From 78fa36a812ac67518f359b163318c30b739fd700 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Oct 2026 22:53:45 +0000 Subject: [PATCH] chore(deps): Bump the go-dependencies group across 1 directory with 29 updates Bumps the go-dependencies group with 29 updates in the / directory: | Package | From | To | | --- | --- | --- | | [github.com/alicebob/miniredis/v2](https://github.com/alicebob/miniredis) | `2.38.0` | `2.40.0` | | [github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2) | `1.43.2` | `1.47.3` | | [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) | `1.32.33` | `1.33.9` | | [github.com/aws/aws-sdk-go-v2/service/dynamodb](https://github.com/aws/aws-sdk-go-v2) | `1.59.1` | `1.70.3` | | [github.com/axiomhq/hyperloglog](https://github.com/axiomhq/hyperloglog) | `0.2.6` | `0.3.0` | | [github.com/dustin/go-humanize](https://github.com/dustin/go-humanize) | `1.0.1` | `1.1.0` | | [github.com/go-openapi/strfmt](https://github.com/go-openapi/strfmt) | `0.27.0` | `0.27.3` | | [github.com/go-openapi/swag/jsonutils](https://github.com/go-openapi/swag) | `0.28.0` | `0.29.2` | | [github.com/golang-migrate/migrate/v4](https://github.com/golang-migrate/migrate) | `4.19.1` | `4.20.1` | | [github.com/hashicorp/consul/api](https://github.com/hashicorp/consul) | `1.34.3` | `1.34.5` | | [github.com/klauspost/compress](https://github.com/klauspost/compress) | `1.19.1` | `1.20.3` | | [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) | `7.2.1` | `7.4.1` | | [github.com/parquet-go/parquet-go](https://github.com/parquet-go/parquet-go) | `0.30.1` | `0.32.0` | | [github.com/prometheus/client_model](https://github.com/prometheus/client_model) | `0.6.2` | `0.6.3` | | [github.com/stretchr/testify](https://github.com/stretchr/testify) | `1.11.1` | `1.12.1` | | [go.opentelemetry.io/collector/pdata](https://github.com/open-telemetry/opentelemetry-collector) | `1.61.0` | `1.69.0` | | [go.opentelemetry.io/contrib/propagators/aws](https://github.com/open-telemetry/opentelemetry-go-contrib) | `1.44.0` | `1.47.0` | | [go.opentelemetry.io/otel](https://github.com/open-telemetry/opentelemetry-go) | `1.45.0` | `1.47.0` | | [go.opentelemetry.io/otel/bridge/opentracing](https://github.com/open-telemetry/opentelemetry-go) | `1.45.0` | `1.47.0` | | [go.opentelemetry.io/otel/exporters/otlp/otlptrace](https://github.com/open-telemetry/opentelemetry-go) | `1.44.0` | `1.47.0` | | [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc](https://github.com/open-telemetry/opentelemetry-go) | `1.44.0` | `1.47.0` | | [go.opentelemetry.io/otel/sdk](https://github.com/open-telemetry/opentelemetry-go) | `1.44.0` | `1.47.0` | | [go.opentelemetry.io/otel/trace](https://github.com/open-telemetry/opentelemetry-go) | `1.45.0` | `1.47.0` | | [go.uber.org/atomic](https://github.com/uber-go/atomic) | `1.11.0` | `1.12.0` | | [golang.org/x/net](https://github.com/golang/net) | `0.58.0` | `0.60.0` | | [golang.org/x/sync](https://github.com/golang/sync) | `0.22.0` | `0.23.0` | | [golang.org/x/time](https://github.com/golang/time) | `0.15.0` | `0.16.0` | | [google.golang.org/grpc](https://github.com/grpc/grpc-go) | `1.83.1` | `1.84.0` | | google.golang.org/protobuf | `1.36.11` | `1.36.12` | Updates `github.com/alicebob/miniredis/v2` from 2.38.0 to 2.40.0 - [Release notes](https://github.com/alicebob/miniredis/releases) - [Changelog](https://github.com/alicebob/miniredis/blob/master/CHANGELOG.md) - [Commits](https://github.com/alicebob/miniredis/compare/v2.38.0...v2.40.0) Updates `github.com/aws/aws-sdk-go-v2` from 1.43.2 to 1.47.3 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.43.2...v1.47.3) Updates `github.com/aws/aws-sdk-go-v2/config` from 1.32.33 to 1.33.9 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.32.33...config/v1.33.9) Updates `github.com/aws/aws-sdk-go-v2/service/dynamodb` from 1.59.1 to 1.70.3 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/ssm/v1.59.1...service/emr/v1.70.3) Updates `github.com/axiomhq/hyperloglog` from 0.2.6 to 0.3.0 - [Release notes](https://github.com/axiomhq/hyperloglog/releases) - [Commits](https://github.com/axiomhq/hyperloglog/compare/v0.2.6...v0.3.0) Updates `github.com/dustin/go-humanize` from 1.0.1 to 1.1.0 - [Commits](https://github.com/dustin/go-humanize/compare/v1.0.1...v1.1.0) Updates `github.com/go-openapi/strfmt` from 0.27.0 to 0.27.3 - [Release notes](https://github.com/go-openapi/strfmt/releases) - [Commits](https://github.com/go-openapi/strfmt/compare/v0.27.0...v0.27.3) Updates `github.com/go-openapi/swag/jsonutils` from 0.28.0 to 0.29.2 - [Release notes](https://github.com/go-openapi/swag/releases) - [Commits](https://github.com/go-openapi/swag/compare/v0.28.0...v0.29.2) Updates `github.com/golang-migrate/migrate/v4` from 4.19.1 to 4.20.1 - [Release notes](https://github.com/golang-migrate/migrate/releases) - [Commits](https://github.com/golang-migrate/migrate/compare/v4.19.1...v4.20.1) Updates `github.com/hashicorp/consul/api` from 1.34.3 to 1.34.5 - [Release notes](https://github.com/hashicorp/consul/releases) - [Changelog](https://github.com/hashicorp/consul/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/consul/compare/api/v1.34.3...api/v1.34.5) Updates `github.com/klauspost/compress` from 1.19.1 to 1.20.3 - [Release notes](https://github.com/klauspost/compress/releases) - [Commits](https://github.com/klauspost/compress/compare/v1.19.1...v1.20.3) Updates `github.com/minio/minio-go/v7` from 7.2.1 to 7.4.1 - [Release notes](https://github.com/minio/minio-go/releases) - [Commits](https://github.com/minio/minio-go/compare/v7.2.1...v7.4.1) Updates `github.com/parquet-go/parquet-go` from 0.30.1 to 0.32.0 - [Release notes](https://github.com/parquet-go/parquet-go/releases) - [Changelog](https://github.com/parquet-go/parquet-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/parquet-go/parquet-go/compare/v0.30.1...v0.32.0) Updates `github.com/prometheus/client_model` from 0.6.2 to 0.6.3 - [Release notes](https://github.com/prometheus/client_model/releases) - [Commits](https://github.com/prometheus/client_model/compare/v0.6.2...v0.6.3) Updates `github.com/stretchr/testify` from 1.11.1 to 1.12.1 - [Release notes](https://github.com/stretchr/testify/releases) - [Commits](https://github.com/stretchr/testify/compare/v1.11.1...v1.12.1) Updates `go.opentelemetry.io/collector/pdata` from 1.61.0 to 1.69.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-collector/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-collector/blob/main/CHANGELOG-API.md) - [Commits](https://github.com/open-telemetry/opentelemetry-collector/compare/pdata/v1.61.0...pdata/v1.69.0) Updates `go.opentelemetry.io/contrib/propagators/aws` from 1.44.0 to 1.47.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-go-contrib/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go-contrib/compare/v1.44.0...v1.47.0) Updates `go.opentelemetry.io/otel` from 1.45.0 to 1.47.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.45.0...v1.47.0) Updates `go.opentelemetry.io/otel/bridge/opentracing` from 1.45.0 to 1.47.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.45.0...v1.47.0) Updates `go.opentelemetry.io/otel/exporters/otlp/otlptrace` from 1.44.0 to 1.47.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.44.0...v1.47.0) Updates `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc` from 1.44.0 to 1.47.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.44.0...v1.47.0) Updates `go.opentelemetry.io/otel/sdk` from 1.44.0 to 1.47.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.44.0...v1.47.0) Updates `go.opentelemetry.io/otel/trace` from 1.45.0 to 1.47.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.45.0...v1.47.0) Updates `go.uber.org/atomic` from 1.11.0 to 1.12.0 - [Release notes](https://github.com/uber-go/atomic/releases) - [Changelog](https://github.com/uber-go/atomic/blob/master/CHANGELOG.md) - [Commits](https://github.com/uber-go/atomic/compare/v1.11.0...v1.12.0) Updates `golang.org/x/net` from 0.58.0 to 0.60.0 - [Commits](https://github.com/golang/net/compare/v0.58.0...v0.60.0) Updates `golang.org/x/sync` from 0.22.0 to 0.23.0 - [Commits](https://github.com/golang/sync/compare/v0.22.0...v0.23.0) Updates `golang.org/x/time` from 0.15.0 to 0.16.0 - [Commits](https://github.com/golang/time/compare/v0.15.0...v0.16.0) Updates `google.golang.org/grpc` from 1.83.1 to 1.84.0 - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.83.1...v1.84.0) Updates `google.golang.org/protobuf` from 1.36.11 to 1.36.12 --- updated-dependencies: - dependency-name: github.com/alicebob/miniredis/v2 dependency-version: 2.39.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2 dependency-version: 1.47.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/config dependency-version: 1.33.5 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/service/dynamodb dependency-version: 1.69.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: github.com/axiomhq/hyperloglog dependency-version: 0.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: github.com/dustin/go-humanize dependency-version: 1.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: github.com/go-openapi/strfmt dependency-version: 0.27.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go-dependencies - dependency-name: github.com/go-openapi/swag/jsonutils dependency-version: 0.29.2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: github.com/golang-migrate/migrate/v4 dependency-version: 4.20.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: github.com/hashicorp/consul/api dependency-version: 1.34.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go-dependencies - dependency-name: github.com/klauspost/compress dependency-version: 1.20.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: github.com/minio/minio-go/v7 dependency-version: 7.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: github.com/parquet-go/parquet-go dependency-version: 0.32.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: github.com/prometheus/client_model dependency-version: 0.6.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go-dependencies - dependency-name: github.com/stretchr/testify dependency-version: 1.12.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: go.opentelemetry.io/collector/pdata dependency-version: 1.67.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: go.opentelemetry.io/contrib/propagators/aws dependency-version: 1.46.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: go.opentelemetry.io/otel dependency-version: 1.46.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: go.opentelemetry.io/otel/bridge/opentracing dependency-version: 1.46.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: go.opentelemetry.io/otel/exporters/otlp/otlptrace dependency-version: 1.46.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc dependency-version: 1.46.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: go.opentelemetry.io/otel/sdk dependency-version: 1.46.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: go.opentelemetry.io/otel/trace dependency-version: 1.46.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: go.uber.org/atomic dependency-version: 1.12.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: golang.org/x/net dependency-version: 0.59.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: golang.org/x/sync dependency-version: 0.23.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: golang.org/x/time dependency-version: 0.16.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: google.golang.org/grpc dependency-version: 1.83.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go-dependencies - dependency-name: google.golang.org/protobuf dependency-version: 1.36.12 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go-dependencies ... Signed-off-by: dependabot[bot] --- go.mod | 166 +- go.sum | 410 +- vendor/cloud.google.com/go/auth/CHANGES.md | 8 + .../go/auth/grpctransport/grpctransport.go | 249 +- .../go/auth/httptransport/transport.go | 315 +- .../go/auth/internal/transport/transport.go | 30 + .../go/auth/internal/version.go | 4 +- .../go/iam/.repo-metadata.json | 10 + vendor/cloud.google.com/go/iam/CHANGES.md | 16 + vendor/cloud.google.com/go/iam/README.md | 19 +- .../go/iam/apiv1/iampb/iam_policy.pb.go | 160 +- .../go/iam/apiv1/iampb/iam_policy_grpc.pb.go | 3 +- .../go/iam/apiv1/iampb/options.pb.go | 49 +- .../go/iam/apiv1/iampb/policy.pb.go | 215 +- .../apiv1/iampb/resource_policy_member.pb.go | 58 +- .../go/internal/.repo-metadata-full.json | 50 +- .../monitoring/apiv3/v2/.repo-metadata.json | 10 + .../apiv3/v2/alert_policy_client.go | 61 +- .../go/monitoring/apiv3/v2/auxiliary.go | 2 +- .../go/monitoring/apiv3/v2/auxiliary_go123.go | 2 +- .../go/monitoring/apiv3/v2/doc.go | 2 +- .../go/monitoring/apiv3/v2/group_client.go | 70 +- .../go/monitoring/apiv3/v2/helpers.go | 2 +- .../go/monitoring/apiv3/v2/metric_client.go | 96 +- .../apiv3/v2/monitoringpb/alert.pb.go | 917 +- .../apiv3/v2/monitoringpb/alert_service.pb.go | 263 +- .../v2/monitoringpb/alert_service_grpc.pb.go | 3 +- .../apiv3/v2/monitoringpb/common.pb.go | 286 +- .../v2/monitoringpb/dropped_labels.pb.go | 65 +- .../apiv3/v2/monitoringpb/group.pb.go | 80 +- .../apiv3/v2/monitoringpb/group_service.pb.go | 357 +- .../v2/monitoringpb/group_service_grpc.pb.go | 3 +- .../apiv3/v2/monitoringpb/metric.pb.go | 330 +- .../v2/monitoringpb/metric_service.pb.go | 683 +- .../v2/monitoringpb/metric_service_grpc.pb.go | 3 +- .../v2/monitoringpb/mutation_record.pb.go | 64 +- .../apiv3/v2/monitoringpb/notification.pb.go | 216 +- .../monitoringpb/notification_service.pb.go | 521 +- .../notification_service_grpc.pb.go | 3 +- .../apiv3/v2/monitoringpb/query_service.pb.go | 65 +- .../v2/monitoringpb/query_service_grpc.pb.go | 3 +- .../apiv3/v2/monitoringpb/service.pb.go | 960 +- .../v2/monitoringpb/service_service.pb.go | 473 +- .../monitoringpb/service_service_grpc.pb.go | 3 +- .../apiv3/v2/monitoringpb/snooze.pb.go | 99 +- .../v2/monitoringpb/snooze_service.pb.go | 212 +- .../v2/monitoringpb/snooze_service_grpc.pb.go | 3 +- .../apiv3/v2/monitoringpb/span_context.pb.go | 55 +- .../apiv3/v2/monitoringpb/uptime.pb.go | 784 +- .../v2/monitoringpb/uptime_service.pb.go | 321 +- .../v2/monitoringpb/uptime_service_grpc.pb.go | 3 +- .../apiv3/v2/notification_channel_client.go | 98 +- .../go/monitoring/apiv3/v2/query_client.go | 33 +- .../apiv3/v2/service_monitoring_client.go | 95 +- .../go/monitoring/apiv3/v2/snooze_client.go | 54 +- .../apiv3/v2/uptime_check_client.go | 67 +- .../go/monitoring/apiv3/v2/version.go | 4 +- .../go/monitoring/internal/version.go | 8 +- .../alicebob/miniredis/v2/CHANGELOG.md | 18 + .../alicebob/miniredis/v2/README.md | 47 + .../alicebob/miniredis/v2/cmd_cluster.go | 16 +- .../alicebob/miniredis/v2/cmd_geo.go | 282 + .../alicebob/miniredis/v2/cmd_hash.go | 337 +- .../alicebob/miniredis/v2/cmd_list.go | 110 + .../alicebob/miniredis/v2/cmd_sorted_set.go | 209 + vendor/github.com/alicebob/miniredis/v2/db.go | 3 + .../alicebob/miniredis/v2/direct.go | 83 + .../alicebob/miniredis/v2/miniredis.go | 105 +- .../alicebob/miniredis/v2/proto/client.go | 8 + .../github.com/alicebob/miniredis/v2/redis.go | 1 + .../alicebob/miniredis/v2/server/proto.go | 3 + .../alicebob/miniredis/v2/server/server.go | 12 + .../aws-sdk-go-v2/aws/go_module_metadata.go | 2 +- .../aws-sdk-go-v2/aws/middleware/metadata.go | 17 +- .../aws/aws-sdk-go-v2/aws/retry/middleware.go | 47 +- .../aws/signer/internal/v4/headers.go | 4 + .../aws/transport/http/client.go | 64 +- .../aws/transport/http/timeouts.go | 54 + .../aws/aws-sdk-go-v2/config/CHANGELOG.md | 76 + .../config/go_module_metadata.go | 2 +- .../aws-sdk-go-v2/credentials/CHANGELOG.md | 76 + .../endpointcreds/internal/client/client.go | 2 - .../internal/client/middleware.go | 10 +- .../credentials/go_module_metadata.go | 2 +- .../feature/ec2/imds/CHANGELOG.md | 65 + .../feature/ec2/imds/go_module_metadata.go | 2 +- .../internal/configsources/CHANGELOG.md | 63 + .../configsources/go_module_metadata.go | 2 +- .../internal/endpoints/v2/CHANGELOG.md | 63 + .../endpoints/v2/go_module_metadata.go | 2 +- .../internal/timeouts/awsinternal.go | 6 + .../internal/timeouts/timeouts.go | 39 + .../internal/timeouts/timeouts_services.go | 102 + .../aws-sdk-go-v2/internal/v4a/CHANGELOG.md | 63 + .../internal/v4a/go_module_metadata.go | 2 +- .../service/dynamodb/CHANGELOG.md | 119 + .../service/dynamodb/api_client.go | 235 +- .../dynamodb/api_op_BatchExecuteStatement.go | 60 +- .../service/dynamodb/api_op_BatchGetItem.go | 62 +- .../service/dynamodb/api_op_BatchWriteItem.go | 80 +- .../service/dynamodb/api_op_CreateBackup.go | 63 +- .../dynamodb/api_op_CreateGlobalTable.go | 61 +- .../service/dynamodb/api_op_CreateTable.go | 134 +- .../service/dynamodb/api_op_DeleteBackup.go | 60 +- .../service/dynamodb/api_op_DeleteItem.go | 96 +- .../dynamodb/api_op_DeleteResourcePolicy.go | 61 +- .../service/dynamodb/api_op_DeleteTable.go | 60 +- .../service/dynamodb/api_op_DescribeBackup.go | 60 +- .../api_op_DescribeContinuousBackups.go | 60 +- .../api_op_DescribeContributorInsights.go | 104 +- .../dynamodb/api_op_DescribeEndpoints.go | 53 +- .../service/dynamodb/api_op_DescribeExport.go | 60 +- .../dynamodb/api_op_DescribeGlobalTable.go | 60 +- .../api_op_DescribeGlobalTableSettings.go | 61 +- .../service/dynamodb/api_op_DescribeImport.go | 60 +- ..._op_DescribeKinesisStreamingDestination.go | 61 +- .../service/dynamodb/api_op_DescribeLimits.go | 74 +- .../service/dynamodb/api_op_DescribeTable.go | 60 +- .../api_op_DescribeTableReplicaAutoScaling.go | 60 +- .../dynamodb/api_op_DescribeTimeToLive.go | 60 +- ...i_op_DisableKinesisStreamingDestination.go | 106 +- ...pi_op_EnableKinesisStreamingDestination.go | 106 +- .../dynamodb/api_op_ExecuteStatement.go | 89 +- .../dynamodb/api_op_ExecuteTransaction.go | 63 +- .../api_op_ExportTableToPointInTime.go | 102 +- .../service/dynamodb/api_op_GetItem.go | 75 +- .../dynamodb/api_op_GetResourcePolicy.go | 64 +- .../service/dynamodb/api_op_ImportTable.go | 81 +- .../service/dynamodb/api_op_ListBackups.go | 76 +- .../api_op_ListContributorInsights.go | 67 +- .../service/dynamodb/api_op_ListExports.go | 67 +- .../dynamodb/api_op_ListGlobalTables.go | 68 +- .../service/dynamodb/api_op_ListImports.go | 67 +- .../service/dynamodb/api_op_ListTables.go | 65 +- .../dynamodb/api_op_ListTagsOfResource.go | 64 +- .../service/dynamodb/api_op_PutItem.go | 108 +- .../dynamodb/api_op_PutResourcePolicy.go | 67 +- .../service/dynamodb/api_op_Query.go | 112 +- .../dynamodb/api_op_RestoreTableFromBackup.go | 90 +- .../api_op_RestoreTableToPointInTime.go | 104 +- .../service/dynamodb/api_op_Scan.go | 111 +- .../service/dynamodb/api_op_SearchVectors.go | 239 + .../service/dynamodb/api_op_TagResource.go | 53 +- .../dynamodb/api_op_TransactGetItems.go | 59 +- .../dynamodb/api_op_TransactWriteItems.go | 68 +- .../service/dynamodb/api_op_UntagResource.go | 53 +- .../api_op_UpdateContinuousBackups.go | 65 +- .../api_op_UpdateContributorInsights.go | 93 +- .../dynamodb/api_op_UpdateGlobalTable.go | 61 +- .../api_op_UpdateGlobalTableSettings.go | 74 +- .../service/dynamodb/api_op_UpdateItem.go | 100 +- ...pi_op_UpdateKinesisStreamingDestination.go | 90 +- .../service/dynamodb/api_op_UpdateTable.go | 113 +- .../api_op_UpdateTableReplicaAutoScaling.go | 67 +- .../dynamodb/api_op_UpdateTimeToLive.go | 65 +- .../service/dynamodb/common_serde.go | 2518 ++ .../service/dynamodb/endpoints.go | 347 +- .../service/dynamodb/generated.json | 10 +- .../service/dynamodb/go_module_metadata.go | 2 +- .../aws-sdk-go-v2/service/dynamodb/options.go | 7 + .../service/dynamodb/schemas/schemas.go | 7250 +++++ .../service/dynamodb/type_registry.go | 155 + .../service/dynamodb/types/common_serde.go | 2517 ++ .../service/dynamodb/types/enums.go | 40 + .../service/dynamodb/types/errors.go | 756 +- .../service/dynamodb/types/types.go | 5698 +++- .../service/dynamodb/validators.go | 266 + .../internal/accept-encoding/CHANGELOG.md | 28 + .../accept-encoding/go_module_metadata.go | 2 +- .../internal/endpoint-discovery/CHANGELOG.md | 81 + .../endpoint-discovery/go_module_metadata.go | 2 +- .../internal/presigned-url/CHANGELOG.md | 64 + .../presigned-url/go_module_metadata.go | 2 +- .../aws-sdk-go-v2/service/signin/CHANGELOG.md | 75 + .../service/signin/api_client.go | 123 +- .../signin/api_op_CreateOAuth2Token.go | 16 - .../signin/api_op_CreateOAuth2TokenWithIAM.go | 16 - ...DeleteConsoleAuthorizationConfiguration.go | 16 - ...pi_op_DeleteResourcePermissionStatement.go | 16 - ...op_GetConsoleAuthorizationConfiguration.go | 16 - .../signin/api_op_GetResourcePolicy.go | 16 - .../api_op_IntrospectOAuth2TokenWithIAM.go | 16 - ...api_op_ListResourcePermissionStatements.go | 16 - ...op_PutConsoleAuthorizationConfiguration.go | 16 - .../api_op_PutResourcePermissionStatement.go | 16 - .../signin/api_op_RevokeOAuth2TokenWithIAM.go | 16 - .../service/signin/deserializers.go | 176 +- .../service/signin/go_module_metadata.go | 2 +- .../aws-sdk-go-v2/service/sso/CHANGELOG.md | 75 + .../aws-sdk-go-v2/service/sso/api_client.go | 123 +- .../service/sso/api_op_GetRoleCredentials.go | 16 - .../service/sso/api_op_ListAccountRoles.go | 16 - .../service/sso/api_op_ListAccounts.go | 16 - .../service/sso/api_op_Logout.go | 16 - .../service/sso/deserializers.go | 64 +- .../service/sso/go_module_metadata.go | 2 +- .../service/ssooidc/CHANGELOG.md | 75 + .../service/ssooidc/api_client.go | 123 +- .../service/ssooidc/api_op_CreateToken.go | 16 - .../ssooidc/api_op_CreateTokenWithIAM.go | 16 - .../service/ssooidc/api_op_RegisterClient.go | 16 - .../api_op_StartDeviceAuthorization.go | 16 - .../service/ssooidc/deserializers.go | 64 +- .../service/ssooidc/go_module_metadata.go | 2 +- .../aws-sdk-go-v2/service/sts/CHANGELOG.md | 79 + .../aws-sdk-go-v2/service/sts/api_client.go | 126 +- .../service/sts/api_op_AssumeRole.go | 32 +- .../service/sts/api_op_AssumeRoleWithSAML.go | 32 +- .../sts/api_op_AssumeRoleWithWebIdentity.go | 32 +- .../service/sts/api_op_AssumeRoot.go | 30 +- .../sts/api_op_DecodeAuthorizationMessage.go | 16 - .../service/sts/api_op_GetAccessKeyInfo.go | 16 - .../service/sts/api_op_GetCallerIdentity.go | 16 - .../sts/api_op_GetDelegatedAccessToken.go | 18 +- .../service/sts/api_op_GetFederationToken.go | 32 +- .../service/sts/api_op_GetSessionToken.go | 30 +- .../service/sts/api_op_GetWebIdentityToken.go | 18 +- .../service/sts/deserializers.go | 380 +- .../aws/aws-sdk-go-v2/service/sts/doc.go | 27 +- .../service/sts/go_module_metadata.go | 2 +- .../aws-sdk-go-v2/service/sts/serializers.go | 30 + vendor/github.com/aws/smithy-go/CHANGELOG.md | 109 + vendor/github.com/aws/smithy-go/Makefile | 2 +- vendor/github.com/aws/smithy-go/README.md | 224 +- .../document/internal/serde/field.go | 293 + .../document/internal/serde/field_cache.go | 48 + .../document/internal/serde/reflect.go | 24 + .../document/internal/serde/serde.go | 100 + .../smithy-go/document/internal/serde/tags.go | 38 + .../aws/smithy-go/document/json/decoder.go | 349 + .../aws/smithy-go/document/json/doc.go | 8 + .../aws/smithy-go/document/json/encoder.go | 352 + .../aws/smithy-go/document/json/json.go | 27 + .../aws/smithy-go/eventstream/debug.go | 2 +- .../aws/smithy-go/eventstream/header.go | 2 +- .../aws/smithy-go/go_module_metadata.go | 2 +- .../aws/smithy-go/internal/errors/errors.go | 56 + .../smithy-go/internal/eventstream/codec.go | 244 + .../internal/eventstream/no_event_stream.go | 36 + .../internal/eventstream/require_http2.go | 12 + .../internal/serde/read_payload_blob.go | 34 + .../aws/smithy-go/internal/serde/stack.go | 53 + .../smithy-go/internal/serde/string_arena.go | 66 + .../smithy-go/internal/sync/buffer_pool.go | 52 + .../aws/smithy-go/prelude/prelude.go | 31 + vendor/github.com/aws/smithy-go/schema.go | 36 +- vendor/github.com/aws/smithy-go/schema_ext.go | 11 +- .../github.com/aws/smithy-go/traits/traits.go | 8 + .../smithy-go/transport/http/eventstream.go | 12 +- .../aws/smithy-go/transport/http/host.go | 18 +- .../http/middleware_close_response_body.go | 33 +- .../http/middleware_content_length.go | 3 + .../http/protocol/awsjson/awsjson.go | 265 + .../http/protocol/internal/json/error.go | 76 + .../http/protocol/internal/json/ext.go | 62 + .../internal/json/internal/stdlib/LICENSE | 27 + .../internal/json/internal/stdlib/stdlib.go | 145 + .../http/protocol/internal/json/parser.go | 466 + .../http/protocol/internal/json/scanner.go | 1 + .../internal/json/shape_deserializer.go | 881 + .../internal/json/shape_serializer.go | 562 + .../http/protocol/internal/json/stack.go | 38 + .../aws/smithy-go/transport/http/request.go | 9 + .../github.com/aws/smithy-go/waiter/logger.go | 4 +- .../github.com/axiomhq/hyperloglog/.gitignore | 5 +- .../hyperloglog/.golangci-lint-version | 1 + .../axiomhq/hyperloglog/.golangci.yml | 25 + .../axiomhq/hyperloglog/.goreleaser.yaml | 19 + .../axiomhq/hyperloglog/Contributing.md | 24 +- .../github.com/axiomhq/hyperloglog/Makefile | 42 + .../github.com/axiomhq/hyperloglog/README.md | 24 +- vendor/github.com/axiomhq/hyperloglog/beta.go | 53 +- .../axiomhq/hyperloglog/compressed.go | 100 +- .../axiomhq/hyperloglog/hyperloglog.go | 305 +- .../github.com/axiomhq/hyperloglog/sparse.go | 16 + .../github.com/axiomhq/hyperloglog/utils.go | 4 +- vendor/github.com/dustin/go-humanize/.envrc | 4 + .../github.com/dustin/go-humanize/.gitignore | 1 + .../dustin/go-humanize/README.markdown | 5 +- .../github.com/dustin/go-humanize/SECURITY.md | 5 + vendor/github.com/dustin/go-humanize/bytes.go | 82 +- vendor/github.com/dustin/go-humanize/comma.go | 93 +- .../github.com/dustin/go-humanize/commaf.go | 7 + .../github.com/dustin/go-humanize/flake.lock | 58 + .../github.com/dustin/go-humanize/flake.nix | 15 + vendor/github.com/dustin/go-humanize/ftoa.go | 2 +- .../github.com/dustin/go-humanize/number.go | 9 +- .../github.com/dustin/go-humanize/shell.nix | 11 + vendor/github.com/dustin/go-humanize/si.go | 44 +- vendor/github.com/dustin/go-humanize/times.go | 10 +- .../filters/http/ext_proc/v3/ext_proc.pb.go | 1214 + .../http/ext_proc/v3/ext_proc.pb.validate.go | 1616 ++ .../http/ext_proc/v3/ext_proc_vtproto.pb.go | 1194 + .../http/ext_proc/v3/processing_mode.pb.go | 366 + .../v3/processing_mode.pb.validate.go | 203 + .../ext_proc/v3/processing_mode_vtproto.pb.go | 110 + .../ext_proc/v3/external_processor.pb.go | 1898 ++ .../v3/external_processor.pb.validate.go | 3131 ++ .../ext_proc/v3/external_processor_grpc.pb.go | 147 + .../v3/external_processor_vtproto.pb.go | 2269 ++ .../felixge/httpsnoop/capture_metrics.go | 37 +- .../felixge/httpsnoop/wrap_generated.go | 16179 +++++++++++ .../go-openapi/errors/CONTRIBUTORS.md | 4 +- vendor/github.com/go-openapi/errors/README.md | 20 +- .../go-openapi/strfmt/.golangci.yml | 1 + .../go-openapi/strfmt/CONTRIBUTORS.md | 4 +- vendor/github.com/go-openapi/strfmt/README.md | 4 +- .../github.com/go-openapi/strfmt/default.go | 3 +- .../github.com/go-openapi/strfmt/duration.go | 6 + vendor/github.com/go-openapi/strfmt/format.go | 6 +- vendor/github.com/go-openapi/strfmt/go.work | 2 +- .../jsonutils/adapters/stdlib/json/options.go | 5 + vendor/github.com/gofrs/flock/.golangci.yml | 4 +- vendor/github.com/gofrs/flock/flock.go | 4 +- vendor/github.com/gofrs/flock/flock_others.go | 2 +- vendor/github.com/gofrs/flock/flock_unix.go | 2 +- .../gofrs/flock/flock_unix_fcntl.go | 2 +- .../github.com/gofrs/flock/flock_windows.go | 2 +- vendor/github.com/gofrs/flock/zizmor.yml | 3 + .../golang-migrate/migrate/v4/.golangci.yml | 47 +- .../golang-migrate/migrate/v4/.goreleaser.yml | 7 + .../golang-migrate/migrate/v4/Dockerfile | 7 +- .../migrate/v4/Dockerfile.github-actions | 5 +- .../golang-migrate/migrate/v4/README.md | 2 +- .../migrate/v4/database/postgres/postgres.go | 6 +- .../migrate/v4/source/iofs/iofs.go | 2 +- .../migrate/v4/source/migration.go | 12 +- .../client/client.go | 4 +- .../client/util/util.go | 2 +- .../googleapis/gax-go/v2/CHANGES.md | 37 + .../googleapis/gax-go/v2/apierror/apierror.go | 11 + .../internal/proto/custom_error.pb.go | 84 +- .../v2/apierror/internal/proto/error.pb.go | 156 +- .../googleapis/gax-go/v2/call_option.go | 20 + .../googleapis/gax-go/v2/callctx/callctx.go | 46 + .../googleapis/gax-go/v2/content_type.go | 4 +- .../googleapis/gax-go/v2/feature.go | 8 +- .../googleapis/gax-go/v2/internal/version.go | 2 +- .../github.com/googleapis/gax-go/v2/invoke.go | 20 +- .../googleapis/gax-go/v2/telemetry.go | 469 + .../github.com/hashicorp/consul/api/agent.go | 80 + .../hashicorp/consul/api/config_entry.go | 7 + .../consul/api/config_entry_gateways.go | 45 +- .../consul/api/config_entry_routes.go | 53 +- .../consul/api/operator_feature_gate.go | 104 + .../hashicorp/go-metrics/compat/armon.go | 131 + .../hashicorp/go-metrics/compat/hashicorp.go | 131 + vendor/github.com/hashicorp/serf/LICENSE | 2 + .../hashicorp/serf/coordinate/client.go | 7 +- .../hashicorp/serf/coordinate/config.go | 23 +- .../hashicorp/serf/coordinate/coordinate.go | 13 +- .../hashicorp/serf/coordinate/phantom.go | 30 +- .../github.com/klauspost/compress/.gitignore | 3 + .../github.com/klauspost/compress/AGENTS.md | 104 + .../github.com/klauspost/compress/README.md | 55 +- .../klauspost/compress/flate/deflate.go | 36 +- .../klauspost/compress/flate/fast_encoder.go | 3 +- .../compress/flate/huffman_bit_writer.go | 224 +- .../klauspost/compress/flate/huffman_code.go | 138 +- .../klauspost/compress/flate/inflate.go | 12 +- .../klauspost/compress/flate/inflate_gen.go | 142 +- .../compress/flate/matchlen_generic.go | 13 +- .../klauspost/compress/flate/token.go | 18 +- .../klauspost/compress/fse/compress.go | 3 +- .../klauspost/compress/fse/decompress.go | 6 + .../klauspost/compress/gzhttp/compress.go | 62 +- .../klauspost/compress/gzhttp/transport.go | 1 + .../klauspost/compress/huff0/bitreader.go | 63 + .../klauspost/compress/huff0/bitwriter.go | 93 +- .../klauspost/compress/huff0/compress.go | 31 +- .../klauspost/compress/huff0/decompress.go | 49 +- .../compress/huff0/decompress_amd64.go | 276 +- .../compress/huff0/decompress_amd64.s | 4118 ++- .../compress/huff0/decompress_arm64.go | 72 + .../compress/huff0/decompress_arm64.s | 1663 ++ .../compress/huff0/decompress_asm.go | 253 + .../compress/huff0/decompress_generic.go | 2 +- .../internal/cpuinfo/cpuinfo_amd64.go | 2 +- .../compress/internal/cpuinfo/cpuinfo_amd64.s | 4 +- .../compress/internal/le/unsafe_disabled.go | 2 +- .../compress/internal/le/unsafe_enabled.go | 2 +- .../compress/internal/regmask/regmask.go | 50 + .../compress/internal/regmask/regmask_386.go | 39 + .../klauspost/compress/s2/decode_amd64.s | 4 +- .../klauspost/compress/s2/decode_arm64.s | 4 +- .../klauspost/compress/s2/decode_asm.go | 6 +- .../klauspost/compress/s2/decode_other.go | 2 +- .../klauspost/compress/s2/encode_asm.go | 316 + .../klauspost/compress/s2/encode_better.go | 8 +- .../klauspost/compress/s2/encode_go.go | 4 +- .../klauspost/compress/s2/encodeblock_amd64.s | 1680 +- .../klauspost/compress/s2/encodeblock_arm64.s | 23576 ++++++++++++++++ .../klauspost/compress/s2/encodeblock_asm.go | 228 + .../github.com/klauspost/compress/s2/index.go | 13 +- .../klauspost/compress/s2/lz4convert.go | 21 +- .../klauspost/compress/s2/lz4sconvert.go | 16 +- .../klauspost/compress/s2/reader.go | 9 +- .../klauspost/compress/s2/writer.go | 8 +- .../klauspost/compress/zstd/bitwriter.go | 39 + .../klauspost/compress/zstd/blockdec.go | 71 +- .../klauspost/compress/zstd/blockenc.go | 177 +- .../klauspost/compress/zstd/decoder.go | 155 +- .../klauspost/compress/zstd/dict.go | 99 +- .../klauspost/compress/zstd/enc_base.go | 1 + .../klauspost/compress/zstd/enc_better.go | 90 +- .../klauspost/compress/zstd/enc_dfast.go | 67 +- .../klauspost/compress/zstd/framedec.go | 38 +- .../klauspost/compress/zstd/fse_decoder.go | 76 +- .../compress/zstd/fse_decoder_amd64.s | 110 +- .../compress/zstd/fse_decoder_arm64.s | 135 +- .../compress/zstd/fse_decoder_asm.go | 8 +- .../compress/zstd/fse_decoder_generic.go | 9 +- .../klauspost/compress/zstd/fse_predefined.go | 18 +- .../klauspost/compress/zstd/hash.go | 22 + .../klauspost/compress/zstd/history.go | 89 +- .../compress/zstd/internal/xxhash/xxhash.go | 12 + .../zstd/internal/xxhash/xxhash_amd64.s | 12 +- .../zstd/internal/xxhash/xxhash_arm64.s | 12 +- .../zstd/internal/xxhash/xxhash_asm.go | 7 +- .../zstd/internal/xxhash/xxhash_other.go | 2 +- .../klauspost/compress/zstd/matchlen_amd64.go | 2 +- .../klauspost/compress/zstd/matchlen_amd64.s | 2 +- .../compress/zstd/matchlen_generic.go | 2 +- .../klauspost/compress/zstd/seqdec.go | 64 +- .../klauspost/compress/zstd/seqdec_amd64.go | 12 +- .../klauspost/compress/zstd/seqdec_amd64.s | 2701 +- .../klauspost/compress/zstd/seqdec_arm64.go | 13 +- .../klauspost/compress/zstd/seqdec_arm64.s | 2512 +- .../klauspost/compress/zstd/seqdec_asm.go | 65 +- .../klauspost/compress/zstd/seqdec_generic.go | 9 +- .../klauspost/compress/zstd/seqenc.go | 47 + .../klauspost/compress/zstd/simple.go | 54 + .../klauspost/compress/zstd/snappy.go | 12 + .../klauspost/cpuid/v2/.goreleaser.yml | 2 +- .../github.com/klauspost/cpuid/v2/README.md | 76 +- vendor/github.com/klauspost/cpuid/v2/cpuid.go | 317 +- .../klauspost/cpuid/v2/detect_arm64.go | 9 +- .../klauspost/cpuid/v2/detect_ref.go | 3 +- .../klauspost/cpuid/v2/detect_ref_arm64.go | 19 + .../klauspost/cpuid/v2/detect_riscv64.go | 16 + .../klauspost/cpuid/v2/detect_x86.go | 5 +- .../klauspost/cpuid/v2/featureid_string.go | 506 +- .../klauspost/cpuid/v2/os_darwin_arm64.go | 13 + .../klauspost/cpuid/v2/os_linux_arm64.go | 88 +- .../klauspost/cpuid/v2/os_linux_riscv64.go | 225 + .../klauspost/cpuid/v2/os_other_arm64.go | 1 - .../klauspost/cpuid/v2/os_other_riscv64.go | 14 + .../klauspost/cpuid/v2/os_safe_linux_arm64.go | 1 - .../cpuid/v2/os_unsafe_linux_arm64.go | 1 - .../klauspost/cpuid/v2/riscv_isa.go | 93 + .../mattn/go-colorable/colorable_windows.go | 26 +- .../mattn/go-isatty/isatty_others.go | 4 +- .../mattn/go-isatty/isatty_windows.go | 15 +- .../github.com/minio/minio-go/v7/.gitignore | 1 + vendor/github.com/minio/minio-go/v7/README.md | 2 +- .../minio/minio-go/v7/api-append-object.go | 4 +- .../minio/minio-go/v7/api-bucket-policy.go | 32 +- .../minio/minio-go/v7/api-compose-object.go | 192 +- .../minio/minio-go/v7/api-copy-object.go | 28 +- .../minio/minio-go/v7/api-datatypes.go | 41 +- .../minio/minio-go/v7/api-error-response.go | 28 + .../minio/minio-go/v7/api-get-object-file.go | 24 +- .../minio-go/v7/api-get-object-parallel.go | 139 + .../minio/minio-go/v7/api-get-object.go | 232 +- .../minio/minio-go/v7/api-get-options.go | 19 +- .../github.com/minio/minio-go/v7/api-list.go | 166 +- .../minio/minio-go/v7/api-object-retention.go | 3 +- .../minio/minio-go/v7/api-presigned.go | 2 +- .../minio-go/v7/api-put-object-common.go | 104 +- .../minio-go/v7/api-put-object-fan-out.go | 2 + .../minio-go/v7/api-put-object-multipart.go | 43 +- .../minio-go/v7/api-put-object-streaming.go | 52 +- .../minio/minio-go/v7/api-put-object.go | 47 +- .../minio/minio-go/v7/api-remove.go | 9 + .../minio/minio-go/v7/api-s3-datatypes.go | 41 +- .../github.com/minio/minio-go/v7/api-stat.go | 49 +- vendor/github.com/minio/minio-go/v7/api.go | 194 +- .../minio/minio-go/v7/bucket-cache.go | 57 +- .../github.com/minio/minio-go/v7/checksum.go | 130 + .../github.com/minio/minio-go/v7/constants.go | 28 +- vendor/github.com/minio/minio-go/v7/core.go | 2 +- .../minio/minio-go/v7/create-session.go | 27 +- .../github.com/minio/minio-go/v7/endpoints.go | 110 +- .../minio/minio-go/v7/functional_tests.go | 838 +- .../minio/minio-go/v7/hook-reader.go | 44 +- .../v7/pkg/credentials/assume_role.go | 15 +- .../v7/pkg/credentials/credentials-sso.sample | 57 + .../v7/pkg/credentials/credentials.go | 16 + .../pkg/credentials/file_aws_credentials.go | 452 +- .../minio-go/v7/pkg/credentials/iam_aws.go | 67 +- .../v7/pkg/credentials/sts_client_grants.go | 7 +- .../v7/pkg/credentials/sts_custom_identity.go | 2 +- .../v7/pkg/credentials/sts_ldap_identity.go | 2 +- .../v7/pkg/credentials/sts_tls_identity.go | 2 +- .../v7/pkg/credentials/sts_web_identity.go | 40 +- .../minio-go/v7/pkg/lifecycle/lifecycle.go | 100 +- .../v7/pkg/policy/bucket-policy-condition.go | 114 + .../minio-go/v7/pkg/policy/bucket-policy.go | 680 + .../minio/minio-go/v7/pkg/s3utils/utils.go | 34 +- ...st-signature-streaming-unsigned-trailer.go | 6 +- .../pkg/signer/request-signature-streaming.go | 9 +- .../v7/pkg/signer/request-signature-v4.go | 4 +- .../minio/minio-go/v7/pkg/signer/utils.go | 25 + .../v7/pkg/singleflight/singleflight.go | 8 +- vendor/github.com/minio/minio-go/v7/rdma.go | 52 +- .../minio/minio-go/v7/rdma_callback.go | 101 + .../minio/minio-go/v7/rdma_stream.go | 108 + .../github.com/minio/minio-go/v7/rdma_stub.go | 7 + .../github.com/minio/minio-go/v7/rdma_tls.go | 37 + .../github.com/minio/minio-go/v7/s3-error.go | 1 + .../minio/minio-go/v7/upload-limits.go | 145 + vendor/github.com/minio/minio-go/v7/utils.go | 72 +- .../github.com/parquet-go/parquet-go/bloom.go | 36 +- .../parquet-go/parquet-go/buffer.go | 9 + .../parquet-go/parquet-go/buffer_pool.go | 6 +- .../parquet-go/parquet-go/column.go | 305 +- .../parquet-go/column_buffer_geometry.go | 6 +- .../parquet-go/column_buffer_json.go | 21 +- .../parquet-go/column_buffer_proto.go | 10 +- .../parquet-go/column_buffer_reflect.go | 56 +- .../parquet-go/column_buffer_variant.go | 190 +- .../parquet-go/column_buffer_write.go | 78 +- .../parquet-go/parquet-go/compare.go | 163 +- .../parquet-go/parquet-go/config.go | 1 + .../parquet-go/parquet-go/convert.go | 109 +- .../parquet-go/parquet-go/convert_variant.go | 235 + .../parquet-go/parquet-go/encoding/rle/rle.go | 9 + .../parquet-go/encoding/thrift/binary.go | 19 +- .../parquet-go/encoding/thrift/compact.go | 19 +- .../parquet-go/encoding/thrift/debug.go | 10 + .../parquet-go/encoding/thrift/decode.go | 213 +- .../parquet-go/encoding/thrift/encode.go | 40 +- .../parquet-go/encoding/thrift/list.go | 2 +- .../parquet-go/encoding/thrift/protocol.go | 20 +- .../parquet-go/encoding/thrift/struct.go | 26 +- .../parquet-go/encoding/thrift/thrift.go | 4 + .../parquet-go/encoding/thrift/union.go | 322 + .../parquet-go/parquet-go/errors.go | 2 +- .../github.com/parquet-go/parquet-go/file.go | 155 +- .../parquet-go/parquet-go/format/footer.go | 63 + .../parquet-go/parquet-go/format/parquet.go | 332 +- .../parquet-go/parquet-go/format/reset.go | 124 + .../parquet-go/parquet-go/limits.go | 59 +- .../github.com/parquet-go/parquet-go/merge.go | 518 +- .../parquet-go/parquet-go/merge_refine.go | 365 + .../parquet-go/parquet-go/multi_row_group.go | 19 +- .../github.com/parquet-go/parquet-go/node.go | 6 +- .../parquet-go/parquet-go/page_be128.go | 31 + .../parquet-go/page_bounds_amd64.go | 19 +- .../parquet-go/parquet-go/page_bounds_amd64.s | 73 + .../parquet-go/parquet-go/reader.go | 17 + .../github.com/parquet-go/parquet-go/row.go | 10 +- .../parquet-go/parquet-go/row_range.go | 176 + .../parquet-go/parquet-go/row_variant.go | 806 +- .../parquet-go/parquet-go/schema.go | 46 +- .../parquet-go/parquet-go/sorting.go | 15 +- .../github.com/parquet-go/parquet-go/type.go | 28 +- .../parquet-go/parquet-go/type_bson.go | 2 +- .../parquet-go/parquet-go/type_date.go | 2 +- .../parquet-go/parquet-go/type_decimal.go | 18 +- .../parquet-go/parquet-go/type_enum.go | 2 +- .../parquet-go/parquet-go/type_geography.go | 21 +- .../parquet-go/parquet-go/type_geometry.go | 10 +- .../parquet-go/parquet-go/type_int32.go | 2 +- .../parquet-go/parquet-go/type_int64.go | 2 +- .../parquet-go/parquet-go/type_int_logical.go | 42 +- .../parquet-go/parquet-go/type_json.go | 2 +- .../parquet-go/parquet-go/type_list.go | 2 +- .../parquet-go/parquet-go/type_map.go | 2 +- .../parquet-go/parquet-go/type_null.go | 2 +- .../parquet-go/parquet-go/type_string.go | 4 +- .../parquet-go/parquet-go/type_time.go | 100 +- .../parquet-go/parquet-go/type_timestamp.go | 98 +- .../parquet-go/parquet-go/type_uuid.go | 2 +- .../parquet-go/parquet-go/type_variant.go | 88 +- .../github.com/parquet-go/parquet-go/value.go | 118 +- .../parquet-go/parquet-go/variant/builder.go | 636 + .../parquet-go/parquet-go/variant/decoding.go | 127 +- .../parquet-go/parquet-go/variant/encoding.go | 744 +- .../parquet-go/parquet-go/variant/loc.go | 50 + .../parquet-go/parquet-go/variant/marshal.go | 59 +- .../parquet-go/parquet-go/variant/metadata.go | 187 +- .../parquet-go/parquet-go/variant/types.go | 43 +- .../parquet-go/parquet-go/variant/value.go | 46 +- .../parquet-go/variant_column_reader.go | 1588 ++ .../parquet-go/variant_column_writer.go | 844 + .../parquet-go/variant_shredded_read.go | 562 + .../parquet-go/variant_shredded_write.go | 367 + .../parquet-go/parquet-go/writer.go | 203 +- .../parquet-go/parquet-go/writer_copy.go | 426 + .../parquet-go/parquet-go/writer_reencode.go | 233 + .../github.com/sirupsen/logrus/.golangci.yml | 48 +- .../github.com/sirupsen/logrus/CHANGELOG.md | 246 +- vendor/github.com/sirupsen/logrus/README.md | 92 +- vendor/github.com/sirupsen/logrus/alt_exit.go | 4 +- .../github.com/sirupsen/logrus/buffer_pool.go | 22 +- vendor/github.com/sirupsen/logrus/doc.go | 26 +- vendor/github.com/sirupsen/logrus/entry.go | 412 +- vendor/github.com/sirupsen/logrus/exported.go | 169 +- .../github.com/sirupsen/logrus/formatter.go | 47 +- .../sirupsen/logrus/json_formatter.go | 37 +- vendor/github.com/sirupsen/logrus/level.go | 101 + vendor/github.com/sirupsen/logrus/logger.go | 156 +- vendor/github.com/sirupsen/logrus/logrus.go | 211 +- .../logrus/terminal_check_appengine.go | 8 +- .../sirupsen/logrus/terminal_check_bsd.go | 3 +- .../logrus/terminal_check_no_terminal.go | 8 +- .../logrus/terminal_check_notappengine.go | 8 +- .../sirupsen/logrus/terminal_check_solaris.go | 2 + .../sirupsen/logrus/terminal_check_unix.go | 5 +- .../sirupsen/logrus/terminal_check_windows.go | 2 +- .../sirupsen/logrus/text_formatter.go | 489 +- vendor/github.com/sirupsen/logrus/writer.go | 6 +- .../go-spiffe/v2/bundle/jwtbundle/bundle.go | 2 +- .../v2/exp/bundle/witbundle/bundle.go | 5 +- vendor/github.com/stretchr/objx/README.md | 49 +- .../testify/assert/assertion_format.go | 28 +- .../testify/assert/assertion_forward.go | 52 +- .../testify/assert/assertion_order.go | 14 +- .../stretchr/testify/assert/assertions.go | 147 +- .../github.com/stretchr/testify/assert/doc.go | 4 +- .../testify/assert/yaml/yaml_custom.go | 2 +- .../testify/assert/yaml/yaml_default.go | 6 +- .../stretchr/testify/assert/yaml/yaml_fail.go | 2 +- .../stretchr/testify/internal/difflib/LICENSE | 27 + .../testify/internal/difflib/difflib.go | 592 + .../stretchr/testify/internal/spew/LICENSE | 15 + .../stretchr/testify/internal/spew/README.md | 12 + .../stretchr/testify/internal/spew/bypass.go | 146 + .../testify/internal/spew/bypasssafe.go | 39 + .../stretchr/testify/internal/spew/common.go | 341 + .../stretchr/testify/internal/spew/config.go | 306 + .../stretchr/testify/internal/spew/doc.go | 217 + .../stretchr/testify/internal/spew/dump.go | 509 + .../stretchr/testify/internal/spew/format.go | 419 + .../stretchr/testify/internal/spew/spew.go | 148 + .../github.com/stretchr/testify/mock/mock.go | 43 +- .../stretchr/testify/require/doc.go | 6 +- .../stretchr/testify/require/require.go | 102 +- .../stretchr/testify/require/require.go.tmpl | 2 +- .../testify/require/require_forward.go | 100 +- .../testify/require/require_forward.go.tmpl | 2 +- .../stretchr/testify/require/requirements.go | 8 +- vendor/github.com/tinylib/msgp/msgp/json.go | 28 +- .../tinylib/msgp/msgp/json_bytes.go | 21 + vendor/github.com/tinylib/msgp/msgp/read.go | 60 + .../collector/featuregate/flag.go | 5 + .../collector/featuregate/registry.go | 6 +- .../internal/generated_proto_anyvalue.go | 2 +- .../internal/generated_proto_exemplar.go | 2 +- ...ted_proto_exponentialhistogramdatapoint.go | 10 +- ...to_exponentialhistogramdatapointbuckets.go | 2 +- ...enerated_proto_exportlogspartialsuccess.go | 2 +- ...rated_proto_exportmetricspartialsuccess.go | 2 +- ...ated_proto_exportprofilespartialsuccess.go | 2 +- ...nerated_proto_exporttracepartialsuccess.go | 2 +- .../generated_proto_histogramdatapoint.go | 8 +- .../pdata/internal/generated_proto_ipaddr.go | 2 +- .../internal/generated_proto_keyvalue.go | 2 +- .../generated_proto_keyvalueandunit.go | 2 +- .../internal/generated_proto_location.go | 4 +- .../internal/generated_proto_logrecord.go | 8 +- .../pdata/internal/generated_proto_mapping.go | 2 +- .../generated_proto_numberdatapoint.go | 4 +- .../pdata/internal/generated_proto_profile.go | 12 +- .../generated_proto_requestcontext.go | 2 +- .../internal/generated_proto_resource.go | 2 +- .../generated_proto_resourceprofiles.go | 2 +- .../pdata/internal/generated_proto_sample.go | 4 +- .../internal/generated_proto_scopelogs.go | 4 +- .../internal/generated_proto_scopemetrics.go | 4 +- .../internal/generated_proto_scopeprofiles.go | 4 +- .../internal/generated_proto_scopespans.go | 4 +- .../pdata/internal/generated_proto_span.go | 18 +- .../internal/generated_proto_spancontext.go | 4 +- .../internal/generated_proto_spanevent.go | 2 +- .../internal/generated_proto_spanlink.go | 4 +- .../generated_proto_summarydatapoint.go | 2 +- .../pdata/internal/generated_proto_tcpaddr.go | 2 +- .../pdata/internal/generated_proto_udpaddr.go | 2 +- .../collector/pdata/internal/json/stream.go | 16 +- .../internal/otelgrpc/profiles_service.go | 7 + .../internal/otlp/profiles_dictionary.go | 188 + .../pdata/internal/otlp/profiles_version.go | 31 + .../collector/pdata/internal/profileid.go | 2 +- .../collector/pdata/internal/spanid.go | 2 +- .../collector/pdata/internal/traceid.go | 2 +- .../collector/pdata/pcommon/map.go | 3 +- .../google.golang.org/grpc/otelgrpc/LICENSE | 30 + .../google.golang.org/grpc/otelgrpc/config.go | 237 +- .../google.golang.org/grpc/otelgrpc/doc.go | 2 +- .../grpc/otelgrpc/interceptor.go | 347 +- .../grpc/otelgrpc/interceptorinfo.go | 2 +- .../grpc/otelgrpc/internal/parse.go | 40 +- .../grpc/otelgrpc/metadata_supplier.go | 53 +- .../grpc/otelgrpc/stats_handler.go | 467 +- .../grpc/otelgrpc/version.go | 7 +- .../net/http/otelhttp/common.go | 2 +- .../net/http/otelhttp/config.go | 2 +- .../instrumentation/net/http/otelhttp/doc.go | 2 +- .../net/http/otelhttp/handler.go | 2 +- .../otelhttp/internal/request/body_wrapper.go | 8 +- .../net/http/otelhttp/internal/request/gen.go | 2 +- .../internal/request/resp_writer_wrapper.go | 8 +- .../http/otelhttp/internal/semconv/client.go | 70 +- .../net/http/otelhttp/internal/semconv/gen.go | 2 +- .../http/otelhttp/internal/semconv/server.go | 42 +- .../http/otelhttp/internal/semconv/util.go | 24 +- .../net/http/otelhttp/labeler.go | 2 +- .../net/http/otelhttp/start_time_context.go | 2 +- .../net/http/otelhttp/transport.go | 23 +- .../net/http/otelhttp/version.go | 4 +- .../propagators/aws/xray/idgenerator.go | 44 +- .../propagators/aws/xray/propagator.go | 2 +- vendor/go.opentelemetry.io/otel/.golangci.yml | 15 +- vendor/go.opentelemetry.io/otel/CHANGELOG.md | 121 +- vendor/go.opentelemetry.io/otel/CODEOWNERS | 2 +- .../go.opentelemetry.io/otel/CONTRIBUTING.md | 20 +- vendor/go.opentelemetry.io/otel/Makefile | 30 +- vendor/go.opentelemetry.io/otel/README.md | 28 +- vendor/go.opentelemetry.io/otel/VERSIONING.md | 6 + .../otel/attribute/hash.go | 70 +- .../otel/attribute/internal/xxhash/xxhash.go | 8 + .../go.opentelemetry.io/otel/attribute/kv.go | 10 + .../go.opentelemetry.io/otel/attribute/set.go | 18 + .../otel/baggage/baggage.go | 235 +- .../otel/bridge/opentracing/bridge.go | 40 +- .../go.opentelemetry.io/otel/codes/codes.go | 2 +- .../otel/dependencies.Dockerfile | 2 +- .../otel/exporters/otlp/otlptrace/clients.go | 2 +- .../otel/exporters/otlp/otlptrace/doc.go | 2 +- .../otel/exporters/otlp/otlptrace/exporter.go | 6 +- .../internal/tracetransform/attribute.go | 8 +- .../tracetransform/instrumentation.go | 4 +- .../internal/tracetransform/resource.go | 2 +- .../otlptrace/internal/tracetransform/span.go | 26 +- .../otlp/otlptrace/otlptracegrpc/client.go | 10 +- .../otlp/otlptrace/otlptracegrpc/doc.go | 7 +- .../otlp/otlptrace/otlptracegrpc/exporter.go | 2 +- .../otlptracegrpc/internal/counter/counter.go | 8 +- .../internal/envconfig/envconfig.go | 10 +- .../otlptrace/otlptracegrpc/internal/gen.go | 10 +- .../otlptracegrpc/internal/observ/doc.go | 2 +- .../internal/observ/instrumentation.go | 6 +- .../otlptracegrpc/internal/observ/target.go | 31 +- .../internal/otlpconfig/envconfig.go | 95 +- .../internal/otlpconfig/options.go | 85 +- .../internal/otlpconfig/optiontypes.go | 20 +- .../otlptracegrpc/internal/otlpconfig/tls.go | 8 +- .../otlptracegrpc/internal/partialsuccess.go | 10 +- .../otlptracegrpc/internal/retry/retry.go | 58 +- .../otlptracegrpc/internal/version.go | 4 +- .../otlptracegrpc/internal/x/observ.go | 2 +- .../otlptrace/otlptracegrpc/internal/x/x.go | 12 +- .../otlp/otlptrace/otlptracegrpc/options.go | 11 +- .../otel/exporters/otlp/otlptrace/version.go | 4 +- .../otel/internal/baggage/baggage.go | 29 +- .../internal/errorhandler/errorhandler.go | 5 + .../otel/internal/global/logger.go | 96 + .../otel/internal/global/state.go | 45 +- vendor/go.opentelemetry.io/otel/log.go | 41 + vendor/go.opentelemetry.io/otel/log/DESIGN.md | 566 + vendor/go.opentelemetry.io/otel/log/LICENSE | 231 + vendor/go.opentelemetry.io/otel/log/README.md | 3 + vendor/go.opentelemetry.io/otel/log/doc.go | 85 + .../otel/log/embedded/README.md | 3 + .../otel/log/embedded/embedded.go | 36 + vendor/go.opentelemetry.io/otel/log/logger.go | 197 + .../go.opentelemetry.io/otel/log/provider.go | 38 + vendor/go.opentelemetry.io/otel/log/record.go | 168 + .../go.opentelemetry.io/otel/log/severity.go | 69 + .../otel/log/severity_string.go | 48 + .../go.opentelemetry.io/otel/metric/meter.go | 2 +- .../propagation/internal/hextable/hextable.go | 32 + .../otel/propagation/trace_context.go | 27 +- vendor/go.opentelemetry.io/otel/renovate.json | 7 + .../otel/sdk/instrumentation/doc.go | 2 +- .../otel/sdk/instrumentation/library.go | 2 +- .../otel/sdk/instrumentation/scope.go | 2 +- .../otel/sdk/internal/attrnorm/dedup.go | 802 + .../otel/sdk/internal/attrnorm/truncate.go | 416 + .../otel/sdk/internal/x/features.go | 2 +- .../otel/sdk/internal/x/x.go | 12 +- .../otel/sdk/metric/aggregation.go | 6 +- .../otel/sdk/metric/cache.go | 2 +- .../otel/sdk/metric/config.go | 4 +- .../otel/sdk/metric/doc.go | 2 +- .../otel/sdk/metric/env.go | 11 +- .../otel/sdk/metric/exemplar.go | 2 +- .../otel/sdk/metric/exemplar/doc.go | 2 +- .../otel/sdk/metric/exemplar/exemplar.go | 2 +- .../otel/sdk/metric/exemplar/filter.go | 2 +- .../metric/exemplar/fixed_size_reservoir.go | 176 +- .../metric/exemplar/histogram_reservoir.go | 58 +- .../otel/sdk/metric/exemplar/next_tracker.go | 154 + .../otel/sdk/metric/exemplar/reservoir.go | 2 +- .../otel/sdk/metric/exemplar/storage.go | 57 +- .../otel/sdk/metric/exemplar/value.go | 6 +- .../otel/sdk/metric/exporter.go | 2 +- .../otel/sdk/metric/instrument.go | 58 +- .../metric/internal/aggregate/aggregate.go | 9 +- .../sdk/metric/internal/aggregate/atomic.go | 179 +- .../otel/sdk/metric/internal/aggregate/doc.go | 2 +- .../sdk/metric/internal/aggregate/drop.go | 4 +- .../sdk/metric/internal/aggregate/exemplar.go | 2 +- .../aggregate/exponential_histogram.go | 47 +- .../internal/aggregate/filtered_reservoir.go | 11 +- .../metric/internal/aggregate/finish_sum.go | 313 + .../metric/internal/aggregate/histogram.go | 139 +- .../metric/internal/aggregate/lastvalue.go | 124 +- .../internal/aggregate/lazy_attributes.go | 146 + .../sdk/metric/internal/aggregate/limit.go | 2 +- .../otel/sdk/metric/internal/aggregate/sum.go | 134 +- .../sdk/metric/internal/attrnorm/dedup.go | 308 + .../sdk/metric/internal/attrnorm/distinct.go | 110 + .../otel/sdk/metric/internal/finish/doc.go | 5 + .../sdk/metric/internal/finish/lifecycle.go | 253 + .../otel/sdk/metric/internal/gen.go | 10 + .../metric/internal/observ/instrumentation.go | 6 +- .../internal/reservoir/concurrent_safe.go | 2 +- .../otel/sdk/metric/internal/reservoir/doc.go | 2 +- .../otel/sdk/metric/internal/reuse_slice.go | 2 +- .../otel/sdk/metric/manual_reader.go | 2 +- .../otel/sdk/metric/meter.go | 16 +- .../otel/sdk/metric/metricdata/data.go | 4 +- .../otel/sdk/metric/metricdata/temporality.go | 2 +- .../otel/sdk/metric/periodic_reader.go | 35 +- .../otel/sdk/metric/pipeline.go | 21 +- .../otel/sdk/metric/provider.go | 6 +- .../otel/sdk/metric/reader.go | 2 +- .../otel/sdk/metric/splitmetrics.go | 2 +- .../otel/sdk/metric/version.go | 4 +- .../otel/sdk/metric/view.go | 4 +- .../otel/sdk/resource/auto.go | 2 +- .../otel/sdk/resource/builtin.go | 4 +- .../otel/sdk/resource/config.go | 6 +- .../otel/sdk/resource/container.go | 4 +- .../otel/sdk/resource/doc.go | 2 +- .../otel/sdk/resource/env.go | 4 +- .../otel/sdk/resource/host_id.go | 4 +- .../otel/sdk/resource/host_id_bsd.go | 2 +- .../otel/sdk/resource/host_id_darwin.go | 2 +- .../otel/sdk/resource/host_id_exec.go | 2 +- .../otel/sdk/resource/host_id_linux.go | 2 +- .../otel/sdk/resource/host_id_readfile.go | 2 +- .../otel/sdk/resource/host_id_unsupported.go | 2 +- .../otel/sdk/resource/host_id_windows.go | 2 +- .../otel/sdk/resource/os.go | 4 +- .../otel/sdk/resource/os_release_darwin.go | 2 +- .../otel/sdk/resource/os_release_unix.go | 2 +- .../otel/sdk/resource/os_unix.go | 2 +- .../otel/sdk/resource/os_unsupported.go | 2 +- .../otel/sdk/resource/os_windows.go | 2 +- .../otel/sdk/resource/process.go | 4 +- .../otel/sdk/resource/resource.go | 26 +- .../otel/sdk/trace/batch_span_processor.go | 7 +- .../go.opentelemetry.io/otel/sdk/trace/doc.go | 2 +- .../otel/sdk/trace/event.go | 2 +- .../otel/sdk/trace/evictedqueue.go | 2 +- .../otel/sdk/trace/id_generator.go | 2 +- .../otel/sdk/trace/internal/env/env.go | 2 +- .../internal/observ/batch_span_processor.go | 12 +- .../otel/sdk/trace/internal/observ/doc.go | 2 +- .../internal/observ/simple_span_processor.go | 46 +- .../otel/sdk/trace/internal/observ/tracer.go | 11 +- .../otel/sdk/trace/link.go | 2 +- .../otel/sdk/trace/provider.go | 121 +- .../otel/sdk/trace/sampler_env.go | 11 +- .../otel/sdk/trace/sampling.go | 2 +- .../otel/sdk/trace/simple_span_processor.go | 41 +- .../otel/sdk/trace/snapshot.go | 4 +- .../otel/sdk/trace/span.go | 306 +- .../otel/sdk/trace/span_exporter.go | 2 +- .../otel/sdk/trace/span_limits.go | 36 +- .../otel/sdk/trace/span_processor.go | 2 +- .../otel/sdk/trace/tracer.go | 2 +- .../otel/sdk/trace/tracetest/exporter.go | 2 +- .../otel/sdk/trace/tracetest/recorder.go | 2 +- .../otel/sdk/trace/tracetest/span.go | 2 +- .../go.opentelemetry.io/otel/sdk/version.go | 4 +- .../otel/semconv/v1.37.0/rpcconv/metric.go | 1010 + .../otel/semconv/v1.43.0/httpconv/metric.go | 2051 ++ .../otel/semconv/v1.43.0/otelconv/metric.go | 3197 +++ .../otel/semconv/v1.43.0/rpcconv/metric.go | 357 + vendor/go.opentelemetry.io/otel/trace/auto.go | 14 +- .../otel/trace/internal/telemetry/number.go | 2 +- .../otel/trace/internal/telemetry/value.go | 2 +- .../go.opentelemetry.io/otel/trace/trace.go | 78 +- .../otel/trace/tracestate.go | 2 +- vendor/go.opentelemetry.io/otel/version.go | 2 +- vendor/go.opentelemetry.io/otel/versions.yaml | 16 +- .../proto/otlp/common/v1/common.pb.go | 6 +- vendor/go.uber.org/atomic/CHANGELOG.md | 14 +- vendor/go.uber.org/atomic/README.md | 2 +- vendor/go.uber.org/atomic/bool_ext.go | 2 +- vendor/go.uber.org/atomic/float32_ext.go | 2 +- vendor/go.uber.org/atomic/float64_ext.go | 2 +- vendor/go.uber.org/atomic/pointer_go118.go | 20 +- vendor/go.uber.org/atomic/time_ext.go | 20 +- vendor/go.yaml.in/yaml/v3/parserc.go | 178 +- vendor/go.yaml.in/yaml/v3/yamlh.go | 44 +- vendor/golang.org/x/net/http2/ascii.go | 14 +- vendor/golang.org/x/net/http2/databuffer.go | 5 +- vendor/golang.org/x/net/http2/flow.go | 103 +- vendor/golang.org/x/net/http2/frame.go | 34 +- vendor/golang.org/x/net/http2/server.go | 110 +- .../golang.org/x/net/http2/server_common.go | 47 + vendor/golang.org/x/net/http2/transport.go | 144 +- .../x/net/http2/transport_common.go | 79 +- .../golang.org/x/net/http2/transport_wrap.go | 216 +- vendor/golang.org/x/net/http2/writesched.go | 7 +- .../x/net/internal/httpcommon/README.md | 7 + .../x/net/internal/httpcommon/gzip.go | 132 + .../x/net/internal/httpcommon/request.go | 34 +- vendor/golang.org/x/net/trace/histogram.go | 5 +- .../golang.org/x/sync/semaphore/semaphore.go | 9 +- vendor/golang.org/x/sys/cpu/cpu.go | 21 +- vendor/golang.org/x/sys/cpu/cpu_gc_riscv64.go | 11 + .../golang.org/x/sys/cpu/cpu_linux_ppc64x.go | 4 + .../golang.org/x/sys/cpu/cpu_linux_riscv64.go | 11 + .../golang.org/x/sys/cpu/cpu_netbsd_amd64.go | 47 + vendor/golang.org/x/sys/cpu/cpu_other_x86.go | 2 +- vendor/golang.org/x/sys/cpu/cpu_riscv64.s | 17 + vendor/golang.org/x/sys/cpu/cpu_sparc64.go | 12 + vendor/golang.org/x/sys/unix/ifreq_linux.go | 8 +- vendor/golang.org/x/sys/unix/ioctl_linux.go | 7 + vendor/golang.org/x/sys/unix/mkerrors.sh | 9 +- vendor/golang.org/x/sys/unix/syscall.go | 2 +- vendor/golang.org/x/sys/unix/syscall_bsd.go | 2 +- vendor/golang.org/x/sys/unix/syscall_linux.go | 2 +- vendor/golang.org/x/sys/unix/zerrors_linux.go | 2 + .../x/sys/unix/zerrors_linux_386.go | 1 - .../x/sys/unix/zerrors_linux_amd64.go | 1 - .../x/sys/unix/zerrors_linux_arm.go | 1 - .../x/sys/unix/zerrors_linux_arm64.go | 1 - .../x/sys/unix/zerrors_linux_loong64.go | 1 - .../x/sys/unix/zerrors_linux_mips.go | 1 - .../x/sys/unix/zerrors_linux_mips64.go | 1 - .../x/sys/unix/zerrors_linux_mips64le.go | 1 - .../x/sys/unix/zerrors_linux_mipsle.go | 1 - .../x/sys/unix/zerrors_linux_ppc.go | 1 - .../x/sys/unix/zerrors_linux_ppc64.go | 1 - .../x/sys/unix/zerrors_linux_ppc64le.go | 1 - .../x/sys/unix/zerrors_linux_riscv64.go | 1 - .../x/sys/unix/zerrors_linux_s390x.go | 1 - .../x/sys/unix/zerrors_linux_sparc64.go | 35 +- vendor/golang.org/x/sys/unix/ztypes_linux.go | 86 +- .../golang.org/x/sys/unix/ztypes_linux_386.go | 32 +- .../x/sys/unix/ztypes_linux_amd64.go | 32 +- .../golang.org/x/sys/unix/ztypes_linux_arm.go | 32 +- .../x/sys/unix/ztypes_linux_arm64.go | 32 +- .../x/sys/unix/ztypes_linux_loong64.go | 32 +- .../x/sys/unix/ztypes_linux_mips.go | 32 +- .../x/sys/unix/ztypes_linux_mips64.go | 32 +- .../x/sys/unix/ztypes_linux_mips64le.go | 32 +- .../x/sys/unix/ztypes_linux_mipsle.go | 32 +- .../golang.org/x/sys/unix/ztypes_linux_ppc.go | 32 +- .../x/sys/unix/ztypes_linux_ppc64.go | 32 +- .../x/sys/unix/ztypes_linux_ppc64le.go | 32 +- .../x/sys/unix/ztypes_linux_riscv64.go | 32 +- .../x/sys/unix/ztypes_linux_s390x.go | 32 +- .../x/sys/unix/ztypes_linux_sparc64.go | 32 +- .../golang.org/x/sys/windows/types_windows.go | 1 + vendor/golang.org/x/text/unicode/bidi/core.go | 5 +- .../x/text/unicode/norm/composition.go | 42 +- .../x/text/unicode/norm/forminfo.go | 24 +- .../x/text/unicode/norm/normalize.go | 5 +- .../x/text/unicode/norm/tables15.0.0.go | 1884 +- .../x/text/unicode/norm/tables17.0.0.go | 1924 +- .../x/text/unicode/norm/transform.go | 5 +- .../go/analysis/unitchecker/unitchecker.go | 225 +- .../x/tools/go/ast/astutil/imports.go | 10 +- .../x/tools/go/gcexportdata/gcexportdata.go | 103 +- .../x/tools/internal/gcimporter/iexport.go | 22 +- .../x/tools/internal/gcimporter/iimport.go | 14 +- .../x/tools/internal/gcimporter/ureader.go | 53 +- .../x/tools/internal/pkgbits/version.go | 9 + .../x/tools/internal/stdlib/deps.go | 6 +- .../x/tools/internal/typesinternal/types.go | 2 + .../iamcredentials/v1/iamcredentials-api.json | 4 +- .../iamcredentials/v1/iamcredentials-gen.go | 3 +- .../api/internal/gensupport/media.go | 16 + .../api/internal/gensupport/send.go | 74 +- .../google.golang.org/api/internal/version.go | 2 +- .../option/internaloption/unsaferesolver.go | 106 + .../api/storage/v1/storage-api.json | 169 +- .../api/storage/v1/storage-gen.go | 348 +- .../type/calendarperiod/calendar_period.pb.go | 2 +- .../genproto/googleapis/type/date/date.pb.go | 25 +- .../genproto/googleapis/type/expr/expr.pb.go | 2 +- .../googleapis/type/timeofday/timeofday.pb.go | 24 +- .../endpointsharding/endpointsharding.go | 339 +- .../grpc/balancer/pickfirst/pickfirst.go | 50 +- .../grpc/balancer/ringhash/picker.go | 2 +- .../grpc/balancer/ringhash/ringhash.go | 20 +- .../grpc/balancer/rls/balancer.go | 4 +- .../grpc_binarylog_v1/binarylog.pb.go | 6 +- vendor/google.golang.org/grpc/call.go | 27 +- vendor/google.golang.org/grpc/clientconn.go | 1 + .../credentials/alts/internal/conn/record.go | 19 +- .../alts/internal/handshaker/handshaker.go | 6 +- .../grpc/internal/buffer/unbounded.go | 32 +- .../credentials/xds/handshake_info.go | 152 +- .../grpc/internal/envconfig/envconfig.go | 7 + .../grpc/internal/envconfig/xds.go | 5 + .../internal/grpcsync/callback_serializer.go | 6 +- .../grpc/internal/grpcsync/refcounted.go | 109 + .../grpc/internal/internal.go | 4 + .../grpc/internal/optional/optional.go | 47 + .../grpc/internal/resolver/config_selector.go | 15 +- .../grpc/internal/transport/controlbuf.go | 17 + .../grpc/internal/transport/http2_client.go | 57 +- .../grpc/internal/transport/http2_server.go | 7 + .../grpc/internal/transport/http_util.go | 53 +- .../grpc/internal/transport/transport.go | 18 +- .../xds/balancer/clusterimpl/clusterimpl.go | 113 +- .../xds/balancer/outlierdetection/balancer.go | 8 +- .../outlierdetection/subconn_wrapper.go | 2 +- .../xds/balancer/priority/balancer.go | 4 +- .../grpc/internal/xds/bootstrap/bootstrap.go | 213 +- .../xds/clients/internal/buffer/unbounded.go | 32 +- .../internal/syncutil/callback_serializer.go | 6 +- .../xds/clients/xdsclient/authority.go | 39 +- .../grpc/internal/xds/httpfilter/extconfig.go | 238 + .../internal/xds/httpfilter/extproc/config.go | 184 + .../xds/httpfilter/extproc/ext_proc.go | 2012 ++ .../httpfilter/extproc/internal/internal.go | 59 + .../xds/httpfilter/extproc/metrics.go | 54 + .../internal/xds/httpfilter/fault/fault.go | 4 +- .../internal/xds/httpfilter/httpfilter.go | 46 +- .../grpc/internal/xds/httpfilter/rbac/rbac.go | 16 +- .../internal/xds/httpfilter/router/router.go | 7 +- .../grpc/internal/xds/rbac/matchers.go | 4 +- .../internal/xds/resolver/serviceconfig.go | 108 +- .../internal/xds/resolver/xds_resolver.go | 53 +- .../grpc/internal/xds/server/conn_wrapper.go | 51 +- .../xds/server/filter_chain_manager.go | 21 +- .../grpc/internal/xds/server/routing.go | 44 +- .../internal/xds/xdsclient/resource_types.go | 4 +- .../xds/xdsclient/xdsresource/filter_chain.go | 7 +- .../xdsresource/listener_resource_type.go | 11 +- .../xds/xdsclient/xdsresource/matcher.go | 22 +- .../xdsresource/route_config_resource_type.go | 11 +- .../xdsclient/xdsresource/unmarshal_eds.go | 12 +- .../xdsclient/xdsresource/unmarshal_lds.go | 98 +- .../xdsclient/xdsresource/unmarshal_rds.go | 20 +- .../grpc/metadata/metadata.go | 71 + .../grpc/resolver_wrapper.go | 2 +- vendor/google.golang.org/grpc/server.go | 490 +- .../stats/opentelemetry/client_metrics.go | 18 +- .../stats/opentelemetry/client_tracing.go | 2 +- .../grpc/stats/opentelemetry/opentelemetry.go | 42 +- .../stats/opentelemetry/server_metrics.go | 23 +- .../stats/opentelemetry/server_tracing.go | 4 +- vendor/google.golang.org/grpc/stream.go | 194 +- vendor/google.golang.org/grpc/version.go | 2 +- vendor/google.golang.org/grpc/xds/server.go | 34 +- vendor/google.golang.org/grpc/xds/xds.go | 1 + .../encoding/protodelim/protodelim.go | 9 +- .../protobuf/encoding/protojson/decode.go | 12 + .../encoding/protojson/well_known_types.go | 5 +- .../protobuf/encoding/prototext/decode.go | 18 + .../protobuf/internal/descfmt/stringer.go | 269 +- .../editiondefaults/editions_defaults.binpb | Bin 154 -> 191 bytes .../internal/encoding/defval/default.go | 8 +- .../protobuf/internal/genid/descriptor_gen.go | 5 + .../protobuf/internal/version/version.go | 2 +- .../protobuf/reflect/protodesc/desc_init.go | 1 + .../reflect/protoreflect/source_gen.go | 2 + .../types/descriptorpb/descriptor.pb.go | 101 +- .../protobuf/types/known/anypb/any.pb.go | 160 +- .../types/known/fieldmaskpb/field_mask.pb.go | 34 +- .../types/known/structpb/struct.pb.go | 55 +- .../types/known/timestamppb/timestamp.pb.go | 6 +- vendor/gopkg.in/ini.v1/key.go | 49 +- vendor/modules.txt | 301 +- 1076 files changed, 142964 insertions(+), 23422 deletions(-) create mode 100644 vendor/cloud.google.com/go/iam/.repo-metadata.json create mode 100644 vendor/cloud.google.com/go/monitoring/apiv3/v2/.repo-metadata.json create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/timeouts.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/timeouts/awsinternal.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/timeouts/timeouts.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/timeouts/timeouts_services.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_SearchVectors.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/common_serde.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas/schemas.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/type_registry.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/types/common_serde.go create mode 100644 vendor/github.com/aws/smithy-go/document/internal/serde/field.go create mode 100644 vendor/github.com/aws/smithy-go/document/internal/serde/field_cache.go create mode 100644 vendor/github.com/aws/smithy-go/document/internal/serde/reflect.go create mode 100644 vendor/github.com/aws/smithy-go/document/internal/serde/serde.go create mode 100644 vendor/github.com/aws/smithy-go/document/internal/serde/tags.go create mode 100644 vendor/github.com/aws/smithy-go/document/json/decoder.go create mode 100644 vendor/github.com/aws/smithy-go/document/json/doc.go create mode 100644 vendor/github.com/aws/smithy-go/document/json/encoder.go create mode 100644 vendor/github.com/aws/smithy-go/document/json/json.go create mode 100644 vendor/github.com/aws/smithy-go/internal/errors/errors.go create mode 100644 vendor/github.com/aws/smithy-go/internal/eventstream/codec.go create mode 100644 vendor/github.com/aws/smithy-go/internal/eventstream/no_event_stream.go create mode 100644 vendor/github.com/aws/smithy-go/internal/eventstream/require_http2.go create mode 100644 vendor/github.com/aws/smithy-go/internal/serde/read_payload_blob.go create mode 100644 vendor/github.com/aws/smithy-go/internal/serde/stack.go create mode 100644 vendor/github.com/aws/smithy-go/internal/serde/string_arena.go create mode 100644 vendor/github.com/aws/smithy-go/internal/sync/buffer_pool.go create mode 100644 vendor/github.com/aws/smithy-go/prelude/prelude.go create mode 100644 vendor/github.com/aws/smithy-go/transport/http/protocol/awsjson/awsjson.go create mode 100644 vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/error.go create mode 100644 vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/ext.go create mode 100644 vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/internal/stdlib/LICENSE create mode 100644 vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/internal/stdlib/stdlib.go create mode 100644 vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/parser.go create mode 100644 vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/scanner.go create mode 100644 vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/shape_deserializer.go create mode 100644 vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/shape_serializer.go create mode 100644 vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/stack.go create mode 100644 vendor/github.com/axiomhq/hyperloglog/.golangci-lint-version create mode 100644 vendor/github.com/axiomhq/hyperloglog/.golangci.yml create mode 100644 vendor/github.com/axiomhq/hyperloglog/.goreleaser.yaml create mode 100644 vendor/github.com/axiomhq/hyperloglog/Makefile create mode 100644 vendor/github.com/dustin/go-humanize/.envrc create mode 100644 vendor/github.com/dustin/go-humanize/.gitignore create mode 100644 vendor/github.com/dustin/go-humanize/SECURITY.md create mode 100644 vendor/github.com/dustin/go-humanize/flake.lock create mode 100644 vendor/github.com/dustin/go-humanize/flake.nix create mode 100644 vendor/github.com/dustin/go-humanize/shell.nix create mode 100644 vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc.pb.go create mode 100644 vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc.pb.validate.go create mode 100644 vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc_vtproto.pb.go create mode 100644 vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode.pb.go create mode 100644 vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode.pb.validate.go create mode 100644 vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode_vtproto.pb.go create mode 100644 vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor.pb.go create mode 100644 vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor.pb.validate.go create mode 100644 vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor_grpc.pb.go create mode 100644 vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor_vtproto.pb.go create mode 100644 vendor/github.com/felixge/httpsnoop/wrap_generated.go create mode 100644 vendor/github.com/gofrs/flock/zizmor.yml create mode 100644 vendor/github.com/googleapis/gax-go/v2/telemetry.go create mode 100644 vendor/github.com/hashicorp/consul/api/operator_feature_gate.go create mode 100644 vendor/github.com/hashicorp/go-metrics/compat/armon.go create mode 100644 vendor/github.com/hashicorp/go-metrics/compat/hashicorp.go create mode 100644 vendor/github.com/klauspost/compress/AGENTS.md create mode 100644 vendor/github.com/klauspost/compress/huff0/decompress_arm64.go create mode 100644 vendor/github.com/klauspost/compress/huff0/decompress_arm64.s create mode 100644 vendor/github.com/klauspost/compress/huff0/decompress_asm.go create mode 100644 vendor/github.com/klauspost/compress/internal/regmask/regmask.go create mode 100644 vendor/github.com/klauspost/compress/internal/regmask/regmask_386.go create mode 100644 vendor/github.com/klauspost/compress/s2/encode_asm.go create mode 100644 vendor/github.com/klauspost/compress/s2/encodeblock_arm64.s create mode 100644 vendor/github.com/klauspost/compress/s2/encodeblock_asm.go create mode 100644 vendor/github.com/klauspost/compress/zstd/simple.go create mode 100644 vendor/github.com/klauspost/cpuid/v2/detect_ref_arm64.go create mode 100644 vendor/github.com/klauspost/cpuid/v2/detect_riscv64.go create mode 100644 vendor/github.com/klauspost/cpuid/v2/os_linux_riscv64.go create mode 100644 vendor/github.com/klauspost/cpuid/v2/os_other_riscv64.go create mode 100644 vendor/github.com/klauspost/cpuid/v2/riscv_isa.go create mode 100644 vendor/github.com/minio/minio-go/v7/api-get-object-parallel.go create mode 100644 vendor/github.com/minio/minio-go/v7/pkg/credentials/credentials-sso.sample create mode 100644 vendor/github.com/minio/minio-go/v7/pkg/policy/bucket-policy-condition.go create mode 100644 vendor/github.com/minio/minio-go/v7/pkg/policy/bucket-policy.go create mode 100644 vendor/github.com/minio/minio-go/v7/rdma_callback.go create mode 100644 vendor/github.com/minio/minio-go/v7/rdma_stream.go create mode 100644 vendor/github.com/minio/minio-go/v7/rdma_tls.go create mode 100644 vendor/github.com/minio/minio-go/v7/upload-limits.go create mode 100644 vendor/github.com/parquet-go/parquet-go/convert_variant.go create mode 100644 vendor/github.com/parquet-go/parquet-go/encoding/thrift/union.go create mode 100644 vendor/github.com/parquet-go/parquet-go/format/footer.go create mode 100644 vendor/github.com/parquet-go/parquet-go/format/reset.go create mode 100644 vendor/github.com/parquet-go/parquet-go/merge_refine.go create mode 100644 vendor/github.com/parquet-go/parquet-go/row_range.go create mode 100644 vendor/github.com/parquet-go/parquet-go/variant/builder.go create mode 100644 vendor/github.com/parquet-go/parquet-go/variant/loc.go create mode 100644 vendor/github.com/parquet-go/parquet-go/variant_column_reader.go create mode 100644 vendor/github.com/parquet-go/parquet-go/variant_column_writer.go create mode 100644 vendor/github.com/parquet-go/parquet-go/variant_shredded_read.go create mode 100644 vendor/github.com/parquet-go/parquet-go/variant_shredded_write.go create mode 100644 vendor/github.com/parquet-go/parquet-go/writer_copy.go create mode 100644 vendor/github.com/parquet-go/parquet-go/writer_reencode.go create mode 100644 vendor/github.com/sirupsen/logrus/level.go create mode 100644 vendor/github.com/stretchr/testify/internal/difflib/LICENSE create mode 100644 vendor/github.com/stretchr/testify/internal/difflib/difflib.go create mode 100644 vendor/github.com/stretchr/testify/internal/spew/LICENSE create mode 100644 vendor/github.com/stretchr/testify/internal/spew/README.md create mode 100644 vendor/github.com/stretchr/testify/internal/spew/bypass.go create mode 100644 vendor/github.com/stretchr/testify/internal/spew/bypasssafe.go create mode 100644 vendor/github.com/stretchr/testify/internal/spew/common.go create mode 100644 vendor/github.com/stretchr/testify/internal/spew/config.go create mode 100644 vendor/github.com/stretchr/testify/internal/spew/doc.go create mode 100644 vendor/github.com/stretchr/testify/internal/spew/dump.go create mode 100644 vendor/github.com/stretchr/testify/internal/spew/format.go create mode 100644 vendor/github.com/stretchr/testify/internal/spew/spew.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/otlp/profiles_dictionary.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/otlp/profiles_version.go create mode 100644 vendor/go.opentelemetry.io/otel/internal/global/logger.go create mode 100644 vendor/go.opentelemetry.io/otel/log.go create mode 100644 vendor/go.opentelemetry.io/otel/log/DESIGN.md create mode 100644 vendor/go.opentelemetry.io/otel/log/LICENSE create mode 100644 vendor/go.opentelemetry.io/otel/log/README.md create mode 100644 vendor/go.opentelemetry.io/otel/log/doc.go create mode 100644 vendor/go.opentelemetry.io/otel/log/embedded/README.md create mode 100644 vendor/go.opentelemetry.io/otel/log/embedded/embedded.go create mode 100644 vendor/go.opentelemetry.io/otel/log/logger.go create mode 100644 vendor/go.opentelemetry.io/otel/log/provider.go create mode 100644 vendor/go.opentelemetry.io/otel/log/record.go create mode 100644 vendor/go.opentelemetry.io/otel/log/severity.go create mode 100644 vendor/go.opentelemetry.io/otel/log/severity_string.go create mode 100644 vendor/go.opentelemetry.io/otel/propagation/internal/hextable/hextable.go create mode 100644 vendor/go.opentelemetry.io/otel/sdk/internal/attrnorm/dedup.go create mode 100644 vendor/go.opentelemetry.io/otel/sdk/internal/attrnorm/truncate.go create mode 100644 vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/next_tracker.go create mode 100644 vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/finish_sum.go create mode 100644 vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/lazy_attributes.go create mode 100644 vendor/go.opentelemetry.io/otel/sdk/metric/internal/attrnorm/dedup.go create mode 100644 vendor/go.opentelemetry.io/otel/sdk/metric/internal/attrnorm/distinct.go create mode 100644 vendor/go.opentelemetry.io/otel/sdk/metric/internal/finish/doc.go create mode 100644 vendor/go.opentelemetry.io/otel/sdk/metric/internal/finish/lifecycle.go create mode 100644 vendor/go.opentelemetry.io/otel/sdk/metric/internal/gen.go create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.37.0/rpcconv/metric.go create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.43.0/httpconv/metric.go create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.43.0/otelconv/metric.go create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.43.0/rpcconv/metric.go create mode 100644 vendor/golang.org/x/net/internal/httpcommon/README.md create mode 100644 vendor/golang.org/x/net/internal/httpcommon/gzip.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_gc_riscv64.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_netbsd_amd64.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_riscv64.s create mode 100644 vendor/golang.org/x/sys/cpu/cpu_sparc64.go create mode 100644 vendor/google.golang.org/api/option/internaloption/unsaferesolver.go create mode 100644 vendor/google.golang.org/grpc/internal/grpcsync/refcounted.go create mode 100644 vendor/google.golang.org/grpc/internal/optional/optional.go create mode 100644 vendor/google.golang.org/grpc/internal/xds/httpfilter/extproc/config.go create mode 100644 vendor/google.golang.org/grpc/internal/xds/httpfilter/extproc/ext_proc.go create mode 100644 vendor/google.golang.org/grpc/internal/xds/httpfilter/extproc/internal/internal.go create mode 100644 vendor/google.golang.org/grpc/internal/xds/httpfilter/extproc/metrics.go diff --git a/go.mod b/go.mod index db463ee688f..b73cf6ae8e3 100644 --- a/go.mod +++ b/go.mod @@ -6,42 +6,42 @@ require ( github.com/Masterminds/squirrel v1.5.4 github.com/VictoriaMetrics/fastcache v1.13.3 github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b - github.com/alicebob/miniredis/v2 v2.38.0 - github.com/aws/aws-sdk-go-v2 v1.43.2 - github.com/aws/aws-sdk-go-v2/config v1.32.33 - github.com/aws/aws-sdk-go-v2/service/dynamodb v1.59.1 - github.com/axiomhq/hyperloglog v0.2.6 + github.com/alicebob/miniredis/v2 v2.40.0 + github.com/aws/aws-sdk-go-v2 v1.47.3 + github.com/aws/aws-sdk-go-v2/config v1.33.9 + github.com/aws/aws-sdk-go-v2/service/dynamodb v1.70.3 + github.com/axiomhq/hyperloglog v0.3.0 github.com/bboreham/go-loser v0.0.0-20230920113527-fcc2c21820a3 github.com/bradfitz/gomemcache v0.0.0-20250403215159-8d39553ac7cf github.com/cespare/xxhash/v2 v2.3.0 github.com/cortexproject/promqlsmith v0.0.0-20260205231645-0c8ef5fe46a5 - github.com/dustin/go-humanize v1.0.1 + github.com/dustin/go-humanize v1.1.0 github.com/edsrzf/mmap-go v1.2.0 github.com/efficientgo/core v1.0.0-rc.3 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.27.0 - github.com/go-openapi/swag/jsonutils v0.28.0 + github.com/go-openapi/strfmt v0.27.3 + github.com/go-openapi/swag/jsonutils v0.29.2 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.19.1 + github.com/golang-migrate/migrate/v4 v4.20.1 github.com/golang/snappy v1.0.0 github.com/google/go-cmp v0.7.0 github.com/google/uuid v1.6.0 github.com/gorilla/mux v1.8.1 github.com/grafana/regexp v0.0.0-20250905093917-f7b3be9d1853 github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 - github.com/hashicorp/consul/api v1.34.3 + github.com/hashicorp/consul/api v1.34.5 github.com/hashicorp/go-cleanhttp v0.5.2 github.com/hashicorp/go-metrics v0.6.0 github.com/hashicorp/go-sockaddr v1.0.7 github.com/hashicorp/golang-lru/v2 v2.0.7 github.com/hashicorp/memberlist v0.6.0 github.com/json-iterator/go v1.1.12 - github.com/klauspost/compress v1.19.1 - github.com/minio/minio-go/v7 v7.2.1 + github.com/klauspost/compress v1.20.3 + github.com/minio/minio-go/v7 v7.4.1 github.com/mitchellh/go-wordwrap v1.0.1 github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 github.com/oklog/ulid v1.3.1 @@ -49,13 +49,13 @@ require ( github.com/opentracing-contrib/go-grpc v0.1.4 github.com/opentracing-contrib/go-stdlib v1.1.1 github.com/opentracing/opentracing-go v1.2.0 - github.com/parquet-go/parquet-go v0.30.1 + github.com/parquet-go/parquet-go v0.32.0 github.com/pkg/errors v0.9.1 github.com/prometheus-community/parquet-common v0.0.0-20260614025832-5f32460b5373 github.com/prometheus/alertmanager v0.34.1 github.com/prometheus/client_golang v1.24.1 github.com/prometheus/client_golang/exp v0.0.0-20251212205219-7ba246a648ca - github.com/prometheus/client_model v0.6.2 + github.com/prometheus/client_model v0.6.3 github.com/prometheus/common v0.70.1 github.com/prometheus/procfs v0.21.1 // Prometheus maps version 3.x.y to tags v0.30x.y. @@ -64,7 +64,7 @@ require ( github.com/sercand/kuberesolver/v5 v5.1.1 github.com/sony/gobreaker v1.0.0 github.com/spf13/afero v1.15.0 - github.com/stretchr/testify v1.11.1 + github.com/stretchr/testify v1.12.1 github.com/thanos-io/objstore v0.0.0-20250804093838-71d60dfee488 // Pinned to main: promql-engine has never cut a tag, so a pseudo-version is the only // option. We need thanosengine.Opts.SelectorBatchSize (-querier.selector-batch-size, @@ -80,33 +80,33 @@ require ( 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/collector/pdata v1.61.0 - go.opentelemetry.io/contrib/propagators/aws v1.44.0 - go.opentelemetry.io/otel v1.45.0 - go.opentelemetry.io/otel/bridge/opentracing v1.45.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.44.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.44.0 - go.opentelemetry.io/otel/sdk v1.44.0 - go.opentelemetry.io/otel/trace v1.45.0 - go.uber.org/atomic v1.11.0 + go.opentelemetry.io/collector/pdata v1.69.0 + go.opentelemetry.io/contrib/propagators/aws v1.47.0 + go.opentelemetry.io/otel v1.47.0 + go.opentelemetry.io/otel/bridge/opentracing v1.47.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.47.0 + go.opentelemetry.io/otel/sdk v1.47.0 + go.opentelemetry.io/otel/trace v1.47.0 + go.uber.org/atomic v1.12.0 go.uber.org/automaxprocs v1.6.0 - golang.org/x/net v0.58.0 - golang.org/x/sync v0.22.0 - golang.org/x/time v0.15.0 - google.golang.org/grpc v1.83.1 - google.golang.org/protobuf v1.36.11 + golang.org/x/net v0.60.0 + golang.org/x/sync v0.23.0 + golang.org/x/time v0.16.0 + google.golang.org/grpc v1.84.0 + google.golang.org/protobuf v1.36.12 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 ) require ( cel.dev/expr v0.25.2 // indirect - cloud.google.com/go v0.121.6 // indirect - cloud.google.com/go/auth v0.18.2 // indirect + cloud.google.com/go v0.123.0 // indirect + cloud.google.com/go/auth v0.20.0 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect cloud.google.com/go/compute/metadata v0.9.0 // indirect - cloud.google.com/go/iam v1.5.3 // indirect - cloud.google.com/go/monitoring v1.24.3 // indirect + cloud.google.com/go/iam v1.11.0 // indirect + cloud.google.com/go/monitoring v1.29.0 // indirect cloud.google.com/go/storage v1.56.0 // indirect dmitri.shuralyov.com/go/generated v0.0.0-20170818220700-b1254a446363 // indirect github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0 // indirect @@ -114,7 +114,7 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 // indirect github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.1 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0 // indirect - github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.33.0 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.34.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/VictoriaMetrics/easyproto v1.1.3 // indirect @@ -122,20 +122,20 @@ require ( github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible // indirect github.com/andybalholm/brotli v1.1.1 // indirect github.com/armon/go-metrics v0.4.1 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.19.32 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.33 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.33 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.33 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.34 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.14 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.12.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.33 // indirect - github.com/aws/aws-sdk-go-v2/service/signin v1.5.2 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.3 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.13.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/signin v1.10.4 // indirect github.com/aws/aws-sdk-go-v2/service/sns v1.42.2 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.33.2 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.38.2 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.45.2 // indirect - github.com/aws/smithy-go v1.27.5 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.38.4 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.4 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.51.4 // indirect + github.com/aws/smithy-go v1.28.5 // indirect github.com/baidubce/bce-sdk-go v0.9.230 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/blang/semver/v4 v4.0.0 // indirect @@ -156,7 +156,7 @@ require ( github.com/envoyproxy/protoc-gen-validate v1.3.3 // indirect github.com/fatih/color v1.19.0 // indirect github.com/fatih/faillint v1.15.0 // indirect - github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/felixge/httpsnoop v1.1.0 // indirect github.com/fsnotify/fsnotify v1.10.1 // indirect github.com/go-chi/chi/v5 v5.2.4 // indirect github.com/go-jose/go-jose/v4 v4.1.4 // indirect @@ -164,7 +164,7 @@ require ( github.com/go-logr/logr v1.4.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/analysis v0.25.5 // indirect - github.com/go-openapi/errors v0.22.8 // indirect + github.com/go-openapi/errors v0.22.9 // indirect github.com/go-openapi/jsonpointer v1.0.0 // indirect github.com/go-openapi/jsonreference v1.0.0 // indirect github.com/go-openapi/loads v0.25.0 // indirect @@ -173,19 +173,19 @@ require ( github.com/go-openapi/spec v0.22.9 // indirect github.com/go-openapi/swag v0.28.0 // indirect github.com/go-openapi/swag/cmdutils v0.28.0 // indirect - github.com/go-openapi/swag/conv v0.28.0 // indirect + github.com/go-openapi/swag/conv v0.29.2 // indirect github.com/go-openapi/swag/fileutils v0.28.0 // indirect github.com/go-openapi/swag/loading v0.28.0 // indirect github.com/go-openapi/swag/mangling v0.28.0 // indirect github.com/go-openapi/swag/netutils v0.28.0 // indirect - github.com/go-openapi/swag/pools v0.28.0 // indirect + github.com/go-openapi/swag/pools v0.29.2 // indirect github.com/go-openapi/swag/stringutils v0.28.0 // indirect - github.com/go-openapi/swag/typeutils v0.28.0 // indirect + github.com/go-openapi/swag/typeutils v0.29.2 // indirect github.com/go-openapi/swag/yamlutils v0.28.0 // indirect github.com/go-openapi/validate v0.26.1 // indirect github.com/go-viper/mapstructure/v2 v2.5.0 // indirect github.com/gobwas/glob v0.2.3 // indirect - github.com/gofrs/flock v0.13.0 // indirect + github.com/gofrs/flock v0.13.1 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/golang-jwt/jwt/v5 v5.3.1 // indirect github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect @@ -194,10 +194,10 @@ require ( github.com/google/go-querystring v1.1.0 // indirect github.com/google/pprof v0.0.0-20251213031049-b05bdaca462f // indirect github.com/google/s2a-go v0.1.9 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.3.11 // indirect - github.com/googleapis/gax-go/v2 v2.17.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.17 // indirect + github.com/googleapis/gax-go/v2 v2.22.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // 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 @@ -205,14 +205,14 @@ require ( github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-rootcerts v1.0.2 // indirect github.com/hashicorp/go-version v1.9.0 // indirect - github.com/hashicorp/golang-lru v0.6.0 // indirect - github.com/hashicorp/serf v0.10.1 // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/serf v0.10.4 // indirect github.com/huaweicloud/huaweicloud-sdk-go-obs v3.25.4+incompatible // indirect 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/kamstrup/intmap v0.5.2 // indirect - github.com/klauspost/cpuid/v2 v2.2.11 // indirect + github.com/klauspost/cpuid/v2 v2.4.0 // 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 @@ -221,8 +221,8 @@ require ( github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect github.com/lib/pq v1.11.2 // indirect - github.com/mattn/go-colorable v0.1.14 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-colorable v0.1.15 // indirect + github.com/mattn/go-isatty v0.0.22 // indirect github.com/mdlayher/socket v0.6.0 // indirect github.com/mdlayher/vsock v1.3.0 // indirect github.com/metalmatze/signal v0.0.0-20210307161603-1c9aa721a97a // indirect @@ -250,7 +250,6 @@ require ( github.com/pierrec/lz4/v4 v4.1.26 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect - github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus-community/prom-label-proxy v0.11.1 // indirect github.com/prometheus/exporter-toolkit v0.17.1 // indirect github.com/prometheus/otlptranslator v1.0.0 // indirect @@ -262,12 +261,12 @@ require ( github.com/rs/xid v1.6.0 // indirect github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect github.com/seiflotfy/cuckoofilter v0.0.0-20240715131351-a2f2c23f1771 // indirect - github.com/sirupsen/logrus v1.9.4 // indirect + github.com/sirupsen/logrus v1.10.2 // indirect github.com/soheilhy/cmux v0.1.5 // indirect - github.com/spiffe/go-spiffe/v2 v2.7.0 // indirect - github.com/stretchr/objx v0.5.2 // indirect + github.com/spiffe/go-spiffe/v2 v2.8.1 // indirect + github.com/stretchr/objx v0.5.3 // indirect github.com/tencentyun/cos-go-sdk-v5 v0.7.66 // indirect - github.com/tinylib/msgp v1.6.1 // indirect + github.com/tinylib/msgp v1.6.4 // indirect github.com/twmb/franz-go v1.21.5 // indirect github.com/twmb/franz-go/pkg/kmsg v1.13.1 // indirect github.com/twmb/franz-go/plugin/kslog v1.0.0 // indirect @@ -285,40 +284,41 @@ require ( go.opentelemetry.io/collector/confmap v1.48.0 // indirect go.opentelemetry.io/collector/confmap/xconfmap v0.142.0 // indirect go.opentelemetry.io/collector/consumer v1.48.0 // indirect - go.opentelemetry.io/collector/featuregate v1.61.0 // indirect + go.opentelemetry.io/collector/featuregate v1.69.0 // indirect go.opentelemetry.io/collector/pipeline v1.48.0 // indirect go.opentelemetry.io/collector/processor v1.48.0 // indirect go.opentelemetry.io/collector/semconv v0.128.0 // indirect go.opentelemetry.io/contrib/detectors/gcp v1.44.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.70.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.69.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0 // indirect go.opentelemetry.io/contrib/propagators/autoprop v0.61.0 // indirect go.opentelemetry.io/contrib/propagators/b3 v1.36.0 // indirect go.opentelemetry.io/contrib/propagators/jaeger v1.36.0 // indirect go.opentelemetry.io/contrib/propagators/ot v1.36.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.44.0 // indirect - go.opentelemetry.io/otel/metric v1.45.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.44.0 // indirect - go.opentelemetry.io/proto/otlp v1.10.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect go.uber.org/goleak v1.3.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.1 // indirect go.yaml.in/yaml/v2 v2.4.4 // indirect - go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/crypto v0.55.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/crypto v0.57.0 // indirect golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa // indirect - golang.org/x/mod v0.40.0 // indirect + golang.org/x/mod v0.41.0 // indirect golang.org/x/oauth2 v0.36.0 // indirect - golang.org/x/sys v0.47.0 // indirect - golang.org/x/text v0.41.0 // indirect - golang.org/x/tools v0.49.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + golang.org/x/tools v0.50.0 // indirect gonum.org/v1/gonum v0.17.0 // indirect - google.golang.org/api v0.264.0 // indirect - google.golang.org/genproto v0.0.0-20260128011058-8636f8732409 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260803160001-6ac0973c030d // indirect - gopkg.in/ini.v1 v1.67.2 // indirect + google.golang.org/api v0.287.0 // indirect + google.golang.org/genproto v0.0.0-20260630182238-925bb5da69e7 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + gopkg.in/ini.v1 v1.67.3 // indirect gopkg.in/telebot.v3 v3.3.8 // indirect k8s.io/apimachinery v0.34.3 // indirect k8s.io/client-go v0.34.3 // indirect diff --git a/go.sum b/go.sum index 5ec89d27c79..3d4874bf1b1 100644 --- a/go.sum +++ b/go.sum @@ -31,10 +31,10 @@ cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= -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/auth v0.18.2 h1:+Nbt5Ev0xEqxlNjd6c+yYUeosQ5TtEUaNcN/3FozlaM= -cloud.google.com/go/auth v0.18.2/go.mod h1:xD+oY7gcahcu7G2SG2DsBerfFxgPAJz17zz2joOFF3M= +cloud.google.com/go v0.123.0 h1:2NAUJwPR47q+E35uaJeYoNhuNEM9kM8SjgRgdeOJUSE= +cloud.google.com/go v0.123.0/go.mod h1:xBoMV08QcqUGuPW65Qfm1o9Y4zKZBpGS+7bImXLTAZU= +cloud.google.com/go/auth v0.20.0 h1:kXTssoVb4azsVDoUiF8KvxAqrsQcQtB53DcSgta74CA= +cloud.google.com/go/auth v0.20.0/go.mod h1:942/yi/itH1SsmpyrbnTMDgGfdy2BUqIKyd0cyYLc5Q= 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/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= @@ -53,14 +53,14 @@ cloud.google.com/go/compute/metadata v0.9.0/go.mod h1:E0bWwX5wTnLPedCKqk3pJmVgCB cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= -cloud.google.com/go/iam v1.5.3 h1:+vMINPiDF2ognBJ97ABAYYwRgsaqxPbQDlMnbHMjolc= -cloud.google.com/go/iam v1.5.3/go.mod h1:MR3v9oLkZCTlaqljW6Eb2d3HGDGK5/bDv93jhfISFvU= -cloud.google.com/go/logging v1.13.1 h1:O7LvmO0kGLaHY/gq8cV7T0dyp6zJhYAOtZPX4TF3QtY= -cloud.google.com/go/logging v1.13.1/go.mod h1:XAQkfkMBxQRjQek96WLPNze7vsOmay9H5PqfsNYDqvw= -cloud.google.com/go/longrunning v0.8.0 h1:LiKK77J3bx5gDLi4SMViHixjD2ohlkwBi+mKA7EhfW8= -cloud.google.com/go/longrunning v0.8.0/go.mod h1:UmErU2Onzi+fKDg2gR7dusz11Pe26aknR4kHmJJqIfk= -cloud.google.com/go/monitoring v1.24.3 h1:dde+gMNc0UhPZD1Azu6at2e79bfdztVDS5lvhOdsgaE= -cloud.google.com/go/monitoring v1.24.3/go.mod h1:nYP6W0tm3N9H/bOw8am7t62YTzZY+zUeQ+Bi6+2eonI= +cloud.google.com/go/iam v1.11.0 h1:KieQ9Pb+LLPak1O3Rv3GgCxhnmkYf7Xyh0P5HfF1jFM= +cloud.google.com/go/iam v1.11.0/go.mod h1:KP+nKGugNJW4LcLx1uEZcq1ok5sQHFaQehQNl4QDgV4= +cloud.google.com/go/logging v1.18.0 h1:KhzZq+1cSkPH9YUaKLLhLtQxIHitVayBmk0sGfoM9+k= +cloud.google.com/go/logging v1.18.0/go.mod h1:ZGKnpBaURITh+g/uom2VhbiFoFWvejcrHPDhxFtU/gI= +cloud.google.com/go/longrunning v1.1.0 h1:qJ0R0IA8ONaRCNWTRPAS0iAmt1bj3TVgJ40z7ZGRslE= +cloud.google.com/go/longrunning v1.1.0/go.mod h1:tH+A/6UvNypiPJWAQaKCsh+xiGbB23wUO8egwUXlD2E= +cloud.google.com/go/monitoring v1.29.0 h1:AHhDsFaSax1/4k+qlIDX/SDGe6hggnfXJ9dkgD9qBPY= +cloud.google.com/go/monitoring v1.29.0/go.mod h1:72NOVjJXHY/HBfoLT0+qlCZBT059+9VXLeAnL2PeeVM= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -73,8 +73,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= 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/trace v1.11.7 h1:kDNDX8JkaAG3R2nq1lIdkb7FCSi1rCmsEtKVsty7p+U= -cloud.google.com/go/trace v1.11.7/go.mod h1:TNn9d5V3fQVf6s4SCveVMIBS2LJUqo73GACmq/Tky0s= +cloud.google.com/go/trace v1.16.0 h1:GmQovzFc5F0CNfl0VLgL64aoTtu7xsM0YajW2GlG9+E= +cloud.google.com/go/trace v1.16.0/go.mod h1:r+bdAn16dKLSV1G2D5v3e58IlQlizfxWrUfjx7kM7X0= dmitri.shuralyov.com/go/generated v0.0.0-20170818220700-b1254a446363 h1:o4lAkfETerCnr1kF9/qwkwjICnU+YLHNDCM8h2xj7as= dmitri.shuralyov.com/go/generated v0.0.0-20170818220700-b1254a446363/go.mod h1:WG7q7swWsS2f9PYpt5DoEP/EBYWx8We5UoRltn9vJl8= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -94,8 +94,8 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.8.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.8.0/go.mod h1:DWAciXemNf++PQJLeXUB4HHH5OpsAh12HZnu2wXE1jA= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.1 h1:lhZdRq7TIx0GJQvSyX2Si406vrYsov2FXGp/RnSEtcs= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.1/go.mod h1:8cl44BDmi+effbARHMQjgOKA2AYvcohNm7KEt42mSV8= -github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= -github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg= +github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE= github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0 h1:XRzhVemXdgvJqCH0sFfrBUTnUJSBrBf7++ypk+twtRs= @@ -108,8 +108,8 @@ github.com/DATA-DOG/go-sqlmock v1.4.1/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7OputlJIzU= github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.33.0 h1:l7+6kwRMJNwdCvYdDl7Eax+wzEYHSnNY7zrrfbhDdTA= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.33.0/go.mod h1:pJTkW8hEUIIi3Pf65lPZOnn4Y81yCllX6IWk2jNXdkM= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.34.0 h1:yzIYdwuro811Z27D3T80Wkd3rqZzb0K43nner7Eh1yE= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.34.0/go.mod h1:pJTkW8hEUIIi3Pf65lPZOnn4Y81yCllX6IWk2jNXdkM= 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= @@ -142,8 +142,8 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b h1:mimo19zliBX/vSQ6PWWSL9lK8qwHozUj03+zLoEB8O0= github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b/go.mod h1:fvzegU4vN3H1qMT+8wDmzjAcDONcgo2/SZ/TyfdUOFs= -github.com/alicebob/miniredis/v2 v2.38.0 h1:nZAzCR+Lj+Vxk4ZXzm2NuKq2O33RXj1XxJ2e2uP9jiw= -github.com/alicebob/miniredis/v2 v2.38.0/go.mod h1:TcL7YfarKPGDAthEtl5NBeHZfeUQj6OXMm/+iu5cLMM= +github.com/alicebob/miniredis/v2 v2.40.0 h1:6IgTQbvm2JiMYZ8yur/acNJzVjtSOWCelxXbk/LUBXc= +github.com/alicebob/miniredis/v2 v2.40.0/go.mod h1:TcL7YfarKPGDAthEtl5NBeHZfeUQj6OXMm/+iu5cLMM= github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible h1:8psS8a+wKfiLt1iVDX79F7Y6wUM49Lcha2FMXt4UM8g= github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= @@ -158,48 +158,48 @@ 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/aws/aws-sdk-go-v2 v1.43.2 h1:cl+IXwWb3qazClUcm08tGSsB6OiuV83JVJO9B0jQcPc= -github.com/aws/aws-sdk-go-v2 v1.43.2/go.mod h1:WEzLKBh/mEjXvx1FtQMWgSxMSTVqxQzjkRtk5fa3wkg= -github.com/aws/aws-sdk-go-v2/config v1.32.33 h1:M1m/Q6f0OKDEDGwhiNOqx1OjTdrewe3v+GDbHmKczWk= -github.com/aws/aws-sdk-go-v2/config v1.32.33/go.mod h1:fGj1iQj2QpIZzp7jE4aQQ+71TE8cd4z9K4+xCd6EqmE= -github.com/aws/aws-sdk-go-v2/credentials v1.19.32 h1:eNE0JnIblBo1NCvd3tqEYuZz9XDefn69R74CHd3nT7U= -github.com/aws/aws-sdk-go-v2/credentials v1.19.32/go.mod h1:yYJu+6tqKUYZuJSYcpSGjz/6sV/SUaAaKIufnWKx2OU= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.33 h1:MobhiR6KIerWxmO74Zit5I3379+mSc2DOdZ3DeRFB9w= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.33/go.mod h1:xu02847OdZfNr/jAfZpHtyRk0b3v4d0kaoxNHxZGG/w= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.33 h1:HAp1wLFZzch054uh3FK7rcVYg4v7J2FxVf3h3IGNZas= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.33/go.mod h1:mJk5fmqnF+WUlMdPG37pR2Fh3oh6r8F6ZGUgPKvzu0c= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.33 h1:0YA0aCKgsJyno6xkFfaIgjE3/wK08+Qxo9nQfe1UrWM= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.33/go.mod h1:UZqj4WIdTH+ga8Y/DgpAuy/8cGjM3h7gDCliJYGg2SE= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.34 h1:HQYnjFnXpX8EbPW5M1QT8mXzesRPwly0HEPTcFlS02Y= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.34/go.mod h1:tGzj56niKYZBbDIRhwPGDqrULzmWv5b6uBQGqyNaFZw= -github.com/aws/aws-sdk-go-v2/service/dynamodb v1.59.1 h1:GaRPmlTeDxjnp6XipIV4b69PJalB59DcMMClFJeHeMw= -github.com/aws/aws-sdk-go-v2/service/dynamodb v1.59.1/go.mod h1:jLkDwIDBkCIpiENQhAOjAR2L9jwj56mZgVEvuro4gUE= +github.com/aws/aws-sdk-go-v2 v1.47.3 h1:HRoT/MkNi3bjO5xF4dCzLzvVmkvRGHj3/cLINDnJejk= +github.com/aws/aws-sdk-go-v2 v1.47.3/go.mod h1:xSl+OSI5ZUw6bSMupWc218zE5Pl+65MCCu3ySWFY99A= +github.com/aws/aws-sdk-go-v2/config v1.33.9 h1:Hv6bcQUJVnmuWaKjqD6Ot8sE75NrWsWV20oGT5aWle0= +github.com/aws/aws-sdk-go-v2/config v1.33.9/go.mod h1:ivowmrZNfBQLcg4QkaItgi5wae4Bzot9RzIdbY1hfTg= +github.com/aws/aws-sdk-go-v2/credentials v1.20.9 h1:SNO55PnWhaDafsOcv16lCA0kdoFMl/YlegWoVsU02s0= +github.com/aws/aws-sdk-go-v2/credentials v1.20.9/go.mod h1:+2reOTRtdD3VSBqpRDNwrZIYy8yMCYa7oK3WKTJ/I1I= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.3 h1:gr3b87OLB29jymWPzp/CAyXwQRJVE+sC4Wm0qBIKHsk= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.3/go.mod h1:BRjf4L/Yx2hY54o+ZibPbLJyMMeSwqYQXwcJfqW66a8= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 h1:CqL8NN3p4I0JTwwV5MEoatIl4Y2amZ2X9dRD+0hbRL0= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6/go.mod h1:exdJ32hMqXl0Wyo6NwqEC5yIhtua3+PDaKE8P29m4qE= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 h1:FpBq24TG6WVSObTNhQOv7Q0088rounUUlwn3zlNItkM= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6/go.mod h1:ONzdPVYC95oBOu0VWNEsKEntcoemP3xVKjT+qWml1s4= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 h1:Qmn60RWuk9+bd2ddvJJqwf3Cpac3VvGMOdbGemtUhX4= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6/go.mod h1:h/YJhe4AVyQxEUMluph10iqV7mjajH7A9L+BHF5ppis= +github.com/aws/aws-sdk-go-v2/service/dynamodb v1.70.3 h1:840B8kzqfJDUHUCvSUhoc8MmnOtmGIwEg4WIFiJSy68= +github.com/aws/aws-sdk-go-v2/service/dynamodb v1.70.3/go.mod h1:OYCu7bfkQi8JHCVxkQr0n6e/eL/iiJG0YXFN5fOP3v0= github.com/aws/aws-sdk-go-v2/service/ec2 v1.277.0 h1:RHJSkRXDGkAKrV4CTEsZsZkOmSpxXKO4aKx4rXd94K4= github.com/aws/aws-sdk-go-v2/service/ec2 v1.277.0/go.mod h1:Wg68QRgy2gEGGdmTPU/UbVpdv8sM14bUZmF64KFwAsY= github.com/aws/aws-sdk-go-v2/service/ecs v1.69.5 h1:5nkhwt0d/gjuT3AQ2LUK0aFRNB3MGlzB2elqy/ZsKP4= github.com/aws/aws-sdk-go-v2/service/ecs v1.69.5/go.mod h1:LQMlcWBoiFVD3vUVEz42ST0yTiaDujv2dRE6sXt1yPE= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.14 h1:SA43nfaY7+1jjMNIc2ywu99JLJLButtIdLP6j+bT870= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.14/go.mod h1:Du3llKcwbQvHsTXSLzTOGQz0DTDBMEzdg7DAGu7inrY= -github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.12.6 h1:Bs2OwYq0HBgHYwfGmUwYIPtTNaGMGAHkRje4jmW2VoI= -github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.12.6/go.mod h1:OTctu4cW8t7/TRlTKPLT6akzyOkfceMWhtEHqtYDIQQ= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.33 h1:mqI7OrxN/DUH85F5OqVn3cIfuZ3+HVcebUm2N8mLlgQ= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.33/go.mod h1:eZ5jdEpvaaOU8nWWE4cTAJETSEA5FZoWxvNRao4piHY= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 h1:e6YW5uME30TkrElR+4/xcY7NB6CCj2dcv7vtmGXhfhQ= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21/go.mod h1:obpHAMP693+f3/A8PkLhIqfK1C+NWWn8zXzqD3OH520= +github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.13.6 h1:GxZx+rmWZ1/20VC0K6PJE6KFgIlwovwpJeR4pNKRlLY= +github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.13.6/go.mod h1:AyLP2PNMRAVl7yq1/qoryCn28uRxMEDN4Cb3hTBUkHI= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 h1:LHHdobjo5le1sjJdolitV7uVvYg3wkaeM1Ju2fDgeZQ= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6/go.mod h1:CBGB0evAiaMD3Lk4wPO7LQCcCZLuhzL5Qf/wfEUHQ5w= github.com/aws/aws-sdk-go-v2/service/lightsail v1.50.10 h1:MQuZZ6Tq1qQabPlkVxrCMdyVl70Ogl4AERZKo+y9Wzo= github.com/aws/aws-sdk-go-v2/service/lightsail v1.50.10/go.mod h1:U5C3JME1ibKESmpzBAqlRpTYZfVbTqrb5ICJm+sVVd8= -github.com/aws/aws-sdk-go-v2/service/signin v1.5.2 h1:EjI1CZzDcBxPkTa3j1BdtIrUDbqnOGssFMeyUS+6W0I= -github.com/aws/aws-sdk-go-v2/service/signin v1.5.2/go.mod h1:vN3eb5H8MEAZ4dx0F5Wc9LT8eb3eW7bZZ5BjGJdbw9k= +github.com/aws/aws-sdk-go-v2/service/signin v1.10.4 h1:tvpDjuUvgKURf3Yk4hOaGbZ4QdY+070OWcA5d6LUv2A= +github.com/aws/aws-sdk-go-v2/service/signin v1.10.4/go.mod h1:3ibVKg5Ng82Zby8++jELTD2nHxiPk2DJRLEeW/LKp8M= github.com/aws/aws-sdk-go-v2/service/sns v1.42.2 h1:sG8S3cdfG2+Shse+h8YWTKTrv4sj+48yASyin+YoQHM= github.com/aws/aws-sdk-go-v2/service/sns v1.42.2/go.mod h1:EHECMrJFM/36j9vLqYP/ksa1js/0Kp5RIzxMEX5Yz1g= -github.com/aws/aws-sdk-go-v2/service/sso v1.33.2 h1:zMP1FDFE08L7sM5f1QqkH/ZgKKg8Uc0Dz7KhSSYqWkw= -github.com/aws/aws-sdk-go-v2/service/sso v1.33.2/go.mod h1:0LoIZSUKjdo2BleHfT1hv/jlD33LQS00IrBlzoUsoUQ= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.38.2 h1:9eTqUYl+SyVmaRPMyBXSO9wwqC6TRwZB82pKENK2hdQ= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.38.2/go.mod h1:DThweuz22kiLc7lGHop5vQ9c3bx5W6Azs/YqSHa2fu8= -github.com/aws/aws-sdk-go-v2/service/sts v1.45.2 h1:EJd8vZO3E8SE6nmPqxuxlQ1NeSb8as50sf6eGdV4Saw= -github.com/aws/aws-sdk-go-v2/service/sts v1.45.2/go.mod h1:OgpPvKzsO2Ranjpli/20djMkg6UrV5mw4W3pZpq1Mqo= -github.com/aws/smithy-go v1.27.5 h1:d1ro7KpYOYwP6m73YFa+Kc/A130VsAdX68SpsJwARMM= -github.com/aws/smithy-go v1.27.5/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= -github.com/axiomhq/hyperloglog v0.2.6 h1:sRhvvF3RIXWQgAXaTphLp4yJiX4S0IN3MWTaAgZoRJw= -github.com/axiomhq/hyperloglog v0.2.6/go.mod h1:YjX/dQqCR/7QYX0g8mu8UZAjpIenz1FKM71UEsjFoTo= +github.com/aws/aws-sdk-go-v2/service/sso v1.38.4 h1:ChCtagixSFOxltv0o6E3NT8F7ksvZtZGPwUBynO5Nmk= +github.com/aws/aws-sdk-go-v2/service/sso v1.38.4/go.mod h1:+FEO9jrVMpc9oN3CdAxJbtlQEu3z8UddDPSedpeM3PY= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.4 h1:j6c+HA4AoS0EBEjArPjavFEBrucJEryfrQU0TffmACk= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.4/go.mod h1:RhghaXUk9q66VtOQUX1FdPddQuHnqQZzbB0fEYXmPRA= +github.com/aws/aws-sdk-go-v2/service/sts v1.51.4 h1:OKEfbf2tcfsF2pBk/S9QqNpo6alaAtiBs4hysCsBjPw= +github.com/aws/aws-sdk-go-v2/service/sts v1.51.4/go.mod h1:mCd6qGo9b8hTtfjgsmNkFlzwjyce4owd7HDVFnCLXhM= +github.com/aws/smithy-go v1.28.5 h1:OqbqKtzY9NUnr2yAe9+hiTdFb20tNaK/lI0PMOGXX9k= +github.com/aws/smithy-go v1.28.5/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= +github.com/axiomhq/hyperloglog v0.3.0 h1:IQzzb1zjZiODMwCgBRHKak4oIp2Oj7K0Q0rVoAoFVuM= +github.com/axiomhq/hyperloglog v0.3.0/go.mod h1:YjX/dQqCR/7QYX0g8mu8UZAjpIenz1FKM71UEsjFoTo= 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= @@ -285,13 +285,13 @@ github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5Qvfr github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/docker/docker v28.5.2+incompatible h1:DBX0Y0zAjZbSrm1uzOkdr1onVghKaftjlSWt4AFexzM= github.com/docker/docker v28.5.2+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-connections v0.7.0 h1:6SsRfJddP22WMrCkj19x9WKjEDTB+ahsdiGYf0mN39c= +github.com/docker/go-connections v0.7.0/go.mod h1:no1qkHdjq7kLMGUXYAduOhYPSJxxvgWBh7ogVvptn3Q= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= -github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/dustin/go-humanize v1.1.0 h1:dbKTrvD0klcbBV/h4AWJdMuZogJACoMlvWIWZ5b2xWg= +github.com/dustin/go-humanize v1.1.0/go.mod h1:hc1CvRkJMsgxqjmjMQF3QNRAZBwY8AXBAzKYoSX9sFI= github.com/edsrzf/mmap-go v1.2.0 h1:hXLYlkbaPzt1SaQk+anYwKSRNhufIDCchSPkUD6dD84= github.com/edsrzf/mmap-go v1.2.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q= github.com/efficientgo/core v1.0.0-rc.3 h1:X6CdgycYWDcbYiJr1H1+lQGzx13o7bq3EUkbB9DsSPc= @@ -336,8 +336,8 @@ github.com/fatih/faillint v1.15.0 h1:GBsqRgd/uPvo7AdunUoM4oEBVCE7KCxz77J0f9IKr2w github.com/fatih/faillint v1.15.0/go.mod h1:xg4qfUwfXviSkDlZqJ7cDaf0JyOgR2Hx+a977rJt5Rc= github.com/felixge/fgprof v0.9.5 h1:8+vR6yu2vvSKn08urWyEuxx75NWPEvybbkBirEpsbVY= github.com/felixge/fgprof v0.9.5/go.mod h1:yKl+ERSa++RYOs32d8K6WEXCB4uXdLls4ZaZPpayhMM= -github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= -github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.1.0 h1:3YtUj32ZZkqZtt3sZZsClsymw/QDuVfpNhoA31zeORc= +github.com/felixge/httpsnoop v1.1.0/go.mod h1:Zqxgdd+1Rkcz8euOqdr7lqgCRJztwr5hp9vDSi5UZCE= github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/fsnotify/fsnotify v1.10.1 h1:b0/UzAf9yR5rhf3RPm9gf3ehBPpf0oZKIjtpKrx59Ho= @@ -371,8 +371,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.25.5 h1:xPYEvTb90o1y0epuiOPAoG4QqahjP3cdp5xNlHeKJRI= github.com/go-openapi/analysis v0.25.5/go.mod h1:d3UGtQC5uq5Kqqqis2VH09Km/v3vwsWrYkbp4gdm+Rc= -github.com/go-openapi/errors v0.22.8 h1:oP7sW7TWc3wFFjrzzj0nI83H2qMBkNjNfSd+XRejk/I= -github.com/go-openapi/errors v0.22.8/go.mod h1:BuUoHcYrU6E7V9gfj1I5wLQqgtIHnup/alXZ8KdgQ0w= +github.com/go-openapi/errors v0.22.9 h1:HI9+SyVYiRzyeBQGv0CbWbQa+u2S0nny7G7AhY+UMiM= +github.com/go-openapi/errors v0.22.9/go.mod h1:R73q66sXP2smzAGgFOI4nqtusRK2xN5pYCjsij+KX58= github.com/go-openapi/jsonpointer v1.0.0 h1:kR9tHqY0CtZaOPVFm622dPVNhrvYpwr4uCxgL3h1H8s= github.com/go-openapi/jsonpointer v1.0.0/go.mod h1:Z3rw7dWu1p9IgitXCFamSlA5lmDiklEB6vkaxcNZW5Y= github.com/go-openapi/jsonreference v1.0.0 h1:jlmTr6torcd1YgDQvSfNmRtKzYDO4FGBkrAdlAVWnpY= @@ -385,38 +385,38 @@ github.com/go-openapi/runtime/server-middleware v0.33.0 h1:ZFUNyaa2eUs9DhLd6MTe/ github.com/go-openapi/runtime/server-middleware v0.33.0/go.mod h1:OQHTBqMGquJShXhPYQ62yAqDMtC1rYpsEwldNWjYKhA= github.com/go-openapi/spec v0.22.9 h1:/vKIFDcGKp0ktZWGbym/tJEWbk6/XOEmAVU0kqKMH+w= github.com/go-openapi/spec v0.22.9/go.mod h1:b/mNUYIOQOyIiUzUzXEE8xzyZqf93KvM9hQGP91yfl0= -github.com/go-openapi/strfmt v0.27.0 h1:kbcTeaD9TXuXD0hhMXzuYa1sdTo6+dWGvwjW93E80IM= -github.com/go-openapi/strfmt v0.27.0/go.mod h1:s/qhDqfY72irigXUGJmtgid2Rm+3tnz3k8hZaRmvWYc= +github.com/go-openapi/strfmt v0.27.3 h1:cyf4J5Wjpd6bFpAs44MF8PsbWF/mWXhn82Ck/hgQZgw= +github.com/go-openapi/strfmt v0.27.3/go.mod h1:Bl+xadPLa3nhBiaCAxNND1vrQfzyEjF0vBrLx96n/4E= github.com/go-openapi/swag v0.28.0 h1:xkgbOSKj6DZziNpyqRRAOt3GJGtgjgsd2RoyT30VWuw= github.com/go-openapi/swag v0.28.0/go.mod h1:4qYnT3Cqr1p1VknOdPo70evN4rgQnAg6jwApHyxSGIg= github.com/go-openapi/swag/cmdutils v0.28.0 h1:7TOeNtkYru1SG8Y34tDh9WBbLsMqGnptuxWiHREPZ4Q= github.com/go-openapi/swag/cmdutils v0.28.0/go.mod h1:Sm1MVFMkF6guJJ+pQqHnQA3N0j9qALV3NxzDSv6bETM= -github.com/go-openapi/swag/conv v0.28.0 h1:GtqqbyFe7vR5Y7ehxG9W6/OvrSFdf1OLeTGp40TqxH8= -github.com/go-openapi/swag/conv v0.28.0/go.mod h1:mbUE+mzctnhxi864m0Q07SpN8OowD9JhxmxuYvZZD/k= +github.com/go-openapi/swag/conv v0.29.2 h1:8c9shoB8l0QRSR6ymq1llHdBWDqpIgJfjTGHx3Vuhm0= +github.com/go-openapi/swag/conv v0.29.2/go.mod h1:AZS0YigTNf8qNtD6WqJz/N4RUNmpr76SyjFGkq4+p6Q= github.com/go-openapi/swag/fileutils v0.28.0 h1:Z04XWQD7R8Eq+7GnOrjovBxPPmZzsS4gt2H2GPGIViU= github.com/go-openapi/swag/fileutils v0.28.0/go.mod h1:VvJFZLTZS0AI854gEQz5tk7dBESdLjiNUMSZ/th2ry8= -github.com/go-openapi/swag/jsonutils v0.28.0 h1:YIch6FwO7RXzeAnbO8Tu7dWBZeUEH+4nA0HXltVTnv4= -github.com/go-openapi/swag/jsonutils v0.28.0/go.mod h1:CYM3WlTUcagR2ZoHdz54di/cbBqt82tuxuXgAjxw+mg= -github.com/go-openapi/swag/jsonutils/fixtures_test v0.28.0 h1:qV+VVUAx5Oro8WjVWpZeql7YReTKhT4smR4zhcOQZr0= -github.com/go-openapi/swag/jsonutils/fixtures_test v0.28.0/go.mod h1:mofwUWx70wvskwESqRJ//k/9kURmCgyJl5m5Ppoh5kY= +github.com/go-openapi/swag/jsonutils v0.29.2 h1:uZNSD2/rJDYAfvsLYkykTzXuyxM3QpDKV9jhRHrMu6k= +github.com/go-openapi/swag/jsonutils v0.29.2/go.mod h1:ONTdNvj3Y+IXRzfa17E+Rgt2ns/qiSOYjIo2K7v2yDs= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.29.2 h1:w+Fd6EBOMGlC74GYGHqCLGyb3Bpams8TtNrgM/SG4jo= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.29.2/go.mod h1:HC2egPORFzbj/gf05Zrfgz8Mgplx3oW7hgGi7pjZVhM= github.com/go-openapi/swag/loading v0.28.0 h1:td8QZdZC9MIYGGSnSPKShKiK22I2tU5UQvuUhIBPRLU= github.com/go-openapi/swag/loading v0.28.0/go.mod h1:rXB0QiQX5mMveXEA7ouM4KiiM9jVJe4K6BVbwhD1M4k= github.com/go-openapi/swag/mangling v0.28.0 h1:pH8eyeNO9SLYsTMWJrurnNfKmDa28XrlA+HePVD53VM= github.com/go-openapi/swag/mangling v0.28.0/go.mod h1:jtBE2+V+3pILxOR7Vgce+Cwp6A2PgZbvVqfNntbVs0w= github.com/go-openapi/swag/netutils v0.28.0 h1:YXN6TALEi2pzts8/8GNm6T61HTAZsieukGZidap989k= github.com/go-openapi/swag/netutils v0.28.0/go.mod h1:J+WYyFMLtvtCGqa6jLv+YNUmIKI3ZRQRrvfNDMoQoEQ= -github.com/go-openapi/swag/pools v0.28.0 h1:HPMZWSAfce3rdVTFcjFiCIBtDg9h4x2QlRrHipwhxeU= -github.com/go-openapi/swag/pools v0.28.0/go.mod h1:kVQefhSK5RWuRe7BXsL8htgBPAMpN7HDGpGEknqugeE= +github.com/go-openapi/swag/pools v0.29.2 h1:PlGoDRF8WtSyXkedZZkpW3f9wDhFf3u8KtaBcmgmh8c= +github.com/go-openapi/swag/pools v0.29.2/go.mod h1:V3lhxVT4qDYRqc2MRSSbLsTYIYV/2HlHafhyEkmzLIc= github.com/go-openapi/swag/stringutils v0.28.0 h1:ixsc9iYgDPubHL/8nSkbnryEHpD2VRlBMLKpQyPXcDU= github.com/go-openapi/swag/stringutils v0.28.0/go.mod h1:lzRN95CxXmA03XcDWHLOb6nOMcxCqR5rGY0lOgsfRoM= -github.com/go-openapi/swag/typeutils v0.28.0 h1:nRBKSBXjDgf01VDPB3fWeD9nQuhCOVeIYAkUx2tbkyY= -github.com/go-openapi/swag/typeutils v0.28.0/go.mod h1:Srm0xFNRZ1Y+vCxJclo5qzx8aj+1pAKda/YfFPrG0dQ= +github.com/go-openapi/swag/typeutils v0.29.2 h1:O7aVvkTs3pXwikgtrPLenigEMdQFgONKRooQA9pgf2I= +github.com/go-openapi/swag/typeutils v0.29.2/go.mod h1:7+GDG+uz9Ke+eVt4rClZg7wklSDp8hT/mKNh/pC26TE= github.com/go-openapi/swag/yamlutils v0.28.0 h1:TV3JXH6DS46KUroDtMLAYHGkdWf5VDq3wVWFirmzROY= github.com/go-openapi/swag/yamlutils v0.28.0/go.mod h1:x0q/yndZHEgk9Rx3DyDqzFUmHy55KTvIZldvF2dTJXs= -github.com/go-openapi/testify/enable/yaml/v2 v2.6.0 h1:gGHwAJ0R/5jU8BEGDbfRNR3hL68dAVi84WuOApp29B0= -github.com/go-openapi/testify/enable/yaml/v2 v2.6.0/go.mod h1:tY+St1SGq4NFl0QIqdTY4aEdbChAHxhyB77XQi9iJCo= -github.com/go-openapi/testify/v2 v2.6.0 h1:5PKH2HE7YJ/LuRPQGvSxBRlFXNQhSetBLlGAgUEu3ug= -github.com/go-openapi/testify/v2 v2.6.0/go.mod h1:SgsVHtfooshd0tublTtJ50FPKhujf47YRqauXXOUxfw= +github.com/go-openapi/testify/enable/yaml/v2 v2.7.0 h1:wPW6YRgx3+SID1yUy/Xwa17L8kFEaEKod2VRbJDZNUs= +github.com/go-openapi/testify/enable/yaml/v2 v2.7.0/go.mod h1:mI1M88etYbc3PhgHsWQK2kwvNwW5aGFqMPbmib+SGIs= +github.com/go-openapi/testify/v2 v2.8.0 h1:19QDx5b57p8KjO2E4sgs/woL4Akp+FGLRlVm2xn0Rho= +github.com/go-openapi/testify/v2 v2.8.0/go.mod h1:4gUN8jC+RqOE2qjW/vDmfyTvl5BCht4qL7oca0odrak= github.com/go-openapi/validate v0.26.1 h1:pZSbvtRO8G2R2FpWTYRn3w8LrsNwbtaVhP2dWiBa0Us= github.com/go-openapi/validate v0.26.1/go.mod h1:B8UMgXiQiwwQWIbmuROlwJZDPGlikPuh7iHV1vPX9Oo= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= @@ -440,8 +440,8 @@ github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/K 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.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -github.com/gofrs/flock v0.13.0 h1:95JolYOvGMqeH31+FC7D2+uULf6mG61mEZ/A8dRYMzw= -github.com/gofrs/flock v0.13.0/go.mod h1:jxeyy9R1auM5S6JYDBhDt+E2TCo7DkratH4Pgi8P+Z0= +github.com/gofrs/flock v0.13.1 h1:jjREztyBeSKBZYAC+mgc1laB+xsgy4kYMf3FbKF2UBo= +github.com/gofrs/flock v0.13.1/go.mod h1:sf4BFiHwnvgxa25DlQoDqXQnwRMEOwqxRq37P6MzzmE= github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= @@ -453,8 +453,8 @@ github.com/gogo/status v1.1.1/go.mod h1:jpG3dM5QPcqu19Hg8lkUhBFBa3TcLs1DG7+2Jqci github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63YCY= github.com/golang-jwt/jwt/v5 v5.3.1/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-migrate/migrate/v4 v4.20.1 h1:2N/ToVTKrKl58ynBpgeVJ4In7VcLCjWTZtm4eP1LxhU= +github.com/golang-migrate/migrate/v4 v4.20.1/go.mod h1:DDPgKVb4ovSWc4FwSPfV2Uz1160f4XBiTHTrAJtljmM= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -551,8 +551,8 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.3.11 h1:vAe81Msw+8tKUxi2Dqh/NZMz7475yUvmRIkXr4oN2ao= -github.com/googleapis/enterprise-certificate-proxy v0.3.11/go.mod h1:RFV7MUdlb7AgEq2v7FmMCfeSMCllAzWxFgRdusoGks8= +github.com/googleapis/enterprise-certificate-proxy v0.3.17 h1:73NfMHdiqo9JFU9+7a5ExpVa10/R29pXfZIaW559nrg= +github.com/googleapis/enterprise-certificate-proxy v0.3.17/go.mod h1:rSEsBUemEBZEexP2y6jPp16LUmUbjmSbcPMQizR0o4k= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= @@ -560,8 +560,8 @@ github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0 github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= -github.com/googleapis/gax-go/v2 v2.17.0 h1:RksgfBpxqff0EZkDWYuz9q/uWsTVz+kf43LsZ1J6SMc= -github.com/googleapis/gax-go/v2 v2.17.0/go.mod h1:mzaqghpQp4JDh3HvADwrat+6M3MOIDp5YKHhb9PAgDY= +github.com/googleapis/gax-go/v2 v2.22.0 h1:PjIWBpgGIVKGoCXuiCoP64altEJCj3/Ei+kSU5vlZD4= +github.com/googleapis/gax-go/v2 v2.22.0/go.mod h1:irWBbALSr0Sk3qlqb9SyJ1h68WjgeFuiOzI4Rqw5+aY= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gophercloud/gophercloud/v2 v2.9.0 h1:Y9OMrwKF9EDERcHFSOTpf/6XGoAI0yOxmsLmQki4LPM= github.com/gophercloud/gophercloud/v2 v2.9.0/go.mod h1:Ki/ILhYZr/5EPebrPL9Ej+tUg4lqx71/YH2JWVeU+Qk= @@ -581,14 +581,14 @@ github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2 h1:sGm2vDRFUrQJO/Veii4h4z github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2/go.mod h1:wd1YpapPLivG6nQgbf7ZkG1hhSOXDhhn4MLTknx2aAc= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 h1:5VipnvEpbqr2gA2VbM+nYVbkIF28c5ZQfqCBQ5g2xfk= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0/go.mod h1:Hyl3n6Twe1hvtd9XUXDec4pTvgMSEixRuQKPTMH2bNs= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 h1:/Tnpcb2E0Pz/tN9s3bfEY2Q8ePCEX9iuS+cneUwncnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0/go.mod h1:zOBXOsUaBSjKgmH4OGzV1esUpR3oUSCPYVd2cUBjKYY= github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= -github.com/hashicorp/consul/api v1.34.3 h1:OiZaQnwkS6uvutie3CF6NFXj8uScNezDlsU9MEqKT0s= -github.com/hashicorp/consul/api v1.34.3/go.mod h1:A4wKd7yw7Wz4zn07p74+o0bLBi5dXsSDMMcMCEinY40= +github.com/hashicorp/consul/api v1.34.5 h1:QpMhHZyfYsOsIu5n5QA7TQTLabM4OQJEbKi3pXXnw7U= +github.com/hashicorp/consul/api v1.34.5/go.mod h1:OrXEufkaxFy1pMIRHFrn3JkuircxMhA4BHHpbR8k+5U= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= -github.com/hashicorp/consul/sdk v0.18.1 h1:RDTeBvAeOveI2xI86sV+8WkaN7OkP4zz+cG3fOobDCM= -github.com/hashicorp/consul/sdk v0.18.1/go.mod h1:XdP2tEJmAvlK4jgoKTTtohGkRJlS4mU44mv9/sjU21s= +github.com/hashicorp/consul/sdk v0.18.2 h1:wMFx4OkUPg8un6kimUmzADVBsuRqUdNRtJ0KREGs7vM= +github.com/hashicorp/consul/sdk v0.18.2/go.mod h1:2V4Z2YguOFZelOtkQs3UnIrkCXDQ6iL3P4B6EtSqoQY= github.com/hashicorp/cronexpr v1.1.3 h1:rl5IkxXN2m681EfivTlccqIryzYJSXRGRNa0xeG7NA4= github.com/hashicorp/cronexpr v1.1.3/go.mod h1:P4wA0KBl9C5q2hABiMO7cp6jcIg96CDh1Efb3g1PWA4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -610,6 +610,8 @@ github.com/hashicorp/go-metrics v0.6.0/go.mod h1:0B52B5pZ7+qm5Zhzs8Fygr87isvmUgr github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-msgpack/v2 v2.1.5 h1:Ue879bPnutj/hXfmUk6s/jtIK90XxgiUIcXRl656T44= +github.com/hashicorp/go-msgpack/v2 v2.1.5/go.mod h1:bjCsRXpZ7NsJdk45PoCQnzRGDaK8TKm5ZnDI/9y3J4M= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= @@ -632,8 +634,8 @@ github.com/hashicorp/go-version v1.9.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/golang-lru v0.6.0 h1:uL2shRDx7RTrOrTCUZEGP/wJUFiUI8QT6E7z5o8jga4= -github.com/hashicorp/golang-lru v0.6.0/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= @@ -643,8 +645,8 @@ github.com/hashicorp/nomad/api v0.0.0-20251216171439-1dee0671280e h1:wGl06iy/H90 github.com/hashicorp/nomad/api v0.0.0-20251216171439-1dee0671280e/go.mod h1:sldFTIgs+FsUeKU3LwVjviAIuksxD8TzDOn02MYwslE= github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= -github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY= -github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= +github.com/hashicorp/serf v0.10.4 h1:TCQOrJXHZ1Xf80c4WBhMM9OwUFgDaIP0R+YvoQUKadI= +github.com/hashicorp/serf v0.10.4/go.mod h1:l+s5Q1OSPWU6b9l9m7ODJzTp7mLevSaVzAI03Nka2F0= github.com/hetznercloud/hcloud-go/v2 v2.32.0 h1:BRe+k7ESdYv3xQLBGdKUfk+XBFRJNGKzq70nJI24ciM= github.com/hetznercloud/hcloud-go/v2 v2.32.0/go.mod h1:hAanyyfn9M0cMmZ68CXzPCF54KRb9EXd8eiE2FHKGIE= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= @@ -678,11 +680,11 @@ github.com/keybase/go-keychain v0.0.1 h1:way+bWYa6lDppZoZcgMbYsvC7GxljxrskdNInRt github.com/keybase/go-keychain v0.0.1/go.mod h1:PdEILRW3i9D8JcdM+FmY6RwkHGnhHxXwkPPMeUgOK1k= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.19.1 h1:VsB4HPswih7mmZ8WleSFQ75c/Ui1M4trX5oAsJnhSlk= -github.com/klauspost/compress v1.19.1/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ= +github.com/klauspost/compress v1.20.3 h1:zWNoFqq/lSuYQRim3dUXlXeA0IqwuZGicdG5ZTfY5j4= +github.com/klauspost/compress v1.20.3/go.mod h1:LUdAzn7YLVvxLpc7y3V1m40wESHTgc1422pwwBSKYuI= github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -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/cpuid/v2 v2.4.0 h1:S6Hrbc7+ywsr0r+RLapfGBHfyefhCTwEh3A0tV913Dw= +github.com/klauspost/cpuid/v2 v2.4.0/go.mod h1:19jmZ9mjzoF//ddRSUsv0zfBTJWh3QJh9FNxZTMrGxU= 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= @@ -730,16 +732,16 @@ github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= -github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= +github.com/mattn/go-colorable v0.1.15 h1:+u9SLTRGnXv73cEsnsmoZBom+dMU88B2M0aDcWy0/jY= +github.com/mattn/go-colorable v0.1.15/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= -github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.22 h1:j8l17JJ9i6VGPUFUYoTUKPSgKe/83EYU2zBC7YNKMw4= +github.com/mattn/go-isatty v0.0.22/go.mod h1:ZXfXG4SQHsB/w3ZeOYbR0PrPwLy+n6xiMrJlRFqopa4= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mdlayher/socket v0.6.0 h1:ScZPaAGyO1icQnbFrhPM8mnXyMu9qukC1K4ZoM2IQKU= github.com/mdlayher/socket v0.6.0/go.mod h1:q7vozUAnxSqnjHc12Fik5yUKIzfZ8ITCfMkhOtE9z18= @@ -755,8 +757,8 @@ github.com/minio/crc64nvme v1.1.1 h1:8dwx/Pz49suywbO+auHCBpCtlW1OfpcLN7wYgVR6wAI github.com/minio/crc64nvme v1.1.1/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.2.1 h1:PfBfwvKB/MmqyN8Vb1G9voWisaM9OrLv+WwOvMwS9Dw= -github.com/minio/minio-go/v7 v7.2.1/go.mod h1:EU9hENAStx/xXduNdrGO5e4X5vk19NtgB+RIPjZO8o0= +github.com/minio/minio-go/v7 v7.4.1 h1:PtU/zIOfQRWZ+QydXAZysc+xZYHdG+BBR4Z6TUvy73w= +github.com/minio/minio-go/v7 v7.4.1/go.mod h1:nQnQi7zTfXR4lREtYXZQWqo5aw0Rqv+ZqCGrTORygRk= 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= @@ -776,8 +778,12 @@ github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zx github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= -github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= -github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= +github.com/moby/moby/api v1.54.2 h1:wiat9QAhnDQjA7wk1kh/TqHz2I1uUA7M7t9SAl/JNXg= +github.com/moby/moby/api v1.54.2/go.mod h1:+RQ6wluLwtYaTd1WnPLykIDPekkuyD/ROWQClE83pzs= +github.com/moby/moby/client v0.4.1 h1:DMQgisVoMkmMs7fp3ROSdiBnoAu8+vo3GggFl06M/wY= +github.com/moby/moby/client v0.4.1/go.mod h1:z52C9O2POPOsnxZAy//WtKcQ32P+jT/NGeXu/7nfjGQ= +github.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ= +github.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -818,12 +824,12 @@ github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumul github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor v0.142.0/go.mod h1:fSnKuTN91I68Ou1Lgfwe3Mt6BGl9kcA8PYCpnGkPnsY= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= -github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= +github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040= +github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M= github.com/opentracing-contrib/go-grpc v0.1.4 h1:m9VukGYQ+tfcgtwdsifjjFtAoWRqmcbnGhgRQcZ+ZQA= github.com/opentracing-contrib/go-grpc v0.1.4/go.mod h1:xP8rkWX/qdQJVTkf01D6Fc002zN0WUMKsvuKg7Tf93E= -github.com/opentracing-contrib/go-grpc/test v0.0.0-20260727233914-064b4d2bcbbf h1:xfFA+XblffDh3LsTrbSG1MHpmrXsY/9GQI4sbCnY+kI= -github.com/opentracing-contrib/go-grpc/test v0.0.0-20260727233914-064b4d2bcbbf/go.mod h1:AYO7D5MbvWwD7/UggkDbqyW0pDt7KZyQkHCn4IC2i/w= +github.com/opentracing-contrib/go-grpc/test v0.0.0-20260921214634-c4b381826b81 h1:OTbhGHT9+eMbYR7J0zJw741aJHsDo4SZrecanjdSFiQ= +github.com/opentracing-contrib/go-grpc/test v0.0.0-20260921214634-c4b381826b81/go.mod h1:EgSh6JmUwxmDnsxBVhxd1UjP+jOJPo7O/3zPWO9kiPo= github.com/opentracing-contrib/go-stdlib v1.1.1 h1:nl22krMt3PpAWPCKpDjFiAH4Qdr2855F5wOkQ52C0+w= github.com/opentracing-contrib/go-stdlib v1.1.1/go.mod h1:S0p+X9p6dcBkoMTL+Qq2VOvxKs9ys5PpYWXWqlCS0bQ= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -838,8 +844,8 @@ github.com/parquet-go/bitpack v1.0.0 h1:AUqzlKzPPXf2bCdjfj4sTeacrUwsT7NlcYDMUQxP 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.30.1 h1:Oy6ganNrAdFiVwy7wNmWagfPTWA2X9Z3tVHBc7JtuX8= -github.com/parquet-go/parquet-go v0.30.1/go.mod h1:navtkAYr2LGoJVp141oXPlO/sxLvaOe3la2JEoD8+rg= +github.com/parquet-go/parquet-go v0.32.0 h1:NWDqTUHfrCS4cJP/Fj2HlxvqsrVedWG3sayMkf+znzM= +github.com/parquet-go/parquet-go v0.32.0/go.mod h1:navtkAYr2LGoJVp141oXPlO/sxLvaOe3la2JEoD8+rg= 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= @@ -886,8 +892,8 @@ github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1: github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= -github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= +github.com/prometheus/client_model v0.6.3 h1:O0jaTVAYNxTHYInEPFJt5I3+sN8zqBtVMPTB1qyxiEo= +github.com/prometheus/client_model v0.6.3/go.mod h1:gpN5P9S7Rr6Yr92PiQ+Ixvhf6JZEkF1dnxsYL2aPBEM= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= 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= @@ -918,8 +924,8 @@ github.com/redis/rueidis v1.0.61/go.mod h1:Lkhr2QTgcoYBhxARU7kJRO8SyVlgUuEkcJO1Y github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= -github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= +github.com/rogpeppe/go-internal v1.16.0 h1:O9DK+vNMDVGLr2BeZqmpLeMjiMNkuXfcqntWbZV6S5g= +github.com/rogpeppe/go-internal v1.16.0/go.mod h1:DrUVZyrJU+txYW5/1kwtXQSMFio52ZOxX7yM1VHvnxs= github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.6.0 h1:fV591PaemRlL6JfRxGDEPl69wICngIQ3shQtzfy2gxU= @@ -939,8 +945,8 @@ github.com/sercand/kuberesolver/v5 v5.1.1/go.mod h1:Fs1KbKhVRnB2aDWN12NjKCB+RgYM github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w= -github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g= +github.com/sirupsen/logrus v1.10.2 h1:G2SED73/qrAu6YwbdxOD6peLkCBI3z7L+ykJFTXJBBo= +github.com/sirupsen/logrus v1.10.2/go.mod h1:SLEg8TqYulVKKfIGHldVp2K2aYz2DKSVBq4g/H5bR7Q= github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= github.com/sony/gobreaker v0.5.0/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= @@ -956,16 +962,17 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.13.0/go.mod h1:Icm2xNL3/8uyh/wFuB1jI7TiTNKp8632Nwegu+zgdYw= -github.com/spiffe/go-spiffe/v2 v2.7.0 h1:uXe1MflJoHw58wAUvxVlcM7WpKtijWG7I1UidcGh6g4= -github.com/spiffe/go-spiffe/v2 v2.7.0/go.mod h1:47Q0Q9/AqGha8QLHp+kxpH4Wca7X7EnOtlIJy3mxZ3U= +github.com/spiffe/go-spiffe/v2 v2.8.1 h1:eXZMLsu+3MLEPJyGJkolqtVrteZfQdUpOWj6LTiDl/E= +github.com/spiffe/go-spiffe/v2 v2.8.1/go.mod h1:47Q0Q9/AqGha8QLHp+kxpH4Wca7X7EnOtlIJy3mxZ3U= github.com/stackitcloud/stackit-sdk-go/core v0.20.1 h1:odiuhhRXmxvEvnVTeZSN9u98edvw2Cd3DcnkepncP3M= github.com/stackitcloud/stackit-sdk-go/core v0.20.1/go.mod h1:fqto7M82ynGhEnpZU6VkQKYWYoFG5goC076JWXTUPRQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/objx v0.5.3 h1:jmXUvGomnU1o3W/V5h2VEradbpJDwGrzugQQvL0POH4= +github.com/stretchr/objx v0.5.3/go.mod h1:rDQraq+vQZU7Fde9LOZLr8Tax6zZvy4kuNKF+QYS+U0= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -979,8 +986,9 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.563/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/kms v1.0.563/go.mod h1:uom4Nvi9W+Qkom0exYiJ9VWJjXwyxtPYTkKkaLMlfE0= @@ -994,8 +1002,8 @@ github.com/thanos-io/promql-engine v0.0.0-20261020165614-7157e606efa6 h1:jEE4chR github.com/thanos-io/promql-engine v0.0.0-20261020165614-7157e606efa6/go.mod h1:uzn40oZHPXvfdP498h+MiRL2fN7RF519gNaV3LyhChc= github.com/thanos-io/thanos v0.42.5-0.20261008195948-dd67d9cc81c3 h1:idn6HjA+bPG4MbQevVmmBkce1uKmgsn5c8wy7+irJ+s= github.com/thanos-io/thanos v0.42.5-0.20261008195948-dd67d9cc81c3/go.mod h1:4RXnRoz0Bft5oxH3VS0E7g9z7VKPz7Q0KB4EywvwHOw= -github.com/tinylib/msgp v1.6.1 h1:ESRv8eL3u+DNHUoSAAQRE50Hm162zqAnBoGv9PzScPY= -github.com/tinylib/msgp v1.6.1/go.mod h1:RSp0LW9oSxFut3KzESt5Voq4GVWyS+PSulT77roAqEA= +github.com/tinylib/msgp v1.6.4 h1:mOwYbyYDLPj35mkA2BjjYejgJk9BuHxDdvRnb6v2ZcQ= +github.com/tinylib/msgp v1.6.4/go.mod h1:RSp0LW9oSxFut3KzESt5Voq4GVWyS+PSulT77roAqEA= github.com/tjhop/slog-gokit v0.2.2 h1:ev90r/tMq5cx7q6lMuhJ6v7fjsr1bDho7W2BLAFVwtI= github.com/tjhop/slog-gokit v0.2.2/go.mod h1:yA48zAHvV+Sg4z4VRyeFyFUNNXd3JY5Zg84u3USICq0= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= @@ -1074,12 +1082,12 @@ go.opentelemetry.io/collector/consumer/consumertest v0.142.0 h1:TRt8zR57Vk1PTjtq go.opentelemetry.io/collector/consumer/consumertest v0.142.0/go.mod h1:yq2dhMxFUlCFkRN7LES3fzsTmUDw9VaunyRAka2TEaY= go.opentelemetry.io/collector/consumer/xconsumer v0.142.0 h1:qOoQnLZXQ9sRLexTkkmBx3qfaOmEgco9VBPmryg5UhA= go.opentelemetry.io/collector/consumer/xconsumer v0.142.0/go.mod h1:oPN0yJzEpovwlWvmSaiYgtDqGuOmMMLmmg352sqZdsE= -go.opentelemetry.io/collector/featuregate v1.61.0 h1:XtnQ/XPHLmw9zgg4Cjq/f0rgdqn7z1M10wnmGhgNbYk= -go.opentelemetry.io/collector/featuregate v1.61.0/go.mod h1:4ga1QBMPEejXXmpyJS8lmaRpknJ3Lb9Bvk6e420bUFU= -go.opentelemetry.io/collector/internal/testutil v0.155.0 h1:ExZ3lqM1e1Y83AAXKr6Xsw20v4LHW6GZ8VeLLQHiOrA= -go.opentelemetry.io/collector/internal/testutil v0.155.0/go.mod h1:Jkjs6rkqs973LqgZ0Fe3zrokQRKULYXPIf4HuqStiEE= -go.opentelemetry.io/collector/pdata v1.61.0 h1:EVfGB/9dcyMXhMsZ5kzKeGFJj8QWqvmZjgg4RMjnRhE= -go.opentelemetry.io/collector/pdata v1.61.0/go.mod h1:qYEsyeIJ9tWHb2jSR5HQ9/VmbCGVca+G+ZDAB8dFCMc= +go.opentelemetry.io/collector/featuregate v1.69.0 h1:RapEMYjBfvt9IUP3ypQ9Y7/g21nwRzvtKO3dSOCCL6E= +go.opentelemetry.io/collector/featuregate v1.69.0/go.mod h1:dRYifiJa2vQ6LWpPwHny4mL82mnGWsWEVeVWw+DhYJw= +go.opentelemetry.io/collector/internal/testutil v0.163.0 h1:JR65ZHtuOP1E5cJZKl4ub/UFHQ7xo3KN/Iryhtc0P5E= +go.opentelemetry.io/collector/internal/testutil v0.163.0/go.mod h1:RUvWdMZGEBicc0C3teDcnTrifUX8HB4AJ4l8pMONURU= +go.opentelemetry.io/collector/pdata v1.69.0 h1:u0a2n1kOS/OGwIEQMOKCnl+bbmFG5wGO/OfFXajICpA= +go.opentelemetry.io/collector/pdata v1.69.0/go.mod h1:5U4aIRhQKQgo3DifeWgVdWBhSBbYV2BQ6Nz4bJc7dfE= go.opentelemetry.io/collector/pdata/pprofile v0.142.0 h1:Ivyw7WY8SIIWqzXsnNmjEgz3ysVs/OkIf0KIpJUnuuo= go.opentelemetry.io/collector/pdata/pprofile v0.142.0/go.mod h1:94GAph54K4WDpYz9xirhroHB3ptNLuPiY02k8fyoNUI= go.opentelemetry.io/collector/pdata/testdata v0.142.0 h1:+jf9RyLWl8WyhIVjpg7yuH+bRdQH4mW20cPtCMlY1cI= @@ -1096,56 +1104,58 @@ go.opentelemetry.io/collector/semconv v0.128.0 h1:MzYOz7Vgb3Kf5D7b49pqqgeUhEmOCu go.opentelemetry.io/collector/semconv v0.128.0/go.mod h1:OPXer4l43X23cnjLXIZnRj/qQOjSuq4TgBLI76P9hns= go.opentelemetry.io/contrib/detectors/gcp v1.44.0 h1:NmLfL734pJhM0JKaYd2Y28+nY9dPRWYAAbxhRCrKXPw= go.opentelemetry.io/contrib/detectors/gcp v1.44.0/go.mod h1:tNAsgd8avTGke1+MndXlU5Cru4PQ9Ai/cCNWQv/ZJ/s= -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/google.golang.org/grpc/otelgrpc v0.70.0 h1:oECp5f+hN7nkwjU/8BxQ/q23bGPb8FIrD839owX222E= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.70.0/go.mod h1:DqEFwLumhzMBDQv9PcWbyoDxHI/4lAk6CM4nJBH39sc= go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.69.0 h1:MCcYL7J6Vt/X0kjqbMZkekCmwsurbQRbL69vkiye2lk= go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.69.0/go.mod h1:3jnStNwSufK+f5ktjL4EPcwtig4rtd81NS70lqHuXl8= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0 h1:8tvICD4vSTOOsNrsI4Ljf6C+6UKvpTEH5XY3JMoyPoo= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0/go.mod h1:z9+yiacE0IHRqM4qFfkbt/JYlmYXgss8GY/jXoNuPJI= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0 h1:LMuyCAyfalSjDyjdC65nK6N0zoTT63+E/u95X0JovZI= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0/go.mod h1:085m8qbm4hgc8rZWGDEa4vmyyo2c3nPxUslYUKUIU04= 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.44.0 h1:Rtvfd6nTbAF2csjiw41m1DfuqC5TneXs+gB84ZA3gq4= -go.opentelemetry.io/contrib/propagators/aws v1.44.0/go.mod h1:auu0tIyZErQGLLUvOp9DgmhKALIoebR4Fpkt9CT0c0k= +go.opentelemetry.io/contrib/propagators/aws v1.47.0 h1:n/2x/vQki1ojD7R2jYHdnNdI74Yx/OFdY4YXFFesm8M= +go.opentelemetry.io/contrib/propagators/aws v1.47.0/go.mod h1:qz0eA26XfmJUDbcqCZrn2HJ5WIETXpcMfiKRAEHRvmQ= 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= go.opentelemetry.io/contrib/propagators/jaeger v1.36.0/go.mod h1:VHu48l0YTRKSObdPQ+Sb8xMZvdnJlN7yhHuHoPgNqHM= go.opentelemetry.io/contrib/propagators/ot v1.36.0 h1:UBoZjbx483GslNKYK2YpfvePTJV4BHGeFd8+b7dexiM= go.opentelemetry.io/contrib/propagators/ot v1.36.0/go.mod h1:adDDRry19/n9WoA7mSCMjoVJcmzK/bZYzX9SR+g2+W4= -go.opentelemetry.io/otel v1.45.0 h1:pdrWmLHofpubmArBv1LgFSv1Z0Ie/ppdZzu+kUN5EeU= -go.opentelemetry.io/otel v1.45.0/go.mod h1:XZxIqPapzEYnhNSScF5DIqXhm/rYi0FzCe2XddAwZfQ= -go.opentelemetry.io/otel/bridge/opentracing v1.45.0 h1:hFf959SYHZpFc8ZWlqiYlnH3Ke5w4fcWZh7He+CmqXk= -go.opentelemetry.io/otel/bridge/opentracing v1.45.0/go.mod h1:etOoQoentzhTX0XTaRJmwlsiQx8TXD7mHo76YxNeBYg= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.44.0 h1:4YsVu3B8+3qtWYYrsUYgn0OG78pN0rnNPRGX4SbokQI= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.44.0/go.mod h1:+wnlSn0mD1ADVMe3v9Z/WIaiz6q6gL2J/ejaAmdmv80= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.44.0 h1:qazEJlUOQzhCpzQpFETGby7EdqjI1wsd0W+6Gg1SCTU= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.44.0/go.mod h1:fOD2Yefuxixkx3ahVNf0O/PERb6r4OlbxfATVnYvzCo= +go.opentelemetry.io/otel v1.47.0 h1:j7ALJ/zgkS7Z6aeJW09p8VC9804bC+PpeTfCD4XPnOM= +go.opentelemetry.io/otel v1.47.0/go.mod h1:8wS9O2qfXrYrzp6hIF/HOYJJf/wIhFPhR2xLuP+iXQU= +go.opentelemetry.io/otel/bridge/opentracing v1.47.0 h1:s3CJ/gi1BywMOOKLvu9m6nNDf26x8+Cf+OkNKtTIRPY= +go.opentelemetry.io/otel/bridge/opentracing v1.47.0/go.mod h1:sSsj7slxZdcL7gtBnE7IT1T2yr0Zk85Ynf52xWRnfes= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 h1:julhjPeUH/q/7hinbSdDdqt5h7Zw9YWmRlWRhI0jd54= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0/go.mod h1:Ao2mz688LH/tFf0yMAenidq6k2YNSx6SIY2q6jDACck= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.47.0 h1:UFpxOpYPmMNUtOWhdb+nC1WELIgVf8z9higURrbzYU4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.47.0/go.mod h1:YBGjxe3lt0jtXoEXxGrGhv/jM7oUBUDVK7zhAvNyEjc= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.44.0 h1:lgh3PiVrRUWMLOVSkQicxzZll5NjF1r+AtsX1XRIHw0= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.44.0/go.mod h1:5Cnhth3m/AgOeTgE3ex12pPmiu/gGtZit03kSzx9X7s= 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/metric v1.45.0 h1:7Eg1uH7CJ5cXv9is6tnBe1FI6rj1nwUdbFypRm3br/M= -go.opentelemetry.io/otel/metric v1.45.0/go.mod h1:HAPbm1nd3p1PmFH7v2dR+6BjXxw+Lq4a2+pndMAm08s= -go.opentelemetry.io/otel/metric/x v0.66.0 h1:YkCrx1zLOChi9ZcZ6euupOcsgzbVlec7D/xoEU1+cTA= -go.opentelemetry.io/otel/metric/x v0.66.0/go.mod h1:d1+BDj9t96do0/1LoU1ayfCv79ZgNE41qbhBvnMOBZk= -go.opentelemetry.io/otel/sdk v1.44.0 h1:nHYwb9lK+fJPU/dnT6s7W7Z8itMWyqrnVfbheVYrZ58= -go.opentelemetry.io/otel/sdk v1.44.0/go.mod h1:Osuydd3Se74nqjAKxid74N5eC+jfEqfTegHRnq58oK0= -go.opentelemetry.io/otel/sdk/metric v1.44.0 h1:3LlKgI+VjbVsjNRFZJZAJ30WjXC5VkNRks6si09iEfI= -go.opentelemetry.io/otel/sdk/metric v1.44.0/go.mod h1:5B5pMARnXxKhltooO4xUuCBorl65a4EpnTalObqOigA= -go.opentelemetry.io/otel/trace v1.45.0 h1:l/mP6Uv7oNO7/TblbhpbgMidxhq1uO/rPsikOyVhxag= -go.opentelemetry.io/otel/trace v1.45.0/go.mod h1:qoJJA2xNMnxRrdISU/kLtfUH2wNeQbiv+jhs/CxI8bc= +go.opentelemetry.io/otel/log v1.47.0 h1:cOTS1CcLbSQeZKanGJ+0JpF/+t4PELi3O3bbl2lqCcI= +go.opentelemetry.io/otel/log v1.47.0/go.mod h1:9byitSQ5pLC6PpqwGXjqdMKya6ZTswHRZh2vvXT33nw= +go.opentelemetry.io/otel/metric v1.47.0 h1:4PptaldXx3Eat1XjMZ68pPJEs5wrhlemctZE9a3UdWY= +go.opentelemetry.io/otel/metric v1.47.0/go.mod h1:ADGSXxRrXM6bjbvLo535EstVFlPpPYZm4LBKixjDHwU= +go.opentelemetry.io/otel/metric/x v0.69.0 h1:DjRLr15H83v+hCW7JA9NoJvOkYTtmq5YoDRbe9deYpM= +go.opentelemetry.io/otel/metric/x v0.69.0/go.mod h1:uVvsMPMFFyj/HUQfrUnH3JjnOQ1dwFDorgFLRBasM0k= +go.opentelemetry.io/otel/sdk v1.47.0 h1:zWXEr4j2lFefG87TU6Yg8a7ngfohIKFZHKp0Hf5hC6I= +go.opentelemetry.io/otel/sdk v1.47.0/go.mod h1:VUc24kiOeoGsxG8G9ULx3fWKvB7jMhnGE8Oi607lgR0= +go.opentelemetry.io/otel/sdk/metric v1.47.0 h1:lfISg2j93VT6yqdk9OfUaZmw/GfcZqCCV3jdXtsPnKw= +go.opentelemetry.io/otel/sdk/metric v1.47.0/go.mod h1:ypLp+mW1Nt2x+Szt3b5/i1syodyts49lMOwxpDI3VGw= +go.opentelemetry.io/otel/trace v1.47.0 h1:JOjX/Oci8K94QHddo+bbfya/Ai/nf6/dt9ZfrFNWSrM= +go.opentelemetry.io/otel/trace v1.47.0/go.mod h1:jNaSLa2PZEYFG6fRjJABAu+bw4FS08uDmPg28lTghu0= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.opentelemetry.io/proto/otlp v1.10.0 h1:IQRWgT5srOCYfiWnpqUYz9CVmbO8bFmKcwYxpuCSL2g= -go.opentelemetry.io/proto/otlp v1.10.0/go.mod h1:/CV4QoCR/S9yaPj8utp3lvQPoqMtxXdzn7ozvvozVqk= -go.opentelemetry.io/proto/slim/otlp v1.10.0 h1:iR97Vs/ZDR+y9TfuP9b1XBtdPWeC+OMslIBmhcLU7jM= -go.opentelemetry.io/proto/slim/otlp v1.10.0/go.mod h1:lV9250stpjYLPNA5viFabIgP2QlUGRT1GdTgAf8SIUk= -go.opentelemetry.io/proto/slim/otlp/collector/profiles/v1development v0.3.0 h1:RUF5rO0hAlgiJt1fzQVzcVs3vZVNHIcMLgOgG4rWNcQ= -go.opentelemetry.io/proto/slim/otlp/collector/profiles/v1development v0.3.0/go.mod h1:I89cynRj8y+383o7tEQVg2SVA6SRgDVIouWPUVXjx0U= -go.opentelemetry.io/proto/slim/otlp/profiles/v1development v0.3.0 h1:CQvJSldHRUN6Z8jsUeYv8J0lXRvygALXIzsmAeCcZE0= -go.opentelemetry.io/proto/slim/otlp/profiles/v1development v0.3.0/go.mod h1:xSQ+mEfJe/GjK1LXEyVOoSI1N9JV9ZI923X5kup43W4= +go.opentelemetry.io/proto/otlp v1.11.0 h1:5rrYs0Ykyj50sdU/JU0x8etU+LubXWb+gED6TbEdMIk= +go.opentelemetry.io/proto/otlp v1.11.0/go.mod h1:SmVizdCOAm3XBtG1g1NnOdhW6jtddT72hLMhv8VwA8E= +go.opentelemetry.io/proto/slim/otlp v1.11.1 h1:qf2OA3kQcIDXh3q7b6kc0IzRe8BFXlVIlH5uaOACrVQ= +go.opentelemetry.io/proto/slim/otlp v1.11.1/go.mod h1:15pWfj6/rYjQzyrC3ZGQoZ0rNgLqI/Lk+jFgYgV4UIE= +go.opentelemetry.io/proto/slim/otlp/collector/profiles/v1development v0.4.1 h1:pgPIbi29ViNY/gE//bHlHuLyqHE+PDhhw7jAhItWIaM= +go.opentelemetry.io/proto/slim/otlp/collector/profiles/v1development v0.4.1/go.mod h1:MSbd82YGFGySHE+GsR2J7+RvMf7mgnknr7IFjsxfoTs= +go.opentelemetry.io/proto/slim/otlp/profiles/v1development v0.4.1 h1:pso/53PWXaoGeW+/ww9WHKxoWTbTJBSmUH1VsiEmelU= +go.opentelemetry.io/proto/slim/otlp/profiles/v1development v0.4.1/go.mod h1:axuN0N02xZ3l+3zFqWXXRBTC6766vGQ0PbeCh46kuXA= 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= +go.uber.org/atomic v1.12.0 h1:BvcXdFKuviU4fTL/f+SxdQ5qJX/Jix8pAkgdUcb3XOE= +go.uber.org/atomic v1.12.0/go.mod h1:I6c4cg+6HCxRjfjSsYtApoFILnpc0CGUdGkXVqbYVNk= go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs= go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= @@ -1160,8 +1170,8 @@ go.uber.org/zap v1.27.1 h1:08RqriUEv8+ArZRYSTXy1LeBScaMpVSTBhCeaZYfMYc= go.uber.org/zap v1.27.1/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ= go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ= -go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= -go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -1175,8 +1185,8 @@ golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= -golang.org/x/crypto v0.55.0 h1:+KWHjbgOaAQ66dh/YlkZKHlz9ZUlq61AFirAR9ntP8M= -golang.org/x/crypto v0.55.0/go.mod h1:uq0V9dE/fzQuJtbnL+2EhWOE63vo164FY8xqEnV9xis= +golang.org/x/crypto v0.57.0 h1:3ZVCjf8Ggz7zneR/EHRVx68Ctf+2pmIMP2UFhh9cC6M= +golang.org/x/crypto v0.57.0/go.mod h1:Fdz0i5U6CoizGwLda9DttjSk6qlZo25zYNtR+ycvuZA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1216,8 +1226,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.40.0 h1:hUv+3cXcdRHz08UmSiOob7sadHig73uo5bkXxQ/tvUs= -golang.org/x/mod v0.40.0/go.mod h1:0/weTWkPWGBikyTWAX3dkjVztMmBA5hM0DH6BElSupE= +golang.org/x/mod v0.41.0 h1:qJmnOUb4YB+FsEuM3HcWucdZASCPGhsX6uljO6pog0c= +golang.org/x/mod v0.41.0/go.mod h1:Ek9pY8RKWXwsWvd3rQiHYtMqkjSUV+s1Rj7j4H5Ur6o= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1270,8 +1280,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/net v0.58.0 h1:ynWG7rqYi4ccpTEuPZ2QGWHktVEM9DMCj9yzDE0Q7To= -golang.org/x/net v0.58.0/go.mod h1:YwCddHnFlT7eLQqVprV19OnhLGtc5xOKgE0RyqgfWAU= +golang.org/x/net v0.60.0 h1:79p50tfZlm0J9YfoDsSi639qSXNGVwEzOPLCxM2FsYU= +golang.org/x/net v0.60.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= 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= @@ -1308,8 +1318,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek= -golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk= +golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1398,16 +1408,16 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= -golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo= +golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= -golang.org/x/term v0.45.0 h1:NwWyBmoJCbfTHpxrWoZ9C6/VxOf7ic219I8xZZFdrf0= -golang.org/x/term v0.45.0/go.mod h1:9aqxs0blBcrm/n0L9QW0aRVD+ktan8ssZromtqJC43w= +golang.org/x/term v0.46.0 h1:3+OXuTbaKDgwk8jTi3aSLHRlmWqHEUDUtxnbFigO4YE= +golang.org/x/term v0.46.0/go.mod h1:+K02xbkittuwc0Am4abfA3Fc+XRGXkvBXNO88NCXPoc= 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= @@ -1420,13 +1430,13 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.41.0 h1:vz/seA0lnX87Othu2f/0L24RcgrXD9/YFTSuGjj3rH8= -golang.org/x/text v0.41.0/go.mod h1:jvf1O8ajNzZqhSrQBPbutR/EB83Cc0CFrezNQIwbb5M= +golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI= +golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E= 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.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U= -golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= +golang.org/x/time v0.16.0 h1:vMb6ptszcQMkcwiRTAuNNU50gom6++Q/6gY2hDM6VDE= +golang.org/x/time v0.16.0/go.mod h1:rVKOqvZeKvrDKTQiAHJ7wmwP0RzleSphoEA9RcdLA0s= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -1485,8 +1495,8 @@ golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.49.0 h1:3NI7VXzL9+1WZD52Dx2ttoPwD5DWrFGpl9mFZDlmisI= -golang.org/x/tools v0.49.0/go.mod h1:SJNXV9DBKT0UbdttsQjbfJlAE/q+y36++zo3uL3N0Oo= +golang.org/x/tools v0.50.0 h1:c2ifzfcuY7L90lZ2aKd8S4K2NpASF08SZx9ZuJkHmSU= +golang.org/x/tools v0.50.0/go.mod h1:7ulVMw3831Mwi5EZD6RomGyffr4VFjuNYXf2BbCEAV0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1534,8 +1544,8 @@ google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRR google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.81.0/go.mod h1:FA6Mb/bZxj706H2j+j2d6mHEEaHBmbbWnkfvmorOCko= -google.golang.org/api v0.264.0 h1:+Fo3DQXBK8gLdf8rFZ3uLu39JpOnhvzJrLMQSoSYZJM= -google.golang.org/api v0.264.0/go.mod h1:fAU1xtNNisHgOF5JooAs8rRaTkl2rT3uaoNGo9NS3R8= +google.golang.org/api v0.287.0 h1:CQDMqUiqZZ0U/Yge3zyjAhNQ0OSYEH0PaA7l4xtEen4= +google.golang.org/api v0.287.0/go.mod h1:pPW85yt3Iuc3unkpaMhFtMmOqnTdCwCqEOaUlnuxRlQ= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= 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= @@ -1623,12 +1633,12 @@ google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20260128011058-8636f8732409 h1:VQZ/yAbAtjkHgH80teYd2em3xtIkkHd7ZhqfH2N9CsM= -google.golang.org/genproto v0.0.0-20260128011058-8636f8732409/go.mod h1:rxKD3IEILWEu3P44seeNOAwZN4SaoKaQ/2eTg4mM6EM= -google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa h1:Kjn0N0tCrDgiAFW+lGO4JZ3ck44CehvJQMAwj9QF0G8= -google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa/go.mod h1:q4lMZS6kskjT5HvCPrnnypcDPVJqT/f4nfxmkE7gryY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260803160001-6ac0973c030d h1:IL4hdHzcUv2l/gcg98/Rj3FbtE6axwqslOW8SW0C+S0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260803160001-6ac0973c030d/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= +google.golang.org/genproto v0.0.0-20260630182238-925bb5da69e7 h1:lQG76ePMKmtujel4VIVMiFoHVWVNtJdawbCZJtWlVXU= +google.golang.org/genproto v0.0.0-20260630182238-925bb5da69e7/go.mod h1:LwlOWYBU335L+sR55UuR5fbbU8KmEX+3tUHf3SwMmhM= +google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc h1:rZHRz0ogq4Pid1IKtA/ivHi8XONVF5tqUQXA2TtgpkE= +google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc/go.mod h1:K/n0XLazCJHjD73YuMyNJsN38BPPy1kfFnKxUXaThFU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc h1:4bNTbnb44EqGVy9HaQxSY2jnafSUdgV3qHtedvNpDKg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -1660,8 +1670,8 @@ google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ5 google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.83.1 h1:HIO0+BEtBP6soyqvqC8sNUjZ7bTs+0hFQuFF+RAy++Y= -google.golang.org/grpc v1.83.1/go.mod h1:kDyl6SKsiHKt0uylY5gtn5cEjkrIOhQOGDgIc4JGwzQ= +google.golang.org/grpc v1.84.0 h1:soMyaPJ8pAak5PIQ0DGBUir0XRo2fRoMqhNWMLlLxO0= +google.golang.org/grpc v1.84.0/go.mod h1:ljCht0DrxQrXBDRTZp52Qxh3Ffk8CdYm2sj4O2QN2C0= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1677,8 +1687,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= -google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= +google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= +google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1690,8 +1700,8 @@ gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWM gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.67.2 h1:JtOSMb9OuaCZKr7h5D/h6iii14sK0hLbplTc6frx4Ss= -gopkg.in/ini.v1 v1.67.2/go.mod h1:x/cyOwCgZqOkJoDIJ3c1KNHMo10+nLGAhh+kn3Zizss= +gopkg.in/ini.v1 v1.67.3 h1:iM9Lhz5MRSGhHVGGwCuzG9KO8PoirCXj/m/qTmOJJQw= +gopkg.in/ini.v1 v1.67.3/go.mod h1:x/cyOwCgZqOkJoDIJ3c1KNHMo10+nLGAhh+kn3Zizss= gopkg.in/telebot.v3 v3.3.8 h1:uVDGjak9l824FN9YARWUHMsiNZnlohAVwUycw21k6t8= gopkg.in/telebot.v3 v3.3.8/go.mod h1:1mlbqcLTVSfK9dx7fdp+Nb5HZsy4LLPtpZTKmwhwtzM= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= diff --git a/vendor/cloud.google.com/go/auth/CHANGES.md b/vendor/cloud.google.com/go/auth/CHANGES.md index 846231f64a8..2c1f6ff8fac 100644 --- a/vendor/cloud.google.com/go/auth/CHANGES.md +++ b/vendor/cloud.google.com/go/auth/CHANGES.md @@ -1,5 +1,13 @@ # Changes +## [0.20.0](https://github.com/googleapis/google-cloud-go/releases/tag/auth%2Fv0.20.0) (2026-04-06) + +## [0.19.0](https://github.com/googleapis/google-cloud-go/releases/tag/auth%2Fv0.19.0) (2026-03-23) + +### Features + +* add OpenTelemetry gRPC and HTTP wrappers for T4 tracing (#14133) ([d38abf9](https://github.com/googleapis/google-cloud-go/commit/d38abf988d4017b4832434abae9a90874bec5ce9)) + ## [0.18.2](https://github.com/googleapis/google-cloud-go/releases/tag/auth%2Fv0.18.2) (2026-02-13) ### Bug Fixes diff --git a/vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go b/vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go index 9b4b1f06e88..f77f6423c4a 100644 --- a/vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go +++ b/vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go @@ -22,19 +22,27 @@ import ( "errors" "fmt" "log/slog" + "net" "net/http" "os" + "strconv" + "strings" "cloud.google.com/go/auth" "cloud.google.com/go/auth/credentials" "cloud.google.com/go/auth/internal" "cloud.google.com/go/auth/internal/transport" "cloud.google.com/go/auth/internal/transport/headers" + "github.com/googleapis/gax-go/v2" + "github.com/googleapis/gax-go/v2/callctx" "github.com/googleapis/gax-go/v2/internallog" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/trace" "google.golang.org/grpc" grpccreds "google.golang.org/grpc/credentials" grpcinsecure "google.golang.org/grpc/credentials/insecure" + "google.golang.org/grpc/stats" ) const ( @@ -47,6 +55,30 @@ const ( quotaProjectHeaderKey = "X-goog-user-project" ) +// codeToStr is a reversal of the `strToCode` map in +// https://github.com/grpc/grpc-go/blob/master/codes/codes.go +// The gRPC specification has exactly 17 status codes, defined +// as a contiguous block of integers from 0 to 16. +var codeToStr = [...]string{ + "OK", // codes.OK = 0 + "CANCELED", // codes.Canceled = 1 + "UNKNOWN", // codes.Unknown = 2 + "INVALID_ARGUMENT", // codes.InvalidArgument = 3 + "DEADLINE_EXCEEDED", // codes.DeadlineExceeded = 4 + "NOT_FOUND", // codes.NotFound = 5 + "ALREADY_EXISTS", // codes.AlreadyExists = 6 + "PERMISSION_DENIED", // codes.PermissionDenied = 7 + "RESOURCE_EXHAUSTED", // codes.ResourceExhausted = 8 + "FAILED_PRECONDITION", // codes.FailedPrecondition = 9 + "ABORTED", // codes.Aborted = 10 + "OUT_OF_RANGE", // codes.OutOfRange = 11 + "UNIMPLEMENTED", // codes.Unimplemented = 12 + "INTERNAL", // codes.Internal = 13 + "UNAVAILABLE", // codes.Unavailable = 14 + "DATA_LOSS", // codes.DataLoss = 15 + "UNAUTHENTICATED", // codes.Unauthenticated = 16 +} + var ( // Set at init time by dial_socketopt.go. If nil, socketopt is not supported. timeoutDialerOption grpc.DialOption @@ -198,7 +230,7 @@ type InternalOptions struct { // service. DefaultScopes []string // SkipValidation bypasses validation on Options. It should only be used - // internally for clients that needs more control over their transport. + // internally for clients that need more control over their transport. SkipValidation bool // TelemetryAttributes specifies a map of telemetry attributes to be added // to all OpenTelemetry signals, such as tracing and metrics, for purposes @@ -338,7 +370,7 @@ func dial(ctx context.Context, secure bool, opts *Options) (*grpc.ClientConn, er // Add tracing, but before the other options, so that clients can override the // gRPC stats handler. // This assumes that gRPC options are processed in order, left to right. - grpcOpts = addOpenTelemetryStatsHandler(grpcOpts, opts) + grpcOpts = addOpenTelemetryStatsHandler(grpcOpts, opts, transportCreds.Endpoint) grpcOpts = append(grpcOpts, opts.GRPCDialOpts...) return grpc.DialContext(ctx, transportCreds.Endpoint, grpcOpts...) @@ -426,9 +458,218 @@ func (c *grpcCredentialsProvider) RequireTransportSecurity() bool { return c.secure } -func addOpenTelemetryStatsHandler(dialOpts []grpc.DialOption, opts *Options) []grpc.DialOption { +func addOpenTelemetryStatsHandler(dialOpts []grpc.DialOption, opts *Options, endpoint string) []grpc.DialOption { if opts.DisableTelemetry { return dialOpts } - return append(dialOpts, grpc.WithStatsHandler(otelgrpc.NewClientHandler())) + if gax.IsFeatureEnabled("METRICS") { + host, port := extractHostPort(endpoint) + dialOpts = append(dialOpts, grpc.WithChainUnaryInterceptor(openTelemetryUnaryClientInterceptor(host, port))) + } + if !gax.IsFeatureEnabled("TRACING") && !gax.IsFeatureEnabled("LOGGING") { + return append(dialOpts, grpc.WithStatsHandler(otelgrpc.NewClientHandler())) + } + var staticAttrs []attribute.KeyValue + var scopedLogger *slog.Logger + + if gax.IsFeatureEnabled("LOGGING") && opts.Logger != nil { + scopedLogger = opts.Logger + } + + if opts.InternalOptions != nil { + staticAttrs = transport.StaticTelemetryAttributes(opts.InternalOptions.TelemetryAttributes) + if scopedLogger != nil { + var staticLogAttrs []any + for _, attr := range staticAttrs { + staticLogAttrs = append(staticLogAttrs, slog.String(string(attr.Key), attr.Value.AsString())) + } + scopedLogger = scopedLogger.With(staticLogAttrs...) + } + } + var otelOpts []otelgrpc.Option + if gax.IsFeatureEnabled("TRACING") { + otelOpts = append(otelOpts, otelgrpc.WithSpanAttributes(staticAttrs...)) + } + return append(dialOpts, grpc.WithStatsHandler(&otelHandler{ + Handler: otelgrpc.NewClientHandler(otelOpts...), + logger: scopedLogger, + })) +} + +// Extract the host and port from a target address +func extractHostPort(target string) (string, int) { + if idx := strings.Index(target, "://"); idx != -1 { + target = target[idx+3:] + // Ensure any leading authorities (like 8.8.8.8 in dns://8.8.8.8/foo) are stripped + if slashIdx := strings.Index(target, "/"); slashIdx != -1 { + target = target[slashIdx+1:] + } + } + host, portStr, err := net.SplitHostPort(target) + if err != nil { + return target, 0 + } + port, err := strconv.Atoi(portStr) + if err != nil { + return host, 0 + } + return host, port +} + +// openTelemetryUnaryClientInterceptor returns an interceptor that populates +// TransportTelemetryData with the server peer address. +func openTelemetryUnaryClientInterceptor(host string, port int) grpc.UnaryClientInterceptor { + return func(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error { + transportData := gax.ExtractTransportTelemetry(ctx) + if transportData != nil { + if host != "" { + transportData.SetServerAddress(host) + } + if port != 0 { + transportData.SetServerPort(port) + } + } + + err := invoker(ctx, method, req, reply, cc, opts...) + + return err + } +} + +// otelHandler is a wrapper around the OpenTelemetry gRPC client handler that +// adds custom Google Cloud-specific attributes to spans and metrics. +type otelHandler struct { + stats.Handler + logger *slog.Logger +} + +// TagRPC intercepts the RPC start to extract dynamic attributes like resource +// name and retry count from the outgoing context metadata and attach them to +// the current span. +func (h *otelHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context { + ctx = h.Handler.TagRPC(ctx, info) + + var span trace.Span + if gax.IsFeatureEnabled("TRACING") { + if s := trace.SpanFromContext(ctx); s != nil && s.IsRecording() { + span = s + } + } + + if span == nil { + return ctx + } + var attrs []attribute.KeyValue + if resName, ok := callctx.TelemetryFromContext(ctx, "resource_name"); ok { + attrs = append(attrs, attribute.String("gcp.resource.destination.id", resName)) + } + if resendCountStr, ok := callctx.TelemetryFromContext(ctx, "resend_count"); ok { + if count, err := strconv.Atoi(resendCountStr); err == nil { + attrs = append(attrs, attribute.Int("gcp.grpc.resend_count", count)) + } + } + if len(attrs) > 0 { + span.SetAttributes(attrs...) + } + return ctx +} + +// HandleRPC intercepts the RPC completion to capture and format error-related +// attributes ensuring they conform to Google Cloud observability standards. +func (h *otelHandler) HandleRPC(ctx context.Context, s stats.RPCStats) { + end, ok := s.(*stats.End) + if !ok { + h.Handler.HandleRPC(ctx, s) + return + } + + var span trace.Span + if gax.IsFeatureEnabled("TRACING") { + if s := trace.SpanFromContext(ctx); s != nil && s.IsRecording() { + span = s + } + } + + var logger *slog.Logger + if gax.IsFeatureEnabled("LOGGING") { + if l := h.logger; l != nil && l.Enabled(ctx, slog.LevelDebug) { + logger = l + } + } + + if span == nil && logger == nil { + h.Handler.HandleRPC(ctx, s) + return + } + + if end.Error != nil { + h.handleRPCError(ctx, span, logger, end) + } else { + h.handleRPCSuccess(span) + } + h.Handler.HandleRPC(ctx, s) +} + +func (h *otelHandler) handleRPCError(ctx context.Context, span trace.Span, logger *slog.Logger, end *stats.End) { + info := gax.ExtractTelemetryErrorInfo(ctx, end.Error) + + if logger != nil { + logActionableError(ctx, logger, info) + } + + if span != nil { + attrs := []attribute.KeyValue{ + attribute.String("error.type", info.ErrorType), + attribute.String("status.message", info.StatusMessage), + attribute.String("rpc.response.status_code", info.StatusCode), + attribute.String("exception.type", fmt.Sprintf("%T", end.Error)), + } + span.SetAttributes(attrs...) + } +} + +func (h *otelHandler) handleRPCSuccess(span trace.Span) { + if span != nil { + attrs := []attribute.KeyValue{ + attribute.String("rpc.response.status_code", "OK"), + } + span.SetAttributes(attrs...) + } +} + +func logActionableError(ctx context.Context, logger *slog.Logger, info gax.TelemetryErrorInfo) { + baseLogAttrs := []slog.Attr{ + slog.String("rpc.system.name", "grpc"), + slog.String("rpc.response.status_code", info.StatusCode), + } + + if resendCountStr, ok := callctx.TelemetryFromContext(ctx, "resend_count"); ok { + if count, e := strconv.Atoi(resendCountStr); e == nil { + baseLogAttrs = append(baseLogAttrs, slog.Int64("gcp.grpc.resend_count", int64(count))) + } + } + + msg := info.StatusMessage + if msg == "" { + msg = "API call failed" + } + + if rpcMethod, ok := callctx.TelemetryFromContext(ctx, "rpc_method"); ok { + baseLogAttrs = append(baseLogAttrs, slog.String("rpc.method", rpcMethod)) + } + + if resName, ok := callctx.TelemetryFromContext(ctx, "resource_name"); ok { + baseLogAttrs = append(baseLogAttrs, slog.String("gcp.resource.destination.id", resName)) + } + + if info.Domain != "" { + baseLogAttrs = append(baseLogAttrs, slog.String("gcp.errors.domain", info.Domain)) + } + for k, v := range info.Metadata { + baseLogAttrs = append(baseLogAttrs, slog.String("gcp.errors.metadata."+k, v)) + } + + baseLogAttrs = append(baseLogAttrs, slog.String("error.type", info.ErrorType)) + + logger.LogAttrs(ctx, slog.LevelDebug, msg, baseLogAttrs...) } diff --git a/vendor/cloud.google.com/go/auth/httptransport/transport.go b/vendor/cloud.google.com/go/auth/httptransport/transport.go index 3feb997c76d..87b3fef2187 100644 --- a/vendor/cloud.google.com/go/auth/httptransport/transport.go +++ b/vendor/cloud.google.com/go/auth/httptransport/transport.go @@ -15,11 +15,17 @@ package httptransport import ( + "bytes" "context" "crypto/tls" + "fmt" + "io" + "log/slog" "net" "net/http" "os" + "strconv" + "sync" "time" "cloud.google.com/go/auth" @@ -28,12 +34,18 @@ import ( "cloud.google.com/go/auth/internal/transport" "cloud.google.com/go/auth/internal/transport/cert" "cloud.google.com/go/auth/internal/transport/headers" + "github.com/googleapis/gax-go/v2" + "github.com/googleapis/gax-go/v2/callctx" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/trace" "golang.org/x/net/http2" + "google.golang.org/api/googleapi" ) const ( quotaProjectHeaderKey = "X-goog-user-project" + maxErrorReadBytes = int64(8192) // 8KB ) func newTransport(base http.RoundTripper, opts *Options) (http.RoundTripper, error) { @@ -173,7 +185,308 @@ func addOpenTelemetryTransport(trans http.RoundTripper, opts *Options) http.Roun if opts.DisableTelemetry { return trans } - return otelhttp.NewTransport(trans) + + var traceAttrs []attribute.KeyValue + var scopedLogger *slog.Logger + + if gax.IsFeatureEnabled("LOGGING") && opts.Logger != nil { + scopedLogger = opts.Logger + } + + if opts.InternalOptions != nil { + attrs := transport.StaticTelemetryAttributes(opts.InternalOptions.TelemetryAttributes) + if gax.IsFeatureEnabled("TRACING") { + traceAttrs = attrs + } + if scopedLogger != nil { + var logAttrs []any + for _, attr := range attrs { + logAttrs = append(logAttrs, slog.String(string(attr.Key), attr.Value.AsString())) + } + scopedLogger = scopedLogger.With(logAttrs...) + } + } + + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + trans = &otelAttributeTransport{ + base: trans, + logger: scopedLogger, + } + } + + if !gax.IsFeatureEnabled("TRACING") && !gax.IsFeatureEnabled("LOGGING") { + return otelhttp.NewTransport(trans) + } + + var otelOpts []otelhttp.Option + if len(traceAttrs) > 0 { + otelOpts = append(otelOpts, otelhttp.WithSpanOptions(trace.WithAttributes(traceAttrs...))) + } + return otelhttp.NewTransport(trans, otelOpts...) +} + +// otelAttributeTransport is a wrapper around an http.RoundTripper that adds +// custom Google Cloud-specific attributes to OpenTelemetry spans. +type otelAttributeTransport struct { + base http.RoundTripper + logger *slog.Logger +} + +// RoundTrip intercepts the HTTP request and response to enrich the active +// OpenTelemetry span with static and dynamic attributes, as well as detailed +// error information. +func (t *otelAttributeTransport) RoundTrip(req *http.Request) (*http.Response, error) { + var span trace.Span + if gax.IsFeatureEnabled("TRACING") { + if s := trace.SpanFromContext(req.Context()); s != nil && s.IsRecording() { + span = s + } + } + + if span != nil { + var attrs []attribute.KeyValue + attrs = append(attrs, attribute.String("rpc.system.name", "http")) + if resName, ok := callctx.TelemetryFromContext(req.Context(), "resource_name"); ok { + attrs = append(attrs, attribute.String("gcp.resource.destination.id", resName)) + } + if resendCountStr, ok := callctx.TelemetryFromContext(req.Context(), "resend_count"); ok { + if count, err := strconv.Atoi(resendCountStr); err == nil { + attrs = append(attrs, attribute.Int("http.request.resend_count", count)) + } + } + if urlTemplate, ok := callctx.TelemetryFromContext(req.Context(), "url_template"); ok { + attrs = append(attrs, attribute.String("url.template", urlTemplate)) + span.SetName(fmt.Sprintf("%s %s", req.Method, urlTemplate)) + } + span.SetAttributes(attrs...) + } + + var data *gax.TransportTelemetryData + if gax.IsFeatureEnabled("METRICS") { + data = gax.ExtractTransportTelemetry(req.Context()) + if data != nil && req.URL != nil { + host := req.URL.Hostname() + if host != "" { + data.SetServerAddress(host) + } + portStr := req.URL.Port() + if portStr == "" { + if req.URL.Scheme == "https" { + portStr = "443" + } else if req.URL.Scheme == "http" { + portStr = "80" + } + } + if port, pErr := strconv.Atoi(portStr); pErr == nil { + data.SetServerPort(port) + } + } + } + + resp, err := t.base.RoundTrip(req) + + var logger *slog.Logger + if gax.IsFeatureEnabled("LOGGING") { + if l := t.logger; l != nil && l.Enabled(req.Context(), slog.LevelDebug) { + logger = l + } + } + + if span == nil && logger == nil { + return resp, err + } + + if err != nil { + t.logAndSpanError(req, resp, err, err, span, logger) + } else if resp.StatusCode >= 400 { + if resp.Body != nil && resp.Body != http.NoBody && (resp.ContentLength < 0 || resp.ContentLength <= maxErrorReadBytes) { + resp.Body = &errorTrackingBody{ + ReadCloser: resp.Body, + req: req, + resp: resp, + span: span, + logger: logger, + t: t, + } + } else { + t.logAndSpanError(req, resp, &googleapi.Error{ + Code: resp.StatusCode, + Message: resp.Status, + }, nil, span, logger) + } + } else { + if span != nil { + span.SetAttributes(attribute.Int("http.response.status_code", resp.StatusCode)) + } + } + + return resp, err +} + +func (t *otelAttributeTransport) logAndSpanError(req *http.Request, resp *http.Response, errToParse error, netErr error, span trace.Span, logger *slog.Logger) { + var httpStatusCode int + if resp != nil { + httpStatusCode = resp.StatusCode + } + + info := gax.ExtractTelemetryErrorInfo(req.Context(), errToParse) + + if netErr == nil && resp != nil && resp.StatusCode >= 400 { + if info.ErrorType == "*googleapi.Error" { + info.ErrorType = strconv.Itoa(resp.StatusCode) + } + } + + if logger != nil { + logAttrs := []slog.Attr{ + slog.String("rpc.system.name", "http"), + } + if httpStatusCode > 0 { + logAttrs = append(logAttrs, slog.Int64("http.response.status_code", int64(httpStatusCode))) + } + + ctx := req.Context() + if resendCountStr, ok := callctx.TelemetryFromContext(ctx, "resend_count"); ok { + if count, e := strconv.Atoi(resendCountStr); e == nil { + logAttrs = append(logAttrs, slog.Int64("http.request.resend_count", int64(count))) + } + } + if urlTemplate, ok := callctx.TelemetryFromContext(ctx, "url_template"); ok { + logAttrs = append(logAttrs, slog.String("url.template", urlTemplate)) + } + logAttrs = append(logAttrs, slog.String("http.request.method", req.Method)) + + msg := info.StatusMessage + if msg == "" { + msg = "API call failed" + } + + if rpcMethod, ok := callctx.TelemetryFromContext(ctx, "rpc_method"); ok { + logAttrs = append(logAttrs, slog.String("rpc.method", rpcMethod)) + } + + if resName, ok := callctx.TelemetryFromContext(ctx, "resource_name"); ok { + logAttrs = append(logAttrs, slog.String("gcp.resource.destination.id", resName)) + } + + if info.Domain != "" { + logAttrs = append(logAttrs, slog.String("gcp.errors.domain", info.Domain)) + } + for k, v := range info.Metadata { + logAttrs = append(logAttrs, slog.String("gcp.errors.metadata."+k, v)) + } + + logAttrs = append(logAttrs, slog.String("error.type", info.ErrorType)) + if info.StatusCode != "" { + logAttrs = append(logAttrs, slog.String("rpc.response.status_code", info.StatusCode)) + } + + logger.LogAttrs(ctx, slog.LevelDebug, msg, logAttrs...) + } + + if span != nil { + if netErr != nil { + span.SetAttributes( + attribute.String("error.type", info.ErrorType), + attribute.String("status.message", info.StatusMessage), + attribute.String("exception.type", fmt.Sprintf("%T", netErr)), + ) + } else { + span.SetAttributes( + attribute.Int("http.response.status_code", httpStatusCode), + attribute.String("error.type", info.ErrorType), + attribute.String("status.message", info.StatusMessage), + ) + } + } +} + +type errorTrackingBody struct { + io.ReadCloser + req *http.Request + resp *http.Response + span trace.Span + logger *slog.Logger + t *otelAttributeTransport + + mu sync.Mutex + buf bytes.Buffer + recorded bool +} + +func (b *errorTrackingBody) Read(p []byte) (n int, err error) { + n, err = b.ReadCloser.Read(p) + + b.mu.Lock() + shouldRecord := false + if !b.recorded { + if n > 0 { + remaining := maxErrorReadBytes - int64(b.buf.Len()) + if remaining > 0 { + if int64(n) > remaining { + b.buf.Write(p[:remaining]) + } else { + b.buf.Write(p[:n]) + } + } + } + + if err == io.EOF || int64(b.buf.Len()) >= maxErrorReadBytes { + shouldRecord = true + b.recorded = true + } + } + b.mu.Unlock() + + if shouldRecord { + b.recordError() + } + + return n, err +} + +func (b *errorTrackingBody) Close() error { + b.mu.Lock() + shouldRecord := !b.recorded + b.recorded = true + b.mu.Unlock() + + // We can close the network stream immediately. + err := b.ReadCloser.Close() + + // Do heavy in-memory telemetry parsing without holding the lock + if shouldRecord { + b.recordError() // If this panics here, the socket is already released + } + + return err +} + +func (b *errorTrackingBody) recordError() { + errToParse := &googleapi.Error{ + Code: b.resp.StatusCode, + Message: b.resp.Status, + } + + if b.buf.Len() > 0 { + clone := *b.resp + clone.Body = io.NopCloser(bytes.NewReader(b.buf.Bytes())) + if errResp := googleapi.CheckResponse(&clone); errResp != nil { + if gErr, ok := errResp.(*googleapi.Error); ok { + if gErr.Message == "" { + gErr.Message = b.resp.Status + } + errToParse = gErr + } else { + errToParse = &googleapi.Error{ + Code: b.resp.StatusCode, + Message: errResp.Error(), + } + } + } + } + + b.t.logAndSpanError(b.req, b.resp, errToParse, nil, b.span, b.logger) } type authTransport struct { diff --git a/vendor/cloud.google.com/go/auth/internal/transport/transport.go b/vendor/cloud.google.com/go/auth/internal/transport/transport.go index 5c8721efa9f..fb0a8a1e074 100644 --- a/vendor/cloud.google.com/go/auth/internal/transport/transport.go +++ b/vendor/cloud.google.com/go/auth/internal/transport/transport.go @@ -24,8 +24,38 @@ import ( "time" "cloud.google.com/go/auth/credentials" + "go.opentelemetry.io/otel/attribute" ) +// knownKeys provides keys for reading telemetry attributes from Context. +// It provides an implicit contract with generated client library code +// using the same keys. The keys in this collection should not be removed +// or modified. New keys may be added, but they will need to be explicitly +// used in code referencing this collection in order to appear in telemetry. +var knownKeys = []string{ + "gcp.client.service", + "gcp.client.version", + "gcp.client.repo", + "gcp.client.artifact", + "gcp.client.language", + "url.domain", +} + +// StaticTelemetryAttributes selectively converts known keys from a map of +// strings to Open Telemetry attributes. +func StaticTelemetryAttributes(m map[string]string) []attribute.KeyValue { + var staticAttrs []attribute.KeyValue + if m == nil { + return staticAttrs + } + for _, k := range knownKeys { + if v, ok := m[k]; ok { + staticAttrs = append(staticAttrs, attribute.String(k, v)) + } + } + return staticAttrs +} + // CloneDetectOptions clones a user set detect option into some new memory that // we can internally manipulate before sending onto the detect package. func CloneDetectOptions(oldDo *credentials.DetectOptions) *credentials.DetectOptions { diff --git a/vendor/cloud.google.com/go/auth/internal/version.go b/vendor/cloud.google.com/go/auth/internal/version.go index b73008694f2..d627069b570 100644 --- a/vendor/cloud.google.com/go/auth/internal/version.go +++ b/vendor/cloud.google.com/go/auth/internal/version.go @@ -4,7 +4,7 @@ // 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 +// https://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, @@ -17,4 +17,4 @@ package internal // Version is the current tagged release of the library. -const Version = "0.18.2" +const Version = "0.20.0" diff --git a/vendor/cloud.google.com/go/iam/.repo-metadata.json b/vendor/cloud.google.com/go/iam/.repo-metadata.json new file mode 100644 index 00000000000..bdabea916f5 --- /dev/null +++ b/vendor/cloud.google.com/go/iam/.repo-metadata.json @@ -0,0 +1,10 @@ +{ + "api_shortname": "iam", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/iam/latest", + "client_library_type": "manual", + "description": "Cloud IAM", + "distribution_name": "cloud.google.com/go/iam", + "language": "go", + "library_type": "CORE", + "release_level": "stable" +} \ No newline at end of file diff --git a/vendor/cloud.google.com/go/iam/CHANGES.md b/vendor/cloud.google.com/go/iam/CHANGES.md index a91f9186b72..6a43a667839 100644 --- a/vendor/cloud.google.com/go/iam/CHANGES.md +++ b/vendor/cloud.google.com/go/iam/CHANGES.md @@ -1,6 +1,22 @@ # Changes +## [1.11.0](https://github.com/googleapis/google-cloud-go/releases/tag/iam%2Fv1.11.0) (2026-05-07) + +## [1.10.0](https://github.com/googleapis/google-cloud-go/releases/tag/iam%2Fv1.10.0) (2026-04-30) + +## [1.9.0](https://github.com/googleapis/google-cloud-go/releases/tag/iam%2Fv1.9.0) (2026-04-13) + +## [1.8.0](https://github.com/googleapis/google-cloud-go/releases/tag/iam%2Fv1.8.0) (2026-04-09) + +## [1.7.0](https://github.com/googleapis/google-cloud-go/releases/tag/iam%2Fv1.7.0) (2026-04-02) + +## [1.6.0](https://github.com/googleapis/google-cloud-go/releases/tag/iam%2Fv1.6.0) (2026-03-26) + +### Features + +* update image to us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/librarian-go@sha256:f9f9065a893591ad505df3384f409e9d404132d8c83b5d4bcbb8ae1650553b3b ([9a2be95](https://github.com/googleapis/google-cloud-go/commit/9a2be95cffe44aa7e6d68c08fff6d85a3a13a9b7)) + ## [1.5.3](https://github.com/googleapis/google-cloud-go/compare/iam/v1.5.2...iam/v1.5.3) (2025-10-08) diff --git a/vendor/cloud.google.com/go/iam/README.md b/vendor/cloud.google.com/go/iam/README.md index 0072cc9e294..5f525c59416 100644 --- a/vendor/cloud.google.com/go/iam/README.md +++ b/vendor/cloud.google.com/go/iam/README.md @@ -1,8 +1,8 @@ -# IAM API +# Identity and Access Management (IAM) API [![Go Reference](https://pkg.go.dev/badge/cloud.google.com/go/iam.svg)](https://pkg.go.dev/cloud.google.com/go/iam) -Go Client Library for IAM API. +Go Client Library for Identity and Access Management (IAM) API. ## Install @@ -19,6 +19,21 @@ However, a `v1+` module may have breaking changes in two scenarios: * Packages with `alpha` or `beta` in the import path * The GoDoc has an explicit stability disclaimer (for example, for an experimental feature). +### Which package to use? + +Generated client library surfaces can be found in packages whose import path +ends in `.../apivXXX`. The `XXX` could be something like `1` or `2` in the case +of a stable service backend or may be like `1beta2` or `2beta` in the case of a +more experimental service backend. Because of this fact, a given module can have +multiple clients for different service backends. In these cases it is generally +recommended to use clients with stable service backends, with import suffixes like +`apiv1`, unless you need to use features that are only present in a beta backend +or there is not yet a stable backend available. + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples?l=go). + ## Go Version Support See the [Go Versions Supported](https://github.com/googleapis/google-cloud-go#go-versions-supported) diff --git a/vendor/cloud.google.com/go/iam/apiv1/iampb/iam_policy.pb.go b/vendor/cloud.google.com/go/iam/apiv1/iampb/iam_policy.pb.go index 51a944cfa45..a15659c6e44 100644 --- a/vendor/cloud.google.com/go/iam/apiv1/iampb/iam_policy.pb.go +++ b/vendor/cloud.google.com/go/iam/apiv1/iampb/iam_policy.pb.go @@ -14,19 +14,21 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 -// protoc v4.25.7 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: google/iam/v1/iam_policy.proto package iampb import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" - reflect "reflect" - sync "sync" ) const ( @@ -38,10 +40,7 @@ const ( // Request message for `SetIamPolicy` method. type SetIamPolicyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // REQUIRED: The resource for which the policy is being specified. // See the operation documentation for the appropriate value for this field. Resource string `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` @@ -55,7 +54,9 @@ type SetIamPolicyRequest struct { // following default mask is used: // // `paths: "bindings, etag"` - UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` + UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *SetIamPolicyRequest) Reset() { @@ -111,16 +112,15 @@ func (x *SetIamPolicyRequest) GetUpdateMask() *fieldmaskpb.FieldMask { // Request message for `GetIamPolicy` method. type GetIamPolicyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // REQUIRED: The resource for which the policy is being requested. // See the operation documentation for the appropriate value for this field. Resource string `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` // OPTIONAL: A `GetPolicyOptions` object for specifying options to // `GetIamPolicy`. - Options *GetPolicyOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` + Options *GetPolicyOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GetIamPolicyRequest) Reset() { @@ -169,10 +169,7 @@ func (x *GetIamPolicyRequest) GetOptions() *GetPolicyOptions { // Request message for `TestIamPermissions` method. type TestIamPermissionsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // REQUIRED: The resource for which the policy detail is being requested. // See the operation documentation for the appropriate value for this field. Resource string `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` @@ -180,7 +177,9 @@ type TestIamPermissionsRequest struct { // wildcards (such as '*' or 'storage.*') are not allowed. For more // information see // [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - Permissions []string `protobuf:"bytes,2,rep,name=permissions,proto3" json:"permissions,omitempty"` + Permissions []string `protobuf:"bytes,2,rep,name=permissions,proto3" json:"permissions,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TestIamPermissionsRequest) Reset() { @@ -229,13 +228,12 @@ func (x *TestIamPermissionsRequest) GetPermissions() []string { // Response message for `TestIamPermissions` method. type TestIamPermissionsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // A subset of `TestPermissionsRequest.permissions` that the caller is // allowed. - Permissions []string `protobuf:"bytes,1,rep,name=permissions,proto3" json:"permissions,omitempty"` + Permissions []string `protobuf:"bytes,1,rep,name=permissions,proto3" json:"permissions,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TestIamPermissionsResponse) Reset() { @@ -277,98 +275,39 @@ func (x *TestIamPermissionsResponse) GetPermissions() []string { var File_google_iam_v1_iam_policy_proto protoreflect.FileDescriptor -var file_google_iam_v1_iam_policy_proto_rawDesc = []byte{ - 0x0a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x69, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x2f, - 0x69, 0x61, 0x6d, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x0d, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x1a, - 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, - 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x69, 0x61, 0x6d, 0x2f, 0x76, - 0x31, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x1a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x69, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x70, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, - 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xad, 0x01, - 0x0a, 0x13, 0x53, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x03, 0x0a, - 0x01, 0x2a, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x32, 0x0a, 0x06, - 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 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, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, - 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x77, 0x0a, - 0x13, 0x47, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x03, 0x0a, 0x01, - 0x2a, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x39, 0x0a, 0x07, 0x6f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x69, 0x0a, 0x19, 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, 0x12, 0x25, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x03, 0x0a, 0x01, 0x2a, - 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0b, 0x70, 0x65, - 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x42, - 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x22, 0x3e, 0x0a, 0x1a, 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, 0x12, - 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x32, 0xb4, 0x03, 0x0a, 0x09, 0x49, 0x41, 0x4d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, - 0x74, 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, 0x29, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x23, 0x3a, 0x01, 0x2a, 0x22, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x3d, 0x2a, 0x2a, 0x7d, 0x3a, 0x73, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x74, 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, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x3a, 0x01, 0x2a, 0x22, 0x1e, 0x2f, 0x76, 0x31, - 0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3d, 0x2a, 0x2a, 0x7d, 0x3a, 0x67, - 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x9a, 0x01, 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, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, - 0x01, 0x2a, 0x22, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x3d, 0x2a, 0x2a, 0x7d, 0x3a, 0x74, 0x65, 0x73, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x65, 0x72, - 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x1e, 0xca, 0x41, 0x1b, 0x69, 0x61, 0x6d, - 0x2d, 0x6d, 0x65, 0x74, 0x61, 0x2d, 0x61, 0x70, 0x69, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x42, 0x7c, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x49, - 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x29, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x69, 0x61, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31, 0x2f, 0x69, - 0x61, 0x6d, 0x70, 0x62, 0x3b, 0x69, 0x61, 0x6d, 0x70, 0x62, 0xaa, 0x02, 0x13, 0x47, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x49, 0x61, 0x6d, 0x2e, 0x56, 0x31, - 0xca, 0x02, 0x13, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, - 0x49, 0x61, 0x6d, 0x5c, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_google_iam_v1_iam_policy_proto_rawDesc = "" + + "\n" + + "\x1egoogle/iam/v1/iam_policy.proto\x12\rgoogle.iam.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/iam/v1/options.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a google/protobuf/field_mask.proto\"\xad\x01\n" + + "\x13SetIamPolicyRequest\x12%\n" + + "\bresource\x18\x01 \x01(\tB\t\xe0A\x02\xfaA\x03\n" + + "\x01*R\bresource\x122\n" + + "\x06policy\x18\x02 \x01(\v2\x15.google.iam.v1.PolicyB\x03\xe0A\x02R\x06policy\x12;\n" + + "\vupdate_mask\x18\x03 \x01(\v2\x1a.google.protobuf.FieldMaskR\n" + + "updateMask\"w\n" + + "\x13GetIamPolicyRequest\x12%\n" + + "\bresource\x18\x01 \x01(\tB\t\xe0A\x02\xfaA\x03\n" + + "\x01*R\bresource\x129\n" + + "\aoptions\x18\x02 \x01(\v2\x1f.google.iam.v1.GetPolicyOptionsR\aoptions\"i\n" + + "\x19TestIamPermissionsRequest\x12%\n" + + "\bresource\x18\x01 \x01(\tB\t\xe0A\x02\xfaA\x03\n" + + "\x01*R\bresource\x12%\n" + + "\vpermissions\x18\x02 \x03(\tB\x03\xe0A\x02R\vpermissions\">\n" + + "\x1aTestIamPermissionsResponse\x12 \n" + + "\vpermissions\x18\x01 \x03(\tR\vpermissions2\xb4\x03\n" + + "\tIAMPolicy\x12t\n" + + "\fSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\")\x82\xd3\xe4\x93\x02#:\x01*\"\x1e/v1/{resource=**}:setIamPolicy\x12t\n" + + "\fGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\")\x82\xd3\xe4\x93\x02#:\x01*\"\x1e/v1/{resource=**}:getIamPolicy\x12\x9a\x01\n" + + "\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"/\x82\xd3\xe4\x93\x02):\x01*\"$/v1/{resource=**}:testIamPermissions\x1a\x1e\xcaA\x1biam-meta-api.googleapis.comB|\n" + + "\x11com.google.iam.v1B\x0eIamPolicyProtoP\x01Z)cloud.google.com/go/iam/apiv1/iampb;iampb\xaa\x02\x13Google.Cloud.Iam.V1\xca\x02\x13Google\\Cloud\\Iam\\V1b\x06proto3" var ( file_google_iam_v1_iam_policy_proto_rawDescOnce sync.Once - file_google_iam_v1_iam_policy_proto_rawDescData = file_google_iam_v1_iam_policy_proto_rawDesc + file_google_iam_v1_iam_policy_proto_rawDescData []byte ) func file_google_iam_v1_iam_policy_proto_rawDescGZIP() []byte { file_google_iam_v1_iam_policy_proto_rawDescOnce.Do(func() { - file_google_iam_v1_iam_policy_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_iam_v1_iam_policy_proto_rawDescData) + file_google_iam_v1_iam_policy_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_iam_v1_iam_policy_proto_rawDesc), len(file_google_iam_v1_iam_policy_proto_rawDesc))) }) return file_google_iam_v1_iam_policy_proto_rawDescData } @@ -411,7 +350,7 @@ func file_google_iam_v1_iam_policy_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_iam_v1_iam_policy_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_iam_v1_iam_policy_proto_rawDesc), len(file_google_iam_v1_iam_policy_proto_rawDesc)), NumEnums: 0, NumMessages: 4, NumExtensions: 0, @@ -422,7 +361,6 @@ func file_google_iam_v1_iam_policy_proto_init() { MessageInfos: file_google_iam_v1_iam_policy_proto_msgTypes, }.Build() File_google_iam_v1_iam_policy_proto = out.File - file_google_iam_v1_iam_policy_proto_rawDesc = nil file_google_iam_v1_iam_policy_proto_goTypes = nil file_google_iam_v1_iam_policy_proto_depIdxs = nil } diff --git a/vendor/cloud.google.com/go/iam/apiv1/iampb/iam_policy_grpc.pb.go b/vendor/cloud.google.com/go/iam/apiv1/iampb/iam_policy_grpc.pb.go index d2d5afeae66..f5f3c903de5 100644 --- a/vendor/cloud.google.com/go/iam/apiv1/iampb/iam_policy_grpc.pb.go +++ b/vendor/cloud.google.com/go/iam/apiv1/iampb/iam_policy_grpc.pb.go @@ -15,13 +15,14 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.7 +// - protoc v6.33.2 // source: google/iam/v1/iam_policy.proto package iampb import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/vendor/cloud.google.com/go/iam/apiv1/iampb/options.pb.go b/vendor/cloud.google.com/go/iam/apiv1/iampb/options.pb.go index 9c7e7b831a4..d2c127f8518 100644 --- a/vendor/cloud.google.com/go/iam/apiv1/iampb/options.pb.go +++ b/vendor/cloud.google.com/go/iam/apiv1/iampb/options.pb.go @@ -14,17 +14,19 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 -// protoc v4.25.7 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: google/iam/v1/options.proto package iampb import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( @@ -36,10 +38,7 @@ const ( // Encapsulates settings provided to GetIamPolicy. type GetPolicyOptions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Optional. The maximum policy version that will be used to format the // policy. // @@ -59,6 +58,8 @@ type GetPolicyOptions struct { // [IAM // documentation](https://cloud.google.com/iam/help/conditions/resource-policies). RequestedPolicyVersion int32 `protobuf:"varint,1,opt,name=requested_policy_version,json=requestedPolicyVersion,proto3" json:"requested_policy_version,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GetPolicyOptions) Reset() { @@ -100,34 +101,21 @@ func (x *GetPolicyOptions) GetRequestedPolicyVersion() int32 { var File_google_iam_v1_options_proto protoreflect.FileDescriptor -var file_google_iam_v1_options_proto_rawDesc = []byte{ - 0x0a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x69, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x2f, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x22, 0x4c, 0x0a, 0x10, - 0x47, 0x65, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x12, 0x38, 0x0a, 0x18, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x16, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x50, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x7d, 0x0a, 0x11, 0x63, 0x6f, - 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x42, - 0x0c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x29, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x69, 0x61, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31, 0x2f, 0x69, - 0x61, 0x6d, 0x70, 0x62, 0x3b, 0x69, 0x61, 0x6d, 0x70, 0x62, 0xf8, 0x01, 0x01, 0xaa, 0x02, 0x13, - 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x49, 0x61, 0x6d, - 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f, - 0x75, 0x64, 0x5c, 0x49, 0x61, 0x6d, 0x5c, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} +const file_google_iam_v1_options_proto_rawDesc = "" + + "\n" + + "\x1bgoogle/iam/v1/options.proto\x12\rgoogle.iam.v1\"L\n" + + "\x10GetPolicyOptions\x128\n" + + "\x18requested_policy_version\x18\x01 \x01(\x05R\x16requestedPolicyVersionB}\n" + + "\x11com.google.iam.v1B\fOptionsProtoP\x01Z)cloud.google.com/go/iam/apiv1/iampb;iampb\xf8\x01\x01\xaa\x02\x13Google.Cloud.Iam.V1\xca\x02\x13Google\\Cloud\\Iam\\V1b\x06proto3" var ( file_google_iam_v1_options_proto_rawDescOnce sync.Once - file_google_iam_v1_options_proto_rawDescData = file_google_iam_v1_options_proto_rawDesc + file_google_iam_v1_options_proto_rawDescData []byte ) func file_google_iam_v1_options_proto_rawDescGZIP() []byte { file_google_iam_v1_options_proto_rawDescOnce.Do(func() { - file_google_iam_v1_options_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_iam_v1_options_proto_rawDescData) + file_google_iam_v1_options_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_iam_v1_options_proto_rawDesc), len(file_google_iam_v1_options_proto_rawDesc))) }) return file_google_iam_v1_options_proto_rawDescData } @@ -153,7 +141,7 @@ func file_google_iam_v1_options_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_iam_v1_options_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_iam_v1_options_proto_rawDesc), len(file_google_iam_v1_options_proto_rawDesc)), NumEnums: 0, NumMessages: 1, NumExtensions: 0, @@ -164,7 +152,6 @@ func file_google_iam_v1_options_proto_init() { MessageInfos: file_google_iam_v1_options_proto_msgTypes, }.Build() File_google_iam_v1_options_proto = out.File - file_google_iam_v1_options_proto_rawDesc = nil file_google_iam_v1_options_proto_goTypes = nil file_google_iam_v1_options_proto_depIdxs = nil } diff --git a/vendor/cloud.google.com/go/iam/apiv1/iampb/policy.pb.go b/vendor/cloud.google.com/go/iam/apiv1/iampb/policy.pb.go index 2efacbb0638..04760b42d73 100644 --- a/vendor/cloud.google.com/go/iam/apiv1/iampb/policy.pb.go +++ b/vendor/cloud.google.com/go/iam/apiv1/iampb/policy.pb.go @@ -14,18 +14,20 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 -// protoc v4.25.7 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: google/iam/v1/policy.proto package iampb import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + expr "google.golang.org/genproto/googleapis/type/expr" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( @@ -276,10 +278,7 @@ func (AuditConfigDelta_Action) EnumDescriptor() ([]byte, []int) { // For a description of IAM and its features, see the // [IAM documentation](https://cloud.google.com/iam/docs/). type Policy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Specifies the format of the policy. // // Valid values are `0`, `1`, and `3`. Requests that specify an invalid value @@ -331,7 +330,9 @@ type Policy struct { // whenever you call `setIamPolicy`. If you omit this field, then IAM allows // you to overwrite a version `3` policy with a version `1` policy, and all of // the conditions in the version `3` policy are lost. - Etag []byte `protobuf:"bytes,3,opt,name=etag,proto3" json:"etag,omitempty"` + Etag []byte `protobuf:"bytes,3,opt,name=etag,proto3" json:"etag,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Policy) Reset() { @@ -394,10 +395,7 @@ func (x *Policy) GetEtag() []byte { // Associates `members`, or principals, with a `role`. type Binding struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Role that is assigned to the list of `members`, or principals. // For example, `roles/viewer`, `roles/editor`, or `roles/owner`. Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` @@ -454,7 +452,9 @@ type Binding struct { // To learn which resources support conditions in their IAM policies, see the // [IAM // documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - Condition *expr.Expr `protobuf:"bytes,3,opt,name=condition,proto3" json:"condition,omitempty"` + Condition *expr.Expr `protobuf:"bytes,3,opt,name=condition,proto3" json:"condition,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Binding) Reset() { @@ -560,16 +560,15 @@ func (x *Binding) GetCondition() *expr.Expr { // logging. It also exempts `jose@example.com` from DATA_READ logging, and // `aliya@example.com` from DATA_WRITE logging. type AuditConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Specifies a service that will be enabled for audit logging. // For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. // `allServices` is a special value that covers all services. Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` // The configuration for logging of each type of permission. AuditLogConfigs []*AuditLogConfig `protobuf:"bytes,3,rep,name=audit_log_configs,json=auditLogConfigs,proto3" json:"audit_log_configs,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AuditConfig) Reset() { @@ -636,10 +635,7 @@ func (x *AuditConfig) GetAuditLogConfigs() []*AuditLogConfig { // This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting // jose@example.com from DATA_READ logging. type AuditLogConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The log type that this config enables. LogType AuditLogConfig_LogType `protobuf:"varint,1,opt,name=log_type,json=logType,proto3,enum=google.iam.v1.AuditLogConfig_LogType" json:"log_type,omitempty"` // Specifies the identities that do not cause logging for this type of @@ -647,6 +643,8 @@ type AuditLogConfig struct { // Follows the same format of // [Binding.members][google.iam.v1.Binding.members]. ExemptedMembers []string `protobuf:"bytes,2,rep,name=exempted_members,json=exemptedMembers,proto3" json:"exempted_members,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AuditLogConfig) Reset() { @@ -695,14 +693,13 @@ func (x *AuditLogConfig) GetExemptedMembers() []string { // The difference delta between two policies. type PolicyDelta struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The delta for Bindings between two policies. BindingDeltas []*BindingDelta `protobuf:"bytes,1,rep,name=binding_deltas,json=bindingDeltas,proto3" json:"binding_deltas,omitempty"` // The delta for AuditConfigs between two policies. AuditConfigDeltas []*AuditConfigDelta `protobuf:"bytes,2,rep,name=audit_config_deltas,json=auditConfigDeltas,proto3" json:"audit_config_deltas,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *PolicyDelta) Reset() { @@ -752,10 +749,7 @@ func (x *PolicyDelta) GetAuditConfigDeltas() []*AuditConfigDelta { // One delta entry for Binding. Each individual change (only one member in each // entry) to a binding will be a separate entry. type BindingDelta struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The action that was performed on a Binding. // Required Action BindingDelta_Action `protobuf:"varint,1,opt,name=action,proto3,enum=google.iam.v1.BindingDelta_Action" json:"action,omitempty"` @@ -768,7 +762,9 @@ type BindingDelta struct { // Required Member string `protobuf:"bytes,3,opt,name=member,proto3" json:"member,omitempty"` // The condition that is associated with this binding. - Condition *expr.Expr `protobuf:"bytes,4,opt,name=condition,proto3" json:"condition,omitempty"` + Condition *expr.Expr `protobuf:"bytes,4,opt,name=condition,proto3" json:"condition,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *BindingDelta) Reset() { @@ -832,10 +828,7 @@ func (x *BindingDelta) GetCondition() *expr.Expr { // One delta entry for AuditConfig. Each individual change (only one // exempted_member in each entry) to a AuditConfig will be a separate entry. type AuditConfigDelta struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The action that was performed on an audit configuration in a policy. // Required Action AuditConfigDelta_Action `protobuf:"varint,1,opt,name=action,proto3,enum=google.iam.v1.AuditConfigDelta_Action" json:"action,omitempty"` @@ -851,7 +844,9 @@ type AuditConfigDelta struct { // Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always // enabled, and cannot be configured. // Required - LogType string `protobuf:"bytes,4,opt,name=log_type,json=logType,proto3" json:"log_type,omitempty"` + LogType string `protobuf:"bytes,4,opt,name=log_type,json=logType,proto3" json:"log_type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AuditConfigDelta) Reset() { @@ -914,107 +909,64 @@ func (x *AuditConfigDelta) GetLogType() string { var File_google_iam_v1_policy_proto protoreflect.FileDescriptor -var file_google_iam_v1_policy_proto_rawDesc = []byte{ - 0x0a, 0x1a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x69, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x2f, - 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x1a, 0x16, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xab, 0x01, 0x0a, 0x06, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x18, - 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x08, 0x62, 0x69, 0x6e, 0x64, - 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x69, 0x6e, 0x64, 0x69, - 0x6e, 0x67, 0x52, 0x08, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3f, 0x0a, 0x0d, - 0x61, 0x75, 0x64, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x18, 0x06, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, - 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x64, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, - 0x0c, 0x61, 0x75, 0x64, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x12, 0x12, 0x0a, - 0x04, 0x65, 0x74, 0x61, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x65, 0x74, 0x61, - 0x67, 0x22, 0x68, 0x0a, 0x07, 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, - 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, - 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x2f, 0x0a, 0x09, 0x63, 0x6f, - 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x45, 0x78, 0x70, 0x72, - 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x72, 0x0a, 0x0b, 0x41, - 0x75, 0x64, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x49, 0x0a, 0x11, 0x61, 0x75, 0x64, 0x69, 0x74, 0x5f, 0x6c, 0x6f, - 0x67, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, - 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0f, - 0x61, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x22, - 0xd1, 0x01, 0x0a, 0x0e, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x12, 0x40, 0x0a, 0x08, 0x6c, 0x6f, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, - 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x2e, 0x4c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x6c, 0x6f, 0x67, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x74, 0x65, 0x64, - 0x5f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, - 0x65, 0x78, 0x65, 0x6d, 0x70, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x22, - 0x52, 0x0a, 0x07, 0x4c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x4c, 0x4f, - 0x47, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x5f, 0x52, 0x45, - 0x41, 0x44, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x57, 0x52, 0x49, - 0x54, 0x45, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x52, 0x45, 0x41, - 0x44, 0x10, 0x03, 0x22, 0xa2, 0x01, 0x0a, 0x0b, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x44, 0x65, - 0x6c, 0x74, 0x61, 0x12, 0x42, 0x0a, 0x0e, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x64, - 0x65, 0x6c, 0x74, 0x61, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x69, 0x6e, 0x64, - 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x52, 0x0d, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, - 0x67, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x73, 0x12, 0x4f, 0x0a, 0x13, 0x61, 0x75, 0x64, 0x69, 0x74, - 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, - 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x64, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x44, 0x65, 0x6c, 0x74, 0x61, 0x52, 0x11, 0x61, 0x75, 0x64, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x73, 0x22, 0xde, 0x01, 0x0a, 0x0c, 0x42, 0x69, 0x6e, - 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x12, 0x3a, 0x0a, 0x06, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, - 0x67, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x6d, - 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, - 0x72, 0x12, 0x2f, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, - 0x70, 0x65, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x22, 0x35, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x12, - 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x44, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, - 0x06, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x10, 0x02, 0x22, 0xe7, 0x01, 0x0a, 0x10, 0x41, 0x75, - 0x64, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x12, 0x3e, - 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x41, - 0x75, 0x64, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x2e, - 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, - 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x65, 0x6d, - 0x70, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0e, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, - 0x72, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x6f, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65, 0x22, 0x35, 0x0a, 0x06, - 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, - 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, - 0x0a, 0x03, 0x41, 0x44, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x52, 0x45, 0x4d, 0x4f, 0x56, - 0x45, 0x10, 0x02, 0x42, 0x7c, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x69, 0x61, 0x6d, - 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31, 0x2f, 0x69, 0x61, 0x6d, 0x70, 0x62, 0x3b, 0x69, 0x61, 0x6d, - 0x70, 0x62, 0xf8, 0x01, 0x01, 0xaa, 0x02, 0x13, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, - 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x49, 0x61, 0x6d, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x47, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x49, 0x61, 0x6d, 0x5c, 0x56, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_google_iam_v1_policy_proto_rawDesc = "" + + "\n" + + "\x1agoogle/iam/v1/policy.proto\x12\rgoogle.iam.v1\x1a\x16google/type/expr.proto\"\xab\x01\n" + + "\x06Policy\x12\x18\n" + + "\aversion\x18\x01 \x01(\x05R\aversion\x122\n" + + "\bbindings\x18\x04 \x03(\v2\x16.google.iam.v1.BindingR\bbindings\x12?\n" + + "\raudit_configs\x18\x06 \x03(\v2\x1a.google.iam.v1.AuditConfigR\fauditConfigs\x12\x12\n" + + "\x04etag\x18\x03 \x01(\fR\x04etag\"h\n" + + "\aBinding\x12\x12\n" + + "\x04role\x18\x01 \x01(\tR\x04role\x12\x18\n" + + "\amembers\x18\x02 \x03(\tR\amembers\x12/\n" + + "\tcondition\x18\x03 \x01(\v2\x11.google.type.ExprR\tcondition\"r\n" + + "\vAuditConfig\x12\x18\n" + + "\aservice\x18\x01 \x01(\tR\aservice\x12I\n" + + "\x11audit_log_configs\x18\x03 \x03(\v2\x1d.google.iam.v1.AuditLogConfigR\x0fauditLogConfigs\"\xd1\x01\n" + + "\x0eAuditLogConfig\x12@\n" + + "\blog_type\x18\x01 \x01(\x0e2%.google.iam.v1.AuditLogConfig.LogTypeR\alogType\x12)\n" + + "\x10exempted_members\x18\x02 \x03(\tR\x0fexemptedMembers\"R\n" + + "\aLogType\x12\x18\n" + + "\x14LOG_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n" + + "\n" + + "ADMIN_READ\x10\x01\x12\x0e\n" + + "\n" + + "DATA_WRITE\x10\x02\x12\r\n" + + "\tDATA_READ\x10\x03\"\xa2\x01\n" + + "\vPolicyDelta\x12B\n" + + "\x0ebinding_deltas\x18\x01 \x03(\v2\x1b.google.iam.v1.BindingDeltaR\rbindingDeltas\x12O\n" + + "\x13audit_config_deltas\x18\x02 \x03(\v2\x1f.google.iam.v1.AuditConfigDeltaR\x11auditConfigDeltas\"\xde\x01\n" + + "\fBindingDelta\x12:\n" + + "\x06action\x18\x01 \x01(\x0e2\".google.iam.v1.BindingDelta.ActionR\x06action\x12\x12\n" + + "\x04role\x18\x02 \x01(\tR\x04role\x12\x16\n" + + "\x06member\x18\x03 \x01(\tR\x06member\x12/\n" + + "\tcondition\x18\x04 \x01(\v2\x11.google.type.ExprR\tcondition\"5\n" + + "\x06Action\x12\x16\n" + + "\x12ACTION_UNSPECIFIED\x10\x00\x12\a\n" + + "\x03ADD\x10\x01\x12\n" + + "\n" + + "\x06REMOVE\x10\x02\"\xe7\x01\n" + + "\x10AuditConfigDelta\x12>\n" + + "\x06action\x18\x01 \x01(\x0e2&.google.iam.v1.AuditConfigDelta.ActionR\x06action\x12\x18\n" + + "\aservice\x18\x02 \x01(\tR\aservice\x12'\n" + + "\x0fexempted_member\x18\x03 \x01(\tR\x0eexemptedMember\x12\x19\n" + + "\blog_type\x18\x04 \x01(\tR\alogType\"5\n" + + "\x06Action\x12\x16\n" + + "\x12ACTION_UNSPECIFIED\x10\x00\x12\a\n" + + "\x03ADD\x10\x01\x12\n" + + "\n" + + "\x06REMOVE\x10\x02B|\n" + + "\x11com.google.iam.v1B\vPolicyProtoP\x01Z)cloud.google.com/go/iam/apiv1/iampb;iampb\xf8\x01\x01\xaa\x02\x13Google.Cloud.Iam.V1\xca\x02\x13Google\\Cloud\\Iam\\V1b\x06proto3" var ( file_google_iam_v1_policy_proto_rawDescOnce sync.Once - file_google_iam_v1_policy_proto_rawDescData = file_google_iam_v1_policy_proto_rawDesc + file_google_iam_v1_policy_proto_rawDescData []byte ) func file_google_iam_v1_policy_proto_rawDescGZIP() []byte { file_google_iam_v1_policy_proto_rawDescOnce.Do(func() { - file_google_iam_v1_policy_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_iam_v1_policy_proto_rawDescData) + file_google_iam_v1_policy_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_iam_v1_policy_proto_rawDesc), len(file_google_iam_v1_policy_proto_rawDesc))) }) return file_google_iam_v1_policy_proto_rawDescData } @@ -1061,7 +1013,7 @@ func file_google_iam_v1_policy_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_iam_v1_policy_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_iam_v1_policy_proto_rawDesc), len(file_google_iam_v1_policy_proto_rawDesc)), NumEnums: 3, NumMessages: 7, NumExtensions: 0, @@ -1073,7 +1025,6 @@ func file_google_iam_v1_policy_proto_init() { MessageInfos: file_google_iam_v1_policy_proto_msgTypes, }.Build() File_google_iam_v1_policy_proto = out.File - file_google_iam_v1_policy_proto_rawDesc = nil file_google_iam_v1_policy_proto_goTypes = nil file_google_iam_v1_policy_proto_depIdxs = nil } diff --git a/vendor/cloud.google.com/go/iam/apiv1/iampb/resource_policy_member.pb.go b/vendor/cloud.google.com/go/iam/apiv1/iampb/resource_policy_member.pb.go index c2b0f7a5bbb..045e393123c 100644 --- a/vendor/cloud.google.com/go/iam/apiv1/iampb/resource_policy_member.pb.go +++ b/vendor/cloud.google.com/go/iam/apiv1/iampb/resource_policy_member.pb.go @@ -14,18 +14,20 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 -// protoc v4.25.7 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: google/iam/v1/resource_policy_member.proto package iampb import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( @@ -38,10 +40,7 @@ const ( // Output-only policy member strings of a Google Cloud resource's built-in // identity. type ResourcePolicyMember struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // IAM policy binding member referring to a Google Cloud resource by // user-assigned name (https://google.aip.dev/122). If a resource is deleted // and recreated with the same name, the binding will be applicable to the new @@ -58,6 +57,8 @@ type ResourcePolicyMember struct { // Example: // `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5` IamPolicyUidPrincipal string `protobuf:"bytes,2,opt,name=iam_policy_uid_principal,json=iamPolicyUidPrincipal,proto3" json:"iam_policy_uid_principal,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ResourcePolicyMember) Reset() { @@ -106,42 +107,22 @@ func (x *ResourcePolicyMember) GetIamPolicyUidPrincipal() string { var File_google_iam_v1_resource_policy_member_proto protoreflect.FileDescriptor -var file_google_iam_v1_resource_policy_member_proto_rawDesc = []byte{ - 0x0a, 0x2a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x69, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x2f, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, - 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, - 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x94, 0x01, 0x0a, - 0x14, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4d, - 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x3e, 0x0a, 0x19, 0x69, 0x61, 0x6d, 0x5f, 0x70, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, - 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x16, 0x69, - 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x50, 0x72, 0x69, 0x6e, - 0x63, 0x69, 0x70, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x18, 0x69, 0x61, 0x6d, 0x5f, 0x70, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x5f, 0x75, 0x69, 0x64, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, - 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x15, 0x69, 0x61, - 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x55, 0x69, 0x64, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, - 0x70, 0x61, 0x6c, 0x42, 0x87, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x19, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x69, 0x61, 0x6d, 0x2f, - 0x61, 0x70, 0x69, 0x76, 0x31, 0x2f, 0x69, 0x61, 0x6d, 0x70, 0x62, 0x3b, 0x69, 0x61, 0x6d, 0x70, - 0x62, 0xaa, 0x02, 0x13, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, - 0x2e, 0x49, 0x61, 0x6d, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x5c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x49, 0x61, 0x6d, 0x5c, 0x56, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_google_iam_v1_resource_policy_member_proto_rawDesc = "" + + "\n" + + "*google/iam/v1/resource_policy_member.proto\x12\rgoogle.iam.v1\x1a\x1fgoogle/api/field_behavior.proto\"\x94\x01\n" + + "\x14ResourcePolicyMember\x12>\n" + + "\x19iam_policy_name_principal\x18\x01 \x01(\tB\x03\xe0A\x03R\x16iamPolicyNamePrincipal\x12<\n" + + "\x18iam_policy_uid_principal\x18\x02 \x01(\tB\x03\xe0A\x03R\x15iamPolicyUidPrincipalB\x87\x01\n" + + "\x11com.google.iam.v1B\x19ResourcePolicyMemberProtoP\x01Z)cloud.google.com/go/iam/apiv1/iampb;iampb\xaa\x02\x13Google.Cloud.Iam.V1\xca\x02\x13Google\\Cloud\\Iam\\V1b\x06proto3" var ( file_google_iam_v1_resource_policy_member_proto_rawDescOnce sync.Once - file_google_iam_v1_resource_policy_member_proto_rawDescData = file_google_iam_v1_resource_policy_member_proto_rawDesc + file_google_iam_v1_resource_policy_member_proto_rawDescData []byte ) func file_google_iam_v1_resource_policy_member_proto_rawDescGZIP() []byte { file_google_iam_v1_resource_policy_member_proto_rawDescOnce.Do(func() { - file_google_iam_v1_resource_policy_member_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_iam_v1_resource_policy_member_proto_rawDescData) + file_google_iam_v1_resource_policy_member_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_iam_v1_resource_policy_member_proto_rawDesc), len(file_google_iam_v1_resource_policy_member_proto_rawDesc))) }) return file_google_iam_v1_resource_policy_member_proto_rawDescData } @@ -167,7 +148,7 @@ func file_google_iam_v1_resource_policy_member_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_iam_v1_resource_policy_member_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_iam_v1_resource_policy_member_proto_rawDesc), len(file_google_iam_v1_resource_policy_member_proto_rawDesc)), NumEnums: 0, NumMessages: 1, NumExtensions: 0, @@ -178,7 +159,6 @@ func file_google_iam_v1_resource_policy_member_proto_init() { MessageInfos: file_google_iam_v1_resource_policy_member_proto_msgTypes, }.Build() File_google_iam_v1_resource_policy_member_proto = out.File - file_google_iam_v1_resource_policy_member_proto_rawDesc = nil file_google_iam_v1_resource_policy_member_proto_goTypes = nil file_google_iam_v1_resource_policy_member_proto_depIdxs = nil } 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 eaa1dab0939..134d3771e97 100644 --- a/vendor/cloud.google.com/go/internal/.repo-metadata-full.json +++ b/vendor/cloud.google.com/go/internal/.repo-metadata-full.json @@ -539,6 +539,16 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/bigquery/datapolicies/apiv2": { + "api_shortname": "bigquerydatapolicy", + "distribution_name": "cloud.google.com/go/bigquery/datapolicies/apiv2", + "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/apiv2", + "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", @@ -729,6 +739,16 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/capacityplanner/apiv1beta": { + "api_shortname": "capacityplanner", + "distribution_name": "cloud.google.com/go/capacityplanner/apiv1beta", + "description": "Capacity Planner API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/capacityplanner/latest/apiv1beta", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/certificatemanager/apiv1": { "api_shortname": "certificatemanager", "distribution_name": "cloud.google.com/go/certificatemanager/apiv1", @@ -1259,16 +1279,6 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, - "cloud.google.com/go/dlp/apiv2": { - "api_shortname": "dlp", - "distribution_name": "cloud.google.com/go/dlp/apiv2", - "description": "Sensitive Data Protection (DLP)", - "language": "go", - "client_library_type": "generated", - "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/dlp/latest/apiv2", - "release_level": "stable", - "library_type": "GAPIC_AUTO" - }, "cloud.google.com/go/documentai/apiv1": { "api_shortname": "documentai", "distribution_name": "cloud.google.com/go/documentai/apiv1", @@ -1459,6 +1469,16 @@ "release_level": "preview", "library_type": "CORE" }, + "cloud.google.com/go/geminidataanalytics/apiv1beta": { + "api_shortname": "geminidataanalytics", + "distribution_name": "cloud.google.com/go/geminidataanalytics/apiv1beta", + "description": "Data Analytics API with Gemini", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/geminidataanalytics/latest/apiv1beta", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/gkebackup/apiv1": { "api_shortname": "gkebackup", "distribution_name": "cloud.google.com/go/gkebackup/apiv1", @@ -1689,6 +1709,16 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/locationfinder/apiv1": { + "api_shortname": "cloudlocationfinder", + "distribution_name": "cloud.google.com/go/locationfinder/apiv1", + "description": "Cloud Location Finder API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/locationfinder/latest/apiv1", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/logging": { "api_shortname": "logging", "distribution_name": "cloud.google.com/go/logging", diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/.repo-metadata.json b/vendor/cloud.google.com/go/monitoring/apiv3/v2/.repo-metadata.json new file mode 100644 index 00000000000..dce4f66ff1a --- /dev/null +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/.repo-metadata.json @@ -0,0 +1,10 @@ +{ + "api_shortname": "monitoring", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/monitoring/latest/apiv3/v2", + "client_library_type": "generated", + "description": "Cloud Monitoring API", + "distribution_name": "cloud.google.com/go/monitoring/apiv3/v2", + "language": "go", + "library_type": "GAPIC_AUTO", + "release_level": "preview" +} \ No newline at end of file diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/alert_policy_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/alert_policy_client.go index cc8c69c2401..d960ceed226 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/alert_policy_client.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/alert_policy_client.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -26,6 +26,7 @@ import ( monitoringpb "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb" gax "github.com/googleapis/gax-go/v2" + "github.com/googleapis/gax-go/v2/callctx" "google.golang.org/api/iterator" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" @@ -55,6 +56,7 @@ func defaultAlertPolicyGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultAudience("https://monitoring.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), internaloption.EnableJwtWithScope(), + internaloption.AllowHardBoundTokens("MTLS_S2A"), internaloption.EnableNewAuthLibrary(), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), @@ -236,6 +238,16 @@ type alertPolicyGRPCClient struct { // Cloud console (at https://console.cloud.google.com/). func NewAlertPolicyClient(ctx context.Context, opts ...option.ClientOption) (*AlertPolicyClient, error) { clientOpts := defaultAlertPolicyGRPCClientOptions() + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{ + "gcp.client.service": "monitoring", + "gcp.client.version": getVersionClient(), + "gcp.client.repo": "googleapis/google-cloud-go", + "gcp.client.artifact": "cloud.google.com/go/monitoring/apiv3/v2", + "gcp.client.language": "go", + "url.domain": "monitoring.googleapis.com", + })) + } if newAlertPolicyClientHook != nil { hookOpts, err := newAlertPolicyClientHook(ctx, clientHookParams{}) if err != nil { @@ -257,6 +269,24 @@ func NewAlertPolicyClient(ctx context.Context, opts ...option.ClientOption) (*Al logger: internaloption.GetLogger(opts), } c.setGoogleClientInfo() + if gax.IsFeatureEnabled("METRICS") { + metrics := gax.NewClientMetrics( + gax.WithTelemetryLogger(c.logger), + gax.WithTelemetryAttributes(map[string]string{ + gax.ClientService: "monitoring", + gax.ClientVersion: getVersionClient(), + gax.ClientArtifact: "cloud.google.com/go/monitoring/apiv3/v2", + gax.RPCSystem: "grpc", + gax.URLDomain: "monitoring.googleapis.com", + }), + ) + + client.CallOptions.ListAlertPolicies = append(client.CallOptions.ListAlertPolicies, gax.WithClientMetrics(metrics)) + client.CallOptions.GetAlertPolicy = append(client.CallOptions.GetAlertPolicy, gax.WithClientMetrics(metrics)) + client.CallOptions.CreateAlertPolicy = append(client.CallOptions.CreateAlertPolicy, gax.WithClientMetrics(metrics)) + client.CallOptions.DeleteAlertPolicy = append(client.CallOptions.DeleteAlertPolicy, gax.WithClientMetrics(metrics)) + client.CallOptions.UpdateAlertPolicy = append(client.CallOptions.UpdateAlertPolicy, gax.WithClientMetrics(metrics)) + } client.internalClient = c @@ -293,9 +323,15 @@ func (c *alertPolicyGRPCClient) ListAlertPolicies(ctx context.Context, req *moni hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.AlertPolicyService/ListAlertPolicies") + } opts = append((*c.CallOptions).ListAlertPolicies[0:len((*c.CallOptions).ListAlertPolicies):len((*c.CallOptions).ListAlertPolicies)], opts...) it := &AlertPolicyIterator{} - req = proto.Clone(req).(*monitoringpb.ListAlertPoliciesRequest) + req = proto.CloneOf(req) it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoringpb.AlertPolicy, string, error) { resp := &monitoringpb.ListAlertPoliciesResponse{} if pageToken != "" { @@ -339,6 +375,12 @@ func (c *alertPolicyGRPCClient) GetAlertPolicy(ctx context.Context, req *monitor hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.AlertPolicyService/GetAlertPolicy") + } opts = append((*c.CallOptions).GetAlertPolicy[0:len((*c.CallOptions).GetAlertPolicy):len((*c.CallOptions).GetAlertPolicy)], opts...) var resp *monitoringpb.AlertPolicy err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -357,6 +399,12 @@ func (c *alertPolicyGRPCClient) CreateAlertPolicy(ctx context.Context, req *moni hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.AlertPolicyService/CreateAlertPolicy") + } opts = append((*c.CallOptions).CreateAlertPolicy[0:len((*c.CallOptions).CreateAlertPolicy):len((*c.CallOptions).CreateAlertPolicy)], opts...) var resp *monitoringpb.AlertPolicy err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -375,6 +423,12 @@ func (c *alertPolicyGRPCClient) DeleteAlertPolicy(ctx context.Context, req *moni hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.AlertPolicyService/DeleteAlertPolicy") + } opts = append((*c.CallOptions).DeleteAlertPolicy[0:len((*c.CallOptions).DeleteAlertPolicy):len((*c.CallOptions).DeleteAlertPolicy)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error @@ -389,6 +443,9 @@ func (c *alertPolicyGRPCClient) UpdateAlertPolicy(ctx context.Context, req *moni hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.AlertPolicyService/UpdateAlertPolicy") + } opts = append((*c.CallOptions).UpdateAlertPolicy[0:len((*c.CallOptions).UpdateAlertPolicy):len((*c.CallOptions).UpdateAlertPolicy)], opts...) var resp *monitoringpb.AlertPolicy err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/auxiliary.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/auxiliary.go index 8dc9634588a..556cce7975b 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/auxiliary.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/auxiliary.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/auxiliary_go123.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/auxiliary_go123.go index bf559553b75..4a028b9c933 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/auxiliary_go123.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/auxiliary_go123.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/doc.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/doc.go index 1d5136edaff..a06974e8edd 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/doc.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/doc.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/group_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/group_client.go index 7a9e076093b..fd134943e7c 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/group_client.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/group_client.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -26,6 +26,7 @@ import ( monitoringpb "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb" gax "github.com/googleapis/gax-go/v2" + "github.com/googleapis/gax-go/v2/callctx" "google.golang.org/api/iterator" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" @@ -57,6 +58,7 @@ func defaultGroupGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultAudience("https://monitoring.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), internaloption.EnableJwtWithScope(), + internaloption.AllowHardBoundTokens("MTLS_S2A"), internaloption.EnableNewAuthLibrary(), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), @@ -257,6 +259,16 @@ type groupGRPCClient struct { // from the infrastructure. func NewGroupClient(ctx context.Context, opts ...option.ClientOption) (*GroupClient, error) { clientOpts := defaultGroupGRPCClientOptions() + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{ + "gcp.client.service": "monitoring", + "gcp.client.version": getVersionClient(), + "gcp.client.repo": "googleapis/google-cloud-go", + "gcp.client.artifact": "cloud.google.com/go/monitoring/apiv3/v2", + "gcp.client.language": "go", + "url.domain": "monitoring.googleapis.com", + })) + } if newGroupClientHook != nil { hookOpts, err := newGroupClientHook(ctx, clientHookParams{}) if err != nil { @@ -278,6 +290,25 @@ func NewGroupClient(ctx context.Context, opts ...option.ClientOption) (*GroupCli logger: internaloption.GetLogger(opts), } c.setGoogleClientInfo() + if gax.IsFeatureEnabled("METRICS") { + metrics := gax.NewClientMetrics( + gax.WithTelemetryLogger(c.logger), + gax.WithTelemetryAttributes(map[string]string{ + gax.ClientService: "monitoring", + gax.ClientVersion: getVersionClient(), + gax.ClientArtifact: "cloud.google.com/go/monitoring/apiv3/v2", + gax.RPCSystem: "grpc", + gax.URLDomain: "monitoring.googleapis.com", + }), + ) + + client.CallOptions.ListGroups = append(client.CallOptions.ListGroups, gax.WithClientMetrics(metrics)) + client.CallOptions.GetGroup = append(client.CallOptions.GetGroup, gax.WithClientMetrics(metrics)) + client.CallOptions.CreateGroup = append(client.CallOptions.CreateGroup, gax.WithClientMetrics(metrics)) + client.CallOptions.UpdateGroup = append(client.CallOptions.UpdateGroup, gax.WithClientMetrics(metrics)) + client.CallOptions.DeleteGroup = append(client.CallOptions.DeleteGroup, gax.WithClientMetrics(metrics)) + client.CallOptions.ListGroupMembers = append(client.CallOptions.ListGroupMembers, gax.WithClientMetrics(metrics)) + } client.internalClient = c @@ -314,9 +345,15 @@ func (c *groupGRPCClient) ListGroups(ctx context.Context, req *monitoringpb.List hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.GroupService/ListGroups") + } opts = append((*c.CallOptions).ListGroups[0:len((*c.CallOptions).ListGroups):len((*c.CallOptions).ListGroups)], opts...) it := &GroupIterator{} - req = proto.Clone(req).(*monitoringpb.ListGroupsRequest) + req = proto.CloneOf(req) it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoringpb.Group, string, error) { resp := &monitoringpb.ListGroupsResponse{} if pageToken != "" { @@ -360,6 +397,12 @@ func (c *groupGRPCClient) GetGroup(ctx context.Context, req *monitoringpb.GetGro hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.GroupService/GetGroup") + } opts = append((*c.CallOptions).GetGroup[0:len((*c.CallOptions).GetGroup):len((*c.CallOptions).GetGroup)], opts...) var resp *monitoringpb.Group err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -378,6 +421,12 @@ func (c *groupGRPCClient) CreateGroup(ctx context.Context, req *monitoringpb.Cre hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.GroupService/CreateGroup") + } opts = append((*c.CallOptions).CreateGroup[0:len((*c.CallOptions).CreateGroup):len((*c.CallOptions).CreateGroup)], opts...) var resp *monitoringpb.Group err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -396,6 +445,9 @@ func (c *groupGRPCClient) UpdateGroup(ctx context.Context, req *monitoringpb.Upd hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.GroupService/UpdateGroup") + } opts = append((*c.CallOptions).UpdateGroup[0:len((*c.CallOptions).UpdateGroup):len((*c.CallOptions).UpdateGroup)], opts...) var resp *monitoringpb.Group err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -414,6 +466,12 @@ func (c *groupGRPCClient) DeleteGroup(ctx context.Context, req *monitoringpb.Del hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.GroupService/DeleteGroup") + } opts = append((*c.CallOptions).DeleteGroup[0:len((*c.CallOptions).DeleteGroup):len((*c.CallOptions).DeleteGroup)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error @@ -428,9 +486,15 @@ func (c *groupGRPCClient) ListGroupMembers(ctx context.Context, req *monitoringp hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.GroupService/ListGroupMembers") + } opts = append((*c.CallOptions).ListGroupMembers[0:len((*c.CallOptions).ListGroupMembers):len((*c.CallOptions).ListGroupMembers)], opts...) it := &MonitoredResourceIterator{} - req = proto.Clone(req).(*monitoringpb.ListGroupMembersRequest) + req = proto.CloneOf(req) it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoredrespb.MonitoredResource, string, error) { resp := &monitoringpb.ListGroupMembersResponse{} if pageToken != "" { diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/helpers.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/helpers.go index b97da685e9d..03975b44a0a 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/helpers.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/helpers.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/metric_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/metric_client.go index 2ed8ccc133d..58aceafaaab 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/metric_client.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/metric_client.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -26,6 +26,7 @@ import ( monitoringpb "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb" gax "github.com/googleapis/gax-go/v2" + "github.com/googleapis/gax-go/v2/callctx" "google.golang.org/api/iterator" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" @@ -61,6 +62,7 @@ func defaultMetricGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultAudience("https://monitoring.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), internaloption.EnableJwtWithScope(), + internaloption.AllowHardBoundTokens("MTLS_S2A"), internaloption.EnableNewAuthLibrary(), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), @@ -295,6 +297,16 @@ type metricGRPCClient struct { // time series data. func NewMetricClient(ctx context.Context, opts ...option.ClientOption) (*MetricClient, error) { clientOpts := defaultMetricGRPCClientOptions() + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{ + "gcp.client.service": "monitoring", + "gcp.client.version": getVersionClient(), + "gcp.client.repo": "googleapis/google-cloud-go", + "gcp.client.artifact": "cloud.google.com/go/monitoring/apiv3/v2", + "gcp.client.language": "go", + "url.domain": "monitoring.googleapis.com", + })) + } if newMetricClientHook != nil { hookOpts, err := newMetricClientHook(ctx, clientHookParams{}) if err != nil { @@ -316,6 +328,28 @@ func NewMetricClient(ctx context.Context, opts ...option.ClientOption) (*MetricC logger: internaloption.GetLogger(opts), } c.setGoogleClientInfo() + if gax.IsFeatureEnabled("METRICS") { + metrics := gax.NewClientMetrics( + gax.WithTelemetryLogger(c.logger), + gax.WithTelemetryAttributes(map[string]string{ + gax.ClientService: "monitoring", + gax.ClientVersion: getVersionClient(), + gax.ClientArtifact: "cloud.google.com/go/monitoring/apiv3/v2", + gax.RPCSystem: "grpc", + gax.URLDomain: "monitoring.googleapis.com", + }), + ) + + client.CallOptions.ListMonitoredResourceDescriptors = append(client.CallOptions.ListMonitoredResourceDescriptors, gax.WithClientMetrics(metrics)) + client.CallOptions.GetMonitoredResourceDescriptor = append(client.CallOptions.GetMonitoredResourceDescriptor, gax.WithClientMetrics(metrics)) + client.CallOptions.ListMetricDescriptors = append(client.CallOptions.ListMetricDescriptors, gax.WithClientMetrics(metrics)) + client.CallOptions.GetMetricDescriptor = append(client.CallOptions.GetMetricDescriptor, gax.WithClientMetrics(metrics)) + client.CallOptions.CreateMetricDescriptor = append(client.CallOptions.CreateMetricDescriptor, gax.WithClientMetrics(metrics)) + client.CallOptions.DeleteMetricDescriptor = append(client.CallOptions.DeleteMetricDescriptor, gax.WithClientMetrics(metrics)) + client.CallOptions.ListTimeSeries = append(client.CallOptions.ListTimeSeries, gax.WithClientMetrics(metrics)) + client.CallOptions.CreateTimeSeries = append(client.CallOptions.CreateTimeSeries, gax.WithClientMetrics(metrics)) + client.CallOptions.CreateServiceTimeSeries = append(client.CallOptions.CreateServiceTimeSeries, gax.WithClientMetrics(metrics)) + } client.internalClient = c @@ -352,9 +386,15 @@ func (c *metricGRPCClient) ListMonitoredResourceDescriptors(ctx context.Context, hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.MetricService/ListMonitoredResourceDescriptors") + } opts = append((*c.CallOptions).ListMonitoredResourceDescriptors[0:len((*c.CallOptions).ListMonitoredResourceDescriptors):len((*c.CallOptions).ListMonitoredResourceDescriptors)], opts...) it := &MonitoredResourceDescriptorIterator{} - req = proto.Clone(req).(*monitoringpb.ListMonitoredResourceDescriptorsRequest) + req = proto.CloneOf(req) it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoredrespb.MonitoredResourceDescriptor, string, error) { resp := &monitoringpb.ListMonitoredResourceDescriptorsResponse{} if pageToken != "" { @@ -398,6 +438,12 @@ func (c *metricGRPCClient) GetMonitoredResourceDescriptor(ctx context.Context, r hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.MetricService/GetMonitoredResourceDescriptor") + } opts = append((*c.CallOptions).GetMonitoredResourceDescriptor[0:len((*c.CallOptions).GetMonitoredResourceDescriptor):len((*c.CallOptions).GetMonitoredResourceDescriptor)], opts...) var resp *monitoredrespb.MonitoredResourceDescriptor err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -416,9 +462,15 @@ func (c *metricGRPCClient) ListMetricDescriptors(ctx context.Context, req *monit hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.MetricService/ListMetricDescriptors") + } opts = append((*c.CallOptions).ListMetricDescriptors[0:len((*c.CallOptions).ListMetricDescriptors):len((*c.CallOptions).ListMetricDescriptors)], opts...) it := &MetricDescriptorIterator{} - req = proto.Clone(req).(*monitoringpb.ListMetricDescriptorsRequest) + req = proto.CloneOf(req) it.InternalFetch = func(pageSize int, pageToken string) ([]*metricpb.MetricDescriptor, string, error) { resp := &monitoringpb.ListMetricDescriptorsResponse{} if pageToken != "" { @@ -462,6 +514,12 @@ func (c *metricGRPCClient) GetMetricDescriptor(ctx context.Context, req *monitor hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.MetricService/GetMetricDescriptor") + } opts = append((*c.CallOptions).GetMetricDescriptor[0:len((*c.CallOptions).GetMetricDescriptor):len((*c.CallOptions).GetMetricDescriptor)], opts...) var resp *metricpb.MetricDescriptor err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -480,6 +538,12 @@ func (c *metricGRPCClient) CreateMetricDescriptor(ctx context.Context, req *moni hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.MetricService/CreateMetricDescriptor") + } opts = append((*c.CallOptions).CreateMetricDescriptor[0:len((*c.CallOptions).CreateMetricDescriptor):len((*c.CallOptions).CreateMetricDescriptor)], opts...) var resp *metricpb.MetricDescriptor err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -498,6 +562,12 @@ func (c *metricGRPCClient) DeleteMetricDescriptor(ctx context.Context, req *moni hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.MetricService/DeleteMetricDescriptor") + } opts = append((*c.CallOptions).DeleteMetricDescriptor[0:len((*c.CallOptions).DeleteMetricDescriptor):len((*c.CallOptions).DeleteMetricDescriptor)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error @@ -512,9 +582,15 @@ func (c *metricGRPCClient) ListTimeSeries(ctx context.Context, req *monitoringpb hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.MetricService/ListTimeSeries") + } opts = append((*c.CallOptions).ListTimeSeries[0:len((*c.CallOptions).ListTimeSeries):len((*c.CallOptions).ListTimeSeries)], opts...) it := &TimeSeriesIterator{} - req = proto.Clone(req).(*monitoringpb.ListTimeSeriesRequest) + req = proto.CloneOf(req) it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoringpb.TimeSeries, string, error) { resp := &monitoringpb.ListTimeSeriesResponse{} if pageToken != "" { @@ -558,6 +634,12 @@ func (c *metricGRPCClient) CreateTimeSeries(ctx context.Context, req *monitoring hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.MetricService/CreateTimeSeries") + } opts = append((*c.CallOptions).CreateTimeSeries[0:len((*c.CallOptions).CreateTimeSeries):len((*c.CallOptions).CreateTimeSeries)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error @@ -572,6 +654,12 @@ func (c *metricGRPCClient) CreateServiceTimeSeries(ctx context.Context, req *mon hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.MetricService/CreateServiceTimeSeries") + } opts = append((*c.CallOptions).CreateServiceTimeSeries[0:len((*c.CallOptions).CreateServiceTimeSeries):len((*c.CallOptions).CreateServiceTimeSeries)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert.pb.go index f735f032534..0e0b0f58f84 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert.pb.go @@ -14,13 +14,17 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 -// protoc v4.25.7 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: google/monitoring/v3/alert.proto package monitoringpb import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "google.golang.org/genproto/googleapis/api/annotations" status "google.golang.org/genproto/googleapis/rpc/status" timeofday "google.golang.org/genproto/googleapis/type/timeofday" @@ -28,8 +32,6 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" - reflect "reflect" - sync "sync" ) const ( @@ -283,10 +285,7 @@ func (AlertPolicy_AlertStrategy_NotificationPrompt) EnumDescriptor() ([]byte, [] // this state. For an overview of alerting policies, see // [Introduction to Alerting](https://cloud.google.com/monitoring/alerts/). type AlertPolicy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Identifier. Required if the policy exists. The resource name for this // policy. The format is: // @@ -329,7 +328,7 @@ type AlertPolicy struct { // whereas Prometheus {rule group} is an unrestricted UTF-8 string. // This means that they cannot be stored as-is in user labels, because // they may contain characters that are not allowed in user-label values. - UserLabels map[string]string `protobuf:"bytes,16,rep,name=user_labels,json=userLabels,proto3" json:"user_labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + UserLabels map[string]string `protobuf:"bytes,16,rep,name=user_labels,json=userLabels,proto3" json:"user_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // A list of conditions for the policy. The conditions are combined by AND or // OR according to the `combiner` field. If the combined conditions evaluate // to true, then an incident is created. A policy can have from one to six @@ -376,7 +375,9 @@ type AlertPolicy struct { // Optional. The severity of an alerting policy indicates how important // incidents generated by that policy are. The severity level will be // displayed on the Incident detail page and in notifications. - Severity AlertPolicy_Severity `protobuf:"varint,22,opt,name=severity,proto3,enum=google.monitoring.v3.AlertPolicy_Severity" json:"severity,omitempty"` + Severity AlertPolicy_Severity `protobuf:"varint,22,opt,name=severity,proto3,enum=google.monitoring.v3.AlertPolicy_Severity" json:"severity,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AlertPolicy) Reset() { @@ -503,10 +504,7 @@ func (x *AlertPolicy) GetSeverity() AlertPolicy_Severity { // Documentation that is included in the notifications and incidents // pertaining to this policy. type AlertPolicy_Documentation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The body of the documentation, interpreted according to `mime_type`. // The content may not exceed 8,192 Unicode characters and may not exceed // more than 10,240 bytes when encoded in UTF-8 format, whichever is @@ -533,7 +531,9 @@ type AlertPolicy_Documentation struct { Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"` // Optional. Links to content such as playbooks, repositories, and other // resources. This field can contain up to 3 entries. - Links []*AlertPolicy_Documentation_Link `protobuf:"bytes,4,rep,name=links,proto3" json:"links,omitempty"` + Links []*AlertPolicy_Documentation_Link `protobuf:"bytes,4,rep,name=links,proto3" json:"links,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AlertPolicy_Documentation) Reset() { @@ -598,10 +598,7 @@ func (x *AlertPolicy_Documentation) GetLinks() []*AlertPolicy_Documentation_Link // should open an incident. If a condition evaluates to true, it signifies // that something is wrong. type AlertPolicy_Condition struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required if the condition exists. The unique resource name for this // condition. Its format is: // @@ -634,7 +631,7 @@ type AlertPolicy_Condition struct { DisplayName string `protobuf:"bytes,6,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` // Only one of the following condition types will be specified. // - // Types that are assignable to Condition: + // Types that are valid to be assigned to Condition: // // *AlertPolicy_Condition_ConditionThreshold // *AlertPolicy_Condition_ConditionAbsent @@ -642,7 +639,9 @@ type AlertPolicy_Condition struct { // *AlertPolicy_Condition_ConditionMonitoringQueryLanguage // *AlertPolicy_Condition_ConditionPrometheusQueryLanguage // *AlertPolicy_Condition_ConditionSql - Condition isAlertPolicy_Condition_Condition `protobuf_oneof:"condition"` + Condition isAlertPolicy_Condition_Condition `protobuf_oneof:"condition"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AlertPolicy_Condition) Reset() { @@ -689,51 +688,63 @@ func (x *AlertPolicy_Condition) GetDisplayName() string { return "" } -func (m *AlertPolicy_Condition) GetCondition() isAlertPolicy_Condition_Condition { - if m != nil { - return m.Condition +func (x *AlertPolicy_Condition) GetCondition() isAlertPolicy_Condition_Condition { + if x != nil { + return x.Condition } return nil } func (x *AlertPolicy_Condition) GetConditionThreshold() *AlertPolicy_Condition_MetricThreshold { - if x, ok := x.GetCondition().(*AlertPolicy_Condition_ConditionThreshold); ok { - return x.ConditionThreshold + if x != nil { + if x, ok := x.Condition.(*AlertPolicy_Condition_ConditionThreshold); ok { + return x.ConditionThreshold + } } return nil } func (x *AlertPolicy_Condition) GetConditionAbsent() *AlertPolicy_Condition_MetricAbsence { - if x, ok := x.GetCondition().(*AlertPolicy_Condition_ConditionAbsent); ok { - return x.ConditionAbsent + if x != nil { + if x, ok := x.Condition.(*AlertPolicy_Condition_ConditionAbsent); ok { + return x.ConditionAbsent + } } return nil } func (x *AlertPolicy_Condition) GetConditionMatchedLog() *AlertPolicy_Condition_LogMatch { - if x, ok := x.GetCondition().(*AlertPolicy_Condition_ConditionMatchedLog); ok { - return x.ConditionMatchedLog + if x != nil { + if x, ok := x.Condition.(*AlertPolicy_Condition_ConditionMatchedLog); ok { + return x.ConditionMatchedLog + } } return nil } func (x *AlertPolicy_Condition) GetConditionMonitoringQueryLanguage() *AlertPolicy_Condition_MonitoringQueryLanguageCondition { - if x, ok := x.GetCondition().(*AlertPolicy_Condition_ConditionMonitoringQueryLanguage); ok { - return x.ConditionMonitoringQueryLanguage + if x != nil { + if x, ok := x.Condition.(*AlertPolicy_Condition_ConditionMonitoringQueryLanguage); ok { + return x.ConditionMonitoringQueryLanguage + } } return nil } func (x *AlertPolicy_Condition) GetConditionPrometheusQueryLanguage() *AlertPolicy_Condition_PrometheusQueryLanguageCondition { - if x, ok := x.GetCondition().(*AlertPolicy_Condition_ConditionPrometheusQueryLanguage); ok { - return x.ConditionPrometheusQueryLanguage + if x != nil { + if x, ok := x.Condition.(*AlertPolicy_Condition_ConditionPrometheusQueryLanguage); ok { + return x.ConditionPrometheusQueryLanguage + } } return nil } func (x *AlertPolicy_Condition) GetConditionSql() *AlertPolicy_Condition_SqlCondition { - if x, ok := x.GetCondition().(*AlertPolicy_Condition_ConditionSql); ok { - return x.ConditionSql + if x != nil { + if x, ok := x.Condition.(*AlertPolicy_Condition_ConditionSql); ok { + return x.ConditionSql + } } return nil } @@ -790,10 +801,7 @@ func (*AlertPolicy_Condition_ConditionSql) isAlertPolicy_Condition_Condition() { // Control over how the notification channels in `notification_channels` // are notified when this alert fires. type AlertPolicy_AlertStrategy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required for log-based alerting policies, i.e. policies with a `LogMatch` // condition. // @@ -809,6 +817,8 @@ type AlertPolicy_AlertStrategy struct { AutoClose *durationpb.Duration `protobuf:"bytes,3,opt,name=auto_close,json=autoClose,proto3" json:"auto_close,omitempty"` // Control how notifications will be sent out, on a per-channel basis. NotificationChannelStrategy []*AlertPolicy_AlertStrategy_NotificationChannelStrategy `protobuf:"bytes,4,rep,name=notification_channel_strategy,json=notificationChannelStrategy,proto3" json:"notification_channel_strategy,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AlertPolicy_AlertStrategy) Reset() { @@ -871,10 +881,7 @@ func (x *AlertPolicy_AlertStrategy) GetNotificationChannelStrategy() []*AlertPol // Links to content such as playbooks, repositories, and other resources. type AlertPolicy_Documentation_Link struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // A short display name for the link. The display name must not be empty // or exceed 63 characters. Example: "playbook". DisplayName string `protobuf:"bytes,1,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` @@ -883,7 +890,9 @@ type AlertPolicy_Documentation_Link struct { // in the path or the query parameters. The total length of a URL should // not exceed 2083 characters before and after variable expansion. // Example: "https://my_domain.com/playbook?name=${resource.name}" - Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` + Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AlertPolicy_Documentation_Link) Reset() { @@ -933,17 +942,16 @@ func (x *AlertPolicy_Documentation_Link) GetUrl() string { // Specifies how many time series must fail a predicate to trigger a // condition. If not specified, then a `{count: 1}` trigger is used. type AlertPolicy_Condition_Trigger struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // A type of trigger. // - // Types that are assignable to Type: + // Types that are valid to be assigned to Type: // // *AlertPolicy_Condition_Trigger_Count // *AlertPolicy_Condition_Trigger_Percent - Type isAlertPolicy_Condition_Trigger_Type `protobuf_oneof:"type"` + Type isAlertPolicy_Condition_Trigger_Type `protobuf_oneof:"type"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AlertPolicy_Condition_Trigger) Reset() { @@ -976,23 +984,27 @@ func (*AlertPolicy_Condition_Trigger) Descriptor() ([]byte, []int) { return file_google_monitoring_v3_alert_proto_rawDescGZIP(), []int{0, 1, 0} } -func (m *AlertPolicy_Condition_Trigger) GetType() isAlertPolicy_Condition_Trigger_Type { - if m != nil { - return m.Type +func (x *AlertPolicy_Condition_Trigger) GetType() isAlertPolicy_Condition_Trigger_Type { + if x != nil { + return x.Type } return nil } func (x *AlertPolicy_Condition_Trigger) GetCount() int32 { - if x, ok := x.GetType().(*AlertPolicy_Condition_Trigger_Count); ok { - return x.Count + if x != nil { + if x, ok := x.Type.(*AlertPolicy_Condition_Trigger_Count); ok { + return x.Count + } } return 0 } func (x *AlertPolicy_Condition_Trigger) GetPercent() float64 { - if x, ok := x.GetType().(*AlertPolicy_Condition_Trigger_Percent); ok { - return x.Percent + if x != nil { + if x, ok := x.Type.(*AlertPolicy_Condition_Trigger_Percent); ok { + return x.Percent + } } return 0 } @@ -1020,10 +1032,7 @@ func (*AlertPolicy_Condition_Trigger_Percent) isAlertPolicy_Condition_Trigger_Ty // A condition type that compares a collection of time series // against a threshold. type AlertPolicy_Condition_MetricThreshold struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. A // [filter](https://cloud.google.com/monitoring/api/v3/filters) that // identifies which time series should be compared with the threshold. @@ -1106,6 +1115,8 @@ type AlertPolicy_Condition_MetricThreshold struct { // are evaluated when data stops arriving. To use this control, the value // of the `duration` field must be greater than or equal to 60 seconds. EvaluationMissingData AlertPolicy_Condition_EvaluationMissingData `protobuf:"varint,11,opt,name=evaluation_missing_data,json=evaluationMissingData,proto3,enum=google.monitoring.v3.AlertPolicy_Condition_EvaluationMissingData" json:"evaluation_missing_data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AlertPolicy_Condition_MetricThreshold) Reset() { @@ -1214,10 +1225,7 @@ func (x *AlertPolicy_Condition_MetricThreshold) GetEvaluationMissingData() Alert // when a time series for the specified metric of a monitored // resource does not include any data in the specified `duration`. type AlertPolicy_Condition_MetricAbsence struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. A // [filter](https://cloud.google.com/monitoring/api/v3/filters) that // identifies which time series should be compared with the threshold. @@ -1254,7 +1262,9 @@ type AlertPolicy_Condition_MetricAbsence struct { // in order for the condition to trigger. If unspecified, then the // condition will trigger if the comparison is true for any of the // time series that have been identified by `filter` and `aggregations`. - Trigger *AlertPolicy_Condition_Trigger `protobuf:"bytes,3,opt,name=trigger,proto3" json:"trigger,omitempty"` + Trigger *AlertPolicy_Condition_Trigger `protobuf:"bytes,3,opt,name=trigger,proto3" json:"trigger,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AlertPolicy_Condition_MetricAbsence) Reset() { @@ -1320,10 +1330,7 @@ func (x *AlertPolicy_Condition_MetricAbsence) GetTrigger() *AlertPolicy_Conditio // satisfies the given filter. Logs from other projects in the metrics // scope are not evaluated. type AlertPolicy_Condition_LogMatch struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. A logs-based filter. See [Advanced Logs // Queries](https://cloud.google.com/logging/docs/view/advanced-queries) // for how this filter should be constructed. @@ -1339,7 +1346,9 @@ type AlertPolicy_Condition_LogMatch struct { // Please see [the documentation on logs-based metric // `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor) // for syntax and examples. - LabelExtractors map[string]string `protobuf:"bytes,2,rep,name=label_extractors,json=labelExtractors,proto3" json:"label_extractors,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + LabelExtractors map[string]string `protobuf:"bytes,2,rep,name=label_extractors,json=labelExtractors,proto3" json:"label_extractors,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AlertPolicy_Condition_LogMatch) Reset() { @@ -1389,10 +1398,7 @@ func (x *AlertPolicy_Condition_LogMatch) GetLabelExtractors() map[string]string // A condition type that allows alerting policies to be defined using // [Monitoring Query Language](https://cloud.google.com/monitoring/mql). type AlertPolicy_Condition_MonitoringQueryLanguageCondition struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // [Monitoring Query Language](https://cloud.google.com/monitoring/mql) // query that outputs a boolean stream. Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` @@ -1417,6 +1423,8 @@ type AlertPolicy_Condition_MonitoringQueryLanguageCondition struct { // A condition control that determines how metric-threshold conditions // are evaluated when data stops arriving. EvaluationMissingData AlertPolicy_Condition_EvaluationMissingData `protobuf:"varint,4,opt,name=evaluation_missing_data,json=evaluationMissingData,proto3,enum=google.monitoring.v3.AlertPolicy_Condition_EvaluationMissingData" json:"evaluation_missing_data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AlertPolicy_Condition_MonitoringQueryLanguageCondition) Reset() { @@ -1509,10 +1517,7 @@ func (x *AlertPolicy_Condition_MonitoringQueryLanguageCondition) GetEvaluationMi // alerting rule features. There are no new such features at the present // time (2023-06-26). type AlertPolicy_Condition_PrometheusQueryLanguageCondition struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The PromQL expression to evaluate. Every evaluation cycle // this expression is evaluated at the current time, and all resultant // time series become pending/firing alerts. This field must not be empty. @@ -1538,7 +1543,7 @@ type AlertPolicy_Condition_PrometheusQueryLanguageCondition struct { // variables](https://cloud.google.com/monitoring/alerts/doc-variables#doc-vars). // The only available variable names are the names of the labels in the // PromQL result, including "__name__" and "value". "labels" may be empty. - Labels map[string]string `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Labels map[string]string `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // Optional. The rule group name of this alert in the corresponding // Prometheus configuration file. // @@ -1576,6 +1581,8 @@ type AlertPolicy_Condition_PrometheusQueryLanguageCondition struct { // Users with the `monitoring.alertPolicyViewer` role are able to see the // name of the non-existent metric in the alerting policy condition. DisableMetricValidation bool `protobuf:"varint,7,opt,name=disable_metric_validation,json=disableMetricValidation,proto3" json:"disable_metric_validation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AlertPolicy_Condition_PrometheusQueryLanguageCondition) Reset() { @@ -1661,10 +1668,7 @@ func (x *AlertPolicy_Condition_PrometheusQueryLanguageCondition) GetDisableMetri // SQL conditions examine a sliding window of logs using GoogleSQL. // Alert policies with SQL conditions may incur additional billing. type AlertPolicy_Condition_SqlCondition struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The Log Analytics SQL query to run, as a string. The query // must conform to the required shape. Specifically, the query must not // try to filter the input by time. A filter will automatically be @@ -1683,7 +1687,7 @@ type AlertPolicy_Condition_SqlCondition struct { Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` // The schedule indicates how often the query should be run. // - // Types that are assignable to Schedule: + // Types that are valid to be assigned to Schedule: // // *AlertPolicy_Condition_SqlCondition_Minutes_ // *AlertPolicy_Condition_SqlCondition_Hourly_ @@ -1691,11 +1695,13 @@ type AlertPolicy_Condition_SqlCondition struct { Schedule isAlertPolicy_Condition_SqlCondition_Schedule `protobuf_oneof:"schedule"` // The test to be run against the SQL result set. // - // Types that are assignable to Evaluate: + // Types that are valid to be assigned to Evaluate: // // *AlertPolicy_Condition_SqlCondition_RowCountTest_ // *AlertPolicy_Condition_SqlCondition_BooleanTest_ - Evaluate isAlertPolicy_Condition_SqlCondition_Evaluate `protobuf_oneof:"evaluate"` + Evaluate isAlertPolicy_Condition_SqlCondition_Evaluate `protobuf_oneof:"evaluate"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AlertPolicy_Condition_SqlCondition) Reset() { @@ -1735,51 +1741,61 @@ func (x *AlertPolicy_Condition_SqlCondition) GetQuery() string { return "" } -func (m *AlertPolicy_Condition_SqlCondition) GetSchedule() isAlertPolicy_Condition_SqlCondition_Schedule { - if m != nil { - return m.Schedule +func (x *AlertPolicy_Condition_SqlCondition) GetSchedule() isAlertPolicy_Condition_SqlCondition_Schedule { + if x != nil { + return x.Schedule } return nil } func (x *AlertPolicy_Condition_SqlCondition) GetMinutes() *AlertPolicy_Condition_SqlCondition_Minutes { - if x, ok := x.GetSchedule().(*AlertPolicy_Condition_SqlCondition_Minutes_); ok { - return x.Minutes + if x != nil { + if x, ok := x.Schedule.(*AlertPolicy_Condition_SqlCondition_Minutes_); ok { + return x.Minutes + } } return nil } func (x *AlertPolicy_Condition_SqlCondition) GetHourly() *AlertPolicy_Condition_SqlCondition_Hourly { - if x, ok := x.GetSchedule().(*AlertPolicy_Condition_SqlCondition_Hourly_); ok { - return x.Hourly + if x != nil { + if x, ok := x.Schedule.(*AlertPolicy_Condition_SqlCondition_Hourly_); ok { + return x.Hourly + } } return nil } func (x *AlertPolicy_Condition_SqlCondition) GetDaily() *AlertPolicy_Condition_SqlCondition_Daily { - if x, ok := x.GetSchedule().(*AlertPolicy_Condition_SqlCondition_Daily_); ok { - return x.Daily + if x != nil { + if x, ok := x.Schedule.(*AlertPolicy_Condition_SqlCondition_Daily_); ok { + return x.Daily + } } return nil } -func (m *AlertPolicy_Condition_SqlCondition) GetEvaluate() isAlertPolicy_Condition_SqlCondition_Evaluate { - if m != nil { - return m.Evaluate +func (x *AlertPolicy_Condition_SqlCondition) GetEvaluate() isAlertPolicy_Condition_SqlCondition_Evaluate { + if x != nil { + return x.Evaluate } return nil } func (x *AlertPolicy_Condition_SqlCondition) GetRowCountTest() *AlertPolicy_Condition_SqlCondition_RowCountTest { - if x, ok := x.GetEvaluate().(*AlertPolicy_Condition_SqlCondition_RowCountTest_); ok { - return x.RowCountTest + if x != nil { + if x, ok := x.Evaluate.(*AlertPolicy_Condition_SqlCondition_RowCountTest_); ok { + return x.RowCountTest + } } return nil } func (x *AlertPolicy_Condition_SqlCondition) GetBooleanTest() *AlertPolicy_Condition_SqlCondition_BooleanTest { - if x, ok := x.GetEvaluate().(*AlertPolicy_Condition_SqlCondition_BooleanTest_); ok { - return x.BooleanTest + if x != nil { + if x, ok := x.Evaluate.(*AlertPolicy_Condition_SqlCondition_BooleanTest_); ok { + return x.BooleanTest + } } return nil } @@ -1832,10 +1848,7 @@ func (*AlertPolicy_Condition_SqlCondition_BooleanTest_) isAlertPolicy_Condition_ // Options used when forecasting the time series and testing // the predicted value against the threshold. type AlertPolicy_Condition_MetricThreshold_ForecastOptions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The length of time into the future to forecast whether a // time series will violate the threshold. If the predicted value is // found to violate the threshold, and the violation is observed in all @@ -1843,6 +1856,8 @@ type AlertPolicy_Condition_MetricThreshold_ForecastOptions struct { // considered to be failing. // The forecast horizon can range from 1 hour to 60 hours. ForecastHorizon *durationpb.Duration `protobuf:"bytes,1,opt,name=forecast_horizon,json=forecastHorizon,proto3" json:"forecast_horizon,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AlertPolicy_Condition_MetricThreshold_ForecastOptions) Reset() { @@ -1884,14 +1899,13 @@ func (x *AlertPolicy_Condition_MetricThreshold_ForecastOptions) GetForecastHoriz // Used to schedule the query to run every so many minutes. type AlertPolicy_Condition_SqlCondition_Minutes struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. Number of minutes between runs. The interval must be // greater than or equal to 5 minutes and less than or equal to 1440 // minutes. - Periodicity int32 `protobuf:"varint,1,opt,name=periodicity,proto3" json:"periodicity,omitempty"` + Periodicity int32 `protobuf:"varint,1,opt,name=periodicity,proto3" json:"periodicity,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AlertPolicy_Condition_SqlCondition_Minutes) Reset() { @@ -1933,10 +1947,7 @@ func (x *AlertPolicy_Condition_SqlCondition_Minutes) GetPeriodicity() int32 { // Used to schedule the query to run every so many hours. type AlertPolicy_Condition_SqlCondition_Hourly struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The number of hours between runs. Must be greater than or // equal to 1 hour and less than or equal to 48 hours. Periodicity int32 `protobuf:"varint,1,opt,name=periodicity,proto3" json:"periodicity,omitempty"` @@ -1944,7 +1955,9 @@ type AlertPolicy_Condition_SqlCondition_Hourly struct { // query. Must be greater than or equal to 0 minutes and less than or // equal to 59 minutes. If left unspecified, then an arbitrary offset // is used. - MinuteOffset *int32 `protobuf:"varint,2,opt,name=minute_offset,json=minuteOffset,proto3,oneof" json:"minute_offset,omitempty"` + MinuteOffset *int32 `protobuf:"varint,2,opt,name=minute_offset,json=minuteOffset,proto3,oneof" json:"minute_offset,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AlertPolicy_Condition_SqlCondition_Hourly) Reset() { @@ -1993,10 +2006,7 @@ func (x *AlertPolicy_Condition_SqlCondition_Hourly) GetMinuteOffset() int32 { // Used to schedule the query to run every so many days. type AlertPolicy_Condition_SqlCondition_Daily struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The number of days between runs. Must be greater than or // equal to 1 day and less than or equal to 31 days. Periodicity int32 `protobuf:"varint,1,opt,name=periodicity,proto3" json:"periodicity,omitempty"` @@ -2004,6 +2014,8 @@ type AlertPolicy_Condition_SqlCondition_Daily struct { // left unspecified, the server picks an arbitrary time of day and runs // the query at the same time each day. ExecutionTime *timeofday.TimeOfDay `protobuf:"bytes,2,opt,name=execution_time,json=executionTime,proto3" json:"execution_time,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AlertPolicy_Condition_SqlCondition_Daily) Reset() { @@ -2053,15 +2065,14 @@ func (x *AlertPolicy_Condition_SqlCondition_Daily) GetExecutionTime() *timeofday // A test that checks if the number of rows in the result set // violates some threshold. type AlertPolicy_Condition_SqlCondition_RowCountTest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The comparison to apply between the number of rows returned // by the query and the threshold. Comparison ComparisonType `protobuf:"varint,1,opt,name=comparison,proto3,enum=google.monitoring.v3.ComparisonType" json:"comparison,omitempty"` // Required. The value against which to compare the row count. - Threshold int64 `protobuf:"varint,2,opt,name=threshold,proto3" json:"threshold,omitempty"` + Threshold int64 `protobuf:"varint,2,opt,name=threshold,proto3" json:"threshold,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AlertPolicy_Condition_SqlCondition_RowCountTest) Reset() { @@ -2111,13 +2122,12 @@ func (x *AlertPolicy_Condition_SqlCondition_RowCountTest) GetThreshold() int64 { // A test that uses an alerting result in a boolean column produced by // the SQL query. type AlertPolicy_Condition_SqlCondition_BooleanTest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The name of the column containing the boolean value. If the // value in a row is NULL, that row is ignored. - Column string `protobuf:"bytes,1,opt,name=column,proto3" json:"column,omitempty"` + Column string `protobuf:"bytes,1,opt,name=column,proto3" json:"column,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AlertPolicy_Condition_SqlCondition_BooleanTest) Reset() { @@ -2160,12 +2170,11 @@ func (x *AlertPolicy_Condition_SqlCondition_BooleanTest) GetColumn() string { // Control over the rate of notifications sent to this alerting policy's // notification channels. type AlertPolicy_AlertStrategy_NotificationRateLimit struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Not more than one notification per `period`. - Period *durationpb.Duration `protobuf:"bytes,1,opt,name=period,proto3" json:"period,omitempty"` + Period *durationpb.Duration `protobuf:"bytes,1,opt,name=period,proto3" json:"period,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AlertPolicy_AlertStrategy_NotificationRateLimit) Reset() { @@ -2208,10 +2217,7 @@ func (x *AlertPolicy_AlertStrategy_NotificationRateLimit) GetPeriod() *durationp // Control over how the notification channels in `notification_channels` // are notified when this alert fires, on a per-channel basis. type AlertPolicy_AlertStrategy_NotificationChannelStrategy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The full REST resource name for the notification channels that these // settings apply to. Each of these correspond to the name field in one // of the NotificationChannel objects referenced in the @@ -2223,6 +2229,8 @@ type AlertPolicy_AlertStrategy_NotificationChannelStrategy struct { // The frequency at which to send reminder notifications for open // incidents. RenotifyInterval *durationpb.Duration `protobuf:"bytes,2,opt,name=renotify_interval,json=renotifyInterval,proto3" json:"renotify_interval,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AlertPolicy_AlertStrategy_NotificationChannelStrategy) Reset() { @@ -2271,481 +2279,169 @@ func (x *AlertPolicy_AlertStrategy_NotificationChannelStrategy) GetRenotifyInter var File_google_monitoring_v3_alert_proto protoreflect.FileDescriptor -var file_google_monitoring_v3_alert_proto_rawDesc = []byte{ - 0x0a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x14, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, - 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x6d, 0x75, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 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, 0x1a, 0x1b, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x66, - 0x64, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe5, 0x35, 0x0a, 0x0b, 0x41, 0x6c, - 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 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, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, - 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x55, 0x0a, 0x0d, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, - 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, - 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x64, - 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x52, 0x0a, 0x0b, - 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x31, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, - 0x12, 0x4b, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0c, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6c, 0x65, 0x72, - 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x53, 0x0a, - 0x08, 0x63, 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x37, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x62, - 0x69, 0x6e, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x62, 0x69, 0x6e, - 0x65, 0x72, 0x12, 0x34, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 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, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, - 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x2e, 0x0a, 0x08, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x69, 0x74, 0x79, 0x18, 0x12, 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, 0x08, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x69, 0x74, 0x79, 0x12, 0x33, 0x0a, 0x15, 0x6e, 0x6f, 0x74, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, - 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x12, 0x4d, 0x0a, - 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x75, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x0e, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x4d, 0x0a, 0x0f, - 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, - 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x75, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x0e, 0x6d, 0x75, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x56, 0x0a, 0x0e, 0x61, - 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x18, 0x15, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, - 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x53, 0x74, 0x72, 0x61, - 0x74, 0x65, 0x67, 0x79, 0x52, 0x0d, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x53, 0x74, 0x72, 0x61, 0x74, - 0x65, 0x67, 0x79, 0x12, 0x4b, 0x0a, 0x08, 0x73, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x18, - 0x16, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6c, 0x65, - 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x53, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, - 0x79, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x73, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, - 0x1a, 0xf3, 0x01, 0x0a, 0x0d, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, - 0x6d, 0x69, 0x6d, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x6d, 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x07, 0x73, 0x75, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, - 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x4f, 0x0a, 0x05, 0x6c, 0x69, 0x6e, 0x6b, - 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, - 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, - 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x42, 0x03, 0xe0, - 0x41, 0x01, 0x52, 0x05, 0x6c, 0x69, 0x6e, 0x6b, 0x73, 0x1a, 0x3b, 0x0a, 0x04, 0x4c, 0x69, 0x6e, - 0x6b, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x1a, 0xa5, 0x23, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x64, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, - 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x6e, 0x0a, 0x13, 0x63, - 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, - 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, - 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x64, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x54, 0x68, 0x72, 0x65, - 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x48, 0x00, 0x52, 0x12, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x66, 0x0a, 0x10, 0x63, - 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x62, 0x73, 0x65, 0x6e, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6c, 0x65, - 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x41, 0x62, 0x73, 0x65, 0x6e, 0x63, 0x65, - 0x48, 0x00, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x62, 0x73, - 0x65, 0x6e, 0x74, 0x12, 0x6a, 0x0a, 0x15, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x5f, 0x6c, 0x6f, 0x67, 0x18, 0x14, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x4c, 0x6f, 0x67, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x48, 0x00, 0x52, 0x13, 0x63, 0x6f, 0x6e, 0x64, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x4c, 0x6f, 0x67, 0x12, - 0x9d, 0x01, 0x0a, 0x23, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x6c, - 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4c, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, - 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, - 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x20, 0x63, - 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x6e, 0x67, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x12, - 0x9d, 0x01, 0x0a, 0x23, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, - 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x6c, - 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4c, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, - 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x72, 0x6f, 0x6d, 0x65, - 0x74, 0x68, 0x65, 0x75, 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, - 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x20, 0x63, - 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, - 0x75, 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x12, - 0x5f, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x71, 0x6c, - 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6c, - 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x71, 0x6c, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x48, 0x00, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x71, 0x6c, - 0x1a, 0x45, 0x0a, 0x07, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x05, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x05, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x07, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x07, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x42, - 0x06, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x1a, 0xc8, 0x06, 0x0a, 0x0f, 0x4d, 0x65, 0x74, 0x72, - 0x69, 0x63, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x1b, 0x0a, 0x06, 0x66, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, - 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x45, 0x0a, 0x0c, 0x61, 0x67, 0x67, 0x72, - 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x0c, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x2d, 0x0a, 0x12, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x66, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x64, 0x65, 0x6e, - 0x6f, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x5c, - 0x0a, 0x18, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x67, - 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, - 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x17, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, - 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x76, 0x0a, 0x10, - 0x66, 0x6f, 0x72, 0x65, 0x63, 0x61, 0x73, 0x74, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6c, - 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, - 0x6f, 0x6c, 0x64, 0x2e, 0x46, 0x6f, 0x72, 0x65, 0x63, 0x61, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x0f, 0x66, 0x6f, 0x72, 0x65, 0x63, 0x61, 0x73, 0x74, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x44, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x69, 0x73, - 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, - 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x69, 0x73, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, - 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x69, 0x73, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x0f, 0x74, 0x68, - 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x01, 0x52, 0x0e, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x06, 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, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4d, 0x0a, 0x07, 0x74, 0x72, - 0x69, 0x67, 0x67, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x33, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x43, - 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, - 0x52, 0x07, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x12, 0x79, 0x0a, 0x17, 0x65, 0x76, 0x61, - 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x5f, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x41, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, - 0x33, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x43, 0x6f, - 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x44, 0x61, 0x74, 0x61, 0x52, 0x15, 0x65, - 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, - 0x44, 0x61, 0x74, 0x61, 0x1a, 0x5c, 0x0a, 0x0f, 0x46, 0x6f, 0x72, 0x65, 0x63, 0x61, 0x73, 0x74, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x49, 0x0a, 0x10, 0x66, 0x6f, 0x72, 0x65, 0x63, - 0x61, 0x73, 0x74, 0x5f, 0x68, 0x6f, 0x72, 0x69, 0x7a, 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, 0x42, 0x03, 0xe0, 0x41, - 0x02, 0x52, 0x0f, 0x66, 0x6f, 0x72, 0x65, 0x63, 0x61, 0x73, 0x74, 0x48, 0x6f, 0x72, 0x69, 0x7a, - 0x6f, 0x6e, 0x1a, 0xf9, 0x01, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x41, 0x62, 0x73, - 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x12, 0x45, 0x0a, 0x0c, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, - 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x61, 0x67, 0x67, 0x72, - 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x35, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 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, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x4d, 0x0a, 0x07, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, - 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x54, 0x72, - 0x69, 0x67, 0x67, 0x65, 0x72, 0x52, 0x07, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x1a, 0xe1, - 0x01, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x1b, 0x0a, 0x06, 0x66, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, - 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x74, 0x0a, 0x10, 0x6c, 0x61, 0x62, 0x65, - 0x6c, 0x5f, 0x65, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x49, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x4c, 0x6f, 0x67, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x45, 0x78, - 0x74, 0x72, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x6c, - 0x61, 0x62, 0x65, 0x6c, 0x45, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x1a, 0x42, - 0x0a, 0x14, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x45, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6f, 0x72, - 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, 0x1a, 0xb9, 0x02, 0x0a, 0x20, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, - 0x67, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x43, 0x6f, - 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x35, 0x0a, - 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 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, 0x08, 0x64, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4d, 0x0a, 0x07, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6c, 0x65, - 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x52, 0x07, 0x74, 0x72, 0x69, 0x67, - 0x67, 0x65, 0x72, 0x12, 0x79, 0x0a, 0x17, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x41, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6c, 0x65, 0x72, - 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x73, 0x73, - 0x69, 0x6e, 0x67, 0x44, 0x61, 0x74, 0x61, 0x52, 0x15, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x85, - 0x04, 0x0a, 0x20, 0x50, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x3a, - 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 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, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4f, 0x0a, 0x13, 0x65, 0x76, - 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, - 0x6c, 0x18, 0x03, 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, 0x12, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x75, 0x0a, 0x06, 0x6c, - 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x58, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x33, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x43, - 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, - 0x65, 0x75, 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, - 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 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, 0x22, 0x0a, 0x0a, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x72, 0x75, 0x6c, - 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x22, 0x0a, 0x0a, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, - 0x72, 0x75, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, - 0x09, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x3f, 0x0a, 0x19, 0x64, 0x69, - 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, - 0x41, 0x01, 0x52, 0x17, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x72, 0x69, - 0x63, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, 0x1a, 0xee, 0x07, 0x0a, 0x0c, 0x53, 0x71, 0x6c, 0x43, 0x6f, - 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x05, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x12, 0x5c, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, - 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x53, 0x71, 0x6c, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x69, - 0x6e, 0x75, 0x74, 0x65, 0x73, 0x48, 0x00, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, - 0x12, 0x59, 0x0a, 0x06, 0x68, 0x6f, 0x75, 0x72, 0x6c, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x3f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, - 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x71, - 0x6c, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x48, 0x6f, 0x75, 0x72, 0x6c, - 0x79, 0x48, 0x00, 0x52, 0x06, 0x68, 0x6f, 0x75, 0x72, 0x6c, 0x79, 0x12, 0x56, 0x0a, 0x05, 0x64, - 0x61, 0x69, 0x6c, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, - 0x33, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x43, 0x6f, - 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x71, 0x6c, 0x43, 0x6f, 0x6e, 0x64, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x48, 0x00, 0x52, 0x05, 0x64, 0x61, - 0x69, 0x6c, 0x79, 0x12, 0x6d, 0x0a, 0x0e, 0x72, 0x6f, 0x77, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x5f, 0x74, 0x65, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x45, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x33, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x43, - 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x71, 0x6c, 0x43, 0x6f, 0x6e, 0x64, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x6f, 0x77, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x65, - 0x73, 0x74, 0x48, 0x01, 0x52, 0x0c, 0x72, 0x6f, 0x77, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x65, - 0x73, 0x74, 0x12, 0x69, 0x0a, 0x0c, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x5f, 0x74, 0x65, - 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x44, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, - 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x64, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x71, 0x6c, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x54, 0x65, 0x73, 0x74, 0x48, 0x01, - 0x52, 0x0b, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x54, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x0a, - 0x07, 0x4d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x69, - 0x6f, 0x64, 0x69, 0x63, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, - 0x41, 0x02, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x69, 0x63, 0x69, 0x74, 0x79, 0x1a, - 0x70, 0x0a, 0x06, 0x48, 0x6f, 0x75, 0x72, 0x6c, 0x79, 0x12, 0x25, 0x0a, 0x0b, 0x70, 0x65, 0x72, - 0x69, 0x6f, 0x64, 0x69, 0x63, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, - 0xe0, 0x41, 0x02, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x69, 0x63, 0x69, 0x74, 0x79, - 0x12, 0x2d, 0x0a, 0x0d, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, - 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x00, 0x52, 0x0c, - 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x88, 0x01, 0x01, 0x42, - 0x10, 0x0a, 0x0e, 0x5f, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, - 0x74, 0x1a, 0x72, 0x0a, 0x05, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x12, 0x25, 0x0a, 0x0b, 0x70, 0x65, - 0x72, 0x69, 0x6f, 0x64, 0x69, 0x63, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42, - 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x69, 0x63, 0x69, 0x74, - 0x79, 0x12, 0x42, 0x0a, 0x0e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, - 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x4f, 0x66, 0x44, 0x61, - 0x79, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x1a, 0x7c, 0x0a, 0x0c, 0x52, 0x6f, 0x77, 0x43, 0x6f, 0x75, 0x6e, - 0x74, 0x54, 0x65, 0x73, 0x74, 0x12, 0x49, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x69, - 0x73, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, - 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x69, 0x73, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x42, - 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x69, 0x73, 0x6f, 0x6e, - 0x12, 0x21, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, - 0x6f, 0x6c, 0x64, 0x1a, 0x2a, 0x0a, 0x0b, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x54, 0x65, - 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x42, - 0x0a, 0x0a, 0x08, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x42, 0x0a, 0x0a, 0x08, 0x65, - 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x22, 0xad, 0x01, 0x0a, 0x15, 0x45, 0x76, 0x61, 0x6c, - 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x44, 0x61, 0x74, - 0x61, 0x12, 0x27, 0x0a, 0x23, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, - 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x55, 0x4e, 0x53, - 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x24, 0x0a, 0x20, 0x45, 0x56, - 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, - 0x5f, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x49, 0x4e, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x01, - 0x12, 0x22, 0x0a, 0x1e, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, - 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x41, 0x43, 0x54, 0x49, - 0x56, 0x45, 0x10, 0x02, 0x12, 0x21, 0x0a, 0x1d, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, - 0x4f, 0x4e, 0x5f, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x5f, - 0x4e, 0x4f, 0x5f, 0x4f, 0x50, 0x10, 0x03, 0x3a, 0x97, 0x02, 0xea, 0x41, 0x93, 0x02, 0x0a, 0x2e, - 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x46, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x7d, 0x2f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, - 0x2f, 0x7b, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x7d, 0x2f, - 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x63, 0x6f, 0x6e, 0x64, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x12, 0x50, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, - 0x65, 0x73, 0x2f, 0x7b, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x7d, 0x2f, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x63, 0x6f, - 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x12, 0x44, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, - 0x73, 0x2f, 0x7b, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x7d, 0x2f, 0x61, 0x6c, 0x65, 0x72, 0x74, - 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, 0x7b, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, - 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x7d, 0x2f, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x2f, 0x7b, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x12, 0x01, - 0x2a, 0x42, 0x0b, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x96, - 0x06, 0x0a, 0x0d, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, - 0x12, 0x7d, 0x0a, 0x17, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x45, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, - 0x67, 0x79, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x15, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, - 0x75, 0x0a, 0x14, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x42, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, - 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x2e, 0x4e, - 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6d, 0x70, - 0x74, 0x52, 0x13, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, - 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x73, 0x12, 0x38, 0x0a, 0x0a, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x63, - 0x6c, 0x6f, 0x73, 0x65, 0x18, 0x03, 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, 0x09, 0x61, 0x75, 0x74, 0x6f, 0x43, 0x6c, 0x6f, 0x73, 0x65, - 0x12, 0x8f, 0x01, 0x0a, 0x1d, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, - 0x67, 0x79, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, - 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x41, 0x6c, 0x65, 0x72, - 0x74, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x53, 0x74, 0x72, - 0x61, 0x74, 0x65, 0x67, 0x79, 0x52, 0x1b, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, - 0x67, 0x79, 0x1a, 0x4a, 0x0a, 0x15, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x31, 0x0a, 0x06, 0x70, - 0x65, 0x72, 0x69, 0x6f, 0x64, 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, 0x52, 0x06, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x1a, 0xa3, - 0x01, 0x0a, 0x1b, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, - 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x3c, - 0x0a, 0x1a, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, - 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x18, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x46, 0x0a, 0x11, - 0x72, 0x65, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, - 0x6c, 0x18, 0x02, 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, 0x10, 0x72, 0x65, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x49, 0x6e, 0x74, 0x65, - 0x72, 0x76, 0x61, 0x6c, 0x22, 0x51, 0x0a, 0x12, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x12, 0x23, 0x0a, 0x1f, 0x4e, 0x4f, - 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x4d, 0x50, - 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, - 0x0a, 0x0a, 0x06, 0x4f, 0x50, 0x45, 0x4e, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x43, - 0x4c, 0x4f, 0x53, 0x45, 0x44, 0x10, 0x03, 0x1a, 0x3d, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 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, 0x22, 0x61, 0x0a, 0x15, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x17, 0x0a, 0x13, 0x43, 0x4f, 0x4d, 0x42, 0x49, 0x4e, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, - 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4e, 0x44, 0x10, - 0x01, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x52, 0x10, 0x02, 0x12, 0x1e, 0x0a, 0x1a, 0x41, 0x4e, 0x44, - 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x49, 0x4e, 0x47, 0x5f, 0x52, - 0x45, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x03, 0x22, 0x4a, 0x0a, 0x08, 0x53, 0x65, 0x76, - 0x65, 0x72, 0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x14, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, - 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, - 0x0c, 0x0a, 0x08, 0x43, 0x52, 0x49, 0x54, 0x49, 0x43, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x09, 0x0a, - 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x52, 0x4e, - 0x49, 0x4e, 0x47, 0x10, 0x03, 0x3a, 0xc9, 0x01, 0xea, 0x41, 0xc5, 0x01, 0x0a, 0x25, 0x6d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, - 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x12, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, - 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, 0x7b, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x70, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x7d, 0x12, 0x39, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x7d, 0x2f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, - 0x2f, 0x7b, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x7d, 0x12, - 0x2d, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, - 0x7d, 0x2f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, - 0x7b, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x7d, 0x12, 0x01, - 0x2a, 0x42, 0xc5, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x42, 0x0a, - 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, - 0x6f, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x70, 0x69, - 0x76, 0x33, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, - 0x70, 0x62, 0x3b, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x70, 0x62, 0xaa, - 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x4d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x1a, 0x47, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x4d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x33, 0xea, 0x02, 0x1d, 0x47, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x3a, 0x3a, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x3a, 0x3a, 0x4d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} +const file_google_monitoring_v3_alert_proto_rawDesc = "" + + "\n" + + " google/monitoring/v3/alert.proto\x12\x14google.monitoring.v3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a!google/monitoring/v3/common.proto\x1a*google/monitoring/v3/mutation_record.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x17google/rpc/status.proto\x1a\x1bgoogle/type/timeofday.proto\"\xe55\n" + + "\vAlertPolicy\x12\x17\n" + + "\x04name\x18\x01 \x01(\tB\x03\xe0A\bR\x04name\x12!\n" + + "\fdisplay_name\x18\x02 \x01(\tR\vdisplayName\x12U\n" + + "\rdocumentation\x18\r \x01(\v2/.google.monitoring.v3.AlertPolicy.DocumentationR\rdocumentation\x12R\n" + + "\vuser_labels\x18\x10 \x03(\v21.google.monitoring.v3.AlertPolicy.UserLabelsEntryR\n" + + "userLabels\x12K\n" + + "\n" + + "conditions\x18\f \x03(\v2+.google.monitoring.v3.AlertPolicy.ConditionR\n" + + "conditions\x12S\n" + + "\bcombiner\x18\x06 \x01(\x0e27.google.monitoring.v3.AlertPolicy.ConditionCombinerTypeR\bcombiner\x124\n" + + "\aenabled\x18\x11 \x01(\v2\x1a.google.protobuf.BoolValueR\aenabled\x12.\n" + + "\bvalidity\x18\x12 \x01(\v2\x12.google.rpc.StatusR\bvalidity\x123\n" + + "\x15notification_channels\x18\x0e \x03(\tR\x14notificationChannels\x12M\n" + + "\x0fcreation_record\x18\n" + + " \x01(\v2$.google.monitoring.v3.MutationRecordR\x0ecreationRecord\x12M\n" + + "\x0fmutation_record\x18\v \x01(\v2$.google.monitoring.v3.MutationRecordR\x0emutationRecord\x12V\n" + + "\x0ealert_strategy\x18\x15 \x01(\v2/.google.monitoring.v3.AlertPolicy.AlertStrategyR\ralertStrategy\x12K\n" + + "\bseverity\x18\x16 \x01(\x0e2*.google.monitoring.v3.AlertPolicy.SeverityB\x03\xe0A\x01R\bseverity\x1a\xf3\x01\n" + + "\rDocumentation\x12\x18\n" + + "\acontent\x18\x01 \x01(\tR\acontent\x12\x1b\n" + + "\tmime_type\x18\x02 \x01(\tR\bmimeType\x12\x1d\n" + + "\asubject\x18\x03 \x01(\tB\x03\xe0A\x01R\asubject\x12O\n" + + "\x05links\x18\x04 \x03(\v24.google.monitoring.v3.AlertPolicy.Documentation.LinkB\x03\xe0A\x01R\x05links\x1a;\n" + + "\x04Link\x12!\n" + + "\fdisplay_name\x18\x01 \x01(\tR\vdisplayName\x12\x10\n" + + "\x03url\x18\x02 \x01(\tR\x03url\x1a\xa5#\n" + + "\tCondition\x12\x12\n" + + "\x04name\x18\f \x01(\tR\x04name\x12!\n" + + "\fdisplay_name\x18\x06 \x01(\tR\vdisplayName\x12n\n" + + "\x13condition_threshold\x18\x01 \x01(\v2;.google.monitoring.v3.AlertPolicy.Condition.MetricThresholdH\x00R\x12conditionThreshold\x12f\n" + + "\x10condition_absent\x18\x02 \x01(\v29.google.monitoring.v3.AlertPolicy.Condition.MetricAbsenceH\x00R\x0fconditionAbsent\x12j\n" + + "\x15condition_matched_log\x18\x14 \x01(\v24.google.monitoring.v3.AlertPolicy.Condition.LogMatchH\x00R\x13conditionMatchedLog\x12\x9d\x01\n" + + "#condition_monitoring_query_language\x18\x13 \x01(\v2L.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageConditionH\x00R conditionMonitoringQueryLanguage\x12\x9d\x01\n" + + "#condition_prometheus_query_language\x18\x15 \x01(\v2L.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageConditionH\x00R conditionPrometheusQueryLanguage\x12_\n" + + "\rcondition_sql\x18\x16 \x01(\v28.google.monitoring.v3.AlertPolicy.Condition.SqlConditionH\x00R\fconditionSql\x1aE\n" + + "\aTrigger\x12\x16\n" + + "\x05count\x18\x01 \x01(\x05H\x00R\x05count\x12\x1a\n" + + "\apercent\x18\x02 \x01(\x01H\x00R\apercentB\x06\n" + + "\x04type\x1a\xc8\x06\n" + + "\x0fMetricThreshold\x12\x1b\n" + + "\x06filter\x18\x02 \x01(\tB\x03\xe0A\x02R\x06filter\x12E\n" + + "\faggregations\x18\b \x03(\v2!.google.monitoring.v3.AggregationR\faggregations\x12-\n" + + "\x12denominator_filter\x18\t \x01(\tR\x11denominatorFilter\x12\\\n" + + "\x18denominator_aggregations\x18\n" + + " \x03(\v2!.google.monitoring.v3.AggregationR\x17denominatorAggregations\x12v\n" + + "\x10forecast_options\x18\f \x01(\v2K.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptionsR\x0fforecastOptions\x12D\n" + + "\n" + + "comparison\x18\x04 \x01(\x0e2$.google.monitoring.v3.ComparisonTypeR\n" + + "comparison\x12'\n" + + "\x0fthreshold_value\x18\x05 \x01(\x01R\x0ethresholdValue\x125\n" + + "\bduration\x18\x06 \x01(\v2\x19.google.protobuf.DurationR\bduration\x12M\n" + + "\atrigger\x18\a \x01(\v23.google.monitoring.v3.AlertPolicy.Condition.TriggerR\atrigger\x12y\n" + + "\x17evaluation_missing_data\x18\v \x01(\x0e2A.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingDataR\x15evaluationMissingData\x1a\\\n" + + "\x0fForecastOptions\x12I\n" + + "\x10forecast_horizon\x18\x01 \x01(\v2\x19.google.protobuf.DurationB\x03\xe0A\x02R\x0fforecastHorizon\x1a\xf9\x01\n" + + "\rMetricAbsence\x12\x1b\n" + + "\x06filter\x18\x01 \x01(\tB\x03\xe0A\x02R\x06filter\x12E\n" + + "\faggregations\x18\x05 \x03(\v2!.google.monitoring.v3.AggregationR\faggregations\x125\n" + + "\bduration\x18\x02 \x01(\v2\x19.google.protobuf.DurationR\bduration\x12M\n" + + "\atrigger\x18\x03 \x01(\v23.google.monitoring.v3.AlertPolicy.Condition.TriggerR\atrigger\x1a\xe1\x01\n" + + "\bLogMatch\x12\x1b\n" + + "\x06filter\x18\x01 \x01(\tB\x03\xe0A\x02R\x06filter\x12t\n" + + "\x10label_extractors\x18\x02 \x03(\v2I.google.monitoring.v3.AlertPolicy.Condition.LogMatch.LabelExtractorsEntryR\x0flabelExtractors\x1aB\n" + + "\x14LabelExtractorsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1a\xb9\x02\n" + + " MonitoringQueryLanguageCondition\x12\x14\n" + + "\x05query\x18\x01 \x01(\tR\x05query\x125\n" + + "\bduration\x18\x02 \x01(\v2\x19.google.protobuf.DurationR\bduration\x12M\n" + + "\atrigger\x18\x03 \x01(\v23.google.monitoring.v3.AlertPolicy.Condition.TriggerR\atrigger\x12y\n" + + "\x17evaluation_missing_data\x18\x04 \x01(\x0e2A.google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingDataR\x15evaluationMissingData\x1a\x85\x04\n" + + " PrometheusQueryLanguageCondition\x12\x19\n" + + "\x05query\x18\x01 \x01(\tB\x03\xe0A\x02R\x05query\x12:\n" + + "\bduration\x18\x02 \x01(\v2\x19.google.protobuf.DurationB\x03\xe0A\x01R\bduration\x12O\n" + + "\x13evaluation_interval\x18\x03 \x01(\v2\x19.google.protobuf.DurationB\x03\xe0A\x01R\x12evaluationInterval\x12u\n" + + "\x06labels\x18\x04 \x03(\v2X.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition.LabelsEntryB\x03\xe0A\x01R\x06labels\x12\"\n" + + "\n" + + "rule_group\x18\x05 \x01(\tB\x03\xe0A\x01R\truleGroup\x12\"\n" + + "\n" + + "alert_rule\x18\x06 \x01(\tB\x03\xe0A\x01R\talertRule\x12?\n" + + "\x19disable_metric_validation\x18\a \x01(\bB\x03\xe0A\x01R\x17disableMetricValidation\x1a9\n" + + "\vLabelsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1a\xee\a\n" + + "\fSqlCondition\x12\x19\n" + + "\x05query\x18\x01 \x01(\tB\x03\xe0A\x02R\x05query\x12\\\n" + + "\aminutes\x18\x02 \x01(\v2@.google.monitoring.v3.AlertPolicy.Condition.SqlCondition.MinutesH\x00R\aminutes\x12Y\n" + + "\x06hourly\x18\x03 \x01(\v2?.google.monitoring.v3.AlertPolicy.Condition.SqlCondition.HourlyH\x00R\x06hourly\x12V\n" + + "\x05daily\x18\x04 \x01(\v2>.google.monitoring.v3.AlertPolicy.Condition.SqlCondition.DailyH\x00R\x05daily\x12m\n" + + "\x0erow_count_test\x18\x05 \x01(\v2E.google.monitoring.v3.AlertPolicy.Condition.SqlCondition.RowCountTestH\x01R\frowCountTest\x12i\n" + + "\fboolean_test\x18\x06 \x01(\v2D.google.monitoring.v3.AlertPolicy.Condition.SqlCondition.BooleanTestH\x01R\vbooleanTest\x1a0\n" + + "\aMinutes\x12%\n" + + "\vperiodicity\x18\x01 \x01(\x05B\x03\xe0A\x02R\vperiodicity\x1ap\n" + + "\x06Hourly\x12%\n" + + "\vperiodicity\x18\x01 \x01(\x05B\x03\xe0A\x02R\vperiodicity\x12-\n" + + "\rminute_offset\x18\x02 \x01(\x05B\x03\xe0A\x01H\x00R\fminuteOffset\x88\x01\x01B\x10\n" + + "\x0e_minute_offset\x1ar\n" + + "\x05Daily\x12%\n" + + "\vperiodicity\x18\x01 \x01(\x05B\x03\xe0A\x02R\vperiodicity\x12B\n" + + "\x0eexecution_time\x18\x02 \x01(\v2\x16.google.type.TimeOfDayB\x03\xe0A\x01R\rexecutionTime\x1a|\n" + + "\fRowCountTest\x12I\n" + + "\n" + + "comparison\x18\x01 \x01(\x0e2$.google.monitoring.v3.ComparisonTypeB\x03\xe0A\x02R\n" + + "comparison\x12!\n" + + "\tthreshold\x18\x02 \x01(\x03B\x03\xe0A\x02R\tthreshold\x1a*\n" + + "\vBooleanTest\x12\x1b\n" + + "\x06column\x18\x01 \x01(\tB\x03\xe0A\x02R\x06columnB\n" + + "\n" + + "\bscheduleB\n" + + "\n" + + "\bevaluate\"\xad\x01\n" + + "\x15EvaluationMissingData\x12'\n" + + "#EVALUATION_MISSING_DATA_UNSPECIFIED\x10\x00\x12$\n" + + " EVALUATION_MISSING_DATA_INACTIVE\x10\x01\x12\"\n" + + "\x1eEVALUATION_MISSING_DATA_ACTIVE\x10\x02\x12!\n" + + "\x1dEVALUATION_MISSING_DATA_NO_OP\x10\x03:\x97\x02\xeaA\x93\x02\n" + + ".monitoring.googleapis.com/AlertPolicyCondition\x12Fprojects/{project}/alertPolicies/{alert_policy}/conditions/{condition}\x12Porganizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition}\x12Dfolders/{folder}/alertPolicies/{alert_policy}/conditions/{condition}\x12\x01*B\v\n" + + "\tcondition\x1a\x96\x06\n" + + "\rAlertStrategy\x12}\n" + + "\x17notification_rate_limit\x18\x01 \x01(\v2E.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimitR\x15notificationRateLimit\x12u\n" + + "\x14notification_prompts\x18\x02 \x03(\x0e2B.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationPromptR\x13notificationPrompts\x128\n" + + "\n" + + "auto_close\x18\x03 \x01(\v2\x19.google.protobuf.DurationR\tautoClose\x12\x8f\x01\n" + + "\x1dnotification_channel_strategy\x18\x04 \x03(\v2K.google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategyR\x1bnotificationChannelStrategy\x1aJ\n" + + "\x15NotificationRateLimit\x121\n" + + "\x06period\x18\x01 \x01(\v2\x19.google.protobuf.DurationR\x06period\x1a\xa3\x01\n" + + "\x1bNotificationChannelStrategy\x12<\n" + + "\x1anotification_channel_names\x18\x01 \x03(\tR\x18notificationChannelNames\x12F\n" + + "\x11renotify_interval\x18\x02 \x01(\v2\x19.google.protobuf.DurationR\x10renotifyInterval\"Q\n" + + "\x12NotificationPrompt\x12#\n" + + "\x1fNOTIFICATION_PROMPT_UNSPECIFIED\x10\x00\x12\n" + + "\n" + + "\x06OPENED\x10\x01\x12\n" + + "\n" + + "\x06CLOSED\x10\x03\x1a=\n" + + "\x0fUserLabelsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"a\n" + + "\x15ConditionCombinerType\x12\x17\n" + + "\x13COMBINE_UNSPECIFIED\x10\x00\x12\a\n" + + "\x03AND\x10\x01\x12\x06\n" + + "\x02OR\x10\x02\x12\x1e\n" + + "\x1aAND_WITH_MATCHING_RESOURCE\x10\x03\"J\n" + + "\bSeverity\x12\x18\n" + + "\x14SEVERITY_UNSPECIFIED\x10\x00\x12\f\n" + + "\bCRITICAL\x10\x01\x12\t\n" + + "\x05ERROR\x10\x02\x12\v\n" + + "\aWARNING\x10\x03:\xc9\x01\xeaA\xc5\x01\n" + + "%monitoring.googleapis.com/AlertPolicy\x12/projects/{project}/alertPolicies/{alert_policy}\x129organizations/{organization}/alertPolicies/{alert_policy}\x12-folders/{folder}/alertPolicies/{alert_policy}\x12\x01*B\xc5\x01\n" + + "\x18com.google.monitoring.v3B\n" + + "AlertProtoP\x01ZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpb\xaa\x02\x1aGoogle.Cloud.Monitoring.V3\xca\x02\x1aGoogle\\Cloud\\Monitoring\\V3\xea\x02\x1dGoogle::Cloud::Monitoring::V3b\x06proto3" var ( file_google_monitoring_v3_alert_proto_rawDescOnce sync.Once - file_google_monitoring_v3_alert_proto_rawDescData = file_google_monitoring_v3_alert_proto_rawDesc + file_google_monitoring_v3_alert_proto_rawDescData []byte ) func file_google_monitoring_v3_alert_proto_rawDescGZIP() []byte { file_google_monitoring_v3_alert_proto_rawDescOnce.Do(func() { - file_google_monitoring_v3_alert_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_monitoring_v3_alert_proto_rawDescData) + file_google_monitoring_v3_alert_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_alert_proto_rawDesc), len(file_google_monitoring_v3_alert_proto_rawDesc))) }) return file_google_monitoring_v3_alert_proto_rawDescData } @@ -2875,7 +2571,7 @@ func file_google_monitoring_v3_alert_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_monitoring_v3_alert_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_alert_proto_rawDesc), len(file_google_monitoring_v3_alert_proto_rawDesc)), NumEnums: 4, NumMessages: 23, NumExtensions: 0, @@ -2887,7 +2583,6 @@ func file_google_monitoring_v3_alert_proto_init() { MessageInfos: file_google_monitoring_v3_alert_proto_msgTypes, }.Build() File_google_monitoring_v3_alert_proto = out.File - file_google_monitoring_v3_alert_proto_rawDesc = nil file_google_monitoring_v3_alert_proto_goTypes = nil file_google_monitoring_v3_alert_proto_depIdxs = nil } diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service.pb.go index 5edc4a06df8..9db077f43d6 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service.pb.go @@ -14,20 +14,22 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 -// protoc v4.25.7 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: google/monitoring/v3/alert_service.proto package monitoringpb import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" - reflect "reflect" - sync "sync" ) const ( @@ -39,10 +41,7 @@ const ( // The protocol for the `CreateAlertPolicy` request. type CreateAlertPolicyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The // [project](https://cloud.google.com/monitoring/api/v3#project_name) in which // to create the alerting policy. The format is: @@ -60,7 +59,9 @@ type CreateAlertPolicyRequest struct { // Required. The requested alerting policy. You should omit the `name` field // in this policy. The name will be returned in the new policy, including a // new `[ALERT_POLICY_ID]` value. - AlertPolicy *AlertPolicy `protobuf:"bytes,2,opt,name=alert_policy,json=alertPolicy,proto3" json:"alert_policy,omitempty"` + AlertPolicy *AlertPolicy `protobuf:"bytes,2,opt,name=alert_policy,json=alertPolicy,proto3" json:"alert_policy,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *CreateAlertPolicyRequest) Reset() { @@ -109,14 +110,13 @@ func (x *CreateAlertPolicyRequest) GetAlertPolicy() *AlertPolicy { // The protocol for the `GetAlertPolicy` request. type GetAlertPolicyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The alerting policy to retrieve. The format is: // // projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GetAlertPolicyRequest) Reset() { @@ -158,10 +158,7 @@ func (x *GetAlertPolicyRequest) GetName() string { // The protocol for the `ListAlertPolicies` request. type ListAlertPoliciesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The // [project](https://cloud.google.com/monitoring/api/v3#project_name) whose // alert policies are to be listed. The format is: @@ -193,7 +190,9 @@ type ListAlertPoliciesRequest struct { // `nextPageToken` value returned by a previous call to this method. Using // this field causes the method to return more results from the previous // method call. - PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ListAlertPoliciesRequest) Reset() { @@ -263,10 +262,7 @@ func (x *ListAlertPoliciesRequest) GetPageToken() string { // The protocol for the `ListAlertPolicies` response. type ListAlertPoliciesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The returned alert policies. AlertPolicies []*AlertPolicy `protobuf:"bytes,3,rep,name=alert_policies,json=alertPolicies,proto3" json:"alert_policies,omitempty"` // If there might be more results than were returned, then this field is set @@ -275,7 +271,9 @@ type ListAlertPoliciesResponse struct { NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` // The total number of alert policies in all pages. This number is only an // estimate, and may change in subsequent pages. https://aip.dev/158 - TotalSize int32 `protobuf:"varint,4,opt,name=total_size,json=totalSize,proto3" json:"total_size,omitempty"` + TotalSize int32 `protobuf:"varint,4,opt,name=total_size,json=totalSize,proto3" json:"total_size,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ListAlertPoliciesResponse) Reset() { @@ -331,10 +329,7 @@ func (x *ListAlertPoliciesResponse) GetTotalSize() int32 { // The protocol for the `UpdateAlertPolicy` request. type UpdateAlertPolicyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Optional. A list of alerting policy field names. If this field is not // empty, each listed field in the existing alerting policy is set to the // value of the corresponding field in the supplied policy (`alert_policy`), @@ -361,7 +356,9 @@ type UpdateAlertPolicyRequest struct { // fields listed in `update_mask`. // If `update_mask` is not empty, any fields in this policy that are // not in `update_mask` are ignored. - AlertPolicy *AlertPolicy `protobuf:"bytes,3,opt,name=alert_policy,json=alertPolicy,proto3" json:"alert_policy,omitempty"` + AlertPolicy *AlertPolicy `protobuf:"bytes,3,opt,name=alert_policy,json=alertPolicy,proto3" json:"alert_policy,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *UpdateAlertPolicyRequest) Reset() { @@ -410,16 +407,15 @@ func (x *UpdateAlertPolicyRequest) GetAlertPolicy() *AlertPolicy { // The protocol for the `DeleteAlertPolicy` request. type DeleteAlertPolicyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The alerting policy to delete. The format is: // // projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] // // For more information, see [AlertPolicy][google.monitoring.v3.AlertPolicy]. - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *DeleteAlertPolicyRequest) Reset() { @@ -461,172 +457,50 @@ func (x *DeleteAlertPolicyRequest) GetName() string { var File_google_monitoring_v3_alert_service_proto protoreflect.FileDescriptor -var file_google_monitoring_v3_alert_service_proto_rawDesc = []byte{ - 0x0a, 0x28, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, - 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, - 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa8, 0x01, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, - 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x41, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x2d, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x27, 0x12, 0x25, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x49, 0x0a, 0x0c, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x70, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, - 0x33, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x42, 0x03, 0xe0, - 0x41, 0x02, 0x52, 0x0b, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, - 0x5a, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, - 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2d, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x27, 0x0a, 0x25, - 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xe0, 0x01, 0x0a, 0x18, - 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2d, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x27, 0x12, 0x25, - 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x06, 0x66, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, - 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, - 0x72, 0x5f, 0x62, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, - 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x79, 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, 0x22, 0xac, - 0x01, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x0e, - 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6c, 0x65, 0x72, - 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0d, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, - 0x6c, 0x69, 0x63, 0x69, 0x65, 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, 0x12, 0x1d, - 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x22, 0xa7, 0x01, - 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 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, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x03, 0xe0, 0x41, 0x01, - 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x49, 0x0a, 0x0c, - 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0b, 0x61, 0x6c, 0x65, 0x72, - 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x5d, 0x0a, 0x18, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x2d, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x27, 0x0a, 0x25, 0x6d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x32, 0x9e, 0x08, 0x0a, 0x12, 0x41, 0x6c, 0x65, 0x72, 0x74, - 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xa8, 0x01, - 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, - 0x69, 0x65, 0x73, 0x12, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, - 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, - 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x25, 0x12, 0x23, 0x2f, 0x76, 0x33, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x61, 0x6c, 0x65, 0x72, 0x74, - 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0x96, 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, - 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x2b, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, - 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, - 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x34, 0xda, 0x41, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x76, 0x33, 0x2f, - 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, - 0x2f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, 0x2a, - 0x7d, 0x12, 0xb5, 0x01, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x65, 0x72, - 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, - 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x4d, 0xda, 0x41, 0x11, 0x6e, - 0x61, 0x6d, 0x65, 0x2c, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x3a, 0x0c, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x70, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x22, 0x23, 0x2f, 0x76, 0x33, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x61, 0x6c, 0x65, 0x72, - 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0x91, 0x01, 0x0a, 0x11, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, - 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x6c, 0x65, - 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 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, 0x34, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x2a, 0x25, 0x2f, 0x76, 0x33, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, - 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x61, 0x6c, 0x65, - 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xcb, 0x01, - 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x12, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, - 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x63, 0xda, 0x41, 0x18, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2c, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x70, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x42, 0x3a, 0x0c, 0x61, 0x6c, 0x65, 0x72, 0x74, - 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x32, 0x32, 0x2f, 0x76, 0x33, 0x2f, 0x7b, 0x61, 0x6c, - 0x65, 0x72, 0x74, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x61, 0x6c, 0x65, 0x72, 0x74, - 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x1a, 0xa9, 0x01, 0xca, 0x41, - 0x19, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0xd2, 0x41, 0x89, 0x01, 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, 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, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 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, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x6e, 0x67, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x42, 0xcc, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, - 0x67, 0x2e, 0x76, 0x33, 0x42, 0x11, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x63, 0x6c, 0x6f, 0x75, 0x64, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x6d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x33, 0x2f, - 0x76, 0x32, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x70, 0x62, 0x3b, - 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x70, 0x62, 0xaa, 0x02, 0x1a, 0x47, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x33, 0xea, 0x02, 0x1d, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x3a, - 0x3a, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x3a, 0x3a, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_google_monitoring_v3_alert_service_proto_rawDesc = "" + + "\n" + + "(google/monitoring/v3/alert_service.proto\x12\x14google.monitoring.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/monitoring/v3/alert.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xa8\x01\n" + + "\x18CreateAlertPolicyRequest\x12A\n" + + "\x04name\x18\x03 \x01(\tB-\xe0A\x02\xfaA'\x12%monitoring.googleapis.com/AlertPolicyR\x04name\x12I\n" + + "\falert_policy\x18\x02 \x01(\v2!.google.monitoring.v3.AlertPolicyB\x03\xe0A\x02R\valertPolicy\"Z\n" + + "\x15GetAlertPolicyRequest\x12A\n" + + "\x04name\x18\x03 \x01(\tB-\xe0A\x02\xfaA'\n" + + "%monitoring.googleapis.com/AlertPolicyR\x04name\"\xe0\x01\n" + + "\x18ListAlertPoliciesRequest\x12A\n" + + "\x04name\x18\x04 \x01(\tB-\xe0A\x02\xfaA'\x12%monitoring.googleapis.com/AlertPolicyR\x04name\x12\x1b\n" + + "\x06filter\x18\x05 \x01(\tB\x03\xe0A\x01R\x06filter\x12\x1e\n" + + "\border_by\x18\x06 \x01(\tB\x03\xe0A\x01R\aorderBy\x12 \n" + + "\tpage_size\x18\x02 \x01(\x05B\x03\xe0A\x01R\bpageSize\x12\"\n" + + "\n" + + "page_token\x18\x03 \x01(\tB\x03\xe0A\x01R\tpageToken\"\xac\x01\n" + + "\x19ListAlertPoliciesResponse\x12H\n" + + "\x0ealert_policies\x18\x03 \x03(\v2!.google.monitoring.v3.AlertPolicyR\ralertPolicies\x12&\n" + + "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\x12\x1d\n" + + "\n" + + "total_size\x18\x04 \x01(\x05R\ttotalSize\"\xa7\x01\n" + + "\x18UpdateAlertPolicyRequest\x12@\n" + + "\vupdate_mask\x18\x02 \x01(\v2\x1a.google.protobuf.FieldMaskB\x03\xe0A\x01R\n" + + "updateMask\x12I\n" + + "\falert_policy\x18\x03 \x01(\v2!.google.monitoring.v3.AlertPolicyB\x03\xe0A\x02R\valertPolicy\"]\n" + + "\x18DeleteAlertPolicyRequest\x12A\n" + + "\x04name\x18\x03 \x01(\tB-\xe0A\x02\xfaA'\n" + + "%monitoring.googleapis.com/AlertPolicyR\x04name2\x9e\b\n" + + "\x12AlertPolicyService\x12\xa8\x01\n" + + "\x11ListAlertPolicies\x12..google.monitoring.v3.ListAlertPoliciesRequest\x1a/.google.monitoring.v3.ListAlertPoliciesResponse\"2\xdaA\x04name\x82\xd3\xe4\x93\x02%\x12#/v3/{name=projects/*}/alertPolicies\x12\x96\x01\n" + + "\x0eGetAlertPolicy\x12+.google.monitoring.v3.GetAlertPolicyRequest\x1a!.google.monitoring.v3.AlertPolicy\"4\xdaA\x04name\x82\xd3\xe4\x93\x02'\x12%/v3/{name=projects/*/alertPolicies/*}\x12\xb5\x01\n" + + "\x11CreateAlertPolicy\x12..google.monitoring.v3.CreateAlertPolicyRequest\x1a!.google.monitoring.v3.AlertPolicy\"M\xdaA\x11name,alert_policy\x82\xd3\xe4\x93\x023:\falert_policy\"#/v3/{name=projects/*}/alertPolicies\x12\x91\x01\n" + + "\x11DeleteAlertPolicy\x12..google.monitoring.v3.DeleteAlertPolicyRequest\x1a\x16.google.protobuf.Empty\"4\xdaA\x04name\x82\xd3\xe4\x93\x02'*%/v3/{name=projects/*/alertPolicies/*}\x12\xcb\x01\n" + + "\x11UpdateAlertPolicy\x12..google.monitoring.v3.UpdateAlertPolicyRequest\x1a!.google.monitoring.v3.AlertPolicy\"c\xdaA\x18update_mask,alert_policy\x82\xd3\xe4\x93\x02B:\falert_policy22/v3/{alert_policy.name=projects/*/alertPolicies/*}\x1a\xa9\x01\xcaA\x19monitoring.googleapis.com\xd2A\x89\x01https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.readB\xcc\x01\n" + + "\x18com.google.monitoring.v3B\x11AlertServiceProtoP\x01ZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpb\xaa\x02\x1aGoogle.Cloud.Monitoring.V3\xca\x02\x1aGoogle\\Cloud\\Monitoring\\V3\xea\x02\x1dGoogle::Cloud::Monitoring::V3b\x06proto3" var ( file_google_monitoring_v3_alert_service_proto_rawDescOnce sync.Once - file_google_monitoring_v3_alert_service_proto_rawDescData = file_google_monitoring_v3_alert_service_proto_rawDesc + file_google_monitoring_v3_alert_service_proto_rawDescData []byte ) func file_google_monitoring_v3_alert_service_proto_rawDescGZIP() []byte { file_google_monitoring_v3_alert_service_proto_rawDescOnce.Do(func() { - file_google_monitoring_v3_alert_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_monitoring_v3_alert_service_proto_rawDescData) + file_google_monitoring_v3_alert_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_alert_service_proto_rawDesc), len(file_google_monitoring_v3_alert_service_proto_rawDesc))) }) return file_google_monitoring_v3_alert_service_proto_rawDescData } @@ -675,7 +549,7 @@ func file_google_monitoring_v3_alert_service_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_monitoring_v3_alert_service_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_alert_service_proto_rawDesc), len(file_google_monitoring_v3_alert_service_proto_rawDesc)), NumEnums: 0, NumMessages: 6, NumExtensions: 0, @@ -686,7 +560,6 @@ func file_google_monitoring_v3_alert_service_proto_init() { MessageInfos: file_google_monitoring_v3_alert_service_proto_msgTypes, }.Build() File_google_monitoring_v3_alert_service_proto = out.File - file_google_monitoring_v3_alert_service_proto_rawDesc = nil file_google_monitoring_v3_alert_service_proto_goTypes = nil file_google_monitoring_v3_alert_service_proto_depIdxs = nil } diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service_grpc.pb.go index ff3412fb4ca..a9e32797c96 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service_grpc.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service_grpc.pb.go @@ -15,13 +15,14 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.7 +// - protoc v6.33.2 // source: google/monitoring/v3/alert_service.proto package monitoringpb import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/common.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/common.pb.go index d6d2047b675..f09a3d95898 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/common.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/common.pb.go @@ -14,20 +14,22 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 -// protoc v4.25.7 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: google/monitoring/v3/common.proto package monitoringpb import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + distribution "google.golang.org/genproto/googleapis/api/distribution" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" ) const ( @@ -539,20 +541,19 @@ func (Aggregation_Reducer) EnumDescriptor() ([]byte, []int) { // A single strongly-typed value. type TypedValue struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The typed value field. // - // Types that are assignable to Value: + // Types that are valid to be assigned to Value: // // *TypedValue_BoolValue // *TypedValue_Int64Value // *TypedValue_DoubleValue // *TypedValue_StringValue // *TypedValue_DistributionValue - Value isTypedValue_Value `protobuf_oneof:"value"` + Value isTypedValue_Value `protobuf_oneof:"value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TypedValue) Reset() { @@ -585,44 +586,54 @@ func (*TypedValue) Descriptor() ([]byte, []int) { return file_google_monitoring_v3_common_proto_rawDescGZIP(), []int{0} } -func (m *TypedValue) GetValue() isTypedValue_Value { - if m != nil { - return m.Value +func (x *TypedValue) GetValue() isTypedValue_Value { + if x != nil { + return x.Value } return nil } func (x *TypedValue) GetBoolValue() bool { - if x, ok := x.GetValue().(*TypedValue_BoolValue); ok { - return x.BoolValue + if x != nil { + if x, ok := x.Value.(*TypedValue_BoolValue); ok { + return x.BoolValue + } } return false } func (x *TypedValue) GetInt64Value() int64 { - if x, ok := x.GetValue().(*TypedValue_Int64Value); ok { - return x.Int64Value + if x != nil { + if x, ok := x.Value.(*TypedValue_Int64Value); ok { + return x.Int64Value + } } return 0 } func (x *TypedValue) GetDoubleValue() float64 { - if x, ok := x.GetValue().(*TypedValue_DoubleValue); ok { - return x.DoubleValue + if x != nil { + if x, ok := x.Value.(*TypedValue_DoubleValue); ok { + return x.DoubleValue + } } return 0 } func (x *TypedValue) GetStringValue() string { - if x, ok := x.GetValue().(*TypedValue_StringValue); ok { - return x.StringValue + if x != nil { + if x, ok := x.Value.(*TypedValue_StringValue); ok { + return x.StringValue + } } return "" } func (x *TypedValue) GetDistributionValue() *distribution.Distribution { - if x, ok := x.GetValue().(*TypedValue_DistributionValue); ok { - return x.DistributionValue + if x != nil { + if x, ok := x.Value.(*TypedValue_DistributionValue); ok { + return x.DistributionValue + } } return nil } @@ -707,16 +718,15 @@ func (*TypedValue_DistributionValue) isTypedValue_Value() {} // previous interval, then data written at the new start time could // overwrite data written at the previous end time. type TimeInterval struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The end of the time interval. EndTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` // Optional. The beginning of the time interval. The default value // for the start time is the end time. The start time must not be // later than the end time. - StartTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + StartTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TimeInterval) Reset() { @@ -790,10 +800,7 @@ func (x *TimeInterval) GetStartTime() *timestamppb.Timestamp { // details, see [Filtering and // aggregation](https://cloud.google.com/monitoring/api/v3/aggregation). type Aggregation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The `alignment_period` specifies a time interval, in seconds, that is used // to divide the data in all the // [time series][google.monitoring.v3.TimeSeries] into consistent blocks of @@ -855,6 +862,8 @@ type Aggregation struct { // a single output time series. If `cross_series_reducer` is not // defined, this field is ignored. GroupByFields []string `protobuf:"bytes,5,rep,name=group_by_fields,json=groupByFields,proto3" json:"group_by_fields,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Aggregation) Reset() { @@ -917,143 +926,93 @@ func (x *Aggregation) GetGroupByFields() []string { var File_google_monitoring_v3_common_proto protoreflect.FileDescriptor -var file_google_monitoring_v3_common_proto_rawDesc = []byte{ - 0x0a, 0x21, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x1a, 0x1d, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xee, 0x01, 0x0a, 0x0a, 0x54, 0x79, - 0x70, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, - 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x09, - 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x69, 0x6e, 0x74, - 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, - 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, - 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x01, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x49, 0x0a, 0x12, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x11, - 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x80, 0x01, 0x0a, 0x0c, 0x54, - 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x35, 0x0a, 0x08, 0x65, - 0x6e, 0x64, 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, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, - 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 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, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xf3, 0x07, - 0x0a, 0x0b, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x44, 0x0a, - 0x10, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, - 0x64, 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, 0x52, 0x0f, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x65, 0x72, - 0x69, 0x6f, 0x64, 0x12, 0x57, 0x0a, 0x12, 0x70, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x65, - 0x73, 0x5f, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x41, 0x6c, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x52, 0x10, 0x70, 0x65, 0x72, 0x53, - 0x65, 0x72, 0x69, 0x65, 0x73, 0x41, 0x6c, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x5b, 0x0a, 0x14, - 0x63, 0x72, 0x6f, 0x73, 0x73, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x64, - 0x75, 0x63, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, - 0x33, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, - 0x64, 0x75, 0x63, 0x65, 0x72, 0x52, 0x12, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x53, 0x65, 0x72, 0x69, - 0x65, 0x73, 0x52, 0x65, 0x64, 0x75, 0x63, 0x65, 0x72, 0x12, 0x26, 0x0a, 0x0f, 0x67, 0x72, 0x6f, - 0x75, 0x70, 0x5f, 0x62, 0x79, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x05, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x0d, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x79, 0x46, 0x69, 0x65, 0x6c, 0x64, - 0x73, 0x22, 0x8b, 0x03, 0x0a, 0x07, 0x41, 0x6c, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x0e, 0x0a, - 0x0a, 0x41, 0x4c, 0x49, 0x47, 0x4e, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x0f, 0x0a, - 0x0b, 0x41, 0x4c, 0x49, 0x47, 0x4e, 0x5f, 0x44, 0x45, 0x4c, 0x54, 0x41, 0x10, 0x01, 0x12, 0x0e, - 0x0a, 0x0a, 0x41, 0x4c, 0x49, 0x47, 0x4e, 0x5f, 0x52, 0x41, 0x54, 0x45, 0x10, 0x02, 0x12, 0x15, - 0x0a, 0x11, 0x41, 0x4c, 0x49, 0x47, 0x4e, 0x5f, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x50, 0x4f, 0x4c, - 0x41, 0x54, 0x45, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x41, 0x4c, 0x49, 0x47, 0x4e, 0x5f, 0x4e, - 0x45, 0x58, 0x54, 0x5f, 0x4f, 0x4c, 0x44, 0x45, 0x52, 0x10, 0x04, 0x12, 0x0d, 0x0a, 0x09, 0x41, - 0x4c, 0x49, 0x47, 0x4e, 0x5f, 0x4d, 0x49, 0x4e, 0x10, 0x0a, 0x12, 0x0d, 0x0a, 0x09, 0x41, 0x4c, - 0x49, 0x47, 0x4e, 0x5f, 0x4d, 0x41, 0x58, 0x10, 0x0b, 0x12, 0x0e, 0x0a, 0x0a, 0x41, 0x4c, 0x49, - 0x47, 0x4e, 0x5f, 0x4d, 0x45, 0x41, 0x4e, 0x10, 0x0c, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x4c, 0x49, - 0x47, 0x4e, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x10, 0x0d, 0x12, 0x0d, 0x0a, 0x09, 0x41, 0x4c, - 0x49, 0x47, 0x4e, 0x5f, 0x53, 0x55, 0x4d, 0x10, 0x0e, 0x12, 0x10, 0x0a, 0x0c, 0x41, 0x4c, 0x49, - 0x47, 0x4e, 0x5f, 0x53, 0x54, 0x44, 0x44, 0x45, 0x56, 0x10, 0x0f, 0x12, 0x14, 0x0a, 0x10, 0x41, - 0x4c, 0x49, 0x47, 0x4e, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x5f, 0x54, 0x52, 0x55, 0x45, 0x10, - 0x10, 0x12, 0x15, 0x0a, 0x11, 0x41, 0x4c, 0x49, 0x47, 0x4e, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, - 0x5f, 0x46, 0x41, 0x4c, 0x53, 0x45, 0x10, 0x18, 0x12, 0x17, 0x0a, 0x13, 0x41, 0x4c, 0x49, 0x47, - 0x4e, 0x5f, 0x46, 0x52, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x52, 0x55, 0x45, 0x10, - 0x11, 0x12, 0x17, 0x0a, 0x13, 0x41, 0x4c, 0x49, 0x47, 0x4e, 0x5f, 0x50, 0x45, 0x52, 0x43, 0x45, - 0x4e, 0x54, 0x49, 0x4c, 0x45, 0x5f, 0x39, 0x39, 0x10, 0x12, 0x12, 0x17, 0x0a, 0x13, 0x41, 0x4c, - 0x49, 0x47, 0x4e, 0x5f, 0x50, 0x45, 0x52, 0x43, 0x45, 0x4e, 0x54, 0x49, 0x4c, 0x45, 0x5f, 0x39, - 0x35, 0x10, 0x13, 0x12, 0x17, 0x0a, 0x13, 0x41, 0x4c, 0x49, 0x47, 0x4e, 0x5f, 0x50, 0x45, 0x52, - 0x43, 0x45, 0x4e, 0x54, 0x49, 0x4c, 0x45, 0x5f, 0x35, 0x30, 0x10, 0x14, 0x12, 0x17, 0x0a, 0x13, - 0x41, 0x4c, 0x49, 0x47, 0x4e, 0x5f, 0x50, 0x45, 0x52, 0x43, 0x45, 0x4e, 0x54, 0x49, 0x4c, 0x45, - 0x5f, 0x30, 0x35, 0x10, 0x15, 0x12, 0x18, 0x0a, 0x14, 0x41, 0x4c, 0x49, 0x47, 0x4e, 0x5f, 0x50, - 0x45, 0x52, 0x43, 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x17, 0x22, - 0xb1, 0x02, 0x0a, 0x07, 0x52, 0x65, 0x64, 0x75, 0x63, 0x65, 0x72, 0x12, 0x0f, 0x0a, 0x0b, 0x52, - 0x45, 0x44, 0x55, 0x43, 0x45, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, - 0x52, 0x45, 0x44, 0x55, 0x43, 0x45, 0x5f, 0x4d, 0x45, 0x41, 0x4e, 0x10, 0x01, 0x12, 0x0e, 0x0a, - 0x0a, 0x52, 0x45, 0x44, 0x55, 0x43, 0x45, 0x5f, 0x4d, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x0e, 0x0a, - 0x0a, 0x52, 0x45, 0x44, 0x55, 0x43, 0x45, 0x5f, 0x4d, 0x41, 0x58, 0x10, 0x03, 0x12, 0x0e, 0x0a, - 0x0a, 0x52, 0x45, 0x44, 0x55, 0x43, 0x45, 0x5f, 0x53, 0x55, 0x4d, 0x10, 0x04, 0x12, 0x11, 0x0a, - 0x0d, 0x52, 0x45, 0x44, 0x55, 0x43, 0x45, 0x5f, 0x53, 0x54, 0x44, 0x44, 0x45, 0x56, 0x10, 0x05, - 0x12, 0x10, 0x0a, 0x0c, 0x52, 0x45, 0x44, 0x55, 0x43, 0x45, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, - 0x10, 0x06, 0x12, 0x15, 0x0a, 0x11, 0x52, 0x45, 0x44, 0x55, 0x43, 0x45, 0x5f, 0x43, 0x4f, 0x55, - 0x4e, 0x54, 0x5f, 0x54, 0x52, 0x55, 0x45, 0x10, 0x07, 0x12, 0x16, 0x0a, 0x12, 0x52, 0x45, 0x44, - 0x55, 0x43, 0x45, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x5f, 0x46, 0x41, 0x4c, 0x53, 0x45, 0x10, - 0x0f, 0x12, 0x18, 0x0a, 0x14, 0x52, 0x45, 0x44, 0x55, 0x43, 0x45, 0x5f, 0x46, 0x52, 0x41, 0x43, - 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x52, 0x55, 0x45, 0x10, 0x08, 0x12, 0x18, 0x0a, 0x14, 0x52, - 0x45, 0x44, 0x55, 0x43, 0x45, 0x5f, 0x50, 0x45, 0x52, 0x43, 0x45, 0x4e, 0x54, 0x49, 0x4c, 0x45, - 0x5f, 0x39, 0x39, 0x10, 0x09, 0x12, 0x18, 0x0a, 0x14, 0x52, 0x45, 0x44, 0x55, 0x43, 0x45, 0x5f, - 0x50, 0x45, 0x52, 0x43, 0x45, 0x4e, 0x54, 0x49, 0x4c, 0x45, 0x5f, 0x39, 0x35, 0x10, 0x0a, 0x12, - 0x18, 0x0a, 0x14, 0x52, 0x45, 0x44, 0x55, 0x43, 0x45, 0x5f, 0x50, 0x45, 0x52, 0x43, 0x45, 0x4e, - 0x54, 0x49, 0x4c, 0x45, 0x5f, 0x35, 0x30, 0x10, 0x0b, 0x12, 0x18, 0x0a, 0x14, 0x52, 0x45, 0x44, - 0x55, 0x43, 0x45, 0x5f, 0x50, 0x45, 0x52, 0x43, 0x45, 0x4e, 0x54, 0x49, 0x4c, 0x45, 0x5f, 0x30, - 0x35, 0x10, 0x0c, 0x2a, 0x9e, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x69, 0x73, - 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x52, - 0x49, 0x53, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, - 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x52, 0x49, 0x53, 0x4f, 0x4e, - 0x5f, 0x47, 0x54, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x52, 0x49, - 0x53, 0x4f, 0x4e, 0x5f, 0x47, 0x45, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x4f, 0x4d, 0x50, - 0x41, 0x52, 0x49, 0x53, 0x4f, 0x4e, 0x5f, 0x4c, 0x54, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x43, - 0x4f, 0x4d, 0x50, 0x41, 0x52, 0x49, 0x53, 0x4f, 0x4e, 0x5f, 0x4c, 0x45, 0x10, 0x04, 0x12, 0x11, - 0x0a, 0x0d, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x52, 0x49, 0x53, 0x4f, 0x4e, 0x5f, 0x45, 0x51, 0x10, - 0x05, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x52, 0x49, 0x53, 0x4f, 0x4e, 0x5f, - 0x4e, 0x45, 0x10, 0x06, 0x2a, 0x61, 0x0a, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, - 0x69, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x18, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x54, - 0x49, 0x45, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x54, 0x49, 0x45, - 0x52, 0x5f, 0x42, 0x41, 0x53, 0x49, 0x43, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x53, 0x45, 0x52, - 0x56, 0x49, 0x43, 0x45, 0x5f, 0x54, 0x49, 0x45, 0x52, 0x5f, 0x50, 0x52, 0x45, 0x4d, 0x49, 0x55, - 0x4d, 0x10, 0x02, 0x1a, 0x02, 0x18, 0x01, 0x42, 0xcd, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, - 0x67, 0x2e, 0x76, 0x33, 0x42, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x33, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x70, 0x62, 0x3b, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, - 0x72, 0x69, 0x6e, 0x67, 0x70, 0x62, 0xa2, 0x02, 0x04, 0x47, 0x4d, 0x4f, 0x4e, 0xaa, 0x02, 0x1a, - 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x4d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x1a, 0x47, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, - 0x72, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x33, 0xea, 0x02, 0x1d, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x3a, 0x3a, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x3a, 0x3a, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_google_monitoring_v3_common_proto_rawDesc = "" + + "\n" + + "!google/monitoring/v3/common.proto\x12\x14google.monitoring.v3\x1a\x1dgoogle/api/distribution.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xee\x01\n" + + "\n" + + "TypedValue\x12\x1f\n" + + "\n" + + "bool_value\x18\x01 \x01(\bH\x00R\tboolValue\x12!\n" + + "\vint64_value\x18\x02 \x01(\x03H\x00R\n" + + "int64Value\x12#\n" + + "\fdouble_value\x18\x03 \x01(\x01H\x00R\vdoubleValue\x12#\n" + + "\fstring_value\x18\x04 \x01(\tH\x00R\vstringValue\x12I\n" + + "\x12distribution_value\x18\x05 \x01(\v2\x18.google.api.DistributionH\x00R\x11distributionValueB\a\n" + + "\x05value\"\x80\x01\n" + + "\fTimeInterval\x125\n" + + "\bend_time\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\aendTime\x129\n" + + "\n" + + "start_time\x18\x01 \x01(\v2\x1a.google.protobuf.TimestampR\tstartTime\"\xf3\a\n" + + "\vAggregation\x12D\n" + + "\x10alignment_period\x18\x01 \x01(\v2\x19.google.protobuf.DurationR\x0falignmentPeriod\x12W\n" + + "\x12per_series_aligner\x18\x02 \x01(\x0e2).google.monitoring.v3.Aggregation.AlignerR\x10perSeriesAligner\x12[\n" + + "\x14cross_series_reducer\x18\x04 \x01(\x0e2).google.monitoring.v3.Aggregation.ReducerR\x12crossSeriesReducer\x12&\n" + + "\x0fgroup_by_fields\x18\x05 \x03(\tR\rgroupByFields\"\x8b\x03\n" + + "\aAligner\x12\x0e\n" + + "\n" + + "ALIGN_NONE\x10\x00\x12\x0f\n" + + "\vALIGN_DELTA\x10\x01\x12\x0e\n" + + "\n" + + "ALIGN_RATE\x10\x02\x12\x15\n" + + "\x11ALIGN_INTERPOLATE\x10\x03\x12\x14\n" + + "\x10ALIGN_NEXT_OLDER\x10\x04\x12\r\n" + + "\tALIGN_MIN\x10\n" + + "\x12\r\n" + + "\tALIGN_MAX\x10\v\x12\x0e\n" + + "\n" + + "ALIGN_MEAN\x10\f\x12\x0f\n" + + "\vALIGN_COUNT\x10\r\x12\r\n" + + "\tALIGN_SUM\x10\x0e\x12\x10\n" + + "\fALIGN_STDDEV\x10\x0f\x12\x14\n" + + "\x10ALIGN_COUNT_TRUE\x10\x10\x12\x15\n" + + "\x11ALIGN_COUNT_FALSE\x10\x18\x12\x17\n" + + "\x13ALIGN_FRACTION_TRUE\x10\x11\x12\x17\n" + + "\x13ALIGN_PERCENTILE_99\x10\x12\x12\x17\n" + + "\x13ALIGN_PERCENTILE_95\x10\x13\x12\x17\n" + + "\x13ALIGN_PERCENTILE_50\x10\x14\x12\x17\n" + + "\x13ALIGN_PERCENTILE_05\x10\x15\x12\x18\n" + + "\x14ALIGN_PERCENT_CHANGE\x10\x17\"\xb1\x02\n" + + "\aReducer\x12\x0f\n" + + "\vREDUCE_NONE\x10\x00\x12\x0f\n" + + "\vREDUCE_MEAN\x10\x01\x12\x0e\n" + + "\n" + + "REDUCE_MIN\x10\x02\x12\x0e\n" + + "\n" + + "REDUCE_MAX\x10\x03\x12\x0e\n" + + "\n" + + "REDUCE_SUM\x10\x04\x12\x11\n" + + "\rREDUCE_STDDEV\x10\x05\x12\x10\n" + + "\fREDUCE_COUNT\x10\x06\x12\x15\n" + + "\x11REDUCE_COUNT_TRUE\x10\a\x12\x16\n" + + "\x12REDUCE_COUNT_FALSE\x10\x0f\x12\x18\n" + + "\x14REDUCE_FRACTION_TRUE\x10\b\x12\x18\n" + + "\x14REDUCE_PERCENTILE_99\x10\t\x12\x18\n" + + "\x14REDUCE_PERCENTILE_95\x10\n" + + "\x12\x18\n" + + "\x14REDUCE_PERCENTILE_50\x10\v\x12\x18\n" + + "\x14REDUCE_PERCENTILE_05\x10\f*\x9e\x01\n" + + "\x0eComparisonType\x12\x1a\n" + + "\x16COMPARISON_UNSPECIFIED\x10\x00\x12\x11\n" + + "\rCOMPARISON_GT\x10\x01\x12\x11\n" + + "\rCOMPARISON_GE\x10\x02\x12\x11\n" + + "\rCOMPARISON_LT\x10\x03\x12\x11\n" + + "\rCOMPARISON_LE\x10\x04\x12\x11\n" + + "\rCOMPARISON_EQ\x10\x05\x12\x11\n" + + "\rCOMPARISON_NE\x10\x06*a\n" + + "\vServiceTier\x12\x1c\n" + + "\x18SERVICE_TIER_UNSPECIFIED\x10\x00\x12\x16\n" + + "\x12SERVICE_TIER_BASIC\x10\x01\x12\x18\n" + + "\x14SERVICE_TIER_PREMIUM\x10\x02\x1a\x02\x18\x01B\xcd\x01\n" + + "\x18com.google.monitoring.v3B\vCommonProtoP\x01ZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpb\xa2\x02\x04GMON\xaa\x02\x1aGoogle.Cloud.Monitoring.V3\xca\x02\x1aGoogle\\Cloud\\Monitoring\\V3\xea\x02\x1dGoogle::Cloud::Monitoring::V3b\x06proto3" var ( file_google_monitoring_v3_common_proto_rawDescOnce sync.Once - file_google_monitoring_v3_common_proto_rawDescData = file_google_monitoring_v3_common_proto_rawDesc + file_google_monitoring_v3_common_proto_rawDescData []byte ) func file_google_monitoring_v3_common_proto_rawDescGZIP() []byte { file_google_monitoring_v3_common_proto_rawDescOnce.Do(func() { - file_google_monitoring_v3_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_monitoring_v3_common_proto_rawDescData) + file_google_monitoring_v3_common_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_common_proto_rawDesc), len(file_google_monitoring_v3_common_proto_rawDesc))) }) return file_google_monitoring_v3_common_proto_rawDescData } @@ -1102,7 +1061,7 @@ func file_google_monitoring_v3_common_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_monitoring_v3_common_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_common_proto_rawDesc), len(file_google_monitoring_v3_common_proto_rawDesc)), NumEnums: 4, NumMessages: 3, NumExtensions: 0, @@ -1114,7 +1073,6 @@ func file_google_monitoring_v3_common_proto_init() { MessageInfos: file_google_monitoring_v3_common_proto_msgTypes, }.Build() File_google_monitoring_v3_common_proto = out.File - file_google_monitoring_v3_common_proto_rawDesc = nil file_google_monitoring_v3_common_proto_goTypes = nil file_google_monitoring_v3_common_proto_depIdxs = nil } diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/dropped_labels.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/dropped_labels.pb.go index b9161423cb9..ad8d2361ae6 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/dropped_labels.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/dropped_labels.pb.go @@ -14,17 +14,19 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 -// protoc v4.25.7 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: google/monitoring/v3/dropped_labels.proto package monitoringpb import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( @@ -51,12 +53,11 @@ const ( // stream, and there may be duplicates. It is up to clients to resolve any // ambiguities. type DroppedLabels struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Map from label to its value, for all labels dropped in any aggregation. - Label map[string]string `protobuf:"bytes,1,rep,name=label,proto3" json:"label,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Label map[string]string `protobuf:"bytes,1,rep,name=label,proto3" json:"label,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *DroppedLabels) Reset() { @@ -98,44 +99,25 @@ func (x *DroppedLabels) GetLabel() map[string]string { var File_google_monitoring_v3_dropped_labels_proto protoreflect.FileDescriptor -var file_google_monitoring_v3_dropped_labels_proto_rawDesc = []byte{ - 0x0a, 0x29, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x6c, - 0x61, 0x62, 0x65, 0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, - 0x33, 0x22, 0x8f, 0x01, 0x0a, 0x0d, 0x44, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x4c, 0x61, 0x62, - 0x65, 0x6c, 0x73, 0x12, 0x44, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x70, 0x65, - 0x64, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x1a, 0x38, 0x0a, 0x0a, 0x4c, 0x61, 0x62, - 0x65, 0x6c, 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, 0xcd, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, - 0x42, 0x12, 0x44, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x33, 0x2f, 0x76, 0x32, 0x2f, - 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x70, 0x62, 0x3b, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x70, 0x62, 0xaa, 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, - 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, - 0x5c, 0x56, 0x33, 0xea, 0x02, 0x1d, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x3a, 0x3a, 0x43, 0x6c, - 0x6f, 0x75, 0x64, 0x3a, 0x3a, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x3a, - 0x3a, 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_google_monitoring_v3_dropped_labels_proto_rawDesc = "" + + "\n" + + ")google/monitoring/v3/dropped_labels.proto\x12\x14google.monitoring.v3\"\x8f\x01\n" + + "\rDroppedLabels\x12D\n" + + "\x05label\x18\x01 \x03(\v2..google.monitoring.v3.DroppedLabels.LabelEntryR\x05label\x1a8\n" + + "\n" + + "LabelEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01B\xcd\x01\n" + + "\x18com.google.monitoring.v3B\x12DroppedLabelsProtoP\x01ZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpb\xaa\x02\x1aGoogle.Cloud.Monitoring.V3\xca\x02\x1aGoogle\\Cloud\\Monitoring\\V3\xea\x02\x1dGoogle::Cloud::Monitoring::V3b\x06proto3" var ( file_google_monitoring_v3_dropped_labels_proto_rawDescOnce sync.Once - file_google_monitoring_v3_dropped_labels_proto_rawDescData = file_google_monitoring_v3_dropped_labels_proto_rawDesc + file_google_monitoring_v3_dropped_labels_proto_rawDescData []byte ) func file_google_monitoring_v3_dropped_labels_proto_rawDescGZIP() []byte { file_google_monitoring_v3_dropped_labels_proto_rawDescOnce.Do(func() { - file_google_monitoring_v3_dropped_labels_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_monitoring_v3_dropped_labels_proto_rawDescData) + file_google_monitoring_v3_dropped_labels_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_dropped_labels_proto_rawDesc), len(file_google_monitoring_v3_dropped_labels_proto_rawDesc))) }) return file_google_monitoring_v3_dropped_labels_proto_rawDescData } @@ -163,7 +145,7 @@ func file_google_monitoring_v3_dropped_labels_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_monitoring_v3_dropped_labels_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_dropped_labels_proto_rawDesc), len(file_google_monitoring_v3_dropped_labels_proto_rawDesc)), NumEnums: 0, NumMessages: 2, NumExtensions: 0, @@ -174,7 +156,6 @@ func file_google_monitoring_v3_dropped_labels_proto_init() { MessageInfos: file_google_monitoring_v3_dropped_labels_proto_msgTypes, }.Build() File_google_monitoring_v3_dropped_labels_proto = out.File - file_google_monitoring_v3_dropped_labels_proto_rawDesc = nil file_google_monitoring_v3_dropped_labels_proto_goTypes = nil file_google_monitoring_v3_dropped_labels_proto_depIdxs = nil } diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group.pb.go index 6cb42d2922d..03c6fc298df 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group.pb.go @@ -14,18 +14,20 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 -// protoc v4.25.7 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: google/monitoring/v3/group.proto package monitoringpb import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( @@ -62,10 +64,7 @@ const ( // depending on what resources exist and what filters are associated with the // group and its ancestors. type Group struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Output only. The name of this group. The format is: // // projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] @@ -87,7 +86,9 @@ type Group struct { Filter string `protobuf:"bytes,5,opt,name=filter,proto3" json:"filter,omitempty"` // If true, the members of this group are considered to be a cluster. // The system can perform additional analysis on groups that are clusters. - IsCluster bool `protobuf:"varint,6,opt,name=is_cluster,json=isCluster,proto3" json:"is_cluster,omitempty"` + IsCluster bool `protobuf:"varint,6,opt,name=is_cluster,json=isCluster,proto3" json:"is_cluster,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Group) Reset() { @@ -157,55 +158,29 @@ func (x *Group) GetIsCluster() bool { var File_google_monitoring_v3_group_proto protoreflect.FileDescriptor -var file_google_monitoring_v3_group_proto_rawDesc = []byte{ - 0x0a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x14, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xb2, 0x02, 0x0a, 0x05, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, - 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x1d, 0x0a, - 0x0a, 0x69, 0x73, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x09, 0x69, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x3a, 0x99, 0x01, 0xea, - 0x41, 0x95, 0x01, 0x0a, 0x1f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x12, 0x21, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2f, - 0x7b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x7d, 0x12, 0x2b, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2f, 0x7b, 0x67, 0x72, - 0x6f, 0x75, 0x70, 0x7d, 0x12, 0x1f, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x66, - 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x7d, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2f, 0x7b, 0x67, - 0x72, 0x6f, 0x75, 0x70, 0x7d, 0x12, 0x01, 0x2a, 0x42, 0xc5, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x42, 0x0a, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x33, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x70, 0x62, 0x3b, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, - 0x72, 0x69, 0x6e, 0x67, 0x70, 0x62, 0xaa, 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, - 0x2e, 0x56, 0x33, 0xca, 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f, - 0x75, 0x64, 0x5c, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x33, - 0xea, 0x02, 0x1d, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x3a, 0x3a, 0x43, 0x6c, 0x6f, 0x75, 0x64, - 0x3a, 0x3a, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x33, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_google_monitoring_v3_group_proto_rawDesc = "" + + "\n" + + " google/monitoring/v3/group.proto\x12\x14google.monitoring.v3\x1a\x19google/api/resource.proto\"\xb2\x02\n" + + "\x05Group\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12!\n" + + "\fdisplay_name\x18\x02 \x01(\tR\vdisplayName\x12\x1f\n" + + "\vparent_name\x18\x03 \x01(\tR\n" + + "parentName\x12\x16\n" + + "\x06filter\x18\x05 \x01(\tR\x06filter\x12\x1d\n" + + "\n" + + "is_cluster\x18\x06 \x01(\bR\tisCluster:\x99\x01\xeaA\x95\x01\n" + + "\x1fmonitoring.googleapis.com/Group\x12!projects/{project}/groups/{group}\x12+organizations/{organization}/groups/{group}\x12\x1ffolders/{folder}/groups/{group}\x12\x01*B\xc5\x01\n" + + "\x18com.google.monitoring.v3B\n" + + "GroupProtoP\x01ZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpb\xaa\x02\x1aGoogle.Cloud.Monitoring.V3\xca\x02\x1aGoogle\\Cloud\\Monitoring\\V3\xea\x02\x1dGoogle::Cloud::Monitoring::V3b\x06proto3" var ( file_google_monitoring_v3_group_proto_rawDescOnce sync.Once - file_google_monitoring_v3_group_proto_rawDescData = file_google_monitoring_v3_group_proto_rawDesc + file_google_monitoring_v3_group_proto_rawDescData []byte ) func file_google_monitoring_v3_group_proto_rawDescGZIP() []byte { file_google_monitoring_v3_group_proto_rawDescOnce.Do(func() { - file_google_monitoring_v3_group_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_monitoring_v3_group_proto_rawDescData) + file_google_monitoring_v3_group_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_group_proto_rawDesc), len(file_google_monitoring_v3_group_proto_rawDesc))) }) return file_google_monitoring_v3_group_proto_rawDescData } @@ -231,7 +206,7 @@ func file_google_monitoring_v3_group_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_monitoring_v3_group_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_group_proto_rawDesc), len(file_google_monitoring_v3_group_proto_rawDesc)), NumEnums: 0, NumMessages: 1, NumExtensions: 0, @@ -242,7 +217,6 @@ func file_google_monitoring_v3_group_proto_init() { MessageInfos: file_google_monitoring_v3_group_proto_msgTypes, }.Build() File_google_monitoring_v3_group_proto = out.File - file_google_monitoring_v3_group_proto_rawDesc = nil file_google_monitoring_v3_group_proto_goTypes = nil file_google_monitoring_v3_group_proto_depIdxs = nil } diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service.pb.go index a0552019c27..cb2af61ba50 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service.pb.go @@ -14,20 +14,22 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 -// protoc v4.25.7 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: google/monitoring/v3/group_service.proto package monitoringpb import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "google.golang.org/genproto/googleapis/api/annotations" monitoredres "google.golang.org/genproto/googleapis/api/monitoredres" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" - reflect "reflect" - sync "sync" ) const ( @@ -39,10 +41,7 @@ const ( // The `ListGroup` request. type ListGroupsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The // [project](https://cloud.google.com/monitoring/api/v3#project_name) whose // groups are to be listed. The format is: @@ -53,7 +52,7 @@ type ListGroupsRequest struct { // the groups returned based on their parent-child relationship with the // specified group. If no filter is specified, all groups are returned. // - // Types that are assignable to Filter: + // Types that are valid to be assigned to Filter: // // *ListGroupsRequest_ChildrenOfGroup // *ListGroupsRequest_AncestorsOfGroup @@ -64,7 +63,9 @@ type ListGroupsRequest struct { // If this field is not empty then it must contain the `next_page_token` value // returned by a previous call to this method. Using this field causes the // method to return additional results from the previous method call. - PageToken string `protobuf:"bytes,6,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + PageToken string `protobuf:"bytes,6,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ListGroupsRequest) Reset() { @@ -104,30 +105,36 @@ func (x *ListGroupsRequest) GetName() string { return "" } -func (m *ListGroupsRequest) GetFilter() isListGroupsRequest_Filter { - if m != nil { - return m.Filter +func (x *ListGroupsRequest) GetFilter() isListGroupsRequest_Filter { + if x != nil { + return x.Filter } return nil } func (x *ListGroupsRequest) GetChildrenOfGroup() string { - if x, ok := x.GetFilter().(*ListGroupsRequest_ChildrenOfGroup); ok { - return x.ChildrenOfGroup + if x != nil { + if x, ok := x.Filter.(*ListGroupsRequest_ChildrenOfGroup); ok { + return x.ChildrenOfGroup + } } return "" } func (x *ListGroupsRequest) GetAncestorsOfGroup() string { - if x, ok := x.GetFilter().(*ListGroupsRequest_AncestorsOfGroup); ok { - return x.AncestorsOfGroup + if x != nil { + if x, ok := x.Filter.(*ListGroupsRequest_AncestorsOfGroup); ok { + return x.AncestorsOfGroup + } } return "" } func (x *ListGroupsRequest) GetDescendantsOfGroup() string { - if x, ok := x.GetFilter().(*ListGroupsRequest_DescendantsOfGroup); ok { - return x.DescendantsOfGroup + if x != nil { + if x, ok := x.Filter.(*ListGroupsRequest_DescendantsOfGroup); ok { + return x.DescendantsOfGroup + } } return "" } @@ -191,16 +198,15 @@ func (*ListGroupsRequest_DescendantsOfGroup) isListGroupsRequest_Filter() {} // The `ListGroups` response. type ListGroupsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The groups that match the specified filters. Group []*Group `protobuf:"bytes,1,rep,name=group,proto3" json:"group,omitempty"` // If there are more results than have been returned, then this field is set // to a non-empty value. To see the additional results, // use that value as `page_token` in the next call to this method. NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ListGroupsResponse) Reset() { @@ -249,14 +255,13 @@ func (x *ListGroupsResponse) GetNextPageToken() string { // The `GetGroup` request. type GetGroupRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The group to retrieve. The format is: // // projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GetGroupRequest) Reset() { @@ -298,10 +303,7 @@ func (x *GetGroupRequest) GetName() string { // The `CreateGroup` request. type CreateGroupRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The // [project](https://cloud.google.com/monitoring/api/v3#project_name) in which // to create the group. The format is: @@ -312,7 +314,9 @@ type CreateGroupRequest struct { // because the system assigns the name. Group *Group `protobuf:"bytes,2,opt,name=group,proto3" json:"group,omitempty"` // If true, validate this request but do not create the group. - ValidateOnly bool `protobuf:"varint,3,opt,name=validate_only,json=validateOnly,proto3" json:"validate_only,omitempty"` + ValidateOnly bool `protobuf:"varint,3,opt,name=validate_only,json=validateOnly,proto3" json:"validate_only,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *CreateGroupRequest) Reset() { @@ -368,16 +372,15 @@ func (x *CreateGroupRequest) GetValidateOnly() bool { // The `UpdateGroup` request. type UpdateGroupRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The new definition of the group. All fields of the existing // group, excepting `name`, are replaced with the corresponding fields of this // group. Group *Group `protobuf:"bytes,2,opt,name=group,proto3" json:"group,omitempty"` // If true, validate this request but do not update the existing group. - ValidateOnly bool `protobuf:"varint,3,opt,name=validate_only,json=validateOnly,proto3" json:"validate_only,omitempty"` + ValidateOnly bool `protobuf:"varint,3,opt,name=validate_only,json=validateOnly,proto3" json:"validate_only,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *UpdateGroupRequest) Reset() { @@ -427,10 +430,7 @@ func (x *UpdateGroupRequest) GetValidateOnly() bool { // The `DeleteGroup` request. The default behavior is to be able to delete a // single group without any descendants. type DeleteGroupRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The group to delete. The format is: // // projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] @@ -438,7 +438,9 @@ type DeleteGroupRequest struct { // If this field is true, then the request means to delete a group with all // its descendants. Otherwise, the request means to delete a group only when // it has no descendants. The default value is false. - Recursive bool `protobuf:"varint,4,opt,name=recursive,proto3" json:"recursive,omitempty"` + Recursive bool `protobuf:"varint,4,opt,name=recursive,proto3" json:"recursive,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *DeleteGroupRequest) Reset() { @@ -487,10 +489,7 @@ func (x *DeleteGroupRequest) GetRecursive() bool { // The `ListGroupMembers` request. type ListGroupMembersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The group whose members are listed. The format is: // // projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] @@ -514,7 +513,9 @@ type ListGroupMembersRequest struct { // members that were part of the group during the specified interval are // included in the response. If no interval is provided then the group // membership over the last minute is returned. - Interval *TimeInterval `protobuf:"bytes,6,opt,name=interval,proto3" json:"interval,omitempty"` + Interval *TimeInterval `protobuf:"bytes,6,opt,name=interval,proto3" json:"interval,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ListGroupMembersRequest) Reset() { @@ -584,10 +585,7 @@ func (x *ListGroupMembersRequest) GetInterval() *TimeInterval { // The `ListGroupMembers` response. type ListGroupMembersResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // A set of monitored resources in the group. Members []*monitoredres.MonitoredResource `protobuf:"bytes,1,rep,name=members,proto3" json:"members,omitempty"` // If there are more results than have been returned, then this field is @@ -595,7 +593,9 @@ type ListGroupMembersResponse struct { // `page_token` in the next call to this method. NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` // The total number of elements matching this request. - TotalSize int32 `protobuf:"varint,3,opt,name=total_size,json=totalSize,proto3" json:"total_size,omitempty"` + TotalSize int32 `protobuf:"varint,3,opt,name=total_size,json=totalSize,proto3" json:"total_size,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ListGroupMembersResponse) Reset() { @@ -651,204 +651,70 @@ func (x *ListGroupMembersResponse) GetTotalSize() int32 { var File_google_monitoring_v3_group_service_proto protoreflect.FileDescriptor -var file_google_monitoring_v3_group_service_proto_rawDesc = []byte{ - 0x0a, 0x28, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, - 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, - 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x5f, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x76, - 0x33, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, - 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9a, 0x03, 0x0a, 0x11, 0x4c, - 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x3b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x27, - 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x21, 0x12, 0x1f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x52, 0x0a, - 0x11, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x5f, 0x6f, 0x66, 0x5f, 0x67, 0x72, 0x6f, - 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x24, 0xfa, 0x41, 0x21, 0x0a, 0x1f, 0x6d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x48, 0x00, - 0x52, 0x0f, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x4f, 0x66, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x12, 0x54, 0x0a, 0x12, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x73, 0x5f, 0x6f, - 0x66, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x24, 0xfa, - 0x41, 0x21, 0x0a, 0x1f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x47, 0x72, - 0x6f, 0x75, 0x70, 0x48, 0x00, 0x52, 0x10, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x73, - 0x4f, 0x66, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x58, 0x0a, 0x14, 0x64, 0x65, 0x73, 0x63, 0x65, - 0x6e, 0x64, 0x61, 0x6e, 0x74, 0x73, 0x5f, 0x6f, 0x66, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x24, 0xfa, 0x41, 0x21, 0x0a, 0x1f, 0x6d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, - 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x48, 0x00, 0x52, 0x12, 0x64, - 0x65, 0x73, 0x63, 0x65, 0x6e, 0x64, 0x61, 0x6e, 0x74, 0x73, 0x4f, 0x66, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, - 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, 0x06, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x08, 0x0a, - 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x6f, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, - 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, - 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, - 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, 0x4e, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3b, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x27, 0xe0, 0x41, 0x02, 0xfa, 0x41, - 0x21, 0x0a, 0x1f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xae, 0x01, 0x0a, 0x12, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x3b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x27, 0xe0, - 0x41, 0x02, 0xfa, 0x41, 0x21, 0x12, 0x1f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, - 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x05, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x33, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x05, 0x67, - 0x72, 0x6f, 0x75, 0x70, 0x12, 0x23, 0x0a, 0x0d, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, - 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x6e, 0x6c, 0x79, 0x22, 0x71, 0x0a, 0x12, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x36, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x02, - 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x23, 0x0a, 0x0d, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x65, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x6e, 0x6c, 0x79, 0x22, 0x6f, 0x0a, 0x12, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x3b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x27, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x21, 0x0a, 0x1f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, - 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x09, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x22, 0xea, 0x01, - 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, - 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x27, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x21, 0x0a, - 0x1f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x47, 0x72, 0x6f, 0x75, 0x70, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, - 0x69, 0x7a, 0x65, 0x18, 0x03, 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, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x3e, 0x0a, 0x08, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, - 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, - 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x22, 0x9a, 0x01, 0x0a, 0x18, 0x4c, - 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, - 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 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, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, - 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, - 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x32, 0x98, 0x08, 0x0a, 0x0c, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x8c, 0x01, 0x0a, 0x0a, 0x4c, 0x69, 0x73, - 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, - 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, 0xda, 0x41, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x12, 0x1c, 0x2f, 0x76, 0x33, 0x2f, 0x7b, - 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, - 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x7d, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x47, 0x72, - 0x6f, 0x75, 0x70, 0x12, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, - 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, - 0x33, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x2d, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x76, 0x33, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, - 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x67, 0x72, 0x6f, - 0x75, 0x70, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x8e, 0x01, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, - 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x38, 0xda, - 0x41, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x25, 0x3a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x1c, 0x2f, 0x76, 0x33, 0x2f, 0x7b, - 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, - 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x91, 0x01, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x3b, - 0xda, 0x41, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x3a, 0x05, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x1a, 0x24, 0x2f, 0x76, 0x33, 0x2f, 0x7b, 0x67, 0x72, 0x6f, 0x75, - 0x70, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, - 0x2a, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x7e, 0x0a, 0x0b, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x28, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, - 0x33, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 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, 0x2d, 0xda, 0x41, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x2a, 0x1e, 0x2f, 0x76, 0x33, - 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, - 0x2a, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xa8, 0x01, 0x0a, 0x10, - 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, - 0x12, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, - 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, - 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x35, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, - 0x2f, 0x76, 0x33, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x6d, - 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x1a, 0xa9, 0x01, 0xca, 0x41, 0x19, 0x6d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, - 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0xd2, 0x41, 0x89, 0x01, 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, 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, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x6e, 0x67, 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, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x72, 0x65, - 0x61, 0x64, 0x42, 0xcc, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x42, - 0x11, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, - 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x33, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x70, 0x62, 0x3b, 0x6d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x70, 0x62, 0xaa, 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, - 0x67, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, - 0x6f, 0x75, 0x64, 0x5c, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x5c, 0x56, - 0x33, 0xea, 0x02, 0x1d, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x3a, 0x3a, 0x43, 0x6c, 0x6f, 0x75, - 0x64, 0x3a, 0x3a, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, - 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_google_monitoring_v3_group_service_proto_rawDesc = "" + + "\n" + + "(google/monitoring/v3/group_service.proto\x12\x14google.monitoring.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a#google/api/monitored_resource.proto\x1a\x19google/api/resource.proto\x1a!google/monitoring/v3/common.proto\x1a google/monitoring/v3/group.proto\x1a\x1bgoogle/protobuf/empty.proto\"\x9a\x03\n" + + "\x11ListGroupsRequest\x12;\n" + + "\x04name\x18\a \x01(\tB'\xe0A\x02\xfaA!\x12\x1fmonitoring.googleapis.com/GroupR\x04name\x12R\n" + + "\x11children_of_group\x18\x02 \x01(\tB$\xfaA!\n" + + "\x1fmonitoring.googleapis.com/GroupH\x00R\x0fchildrenOfGroup\x12T\n" + + "\x12ancestors_of_group\x18\x03 \x01(\tB$\xfaA!\n" + + "\x1fmonitoring.googleapis.com/GroupH\x00R\x10ancestorsOfGroup\x12X\n" + + "\x14descendants_of_group\x18\x04 \x01(\tB$\xfaA!\n" + + "\x1fmonitoring.googleapis.com/GroupH\x00R\x12descendantsOfGroup\x12\x1b\n" + + "\tpage_size\x18\x05 \x01(\x05R\bpageSize\x12\x1d\n" + + "\n" + + "page_token\x18\x06 \x01(\tR\tpageTokenB\b\n" + + "\x06filter\"o\n" + + "\x12ListGroupsResponse\x121\n" + + "\x05group\x18\x01 \x03(\v2\x1b.google.monitoring.v3.GroupR\x05group\x12&\n" + + "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\"N\n" + + "\x0fGetGroupRequest\x12;\n" + + "\x04name\x18\x03 \x01(\tB'\xe0A\x02\xfaA!\n" + + "\x1fmonitoring.googleapis.com/GroupR\x04name\"\xae\x01\n" + + "\x12CreateGroupRequest\x12;\n" + + "\x04name\x18\x04 \x01(\tB'\xe0A\x02\xfaA!\x12\x1fmonitoring.googleapis.com/GroupR\x04name\x126\n" + + "\x05group\x18\x02 \x01(\v2\x1b.google.monitoring.v3.GroupB\x03\xe0A\x02R\x05group\x12#\n" + + "\rvalidate_only\x18\x03 \x01(\bR\fvalidateOnly\"q\n" + + "\x12UpdateGroupRequest\x126\n" + + "\x05group\x18\x02 \x01(\v2\x1b.google.monitoring.v3.GroupB\x03\xe0A\x02R\x05group\x12#\n" + + "\rvalidate_only\x18\x03 \x01(\bR\fvalidateOnly\"o\n" + + "\x12DeleteGroupRequest\x12;\n" + + "\x04name\x18\x03 \x01(\tB'\xe0A\x02\xfaA!\n" + + "\x1fmonitoring.googleapis.com/GroupR\x04name\x12\x1c\n" + + "\trecursive\x18\x04 \x01(\bR\trecursive\"\xea\x01\n" + + "\x17ListGroupMembersRequest\x12;\n" + + "\x04name\x18\a \x01(\tB'\xe0A\x02\xfaA!\n" + + "\x1fmonitoring.googleapis.com/GroupR\x04name\x12\x1b\n" + + "\tpage_size\x18\x03 \x01(\x05R\bpageSize\x12\x1d\n" + + "\n" + + "page_token\x18\x04 \x01(\tR\tpageToken\x12\x16\n" + + "\x06filter\x18\x05 \x01(\tR\x06filter\x12>\n" + + "\binterval\x18\x06 \x01(\v2\".google.monitoring.v3.TimeIntervalR\binterval\"\x9a\x01\n" + + "\x18ListGroupMembersResponse\x127\n" + + "\amembers\x18\x01 \x03(\v2\x1d.google.api.MonitoredResourceR\amembers\x12&\n" + + "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\x12\x1d\n" + + "\n" + + "total_size\x18\x03 \x01(\x05R\ttotalSize2\x98\b\n" + + "\fGroupService\x12\x8c\x01\n" + + "\n" + + "ListGroups\x12'.google.monitoring.v3.ListGroupsRequest\x1a(.google.monitoring.v3.ListGroupsResponse\"+\xdaA\x04name\x82\xd3\xe4\x93\x02\x1e\x12\x1c/v3/{name=projects/*}/groups\x12}\n" + + "\bGetGroup\x12%.google.monitoring.v3.GetGroupRequest\x1a\x1b.google.monitoring.v3.Group\"-\xdaA\x04name\x82\xd3\xe4\x93\x02 \x12\x1e/v3/{name=projects/*/groups/*}\x12\x8e\x01\n" + + "\vCreateGroup\x12(.google.monitoring.v3.CreateGroupRequest\x1a\x1b.google.monitoring.v3.Group\"8\xdaA\n" + + "name,group\x82\xd3\xe4\x93\x02%:\x05group\"\x1c/v3/{name=projects/*}/groups\x12\x91\x01\n" + + "\vUpdateGroup\x12(.google.monitoring.v3.UpdateGroupRequest\x1a\x1b.google.monitoring.v3.Group\";\xdaA\x05group\x82\xd3\xe4\x93\x02-:\x05group\x1a$/v3/{group.name=projects/*/groups/*}\x12~\n" + + "\vDeleteGroup\x12(.google.monitoring.v3.DeleteGroupRequest\x1a\x16.google.protobuf.Empty\"-\xdaA\x04name\x82\xd3\xe4\x93\x02 *\x1e/v3/{name=projects/*/groups/*}\x12\xa8\x01\n" + + "\x10ListGroupMembers\x12-.google.monitoring.v3.ListGroupMembersRequest\x1a..google.monitoring.v3.ListGroupMembersResponse\"5\xdaA\x04name\x82\xd3\xe4\x93\x02(\x12&/v3/{name=projects/*/groups/*}/members\x1a\xa9\x01\xcaA\x19monitoring.googleapis.com\xd2A\x89\x01https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.readB\xcc\x01\n" + + "\x18com.google.monitoring.v3B\x11GroupServiceProtoP\x01ZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpb\xaa\x02\x1aGoogle.Cloud.Monitoring.V3\xca\x02\x1aGoogle\\Cloud\\Monitoring\\V3\xea\x02\x1dGoogle::Cloud::Monitoring::V3b\x06proto3" var ( file_google_monitoring_v3_group_service_proto_rawDescOnce sync.Once - file_google_monitoring_v3_group_service_proto_rawDescData = file_google_monitoring_v3_group_service_proto_rawDesc + file_google_monitoring_v3_group_service_proto_rawDescData []byte ) func file_google_monitoring_v3_group_service_proto_rawDescGZIP() []byte { file_google_monitoring_v3_group_service_proto_rawDescOnce.Do(func() { - file_google_monitoring_v3_group_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_monitoring_v3_group_service_proto_rawDescData) + file_google_monitoring_v3_group_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_group_service_proto_rawDesc), len(file_google_monitoring_v3_group_service_proto_rawDesc))) }) return file_google_monitoring_v3_group_service_proto_rawDescData } @@ -909,7 +775,7 @@ func file_google_monitoring_v3_group_service_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_monitoring_v3_group_service_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_group_service_proto_rawDesc), len(file_google_monitoring_v3_group_service_proto_rawDesc)), NumEnums: 0, NumMessages: 8, NumExtensions: 0, @@ -920,7 +786,6 @@ func file_google_monitoring_v3_group_service_proto_init() { MessageInfos: file_google_monitoring_v3_group_service_proto_msgTypes, }.Build() File_google_monitoring_v3_group_service_proto = out.File - file_google_monitoring_v3_group_service_proto_rawDesc = nil file_google_monitoring_v3_group_service_proto_goTypes = nil file_google_monitoring_v3_group_service_proto_depIdxs = nil } diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service_grpc.pb.go index 2828587eae1..0d94d9a72a2 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service_grpc.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service_grpc.pb.go @@ -15,13 +15,14 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.7 +// - protoc v6.33.2 // source: google/monitoring/v3/group_service.proto package monitoringpb import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric.pb.go index 7aefb0a5ec6..de021e107d4 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric.pb.go @@ -14,20 +14,22 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 -// protoc v4.25.7 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: google/monitoring/v3/metric.proto package monitoringpb import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + label "google.golang.org/genproto/googleapis/api/label" metric "google.golang.org/genproto/googleapis/api/metric" monitoredres "google.golang.org/genproto/googleapis/api/monitoredres" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( @@ -39,10 +41,7 @@ const ( // A single data point in a time series. type Point struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The time interval to which the data point applies. For `GAUGE` metrics, // the start time is optional, but if it is supplied, it must equal the // end time. For `DELTA` metrics, the start @@ -54,7 +53,9 @@ type Point struct { // time for the following points. Interval *TimeInterval `protobuf:"bytes,1,opt,name=interval,proto3" json:"interval,omitempty"` // The value of the data point. - Value *TypedValue `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + Value *TypedValue `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Point) Reset() { @@ -106,10 +107,7 @@ func (x *Point) GetValue() *TypedValue { // fully-specified monitored resource and a fully-specified metric. // This type is used for both listing and creating time series. type TimeSeries struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The associated metric. A fully-specified metric used to identify the time // series. Metric *metric.Metric `protobuf:"bytes,1,opt,name=metric,proto3" json:"metric,omitempty"` @@ -157,7 +155,9 @@ type TimeSeries struct { // associated with the // [google.api.MetricDescriptor][google.api.MetricDescriptor] for the metric. // Once set, this field cannot be changed through CreateTimeSeries. - Description string `protobuf:"bytes,9,opt,name=description,proto3" json:"description,omitempty"` + Description string `protobuf:"bytes,9,opt,name=description,proto3" json:"description,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TimeSeries) Reset() { @@ -248,14 +248,13 @@ func (x *TimeSeries) GetDescription() string { // A descriptor for the labels and points in a time series. type TimeSeriesDescriptor struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Descriptors for the labels. LabelDescriptors []*label.LabelDescriptor `protobuf:"bytes,1,rep,name=label_descriptors,json=labelDescriptors,proto3" json:"label_descriptors,omitempty"` // Descriptors for the point data value columns. PointDescriptors []*TimeSeriesDescriptor_ValueDescriptor `protobuf:"bytes,5,rep,name=point_descriptors,json=pointDescriptors,proto3" json:"point_descriptors,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TimeSeriesDescriptor) Reset() { @@ -305,17 +304,16 @@ func (x *TimeSeriesDescriptor) GetPointDescriptors() []*TimeSeriesDescriptor_Val // Represents the values of a time series associated with a // TimeSeriesDescriptor. type TimeSeriesData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The values of the labels in the time series identifier, given in the same // order as the `label_descriptors` field of the TimeSeriesDescriptor // associated with this object. Each value must have a value of the type // given in the corresponding entry of `label_descriptors`. LabelValues []*LabelValue `protobuf:"bytes,1,rep,name=label_values,json=labelValues,proto3" json:"label_values,omitempty"` // The points in the time series. - PointData []*TimeSeriesData_PointData `protobuf:"bytes,2,rep,name=point_data,json=pointData,proto3" json:"point_data,omitempty"` + PointData []*TimeSeriesData_PointData `protobuf:"bytes,2,rep,name=point_data,json=pointData,proto3" json:"point_data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TimeSeriesData) Reset() { @@ -364,18 +362,17 @@ func (x *TimeSeriesData) GetPointData() []*TimeSeriesData_PointData { // A label value. type LabelValue struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The label value can be a bool, int64, or string. // - // Types that are assignable to Value: + // Types that are valid to be assigned to Value: // // *LabelValue_BoolValue // *LabelValue_Int64Value // *LabelValue_StringValue - Value isLabelValue_Value `protobuf_oneof:"value"` + Value isLabelValue_Value `protobuf_oneof:"value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *LabelValue) Reset() { @@ -408,30 +405,36 @@ func (*LabelValue) Descriptor() ([]byte, []int) { return file_google_monitoring_v3_metric_proto_rawDescGZIP(), []int{4} } -func (m *LabelValue) GetValue() isLabelValue_Value { - if m != nil { - return m.Value +func (x *LabelValue) GetValue() isLabelValue_Value { + if x != nil { + return x.Value } return nil } func (x *LabelValue) GetBoolValue() bool { - if x, ok := x.GetValue().(*LabelValue_BoolValue); ok { - return x.BoolValue + if x != nil { + if x, ok := x.Value.(*LabelValue_BoolValue); ok { + return x.BoolValue + } } return false } func (x *LabelValue) GetInt64Value() int64 { - if x, ok := x.GetValue().(*LabelValue_Int64Value); ok { - return x.Int64Value + if x != nil { + if x, ok := x.Value.(*LabelValue_Int64Value); ok { + return x.Int64Value + } } return 0 } func (x *LabelValue) GetStringValue() string { - if x, ok := x.GetValue().(*LabelValue_StringValue); ok { - return x.StringValue + if x != nil { + if x, ok := x.Value.(*LabelValue_StringValue); ok { + return x.StringValue + } } return "" } @@ -463,15 +466,14 @@ func (*LabelValue_StringValue) isLabelValue_Value() {} // An error associated with a query in the time series query language format. type QueryError struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The location of the time series query language text that this error applies // to. Locator *TextLocator `protobuf:"bytes,1,opt,name=locator,proto3" json:"locator,omitempty"` // The error message. - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *QueryError) Reset() { @@ -539,10 +541,7 @@ func (x *QueryError) GetMessage() string { // // refers to the part of the text: "fox". type TextLocator struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The source of the text. The source may be a field in the request, in which // case its format is the format of the // google.rpc.BadRequest.FieldViolation.field field in @@ -567,6 +566,8 @@ type TextLocator struct { // the location of the macro argument inside the macro body that got // substituted away. NestingReason string `protobuf:"bytes,5,opt,name=nesting_reason,json=nestingReason,proto3" json:"nesting_reason,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TextLocator) Reset() { @@ -636,10 +637,7 @@ func (x *TextLocator) GetNestingReason() string { // A descriptor for the value columns in a data point. type TimeSeriesDescriptor_ValueDescriptor struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The value key. Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // The value type. @@ -650,7 +648,9 @@ type TimeSeriesDescriptor_ValueDescriptor struct { // follows the UCUM format for units as seen in // https://unitsofmeasure.org/ucum.html. // `unit` is only valid if `value_type` is INTEGER, DOUBLE, DISTRIBUTION. - Unit string `protobuf:"bytes,4,opt,name=unit,proto3" json:"unit,omitempty"` + Unit string `protobuf:"bytes,4,opt,name=unit,proto3" json:"unit,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TimeSeriesDescriptor_ValueDescriptor) Reset() { @@ -715,14 +715,13 @@ func (x *TimeSeriesDescriptor_ValueDescriptor) GetUnit() string { // point values corresponding to the entries in `point_descriptors` field in // the TimeSeriesDescriptor associated with this object. type TimeSeriesData_PointData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The values that make up the point. Values []*TypedValue `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` // The time interval associated with the point. - TimeInterval *TimeInterval `protobuf:"bytes,2,opt,name=time_interval,json=timeInterval,proto3" json:"time_interval,omitempty"` + TimeInterval *TimeInterval `protobuf:"bytes,2,opt,name=time_interval,json=timeInterval,proto3" json:"time_interval,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TimeSeriesData_PointData) Reset() { @@ -771,15 +770,14 @@ func (x *TimeSeriesData_PointData) GetTimeInterval() *TimeInterval { // The position of a byte within the text. type TextLocator_Position struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The line, starting with 1, where the byte is positioned. Line int32 `protobuf:"varint,1,opt,name=line,proto3" json:"line,omitempty"` // The column within the line, starting with 1, where the byte is // positioned. This is a byte index even though the text is UTF-8. - Column int32 `protobuf:"varint,2,opt,name=column,proto3" json:"column,omitempty"` + Column int32 `protobuf:"varint,2,opt,name=column,proto3" json:"column,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TextLocator_Position) Reset() { @@ -828,159 +826,72 @@ func (x *TextLocator_Position) GetColumn() int32 { var File_google_monitoring_v3_metric_proto protoreflect.FileDescriptor -var file_google_monitoring_v3_metric_proto_rawDesc = []byte{ - 0x0a, 0x21, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x1a, 0x16, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, - 0x74, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x65, 0x64, - 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x21, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x6e, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x7f, 0x0a, 0x05, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x3e, 0x0a, 0x08, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, - 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, - 0x6c, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x36, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, - 0x33, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x22, 0xb2, 0x03, 0x0a, 0x0a, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, - 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x39, - 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, - 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x41, 0x0a, 0x08, 0x6d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x48, 0x0a, 0x0b, - 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, - 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, - 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x72, - 0x69, 0x63, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x45, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x54, 0x79, - 0x70, 0x65, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x33, 0x0a, - 0x06, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, - 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x70, 0x6f, 0x69, 0x6e, - 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x94, 0x03, 0x0a, 0x14, 0x54, 0x69, 0x6d, - 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, - 0x72, 0x12, 0x48, 0x0a, 0x11, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x44, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x10, 0x6c, 0x61, 0x62, 0x65, 0x6c, - 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x67, 0x0a, 0x11, 0x70, - 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, - 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x6f, 0x72, 0x52, 0x10, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x6f, 0x72, 0x73, 0x1a, 0xc8, 0x01, 0x0a, 0x0f, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x44, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x45, 0x0a, 0x0a, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x65, 0x74, 0x72, - 0x69, 0x63, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x48, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x6b, 0x69, 0x6e, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x4b, 0x69, 0x6e, 0x64, 0x52, - 0x0a, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x75, - 0x6e, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x22, - 0xb5, 0x02, 0x0a, 0x0e, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x44, 0x61, - 0x74, 0x61, 0x12, 0x43, 0x0a, 0x0c, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, - 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x6c, 0x61, 0x62, 0x65, - 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x4d, 0x0a, 0x0a, 0x70, 0x6f, 0x69, 0x6e, 0x74, - 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x33, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x44, 0x61, 0x74, - 0x61, 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x09, 0x70, 0x6f, 0x69, - 0x6e, 0x74, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x8e, 0x01, 0x0a, 0x09, 0x50, 0x6f, 0x69, 0x6e, 0x74, - 0x44, 0x61, 0x74, 0x61, 0x12, 0x38, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x79, 0x70, 0x65, - 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x47, - 0x0a, 0x0d, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x52, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x49, - 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x22, 0x7e, 0x0a, 0x0a, 0x4c, 0x61, 0x62, 0x65, 0x6c, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x09, 0x62, 0x6f, 0x6f, - 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x0a, 0x69, - 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x07, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x63, 0x0a, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x3b, 0x0a, 0x07, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x65, - 0x78, 0x74, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x07, 0x6c, 0x6f, 0x63, 0x61, 0x74, - 0x6f, 0x72, 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, 0x22, 0xf0, 0x02, 0x0a, - 0x0b, 0x54, 0x65, 0x78, 0x74, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x16, 0x0a, 0x06, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x12, 0x51, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, - 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x2e, - 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x73, 0x74, 0x61, 0x72, 0x74, 0x50, - 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4d, 0x0a, 0x0c, 0x65, 0x6e, 0x64, 0x5f, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, - 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, - 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x65, 0x6e, 0x64, 0x50, 0x6f, - 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x48, 0x0a, 0x0e, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, - 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, - 0x72, 0x52, 0x0d, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, - 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x65, 0x61, 0x73, - 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x73, 0x74, 0x69, 0x6e, - 0x67, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x1a, 0x36, 0x0a, 0x08, 0x50, 0x6f, 0x73, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x42, - 0xc6, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x42, 0x0b, 0x4d, 0x65, - 0x74, 0x72, 0x69, 0x63, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x63, 0x6c, 0x6f, - 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, - 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x76, - 0x33, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x70, - 0x62, 0x3b, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x70, 0x62, 0xaa, 0x02, - 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x4d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x1a, 0x47, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x4d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x33, 0xea, 0x02, 0x1d, 0x47, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x3a, 0x3a, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x3a, 0x3a, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, - 0x72, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_google_monitoring_v3_metric_proto_rawDesc = "" + + "\n" + + "!google/monitoring/v3/metric.proto\x12\x14google.monitoring.v3\x1a\x16google/api/label.proto\x1a\x17google/api/metric.proto\x1a#google/api/monitored_resource.proto\x1a!google/monitoring/v3/common.proto\"\x7f\n" + + "\x05Point\x12>\n" + + "\binterval\x18\x01 \x01(\v2\".google.monitoring.v3.TimeIntervalR\binterval\x126\n" + + "\x05value\x18\x02 \x01(\v2 .google.monitoring.v3.TypedValueR\x05value\"\xb2\x03\n" + + "\n" + + "TimeSeries\x12*\n" + + "\x06metric\x18\x01 \x01(\v2\x12.google.api.MetricR\x06metric\x129\n" + + "\bresource\x18\x02 \x01(\v2\x1d.google.api.MonitoredResourceR\bresource\x12A\n" + + "\bmetadata\x18\a \x01(\v2%.google.api.MonitoredResourceMetadataR\bmetadata\x12H\n" + + "\vmetric_kind\x18\x03 \x01(\x0e2'.google.api.MetricDescriptor.MetricKindR\n" + + "metricKind\x12E\n" + + "\n" + + "value_type\x18\x04 \x01(\x0e2&.google.api.MetricDescriptor.ValueTypeR\tvalueType\x123\n" + + "\x06points\x18\x05 \x03(\v2\x1b.google.monitoring.v3.PointR\x06points\x12\x12\n" + + "\x04unit\x18\b \x01(\tR\x04unit\x12 \n" + + "\vdescription\x18\t \x01(\tR\vdescription\"\x94\x03\n" + + "\x14TimeSeriesDescriptor\x12H\n" + + "\x11label_descriptors\x18\x01 \x03(\v2\x1b.google.api.LabelDescriptorR\x10labelDescriptors\x12g\n" + + "\x11point_descriptors\x18\x05 \x03(\v2:.google.monitoring.v3.TimeSeriesDescriptor.ValueDescriptorR\x10pointDescriptors\x1a\xc8\x01\n" + + "\x0fValueDescriptor\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12E\n" + + "\n" + + "value_type\x18\x02 \x01(\x0e2&.google.api.MetricDescriptor.ValueTypeR\tvalueType\x12H\n" + + "\vmetric_kind\x18\x03 \x01(\x0e2'.google.api.MetricDescriptor.MetricKindR\n" + + "metricKind\x12\x12\n" + + "\x04unit\x18\x04 \x01(\tR\x04unit\"\xb5\x02\n" + + "\x0eTimeSeriesData\x12C\n" + + "\flabel_values\x18\x01 \x03(\v2 .google.monitoring.v3.LabelValueR\vlabelValues\x12M\n" + + "\n" + + "point_data\x18\x02 \x03(\v2..google.monitoring.v3.TimeSeriesData.PointDataR\tpointData\x1a\x8e\x01\n" + + "\tPointData\x128\n" + + "\x06values\x18\x01 \x03(\v2 .google.monitoring.v3.TypedValueR\x06values\x12G\n" + + "\rtime_interval\x18\x02 \x01(\v2\".google.monitoring.v3.TimeIntervalR\ftimeInterval\"~\n" + + "\n" + + "LabelValue\x12\x1f\n" + + "\n" + + "bool_value\x18\x01 \x01(\bH\x00R\tboolValue\x12!\n" + + "\vint64_value\x18\x02 \x01(\x03H\x00R\n" + + "int64Value\x12#\n" + + "\fstring_value\x18\x03 \x01(\tH\x00R\vstringValueB\a\n" + + "\x05value\"c\n" + + "\n" + + "QueryError\x12;\n" + + "\alocator\x18\x01 \x01(\v2!.google.monitoring.v3.TextLocatorR\alocator\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"\xf0\x02\n" + + "\vTextLocator\x12\x16\n" + + "\x06source\x18\x01 \x01(\tR\x06source\x12Q\n" + + "\x0estart_position\x18\x02 \x01(\v2*.google.monitoring.v3.TextLocator.PositionR\rstartPosition\x12M\n" + + "\fend_position\x18\x03 \x01(\v2*.google.monitoring.v3.TextLocator.PositionR\vendPosition\x12H\n" + + "\x0enested_locator\x18\x04 \x01(\v2!.google.monitoring.v3.TextLocatorR\rnestedLocator\x12%\n" + + "\x0enesting_reason\x18\x05 \x01(\tR\rnestingReason\x1a6\n" + + "\bPosition\x12\x12\n" + + "\x04line\x18\x01 \x01(\x05R\x04line\x12\x16\n" + + "\x06column\x18\x02 \x01(\x05R\x06columnB\xc6\x01\n" + + "\x18com.google.monitoring.v3B\vMetricProtoP\x01ZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpb\xaa\x02\x1aGoogle.Cloud.Monitoring.V3\xca\x02\x1aGoogle\\Cloud\\Monitoring\\V3\xea\x02\x1dGoogle::Cloud::Monitoring::V3b\x06proto3" var ( file_google_monitoring_v3_metric_proto_rawDescOnce sync.Once - file_google_monitoring_v3_metric_proto_rawDescData = file_google_monitoring_v3_metric_proto_rawDesc + file_google_monitoring_v3_metric_proto_rawDescData []byte ) func file_google_monitoring_v3_metric_proto_rawDescGZIP() []byte { file_google_monitoring_v3_metric_proto_rawDescOnce.Do(func() { - file_google_monitoring_v3_metric_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_monitoring_v3_metric_proto_rawDescData) + file_google_monitoring_v3_metric_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_metric_proto_rawDesc), len(file_google_monitoring_v3_metric_proto_rawDesc))) }) return file_google_monitoring_v3_metric_proto_rawDescData } @@ -1049,7 +960,7 @@ func file_google_monitoring_v3_metric_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_monitoring_v3_metric_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_metric_proto_rawDesc), len(file_google_monitoring_v3_metric_proto_rawDesc)), NumEnums: 0, NumMessages: 10, NumExtensions: 0, @@ -1060,7 +971,6 @@ func file_google_monitoring_v3_metric_proto_init() { MessageInfos: file_google_monitoring_v3_metric_proto_msgTypes, }.Build() File_google_monitoring_v3_metric_proto = out.File - file_google_monitoring_v3_metric_proto_rawDesc = nil file_google_monitoring_v3_metric_proto_goTypes = nil file_google_monitoring_v3_metric_proto_depIdxs = nil } diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service.pb.go index d4067d85949..fc6e03699ad 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service.pb.go @@ -14,13 +14,17 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 -// protoc v4.25.7 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: google/monitoring/v3/metric_service.proto package monitoringpb import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "google.golang.org/genproto/googleapis/api/annotations" metric "google.golang.org/genproto/googleapis/api/metric" monitoredres "google.golang.org/genproto/googleapis/api/monitoredres" @@ -28,8 +32,6 @@ import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" - reflect "reflect" - sync "sync" ) const ( @@ -92,10 +94,7 @@ func (ListTimeSeriesRequest_TimeSeriesView) EnumDescriptor() ([]byte, []int) { // The `ListMonitoredResourceDescriptors` request. type ListMonitoredResourceDescriptorsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The // [project](https://cloud.google.com/monitoring/api/v3#project_name) on which // to execute the request. The format is: @@ -114,7 +113,9 @@ type ListMonitoredResourceDescriptorsRequest struct { // If this field is not empty then it must contain the `nextPageToken` value // returned by a previous call to this method. Using this field causes the // method to return additional results from the previous method call. - PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ListMonitoredResourceDescriptorsRequest) Reset() { @@ -177,10 +178,7 @@ func (x *ListMonitoredResourceDescriptorsRequest) GetPageToken() string { // The `ListMonitoredResourceDescriptors` response. type ListMonitoredResourceDescriptorsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The monitored resource descriptors that are available to this project // and that match `filter`, if present. ResourceDescriptors []*monitoredres.MonitoredResourceDescriptor `protobuf:"bytes,1,rep,name=resource_descriptors,json=resourceDescriptors,proto3" json:"resource_descriptors,omitempty"` @@ -188,6 +186,8 @@ type ListMonitoredResourceDescriptorsResponse struct { // to a non-empty value. To see the additional results, // use that value as `page_token` in the next call to this method. NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ListMonitoredResourceDescriptorsResponse) Reset() { @@ -236,17 +236,16 @@ func (x *ListMonitoredResourceDescriptorsResponse) GetNextPageToken() string { // The `GetMonitoredResourceDescriptor` request. type GetMonitoredResourceDescriptorRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The monitored resource descriptor to get. The format is: // // projects/[PROJECT_ID_OR_NUMBER]/monitoredResourceDescriptors/[RESOURCE_TYPE] // // The `[RESOURCE_TYPE]` is a predefined type, such as // `cloudsql_database`. - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GetMonitoredResourceDescriptorRequest) Reset() { @@ -288,10 +287,7 @@ func (x *GetMonitoredResourceDescriptorRequest) GetName() string { // The `ListMetricDescriptors` request. type ListMetricDescriptorsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The // [project](https://cloud.google.com/monitoring/api/v3#project_name) on which // to execute the request. The format is: @@ -326,7 +322,9 @@ type ListMetricDescriptorsRequest struct { // resource types, it will be returned only if the metric type has recent // data for some monitored resource type. The returned descriptor will not // enumerate any monitored resource types. - ActiveOnly bool `protobuf:"varint,6,opt,name=active_only,json=activeOnly,proto3" json:"active_only,omitempty"` + ActiveOnly bool `protobuf:"varint,6,opt,name=active_only,json=activeOnly,proto3" json:"active_only,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ListMetricDescriptorsRequest) Reset() { @@ -396,10 +394,7 @@ func (x *ListMetricDescriptorsRequest) GetActiveOnly() bool { // The `ListMetricDescriptors` response. type ListMetricDescriptorsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The metric descriptors that are available to the project // and that match the value of `filter`, if present. MetricDescriptors []*metric.MetricDescriptor `protobuf:"bytes,1,rep,name=metric_descriptors,json=metricDescriptors,proto3" json:"metric_descriptors,omitempty"` @@ -407,6 +402,8 @@ type ListMetricDescriptorsResponse struct { // to a non-empty value. To see the additional results, // use that value as `page_token` in the next call to this method. NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ListMetricDescriptorsResponse) Reset() { @@ -455,10 +452,7 @@ func (x *ListMetricDescriptorsResponse) GetNextPageToken() string { // The `GetMetricDescriptor` request. type GetMetricDescriptorRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The metric descriptor on which to execute the request. The format // is: // @@ -466,7 +460,9 @@ type GetMetricDescriptorRequest struct { // // An example value of `[METRIC_ID]` is // `"compute.googleapis.com/instance/disk/read_bytes_count"`. - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GetMetricDescriptorRequest) Reset() { @@ -508,10 +504,7 @@ func (x *GetMetricDescriptorRequest) GetName() string { // The `CreateMetricDescriptor` request. type CreateMetricDescriptorRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The // [project](https://cloud.google.com/monitoring/api/v3#project_name) on which // to execute the request. The format is: @@ -522,6 +515,8 @@ type CreateMetricDescriptorRequest struct { // Required. The new [custom // metric](https://cloud.google.com/monitoring/custom-metrics) descriptor. MetricDescriptor *metric.MetricDescriptor `protobuf:"bytes,2,opt,name=metric_descriptor,json=metricDescriptor,proto3" json:"metric_descriptor,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *CreateMetricDescriptorRequest) Reset() { @@ -570,10 +565,7 @@ func (x *CreateMetricDescriptorRequest) GetMetricDescriptor() *metric.MetricDesc // The `DeleteMetricDescriptor` request. type DeleteMetricDescriptorRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The metric descriptor on which to execute the request. The format // is: // @@ -581,7 +573,9 @@ type DeleteMetricDescriptorRequest struct { // // An example of `[METRIC_ID]` is: // `"custom.googleapis.com/my_test_metric"`. - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *DeleteMetricDescriptorRequest) Reset() { @@ -623,10 +617,7 @@ func (x *DeleteMetricDescriptorRequest) GetName() string { // The `ListTimeSeries` request. type ListTimeSeriesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The // [project](https://cloud.google.com/monitoring/api/v3#project_name), // organization or folder on which to execute the request. The format is: @@ -671,7 +662,9 @@ type ListTimeSeriesRequest struct { // If this field is not empty then it must contain the `nextPageToken` value // returned by a previous call to this method. Using this field causes the // method to return additional results from the previous method call. - PageToken string `protobuf:"bytes,9,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + PageToken string `protobuf:"bytes,9,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ListTimeSeriesRequest) Reset() { @@ -769,10 +762,7 @@ func (x *ListTimeSeriesRequest) GetPageToken() string { // The `ListTimeSeries` response. type ListTimeSeriesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // One or more time series that match the filter included in the request. TimeSeries []*TimeSeries `protobuf:"bytes,1,rep,name=time_series,json=timeSeries,proto3" json:"time_series,omitempty"` // If there are more results than have been returned, then this field is set @@ -788,7 +778,9 @@ type ListTimeSeriesResponse struct { // If different `time_series` have different units (for example, because they // come from different metric types, or a unit is absent), then `unit` will be // "{not_a_unit}". - Unit string `protobuf:"bytes,5,opt,name=unit,proto3" json:"unit,omitempty"` + Unit string `protobuf:"bytes,5,opt,name=unit,proto3" json:"unit,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ListTimeSeriesResponse) Reset() { @@ -851,10 +843,7 @@ func (x *ListTimeSeriesResponse) GetUnit() string { // The `CreateTimeSeries` request. type CreateTimeSeriesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The // [project](https://cloud.google.com/monitoring/api/v3#project_name) on which // to execute the request. The format is: @@ -868,7 +857,9 @@ type CreateTimeSeriesRequest struct { // all label values for the metric and the monitored resource. // // The maximum number of `TimeSeries` objects per `Create` request is 200. - TimeSeries []*TimeSeries `protobuf:"bytes,2,rep,name=time_series,json=timeSeries,proto3" json:"time_series,omitempty"` + TimeSeries []*TimeSeries `protobuf:"bytes,2,rep,name=time_series,json=timeSeries,proto3" json:"time_series,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *CreateTimeSeriesRequest) Reset() { @@ -917,10 +908,7 @@ func (x *CreateTimeSeriesRequest) GetTimeSeries() []*TimeSeries { // DEPRECATED. Used to hold per-time-series error status. type CreateTimeSeriesError struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // DEPRECATED. Time series ID that resulted in the `status` error. // // Deprecated: Marked as deprecated in google/monitoring/v3/metric_service.proto. @@ -928,7 +916,9 @@ type CreateTimeSeriesError struct { // DEPRECATED. The status of the requested write operation for `time_series`. // // Deprecated: Marked as deprecated in google/monitoring/v3/metric_service.proto. - Status *status.Status `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` + Status *status.Status `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *CreateTimeSeriesError) Reset() { @@ -979,16 +969,15 @@ func (x *CreateTimeSeriesError) GetStatus() *status.Status { // Summary of the result of a failed request to write data to a time series. type CreateTimeSeriesSummary struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The number of points in the request. TotalPointCount int32 `protobuf:"varint,1,opt,name=total_point_count,json=totalPointCount,proto3" json:"total_point_count,omitempty"` // The number of points that were successfully written. SuccessPointCount int32 `protobuf:"varint,2,opt,name=success_point_count,json=successPointCount,proto3" json:"success_point_count,omitempty"` // The number of points that failed to be written. Order is not guaranteed. - Errors []*CreateTimeSeriesSummary_Error `protobuf:"bytes,3,rep,name=errors,proto3" json:"errors,omitempty"` + Errors []*CreateTimeSeriesSummary_Error `protobuf:"bytes,3,rep,name=errors,proto3" json:"errors,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *CreateTimeSeriesSummary) Reset() { @@ -1048,10 +1037,7 @@ func (x *CreateTimeSeriesSummary) GetErrors() []*CreateTimeSeriesSummary_Error { // // Deprecated: Marked as deprecated in google/monitoring/v3/metric_service.proto. type QueryTimeSeriesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The // [project](https://cloud.google.com/monitoring/api/v3#project_name) on which // to execute the request. The format is: @@ -1067,7 +1053,9 @@ type QueryTimeSeriesRequest struct { // If this field is not empty then it must contain the `nextPageToken` value // returned by a previous call to this method. Using this field causes the // method to return additional results from the previous method call. - PageToken string `protobuf:"bytes,10,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + PageToken string `protobuf:"bytes,10,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *QueryTimeSeriesRequest) Reset() { @@ -1134,10 +1122,7 @@ func (x *QueryTimeSeriesRequest) GetPageToken() string { // // Deprecated: Marked as deprecated in google/monitoring/v3/metric_service.proto. type QueryTimeSeriesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The descriptor for the time series data. TimeSeriesDescriptor *TimeSeriesDescriptor `protobuf:"bytes,8,opt,name=time_series_descriptor,json=timeSeriesDescriptor,proto3" json:"time_series_descriptor,omitempty"` // The time series data. @@ -1150,6 +1135,8 @@ type QueryTimeSeriesResponse struct { // to be incomplete. The available data will be available in the // response. PartialErrors []*status.Status `protobuf:"bytes,11,rep,name=partial_errors,json=partialErrors,proto3" json:"partial_errors,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *QueryTimeSeriesResponse) Reset() { @@ -1212,15 +1199,14 @@ func (x *QueryTimeSeriesResponse) GetPartialErrors() []*status.Status { // This is an error detail intended to be used with INVALID_ARGUMENT errors. type QueryErrorList struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Errors in parsing the time series query language text. The number of errors // in the response may be limited. Errors []*QueryError `protobuf:"bytes,1,rep,name=errors,proto3" json:"errors,omitempty"` // A summary of all the errors. - ErrorSummary string `protobuf:"bytes,2,opt,name=error_summary,json=errorSummary,proto3" json:"error_summary,omitempty"` + ErrorSummary string `protobuf:"bytes,2,opt,name=error_summary,json=errorSummary,proto3" json:"error_summary,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *QueryErrorList) Reset() { @@ -1269,14 +1255,13 @@ func (x *QueryErrorList) GetErrorSummary() string { // Detailed information about an error category. type CreateTimeSeriesSummary_Error struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The status of the requested write operation. Status *status.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` // The number of points that couldn't be written because of `status`. - PointCount int32 `protobuf:"varint,2,opt,name=point_count,json=pointCount,proto3" json:"point_count,omitempty"` + PointCount int32 `protobuf:"varint,2,opt,name=point_count,json=pointCount,proto3" json:"point_count,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *CreateTimeSeriesSummary_Error) Reset() { @@ -1325,432 +1310,119 @@ func (x *CreateTimeSeriesSummary_Error) GetPointCount() int32 { var File_google_monitoring_v3_metric_service_proto protoreflect.FileDescriptor -var file_google_monitoring_v3_metric_service_proto_rawDesc = []byte{ - 0x0a, 0x29, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, - 0x33, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, - 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, - 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x23, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x21, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x6d, 0x65, 0x74, 0x72, - 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 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, 0xd0, - 0x01, 0x0a, 0x27, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x65, 0x64, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x51, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3d, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x37, - 0x12, 0x35, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x03, 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, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x22, 0xae, 0x01, 0x0a, 0x28, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, - 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, - 0x0a, 0x14, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, - 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x13, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 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, 0x7a, 0x0a, 0x25, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x51, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3d, 0xe0, 0x41, 0x02, 0xfa, 0x41, - 0x37, 0x0a, 0x35, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xef, - 0x01, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x46, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x32, 0xe0, - 0x41, 0x02, 0xfa, 0x41, 0x2c, 0x12, 0x2a, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, - 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, - 0x72, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x66, 0x69, - 0x6c, 0x74, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, - 0x65, 0x18, 0x03, 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, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, - 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x24, 0x0a, 0x0b, 0x61, 0x63, - 0x74, 0x69, 0x76, 0x65, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x42, - 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4f, 0x6e, 0x6c, 0x79, - 0x22, 0x94, 0x01, 0x0a, 0x1d, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x12, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x65, 0x74, 0x72, - 0x69, 0x63, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x11, 0x6d, 0x65, - 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 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, 0x64, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x4d, 0x65, - 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x32, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x2c, 0x0a, 0x2a, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, - 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xb7, 0x01, - 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x46, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x32, 0xe0, - 0x41, 0x02, 0xfa, 0x41, 0x2c, 0x12, 0x2a, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, - 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, - 0x72, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x4e, 0x0a, 0x11, 0x6d, 0x65, 0x74, 0x72, 0x69, - 0x63, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, - 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x10, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x22, 0x67, 0x0a, 0x1d, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x32, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x2c, 0x0a, 0x2a, - 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, - 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x22, 0xad, 0x04, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, - 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2c, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x26, - 0x12, 0x24, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x69, 0x6d, 0x65, - 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x06, - 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, - 0x02, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x43, 0x0a, 0x08, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x33, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x42, - 0x03, 0xe0, 0x41, 0x02, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x43, - 0x0a, 0x0b, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x56, 0x0a, 0x15, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x61, 0x72, 0x79, - 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x14, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x61, 0x72, 0x79, - 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x6f, - 0x72, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, - 0x72, 0x64, 0x65, 0x72, 0x42, 0x79, 0x12, 0x53, 0x0a, 0x04, 0x76, 0x69, 0x65, 0x77, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x56, 0x69, 0x65, 0x77, - 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x76, 0x69, 0x65, 0x77, 0x12, 0x1b, 0x0a, 0x09, 0x70, - 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x08, 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, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, - 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x27, 0x0a, 0x0e, 0x54, 0x69, 0x6d, 0x65, 0x53, - 0x65, 0x72, 0x69, 0x65, 0x73, 0x56, 0x69, 0x65, 0x77, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x55, 0x4c, - 0x4c, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x53, 0x10, 0x01, - 0x22, 0xd6, 0x01, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, - 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0b, 0x74, - 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x20, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, - 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, - 0x65, 0x73, 0x52, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 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, 0x12, 0x3d, 0x0a, 0x10, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x03, 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, 0x0f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x45, - 0x72, 0x72, 0x6f, 0x72, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x22, 0xaa, 0x01, 0x0a, 0x17, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x47, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x33, 0xe0, 0x41, 0x02, 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, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x46, - 0x0a, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x53, - 0x65, 0x72, 0x69, 0x65, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x74, 0x69, 0x6d, 0x65, - 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, 0x8e, 0x01, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, - 0x12, 0x45, 0x0a, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0a, 0x74, 0x69, 0x6d, - 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x2e, 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, 0x42, 0x02, 0x18, 0x01, 0x52, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x98, 0x02, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x53, 0x75, 0x6d, 0x6d, - 0x61, 0x72, 0x79, 0x12, 0x2a, 0x0a, 0x11, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x69, - 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x2e, 0x0a, 0x13, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, - 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x73, 0x75, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x4b, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, - 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x2e, 0x45, - 0x72, 0x72, 0x6f, 0x72, 0x52, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x1a, 0x54, 0x0a, 0x05, - 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x01, 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, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x43, 0x6f, 0x75, - 0x6e, 0x74, 0x22, 0x8c, 0x01, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x69, 0x6d, 0x65, - 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 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, 0x19, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x09, - 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, 0x0a, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3a, 0x02, 0x18, - 0x01, 0x22, 0xb2, 0x02, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x53, - 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x60, 0x0a, - 0x16, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x5f, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, - 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x44, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x14, 0x74, 0x69, 0x6d, 0x65, 0x53, - 0x65, 0x72, 0x69, 0x65, 0x73, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, - 0x4e, 0x0a, 0x10, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x5f, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x44, 0x61, 0x74, 0x61, 0x52, - 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x44, 0x61, 0x74, 0x61, 0x12, - 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, - 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x39, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x74, 0x69, - 0x61, 0x6c, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x0b, 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, 0x0d, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x45, 0x72, 0x72, 0x6f, - 0x72, 0x73, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x6f, 0x0a, 0x0e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, - 0x72, 0x72, 0x6f, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x06, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x73, 0x75, 0x6d, 0x6d, - 0x61, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x32, 0xbc, 0x0f, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x72, - 0x69, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xe4, 0x01, 0x0a, 0x20, 0x4c, 0x69, - 0x73, 0x74, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x3d, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, - 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3e, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, - 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x41, 0xda, - 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x12, 0x32, 0x2f, 0x76, - 0x33, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, - 0x2f, 0x2a, 0x7d, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, - 0x12, 0xcc, 0x01, 0x0a, 0x1e, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x65, - 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x6f, 0x72, 0x12, 0x3b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x22, 0x44, 0xda, 0x41, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x37, 0x12, 0x35, 0x2f, 0x76, 0x33, 0x2f, 0x7b, 0x6e, - 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x2a, 0x2a, 0x7d, 0x12, - 0xb8, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, - 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x36, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x29, 0x12, 0x27, 0x2f, 0x76, 0x33, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x12, 0xa0, 0x01, 0x0a, 0x13, 0x47, - 0x65, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x6f, 0x72, 0x12, 0x30, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x74, - 0x72, 0x69, 0x63, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x6f, 0x72, 0x22, 0x39, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x2c, 0x12, 0x2a, 0x2f, 0x76, 0x33, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x2a, 0x2a, 0x7d, 0x12, 0xc8, 0x01, - 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, - 0x63, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x22, 0x5b, 0xda, 0x41, 0x16, - 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3c, 0x3a, 0x11, 0x6d, 0x65, - 0x74, 0x72, 0x69, 0x63, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x22, - 0x27, 0x2f, 0x76, 0x33, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x12, 0xa0, 0x01, 0x0a, 0x16, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x6f, 0x72, 0x12, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, - 0x72, 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, 0x39, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x2a, - 0x2a, 0x2f, 0x76, 0x33, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x2a, 0x2a, 0x7d, 0x12, 0xfe, 0x01, 0x0a, 0x0e, - 0x4c, 0x69, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x2b, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, - 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x33, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x90, 0x01, 0xda, 0x41, 0x19, 0x6e, - 0x61, 0x6d, 0x65, 0x2c, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2c, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x76, 0x61, 0x6c, 0x2c, 0x76, 0x69, 0x65, 0x77, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x6e, 0x5a, 0x27, - 0x12, 0x25, 0x2f, 0x76, 0x33, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6f, 0x72, 0x67, 0x61, - 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x74, 0x69, 0x6d, - 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x5a, 0x21, 0x12, 0x1f, 0x2f, 0x76, 0x33, 0x2f, 0x7b, - 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, - 0x74, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x20, 0x2f, 0x76, 0x33, 0x2f, - 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, - 0x7d, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x99, 0x01, 0x0a, - 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, - 0x73, 0x12, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, - 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 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, 0x3e, 0xda, 0x41, 0x10, 0x6e, 0x61, 0x6d, - 0x65, 0x2c, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, 0x2f, 0x76, 0x33, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, - 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x74, 0x69, - 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0xae, 0x01, 0x0a, 0x17, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, - 0x72, 0x69, 0x65, 0x73, 0x12, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 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, 0x4c, 0xda, 0x41, 0x10, - 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x3a, 0x01, 0x2a, 0x22, 0x2e, 0x2f, 0x76, 0x33, 0x2f, 0x7b, - 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, - 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x3a, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0xda, 0x01, 0xca, 0x41, 0x19, 0x6d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0xd2, 0x41, 0xba, 0x01, 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, 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, 0x6d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 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, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, - 0x2e, 0x72, 0x65, 0x61, 0x64, 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, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, - 0x2e, 0x77, 0x72, 0x69, 0x74, 0x65, 0x42, 0x89, 0x08, 0xea, 0x41, 0xf0, 0x01, 0x0a, 0x2a, 0x6d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x3b, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x6d, 0x65, - 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x2f, - 0x7b, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x6f, 0x72, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x45, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x39, 0x66, - 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x7d, 0x2f, - 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, - 0x73, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x6f, 0x72, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x01, 0x2a, 0x20, 0x01, 0xea, 0x41, 0xb7, - 0x02, 0x0a, 0x35, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x4f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x7b, 0x6d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x7d, 0x12, 0x59, 0x6f, 0x72, 0x67, 0x61, 0x6e, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, - 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x65, - 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x7b, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x5f, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x6f, 0x72, 0x7d, 0x12, 0x4d, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x66, - 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x7d, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x65, 0x64, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x6f, 0x72, 0x73, 0x2f, 0x7b, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x5f, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x6f, 0x72, 0x7d, 0x12, 0x01, 0x2a, 0x20, 0x01, 0xea, 0x41, 0x51, 0x0a, 0x23, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, - 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x12, 0x12, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x7d, 0x12, 0x16, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, - 0x2f, 0x7b, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0xea, 0x41, 0xb5, 0x01, - 0x0a, 0x24, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x69, 0x6d, 0x65, - 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x2b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, - 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x53, - 0x65, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x7b, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x69, - 0x65, 0x73, 0x7d, 0x12, 0x35, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x2f, 0x7b, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x7d, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x7b, 0x74, 0x69, - 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x7d, 0x12, 0x29, 0x66, 0x6f, 0x6c, 0x64, - 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x7d, 0x2f, 0x74, 0x69, 0x6d, - 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x7b, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x65, - 0x72, 0x69, 0x65, 0x73, 0x7d, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x42, - 0x12, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x33, 0x2f, 0x76, 0x32, 0x2f, 0x6d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x70, 0x62, 0x3b, 0x6d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x70, 0x62, 0xaa, 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x6e, 0x67, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, - 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x5c, - 0x56, 0x33, 0xea, 0x02, 0x1d, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x3a, 0x3a, 0x43, 0x6c, 0x6f, - 0x75, 0x64, 0x3a, 0x3a, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x3a, 0x3a, - 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_google_monitoring_v3_metric_service_proto_rawDesc = "" + + "\n" + + ")google/monitoring/v3/metric_service.proto\x12\x14google.monitoring.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x17google/api/metric.proto\x1a#google/api/monitored_resource.proto\x1a\x19google/api/resource.proto\x1a!google/monitoring/v3/common.proto\x1a!google/monitoring/v3/metric.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x17google/rpc/status.proto\"\xd0\x01\n" + + "'ListMonitoredResourceDescriptorsRequest\x12Q\n" + + "\x04name\x18\x05 \x01(\tB=\xe0A\x02\xfaA7\x125monitoring.googleapis.com/MonitoredResourceDescriptorR\x04name\x12\x16\n" + + "\x06filter\x18\x02 \x01(\tR\x06filter\x12\x1b\n" + + "\tpage_size\x18\x03 \x01(\x05R\bpageSize\x12\x1d\n" + + "\n" + + "page_token\x18\x04 \x01(\tR\tpageToken\"\xae\x01\n" + + "(ListMonitoredResourceDescriptorsResponse\x12Z\n" + + "\x14resource_descriptors\x18\x01 \x03(\v2'.google.api.MonitoredResourceDescriptorR\x13resourceDescriptors\x12&\n" + + "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\"z\n" + + "%GetMonitoredResourceDescriptorRequest\x12Q\n" + + "\x04name\x18\x03 \x01(\tB=\xe0A\x02\xfaA7\n" + + "5monitoring.googleapis.com/MonitoredResourceDescriptorR\x04name\"\xef\x01\n" + + "\x1cListMetricDescriptorsRequest\x12F\n" + + "\x04name\x18\x05 \x01(\tB2\xe0A\x02\xfaA,\x12*monitoring.googleapis.com/MetricDescriptorR\x04name\x12\x1b\n" + + "\x06filter\x18\x02 \x01(\tB\x03\xe0A\x01R\x06filter\x12 \n" + + "\tpage_size\x18\x03 \x01(\x05B\x03\xe0A\x01R\bpageSize\x12\"\n" + + "\n" + + "page_token\x18\x04 \x01(\tB\x03\xe0A\x01R\tpageToken\x12$\n" + + "\vactive_only\x18\x06 \x01(\bB\x03\xe0A\x01R\n" + + "activeOnly\"\x94\x01\n" + + "\x1dListMetricDescriptorsResponse\x12K\n" + + "\x12metric_descriptors\x18\x01 \x03(\v2\x1c.google.api.MetricDescriptorR\x11metricDescriptors\x12&\n" + + "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\"d\n" + + "\x1aGetMetricDescriptorRequest\x12F\n" + + "\x04name\x18\x03 \x01(\tB2\xe0A\x02\xfaA,\n" + + "*monitoring.googleapis.com/MetricDescriptorR\x04name\"\xb7\x01\n" + + "\x1dCreateMetricDescriptorRequest\x12F\n" + + "\x04name\x18\x03 \x01(\tB2\xe0A\x02\xfaA,\x12*monitoring.googleapis.com/MetricDescriptorR\x04name\x12N\n" + + "\x11metric_descriptor\x18\x02 \x01(\v2\x1c.google.api.MetricDescriptorB\x03\xe0A\x02R\x10metricDescriptor\"g\n" + + "\x1dDeleteMetricDescriptorRequest\x12F\n" + + "\x04name\x18\x03 \x01(\tB2\xe0A\x02\xfaA,\n" + + "*monitoring.googleapis.com/MetricDescriptorR\x04name\"\xad\x04\n" + + "\x15ListTimeSeriesRequest\x12@\n" + + "\x04name\x18\n" + + " \x01(\tB,\xe0A\x02\xfaA&\x12$monitoring.googleapis.com/TimeSeriesR\x04name\x12\x1b\n" + + "\x06filter\x18\x02 \x01(\tB\x03\xe0A\x02R\x06filter\x12C\n" + + "\binterval\x18\x04 \x01(\v2\".google.monitoring.v3.TimeIntervalB\x03\xe0A\x02R\binterval\x12C\n" + + "\vaggregation\x18\x05 \x01(\v2!.google.monitoring.v3.AggregationR\vaggregation\x12V\n" + + "\x15secondary_aggregation\x18\v \x01(\v2!.google.monitoring.v3.AggregationR\x14secondaryAggregation\x12\x19\n" + + "\border_by\x18\x06 \x01(\tR\aorderBy\x12S\n" + + "\x04view\x18\a \x01(\x0e2:.google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesViewB\x03\xe0A\x02R\x04view\x12\x1b\n" + + "\tpage_size\x18\b \x01(\x05R\bpageSize\x12\x1d\n" + + "\n" + + "page_token\x18\t \x01(\tR\tpageToken\"'\n" + + "\x0eTimeSeriesView\x12\b\n" + + "\x04FULL\x10\x00\x12\v\n" + + "\aHEADERS\x10\x01\"\xd6\x01\n" + + "\x16ListTimeSeriesResponse\x12A\n" + + "\vtime_series\x18\x01 \x03(\v2 .google.monitoring.v3.TimeSeriesR\n" + + "timeSeries\x12&\n" + + "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\x12=\n" + + "\x10execution_errors\x18\x03 \x03(\v2\x12.google.rpc.StatusR\x0fexecutionErrors\x12\x12\n" + + "\x04unit\x18\x05 \x01(\tR\x04unit\"\xaa\x01\n" + + "\x17CreateTimeSeriesRequest\x12G\n" + + "\x04name\x18\x03 \x01(\tB3\xe0A\x02\xfaA-\n" + + "+cloudresourcemanager.googleapis.com/ProjectR\x04name\x12F\n" + + "\vtime_series\x18\x02 \x03(\v2 .google.monitoring.v3.TimeSeriesB\x03\xe0A\x02R\n" + + "timeSeries\"\x8e\x01\n" + + "\x15CreateTimeSeriesError\x12E\n" + + "\vtime_series\x18\x01 \x01(\v2 .google.monitoring.v3.TimeSeriesB\x02\x18\x01R\n" + + "timeSeries\x12.\n" + + "\x06status\x18\x02 \x01(\v2\x12.google.rpc.StatusB\x02\x18\x01R\x06status\"\x98\x02\n" + + "\x17CreateTimeSeriesSummary\x12*\n" + + "\x11total_point_count\x18\x01 \x01(\x05R\x0ftotalPointCount\x12.\n" + + "\x13success_point_count\x18\x02 \x01(\x05R\x11successPointCount\x12K\n" + + "\x06errors\x18\x03 \x03(\v23.google.monitoring.v3.CreateTimeSeriesSummary.ErrorR\x06errors\x1aT\n" + + "\x05Error\x12*\n" + + "\x06status\x18\x01 \x01(\v2\x12.google.rpc.StatusR\x06status\x12\x1f\n" + + "\vpoint_count\x18\x02 \x01(\x05R\n" + + "pointCount\"\x8c\x01\n" + + "\x16QueryTimeSeriesRequest\x12\x17\n" + + "\x04name\x18\x01 \x01(\tB\x03\xe0A\x02R\x04name\x12\x19\n" + + "\x05query\x18\a \x01(\tB\x03\xe0A\x02R\x05query\x12\x1b\n" + + "\tpage_size\x18\t \x01(\x05R\bpageSize\x12\x1d\n" + + "\n" + + "page_token\x18\n" + + " \x01(\tR\tpageToken:\x02\x18\x01\"\xb2\x02\n" + + "\x17QueryTimeSeriesResponse\x12`\n" + + "\x16time_series_descriptor\x18\b \x01(\v2*.google.monitoring.v3.TimeSeriesDescriptorR\x14timeSeriesDescriptor\x12N\n" + + "\x10time_series_data\x18\t \x03(\v2$.google.monitoring.v3.TimeSeriesDataR\x0etimeSeriesData\x12&\n" + + "\x0fnext_page_token\x18\n" + + " \x01(\tR\rnextPageToken\x129\n" + + "\x0epartial_errors\x18\v \x03(\v2\x12.google.rpc.StatusR\rpartialErrors:\x02\x18\x01\"o\n" + + "\x0eQueryErrorList\x128\n" + + "\x06errors\x18\x01 \x03(\v2 .google.monitoring.v3.QueryErrorR\x06errors\x12#\n" + + "\rerror_summary\x18\x02 \x01(\tR\ferrorSummary2\xbc\x0f\n" + + "\rMetricService\x12\xe4\x01\n" + + " ListMonitoredResourceDescriptors\x12=.google.monitoring.v3.ListMonitoredResourceDescriptorsRequest\x1a>.google.monitoring.v3.ListMonitoredResourceDescriptorsResponse\"A\xdaA\x04name\x82\xd3\xe4\x93\x024\x122/v3/{name=projects/*}/monitoredResourceDescriptors\x12\xcc\x01\n" + + "\x1eGetMonitoredResourceDescriptor\x12;.google.monitoring.v3.GetMonitoredResourceDescriptorRequest\x1a'.google.api.MonitoredResourceDescriptor\"D\xdaA\x04name\x82\xd3\xe4\x93\x027\x125/v3/{name=projects/*/monitoredResourceDescriptors/**}\x12\xb8\x01\n" + + "\x15ListMetricDescriptors\x122.google.monitoring.v3.ListMetricDescriptorsRequest\x1a3.google.monitoring.v3.ListMetricDescriptorsResponse\"6\xdaA\x04name\x82\xd3\xe4\x93\x02)\x12'/v3/{name=projects/*}/metricDescriptors\x12\xa0\x01\n" + + "\x13GetMetricDescriptor\x120.google.monitoring.v3.GetMetricDescriptorRequest\x1a\x1c.google.api.MetricDescriptor\"9\xdaA\x04name\x82\xd3\xe4\x93\x02,\x12*/v3/{name=projects/*/metricDescriptors/**}\x12\xc8\x01\n" + + "\x16CreateMetricDescriptor\x123.google.monitoring.v3.CreateMetricDescriptorRequest\x1a\x1c.google.api.MetricDescriptor\"[\xdaA\x16name,metric_descriptor\x82\xd3\xe4\x93\x02<:\x11metric_descriptor\"'/v3/{name=projects/*}/metricDescriptors\x12\xa0\x01\n" + + "\x16DeleteMetricDescriptor\x123.google.monitoring.v3.DeleteMetricDescriptorRequest\x1a\x16.google.protobuf.Empty\"9\xdaA\x04name\x82\xd3\xe4\x93\x02,**/v3/{name=projects/*/metricDescriptors/**}\x12\xfe\x01\n" + + "\x0eListTimeSeries\x12+.google.monitoring.v3.ListTimeSeriesRequest\x1a,.google.monitoring.v3.ListTimeSeriesResponse\"\x90\x01\xdaA\x19name,filter,interval,view\x82\xd3\xe4\x93\x02nZ'\x12%/v3/{name=organizations/*}/timeSeriesZ!\x12\x1f/v3/{name=folders/*}/timeSeries\x12 /v3/{name=projects/*}/timeSeries\x12\x99\x01\n" + + "\x10CreateTimeSeries\x12-.google.monitoring.v3.CreateTimeSeriesRequest\x1a\x16.google.protobuf.Empty\">\xdaA\x10name,time_series\x82\xd3\xe4\x93\x02%:\x01*\" /v3/{name=projects/*}/timeSeries\x12\xae\x01\n" + + "\x17CreateServiceTimeSeries\x12-.google.monitoring.v3.CreateTimeSeriesRequest\x1a\x16.google.protobuf.Empty\"L\xdaA\x10name,time_series\x82\xd3\xe4\x93\x023:\x01*\"./v3/{name=projects/*}/timeSeries:createService\x1a\xda\x01\xcaA\x19monitoring.googleapis.com\xd2A\xba\x01https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.read,https://www.googleapis.com/auth/monitoring.writeB\x89\b\xeaA\xf0\x01\n" + + "*monitoring.googleapis.com/MetricDescriptor\x12;projects/{project}/metricDescriptors/{metric_descriptor=**}\x12Eorganizations/{organization}/metricDescriptors/{metric_descriptor=**}\x129folders/{folder}/metricDescriptors/{metric_descriptor=**}\x12\x01* \x01\xeaA\xb7\x02\n" + + "5monitoring.googleapis.com/MonitoredResourceDescriptor\x12Oprojects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}\x12Yorganizations/{organization}/monitoredResourceDescriptors/{monitored_resource_descriptor}\x12Mfolders/{folder}/monitoredResourceDescriptors/{monitored_resource_descriptor}\x12\x01* \x01\xeaAQ\n" + + "#monitoring.googleapis.com/Workspace\x12\x12projects/{project}\x12\x16workspaces/{workspace}\xeaA\xb5\x01\n" + + "$monitoring.googleapis.com/TimeSeries\x12+projects/{project}/timeSeries/{time_series}\x125organizations/{organization}/timeSeries/{time_series}\x12)folders/{folder}/timeSeries/{time_series}\n" + + "\x18com.google.monitoring.v3B\x12MetricServiceProtoP\x01ZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpb\xaa\x02\x1aGoogle.Cloud.Monitoring.V3\xca\x02\x1aGoogle\\Cloud\\Monitoring\\V3\xea\x02\x1dGoogle::Cloud::Monitoring::V3b\x06proto3" var ( file_google_monitoring_v3_metric_service_proto_rawDescOnce sync.Once - file_google_monitoring_v3_metric_service_proto_rawDescData = file_google_monitoring_v3_metric_service_proto_rawDesc + file_google_monitoring_v3_metric_service_proto_rawDescData []byte ) func file_google_monitoring_v3_metric_service_proto_rawDescGZIP() []byte { file_google_monitoring_v3_metric_service_proto_rawDescOnce.Do(func() { - file_google_monitoring_v3_metric_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_monitoring_v3_metric_service_proto_rawDescData) + file_google_monitoring_v3_metric_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_metric_service_proto_rawDesc), len(file_google_monitoring_v3_metric_service_proto_rawDesc))) }) return file_google_monitoring_v3_metric_service_proto_rawDescData } @@ -1842,7 +1514,7 @@ func file_google_monitoring_v3_metric_service_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_monitoring_v3_metric_service_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_metric_service_proto_rawDesc), len(file_google_monitoring_v3_metric_service_proto_rawDesc)), NumEnums: 1, NumMessages: 17, NumExtensions: 0, @@ -1854,7 +1526,6 @@ func file_google_monitoring_v3_metric_service_proto_init() { MessageInfos: file_google_monitoring_v3_metric_service_proto_msgTypes, }.Build() File_google_monitoring_v3_metric_service_proto = out.File - file_google_monitoring_v3_metric_service_proto_rawDesc = nil file_google_monitoring_v3_metric_service_proto_goTypes = nil file_google_monitoring_v3_metric_service_proto_depIdxs = nil } diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service_grpc.pb.go index b4a5478cf61..a2627fbd7ab 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service_grpc.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service_grpc.pb.go @@ -15,13 +15,14 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.7 +// - protoc v6.33.2 // source: google/monitoring/v3/metric_service.proto package monitoringpb import ( context "context" + metric "google.golang.org/genproto/googleapis/api/metric" monitoredres "google.golang.org/genproto/googleapis/api/monitoredres" grpc "google.golang.org/grpc" diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/mutation_record.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/mutation_record.pb.go index 820101962eb..12d685d9101 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/mutation_record.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/mutation_record.pb.go @@ -14,18 +14,20 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 -// protoc v4.25.7 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: google/monitoring/v3/mutation_record.proto package monitoringpb import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" ) const ( @@ -37,14 +39,13 @@ const ( // Describes a change made to a configuration. type MutationRecord struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // When the change occurred. MutateTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=mutate_time,json=mutateTime,proto3" json:"mutate_time,omitempty"` // The email address of the user making the change. - MutatedBy string `protobuf:"bytes,2,opt,name=mutated_by,json=mutatedBy,proto3" json:"mutated_by,omitempty"` + MutatedBy string `protobuf:"bytes,2,opt,name=mutated_by,json=mutatedBy,proto3" json:"mutated_by,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *MutationRecord) Reset() { @@ -93,44 +94,24 @@ func (x *MutationRecord) GetMutatedBy() string { var File_google_monitoring_v3_mutation_record_proto protoreflect.FileDescriptor -var file_google_monitoring_v3_mutation_record_proto_rawDesc = []byte{ - 0x0a, 0x2a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x33, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0x6c, 0x0a, 0x0e, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x3b, 0x0a, 0x0b, 0x6d, 0x75, 0x74, 0x61, 0x74, 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, 0x0a, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x65, 0x54, 0x69, - 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x65, 0x64, 0x42, - 0x79, 0x42, 0xce, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x42, 0x13, - 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x33, 0x2f, 0x76, 0x32, 0x2f, 0x6d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x70, 0x62, 0x3b, 0x6d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x70, 0x62, 0xaa, 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x6e, 0x67, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, - 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x5c, - 0x56, 0x33, 0xea, 0x02, 0x1d, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x3a, 0x3a, 0x43, 0x6c, 0x6f, - 0x75, 0x64, 0x3a, 0x3a, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x3a, 0x3a, - 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_google_monitoring_v3_mutation_record_proto_rawDesc = "" + + "\n" + + "*google/monitoring/v3/mutation_record.proto\x12\x14google.monitoring.v3\x1a\x1fgoogle/protobuf/timestamp.proto\"l\n" + + "\x0eMutationRecord\x12;\n" + + "\vmutate_time\x18\x01 \x01(\v2\x1a.google.protobuf.TimestampR\n" + + "mutateTime\x12\x1d\n" + + "\n" + + "mutated_by\x18\x02 \x01(\tR\tmutatedByB\xce\x01\n" + + "\x18com.google.monitoring.v3B\x13MutationRecordProtoP\x01ZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpb\xaa\x02\x1aGoogle.Cloud.Monitoring.V3\xca\x02\x1aGoogle\\Cloud\\Monitoring\\V3\xea\x02\x1dGoogle::Cloud::Monitoring::V3b\x06proto3" var ( file_google_monitoring_v3_mutation_record_proto_rawDescOnce sync.Once - file_google_monitoring_v3_mutation_record_proto_rawDescData = file_google_monitoring_v3_mutation_record_proto_rawDesc + file_google_monitoring_v3_mutation_record_proto_rawDescData []byte ) func file_google_monitoring_v3_mutation_record_proto_rawDescGZIP() []byte { file_google_monitoring_v3_mutation_record_proto_rawDescOnce.Do(func() { - file_google_monitoring_v3_mutation_record_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_monitoring_v3_mutation_record_proto_rawDescData) + file_google_monitoring_v3_mutation_record_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_mutation_record_proto_rawDesc), len(file_google_monitoring_v3_mutation_record_proto_rawDesc))) }) return file_google_monitoring_v3_mutation_record_proto_rawDescData } @@ -158,7 +139,7 @@ func file_google_monitoring_v3_mutation_record_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_monitoring_v3_mutation_record_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_mutation_record_proto_rawDesc), len(file_google_monitoring_v3_mutation_record_proto_rawDesc)), NumEnums: 0, NumMessages: 1, NumExtensions: 0, @@ -169,7 +150,6 @@ func file_google_monitoring_v3_mutation_record_proto_init() { MessageInfos: file_google_monitoring_v3_mutation_record_proto_msgTypes, }.Build() File_google_monitoring_v3_mutation_record_proto = out.File - file_google_monitoring_v3_mutation_record_proto_rawDesc = nil file_google_monitoring_v3_mutation_record_proto_goTypes = nil file_google_monitoring_v3_mutation_record_proto_depIdxs = nil } diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification.pb.go index b2f0806e893..e98909d56f9 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification.pb.go @@ -14,21 +14,23 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 -// protoc v4.25.7 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: google/monitoring/v3/notification.proto package monitoringpb import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + api "google.golang.org/genproto/googleapis/api" _ "google.golang.org/genproto/googleapis/api/annotations" label "google.golang.org/genproto/googleapis/api/label" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" - reflect "reflect" - sync "sync" ) const ( @@ -107,10 +109,7 @@ func (NotificationChannel_VerificationStatus) EnumDescriptor() ([]byte, []int) { // the properties of the channel and the set of labels or fields that // must be specified to configure channels of a given type. type NotificationChannelDescriptor struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The full REST resource name for this descriptor. The format is: // // projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[TYPE] @@ -140,7 +139,9 @@ type NotificationChannelDescriptor struct { // Deprecated: Marked as deprecated in google/monitoring/v3/notification.proto. SupportedTiers []ServiceTier `protobuf:"varint,5,rep,packed,name=supported_tiers,json=supportedTiers,proto3,enum=google.monitoring.v3.ServiceTier" json:"supported_tiers,omitempty"` // The product launch stage for channels of this type. - LaunchStage api.LaunchStage `protobuf:"varint,7,opt,name=launch_stage,json=launchStage,proto3,enum=google.api.LaunchStage" json:"launch_stage,omitempty"` + LaunchStage api.LaunchStage `protobuf:"varint,7,opt,name=launch_stage,json=launchStage,proto3,enum=google.api.LaunchStage" json:"launch_stage,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *NotificationChannelDescriptor) Reset() { @@ -229,10 +230,7 @@ func (x *NotificationChannelDescriptor) GetLaunchStage() api.LaunchStage { // containing sensitive information like authentication tokens or // contact info are only partially populated on retrieval. type NotificationChannel struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The type of the notification channel. This field matches the // value of the // [NotificationChannelDescriptor.type][google.monitoring.v3.NotificationChannelDescriptor.type] @@ -257,7 +255,7 @@ type NotificationChannel struct { // permissible and required labels are specified in the // [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels] // of the `NotificationChannelDescriptor` corresponding to the `type` field. - Labels map[string]string `protobuf:"bytes,5,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Labels map[string]string `protobuf:"bytes,5,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // User-supplied key/value data that does not need to conform to // the corresponding `NotificationChannelDescriptor`'s schema, unlike // the `labels` field. This field is intended to be used for organizing @@ -267,7 +265,7 @@ type NotificationChannel struct { // 63 Unicode characters or 128 bytes, whichever is smaller. Labels and // values can contain only lowercase letters, numerals, underscores, and // dashes. Keys must begin with a letter. - UserLabels map[string]string `protobuf:"bytes,8,rep,name=user_labels,json=userLabels,proto3" json:"user_labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + UserLabels map[string]string `protobuf:"bytes,8,rep,name=user_labels,json=userLabels,proto3" json:"user_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // Indicates whether this channel has been verified or not. On a // [`ListNotificationChannels`][google.monitoring.v3.NotificationChannelService.ListNotificationChannels] // or @@ -299,6 +297,8 @@ type NotificationChannel struct { CreationRecord *MutationRecord `protobuf:"bytes,12,opt,name=creation_record,json=creationRecord,proto3" json:"creation_record,omitempty"` // Records of the modification of this channel. MutationRecords []*MutationRecord `protobuf:"bytes,13,rep,name=mutation_records,json=mutationRecords,proto3" json:"mutation_records,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *NotificationChannel) Reset() { @@ -403,157 +403,52 @@ func (x *NotificationChannel) GetMutationRecords() []*MutationRecord { var File_google_monitoring_v3_notification_proto protoreflect.FileDescriptor -var file_google_monitoring_v3_notification_proto_rawDesc = []byte{ - 0x0a, 0x27, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x1a, - 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x16, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6c, 0x61, 0x62, - 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x5f, 0x73, 0x74, 0x61, 0x67, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x21, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x6d, 0x75, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0xf0, 0x04, 0x0a, 0x1d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x64, - 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, - 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x33, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x61, - 0x62, 0x65, 0x6c, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x06, 0x6c, - 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x4e, 0x0a, 0x0f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, - 0x65, 0x64, 0x5f, 0x74, 0x69, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x21, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x69, 0x65, - 0x72, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, - 0x54, 0x69, 0x65, 0x72, 0x73, 0x12, 0x3a, 0x0a, 0x0c, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x5f, - 0x73, 0x74, 0x61, 0x67, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x53, - 0x74, 0x61, 0x67, 0x65, 0x52, 0x0b, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x53, 0x74, 0x61, 0x67, - 0x65, 0x3a, 0xa0, 0x02, 0xea, 0x41, 0x9c, 0x02, 0x0a, 0x37, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, - 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, - 0x72, 0x12, 0x46, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x7b, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x7d, 0x12, 0x50, 0x6f, 0x72, 0x67, 0x61, 0x6e, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, - 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x44, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x7b, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x7d, 0x12, 0x44, 0x66, 0x6f, 0x6c, - 0x64, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x7d, 0x2f, 0x6e, 0x6f, - 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, - 0x6c, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x7b, 0x63, 0x68, - 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, - 0x7d, 0x12, 0x01, 0x2a, 0x22, 0xcb, 0x08, 0x0a, 0x13, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, - 0xe0, 0x41, 0x08, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, - 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4d, - 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x5a, 0x0a, - 0x0b, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x08, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x55, 0x73, - 0x65, 0x72, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x75, - 0x73, 0x65, 0x72, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x6d, 0x0a, 0x13, 0x76, 0x65, 0x72, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x6f, - 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, - 0x6c, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x12, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x34, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x64, 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, 0x42, 0x6f, 0x6f, 0x6c, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x4d, - 0x0a, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, - 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x4d, - 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x0e, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x4f, 0x0a, - 0x10, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x4d, - 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x0f, 0x6d, - 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 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, 0x1a, 0x3d, 0x0a, 0x0f, 0x55, 0x73, 0x65, - 0x72, 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, 0x22, 0x57, 0x0a, 0x12, 0x56, 0x65, 0x72, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, - 0x0a, 0x1f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, - 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, - 0x44, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x55, 0x4e, 0x56, 0x45, 0x52, 0x49, 0x46, 0x49, 0x45, - 0x44, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x56, 0x45, 0x52, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, - 0x02, 0x3a, 0xfe, 0x01, 0xea, 0x41, 0xfa, 0x01, 0x0a, 0x2d, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, - 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x3e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, - 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x6e, 0x6f, 0x74, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, - 0x2f, 0x7b, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, - 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x7d, 0x12, 0x48, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x2f, 0x7b, 0x6e, 0x6f, 0x74, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, - 0x7d, 0x12, 0x3c, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x66, 0x6f, 0x6c, 0x64, - 0x65, 0x72, 0x7d, 0x2f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x2f, 0x7b, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x7d, 0x12, - 0x01, 0x2a, 0x42, 0xcc, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x42, - 0x11, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, - 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x33, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x70, 0x62, 0x3b, 0x6d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x70, 0x62, 0xaa, 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, - 0x67, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, - 0x6f, 0x75, 0x64, 0x5c, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x5c, 0x56, - 0x33, 0xea, 0x02, 0x1d, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x3a, 0x3a, 0x43, 0x6c, 0x6f, 0x75, - 0x64, 0x3a, 0x3a, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, - 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_google_monitoring_v3_notification_proto_rawDesc = "" + + "\n" + + "'google/monitoring/v3/notification.proto\x12\x14google.monitoring.v3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x16google/api/label.proto\x1a\x1dgoogle/api/launch_stage.proto\x1a\x19google/api/resource.proto\x1a!google/monitoring/v3/common.proto\x1a*google/monitoring/v3/mutation_record.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xf0\x04\n" + + "\x1dNotificationChannelDescriptor\x12\x12\n" + + "\x04name\x18\x06 \x01(\tR\x04name\x12\x12\n" + + "\x04type\x18\x01 \x01(\tR\x04type\x12!\n" + + "\fdisplay_name\x18\x02 \x01(\tR\vdisplayName\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\x123\n" + + "\x06labels\x18\x04 \x03(\v2\x1b.google.api.LabelDescriptorR\x06labels\x12N\n" + + "\x0fsupported_tiers\x18\x05 \x03(\x0e2!.google.monitoring.v3.ServiceTierB\x02\x18\x01R\x0esupportedTiers\x12:\n" + + "\flaunch_stage\x18\a \x01(\x0e2\x17.google.api.LaunchStageR\vlaunchStage:\xa0\x02\xeaA\x9c\x02\n" + + "7monitoring.googleapis.com/NotificationChannelDescriptor\x12Fprojects/{project}/notificationChannelDescriptors/{channel_descriptor}\x12Porganizations/{organization}/notificationChannelDescriptors/{channel_descriptor}\x12Dfolders/{folder}/notificationChannelDescriptors/{channel_descriptor}\x12\x01*\"\xcb\b\n" + + "\x13NotificationChannel\x12\x12\n" + + "\x04type\x18\x01 \x01(\tR\x04type\x12\x17\n" + + "\x04name\x18\x06 \x01(\tB\x03\xe0A\bR\x04name\x12!\n" + + "\fdisplay_name\x18\x03 \x01(\tR\vdisplayName\x12 \n" + + "\vdescription\x18\x04 \x01(\tR\vdescription\x12M\n" + + "\x06labels\x18\x05 \x03(\v25.google.monitoring.v3.NotificationChannel.LabelsEntryR\x06labels\x12Z\n" + + "\vuser_labels\x18\b \x03(\v29.google.monitoring.v3.NotificationChannel.UserLabelsEntryR\n" + + "userLabels\x12m\n" + + "\x13verification_status\x18\t \x01(\x0e2<.google.monitoring.v3.NotificationChannel.VerificationStatusR\x12verificationStatus\x124\n" + + "\aenabled\x18\v \x01(\v2\x1a.google.protobuf.BoolValueR\aenabled\x12M\n" + + "\x0fcreation_record\x18\f \x01(\v2$.google.monitoring.v3.MutationRecordR\x0ecreationRecord\x12O\n" + + "\x10mutation_records\x18\r \x03(\v2$.google.monitoring.v3.MutationRecordR\x0fmutationRecords\x1a9\n" + + "\vLabelsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1a=\n" + + "\x0fUserLabelsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"W\n" + + "\x12VerificationStatus\x12#\n" + + "\x1fVERIFICATION_STATUS_UNSPECIFIED\x10\x00\x12\x0e\n" + + "\n" + + "UNVERIFIED\x10\x01\x12\f\n" + + "\bVERIFIED\x10\x02:\xfe\x01\xeaA\xfa\x01\n" + + "-monitoring.googleapis.com/NotificationChannel\x12>projects/{project}/notificationChannels/{notification_channel}\x12Horganizations/{organization}/notificationChannels/{notification_channel}\x12= // 1.6.8 will have their services ingested as this type. type Service_IstioCanonicalService struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Identifier for the Istio mesh in which this canonical service is defined. // Corresponds to the `mesh_uid` metric label in // [Istio metrics](https://cloud.google.com/monitoring/api/metrics_istio). @@ -1479,6 +1511,8 @@ type Service_IstioCanonicalService struct { // label in [Istio // metrics](https://cloud.google.com/monitoring/api/metrics_istio). CanonicalService string `protobuf:"bytes,4,opt,name=canonical_service,json=canonicalService,proto3" json:"canonical_service,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Service_IstioCanonicalService) Reset() { @@ -1534,10 +1568,7 @@ func (x *Service_IstioCanonicalService) GetCanonicalService() string { // Cloud Run service. Learn more at https://cloud.google.com/run. type Service_CloudRun struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The name of the Cloud Run service. Corresponds to the `service_name` // resource label in the [`cloud_run_revision` monitored // resource](https://cloud.google.com/monitoring/api/resources#tag_cloud_run_revision). @@ -1545,7 +1576,9 @@ type Service_CloudRun struct { // The location the service is run. Corresponds to the `location` // resource label in the [`cloud_run_revision` monitored // resource](https://cloud.google.com/monitoring/api/resources#tag_cloud_run_revision). - Location string `protobuf:"bytes,2,opt,name=location,proto3" json:"location,omitempty"` + Location string `protobuf:"bytes,2,opt,name=location,proto3" json:"location,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Service_CloudRun) Reset() { @@ -1596,10 +1629,7 @@ func (x *Service_CloudRun) GetLocation() string { // on monitored resources that fall under a namespace (for example, // `k8s_container` or `k8s_pod`). type Service_GkeNamespace struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Output only. The project this resource lives in. For legacy services // migrated from the `Custom` type, this may be a distinct project from the // one parenting the service itself. @@ -1610,6 +1640,8 @@ type Service_GkeNamespace struct { ClusterName string `protobuf:"bytes,3,opt,name=cluster_name,json=clusterName,proto3" json:"cluster_name,omitempty"` // The name of this namespace. NamespaceName string `protobuf:"bytes,4,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Service_GkeNamespace) Reset() { @@ -1674,10 +1706,7 @@ func (x *Service_GkeNamespace) GetNamespaceName() string { // to the metadata labels on monitored resources that fall under a workload // (for example, `k8s_container` or `k8s_pod`). type Service_GkeWorkload struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Output only. The project this resource lives in. For legacy services // migrated from the `Custom` type, this may be a distinct project from the // one parenting the service itself. @@ -1692,6 +1721,8 @@ type Service_GkeWorkload struct { TopLevelControllerType string `protobuf:"bytes,5,opt,name=top_level_controller_type,json=topLevelControllerType,proto3" json:"top_level_controller_type,omitempty"` // The name of this workload. TopLevelControllerName string `protobuf:"bytes,6,opt,name=top_level_controller_name,json=topLevelControllerName,proto3" json:"top_level_controller_name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Service_GkeWorkload) Reset() { @@ -1773,10 +1804,7 @@ func (x *Service_GkeWorkload) GetTopLevelControllerName() string { // monitored // resources](https://cloud.google.com/monitoring/api/resources#tag_k8s_service). type Service_GkeService struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Output only. The project this resource lives in. For legacy services // migrated from the `Custom` type, this may be a distinct project from the // one parenting the service itself. @@ -1788,7 +1816,9 @@ type Service_GkeService struct { // The name of the parent namespace. NamespaceName string `protobuf:"bytes,4,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` // The name of this service. - ServiceName string `protobuf:"bytes,5,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` + ServiceName string `protobuf:"bytes,5,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Service_GkeService) Reset() { @@ -1860,10 +1890,7 @@ func (x *Service_GkeService) GetServiceName() string { // Documentation and examples // [here](https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli). type Service_BasicService struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The type of service that this basic service defines, e.g. // APP_ENGINE service type. // Documentation and valid values @@ -1873,7 +1900,9 @@ type Service_BasicService struct { // is used for SLO reporting of this `Service`. // Documentation and valid values for given service types // [here](https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli). - ServiceLabels map[string]string `protobuf:"bytes,2,rep,name=service_labels,json=serviceLabels,proto3" json:"service_labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + ServiceLabels map[string]string `protobuf:"bytes,2,rep,name=service_labels,json=serviceLabels,proto3" json:"service_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Service_BasicService) Reset() { @@ -1922,13 +1951,12 @@ func (x *Service_BasicService) GetServiceLabels() map[string]string { // Configuration for how to query telemetry on a Service. type Service_Telemetry struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The full name of the resource that defines this service. Formatted as // described in https://cloud.google.com/apis/design/resource_names. - ResourceName string `protobuf:"bytes,1,opt,name=resource_name,json=resourceName,proto3" json:"resource_name,omitempty"` + ResourceName string `protobuf:"bytes,1,opt,name=resource_name,json=resourceName,proto3" json:"resource_name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Service_Telemetry) Reset() { @@ -1970,9 +1998,9 @@ func (x *Service_Telemetry) GetResourceName() string { // Future parameters for the availability SLI. type BasicSli_AvailabilityCriteria struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *BasicSli_AvailabilityCriteria) Reset() { @@ -2007,13 +2035,12 @@ func (*BasicSli_AvailabilityCriteria) Descriptor() ([]byte, []int) { // Parameters for a latency threshold SLI. type BasicSli_LatencyCriteria struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Good service is defined to be the count of requests made to this service // that return in no more than `threshold`. - Threshold *durationpb.Duration `protobuf:"bytes,3,opt,name=threshold,proto3" json:"threshold,omitempty"` + Threshold *durationpb.Duration `protobuf:"bytes,3,opt,name=threshold,proto3" json:"threshold,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *BasicSli_LatencyCriteria) Reset() { @@ -2056,20 +2083,19 @@ func (x *BasicSli_LatencyCriteria) GetThreshold() *durationpb.Duration { // A `PerformanceThreshold` is used when each window is good when that window // has a sufficiently high `performance`. type WindowsBasedSli_PerformanceThreshold struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The means, either a request-based SLI or a basic SLI, by which to compute // performance over a window. // - // Types that are assignable to Type: + // Types that are valid to be assigned to Type: // // *WindowsBasedSli_PerformanceThreshold_Performance // *WindowsBasedSli_PerformanceThreshold_BasicSliPerformance Type isWindowsBasedSli_PerformanceThreshold_Type `protobuf_oneof:"type"` // If window `performance >= threshold`, the window is counted as good. - Threshold float64 `protobuf:"fixed64,2,opt,name=threshold,proto3" json:"threshold,omitempty"` + Threshold float64 `protobuf:"fixed64,2,opt,name=threshold,proto3" json:"threshold,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *WindowsBasedSli_PerformanceThreshold) Reset() { @@ -2102,23 +2128,27 @@ func (*WindowsBasedSli_PerformanceThreshold) Descriptor() ([]byte, []int) { return file_google_monitoring_v3_service_proto_rawDescGZIP(), []int{8, 0} } -func (m *WindowsBasedSli_PerformanceThreshold) GetType() isWindowsBasedSli_PerformanceThreshold_Type { - if m != nil { - return m.Type +func (x *WindowsBasedSli_PerformanceThreshold) GetType() isWindowsBasedSli_PerformanceThreshold_Type { + if x != nil { + return x.Type } return nil } func (x *WindowsBasedSli_PerformanceThreshold) GetPerformance() *RequestBasedSli { - if x, ok := x.GetType().(*WindowsBasedSli_PerformanceThreshold_Performance); ok { - return x.Performance + if x != nil { + if x, ok := x.Type.(*WindowsBasedSli_PerformanceThreshold_Performance); ok { + return x.Performance + } } return nil } func (x *WindowsBasedSli_PerformanceThreshold) GetBasicSliPerformance() *BasicSli { - if x, ok := x.GetType().(*WindowsBasedSli_PerformanceThreshold_BasicSliPerformance); ok { - return x.BasicSliPerformance + if x != nil { + if x, ok := x.Type.(*WindowsBasedSli_PerformanceThreshold_BasicSliPerformance); ok { + return x.BasicSliPerformance + } } return nil } @@ -2155,16 +2185,15 @@ func (*WindowsBasedSli_PerformanceThreshold_BasicSliPerformance) isWindowsBasedS // `TimeSeries` must have `ValueType = INT64` or `ValueType = DOUBLE` and // `MetricKind = GAUGE`. type WindowsBasedSli_MetricRange struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) // specifying the `TimeSeries` to use for evaluating window quality. TimeSeries string `protobuf:"bytes,1,opt,name=time_series,json=timeSeries,proto3" json:"time_series,omitempty"` // Range of values considered "good." For a one-sided range, set one bound // to an infinite value. - Range *Range `protobuf:"bytes,4,opt,name=range,proto3" json:"range,omitempty"` + Range *Range `protobuf:"bytes,4,opt,name=range,proto3" json:"range,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *WindowsBasedSli_MetricRange) Reset() { @@ -2213,400 +2242,160 @@ func (x *WindowsBasedSli_MetricRange) GetRange() *Range { var File_google_monitoring_v3_service_proto protoreflect.FileDescriptor -var file_google_monitoring_v3_service_proto_rawDesc = []byte{ - 0x0a, 0x22, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, - 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x74, - 0x79, 0x70, 0x65, 0x2f, 0x63, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72, 0x5f, 0x70, 0x65, 0x72, - 0x69, 0x6f, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa4, 0x16, 0x0a, 0x07, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 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, 0x21, - 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x3e, 0x0a, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x48, 0x00, 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x12, 0x48, 0x0a, 0x0a, 0x61, 0x70, 0x70, 0x5f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x48, 0x00, - 0x52, 0x09, 0x61, 0x70, 0x70, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x12, 0x57, 0x0a, 0x0f, 0x63, - 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, - 0x74, 0x73, 0x48, 0x00, 0x52, 0x0e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x6e, 0x64, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x73, 0x12, 0x51, 0x0a, 0x0d, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, - 0x69, 0x73, 0x74, 0x69, 0x6f, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x49, 0x73, 0x74, 0x69, 0x6f, 0x48, 0x00, 0x52, 0x0c, 0x63, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x49, 0x73, 0x74, 0x69, 0x6f, 0x12, 0x48, 0x0a, 0x0a, 0x6d, 0x65, 0x73, 0x68, 0x5f, - 0x69, 0x73, 0x74, 0x69, 0x6f, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x65, 0x73, 0x68, 0x49, - 0x73, 0x74, 0x69, 0x6f, 0x48, 0x00, 0x52, 0x09, 0x6d, 0x65, 0x73, 0x68, 0x49, 0x73, 0x74, 0x69, - 0x6f, 0x12, 0x6d, 0x0a, 0x17, 0x69, 0x73, 0x74, 0x69, 0x6f, 0x5f, 0x63, 0x61, 0x6e, 0x6f, 0x6e, - 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x0b, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x49, 0x73, 0x74, 0x69, 0x6f, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x00, 0x52, 0x15, 0x69, 0x73, 0x74, 0x69, 0x6f, - 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x12, 0x45, 0x0a, 0x09, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x72, 0x75, 0x6e, 0x18, 0x0c, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x52, 0x75, 0x6e, 0x48, 0x00, 0x52, 0x08, 0x63, - 0x6c, 0x6f, 0x75, 0x64, 0x52, 0x75, 0x6e, 0x12, 0x51, 0x0a, 0x0d, 0x67, 0x6b, 0x65, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x47, 0x6b, - 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x48, 0x00, 0x52, 0x0c, 0x67, 0x6b, - 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x4e, 0x0a, 0x0c, 0x67, 0x6b, - 0x65, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, - 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, - 0x47, 0x6b, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x00, 0x52, 0x0b, 0x67, - 0x6b, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x4b, 0x0a, 0x0b, 0x67, 0x6b, - 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x47, - 0x6b, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x67, 0x6b, 0x65, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4f, 0x0a, 0x0d, 0x62, 0x61, 0x73, 0x69, 0x63, - 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x42, 0x61, - 0x73, 0x69, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x0c, 0x62, 0x61, 0x73, 0x69, - 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x45, 0x0a, 0x09, 0x74, 0x65, 0x6c, 0x65, - 0x6d, 0x65, 0x74, 0x72, 0x79, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x65, 0x6c, 0x65, 0x6d, - 0x65, 0x74, 0x72, 0x79, 0x52, 0x09, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x12, - 0x4e, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x0e, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, - 0x08, 0x0a, 0x06, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x1a, 0x28, 0x0a, 0x09, 0x41, 0x70, 0x70, - 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x49, 0x64, 0x1a, 0x2a, 0x0a, 0x0e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x6e, 0x64, 0x70, - 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, - 0x9d, 0x01, 0x0a, 0x0c, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x73, 0x74, 0x69, 0x6f, - 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, - 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x2b, 0x0a, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x21, 0x0a, 0x0c, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x1a, - 0x76, 0x0a, 0x09, 0x4d, 0x65, 0x73, 0x68, 0x49, 0x73, 0x74, 0x69, 0x6f, 0x12, 0x19, 0x0a, 0x08, - 0x6d, 0x65, 0x73, 0x68, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x6d, 0x65, 0x73, 0x68, 0x55, 0x69, 0x64, 0x12, 0x2b, 0x0a, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x10, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x1a, 0x9f, 0x01, 0x0a, 0x15, 0x49, 0x73, 0x74, 0x69, - 0x6f, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x68, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x68, 0x55, 0x69, 0x64, 0x12, 0x3e, 0x0a, 0x1b, - 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x19, 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x2b, 0x0a, 0x11, - 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, - 0x61, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x49, 0x0a, 0x08, 0x43, 0x6c, 0x6f, - 0x75, 0x64, 0x52, 0x75, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x98, 0x01, 0x0a, 0x0c, 0x47, 0x6b, 0x65, 0x4e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x1a, - 0x8d, 0x02, 0x0a, 0x0b, 0x47, 0x6b, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x12, - 0x22, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x21, 0x0a, 0x0c, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x19, 0x74, 0x6f, 0x70, - 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, - 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x74, 0x6f, - 0x70, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x39, 0x0a, 0x19, 0x74, 0x6f, 0x70, 0x5f, 0x6c, 0x65, 0x76, 0x65, - 0x6c, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x74, 0x6f, 0x70, 0x4c, 0x65, 0x76, 0x65, - 0x6c, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x1a, - 0xb9, 0x01, 0x0a, 0x0a, 0x47, 0x6b, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x22, - 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, - 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, - 0x0a, 0x0c, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x1a, 0xd9, 0x01, 0x0a, 0x0c, - 0x42, 0x61, 0x73, 0x69, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x21, 0x0a, 0x0c, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x64, 0x0a, 0x0e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x69, 0x63, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, - 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x40, 0x0a, 0x12, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 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, 0x1a, 0x30, 0x0a, 0x09, 0x54, 0x65, 0x6c, 0x65, 0x6d, - 0x65, 0x74, 0x72, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x1a, 0x3d, 0x0a, 0x0f, 0x55, 0x73, 0x65, - 0x72, 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, 0xa7, 0x01, 0xea, 0x41, 0xa3, 0x01, 0x0a, - 0x21, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x25, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, - 0x7b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x7d, 0x12, 0x2f, 0x6f, 0x72, 0x67, 0x61, 0x6e, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, - 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2f, 0x7b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x7d, 0x12, 0x23, 0x66, 0x6f, 0x6c, 0x64, - 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x7d, 0x2f, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x7d, 0x12, - 0x01, 0x2a, 0x42, 0x0c, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, - 0x22, 0x82, 0x07, 0x0a, 0x15, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, - 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 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, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, - 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x63, 0x0a, 0x17, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x6f, - 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x49, 0x6e, 0x64, 0x69, 0x63, - 0x61, 0x74, 0x6f, 0x72, 0x52, 0x15, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, - 0x65, 0x6c, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x67, - 0x6f, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x04, 0x67, 0x6f, 0x61, 0x6c, 0x12, - 0x42, 0x0a, 0x0e, 0x72, 0x6f, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, - 0x64, 0x18, 0x05, 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, 0x0d, 0x72, 0x6f, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, - 0x69, 0x6f, 0x64, 0x12, 0x46, 0x0a, 0x0f, 0x63, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72, 0x5f, - 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x43, 0x61, 0x6c, 0x65, 0x6e, - 0x64, 0x61, 0x72, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x48, 0x00, 0x52, 0x0e, 0x63, 0x61, 0x6c, - 0x65, 0x6e, 0x64, 0x61, 0x72, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x5c, 0x0a, 0x0b, 0x75, - 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x3b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, - 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, - 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x55, 0x73, - 0x65, 0x72, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x75, - 0x73, 0x65, 0x72, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x55, 0x73, 0x65, - 0x72, 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, 0x22, 0x34, 0x0a, 0x04, 0x56, 0x69, 0x65, 0x77, - 0x12, 0x14, 0x0a, 0x10, 0x56, 0x49, 0x45, 0x57, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x55, 0x4c, 0x4c, 0x10, 0x02, - 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x58, 0x50, 0x4c, 0x49, 0x43, 0x49, 0x54, 0x10, 0x01, 0x3a, 0xca, - 0x02, 0xea, 0x41, 0xc6, 0x02, 0x0a, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, - 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x56, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, - 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x7d, 0x2f, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x69, 0x76, 0x65, 0x73, 0x2f, 0x7b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6c, 0x65, - 0x76, 0x65, 0x6c, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x7d, 0x12, 0x60, - 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6f, - 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x7d, 0x2f, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2f, 0x7b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, - 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x7d, - 0x12, 0x54, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x66, 0x6f, 0x6c, 0x64, 0x65, - 0x72, 0x7d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x7d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, - 0x65, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2f, 0x7b, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x69, 0x76, 0x65, 0x7d, 0x12, 0x01, 0x2a, 0x20, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x70, - 0x65, 0x72, 0x69, 0x6f, 0x64, 0x22, 0xfa, 0x01, 0x0a, 0x15, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x12, - 0x3d, 0x0a, 0x09, 0x62, 0x61, 0x73, 0x69, 0x63, 0x5f, 0x73, 0x6c, 0x69, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x42, 0x61, 0x73, 0x69, 0x63, 0x53, - 0x6c, 0x69, 0x48, 0x00, 0x52, 0x08, 0x62, 0x61, 0x73, 0x69, 0x63, 0x53, 0x6c, 0x69, 0x12, 0x4c, - 0x0a, 0x0d, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x62, 0x61, 0x73, 0x65, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x42, 0x61, 0x73, 0x65, 0x64, 0x53, 0x6c, 0x69, 0x48, 0x00, 0x52, 0x0c, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x61, 0x73, 0x65, 0x64, 0x12, 0x4c, 0x0a, 0x0d, - 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0x5f, 0x62, 0x61, 0x73, 0x65, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f, - 0x77, 0x73, 0x42, 0x61, 0x73, 0x65, 0x64, 0x53, 0x6c, 0x69, 0x48, 0x00, 0x52, 0x0c, 0x77, 0x69, - 0x6e, 0x64, 0x6f, 0x77, 0x73, 0x42, 0x61, 0x73, 0x65, 0x64, 0x42, 0x06, 0x0a, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x22, 0xf3, 0x02, 0x0a, 0x08, 0x42, 0x61, 0x73, 0x69, 0x63, 0x53, 0x6c, 0x69, 0x12, - 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x09, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x59, 0x0a, - 0x0c, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x42, 0x61, 0x73, 0x69, 0x63, - 0x53, 0x6c, 0x69, 0x2e, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, - 0x43, 0x72, 0x69, 0x74, 0x65, 0x72, 0x69, 0x61, 0x48, 0x00, 0x52, 0x0c, 0x61, 0x76, 0x61, 0x69, - 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x4a, 0x0a, 0x07, 0x6c, 0x61, 0x74, 0x65, - 0x6e, 0x63, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, - 0x2e, 0x42, 0x61, 0x73, 0x69, 0x63, 0x53, 0x6c, 0x69, 0x2e, 0x4c, 0x61, 0x74, 0x65, 0x6e, 0x63, - 0x79, 0x43, 0x72, 0x69, 0x74, 0x65, 0x72, 0x69, 0x61, 0x48, 0x00, 0x52, 0x07, 0x6c, 0x61, 0x74, - 0x65, 0x6e, 0x63, 0x79, 0x1a, 0x16, 0x0a, 0x14, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, - 0x6c, 0x69, 0x74, 0x79, 0x43, 0x72, 0x69, 0x74, 0x65, 0x72, 0x69, 0x61, 0x1a, 0x4a, 0x0a, 0x0f, - 0x4c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x43, 0x72, 0x69, 0x74, 0x65, 0x72, 0x69, 0x61, 0x12, - 0x37, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, 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, 0x09, 0x74, - 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x42, 0x0e, 0x0a, 0x0c, 0x73, 0x6c, 0x69, 0x5f, - 0x63, 0x72, 0x69, 0x74, 0x65, 0x72, 0x69, 0x61, 0x22, 0x2b, 0x0a, 0x05, 0x52, 0x61, 0x6e, 0x67, - 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, - 0x6d, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x61, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, - 0x52, 0x03, 0x6d, 0x61, 0x78, 0x22, 0xc2, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x42, 0x61, 0x73, 0x65, 0x64, 0x53, 0x6c, 0x69, 0x12, 0x51, 0x0a, 0x10, 0x67, 0x6f, 0x6f, - 0x64, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x53, - 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x48, 0x00, 0x52, 0x0e, 0x67, 0x6f, - 0x6f, 0x64, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x52, 0x0a, 0x10, - 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x75, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x69, - 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x75, 0x74, 0x48, 0x00, 0x52, - 0x0f, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x75, 0x74, - 0x42, 0x08, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x22, 0xa1, 0x01, 0x0a, 0x0f, 0x54, - 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x2e, - 0x0a, 0x13, 0x67, 0x6f, 0x6f, 0x64, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x66, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x67, 0x6f, 0x6f, - 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x2c, - 0x0a, 0x12, 0x62, 0x61, 0x64, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x66, 0x69, - 0x6c, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x62, 0x61, 0x64, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x14, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x66, 0x69, - 0x6c, 0x74, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x74, 0x6f, 0x74, 0x61, - 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x75, - 0x0a, 0x0f, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x75, - 0x74, 0x12, 0x2f, 0x0a, 0x13, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, - 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x69, 0x6c, 0x74, - 0x65, 0x72, 0x12, 0x31, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x05, - 0x72, 0x61, 0x6e, 0x67, 0x65, 0x22, 0xa4, 0x06, 0x0a, 0x0f, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, - 0x73, 0x42, 0x61, 0x73, 0x65, 0x64, 0x53, 0x6c, 0x69, 0x12, 0x35, 0x0a, 0x16, 0x67, 0x6f, 0x6f, - 0x64, 0x5f, 0x62, 0x61, 0x64, 0x5f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x66, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x13, 0x67, 0x6f, 0x6f, - 0x64, 0x42, 0x61, 0x64, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, - 0x12, 0x79, 0x0a, 0x1a, 0x67, 0x6f, 0x6f, 0x64, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x57, 0x69, 0x6e, 0x64, - 0x6f, 0x77, 0x73, 0x42, 0x61, 0x73, 0x65, 0x64, 0x53, 0x6c, 0x69, 0x2e, 0x50, 0x65, 0x72, 0x66, - 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, - 0x48, 0x00, 0x52, 0x17, 0x67, 0x6f, 0x6f, 0x64, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x61, 0x74, - 0x69, 0x6f, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x64, 0x0a, 0x14, 0x6d, - 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x6d, 0x65, 0x61, 0x6e, 0x5f, 0x69, 0x6e, 0x5f, 0x72, 0x61, - 0x6e, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, - 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0x42, 0x61, 0x73, 0x65, 0x64, 0x53, 0x6c, 0x69, - 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x00, 0x52, 0x11, - 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x4d, 0x65, 0x61, 0x6e, 0x49, 0x6e, 0x52, 0x61, 0x6e, 0x67, - 0x65, 0x12, 0x62, 0x0a, 0x13, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x73, 0x75, 0x6d, 0x5f, - 0x69, 0x6e, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0x42, 0x61, 0x73, - 0x65, 0x64, 0x53, 0x6c, 0x69, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x61, 0x6e, 0x67, - 0x65, 0x48, 0x00, 0x52, 0x10, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x75, 0x6d, 0x49, 0x6e, - 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x3e, 0x0a, 0x0d, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, - 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 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, 0x0c, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x50, - 0x65, 0x72, 0x69, 0x6f, 0x64, 0x1a, 0xdd, 0x01, 0x0a, 0x14, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, - 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x49, - 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x42, 0x61, 0x73, 0x65, 0x64, 0x53, 0x6c, 0x69, 0x48, 0x00, 0x52, 0x0b, 0x70, 0x65, - 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x54, 0x0a, 0x15, 0x62, 0x61, 0x73, - 0x69, 0x63, 0x5f, 0x73, 0x6c, 0x69, 0x5f, 0x70, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, - 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, - 0x42, 0x61, 0x73, 0x69, 0x63, 0x53, 0x6c, 0x69, 0x48, 0x00, 0x52, 0x13, 0x62, 0x61, 0x73, 0x69, - 0x63, 0x53, 0x6c, 0x69, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x12, - 0x1c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x01, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x42, 0x06, 0x0a, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x1a, 0x61, 0x0a, 0x0b, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, - 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, - 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x53, - 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x31, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x61, 0x6e, 0x67, - 0x65, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x12, 0x0a, 0x10, 0x77, 0x69, 0x6e, 0x64, - 0x6f, 0x77, 0x5f, 0x63, 0x72, 0x69, 0x74, 0x65, 0x72, 0x69, 0x6f, 0x6e, 0x42, 0xd1, 0x01, 0x0a, - 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x42, 0x16, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x33, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x70, 0x62, 0x3b, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, - 0x72, 0x69, 0x6e, 0x67, 0x70, 0x62, 0xaa, 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, - 0x2e, 0x56, 0x33, 0xca, 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f, - 0x75, 0x64, 0x5c, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x33, - 0xea, 0x02, 0x1d, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x3a, 0x3a, 0x43, 0x6c, 0x6f, 0x75, 0x64, - 0x3a, 0x3a, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x33, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_google_monitoring_v3_service_proto_rawDesc = "" + + "\n" + + "\"google/monitoring/v3/service.proto\x12\x14google.monitoring.v3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a!google/type/calendar_period.proto\"\xa4\x16\n" + + "\aService\x12\x17\n" + + "\x04name\x18\x01 \x01(\tB\x03\xe0A\bR\x04name\x12!\n" + + "\fdisplay_name\x18\x02 \x01(\tR\vdisplayName\x12>\n" + + "\x06custom\x18\x06 \x01(\v2$.google.monitoring.v3.Service.CustomH\x00R\x06custom\x12H\n" + + "\n" + + "app_engine\x18\a \x01(\v2'.google.monitoring.v3.Service.AppEngineH\x00R\tappEngine\x12W\n" + + "\x0fcloud_endpoints\x18\b \x01(\v2,.google.monitoring.v3.Service.CloudEndpointsH\x00R\x0ecloudEndpoints\x12Q\n" + + "\rcluster_istio\x18\t \x01(\v2*.google.monitoring.v3.Service.ClusterIstioH\x00R\fclusterIstio\x12H\n" + + "\n" + + "mesh_istio\x18\n" + + " \x01(\v2'.google.monitoring.v3.Service.MeshIstioH\x00R\tmeshIstio\x12m\n" + + "\x17istio_canonical_service\x18\v \x01(\v23.google.monitoring.v3.Service.IstioCanonicalServiceH\x00R\x15istioCanonicalService\x12E\n" + + "\tcloud_run\x18\f \x01(\v2&.google.monitoring.v3.Service.CloudRunH\x00R\bcloudRun\x12Q\n" + + "\rgke_namespace\x18\x0f \x01(\v2*.google.monitoring.v3.Service.GkeNamespaceH\x00R\fgkeNamespace\x12N\n" + + "\fgke_workload\x18\x10 \x01(\v2).google.monitoring.v3.Service.GkeWorkloadH\x00R\vgkeWorkload\x12K\n" + + "\vgke_service\x18\x11 \x01(\v2(.google.monitoring.v3.Service.GkeServiceH\x00R\n" + + "gkeService\x12O\n" + + "\rbasic_service\x18\x13 \x01(\v2*.google.monitoring.v3.Service.BasicServiceR\fbasicService\x12E\n" + + "\ttelemetry\x18\r \x01(\v2'.google.monitoring.v3.Service.TelemetryR\ttelemetry\x12N\n" + + "\vuser_labels\x18\x0e \x03(\v2-.google.monitoring.v3.Service.UserLabelsEntryR\n" + + "userLabels\x1a\b\n" + + "\x06Custom\x1a(\n" + + "\tAppEngine\x12\x1b\n" + + "\tmodule_id\x18\x01 \x01(\tR\bmoduleId\x1a*\n" + + "\x0eCloudEndpoints\x12\x18\n" + + "\aservice\x18\x01 \x01(\tR\aservice\x1a\x9d\x01\n" + + "\fClusterIstio\x12\x1a\n" + + "\blocation\x18\x01 \x01(\tR\blocation\x12!\n" + + "\fcluster_name\x18\x02 \x01(\tR\vclusterName\x12+\n" + + "\x11service_namespace\x18\x03 \x01(\tR\x10serviceNamespace\x12!\n" + + "\fservice_name\x18\x04 \x01(\tR\vserviceName\x1av\n" + + "\tMeshIstio\x12\x19\n" + + "\bmesh_uid\x18\x01 \x01(\tR\ameshUid\x12+\n" + + "\x11service_namespace\x18\x03 \x01(\tR\x10serviceNamespace\x12!\n" + + "\fservice_name\x18\x04 \x01(\tR\vserviceName\x1a\x9f\x01\n" + + "\x15IstioCanonicalService\x12\x19\n" + + "\bmesh_uid\x18\x01 \x01(\tR\ameshUid\x12>\n" + + "\x1bcanonical_service_namespace\x18\x03 \x01(\tR\x19canonicalServiceNamespace\x12+\n" + + "\x11canonical_service\x18\x04 \x01(\tR\x10canonicalService\x1aI\n" + + "\bCloudRun\x12!\n" + + "\fservice_name\x18\x01 \x01(\tR\vserviceName\x12\x1a\n" + + "\blocation\x18\x02 \x01(\tR\blocation\x1a\x98\x01\n" + + "\fGkeNamespace\x12\"\n" + + "\n" + + "project_id\x18\x01 \x01(\tB\x03\xe0A\x03R\tprojectId\x12\x1a\n" + + "\blocation\x18\x02 \x01(\tR\blocation\x12!\n" + + "\fcluster_name\x18\x03 \x01(\tR\vclusterName\x12%\n" + + "\x0enamespace_name\x18\x04 \x01(\tR\rnamespaceName\x1a\x8d\x02\n" + + "\vGkeWorkload\x12\"\n" + + "\n" + + "project_id\x18\x01 \x01(\tB\x03\xe0A\x03R\tprojectId\x12\x1a\n" + + "\blocation\x18\x02 \x01(\tR\blocation\x12!\n" + + "\fcluster_name\x18\x03 \x01(\tR\vclusterName\x12%\n" + + "\x0enamespace_name\x18\x04 \x01(\tR\rnamespaceName\x129\n" + + "\x19top_level_controller_type\x18\x05 \x01(\tR\x16topLevelControllerType\x129\n" + + "\x19top_level_controller_name\x18\x06 \x01(\tR\x16topLevelControllerName\x1a\xb9\x01\n" + + "\n" + + "GkeService\x12\"\n" + + "\n" + + "project_id\x18\x01 \x01(\tB\x03\xe0A\x03R\tprojectId\x12\x1a\n" + + "\blocation\x18\x02 \x01(\tR\blocation\x12!\n" + + "\fcluster_name\x18\x03 \x01(\tR\vclusterName\x12%\n" + + "\x0enamespace_name\x18\x04 \x01(\tR\rnamespaceName\x12!\n" + + "\fservice_name\x18\x05 \x01(\tR\vserviceName\x1a\xd9\x01\n" + + "\fBasicService\x12!\n" + + "\fservice_type\x18\x01 \x01(\tR\vserviceType\x12d\n" + + "\x0eservice_labels\x18\x02 \x03(\v2=.google.monitoring.v3.Service.BasicService.ServiceLabelsEntryR\rserviceLabels\x1a@\n" + + "\x12ServiceLabelsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1a0\n" + + "\tTelemetry\x12#\n" + + "\rresource_name\x18\x01 \x01(\tR\fresourceName\x1a=\n" + + "\x0fUserLabelsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01:\xa7\x01\xeaA\xa3\x01\n" + + "!monitoring.googleapis.com/Service\x12%projects/{project}/services/{service}\x12/organizations/{organization}/services/{service}\x12#folders/{folder}/services/{service}\x12\x01*B\f\n" + + "\n" + + "identifier\"\x82\a\n" + + "\x15ServiceLevelObjective\x12\x17\n" + + "\x04name\x18\x01 \x01(\tB\x03\xe0A\bR\x04name\x12!\n" + + "\fdisplay_name\x18\v \x01(\tR\vdisplayName\x12c\n" + + "\x17service_level_indicator\x18\x03 \x01(\v2+.google.monitoring.v3.ServiceLevelIndicatorR\x15serviceLevelIndicator\x12\x12\n" + + "\x04goal\x18\x04 \x01(\x01R\x04goal\x12B\n" + + "\x0erolling_period\x18\x05 \x01(\v2\x19.google.protobuf.DurationH\x00R\rrollingPeriod\x12F\n" + + "\x0fcalendar_period\x18\x06 \x01(\x0e2\x1b.google.type.CalendarPeriodH\x00R\x0ecalendarPeriod\x12\\\n" + + "\vuser_labels\x18\f \x03(\v2;.google.monitoring.v3.ServiceLevelObjective.UserLabelsEntryR\n" + + "userLabels\x1a=\n" + + "\x0fUserLabelsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"4\n" + + "\x04View\x12\x14\n" + + "\x10VIEW_UNSPECIFIED\x10\x00\x12\b\n" + + "\x04FULL\x10\x02\x12\f\n" + + "\bEXPLICIT\x10\x01:\xca\x02\xeaA\xc6\x02\n" + + "/monitoring.googleapis.com/ServiceLevelObjective\x12Vprojects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}\x12`organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}\x12Tfolders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}\x12\x01* \x01B\b\n" + + "\x06period\"\xfa\x01\n" + + "\x15ServiceLevelIndicator\x12=\n" + + "\tbasic_sli\x18\x04 \x01(\v2\x1e.google.monitoring.v3.BasicSliH\x00R\bbasicSli\x12L\n" + + "\rrequest_based\x18\x01 \x01(\v2%.google.monitoring.v3.RequestBasedSliH\x00R\frequestBased\x12L\n" + + "\rwindows_based\x18\x02 \x01(\v2%.google.monitoring.v3.WindowsBasedSliH\x00R\fwindowsBasedB\x06\n" + + "\x04type\"\xf3\x02\n" + + "\bBasicSli\x12\x16\n" + + "\x06method\x18\a \x03(\tR\x06method\x12\x1a\n" + + "\blocation\x18\b \x03(\tR\blocation\x12\x18\n" + + "\aversion\x18\t \x03(\tR\aversion\x12Y\n" + + "\favailability\x18\x02 \x01(\v23.google.monitoring.v3.BasicSli.AvailabilityCriteriaH\x00R\favailability\x12J\n" + + "\alatency\x18\x03 \x01(\v2..google.monitoring.v3.BasicSli.LatencyCriteriaH\x00R\alatency\x1a\x16\n" + + "\x14AvailabilityCriteria\x1aJ\n" + + "\x0fLatencyCriteria\x127\n" + + "\tthreshold\x18\x03 \x01(\v2\x19.google.protobuf.DurationR\tthresholdB\x0e\n" + + "\fsli_criteria\"+\n" + + "\x05Range\x12\x10\n" + + "\x03min\x18\x01 \x01(\x01R\x03min\x12\x10\n" + + "\x03max\x18\x02 \x01(\x01R\x03max\"\xc2\x01\n" + + "\x0fRequestBasedSli\x12Q\n" + + "\x10good_total_ratio\x18\x01 \x01(\v2%.google.monitoring.v3.TimeSeriesRatioH\x00R\x0egoodTotalRatio\x12R\n" + + "\x10distribution_cut\x18\x03 \x01(\v2%.google.monitoring.v3.DistributionCutH\x00R\x0fdistributionCutB\b\n" + + "\x06method\"\xa1\x01\n" + + "\x0fTimeSeriesRatio\x12.\n" + + "\x13good_service_filter\x18\x04 \x01(\tR\x11goodServiceFilter\x12,\n" + + "\x12bad_service_filter\x18\x05 \x01(\tR\x10badServiceFilter\x120\n" + + "\x14total_service_filter\x18\x06 \x01(\tR\x12totalServiceFilter\"u\n" + + "\x0fDistributionCut\x12/\n" + + "\x13distribution_filter\x18\x04 \x01(\tR\x12distributionFilter\x121\n" + + "\x05range\x18\x05 \x01(\v2\x1b.google.monitoring.v3.RangeR\x05range\"\xa4\x06\n" + + "\x0fWindowsBasedSli\x125\n" + + "\x16good_bad_metric_filter\x18\x05 \x01(\tH\x00R\x13goodBadMetricFilter\x12y\n" + + "\x1agood_total_ratio_threshold\x18\x02 \x01(\v2:.google.monitoring.v3.WindowsBasedSli.PerformanceThresholdH\x00R\x17goodTotalRatioThreshold\x12d\n" + + "\x14metric_mean_in_range\x18\x06 \x01(\v21.google.monitoring.v3.WindowsBasedSli.MetricRangeH\x00R\x11metricMeanInRange\x12b\n" + + "\x13metric_sum_in_range\x18\a \x01(\v21.google.monitoring.v3.WindowsBasedSli.MetricRangeH\x00R\x10metricSumInRange\x12>\n" + + "\rwindow_period\x18\x04 \x01(\v2\x19.google.protobuf.DurationR\fwindowPeriod\x1a\xdd\x01\n" + + "\x14PerformanceThreshold\x12I\n" + + "\vperformance\x18\x01 \x01(\v2%.google.monitoring.v3.RequestBasedSliH\x00R\vperformance\x12T\n" + + "\x15basic_sli_performance\x18\x03 \x01(\v2\x1e.google.monitoring.v3.BasicSliH\x00R\x13basicSliPerformance\x12\x1c\n" + + "\tthreshold\x18\x02 \x01(\x01R\tthresholdB\x06\n" + + "\x04type\x1aa\n" + + "\vMetricRange\x12\x1f\n" + + "\vtime_series\x18\x01 \x01(\tR\n" + + "timeSeries\x121\n" + + "\x05range\x18\x04 \x01(\v2\x1b.google.monitoring.v3.RangeR\x05rangeB\x12\n" + + "\x10window_criterionB\xd1\x01\n" + + "\x18com.google.monitoring.v3B\x16ServiceMonitoringProtoP\x01ZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpb\xaa\x02\x1aGoogle.Cloud.Monitoring.V3\xca\x02\x1aGoogle\\Cloud\\Monitoring\\V3\xea\x02\x1dGoogle::Cloud::Monitoring::V3b\x06proto3" var ( file_google_monitoring_v3_service_proto_rawDescOnce sync.Once - file_google_monitoring_v3_service_proto_rawDescData = file_google_monitoring_v3_service_proto_rawDesc + file_google_monitoring_v3_service_proto_rawDescData []byte ) func file_google_monitoring_v3_service_proto_rawDescGZIP() []byte { file_google_monitoring_v3_service_proto_rawDescOnce.Do(func() { - file_google_monitoring_v3_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_monitoring_v3_service_proto_rawDescData) + file_google_monitoring_v3_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_service_proto_rawDesc), len(file_google_monitoring_v3_service_proto_rawDesc))) }) return file_google_monitoring_v3_service_proto_rawDescData } @@ -2736,7 +2525,7 @@ func file_google_monitoring_v3_service_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_monitoring_v3_service_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_service_proto_rawDesc), len(file_google_monitoring_v3_service_proto_rawDesc)), NumEnums: 1, NumMessages: 28, NumExtensions: 0, @@ -2748,7 +2537,6 @@ func file_google_monitoring_v3_service_proto_init() { MessageInfos: file_google_monitoring_v3_service_proto_msgTypes, }.Build() File_google_monitoring_v3_service_proto = out.File - file_google_monitoring_v3_service_proto_rawDesc = nil file_google_monitoring_v3_service_proto_goTypes = nil file_google_monitoring_v3_service_proto_depIdxs = nil } diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service.pb.go index f08dfe56ad3..446fa68e1a2 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service.pb.go @@ -14,20 +14,22 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 -// protoc v4.25.7 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: google/monitoring/v3/service_service.proto package monitoringpb import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" - reflect "reflect" - sync "sync" ) const ( @@ -39,10 +41,7 @@ const ( // The `CreateService` request. type CreateServiceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. Resource // [name](https://cloud.google.com/monitoring/api/v3#project_name) of the // parent Metrics Scope. The format is: @@ -53,7 +52,9 @@ type CreateServiceRequest struct { // generated instead. Must match the pattern `[a-z0-9\-]+` ServiceId string `protobuf:"bytes,3,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` // Required. The `Service` to create. - Service *Service `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"` + Service *Service `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *CreateServiceRequest) Reset() { @@ -109,14 +110,13 @@ func (x *CreateServiceRequest) GetService() *Service { // The `GetService` request. type GetServiceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. Resource name of the `Service`. The format is: // // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GetServiceRequest) Reset() { @@ -158,10 +158,7 @@ func (x *GetServiceRequest) GetName() string { // The `ListServices` request. type ListServicesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. Resource name of the parent containing the listed services, // either a [project](https://cloud.google.com/monitoring/api/v3#project_name) // or a Monitoring Metrics Scope. The formats are: @@ -194,7 +191,9 @@ type ListServicesRequest struct { // If this field is not empty then it must contain the `nextPageToken` value // returned by a previous call to this method. Using this field causes the // method to return additional results from the previous method call. - PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ListServicesRequest) Reset() { @@ -257,16 +256,15 @@ func (x *ListServicesRequest) GetPageToken() string { // The `ListServices` response. type ListServicesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The `Service`s matching the specified filter. Services []*Service `protobuf:"bytes,1,rep,name=services,proto3" json:"services,omitempty"` // If there are more results than have been returned, then this field is set // to a non-empty value. To see the additional results, // use that value as `page_token` in the next call to this method. NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ListServicesResponse) Reset() { @@ -315,15 +313,14 @@ func (x *ListServicesResponse) GetNextPageToken() string { // The `UpdateService` request. type UpdateServiceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The `Service` to draw updates from. // The given `name` specifies the resource to update. Service *Service `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` // A set of field paths defining which fields to use for the update. - UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` + UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *UpdateServiceRequest) Reset() { @@ -372,14 +369,13 @@ func (x *UpdateServiceRequest) GetUpdateMask() *fieldmaskpb.FieldMask { // The `DeleteService` request. type DeleteServiceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. Resource name of the `Service` to delete. The format is: // // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *DeleteServiceRequest) Reset() { @@ -421,10 +417,7 @@ func (x *DeleteServiceRequest) GetName() string { // The `CreateServiceLevelObjective` request. type CreateServiceLevelObjectiveRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. Resource name of the parent `Service`. The format is: // // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] @@ -437,6 +430,8 @@ type CreateServiceLevelObjectiveRequest struct { // The provided `name` will be respected if no `ServiceLevelObjective` exists // with this name. ServiceLevelObjective *ServiceLevelObjective `protobuf:"bytes,2,opt,name=service_level_objective,json=serviceLevelObjective,proto3" json:"service_level_objective,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *CreateServiceLevelObjectiveRequest) Reset() { @@ -492,10 +487,7 @@ func (x *CreateServiceLevelObjectiveRequest) GetServiceLevelObjective() *Service // The `GetServiceLevelObjective` request. type GetServiceLevelObjectiveRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. Resource name of the `ServiceLevelObjective` to get. The format // is: // @@ -505,7 +497,9 @@ type GetServiceLevelObjectiveRequest struct { // `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the // `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the // `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. - View ServiceLevelObjective_View `protobuf:"varint,2,opt,name=view,proto3,enum=google.monitoring.v3.ServiceLevelObjective_View" json:"view,omitempty"` + View ServiceLevelObjective_View `protobuf:"varint,2,opt,name=view,proto3,enum=google.monitoring.v3.ServiceLevelObjective_View" json:"view,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GetServiceLevelObjectiveRequest) Reset() { @@ -554,10 +548,7 @@ func (x *GetServiceLevelObjectiveRequest) GetView() ServiceLevelObjective_View { // The `ListServiceLevelObjectives` request. type ListServiceLevelObjectivesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. Resource name of the parent containing the listed SLOs, either a // project or a Monitoring Metrics Scope. The formats are: // @@ -577,7 +568,9 @@ type ListServiceLevelObjectivesRequest struct { // `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the // `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the // `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. - View ServiceLevelObjective_View `protobuf:"varint,5,opt,name=view,proto3,enum=google.monitoring.v3.ServiceLevelObjective_View" json:"view,omitempty"` + View ServiceLevelObjective_View `protobuf:"varint,5,opt,name=view,proto3,enum=google.monitoring.v3.ServiceLevelObjective_View" json:"view,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ListServiceLevelObjectivesRequest) Reset() { @@ -647,16 +640,15 @@ func (x *ListServiceLevelObjectivesRequest) GetView() ServiceLevelObjective_View // The `ListServiceLevelObjectives` response. type ListServiceLevelObjectivesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The `ServiceLevelObjective`s matching the specified filter. ServiceLevelObjectives []*ServiceLevelObjective `protobuf:"bytes,1,rep,name=service_level_objectives,json=serviceLevelObjectives,proto3" json:"service_level_objectives,omitempty"` // If there are more results than have been returned, then this field is set // to a non-empty value. To see the additional results, // use that value as `page_token` in the next call to this method. NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ListServiceLevelObjectivesResponse) Reset() { @@ -705,15 +697,14 @@ func (x *ListServiceLevelObjectivesResponse) GetNextPageToken() string { // The `UpdateServiceLevelObjective` request. type UpdateServiceLevelObjectiveRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The `ServiceLevelObjective` to draw updates from. // The given `name` specifies the resource to update. ServiceLevelObjective *ServiceLevelObjective `protobuf:"bytes,1,opt,name=service_level_objective,json=serviceLevelObjective,proto3" json:"service_level_objective,omitempty"` // A set of field paths defining which fields to use for the update. - UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` + UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *UpdateServiceLevelObjectiveRequest) Reset() { @@ -762,15 +753,14 @@ func (x *UpdateServiceLevelObjectiveRequest) GetUpdateMask() *fieldmaskpb.FieldM // The `DeleteServiceLevelObjective` request. type DeleteServiceLevelObjectiveRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. Resource name of the `ServiceLevelObjective` to delete. The // format is: // // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *DeleteServiceLevelObjectiveRequest) Reset() { @@ -812,302 +802,82 @@ func (x *DeleteServiceLevelObjectiveRequest) GetName() string { var File_google_monitoring_v3_service_service_proto protoreflect.FileDescriptor -var file_google_monitoring_v3_service_service_proto_rawDesc = []byte{ - 0x0a, 0x2a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x33, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, - 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, - 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, - 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb6, 0x01, 0x0a, 0x14, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x41, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x29, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x23, 0x12, 0x21, 0x6d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x06, 0x70, 0x61, - 0x72, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, - 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x49, 0x64, 0x12, 0x3c, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x22, 0x52, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x29, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x23, 0x0a, 0x21, 0x6d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, - 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xac, 0x01, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, - 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x29, 0xe0, - 0x41, 0x02, 0xfa, 0x41, 0x23, 0x12, 0x21, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, - 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, - 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 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, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x79, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x08, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x08, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 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, - 0x91, 0x01, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, - 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x07, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x5f, 0x6d, 0x61, 0x73, 0x6b, 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, 0x46, 0x69, - 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, - 0x61, 0x73, 0x6b, 0x22, 0x55, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x29, 0xe0, 0x41, 0x02, 0xfa, 0x41, - 0x23, 0x0a, 0x21, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x8e, 0x02, 0x0a, 0x22, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, - 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x41, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x29, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x23, 0x0a, 0x21, 0x6d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x06, 0x70, 0x61, - 0x72, 0x65, 0x6e, 0x74, 0x12, 0x3b, 0x0a, 0x1a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, - 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, - 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x49, - 0x64, 0x12, 0x68, 0x0a, 0x17, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6c, 0x65, 0x76, - 0x65, 0x6c, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x42, - 0x03, 0xe0, 0x41, 0x02, 0x52, 0x15, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, - 0x65, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x22, 0xb4, 0x01, 0x0a, 0x1f, - 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x4b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x37, 0xe0, - 0x41, 0x02, 0xfa, 0x41, 0x31, 0x0a, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, - 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x44, 0x0a, 0x04, - 0x76, 0x69, 0x65, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, - 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x52, 0x04, 0x76, 0x69, - 0x65, 0x77, 0x22, 0x80, 0x02, 0x0a, 0x21, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, - 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x29, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x23, - 0x0a, 0x21, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, - 0x18, 0x03, 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, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, - 0x44, 0x0a, 0x04, 0x76, 0x69, 0x65, 0x77, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, - 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, - 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x52, - 0x04, 0x76, 0x69, 0x65, 0x77, 0x22, 0xb3, 0x01, 0x0a, 0x22, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x69, 0x76, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x18, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, - 0x65, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x52, 0x16, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, - 0x76, 0x65, 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, 0xcb, 0x01, 0x0a, 0x22, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, - 0x65, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x68, 0x0a, 0x17, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6c, 0x65, - 0x76, 0x65, 0x6c, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, - 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x15, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, - 0x76, 0x65, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x3b, 0x0a, 0x0b, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 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, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x71, 0x0a, 0x22, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x4b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x37, 0xe0, - 0x41, 0x02, 0xfa, 0x41, 0x31, 0x0a, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, - 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x32, 0xea, 0x0f, 0x0a, - 0x18, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x97, 0x01, 0x0a, 0x0d, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x33, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x3b, 0xda, 0x41, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e, - 0x74, 0x2c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x3a, - 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x19, 0x2f, 0x76, 0x33, 0x2f, 0x7b, 0x70, - 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x2a, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x12, 0x7e, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, - 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x28, 0xda, 0x41, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x76, 0x33, 0x2f, 0x7b, 0x6e, - 0x61, 0x6d, 0x65, 0x3d, 0x2a, 0x2f, 0x2a, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2f, 0x2a, 0x7d, 0x12, 0x91, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x12, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0xda, 0x41, 0x06, - 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x76, - 0x33, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x2a, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x98, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, - 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x22, 0x3c, 0xda, 0x41, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x3a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x32, - 0x21, 0x2f, 0x76, 0x33, 0x2f, 0x7b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x6e, 0x61, - 0x6d, 0x65, 0x3d, 0x2a, 0x2f, 0x2a, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, - 0x2a, 0x7d, 0x12, 0x7d, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 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, 0x28, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x2a, 0x19, 0x2f, 0x76, 0x33, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, - 0x65, 0x3d, 0x2a, 0x2f, 0x2a, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x2a, - 0x7d, 0x12, 0xfa, 0x01, 0x0a, 0x1b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, - 0x65, 0x12, 0x38, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x22, 0x74, 0xda, 0x41, 0x1e, 0x70, 0x61, 0x72, - 0x65, 0x6e, 0x74, 0x2c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6c, 0x65, 0x76, 0x65, - 0x6c, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x4d, 0x3a, 0x17, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, - 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x22, 0x32, 0x2f, 0x76, 0x33, 0x2f, - 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x2a, 0x2f, 0x2a, 0x2f, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, - 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x73, 0x12, 0xc1, - 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, - 0x65, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x35, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, - 0x65, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x22, - 0x41, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x12, 0x32, - 0x2f, 0x76, 0x33, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x2a, 0x2f, 0x2a, 0x2f, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2f, - 0x2a, 0x7d, 0x12, 0xd4, 0x01, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, - 0x73, 0x12, 0x37, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, - 0x33, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, - 0x65, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x12, 0x32, 0x2f, 0x76, 0x33, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, - 0x6e, 0x74, 0x3d, 0x2a, 0x2f, 0x2a, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, - 0x2a, 0x7d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x73, 0x12, 0x8c, 0x02, 0x0a, 0x1b, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x38, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, - 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, - 0x76, 0x65, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, - 0x22, 0x85, 0x01, 0xda, 0x41, 0x17, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6c, 0x65, - 0x76, 0x65, 0x6c, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x65, 0x3a, 0x17, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6c, 0x65, 0x76, - 0x65, 0x6c, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x32, 0x4a, 0x2f, 0x76, - 0x33, 0x2f, 0x7b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, - 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, - 0x2a, 0x2f, 0x2a, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x69, 0x76, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xb2, 0x01, 0x0a, 0x1b, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x38, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, - 0x65, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 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, 0x41, 0xda, 0x41, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x2a, 0x32, 0x2f, 0x76, 0x33, 0x2f, 0x7b, - 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x2a, 0x2f, 0x2a, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2f, 0x2a, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x1a, 0xa9, 0x01, - 0xca, 0x41, 0x19, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0xd2, 0x41, 0x89, 0x01, - 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, 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, 0x6d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 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, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, - 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x42, 0xd8, 0x01, 0x0a, 0x18, 0x63, 0x6f, - 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x42, 0x1d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x33, 0x2f, 0x76, 0x32, - 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x70, 0x62, 0x3b, 0x6d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x70, 0x62, 0xaa, 0x02, 0x1a, 0x47, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, - 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x5c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, - 0x67, 0x5c, 0x56, 0x33, 0xea, 0x02, 0x1d, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x3a, 0x3a, 0x43, - 0x6c, 0x6f, 0x75, 0x64, 0x3a, 0x3a, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, - 0x3a, 0x3a, 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_google_monitoring_v3_service_service_proto_rawDesc = "" + + "\n" + + "*google/monitoring/v3/service_service.proto\x12\x14google.monitoring.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\"google/monitoring/v3/service.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xb6\x01\n" + + "\x14CreateServiceRequest\x12A\n" + + "\x06parent\x18\x01 \x01(\tB)\xe0A\x02\xfaA#\x12!monitoring.googleapis.com/ServiceR\x06parent\x12\x1d\n" + + "\n" + + "service_id\x18\x03 \x01(\tR\tserviceId\x12<\n" + + "\aservice\x18\x02 \x01(\v2\x1d.google.monitoring.v3.ServiceB\x03\xe0A\x02R\aservice\"R\n" + + "\x11GetServiceRequest\x12=\n" + + "\x04name\x18\x01 \x01(\tB)\xe0A\x02\xfaA#\n" + + "!monitoring.googleapis.com/ServiceR\x04name\"\xac\x01\n" + + "\x13ListServicesRequest\x12A\n" + + "\x06parent\x18\x01 \x01(\tB)\xe0A\x02\xfaA#\x12!monitoring.googleapis.com/ServiceR\x06parent\x12\x16\n" + + "\x06filter\x18\x02 \x01(\tR\x06filter\x12\x1b\n" + + "\tpage_size\x18\x03 \x01(\x05R\bpageSize\x12\x1d\n" + + "\n" + + "page_token\x18\x04 \x01(\tR\tpageToken\"y\n" + + "\x14ListServicesResponse\x129\n" + + "\bservices\x18\x01 \x03(\v2\x1d.google.monitoring.v3.ServiceR\bservices\x12&\n" + + "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\"\x91\x01\n" + + "\x14UpdateServiceRequest\x12<\n" + + "\aservice\x18\x01 \x01(\v2\x1d.google.monitoring.v3.ServiceB\x03\xe0A\x02R\aservice\x12;\n" + + "\vupdate_mask\x18\x02 \x01(\v2\x1a.google.protobuf.FieldMaskR\n" + + "updateMask\"U\n" + + "\x14DeleteServiceRequest\x12=\n" + + "\x04name\x18\x01 \x01(\tB)\xe0A\x02\xfaA#\n" + + "!monitoring.googleapis.com/ServiceR\x04name\"\x8e\x02\n" + + "\"CreateServiceLevelObjectiveRequest\x12A\n" + + "\x06parent\x18\x01 \x01(\tB)\xe0A\x02\xfaA#\n" + + "!monitoring.googleapis.com/ServiceR\x06parent\x12;\n" + + "\x1aservice_level_objective_id\x18\x03 \x01(\tR\x17serviceLevelObjectiveId\x12h\n" + + "\x17service_level_objective\x18\x02 \x01(\v2+.google.monitoring.v3.ServiceLevelObjectiveB\x03\xe0A\x02R\x15serviceLevelObjective\"\xb4\x01\n" + + "\x1fGetServiceLevelObjectiveRequest\x12K\n" + + "\x04name\x18\x01 \x01(\tB7\xe0A\x02\xfaA1\n" + + "/monitoring.googleapis.com/ServiceLevelObjectiveR\x04name\x12D\n" + + "\x04view\x18\x02 \x01(\x0e20.google.monitoring.v3.ServiceLevelObjective.ViewR\x04view\"\x80\x02\n" + + "!ListServiceLevelObjectivesRequest\x12A\n" + + "\x06parent\x18\x01 \x01(\tB)\xe0A\x02\xfaA#\n" + + "!monitoring.googleapis.com/ServiceR\x06parent\x12\x16\n" + + "\x06filter\x18\x02 \x01(\tR\x06filter\x12\x1b\n" + + "\tpage_size\x18\x03 \x01(\x05R\bpageSize\x12\x1d\n" + + "\n" + + "page_token\x18\x04 \x01(\tR\tpageToken\x12D\n" + + "\x04view\x18\x05 \x01(\x0e20.google.monitoring.v3.ServiceLevelObjective.ViewR\x04view\"\xb3\x01\n" + + "\"ListServiceLevelObjectivesResponse\x12e\n" + + "\x18service_level_objectives\x18\x01 \x03(\v2+.google.monitoring.v3.ServiceLevelObjectiveR\x16serviceLevelObjectives\x12&\n" + + "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\"\xcb\x01\n" + + "\"UpdateServiceLevelObjectiveRequest\x12h\n" + + "\x17service_level_objective\x18\x01 \x01(\v2+.google.monitoring.v3.ServiceLevelObjectiveB\x03\xe0A\x02R\x15serviceLevelObjective\x12;\n" + + "\vupdate_mask\x18\x02 \x01(\v2\x1a.google.protobuf.FieldMaskR\n" + + "updateMask\"q\n" + + "\"DeleteServiceLevelObjectiveRequest\x12K\n" + + "\x04name\x18\x01 \x01(\tB7\xe0A\x02\xfaA1\n" + + "/monitoring.googleapis.com/ServiceLevelObjectiveR\x04name2\xea\x0f\n" + + "\x18ServiceMonitoringService\x12\x97\x01\n" + + "\rCreateService\x12*.google.monitoring.v3.CreateServiceRequest\x1a\x1d.google.monitoring.v3.Service\";\xdaA\x0eparent,service\x82\xd3\xe4\x93\x02$:\aservice\"\x19/v3/{parent=*/*}/services\x12~\n" + + "\n" + + "GetService\x12'.google.monitoring.v3.GetServiceRequest\x1a\x1d.google.monitoring.v3.Service\"(\xdaA\x04name\x82\xd3\xe4\x93\x02\x1b\x12\x19/v3/{name=*/*/services/*}\x12\x91\x01\n" + + "\fListServices\x12).google.monitoring.v3.ListServicesRequest\x1a*.google.monitoring.v3.ListServicesResponse\"*\xdaA\x06parent\x82\xd3\xe4\x93\x02\x1b\x12\x19/v3/{parent=*/*}/services\x12\x98\x01\n" + + "\rUpdateService\x12*.google.monitoring.v3.UpdateServiceRequest\x1a\x1d.google.monitoring.v3.Service\"<\xdaA\aservice\x82\xd3\xe4\x93\x02,:\aservice2!/v3/{service.name=*/*/services/*}\x12}\n" + + "\rDeleteService\x12*.google.monitoring.v3.DeleteServiceRequest\x1a\x16.google.protobuf.Empty\"(\xdaA\x04name\x82\xd3\xe4\x93\x02\x1b*\x19/v3/{name=*/*/services/*}\x12\xfa\x01\n" + + "\x1bCreateServiceLevelObjective\x128.google.monitoring.v3.CreateServiceLevelObjectiveRequest\x1a+.google.monitoring.v3.ServiceLevelObjective\"t\xdaA\x1eparent,service_level_objective\x82\xd3\xe4\x93\x02M:\x17service_level_objective\"2/v3/{parent=*/*/services/*}/serviceLevelObjectives\x12\xc1\x01\n" + + "\x18GetServiceLevelObjective\x125.google.monitoring.v3.GetServiceLevelObjectiveRequest\x1a+.google.monitoring.v3.ServiceLevelObjective\"A\xdaA\x04name\x82\xd3\xe4\x93\x024\x122/v3/{name=*/*/services/*/serviceLevelObjectives/*}\x12\xd4\x01\n" + + "\x1aListServiceLevelObjectives\x127.google.monitoring.v3.ListServiceLevelObjectivesRequest\x1a8.google.monitoring.v3.ListServiceLevelObjectivesResponse\"C\xdaA\x06parent\x82\xd3\xe4\x93\x024\x122/v3/{parent=*/*/services/*}/serviceLevelObjectives\x12\x8c\x02\n" + + "\x1bUpdateServiceLevelObjective\x128.google.monitoring.v3.UpdateServiceLevelObjectiveRequest\x1a+.google.monitoring.v3.ServiceLevelObjective\"\x85\x01\xdaA\x17service_level_objective\x82\xd3\xe4\x93\x02e:\x17service_level_objective2J/v3/{service_level_objective.name=*/*/services/*/serviceLevelObjectives/*}\x12\xb2\x01\n" + + "\x1bDeleteServiceLevelObjective\x128.google.monitoring.v3.DeleteServiceLevelObjectiveRequest\x1a\x16.google.protobuf.Empty\"A\xdaA\x04name\x82\xd3\xe4\x93\x024*2/v3/{name=*/*/services/*/serviceLevelObjectives/*}\x1a\xa9\x01\xcaA\x19monitoring.googleapis.com\xd2A\x89\x01https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.readB\xd8\x01\n" + + "\x18com.google.monitoring.v3B\x1dServiceMonitoringServiceProtoP\x01ZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpb\xaa\x02\x1aGoogle.Cloud.Monitoring.V3\xca\x02\x1aGoogle\\Cloud\\Monitoring\\V3\xea\x02\x1dGoogle::Cloud::Monitoring::V3b\x06proto3" var ( file_google_monitoring_v3_service_service_proto_rawDescOnce sync.Once - file_google_monitoring_v3_service_service_proto_rawDescData = file_google_monitoring_v3_service_service_proto_rawDesc + file_google_monitoring_v3_service_service_proto_rawDescData []byte ) func file_google_monitoring_v3_service_service_proto_rawDescGZIP() []byte { file_google_monitoring_v3_service_service_proto_rawDescOnce.Do(func() { - file_google_monitoring_v3_service_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_monitoring_v3_service_service_proto_rawDescData) + file_google_monitoring_v3_service_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_service_service_proto_rawDesc), len(file_google_monitoring_v3_service_service_proto_rawDesc))) }) return file_google_monitoring_v3_service_service_proto_rawDescData } @@ -1180,7 +950,7 @@ func file_google_monitoring_v3_service_service_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_monitoring_v3_service_service_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_service_service_proto_rawDesc), len(file_google_monitoring_v3_service_service_proto_rawDesc)), NumEnums: 0, NumMessages: 12, NumExtensions: 0, @@ -1191,7 +961,6 @@ func file_google_monitoring_v3_service_service_proto_init() { MessageInfos: file_google_monitoring_v3_service_service_proto_msgTypes, }.Build() File_google_monitoring_v3_service_service_proto = out.File - file_google_monitoring_v3_service_service_proto_rawDesc = nil file_google_monitoring_v3_service_service_proto_goTypes = nil file_google_monitoring_v3_service_service_proto_depIdxs = nil } diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service_grpc.pb.go index bd7692b9502..96bfe0ab679 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service_grpc.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service_grpc.pb.go @@ -15,13 +15,14 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.7 +// - protoc v6.33.2 // source: google/monitoring/v3/service_service.proto package monitoringpb import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze.pb.go index 39a2dc9f98e..423d366af09 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze.pb.go @@ -14,18 +14,20 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 -// protoc v4.25.7 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: google/monitoring/v3/snooze.proto package monitoringpb import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( @@ -40,10 +42,7 @@ const ( // criteria defined in the `Snooze`. The `Snooze` will be active from // `interval.start_time` through `interval.end_time`. type Snooze struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. Identifier. The name of the `Snooze`. The format is: // // projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] @@ -61,7 +60,9 @@ type Snooze struct { Interval *TimeInterval `protobuf:"bytes,4,opt,name=interval,proto3" json:"interval,omitempty"` // Required. A display name for the `Snooze`. This can be, at most, 512 // unicode characters. - DisplayName string `protobuf:"bytes,5,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + DisplayName string `protobuf:"bytes,5,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Snooze) Reset() { @@ -126,10 +127,7 @@ func (x *Snooze) GetDisplayName() string { // `Snooze` will suppress alerts that come from one of the `AlertPolicy`s // whose names are supplied. type Snooze_Criteria struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The specific `AlertPolicy` names for the alert that should be snoozed. // The format is: // @@ -154,7 +152,9 @@ type Snooze_Criteria struct { // // resource.labels.instance_id="1234567890" AND // resource.labels.zone="us-central1-a" - Filter string `protobuf:"bytes,2,opt,name=filter,proto3" json:"filter,omitempty"` + Filter string `protobuf:"bytes,2,opt,name=filter,proto3" json:"filter,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Snooze_Criteria) Reset() { @@ -203,65 +203,29 @@ func (x *Snooze_Criteria) GetFilter() string { var File_google_monitoring_v3_snooze_proto protoreflect.FileDescriptor -var file_google_monitoring_v3_snooze_proto_rawDesc = []byte{ - 0x0a, 0x21, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, - 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8e, 0x03, 0x0a, 0x06, 0x53, 0x6e, 0x6f, - 0x6f, 0x7a, 0x65, 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, 0x46, 0x0a, 0x08, - 0x63, 0x72, 0x69, 0x74, 0x65, 0x72, 0x69, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x2e, 0x43, 0x72, 0x69, - 0x74, 0x65, 0x72, 0x69, 0x61, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x08, 0x63, 0x72, 0x69, 0x74, - 0x65, 0x72, 0x69, 0x61, 0x12, 0x43, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, - 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x26, 0x0a, 0x0c, 0x64, 0x69, 0x73, - 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, - 0x65, 0x1a, 0x6a, 0x0a, 0x08, 0x43, 0x72, 0x69, 0x74, 0x65, 0x72, 0x69, 0x61, 0x12, 0x46, 0x0a, - 0x08, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x42, - 0x2a, 0xfa, 0x41, 0x27, 0x0a, 0x25, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x41, 0x6c, 0x65, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x08, 0x70, 0x6f, 0x6c, - 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x3a, 0x4a, 0xea, - 0x41, 0x47, 0x0a, 0x20, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x6e, - 0x6f, 0x6f, 0x7a, 0x65, 0x12, 0x23, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x73, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x73, - 0x2f, 0x7b, 0x73, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x7d, 0x42, 0xc6, 0x01, 0x0a, 0x18, 0x63, 0x6f, - 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x42, 0x0b, 0x53, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x33, 0x2f, 0x76, 0x32, 0x2f, 0x6d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x70, 0x62, 0x3b, 0x6d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x70, 0x62, 0xaa, 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x6e, 0x67, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, - 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x5c, - 0x56, 0x33, 0xea, 0x02, 0x1d, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x3a, 0x3a, 0x43, 0x6c, 0x6f, - 0x75, 0x64, 0x3a, 0x3a, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x3a, 0x3a, - 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_google_monitoring_v3_snooze_proto_rawDesc = "" + + "\n" + + "!google/monitoring/v3/snooze.proto\x12\x14google.monitoring.v3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a!google/monitoring/v3/common.proto\"\x8e\x03\n" + + "\x06Snooze\x12\x17\n" + + "\x04name\x18\x01 \x01(\tB\x03\xe0A\bR\x04name\x12F\n" + + "\bcriteria\x18\x03 \x01(\v2%.google.monitoring.v3.Snooze.CriteriaB\x03\xe0A\x02R\bcriteria\x12C\n" + + "\binterval\x18\x04 \x01(\v2\".google.monitoring.v3.TimeIntervalB\x03\xe0A\x02R\binterval\x12&\n" + + "\fdisplay_name\x18\x05 \x01(\tB\x03\xe0A\x02R\vdisplayName\x1aj\n" + + "\bCriteria\x12F\n" + + "\bpolicies\x18\x01 \x03(\tB*\xfaA'\n" + + "%monitoring.googleapis.com/AlertPolicyR\bpolicies\x12\x16\n" + + "\x06filter\x18\x02 \x01(\tR\x06filter:J\xeaAG\n" + + " monitoring.googleapis.com/Snooze\x12#projects/{project}/snoozes/{snooze}B\xc6\x01\n" + + "\x18com.google.monitoring.v3B\vSnoozeProtoP\x01ZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpb\xaa\x02\x1aGoogle.Cloud.Monitoring.V3\xca\x02\x1aGoogle\\Cloud\\Monitoring\\V3\xea\x02\x1dGoogle::Cloud::Monitoring::V3b\x06proto3" var ( file_google_monitoring_v3_snooze_proto_rawDescOnce sync.Once - file_google_monitoring_v3_snooze_proto_rawDescData = file_google_monitoring_v3_snooze_proto_rawDesc + file_google_monitoring_v3_snooze_proto_rawDescData []byte ) func file_google_monitoring_v3_snooze_proto_rawDescGZIP() []byte { file_google_monitoring_v3_snooze_proto_rawDescOnce.Do(func() { - file_google_monitoring_v3_snooze_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_monitoring_v3_snooze_proto_rawDescData) + file_google_monitoring_v3_snooze_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_snooze_proto_rawDesc), len(file_google_monitoring_v3_snooze_proto_rawDesc))) }) return file_google_monitoring_v3_snooze_proto_rawDescData } @@ -292,7 +256,7 @@ func file_google_monitoring_v3_snooze_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_monitoring_v3_snooze_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_snooze_proto_rawDesc), len(file_google_monitoring_v3_snooze_proto_rawDesc)), NumEnums: 0, NumMessages: 2, NumExtensions: 0, @@ -303,7 +267,6 @@ func file_google_monitoring_v3_snooze_proto_init() { MessageInfos: file_google_monitoring_v3_snooze_proto_msgTypes, }.Build() File_google_monitoring_v3_snooze_proto = out.File - file_google_monitoring_v3_snooze_proto_rawDesc = nil file_google_monitoring_v3_snooze_proto_goTypes = nil file_google_monitoring_v3_snooze_proto_depIdxs = nil } diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service.pb.go index 094ab0d01e9..4cc87a48402 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service.pb.go @@ -14,19 +14,21 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 -// protoc v4.25.7 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: google/monitoring/v3/snooze_service.proto package monitoringpb import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" - reflect "reflect" - sync "sync" ) const ( @@ -39,10 +41,7 @@ const ( // The message definition for creating a `Snooze`. Users must provide the body // of the `Snooze` to be created but must omit the `Snooze` field, `name`. type CreateSnoozeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The // [project](https://cloud.google.com/monitoring/api/v3#project_name) in which // a `Snooze` should be created. The format is: @@ -51,7 +50,9 @@ type CreateSnoozeRequest struct { Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` // Required. The `Snooze` to create. Omit the `name` field, as it will be // filled in by the API. - Snooze *Snooze `protobuf:"bytes,2,opt,name=snooze,proto3" json:"snooze,omitempty"` + Snooze *Snooze `protobuf:"bytes,2,opt,name=snooze,proto3" json:"snooze,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *CreateSnoozeRequest) Reset() { @@ -101,10 +102,7 @@ func (x *CreateSnoozeRequest) GetSnooze() *Snooze { // The message definition for listing `Snooze`s associated with the given // `parent`, satisfying the optional `filter`. type ListSnoozesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The // [project](https://cloud.google.com/monitoring/api/v3#project_name) whose // `Snooze`s should be listed. The format is: @@ -130,7 +128,9 @@ type ListSnoozesRequest struct { PageSize int32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // Optional. The `next_page_token` from a previous call to // `ListSnoozesRequest` to get the next page of results. - PageToken string `protobuf:"bytes,5,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + PageToken string `protobuf:"bytes,5,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ListSnoozesRequest) Reset() { @@ -194,15 +194,14 @@ func (x *ListSnoozesRequest) GetPageToken() string { // The results of a successful `ListSnoozes` call, containing the matching // `Snooze`s. type ListSnoozesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // `Snooze`s matching this list call. Snoozes []*Snooze `protobuf:"bytes,1,rep,name=snoozes,proto3" json:"snoozes,omitempty"` // Page token for repeated calls to `ListSnoozes`, to fetch additional pages // of results. If this is empty or missing, there are no more pages. NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ListSnoozesResponse) Reset() { @@ -252,14 +251,13 @@ func (x *ListSnoozesResponse) GetNextPageToken() string { // The message definition for retrieving a `Snooze`. Users must specify the // field, `name`, which identifies the `Snooze`. type GetSnoozeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The ID of the `Snooze` to retrieve. The format is: // // projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GetSnoozeRequest) Reset() { @@ -313,10 +311,7 @@ func (x *GetSnoozeRequest) GetName() string { // - start time is in the future: `display_name`, `interval.start_time` and // `interval.end_time` can be updated. type UpdateSnoozeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. The `Snooze` to update. Must have the name field present. Snooze *Snooze `protobuf:"bytes,1,opt,name=snooze,proto3" json:"snooze,omitempty"` // Required. The fields to update. @@ -341,7 +336,9 @@ type UpdateSnoozeRequest struct { // fields can legally be updated. Before attempting an update, users should // consult the documentation for `UpdateSnoozeRequest`, which talks about // which fields can be updated. - UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` + UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *UpdateSnoozeRequest) Reset() { @@ -390,139 +387,43 @@ func (x *UpdateSnoozeRequest) GetUpdateMask() *fieldmaskpb.FieldMask { var File_google_monitoring_v3_snooze_service_proto protoreflect.FileDescriptor -var file_google_monitoring_v3_snooze_service_proto_rawDesc = []byte{ - 0x0a, 0x29, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x5f, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, - 0x33, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, - 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, - 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x6e, 0x6f, 0x6f, 0x7a, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, - 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x92, 0x01, 0x0a, 0x13, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x53, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x40, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x28, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x22, 0x12, 0x20, 0x6d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x52, 0x06, 0x70, 0x61, 0x72, - 0x65, 0x6e, 0x74, 0x12, 0x39, 0x0a, 0x06, 0x73, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x6e, 0x6f, 0x6f, 0x7a, - 0x65, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x73, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x22, 0xb9, - 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x28, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x22, 0x12, 0x20, 0x6d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x52, - 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x66, 0x69, - 0x6c, 0x74, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, - 0x65, 0x18, 0x04, 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, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, - 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x75, 0x0a, 0x13, 0x4c, 0x69, - 0x73, 0x74, 0x53, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x36, 0x0a, 0x07, 0x73, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, - 0x52, 0x07, 0x73, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 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, 0x50, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x28, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x22, 0x0a, 0x20, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, - 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x22, 0x92, 0x01, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x6e, - 0x6f, 0x6f, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x06, 0x73, - 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x33, 0x2e, 0x53, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, - 0x73, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x5f, 0x6d, 0x61, 0x73, 0x6b, 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, 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, 0x32, 0x98, 0x06, 0x0a, 0x0d, 0x53, 0x6e, 0x6f, - 0x6f, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x98, 0x01, 0x0a, 0x0c, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x12, 0x29, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x33, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x6e, - 0x6f, 0x6f, 0x7a, 0x65, 0x22, 0x3f, 0xda, 0x41, 0x0d, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, - 0x73, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, 0x06, 0x73, 0x6e, - 0x6f, 0x6f, 0x7a, 0x65, 0x22, 0x1f, 0x2f, 0x76, 0x33, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, - 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, 0x6e, - 0x6f, 0x6f, 0x7a, 0x65, 0x73, 0x12, 0x94, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6e, - 0x6f, 0x6f, 0x7a, 0x65, 0x73, 0x12, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x53, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6e, 0x6f, 0x6f, 0x7a, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0xda, 0x41, 0x06, 0x70, - 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x12, 0x1f, 0x2f, 0x76, 0x33, - 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, - 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x73, 0x12, 0x81, 0x01, 0x0a, - 0x09, 0x47, 0x65, 0x74, 0x53, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x12, 0x26, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, - 0x33, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, - 0x22, 0x2e, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x12, - 0x1f, 0x2f, 0x76, 0x33, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x73, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x73, 0x2f, 0x2a, 0x7d, - 0x12, 0xa4, 0x01, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x6e, 0x6f, 0x6f, 0x7a, - 0x65, 0x12, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, - 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, - 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x22, 0x4b, 0xda, 0x41, 0x12, 0x73, - 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, - 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x3a, 0x06, 0x73, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x32, - 0x26, 0x2f, 0x76, 0x33, 0x2f, 0x7b, 0x73, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x2e, 0x6e, 0x61, 0x6d, - 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x73, 0x6e, 0x6f, - 0x6f, 0x7a, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x1a, 0xa9, 0x01, 0xca, 0x41, 0x19, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, - 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0xd2, 0x41, 0x89, 0x01, 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, 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, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 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, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x72, - 0x65, 0x61, 0x64, 0x42, 0xcd, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, - 0x42, 0x12, 0x53, 0x6e, 0x6f, 0x6f, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x33, 0x2f, 0x76, 0x32, 0x2f, - 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x70, 0x62, 0x3b, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x70, 0x62, 0xaa, 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, - 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, - 0x5c, 0x56, 0x33, 0xea, 0x02, 0x1d, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x3a, 0x3a, 0x43, 0x6c, - 0x6f, 0x75, 0x64, 0x3a, 0x3a, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x3a, - 0x3a, 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_google_monitoring_v3_snooze_service_proto_rawDesc = "" + + "\n" + + ")google/monitoring/v3/snooze_service.proto\x12\x14google.monitoring.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a!google/monitoring/v3/snooze.proto\x1a google/protobuf/field_mask.proto\"\x92\x01\n" + + "\x13CreateSnoozeRequest\x12@\n" + + "\x06parent\x18\x01 \x01(\tB(\xe0A\x02\xfaA\"\x12 monitoring.googleapis.com/SnoozeR\x06parent\x129\n" + + "\x06snooze\x18\x02 \x01(\v2\x1c.google.monitoring.v3.SnoozeB\x03\xe0A\x02R\x06snooze\"\xb9\x01\n" + + "\x12ListSnoozesRequest\x12@\n" + + "\x06parent\x18\x01 \x01(\tB(\xe0A\x02\xfaA\"\x12 monitoring.googleapis.com/SnoozeR\x06parent\x12\x1b\n" + + "\x06filter\x18\x02 \x01(\tB\x03\xe0A\x01R\x06filter\x12 \n" + + "\tpage_size\x18\x04 \x01(\x05B\x03\xe0A\x01R\bpageSize\x12\"\n" + + "\n" + + "page_token\x18\x05 \x01(\tB\x03\xe0A\x01R\tpageToken\"u\n" + + "\x13ListSnoozesResponse\x126\n" + + "\asnoozes\x18\x01 \x03(\v2\x1c.google.monitoring.v3.SnoozeR\asnoozes\x12&\n" + + "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\"P\n" + + "\x10GetSnoozeRequest\x12<\n" + + "\x04name\x18\x01 \x01(\tB(\xe0A\x02\xfaA\"\n" + + " monitoring.googleapis.com/SnoozeR\x04name\"\x92\x01\n" + + "\x13UpdateSnoozeRequest\x129\n" + + "\x06snooze\x18\x01 \x01(\v2\x1c.google.monitoring.v3.SnoozeB\x03\xe0A\x02R\x06snooze\x12@\n" + + "\vupdate_mask\x18\x02 \x01(\v2\x1a.google.protobuf.FieldMaskB\x03\xe0A\x02R\n" + + "updateMask2\x98\x06\n" + + "\rSnoozeService\x12\x98\x01\n" + + "\fCreateSnooze\x12).google.monitoring.v3.CreateSnoozeRequest\x1a\x1c.google.monitoring.v3.Snooze\"?\xdaA\rparent,snooze\x82\xd3\xe4\x93\x02):\x06snooze\"\x1f/v3/{parent=projects/*}/snoozes\x12\x94\x01\n" + + "\vListSnoozes\x12(.google.monitoring.v3.ListSnoozesRequest\x1a).google.monitoring.v3.ListSnoozesResponse\"0\xdaA\x06parent\x82\xd3\xe4\x93\x02!\x12\x1f/v3/{parent=projects/*}/snoozes\x12\x81\x01\n" + + "\tGetSnooze\x12&.google.monitoring.v3.GetSnoozeRequest\x1a\x1c.google.monitoring.v3.Snooze\".\xdaA\x04name\x82\xd3\xe4\x93\x02!\x12\x1f/v3/{name=projects/*/snoozes/*}\x12\xa4\x01\n" + + "\fUpdateSnooze\x12).google.monitoring.v3.UpdateSnoozeRequest\x1a\x1c.google.monitoring.v3.Snooze\"K\xdaA\x12snooze,update_mask\x82\xd3\xe4\x93\x020:\x06snooze2&/v3/{snooze.name=projects/*/snoozes/*}\x1a\xa9\x01\xcaA\x19monitoring.googleapis.com\xd2A\x89\x01https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.readB\xcd\x01\n" + + "\x18com.google.monitoring.v3B\x12SnoozeServiceProtoP\x01ZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpb\xaa\x02\x1aGoogle.Cloud.Monitoring.V3\xca\x02\x1aGoogle\\Cloud\\Monitoring\\V3\xea\x02\x1dGoogle::Cloud::Monitoring::V3b\x06proto3" var ( file_google_monitoring_v3_snooze_service_proto_rawDescOnce sync.Once - file_google_monitoring_v3_snooze_service_proto_rawDescData = file_google_monitoring_v3_snooze_service_proto_rawDesc + file_google_monitoring_v3_snooze_service_proto_rawDescData []byte ) func file_google_monitoring_v3_snooze_service_proto_rawDescGZIP() []byte { file_google_monitoring_v3_snooze_service_proto_rawDescOnce.Do(func() { - file_google_monitoring_v3_snooze_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_monitoring_v3_snooze_service_proto_rawDescData) + file_google_monitoring_v3_snooze_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_snooze_service_proto_rawDesc), len(file_google_monitoring_v3_snooze_service_proto_rawDesc))) }) return file_google_monitoring_v3_snooze_service_proto_rawDescData } @@ -567,7 +468,7 @@ func file_google_monitoring_v3_snooze_service_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_monitoring_v3_snooze_service_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_snooze_service_proto_rawDesc), len(file_google_monitoring_v3_snooze_service_proto_rawDesc)), NumEnums: 0, NumMessages: 5, NumExtensions: 0, @@ -578,7 +479,6 @@ func file_google_monitoring_v3_snooze_service_proto_init() { MessageInfos: file_google_monitoring_v3_snooze_service_proto_msgTypes, }.Build() File_google_monitoring_v3_snooze_service_proto = out.File - file_google_monitoring_v3_snooze_service_proto_rawDesc = nil file_google_monitoring_v3_snooze_service_proto_goTypes = nil file_google_monitoring_v3_snooze_service_proto_depIdxs = nil } diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service_grpc.pb.go index 0b7e4fa924c..fe198fddd17 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service_grpc.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service_grpc.pb.go @@ -15,13 +15,14 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.7 +// - protoc v6.33.2 // source: google/monitoring/v3/snooze_service.proto package monitoringpb import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/span_context.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/span_context.pb.go index b9332612414..62e484ce6fe 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/span_context.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/span_context.pb.go @@ -14,17 +14,19 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 -// protoc v4.25.7 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: google/monitoring/v3/span_context.proto package monitoringpb import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( @@ -42,10 +44,7 @@ const ( // // projects/[PROJECT_ID_OR_NUMBER]/traces/[TRACE_ID]/spans/[SPAN_ID] type SpanContext struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The resource name of the span. The format is: // // projects/[PROJECT_ID_OR_NUMBER]/traces/[TRACE_ID]/spans/[SPAN_ID] @@ -55,7 +54,9 @@ type SpanContext struct { // // `[SPAN_ID]` is a unique identifier for a span within a trace; it // is a 16-character hexadecimal encoding of an 8-byte array. - SpanName string `protobuf:"bytes,1,opt,name=span_name,json=spanName,proto3" json:"span_name,omitempty"` + SpanName string `protobuf:"bytes,1,opt,name=span_name,json=spanName,proto3" json:"span_name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *SpanContext) Reset() { @@ -97,38 +98,21 @@ func (x *SpanContext) GetSpanName() string { var File_google_monitoring_v3_span_context_proto protoreflect.FileDescriptor -var file_google_monitoring_v3_span_context_proto_rawDesc = []byte{ - 0x0a, 0x27, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x70, 0x61, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x74, - 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x22, - 0x2a, 0x0a, 0x0b, 0x53, 0x70, 0x61, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x1b, - 0x0a, 0x09, 0x73, 0x70, 0x61, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x73, 0x70, 0x61, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0xcb, 0x01, 0x0a, 0x18, - 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x42, 0x10, 0x53, 0x70, 0x61, 0x6e, 0x43, 0x6f, - 0x6e, 0x74, 0x65, 0x78, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, - 0x6f, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x70, 0x69, - 0x76, 0x33, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, - 0x70, 0x62, 0x3b, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x70, 0x62, 0xaa, - 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x4d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x1a, 0x47, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x4d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x33, 0xea, 0x02, 0x1d, 0x47, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x3a, 0x3a, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x3a, 0x3a, 0x4d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} +const file_google_monitoring_v3_span_context_proto_rawDesc = "" + + "\n" + + "'google/monitoring/v3/span_context.proto\x12\x14google.monitoring.v3\"*\n" + + "\vSpanContext\x12\x1b\n" + + "\tspan_name\x18\x01 \x01(\tR\bspanNameB\xcb\x01\n" + + "\x18com.google.monitoring.v3B\x10SpanContextProtoP\x01ZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpb\xaa\x02\x1aGoogle.Cloud.Monitoring.V3\xca\x02\x1aGoogle\\Cloud\\Monitoring\\V3\xea\x02\x1dGoogle::Cloud::Monitoring::V3b\x06proto3" var ( file_google_monitoring_v3_span_context_proto_rawDescOnce sync.Once - file_google_monitoring_v3_span_context_proto_rawDescData = file_google_monitoring_v3_span_context_proto_rawDesc + file_google_monitoring_v3_span_context_proto_rawDescData []byte ) func file_google_monitoring_v3_span_context_proto_rawDescGZIP() []byte { file_google_monitoring_v3_span_context_proto_rawDescOnce.Do(func() { - file_google_monitoring_v3_span_context_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_monitoring_v3_span_context_proto_rawDescData) + file_google_monitoring_v3_span_context_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_span_context_proto_rawDesc), len(file_google_monitoring_v3_span_context_proto_rawDesc))) }) return file_google_monitoring_v3_span_context_proto_rawDescData } @@ -154,7 +138,7 @@ func file_google_monitoring_v3_span_context_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_monitoring_v3_span_context_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_span_context_proto_rawDesc), len(file_google_monitoring_v3_span_context_proto_rawDesc)), NumEnums: 0, NumMessages: 1, NumExtensions: 0, @@ -165,7 +149,6 @@ func file_google_monitoring_v3_span_context_proto_init() { MessageInfos: file_google_monitoring_v3_span_context_proto_msgTypes, }.Build() File_google_monitoring_v3_span_context_proto = out.File - file_google_monitoring_v3_span_context_proto_rawDesc = nil file_google_monitoring_v3_span_context_proto_goTypes = nil file_google_monitoring_v3_span_context_proto_depIdxs = nil } diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime.pb.go index 2e0fb6420a9..b2b96799bc4 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime.pb.go @@ -14,20 +14,22 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 -// protoc v4.25.7 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: google/monitoring/v3/uptime.proto package monitoringpb import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + _ "google.golang.org/genproto/googleapis/api/annotations" monitoredres "google.golang.org/genproto/googleapis/api/monitoredres" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" - reflect "reflect" - sync "sync" ) const ( @@ -668,10 +670,7 @@ func (UptimeCheckConfig_ContentMatcher_JsonPathMatcher_JsonPathMatcherOption) En // // Deprecated: Marked as deprecated in google/monitoring/v3/uptime.proto. type InternalChecker struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // A unique resource name for this InternalChecker. The format is: // // projects/[PROJECT_ID_OR_NUMBER]/internalCheckers/[INTERNAL_CHECKER_ID] @@ -693,7 +692,9 @@ type InternalChecker struct { // the same as the Metrics Scope project. PeerProjectId string `protobuf:"bytes,6,opt,name=peer_project_id,json=peerProjectId,proto3" json:"peer_project_id,omitempty"` // The current operational state of the internal checker. - State InternalChecker_State `protobuf:"varint,7,opt,name=state,proto3,enum=google.monitoring.v3.InternalChecker_State" json:"state,omitempty"` + State InternalChecker_State `protobuf:"varint,7,opt,name=state,proto3,enum=google.monitoring.v3.InternalChecker_State" json:"state,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *InternalChecker) Reset() { @@ -770,16 +771,15 @@ func (x *InternalChecker) GetState() InternalChecker_State { // Describes a Synthetic Monitor to be invoked by Uptime. type SyntheticMonitorTarget struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Specifies a Synthetic Monitor's execution stack. // - // Types that are assignable to Target: + // Types that are valid to be assigned to Target: // // *SyntheticMonitorTarget_CloudFunctionV2 - Target isSyntheticMonitorTarget_Target `protobuf_oneof:"target"` + Target isSyntheticMonitorTarget_Target `protobuf_oneof:"target"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *SyntheticMonitorTarget) Reset() { @@ -812,16 +812,18 @@ func (*SyntheticMonitorTarget) Descriptor() ([]byte, []int) { return file_google_monitoring_v3_uptime_proto_rawDescGZIP(), []int{1} } -func (m *SyntheticMonitorTarget) GetTarget() isSyntheticMonitorTarget_Target { - if m != nil { - return m.Target +func (x *SyntheticMonitorTarget) GetTarget() isSyntheticMonitorTarget_Target { + if x != nil { + return x.Target } return nil } func (x *SyntheticMonitorTarget) GetCloudFunctionV2() *SyntheticMonitorTarget_CloudFunctionV2Target { - if x, ok := x.GetTarget().(*SyntheticMonitorTarget_CloudFunctionV2); ok { - return x.CloudFunctionV2 + if x != nil { + if x, ok := x.Target.(*SyntheticMonitorTarget_CloudFunctionV2); ok { + return x.CloudFunctionV2 + } } return nil } @@ -840,10 +842,7 @@ func (*SyntheticMonitorTarget_CloudFunctionV2) isSyntheticMonitorTarget_Target() // This message configures which resources and services to monitor for // availability. type UptimeCheckConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Identifier. A unique resource name for this Uptime check configuration. The // format is: // @@ -862,7 +861,7 @@ type UptimeCheckConfig struct { DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` // The resource the check is checking. Required. // - // Types that are assignable to Resource: + // Types that are valid to be assigned to Resource: // // *UptimeCheckConfig_MonitoredResource // *UptimeCheckConfig_ResourceGroup_ @@ -870,7 +869,7 @@ type UptimeCheckConfig struct { Resource isUptimeCheckConfig_Resource `protobuf_oneof:"resource"` // The type of Uptime check request. // - // Types that are assignable to CheckRequestType: + // Types that are valid to be assigned to CheckRequestType: // // *UptimeCheckConfig_HttpCheck_ // *UptimeCheckConfig_TcpCheck_ @@ -918,7 +917,9 @@ type UptimeCheckConfig struct { // 63 Unicode characters or 128 bytes, whichever is smaller. Labels and // values can contain only lowercase letters, numerals, underscores, and // dashes. Keys must begin with a letter. - UserLabels map[string]string `protobuf:"bytes,20,rep,name=user_labels,json=userLabels,proto3" json:"user_labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + UserLabels map[string]string `protobuf:"bytes,20,rep,name=user_labels,json=userLabels,proto3" json:"user_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *UptimeCheckConfig) Reset() { @@ -965,51 +966,61 @@ func (x *UptimeCheckConfig) GetDisplayName() string { return "" } -func (m *UptimeCheckConfig) GetResource() isUptimeCheckConfig_Resource { - if m != nil { - return m.Resource +func (x *UptimeCheckConfig) GetResource() isUptimeCheckConfig_Resource { + if x != nil { + return x.Resource } return nil } func (x *UptimeCheckConfig) GetMonitoredResource() *monitoredres.MonitoredResource { - if x, ok := x.GetResource().(*UptimeCheckConfig_MonitoredResource); ok { - return x.MonitoredResource + if x != nil { + if x, ok := x.Resource.(*UptimeCheckConfig_MonitoredResource); ok { + return x.MonitoredResource + } } return nil } func (x *UptimeCheckConfig) GetResourceGroup() *UptimeCheckConfig_ResourceGroup { - if x, ok := x.GetResource().(*UptimeCheckConfig_ResourceGroup_); ok { - return x.ResourceGroup + if x != nil { + if x, ok := x.Resource.(*UptimeCheckConfig_ResourceGroup_); ok { + return x.ResourceGroup + } } return nil } func (x *UptimeCheckConfig) GetSyntheticMonitor() *SyntheticMonitorTarget { - if x, ok := x.GetResource().(*UptimeCheckConfig_SyntheticMonitor); ok { - return x.SyntheticMonitor + if x != nil { + if x, ok := x.Resource.(*UptimeCheckConfig_SyntheticMonitor); ok { + return x.SyntheticMonitor + } } return nil } -func (m *UptimeCheckConfig) GetCheckRequestType() isUptimeCheckConfig_CheckRequestType { - if m != nil { - return m.CheckRequestType +func (x *UptimeCheckConfig) GetCheckRequestType() isUptimeCheckConfig_CheckRequestType { + if x != nil { + return x.CheckRequestType } return nil } func (x *UptimeCheckConfig) GetHttpCheck() *UptimeCheckConfig_HttpCheck { - if x, ok := x.GetCheckRequestType().(*UptimeCheckConfig_HttpCheck_); ok { - return x.HttpCheck + if x != nil { + if x, ok := x.CheckRequestType.(*UptimeCheckConfig_HttpCheck_); ok { + return x.HttpCheck + } } return nil } func (x *UptimeCheckConfig) GetTcpCheck() *UptimeCheckConfig_TcpCheck { - if x, ok := x.GetCheckRequestType().(*UptimeCheckConfig_TcpCheck_); ok { - return x.TcpCheck + if x != nil { + if x, ok := x.CheckRequestType.(*UptimeCheckConfig_TcpCheck_); ok { + return x.TcpCheck + } } return nil } @@ -1130,10 +1141,7 @@ func (*UptimeCheckConfig_TcpCheck_) isUptimeCheckConfig_CheckRequestType() {} // Contains the region, location, and list of IP // addresses where checkers in the location run from. type UptimeCheckIp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // A broad region category in which the IP address is located. Region UptimeCheckRegion `protobuf:"varint,1,opt,name=region,proto3,enum=google.monitoring.v3.UptimeCheckRegion" json:"region,omitempty"` // A more specific location within the region that typically encodes @@ -1145,7 +1153,9 @@ type UptimeCheckIp struct { // this publication, are in IPv4 format; however, one should not rely on the // IP addresses being in IPv4 format indefinitely, and should support // interpreting this field in either IPv4 or IPv6 format. - IpAddress string `protobuf:"bytes,3,opt,name=ip_address,json=ipAddress,proto3" json:"ip_address,omitempty"` + IpAddress string `protobuf:"bytes,3,opt,name=ip_address,json=ipAddress,proto3" json:"ip_address,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *UptimeCheckIp) Reset() { @@ -1201,10 +1211,7 @@ func (x *UptimeCheckIp) GetIpAddress() string { // A Synthetic Monitor deployed to a Cloud Functions V2 instance. type SyntheticMonitorTarget_CloudFunctionV2Target struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Required. Fully qualified GCFv2 resource name // i.e. `projects/{project}/locations/{location}/functions/{function}` // Required. @@ -1214,6 +1221,8 @@ type SyntheticMonitorTarget_CloudFunctionV2Target struct { // spans) are reported against this Monitored Resource. This field is output // only. CloudRunRevision *monitoredres.MonitoredResource `protobuf:"bytes,2,opt,name=cloud_run_revision,json=cloudRunRevision,proto3" json:"cloud_run_revision,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *SyntheticMonitorTarget_CloudFunctionV2Target) Reset() { @@ -1263,16 +1272,15 @@ func (x *SyntheticMonitorTarget_CloudFunctionV2Target) GetCloudRunRevision() *mo // The resource submessage for group checks. It can be used instead of a // monitored resource, when multiple resources are being monitored. type UptimeCheckConfig_ResourceGroup struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The group of resources being monitored. Should be only the `[GROUP_ID]`, // and not the full-path // `projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]`. GroupId string `protobuf:"bytes,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` // The resource type of the group members. - ResourceType GroupResourceType `protobuf:"varint,2,opt,name=resource_type,json=resourceType,proto3,enum=google.monitoring.v3.GroupResourceType" json:"resource_type,omitempty"` + ResourceType GroupResourceType `protobuf:"varint,2,opt,name=resource_type,json=resourceType,proto3,enum=google.monitoring.v3.GroupResourceType" json:"resource_type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *UptimeCheckConfig_ResourceGroup) Reset() { @@ -1323,12 +1331,11 @@ func (x *UptimeCheckConfig_ResourceGroup) GetResourceType() GroupResourceType { // checks. For HTTP, the pings are performed for each part of the redirect // chain. type UptimeCheckConfig_PingConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Number of ICMP pings. A maximum of 3 ICMP pings is currently supported. - PingsCount int32 `protobuf:"varint,1,opt,name=pings_count,json=pingsCount,proto3" json:"pings_count,omitempty"` + PingsCount int32 `protobuf:"varint,1,opt,name=pings_count,json=pingsCount,proto3" json:"pings_count,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *UptimeCheckConfig_PingConfig) Reset() { @@ -1370,10 +1377,7 @@ func (x *UptimeCheckConfig_PingConfig) GetPingsCount() int32 { // Information involved in an HTTP/HTTPS Uptime check request. type UptimeCheckConfig_HttpCheck struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The HTTP request method to use for the check. If set to // `METHOD_UNSPECIFIED` then `request_method` defaults to `GET`. RequestMethod UptimeCheckConfig_HttpCheck_RequestMethod `protobuf:"varint,8,opt,name=request_method,json=requestMethod,proto3,enum=google.monitoring.v3.UptimeCheckConfig_HttpCheck_RequestMethod" json:"request_method,omitempty"` @@ -1409,7 +1413,7 @@ type UptimeCheckConfig_HttpCheck struct { // Entering two separate headers with the same key in a Create call will // cause the first to be overwritten by the second. // The maximum number of headers allowed is 100. - Headers map[string]string `protobuf:"bytes,6,rep,name=headers,proto3" json:"headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Headers map[string]string `protobuf:"bytes,6,rep,name=headers,proto3" json:"headers,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // The content type header to use for the check. The following // configurations result in errors: // 1. Content type is specified in both the `headers` field and the @@ -1451,10 +1455,12 @@ type UptimeCheckConfig_HttpCheck struct { // an authenticated uptime check. // Do not set both `auth_method` and `auth_info`. // - // Types that are assignable to AuthMethod: + // Types that are valid to be assigned to AuthMethod: // // *UptimeCheckConfig_HttpCheck_ServiceAgentAuthentication_ - AuthMethod isUptimeCheckConfig_HttpCheck_AuthMethod `protobuf_oneof:"auth_method"` + AuthMethod isUptimeCheckConfig_HttpCheck_AuthMethod `protobuf_oneof:"auth_method"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *UptimeCheckConfig_HttpCheck) Reset() { @@ -1578,16 +1584,18 @@ func (x *UptimeCheckConfig_HttpCheck) GetPingConfig() *UptimeCheckConfig_PingCon return nil } -func (m *UptimeCheckConfig_HttpCheck) GetAuthMethod() isUptimeCheckConfig_HttpCheck_AuthMethod { - if m != nil { - return m.AuthMethod +func (x *UptimeCheckConfig_HttpCheck) GetAuthMethod() isUptimeCheckConfig_HttpCheck_AuthMethod { + if x != nil { + return x.AuthMethod } return nil } func (x *UptimeCheckConfig_HttpCheck) GetServiceAgentAuthentication() *UptimeCheckConfig_HttpCheck_ServiceAgentAuthentication { - if x, ok := x.GetAuthMethod().(*UptimeCheckConfig_HttpCheck_ServiceAgentAuthentication_); ok { - return x.ServiceAgentAuthentication + if x != nil { + if x, ok := x.AuthMethod.(*UptimeCheckConfig_HttpCheck_ServiceAgentAuthentication_); ok { + return x.ServiceAgentAuthentication + } } return nil } @@ -1608,16 +1616,15 @@ func (*UptimeCheckConfig_HttpCheck_ServiceAgentAuthentication_) isUptimeCheckCon // Information required for a TCP Uptime check request. type UptimeCheckConfig_TcpCheck struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The TCP port on the server against which to run the check. Will be // combined with host (specified within the `monitored_resource`) to // construct the full URL. Required. Port int32 `protobuf:"varint,1,opt,name=port,proto3" json:"port,omitempty"` // Contains information needed to add pings to a TCP check. - PingConfig *UptimeCheckConfig_PingConfig `protobuf:"bytes,2,opt,name=ping_config,json=pingConfig,proto3" json:"ping_config,omitempty"` + PingConfig *UptimeCheckConfig_PingConfig `protobuf:"bytes,2,opt,name=ping_config,json=pingConfig,proto3" json:"ping_config,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *UptimeCheckConfig_TcpCheck) Reset() { @@ -1670,10 +1677,7 @@ func (x *UptimeCheckConfig_TcpCheck) GetPingConfig() *UptimeCheckConfig_PingConf // 1 MB of a TCP check's response) are examined for purposes of content // matching. type UptimeCheckConfig_ContentMatcher struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // String, regex or JSON content to match. Maximum 1024 bytes. An empty // `content` string indicates no content matching is to be performed. Content string `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` @@ -1684,10 +1688,12 @@ type UptimeCheckConfig_ContentMatcher struct { // `MATCHES_JSON_PATH` or `NOT_MATCHES_JSON_PATH` require a // `JsonPathMatcher`; not used for other options. // - // Types that are assignable to AdditionalMatcherInfo: + // Types that are valid to be assigned to AdditionalMatcherInfo: // // *UptimeCheckConfig_ContentMatcher_JsonPathMatcher_ AdditionalMatcherInfo isUptimeCheckConfig_ContentMatcher_AdditionalMatcherInfo `protobuf_oneof:"additional_matcher_info"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *UptimeCheckConfig_ContentMatcher) Reset() { @@ -1734,16 +1740,18 @@ func (x *UptimeCheckConfig_ContentMatcher) GetMatcher() UptimeCheckConfig_Conten return UptimeCheckConfig_ContentMatcher_CONTENT_MATCHER_OPTION_UNSPECIFIED } -func (m *UptimeCheckConfig_ContentMatcher) GetAdditionalMatcherInfo() isUptimeCheckConfig_ContentMatcher_AdditionalMatcherInfo { - if m != nil { - return m.AdditionalMatcherInfo +func (x *UptimeCheckConfig_ContentMatcher) GetAdditionalMatcherInfo() isUptimeCheckConfig_ContentMatcher_AdditionalMatcherInfo { + if x != nil { + return x.AdditionalMatcherInfo } return nil } func (x *UptimeCheckConfig_ContentMatcher) GetJsonPathMatcher() *UptimeCheckConfig_ContentMatcher_JsonPathMatcher { - if x, ok := x.GetAdditionalMatcherInfo().(*UptimeCheckConfig_ContentMatcher_JsonPathMatcher_); ok { - return x.JsonPathMatcher + if x != nil { + if x, ok := x.AdditionalMatcherInfo.(*UptimeCheckConfig_ContentMatcher_JsonPathMatcher_); ok { + return x.JsonPathMatcher + } } return nil } @@ -1765,14 +1773,13 @@ func (*UptimeCheckConfig_ContentMatcher_JsonPathMatcher_) isUptimeCheckConfig_Co // [Basic HTTP authentication](https://tools.ietf.org/html/rfc7617) is // supported in Uptime checks. type UptimeCheckConfig_HttpCheck_BasicAuthentication struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The username to use when authenticating with the HTTP server. Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` // The password to use when authenticating with the HTTP server. - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *UptimeCheckConfig_HttpCheck_BasicAuthentication) Reset() { @@ -1822,17 +1829,16 @@ func (x *UptimeCheckConfig_HttpCheck_BasicAuthentication) GetPassword() string { // A status to accept. Either a status code class like "2xx", or an integer // status code like "200". type UptimeCheckConfig_HttpCheck_ResponseStatusCode struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Either a specific value or a class of status codes. // - // Types that are assignable to StatusCode: + // Types that are valid to be assigned to StatusCode: // // *UptimeCheckConfig_HttpCheck_ResponseStatusCode_StatusValue // *UptimeCheckConfig_HttpCheck_ResponseStatusCode_StatusClass_ - StatusCode isUptimeCheckConfig_HttpCheck_ResponseStatusCode_StatusCode `protobuf_oneof:"status_code"` + StatusCode isUptimeCheckConfig_HttpCheck_ResponseStatusCode_StatusCode `protobuf_oneof:"status_code"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *UptimeCheckConfig_HttpCheck_ResponseStatusCode) Reset() { @@ -1865,23 +1871,27 @@ func (*UptimeCheckConfig_HttpCheck_ResponseStatusCode) Descriptor() ([]byte, []i return file_google_monitoring_v3_uptime_proto_rawDescGZIP(), []int{2, 2, 1} } -func (m *UptimeCheckConfig_HttpCheck_ResponseStatusCode) GetStatusCode() isUptimeCheckConfig_HttpCheck_ResponseStatusCode_StatusCode { - if m != nil { - return m.StatusCode +func (x *UptimeCheckConfig_HttpCheck_ResponseStatusCode) GetStatusCode() isUptimeCheckConfig_HttpCheck_ResponseStatusCode_StatusCode { + if x != nil { + return x.StatusCode } return nil } func (x *UptimeCheckConfig_HttpCheck_ResponseStatusCode) GetStatusValue() int32 { - if x, ok := x.GetStatusCode().(*UptimeCheckConfig_HttpCheck_ResponseStatusCode_StatusValue); ok { - return x.StatusValue + if x != nil { + if x, ok := x.StatusCode.(*UptimeCheckConfig_HttpCheck_ResponseStatusCode_StatusValue); ok { + return x.StatusValue + } } return 0 } func (x *UptimeCheckConfig_HttpCheck_ResponseStatusCode) GetStatusClass() UptimeCheckConfig_HttpCheck_ResponseStatusCode_StatusClass { - if x, ok := x.GetStatusCode().(*UptimeCheckConfig_HttpCheck_ResponseStatusCode_StatusClass_); ok { - return x.StatusClass + if x != nil { + if x, ok := x.StatusCode.(*UptimeCheckConfig_HttpCheck_ResponseStatusCode_StatusClass_); ok { + return x.StatusClass + } } return UptimeCheckConfig_HttpCheck_ResponseStatusCode_STATUS_CLASS_UNSPECIFIED } @@ -1913,12 +1923,11 @@ func (*UptimeCheckConfig_HttpCheck_ResponseStatusCode_StatusClass_) isUptimeChec // The token will be generated for the Monitoring service agent service // account. type UptimeCheckConfig_HttpCheck_ServiceAgentAuthentication struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Type of authentication. - Type UptimeCheckConfig_HttpCheck_ServiceAgentAuthentication_ServiceAgentAuthenticationType `protobuf:"varint,1,opt,name=type,proto3,enum=google.monitoring.v3.UptimeCheckConfig_HttpCheck_ServiceAgentAuthentication_ServiceAgentAuthenticationType" json:"type,omitempty"` + Type UptimeCheckConfig_HttpCheck_ServiceAgentAuthentication_ServiceAgentAuthenticationType `protobuf:"varint,1,opt,name=type,proto3,enum=google.monitoring.v3.UptimeCheckConfig_HttpCheck_ServiceAgentAuthentication_ServiceAgentAuthenticationType" json:"type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *UptimeCheckConfig_HttpCheck_ServiceAgentAuthentication) Reset() { @@ -1962,16 +1971,15 @@ func (x *UptimeCheckConfig_HttpCheck_ServiceAgentAuthentication) GetType() Uptim // Used for `ContentMatcherOption::MATCHES_JSON_PATH` and // `ContentMatcherOption::NOT_MATCHES_JSON_PATH`. type UptimeCheckConfig_ContentMatcher_JsonPathMatcher struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // JSONPath within the response output pointing to the expected // `ContentMatcher::content` to match against. JsonPath string `protobuf:"bytes,1,opt,name=json_path,json=jsonPath,proto3" json:"json_path,omitempty"` // The type of JSONPath match that will be applied to the JSON output // (`ContentMatcher.content`) - JsonMatcher UptimeCheckConfig_ContentMatcher_JsonPathMatcher_JsonPathMatcherOption `protobuf:"varint,2,opt,name=json_matcher,json=jsonMatcher,proto3,enum=google.monitoring.v3.UptimeCheckConfig_ContentMatcher_JsonPathMatcher_JsonPathMatcherOption" json:"json_matcher,omitempty"` + JsonMatcher UptimeCheckConfig_ContentMatcher_JsonPathMatcher_JsonPathMatcherOption `protobuf:"varint,2,opt,name=json_matcher,json=jsonMatcher,proto3,enum=google.monitoring.v3.UptimeCheckConfig_ContentMatcher_JsonPathMatcher_JsonPathMatcherOption" json:"json_matcher,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *UptimeCheckConfig_ContentMatcher_JsonPathMatcher) Reset() { @@ -2020,395 +2028,170 @@ func (x *UptimeCheckConfig_ContentMatcher_JsonPathMatcher) GetJsonMatcher() Upti var File_google_monitoring_v3_uptime_proto protoreflect.FileDescriptor -var file_google_monitoring_v3_uptime_proto_rawDesc = []byte{ - 0x0a, 0x21, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, - 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x69, 0x6e, 0x66, - 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x5f, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa1, 0x02, 0x0a, 0x0f, 0x49, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x19, 0x0a, 0x08, - 0x67, 0x63, 0x70, 0x5f, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x67, 0x63, 0x70, 0x5a, 0x6f, 0x6e, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x65, 0x65, 0x72, 0x5f, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0d, 0x70, 0x65, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, - 0x41, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x43, 0x68, - 0x65, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x22, 0x33, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, - 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, - 0x43, 0x52, 0x45, 0x41, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x55, - 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xc4, 0x02, 0x0a, 0x16, - 0x53, 0x79, 0x6e, 0x74, 0x68, 0x65, 0x74, 0x69, 0x63, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x70, 0x0a, 0x11, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, - 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x32, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x42, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x79, 0x6e, 0x74, 0x68, 0x65, 0x74, - 0x69, 0x63, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2e, - 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x32, 0x54, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x46, 0x75, - 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x32, 0x1a, 0xad, 0x01, 0x0a, 0x15, 0x43, 0x6c, 0x6f, - 0x75, 0x64, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x32, 0x54, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x12, 0x42, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x2e, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x28, 0x0a, 0x26, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x66, - 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, - 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x50, 0x0a, 0x12, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, - 0x72, 0x75, 0x6e, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x10, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x52, 0x75, 0x6e, - 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x22, 0x94, 0x23, 0x0a, 0x11, 0x55, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 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, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x4e, 0x0a, 0x12, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x65, - 0x64, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, - 0x00, 0x52, 0x11, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x12, 0x5e, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, - 0x2e, 0x76, 0x33, 0x2e, 0x55, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x72, - 0x6f, 0x75, 0x70, 0x48, 0x00, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x12, 0x5b, 0x0a, 0x11, 0x73, 0x79, 0x6e, 0x74, 0x68, 0x65, 0x74, 0x69, - 0x63, 0x5f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x79, 0x6e, 0x74, 0x68, 0x65, 0x74, 0x69, 0x63, - 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x48, 0x00, 0x52, - 0x10, 0x73, 0x79, 0x6e, 0x74, 0x68, 0x65, 0x74, 0x69, 0x63, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, - 0x72, 0x12, 0x52, 0x0a, 0x0a, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x55, 0x70, 0x74, - 0x69, 0x6d, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x48, - 0x74, 0x74, 0x70, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x48, 0x01, 0x52, 0x09, 0x68, 0x74, 0x74, 0x70, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x4f, 0x0a, 0x09, 0x74, 0x63, 0x70, 0x5f, 0x63, 0x68, 0x65, - 0x63, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, - 0x55, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x2e, 0x54, 0x63, 0x70, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x48, 0x01, 0x52, 0x08, 0x74, 0x63, - 0x70, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x31, 0x0a, 0x06, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, - 0x18, 0x07, 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, 0x06, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, - 0x65, 0x6f, 0x75, 0x74, 0x18, 0x08, 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, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x61, - 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, - 0x72, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, - 0x55, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, - 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, - 0x73, 0x12, 0x56, 0x0a, 0x0c, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x55, - 0x70, 0x74, 0x69, 0x6d, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x63, 0x68, - 0x65, 0x63, 0x6b, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x52, 0x0a, 0x10, 0x73, 0x65, 0x6c, - 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0a, 0x20, - 0x03, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x55, 0x70, 0x74, 0x69, 0x6d, - 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x73, 0x65, - 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x23, 0x0a, - 0x0b, 0x69, 0x73, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x18, 0x0f, 0x20, 0x01, - 0x28, 0x08, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0a, 0x69, 0x73, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x12, 0x56, 0x0a, 0x11, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x63, - 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, - 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x65, 0x72, 0x42, 0x02, 0x18, 0x01, 0x52, 0x10, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x12, 0x58, 0x0a, 0x0b, 0x75, 0x73, - 0x65, 0x72, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x37, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x55, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x61, 0x62, - 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x4c, 0x61, - 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x78, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, - 0x12, 0x4c, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, - 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x1a, 0x2d, - 0x0a, 0x0a, 0x50, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1f, 0x0a, 0x0b, - 0x70, 0x69, 0x6e, 0x67, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x0a, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0xef, 0x0e, - 0x0a, 0x09, 0x48, 0x74, 0x74, 0x70, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x66, 0x0a, 0x0e, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x3f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x55, 0x70, 0x74, 0x69, 0x6d, - 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x48, 0x74, 0x74, - 0x70, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x52, 0x0d, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x5f, 0x73, 0x73, 0x6c, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x75, 0x73, 0x65, 0x53, 0x73, 0x6c, 0x12, 0x12, 0x0a, 0x04, - 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, - 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, - 0x70, 0x6f, 0x72, 0x74, 0x12, 0x62, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x69, 0x6e, 0x66, - 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x45, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x55, - 0x70, 0x74, 0x69, 0x6d, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2e, 0x48, 0x74, 0x74, 0x70, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x2e, 0x42, 0x61, 0x73, 0x69, 0x63, - 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, - 0x61, 0x75, 0x74, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x61, 0x73, 0x6b, - 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, - 0x6d, 0x61, 0x73, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x58, 0x0a, 0x07, 0x68, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, - 0x2e, 0x76, 0x33, 0x2e, 0x55, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x2e, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x68, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x60, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3d, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x33, 0x2e, 0x55, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x2e, 0x43, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2e, 0x0a, 0x13, 0x63, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0d, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x65, 0x5f, 0x73, 0x73, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x53, 0x73, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, - 0x64, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x89, - 0x01, 0x0a, 0x1e, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, - 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x44, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x55, - 0x70, 0x74, 0x69, 0x6d, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2e, 0x48, 0x74, 0x74, 0x70, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x1b, 0x61, - 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x53, 0x0a, 0x0b, 0x70, 0x69, - 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x55, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x52, 0x0a, 0x70, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, - 0x90, 0x01, 0x0a, 0x1c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x67, 0x65, 0x6e, - 0x74, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x55, 0x70, - 0x74, 0x69, 0x6d, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, - 0x48, 0x74, 0x74, 0x70, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x1a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, - 0x67, 0x65, 0x6e, 0x74, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x1a, 0x4d, 0x0a, 0x13, 0x42, 0x61, 0x73, 0x69, 0x63, 0x41, 0x75, 0x74, 0x68, 0x65, - 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, - 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, - 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, - 0x64, 0x1a, 0xf6, 0x02, 0x0a, 0x12, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, - 0x52, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x75, 0x0a, - 0x0c, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x50, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x55, 0x70, 0x74, 0x69, 0x6d, - 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x48, 0x74, 0x74, - 0x70, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x43, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, - 0x6c, 0x61, 0x73, 0x73, 0x22, 0xb4, 0x01, 0x0a, 0x0b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, - 0x6c, 0x61, 0x73, 0x73, 0x12, 0x1c, 0x0a, 0x18, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, - 0x4c, 0x41, 0x53, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, - 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4c, 0x41, - 0x53, 0x53, 0x5f, 0x31, 0x58, 0x58, 0x10, 0x64, 0x12, 0x15, 0x0a, 0x10, 0x53, 0x54, 0x41, 0x54, - 0x55, 0x53, 0x5f, 0x43, 0x4c, 0x41, 0x53, 0x53, 0x5f, 0x32, 0x58, 0x58, 0x10, 0xc8, 0x01, 0x12, - 0x15, 0x0a, 0x10, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4c, 0x41, 0x53, 0x53, 0x5f, - 0x33, 0x58, 0x58, 0x10, 0xac, 0x02, 0x12, 0x15, 0x0a, 0x10, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, - 0x5f, 0x43, 0x4c, 0x41, 0x53, 0x53, 0x5f, 0x34, 0x58, 0x58, 0x10, 0x90, 0x03, 0x12, 0x15, 0x0a, - 0x10, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4c, 0x41, 0x53, 0x53, 0x5f, 0x35, 0x58, - 0x58, 0x10, 0xf4, 0x03, 0x12, 0x15, 0x0a, 0x10, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, - 0x4c, 0x41, 0x53, 0x53, 0x5f, 0x41, 0x4e, 0x59, 0x10, 0xe8, 0x07, 0x42, 0x0d, 0x0a, 0x0b, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x1a, 0x82, 0x02, 0x0a, 0x1a, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x41, 0x75, 0x74, 0x68, 0x65, - 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x7f, 0x0a, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x6b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x55, - 0x70, 0x74, 0x69, 0x6d, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2e, 0x48, 0x74, 0x74, 0x70, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x67, 0x65, - 0x6e, 0x74, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x63, 0x0a, 0x1e, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, - 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x31, 0x0a, 0x2d, - 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x41, 0x47, 0x45, 0x4e, 0x54, 0x5f, 0x41, 0x55, - 0x54, 0x48, 0x45, 0x4e, 0x54, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, - 0x0e, 0x0a, 0x0a, 0x4f, 0x49, 0x44, 0x43, 0x5f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x10, 0x01, 0x1a, - 0x3a, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 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, 0x22, 0x3a, 0x0a, 0x0d, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x16, 0x0a, 0x12, - 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x47, 0x45, 0x54, 0x10, 0x01, 0x12, 0x08, 0x0a, - 0x04, 0x50, 0x4f, 0x53, 0x54, 0x10, 0x02, 0x22, 0x47, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, - 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, - 0x55, 0x52, 0x4c, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, 0x45, 0x44, 0x10, 0x01, 0x12, 0x11, 0x0a, - 0x0d, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x44, 0x10, 0x02, - 0x42, 0x0d, 0x0a, 0x0b, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x1a, - 0x73, 0x0a, 0x08, 0x54, 0x63, 0x70, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x70, - 0x6f, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, - 0x53, 0x0a, 0x0b, 0x70, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x55, 0x70, 0x74, 0x69, - 0x6d, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x50, 0x69, - 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0a, 0x70, 0x69, 0x6e, 0x67, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x84, 0x06, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x74, 0x12, 0x65, 0x0a, 0x07, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x4b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x55, 0x70, 0x74, 0x69, 0x6d, 0x65, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x07, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x74, 0x0a, 0x11, 0x6a, 0x73, 0x6f, 0x6e, - 0x5f, 0x70, 0x61, 0x74, 0x68, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x46, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x55, 0x70, 0x74, 0x69, 0x6d, - 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4a, 0x73, 0x6f, 0x6e, - 0x50, 0x61, 0x74, 0x68, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x48, 0x00, 0x52, 0x0f, 0x6a, - 0x73, 0x6f, 0x6e, 0x50, 0x61, 0x74, 0x68, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x1a, 0x94, - 0x02, 0x0a, 0x0f, 0x4a, 0x73, 0x6f, 0x6e, 0x50, 0x61, 0x74, 0x68, 0x4d, 0x61, 0x74, 0x63, 0x68, - 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6a, 0x73, 0x6f, 0x6e, 0x50, 0x61, 0x74, 0x68, 0x12, - 0x7f, 0x0a, 0x0c, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x5c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x55, 0x70, 0x74, - 0x69, 0x6d, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4a, 0x73, - 0x6f, 0x6e, 0x50, 0x61, 0x74, 0x68, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4a, 0x73, - 0x6f, 0x6e, 0x50, 0x61, 0x74, 0x68, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x6a, 0x73, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, - 0x22, 0x63, 0x0a, 0x15, 0x4a, 0x73, 0x6f, 0x6e, 0x50, 0x61, 0x74, 0x68, 0x4d, 0x61, 0x74, 0x63, - 0x68, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x24, 0x4a, 0x53, 0x4f, - 0x4e, 0x5f, 0x50, 0x41, 0x54, 0x48, 0x5f, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x45, 0x52, 0x5f, 0x4f, - 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, - 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x45, 0x58, 0x41, 0x43, 0x54, 0x5f, 0x4d, 0x41, 0x54, - 0x43, 0x48, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x45, 0x47, 0x45, 0x58, 0x5f, 0x4d, 0x41, - 0x54, 0x43, 0x48, 0x10, 0x02, 0x22, 0xc8, 0x01, 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x26, - 0x0a, 0x22, 0x43, 0x4f, 0x4e, 0x54, 0x45, 0x4e, 0x54, 0x5f, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x45, - 0x52, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, - 0x4e, 0x53, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x4e, - 0x4f, 0x54, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x53, 0x5f, 0x53, 0x54, 0x52, 0x49, - 0x4e, 0x47, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x45, 0x53, 0x5f, - 0x52, 0x45, 0x47, 0x45, 0x58, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x4e, 0x4f, 0x54, 0x5f, 0x4d, - 0x41, 0x54, 0x43, 0x48, 0x45, 0x53, 0x5f, 0x52, 0x45, 0x47, 0x45, 0x58, 0x10, 0x04, 0x12, 0x15, - 0x0a, 0x11, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x45, 0x53, 0x5f, 0x4a, 0x53, 0x4f, 0x4e, 0x5f, 0x50, - 0x41, 0x54, 0x48, 0x10, 0x05, 0x12, 0x19, 0x0a, 0x15, 0x4e, 0x4f, 0x54, 0x5f, 0x4d, 0x41, 0x54, - 0x43, 0x48, 0x45, 0x53, 0x5f, 0x4a, 0x53, 0x4f, 0x4e, 0x5f, 0x50, 0x41, 0x54, 0x48, 0x10, 0x06, - 0x42, 0x19, 0x0a, 0x17, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x6d, - 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x1a, 0x3d, 0x0a, 0x0f, 0x55, - 0x73, 0x65, 0x72, 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, 0x22, 0x55, 0x0a, 0x0b, 0x43, 0x68, - 0x65, 0x63, 0x6b, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x18, 0x43, 0x48, 0x45, - 0x43, 0x4b, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x49, - 0x43, 0x5f, 0x49, 0x50, 0x5f, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x45, 0x52, 0x53, 0x10, 0x01, 0x12, - 0x10, 0x0a, 0x0c, 0x56, 0x50, 0x43, 0x5f, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x45, 0x52, 0x53, 0x10, - 0x03, 0x3a, 0xf3, 0x01, 0xea, 0x41, 0xef, 0x01, 0x0a, 0x2b, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, - 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x55, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, - 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x2f, 0x7b, 0x75, 0x70, - 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x7d, 0x12, 0x45, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x2f, 0x7b, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, - 0x2f, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x73, 0x2f, 0x7b, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x63, 0x68, 0x65, 0x63, - 0x6b, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x7d, 0x12, 0x39, 0x66, 0x6f, 0x6c, 0x64, 0x65, - 0x72, 0x73, 0x2f, 0x7b, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x7d, 0x2f, 0x75, 0x70, 0x74, 0x69, - 0x6d, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x2f, 0x7b, - 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x7d, 0x12, 0x01, 0x2a, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x42, 0x14, 0x0a, 0x12, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x72, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0x8b, 0x01, 0x0a, 0x0d, 0x55, 0x70, - 0x74, 0x69, 0x6d, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x70, 0x12, 0x3f, 0x0a, 0x06, 0x72, - 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x33, 0x2e, 0x55, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, - 0x67, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, - 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x70, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x70, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2a, 0x95, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x74, 0x69, - 0x6d, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, - 0x12, 0x52, 0x45, 0x47, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, - 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x55, 0x53, 0x41, 0x10, 0x01, 0x12, 0x0a, - 0x0a, 0x06, 0x45, 0x55, 0x52, 0x4f, 0x50, 0x45, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x4f, - 0x55, 0x54, 0x48, 0x5f, 0x41, 0x4d, 0x45, 0x52, 0x49, 0x43, 0x41, 0x10, 0x03, 0x12, 0x10, 0x0a, - 0x0c, 0x41, 0x53, 0x49, 0x41, 0x5f, 0x50, 0x41, 0x43, 0x49, 0x46, 0x49, 0x43, 0x10, 0x04, 0x12, - 0x0e, 0x0a, 0x0a, 0x55, 0x53, 0x41, 0x5f, 0x4f, 0x52, 0x45, 0x47, 0x4f, 0x4e, 0x10, 0x05, 0x12, - 0x0c, 0x0a, 0x08, 0x55, 0x53, 0x41, 0x5f, 0x49, 0x4f, 0x57, 0x41, 0x10, 0x06, 0x12, 0x10, 0x0a, - 0x0c, 0x55, 0x53, 0x41, 0x5f, 0x56, 0x49, 0x52, 0x47, 0x49, 0x4e, 0x49, 0x41, 0x10, 0x07, 0x2a, - 0x5b, 0x0a, 0x11, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x52, 0x45, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, - 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, - 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4e, 0x43, 0x45, 0x10, - 0x01, 0x12, 0x19, 0x0a, 0x15, 0x41, 0x57, 0x53, 0x5f, 0x45, 0x4c, 0x42, 0x5f, 0x4c, 0x4f, 0x41, - 0x44, 0x5f, 0x42, 0x41, 0x4c, 0x41, 0x4e, 0x43, 0x45, 0x52, 0x10, 0x02, 0x42, 0xaf, 0x02, 0xea, - 0x41, 0x66, 0x0a, 0x26, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3c, 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, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x66, - 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x33, 0x42, 0x0b, 0x55, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x41, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, - 0x67, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x33, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x70, 0x62, 0x3b, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x6e, 0x67, 0x70, 0x62, 0xaa, 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, - 0x6f, 0x75, 0x64, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x56, - 0x33, 0xca, 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f, 0x75, 0x64, - 0x5c, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x33, 0xea, 0x02, - 0x1d, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x3a, 0x3a, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x3a, 0x3a, - 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x33, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_google_monitoring_v3_uptime_proto_rawDesc = "" + + "\n" + + "!google/monitoring/v3/uptime.proto\x12\x14google.monitoring.v3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a#google/api/monitored_resource.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\"\xa1\x02\n" + + "\x0fInternalChecker\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12!\n" + + "\fdisplay_name\x18\x02 \x01(\tR\vdisplayName\x12\x18\n" + + "\anetwork\x18\x03 \x01(\tR\anetwork\x12\x19\n" + + "\bgcp_zone\x18\x04 \x01(\tR\agcpZone\x12&\n" + + "\x0fpeer_project_id\x18\x06 \x01(\tR\rpeerProjectId\x12A\n" + + "\x05state\x18\a \x01(\x0e2+.google.monitoring.v3.InternalChecker.StateR\x05state\"3\n" + + "\x05State\x12\x0f\n" + + "\vUNSPECIFIED\x10\x00\x12\f\n" + + "\bCREATING\x10\x01\x12\v\n" + + "\aRUNNING\x10\x02:\x02\x18\x01\"\xc4\x02\n" + + "\x16SyntheticMonitorTarget\x12p\n" + + "\x11cloud_function_v2\x18\x01 \x01(\v2B.google.monitoring.v3.SyntheticMonitorTarget.CloudFunctionV2TargetH\x00R\x0fcloudFunctionV2\x1a\xad\x01\n" + + "\x15CloudFunctionV2Target\x12B\n" + + "\x04name\x18\x01 \x01(\tB.\xe0A\x02\xfaA(\n" + + "&cloudfunctions.googleapis.com/FunctionR\x04name\x12P\n" + + "\x12cloud_run_revision\x18\x02 \x01(\v2\x1d.google.api.MonitoredResourceB\x03\xe0A\x03R\x10cloudRunRevisionB\b\n" + + "\x06target\"\x94#\n" + + "\x11UptimeCheckConfig\x12\x17\n" + + "\x04name\x18\x01 \x01(\tB\x03\xe0A\bR\x04name\x12!\n" + + "\fdisplay_name\x18\x02 \x01(\tR\vdisplayName\x12N\n" + + "\x12monitored_resource\x18\x03 \x01(\v2\x1d.google.api.MonitoredResourceH\x00R\x11monitoredResource\x12^\n" + + "\x0eresource_group\x18\x04 \x01(\v25.google.monitoring.v3.UptimeCheckConfig.ResourceGroupH\x00R\rresourceGroup\x12[\n" + + "\x11synthetic_monitor\x18\x15 \x01(\v2,.google.monitoring.v3.SyntheticMonitorTargetH\x00R\x10syntheticMonitor\x12R\n" + + "\n" + + "http_check\x18\x05 \x01(\v21.google.monitoring.v3.UptimeCheckConfig.HttpCheckH\x01R\thttpCheck\x12O\n" + + "\ttcp_check\x18\x06 \x01(\v20.google.monitoring.v3.UptimeCheckConfig.TcpCheckH\x01R\btcpCheck\x121\n" + + "\x06period\x18\a \x01(\v2\x19.google.protobuf.DurationR\x06period\x123\n" + + "\atimeout\x18\b \x01(\v2\x19.google.protobuf.DurationR\atimeout\x12a\n" + + "\x10content_matchers\x18\t \x03(\v26.google.monitoring.v3.UptimeCheckConfig.ContentMatcherR\x0fcontentMatchers\x12V\n" + + "\fchecker_type\x18\x11 \x01(\x0e23.google.monitoring.v3.UptimeCheckConfig.CheckerTypeR\vcheckerType\x12R\n" + + "\x10selected_regions\x18\n" + + " \x03(\x0e2'.google.monitoring.v3.UptimeCheckRegionR\x0fselectedRegions\x12#\n" + + "\vis_internal\x18\x0f \x01(\bB\x02\x18\x01R\n" + + "isInternal\x12V\n" + + "\x11internal_checkers\x18\x0e \x03(\v2%.google.monitoring.v3.InternalCheckerB\x02\x18\x01R\x10internalCheckers\x12X\n" + + "\vuser_labels\x18\x14 \x03(\v27.google.monitoring.v3.UptimeCheckConfig.UserLabelsEntryR\n" + + "userLabels\x1ax\n" + + "\rResourceGroup\x12\x19\n" + + "\bgroup_id\x18\x01 \x01(\tR\agroupId\x12L\n" + + "\rresource_type\x18\x02 \x01(\x0e2'.google.monitoring.v3.GroupResourceTypeR\fresourceType\x1a-\n" + + "\n" + + "PingConfig\x12\x1f\n" + + "\vpings_count\x18\x01 \x01(\x05R\n" + + "pingsCount\x1a\xef\x0e\n" + + "\tHttpCheck\x12f\n" + + "\x0erequest_method\x18\b \x01(\x0e2?.google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethodR\rrequestMethod\x12\x17\n" + + "\ause_ssl\x18\x01 \x01(\bR\x06useSsl\x12\x12\n" + + "\x04path\x18\x02 \x01(\tR\x04path\x12\x12\n" + + "\x04port\x18\x03 \x01(\x05R\x04port\x12b\n" + + "\tauth_info\x18\x04 \x01(\v2E.google.monitoring.v3.UptimeCheckConfig.HttpCheck.BasicAuthenticationR\bauthInfo\x12!\n" + + "\fmask_headers\x18\x05 \x01(\bR\vmaskHeaders\x12X\n" + + "\aheaders\x18\x06 \x03(\v2>.google.monitoring.v3.UptimeCheckConfig.HttpCheck.HeadersEntryR\aheaders\x12`\n" + + "\fcontent_type\x18\t \x01(\x0e2=.google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentTypeR\vcontentType\x12.\n" + + "\x13custom_content_type\x18\r \x01(\tR\x11customContentType\x12!\n" + + "\fvalidate_ssl\x18\a \x01(\bR\vvalidateSsl\x12\x12\n" + + "\x04body\x18\n" + + " \x01(\fR\x04body\x12\x89\x01\n" + + "\x1eaccepted_response_status_codes\x18\v \x03(\v2D.google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCodeR\x1bacceptedResponseStatusCodes\x12S\n" + + "\vping_config\x18\f \x01(\v22.google.monitoring.v3.UptimeCheckConfig.PingConfigR\n" + + "pingConfig\x12\x90\x01\n" + + "\x1cservice_agent_authentication\x18\x0e \x01(\v2L.google.monitoring.v3.UptimeCheckConfig.HttpCheck.ServiceAgentAuthenticationH\x00R\x1aserviceAgentAuthentication\x1aM\n" + + "\x13BasicAuthentication\x12\x1a\n" + + "\busername\x18\x01 \x01(\tR\busername\x12\x1a\n" + + "\bpassword\x18\x02 \x01(\tR\bpassword\x1a\xf6\x02\n" + + "\x12ResponseStatusCode\x12#\n" + + "\fstatus_value\x18\x01 \x01(\x05H\x00R\vstatusValue\x12u\n" + + "\fstatus_class\x18\x02 \x01(\x0e2P.google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode.StatusClassH\x00R\vstatusClass\"\xb4\x01\n" + + "\vStatusClass\x12\x1c\n" + + "\x18STATUS_CLASS_UNSPECIFIED\x10\x00\x12\x14\n" + + "\x10STATUS_CLASS_1XX\x10d\x12\x15\n" + + "\x10STATUS_CLASS_2XX\x10\xc8\x01\x12\x15\n" + + "\x10STATUS_CLASS_3XX\x10\xac\x02\x12\x15\n" + + "\x10STATUS_CLASS_4XX\x10\x90\x03\x12\x15\n" + + "\x10STATUS_CLASS_5XX\x10\xf4\x03\x12\x15\n" + + "\x10STATUS_CLASS_ANY\x10\xe8\aB\r\n" + + "\vstatus_code\x1a\x82\x02\n" + + "\x1aServiceAgentAuthentication\x12\x7f\n" + + "\x04type\x18\x01 \x01(\x0e2k.google.monitoring.v3.UptimeCheckConfig.HttpCheck.ServiceAgentAuthentication.ServiceAgentAuthenticationTypeR\x04type\"c\n" + + "\x1eServiceAgentAuthenticationType\x121\n" + + "-SERVICE_AGENT_AUTHENTICATION_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n" + + "\n" + + "OIDC_TOKEN\x10\x01\x1a:\n" + + "\fHeadersEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\":\n" + + "\rRequestMethod\x12\x16\n" + + "\x12METHOD_UNSPECIFIED\x10\x00\x12\a\n" + + "\x03GET\x10\x01\x12\b\n" + + "\x04POST\x10\x02\"G\n" + + "\vContentType\x12\x14\n" + + "\x10TYPE_UNSPECIFIED\x10\x00\x12\x0f\n" + + "\vURL_ENCODED\x10\x01\x12\x11\n" + + "\rUSER_PROVIDED\x10\x02B\r\n" + + "\vauth_method\x1as\n" + + "\bTcpCheck\x12\x12\n" + + "\x04port\x18\x01 \x01(\x05R\x04port\x12S\n" + + "\vping_config\x18\x02 \x01(\v22.google.monitoring.v3.UptimeCheckConfig.PingConfigR\n" + + "pingConfig\x1a\x84\x06\n" + + "\x0eContentMatcher\x12\x18\n" + + "\acontent\x18\x01 \x01(\tR\acontent\x12e\n" + + "\amatcher\x18\x02 \x01(\x0e2K.google.monitoring.v3.UptimeCheckConfig.ContentMatcher.ContentMatcherOptionR\amatcher\x12t\n" + + "\x11json_path_matcher\x18\x03 \x01(\v2F.google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcherH\x00R\x0fjsonPathMatcher\x1a\x94\x02\n" + + "\x0fJsonPathMatcher\x12\x1b\n" + + "\tjson_path\x18\x01 \x01(\tR\bjsonPath\x12\x7f\n" + + "\fjson_matcher\x18\x02 \x01(\x0e2\\.google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher.JsonPathMatcherOptionR\vjsonMatcher\"c\n" + + "\x15JsonPathMatcherOption\x12(\n" + + "$JSON_PATH_MATCHER_OPTION_UNSPECIFIED\x10\x00\x12\x0f\n" + + "\vEXACT_MATCH\x10\x01\x12\x0f\n" + + "\vREGEX_MATCH\x10\x02\"\xc8\x01\n" + + "\x14ContentMatcherOption\x12&\n" + + "\"CONTENT_MATCHER_OPTION_UNSPECIFIED\x10\x00\x12\x13\n" + + "\x0fCONTAINS_STRING\x10\x01\x12\x17\n" + + "\x13NOT_CONTAINS_STRING\x10\x02\x12\x11\n" + + "\rMATCHES_REGEX\x10\x03\x12\x15\n" + + "\x11NOT_MATCHES_REGEX\x10\x04\x12\x15\n" + + "\x11MATCHES_JSON_PATH\x10\x05\x12\x19\n" + + "\x15NOT_MATCHES_JSON_PATH\x10\x06B\x19\n" + + "\x17additional_matcher_info\x1a=\n" + + "\x0fUserLabelsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"U\n" + + "\vCheckerType\x12\x1c\n" + + "\x18CHECKER_TYPE_UNSPECIFIED\x10\x00\x12\x16\n" + + "\x12STATIC_IP_CHECKERS\x10\x01\x12\x10\n" + + "\fVPC_CHECKERS\x10\x03:\xf3\x01\xeaA\xef\x01\n" + + "+monitoring.googleapis.com/UptimeCheckConfig\x12;projects/{project}/uptimeCheckConfigs/{uptime_check_config}\x12Eorganizations/{organization}/uptimeCheckConfigs/{uptime_check_config}\x129folders/{folder}/uptimeCheckConfigs/{uptime_check_config}\x12\x01*B\n" + + "\n" + + "\bresourceB\x14\n" + + "\x12check_request_type\"\x8b\x01\n" + + "\rUptimeCheckIp\x12?\n" + + "\x06region\x18\x01 \x01(\x0e2'.google.monitoring.v3.UptimeCheckRegionR\x06region\x12\x1a\n" + + "\blocation\x18\x02 \x01(\tR\blocation\x12\x1d\n" + + "\n" + + "ip_address\x18\x03 \x01(\tR\tipAddress*\x95\x01\n" + + "\x11UptimeCheckRegion\x12\x16\n" + + "\x12REGION_UNSPECIFIED\x10\x00\x12\a\n" + + "\x03USA\x10\x01\x12\n" + + "\n" + + "\x06EUROPE\x10\x02\x12\x11\n" + + "\rSOUTH_AMERICA\x10\x03\x12\x10\n" + + "\fASIA_PACIFIC\x10\x04\x12\x0e\n" + + "\n" + + "USA_OREGON\x10\x05\x12\f\n" + + "\bUSA_IOWA\x10\x06\x12\x10\n" + + "\fUSA_VIRGINIA\x10\a*[\n" + + "\x11GroupResourceType\x12\x1d\n" + + "\x19RESOURCE_TYPE_UNSPECIFIED\x10\x00\x12\f\n" + + "\bINSTANCE\x10\x01\x12\x19\n" + + "\x15AWS_ELB_LOAD_BALANCER\x10\x02B\xaf\x02\xeaAf\n" + + "&cloudfunctions.googleapis.com/Function\x12/v3/{uptime_check_config.name=projects/*/uptimeCheckConfigs/*}\x12\xa2\x01\n" + + "\x17DeleteUptimeCheckConfig\x124.google.monitoring.v3.DeleteUptimeCheckConfigRequest\x1a\x16.google.protobuf.Empty\"9\xdaA\x04name\x82\xd3\xe4\x93\x02,**/v3/{name=projects/*/uptimeCheckConfigs/*}\x12\x93\x01\n" + + "\x12ListUptimeCheckIps\x12/.google.monitoring.v3.ListUptimeCheckIpsRequest\x1a0.google.monitoring.v3.ListUptimeCheckIpsResponse\"\x1a\x82\xd3\xe4\x93\x02\x14\x12\x12/v3/uptimeCheckIps\x1a\xa9\x01\xcaA\x19monitoring.googleapis.com\xd2A\x89\x01https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.readB\xcd\x01\n" + + "\x18com.google.monitoring.v3B\x12UptimeServiceProtoP\x01ZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpb\xaa\x02\x1aGoogle.Cloud.Monitoring.V3\xca\x02\x1aGoogle\\Cloud\\Monitoring\\V3\xea\x02\x1dGoogle::Cloud::Monitoring::V3b\x06proto3" var ( file_google_monitoring_v3_uptime_service_proto_rawDescOnce sync.Once - file_google_monitoring_v3_uptime_service_proto_rawDescData = file_google_monitoring_v3_uptime_service_proto_rawDesc + file_google_monitoring_v3_uptime_service_proto_rawDescData []byte ) func file_google_monitoring_v3_uptime_service_proto_rawDescGZIP() []byte { file_google_monitoring_v3_uptime_service_proto_rawDescOnce.Do(func() { - file_google_monitoring_v3_uptime_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_monitoring_v3_uptime_service_proto_rawDescData) + file_google_monitoring_v3_uptime_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_uptime_service_proto_rawDesc), len(file_google_monitoring_v3_uptime_service_proto_rawDesc))) }) return file_google_monitoring_v3_uptime_service_proto_rawDescData } @@ -806,7 +648,7 @@ func file_google_monitoring_v3_uptime_service_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_monitoring_v3_uptime_service_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_monitoring_v3_uptime_service_proto_rawDesc), len(file_google_monitoring_v3_uptime_service_proto_rawDesc)), NumEnums: 0, NumMessages: 8, NumExtensions: 0, @@ -817,7 +659,6 @@ func file_google_monitoring_v3_uptime_service_proto_init() { MessageInfos: file_google_monitoring_v3_uptime_service_proto_msgTypes, }.Build() File_google_monitoring_v3_uptime_service_proto = out.File - file_google_monitoring_v3_uptime_service_proto_rawDesc = nil file_google_monitoring_v3_uptime_service_proto_goTypes = nil file_google_monitoring_v3_uptime_service_proto_depIdxs = nil } diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service_grpc.pb.go index 4fd7c67a3f9..40727e4e8af 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service_grpc.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service_grpc.pb.go @@ -15,13 +15,14 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.7 +// - protoc v6.33.2 // source: google/monitoring/v3/uptime_service.proto package monitoringpb import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/notification_channel_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/notification_channel_client.go index 6eac8ffe5ef..80462496d17 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/notification_channel_client.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/notification_channel_client.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -26,6 +26,7 @@ import ( monitoringpb "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb" gax "github.com/googleapis/gax-go/v2" + "github.com/googleapis/gax-go/v2/callctx" "google.golang.org/api/iterator" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" @@ -60,6 +61,7 @@ func defaultNotificationChannelGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultAudience("https://monitoring.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), internaloption.EnableJwtWithScope(), + internaloption.AllowHardBoundTokens("MTLS_S2A"), internaloption.EnableNewAuthLibrary(), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), @@ -341,6 +343,16 @@ type notificationChannelGRPCClient struct { // controls how messages related to incidents are sent. func NewNotificationChannelClient(ctx context.Context, opts ...option.ClientOption) (*NotificationChannelClient, error) { clientOpts := defaultNotificationChannelGRPCClientOptions() + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{ + "gcp.client.service": "monitoring", + "gcp.client.version": getVersionClient(), + "gcp.client.repo": "googleapis/google-cloud-go", + "gcp.client.artifact": "cloud.google.com/go/monitoring/apiv3/v2", + "gcp.client.language": "go", + "url.domain": "monitoring.googleapis.com", + })) + } if newNotificationChannelClientHook != nil { hookOpts, err := newNotificationChannelClientHook(ctx, clientHookParams{}) if err != nil { @@ -362,6 +374,29 @@ func NewNotificationChannelClient(ctx context.Context, opts ...option.ClientOpti logger: internaloption.GetLogger(opts), } c.setGoogleClientInfo() + if gax.IsFeatureEnabled("METRICS") { + metrics := gax.NewClientMetrics( + gax.WithTelemetryLogger(c.logger), + gax.WithTelemetryAttributes(map[string]string{ + gax.ClientService: "monitoring", + gax.ClientVersion: getVersionClient(), + gax.ClientArtifact: "cloud.google.com/go/monitoring/apiv3/v2", + gax.RPCSystem: "grpc", + gax.URLDomain: "monitoring.googleapis.com", + }), + ) + + client.CallOptions.ListNotificationChannelDescriptors = append(client.CallOptions.ListNotificationChannelDescriptors, gax.WithClientMetrics(metrics)) + client.CallOptions.GetNotificationChannelDescriptor = append(client.CallOptions.GetNotificationChannelDescriptor, gax.WithClientMetrics(metrics)) + client.CallOptions.ListNotificationChannels = append(client.CallOptions.ListNotificationChannels, gax.WithClientMetrics(metrics)) + client.CallOptions.GetNotificationChannel = append(client.CallOptions.GetNotificationChannel, gax.WithClientMetrics(metrics)) + client.CallOptions.CreateNotificationChannel = append(client.CallOptions.CreateNotificationChannel, gax.WithClientMetrics(metrics)) + client.CallOptions.UpdateNotificationChannel = append(client.CallOptions.UpdateNotificationChannel, gax.WithClientMetrics(metrics)) + client.CallOptions.DeleteNotificationChannel = append(client.CallOptions.DeleteNotificationChannel, gax.WithClientMetrics(metrics)) + client.CallOptions.SendNotificationChannelVerificationCode = append(client.CallOptions.SendNotificationChannelVerificationCode, gax.WithClientMetrics(metrics)) + client.CallOptions.GetNotificationChannelVerificationCode = append(client.CallOptions.GetNotificationChannelVerificationCode, gax.WithClientMetrics(metrics)) + client.CallOptions.VerifyNotificationChannel = append(client.CallOptions.VerifyNotificationChannel, gax.WithClientMetrics(metrics)) + } client.internalClient = c @@ -398,9 +433,15 @@ func (c *notificationChannelGRPCClient) ListNotificationChannelDescriptors(ctx c hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/ListNotificationChannelDescriptors") + } opts = append((*c.CallOptions).ListNotificationChannelDescriptors[0:len((*c.CallOptions).ListNotificationChannelDescriptors):len((*c.CallOptions).ListNotificationChannelDescriptors)], opts...) it := &NotificationChannelDescriptorIterator{} - req = proto.Clone(req).(*monitoringpb.ListNotificationChannelDescriptorsRequest) + req = proto.CloneOf(req) it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoringpb.NotificationChannelDescriptor, string, error) { resp := &monitoringpb.ListNotificationChannelDescriptorsResponse{} if pageToken != "" { @@ -444,6 +485,12 @@ func (c *notificationChannelGRPCClient) GetNotificationChannelDescriptor(ctx con hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/GetNotificationChannelDescriptor") + } opts = append((*c.CallOptions).GetNotificationChannelDescriptor[0:len((*c.CallOptions).GetNotificationChannelDescriptor):len((*c.CallOptions).GetNotificationChannelDescriptor)], opts...) var resp *monitoringpb.NotificationChannelDescriptor err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -462,9 +509,15 @@ func (c *notificationChannelGRPCClient) ListNotificationChannels(ctx context.Con hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/ListNotificationChannels") + } opts = append((*c.CallOptions).ListNotificationChannels[0:len((*c.CallOptions).ListNotificationChannels):len((*c.CallOptions).ListNotificationChannels)], opts...) it := &NotificationChannelIterator{} - req = proto.Clone(req).(*monitoringpb.ListNotificationChannelsRequest) + req = proto.CloneOf(req) it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoringpb.NotificationChannel, string, error) { resp := &monitoringpb.ListNotificationChannelsResponse{} if pageToken != "" { @@ -508,6 +561,12 @@ func (c *notificationChannelGRPCClient) GetNotificationChannel(ctx context.Conte hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/GetNotificationChannel") + } opts = append((*c.CallOptions).GetNotificationChannel[0:len((*c.CallOptions).GetNotificationChannel):len((*c.CallOptions).GetNotificationChannel)], opts...) var resp *monitoringpb.NotificationChannel err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -526,6 +585,12 @@ func (c *notificationChannelGRPCClient) CreateNotificationChannel(ctx context.Co hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/CreateNotificationChannel") + } opts = append((*c.CallOptions).CreateNotificationChannel[0:len((*c.CallOptions).CreateNotificationChannel):len((*c.CallOptions).CreateNotificationChannel)], opts...) var resp *monitoringpb.NotificationChannel err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -544,6 +609,9 @@ func (c *notificationChannelGRPCClient) UpdateNotificationChannel(ctx context.Co hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/UpdateNotificationChannel") + } opts = append((*c.CallOptions).UpdateNotificationChannel[0:len((*c.CallOptions).UpdateNotificationChannel):len((*c.CallOptions).UpdateNotificationChannel)], opts...) var resp *monitoringpb.NotificationChannel err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -562,6 +630,12 @@ func (c *notificationChannelGRPCClient) DeleteNotificationChannel(ctx context.Co hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/DeleteNotificationChannel") + } opts = append((*c.CallOptions).DeleteNotificationChannel[0:len((*c.CallOptions).DeleteNotificationChannel):len((*c.CallOptions).DeleteNotificationChannel)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error @@ -576,6 +650,12 @@ func (c *notificationChannelGRPCClient) SendNotificationChannelVerificationCode( hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/SendNotificationChannelVerificationCode") + } opts = append((*c.CallOptions).SendNotificationChannelVerificationCode[0:len((*c.CallOptions).SendNotificationChannelVerificationCode):len((*c.CallOptions).SendNotificationChannelVerificationCode)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error @@ -590,6 +670,12 @@ func (c *notificationChannelGRPCClient) GetNotificationChannelVerificationCode(c hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/GetNotificationChannelVerificationCode") + } opts = append((*c.CallOptions).GetNotificationChannelVerificationCode[0:len((*c.CallOptions).GetNotificationChannelVerificationCode):len((*c.CallOptions).GetNotificationChannelVerificationCode)], opts...) var resp *monitoringpb.GetNotificationChannelVerificationCodeResponse err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -608,6 +694,12 @@ func (c *notificationChannelGRPCClient) VerifyNotificationChannel(ctx context.Co hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/VerifyNotificationChannel") + } opts = append((*c.CallOptions).VerifyNotificationChannel[0:len((*c.CallOptions).VerifyNotificationChannel):len((*c.CallOptions).VerifyNotificationChannel)], opts...) var resp *monitoringpb.NotificationChannel err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/query_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/query_client.go index 97fb19974d8..236a85b2326 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/query_client.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/query_client.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ import ( monitoringpb "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb" gax "github.com/googleapis/gax-go/v2" + "github.com/googleapis/gax-go/v2/callctx" "google.golang.org/api/iterator" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" @@ -49,6 +50,7 @@ func defaultQueryGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultAudience("https://monitoring.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), internaloption.EnableJwtWithScope(), + internaloption.AllowHardBoundTokens("MTLS_S2A"), internaloption.EnableNewAuthLibrary(), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), @@ -143,6 +145,16 @@ type queryGRPCClient struct { // the time-varying values of a metric. func NewQueryClient(ctx context.Context, opts ...option.ClientOption) (*QueryClient, error) { clientOpts := defaultQueryGRPCClientOptions() + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{ + "gcp.client.service": "monitoring", + "gcp.client.version": getVersionClient(), + "gcp.client.repo": "googleapis/google-cloud-go", + "gcp.client.artifact": "cloud.google.com/go/monitoring/apiv3/v2", + "gcp.client.language": "go", + "url.domain": "monitoring.googleapis.com", + })) + } if newQueryClientHook != nil { hookOpts, err := newQueryClientHook(ctx, clientHookParams{}) if err != nil { @@ -164,6 +176,20 @@ func NewQueryClient(ctx context.Context, opts ...option.ClientOption) (*QueryCli logger: internaloption.GetLogger(opts), } c.setGoogleClientInfo() + if gax.IsFeatureEnabled("METRICS") { + metrics := gax.NewClientMetrics( + gax.WithTelemetryLogger(c.logger), + gax.WithTelemetryAttributes(map[string]string{ + gax.ClientService: "monitoring", + gax.ClientVersion: getVersionClient(), + gax.ClientArtifact: "cloud.google.com/go/monitoring/apiv3/v2", + gax.RPCSystem: "grpc", + gax.URLDomain: "monitoring.googleapis.com", + }), + ) + + client.CallOptions.QueryTimeSeries = append(client.CallOptions.QueryTimeSeries, gax.WithClientMetrics(metrics)) + } client.internalClient = c @@ -200,9 +226,12 @@ func (c *queryGRPCClient) QueryTimeSeries(ctx context.Context, req *monitoringpb hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.QueryService/QueryTimeSeries") + } opts = append((*c.CallOptions).QueryTimeSeries[0:len((*c.CallOptions).QueryTimeSeries):len((*c.CallOptions).QueryTimeSeries)], opts...) it := &TimeSeriesDataIterator{} - req = proto.Clone(req).(*monitoringpb.QueryTimeSeriesRequest) + req = proto.CloneOf(req) it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoringpb.TimeSeriesData, string, error) { resp := &monitoringpb.QueryTimeSeriesResponse{} if pageToken != "" { diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/service_monitoring_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/service_monitoring_client.go index 580f76a2a29..6498d81992a 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/service_monitoring_client.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/service_monitoring_client.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -26,6 +26,7 @@ import ( monitoringpb "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb" gax "github.com/googleapis/gax-go/v2" + "github.com/googleapis/gax-go/v2/callctx" "google.golang.org/api/iterator" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" @@ -60,6 +61,7 @@ func defaultServiceMonitoringGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultAudience("https://monitoring.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), internaloption.EnableJwtWithScope(), + internaloption.AllowHardBoundTokens("MTLS_S2A"), internaloption.EnableNewAuthLibrary(), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), @@ -288,6 +290,16 @@ type serviceMonitoringGRPCClient struct { // taxonomy of categorized Health Metrics. func NewServiceMonitoringClient(ctx context.Context, opts ...option.ClientOption) (*ServiceMonitoringClient, error) { clientOpts := defaultServiceMonitoringGRPCClientOptions() + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{ + "gcp.client.service": "monitoring", + "gcp.client.version": getVersionClient(), + "gcp.client.repo": "googleapis/google-cloud-go", + "gcp.client.artifact": "cloud.google.com/go/monitoring/apiv3/v2", + "gcp.client.language": "go", + "url.domain": "monitoring.googleapis.com", + })) + } if newServiceMonitoringClientHook != nil { hookOpts, err := newServiceMonitoringClientHook(ctx, clientHookParams{}) if err != nil { @@ -309,6 +321,29 @@ func NewServiceMonitoringClient(ctx context.Context, opts ...option.ClientOption logger: internaloption.GetLogger(opts), } c.setGoogleClientInfo() + if gax.IsFeatureEnabled("METRICS") { + metrics := gax.NewClientMetrics( + gax.WithTelemetryLogger(c.logger), + gax.WithTelemetryAttributes(map[string]string{ + gax.ClientService: "monitoring", + gax.ClientVersion: getVersionClient(), + gax.ClientArtifact: "cloud.google.com/go/monitoring/apiv3/v2", + gax.RPCSystem: "grpc", + gax.URLDomain: "monitoring.googleapis.com", + }), + ) + + client.CallOptions.CreateService = append(client.CallOptions.CreateService, gax.WithClientMetrics(metrics)) + client.CallOptions.GetService = append(client.CallOptions.GetService, gax.WithClientMetrics(metrics)) + client.CallOptions.ListServices = append(client.CallOptions.ListServices, gax.WithClientMetrics(metrics)) + client.CallOptions.UpdateService = append(client.CallOptions.UpdateService, gax.WithClientMetrics(metrics)) + client.CallOptions.DeleteService = append(client.CallOptions.DeleteService, gax.WithClientMetrics(metrics)) + client.CallOptions.CreateServiceLevelObjective = append(client.CallOptions.CreateServiceLevelObjective, gax.WithClientMetrics(metrics)) + client.CallOptions.GetServiceLevelObjective = append(client.CallOptions.GetServiceLevelObjective, gax.WithClientMetrics(metrics)) + client.CallOptions.ListServiceLevelObjectives = append(client.CallOptions.ListServiceLevelObjectives, gax.WithClientMetrics(metrics)) + client.CallOptions.UpdateServiceLevelObjective = append(client.CallOptions.UpdateServiceLevelObjective, gax.WithClientMetrics(metrics)) + client.CallOptions.DeleteServiceLevelObjective = append(client.CallOptions.DeleteServiceLevelObjective, gax.WithClientMetrics(metrics)) + } client.internalClient = c @@ -345,6 +380,12 @@ func (c *serviceMonitoringGRPCClient) CreateService(ctx context.Context, req *mo hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetParent())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/CreateService") + } opts = append((*c.CallOptions).CreateService[0:len((*c.CallOptions).CreateService):len((*c.CallOptions).CreateService)], opts...) var resp *monitoringpb.Service err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -363,6 +404,12 @@ func (c *serviceMonitoringGRPCClient) GetService(ctx context.Context, req *monit hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/GetService") + } opts = append((*c.CallOptions).GetService[0:len((*c.CallOptions).GetService):len((*c.CallOptions).GetService)], opts...) var resp *monitoringpb.Service err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -381,9 +428,15 @@ func (c *serviceMonitoringGRPCClient) ListServices(ctx context.Context, req *mon hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetParent())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/ListServices") + } opts = append((*c.CallOptions).ListServices[0:len((*c.CallOptions).ListServices):len((*c.CallOptions).ListServices)], opts...) it := &ServiceIterator{} - req = proto.Clone(req).(*monitoringpb.ListServicesRequest) + req = proto.CloneOf(req) it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoringpb.Service, string, error) { resp := &monitoringpb.ListServicesResponse{} if pageToken != "" { @@ -427,6 +480,9 @@ func (c *serviceMonitoringGRPCClient) UpdateService(ctx context.Context, req *mo hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/UpdateService") + } opts = append((*c.CallOptions).UpdateService[0:len((*c.CallOptions).UpdateService):len((*c.CallOptions).UpdateService)], opts...) var resp *monitoringpb.Service err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -445,6 +501,12 @@ func (c *serviceMonitoringGRPCClient) DeleteService(ctx context.Context, req *mo hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/DeleteService") + } opts = append((*c.CallOptions).DeleteService[0:len((*c.CallOptions).DeleteService):len((*c.CallOptions).DeleteService)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error @@ -459,6 +521,12 @@ func (c *serviceMonitoringGRPCClient) CreateServiceLevelObjective(ctx context.Co hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetParent())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/CreateServiceLevelObjective") + } opts = append((*c.CallOptions).CreateServiceLevelObjective[0:len((*c.CallOptions).CreateServiceLevelObjective):len((*c.CallOptions).CreateServiceLevelObjective)], opts...) var resp *monitoringpb.ServiceLevelObjective err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -477,6 +545,12 @@ func (c *serviceMonitoringGRPCClient) GetServiceLevelObjective(ctx context.Conte hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/GetServiceLevelObjective") + } opts = append((*c.CallOptions).GetServiceLevelObjective[0:len((*c.CallOptions).GetServiceLevelObjective):len((*c.CallOptions).GetServiceLevelObjective)], opts...) var resp *monitoringpb.ServiceLevelObjective err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -495,9 +569,15 @@ func (c *serviceMonitoringGRPCClient) ListServiceLevelObjectives(ctx context.Con hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetParent())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/ListServiceLevelObjectives") + } opts = append((*c.CallOptions).ListServiceLevelObjectives[0:len((*c.CallOptions).ListServiceLevelObjectives):len((*c.CallOptions).ListServiceLevelObjectives)], opts...) it := &ServiceLevelObjectiveIterator{} - req = proto.Clone(req).(*monitoringpb.ListServiceLevelObjectivesRequest) + req = proto.CloneOf(req) it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoringpb.ServiceLevelObjective, string, error) { resp := &monitoringpb.ListServiceLevelObjectivesResponse{} if pageToken != "" { @@ -541,6 +621,9 @@ func (c *serviceMonitoringGRPCClient) UpdateServiceLevelObjective(ctx context.Co hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/UpdateServiceLevelObjective") + } opts = append((*c.CallOptions).UpdateServiceLevelObjective[0:len((*c.CallOptions).UpdateServiceLevelObjective):len((*c.CallOptions).UpdateServiceLevelObjective)], opts...) var resp *monitoringpb.ServiceLevelObjective err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -559,6 +642,12 @@ func (c *serviceMonitoringGRPCClient) DeleteServiceLevelObjective(ctx context.Co hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/DeleteServiceLevelObjective") + } opts = append((*c.CallOptions).DeleteServiceLevelObjective[0:len((*c.CallOptions).DeleteServiceLevelObjective):len((*c.CallOptions).DeleteServiceLevelObjective)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/snooze_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/snooze_client.go index 52f36302fac..1e325ecd34b 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/snooze_client.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/snooze_client.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -26,6 +26,7 @@ import ( monitoringpb "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb" gax "github.com/googleapis/gax-go/v2" + "github.com/googleapis/gax-go/v2/callctx" "google.golang.org/api/iterator" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" @@ -54,6 +55,7 @@ func defaultSnoozeGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultAudience("https://monitoring.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), internaloption.EnableJwtWithScope(), + internaloption.AllowHardBoundTokens("MTLS_S2A"), internaloption.EnableNewAuthLibrary(), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), @@ -194,6 +196,16 @@ type snoozeGRPCClient struct { // or more alert policies should not fire alerts for the specified duration. func NewSnoozeClient(ctx context.Context, opts ...option.ClientOption) (*SnoozeClient, error) { clientOpts := defaultSnoozeGRPCClientOptions() + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{ + "gcp.client.service": "monitoring", + "gcp.client.version": getVersionClient(), + "gcp.client.repo": "googleapis/google-cloud-go", + "gcp.client.artifact": "cloud.google.com/go/monitoring/apiv3/v2", + "gcp.client.language": "go", + "url.domain": "monitoring.googleapis.com", + })) + } if newSnoozeClientHook != nil { hookOpts, err := newSnoozeClientHook(ctx, clientHookParams{}) if err != nil { @@ -215,6 +227,23 @@ func NewSnoozeClient(ctx context.Context, opts ...option.ClientOption) (*SnoozeC logger: internaloption.GetLogger(opts), } c.setGoogleClientInfo() + if gax.IsFeatureEnabled("METRICS") { + metrics := gax.NewClientMetrics( + gax.WithTelemetryLogger(c.logger), + gax.WithTelemetryAttributes(map[string]string{ + gax.ClientService: "monitoring", + gax.ClientVersion: getVersionClient(), + gax.ClientArtifact: "cloud.google.com/go/monitoring/apiv3/v2", + gax.RPCSystem: "grpc", + gax.URLDomain: "monitoring.googleapis.com", + }), + ) + + client.CallOptions.CreateSnooze = append(client.CallOptions.CreateSnooze, gax.WithClientMetrics(metrics)) + client.CallOptions.ListSnoozes = append(client.CallOptions.ListSnoozes, gax.WithClientMetrics(metrics)) + client.CallOptions.GetSnooze = append(client.CallOptions.GetSnooze, gax.WithClientMetrics(metrics)) + client.CallOptions.UpdateSnooze = append(client.CallOptions.UpdateSnooze, gax.WithClientMetrics(metrics)) + } client.internalClient = c @@ -251,6 +280,12 @@ func (c *snoozeGRPCClient) CreateSnooze(ctx context.Context, req *monitoringpb.C hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetParent())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.SnoozeService/CreateSnooze") + } opts = append((*c.CallOptions).CreateSnooze[0:len((*c.CallOptions).CreateSnooze):len((*c.CallOptions).CreateSnooze)], opts...) var resp *monitoringpb.Snooze err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -269,9 +304,15 @@ func (c *snoozeGRPCClient) ListSnoozes(ctx context.Context, req *monitoringpb.Li hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetParent())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.SnoozeService/ListSnoozes") + } opts = append((*c.CallOptions).ListSnoozes[0:len((*c.CallOptions).ListSnoozes):len((*c.CallOptions).ListSnoozes)], opts...) it := &SnoozeIterator{} - req = proto.Clone(req).(*monitoringpb.ListSnoozesRequest) + req = proto.CloneOf(req) it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoringpb.Snooze, string, error) { resp := &monitoringpb.ListSnoozesResponse{} if pageToken != "" { @@ -315,6 +356,12 @@ func (c *snoozeGRPCClient) GetSnooze(ctx context.Context, req *monitoringpb.GetS hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.SnoozeService/GetSnooze") + } opts = append((*c.CallOptions).GetSnooze[0:len((*c.CallOptions).GetSnooze):len((*c.CallOptions).GetSnooze)], opts...) var resp *monitoringpb.Snooze err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -333,6 +380,9 @@ func (c *snoozeGRPCClient) UpdateSnooze(ctx context.Context, req *monitoringpb.U hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.SnoozeService/UpdateSnooze") + } opts = append((*c.CallOptions).UpdateSnooze[0:len((*c.CallOptions).UpdateSnooze):len((*c.CallOptions).UpdateSnooze)], opts...) var resp *monitoringpb.Snooze err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/uptime_check_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/uptime_check_client.go index 7e2aed8c800..d120f4b4eb0 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/uptime_check_client.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/uptime_check_client.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -26,6 +26,7 @@ import ( monitoringpb "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb" gax "github.com/googleapis/gax-go/v2" + "github.com/googleapis/gax-go/v2/callctx" "google.golang.org/api/iterator" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" @@ -56,6 +57,7 @@ func defaultUptimeCheckGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultAudience("https://monitoring.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), internaloption.EnableJwtWithScope(), + internaloption.AllowHardBoundTokens("MTLS_S2A"), internaloption.EnableNewAuthLibrary(), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), @@ -244,6 +246,16 @@ type uptimeCheckGRPCClient struct { // Monitoring, and then clicking on “Uptime”. func NewUptimeCheckClient(ctx context.Context, opts ...option.ClientOption) (*UptimeCheckClient, error) { clientOpts := defaultUptimeCheckGRPCClientOptions() + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{ + "gcp.client.service": "monitoring", + "gcp.client.version": getVersionClient(), + "gcp.client.repo": "googleapis/google-cloud-go", + "gcp.client.artifact": "cloud.google.com/go/monitoring/apiv3/v2", + "gcp.client.language": "go", + "url.domain": "monitoring.googleapis.com", + })) + } if newUptimeCheckClientHook != nil { hookOpts, err := newUptimeCheckClientHook(ctx, clientHookParams{}) if err != nil { @@ -265,6 +277,25 @@ func NewUptimeCheckClient(ctx context.Context, opts ...option.ClientOption) (*Up logger: internaloption.GetLogger(opts), } c.setGoogleClientInfo() + if gax.IsFeatureEnabled("METRICS") { + metrics := gax.NewClientMetrics( + gax.WithTelemetryLogger(c.logger), + gax.WithTelemetryAttributes(map[string]string{ + gax.ClientService: "monitoring", + gax.ClientVersion: getVersionClient(), + gax.ClientArtifact: "cloud.google.com/go/monitoring/apiv3/v2", + gax.RPCSystem: "grpc", + gax.URLDomain: "monitoring.googleapis.com", + }), + ) + + client.CallOptions.ListUptimeCheckConfigs = append(client.CallOptions.ListUptimeCheckConfigs, gax.WithClientMetrics(metrics)) + client.CallOptions.GetUptimeCheckConfig = append(client.CallOptions.GetUptimeCheckConfig, gax.WithClientMetrics(metrics)) + client.CallOptions.CreateUptimeCheckConfig = append(client.CallOptions.CreateUptimeCheckConfig, gax.WithClientMetrics(metrics)) + client.CallOptions.UpdateUptimeCheckConfig = append(client.CallOptions.UpdateUptimeCheckConfig, gax.WithClientMetrics(metrics)) + client.CallOptions.DeleteUptimeCheckConfig = append(client.CallOptions.DeleteUptimeCheckConfig, gax.WithClientMetrics(metrics)) + client.CallOptions.ListUptimeCheckIps = append(client.CallOptions.ListUptimeCheckIps, gax.WithClientMetrics(metrics)) + } client.internalClient = c @@ -301,9 +332,15 @@ func (c *uptimeCheckGRPCClient) ListUptimeCheckConfigs(ctx context.Context, req hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetParent())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.UptimeCheckService/ListUptimeCheckConfigs") + } opts = append((*c.CallOptions).ListUptimeCheckConfigs[0:len((*c.CallOptions).ListUptimeCheckConfigs):len((*c.CallOptions).ListUptimeCheckConfigs)], opts...) it := &UptimeCheckConfigIterator{} - req = proto.Clone(req).(*monitoringpb.ListUptimeCheckConfigsRequest) + req = proto.CloneOf(req) it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoringpb.UptimeCheckConfig, string, error) { resp := &monitoringpb.ListUptimeCheckConfigsResponse{} if pageToken != "" { @@ -347,6 +384,12 @@ func (c *uptimeCheckGRPCClient) GetUptimeCheckConfig(ctx context.Context, req *m hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.UptimeCheckService/GetUptimeCheckConfig") + } opts = append((*c.CallOptions).GetUptimeCheckConfig[0:len((*c.CallOptions).GetUptimeCheckConfig):len((*c.CallOptions).GetUptimeCheckConfig)], opts...) var resp *monitoringpb.UptimeCheckConfig err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -365,6 +408,12 @@ func (c *uptimeCheckGRPCClient) CreateUptimeCheckConfig(ctx context.Context, req hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetParent())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.UptimeCheckService/CreateUptimeCheckConfig") + } opts = append((*c.CallOptions).CreateUptimeCheckConfig[0:len((*c.CallOptions).CreateUptimeCheckConfig):len((*c.CallOptions).CreateUptimeCheckConfig)], opts...) var resp *monitoringpb.UptimeCheckConfig err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -383,6 +432,9 @@ func (c *uptimeCheckGRPCClient) UpdateUptimeCheckConfig(ctx context.Context, req hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.UptimeCheckService/UpdateUptimeCheckConfig") + } opts = append((*c.CallOptions).UpdateUptimeCheckConfig[0:len((*c.CallOptions).UpdateUptimeCheckConfig):len((*c.CallOptions).UpdateUptimeCheckConfig)], opts...) var resp *monitoringpb.UptimeCheckConfig err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -401,6 +453,12 @@ func (c *uptimeCheckGRPCClient) DeleteUptimeCheckConfig(ctx context.Context, req hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.UptimeCheckService/DeleteUptimeCheckConfig") + } opts = append((*c.CallOptions).DeleteUptimeCheckConfig[0:len((*c.CallOptions).DeleteUptimeCheckConfig):len((*c.CallOptions).DeleteUptimeCheckConfig)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error @@ -412,9 +470,12 @@ func (c *uptimeCheckGRPCClient) DeleteUptimeCheckConfig(ctx context.Context, req func (c *uptimeCheckGRPCClient) ListUptimeCheckIps(ctx context.Context, req *monitoringpb.ListUptimeCheckIpsRequest, opts ...gax.CallOption) *UptimeCheckIpIterator { ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.UptimeCheckService/ListUptimeCheckIps") + } opts = append((*c.CallOptions).ListUptimeCheckIps[0:len((*c.CallOptions).ListUptimeCheckIps):len((*c.CallOptions).ListUptimeCheckIps)], opts...) it := &UptimeCheckIpIterator{} - req = proto.Clone(req).(*monitoringpb.ListUptimeCheckIpsRequest) + req = proto.CloneOf(req) it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoringpb.UptimeCheckIp, string, error) { resp := &monitoringpb.ListUptimeCheckIpsResponse{} if pageToken != "" { diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/version.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/version.go index accff0f5e47..319e27ad3fa 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/version.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/version.go @@ -1,10 +1,10 @@ -// Copyright 2023 Google LLC +// Copyright 2026 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 +// https://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, diff --git a/vendor/cloud.google.com/go/monitoring/internal/version.go b/vendor/cloud.google.com/go/monitoring/internal/version.go index e68e8219435..6403eb8543b 100644 --- a/vendor/cloud.google.com/go/monitoring/internal/version.go +++ b/vendor/cloud.google.com/go/monitoring/internal/version.go @@ -1,10 +1,10 @@ -// Copyright 2022 Google LLC +// Copyright 2026 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 +// https://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, @@ -12,7 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +// Code generated by gapicgen. DO NOT EDIT. + package internal // Version is the current tagged release of the library. -const Version = "1.24.3" +const Version = "1.29.0" diff --git a/vendor/github.com/alicebob/miniredis/v2/CHANGELOG.md b/vendor/github.com/alicebob/miniredis/v2/CHANGELOG.md index 9b753d01393..8add3656755 100644 --- a/vendor/github.com/alicebob/miniredis/v2/CHANGELOG.md +++ b/vendor/github.com/alicebob/miniredis/v2/CHANGELOG.md @@ -1,6 +1,24 @@ ## Changelog +## v2.40.0 + +- support testing/synctest (thanks @alexluong) +- fix RENAME panic (thanks @gianzanuz) +- fix SetError() (thanks @WillAbides) +- fix LPOST COUNT (thanks @akezwang) +- support ZMPOP and BZMPOP (thanks @Lephiziel) +- fix HRANDFIELD (thanks @anuththedev) +- support LMPOP (thanks @LuisFigueroaG) + + +## v2.39.0 + +- support GEOSEARCH (thanks @fl4metf) +- support HPERSIST, HTTL, HPTTL, and HSETEX (thanks @adamrothman) +- support BZPOPMIN and BZPOPMAX (thanks @ChrisJr404) + + ## v2.38.0 - XADD TRIM (thanks @evan-choi) diff --git a/vendor/github.com/alicebob/miniredis/v2/README.md b/vendor/github.com/alicebob/miniredis/v2/README.md index 78e4d3247a7..27ad483c963 100644 --- a/vendor/github.com/alicebob/miniredis/v2/README.md +++ b/vendor/github.com/alicebob/miniredis/v2/README.md @@ -101,6 +101,7 @@ Implemented commands: - Hash keys - HDEL - HEXISTS + - HEXPIRE - HGET - HGETALL - HINCRBY @@ -109,10 +110,14 @@ Implemented commands: - HLEN - HMGET - HMSET + - HPERSIST + - HPTTL - HRANDFIELD - HSET + - HSETEX - HSETNX - HSTRLEN + - HTTL - HVALS - HSCAN - List keys @@ -122,6 +127,7 @@ Implemented commands: - LINDEX - LINSERT - LLEN + - LMPOP - LPOP - LPUSH - LPUSHX @@ -161,6 +167,9 @@ Implemented commands: - SUNION - SUNIONSTORE - Sorted Set keys + - BZMPOP + - BZPOPMAX + - BZPOPMIN - ZADD - ZCARD - ZCOUNT @@ -168,6 +177,7 @@ Implemented commands: - ZINTER - ZINTERSTORE - ZLEXCOUNT + - ZMPOP - ZPOPMIN - ZPOPMAX - ZRANDMEMBER @@ -222,6 +232,7 @@ Implemented commands: - GEORADIUS_RO - GEORADIUSBYMEMBER - GEORADIUSBYMEMBER_RO + - GEOSEARCH - Cluster - CLUSTER SLOTS - CLUSTER KEYSLOT @@ -250,6 +261,42 @@ which case time.Now() will be used. SetTime() also sets the value returned by TIME, which defaults to time.Now(). It is not updated by FastForward, only by SetTime. +`m.ClockTTL(true)` makes TTLs decrease as the clock (time.Now(), or the +SetTime() value) advances, instead of only via FastForward. Expired keys are +removed lazily, whenever a database is accessed via a command or a +Miniredis-level accessor. Combined with SetTime() the expiry stays coherent +with TIME and (P)EXPIREAT. Note that against the wall clock this makes expiry +depend on test execution speed, which is why it's not the default. + +## testing/synctest + +miniredis works inside a `testing/synctest` bubble (Go 1.25+). Since real TCP +connections can't be used there, connect with `m.Dial()`, which serves the +connection on an in-memory pipe — most redis clients accept it as a custom +dialer. `NewMiniRedis()` is the non-started constructor: with `Dial()` no +listener is ever created. Inside a bubble `time.Now()` is the bubble's fake +clock, so with `ClockTTL(true)` a plain `time.Sleep()` expires keys — no +FastForward needed: + +``` Go +synctest.Test(t, func(t *testing.T) { + m := miniredis.NewMiniRedis() + defer m.Close() + m.ClockTTL(true) + + client := redis.NewClient(&redis.Options{ + Dialer: func(ctx context.Context, _, _ string) (net.Conn, error) { + return m.Dial() + }, + }) + + ctx := context.Background() + client.Set(ctx, "session", "v", time.Hour) + time.Sleep(time.Hour + time.Second) // instant, and deterministic + // key is expired now +}) +``` + ## Randomness and Seed() Miniredis will use `math/rand`'s global RNG for randomness unless a seed is diff --git a/vendor/github.com/alicebob/miniredis/v2/cmd_cluster.go b/vendor/github.com/alicebob/miniredis/v2/cmd_cluster.go index 4f7c77f4264..f3c3168e2bb 100644 --- a/vendor/github.com/alicebob/miniredis/v2/cmd_cluster.go +++ b/vendor/github.com/alicebob/miniredis/v2/cmd_cluster.go @@ -48,8 +48,8 @@ func (m *Miniredis) cmdClusterSlots(c *server.Peer, cmd string, args []string) { c.WriteInt(0) c.WriteInt(16383) c.WriteLen(3) - c.WriteBulk(m.srv.Addr().IP.String()) - c.WriteInt(m.srv.Addr().Port) + c.WriteBulk(m.ip) + c.WriteInt(m.port) c.WriteBulk("09dbe9720cda62f7865eabc5fd8857c5d2678366") }) } @@ -65,19 +65,13 @@ func (m *Miniredis) cmdClusterKeySlot(c *server.Peer, cmd string, args []string) func (m *Miniredis) cmdClusterNodes(c *server.Peer, cmd string, args []string) { withTx(m, c, func(c *server.Peer, ctx *connCtx) { // do not try to use m.Addr() here, as m is blocked by this tx. - addr := m.srv.Addr() - port := m.srv.Addr().Port - c.WriteBulk(fmt.Sprintf("e7d1eecce10fd6bb5eb35b9f99a514335d9ba9ca %s@%d myself,master - 0 0 1 connected 0-16383", addr, port)) + c.WriteBulk(fmt.Sprintf("e7d1eecce10fd6bb5eb35b9f99a514335d9ba9ca %s:%d@%d myself,master - 0 0 1 connected 0-16383", m.ip, m.port, m.port)) }) } // CLUSTER SHARDS func (m *Miniredis) cmdClusterShards(c *server.Peer, cmd string, args []string) { withTx(m, c, func(c *server.Peer, ctx *connCtx) { - addr := m.srv.Addr() - host := addr.IP.String() - port := addr.Port - // Array of shards (we return 1 shard) c.WriteLen(1) @@ -105,10 +99,10 @@ func (m *Miniredis) cmdClusterShards(c *server.Peer, cmd string, args []string) //c.WriteBulk(host) // or host:port if your client expects that c.WriteBulk("ip") - c.WriteBulk(host) + c.WriteBulk(m.ip) c.WriteBulk("port") - c.WriteInt(port) + c.WriteInt(m.port) c.WriteBulk("role") c.WriteBulk("master") diff --git a/vendor/github.com/alicebob/miniredis/v2/cmd_geo.go b/vendor/github.com/alicebob/miniredis/v2/cmd_geo.go index 12cf99addec..10dad8bd496 100644 --- a/vendor/github.com/alicebob/miniredis/v2/cmd_geo.go +++ b/vendor/github.com/alicebob/miniredis/v2/cmd_geo.go @@ -20,6 +20,7 @@ func commandsGeo(m *Miniredis) { m.srv.Register("GEORADIUS_RO", m.cmdGeoradius, server.ReadOnlyOption()) m.srv.Register("GEORADIUSBYMEMBER", m.cmdGeoradiusbymember) m.srv.Register("GEORADIUSBYMEMBER_RO", m.cmdGeoradiusbymember, server.ReadOnlyOption()) + m.srv.Register("GEOSEARCH", m.cmdGeosearch, server.ReadOnlyOption()) } // GEOADD @@ -542,6 +543,257 @@ func (m *Miniredis) cmdGeoradiusbymember(c *server.Peer, cmd string, args []stri }) } +// GEOSEARCH +func (m *Miniredis) cmdGeosearch(c *server.Peer, cmd string, args []string) { + if !m.isValidCMD(c, cmd, args, atLeast(6)) { + return + } + + key, args := args[0], args[1:] + + var opts struct { + fromMember string + hasFromMember bool + longitude float64 + latitude float64 + hasFromLonLat bool + + byRadius float64 + hasByRadius bool + byWidth float64 + byHeight float64 + hasByBox bool + toMeter float64 + + withCoord bool + withDist bool + withHash bool + direction direction // unsorted + count int + any bool + } + + for len(args) > 0 { + arg := args[0] + args = args[1:] + switch strings.ToUpper(arg) { + case "FROMMEMBER": + if opts.hasFromMember || opts.hasFromLonLat || len(args) < 1 { + setDirty(c) + c.WriteError(msgSyntaxError) + return + } + opts.fromMember = args[0] + opts.hasFromMember = true + args = args[1:] + case "FROMLONLAT": + if opts.hasFromMember || opts.hasFromLonLat || len(args) < 2 { + setDirty(c) + c.WriteError(msgSyntaxError) + return + } + longitude, err := strconv.ParseFloat(args[0], 64) + if err != nil { + setDirty(c) + c.WriteError("ERR value is not a valid float") + return + } + latitude, err := strconv.ParseFloat(args[1], 64) + if err != nil { + setDirty(c) + c.WriteError("ERR value is not a valid float") + return + } + opts.longitude = longitude + opts.latitude = latitude + opts.hasFromLonLat = true + args = args[2:] + case "BYRADIUS": + if opts.hasByRadius || opts.hasByBox || len(args) < 2 { + setDirty(c) + c.WriteError(msgSyntaxError) + return + } + radius, err := strconv.ParseFloat(args[0], 64) + if err != nil || radius < 0 { + setDirty(c) + c.WriteError("ERR value is not a valid float") + return + } + toMeter := parseUnit(args[1]) + if toMeter == 0 { + setDirty(c) + c.WriteError(msgUnsupportedUnit) + return + } + opts.byRadius = radius + opts.toMeter = toMeter + opts.hasByRadius = true + args = args[2:] + case "BYBOX": + if opts.hasByRadius || opts.hasByBox || len(args) < 3 { + setDirty(c) + c.WriteError(msgSyntaxError) + return + } + width, err := strconv.ParseFloat(args[0], 64) + if err != nil || width < 0 { + setDirty(c) + c.WriteError("ERR value is not a valid float") + return + } + height, err := strconv.ParseFloat(args[1], 64) + if err != nil || height < 0 { + setDirty(c) + c.WriteError("ERR value is not a valid float") + return + } + toMeter := parseUnit(args[2]) + if toMeter == 0 { + setDirty(c) + c.WriteError(msgUnsupportedUnit) + return + } + opts.byWidth = width + opts.byHeight = height + opts.toMeter = toMeter + opts.hasByBox = true + args = args[3:] + case "ASC": + opts.direction = asc + case "DESC": + opts.direction = desc + case "WITHCOORD": + opts.withCoord = true + case "WITHDIST": + opts.withDist = true + case "WITHHASH": + opts.withHash = true + case "COUNT": + if len(args) == 0 { + setDirty(c) + c.WriteError(msgSyntaxError) + return + } + n, err := strconv.Atoi(args[0]) + if err != nil { + setDirty(c) + c.WriteError(msgInvalidInt) + return + } + if n <= 0 { + setDirty(c) + c.WriteError("ERR COUNT must be > 0") + return + } + args = args[1:] + opts.count = n + if len(args) > 0 && strings.ToUpper(args[0]) == "ANY" { + opts.any = true + args = args[1:] + } + default: + setDirty(c) + c.WriteError(msgSyntaxError) + return + } + } + + if !opts.hasFromMember && !opts.hasFromLonLat { + setDirty(c) + c.WriteError("ERR exactly one of FROMMEMBER or FROMLONLAT can be specified for GEOSEARCH") + return + } + if !opts.hasByRadius && !opts.hasByBox { + setDirty(c) + c.WriteError("ERR exactly one of BYRADIUS and BYBOX can be specified for GEOSEARCH") + return + } + if opts.any && opts.count == 0 { + setDirty(c) + c.WriteError("ERR COUNT must be > 0") + return + } + + withTx(m, c, func(c *server.Peer, ctx *connCtx) { + db := m.db(ctx.selectedDB) + + if db.exists(key) && db.t(key) != keyTypeSortedSet { + c.WriteError(ErrWrongType.Error()) + return + } + if !db.exists(key) { + c.WriteLen(0) + return + } + + longitude, latitude := opts.longitude, opts.latitude + if opts.hasFromMember { + if !db.ssetExists(key, opts.fromMember) { + c.WriteError("ERR could not decode requested zset member") + return + } + longitude, latitude = fromGeohash(uint64(db.ssetScore(key, opts.fromMember))) + } + + members := db.ssetElements(key) + + var matches []geoDistance + if opts.hasByRadius { + matches = withinRadius(members, longitude, latitude, opts.byRadius*opts.toMeter) + } else { + matches = withinBox(members, longitude, latitude, opts.byWidth*opts.toMeter, opts.byHeight*opts.toMeter) + } + + // deal with ASC/DESC + if opts.direction != unsorted { + sort.Slice(matches, func(i, j int) bool { + if opts.direction == desc { + return matches[i].Distance > matches[j].Distance + } + return matches[i].Distance < matches[j].Distance + }) + } + + // deal with COUNT + if opts.count > 0 && len(matches) > opts.count { + matches = matches[:opts.count] + } + + c.WriteLen(len(matches)) + for _, member := range matches { + if !opts.withDist && !opts.withCoord && !opts.withHash { + c.WriteBulk(member.Name) + continue + } + + fields := 1 + if opts.withDist { + fields++ + } + if opts.withHash { + fields++ + } + if opts.withCoord { + fields++ + } + c.WriteLen(fields) + c.WriteBulk(member.Name) + if opts.withDist { + c.WriteBulk(fmt.Sprintf("%.4f", member.Distance/opts.toMeter)) + } + if opts.withHash { + c.WriteInt(int(member.Score)) + } + if opts.withCoord { + c.WriteLen(2) + c.WriteBulk(fmt.Sprintf("%f", member.Longitude)) + c.WriteBulk(fmt.Sprintf("%f", member.Latitude)) + } + } + }) +} + func withinRadius(members []ssElem, longitude, latitude, radius float64) []geoDistance { matches := []geoDistance{} for _, el := range members { @@ -561,6 +813,36 @@ func withinRadius(members []ssElem, longitude, latitude, radius float64) []geoDi return matches } +// withinBox filters members inside an axis-aligned box centered on +// longitude/latitude, with width and height given in meters. It mirrors +// Redis' geohashGetDistanceIfInRectangle: a member is inside when its +// latitudinal and longitudinal distances to the center are within half the +// box height and half the box width respectively. +func withinBox(members []ssElem, longitude, latitude, width, height float64) []geoDistance { + matches := []geoDistance{} + for _, el := range members { + elLo, elLat := fromGeohash(uint64(el.score)) + + latDistance := distance(elLat, elLo, latitude, elLo) + if latDistance > height/2 { + continue + } + lonDistance := distance(elLat, elLo, elLat, longitude) + if lonDistance > width/2 { + continue + } + + matches = append(matches, geoDistance{ + Name: el.member, + Score: el.score, + Distance: distance(latitude, longitude, elLat, elLo), + Longitude: elLo, + Latitude: elLat, + }) + } + return matches +} + func parseUnit(u string) float64 { switch strings.ToLower(u) { case "m": diff --git a/vendor/github.com/alicebob/miniredis/v2/cmd_hash.go b/vendor/github.com/alicebob/miniredis/v2/cmd_hash.go index 9c5e686670a..a8977563bda 100644 --- a/vendor/github.com/alicebob/miniredis/v2/cmd_hash.go +++ b/vendor/github.com/alicebob/miniredis/v2/cmd_hash.go @@ -31,6 +31,10 @@ func commandsHash(m *Miniredis) { m.srv.Register("HSCAN", m.cmdHscan, server.ReadOnlyOption()) m.srv.Register("HRANDFIELD", m.cmdHrandfield, server.ReadOnlyOption()) m.srv.Register("HEXPIRE", m.cmdHexpire) + m.srv.Register("HPERSIST", m.cmdHpersist) + m.srv.Register("HTTL", m.cmdHttl, server.ReadOnlyOption()) + m.srv.Register("HPTTL", m.cmdHpttl, server.ReadOnlyOption()) + m.srv.Register("HSETEX", m.cmdHsetex) } // HSET @@ -600,6 +604,12 @@ func (m *Miniredis) cmdHrandfield(c *server.Peer, cmd string, args []string) { withTx(m, c, func(peer *server.Peer, ctx *connCtx) { db := m.db(ctx.selectedDB) + + if t, ok := db.keys[opts.key]; ok && t != keyTypeHash { + peer.WriteError(msgWrongType) + return + } + members := db.hashFields(opts.key) m.shuffle(members) @@ -763,7 +773,7 @@ func parseHExpireArgs(args []string) (hexpireOpts, string) { return hexpireOpts{}, msgNumFieldsInvalid } if numFields <= 0 { - return hexpireOpts{}, msgNumFieldsInvalid + return hexpireOpts{}, msgNumFieldsPositive } // FIELDS numFields field1 field2 ... @@ -789,6 +799,331 @@ func parseHExpireArgs(args []string) (hexpireOpts, string) { return opts, "" } +// HPERSIST +func (m *Miniredis) cmdHpersist(c *server.Peer, cmd string, args []string) { + if !m.isValidCMD(c, cmd, args, atLeast(3)) { + return + } + + key := args[0] + fields, errMsg := parseFieldsArgs(args[1:]) + if errMsg != "" { + setDirty(c) + c.WriteError(errMsg) + return + } + + withTx(m, c, func(c *server.Peer, ctx *connCtx) { + db := m.db(ctx.selectedDB) + + if _, ok := db.keys[key]; !ok { + c.WriteLen(len(fields)) + for range fields { + c.WriteInt(-2) + } + return + } + + if db.t(key) != keyTypeHash { + c.WriteError(msgWrongType) + return + } + + c.WriteLen(len(fields)) + for _, field := range fields { + if _, ok := db.hashKeys[key][field]; !ok { + c.WriteInt(-2) + continue + } + + fieldTTLs := db.hashTTLs[key] + if fieldTTLs == nil { + c.WriteInt(-1) + continue + } + if _, ok := fieldTTLs[field]; !ok { + c.WriteInt(-1) + continue + } + + delete(fieldTTLs, field) + c.WriteInt(1) + } + }) +} + +// HTTL +func (m *Miniredis) cmdHttl(c *server.Peer, cmd string, args []string) { + m.cmdHttlGeneric(c, cmd, args, time.Second) +} + +// HPTTL +func (m *Miniredis) cmdHpttl(c *server.Peer, cmd string, args []string) { + m.cmdHttlGeneric(c, cmd, args, time.Millisecond) +} + +func (m *Miniredis) cmdHttlGeneric(c *server.Peer, cmd string, args []string, unit time.Duration) { + if !m.isValidCMD(c, cmd, args, atLeast(3)) { + return + } + + key := args[0] + fields, errMsg := parseFieldsArgs(args[1:]) + if errMsg != "" { + setDirty(c) + c.WriteError(errMsg) + return + } + + withTx(m, c, func(c *server.Peer, ctx *connCtx) { + db := m.db(ctx.selectedDB) + + if _, ok := db.keys[key]; !ok { + c.WriteLen(len(fields)) + for range fields { + c.WriteInt(-2) + } + return + } + + if db.t(key) != keyTypeHash { + c.WriteError(msgWrongType) + return + } + + c.WriteLen(len(fields)) + for _, field := range fields { + if _, ok := db.hashKeys[key][field]; !ok { + c.WriteInt(-2) + continue + } + + fieldTTLs := db.hashTTLs[key] + if fieldTTLs == nil { + c.WriteInt(-1) + continue + } + ttl, ok := fieldTTLs[field] + if !ok { + c.WriteInt(-1) + continue + } + + c.WriteInt(int(ttl / unit)) + } + }) +} + +type hsetexOpts struct { + key string + fnx bool + fxx bool + ttlMode string // "", "EX", "PX", "EXAT", "PXAT", "KEEPTTL" + ttlVal int // raw value for EX/PX/EXAT/PXAT + fields []string + values []string +} + +func parseHSetEXArgs(args []string) (hsetexOpts, string) { + var opts hsetexOpts + opts.key = args[0] + args = args[1:] + + for len(args) > 0 { + switch strings.ToUpper(args[0]) { + case "FNX": + opts.fnx = true + args = args[1:] + case "FXX": + opts.fxx = true + args = args[1:] + case "KEEPTTL": + if opts.ttlMode != "" { + return hsetexOpts{}, msgSyntaxError + } + opts.ttlMode = "KEEPTTL" + args = args[1:] + case "EX", "PX", "EXAT", "PXAT": + if opts.ttlMode != "" { + return hsetexOpts{}, "ERR Only one of EX, PX, EXAT, PXAT or KEEPTTL arguments can be specified" + } + mode := strings.ToUpper(args[0]) + if len(args) < 2 { + return hsetexOpts{}, msgInvalidInt + } + var val int + if err := optIntSimple(args[1], &val); err != nil { + return hsetexOpts{}, msgInvalidInt + } + if val <= 0 { + return hsetexOpts{}, "ERR invalid expire time, must be >= 0" + } + opts.ttlMode = mode + opts.ttlVal = val + args = args[2:] + case "FIELDS": + if len(args) < 2 { + return hsetexOpts{}, msgNumFieldsInvalid + } + var numFields int + if err := optIntSimple(args[1], &numFields); err != nil { + return hsetexOpts{}, msgNumFieldsInvalid + } + if numFields <= 0 { + return hsetexOpts{}, msgNumFieldsPositive + } + // Need numFields * 2 args (field value pairs) + if len(args) < 2+numFields*2 { + return hsetexOpts{}, msgNumFieldsParameter + } + if len(args) > 2+numFields*2 { + return hsetexOpts{}, msgNumFieldsParameter + } + fvArgs := args[2 : 2+numFields*2] + for i := 0; i < len(fvArgs); i += 2 { + opts.fields = append(opts.fields, fvArgs[i]) + opts.values = append(opts.values, fvArgs[i+1]) + } + args = args[2+numFields*2:] + default: + return hsetexOpts{}, msgSyntaxError + } + } + + if opts.fnx && opts.fxx { + return hsetexOpts{}, msgSyntaxError + } + + if len(opts.fields) == 0 { + return hsetexOpts{}, fmt.Sprintf(msgMandatoryArgument, "FIELDS") + } + + return opts, "" +} + +// HSETEX +func (m *Miniredis) cmdHsetex(c *server.Peer, cmd string, args []string) { + if !m.isValidCMD(c, cmd, args, atLeast(4)) { + return + } + + opts, errMsg := parseHSetEXArgs(args) + if errMsg != "" { + setDirty(c) + c.WriteError(errMsg) + return + } + + withTx(m, c, func(c *server.Peer, ctx *connCtx) { + db := m.db(ctx.selectedDB) + + if t, ok := db.keys[opts.key]; ok && t != keyTypeHash { + c.WriteError(msgWrongType) + return + } + + // FNX: only set if none of the specified fields exist + if opts.fnx { + for _, field := range opts.fields { + if _, ok := db.hashKeys[opts.key][field]; ok { + c.WriteInt(0) + return + } + } + } + + // FXX: only set if all of the specified fields exist + if opts.fxx { + for _, field := range opts.fields { + if _, ok := db.hashKeys[opts.key][field]; !ok { + c.WriteInt(0) + return + } + } + } + + // Resolve TTL + var ttl time.Duration + hasTTL := false + keepTTL := false + switch opts.ttlMode { + case "EX": + ttl = time.Duration(opts.ttlVal) * time.Second + hasTTL = true + case "PX": + ttl = time.Duration(opts.ttlVal) * time.Millisecond + hasTTL = true + case "EXAT": + ttl = m.at(opts.ttlVal, time.Second) + hasTTL = true + case "PXAT": + ttl = m.at(opts.ttlVal, time.Millisecond) + hasTTL = true + case "KEEPTTL": + keepTTL = true + } + + // Set all fields + for i, field := range opts.fields { + db.hashSet(opts.key, field, opts.values[i]) + + if keepTTL { + // Don't touch existing TTL + continue + } + + // Initialize TTL map if needed + if db.hashTTLs[opts.key] == nil { + if hasTTL { + db.hashTTLs[opts.key] = map[string]time.Duration{} + } + } + + if hasTTL { + db.hashTTLs[opts.key][field] = ttl + } else { + // No TTL option: remove any existing TTL + if fieldTTLs := db.hashTTLs[opts.key]; fieldTTLs != nil { + delete(fieldTTLs, field) + } + } + } + + c.WriteInt(1) + }) +} + +// parseFieldsArgs parses "FIELDS numfields field [field ...]" from args. +// Returns the parsed field names, or an error string. +func parseFieldsArgs(args []string) ([]string, string) { + if len(args) < 2 { + return nil, fmt.Sprintf(msgMandatoryArgument, "FIELDS") + } + + if strings.ToLower(args[0]) != "fields" { + return nil, fmt.Sprintf(msgMandatoryArgument, "FIELDS") + } + + var numFields int + if err := optIntSimple(args[1], &numFields); err != nil { + return nil, msgNumFieldsInvalid + } + if numFields <= 0 { + return nil, msgNumFieldsPositive + } + + if len(args) < 2+numFields { + return nil, msgNumFieldsParameter + } + + // Reject trailing args after the declared fields + if len(args) > 2+numFields { + return nil, msgNumFieldsParameter + } + + return append([]string{}, args[2:2+numFields]...), "" +} + func abs(n int) int { if n < 0 { return -n diff --git a/vendor/github.com/alicebob/miniredis/v2/cmd_list.go b/vendor/github.com/alicebob/miniredis/v2/cmd_list.go index 9de16359d54..9287202253a 100644 --- a/vendor/github.com/alicebob/miniredis/v2/cmd_list.go +++ b/vendor/github.com/alicebob/miniredis/v2/cmd_list.go @@ -26,6 +26,7 @@ func commandsList(m *Miniredis) { m.srv.Register("LPOS", m.cmdLpos, server.ReadOnlyOption()) m.srv.Register("LINSERT", m.cmdLinsert) m.srv.Register("LLEN", m.cmdLlen, server.ReadOnlyOption()) + m.srv.Register("LMPOP", m.cmdLmpop) m.srv.Register("LPOP", m.cmdLpop) m.srv.Register("LPUSH", m.cmdLpush) m.srv.Register("LPUSHX", m.cmdLpushx) @@ -211,6 +212,10 @@ func (m *Miniredis) cmdLpos(c *server.Peer, cmd string, args []string) { t, ok := db.keys[key] if !ok { // No such key + if countSpecified { + c.WriteLen(0) + return + } c.WriteNull() return } @@ -369,6 +374,111 @@ func (m *Miniredis) cmdLlen(c *server.Peer, cmd string, args []string) { }) } +// LMPOP +func (m *Miniredis) cmdLmpop(c *server.Peer, cmd string, args []string) { + if !m.isValidCMD(c, cmd, args, atLeast(3)) { + return + } + + keys, lr, count, ok := parseLmpop(c, args) + if !ok { + return + } + + withTx(m, c, func(c *server.Peer, ctx *connCtx) { + if !m.lmpop(c, ctx, keys, lr, count) { + if c.Resp3 { + c.WriteNull() + } else { + c.WriteLen(-1) + } + } + }) +} + +func parseLmpop(c *server.Peer, args []string) ([]string, leftright, int, bool) { + numkeys, err := strconv.Atoi(args[0]) + if err != nil || numkeys < 1 { + setDirty(c) + c.WriteError("ERR numkeys should be greater than 0") + return nil, left, 0, false + } + + args = args[1:] + if len(args) <= numkeys { + setDirty(c) + c.WriteError(msgSyntaxError) + return nil, left, 0, false + } + keys := args[:numkeys] + + var lr leftright + switch strings.ToUpper(args[numkeys]) { + case "LEFT": + lr = left + case "RIGHT": + lr = right + default: + setDirty(c) + c.WriteError(msgSyntaxError) + return nil, left, 0, false + } + + count := 0 + args = args[numkeys+1:] + for len(args) > 0 { + if count != 0 || len(args) < 2 || strings.ToUpper(args[0]) != "COUNT" { + setDirty(c) + c.WriteError(msgSyntaxError) + return nil, left, 0, false + } + count, err = strconv.Atoi(args[1]) + if err != nil || count < 1 { + setDirty(c) + c.WriteError("ERR count should be greater than 0") + return nil, left, 0, false + } + args = args[2:] + } + if count == 0 { + count = 1 + } + return keys, lr, count, true +} + +// lmpop pops up to count elements from the first non-empty list. Returns +// false if there was nothing to pop, in which case nothing has been written. +func (m *Miniredis) lmpop(c *server.Peer, ctx *connCtx, keys []string, lr leftright, count int) bool { + db := m.db(ctx.selectedDB) + for _, key := range keys { + if !db.exists(key) { + continue + } + if db.t(key) != keyTypeList { + c.WriteError(msgWrongType) + return true + } + if len(db.listKeys[key]) == 0 { + continue + } + + var popped []string + for len(popped) < count && len(db.listKeys[key]) > 0 { + switch lr { + case left: + popped = append(popped, db.listLpop(key)) + case right: + popped = append(popped, db.listPop(key)) + } + } + c.WriteLen(2) + c.WriteBulk(key) + c.WriteStrings(popped) + return true + } + return false +} + // LPOP func (m *Miniredis) cmdLpop(c *server.Peer, cmd string, args []string) { m.cmdXpop(c, cmd, args, left) diff --git a/vendor/github.com/alicebob/miniredis/v2/cmd_sorted_set.go b/vendor/github.com/alicebob/miniredis/v2/cmd_sorted_set.go index 1491a74f472..c8d91633dc1 100644 --- a/vendor/github.com/alicebob/miniredis/v2/cmd_sorted_set.go +++ b/vendor/github.com/alicebob/miniredis/v2/cmd_sorted_set.go @@ -9,12 +9,16 @@ import ( "sort" "strconv" "strings" + "time" "github.com/alicebob/miniredis/v2/server" ) // commandsSortedSet handles all sorted set operations. func commandsSortedSet(m *Miniredis) { + m.srv.Register("BZMPOP", m.cmdBzmpop) + m.srv.Register("BZPOPMAX", m.cmdBzpopmax) + m.srv.Register("BZPOPMIN", m.cmdBzpopmin) m.srv.Register("ZADD", m.cmdZadd) m.srv.Register("ZCARD", m.cmdZcard, server.ReadOnlyOption()) m.srv.Register("ZCOUNT", m.cmdZcount, server.ReadOnlyOption()) @@ -36,6 +40,7 @@ func commandsSortedSet(m *Miniredis) { m.srv.Register("ZREVRANK", m.makeCmdZrank(true), server.ReadOnlyOption()) m.srv.Register("ZSCORE", m.cmdZscore, server.ReadOnlyOption()) m.srv.Register("ZMSCORE", m.cmdZMscore, server.ReadOnlyOption()) + m.srv.Register("ZMPOP", m.cmdZmpop) m.srv.Register("ZUNION", m.cmdZunion, server.ReadOnlyOption()) m.srv.Register("ZUNIONSTORE", m.cmdZunionstore) m.srv.Register("ZSCAN", m.cmdZscan, server.ReadOnlyOption()) @@ -1518,6 +1523,210 @@ func (m *Miniredis) cmdZpopmax(reverse bool) server.Cmd { } } +// ZMPOP +func (m *Miniredis) cmdZmpop(c *server.Peer, cmd string, args []string) { + if !m.isValidCMD(c, cmd, args, atLeast(3)) { + return + } + + keys, reverse, count, ok := parseZmpop(c, args) + if !ok { + return + } + + withTx(m, c, func(c *server.Peer, ctx *connCtx) { + if !m.zmpop(c, ctx, keys, reverse, count) { + c.WriteLen(-1) + } + }) +} + +func parseZmpop(c *server.Peer, args []string) ([]string, bool, int, bool) { + numkeys, err := strconv.Atoi(args[0]) + if err != nil || numkeys < 1 { + setDirty(c) + c.WriteError("ERR numkeys should be greater than 0") + return nil, false, 0, false + } + + args = args[1:] + if len(args) <= numkeys { + setDirty(c) + c.WriteError(msgSyntaxError) + return nil, false, 0, false + } + keys := args[:numkeys] + + reverse := false + switch strings.ToUpper(args[numkeys]) { + case "MIN": + case "MAX": + reverse = true + default: + setDirty(c) + c.WriteError(msgSyntaxError) + return nil, false, 0, false + } + + count := 1 + args = args[numkeys+1:] + if len(args) > 0 { + if len(args) != 2 || strings.ToUpper(args[0]) != "COUNT" { + setDirty(c) + c.WriteError(msgSyntaxError) + return nil, false, 0, false + } + count, err = strconv.Atoi(args[1]) + if err != nil || count < 1 { + setDirty(c) + c.WriteError("ERR count should be greater than 0") + return nil, false, 0, false + } + } + return keys, reverse, count, true +} + +func (m *Miniredis) zmpop(c *server.Peer, ctx *connCtx, keys []string, reverse bool, count int) bool { + db := m.db(ctx.selectedDB) + for _, key := range keys { + if !db.exists(key) { + continue + } + if db.t(key) != keyTypeSortedSet { + c.WriteError(msgWrongType) + return true + } + + members := db.ssetMembers(key) + if len(members) == 0 { + continue + } + if reverse { + reverseSlice(members) + } + if count < len(members) { + members = members[:count] + } + + c.WriteLen(2) + c.WriteBulk(key) + c.WriteLen(len(members)) + for _, member := range members { + c.WriteLen(2) + c.WriteBulk(member) + c.WriteFloat(db.ssetScore(key, member)) + db.ssetRem(key, member) + } + if db.t(key) == keyTypeSortedSet { + db.incr(key) + } + return true + } + return false +} + +// BZMPOP +func (m *Miniredis) cmdBzmpop(c *server.Peer, cmd string, args []string) { + if !m.isValidCMD(c, cmd, args, atLeast(4)) { + return + } + + keys, reverse, count, ok := parseZmpop(c, args[1:]) + if !ok { + return + } + var timeout time.Duration + if ok := optDuration(c, args[0], &timeout); !ok { + return + } + ctx := getCtx(c) + if ctx.nested { + if !m.zmpop(c, ctx, keys, reverse, count) { + c.WriteLen(-1) + } + return + } + + blocking( + m, + c, + timeout, + func(c *server.Peer, ctx *connCtx) bool { + return m.zmpop(c, ctx, keys, reverse, count) + }, + func(c *server.Peer) { + c.WriteLen(-1) + }, + ) +} + +// BZPOPMAX +func (m *Miniredis) cmdBzpopmax(c *server.Peer, cmd string, args []string) { + m.cmdBzpop(c, cmd, args, true) +} + +// BZPOPMIN +func (m *Miniredis) cmdBzpopmin(c *server.Peer, cmd string, args []string) { + m.cmdBzpop(c, cmd, args, false) +} + +func (m *Miniredis) cmdBzpop(c *server.Peer, cmd string, args []string, reverse bool) { + if !m.isValidCMD(c, cmd, args, atLeast(2)) { + return + } + + var opts struct { + keys []string + timeout time.Duration + } + + if ok := optDuration(c, args[len(args)-1], &opts.timeout); !ok { + return + } + opts.keys = args[:len(args)-1] + + blocking( + m, + c, + opts.timeout, + func(c *server.Peer, ctx *connCtx) bool { + db := m.db(ctx.selectedDB) + for _, key := range opts.keys { + if !db.exists(key) { + continue + } + if db.t(key) != keyTypeSortedSet { + c.WriteError(msgWrongType) + return true + } + + members := db.ssetMembers(key) + if len(members) == 0 { + continue + } + // members are ordered by score, ascending. ZPOPMIN takes the + // first, ZPOPMAX the last. + member := members[0] + if reverse { + member = members[len(members)-1] + } + score := db.ssetScore(key, member) + db.ssetRem(key, member) + c.WriteLen(3) + c.WriteBulk(key) + c.WriteBulk(member) + c.WriteFloat(score) + return true + } + return false + }, + func(c *server.Peer) { + // timeout + c.WriteLen(-1) + }, + ) +} + // ZRANDMEMBER func (m *Miniredis) cmdZrandmember(c *server.Peer, cmd string, args []string) { if !m.isValidCMD(c, cmd, args, atLeast(1)) { diff --git a/vendor/github.com/alicebob/miniredis/v2/db.go b/vendor/github.com/alicebob/miniredis/v2/db.go index 97bdf7c3a1d..81253d6a3ce 100644 --- a/vendor/github.com/alicebob/miniredis/v2/db.go +++ b/vendor/github.com/alicebob/miniredis/v2/db.go @@ -100,6 +100,9 @@ func (db *RedisDB) move(key string, to *RedisDB) bool { } func (db *RedisDB) rename(from, to string) { + if from == to { + return + } db.del(to, true) switch db.t(from) { case keyTypeString: diff --git a/vendor/github.com/alicebob/miniredis/v2/direct.go b/vendor/github.com/alicebob/miniredis/v2/direct.go index ff527b800cb..a01b4ecb3a6 100644 --- a/vendor/github.com/alicebob/miniredis/v2/direct.go +++ b/vendor/github.com/alicebob/miniredis/v2/direct.go @@ -490,6 +490,89 @@ func (db *RedisDB) HSet(k string, fv ...string) { db.hashSet(k, fv...) } +// HExpire sets a TTL on a hash field. Returns true if the field exists. +func (m *Miniredis) HExpire(key, field string, ttl time.Duration) bool { + return m.DB(m.selectedDB).HExpire(key, field, ttl) +} + +// HExpire sets a TTL on a hash field. Returns true if the field exists. +func (db *RedisDB) HExpire(key, field string, ttl time.Duration) bool { + db.master.Lock() + defer db.master.Unlock() + defer db.master.signal.Broadcast() + + if !db.exists(key) || db.t(key) != keyTypeHash { + return false + } + if _, ok := db.hashKeys[key][field]; !ok { + return false + } + if db.hashTTLs[key] == nil { + db.hashTTLs[key] = map[string]time.Duration{} + } + db.hashTTLs[key][field] = ttl + return true +} + +// HPersist removes a TTL from a hash field. Returns true if there was a TTL. +func (m *Miniredis) HPersist(key, field string) bool { + return m.DB(m.selectedDB).HPersist(key, field) +} + +// HPersist removes a TTL from a hash field. Returns true if there was a TTL. +func (db *RedisDB) HPersist(key, field string) bool { + db.master.Lock() + defer db.master.Unlock() + defer db.master.signal.Broadcast() + + fieldTTLs := db.hashTTLs[key] + if fieldTTLs == nil { + return false + } + if _, ok := fieldTTLs[field]; !ok { + return false + } + delete(fieldTTLs, field) + return true +} + +// HTTL returns the remaining TTL of a hash field. Returns 0 if no TTL. +func (m *Miniredis) HTTL(key, field string) time.Duration { + return m.DB(m.selectedDB).HTTL(key, field) +} + +// HTTL returns the remaining TTL of a hash field. Returns 0 if no TTL. +func (db *RedisDB) HTTL(key, field string) time.Duration { + db.master.Lock() + defer db.master.Unlock() + + fieldTTLs := db.hashTTLs[key] + if fieldTTLs == nil { + return 0 + } + return fieldTTLs[field] +} + +// HSetEX sets hash fields with a TTL. +func (m *Miniredis) HSetEX(key string, ttl time.Duration, fv ...string) { + m.DB(m.selectedDB).HSetEX(key, ttl, fv...) +} + +// HSetEX sets hash fields with a TTL. +func (db *RedisDB) HSetEX(key string, ttl time.Duration, fv ...string) { + db.master.Lock() + defer db.master.Unlock() + defer db.master.signal.Broadcast() + + db.hashSet(key, fv...) + if db.hashTTLs[key] == nil { + db.hashTTLs[key] = map[string]time.Duration{} + } + for i := 0; i < len(fv); i += 2 { + db.hashTTLs[key][fv[i]] = ttl + } +} + // HDel deletes a hash key. func (m *Miniredis) HDel(k, f string) { m.DB(m.selectedDB).HDel(k, f) diff --git a/vendor/github.com/alicebob/miniredis/v2/miniredis.go b/vendor/github.com/alicebob/miniredis/v2/miniredis.go index 7e65f1635db..4d42c930007 100644 --- a/vendor/github.com/alicebob/miniredis/v2/miniredis.go +++ b/vendor/github.com/alicebob/miniredis/v2/miniredis.go @@ -20,6 +20,7 @@ import ( "crypto/tls" "fmt" "math/rand" + "net" "strconv" "strings" "sync" @@ -57,6 +58,8 @@ type RedisDB struct { type Miniredis struct { sync.Mutex srv *server.Server + nextPreHook server.Hook + ip string port int passwords map[string]string // username password dbs map[int]*RedisDB @@ -64,6 +67,8 @@ type Miniredis struct { scripts map[string]string // sha1 -> lua src signal *sync.Cond now time.Time // time.Now() if not set. + clockTTL bool // decrease TTLs as the clock advances + lastTick time.Time // last time TTLs were advanced, if clockTTL is set subscribers map[*Subscriber]struct{} rand *rand.Rand Ctx context.Context @@ -209,8 +214,17 @@ func (m *Miniredis) StartAddrTLS(addr string, cfg *tls.Config) error { func (m *Miniredis) start(s *server.Server) error { m.Lock() defer m.Unlock() + return m.startLocked(s) +} + +func (m *Miniredis) startLocked(s *server.Server) error { m.srv = s - m.port = s.Addr().Port + s.SetPreHook(m.nextPreHook) + m.nextPreHook = nil + if a := s.Addr(); a != nil { + m.ip = a.IP.String() + m.port = a.Port + } commandsConnection(m) commandsGeneric(m) @@ -233,6 +247,36 @@ func (m *Miniredis) start(s *server.Server) error { return nil } +// Dial returns an in-memory client connection to the server, served on a +// net.Pipe: no listener or port is involved. A non-started Miniredis is +// started without a listener, so NewMiniRedis() + Dial() gives a working +// server which never touches the network. Note that Addr() has no address to +// return in that case. +// +// Dial fits the Dialer option of most redis clients, and makes miniredis +// usable inside a testing/synctest bubble, where real sockets can't be used: +// +// client := redis.NewClient(&redis.Options{ +// Dialer: func(ctx context.Context, _, _ string) (net.Conn, error) { +// return m.Dial() +// }, +// }) +func (m *Miniredis) Dial() (net.Conn, error) { + m.Lock() + if m.srv == nil { + if err := m.startLocked(server.NewServerConn()); err != nil { + m.Unlock() + return nil, err + } + } + srv := m.srv + m.Unlock() + + c, s := net.Pipe() + srv.ServeConn(s) + return c, nil +} + // Restart restarts a Close()d server on the same port. Values will be // preserved. func (m *Miniredis) Restart() error { @@ -254,7 +298,6 @@ func (m *Miniredis) Close() { // the OnDisconnect callbacks can lock m, so run Close() outside the lock. srv.Close() - } // RequireAuth makes every connection need to AUTH first. This is the old 'AUTH [password] command. @@ -288,6 +331,7 @@ func (m *Miniredis) DB(i int) *RedisDB { // get DB. No locks! func (m *Miniredis) db(i int) *RedisDB { + m.tickLocked() if db, ok := m.dbs[i]; ok { return db } @@ -322,7 +366,11 @@ func (m *Miniredis) swapDB(i, j int) bool { func (m *Miniredis) Addr() string { m.Lock() defer m.Unlock() - return m.srv.Addr().String() + a := m.srv.Addr() + if a == nil { + return "" + } + return a.String() } // Host returns the host part of Addr(). @@ -457,6 +505,50 @@ func (m *Miniredis) SetTime(t time.Time) { m.Lock() defer m.Unlock() m.now = t + // keep the ClockTTL baseline sane when the clock jumps backwards; a + // forward jump stays pending until the next tick. + if m.clockTTL && t.Before(m.lastTick) { + m.lastTick = t + } +} + +// ClockTTL makes TTLs (both key and hash field TTLs) decrease as the clock +// advances, instead of only via FastForward(). The clock is time.Now(), or +// the value set with SetTime(). Expired keys are removed lazily, whenever a +// command or a Miniredis-level accessor touches a database; a *RedisDB held +// directly does not trigger expiry. +// +// With SetTime() this gives deterministic clock-driven expiry: moving the +// clock forward expires keys, and unlike FastForward() the expiry stays +// coherent with TIME and (P)EXPIREAT, which follow SetTime() as well. +// +// It also makes miniredis work inside a testing/synctest bubble, where +// time.Now() is the bubble's deterministic fake clock: a plain time.Sleep() +// there expires keys. Without SetTime() and outside a bubble, TTLs run +// against the wall clock, which makes expiry depend on test execution +// speed — usually not what you want in a unittest. +func (m *Miniredis) ClockTTL(enabled bool) { + m.Lock() + defer m.Unlock() + m.clockTTL = enabled + m.lastTick = m.effectiveNow() +} + +// advance TTLs by the clock time elapsed since the last tick. Called with the +// lock held on every database access, when ClockTTL is enabled. +func (m *Miniredis) tickLocked() { + if !m.clockTTL { + return + } + now := m.effectiveNow() + elapsed := now.Sub(m.lastTick) + if elapsed <= 0 { + return + } + m.lastTick = now + for _, db := range m.dbs { + db.fastForward(elapsed) + } } // make every command return this message. For example: @@ -473,6 +565,13 @@ func (m *Miniredis) SetError(msg string) { return true } } + + m.Lock() + defer m.Unlock() + if m.srv == nil { + m.nextPreHook = cb + return + } m.srv.SetPreHook(cb) } diff --git a/vendor/github.com/alicebob/miniredis/v2/proto/client.go b/vendor/github.com/alicebob/miniredis/v2/proto/client.go index 92f57baf1ea..2149b0aafca 100644 --- a/vendor/github.com/alicebob/miniredis/v2/proto/client.go +++ b/vendor/github.com/alicebob/miniredis/v2/proto/client.go @@ -11,6 +11,14 @@ type Client struct { r *bufio.Reader } +// NewClient wraps an existing connection, such as one from Miniredis.Dial(). +func NewClient(c net.Conn) *Client { + return &Client{ + c: c, + r: bufio.NewReader(c), + } +} + func Dial(addr string) (*Client, error) { c, err := net.Dial("tcp", addr) if err != nil { diff --git a/vendor/github.com/alicebob/miniredis/v2/redis.go b/vendor/github.com/alicebob/miniredis/v2/redis.go index eae0e2ffbaf..921b5afc868 100644 --- a/vendor/github.com/alicebob/miniredis/v2/redis.go +++ b/vendor/github.com/alicebob/miniredis/v2/redis.go @@ -71,6 +71,7 @@ const ( msgMemorySubcommand = "ERR unknown subcommand '%s'. Try MEMORY HELP." msgNumFieldsParameter = "ERR The `numfields` parameter must match the number of arguments" msgNumFieldsInvalid = "ERR Parameter `numFields` should be greater than 0" + msgNumFieldsPositive = "ERR Number of fields must be a positive integer" msgMandatoryArgument = "ERR Mandatory argument %s is missing or not at the right position" msgGTandLT = "ERR GT and LT options at the same time are not compatible" msgNXandXXGTLT = "ERR NX and XX, GT or LT options at the same time are not compatible" diff --git a/vendor/github.com/alicebob/miniredis/v2/server/proto.go b/vendor/github.com/alicebob/miniredis/v2/server/proto.go index f62e1d73fb2..6ada2fb8624 100644 --- a/vendor/github.com/alicebob/miniredis/v2/server/proto.go +++ b/vendor/github.com/alicebob/miniredis/v2/server/proto.go @@ -144,6 +144,9 @@ func ParseReply(rd *bufio.Reader) (interface{}, error) { return nil, ErrProtocol } // l can be -1 + if l < 0 { + return nil, nil + } var fields []interface{} for ; l > 0; l-- { s, err := ParseReply(rd) diff --git a/vendor/github.com/alicebob/miniredis/v2/server/server.go b/vendor/github.com/alicebob/miniredis/v2/server/server.go index af36105f45d..068a27ea97b 100644 --- a/vendor/github.com/alicebob/miniredis/v2/server/server.go +++ b/vendor/github.com/alicebob/miniredis/v2/server/server.go @@ -60,6 +60,15 @@ func NewServerTLS(addr string, cfg *tls.Config) (*Server, error) { return newServer(l), nil } +// NewServerConn makes a server without a listener. Connections are added +// with ServeConn. Close with .Close(). +func NewServerConn() *Server { + return &Server{ + cmds: map[string]*cmdMeta{}, + peers: map[net.Conn]struct{}{}, + } +} + func newServer(l net.Listener) *Server { s := Server{ cmds: map[string]*cmdMeta{}, @@ -136,6 +145,9 @@ func (s *Server) Close() { s.l.Close() } s.l = nil + for c := range s.peers { + c.Close() + } s.mu.Unlock() s.wg.Wait() 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 7222e27d6d0..f0d417a7ee5 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.43.2" +const goModuleVersion = "1.47.3" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/metadata.go index d66f0960aa5..ba2082411fb 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/metadata.go @@ -15,6 +15,8 @@ type RegisterServiceMetadata struct { SigningName string Region string OperationName string + + RequiresLegacyEndpoints bool } // ID returns the middleware identifier. @@ -33,10 +35,13 @@ func (s RegisterServiceMetadata) HandleInitialize( ctx = SetSigningName(ctx, s.SigningName) } if len(s.Region) > 0 { - ctx = setRegion(ctx, s.Region) + ctx = SetRegion(ctx, s.Region) } if len(s.OperationName) > 0 { - ctx = setOperationName(ctx, s.OperationName) + ctx = SetOperationName(ctx, s.OperationName) + } + if s.RequiresLegacyEndpoints { + ctx = SetRequiresLegacyEndpoints(ctx, true) } return next.HandleInitialize(ctx, in) } @@ -161,19 +166,19 @@ func SetServiceID(ctx context.Context, value string) context.Context { return middleware.WithStackValue(ctx, serviceIDKey{}, value) } -// setRegion sets the endpoint region on the context. +// SetRegion sets the endpoint region on the context. // // Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues // to clear all stack values. -func setRegion(ctx context.Context, value string) context.Context { +func SetRegion(ctx context.Context, value string) context.Context { return middleware.WithStackValue(ctx, regionKey{}, value) } -// setOperationName sets the service operation on the context. +// SetOperationName sets the service operation on the context. // // Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues // to clear all stack values. -func setOperationName(ctx context.Context, value string) context.Context { +func SetOperationName(ctx context.Context, value string) context.Context { return middleware.WithStackValue(ctx, operationNameKey{}, value) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/middleware.go index 126dcf47bd7..3b7e08b91e5 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/middleware.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/middleware.go @@ -93,6 +93,9 @@ func (r Attempt) logf(logger logging.Logger, classification logging.Classificati func (r *Attempt) HandleFinalize(ctx context.Context, in smithymiddle.FinalizeInput, next smithymiddle.FinalizeHandler) ( out smithymiddle.FinalizeOutput, metadata smithymiddle.Metadata, err error, ) { + ctx, span := tracing.StartSpan(ctx, "RetryLoop") + defer span.End() + var attemptClockSkew time.Duration if !r.DisableClockSkewCorrection && r.ClientSkew != nil { attemptClockSkew = time.Duration(r.ClientSkew.Load()) @@ -226,6 +229,11 @@ func (r *Attempt) handleAttempt( service, operation, attemptNum) } + // Not an error for other transports: they have no header to set. + if req, ok := in.Request.(*http.Request); ok { + setRetryMetricsHeader(ctx, req) + } + var metadata smithymiddle.Metadata out, metadata, err = next.HandleFinalize(ctx, in) attemptResult.ResponseMetadata = metadata @@ -386,14 +394,22 @@ func absDuration(d time.Duration) time.Duration { } // MetricsHeader attaches SDK request metric header for retries to the transport +// +// Deprecated: AWS service clients no longer use this middleware. The +// Amz-Sdk-Request header is set by the Attempt middleware, which already holds +// the retry metadata the header describes. type MetricsHeader struct{} // ID returns the middleware identifier +// +// Deprecated: MetricsHeader is deprecated. func (r *MetricsHeader) ID() string { return "RetryMetricsHeader" } // HandleFinalize attaches the SDK request metric header to the transport layer +// +// Deprecated: MetricsHeader is deprecated. func (r MetricsHeader) HandleFinalize(ctx context.Context, in smithymiddle.FinalizeInput, next smithymiddle.FinalizeHandler) ( out smithymiddle.FinalizeOutput, metadata smithymiddle.Metadata, err error, ) { @@ -429,6 +445,34 @@ func (r MetricsHeader) HandleFinalize(ctx context.Context, in smithymiddle.Final return next.HandleFinalize(ctx, in) } +// setRetryMetricsHeader sets the Amz-Sdk-Request header from the retry metadata +// on the context. +func setRetryMetricsHeader(ctx context.Context, req *http.Request) { + retryMetadata, _ := getRetryMetadata(ctx) + + const retryMetricHeader = "Amz-Sdk-Request" + var parts []string + + parts = append(parts, "attempt="+strconv.Itoa(retryMetadata.AttemptNum)) + if retryMetadata.MaxAttempts != 0 { + parts = append(parts, "max="+strconv.Itoa(retryMetadata.MaxAttempts)) + } + + var ttl time.Time + if deadline, ok := ctx.Deadline(); ok { + ttl = deadline + } + + // Only append the TTL if it can be determined. + if !ttl.IsZero() && retryMetadata.AttemptClockSkew > 0 { + const unixTimeFormat = "20060102T150405Z" + ttl = ttl.Add(retryMetadata.AttemptClockSkew) + parts = append(parts, "ttl="+ttl.Format(unixTimeFormat)) + } + + req.Header[retryMetricHeader] = append(req.Header[retryMetricHeader][:0], strings.Join(parts, "; ")) +} + type retryMetadataKey struct{} // getRetryMetadata retrieves retryMetadata from the context and a bool @@ -471,9 +515,6 @@ func AddRetryMiddlewares(stack *smithymiddle.Stack, options AddRetryMiddlewaresO return err } - if err := stack.Finalize.Insert(&MetricsHeader{}, attempt.ID(), smithymiddle.After); err != nil { - return err - } return nil } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/headers.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/headers.go index d99b32ceb07..0b9ddd13ba3 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/headers.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/headers.go @@ -58,6 +58,10 @@ var RequiredSignedHeaders = Rules{ "X-Amz-Tagging": struct{}{}, }, }, + InclusiveRules{ + Patterns{"X-Amz-Checksum-"}, + ExcludeList{Patterns{"X-Amz-Checksum-Mode"}}, + }, Patterns{"X-Amz-Object-Lock-"}, Patterns{"X-Amz-Meta-"}, } 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 49cc31205c5..50b7417c28a 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 @@ -2,6 +2,7 @@ package http import ( "context" + "crypto/fips140" "crypto/tls" "net" "net/http" @@ -27,6 +28,19 @@ var ( // Default to TLS 1.2 for all HTTPS requests. DefaultHTTPTransportTLSMinVersion uint16 = tls.VersionTLS12 + + // DefaultHTTPTransportTLSCurvePreferencesFIPS is the elliptic curve preference + // list applied to the default transport when the FIPS 140-3 module is active. + // + // Go's default preferences lead with X25519, which crypto/ecdh rejects under + // GODEBUG=fips140=only, failing every TLS handshake the SDK attempts. Only the + // NIST curves are FIPS-approved, so restricting to them keeps the default + // client usable in FIPS deployments. + DefaultHTTPTransportTLSCurvePreferencesFIPS = []tls.CurveID{ + tls.CurveP256, + tls.CurveP384, + tls.CurveP521, + } ) // Timeouts for net.Dialer's network connection. @@ -48,6 +62,7 @@ type BuildableClient struct { initOnce sync.Once clientTimeout time.Duration + readTimeout *time.Duration client *http.Client } @@ -82,9 +97,12 @@ func (b *BuildableClient) Freeze() aws.HTTPClient { } func (b *BuildableClient) build() { + tr := b.GetTransport() + b.installReadTimeout(tr) + b.client = wrapWithLimitedRedirect(&http.Client{ Timeout: b.clientTimeout, - Transport: b.GetTransport(), + Transport: tr, }) } @@ -93,6 +111,7 @@ func (b *BuildableClient) clone() *BuildableClient { cpy.transport = b.GetTransport() cpy.dialer = b.GetDialer() cpy.clientTimeout = b.clientTimeout + cpy.readTimeout = b.readTimeout return cpy } @@ -141,6 +160,25 @@ func (b *BuildableClient) WithTimeout(timeout time.Duration) *BuildableClient { return cpy } +// WithReadTimeout copies the BuildableClient and returns it with the read +// timeout set. +// +// The timeout is the maximum time the client waits for a connection to deliver +// any data. It resets on every byte received, so a slow but progressing response +// does not fail. It is not a deadline on the operation; use WithTimeout for that. +// +// A value set here takes precedence over the SDK's defaults for every service +// this client is used with, including services the SDK would otherwise apply a +// higher value to or exempt entirely. Pass 0 to disable read timeouts. +// +// The timeout is applied per connection, so a client shared between service +// clients applies the same value to all of them. +func (b *BuildableClient) WithReadTimeout(timeout time.Duration) *BuildableClient { + cpy := b.clone() + cpy.readTimeout = &timeout + return cpy +} + // GetTransport returns a copy of the client's HTTP Transport. func (b *BuildableClient) GetTransport() *http.Transport { var tr *http.Transport @@ -170,6 +208,17 @@ func (b *BuildableClient) GetTimeout() time.Duration { return b.clientTimeout } +// GetReadTimeout returns the configured read timeout and whether one was set on +// this client. When it was not, the SDK resolves a default per +// service. +func (b *BuildableClient) GetReadTimeout() (time.Duration, bool) { + if b.readTimeout == nil { + return 0, false + } + + return *b.readTimeout, true +} + func defaultDialer() *net.Dialer { return &net.Dialer{ Timeout: DefaultDialConnectTimeout, @@ -178,6 +227,16 @@ func defaultDialer() *net.Dialer { } } +// defaultTLSCurvePreferences returns the curve preferences for the default +// transport. Outside FIPS mode it returns nil so Go's own defaults apply, +// preserving X25519 and the post-quantum X25519MLKEM768 hybrid. +func defaultTLSCurvePreferences(fipsEnabled bool) []tls.CurveID { + if !fipsEnabled { + return nil + } + return DefaultHTTPTransportTLSCurvePreferencesFIPS +} + func defaultHTTPTransport() *http.Transport { dialer := defaultDialer() @@ -192,7 +251,8 @@ func defaultHTTPTransport() *http.Transport { ExpectContinueTimeout: DefaultHTTPTransportExpectContinueTimeout, ForceAttemptHTTP2: true, TLSClientConfig: &tls.Config{ - MinVersion: DefaultHTTPTransportTLSMinVersion, + MinVersion: DefaultHTTPTransportTLSMinVersion, + CurvePreferences: defaultTLSCurvePreferences(fips140.Enabled()), }, } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/timeouts.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/timeouts.go new file mode 100644 index 00000000000..fbd23ef9712 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/timeouts.go @@ -0,0 +1,54 @@ +package http + +import ( + "context" + "errors" + "net" + "net/http" + "os" + "time" +) + +// deadlineConn applies a rolling inactivity window to reads on a connection by +// resetting the read deadline before each one. A read returns as soon as any +// bytes are available, so a slow but progressing transfer survives, and a +// connection that goes silent fails once. +type deadlineConn struct { + net.Conn + timeout time.Duration +} + +// Read implements [io.Reader]. +func (c *deadlineConn) Read(p []byte) (int, error) { + if err := c.Conn.SetReadDeadline(time.Now().Add(c.timeout)); err != nil { + return 0, err + } + + n, err := c.Conn.Read(p) + if errors.Is(err, os.ErrDeadlineExceeded) { + return n, &ResponseTimeoutError{TimeoutDur: c.timeout} + } + + return n, err +} + +func (b *BuildableClient) installReadTimeout(tr *http.Transport) { + timeout, ok := b.GetReadTimeout() + if !ok || timeout <= 0 { + return + } + + dial := tr.DialContext + if dial == nil { + dial = defaultDialer().DialContext + } + + tr.DialContext = func(ctx context.Context, network, addr string) (net.Conn, error) { + conn, err := dial(ctx, network, addr) + if err != nil { + return nil, err + } + + return &deadlineConn{Conn: conn, timeout: timeout}, nil + } +} 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 34989cc52c5..03a911764d9 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,79 @@ +# v1.33.9 (2026-10-09.2) + +* **Dependency Update**: Update to smithy-go v1.28.5. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.33.8 (2026-10-08) + +* **Dependency Update**: Update to smithy-go v1.28.4. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.33.7 (2026-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.33.6 (2026-09-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.33.5 (2026-09-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.33.4 (2026-09-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.33.3 (2026-09-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.33.2 (2026-08-31.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.33.1 (2026-08-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.33.0 (2026-08-27) + +* **Feature**: Support connection read timeouts in the SDK. This is currently available on an opt-in basis by setting env `AWS_ENABLE_DEFAULT_SOCKET_TIMEOUT_2026=true`. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.32.40 (2026-08-26) + +* **Dependency Update**: Update to smithy-go v1.28.0. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.32.39 (2026-08-25) + +* **Dependency Update**: Update to smithy-go v1.27.10. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.32.38 (2026-08-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.32.37 (2026-08-14) + +* **Dependency Update**: Update to smithy-go v1.27.8. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.32.36 (2026-08-10) + +* **Dependency Update**: Update to smithy-go v1.27.7. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.32.35 (2026-08-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.32.34 (2026-07-31.2) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.27.6 to fix various serde issues in HTTP binding services. + # v1.32.33 (2026-07-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 054e37f268e..2f33eee26f0 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.32.33" +const goModuleVersion = "1.33.9" 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 d69df4c866b..ba7a71db97f 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,79 @@ +# v1.20.9 (2026-10-09.2) + +* **Dependency Update**: Update to smithy-go v1.28.5. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.8 (2026-10-08) + +* **Dependency Update**: Update to smithy-go v1.28.4. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.7 (2026-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.6 (2026-09-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.5 (2026-09-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.4 (2026-09-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.3 (2026-09-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.2 (2026-08-31.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.1 (2026-08-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.0 (2026-08-27) + +* **Feature**: Support connection read timeouts in the SDK. This is currently available on an opt-in basis by setting env `AWS_ENABLE_DEFAULT_SOCKET_TIMEOUT_2026=true`. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.39 (2026-08-26) + +* **Dependency Update**: Update to smithy-go v1.28.0. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.38 (2026-08-25) + +* **Dependency Update**: Update to smithy-go v1.27.10. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.37 (2026-08-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.36 (2026-08-14) + +* **Dependency Update**: Update to smithy-go v1.27.8. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.35 (2026-08-10) + +* **Dependency Update**: Update to smithy-go v1.27.7. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.34 (2026-08-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.33 (2026-07-31.2) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.27.6 to fix various serde issues in HTTP binding services. + # v1.19.32 (2026-07-29) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/client.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/client.go index dc291c97cd7..429e3261e50 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/client.go @@ -104,8 +104,6 @@ func (c *Client) GetCredentials(ctx context.Context, params *GetCredentialsInput addProtocolFinalizerMiddlewares(stack, options, "GetCredentials") retry.AddRetryMiddlewares(stack, retry.AddRetryMiddlewaresOptions{Retryer: options.Retryer}) middleware.AddSDKAgentKey(middleware.FeatureMetadata, ServiceID) - smithyhttp.AddErrorCloseResponseBodyMiddleware(stack) - smithyhttp.AddCloseResponseBodyMiddleware(stack) for _, fn := range options.APIOptions { if err := fn(stack); err != nil { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/middleware.go index f2820d20eac..ba985890525 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/middleware.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/middleware.go @@ -82,12 +82,18 @@ func (d *deserializeOpGetCredential) HandleDeserialize(ctx context.Context, in s out smithymiddleware.DeserializeOutput, metadata smithymiddleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + // Close the response body on every exit path in place of the standalone close middleware. + // Deferred in a closure so it observes the final err (this output is not a streaming + // payload, so it is always closed regardless). + response, _ := out.RawResponse.(*smithyhttp.Response) + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { + if response == nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } 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 fdbe8424743..fcee129dc2d 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.19.32" +const goModuleVersion = "1.20.9" 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 96bca6c3af7..c0ffce13a83 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,68 @@ +# v1.20.3 (2026-10-09.2) + +* **Dependency Update**: Update to smithy-go v1.28.5. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.2 (2026-10-08) + +* **Dependency Update**: Update to smithy-go v1.28.4. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.1 (2026-09-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.0 (2026-09-09) + +* **Feature**: Stop registering the `retry.MetricsHeader` middleware in generated clients. The `Amz-Sdk-Request` header is now set by the retry middleware itself. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.2 (2026-09-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.1 (2026-08-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.0 (2026-08-27) + +* **Feature**: Support connection read timeouts in the SDK. This is currently available on an opt-in basis by setting env `AWS_ENABLE_DEFAULT_SOCKET_TIMEOUT_2026=true`. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.40 (2026-08-26) + +* **Dependency Update**: Update to smithy-go v1.28.0. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.39 (2026-08-25) + +* **Dependency Update**: Update to smithy-go v1.27.10. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.38 (2026-08-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.37 (2026-08-14) + +* **Dependency Update**: Update to smithy-go v1.27.8. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.36 (2026-08-10) + +* **Dependency Update**: Update to smithy-go v1.27.7. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.35 (2026-08-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.34 (2026-07-31.2) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.27.6 to fix various serde issues in HTTP binding services. + # v1.18.33 (2026-07-29) * **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 83e751954f0..14f4c1dbcef 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.33" +const goModuleVersion = "1.20.3" 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 afcd57dd3ff..c21c138f0b9 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,66 @@ +# v1.5.6 (2026-10-09.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.5 (2026-10-08) + +* **Dependency Update**: Update to smithy-go v1.28.4. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.4 (2026-09-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.3 (2026-09-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.2 (2026-09-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.1 (2026-08-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.0 (2026-08-27) + +* **Feature**: Support connection read timeouts in the SDK. This is currently available on an opt-in basis by setting env `AWS_ENABLE_DEFAULT_SOCKET_TIMEOUT_2026=true`. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.40 (2026-08-26) + +* **Dependency Update**: Update to smithy-go v1.28.0. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.39 (2026-08-25) + +* **Dependency Update**: Update to smithy-go v1.27.10. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.38 (2026-08-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.37 (2026-08-14) + +* **Dependency Update**: Update to smithy-go v1.27.8. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.36 (2026-08-10) + +* **Dependency Update**: Update to smithy-go v1.27.7. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.35 (2026-08-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.34 (2026-07-31.2) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.27.6 to fix various serde issues in HTTP binding services. + # v1.4.33 (2026-07-29) * **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 f38ccca23f0..be81b265691 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.33" +const goModuleVersion = "1.5.6" 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 ae09aa2d065..95d21290d69 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,66 @@ +# v2.8.6 (2026-10-09.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.8.5 (2026-10-08) + +* **Dependency Update**: Update to smithy-go v1.28.4. +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.8.4 (2026-09-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.8.3 (2026-09-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.8.2 (2026-09-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.8.1 (2026-08-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.8.0 (2026-08-27) + +* **Feature**: Support connection read timeouts in the SDK. This is currently available on an opt-in basis by setting env `AWS_ENABLE_DEFAULT_SOCKET_TIMEOUT_2026=true`. +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.7.40 (2026-08-26) + +* **Dependency Update**: Update to smithy-go v1.28.0. +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.7.39 (2026-08-25) + +* **Dependency Update**: Update to smithy-go v1.27.10. +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.7.38 (2026-08-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.7.37 (2026-08-14) + +* **Dependency Update**: Update to smithy-go v1.27.8. +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.7.36 (2026-08-10) + +* **Dependency Update**: Update to smithy-go v1.27.7. +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.7.35 (2026-08-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.7.34 (2026-07-31.2) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.27.6 to fix various serde issues in HTTP binding services. + # v2.7.33 (2026-07-29) * **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 98755086c5a..b34a16e0c07 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.33" +const goModuleVersion = "2.8.6" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/timeouts/awsinternal.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/timeouts/awsinternal.go new file mode 100644 index 00000000000..7967f709130 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/timeouts/awsinternal.go @@ -0,0 +1,6 @@ +package timeouts + +// Enabled internally. +var enableReadTimeout2026 = false + +var readTimeout2026Rollout map[string]bool diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/timeouts/timeouts.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/timeouts/timeouts.go new file mode 100644 index 00000000000..626f29c9255 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/timeouts/timeouts.go @@ -0,0 +1,39 @@ +package timeouts + +import ( + "os" + "sync" + "time" +) + +// DefaultReadTimeout is the SDK's default read timeout for a service with no +// entry in serviceInactivityTimeoutMillis. +const DefaultReadTimeout = 5 * time.Minute + +const enableReadTimeoutEnvVar = "AWS_ENABLE_DEFAULT_SOCKET_TIMEOUT_2026" + +var enableFromEnv = sync.OnceValue(func() bool { + return os.Getenv(enableReadTimeoutEnvVar) == "true" +}) + +// GetServiceReadTimeout reports the SDK's default read timeout for a service, +// and whether one applies. +func GetServiceReadTimeout(serviceID string) (time.Duration, bool) { + if enableReadTimeout2026 { + if !readTimeout2026Rollout[serviceID] { + return 0, false + } + } else if !enableFromEnv() { + return 0, false + } + + ms, ok := serviceInactivityTimeoutMillis[serviceID] + if !ok { + return DefaultReadTimeout, true + } + if ms < 0 { + return 0, false + } + + return time.Duration(ms) * time.Millisecond, true +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/timeouts/timeouts_services.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/timeouts/timeouts_services.go new file mode 100644 index 00000000000..216a5895aad --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/timeouts/timeouts_services.go @@ -0,0 +1,102 @@ +// Code generated from the connection read timeout risk mitigation +// document's exemption table. DO NOT EDIT. + +package timeouts + +// serviceInactivityTimeoutMillis overrides the default read timeout for +// services whose operations legitimately hold a connection open, keyed by +// ServiceID. A negative value means the service is fully exempt and gets no +// timeout. +// +// Services absent from this map get DefaultReadTimeout. +var serviceInactivityTimeoutMillis = map[string]int64{ + // Fully exempt: an operation takes an event stream or a streaming blob as + // input. The caller controls how long the request takes, and no response + // arrives until it finishes, so a read timeout would fire on the duration of + // the caller's own upload rather than on a network problem. + "Bedrock Runtime": -1, + "CloudSearch Domain": -1, + "ConnectHealth": -1, + "EBS": -1, + "Glacier": -1, + "Lambda": -1, + "Lex Runtime Service": -1, + "Lex Runtime V2": -1, + "MediaStore Data": -1, + "Omics": -1, + "Polly": -1, + "QBusiness": -1, + "S3": -1, + "SageMaker Runtime HTTP2": -1, + "Transcribe Streaming": -1, + "codeartifact": -1, + + // Long-hold operations: a higher ceiling rather than no ceiling. + "API Gateway": 900000, + "ApiGatewayV2": 900000, + "AppIntegrations": 900000, + "AppStream": 900000, + "Athena": 900000, + "Auto Scaling": 900000, + "Batch": 900000, + "Bedrock": 900000, + "Bedrock Agent": 900000, + "Bedrock Agent Runtime": 900000, + "Bedrock AgentCore": 900000, + "Bedrock AgentCore Control": 900000, + "Bedrock Data Automation Runtime": 900000, + "CloudFormation": 900000, + "CloudWatch": 900000, + "CodeBuild": 900000, + "CodeCatalyst": 900000, + "CodeDeploy": 900000, + "Config Service": 900000, + "Connect": 900000, + "Data Pipeline": 900000, + "DataBrew": 900000, + "DataExchange": 900000, + "DataZone": 900000, + "Device Farm": 900000, + "EC2": 900000, + "ECS": 900000, + "EMR Serverless": 900000, + "Elastic Load Balancing v2": 900000, + "GameLift": 900000, + "GameLiftStreams": 900000, + "Glue": 900000, + "IoT": 900000, + "IoT Data Plane": 900000, + "IoT Jobs Data Plane": 900000, + "IoTSecureTunneling": 900000, + "Kinesis": 900000, + "Kinesis Analytics V2": 900000, + "Kinesis Video Archived Media": 900000, + "Kinesis Video Media": 900000, + "Kinesis Video Signaling": 900000, + "Kinesis Video WebRTC Storage": 900000, + "Lex Model Building Service": 900000, + "Lex Models V2": 900000, + "Neptune Graph": 900000, + "Nova Act": 900000, + "QApps": 900000, + "QConnect": 900000, + "QuickSight": 900000, + "RDS": 900000, + "RDS Data": 900000, + "RTBFabric": 900000, + "SFN": 900000, + "SQS": 900000, + "SSM": 900000, + "SWF": 900000, + "SageMaker": 900000, + "SageMaker Runtime": 900000, + "SagemakerJobRuntime": 900000, + "Storage Gateway": 900000, + "Timestream Query": 900000, + "Wisdom": 900000, + "WorkSpaces": 900000, + "WorkSpaces Web": 900000, + "b2bi": 900000, + "mgn": 900000, + "neptunedata": 900000, +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/CHANGELOG.md index 19ff9fc6816..62fb7b2ac5d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/CHANGELOG.md @@ -1,3 +1,66 @@ +# v1.5.6 (2026-10-09.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.5 (2026-10-08) + +* **Dependency Update**: Update to smithy-go v1.28.4. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.4 (2026-09-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.3 (2026-09-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.2 (2026-09-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.1 (2026-08-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.0 (2026-08-27) + +* **Feature**: Support connection read timeouts in the SDK. This is currently available on an opt-in basis by setting env `AWS_ENABLE_DEFAULT_SOCKET_TIMEOUT_2026=true`. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.41 (2026-08-26) + +* **Dependency Update**: Update to smithy-go v1.28.0. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.40 (2026-08-25) + +* **Dependency Update**: Update to smithy-go v1.27.10. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.39 (2026-08-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.38 (2026-08-14) + +* **Dependency Update**: Update to smithy-go v1.27.8. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.37 (2026-08-10) + +* **Dependency Update**: Update to smithy-go v1.27.7. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.36 (2026-08-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.35 (2026-07-31.2) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.27.6 to fix various serde issues in HTTP binding services. + # v1.4.34 (2026-07-29) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/go_module_metadata.go index 1eb67f426ae..e9389b9831b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/go_module_metadata.go @@ -3,4 +3,4 @@ package v4a // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.4.34" +const goModuleVersion = "1.5.6" 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 01a8aa106a4..3399e9973e2 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,122 @@ +# v1.70.3 (2026-10-09.2) + +* **Dependency Update**: Update to smithy-go v1.28.5. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.70.2 (2026-10-08) + +* **Bug Fix**: Fix modeled errors returning an empty `ErrorMessage()` when the service sends the message under a differently-cased key (`Message` instead of `message`). This was a regression introduced with schema-based deserialization. +* **Dependency Update**: Update to smithy-go v1.28.4. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.70.1 (2026-10-06) + +* No change notes available for this release. + +# v1.70.0 (2026-09-30) + +* **Feature**: Adds support for filtering exported table data using FilterExpression, ProjectionExpression and KeyConditionExpression with ExportTableToPointInTime. + +# v1.69.1 (2026-09-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.69.0 (2026-09-15) + +* **Feature**: Enable schema-based (de)serialization for this service. + +# v1.68.0 (2026-09-09) + +* **Feature**: Stop registering the `retry.MetricsHeader` middleware in generated clients. The `Amz-Sdk-Request` header is now set by the retry middleware itself. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.67.0 (2026-09-04) + +* **Feature**: Stop registering the `spanRetryLoop` middleware in generated clients. The retry loop's tracing span is now opened by the retry middleware itself. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.66.0 (2026-08-31.2) + +* **Feature**: Stop registering the `SetCredentialSourceMiddleware` middleware in generated clients. Credential source user agent features are now set when the client's middleware stack is constructed. + +# v1.65.1 (2026-08-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.65.0 (2026-08-27) + +* **Feature**: Support connection read timeouts in the SDK. This is currently available on an opt-in basis by setting env `AWS_ENABLE_DEFAULT_SOCKET_TIMEOUT_2026=true`. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.64.0 (2026-08-26) + +* **Feature**: Stop registering the `ComputeContentLength` middleware in generated clients. `Content-Length` is now set when the request body is set via `SetStream`. +* **Dependency Update**: Update to smithy-go v1.28.0. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.63.5 (2026-08-25) + +* **Dependency Update**: Update to smithy-go v1.27.10. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.63.4 (2026-08-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.63.3 (2026-08-14) + +* **Dependency Update**: Update to smithy-go v1.27.8. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.63.2 (2026-08-10) + +* **Dependency Update**: Update to smithy-go v1.27.7. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.63.1 (2026-08-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.63.0 (2026-08-04) + +* **Feature**: Vector indexes are a type of index in Amazon DynamoDB that enable similarity search on vector embedding stored in your table items. Vector indexes use approximate nearest neighbor search to find items whose vectors are most similar to a query vector that you provide. + +# v1.62.3 (2026-07-31.2) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.27.6 to fix various serde issues in HTTP binding services. + +# v1.62.2 (2026-07-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.62.1 (2026-07-28) + +* **Dependency Update**: Update to smithy-go v1.27.5. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.62.0 (2026-07-24) + +* **Feature**: Endpoint test standardizations + +# v1.61.0 (2026-07-21) + +* **Feature**: Add an option to clients to disable clock skew +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.60.1 (2026-07-13) + +* No change notes available for this release. + +# v1.60.0 (2026-07-06) + +* **Feature**: Add request serialization snapshot tests. + +# v1.59.2 (2026-07-01) + +* **Bug Fix**: Bump smithy-go to 1.27.3, fix JSON encorder for document.Number, endpoint host label format validation and CBOR union serialization on new serde +* **Dependency Update**: Updated to the latest SDK module versions + # v1.59.1 (2026-06-29) * No change notes available for this release. 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 cc9ce6c2b48..2bda45e17f6 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 @@ -16,7 +16,9 @@ import ( 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" + "github.com/aws/aws-sdk-go-v2/internal/timeouts" ddbcust "github.com/aws/aws-sdk-go-v2/service/dynamodb/internal/customizations" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" acceptencodingcust "github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" smithy "github.com/aws/smithy-go" @@ -28,6 +30,7 @@ import ( smithyrand "github.com/aws/smithy-go/rand" "github.com/aws/smithy-go/tracing" smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/aws/smithy-go/transport/http/protocol/awsjson" "net" "net/http" "net/url" @@ -225,6 +228,8 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveAuthSchemeResolver(&options) + options.Protocol = awsjson.New10(schemas.DynamoDB_20120810) + for _, fn := range optFns { fn(&options) } @@ -277,6 +282,10 @@ func (c *Client) invokeOperation( finalizeClientEndpointResolverOptions(&options) + ctx = setLoggerContext(ctx, options, opID) + + ctx = resolveServiceMetadata(ctx, options, opID) + if err := c.addCommonMiddlewares(stack, options, opID); err != nil { return nil, metadata, err } @@ -393,9 +402,6 @@ func (c *Client) addCommonMiddlewares(stack *middleware.Stack, options Options, if err := addProtocolFinalizerMiddlewares(stack, options, operation); err != nil { return fmt.Errorf("add protocol finalizers: %v", err) } - if err := addSetLoggerMiddleware(stack, options); err != nil { - return err - } if err := addClientRequestID(stack); err != nil { return err } @@ -405,9 +411,6 @@ func (c *Client) addCommonMiddlewares(stack *middleware.Stack, options Options, if err := addRawResponseToMetadata(stack); err != nil { return err } - if err := addSpanRetryLoop(stack, options); err != nil { - return err - } if err := addClientUserAgent(stack, options); err != nil { return err } @@ -446,32 +449,104 @@ func resolveAuthSchemes(options *Options) { } } -type noSmithyDocumentSerde = smithydocument.NoSerde - -type legacyEndpointContextSetter struct { - LegacyResolver EndpointResolver +type serializeRequestMiddleware struct { + options *Options + operationSchema *smithy.OperationSchema } -func (*legacyEndpointContextSetter) ID() string { - return "legacyEndpointContextSetter" +func (*serializeRequestMiddleware) ID() string { + return "OperationSerializer" } -func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, +func (m *serializeRequestMiddleware) HandleSerialize( + ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, +) ( + middleware.SerializeOutput, middleware.Metadata, error, ) { - if m.LegacyResolver != nil { - ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return middleware.SerializeOutput{}, middleware.Metadata{}, fmt.Errorf("unexpected transport type %T", in.Request) + } + + input, ok := in.Parameters.(smithy.Serializable) + if !ok { + return middleware.SerializeOutput{}, middleware.Metadata{}, fmt.Errorf("input %T is not Serializable", in.Request) } - return next.HandleInitialize(ctx, in) + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + + err := m.options.Protocol.SerializeRequest(ctx, m.operationSchema, input, req) + endTimer() + span.End() + + if err != nil { + return middleware.SerializeOutput{}, middleware.Metadata{}, err + } + + return next.HandleSerialize(ctx, in) } -func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { - return stack.Initialize.Add(&legacyEndpointContextSetter{ - LegacyResolver: o.EndpointResolver, - }, middleware.Before) + +type deserializeResponseMiddleware struct { + options *Options + operationSchema *smithy.OperationSchema + output smithy.Deserializable +} + +func (*deserializeResponseMiddleware) ID() string { + return "OperationDeserializer" +} + +func (m *deserializeResponseMiddleware) HandleDeserialize( + ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler, +) ( + middleware.DeserializeOutput, middleware.Metadata, error, +) { + out, md, err := next.HandleDeserialize(ctx, in) + + resp, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, md, err + } + return out, md, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + // Close the response body on return. CloseResponseBody keeps the body + // open only for a successful caller-owned stream (a streaming payload + // with a nil error); on any error -- including one surfaced by an + // interceptor that runs after OperationDeserializer (after transmit or + // before deserialization) -- it closes the received body. Registering + // this before the error check below is what covers those interceptor + // aborts. Event streams close their own body in the event stream + // deserializer. + if !m.operationSchema.IsInputEventStream() && !m.operationSchema.IsOutputEventStream() { + _, isStreamingPayload := m.output.(smithy.StreamingOutput) + defer func() { + smithyhttp.CloseResponseBody(ctx, resp, isStreamingPayload, err) + }() + } + + if err != nil { + return out, md, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + + err = m.options.Protocol.DeserializeResponse(ctx, m.operationSchema, TypeRegistry, resp, m.output) + out.Result = m.output + + endTimer() + span.End() + + return out, md, err } +type noSmithyDocumentSerde = smithydocument.NoSerde + func resolveDefaultLogger(o *Options) { if o.Logger != nil { return @@ -479,8 +554,9 @@ func resolveDefaultLogger(o *Options) { o.Logger = logging.Nop{} } -func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { - return middleware.AddSetLoggerMiddleware(stack, o.Logger) +func setLoggerContext(ctx context.Context, options Options, operation string) context.Context { + _ = operation + return middleware.SetLogger(ctx, options.Logger) } func setResolvedDefaultsMode(o *Options) { @@ -501,17 +577,18 @@ func setResolvedDefaultsMode(o *Options) { // 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, - AccountIDEndpointMode: cfg.AccountIDEndpointMode, - AuthSchemePreference: cfg.AuthSchemePreference, + 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, + DisableClockSkewCorrection: cfg.DisableClockSkewCorrection, + AccountIDEndpointMode: cfg.AccountIDEndpointMode, + AuthSchemePreference: cfg.AuthSchemePreference, } resolveAWSRetryerProvider(cfg, &opts) resolveAWSRetryMaxAttempts(cfg, &opts) @@ -560,6 +637,12 @@ func resolveHTTPClient(o *Options) { }) } + if _, ok := buildable.GetReadTimeout(); !ok { + if timeout, ok := timeouts.GetServiceReadTimeout(ServiceID); ok { + buildable = buildable.WithReadTimeout(timeout) + } + } + o.HTTPClient = buildable } @@ -711,40 +794,14 @@ func addClientRequestID(stack *middleware.Stack) error { return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) } -func addComputeContentLength(stack *middleware.Stack) error { - return stack.Build.Insert(&smithyhttp.ComputeContentLength{}, "ClientRequestID", 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 addRecordResponseTiming(stack *middleware.Stack, options Options) error { + return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{ + DisableClockSkewCorrection: options.DisableClockSkewCorrection, + }, middleware.After) } func addStreamingEventsPayload(stack *middleware.Stack) error { return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before) @@ -798,13 +855,11 @@ func addRetry(stack *middleware.Stack, o Options, c *Client) error { m.LogAttempts = o.ClientLogMode.IsRetries() m.OperationMeter = o.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/dynamodb") m.ClientSkew = c.timeOffset + m.DisableClockSkewCorrection = o.DisableClockSkewCorrection }) 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 } @@ -987,35 +1042,21 @@ func addUserAgentAccountIDEndpointMode(stack *middleware.Stack, options Options) 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) + asProviderSource, ok := options.Credentials.(aws.CredentialProviderSource) + if !ok { + return nil + } + + for _, source := range asProviderSource.ProviderSources() { + ua.AddCredentialsSource(source) + } + return nil } func resolveTracerProvider(options *Options) { @@ -1035,12 +1076,16 @@ type IdempotencyTokenProvider interface { GetIdempotencyToken() (string, error) } -func newServiceMetadataMiddleware(region, operation string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: operation, +func resolveServiceMetadata(ctx context.Context, options Options, operation string) context.Context { + ctx = awsmiddleware.SetServiceID(ctx, ServiceID) + if options.Region != "" { + ctx = awsmiddleware.SetRegion(ctx, options.Region) + } + ctx = awsmiddleware.SetOperationName(ctx, operation) + if options.EndpointResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) } + return ctx } func addRecursionDetection(stack *middleware.Stack) error { 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 82201b4843b..f9b4c183d61 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 @@ -4,9 +4,10 @@ package dynamodb import ( "context" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // This operation allows you to perform batch reads or writes on data stored in @@ -66,6 +67,19 @@ type BatchExecuteStatementInput struct { noSmithyDocumentSerde } +func (v *BatchExecuteStatementInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.BatchExecuteStatementInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *BatchExecuteStatementInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ReturnConsumedCapacity != "" { + s.WriteString(schemas.BatchExecuteStatementInput_ReturnConsumedCapacity, string(v.ReturnConsumedCapacity)) + } + serializePartiQLBatchRequest(s, schemas.BatchExecuteStatementInput_Statements, v.Statements) +} + type BatchExecuteStatementOutput struct { // The capacity units consumed by the entire operation. The values of the list are @@ -82,35 +96,42 @@ type BatchExecuteStatementOutput struct { noSmithyDocumentSerde } +func (v *BatchExecuteStatementOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.BatchExecuteStatementOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *BatchExecuteStatementOutput) SerializeMembers(s smithy.ShapeSerializer) { + serializeConsumedCapacityMultiple(s, schemas.BatchExecuteStatementOutput_ConsumedCapacity, v.ConsumedCapacity) + serializePartiQLBatchResponse(s, schemas.BatchExecuteStatementOutput_Responses, v.Responses) +} +func (v *BatchExecuteStatementOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.BatchExecuteStatementOutput, func(s *smithy.Schema) error { + switch s { + case schemas.BatchExecuteStatementOutput_ConsumedCapacity: + return deserializeConsumedCapacityMultiple(d, schemas.BatchExecuteStatementOutput_ConsumedCapacity, &v.ConsumedCapacity) + case schemas.BatchExecuteStatementOutput_Responses: + return deserializePartiQLBatchResponse(d, schemas.BatchExecuteStatementOutput_Responses, &v.Responses) + } + return nil + }) +} func (c *Client) addOperationBatchExecuteStatementMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpBatchExecuteStatement{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.BatchExecuteStatement, schemas.BatchExecuteStatementInput, schemas.BatchExecuteStatementOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpBatchExecuteStatement{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.BatchExecuteStatement, schemas.BatchExecuteStatementInput, schemas.BatchExecuteStatementOutput), output: &BatchExecuteStatementOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addUserAgentAccountIDEndpointMode(stack, options); err != nil { @@ -122,9 +143,6 @@ func (c *Client) addOperationBatchExecuteStatementMiddlewares(stack *middleware. if err = addOpBatchExecuteStatementValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "BatchExecuteStatement"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 70da9d78910..a38be38b643 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // The BatchGetItem operation returns the attributes of one or more items from one @@ -173,6 +174,18 @@ type BatchGetItemInput struct { noSmithyDocumentSerde } +func (v *BatchGetItemInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.BatchGetItemInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *BatchGetItemInput) SerializeMembers(s smithy.ShapeSerializer) { + serializeBatchGetRequestMap(s, schemas.BatchGetItemInput_RequestItems, v.RequestItems) + if v.ReturnConsumedCapacity != "" { + s.WriteString(schemas.BatchGetItemInput_ReturnConsumedCapacity, string(v.ReturnConsumedCapacity)) + } +} func (in *BatchGetItemInput) bindEndpointParams(p *EndpointParameters) { func() { v1 := in.RequestItems @@ -230,35 +243,45 @@ type BatchGetItemOutput struct { noSmithyDocumentSerde } +func (v *BatchGetItemOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.BatchGetItemOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *BatchGetItemOutput) SerializeMembers(s smithy.ShapeSerializer) { + serializeConsumedCapacityMultiple(s, schemas.BatchGetItemOutput_ConsumedCapacity, v.ConsumedCapacity) + serializeBatchGetResponseMap(s, schemas.BatchGetItemOutput_Responses, v.Responses) + serializeBatchGetRequestMap(s, schemas.BatchGetItemOutput_UnprocessedKeys, v.UnprocessedKeys) +} +func (v *BatchGetItemOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.BatchGetItemOutput, func(s *smithy.Schema) error { + switch s { + case schemas.BatchGetItemOutput_ConsumedCapacity: + return deserializeConsumedCapacityMultiple(d, schemas.BatchGetItemOutput_ConsumedCapacity, &v.ConsumedCapacity) + case schemas.BatchGetItemOutput_Responses: + return deserializeBatchGetResponseMap(d, schemas.BatchGetItemOutput_Responses, &v.Responses) + case schemas.BatchGetItemOutput_UnprocessedKeys: + return deserializeBatchGetRequestMap(d, schemas.BatchGetItemOutput_UnprocessedKeys, &v.UnprocessedKeys) + } + return nil + }) +} func (c *Client) addOperationBatchGetItemMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpBatchGetItem{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.BatchGetItem, schemas.BatchGetItemInput, schemas.BatchGetItemOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpBatchGetItem{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.BatchGetItem, schemas.BatchGetItemInput, schemas.BatchGetItemOutput), output: &BatchGetItemOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpBatchGetItemDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -273,9 +296,6 @@ func (c *Client) addOperationBatchGetItemMiddlewares(stack *middleware.Stack, op if err = addOpBatchGetItemValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "BatchGetItem"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 5d843b37e10..034c53510f4 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // The BatchWriteItem operation puts or deletes multiple items in one or more @@ -32,12 +33,12 @@ import ( // iteration would check for unprocessed items and submit a new BatchWriteItem // request with those unprocessed items until all items have been processed. // -// For tables and indexes with provisioned capacity, if none of the items can be -// processed due to insufficient provisioned throughput on all of the tables in the -// request, then BatchWriteItem returns a ProvisionedThroughputExceededException . -// For all tables and indexes, if none of the items can be processed due to other -// throttling scenarios (such as exceeding partition level limits), then -// BatchWriteItem returns a ThrottlingException . +// If BatchWriteItem cannot process any items due to throttling (for example, +// insufficient provisioned throughput on the tables in the request, or +// partition-level or account-level limits), it returns a +// ProvisionedThroughputExceededException or a ThrottlingException . Both indicate +// that the request was throttled; check the ThrottlingReason field in the +// returned exception for details. // // If DynamoDB returns any unprocessed items, you should retry the batch operation // on those items. However, we strongly recommend that you use an exponential @@ -169,6 +170,21 @@ type BatchWriteItemInput struct { noSmithyDocumentSerde } +func (v *BatchWriteItemInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.BatchWriteItemInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *BatchWriteItemInput) SerializeMembers(s smithy.ShapeSerializer) { + serializeBatchWriteItemRequestMap(s, schemas.BatchWriteItemInput_RequestItems, v.RequestItems) + if v.ReturnConsumedCapacity != "" { + s.WriteString(schemas.BatchWriteItemInput_ReturnConsumedCapacity, string(v.ReturnConsumedCapacity)) + } + if v.ReturnItemCollectionMetrics != "" { + s.WriteString(schemas.BatchWriteItemInput_ReturnItemCollectionMetrics, string(v.ReturnItemCollectionMetrics)) + } +} func (in *BatchWriteItemInput) bindEndpointParams(p *EndpointParameters) { func() { v1 := in.RequestItems @@ -191,6 +207,9 @@ type BatchWriteItemOutput struct { // - TableName - The table that consumed the provisioned throughput. // // - CapacityUnits - The total number of capacity units consumed. + // + // If the table has vector indexes, each element also includes a VectorIndexes + // field with VectorWriteRequestBytes consumed for each affected vector index. ConsumedCapacity []types.ConsumedCapacity // A list of tables that were processed by BatchWriteItem and, for each table, @@ -250,35 +269,45 @@ type BatchWriteItemOutput struct { noSmithyDocumentSerde } +func (v *BatchWriteItemOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.BatchWriteItemOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *BatchWriteItemOutput) SerializeMembers(s smithy.ShapeSerializer) { + serializeConsumedCapacityMultiple(s, schemas.BatchWriteItemOutput_ConsumedCapacity, v.ConsumedCapacity) + serializeItemCollectionMetricsPerTable(s, schemas.BatchWriteItemOutput_ItemCollectionMetrics, v.ItemCollectionMetrics) + serializeBatchWriteItemRequestMap(s, schemas.BatchWriteItemOutput_UnprocessedItems, v.UnprocessedItems) +} +func (v *BatchWriteItemOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.BatchWriteItemOutput, func(s *smithy.Schema) error { + switch s { + case schemas.BatchWriteItemOutput_ConsumedCapacity: + return deserializeConsumedCapacityMultiple(d, schemas.BatchWriteItemOutput_ConsumedCapacity, &v.ConsumedCapacity) + case schemas.BatchWriteItemOutput_ItemCollectionMetrics: + return deserializeItemCollectionMetricsPerTable(d, schemas.BatchWriteItemOutput_ItemCollectionMetrics, &v.ItemCollectionMetrics) + case schemas.BatchWriteItemOutput_UnprocessedItems: + return deserializeBatchWriteItemRequestMap(d, schemas.BatchWriteItemOutput_UnprocessedItems, &v.UnprocessedItems) + } + return nil + }) +} func (c *Client) addOperationBatchWriteItemMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpBatchWriteItem{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.BatchWriteItem, schemas.BatchWriteItemInput, schemas.BatchWriteItemOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpBatchWriteItem{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.BatchWriteItem, schemas.BatchWriteItemInput, schemas.BatchWriteItemOutput), output: &BatchWriteItemOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpBatchWriteItemDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -293,9 +322,6 @@ func (c *Client) addOperationBatchWriteItemMiddlewares(stack *middleware.Stack, if err = addOpBatchWriteItemValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "BatchWriteItem"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 886a252620a..c8be0d33ffb 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a backup for an existing table. @@ -72,6 +73,20 @@ type CreateBackupInput struct { noSmithyDocumentSerde } +func (v *CreateBackupInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.CreateBackupInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *CreateBackupInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.BackupName != nil { + s.WriteString(schemas.CreateBackupInput_BackupName, *v.BackupName) + } + if v.TableName != nil { + s.WriteString(schemas.CreateBackupInput_TableName, *v.TableName) + } +} func (in *CreateBackupInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TableName @@ -89,35 +104,44 @@ type CreateBackupOutput struct { noSmithyDocumentSerde } +func (v *CreateBackupOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.CreateBackupOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *CreateBackupOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.BackupDetails != nil { + s.WriteStruct(schemas.CreateBackupOutput_BackupDetails) + v.BackupDetails.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *CreateBackupOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.CreateBackupOutput, func(s *smithy.Schema) error { + switch s { + case schemas.CreateBackupOutput_BackupDetails: + v.BackupDetails = &types.BackupDetails{} + return v.BackupDetails.Deserialize(d) + } + return nil + }) +} func (c *Client) addOperationCreateBackupMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreateBackup{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.CreateBackup, schemas.CreateBackupInput, schemas.CreateBackupOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreateBackup{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.CreateBackup, schemas.CreateBackupInput, schemas.CreateBackupOutput), output: &CreateBackupOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpCreateBackupDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -132,9 +156,6 @@ func (c *Client) addOperationCreateBackupMiddlewares(stack *middleware.Stack, op if err = addOpCreateBackupValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "CreateBackup"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 4d51eb7a489..0a9d218bc12 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a global table from an existing table. A global table creates a @@ -94,6 +95,18 @@ type CreateGlobalTableInput struct { noSmithyDocumentSerde } +func (v *CreateGlobalTableInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.CreateGlobalTableInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *CreateGlobalTableInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.GlobalTableName != nil { + s.WriteString(schemas.CreateGlobalTableInput_GlobalTableName, *v.GlobalTableName) + } + serializeReplicaList(s, schemas.CreateGlobalTableInput_ReplicationGroup, v.ReplicationGroup) +} func (in *CreateGlobalTableInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.GlobalTableName @@ -111,35 +124,44 @@ type CreateGlobalTableOutput struct { noSmithyDocumentSerde } +func (v *CreateGlobalTableOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.CreateGlobalTableOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *CreateGlobalTableOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.GlobalTableDescription != nil { + s.WriteStruct(schemas.CreateGlobalTableOutput_GlobalTableDescription) + v.GlobalTableDescription.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *CreateGlobalTableOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.CreateGlobalTableOutput, func(s *smithy.Schema) error { + switch s { + case schemas.CreateGlobalTableOutput_GlobalTableDescription: + v.GlobalTableDescription = &types.GlobalTableDescription{} + return v.GlobalTableDescription.Deserialize(d) + } + return nil + }) +} func (c *Client) addOperationCreateGlobalTableMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreateGlobalTable{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.CreateGlobalTable, schemas.CreateGlobalTableInput, schemas.CreateGlobalTableOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreateGlobalTable{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.CreateGlobalTable, schemas.CreateGlobalTableInput, schemas.CreateGlobalTableOutput), output: &CreateGlobalTableOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpCreateGlobalTableDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -154,9 +176,6 @@ func (c *Client) addOperationCreateGlobalTableMiddlewares(stack *middleware.Stac if err = addOpCreateGlobalTableValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "CreateGlobalTable"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 294ee44a245..6840a8703cf 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // The CreateTable operation adds a new table to your account. In an Amazon Web @@ -259,6 +260,31 @@ type CreateTableInput struct { // [Tagging for DynamoDB]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html Tags []types.Tag + // One or more vector indexes to be created on the table. Each vector index + // enables similarity search on a vector attribute. Each element in the list + // consists of: + // + // - IndexName - The name of the vector index. Must be unique within the table. + // + // - VectorAttribute - The attribute that contains vector embeddings. If multiple + // vector indexes reference the same attribute, they must all use the same number + // of dimensions. + // + // - Dimensions - The number of dimensions in each vector. + // + // - DistanceFunction - The distance function used to calculate similarity. Valid + // values: COSINE , EUCLIDEAN , DOT_PRODUCT . + // + // - Projection - Specifies attributes that are copied (projected) from the table + // into the vector index. The total number of projected non-key attributes is + // shared across the vector attribute (counts as 1) and INLINE_FILTER search + // schema elements (each counts as 1). HASH search schema elements do not count + // toward this limit. + // + // - SearchSchema - (Optional) Defines the partition key ( HASH ) and inline + // filter ( INLINE_FILTER ) attributes for the vector index. + VectorIndexes []types.VectorIndex + // Represents the warm throughput (in read units per second and write units per // second) for creating a table. WarmThroughput *types.WarmThroughput @@ -266,6 +292,66 @@ type CreateTableInput struct { noSmithyDocumentSerde } +func (v *CreateTableInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.CreateTableInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *CreateTableInput) SerializeMembers(s smithy.ShapeSerializer) { + serializeAttributeDefinitions(s, schemas.CreateTableInput_AttributeDefinitions, v.AttributeDefinitions) + if v.BillingMode != "" { + s.WriteString(schemas.CreateTableInput_BillingMode, string(v.BillingMode)) + } + if v.DeletionProtectionEnabled != nil { + s.WriteBool(schemas.CreateTableInput_DeletionProtectionEnabled, *v.DeletionProtectionEnabled) + } + serializeGlobalSecondaryIndexList(s, schemas.CreateTableInput_GlobalSecondaryIndexes, v.GlobalSecondaryIndexes) + if v.GlobalTableSettingsReplicationMode != "" { + s.WriteString(schemas.CreateTableInput_GlobalTableSettingsReplicationMode, string(v.GlobalTableSettingsReplicationMode)) + } + if v.GlobalTableSourceArn != nil { + s.WriteString(schemas.CreateTableInput_GlobalTableSourceArn, *v.GlobalTableSourceArn) + } + serializeKeySchema(s, schemas.CreateTableInput_KeySchema, v.KeySchema) + serializeLocalSecondaryIndexList(s, schemas.CreateTableInput_LocalSecondaryIndexes, v.LocalSecondaryIndexes) + if v.OnDemandThroughput != nil { + s.WriteStruct(schemas.CreateTableInput_OnDemandThroughput) + v.OnDemandThroughput.SerializeMembers(s) + s.CloseStruct() + } + if v.ProvisionedThroughput != nil { + s.WriteStruct(schemas.CreateTableInput_ProvisionedThroughput) + v.ProvisionedThroughput.SerializeMembers(s) + s.CloseStruct() + } + if v.ResourcePolicy != nil { + s.WriteString(schemas.CreateTableInput_ResourcePolicy, *v.ResourcePolicy) + } + if v.SSESpecification != nil { + s.WriteStruct(schemas.CreateTableInput_SSESpecification) + v.SSESpecification.SerializeMembers(s) + s.CloseStruct() + } + if v.StreamSpecification != nil { + s.WriteStruct(schemas.CreateTableInput_StreamSpecification) + v.StreamSpecification.SerializeMembers(s) + s.CloseStruct() + } + if v.TableClass != "" { + s.WriteString(schemas.CreateTableInput_TableClass, string(v.TableClass)) + } + if v.TableName != nil { + s.WriteString(schemas.CreateTableInput_TableName, *v.TableName) + } + serializeTagList(s, schemas.CreateTableInput_Tags, v.Tags) + serializeVectorIndexList(s, schemas.CreateTableInput_VectorIndexes, v.VectorIndexes) + if v.WarmThroughput != nil { + s.WriteStruct(schemas.CreateTableInput_WarmThroughput) + v.WarmThroughput.SerializeMembers(s) + s.CloseStruct() + } +} func (in *CreateTableInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TableName @@ -284,35 +370,44 @@ type CreateTableOutput struct { noSmithyDocumentSerde } +func (v *CreateTableOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.CreateTableOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *CreateTableOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.TableDescription != nil { + s.WriteStruct(schemas.CreateTableOutput_TableDescription) + v.TableDescription.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *CreateTableOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.CreateTableOutput, func(s *smithy.Schema) error { + switch s { + case schemas.CreateTableOutput_TableDescription: + v.TableDescription = &types.TableDescription{} + return v.TableDescription.Deserialize(d) + } + return nil + }) +} func (c *Client) addOperationCreateTableMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreateTable{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.CreateTable, schemas.CreateTableInput, schemas.CreateTableOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreateTable{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.CreateTable, schemas.CreateTableInput, schemas.CreateTableOutput), output: &CreateTableOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpCreateTableDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -327,9 +422,6 @@ func (c *Client) addOperationCreateTableMiddlewares(stack *middleware.Stack, opt if err = addOpCreateTableValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "CreateTable"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 62b602a4c39..1fb9525da0e 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes an existing backup of a table. @@ -39,6 +40,17 @@ type DeleteBackupInput struct { noSmithyDocumentSerde } +func (v *DeleteBackupInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DeleteBackupInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DeleteBackupInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.BackupArn != nil { + s.WriteString(schemas.DeleteBackupInput_BackupArn, *v.BackupArn) + } +} func (in *DeleteBackupInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.BackupArn @@ -56,35 +68,44 @@ type DeleteBackupOutput struct { noSmithyDocumentSerde } +func (v *DeleteBackupOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DeleteBackupOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DeleteBackupOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.BackupDescription != nil { + s.WriteStruct(schemas.DeleteBackupOutput_BackupDescription) + v.BackupDescription.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *DeleteBackupOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.DeleteBackupOutput, func(s *smithy.Schema) error { + switch s { + case schemas.DeleteBackupOutput_BackupDescription: + v.BackupDescription = &types.BackupDescription{} + return v.BackupDescription.Deserialize(d) + } + return nil + }) +} func (c *Client) addOperationDeleteBackupMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteBackup{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DeleteBackup, schemas.DeleteBackupInput, schemas.DeleteBackupOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteBackup{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DeleteBackup, schemas.DeleteBackupInput, schemas.DeleteBackupOutput), output: &DeleteBackupOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpDeleteBackupDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -99,9 +120,6 @@ func (c *Client) addOperationDeleteBackupMiddlewares(stack *middleware.Stack, op if err = addOpDeleteBackupValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "DeleteBackup"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 abaff832288..8e93a208a44 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes a single item in a table by primary key. You can perform a conditional @@ -202,6 +203,39 @@ type DeleteItemInput struct { noSmithyDocumentSerde } +func (v *DeleteItemInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DeleteItemInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DeleteItemInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ConditionExpression != nil { + s.WriteString(schemas.DeleteItemInput_ConditionExpression, *v.ConditionExpression) + } + if v.ConditionalOperator != "" { + s.WriteString(schemas.DeleteItemInput_ConditionalOperator, string(v.ConditionalOperator)) + } + serializeExpectedAttributeMap(s, schemas.DeleteItemInput_Expected, v.Expected) + serializeExpressionAttributeNameMap(s, schemas.DeleteItemInput_ExpressionAttributeNames, v.ExpressionAttributeNames) + serializeExpressionAttributeValueMap(s, schemas.DeleteItemInput_ExpressionAttributeValues, v.ExpressionAttributeValues) + serializeKey(s, schemas.DeleteItemInput_Key, v.Key) + if v.ReturnConsumedCapacity != "" { + s.WriteString(schemas.DeleteItemInput_ReturnConsumedCapacity, string(v.ReturnConsumedCapacity)) + } + if v.ReturnItemCollectionMetrics != "" { + s.WriteString(schemas.DeleteItemInput_ReturnItemCollectionMetrics, string(v.ReturnItemCollectionMetrics)) + } + if v.ReturnValues != "" { + s.WriteString(schemas.DeleteItemInput_ReturnValues, string(v.ReturnValues)) + } + if v.ReturnValuesOnConditionCheckFailure != "" { + s.WriteString(schemas.DeleteItemInput_ReturnValuesOnConditionCheckFailure, string(v.ReturnValuesOnConditionCheckFailure)) + } + if v.TableName != nil { + s.WriteString(schemas.DeleteItemInput_TableName, *v.TableName) + } +} func (in *DeleteItemInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TableName @@ -222,6 +256,9 @@ type DeleteItemOutput struct { // returned if the ReturnConsumedCapacity parameter was specified. For more // information, see [Provisioned capacity mode]in the Amazon DynamoDB Developer Guide. // + // If the table has vector indexes, the response includes a VectorIndexes field + // with VectorWriteRequestBytes consumed for each affected vector index. + // // [Provisioned capacity mode]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html ConsumedCapacity *types.ConsumedCapacity @@ -252,35 +289,55 @@ type DeleteItemOutput struct { noSmithyDocumentSerde } -func (c *Client) addOperationDeleteItemMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteItem{}, middleware.After) - if err != nil { - return err +func (v *DeleteItemOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DeleteItemOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DeleteItemOutput) SerializeMembers(s smithy.ShapeSerializer) { + serializeAttributeMap(s, schemas.DeleteItemOutput_Attributes, v.Attributes) + if v.ConsumedCapacity != nil { + s.WriteStruct(schemas.DeleteItemOutput_ConsumedCapacity) + v.ConsumedCapacity.SerializeMembers(s) + s.CloseStruct() } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteItem{}, middleware.After) - if err != nil { - return err + if v.ItemCollectionMetrics != nil { + s.WriteStruct(schemas.DeleteItemOutput_ItemCollectionMetrics) + v.ItemCollectionMetrics.SerializeMembers(s) + s.CloseStruct() } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { +} +func (v *DeleteItemOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.DeleteItemOutput, func(s *smithy.Schema) error { + switch s { + case schemas.DeleteItemOutput_Attributes: + return deserializeAttributeMap(d, schemas.DeleteItemOutput_Attributes, &v.Attributes) + case schemas.DeleteItemOutput_ConsumedCapacity: + v.ConsumedCapacity = &types.ConsumedCapacity{} + return v.ConsumedCapacity.Deserialize(d) + case schemas.DeleteItemOutput_ItemCollectionMetrics: + v.ItemCollectionMetrics = &types.ItemCollectionMetrics{} + return v.ItemCollectionMetrics.Deserialize(d) + } + return nil + }) +} +func (c *Client) addOperationDeleteItemMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DeleteItem, schemas.DeleteItemInput, schemas.DeleteItemOutput)}, middleware.After); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DeleteItem, schemas.DeleteItemInput, schemas.DeleteItemOutput), output: &DeleteItemOutput{}}, middleware.After); err != nil { return err } + if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpDeleteItemDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -295,9 +352,6 @@ func (c *Client) addOperationDeleteItemMiddlewares(stack *middleware.Stack, opti if err = addOpDeleteItemValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "DeleteItem"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 55afbefa5d0..3a0ea73bb08 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 @@ -5,9 +5,10 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes the resource-based policy attached to the resource, which can be a @@ -62,6 +63,20 @@ type DeleteResourcePolicyInput struct { noSmithyDocumentSerde } +func (v *DeleteResourcePolicyInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DeleteResourcePolicyInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DeleteResourcePolicyInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ExpectedRevisionId != nil { + s.WriteString(schemas.DeleteResourcePolicyInput_ExpectedRevisionId, *v.ExpectedRevisionId) + } + if v.ResourceArn != nil { + s.WriteString(schemas.DeleteResourcePolicyInput_ResourceArn, *v.ResourceArn) + } +} func (in *DeleteResourcePolicyInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.ResourceArn @@ -83,35 +98,42 @@ type DeleteResourcePolicyOutput struct { noSmithyDocumentSerde } +func (v *DeleteResourcePolicyOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DeleteResourcePolicyOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DeleteResourcePolicyOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.RevisionId != nil { + s.WriteString(schemas.DeleteResourcePolicyOutput_RevisionId, *v.RevisionId) + } +} +func (v *DeleteResourcePolicyOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.DeleteResourcePolicyOutput, func(s *smithy.Schema) error { + switch s { + case schemas.DeleteResourcePolicyOutput_RevisionId: + v.RevisionId = new(string) + return d.ReadString(schemas.DeleteResourcePolicyOutput_RevisionId, v.RevisionId) + } + return nil + }) +} func (c *Client) addOperationDeleteResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteResourcePolicy{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DeleteResourcePolicy, schemas.DeleteResourcePolicyInput, schemas.DeleteResourcePolicyOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteResourcePolicy{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DeleteResourcePolicy, schemas.DeleteResourcePolicyInput, schemas.DeleteResourcePolicyOutput), output: &DeleteResourcePolicyOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpDeleteResourcePolicyDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -126,9 +148,6 @@ func (c *Client) addOperationDeleteResourcePolicyMiddlewares(stack *middleware.S if err = addOpDeleteResourcePolicyValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "DeleteResourcePolicy"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 fc50927bafc..f0edcc10b4a 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // The DeleteTable operation deletes a table and all of its items. After a @@ -59,6 +60,17 @@ type DeleteTableInput struct { noSmithyDocumentSerde } +func (v *DeleteTableInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DeleteTableInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DeleteTableInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.TableName != nil { + s.WriteString(schemas.DeleteTableInput_TableName, *v.TableName) + } +} func (in *DeleteTableInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TableName @@ -77,35 +89,44 @@ type DeleteTableOutput struct { noSmithyDocumentSerde } +func (v *DeleteTableOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DeleteTableOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DeleteTableOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.TableDescription != nil { + s.WriteStruct(schemas.DeleteTableOutput_TableDescription) + v.TableDescription.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *DeleteTableOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.DeleteTableOutput, func(s *smithy.Schema) error { + switch s { + case schemas.DeleteTableOutput_TableDescription: + v.TableDescription = &types.TableDescription{} + return v.TableDescription.Deserialize(d) + } + return nil + }) +} func (c *Client) addOperationDeleteTableMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteTable{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DeleteTable, schemas.DeleteTableInput, schemas.DeleteTableOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteTable{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DeleteTable, schemas.DeleteTableInput, schemas.DeleteTableOutput), output: &DeleteTableOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpDeleteTableDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -120,9 +141,6 @@ func (c *Client) addOperationDeleteTableMiddlewares(stack *middleware.Stack, opt if err = addOpDeleteTableValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "DeleteTable"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 58ce7629776..7aa68f3b48c 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Describes an existing backup of a table. @@ -39,6 +40,17 @@ type DescribeBackupInput struct { noSmithyDocumentSerde } +func (v *DescribeBackupInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DescribeBackupInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DescribeBackupInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.BackupArn != nil { + s.WriteString(schemas.DescribeBackupInput_BackupArn, *v.BackupArn) + } +} func (in *DescribeBackupInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.BackupArn @@ -56,35 +68,44 @@ type DescribeBackupOutput struct { noSmithyDocumentSerde } +func (v *DescribeBackupOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DescribeBackupOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DescribeBackupOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.BackupDescription != nil { + s.WriteStruct(schemas.DescribeBackupOutput_BackupDescription) + v.BackupDescription.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *DescribeBackupOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.DescribeBackupOutput, func(s *smithy.Schema) error { + switch s { + case schemas.DescribeBackupOutput_BackupDescription: + v.BackupDescription = &types.BackupDescription{} + return v.BackupDescription.Deserialize(d) + } + return nil + }) +} func (c *Client) addOperationDescribeBackupMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeBackup{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DescribeBackup, schemas.DescribeBackupInput, schemas.DescribeBackupOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeBackup{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DescribeBackup, schemas.DescribeBackupInput, schemas.DescribeBackupOutput), output: &DescribeBackupOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpDescribeBackupDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -99,9 +120,6 @@ func (c *Client) addOperationDescribeBackupMiddlewares(stack *middleware.Stack, if err = addOpDescribeBackupValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "DescribeBackup"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 ee0968ff409..50010a77405 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Checks the status of continuous backups and point in time recovery on the @@ -54,6 +55,17 @@ type DescribeContinuousBackupsInput struct { noSmithyDocumentSerde } +func (v *DescribeContinuousBackupsInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DescribeContinuousBackupsInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DescribeContinuousBackupsInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.TableName != nil { + s.WriteString(schemas.DescribeContinuousBackupsInput_TableName, *v.TableName) + } +} func (in *DescribeContinuousBackupsInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TableName @@ -72,35 +84,44 @@ type DescribeContinuousBackupsOutput struct { noSmithyDocumentSerde } +func (v *DescribeContinuousBackupsOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DescribeContinuousBackupsOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DescribeContinuousBackupsOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ContinuousBackupsDescription != nil { + s.WriteStruct(schemas.DescribeContinuousBackupsOutput_ContinuousBackupsDescription) + v.ContinuousBackupsDescription.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *DescribeContinuousBackupsOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.DescribeContinuousBackupsOutput, func(s *smithy.Schema) error { + switch s { + case schemas.DescribeContinuousBackupsOutput_ContinuousBackupsDescription: + v.ContinuousBackupsDescription = &types.ContinuousBackupsDescription{} + return v.ContinuousBackupsDescription.Deserialize(d) + } + return nil + }) +} func (c *Client) addOperationDescribeContinuousBackupsMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeContinuousBackups{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DescribeContinuousBackups, schemas.DescribeContinuousBackupsInput, schemas.DescribeContinuousBackupsOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeContinuousBackups{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DescribeContinuousBackups, schemas.DescribeContinuousBackupsInput, schemas.DescribeContinuousBackupsOutput), output: &DescribeContinuousBackupsOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpDescribeContinuousBackupsDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -115,9 +136,6 @@ func (c *Client) addOperationDescribeContinuousBackupsMiddlewares(stack *middlew if err = addOpDescribeContinuousBackupsValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "DescribeContinuousBackups"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 1a6730b8643..033534f3837 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" smithywaiter "github.com/aws/smithy-go/waiter" "time" ) @@ -44,6 +45,20 @@ type DescribeContributorInsightsInput struct { noSmithyDocumentSerde } +func (v *DescribeContributorInsightsInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DescribeContributorInsightsInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DescribeContributorInsightsInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.IndexName != nil { + s.WriteString(schemas.DescribeContributorInsightsInput_IndexName, *v.IndexName) + } + if v.TableName != nil { + s.WriteString(schemas.DescribeContributorInsightsInput_TableName, *v.TableName) + } +} func (in *DescribeContributorInsightsInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TableName @@ -96,35 +111,85 @@ type DescribeContributorInsightsOutput struct { noSmithyDocumentSerde } -func (c *Client) addOperationDescribeContributorInsightsMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeContributorInsights{}, middleware.After) - if err != nil { - return err +func (v *DescribeContributorInsightsOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DescribeContributorInsightsOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DescribeContributorInsightsOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ContributorInsightsMode != "" { + s.WriteString(schemas.DescribeContributorInsightsOutput_ContributorInsightsMode, string(v.ContributorInsightsMode)) } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeContributorInsights{}, middleware.After) - if err != nil { - return err + serializeContributorInsightsRuleList(s, schemas.DescribeContributorInsightsOutput_ContributorInsightsRuleList, v.ContributorInsightsRuleList) + if v.ContributorInsightsStatus != "" { + s.WriteString(schemas.DescribeContributorInsightsOutput_ContributorInsightsStatus, string(v.ContributorInsightsStatus)) } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err + if v.FailureException != nil { + s.WriteStruct(schemas.DescribeContributorInsightsOutput_FailureException) + v.FailureException.SerializeMembers(s) + s.CloseStruct() } - if err = addComputeContentLength(stack); err != nil { - return err + if v.IndexName != nil { + s.WriteString(schemas.DescribeContributorInsightsOutput_IndexName, *v.IndexName) } - if err = addResolveEndpointMiddleware(stack, options); err != nil { + if v.LastUpdateDateTime != nil { + s.WriteTime(schemas.DescribeContributorInsightsOutput_LastUpdateDateTime, *v.LastUpdateDateTime) + } + if v.TableName != nil { + s.WriteString(schemas.DescribeContributorInsightsOutput_TableName, *v.TableName) + } +} +func (v *DescribeContributorInsightsOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.DescribeContributorInsightsOutput, func(s *smithy.Schema) error { + switch s { + case schemas.DescribeContributorInsightsOutput_ContributorInsightsMode: + var ev string + if err := d.ReadString(schemas.DescribeContributorInsightsOutput_ContributorInsightsMode, &ev); err != nil { + return err + } + v.ContributorInsightsMode = types.ContributorInsightsMode(ev) + return nil + case schemas.DescribeContributorInsightsOutput_ContributorInsightsRuleList: + return deserializeContributorInsightsRuleList(d, schemas.DescribeContributorInsightsOutput_ContributorInsightsRuleList, &v.ContributorInsightsRuleList) + case schemas.DescribeContributorInsightsOutput_ContributorInsightsStatus: + var ev string + if err := d.ReadString(schemas.DescribeContributorInsightsOutput_ContributorInsightsStatus, &ev); err != nil { + return err + } + v.ContributorInsightsStatus = types.ContributorInsightsStatus(ev) + return nil + case schemas.DescribeContributorInsightsOutput_FailureException: + v.FailureException = &types.FailureException{} + return v.FailureException.Deserialize(d) + case schemas.DescribeContributorInsightsOutput_IndexName: + v.IndexName = new(string) + return d.ReadString(schemas.DescribeContributorInsightsOutput_IndexName, v.IndexName) + case schemas.DescribeContributorInsightsOutput_LastUpdateDateTime: + v.LastUpdateDateTime = new(time.Time) + return d.ReadTime(schemas.DescribeContributorInsightsOutput_LastUpdateDateTime, v.LastUpdateDateTime) + case schemas.DescribeContributorInsightsOutput_TableName: + v.TableName = new(string) + return d.ReadString(schemas.DescribeContributorInsightsOutput_TableName, v.TableName) + } + return nil + }) +} +func (c *Client) addOperationDescribeContributorInsightsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DescribeContributorInsights, schemas.DescribeContributorInsightsInput, schemas.DescribeContributorInsightsOutput)}, middleware.After); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DescribeContributorInsights, schemas.DescribeContributorInsightsInput, schemas.DescribeContributorInsightsOutput), output: &DescribeContributorInsightsOutput{}}, middleware.After); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + + if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addUserAgentAccountIDEndpointMode(stack, options); err != nil { @@ -136,9 +201,6 @@ func (c *Client) addOperationDescribeContributorInsightsMiddlewares(stack *middl if err = addOpDescribeContributorInsightsValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "DescribeContributorInsights"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 e21bf097452..a7ca3f876b6 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 @@ -4,9 +4,10 @@ package dynamodb import ( "context" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns the regional endpoint information. For more information on policy @@ -32,6 +33,15 @@ type DescribeEndpointsInput struct { noSmithyDocumentSerde } +func (v *DescribeEndpointsInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DescribeEndpointsRequest) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DescribeEndpointsInput) SerializeMembers(s smithy.ShapeSerializer) { +} + type DescribeEndpointsOutput struct { // List of endpoints. @@ -45,35 +55,39 @@ type DescribeEndpointsOutput struct { noSmithyDocumentSerde } +func (v *DescribeEndpointsOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DescribeEndpointsResponse) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DescribeEndpointsOutput) SerializeMembers(s smithy.ShapeSerializer) { + serializeEndpoints(s, schemas.DescribeEndpointsResponse_Endpoints, v.Endpoints) +} +func (v *DescribeEndpointsOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.DescribeEndpointsResponse, func(s *smithy.Schema) error { + switch s { + case schemas.DescribeEndpointsResponse_Endpoints: + return deserializeEndpoints(d, schemas.DescribeEndpointsResponse_Endpoints, &v.Endpoints) + } + return nil + }) +} func (c *Client) addOperationDescribeEndpointsMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeEndpoints{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DescribeEndpoints, schemas.DescribeEndpointsRequest, schemas.DescribeEndpointsResponse)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeEndpoints{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DescribeEndpoints, schemas.DescribeEndpointsRequest, schemas.DescribeEndpointsResponse), output: &DescribeEndpointsOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addUserAgentAccountIDEndpointMode(stack, options); err != nil { @@ -82,9 +96,6 @@ func (c *Client) addOperationDescribeEndpointsMiddlewares(stack *middleware.Stac if err = addCredentialSource(stack, options); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "DescribeEndpoints"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 9e749e7ebe5..eb008f7eeed 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" smithywaiter "github.com/aws/smithy-go/waiter" "time" ) @@ -39,6 +40,17 @@ type DescribeExportInput struct { noSmithyDocumentSerde } +func (v *DescribeExportInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DescribeExportInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DescribeExportInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ExportArn != nil { + s.WriteString(schemas.DescribeExportInput_ExportArn, *v.ExportArn) + } +} func (in *DescribeExportInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.ExportArn @@ -56,35 +68,44 @@ type DescribeExportOutput struct { noSmithyDocumentSerde } +func (v *DescribeExportOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DescribeExportOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DescribeExportOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ExportDescription != nil { + s.WriteStruct(schemas.DescribeExportOutput_ExportDescription) + v.ExportDescription.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *DescribeExportOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.DescribeExportOutput, func(s *smithy.Schema) error { + switch s { + case schemas.DescribeExportOutput_ExportDescription: + v.ExportDescription = &types.ExportDescription{} + return v.ExportDescription.Deserialize(d) + } + return nil + }) +} func (c *Client) addOperationDescribeExportMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeExport{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DescribeExport, schemas.DescribeExportInput, schemas.DescribeExportOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeExport{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DescribeExport, schemas.DescribeExportInput, schemas.DescribeExportOutput), output: &DescribeExportOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addUserAgentAccountIDEndpointMode(stack, options); err != nil { @@ -96,9 +117,6 @@ func (c *Client) addOperationDescribeExportMiddlewares(stack *middleware.Stack, if err = addOpDescribeExportValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "DescribeExport"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 c4fbb63b6e5..69e64054334 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns information about the specified global table. @@ -49,6 +50,17 @@ type DescribeGlobalTableInput struct { noSmithyDocumentSerde } +func (v *DescribeGlobalTableInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DescribeGlobalTableInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DescribeGlobalTableInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.GlobalTableName != nil { + s.WriteString(schemas.DescribeGlobalTableInput_GlobalTableName, *v.GlobalTableName) + } +} func (in *DescribeGlobalTableInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.GlobalTableName @@ -66,35 +78,44 @@ type DescribeGlobalTableOutput struct { noSmithyDocumentSerde } +func (v *DescribeGlobalTableOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DescribeGlobalTableOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DescribeGlobalTableOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.GlobalTableDescription != nil { + s.WriteStruct(schemas.DescribeGlobalTableOutput_GlobalTableDescription) + v.GlobalTableDescription.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *DescribeGlobalTableOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.DescribeGlobalTableOutput, func(s *smithy.Schema) error { + switch s { + case schemas.DescribeGlobalTableOutput_GlobalTableDescription: + v.GlobalTableDescription = &types.GlobalTableDescription{} + return v.GlobalTableDescription.Deserialize(d) + } + return nil + }) +} func (c *Client) addOperationDescribeGlobalTableMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeGlobalTable{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DescribeGlobalTable, schemas.DescribeGlobalTableInput, schemas.DescribeGlobalTableOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeGlobalTable{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DescribeGlobalTable, schemas.DescribeGlobalTableInput, schemas.DescribeGlobalTableOutput), output: &DescribeGlobalTableOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpDescribeGlobalTableDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -109,9 +130,6 @@ func (c *Client) addOperationDescribeGlobalTableMiddlewares(stack *middleware.St if err = addOpDescribeGlobalTableValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "DescribeGlobalTable"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 9b7d5a81cfd..32ec827b28d 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Describes Region-specific settings for a global table. @@ -49,6 +50,17 @@ type DescribeGlobalTableSettingsInput struct { noSmithyDocumentSerde } +func (v *DescribeGlobalTableSettingsInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DescribeGlobalTableSettingsInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DescribeGlobalTableSettingsInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.GlobalTableName != nil { + s.WriteString(schemas.DescribeGlobalTableSettingsInput_GlobalTableName, *v.GlobalTableName) + } +} func (in *DescribeGlobalTableSettingsInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.GlobalTableName @@ -69,35 +81,45 @@ type DescribeGlobalTableSettingsOutput struct { noSmithyDocumentSerde } +func (v *DescribeGlobalTableSettingsOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DescribeGlobalTableSettingsOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DescribeGlobalTableSettingsOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.GlobalTableName != nil { + s.WriteString(schemas.DescribeGlobalTableSettingsOutput_GlobalTableName, *v.GlobalTableName) + } + serializeReplicaSettingsDescriptionList(s, schemas.DescribeGlobalTableSettingsOutput_ReplicaSettings, v.ReplicaSettings) +} +func (v *DescribeGlobalTableSettingsOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.DescribeGlobalTableSettingsOutput, func(s *smithy.Schema) error { + switch s { + case schemas.DescribeGlobalTableSettingsOutput_GlobalTableName: + v.GlobalTableName = new(string) + return d.ReadString(schemas.DescribeGlobalTableSettingsOutput_GlobalTableName, v.GlobalTableName) + case schemas.DescribeGlobalTableSettingsOutput_ReplicaSettings: + return deserializeReplicaSettingsDescriptionList(d, schemas.DescribeGlobalTableSettingsOutput_ReplicaSettings, &v.ReplicaSettings) + } + return nil + }) +} func (c *Client) addOperationDescribeGlobalTableSettingsMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeGlobalTableSettings{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DescribeGlobalTableSettings, schemas.DescribeGlobalTableSettingsInput, schemas.DescribeGlobalTableSettingsOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeGlobalTableSettings{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DescribeGlobalTableSettings, schemas.DescribeGlobalTableSettingsInput, schemas.DescribeGlobalTableSettingsOutput), output: &DescribeGlobalTableSettingsOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpDescribeGlobalTableSettingsDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -112,9 +134,6 @@ func (c *Client) addOperationDescribeGlobalTableSettingsMiddlewares(stack *middl if err = addOpDescribeGlobalTableSettingsValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "DescribeGlobalTableSettings"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 a15716b31a8..042aa981fd1 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" smithywaiter "github.com/aws/smithy-go/waiter" "time" ) @@ -39,6 +40,17 @@ type DescribeImportInput struct { noSmithyDocumentSerde } +func (v *DescribeImportInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DescribeImportInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DescribeImportInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ImportArn != nil { + s.WriteString(schemas.DescribeImportInput_ImportArn, *v.ImportArn) + } +} func (in *DescribeImportInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.ImportArn @@ -60,35 +72,44 @@ type DescribeImportOutput struct { noSmithyDocumentSerde } +func (v *DescribeImportOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DescribeImportOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DescribeImportOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ImportTableDescription != nil { + s.WriteStruct(schemas.DescribeImportOutput_ImportTableDescription) + v.ImportTableDescription.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *DescribeImportOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.DescribeImportOutput, func(s *smithy.Schema) error { + switch s { + case schemas.DescribeImportOutput_ImportTableDescription: + v.ImportTableDescription = &types.ImportTableDescription{} + return v.ImportTableDescription.Deserialize(d) + } + return nil + }) +} func (c *Client) addOperationDescribeImportMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeImport{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DescribeImport, schemas.DescribeImportInput, schemas.DescribeImportOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeImport{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DescribeImport, schemas.DescribeImportInput, schemas.DescribeImportOutput), output: &DescribeImportOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addUserAgentAccountIDEndpointMode(stack, options); err != nil { @@ -100,9 +121,6 @@ func (c *Client) addOperationDescribeImportMiddlewares(stack *middleware.Stack, if err = addOpDescribeImportValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "DescribeImport"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 0da887082c0..6e5b9b6ab63 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 @@ -5,11 +5,12 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" smithywaiter "github.com/aws/smithy-go/waiter" "strconv" "time" @@ -42,6 +43,17 @@ type DescribeKinesisStreamingDestinationInput struct { noSmithyDocumentSerde } +func (v *DescribeKinesisStreamingDestinationInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DescribeKinesisStreamingDestinationInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DescribeKinesisStreamingDestinationInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.TableName != nil { + s.WriteString(schemas.DescribeKinesisStreamingDestinationInput_TableName, *v.TableName) + } +} func (in *DescribeKinesisStreamingDestinationInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TableName @@ -62,35 +74,45 @@ type DescribeKinesisStreamingDestinationOutput struct { noSmithyDocumentSerde } +func (v *DescribeKinesisStreamingDestinationOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DescribeKinesisStreamingDestinationOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DescribeKinesisStreamingDestinationOutput) SerializeMembers(s smithy.ShapeSerializer) { + serializeKinesisDataStreamDestinations(s, schemas.DescribeKinesisStreamingDestinationOutput_KinesisDataStreamDestinations, v.KinesisDataStreamDestinations) + if v.TableName != nil { + s.WriteString(schemas.DescribeKinesisStreamingDestinationOutput_TableName, *v.TableName) + } +} +func (v *DescribeKinesisStreamingDestinationOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.DescribeKinesisStreamingDestinationOutput, func(s *smithy.Schema) error { + switch s { + case schemas.DescribeKinesisStreamingDestinationOutput_KinesisDataStreamDestinations: + return deserializeKinesisDataStreamDestinations(d, schemas.DescribeKinesisStreamingDestinationOutput_KinesisDataStreamDestinations, &v.KinesisDataStreamDestinations) + case schemas.DescribeKinesisStreamingDestinationOutput_TableName: + v.TableName = new(string) + return d.ReadString(schemas.DescribeKinesisStreamingDestinationOutput_TableName, v.TableName) + } + return nil + }) +} func (c *Client) addOperationDescribeKinesisStreamingDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeKinesisStreamingDestination{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DescribeKinesisStreamingDestination, schemas.DescribeKinesisStreamingDestinationInput, schemas.DescribeKinesisStreamingDestinationOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeKinesisStreamingDestination{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DescribeKinesisStreamingDestination, schemas.DescribeKinesisStreamingDestinationInput, schemas.DescribeKinesisStreamingDestinationOutput), output: &DescribeKinesisStreamingDestinationOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpDescribeKinesisStreamingDestinationDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -105,9 +127,6 @@ func (c *Client) addOperationDescribeKinesisStreamingDestinationMiddlewares(stac if err = addOpDescribeKinesisStreamingDestinationValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "DescribeKinesisStreamingDestination"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 aa4f9a27b72..257161f6673 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 @@ -5,9 +5,10 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns the current provisioned-capacity quotas for your Amazon Web Services @@ -90,6 +91,15 @@ type DescribeLimitsInput struct { noSmithyDocumentSerde } +func (v *DescribeLimitsInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DescribeLimitsInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DescribeLimitsInput) SerializeMembers(s smithy.ShapeSerializer) { +} + // Represents the output of a DescribeLimits operation. type DescribeLimitsOutput struct { @@ -117,35 +127,60 @@ type DescribeLimitsOutput struct { noSmithyDocumentSerde } -func (c *Client) addOperationDescribeLimitsMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeLimits{}, middleware.After) - if err != nil { - return err +func (v *DescribeLimitsOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DescribeLimitsOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DescribeLimitsOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.AccountMaxReadCapacityUnits != nil { + s.WriteInt64(schemas.DescribeLimitsOutput_AccountMaxReadCapacityUnits, *v.AccountMaxReadCapacityUnits) } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeLimits{}, middleware.After) - if err != nil { - return err + if v.AccountMaxWriteCapacityUnits != nil { + s.WriteInt64(schemas.DescribeLimitsOutput_AccountMaxWriteCapacityUnits, *v.AccountMaxWriteCapacityUnits) } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err + if v.TableMaxReadCapacityUnits != nil { + s.WriteInt64(schemas.DescribeLimitsOutput_TableMaxReadCapacityUnits, *v.TableMaxReadCapacityUnits) } - if err = addComputeContentLength(stack); err != nil { - return err + if v.TableMaxWriteCapacityUnits != nil { + s.WriteInt64(schemas.DescribeLimitsOutput_TableMaxWriteCapacityUnits, *v.TableMaxWriteCapacityUnits) } - if err = addResolveEndpointMiddleware(stack, options); err != nil { +} +func (v *DescribeLimitsOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.DescribeLimitsOutput, func(s *smithy.Schema) error { + switch s { + case schemas.DescribeLimitsOutput_AccountMaxReadCapacityUnits: + v.AccountMaxReadCapacityUnits = new(int64) + return d.ReadInt64(schemas.DescribeLimitsOutput_AccountMaxReadCapacityUnits, v.AccountMaxReadCapacityUnits) + case schemas.DescribeLimitsOutput_AccountMaxWriteCapacityUnits: + v.AccountMaxWriteCapacityUnits = new(int64) + return d.ReadInt64(schemas.DescribeLimitsOutput_AccountMaxWriteCapacityUnits, v.AccountMaxWriteCapacityUnits) + case schemas.DescribeLimitsOutput_TableMaxReadCapacityUnits: + v.TableMaxReadCapacityUnits = new(int64) + return d.ReadInt64(schemas.DescribeLimitsOutput_TableMaxReadCapacityUnits, v.TableMaxReadCapacityUnits) + case schemas.DescribeLimitsOutput_TableMaxWriteCapacityUnits: + v.TableMaxWriteCapacityUnits = new(int64) + return d.ReadInt64(schemas.DescribeLimitsOutput_TableMaxWriteCapacityUnits, v.TableMaxWriteCapacityUnits) + } + return nil + }) +} +func (c *Client) addOperationDescribeLimitsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DescribeLimits, schemas.DescribeLimitsInput, schemas.DescribeLimitsOutput)}, middleware.After); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DescribeLimits, schemas.DescribeLimitsInput, schemas.DescribeLimitsOutput), output: &DescribeLimitsOutput{}}, middleware.After); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + + if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpDescribeLimitsDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -157,9 +192,6 @@ func (c *Client) addOperationDescribeLimitsMiddlewares(stack *middleware.Stack, if err = addCredentialSource(stack, options); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "DescribeLimits"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 266568b3794..e6a83852844 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 @@ -6,11 +6,12 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" smithywaiter "github.com/aws/smithy-go/waiter" "time" ) @@ -50,6 +51,17 @@ type DescribeTableInput struct { noSmithyDocumentSerde } +func (v *DescribeTableInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DescribeTableInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DescribeTableInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.TableName != nil { + s.WriteString(schemas.DescribeTableInput_TableName, *v.TableName) + } +} func (in *DescribeTableInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TableName @@ -68,35 +80,44 @@ type DescribeTableOutput struct { noSmithyDocumentSerde } +func (v *DescribeTableOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DescribeTableOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DescribeTableOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.Table != nil { + s.WriteStruct(schemas.DescribeTableOutput_Table) + v.Table.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *DescribeTableOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.DescribeTableOutput, func(s *smithy.Schema) error { + switch s { + case schemas.DescribeTableOutput_Table: + v.Table = &types.TableDescription{} + return v.Table.Deserialize(d) + } + return nil + }) +} func (c *Client) addOperationDescribeTableMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeTable{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DescribeTable, schemas.DescribeTableInput, schemas.DescribeTableOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeTable{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DescribeTable, schemas.DescribeTableInput, schemas.DescribeTableOutput), output: &DescribeTableOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpDescribeTableDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -111,9 +132,6 @@ func (c *Client) addOperationDescribeTableMiddlewares(stack *middleware.Stack, o if err = addOpDescribeTableValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "DescribeTable"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 7c550e29f0e..727a6888cf6 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 @@ -4,9 +4,10 @@ package dynamodb import ( "context" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Describes auto scaling settings across replicas of the global table at once. @@ -36,6 +37,17 @@ type DescribeTableReplicaAutoScalingInput struct { noSmithyDocumentSerde } +func (v *DescribeTableReplicaAutoScalingInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DescribeTableReplicaAutoScalingInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DescribeTableReplicaAutoScalingInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.TableName != nil { + s.WriteString(schemas.DescribeTableReplicaAutoScalingInput_TableName, *v.TableName) + } +} func (in *DescribeTableReplicaAutoScalingInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TableName @@ -53,35 +65,44 @@ type DescribeTableReplicaAutoScalingOutput struct { noSmithyDocumentSerde } +func (v *DescribeTableReplicaAutoScalingOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DescribeTableReplicaAutoScalingOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DescribeTableReplicaAutoScalingOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.TableAutoScalingDescription != nil { + s.WriteStruct(schemas.DescribeTableReplicaAutoScalingOutput_TableAutoScalingDescription) + v.TableAutoScalingDescription.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *DescribeTableReplicaAutoScalingOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.DescribeTableReplicaAutoScalingOutput, func(s *smithy.Schema) error { + switch s { + case schemas.DescribeTableReplicaAutoScalingOutput_TableAutoScalingDescription: + v.TableAutoScalingDescription = &types.TableAutoScalingDescription{} + return v.TableAutoScalingDescription.Deserialize(d) + } + return nil + }) +} func (c *Client) addOperationDescribeTableReplicaAutoScalingMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeTableReplicaAutoScaling{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DescribeTableReplicaAutoScaling, schemas.DescribeTableReplicaAutoScalingInput, schemas.DescribeTableReplicaAutoScalingOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeTableReplicaAutoScaling{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DescribeTableReplicaAutoScaling, schemas.DescribeTableReplicaAutoScalingInput, schemas.DescribeTableReplicaAutoScalingOutput), output: &DescribeTableReplicaAutoScalingOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addUserAgentAccountIDEndpointMode(stack, options); err != nil { @@ -93,9 +114,6 @@ func (c *Client) addOperationDescribeTableReplicaAutoScalingMiddlewares(stack *m if err = addOpDescribeTableReplicaAutoScalingValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "DescribeTableReplicaAutoScaling"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 53f7be7f8d7..ec294a0d0e8 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Gives a description of the Time to Live (TTL) status on the specified table. @@ -38,6 +39,17 @@ type DescribeTimeToLiveInput struct { noSmithyDocumentSerde } +func (v *DescribeTimeToLiveInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DescribeTimeToLiveInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DescribeTimeToLiveInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.TableName != nil { + s.WriteString(schemas.DescribeTimeToLiveInput_TableName, *v.TableName) + } +} func (in *DescribeTimeToLiveInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TableName @@ -55,35 +67,44 @@ type DescribeTimeToLiveOutput struct { noSmithyDocumentSerde } +func (v *DescribeTimeToLiveOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DescribeTimeToLiveOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DescribeTimeToLiveOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.TimeToLiveDescription != nil { + s.WriteStruct(schemas.DescribeTimeToLiveOutput_TimeToLiveDescription) + v.TimeToLiveDescription.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *DescribeTimeToLiveOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.DescribeTimeToLiveOutput, func(s *smithy.Schema) error { + switch s { + case schemas.DescribeTimeToLiveOutput_TimeToLiveDescription: + v.TimeToLiveDescription = &types.TimeToLiveDescription{} + return v.TimeToLiveDescription.Deserialize(d) + } + return nil + }) +} func (c *Client) addOperationDescribeTimeToLiveMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeTimeToLive{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DescribeTimeToLive, schemas.DescribeTimeToLiveInput, schemas.DescribeTimeToLiveOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeTimeToLive{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DescribeTimeToLive, schemas.DescribeTimeToLiveInput, schemas.DescribeTimeToLiveOutput), output: &DescribeTimeToLiveOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpDescribeTimeToLiveDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -98,9 +119,6 @@ func (c *Client) addOperationDescribeTimeToLiveMiddlewares(stack *middleware.Sta if err = addOpDescribeTimeToLiveValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "DescribeTimeToLive"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 1378c96b2ec..5522474fd4d 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Stops replication from the DynamoDB table to the Kinesis data stream. This is @@ -47,6 +48,41 @@ type DisableKinesisStreamingDestinationInput struct { noSmithyDocumentSerde } +func (v *DisableKinesisStreamingDestinationInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.KinesisStreamingDestinationInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DisableKinesisStreamingDestinationInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.EnableKinesisStreamingConfiguration != nil { + s.WriteStruct(schemas.KinesisStreamingDestinationInput_EnableKinesisStreamingConfiguration) + v.EnableKinesisStreamingConfiguration.SerializeMembers(s) + s.CloseStruct() + } + if v.StreamArn != nil { + s.WriteString(schemas.KinesisStreamingDestinationInput_StreamArn, *v.StreamArn) + } + if v.TableName != nil { + s.WriteString(schemas.KinesisStreamingDestinationInput_TableName, *v.TableName) + } +} +func (v *DisableKinesisStreamingDestinationInput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.KinesisStreamingDestinationInput, func(s *smithy.Schema) error { + switch s { + case schemas.KinesisStreamingDestinationInput_EnableKinesisStreamingConfiguration: + v.EnableKinesisStreamingConfiguration = &types.EnableKinesisStreamingConfiguration{} + return v.EnableKinesisStreamingConfiguration.Deserialize(d) + case schemas.KinesisStreamingDestinationInput_StreamArn: + v.StreamArn = new(string) + return d.ReadString(schemas.KinesisStreamingDestinationInput_StreamArn, v.StreamArn) + case schemas.KinesisStreamingDestinationInput_TableName: + v.TableName = new(string) + return d.ReadString(schemas.KinesisStreamingDestinationInput_TableName, v.TableName) + } + return nil + }) +} func (in *DisableKinesisStreamingDestinationInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TableName @@ -73,35 +109,66 @@ type DisableKinesisStreamingDestinationOutput struct { noSmithyDocumentSerde } -func (c *Client) addOperationDisableKinesisStreamingDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpDisableKinesisStreamingDestination{}, middleware.After) - if err != nil { - return err +func (v *DisableKinesisStreamingDestinationOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.KinesisStreamingDestinationOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DisableKinesisStreamingDestinationOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.DestinationStatus != "" { + s.WriteString(schemas.KinesisStreamingDestinationOutput_DestinationStatus, string(v.DestinationStatus)) } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDisableKinesisStreamingDestination{}, middleware.After) - if err != nil { - return err + if v.EnableKinesisStreamingConfiguration != nil { + s.WriteStruct(schemas.KinesisStreamingDestinationOutput_EnableKinesisStreamingConfiguration) + v.EnableKinesisStreamingConfiguration.SerializeMembers(s) + s.CloseStruct() } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err + if v.StreamArn != nil { + s.WriteString(schemas.KinesisStreamingDestinationOutput_StreamArn, *v.StreamArn) } - if err = addComputeContentLength(stack); err != nil { - return err + if v.TableName != nil { + s.WriteString(schemas.KinesisStreamingDestinationOutput_TableName, *v.TableName) } - if err = addResolveEndpointMiddleware(stack, options); err != nil { +} +func (v *DisableKinesisStreamingDestinationOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.KinesisStreamingDestinationOutput, func(s *smithy.Schema) error { + switch s { + case schemas.KinesisStreamingDestinationOutput_DestinationStatus: + var ev string + if err := d.ReadString(schemas.KinesisStreamingDestinationOutput_DestinationStatus, &ev); err != nil { + return err + } + v.DestinationStatus = types.DestinationStatus(ev) + return nil + case schemas.KinesisStreamingDestinationOutput_EnableKinesisStreamingConfiguration: + v.EnableKinesisStreamingConfiguration = &types.EnableKinesisStreamingConfiguration{} + return v.EnableKinesisStreamingConfiguration.Deserialize(d) + case schemas.KinesisStreamingDestinationOutput_StreamArn: + v.StreamArn = new(string) + return d.ReadString(schemas.KinesisStreamingDestinationOutput_StreamArn, v.StreamArn) + case schemas.KinesisStreamingDestinationOutput_TableName: + v.TableName = new(string) + return d.ReadString(schemas.KinesisStreamingDestinationOutput_TableName, v.TableName) + } + return nil + }) +} +func (c *Client) addOperationDisableKinesisStreamingDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DisableKinesisStreamingDestination, schemas.KinesisStreamingDestinationInput, schemas.KinesisStreamingDestinationOutput)}, middleware.After); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DisableKinesisStreamingDestination, schemas.KinesisStreamingDestinationInput, schemas.KinesisStreamingDestinationOutput), output: &DisableKinesisStreamingDestinationOutput{}}, middleware.After); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + + if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpDisableKinesisStreamingDestinationDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -116,9 +183,6 @@ func (c *Client) addOperationDisableKinesisStreamingDestinationMiddlewares(stack if err = addOpDisableKinesisStreamingDestinationValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "DisableKinesisStreamingDestination"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 fd6d5903c75..5fc0897cda1 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Starts table data replication to the specified Kinesis data stream at a @@ -49,6 +50,41 @@ type EnableKinesisStreamingDestinationInput struct { noSmithyDocumentSerde } +func (v *EnableKinesisStreamingDestinationInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.KinesisStreamingDestinationInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *EnableKinesisStreamingDestinationInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.EnableKinesisStreamingConfiguration != nil { + s.WriteStruct(schemas.KinesisStreamingDestinationInput_EnableKinesisStreamingConfiguration) + v.EnableKinesisStreamingConfiguration.SerializeMembers(s) + s.CloseStruct() + } + if v.StreamArn != nil { + s.WriteString(schemas.KinesisStreamingDestinationInput_StreamArn, *v.StreamArn) + } + if v.TableName != nil { + s.WriteString(schemas.KinesisStreamingDestinationInput_TableName, *v.TableName) + } +} +func (v *EnableKinesisStreamingDestinationInput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.KinesisStreamingDestinationInput, func(s *smithy.Schema) error { + switch s { + case schemas.KinesisStreamingDestinationInput_EnableKinesisStreamingConfiguration: + v.EnableKinesisStreamingConfiguration = &types.EnableKinesisStreamingConfiguration{} + return v.EnableKinesisStreamingConfiguration.Deserialize(d) + case schemas.KinesisStreamingDestinationInput_StreamArn: + v.StreamArn = new(string) + return d.ReadString(schemas.KinesisStreamingDestinationInput_StreamArn, v.StreamArn) + case schemas.KinesisStreamingDestinationInput_TableName: + v.TableName = new(string) + return d.ReadString(schemas.KinesisStreamingDestinationInput_TableName, v.TableName) + } + return nil + }) +} func (in *EnableKinesisStreamingDestinationInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TableName @@ -75,35 +111,66 @@ type EnableKinesisStreamingDestinationOutput struct { noSmithyDocumentSerde } -func (c *Client) addOperationEnableKinesisStreamingDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpEnableKinesisStreamingDestination{}, middleware.After) - if err != nil { - return err +func (v *EnableKinesisStreamingDestinationOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.KinesisStreamingDestinationOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *EnableKinesisStreamingDestinationOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.DestinationStatus != "" { + s.WriteString(schemas.KinesisStreamingDestinationOutput_DestinationStatus, string(v.DestinationStatus)) } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpEnableKinesisStreamingDestination{}, middleware.After) - if err != nil { - return err + if v.EnableKinesisStreamingConfiguration != nil { + s.WriteStruct(schemas.KinesisStreamingDestinationOutput_EnableKinesisStreamingConfiguration) + v.EnableKinesisStreamingConfiguration.SerializeMembers(s) + s.CloseStruct() } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err + if v.StreamArn != nil { + s.WriteString(schemas.KinesisStreamingDestinationOutput_StreamArn, *v.StreamArn) } - if err = addComputeContentLength(stack); err != nil { - return err + if v.TableName != nil { + s.WriteString(schemas.KinesisStreamingDestinationOutput_TableName, *v.TableName) } - if err = addResolveEndpointMiddleware(stack, options); err != nil { +} +func (v *EnableKinesisStreamingDestinationOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.KinesisStreamingDestinationOutput, func(s *smithy.Schema) error { + switch s { + case schemas.KinesisStreamingDestinationOutput_DestinationStatus: + var ev string + if err := d.ReadString(schemas.KinesisStreamingDestinationOutput_DestinationStatus, &ev); err != nil { + return err + } + v.DestinationStatus = types.DestinationStatus(ev) + return nil + case schemas.KinesisStreamingDestinationOutput_EnableKinesisStreamingConfiguration: + v.EnableKinesisStreamingConfiguration = &types.EnableKinesisStreamingConfiguration{} + return v.EnableKinesisStreamingConfiguration.Deserialize(d) + case schemas.KinesisStreamingDestinationOutput_StreamArn: + v.StreamArn = new(string) + return d.ReadString(schemas.KinesisStreamingDestinationOutput_StreamArn, v.StreamArn) + case schemas.KinesisStreamingDestinationOutput_TableName: + v.TableName = new(string) + return d.ReadString(schemas.KinesisStreamingDestinationOutput_TableName, v.TableName) + } + return nil + }) +} +func (c *Client) addOperationEnableKinesisStreamingDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.EnableKinesisStreamingDestination, schemas.KinesisStreamingDestinationInput, schemas.KinesisStreamingDestinationOutput)}, middleware.After); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.EnableKinesisStreamingDestination, schemas.KinesisStreamingDestinationInput, schemas.KinesisStreamingDestinationOutput), output: &EnableKinesisStreamingDestinationOutput{}}, middleware.After); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + + if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpEnableKinesisStreamingDestinationDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -118,9 +185,6 @@ func (c *Client) addOperationEnableKinesisStreamingDestinationMiddlewares(stack if err = addOpEnableKinesisStreamingDestinationValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "EnableKinesisStreamingDestination"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 d33de5bf533..92cf758b776 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 @@ -4,9 +4,10 @@ package dynamodb import ( "context" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // This operation allows you to perform reads and singleton writes on data stored @@ -94,6 +95,34 @@ type ExecuteStatementInput struct { noSmithyDocumentSerde } +func (v *ExecuteStatementInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ExecuteStatementInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ExecuteStatementInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ConsistentRead != nil { + s.WriteBool(schemas.ExecuteStatementInput_ConsistentRead, *v.ConsistentRead) + } + if v.Limit != nil { + s.WriteInt32(schemas.ExecuteStatementInput_Limit, *v.Limit) + } + if v.NextToken != nil { + s.WriteString(schemas.ExecuteStatementInput_NextToken, *v.NextToken) + } + serializePreparedStatementParameters(s, schemas.ExecuteStatementInput_Parameters, v.Parameters) + if v.ReturnConsumedCapacity != "" { + s.WriteString(schemas.ExecuteStatementInput_ReturnConsumedCapacity, string(v.ReturnConsumedCapacity)) + } + if v.ReturnValuesOnConditionCheckFailure != "" { + s.WriteString(schemas.ExecuteStatementInput_ReturnValuesOnConditionCheckFailure, string(v.ReturnValuesOnConditionCheckFailure)) + } + if v.Statement != nil { + s.WriteString(schemas.ExecuteStatementInput_Statement, *v.Statement) + } +} + type ExecuteStatementOutput struct { // The capacity units consumed by an operation. The data returned includes the @@ -130,35 +159,56 @@ type ExecuteStatementOutput struct { noSmithyDocumentSerde } -func (c *Client) addOperationExecuteStatementMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpExecuteStatement{}, middleware.After) - if err != nil { - return err +func (v *ExecuteStatementOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ExecuteStatementOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ExecuteStatementOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ConsumedCapacity != nil { + s.WriteStruct(schemas.ExecuteStatementOutput_ConsumedCapacity) + v.ConsumedCapacity.SerializeMembers(s) + s.CloseStruct() } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpExecuteStatement{}, middleware.After) - if err != nil { - return err + serializeItemList(s, schemas.ExecuteStatementOutput_Items, v.Items) + serializeKey(s, schemas.ExecuteStatementOutput_LastEvaluatedKey, v.LastEvaluatedKey) + if v.NextToken != nil { + s.WriteString(schemas.ExecuteStatementOutput_NextToken, *v.NextToken) } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { +} +func (v *ExecuteStatementOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ExecuteStatementOutput, func(s *smithy.Schema) error { + switch s { + case schemas.ExecuteStatementOutput_ConsumedCapacity: + v.ConsumedCapacity = &types.ConsumedCapacity{} + return v.ConsumedCapacity.Deserialize(d) + case schemas.ExecuteStatementOutput_Items: + return deserializeItemList(d, schemas.ExecuteStatementOutput_Items, &v.Items) + case schemas.ExecuteStatementOutput_LastEvaluatedKey: + return deserializeKey(d, schemas.ExecuteStatementOutput_LastEvaluatedKey, &v.LastEvaluatedKey) + case schemas.ExecuteStatementOutput_NextToken: + v.NextToken = new(string) + return d.ReadString(schemas.ExecuteStatementOutput_NextToken, v.NextToken) + } + return nil + }) +} +func (c *Client) addOperationExecuteStatementMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.ExecuteStatement, schemas.ExecuteStatementInput, schemas.ExecuteStatementOutput)}, middleware.After); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.ExecuteStatement, schemas.ExecuteStatementInput, schemas.ExecuteStatementOutput), output: &ExecuteStatementOutput{}}, middleware.After); err != nil { return err } + if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addUserAgentAccountIDEndpointMode(stack, options); err != nil { @@ -170,9 +220,6 @@ func (c *Client) addOperationExecuteStatementMiddlewares(stack *middleware.Stack if err = addOpExecuteStatementValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "ExecuteStatement"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 af10ae61d46..b775c1474c1 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 @@ -5,9 +5,10 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // This operation allows you to perform transactional reads or writes on data @@ -55,6 +56,22 @@ type ExecuteTransactionInput struct { noSmithyDocumentSerde } +func (v *ExecuteTransactionInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ExecuteTransactionInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ExecuteTransactionInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ClientRequestToken != nil { + s.WriteString(schemas.ExecuteTransactionInput_ClientRequestToken, *v.ClientRequestToken) + } + if v.ReturnConsumedCapacity != "" { + s.WriteString(schemas.ExecuteTransactionInput_ReturnConsumedCapacity, string(v.ReturnConsumedCapacity)) + } + serializeParameterizedStatements(s, schemas.ExecuteTransactionInput_TransactStatements, v.TransactStatements) +} + type ExecuteTransactionOutput struct { // The capacity units consumed by the entire operation. The values of the list are @@ -70,35 +87,42 @@ type ExecuteTransactionOutput struct { noSmithyDocumentSerde } +func (v *ExecuteTransactionOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ExecuteTransactionOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ExecuteTransactionOutput) SerializeMembers(s smithy.ShapeSerializer) { + serializeConsumedCapacityMultiple(s, schemas.ExecuteTransactionOutput_ConsumedCapacity, v.ConsumedCapacity) + serializeItemResponseList(s, schemas.ExecuteTransactionOutput_Responses, v.Responses) +} +func (v *ExecuteTransactionOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ExecuteTransactionOutput, func(s *smithy.Schema) error { + switch s { + case schemas.ExecuteTransactionOutput_ConsumedCapacity: + return deserializeConsumedCapacityMultiple(d, schemas.ExecuteTransactionOutput_ConsumedCapacity, &v.ConsumedCapacity) + case schemas.ExecuteTransactionOutput_Responses: + return deserializeItemResponseList(d, schemas.ExecuteTransactionOutput_Responses, &v.Responses) + } + return nil + }) +} func (c *Client) addOperationExecuteTransactionMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpExecuteTransaction{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.ExecuteTransaction, schemas.ExecuteTransactionInput, schemas.ExecuteTransactionOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpExecuteTransaction{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.ExecuteTransaction, schemas.ExecuteTransactionInput, schemas.ExecuteTransactionOutput), output: &ExecuteTransactionOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addUserAgentAccountIDEndpointMode(stack, options); err != nil { @@ -113,9 +137,6 @@ func (c *Client) addOperationExecuteTransactionMiddlewares(stack *middleware.Sta if err = addOpExecuteTransactionValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "ExecuteTransaction"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 81186948fd2..d84fec7fe56 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 @@ -5,9 +5,10 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) @@ -70,6 +71,11 @@ type ExportTableToPointInTimeInput struct { // be used. ExportType types.ExportType + // The criteria used to filter which items are included in the point-in-time + // export. When you specify this parameter, only items that match the key + // conditions and filter expressions are exported. + FilterSpecification *types.FilterSpecification + // Optional object containing the parameters specific to an incremental export. IncrementalExportSpecification *types.IncrementalExportSpecification @@ -99,6 +105,54 @@ type ExportTableToPointInTimeInput struct { noSmithyDocumentSerde } +func (v *ExportTableToPointInTimeInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ExportTableToPointInTimeInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ExportTableToPointInTimeInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ClientToken != nil { + s.WriteString(schemas.ExportTableToPointInTimeInput_ClientToken, *v.ClientToken) + } + if v.ExportFormat != "" { + s.WriteString(schemas.ExportTableToPointInTimeInput_ExportFormat, string(v.ExportFormat)) + } + if v.ExportTime != nil { + s.WriteTime(schemas.ExportTableToPointInTimeInput_ExportTime, *v.ExportTime) + } + if v.ExportType != "" { + s.WriteString(schemas.ExportTableToPointInTimeInput_ExportType, string(v.ExportType)) + } + if v.FilterSpecification != nil { + s.WriteStruct(schemas.ExportTableToPointInTimeInput_FilterSpecification) + v.FilterSpecification.SerializeMembers(s) + s.CloseStruct() + } + if v.IncrementalExportSpecification != nil { + s.WriteStruct(schemas.ExportTableToPointInTimeInput_IncrementalExportSpecification) + v.IncrementalExportSpecification.SerializeMembers(s) + s.CloseStruct() + } + if v.S3Bucket != nil { + s.WriteString(schemas.ExportTableToPointInTimeInput_S3Bucket, *v.S3Bucket) + } + if v.S3BucketOwner != nil { + s.WriteString(schemas.ExportTableToPointInTimeInput_S3BucketOwner, *v.S3BucketOwner) + } + if v.S3Prefix != nil { + s.WriteString(schemas.ExportTableToPointInTimeInput_S3Prefix, *v.S3Prefix) + } + if v.S3SseAlgorithm != "" { + s.WriteString(schemas.ExportTableToPointInTimeInput_S3SseAlgorithm, string(v.S3SseAlgorithm)) + } + if v.S3SseKmsKeyId != nil { + s.WriteString(schemas.ExportTableToPointInTimeInput_S3SseKmsKeyId, *v.S3SseKmsKeyId) + } + if v.TableArn != nil { + s.WriteString(schemas.ExportTableToPointInTimeInput_TableArn, *v.TableArn) + } +} func (in *ExportTableToPointInTimeInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TableArn @@ -116,35 +170,44 @@ type ExportTableToPointInTimeOutput struct { noSmithyDocumentSerde } +func (v *ExportTableToPointInTimeOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ExportTableToPointInTimeOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ExportTableToPointInTimeOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ExportDescription != nil { + s.WriteStruct(schemas.ExportTableToPointInTimeOutput_ExportDescription) + v.ExportDescription.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *ExportTableToPointInTimeOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ExportTableToPointInTimeOutput, func(s *smithy.Schema) error { + switch s { + case schemas.ExportTableToPointInTimeOutput_ExportDescription: + v.ExportDescription = &types.ExportDescription{} + return v.ExportDescription.Deserialize(d) + } + return nil + }) +} func (c *Client) addOperationExportTableToPointInTimeMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpExportTableToPointInTime{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.ExportTableToPointInTime, schemas.ExportTableToPointInTimeInput, schemas.ExportTableToPointInTimeOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpExportTableToPointInTime{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.ExportTableToPointInTime, schemas.ExportTableToPointInTimeInput, schemas.ExportTableToPointInTimeOutput), output: &ExportTableToPointInTimeOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addUserAgentAccountIDEndpointMode(stack, options); err != nil { @@ -159,9 +222,6 @@ func (c *Client) addOperationExportTableToPointInTimeMiddlewares(stack *middlewa if err = addOpExportTableToPointInTimeValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "ExportTableToPointInTime"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 9d27e788a70..635cf18d288 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // The GetItem operation returns a set of attributes for the item with the given @@ -134,6 +135,29 @@ type GetItemInput struct { noSmithyDocumentSerde } +func (v *GetItemInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.GetItemInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *GetItemInput) SerializeMembers(s smithy.ShapeSerializer) { + serializeAttributeNameList(s, schemas.GetItemInput_AttributesToGet, v.AttributesToGet) + if v.ConsistentRead != nil { + s.WriteBool(schemas.GetItemInput_ConsistentRead, *v.ConsistentRead) + } + serializeExpressionAttributeNameMap(s, schemas.GetItemInput_ExpressionAttributeNames, v.ExpressionAttributeNames) + serializeKey(s, schemas.GetItemInput_Key, v.Key) + if v.ProjectionExpression != nil { + s.WriteString(schemas.GetItemInput_ProjectionExpression, *v.ProjectionExpression) + } + if v.ReturnConsumedCapacity != "" { + s.WriteString(schemas.GetItemInput_ReturnConsumedCapacity, string(v.ReturnConsumedCapacity)) + } + if v.TableName != nil { + s.WriteString(schemas.GetItemInput_TableName, *v.TableName) + } +} func (in *GetItemInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TableName @@ -162,35 +186,47 @@ type GetItemOutput struct { noSmithyDocumentSerde } +func (v *GetItemOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.GetItemOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *GetItemOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ConsumedCapacity != nil { + s.WriteStruct(schemas.GetItemOutput_ConsumedCapacity) + v.ConsumedCapacity.SerializeMembers(s) + s.CloseStruct() + } + serializeAttributeMap(s, schemas.GetItemOutput_Item, v.Item) +} +func (v *GetItemOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.GetItemOutput, func(s *smithy.Schema) error { + switch s { + case schemas.GetItemOutput_ConsumedCapacity: + v.ConsumedCapacity = &types.ConsumedCapacity{} + return v.ConsumedCapacity.Deserialize(d) + case schemas.GetItemOutput_Item: + return deserializeAttributeMap(d, schemas.GetItemOutput_Item, &v.Item) + } + return nil + }) +} func (c *Client) addOperationGetItemMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetItem{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.GetItem, schemas.GetItemInput, schemas.GetItemOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetItem{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.GetItem, schemas.GetItemInput, schemas.GetItemOutput), output: &GetItemOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpGetItemDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -205,9 +241,6 @@ func (c *Client) addOperationGetItemMiddlewares(stack *middleware.Stack, options if err = addOpGetItemValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "GetItem"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 440b9db6b0e..b0c64642588 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 @@ -5,9 +5,10 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns the resource-based policy document attached to the resource, which can @@ -66,6 +67,17 @@ type GetResourcePolicyInput struct { noSmithyDocumentSerde } +func (v *GetResourcePolicyInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.GetResourcePolicyInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *GetResourcePolicyInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ResourceArn != nil { + s.WriteString(schemas.GetResourcePolicyInput_ResourceArn, *v.ResourceArn) + } +} func (in *GetResourcePolicyInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.ResourceArn @@ -88,35 +100,48 @@ type GetResourcePolicyOutput struct { noSmithyDocumentSerde } -func (c *Client) addOperationGetResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetResourcePolicy{}, middleware.After) - if err != nil { - return err +func (v *GetResourcePolicyOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.GetResourcePolicyOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *GetResourcePolicyOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.Policy != nil { + s.WriteString(schemas.GetResourcePolicyOutput_Policy, *v.Policy) } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetResourcePolicy{}, middleware.After) - if err != nil { - return err + if v.RevisionId != nil { + s.WriteString(schemas.GetResourcePolicyOutput_RevisionId, *v.RevisionId) } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { +} +func (v *GetResourcePolicyOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.GetResourcePolicyOutput, func(s *smithy.Schema) error { + switch s { + case schemas.GetResourcePolicyOutput_Policy: + v.Policy = new(string) + return d.ReadString(schemas.GetResourcePolicyOutput_Policy, v.Policy) + case schemas.GetResourcePolicyOutput_RevisionId: + v.RevisionId = new(string) + return d.ReadString(schemas.GetResourcePolicyOutput_RevisionId, v.RevisionId) + } + return nil + }) +} +func (c *Client) addOperationGetResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.GetResourcePolicy, schemas.GetResourcePolicyInput, schemas.GetResourcePolicyOutput)}, middleware.After); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.GetResourcePolicy, schemas.GetResourcePolicyInput, schemas.GetResourcePolicyOutput), output: &GetResourcePolicyOutput{}}, middleware.After); err != nil { return err } + if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpGetResourcePolicyDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -131,9 +156,6 @@ func (c *Client) addOperationGetResourcePolicyMiddlewares(stack *middleware.Stac if err = addOpGetResourcePolicyValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "GetResourcePolicy"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 1ec25bd027a..4cf0b2cdcf1 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 @@ -5,9 +5,10 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Imports table data from an S3 bucket. @@ -66,6 +67,38 @@ type ImportTableInput struct { noSmithyDocumentSerde } +func (v *ImportTableInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ImportTableInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ImportTableInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ClientToken != nil { + s.WriteString(schemas.ImportTableInput_ClientToken, *v.ClientToken) + } + if v.InputCompressionType != "" { + s.WriteString(schemas.ImportTableInput_InputCompressionType, string(v.InputCompressionType)) + } + if v.InputFormat != "" { + s.WriteString(schemas.ImportTableInput_InputFormat, string(v.InputFormat)) + } + if v.InputFormatOptions != nil { + s.WriteStruct(schemas.ImportTableInput_InputFormatOptions) + v.InputFormatOptions.SerializeMembers(s) + s.CloseStruct() + } + if v.S3BucketSource != nil { + s.WriteStruct(schemas.ImportTableInput_S3BucketSource) + v.S3BucketSource.SerializeMembers(s) + s.CloseStruct() + } + if v.TableCreationParameters != nil { + s.WriteStruct(schemas.ImportTableInput_TableCreationParameters) + v.TableCreationParameters.SerializeMembers(s) + s.CloseStruct() + } +} func (in *ImportTableInput) bindEndpointParams(p *EndpointParameters) { func() { v1 := in.TableCreationParameters @@ -94,35 +127,44 @@ type ImportTableOutput struct { noSmithyDocumentSerde } +func (v *ImportTableOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ImportTableOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ImportTableOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ImportTableDescription != nil { + s.WriteStruct(schemas.ImportTableOutput_ImportTableDescription) + v.ImportTableDescription.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *ImportTableOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ImportTableOutput, func(s *smithy.Schema) error { + switch s { + case schemas.ImportTableOutput_ImportTableDescription: + v.ImportTableDescription = &types.ImportTableDescription{} + return v.ImportTableDescription.Deserialize(d) + } + return nil + }) +} func (c *Client) addOperationImportTableMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpImportTable{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.ImportTable, schemas.ImportTableInput, schemas.ImportTableOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpImportTable{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.ImportTable, schemas.ImportTableInput, schemas.ImportTableOutput), output: &ImportTableOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addUserAgentAccountIDEndpointMode(stack, options); err != nil { @@ -137,9 +179,6 @@ func (c *Client) addOperationImportTableMiddlewares(stack *middleware.Stack, opt if err = addOpImportTableValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "ImportTable"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 634a3909e33..e632cccd14e 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) @@ -81,6 +82,32 @@ type ListBackupsInput struct { noSmithyDocumentSerde } +func (v *ListBackupsInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ListBackupsInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ListBackupsInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.BackupType != "" { + s.WriteString(schemas.ListBackupsInput_BackupType, string(v.BackupType)) + } + if v.ExclusiveStartBackupArn != nil { + s.WriteString(schemas.ListBackupsInput_ExclusiveStartBackupArn, *v.ExclusiveStartBackupArn) + } + if v.Limit != nil { + s.WriteInt32(schemas.ListBackupsInput_Limit, *v.Limit) + } + if v.TableName != nil { + s.WriteString(schemas.ListBackupsInput_TableName, *v.TableName) + } + if v.TimeRangeLowerBound != nil { + s.WriteTime(schemas.ListBackupsInput_TimeRangeLowerBound, *v.TimeRangeLowerBound) + } + if v.TimeRangeUpperBound != nil { + s.WriteTime(schemas.ListBackupsInput_TimeRangeUpperBound, *v.TimeRangeUpperBound) + } +} func (in *ListBackupsInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TableName @@ -111,35 +138,45 @@ type ListBackupsOutput struct { noSmithyDocumentSerde } +func (v *ListBackupsOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ListBackupsOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ListBackupsOutput) SerializeMembers(s smithy.ShapeSerializer) { + serializeBackupSummaries(s, schemas.ListBackupsOutput_BackupSummaries, v.BackupSummaries) + if v.LastEvaluatedBackupArn != nil { + s.WriteString(schemas.ListBackupsOutput_LastEvaluatedBackupArn, *v.LastEvaluatedBackupArn) + } +} +func (v *ListBackupsOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ListBackupsOutput, func(s *smithy.Schema) error { + switch s { + case schemas.ListBackupsOutput_BackupSummaries: + return deserializeBackupSummaries(d, schemas.ListBackupsOutput_BackupSummaries, &v.BackupSummaries) + case schemas.ListBackupsOutput_LastEvaluatedBackupArn: + v.LastEvaluatedBackupArn = new(string) + return d.ReadString(schemas.ListBackupsOutput_LastEvaluatedBackupArn, v.LastEvaluatedBackupArn) + } + return nil + }) +} func (c *Client) addOperationListBackupsMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpListBackups{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.ListBackups, schemas.ListBackupsInput, schemas.ListBackupsOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListBackups{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.ListBackups, schemas.ListBackupsInput, schemas.ListBackupsOutput), output: &ListBackupsOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpListBackupsDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -151,9 +188,6 @@ func (c *Client) addOperationListBackupsMiddlewares(stack *middleware.Stack, opt if err = addCredentialSource(stack, options); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "ListBackups"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 b4e0428465d..2e7061909b4 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 @@ -5,9 +5,10 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of ContributorInsightsSummary for a table and all its global @@ -42,6 +43,23 @@ type ListContributorInsightsInput struct { noSmithyDocumentSerde } +func (v *ListContributorInsightsInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ListContributorInsightsInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ListContributorInsightsInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.MaxResults != 0 { + s.WriteInt32(schemas.ListContributorInsightsInput_MaxResults, v.MaxResults) + } + if v.NextToken != nil { + s.WriteString(schemas.ListContributorInsightsInput_NextToken, *v.NextToken) + } + if v.TableName != nil { + s.WriteString(schemas.ListContributorInsightsInput_TableName, *v.TableName) + } +} func (in *ListContributorInsightsInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TableName @@ -62,35 +80,45 @@ type ListContributorInsightsOutput struct { noSmithyDocumentSerde } +func (v *ListContributorInsightsOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ListContributorInsightsOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ListContributorInsightsOutput) SerializeMembers(s smithy.ShapeSerializer) { + serializeContributorInsightsSummaries(s, schemas.ListContributorInsightsOutput_ContributorInsightsSummaries, v.ContributorInsightsSummaries) + if v.NextToken != nil { + s.WriteString(schemas.ListContributorInsightsOutput_NextToken, *v.NextToken) + } +} +func (v *ListContributorInsightsOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ListContributorInsightsOutput, func(s *smithy.Schema) error { + switch s { + case schemas.ListContributorInsightsOutput_ContributorInsightsSummaries: + return deserializeContributorInsightsSummaries(d, schemas.ListContributorInsightsOutput_ContributorInsightsSummaries, &v.ContributorInsightsSummaries) + case schemas.ListContributorInsightsOutput_NextToken: + v.NextToken = new(string) + return d.ReadString(schemas.ListContributorInsightsOutput_NextToken, v.NextToken) + } + return nil + }) +} func (c *Client) addOperationListContributorInsightsMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpListContributorInsights{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.ListContributorInsights, schemas.ListContributorInsightsInput, schemas.ListContributorInsightsOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListContributorInsights{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.ListContributorInsights, schemas.ListContributorInsightsInput, schemas.ListContributorInsightsOutput), output: &ListContributorInsightsOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addUserAgentAccountIDEndpointMode(stack, options); err != nil { @@ -99,9 +127,6 @@ func (c *Client) addOperationListContributorInsightsMiddlewares(stack *middlewar if err = addCredentialSource(stack, options); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "ListContributorInsights"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 2f291560687..d74b077ce43 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 @@ -5,9 +5,10 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists completed exports within the past 90 days, in reverse alphanumeric order @@ -43,6 +44,23 @@ type ListExportsInput struct { noSmithyDocumentSerde } +func (v *ListExportsInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ListExportsInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ListExportsInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.MaxResults != nil { + s.WriteInt32(schemas.ListExportsInput_MaxResults, *v.MaxResults) + } + if v.NextToken != nil { + s.WriteString(schemas.ListExportsInput_NextToken, *v.NextToken) + } + if v.TableArn != nil { + s.WriteString(schemas.ListExportsInput_TableArn, *v.TableArn) + } +} func (in *ListExportsInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TableArn @@ -64,35 +82,45 @@ type ListExportsOutput struct { noSmithyDocumentSerde } +func (v *ListExportsOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ListExportsOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ListExportsOutput) SerializeMembers(s smithy.ShapeSerializer) { + serializeExportSummaries(s, schemas.ListExportsOutput_ExportSummaries, v.ExportSummaries) + if v.NextToken != nil { + s.WriteString(schemas.ListExportsOutput_NextToken, *v.NextToken) + } +} +func (v *ListExportsOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ListExportsOutput, func(s *smithy.Schema) error { + switch s { + case schemas.ListExportsOutput_ExportSummaries: + return deserializeExportSummaries(d, schemas.ListExportsOutput_ExportSummaries, &v.ExportSummaries) + case schemas.ListExportsOutput_NextToken: + v.NextToken = new(string) + return d.ReadString(schemas.ListExportsOutput_NextToken, v.NextToken) + } + return nil + }) +} func (c *Client) addOperationListExportsMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpListExports{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.ListExports, schemas.ListExportsInput, schemas.ListExportsOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListExports{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.ListExports, schemas.ListExportsInput, schemas.ListExportsOutput), output: &ListExportsOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addUserAgentAccountIDEndpointMode(stack, options); err != nil { @@ -101,9 +129,6 @@ func (c *Client) addOperationListExportsMiddlewares(stack *middleware.Stack, opt if err = addCredentialSource(stack, options); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "ListExports"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 d715f7ba457..7eabcc2d0c5 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists all global tables that have a replica in the specified Region. @@ -59,6 +60,24 @@ type ListGlobalTablesInput struct { noSmithyDocumentSerde } +func (v *ListGlobalTablesInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ListGlobalTablesInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ListGlobalTablesInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ExclusiveStartGlobalTableName != nil { + s.WriteString(schemas.ListGlobalTablesInput_ExclusiveStartGlobalTableName, *v.ExclusiveStartGlobalTableName) + } + if v.Limit != nil { + s.WriteInt32(schemas.ListGlobalTablesInput_Limit, *v.Limit) + } + if v.RegionName != nil { + s.WriteString(schemas.ListGlobalTablesInput_RegionName, *v.RegionName) + } +} + type ListGlobalTablesOutput struct { // List of global table names. @@ -73,35 +92,45 @@ type ListGlobalTablesOutput struct { noSmithyDocumentSerde } +func (v *ListGlobalTablesOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ListGlobalTablesOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ListGlobalTablesOutput) SerializeMembers(s smithy.ShapeSerializer) { + serializeGlobalTableList(s, schemas.ListGlobalTablesOutput_GlobalTables, v.GlobalTables) + if v.LastEvaluatedGlobalTableName != nil { + s.WriteString(schemas.ListGlobalTablesOutput_LastEvaluatedGlobalTableName, *v.LastEvaluatedGlobalTableName) + } +} +func (v *ListGlobalTablesOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ListGlobalTablesOutput, func(s *smithy.Schema) error { + switch s { + case schemas.ListGlobalTablesOutput_GlobalTables: + return deserializeGlobalTableList(d, schemas.ListGlobalTablesOutput_GlobalTables, &v.GlobalTables) + case schemas.ListGlobalTablesOutput_LastEvaluatedGlobalTableName: + v.LastEvaluatedGlobalTableName = new(string) + return d.ReadString(schemas.ListGlobalTablesOutput_LastEvaluatedGlobalTableName, v.LastEvaluatedGlobalTableName) + } + return nil + }) +} func (c *Client) addOperationListGlobalTablesMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpListGlobalTables{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.ListGlobalTables, schemas.ListGlobalTablesInput, schemas.ListGlobalTablesOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListGlobalTables{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.ListGlobalTables, schemas.ListGlobalTablesInput, schemas.ListGlobalTablesOutput), output: &ListGlobalTablesOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpListGlobalTablesDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -113,9 +142,6 @@ func (c *Client) addOperationListGlobalTablesMiddlewares(stack *middleware.Stack if err = addCredentialSource(stack, options); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "ListGlobalTables"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 5db278e1e26..26643bef0cb 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 @@ -5,9 +5,10 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists completed imports within the past 90 days. @@ -42,6 +43,23 @@ type ListImportsInput struct { noSmithyDocumentSerde } +func (v *ListImportsInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ListImportsInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ListImportsInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.NextToken != nil { + s.WriteString(schemas.ListImportsInput_NextToken, *v.NextToken) + } + if v.PageSize != nil { + s.WriteInt32(schemas.ListImportsInput_PageSize, *v.PageSize) + } + if v.TableArn != nil { + s.WriteString(schemas.ListImportsInput_TableArn, *v.TableArn) + } +} func (in *ListImportsInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TableArn @@ -63,35 +81,45 @@ type ListImportsOutput struct { noSmithyDocumentSerde } +func (v *ListImportsOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ListImportsOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ListImportsOutput) SerializeMembers(s smithy.ShapeSerializer) { + serializeImportSummaryList(s, schemas.ListImportsOutput_ImportSummaryList, v.ImportSummaryList) + if v.NextToken != nil { + s.WriteString(schemas.ListImportsOutput_NextToken, *v.NextToken) + } +} +func (v *ListImportsOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ListImportsOutput, func(s *smithy.Schema) error { + switch s { + case schemas.ListImportsOutput_ImportSummaryList: + return deserializeImportSummaryList(d, schemas.ListImportsOutput_ImportSummaryList, &v.ImportSummaryList) + case schemas.ListImportsOutput_NextToken: + v.NextToken = new(string) + return d.ReadString(schemas.ListImportsOutput_NextToken, v.NextToken) + } + return nil + }) +} func (c *Client) addOperationListImportsMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpListImports{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.ListImports, schemas.ListImportsInput, schemas.ListImportsOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListImports{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.ListImports, schemas.ListImportsInput, schemas.ListImportsOutput), output: &ListImportsOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addUserAgentAccountIDEndpointMode(stack, options); err != nil { @@ -100,9 +128,6 @@ func (c *Client) addOperationListImportsMiddlewares(stack *middleware.Stack, opt if err = addCredentialSource(stack, options); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "ListImports"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 6aaa40f2293..363cce9656d 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 @@ -5,9 +5,10 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns an array of table names associated with the current account and @@ -43,6 +44,21 @@ type ListTablesInput struct { noSmithyDocumentSerde } +func (v *ListTablesInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ListTablesInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ListTablesInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ExclusiveStartTableName != nil { + s.WriteString(schemas.ListTablesInput_ExclusiveStartTableName, *v.ExclusiveStartTableName) + } + if v.Limit != nil { + s.WriteInt32(schemas.ListTablesInput_Limit, *v.Limit) + } +} + // Represents the output of a ListTables operation. type ListTablesOutput struct { @@ -68,35 +84,45 @@ type ListTablesOutput struct { noSmithyDocumentSerde } +func (v *ListTablesOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ListTablesOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ListTablesOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.LastEvaluatedTableName != nil { + s.WriteString(schemas.ListTablesOutput_LastEvaluatedTableName, *v.LastEvaluatedTableName) + } + serializeTableNameList(s, schemas.ListTablesOutput_TableNames, v.TableNames) +} +func (v *ListTablesOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ListTablesOutput, func(s *smithy.Schema) error { + switch s { + case schemas.ListTablesOutput_LastEvaluatedTableName: + v.LastEvaluatedTableName = new(string) + return d.ReadString(schemas.ListTablesOutput_LastEvaluatedTableName, v.LastEvaluatedTableName) + case schemas.ListTablesOutput_TableNames: + return deserializeTableNameList(d, schemas.ListTablesOutput_TableNames, &v.TableNames) + } + return nil + }) +} func (c *Client) addOperationListTablesMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpListTables{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.ListTables, schemas.ListTablesInput, schemas.ListTablesOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListTables{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.ListTables, schemas.ListTablesInput, schemas.ListTablesOutput), output: &ListTablesOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpListTablesDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -108,9 +134,6 @@ func (c *Client) addOperationListTablesMiddlewares(stack *middleware.Stack, opti if err = addCredentialSource(stack, options); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "ListTables"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 8168ae37ebc..1aebfacbddd 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // List all tags on an Amazon DynamoDB resource. You can call ListTagsOfResource @@ -49,6 +50,20 @@ type ListTagsOfResourceInput struct { noSmithyDocumentSerde } +func (v *ListTagsOfResourceInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ListTagsOfResourceInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ListTagsOfResourceInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.NextToken != nil { + s.WriteString(schemas.ListTagsOfResourceInput_NextToken, *v.NextToken) + } + if v.ResourceArn != nil { + s.WriteString(schemas.ListTagsOfResourceInput_ResourceArn, *v.ResourceArn) + } +} func (in *ListTagsOfResourceInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.ResourceArn @@ -70,35 +85,45 @@ type ListTagsOfResourceOutput struct { noSmithyDocumentSerde } +func (v *ListTagsOfResourceOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ListTagsOfResourceOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ListTagsOfResourceOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.NextToken != nil { + s.WriteString(schemas.ListTagsOfResourceOutput_NextToken, *v.NextToken) + } + serializeTagList(s, schemas.ListTagsOfResourceOutput_Tags, v.Tags) +} +func (v *ListTagsOfResourceOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ListTagsOfResourceOutput, func(s *smithy.Schema) error { + switch s { + case schemas.ListTagsOfResourceOutput_NextToken: + v.NextToken = new(string) + return d.ReadString(schemas.ListTagsOfResourceOutput_NextToken, v.NextToken) + case schemas.ListTagsOfResourceOutput_Tags: + return deserializeTagList(d, schemas.ListTagsOfResourceOutput_Tags, &v.Tags) + } + return nil + }) +} func (c *Client) addOperationListTagsOfResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpListTagsOfResource{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.ListTagsOfResource, schemas.ListTagsOfResourceInput, schemas.ListTagsOfResourceOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListTagsOfResource{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.ListTagsOfResource, schemas.ListTagsOfResourceInput, schemas.ListTagsOfResourceOutput), output: &ListTagsOfResourceOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpListTagsOfResourceDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -113,9 +138,6 @@ func (c *Client) addOperationListTagsOfResourceMiddlewares(stack *middleware.Sta if err = addOpListTagsOfResourceValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "ListTagsOfResource"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 03ee5452a98..44a4f6e0d12 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a new item, or replaces an old item with a new item. If an item that @@ -74,6 +75,18 @@ type PutItemInput struct { // types for those attributes must match those of the schema in the table's // attribute definition. // + // If the table has vector indexes, the following validations apply to write + // operations. A violation of any of these constraints results in a + // ValidationException : + // + // - The vector attribute must be a list of numbers with dimensions matching the + // index configuration. + // + // - Vector values must fit in 32-bit IEEE-754 floating point format (f32). + // + // - Partition key and inline filter attributes defined in the search schema + // must have data types matching the index schema definition. + // // Empty String and Binary attribute values are allowed. Attribute values of type // String and Binary must have a length greater than zero if the attribute is used // as a key attribute for a table or index. @@ -239,6 +252,39 @@ type PutItemInput struct { noSmithyDocumentSerde } +func (v *PutItemInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.PutItemInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *PutItemInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ConditionExpression != nil { + s.WriteString(schemas.PutItemInput_ConditionExpression, *v.ConditionExpression) + } + if v.ConditionalOperator != "" { + s.WriteString(schemas.PutItemInput_ConditionalOperator, string(v.ConditionalOperator)) + } + serializeExpectedAttributeMap(s, schemas.PutItemInput_Expected, v.Expected) + serializeExpressionAttributeNameMap(s, schemas.PutItemInput_ExpressionAttributeNames, v.ExpressionAttributeNames) + serializeExpressionAttributeValueMap(s, schemas.PutItemInput_ExpressionAttributeValues, v.ExpressionAttributeValues) + serializePutItemInputAttributeMap(s, schemas.PutItemInput_Item, v.Item) + if v.ReturnConsumedCapacity != "" { + s.WriteString(schemas.PutItemInput_ReturnConsumedCapacity, string(v.ReturnConsumedCapacity)) + } + if v.ReturnItemCollectionMetrics != "" { + s.WriteString(schemas.PutItemInput_ReturnItemCollectionMetrics, string(v.ReturnItemCollectionMetrics)) + } + if v.ReturnValues != "" { + s.WriteString(schemas.PutItemInput_ReturnValues, string(v.ReturnValues)) + } + if v.ReturnValuesOnConditionCheckFailure != "" { + s.WriteString(schemas.PutItemInput_ReturnValuesOnConditionCheckFailure, string(v.ReturnValuesOnConditionCheckFailure)) + } + if v.TableName != nil { + s.WriteString(schemas.PutItemInput_TableName, *v.TableName) + } +} func (in *PutItemInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TableName @@ -259,6 +305,9 @@ type PutItemOutput struct { // returned if the ReturnConsumedCapacity parameter was specified. For more // information, see [Capacity unity consumption for write operations]in the Amazon DynamoDB Developer Guide. // + // If the table has vector indexes, the response includes a VectorIndexes field + // with VectorWriteRequestBytes consumed for each affected vector index. + // // [Capacity unity consumption for write operations]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/read-write-operations.html#write-operation-consumption ConsumedCapacity *types.ConsumedCapacity @@ -289,35 +338,55 @@ type PutItemOutput struct { noSmithyDocumentSerde } -func (c *Client) addOperationPutItemMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpPutItem{}, middleware.After) - if err != nil { - return err +func (v *PutItemOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.PutItemOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *PutItemOutput) SerializeMembers(s smithy.ShapeSerializer) { + serializeAttributeMap(s, schemas.PutItemOutput_Attributes, v.Attributes) + if v.ConsumedCapacity != nil { + s.WriteStruct(schemas.PutItemOutput_ConsumedCapacity) + v.ConsumedCapacity.SerializeMembers(s) + s.CloseStruct() } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpPutItem{}, middleware.After) - if err != nil { - return err + if v.ItemCollectionMetrics != nil { + s.WriteStruct(schemas.PutItemOutput_ItemCollectionMetrics) + v.ItemCollectionMetrics.SerializeMembers(s) + s.CloseStruct() } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { +} +func (v *PutItemOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.PutItemOutput, func(s *smithy.Schema) error { + switch s { + case schemas.PutItemOutput_Attributes: + return deserializeAttributeMap(d, schemas.PutItemOutput_Attributes, &v.Attributes) + case schemas.PutItemOutput_ConsumedCapacity: + v.ConsumedCapacity = &types.ConsumedCapacity{} + return v.ConsumedCapacity.Deserialize(d) + case schemas.PutItemOutput_ItemCollectionMetrics: + v.ItemCollectionMetrics = &types.ItemCollectionMetrics{} + return v.ItemCollectionMetrics.Deserialize(d) + } + return nil + }) +} +func (c *Client) addOperationPutItemMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.PutItem, schemas.PutItemInput, schemas.PutItemOutput)}, middleware.After); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.PutItem, schemas.PutItemInput, schemas.PutItemOutput), output: &PutItemOutput{}}, middleware.After); err != nil { return err } + if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpPutItemDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -332,9 +401,6 @@ func (c *Client) addOperationPutItemMiddlewares(stack *middleware.Stack, options if err = addOpPutItemValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "PutItem"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 a77e8d9b1e9..581df762905 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 @@ -5,9 +5,10 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Attaches a resource-based policy document to the resource, which can be a table @@ -94,6 +95,26 @@ type PutResourcePolicyInput struct { noSmithyDocumentSerde } +func (v *PutResourcePolicyInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.PutResourcePolicyInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *PutResourcePolicyInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ConfirmRemoveSelfResourceAccess != false { + s.WriteBool(schemas.PutResourcePolicyInput_ConfirmRemoveSelfResourceAccess, v.ConfirmRemoveSelfResourceAccess) + } + if v.ExpectedRevisionId != nil { + s.WriteString(schemas.PutResourcePolicyInput_ExpectedRevisionId, *v.ExpectedRevisionId) + } + if v.Policy != nil { + s.WriteString(schemas.PutResourcePolicyInput_Policy, *v.Policy) + } + if v.ResourceArn != nil { + s.WriteString(schemas.PutResourcePolicyInput_ResourceArn, *v.ResourceArn) + } +} func (in *PutResourcePolicyInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.ResourceArn @@ -112,35 +133,42 @@ type PutResourcePolicyOutput struct { noSmithyDocumentSerde } +func (v *PutResourcePolicyOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.PutResourcePolicyOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *PutResourcePolicyOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.RevisionId != nil { + s.WriteString(schemas.PutResourcePolicyOutput_RevisionId, *v.RevisionId) + } +} +func (v *PutResourcePolicyOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.PutResourcePolicyOutput, func(s *smithy.Schema) error { + switch s { + case schemas.PutResourcePolicyOutput_RevisionId: + v.RevisionId = new(string) + return d.ReadString(schemas.PutResourcePolicyOutput_RevisionId, v.RevisionId) + } + return nil + }) +} func (c *Client) addOperationPutResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpPutResourcePolicy{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.PutResourcePolicy, schemas.PutResourcePolicyInput, schemas.PutResourcePolicyOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpPutResourcePolicy{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.PutResourcePolicy, schemas.PutResourcePolicyInput, schemas.PutResourcePolicyOutput), output: &PutResourcePolicyOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpPutResourcePolicyDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -155,9 +183,6 @@ func (c *Client) addOperationPutResourcePolicyMiddlewares(stack *middleware.Stac if err = addOpPutResourcePolicyValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "PutResourcePolicy"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 a7dce4efc89..82f52d4232c 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // You must provide the name of the partition key attribute and a single value for @@ -394,6 +395,53 @@ type QueryInput struct { noSmithyDocumentSerde } +func (v *QueryInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.QueryInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *QueryInput) SerializeMembers(s smithy.ShapeSerializer) { + serializeAttributeNameList(s, schemas.QueryInput_AttributesToGet, v.AttributesToGet) + if v.ConditionalOperator != "" { + s.WriteString(schemas.QueryInput_ConditionalOperator, string(v.ConditionalOperator)) + } + if v.ConsistentRead != nil { + s.WriteBool(schemas.QueryInput_ConsistentRead, *v.ConsistentRead) + } + serializeKey(s, schemas.QueryInput_ExclusiveStartKey, v.ExclusiveStartKey) + serializeExpressionAttributeNameMap(s, schemas.QueryInput_ExpressionAttributeNames, v.ExpressionAttributeNames) + serializeExpressionAttributeValueMap(s, schemas.QueryInput_ExpressionAttributeValues, v.ExpressionAttributeValues) + if v.FilterExpression != nil { + s.WriteString(schemas.QueryInput_FilterExpression, *v.FilterExpression) + } + if v.IndexName != nil { + s.WriteString(schemas.QueryInput_IndexName, *v.IndexName) + } + if v.KeyConditionExpression != nil { + s.WriteString(schemas.QueryInput_KeyConditionExpression, *v.KeyConditionExpression) + } + serializeKeyConditions(s, schemas.QueryInput_KeyConditions, v.KeyConditions) + if v.Limit != nil { + s.WriteInt32(schemas.QueryInput_Limit, *v.Limit) + } + if v.ProjectionExpression != nil { + s.WriteString(schemas.QueryInput_ProjectionExpression, *v.ProjectionExpression) + } + serializeFilterConditionMap(s, schemas.QueryInput_QueryFilter, v.QueryFilter) + if v.ReturnConsumedCapacity != "" { + s.WriteString(schemas.QueryInput_ReturnConsumedCapacity, string(v.ReturnConsumedCapacity)) + } + if v.ScanIndexForward != nil { + s.WriteBool(schemas.QueryInput_ScanIndexForward, *v.ScanIndexForward) + } + if v.Select != "" { + s.WriteString(schemas.QueryInput_Select, string(v.Select)) + } + if v.TableName != nil { + s.WriteString(schemas.QueryInput_TableName, *v.TableName) + } +} func (in *QueryInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TableName @@ -454,35 +502,60 @@ type QueryOutput struct { noSmithyDocumentSerde } -func (c *Client) addOperationQueryMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpQuery{}, middleware.After) - if err != nil { - return err +func (v *QueryOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.QueryOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *QueryOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ConsumedCapacity != nil { + s.WriteStruct(schemas.QueryOutput_ConsumedCapacity) + v.ConsumedCapacity.SerializeMembers(s) + s.CloseStruct() } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpQuery{}, middleware.After) - if err != nil { - return err + if v.Count != 0 { + s.WriteInt32(schemas.QueryOutput_Count, v.Count) } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { + serializeItemList(s, schemas.QueryOutput_Items, v.Items) + serializeKey(s, schemas.QueryOutput_LastEvaluatedKey, v.LastEvaluatedKey) + if v.ScannedCount != 0 { + s.WriteInt32(schemas.QueryOutput_ScannedCount, v.ScannedCount) + } +} +func (v *QueryOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.QueryOutput, func(s *smithy.Schema) error { + switch s { + case schemas.QueryOutput_ConsumedCapacity: + v.ConsumedCapacity = &types.ConsumedCapacity{} + return v.ConsumedCapacity.Deserialize(d) + case schemas.QueryOutput_Count: + return d.ReadInt32(schemas.QueryOutput_Count, &v.Count) + case schemas.QueryOutput_Items: + return deserializeItemList(d, schemas.QueryOutput_Items, &v.Items) + case schemas.QueryOutput_LastEvaluatedKey: + return deserializeKey(d, schemas.QueryOutput_LastEvaluatedKey, &v.LastEvaluatedKey) + case schemas.QueryOutput_ScannedCount: + return d.ReadInt32(schemas.QueryOutput_ScannedCount, &v.ScannedCount) + } + return nil + }) +} +func (c *Client) addOperationQueryMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.Query, schemas.QueryInput, schemas.QueryOutput)}, middleware.After); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.Query, schemas.QueryInput, schemas.QueryOutput), output: &QueryOutput{}}, middleware.After); err != nil { return err } + if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpQueryDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -497,9 +570,6 @@ func (c *Client) addOperationQueryMiddlewares(stack *middleware.Stack, options O if err = addOpQueryValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "Query"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 66b1258a610..92710ebefea 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a new table from an existing backup. Any number of users can execute up @@ -80,9 +81,50 @@ type RestoreTableFromBackupInput struct { // The new server-side encryption settings for the restored table. SSESpecificationOverride *types.SSESpecification + // The vector indexes for the restored table. If not specified, all vector indexes + // from the backup are restored. The indexes provided must match existing vector + // indexes from the backup. You can choose to exclude some or all of the vector + // indexes at the time of restore. + VectorIndexOverride []types.VectorIndex + noSmithyDocumentSerde } +func (v *RestoreTableFromBackupInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.RestoreTableFromBackupInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *RestoreTableFromBackupInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.BackupArn != nil { + s.WriteString(schemas.RestoreTableFromBackupInput_BackupArn, *v.BackupArn) + } + if v.BillingModeOverride != "" { + s.WriteString(schemas.RestoreTableFromBackupInput_BillingModeOverride, string(v.BillingModeOverride)) + } + serializeGlobalSecondaryIndexList(s, schemas.RestoreTableFromBackupInput_GlobalSecondaryIndexOverride, v.GlobalSecondaryIndexOverride) + serializeLocalSecondaryIndexList(s, schemas.RestoreTableFromBackupInput_LocalSecondaryIndexOverride, v.LocalSecondaryIndexOverride) + if v.OnDemandThroughputOverride != nil { + s.WriteStruct(schemas.RestoreTableFromBackupInput_OnDemandThroughputOverride) + v.OnDemandThroughputOverride.SerializeMembers(s) + s.CloseStruct() + } + if v.ProvisionedThroughputOverride != nil { + s.WriteStruct(schemas.RestoreTableFromBackupInput_ProvisionedThroughputOverride) + v.ProvisionedThroughputOverride.SerializeMembers(s) + s.CloseStruct() + } + if v.SSESpecificationOverride != nil { + s.WriteStruct(schemas.RestoreTableFromBackupInput_SSESpecificationOverride) + v.SSESpecificationOverride.SerializeMembers(s) + s.CloseStruct() + } + if v.TargetTableName != nil { + s.WriteString(schemas.RestoreTableFromBackupInput_TargetTableName, *v.TargetTableName) + } + serializeVectorIndexList(s, schemas.RestoreTableFromBackupInput_VectorIndexOverride, v.VectorIndexOverride) +} func (in *RestoreTableFromBackupInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TargetTableName @@ -100,35 +142,44 @@ type RestoreTableFromBackupOutput struct { noSmithyDocumentSerde } +func (v *RestoreTableFromBackupOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.RestoreTableFromBackupOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *RestoreTableFromBackupOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.TableDescription != nil { + s.WriteStruct(schemas.RestoreTableFromBackupOutput_TableDescription) + v.TableDescription.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *RestoreTableFromBackupOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.RestoreTableFromBackupOutput, func(s *smithy.Schema) error { + switch s { + case schemas.RestoreTableFromBackupOutput_TableDescription: + v.TableDescription = &types.TableDescription{} + return v.TableDescription.Deserialize(d) + } + return nil + }) +} func (c *Client) addOperationRestoreTableFromBackupMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpRestoreTableFromBackup{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.RestoreTableFromBackup, schemas.RestoreTableFromBackupInput, schemas.RestoreTableFromBackupOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpRestoreTableFromBackup{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.RestoreTableFromBackup, schemas.RestoreTableFromBackupInput, schemas.RestoreTableFromBackupOutput), output: &RestoreTableFromBackupOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpRestoreTableFromBackupDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -143,9 +194,6 @@ func (c *Client) addOperationRestoreTableFromBackupMiddlewares(stack *middleware if err = addOpRestoreTableFromBackupValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "RestoreTableFromBackup"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 263225c9381..6a44bb93116 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) @@ -80,6 +81,11 @@ type RestoreTableToPointInTimeInput struct { // List of global secondary indexes for the restored table. The indexes provided // should match existing secondary indexes. You can choose to exclude some or all // of the indexes at the time of restore. + // + // The WarmThroughput setting is not supported on global secondary indexes when + // you use RestoreTableToPointInTime . Although WarmThroughput appears in the + // shared index definition, including it in a GlobalSecondaryIndexOverride entry + // causes the request to fail with a validation error. GlobalSecondaryIndexOverride []types.GlobalSecondaryIndex // List of local secondary indexes for the restored table. The indexes provided @@ -112,9 +118,59 @@ type RestoreTableToPointInTimeInput struct { // typically 5 minutes before the current time. UseLatestRestorableTime *bool + // The vector indexes for the restored table. If not specified, all vector indexes + // from the source table are restored. The indexes provided must match existing + // vector indexes from the source table. You can choose to exclude some or all of + // the vector indexes at the time of restore. + VectorIndexOverride []types.VectorIndex + noSmithyDocumentSerde } +func (v *RestoreTableToPointInTimeInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.RestoreTableToPointInTimeInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *RestoreTableToPointInTimeInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.BillingModeOverride != "" { + s.WriteString(schemas.RestoreTableToPointInTimeInput_BillingModeOverride, string(v.BillingModeOverride)) + } + serializeGlobalSecondaryIndexList(s, schemas.RestoreTableToPointInTimeInput_GlobalSecondaryIndexOverride, v.GlobalSecondaryIndexOverride) + serializeLocalSecondaryIndexList(s, schemas.RestoreTableToPointInTimeInput_LocalSecondaryIndexOverride, v.LocalSecondaryIndexOverride) + if v.OnDemandThroughputOverride != nil { + s.WriteStruct(schemas.RestoreTableToPointInTimeInput_OnDemandThroughputOverride) + v.OnDemandThroughputOverride.SerializeMembers(s) + s.CloseStruct() + } + if v.ProvisionedThroughputOverride != nil { + s.WriteStruct(schemas.RestoreTableToPointInTimeInput_ProvisionedThroughputOverride) + v.ProvisionedThroughputOverride.SerializeMembers(s) + s.CloseStruct() + } + if v.RestoreDateTime != nil { + s.WriteTime(schemas.RestoreTableToPointInTimeInput_RestoreDateTime, *v.RestoreDateTime) + } + if v.SSESpecificationOverride != nil { + s.WriteStruct(schemas.RestoreTableToPointInTimeInput_SSESpecificationOverride) + v.SSESpecificationOverride.SerializeMembers(s) + s.CloseStruct() + } + if v.SourceTableArn != nil { + s.WriteString(schemas.RestoreTableToPointInTimeInput_SourceTableArn, *v.SourceTableArn) + } + if v.SourceTableName != nil { + s.WriteString(schemas.RestoreTableToPointInTimeInput_SourceTableName, *v.SourceTableName) + } + if v.TargetTableName != nil { + s.WriteString(schemas.RestoreTableToPointInTimeInput_TargetTableName, *v.TargetTableName) + } + if v.UseLatestRestorableTime != nil { + s.WriteBool(schemas.RestoreTableToPointInTimeInput_UseLatestRestorableTime, *v.UseLatestRestorableTime) + } + serializeVectorIndexList(s, schemas.RestoreTableToPointInTimeInput_VectorIndexOverride, v.VectorIndexOverride) +} func (in *RestoreTableToPointInTimeInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TargetTableName @@ -132,35 +188,44 @@ type RestoreTableToPointInTimeOutput struct { noSmithyDocumentSerde } +func (v *RestoreTableToPointInTimeOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.RestoreTableToPointInTimeOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *RestoreTableToPointInTimeOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.TableDescription != nil { + s.WriteStruct(schemas.RestoreTableToPointInTimeOutput_TableDescription) + v.TableDescription.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *RestoreTableToPointInTimeOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.RestoreTableToPointInTimeOutput, func(s *smithy.Schema) error { + switch s { + case schemas.RestoreTableToPointInTimeOutput_TableDescription: + v.TableDescription = &types.TableDescription{} + return v.TableDescription.Deserialize(d) + } + return nil + }) +} func (c *Client) addOperationRestoreTableToPointInTimeMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpRestoreTableToPointInTime{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.RestoreTableToPointInTime, schemas.RestoreTableToPointInTimeInput, schemas.RestoreTableToPointInTimeOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpRestoreTableToPointInTime{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.RestoreTableToPointInTime, schemas.RestoreTableToPointInTimeInput, schemas.RestoreTableToPointInTimeOutput), output: &RestoreTableToPointInTimeOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpRestoreTableToPointInTimeDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -175,9 +240,6 @@ func (c *Client) addOperationRestoreTableToPointInTimeMiddlewares(stack *middlew if err = addOpRestoreTableToPointInTimeValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "RestoreTableToPointInTime"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 9d4b1805b7b..bfb8dfdd590 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // The Scan operation returns one or more items and item attributes by accessing @@ -325,6 +326,52 @@ type ScanInput struct { noSmithyDocumentSerde } +func (v *ScanInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ScanInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ScanInput) SerializeMembers(s smithy.ShapeSerializer) { + serializeAttributeNameList(s, schemas.ScanInput_AttributesToGet, v.AttributesToGet) + if v.ConditionalOperator != "" { + s.WriteString(schemas.ScanInput_ConditionalOperator, string(v.ConditionalOperator)) + } + if v.ConsistentRead != nil { + s.WriteBool(schemas.ScanInput_ConsistentRead, *v.ConsistentRead) + } + serializeKey(s, schemas.ScanInput_ExclusiveStartKey, v.ExclusiveStartKey) + serializeExpressionAttributeNameMap(s, schemas.ScanInput_ExpressionAttributeNames, v.ExpressionAttributeNames) + serializeExpressionAttributeValueMap(s, schemas.ScanInput_ExpressionAttributeValues, v.ExpressionAttributeValues) + if v.FilterExpression != nil { + s.WriteString(schemas.ScanInput_FilterExpression, *v.FilterExpression) + } + if v.IndexName != nil { + s.WriteString(schemas.ScanInput_IndexName, *v.IndexName) + } + if v.Limit != nil { + s.WriteInt32(schemas.ScanInput_Limit, *v.Limit) + } + if v.ProjectionExpression != nil { + s.WriteString(schemas.ScanInput_ProjectionExpression, *v.ProjectionExpression) + } + if v.ReturnConsumedCapacity != "" { + s.WriteString(schemas.ScanInput_ReturnConsumedCapacity, string(v.ReturnConsumedCapacity)) + } + serializeFilterConditionMap(s, schemas.ScanInput_ScanFilter, v.ScanFilter) + if v.Segment != nil { + s.WriteInt32(schemas.ScanInput_Segment, *v.Segment) + } + if v.Select != "" { + s.WriteString(schemas.ScanInput_Select, string(v.Select)) + } + if v.TableName != nil { + s.WriteString(schemas.ScanInput_TableName, *v.TableName) + } + if v.TotalSegments != nil { + s.WriteInt32(schemas.ScanInput_TotalSegments, *v.TotalSegments) + } +} func (in *ScanInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TableName @@ -385,35 +432,60 @@ type ScanOutput struct { noSmithyDocumentSerde } -func (c *Client) addOperationScanMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpScan{}, middleware.After) - if err != nil { - return err +func (v *ScanOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ScanOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ScanOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ConsumedCapacity != nil { + s.WriteStruct(schemas.ScanOutput_ConsumedCapacity) + v.ConsumedCapacity.SerializeMembers(s) + s.CloseStruct() } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpScan{}, middleware.After) - if err != nil { - return err + if v.Count != 0 { + s.WriteInt32(schemas.ScanOutput_Count, v.Count) } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { + serializeItemList(s, schemas.ScanOutput_Items, v.Items) + serializeKey(s, schemas.ScanOutput_LastEvaluatedKey, v.LastEvaluatedKey) + if v.ScannedCount != 0 { + s.WriteInt32(schemas.ScanOutput_ScannedCount, v.ScannedCount) + } +} +func (v *ScanOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ScanOutput, func(s *smithy.Schema) error { + switch s { + case schemas.ScanOutput_ConsumedCapacity: + v.ConsumedCapacity = &types.ConsumedCapacity{} + return v.ConsumedCapacity.Deserialize(d) + case schemas.ScanOutput_Count: + return d.ReadInt32(schemas.ScanOutput_Count, &v.Count) + case schemas.ScanOutput_Items: + return deserializeItemList(d, schemas.ScanOutput_Items, &v.Items) + case schemas.ScanOutput_LastEvaluatedKey: + return deserializeKey(d, schemas.ScanOutput_LastEvaluatedKey, &v.LastEvaluatedKey) + case schemas.ScanOutput_ScannedCount: + return d.ReadInt32(schemas.ScanOutput_ScannedCount, &v.ScannedCount) + } + return nil + }) +} +func (c *Client) addOperationScanMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.Scan, schemas.ScanInput, schemas.ScanOutput)}, middleware.After); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.Scan, schemas.ScanInput, schemas.ScanOutput), output: &ScanOutput{}}, middleware.After); err != nil { return err } + if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpScanDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -428,9 +500,6 @@ func (c *Client) addOperationScanMiddlewares(stack *middleware.Stack, options Op if err = addOpScanValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "Scan"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_SearchVectors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_SearchVectors.go new file mode 100644 index 00000000000..8793da66bb5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_SearchVectors.go @@ -0,0 +1,239 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package dynamodb + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" +) + +// Performs a vector similarity search on a vector index associated with an Amazon +// DynamoDB table, and returns the most similar items sorted by similarity score +// based on the distance function configured for the index. +// +// Score interpretation depends on the distance function: +// +// - COSINE - Returns the items with the k smallest scores. Scores range from 0 +// (identical) to 2 (opposite). Lower scores indicate higher similarity. +// +// - EUCLIDEAN - Returns the items with the k smallest scores. Scores represent +// the Euclidean distance between vectors. Lower scores indicate higher similarity. +// +// - DOT_PRODUCT - Returns the items with the k highest scores. Higher scores +// indicate higher similarity. +func (c *Client) SearchVectors(ctx context.Context, params *SearchVectorsInput, optFns ...func(*Options)) (*SearchVectorsOutput, error) { + if params == nil { + params = &SearchVectorsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SearchVectors", params, optFns, c.addOperationSearchVectorsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SearchVectorsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SearchVectorsInput struct { + + // The name of the vector index to search. The index must be in the ACTIVE state. + // + // This member is required. + IndexName *string + + // The search vector to compare against the indexed vectors. Each element is a + // 32-bit IEEE-754 floating point number, provided in DynamoDB list format. + // + // The number of dimensions must match the number of dimensions configured for the + // vector index. + // + // This member is required. + SearchVector []types.AttributeValue + + // The name or Amazon Resource Name (ARN) of the table containing the vector index. + // + // This member is required. + TableName *string + + // The number of most similar results to return. + // + // This member is required. + TopK *int32 + + // One or more substitution tokens for attribute names in an expression. Use the # + // character in an expression to dereference an attribute name. + ExpressionAttributeNames map[string]string + + // One or more values that can be substituted in an expression. Use the : + // character in an expression to dereference an attribute value. + ExpressionAttributeValues map[string]types.AttributeValue + + // A string that identifies one or more attributes to retrieve from the index. + // Separate attribute names with commas. If not specified, the operation returns + // all attributes projected into the vector index. + // + // Only attributes projected into the vector index can be retrieved. + ProjectionExpression *string + + // Determines the level of detail about either provisioned or on-demand throughput + // consumption that is returned in the response: + // + // - INDEXES - The response includes the aggregate ConsumedCapacity for the + // operation, together with ConsumedCapacity for each table and secondary index + // that was accessed. + // + // Note that some operations, such as GetItem and BatchGetItem , do not access any + // indexes at all. In these cases, specifying INDEXES will only return + // ConsumedCapacity information for table(s). + // + // - TOTAL - The response includes only the aggregate ConsumedCapacity for the + // operation. + // + // - NONE - No ConsumedCapacity details are included in the response. + ReturnConsumedCapacity types.ReturnConsumedCapacity + + // A condition expression used to filter the vector search results. The expression + // can reference attributes defined in the vector index search schema, including + // HASH and INLINE_FILTER key elements. + // + // Only the equality operator ( = ) is supported for HASH attributes. Comparison + // and range operators are supported for INLINE_FILTER attributes. Only top-level + // attributes from the search schema can be referenced. + SearchConditionExpression *string + + noSmithyDocumentSerde +} + +func (v *SearchVectorsInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.SearchVectorsInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *SearchVectorsInput) SerializeMembers(s smithy.ShapeSerializer) { + serializeExpressionAttributeNameMap(s, schemas.SearchVectorsInput_ExpressionAttributeNames, v.ExpressionAttributeNames) + serializeExpressionAttributeValueMap(s, schemas.SearchVectorsInput_ExpressionAttributeValues, v.ExpressionAttributeValues) + if v.IndexName != nil { + s.WriteString(schemas.SearchVectorsInput_IndexName, *v.IndexName) + } + if v.ProjectionExpression != nil { + s.WriteString(schemas.SearchVectorsInput_ProjectionExpression, *v.ProjectionExpression) + } + if v.ReturnConsumedCapacity != "" { + s.WriteString(schemas.SearchVectorsInput_ReturnConsumedCapacity, string(v.ReturnConsumedCapacity)) + } + if v.SearchConditionExpression != nil { + s.WriteString(schemas.SearchVectorsInput_SearchConditionExpression, *v.SearchConditionExpression) + } + serializeSearchVectorList(s, schemas.SearchVectorsInput_SearchVector, v.SearchVector) + if v.TableName != nil { + s.WriteString(schemas.SearchVectorsInput_TableName, *v.TableName) + } + if v.TopK != nil { + s.WriteInt32(schemas.SearchVectorsInput_TopK, *v.TopK) + } +} +func (in *SearchVectorsInput) bindEndpointParams(p *EndpointParameters) { + + p.ResourceArn = in.TableName + p.IsSearchOperation = ptr.Bool(true) +} + +type SearchVectorsOutput struct { + + // The capacity units consumed by the SearchVectors operation. Contains + // VectorSearchRequestBytes , which represents the vector search capacity consumed. + ConsumedCapacity *types.VectorCapacity + + // A list of items returned by the vector similarity search, sorted by similarity + // with the most similar item first. Each item contains the projected attributes + // and a similarity score. + SearchResults []types.SearchResultItem + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (v *SearchVectorsOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.SearchVectorsOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *SearchVectorsOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ConsumedCapacity != nil { + s.WriteStruct(schemas.SearchVectorsOutput_ConsumedCapacity) + v.ConsumedCapacity.SerializeMembers(s) + s.CloseStruct() + } + serializeSearchResultList(s, schemas.SearchVectorsOutput_SearchResults, v.SearchResults) +} +func (v *SearchVectorsOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.SearchVectorsOutput, func(s *smithy.Schema) error { + switch s { + case schemas.SearchVectorsOutput_ConsumedCapacity: + v.ConsumedCapacity = &types.VectorCapacity{} + return v.ConsumedCapacity.Deserialize(d) + case schemas.SearchVectorsOutput_SearchResults: + return deserializeSearchResultList(d, schemas.SearchVectorsOutput_SearchResults, &v.SearchResults) + } + return nil + }) +} +func (c *Client) addOperationSearchVectorsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.SearchVectors, schemas.SearchVectorsInput, schemas.SearchVectorsOutput)}, middleware.After); err != nil { + return err + } + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.SearchVectors, schemas.SearchVectorsInput, schemas.SearchVectorsOutput), output: &SearchVectorsOutput{}}, middleware.After); err != nil { + return err + } + + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack, options); err != nil { + return err + } + if err = addUserAgentAccountIDEndpointMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpSearchVectorsValidationMiddleware(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addValidateResponseChecksum(stack, options); err != nil { + return err + } + if err = addAcceptEncodingGzip(stack, options); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + 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 21c620e2223..08a5b7361d7 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Associate a set of tags with an Amazon DynamoDB resource. You can then activate @@ -62,6 +63,18 @@ type TagResourceInput struct { noSmithyDocumentSerde } +func (v *TagResourceInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.TagResourceInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *TagResourceInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ResourceArn != nil { + s.WriteString(schemas.TagResourceInput_ResourceArn, *v.ResourceArn) + } + serializeTagList(s, schemas.TagResourceInput_Tags, v.Tags) +} func (in *TagResourceInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.ResourceArn @@ -75,35 +88,36 @@ type TagResourceOutput struct { noSmithyDocumentSerde } +func (v *TagResourceOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(nil) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *TagResourceOutput) SerializeMembers(s smithy.ShapeSerializer) { +} +func (v *TagResourceOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, nil, func(s *smithy.Schema) error { + switch s { + } + return nil + }) +} func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpTagResource{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.TagResource, schemas.TagResourceInput, nil)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpTagResource{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.TagResource, schemas.TagResourceInput, nil), output: &TagResourceOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpTagResourceDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -118,9 +132,6 @@ func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, opt if err = addOpTagResourceValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "TagResource"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 a38cd39d6da..b101a2bee68 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // TransactGetItems is a synchronous operation that atomically retrieves multiple @@ -61,6 +62,18 @@ type TransactGetItemsInput struct { noSmithyDocumentSerde } +func (v *TransactGetItemsInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.TransactGetItemsInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *TransactGetItemsInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ReturnConsumedCapacity != "" { + s.WriteString(schemas.TransactGetItemsInput_ReturnConsumedCapacity, string(v.ReturnConsumedCapacity)) + } + serializeTransactGetItemList(s, schemas.TransactGetItemsInput_TransactItems, v.TransactItems) +} func (in *TransactGetItemsInput) bindEndpointParams(p *EndpointParameters) { func() { v1 := in.TransactItems @@ -105,35 +118,42 @@ type TransactGetItemsOutput struct { noSmithyDocumentSerde } +func (v *TransactGetItemsOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.TransactGetItemsOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *TransactGetItemsOutput) SerializeMembers(s smithy.ShapeSerializer) { + serializeConsumedCapacityMultiple(s, schemas.TransactGetItemsOutput_ConsumedCapacity, v.ConsumedCapacity) + serializeItemResponseList(s, schemas.TransactGetItemsOutput_Responses, v.Responses) +} +func (v *TransactGetItemsOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.TransactGetItemsOutput, func(s *smithy.Schema) error { + switch s { + case schemas.TransactGetItemsOutput_ConsumedCapacity: + return deserializeConsumedCapacityMultiple(d, schemas.TransactGetItemsOutput_ConsumedCapacity, &v.ConsumedCapacity) + case schemas.TransactGetItemsOutput_Responses: + return deserializeItemResponseList(d, schemas.TransactGetItemsOutput_Responses, &v.Responses) + } + return nil + }) +} func (c *Client) addOperationTransactGetItemsMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpTransactGetItems{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.TransactGetItems, schemas.TransactGetItemsInput, schemas.TransactGetItemsOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpTransactGetItems{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.TransactGetItems, schemas.TransactGetItemsInput, schemas.TransactGetItemsOutput), output: &TransactGetItemsOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpTransactGetItemsDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -148,9 +168,6 @@ func (c *Client) addOperationTransactGetItemsMiddlewares(stack *middleware.Stack if err = addOpTransactGetItemsValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "TransactGetItems"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 645f3c25c33..f844d3d2b42 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // TransactWriteItems is a synchronous write operation that groups up to 100 @@ -134,6 +135,24 @@ type TransactWriteItemsInput struct { noSmithyDocumentSerde } +func (v *TransactWriteItemsInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.TransactWriteItemsInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *TransactWriteItemsInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ClientRequestToken != nil { + s.WriteString(schemas.TransactWriteItemsInput_ClientRequestToken, *v.ClientRequestToken) + } + if v.ReturnConsumedCapacity != "" { + s.WriteString(schemas.TransactWriteItemsInput_ReturnConsumedCapacity, string(v.ReturnConsumedCapacity)) + } + if v.ReturnItemCollectionMetrics != "" { + s.WriteString(schemas.TransactWriteItemsInput_ReturnItemCollectionMetrics, string(v.ReturnItemCollectionMetrics)) + } + serializeTransactWriteItemList(s, schemas.TransactWriteItemsInput_TransactItems, v.TransactItems) +} func (in *TransactWriteItemsInput) bindEndpointParams(p *EndpointParameters) { func() { v1 := in.TransactItems @@ -194,6 +213,9 @@ type TransactWriteItemsOutput struct { // The capacity units consumed by the entire TransactWriteItems operation. The // values of the list are ordered according to the ordering of the TransactItems // request parameter. + // + // If the table has vector indexes, each element also includes a VectorIndexes + // field with VectorWriteRequestBytes consumed for each affected vector index. ConsumedCapacity []types.ConsumedCapacity // A list of tables that were processed by TransactWriteItems and, for each table, @@ -207,35 +229,42 @@ type TransactWriteItemsOutput struct { noSmithyDocumentSerde } +func (v *TransactWriteItemsOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.TransactWriteItemsOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *TransactWriteItemsOutput) SerializeMembers(s smithy.ShapeSerializer) { + serializeConsumedCapacityMultiple(s, schemas.TransactWriteItemsOutput_ConsumedCapacity, v.ConsumedCapacity) + serializeItemCollectionMetricsPerTable(s, schemas.TransactWriteItemsOutput_ItemCollectionMetrics, v.ItemCollectionMetrics) +} +func (v *TransactWriteItemsOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.TransactWriteItemsOutput, func(s *smithy.Schema) error { + switch s { + case schemas.TransactWriteItemsOutput_ConsumedCapacity: + return deserializeConsumedCapacityMultiple(d, schemas.TransactWriteItemsOutput_ConsumedCapacity, &v.ConsumedCapacity) + case schemas.TransactWriteItemsOutput_ItemCollectionMetrics: + return deserializeItemCollectionMetricsPerTable(d, schemas.TransactWriteItemsOutput_ItemCollectionMetrics, &v.ItemCollectionMetrics) + } + return nil + }) +} func (c *Client) addOperationTransactWriteItemsMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpTransactWriteItems{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.TransactWriteItems, schemas.TransactWriteItemsInput, schemas.TransactWriteItemsOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpTransactWriteItems{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.TransactWriteItems, schemas.TransactWriteItemsInput, schemas.TransactWriteItemsOutput), output: &TransactWriteItemsOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpTransactWriteItemsDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -253,9 +282,6 @@ func (c *Client) addOperationTransactWriteItemsMiddlewares(stack *middleware.Sta if err = addOpTransactWriteItemsValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "TransactWriteItems"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 14e72c040fe..dc1dc23197a 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 @@ -5,9 +5,10 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Removes the association of tags from an Amazon DynamoDB resource. You can call @@ -60,6 +61,18 @@ type UntagResourceInput struct { noSmithyDocumentSerde } +func (v *UntagResourceInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.UntagResourceInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *UntagResourceInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ResourceArn != nil { + s.WriteString(schemas.UntagResourceInput_ResourceArn, *v.ResourceArn) + } + serializeTagKeyList(s, schemas.UntagResourceInput_TagKeys, v.TagKeys) +} func (in *UntagResourceInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.ResourceArn @@ -73,35 +86,36 @@ type UntagResourceOutput struct { noSmithyDocumentSerde } +func (v *UntagResourceOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(nil) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *UntagResourceOutput) SerializeMembers(s smithy.ShapeSerializer) { +} +func (v *UntagResourceOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, nil, func(s *smithy.Schema) error { + switch s { + } + return nil + }) +} func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpUntagResource{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.UntagResource, schemas.UntagResourceInput, nil)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUntagResource{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.UntagResource, schemas.UntagResourceInput, nil), output: &UntagResourceOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpUntagResourceDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -116,9 +130,6 @@ func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, o if err = addOpUntagResourceValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "UntagResource"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 752380475c5..36dd8663d44 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // UpdateContinuousBackups enables or disables point in time recovery for the @@ -55,6 +56,22 @@ type UpdateContinuousBackupsInput struct { noSmithyDocumentSerde } +func (v *UpdateContinuousBackupsInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.UpdateContinuousBackupsInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *UpdateContinuousBackupsInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.PointInTimeRecoverySpecification != nil { + s.WriteStruct(schemas.UpdateContinuousBackupsInput_PointInTimeRecoverySpecification) + v.PointInTimeRecoverySpecification.SerializeMembers(s) + s.CloseStruct() + } + if v.TableName != nil { + s.WriteString(schemas.UpdateContinuousBackupsInput_TableName, *v.TableName) + } +} func (in *UpdateContinuousBackupsInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TableName @@ -73,35 +90,44 @@ type UpdateContinuousBackupsOutput struct { noSmithyDocumentSerde } +func (v *UpdateContinuousBackupsOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.UpdateContinuousBackupsOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *UpdateContinuousBackupsOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ContinuousBackupsDescription != nil { + s.WriteStruct(schemas.UpdateContinuousBackupsOutput_ContinuousBackupsDescription) + v.ContinuousBackupsDescription.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *UpdateContinuousBackupsOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.UpdateContinuousBackupsOutput, func(s *smithy.Schema) error { + switch s { + case schemas.UpdateContinuousBackupsOutput_ContinuousBackupsDescription: + v.ContinuousBackupsDescription = &types.ContinuousBackupsDescription{} + return v.ContinuousBackupsDescription.Deserialize(d) + } + return nil + }) +} func (c *Client) addOperationUpdateContinuousBackupsMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateContinuousBackups{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.UpdateContinuousBackups, schemas.UpdateContinuousBackupsInput, schemas.UpdateContinuousBackupsOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateContinuousBackups{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.UpdateContinuousBackups, schemas.UpdateContinuousBackupsInput, schemas.UpdateContinuousBackupsOutput), output: &UpdateContinuousBackupsOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpUpdateContinuousBackupsDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -116,9 +142,6 @@ func (c *Client) addOperationUpdateContinuousBackupsMiddlewares(stack *middlewar if err = addOpUpdateContinuousBackupsValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "UpdateContinuousBackups"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 1e3c0fe374e..231bc607390 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 @@ -4,9 +4,10 @@ package dynamodb import ( "context" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates the status for contributor insights for a specific table or index. @@ -54,6 +55,26 @@ type UpdateContributorInsightsInput struct { noSmithyDocumentSerde } +func (v *UpdateContributorInsightsInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.UpdateContributorInsightsInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *UpdateContributorInsightsInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ContributorInsightsAction != "" { + s.WriteString(schemas.UpdateContributorInsightsInput_ContributorInsightsAction, string(v.ContributorInsightsAction)) + } + if v.ContributorInsightsMode != "" { + s.WriteString(schemas.UpdateContributorInsightsInput_ContributorInsightsMode, string(v.ContributorInsightsMode)) + } + if v.IndexName != nil { + s.WriteString(schemas.UpdateContributorInsightsInput_IndexName, *v.IndexName) + } + if v.TableName != nil { + s.WriteString(schemas.UpdateContributorInsightsInput_TableName, *v.TableName) + } +} func (in *UpdateContributorInsightsInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TableName @@ -82,35 +103,68 @@ type UpdateContributorInsightsOutput struct { noSmithyDocumentSerde } -func (c *Client) addOperationUpdateContributorInsightsMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateContributorInsights{}, middleware.After) - if err != nil { - return err +func (v *UpdateContributorInsightsOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.UpdateContributorInsightsOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *UpdateContributorInsightsOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ContributorInsightsMode != "" { + s.WriteString(schemas.UpdateContributorInsightsOutput_ContributorInsightsMode, string(v.ContributorInsightsMode)) } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateContributorInsights{}, middleware.After) - if err != nil { - return err + if v.ContributorInsightsStatus != "" { + s.WriteString(schemas.UpdateContributorInsightsOutput_ContributorInsightsStatus, string(v.ContributorInsightsStatus)) } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err + if v.IndexName != nil { + s.WriteString(schemas.UpdateContributorInsightsOutput_IndexName, *v.IndexName) } - if err = addComputeContentLength(stack); err != nil { - return err + if v.TableName != nil { + s.WriteString(schemas.UpdateContributorInsightsOutput_TableName, *v.TableName) } - if err = addResolveEndpointMiddleware(stack, options); err != nil { +} +func (v *UpdateContributorInsightsOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.UpdateContributorInsightsOutput, func(s *smithy.Schema) error { + switch s { + case schemas.UpdateContributorInsightsOutput_ContributorInsightsMode: + var ev string + if err := d.ReadString(schemas.UpdateContributorInsightsOutput_ContributorInsightsMode, &ev); err != nil { + return err + } + v.ContributorInsightsMode = types.ContributorInsightsMode(ev) + return nil + case schemas.UpdateContributorInsightsOutput_ContributorInsightsStatus: + var ev string + if err := d.ReadString(schemas.UpdateContributorInsightsOutput_ContributorInsightsStatus, &ev); err != nil { + return err + } + v.ContributorInsightsStatus = types.ContributorInsightsStatus(ev) + return nil + case schemas.UpdateContributorInsightsOutput_IndexName: + v.IndexName = new(string) + return d.ReadString(schemas.UpdateContributorInsightsOutput_IndexName, v.IndexName) + case schemas.UpdateContributorInsightsOutput_TableName: + v.TableName = new(string) + return d.ReadString(schemas.UpdateContributorInsightsOutput_TableName, v.TableName) + } + return nil + }) +} +func (c *Client) addOperationUpdateContributorInsightsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.UpdateContributorInsights, schemas.UpdateContributorInsightsInput, schemas.UpdateContributorInsightsOutput)}, middleware.After); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.UpdateContributorInsights, schemas.UpdateContributorInsightsInput, schemas.UpdateContributorInsightsOutput), output: &UpdateContributorInsightsOutput{}}, middleware.After); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + + if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addUserAgentAccountIDEndpointMode(stack, options); err != nil { @@ -122,9 +176,6 @@ func (c *Client) addOperationUpdateContributorInsightsMiddlewares(stack *middlew if err = addOpUpdateContributorInsightsValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "UpdateContributorInsights"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 7b445278f60..f5c42645dd9 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Adds or removes replicas in the specified global table. The global table must @@ -77,6 +78,18 @@ type UpdateGlobalTableInput struct { noSmithyDocumentSerde } +func (v *UpdateGlobalTableInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.UpdateGlobalTableInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *UpdateGlobalTableInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.GlobalTableName != nil { + s.WriteString(schemas.UpdateGlobalTableInput_GlobalTableName, *v.GlobalTableName) + } + serializeReplicaUpdateList(s, schemas.UpdateGlobalTableInput_ReplicaUpdates, v.ReplicaUpdates) +} func (in *UpdateGlobalTableInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.GlobalTableName @@ -94,35 +107,44 @@ type UpdateGlobalTableOutput struct { noSmithyDocumentSerde } +func (v *UpdateGlobalTableOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.UpdateGlobalTableOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *UpdateGlobalTableOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.GlobalTableDescription != nil { + s.WriteStruct(schemas.UpdateGlobalTableOutput_GlobalTableDescription) + v.GlobalTableDescription.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *UpdateGlobalTableOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.UpdateGlobalTableOutput, func(s *smithy.Schema) error { + switch s { + case schemas.UpdateGlobalTableOutput_GlobalTableDescription: + v.GlobalTableDescription = &types.GlobalTableDescription{} + return v.GlobalTableDescription.Deserialize(d) + } + return nil + }) +} func (c *Client) addOperationUpdateGlobalTableMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateGlobalTable{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.UpdateGlobalTable, schemas.UpdateGlobalTableInput, schemas.UpdateGlobalTableOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateGlobalTable{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.UpdateGlobalTable, schemas.UpdateGlobalTableInput, schemas.UpdateGlobalTableOutput), output: &UpdateGlobalTableOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpUpdateGlobalTableDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -137,9 +159,6 @@ func (c *Client) addOperationUpdateGlobalTableMiddlewares(stack *middleware.Stac if err = addOpUpdateGlobalTableValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "UpdateGlobalTable"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 70dc9187772..3e94277ed76 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates settings for a global table. @@ -77,6 +78,30 @@ type UpdateGlobalTableSettingsInput struct { noSmithyDocumentSerde } +func (v *UpdateGlobalTableSettingsInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.UpdateGlobalTableSettingsInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *UpdateGlobalTableSettingsInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.GlobalTableBillingMode != "" { + s.WriteString(schemas.UpdateGlobalTableSettingsInput_GlobalTableBillingMode, string(v.GlobalTableBillingMode)) + } + serializeGlobalTableGlobalSecondaryIndexSettingsUpdateList(s, schemas.UpdateGlobalTableSettingsInput_GlobalTableGlobalSecondaryIndexSettingsUpdate, v.GlobalTableGlobalSecondaryIndexSettingsUpdate) + if v.GlobalTableName != nil { + s.WriteString(schemas.UpdateGlobalTableSettingsInput_GlobalTableName, *v.GlobalTableName) + } + if v.GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate != nil { + s.WriteStruct(schemas.UpdateGlobalTableSettingsInput_GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate) + v.GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate.SerializeMembers(s) + s.CloseStruct() + } + if v.GlobalTableProvisionedWriteCapacityUnits != nil { + s.WriteInt64(schemas.UpdateGlobalTableSettingsInput_GlobalTableProvisionedWriteCapacityUnits, *v.GlobalTableProvisionedWriteCapacityUnits) + } + serializeReplicaSettingsUpdateList(s, schemas.UpdateGlobalTableSettingsInput_ReplicaSettingsUpdate, v.ReplicaSettingsUpdate) +} func (in *UpdateGlobalTableSettingsInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.GlobalTableName @@ -97,35 +122,45 @@ type UpdateGlobalTableSettingsOutput struct { noSmithyDocumentSerde } +func (v *UpdateGlobalTableSettingsOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.UpdateGlobalTableSettingsOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *UpdateGlobalTableSettingsOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.GlobalTableName != nil { + s.WriteString(schemas.UpdateGlobalTableSettingsOutput_GlobalTableName, *v.GlobalTableName) + } + serializeReplicaSettingsDescriptionList(s, schemas.UpdateGlobalTableSettingsOutput_ReplicaSettings, v.ReplicaSettings) +} +func (v *UpdateGlobalTableSettingsOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.UpdateGlobalTableSettingsOutput, func(s *smithy.Schema) error { + switch s { + case schemas.UpdateGlobalTableSettingsOutput_GlobalTableName: + v.GlobalTableName = new(string) + return d.ReadString(schemas.UpdateGlobalTableSettingsOutput_GlobalTableName, v.GlobalTableName) + case schemas.UpdateGlobalTableSettingsOutput_ReplicaSettings: + return deserializeReplicaSettingsDescriptionList(d, schemas.UpdateGlobalTableSettingsOutput_ReplicaSettings, &v.ReplicaSettings) + } + return nil + }) +} func (c *Client) addOperationUpdateGlobalTableSettingsMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateGlobalTableSettings{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.UpdateGlobalTableSettings, schemas.UpdateGlobalTableSettingsInput, schemas.UpdateGlobalTableSettingsOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateGlobalTableSettings{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.UpdateGlobalTableSettings, schemas.UpdateGlobalTableSettingsInput, schemas.UpdateGlobalTableSettingsOutput), output: &UpdateGlobalTableSettingsOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpUpdateGlobalTableSettingsDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -140,9 +175,6 @@ func (c *Client) addOperationUpdateGlobalTableSettingsMiddlewares(stack *middlew if err = addOpUpdateGlobalTableSettingsValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "UpdateGlobalTableSettings"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 3d30a2c4ffc..adcee6c6602 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Edits an existing item's attributes, or adds a new item to the table if it does @@ -283,6 +284,43 @@ type UpdateItemInput struct { noSmithyDocumentSerde } +func (v *UpdateItemInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.UpdateItemInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *UpdateItemInput) SerializeMembers(s smithy.ShapeSerializer) { + serializeAttributeUpdates(s, schemas.UpdateItemInput_AttributeUpdates, v.AttributeUpdates) + if v.ConditionExpression != nil { + s.WriteString(schemas.UpdateItemInput_ConditionExpression, *v.ConditionExpression) + } + if v.ConditionalOperator != "" { + s.WriteString(schemas.UpdateItemInput_ConditionalOperator, string(v.ConditionalOperator)) + } + serializeExpectedAttributeMap(s, schemas.UpdateItemInput_Expected, v.Expected) + serializeExpressionAttributeNameMap(s, schemas.UpdateItemInput_ExpressionAttributeNames, v.ExpressionAttributeNames) + serializeExpressionAttributeValueMap(s, schemas.UpdateItemInput_ExpressionAttributeValues, v.ExpressionAttributeValues) + serializeKey(s, schemas.UpdateItemInput_Key, v.Key) + if v.ReturnConsumedCapacity != "" { + s.WriteString(schemas.UpdateItemInput_ReturnConsumedCapacity, string(v.ReturnConsumedCapacity)) + } + if v.ReturnItemCollectionMetrics != "" { + s.WriteString(schemas.UpdateItemInput_ReturnItemCollectionMetrics, string(v.ReturnItemCollectionMetrics)) + } + if v.ReturnValues != "" { + s.WriteString(schemas.UpdateItemInput_ReturnValues, string(v.ReturnValues)) + } + if v.ReturnValuesOnConditionCheckFailure != "" { + s.WriteString(schemas.UpdateItemInput_ReturnValuesOnConditionCheckFailure, string(v.ReturnValuesOnConditionCheckFailure)) + } + if v.TableName != nil { + s.WriteString(schemas.UpdateItemInput_TableName, *v.TableName) + } + if v.UpdateExpression != nil { + s.WriteString(schemas.UpdateItemInput_UpdateExpression, *v.UpdateExpression) + } +} func (in *UpdateItemInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TableName @@ -306,6 +344,9 @@ type UpdateItemOutput struct { // returned if the ReturnConsumedCapacity parameter was specified. For more // information, see [Capacity unity consumption for write operations]in the Amazon DynamoDB Developer Guide. // + // If the table has vector indexes, the response includes a VectorIndexes field + // with VectorWriteRequestBytes consumed for each affected vector index. + // // [Capacity unity consumption for write operations]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/read-write-operations.html#write-operation-consumption ConsumedCapacity *types.ConsumedCapacity @@ -336,35 +377,55 @@ type UpdateItemOutput struct { noSmithyDocumentSerde } -func (c *Client) addOperationUpdateItemMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateItem{}, middleware.After) - if err != nil { - return err +func (v *UpdateItemOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.UpdateItemOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *UpdateItemOutput) SerializeMembers(s smithy.ShapeSerializer) { + serializeAttributeMap(s, schemas.UpdateItemOutput_Attributes, v.Attributes) + if v.ConsumedCapacity != nil { + s.WriteStruct(schemas.UpdateItemOutput_ConsumedCapacity) + v.ConsumedCapacity.SerializeMembers(s) + s.CloseStruct() } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateItem{}, middleware.After) - if err != nil { - return err + if v.ItemCollectionMetrics != nil { + s.WriteStruct(schemas.UpdateItemOutput_ItemCollectionMetrics) + v.ItemCollectionMetrics.SerializeMembers(s) + s.CloseStruct() } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { +} +func (v *UpdateItemOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.UpdateItemOutput, func(s *smithy.Schema) error { + switch s { + case schemas.UpdateItemOutput_Attributes: + return deserializeAttributeMap(d, schemas.UpdateItemOutput_Attributes, &v.Attributes) + case schemas.UpdateItemOutput_ConsumedCapacity: + v.ConsumedCapacity = &types.ConsumedCapacity{} + return v.ConsumedCapacity.Deserialize(d) + case schemas.UpdateItemOutput_ItemCollectionMetrics: + v.ItemCollectionMetrics = &types.ItemCollectionMetrics{} + return v.ItemCollectionMetrics.Deserialize(d) + } + return nil + }) +} +func (c *Client) addOperationUpdateItemMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.UpdateItem, schemas.UpdateItemInput, schemas.UpdateItemOutput)}, middleware.After); err != nil { return err } - if err = addComputeContentLength(stack); err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.UpdateItem, schemas.UpdateItemInput, schemas.UpdateItemOutput), output: &UpdateItemOutput{}}, middleware.After); err != nil { return err } + if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpUpdateItemDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -379,9 +440,6 @@ func (c *Client) addOperationUpdateItemMiddlewares(stack *middleware.Stack, opti if err = addOpUpdateItemValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "UpdateItem"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 0dafb8e9607..e92081fcd0a 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // The command to update the Kinesis stream destination. @@ -46,6 +47,25 @@ type UpdateKinesisStreamingDestinationInput struct { noSmithyDocumentSerde } +func (v *UpdateKinesisStreamingDestinationInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.UpdateKinesisStreamingDestinationInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *UpdateKinesisStreamingDestinationInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.StreamArn != nil { + s.WriteString(schemas.UpdateKinesisStreamingDestinationInput_StreamArn, *v.StreamArn) + } + if v.TableName != nil { + s.WriteString(schemas.UpdateKinesisStreamingDestinationInput_TableName, *v.TableName) + } + if v.UpdateKinesisStreamingConfiguration != nil { + s.WriteStruct(schemas.UpdateKinesisStreamingDestinationInput_UpdateKinesisStreamingConfiguration) + v.UpdateKinesisStreamingConfiguration.SerializeMembers(s) + s.CloseStruct() + } +} func (in *UpdateKinesisStreamingDestinationInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TableName @@ -72,35 +92,66 @@ type UpdateKinesisStreamingDestinationOutput struct { noSmithyDocumentSerde } -func (c *Client) addOperationUpdateKinesisStreamingDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateKinesisStreamingDestination{}, middleware.After) - if err != nil { - return err +func (v *UpdateKinesisStreamingDestinationOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.UpdateKinesisStreamingDestinationOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *UpdateKinesisStreamingDestinationOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.DestinationStatus != "" { + s.WriteString(schemas.UpdateKinesisStreamingDestinationOutput_DestinationStatus, string(v.DestinationStatus)) } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateKinesisStreamingDestination{}, middleware.After) - if err != nil { - return err + if v.StreamArn != nil { + s.WriteString(schemas.UpdateKinesisStreamingDestinationOutput_StreamArn, *v.StreamArn) } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err + if v.TableName != nil { + s.WriteString(schemas.UpdateKinesisStreamingDestinationOutput_TableName, *v.TableName) } - if err = addComputeContentLength(stack); err != nil { - return err + if v.UpdateKinesisStreamingConfiguration != nil { + s.WriteStruct(schemas.UpdateKinesisStreamingDestinationOutput_UpdateKinesisStreamingConfiguration) + v.UpdateKinesisStreamingConfiguration.SerializeMembers(s) + s.CloseStruct() } - if err = addResolveEndpointMiddleware(stack, options); err != nil { +} +func (v *UpdateKinesisStreamingDestinationOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.UpdateKinesisStreamingDestinationOutput, func(s *smithy.Schema) error { + switch s { + case schemas.UpdateKinesisStreamingDestinationOutput_DestinationStatus: + var ev string + if err := d.ReadString(schemas.UpdateKinesisStreamingDestinationOutput_DestinationStatus, &ev); err != nil { + return err + } + v.DestinationStatus = types.DestinationStatus(ev) + return nil + case schemas.UpdateKinesisStreamingDestinationOutput_StreamArn: + v.StreamArn = new(string) + return d.ReadString(schemas.UpdateKinesisStreamingDestinationOutput_StreamArn, v.StreamArn) + case schemas.UpdateKinesisStreamingDestinationOutput_TableName: + v.TableName = new(string) + return d.ReadString(schemas.UpdateKinesisStreamingDestinationOutput_TableName, v.TableName) + case schemas.UpdateKinesisStreamingDestinationOutput_UpdateKinesisStreamingConfiguration: + v.UpdateKinesisStreamingConfiguration = &types.UpdateKinesisStreamingConfiguration{} + return v.UpdateKinesisStreamingConfiguration.Deserialize(d) + } + return nil + }) +} +func (c *Client) addOperationUpdateKinesisStreamingDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.UpdateKinesisStreamingDestination, schemas.UpdateKinesisStreamingDestinationInput, schemas.UpdateKinesisStreamingDestinationOutput)}, middleware.After); err != nil { return err } - if err = addComputePayloadSHA256(stack); err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.UpdateKinesisStreamingDestination, schemas.UpdateKinesisStreamingDestinationInput, schemas.UpdateKinesisStreamingDestinationOutput), output: &UpdateKinesisStreamingDestinationOutput{}}, middleware.After); err != nil { return err } - if err = addRecordResponseTiming(stack); err != nil { + + if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpUpdateKinesisStreamingDestinationDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -115,9 +166,6 @@ func (c *Client) addOperationUpdateKinesisStreamingDestinationMiddlewares(stack if err = addOpUpdateKinesisStreamingDestinationValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "UpdateKinesisStreamingDestination"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 3f7b4f6c691..754b0a6f93e 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Modifies the provisioned throughput settings, global secondary indexes, or @@ -170,6 +171,14 @@ type UpdateTableInput struct { // STANDARD_INFREQUENT_ACCESS . TableClass types.TableClass + // A list of vector indexes to be added to or removed from the table. You can add + // or remove one vector index for each UpdateTable operation. + // + // To add a vector index, specify IndexName , VectorAttribute , Dimensions , + // DistanceFunction , and Projection . To remove a vector index, specify only the + // IndexName . + VectorIndexUpdates []types.VectorIndexUpdate + // Represents the warm throughput (in read units per second and write units per // second) for updating a table. WarmThroughput *types.WarmThroughput @@ -177,6 +186,62 @@ type UpdateTableInput struct { noSmithyDocumentSerde } +func (v *UpdateTableInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.UpdateTableInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *UpdateTableInput) SerializeMembers(s smithy.ShapeSerializer) { + serializeAttributeDefinitions(s, schemas.UpdateTableInput_AttributeDefinitions, v.AttributeDefinitions) + if v.BillingMode != "" { + s.WriteString(schemas.UpdateTableInput_BillingMode, string(v.BillingMode)) + } + if v.DeletionProtectionEnabled != nil { + s.WriteBool(schemas.UpdateTableInput_DeletionProtectionEnabled, *v.DeletionProtectionEnabled) + } + serializeGlobalSecondaryIndexUpdateList(s, schemas.UpdateTableInput_GlobalSecondaryIndexUpdates, v.GlobalSecondaryIndexUpdates) + if v.GlobalTableSettingsReplicationMode != "" { + s.WriteString(schemas.UpdateTableInput_GlobalTableSettingsReplicationMode, string(v.GlobalTableSettingsReplicationMode)) + } + serializeGlobalTableWitnessGroupUpdateList(s, schemas.UpdateTableInput_GlobalTableWitnessUpdates, v.GlobalTableWitnessUpdates) + if v.MultiRegionConsistency != "" { + s.WriteString(schemas.UpdateTableInput_MultiRegionConsistency, string(v.MultiRegionConsistency)) + } + if v.OnDemandThroughput != nil { + s.WriteStruct(schemas.UpdateTableInput_OnDemandThroughput) + v.OnDemandThroughput.SerializeMembers(s) + s.CloseStruct() + } + if v.ProvisionedThroughput != nil { + s.WriteStruct(schemas.UpdateTableInput_ProvisionedThroughput) + v.ProvisionedThroughput.SerializeMembers(s) + s.CloseStruct() + } + serializeReplicationGroupUpdateList(s, schemas.UpdateTableInput_ReplicaUpdates, v.ReplicaUpdates) + if v.SSESpecification != nil { + s.WriteStruct(schemas.UpdateTableInput_SSESpecification) + v.SSESpecification.SerializeMembers(s) + s.CloseStruct() + } + if v.StreamSpecification != nil { + s.WriteStruct(schemas.UpdateTableInput_StreamSpecification) + v.StreamSpecification.SerializeMembers(s) + s.CloseStruct() + } + if v.TableClass != "" { + s.WriteString(schemas.UpdateTableInput_TableClass, string(v.TableClass)) + } + if v.TableName != nil { + s.WriteString(schemas.UpdateTableInput_TableName, *v.TableName) + } + serializeVectorIndexUpdateList(s, schemas.UpdateTableInput_VectorIndexUpdates, v.VectorIndexUpdates) + if v.WarmThroughput != nil { + s.WriteStruct(schemas.UpdateTableInput_WarmThroughput) + v.WarmThroughput.SerializeMembers(s) + s.CloseStruct() + } +} func (in *UpdateTableInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TableName @@ -195,35 +260,44 @@ type UpdateTableOutput struct { noSmithyDocumentSerde } +func (v *UpdateTableOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.UpdateTableOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *UpdateTableOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.TableDescription != nil { + s.WriteStruct(schemas.UpdateTableOutput_TableDescription) + v.TableDescription.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *UpdateTableOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.UpdateTableOutput, func(s *smithy.Schema) error { + switch s { + case schemas.UpdateTableOutput_TableDescription: + v.TableDescription = &types.TableDescription{} + return v.TableDescription.Deserialize(d) + } + return nil + }) +} func (c *Client) addOperationUpdateTableMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateTable{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.UpdateTable, schemas.UpdateTableInput, schemas.UpdateTableOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateTable{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.UpdateTable, schemas.UpdateTableInput, schemas.UpdateTableOutput), output: &UpdateTableOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpUpdateTableDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -238,9 +312,6 @@ func (c *Client) addOperationUpdateTableMiddlewares(stack *middleware.Stack, opt if err = addOpUpdateTableValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "UpdateTable"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 b5170fad1d1..6801c3cb720 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 @@ -4,9 +4,10 @@ package dynamodb import ( "context" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates auto scaling settings on your global tables at once. @@ -48,6 +49,24 @@ type UpdateTableReplicaAutoScalingInput struct { noSmithyDocumentSerde } +func (v *UpdateTableReplicaAutoScalingInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.UpdateTableReplicaAutoScalingInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *UpdateTableReplicaAutoScalingInput) SerializeMembers(s smithy.ShapeSerializer) { + serializeGlobalSecondaryIndexAutoScalingUpdateList(s, schemas.UpdateTableReplicaAutoScalingInput_GlobalSecondaryIndexUpdates, v.GlobalSecondaryIndexUpdates) + if v.ProvisionedWriteCapacityAutoScalingUpdate != nil { + s.WriteStruct(schemas.UpdateTableReplicaAutoScalingInput_ProvisionedWriteCapacityAutoScalingUpdate) + v.ProvisionedWriteCapacityAutoScalingUpdate.SerializeMembers(s) + s.CloseStruct() + } + serializeReplicaAutoScalingUpdateList(s, schemas.UpdateTableReplicaAutoScalingInput_ReplicaUpdates, v.ReplicaUpdates) + if v.TableName != nil { + s.WriteString(schemas.UpdateTableReplicaAutoScalingInput_TableName, *v.TableName) + } +} func (in *UpdateTableReplicaAutoScalingInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TableName @@ -65,35 +84,44 @@ type UpdateTableReplicaAutoScalingOutput struct { noSmithyDocumentSerde } +func (v *UpdateTableReplicaAutoScalingOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.UpdateTableReplicaAutoScalingOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *UpdateTableReplicaAutoScalingOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.TableAutoScalingDescription != nil { + s.WriteStruct(schemas.UpdateTableReplicaAutoScalingOutput_TableAutoScalingDescription) + v.TableAutoScalingDescription.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *UpdateTableReplicaAutoScalingOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.UpdateTableReplicaAutoScalingOutput, func(s *smithy.Schema) error { + switch s { + case schemas.UpdateTableReplicaAutoScalingOutput_TableAutoScalingDescription: + v.TableAutoScalingDescription = &types.TableAutoScalingDescription{} + return v.TableAutoScalingDescription.Deserialize(d) + } + return nil + }) +} func (c *Client) addOperationUpdateTableReplicaAutoScalingMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateTableReplicaAutoScaling{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.UpdateTableReplicaAutoScaling, schemas.UpdateTableReplicaAutoScalingInput, schemas.UpdateTableReplicaAutoScalingOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateTableReplicaAutoScaling{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.UpdateTableReplicaAutoScaling, schemas.UpdateTableReplicaAutoScalingInput, schemas.UpdateTableReplicaAutoScalingOutput), output: &UpdateTableReplicaAutoScalingOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addUserAgentAccountIDEndpointMode(stack, options); err != nil { @@ -105,9 +133,6 @@ func (c *Client) addOperationUpdateTableReplicaAutoScalingMiddlewares(stack *mid if err = addOpUpdateTableReplicaAutoScalingValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "UpdateTableReplicaAutoScaling"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 09b6eec480d..f0ac009bab4 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 @@ -5,10 +5,11 @@ package dynamodb import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // The UpdateTimeToLive method enables or disables Time to Live (TTL) for the @@ -73,6 +74,22 @@ type UpdateTimeToLiveInput struct { noSmithyDocumentSerde } +func (v *UpdateTimeToLiveInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.UpdateTimeToLiveInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *UpdateTimeToLiveInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.TableName != nil { + s.WriteString(schemas.UpdateTimeToLiveInput_TableName, *v.TableName) + } + if v.TimeToLiveSpecification != nil { + s.WriteStruct(schemas.UpdateTimeToLiveInput_TimeToLiveSpecification) + v.TimeToLiveSpecification.SerializeMembers(s) + s.CloseStruct() + } +} func (in *UpdateTimeToLiveInput) bindEndpointParams(p *EndpointParameters) { p.ResourceArn = in.TableName @@ -90,35 +107,44 @@ type UpdateTimeToLiveOutput struct { noSmithyDocumentSerde } +func (v *UpdateTimeToLiveOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.UpdateTimeToLiveOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *UpdateTimeToLiveOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.TimeToLiveSpecification != nil { + s.WriteStruct(schemas.UpdateTimeToLiveOutput_TimeToLiveSpecification) + v.TimeToLiveSpecification.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *UpdateTimeToLiveOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.UpdateTimeToLiveOutput, func(s *smithy.Schema) error { + switch s { + case schemas.UpdateTimeToLiveOutput_TimeToLiveSpecification: + v.TimeToLiveSpecification = &types.TimeToLiveSpecification{} + return v.TimeToLiveSpecification.Deserialize(d) + } + return nil + }) +} func (c *Client) addOperationUpdateTimeToLiveMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateTimeToLive{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.UpdateTimeToLive, schemas.UpdateTimeToLiveInput, schemas.UpdateTimeToLiveOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateTimeToLive{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.UpdateTimeToLive, schemas.UpdateTimeToLiveInput, schemas.UpdateTimeToLiveOutput), output: &UpdateTimeToLiveOutput{}}, middleware.After); err != nil { return err } - if err = addlegacyEndpointContextSetter(stack, options); 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 = addRecordResponseTiming(stack); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + if err = addRecordResponseTiming(stack, options); err != nil { return err } if err = addOpUpdateTimeToLiveDiscoverEndpointMiddleware(stack, options, c); err != nil { @@ -133,9 +159,6 @@ func (c *Client) addOperationUpdateTimeToLiveMiddlewares(stack *middleware.Stack if err = addOpUpdateTimeToLiveValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "UpdateTimeToLive"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/common_serde.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/common_serde.go new file mode 100644 index 00000000000..faa4231dd9f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/common_serde.go @@ -0,0 +1,2518 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package dynamodb + +import ( + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" + smithy "github.com/aws/smithy-go" +) + +func serializeAttributeValue(s smithy.ShapeSerializer, schema *smithy.Schema, v types.AttributeValue) { + switch vv := v.(type) { + case *types.AttributeValueMemberB: + s.WriteUnion(schema, schemas.AttributeValue_B) + s.WriteBlob(schemas.AttributeValue_B, vv.Value) + s.CloseUnion() + case *types.AttributeValueMemberBOOL: + s.WriteUnion(schema, schemas.AttributeValue_BOOL) + s.WriteBool(schemas.AttributeValue_BOOL, vv.Value) + s.CloseUnion() + case *types.AttributeValueMemberBS: + s.WriteUnion(schema, schemas.AttributeValue_BS) + serializeBinarySetAttributeValue(s, schemas.AttributeValue_BS, vv.Value) + s.CloseUnion() + case *types.AttributeValueMemberL: + s.WriteUnion(schema, schemas.AttributeValue_L) + serializeListAttributeValue(s, schemas.AttributeValue_L, vv.Value) + s.CloseUnion() + case *types.AttributeValueMemberM: + s.WriteUnion(schema, schemas.AttributeValue_M) + serializeMapAttributeValue(s, schemas.AttributeValue_M, vv.Value) + s.CloseUnion() + case *types.AttributeValueMemberN: + s.WriteUnion(schema, schemas.AttributeValue_N) + s.WriteString(schemas.AttributeValue_N, vv.Value) + s.CloseUnion() + case *types.AttributeValueMemberNS: + s.WriteUnion(schema, schemas.AttributeValue_NS) + serializeNumberSetAttributeValue(s, schemas.AttributeValue_NS, vv.Value) + s.CloseUnion() + case *types.AttributeValueMemberNULL: + s.WriteUnion(schema, schemas.AttributeValue_NULL) + s.WriteBool(schemas.AttributeValue_NULL, vv.Value) + s.CloseUnion() + case *types.AttributeValueMemberS: + s.WriteUnion(schema, schemas.AttributeValue_S) + s.WriteString(schemas.AttributeValue_S, vv.Value) + s.CloseUnion() + case *types.AttributeValueMemberSS: + s.WriteUnion(schema, schemas.AttributeValue_SS) + serializeStringSetAttributeValue(s, schemas.AttributeValue_SS, vv.Value) + s.CloseUnion() + } +} + +func deserializeAttributeValue(d smithy.ShapeDeserializer, s *smithy.Schema, v *types.AttributeValue) error { + return smithy.ReadUnion(d, s, func(ms *smithy.Schema) error { + switch ms { + case schemas.AttributeValue_B: + vv := &types.AttributeValueMemberB{} + *v = vv + return vv.Deserialize(d) + case schemas.AttributeValue_BOOL: + vv := &types.AttributeValueMemberBOOL{} + *v = vv + return vv.Deserialize(d) + case schemas.AttributeValue_BS: + vv := &types.AttributeValueMemberBS{} + *v = vv + return vv.Deserialize(d) + case schemas.AttributeValue_L: + vv := &types.AttributeValueMemberL{} + *v = vv + return vv.Deserialize(d) + case schemas.AttributeValue_M: + vv := &types.AttributeValueMemberM{} + *v = vv + return vv.Deserialize(d) + case schemas.AttributeValue_N: + vv := &types.AttributeValueMemberN{} + *v = vv + return vv.Deserialize(d) + case schemas.AttributeValue_NS: + vv := &types.AttributeValueMemberNS{} + *v = vv + return vv.Deserialize(d) + case schemas.AttributeValue_NULL: + vv := &types.AttributeValueMemberNULL{} + *v = vv + return vv.Deserialize(d) + case schemas.AttributeValue_S: + vv := &types.AttributeValueMemberS{} + *v = vv + return vv.Deserialize(d) + case schemas.AttributeValue_SS: + vv := &types.AttributeValueMemberSS{} + *v = vv + return vv.Deserialize(d) + } + return nil + }) +} + +func serializeAttributeDefinitions(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.AttributeDefinition) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeAttributeNameList(s smithy.ShapeSerializer, schema *smithy.Schema, v []string) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteString(schema.ListMember(), string(vv)) + } + s.CloseList() +} + +func serializeAttributeValueList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.AttributeValue) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + serializeAttributeValue(s, schema.ListMember(), vv) + } + s.CloseList() +} + +func serializeAutoScalingPolicyDescriptionList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.AutoScalingPolicyDescription) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeBackupSummaries(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.BackupSummary) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeBinarySetAttributeValue(s smithy.ShapeSerializer, schema *smithy.Schema, v [][]byte) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteBlob(schema.ListMember(), vv) + } + s.CloseList() +} + +func serializeCancellationReasonList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.CancellationReason) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeConsumedCapacityMultiple(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.ConsumedCapacity) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeContributorInsightsRuleList(s smithy.ShapeSerializer, schema *smithy.Schema, v []string) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteString(schema.ListMember(), string(vv)) + } + s.CloseList() +} + +func serializeContributorInsightsSummaries(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.ContributorInsightsSummary) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeCsvHeaderList(s smithy.ShapeSerializer, schema *smithy.Schema, v []string) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteString(schema.ListMember(), string(vv)) + } + s.CloseList() +} + +func serializeEndpoints(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.Endpoint) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeExportSummaries(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.ExportSummary) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeGlobalSecondaryIndexAutoScalingUpdateList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.GlobalSecondaryIndexAutoScalingUpdate) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeGlobalSecondaryIndexDescriptionList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.GlobalSecondaryIndexDescription) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeGlobalSecondaryIndexes(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.GlobalSecondaryIndexInfo) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeGlobalSecondaryIndexList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.GlobalSecondaryIndex) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeGlobalSecondaryIndexUpdateList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.GlobalSecondaryIndexUpdate) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeGlobalTableGlobalSecondaryIndexSettingsUpdateList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.GlobalTableGlobalSecondaryIndexSettingsUpdate) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeGlobalTableList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.GlobalTable) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeGlobalTableWitnessDescriptionList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.GlobalTableWitnessDescription) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeGlobalTableWitnessGroupUpdateList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.GlobalTableWitnessGroupUpdate) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeImportSummaryList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.ImportSummary) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeItemCollectionMetricsMultiple(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.ItemCollectionMetrics) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeItemCollectionSizeEstimateRange(s smithy.ShapeSerializer, schema *smithy.Schema, v []float64) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteFloat64(schema.ListMember(), vv) + } + s.CloseList() +} + +func serializeItemList(s smithy.ShapeSerializer, schema *smithy.Schema, v []map[string]types.AttributeValue) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + serializeAttributeMap(s, schema.ListMember(), vv) + } + s.CloseList() +} + +func serializeItemResponseList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.ItemResponse) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeKeyList(s smithy.ShapeSerializer, schema *smithy.Schema, v []map[string]types.AttributeValue) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + serializeKey(s, schema.ListMember(), vv) + } + s.CloseList() +} + +func serializeKeySchema(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.KeySchemaElement) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeKinesisDataStreamDestinations(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.KinesisDataStreamDestination) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeListAttributeValue(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.AttributeValue) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + serializeAttributeValue(s, schema.ListMember(), vv) + } + s.CloseList() +} + +func serializeLocalSecondaryIndexDescriptionList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.LocalSecondaryIndexDescription) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeLocalSecondaryIndexes(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.LocalSecondaryIndexInfo) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeLocalSecondaryIndexList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.LocalSecondaryIndex) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeNonKeyAttributeNameList(s smithy.ShapeSerializer, schema *smithy.Schema, v []string) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteString(schema.ListMember(), string(vv)) + } + s.CloseList() +} + +func serializeNumberSetAttributeValue(s smithy.ShapeSerializer, schema *smithy.Schema, v []string) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteString(schema.ListMember(), string(vv)) + } + s.CloseList() +} + +func serializeParameterizedStatements(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.ParameterizedStatement) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializePartiQLBatchRequest(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.BatchStatementRequest) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializePartiQLBatchResponse(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.BatchStatementResponse) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializePreparedStatementParameters(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.AttributeValue) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + serializeAttributeValue(s, schema.ListMember(), vv) + } + s.CloseList() +} + +func serializeReplicaAutoScalingDescriptionList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.ReplicaAutoScalingDescription) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeReplicaAutoScalingUpdateList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.ReplicaAutoScalingUpdate) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeReplicaDescriptionList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.ReplicaDescription) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeReplicaGlobalSecondaryIndexAutoScalingDescriptionList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.ReplicaGlobalSecondaryIndexAutoScalingDescription) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeReplicaGlobalSecondaryIndexAutoScalingUpdateList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.ReplicaGlobalSecondaryIndexAutoScalingUpdate) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeReplicaGlobalSecondaryIndexDescriptionList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.ReplicaGlobalSecondaryIndexDescription) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeReplicaGlobalSecondaryIndexList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.ReplicaGlobalSecondaryIndex) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeReplicaGlobalSecondaryIndexSettingsDescriptionList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.ReplicaGlobalSecondaryIndexSettingsDescription) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeReplicaGlobalSecondaryIndexSettingsUpdateList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.ReplicaGlobalSecondaryIndexSettingsUpdate) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeReplicaList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.Replica) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeReplicaSettingsDescriptionList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.ReplicaSettingsDescription) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeReplicaSettingsUpdateList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.ReplicaSettingsUpdate) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeReplicationGroupUpdateList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.ReplicationGroupUpdate) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeReplicaUpdateList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.ReplicaUpdate) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeSearchResultList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.SearchResultItem) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeSearchSchema(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.SearchSchemaElement) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeSearchVectorList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.AttributeValue) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + serializeAttributeValue(s, schema.ListMember(), vv) + } + s.CloseList() +} + +func serializeStringSetAttributeValue(s smithy.ShapeSerializer, schema *smithy.Schema, v []string) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteString(schema.ListMember(), string(vv)) + } + s.CloseList() +} + +func serializeTableNameList(s smithy.ShapeSerializer, schema *smithy.Schema, v []string) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteString(schema.ListMember(), string(vv)) + } + s.CloseList() +} + +func serializeTagKeyList(s smithy.ShapeSerializer, schema *smithy.Schema, v []string) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteString(schema.ListMember(), string(vv)) + } + s.CloseList() +} + +func serializeTagList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.Tag) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeThrottlingReasonList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.ThrottlingReason) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeTransactGetItemList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.TransactGetItem) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeTransactWriteItemList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.TransactWriteItem) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeVectorIndexDescriptionList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.VectorIndexDescription) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeVectorIndexes(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.VectorIndexInfo) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeVectorIndexList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.VectorIndex) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeVectorIndexUpdateList(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.VectorIndexUpdate) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeWriteRequests(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.WriteRequest) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func deserializeAttributeDefinitions(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.AttributeDefinition) error { + *v = make([]types.AttributeDefinition, 0) + var vv types.AttributeDefinition + return smithy.ReadList(d, s, func() error { + vv = types.AttributeDefinition{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeAttributeNameList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]string) error { + *v = make([]string, 0) + var vv string + return smithy.ReadList(d, s, func() error { + + if err := d.ReadString(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeAttributeValueList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.AttributeValue) error { + *v = make([]types.AttributeValue, 0) + var vv types.AttributeValue + return smithy.ReadList(d, s, func() error { + + if err := deserializeAttributeValue(d, s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeAutoScalingPolicyDescriptionList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.AutoScalingPolicyDescription) error { + *v = make([]types.AutoScalingPolicyDescription, 0) + var vv types.AutoScalingPolicyDescription + return smithy.ReadList(d, s, func() error { + vv = types.AutoScalingPolicyDescription{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeBackupSummaries(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.BackupSummary) error { + *v = make([]types.BackupSummary, 0) + var vv types.BackupSummary + return smithy.ReadList(d, s, func() error { + vv = types.BackupSummary{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeBinarySetAttributeValue(d smithy.ShapeDeserializer, s *smithy.Schema, v *[][]byte) error { + *v = make([][]byte, 0) + var vv []byte + return smithy.ReadList(d, s, func() error { + + if err := d.ReadBlob(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeCancellationReasonList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.CancellationReason) error { + *v = make([]types.CancellationReason, 0) + var vv types.CancellationReason + return smithy.ReadList(d, s, func() error { + vv = types.CancellationReason{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeConsumedCapacityMultiple(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.ConsumedCapacity) error { + *v = make([]types.ConsumedCapacity, 0) + var vv types.ConsumedCapacity + return smithy.ReadList(d, s, func() error { + vv = types.ConsumedCapacity{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeContributorInsightsRuleList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]string) error { + *v = make([]string, 0) + var vv string + return smithy.ReadList(d, s, func() error { + + if err := d.ReadString(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeContributorInsightsSummaries(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.ContributorInsightsSummary) error { + *v = make([]types.ContributorInsightsSummary, 0) + var vv types.ContributorInsightsSummary + return smithy.ReadList(d, s, func() error { + vv = types.ContributorInsightsSummary{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeCsvHeaderList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]string) error { + *v = make([]string, 0) + var vv string + return smithy.ReadList(d, s, func() error { + + if err := d.ReadString(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeEndpoints(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.Endpoint) error { + *v = make([]types.Endpoint, 0) + var vv types.Endpoint + return smithy.ReadList(d, s, func() error { + vv = types.Endpoint{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeExportSummaries(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.ExportSummary) error { + *v = make([]types.ExportSummary, 0) + var vv types.ExportSummary + return smithy.ReadList(d, s, func() error { + vv = types.ExportSummary{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeGlobalSecondaryIndexAutoScalingUpdateList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.GlobalSecondaryIndexAutoScalingUpdate) error { + *v = make([]types.GlobalSecondaryIndexAutoScalingUpdate, 0) + var vv types.GlobalSecondaryIndexAutoScalingUpdate + return smithy.ReadList(d, s, func() error { + vv = types.GlobalSecondaryIndexAutoScalingUpdate{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeGlobalSecondaryIndexDescriptionList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.GlobalSecondaryIndexDescription) error { + *v = make([]types.GlobalSecondaryIndexDescription, 0) + var vv types.GlobalSecondaryIndexDescription + return smithy.ReadList(d, s, func() error { + vv = types.GlobalSecondaryIndexDescription{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeGlobalSecondaryIndexes(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.GlobalSecondaryIndexInfo) error { + *v = make([]types.GlobalSecondaryIndexInfo, 0) + var vv types.GlobalSecondaryIndexInfo + return smithy.ReadList(d, s, func() error { + vv = types.GlobalSecondaryIndexInfo{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeGlobalSecondaryIndexList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.GlobalSecondaryIndex) error { + *v = make([]types.GlobalSecondaryIndex, 0) + var vv types.GlobalSecondaryIndex + return smithy.ReadList(d, s, func() error { + vv = types.GlobalSecondaryIndex{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeGlobalSecondaryIndexUpdateList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.GlobalSecondaryIndexUpdate) error { + *v = make([]types.GlobalSecondaryIndexUpdate, 0) + var vv types.GlobalSecondaryIndexUpdate + return smithy.ReadList(d, s, func() error { + vv = types.GlobalSecondaryIndexUpdate{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeGlobalTableGlobalSecondaryIndexSettingsUpdateList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.GlobalTableGlobalSecondaryIndexSettingsUpdate) error { + *v = make([]types.GlobalTableGlobalSecondaryIndexSettingsUpdate, 0) + var vv types.GlobalTableGlobalSecondaryIndexSettingsUpdate + return smithy.ReadList(d, s, func() error { + vv = types.GlobalTableGlobalSecondaryIndexSettingsUpdate{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeGlobalTableList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.GlobalTable) error { + *v = make([]types.GlobalTable, 0) + var vv types.GlobalTable + return smithy.ReadList(d, s, func() error { + vv = types.GlobalTable{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeGlobalTableWitnessDescriptionList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.GlobalTableWitnessDescription) error { + *v = make([]types.GlobalTableWitnessDescription, 0) + var vv types.GlobalTableWitnessDescription + return smithy.ReadList(d, s, func() error { + vv = types.GlobalTableWitnessDescription{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeGlobalTableWitnessGroupUpdateList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.GlobalTableWitnessGroupUpdate) error { + *v = make([]types.GlobalTableWitnessGroupUpdate, 0) + var vv types.GlobalTableWitnessGroupUpdate + return smithy.ReadList(d, s, func() error { + vv = types.GlobalTableWitnessGroupUpdate{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeImportSummaryList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.ImportSummary) error { + *v = make([]types.ImportSummary, 0) + var vv types.ImportSummary + return smithy.ReadList(d, s, func() error { + vv = types.ImportSummary{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeItemCollectionMetricsMultiple(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.ItemCollectionMetrics) error { + *v = make([]types.ItemCollectionMetrics, 0) + var vv types.ItemCollectionMetrics + return smithy.ReadList(d, s, func() error { + vv = types.ItemCollectionMetrics{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeItemCollectionSizeEstimateRange(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]float64) error { + *v = make([]float64, 0) + var vv float64 + return smithy.ReadList(d, s, func() error { + + if err := d.ReadFloat64(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeItemList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]map[string]types.AttributeValue) error { + *v = make([]map[string]types.AttributeValue, 0) + var vv map[string]types.AttributeValue + return smithy.ReadList(d, s, func() error { + vv = nil + if err := deserializeAttributeMap(d, s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeItemResponseList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.ItemResponse) error { + *v = make([]types.ItemResponse, 0) + var vv types.ItemResponse + return smithy.ReadList(d, s, func() error { + vv = types.ItemResponse{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeKeyList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]map[string]types.AttributeValue) error { + *v = make([]map[string]types.AttributeValue, 0) + var vv map[string]types.AttributeValue + return smithy.ReadList(d, s, func() error { + vv = nil + if err := deserializeKey(d, s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeKeySchema(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.KeySchemaElement) error { + *v = make([]types.KeySchemaElement, 0) + var vv types.KeySchemaElement + return smithy.ReadList(d, s, func() error { + vv = types.KeySchemaElement{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeKinesisDataStreamDestinations(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.KinesisDataStreamDestination) error { + *v = make([]types.KinesisDataStreamDestination, 0) + var vv types.KinesisDataStreamDestination + return smithy.ReadList(d, s, func() error { + vv = types.KinesisDataStreamDestination{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeListAttributeValue(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.AttributeValue) error { + *v = make([]types.AttributeValue, 0) + var vv types.AttributeValue + return smithy.ReadList(d, s, func() error { + + if err := deserializeAttributeValue(d, s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeLocalSecondaryIndexDescriptionList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.LocalSecondaryIndexDescription) error { + *v = make([]types.LocalSecondaryIndexDescription, 0) + var vv types.LocalSecondaryIndexDescription + return smithy.ReadList(d, s, func() error { + vv = types.LocalSecondaryIndexDescription{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeLocalSecondaryIndexes(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.LocalSecondaryIndexInfo) error { + *v = make([]types.LocalSecondaryIndexInfo, 0) + var vv types.LocalSecondaryIndexInfo + return smithy.ReadList(d, s, func() error { + vv = types.LocalSecondaryIndexInfo{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeLocalSecondaryIndexList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.LocalSecondaryIndex) error { + *v = make([]types.LocalSecondaryIndex, 0) + var vv types.LocalSecondaryIndex + return smithy.ReadList(d, s, func() error { + vv = types.LocalSecondaryIndex{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeNonKeyAttributeNameList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]string) error { + *v = make([]string, 0) + var vv string + return smithy.ReadList(d, s, func() error { + + if err := d.ReadString(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeNumberSetAttributeValue(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]string) error { + *v = make([]string, 0) + var vv string + return smithy.ReadList(d, s, func() error { + + if err := d.ReadString(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeParameterizedStatements(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.ParameterizedStatement) error { + *v = make([]types.ParameterizedStatement, 0) + var vv types.ParameterizedStatement + return smithy.ReadList(d, s, func() error { + vv = types.ParameterizedStatement{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializePartiQLBatchRequest(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.BatchStatementRequest) error { + *v = make([]types.BatchStatementRequest, 0) + var vv types.BatchStatementRequest + return smithy.ReadList(d, s, func() error { + vv = types.BatchStatementRequest{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializePartiQLBatchResponse(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.BatchStatementResponse) error { + *v = make([]types.BatchStatementResponse, 0) + var vv types.BatchStatementResponse + return smithy.ReadList(d, s, func() error { + vv = types.BatchStatementResponse{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializePreparedStatementParameters(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.AttributeValue) error { + *v = make([]types.AttributeValue, 0) + var vv types.AttributeValue + return smithy.ReadList(d, s, func() error { + + if err := deserializeAttributeValue(d, s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeReplicaAutoScalingDescriptionList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.ReplicaAutoScalingDescription) error { + *v = make([]types.ReplicaAutoScalingDescription, 0) + var vv types.ReplicaAutoScalingDescription + return smithy.ReadList(d, s, func() error { + vv = types.ReplicaAutoScalingDescription{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeReplicaAutoScalingUpdateList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.ReplicaAutoScalingUpdate) error { + *v = make([]types.ReplicaAutoScalingUpdate, 0) + var vv types.ReplicaAutoScalingUpdate + return smithy.ReadList(d, s, func() error { + vv = types.ReplicaAutoScalingUpdate{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeReplicaDescriptionList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.ReplicaDescription) error { + *v = make([]types.ReplicaDescription, 0) + var vv types.ReplicaDescription + return smithy.ReadList(d, s, func() error { + vv = types.ReplicaDescription{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeReplicaGlobalSecondaryIndexAutoScalingDescriptionList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.ReplicaGlobalSecondaryIndexAutoScalingDescription) error { + *v = make([]types.ReplicaGlobalSecondaryIndexAutoScalingDescription, 0) + var vv types.ReplicaGlobalSecondaryIndexAutoScalingDescription + return smithy.ReadList(d, s, func() error { + vv = types.ReplicaGlobalSecondaryIndexAutoScalingDescription{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeReplicaGlobalSecondaryIndexAutoScalingUpdateList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.ReplicaGlobalSecondaryIndexAutoScalingUpdate) error { + *v = make([]types.ReplicaGlobalSecondaryIndexAutoScalingUpdate, 0) + var vv types.ReplicaGlobalSecondaryIndexAutoScalingUpdate + return smithy.ReadList(d, s, func() error { + vv = types.ReplicaGlobalSecondaryIndexAutoScalingUpdate{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeReplicaGlobalSecondaryIndexDescriptionList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.ReplicaGlobalSecondaryIndexDescription) error { + *v = make([]types.ReplicaGlobalSecondaryIndexDescription, 0) + var vv types.ReplicaGlobalSecondaryIndexDescription + return smithy.ReadList(d, s, func() error { + vv = types.ReplicaGlobalSecondaryIndexDescription{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeReplicaGlobalSecondaryIndexList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.ReplicaGlobalSecondaryIndex) error { + *v = make([]types.ReplicaGlobalSecondaryIndex, 0) + var vv types.ReplicaGlobalSecondaryIndex + return smithy.ReadList(d, s, func() error { + vv = types.ReplicaGlobalSecondaryIndex{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeReplicaGlobalSecondaryIndexSettingsDescriptionList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.ReplicaGlobalSecondaryIndexSettingsDescription) error { + *v = make([]types.ReplicaGlobalSecondaryIndexSettingsDescription, 0) + var vv types.ReplicaGlobalSecondaryIndexSettingsDescription + return smithy.ReadList(d, s, func() error { + vv = types.ReplicaGlobalSecondaryIndexSettingsDescription{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeReplicaGlobalSecondaryIndexSettingsUpdateList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.ReplicaGlobalSecondaryIndexSettingsUpdate) error { + *v = make([]types.ReplicaGlobalSecondaryIndexSettingsUpdate, 0) + var vv types.ReplicaGlobalSecondaryIndexSettingsUpdate + return smithy.ReadList(d, s, func() error { + vv = types.ReplicaGlobalSecondaryIndexSettingsUpdate{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeReplicaList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.Replica) error { + *v = make([]types.Replica, 0) + var vv types.Replica + return smithy.ReadList(d, s, func() error { + vv = types.Replica{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeReplicaSettingsDescriptionList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.ReplicaSettingsDescription) error { + *v = make([]types.ReplicaSettingsDescription, 0) + var vv types.ReplicaSettingsDescription + return smithy.ReadList(d, s, func() error { + vv = types.ReplicaSettingsDescription{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeReplicaSettingsUpdateList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.ReplicaSettingsUpdate) error { + *v = make([]types.ReplicaSettingsUpdate, 0) + var vv types.ReplicaSettingsUpdate + return smithy.ReadList(d, s, func() error { + vv = types.ReplicaSettingsUpdate{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeReplicationGroupUpdateList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.ReplicationGroupUpdate) error { + *v = make([]types.ReplicationGroupUpdate, 0) + var vv types.ReplicationGroupUpdate + return smithy.ReadList(d, s, func() error { + vv = types.ReplicationGroupUpdate{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeReplicaUpdateList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.ReplicaUpdate) error { + *v = make([]types.ReplicaUpdate, 0) + var vv types.ReplicaUpdate + return smithy.ReadList(d, s, func() error { + vv = types.ReplicaUpdate{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeSearchResultList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.SearchResultItem) error { + *v = make([]types.SearchResultItem, 0) + var vv types.SearchResultItem + return smithy.ReadList(d, s, func() error { + vv = types.SearchResultItem{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeSearchSchema(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.SearchSchemaElement) error { + *v = make([]types.SearchSchemaElement, 0) + var vv types.SearchSchemaElement + return smithy.ReadList(d, s, func() error { + vv = types.SearchSchemaElement{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeSearchVectorList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.AttributeValue) error { + *v = make([]types.AttributeValue, 0) + var vv types.AttributeValue + return smithy.ReadList(d, s, func() error { + + if err := deserializeAttributeValue(d, s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeStringSetAttributeValue(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]string) error { + *v = make([]string, 0) + var vv string + return smithy.ReadList(d, s, func() error { + + if err := d.ReadString(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeTableNameList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]string) error { + *v = make([]string, 0) + var vv string + return smithy.ReadList(d, s, func() error { + + if err := d.ReadString(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeTagKeyList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]string) error { + *v = make([]string, 0) + var vv string + return smithy.ReadList(d, s, func() error { + + if err := d.ReadString(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeTagList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.Tag) error { + *v = make([]types.Tag, 0) + var vv types.Tag + return smithy.ReadList(d, s, func() error { + vv = types.Tag{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeThrottlingReasonList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.ThrottlingReason) error { + *v = make([]types.ThrottlingReason, 0) + var vv types.ThrottlingReason + return smithy.ReadList(d, s, func() error { + vv = types.ThrottlingReason{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeTransactGetItemList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.TransactGetItem) error { + *v = make([]types.TransactGetItem, 0) + var vv types.TransactGetItem + return smithy.ReadList(d, s, func() error { + vv = types.TransactGetItem{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeTransactWriteItemList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.TransactWriteItem) error { + *v = make([]types.TransactWriteItem, 0) + var vv types.TransactWriteItem + return smithy.ReadList(d, s, func() error { + vv = types.TransactWriteItem{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeVectorIndexDescriptionList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.VectorIndexDescription) error { + *v = make([]types.VectorIndexDescription, 0) + var vv types.VectorIndexDescription + return smithy.ReadList(d, s, func() error { + vv = types.VectorIndexDescription{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeVectorIndexes(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.VectorIndexInfo) error { + *v = make([]types.VectorIndexInfo, 0) + var vv types.VectorIndexInfo + return smithy.ReadList(d, s, func() error { + vv = types.VectorIndexInfo{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeVectorIndexList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.VectorIndex) error { + *v = make([]types.VectorIndex, 0) + var vv types.VectorIndex + return smithy.ReadList(d, s, func() error { + vv = types.VectorIndex{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeVectorIndexUpdateList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.VectorIndexUpdate) error { + *v = make([]types.VectorIndexUpdate, 0) + var vv types.VectorIndexUpdate + return smithy.ReadList(d, s, func() error { + vv = types.VectorIndexUpdate{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeWriteRequests(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.WriteRequest) error { + *v = make([]types.WriteRequest, 0) + var vv types.WriteRequest + return smithy.ReadList(d, s, func() error { + vv = types.WriteRequest{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func serializeAttributeMap(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]types.AttributeValue) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + serializeAttributeValue(s, schema.MapValue(), vv) + } + s.CloseMap() +} + +func serializeAttributeUpdates(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]types.AttributeValueUpdate) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + s.WriteStruct(schema.MapValue()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseMap() +} + +func serializeBatchGetRequestMap(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]types.KeysAndAttributes) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + s.WriteStruct(schema.MapValue()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseMap() +} + +func serializeBatchGetResponseMap(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string][]map[string]types.AttributeValue) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + serializeItemList(s, schema.MapValue(), vv) + } + s.CloseMap() +} + +func serializeBatchWriteItemRequestMap(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string][]types.WriteRequest) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + serializeWriteRequests(s, schema.MapValue(), vv) + } + s.CloseMap() +} + +func serializeExpectedAttributeMap(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]types.ExpectedAttributeValue) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + s.WriteStruct(schema.MapValue()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseMap() +} + +func serializeExpressionAttributeNameMap(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]string) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + s.WriteString(schema.MapValue(), string(vv)) + } + s.CloseMap() +} + +func serializeExpressionAttributeValueMap(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]types.AttributeValue) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + serializeAttributeValue(s, schema.MapValue(), vv) + } + s.CloseMap() +} + +func serializeFilterConditionMap(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]types.Condition) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + s.WriteStruct(schema.MapValue()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseMap() +} + +func serializeItemCollectionKeyAttributeMap(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]types.AttributeValue) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + serializeAttributeValue(s, schema.MapValue(), vv) + } + s.CloseMap() +} + +func serializeItemCollectionMetricsPerTable(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string][]types.ItemCollectionMetrics) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + serializeItemCollectionMetricsMultiple(s, schema.MapValue(), vv) + } + s.CloseMap() +} + +func serializeKey(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]types.AttributeValue) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + serializeAttributeValue(s, schema.MapValue(), vv) + } + s.CloseMap() +} + +func serializeKeyConditions(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]types.Condition) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + s.WriteStruct(schema.MapValue()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseMap() +} + +func serializeMapAttributeValue(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]types.AttributeValue) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + serializeAttributeValue(s, schema.MapValue(), vv) + } + s.CloseMap() +} + +func serializePutItemInputAttributeMap(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]types.AttributeValue) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + serializeAttributeValue(s, schema.MapValue(), vv) + } + s.CloseMap() +} + +func serializeSecondaryIndexesCapacityMap(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]types.Capacity) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + s.WriteStruct(schema.MapValue()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseMap() +} + +func serializeVectorIndexesCapacityMap(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]types.VectorCapacity) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + s.WriteStruct(schema.MapValue()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseMap() +} + +func deserializeAttributeMap(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]types.AttributeValue) error { + *v = make(map[string]types.AttributeValue) + var vv types.AttributeValue + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero types.AttributeValue + (*v)[k] = zero + return nil + } + + if err := deserializeAttributeValue(d, s.MapValue(), &vv); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeAttributeUpdates(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]types.AttributeValueUpdate) error { + *v = make(map[string]types.AttributeValueUpdate) + var vv types.AttributeValueUpdate + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero types.AttributeValueUpdate + (*v)[k] = zero + return nil + } + + vv = types.AttributeValueUpdate{} + if err := vv.Deserialize(d); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeBatchGetRequestMap(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]types.KeysAndAttributes) error { + *v = make(map[string]types.KeysAndAttributes) + var vv types.KeysAndAttributes + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero types.KeysAndAttributes + (*v)[k] = zero + return nil + } + + vv = types.KeysAndAttributes{} + if err := vv.Deserialize(d); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeBatchGetResponseMap(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string][]map[string]types.AttributeValue) error { + *v = make(map[string][]map[string]types.AttributeValue) + var vv []map[string]types.AttributeValue + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero []map[string]types.AttributeValue + (*v)[k] = zero + return nil + } + + vv = nil + if err := deserializeItemList(d, s.MapValue(), &vv); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeBatchWriteItemRequestMap(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string][]types.WriteRequest) error { + *v = make(map[string][]types.WriteRequest) + var vv []types.WriteRequest + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero []types.WriteRequest + (*v)[k] = zero + return nil + } + + vv = nil + if err := deserializeWriteRequests(d, s.MapValue(), &vv); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeExpectedAttributeMap(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]types.ExpectedAttributeValue) error { + *v = make(map[string]types.ExpectedAttributeValue) + var vv types.ExpectedAttributeValue + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero types.ExpectedAttributeValue + (*v)[k] = zero + return nil + } + + vv = types.ExpectedAttributeValue{} + if err := vv.Deserialize(d); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeExpressionAttributeNameMap(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]string) error { + *v = make(map[string]string) + var vv string + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero string + (*v)[k] = zero + return nil + } + + if err := d.ReadString(s.MapValue(), &vv); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeExpressionAttributeValueMap(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]types.AttributeValue) error { + *v = make(map[string]types.AttributeValue) + var vv types.AttributeValue + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero types.AttributeValue + (*v)[k] = zero + return nil + } + + if err := deserializeAttributeValue(d, s.MapValue(), &vv); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeFilterConditionMap(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]types.Condition) error { + *v = make(map[string]types.Condition) + var vv types.Condition + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero types.Condition + (*v)[k] = zero + return nil + } + + vv = types.Condition{} + if err := vv.Deserialize(d); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeItemCollectionKeyAttributeMap(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]types.AttributeValue) error { + *v = make(map[string]types.AttributeValue) + var vv types.AttributeValue + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero types.AttributeValue + (*v)[k] = zero + return nil + } + + if err := deserializeAttributeValue(d, s.MapValue(), &vv); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeItemCollectionMetricsPerTable(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string][]types.ItemCollectionMetrics) error { + *v = make(map[string][]types.ItemCollectionMetrics) + var vv []types.ItemCollectionMetrics + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero []types.ItemCollectionMetrics + (*v)[k] = zero + return nil + } + + vv = nil + if err := deserializeItemCollectionMetricsMultiple(d, s.MapValue(), &vv); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeKey(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]types.AttributeValue) error { + *v = make(map[string]types.AttributeValue) + var vv types.AttributeValue + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero types.AttributeValue + (*v)[k] = zero + return nil + } + + if err := deserializeAttributeValue(d, s.MapValue(), &vv); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeKeyConditions(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]types.Condition) error { + *v = make(map[string]types.Condition) + var vv types.Condition + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero types.Condition + (*v)[k] = zero + return nil + } + + vv = types.Condition{} + if err := vv.Deserialize(d); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeMapAttributeValue(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]types.AttributeValue) error { + *v = make(map[string]types.AttributeValue) + var vv types.AttributeValue + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero types.AttributeValue + (*v)[k] = zero + return nil + } + + if err := deserializeAttributeValue(d, s.MapValue(), &vv); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializePutItemInputAttributeMap(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]types.AttributeValue) error { + *v = make(map[string]types.AttributeValue) + var vv types.AttributeValue + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero types.AttributeValue + (*v)[k] = zero + return nil + } + + if err := deserializeAttributeValue(d, s.MapValue(), &vv); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeSecondaryIndexesCapacityMap(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]types.Capacity) error { + *v = make(map[string]types.Capacity) + var vv types.Capacity + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero types.Capacity + (*v)[k] = zero + return nil + } + + vv = types.Capacity{} + if err := vv.Deserialize(d); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeVectorIndexesCapacityMap(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]types.VectorCapacity) error { + *v = make(map[string]types.VectorCapacity) + var vv types.VectorCapacity + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero types.VectorCapacity + (*v)[k] = zero + return nil + } + + vv = types.VectorCapacity{} + if err := vv.Deserialize(d); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} 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 4cf69274193..96da0657c65 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 @@ -296,6 +296,12 @@ type EndpointParameters struct { // // Parameter is required. ResourceArnList []string + + // Set to true for SearchVectors to route to the Search FQDN + // + // Parameter is + // required. + IsSearchOperation *bool } // ValidateRequired validates required parameters are set. @@ -326,11 +332,12 @@ func (p EndpointParameters) WithDefaults() EndpointParameters { const bddRoot int32 = 2 -var bddNodes = [201]int32{ - -1, 1, -1, 0, 5, 3, 1, 4, 100000025, 2, 100000001, 65, 1, 63, 6, 2, 52, 7, 3, 8, 100000025, 4, 51, 9, 6, 30, 10, 9, 11, 100000011, 10, 13, 12, 26, 100000019, 100000011, 11, 29, 14, 12, 15, 20, 13, 16, 20, 14, 17, 20, 15, 18, 20, 16, 19, 20, 17, 100000022, 20, 18, 21, 27, 19, 22, 27, 20, 23, 27, 21, 24, 27, 22, 25, 27, 23, 26, 27, 24, 100000023, 27, 25, 28, 29, 27, 100000024, 100000017, 26, 100000018, 100000011, 7, 31, 100000021, 9, 32, 100000020, 10, 34, 33, 26, 100000019, 100000020, 11, 50, 35, 12, 36, 41, 13, 37, 41, 14, 38, 41, 15, 39, 41, 16, 40, 41, 17, 100000014, 41, 18, 42, 48, 19, 43, 48, 20, 44, 48, 21, 45, 48, 22, 46, 48, 23, 47, 48, 24, 100000015, 48, 25, 49, 50, 27, 100000016, 100000017, 26, 100000018, 100000020, 6, 100000006, 100000007, 3, 53, 100000025, 4, 100000005, 54, 5, 56, 55, 6, 100000010, 100000013, 6, 60, 57, 9, 58, 59, 26, 100000008, 59, 28, 100000011, 100000012, 7, 61, 100000010, 9, 62, 100000009, 26, 100000008, 100000009, 2, 100000001, 64, 3, 66, 65, 6, 100000002, 100000004, 6, 100000002, 67, 8, 100000003, 100000004} +var bddNodes = [246]int32{ + -1, 1, -1, 0, 6, 3, 1, 4, 100000035, 2, 100000001, 5, 3, 100000002, 100000004, 1, 77, 7, 2, 61, 8, 3, 34, 9, 4, 10, 100000035, 5, 100000007, 11, 11, 12, 69, 12, 14, 13, 28, 100000025, 69, 13, 33, 15, 14, 16, 21, 15, 17, 21, 16, 18, 21, 17, 19, 21, 18, 20, 21, 19, 32, 21, 20, 22, 28, 21, 23, 28, 22, 24, 28, 23, 25, 28, 24, 26, 28, 25, 27, 28, 26, 31, 28, 27, 29, 33, 29, 30, 100000023, 31, 100000033, 100000034, 31, 100000031, 100000032, 31, 100000029, 100000030, 28, 100000024, 69, 4, 35, 100000035, 5, 100000006, 36, 9, 37, 100000028, 11, 38, 60, 12, 40, 39, 28, 100000025, 60, 13, 59, 41, 14, 42, 47, 15, 43, 47, 16, 44, 47, 17, 45, 47, 18, 46, 47, 19, 58, 47, 20, 48, 54, 21, 49, 54, 22, 50, 54, 23, 51, 54, 24, 52, 54, 25, 53, 54, 26, 57, 54, 27, 55, 59, 29, 56, 100000023, 31, 100000021, 100000022, 31, 100000019, 100000020, 31, 100000017, 100000018, 28, 100000024, 60, 31, 100000026, 100000027, 3, 70, 62, 4, 63, 100000035, 5, 100000005, 64, 6, 65, 100000016, 11, 66, 67, 28, 100000008, 67, 30, 69, 68, 31, 100000014, 100000015, 31, 100000012, 100000013, 4, 71, 100000035, 5, 100000005, 72, 6, 73, 100000011, 9, 74, 100000011, 11, 75, 76, 28, 100000008, 76, 31, 100000009, 100000010, 2, 100000001, 78, 3, 100000002, 79, 4, 80, 100000004, 7, 81, 100000004, 8, 100000003, 82, 10, 100000003, 100000004} type conditionContext struct { PartitionResult *awsrulesfn.PartitionConfig + parsedEndpoint *rulesfn.URL ParsedArn_ssa_2 *awsrulesfn.ARN FirstArn *string ParsedArn_ssa_1 *awsrulesfn.ARN @@ -345,80 +352,102 @@ func evalCondition(idx int, params *EndpointParameters, c *conditionContext) boo case 2: return *params.UseFIPS == true case 3: + return *params.UseDualStack == true + case 4: if v := awsrulesfn.GetPartition(*params.Region); v != nil { c.PartitionResult = v return true } return false - case 4: - return *params.Region == "local" case 5: - return c.PartitionResult.SupportsFIPS == true + return *params.Region == "local" case 6: - return *params.UseDualStack == true + return c.PartitionResult.SupportsFIPS == true case 7: - return c.PartitionResult.SupportsDualStack == true + if v := rulesfn.ParseURL(*params.Endpoint); v != nil { + c.parsedEndpoint = v + return true + } + return false case 8: return func() string { var out strings.Builder - out.WriteString("https://dynamodb.") + out.WriteString("dynamodb.") out.WriteString(*params.Region) out.WriteString(".") out.WriteString(c.PartitionResult.DualStackDnsSuffix) return out.String() - }() == *params.Endpoint + }() == c.parsedEndpoint.Authority case 9: - return params.AccountIdEndpointMode != nil + return c.PartitionResult.SupportsDualStack == true case 10: - return c.PartitionResult.Name == "aws" + return func() string { + var out strings.Builder + out.WriteString("search-dynamodb.") + out.WriteString(*params.Region) + out.WriteString(".") + out.WriteString(c.PartitionResult.DualStackDnsSuffix) + return out.String() + }() == c.parsedEndpoint.Authority case 11: - return *params.AccountIdEndpointMode == "disabled" + return params.AccountIdEndpointMode != nil case 12: - return params.ResourceArn != nil + return c.PartitionResult.Name == "aws" case 13: + return *params.AccountIdEndpointMode == "disabled" + case 14: + return params.ResourceArn != nil + case 15: if v := awsrulesfn.ParseARN(*params.ResourceArn); v != nil { c.ParsedArn_ssa_2 = v return true } return false - case 14: - return c.ParsedArn_ssa_2.Region == *params.Region - case 15: - return c.ParsedArn_ssa_2.Service == "dynamodb" case 16: - return rulesfn.IsValidHostLabel(c.ParsedArn_ssa_2.AccountId, false) + return c.ParsedArn_ssa_2.Region == *params.Region case 17: - return rulesfn.IsValidHostLabel(c.ParsedArn_ssa_2.Region, false) + return c.ParsedArn_ssa_2.Service == "dynamodb" case 18: - return params.ResourceArnList != nil + return rulesfn.IsValidHostLabel(c.ParsedArn_ssa_2.Region, false) case 19: + return rulesfn.IsValidHostLabel(c.ParsedArn_ssa_2.AccountId, false) + case 20: + return params.ResourceArnList != nil + case 21: if v := rulesfn.StringSlice(params.ResourceArnList).Get(0); v != nil { c.FirstArn = v return true } return false - case 20: + case 22: if v := awsrulesfn.ParseARN(*c.FirstArn); v != nil { c.ParsedArn_ssa_1 = v return true } return false - case 21: + case 23: return c.ParsedArn_ssa_1.Region == *params.Region - case 22: + case 24: return c.ParsedArn_ssa_1.Service == "dynamodb" - case 23: + case 25: return rulesfn.IsValidHostLabel(c.ParsedArn_ssa_1.AccountId, false) - case 24: + case 26: return rulesfn.IsValidHostLabel(c.ParsedArn_ssa_1.Region, false) - case 25: + case 27: return params.AccountId != nil - case 26: + case 28: return *params.AccountIdEndpointMode == "required" - case 27: + case 29: return rulesfn.IsValidHostLabel(*params.AccountId, false) - case 28: + case 30: return c.PartitionResult.Name == "aws-us-gov" + case 31: + return func() bool { + if v := params.IsSearchOperation; v != nil { + return *v + } + return false + }() == true } return false } @@ -463,10 +492,10 @@ func resolveResult(idx int32, params *EndpointParameters, c *conditionContext) ( SchemeID: "sigv4", SignerProperties: func() smithy.Properties { var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + smithyhttp.SetSigV4SigningName(&sp, "dynamodb") smithyhttp.SetSigV4ASigningName(&sp, "dynamodb") - - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") return sp }(), }, @@ -479,7 +508,7 @@ func resolveResult(idx int32, params *EndpointParameters, c *conditionContext) ( case 9: uriString := func() string { var out strings.Builder - out.WriteString("https://dynamodb-fips.") + out.WriteString("https://search-dynamodb-fips.") out.WriteString(*params.Region) out.WriteString(".") out.WriteString(c.PartitionResult.DualStackDnsSuffix) @@ -494,8 +523,42 @@ func resolveResult(idx int32, params *EndpointParameters, c *conditionContext) ( Headers: http.Header{}, }, nil case 10: - return smithyendpoints.Endpoint{}, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") + uriString := func() string { + var out strings.Builder + out.WriteString("https://dynamodb-fips.") + out.WriteString(*params.Region) + out.WriteString(".") + out.WriteString(c.PartitionResult.DualStackDnsSuffix) + return out.String() + }() + uri, err := url.Parse(uriString) + if err != nil { + return smithyendpoints.Endpoint{}, fmt.Errorf("Failed to parse uri: %s", uriString) + } + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil case 11: + return smithyendpoints.Endpoint{}, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") + case 12: + uriString := func() string { + var out strings.Builder + out.WriteString("https://search-dynamodb.") + out.WriteString(*params.Region) + out.WriteString(".") + out.WriteString(c.PartitionResult.DnsSuffix) + return out.String() + }() + uri, err := url.Parse(uriString) + if err != nil { + return smithyendpoints.Endpoint{}, fmt.Errorf("Failed to parse uri: %s", uriString) + } + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + case 13: uriString := func() string { var out strings.Builder out.WriteString("https://dynamodb.") @@ -512,7 +575,24 @@ func resolveResult(idx int32, params *EndpointParameters, c *conditionContext) ( URI: *uri, Headers: http.Header{}, }, nil - case 12: + case 14: + uriString := func() string { + var out strings.Builder + out.WriteString("https://search-dynamodb-fips.") + out.WriteString(*params.Region) + out.WriteString(".") + out.WriteString(c.PartitionResult.DnsSuffix) + return out.String() + }() + uri, err := url.Parse(uriString) + if err != nil { + return smithyendpoints.Endpoint{}, fmt.Errorf("Failed to parse uri: %s", uriString) + } + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + case 15: uriString := func() string { var out strings.Builder out.WriteString("https://dynamodb-fips.") @@ -529,9 +609,35 @@ func resolveResult(idx int32, params *EndpointParameters, c *conditionContext) ( URI: *uri, Headers: http.Header{}, }, nil - case 13: + case 16: return smithyendpoints.Endpoint{}, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") - case 14: + case 17: + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(c.ParsedArn_ssa_2.AccountId) + out.WriteString(".search-ddb.") + out.WriteString(*params.Region) + out.WriteString(".") + out.WriteString(c.PartitionResult.DualStackDnsSuffix) + return out.String() + }() + uri, err := url.Parse(uriString) + if err != nil { + return smithyendpoints.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 + case 18: uriString := func() string { var out strings.Builder out.WriteString("https://") @@ -557,7 +663,33 @@ func resolveResult(idx int32, params *EndpointParameters, c *conditionContext) ( return out }(), }, nil - case 15: + case 19: + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(c.ParsedArn_ssa_1.AccountId) + out.WriteString(".search-ddb.") + out.WriteString(*params.Region) + out.WriteString(".") + out.WriteString(c.PartitionResult.DualStackDnsSuffix) + return out.String() + }() + uri, err := url.Parse(uriString) + if err != nil { + return smithyendpoints.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 + case 20: uriString := func() string { var out strings.Builder out.WriteString("https://") @@ -583,7 +715,33 @@ func resolveResult(idx int32, params *EndpointParameters, c *conditionContext) ( return out }(), }, nil - case 16: + case 21: + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(*params.AccountId) + out.WriteString(".search-ddb.") + out.WriteString(*params.Region) + out.WriteString(".") + out.WriteString(c.PartitionResult.DualStackDnsSuffix) + return out.String() + }() + uri, err := url.Parse(uriString) + if err != nil { + return smithyendpoints.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 + case 22: uriString := func() string { var out strings.Builder out.WriteString("https://") @@ -609,13 +767,30 @@ func resolveResult(idx int32, params *EndpointParameters, c *conditionContext) ( return out }(), }, nil - case 17: + case 23: return smithyendpoints.Endpoint{}, fmt.Errorf("endpoint rule error, %s", "Credentials-sourced account ID parameter is invalid") - case 18: + case 24: return smithyendpoints.Endpoint{}, fmt.Errorf("endpoint rule error, %s", "AccountIdEndpointMode is required but no AccountID was provided or able to be loaded") - case 19: + case 25: return smithyendpoints.Endpoint{}, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: AccountIdEndpointMode is required but account endpoints are not supported in this partition") - case 20: + case 26: + uriString := func() string { + var out strings.Builder + out.WriteString("https://search-dynamodb.") + out.WriteString(*params.Region) + out.WriteString(".") + out.WriteString(c.PartitionResult.DualStackDnsSuffix) + return out.String() + }() + uri, err := url.Parse(uriString) + if err != nil { + return smithyendpoints.Endpoint{}, fmt.Errorf("Failed to parse uri: %s", uriString) + } + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + case 27: uriString := func() string { var out strings.Builder out.WriteString("https://dynamodb.") @@ -632,9 +807,35 @@ func resolveResult(idx int32, params *EndpointParameters, c *conditionContext) ( URI: *uri, Headers: http.Header{}, }, nil - case 21: + case 28: return smithyendpoints.Endpoint{}, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") - case 22: + case 29: + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(c.ParsedArn_ssa_2.AccountId) + out.WriteString(".search-ddb.") + out.WriteString(*params.Region) + out.WriteString(".") + out.WriteString(c.PartitionResult.DnsSuffix) + return out.String() + }() + uri, err := url.Parse(uriString) + if err != nil { + return smithyendpoints.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 + case 30: uriString := func() string { var out strings.Builder out.WriteString("https://") @@ -660,7 +861,33 @@ func resolveResult(idx int32, params *EndpointParameters, c *conditionContext) ( return out }(), }, nil - case 23: + case 31: + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(c.ParsedArn_ssa_1.AccountId) + out.WriteString(".search-ddb.") + out.WriteString(*params.Region) + out.WriteString(".") + out.WriteString(c.PartitionResult.DnsSuffix) + return out.String() + }() + uri, err := url.Parse(uriString) + if err != nil { + return smithyendpoints.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 + case 32: uriString := func() string { var out strings.Builder out.WriteString("https://") @@ -686,7 +913,33 @@ func resolveResult(idx int32, params *EndpointParameters, c *conditionContext) ( return out }(), }, nil - case 24: + case 33: + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(*params.AccountId) + out.WriteString(".search-ddb.") + out.WriteString(*params.Region) + out.WriteString(".") + out.WriteString(c.PartitionResult.DnsSuffix) + return out.String() + }() + uri, err := url.Parse(uriString) + if err != nil { + return smithyendpoints.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 + case 34: uriString := func() string { var out strings.Builder out.WriteString("https://") @@ -712,7 +965,7 @@ func resolveResult(idx int32, params *EndpointParameters, c *conditionContext) ( return out }(), }, nil - case 25: + case 35: return smithyendpoints.Endpoint{}, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") } return smithyendpoints.Endpoint{}, fmt.Errorf("endpoint rule error, invalid result index: %d", idx) 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 f306b0cb12e..a185fb75f21 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 @@ -54,6 +54,7 @@ "api_op_RestoreTableFromBackup.go", "api_op_RestoreTableToPointInTime.go", "api_op_Scan.go", + "api_op_SearchVectors.go", "api_op_TagResource.go", "api_op_TransactGetItems.go", "api_op_TransactWriteItems.go", @@ -68,7 +69,7 @@ "api_op_UpdateTableReplicaAutoScaling.go", "api_op_UpdateTimeToLive.go", "auth.go", - "deserializers.go", + "common_serde.go", "doc.go", "endpoints.go", "endpoints_config_test.go", @@ -77,9 +78,14 @@ "internal/endpoints/endpoints.go", "internal/endpoints/endpoints_test.go", "options.go", - "serializers.go", + "request_snapshot_test.go", + "response_snapshot_test.go", + "response_snapshot_update_test.go", + "schemas/schemas.go", "snapshot_test.go", "sra_operation_order_test.go", + "type_registry.go", + "types/common_serde.go", "types/enums.go", "types/errors.go", "types/types.go", 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 5c7766d0f2a..d69d70d8f72 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.59.1" +const goModuleVersion = "1.70.3" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/options.go index 5db1ed2b917..be3cbb9aff2 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/options.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/options.go @@ -47,6 +47,11 @@ type Options struct { // clients initial default settings. DefaultsMode aws.DefaultsMode + // Disables SDK clock skew correction. When set, the SDK will not adjust request + // signing timestamps to compensate for clock drift between the client and the + // service. + DisableClockSkewCorrection bool + // Allows you to disable the client's validation of response integrity using CRC32 // checksum. Enabled by default. DisableValidateResponseChecksum bool @@ -132,6 +137,8 @@ type Options struct { // Currently does not support per operation call overrides, may in the future. resolvedDefaultsMode aws.DefaultsMode + Protocol smithyhttp.ClientProtocol + // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. HTTPClient HTTPClient diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas/schemas.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas/schemas.go new file mode 100644 index 00000000000..81a96431023 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas/schemas.go @@ -0,0 +1,7250 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package schemas + +import ( + smithy "github.com/aws/smithy-go" + smithyprelude "github.com/aws/smithy-go/prelude" + smithytraits "github.com/aws/smithy-go/traits" +) + +var BatchExecuteStatement = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BatchExecuteStatement", +}, smithy.ShapeTypeOperation, 0) + +var BatchGetItem = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BatchGetItem", +}, smithy.ShapeTypeOperation, 0) + +var BatchWriteItem = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BatchWriteItem", +}, smithy.ShapeTypeOperation, 0) + +var CreateBackup = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "CreateBackup", +}, smithy.ShapeTypeOperation, 0) + +var CreateGlobalTable = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "CreateGlobalTable", +}, smithy.ShapeTypeOperation, 0) + +var CreateTable = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "CreateTable", +}, smithy.ShapeTypeOperation, 0) + +var DeleteBackup = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DeleteBackup", +}, smithy.ShapeTypeOperation, 0) + +var DeleteItem = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DeleteItem", +}, smithy.ShapeTypeOperation, 0) + +var DeleteResourcePolicy = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DeleteResourcePolicy", +}, smithy.ShapeTypeOperation, 0) + +var DeleteTable = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DeleteTable", +}, smithy.ShapeTypeOperation, 0) + +var DescribeBackup = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeBackup", +}, smithy.ShapeTypeOperation, 0) + +var DescribeContinuousBackups = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeContinuousBackups", +}, smithy.ShapeTypeOperation, 0) + +var DescribeContributorInsights = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeContributorInsights", +}, smithy.ShapeTypeOperation, 0) + +var DescribeEndpoints = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeEndpoints", +}, smithy.ShapeTypeOperation, 0) + +var DescribeExport = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeExport", +}, smithy.ShapeTypeOperation, 0) + +var DescribeGlobalTable = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeGlobalTable", +}, smithy.ShapeTypeOperation, 0) + +var DescribeGlobalTableSettings = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeGlobalTableSettings", +}, smithy.ShapeTypeOperation, 0) + +var DescribeImport = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeImport", +}, smithy.ShapeTypeOperation, 0) + +var DescribeKinesisStreamingDestination = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeKinesisStreamingDestination", +}, smithy.ShapeTypeOperation, 0) + +var DescribeLimits = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeLimits", +}, smithy.ShapeTypeOperation, 0) + +var DescribeTable = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeTable", +}, smithy.ShapeTypeOperation, 0) + +var DescribeTableReplicaAutoScaling = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeTableReplicaAutoScaling", +}, smithy.ShapeTypeOperation, 0) + +var DescribeTimeToLive = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeTimeToLive", +}, smithy.ShapeTypeOperation, 0) + +var DisableKinesisStreamingDestination = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DisableKinesisStreamingDestination", +}, smithy.ShapeTypeOperation, 0) + +var EnableKinesisStreamingDestination = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "EnableKinesisStreamingDestination", +}, smithy.ShapeTypeOperation, 0) + +var ExecuteStatement = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExecuteStatement", +}, smithy.ShapeTypeOperation, 0) + +var ExecuteTransaction = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExecuteTransaction", +}, smithy.ShapeTypeOperation, 0) + +var ExportTableToPointInTime = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExportTableToPointInTime", +}, smithy.ShapeTypeOperation, 0) + +var GetItem = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GetItem", +}, smithy.ShapeTypeOperation, 0) + +var GetResourcePolicy = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GetResourcePolicy", +}, smithy.ShapeTypeOperation, 0) + +var ImportTable = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ImportTable", +}, smithy.ShapeTypeOperation, 0) + +var ListBackups = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ListBackups", +}, smithy.ShapeTypeOperation, 0) + +var ListContributorInsights = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ListContributorInsights", +}, smithy.ShapeTypeOperation, 0) + +var ListExports = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ListExports", +}, smithy.ShapeTypeOperation, 0) + +var ListGlobalTables = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ListGlobalTables", +}, smithy.ShapeTypeOperation, 0) + +var ListImports = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ListImports", +}, smithy.ShapeTypeOperation, 0) + +var ListTables = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ListTables", +}, smithy.ShapeTypeOperation, 0) + +var ListTagsOfResource = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ListTagsOfResource", +}, smithy.ShapeTypeOperation, 0) + +var PutItem = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "PutItem", +}, smithy.ShapeTypeOperation, 0) + +var PutResourcePolicy = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "PutResourcePolicy", +}, smithy.ShapeTypeOperation, 0) + +var Query = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "Query", +}, smithy.ShapeTypeOperation, 0) + +var RestoreTableFromBackup = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "RestoreTableFromBackup", +}, smithy.ShapeTypeOperation, 0) + +var RestoreTableToPointInTime = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "RestoreTableToPointInTime", +}, smithy.ShapeTypeOperation, 0) + +var Scan = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "Scan", +}, smithy.ShapeTypeOperation, 0) + +var SearchVectors = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "SearchVectors", +}, smithy.ShapeTypeOperation, 0) + +var TagResource = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TagResource", +}, smithy.ShapeTypeOperation, 0) + +var TransactGetItems = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TransactGetItems", +}, smithy.ShapeTypeOperation, 0) + +var TransactWriteItems = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TransactWriteItems", +}, smithy.ShapeTypeOperation, 0) + +var UntagResource = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UntagResource", +}, smithy.ShapeTypeOperation, 0) + +var UpdateContinuousBackups = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateContinuousBackups", +}, smithy.ShapeTypeOperation, 0) + +var UpdateContributorInsights = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateContributorInsights", +}, smithy.ShapeTypeOperation, 0) + +var UpdateGlobalTable = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateGlobalTable", +}, smithy.ShapeTypeOperation, 0) + +var UpdateGlobalTableSettings = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateGlobalTableSettings", +}, smithy.ShapeTypeOperation, 0) + +var UpdateItem = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateItem", +}, smithy.ShapeTypeOperation, 0) + +var UpdateKinesisStreamingDestination = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateKinesisStreamingDestination", +}, smithy.ShapeTypeOperation, 0) + +var UpdateTable = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateTable", +}, smithy.ShapeTypeOperation, 0) + +var UpdateTableReplicaAutoScaling = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateTableReplicaAutoScaling", +}, smithy.ShapeTypeOperation, 0) + +var UpdateTimeToLive = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateTimeToLive", +}, smithy.ShapeTypeOperation, 0) + +var _DynamoDB_20120810 = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DynamoDB_20120810", +}, smithy.ShapeTypeService, 0, &smithytraits.XMLNamespace{URI: "http://dynamodb.amazonaws.com/doc/2012-08-10/"}) + +var DynamoDB_20120810 = smithy.NewServiceSchema(_DynamoDB_20120810, "2012-08-10") + +var ApproximateCreationDateTimePrecision = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ApproximateCreationDateTimePrecision", +}, smithy.ShapeTypeEnum, 2) +var ApproximateCreationDateTimePrecision_MILLISECOND *smithy.Schema + +var ApproximateCreationDateTimePrecision_MICROSECOND *smithy.Schema + +var _ArchivalReason = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ArchivalReason", +}, smithy.ShapeTypeString, 0) + +var ArchivalSummary = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ArchivalSummary", +}, smithy.ShapeTypeStructure, 3) +var ArchivalSummary_ArchivalDateTime *smithy.Schema + +var ArchivalSummary_ArchivalReason *smithy.Schema + +var ArchivalSummary_ArchivalBackupArn *smithy.Schema + +var AttributeAction = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "AttributeAction", +}, smithy.ShapeTypeEnum, 3) +var AttributeAction_ADD *smithy.Schema + +var AttributeAction_PUT *smithy.Schema + +var AttributeAction_DELETE *smithy.Schema + +var AttributeDefinition = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "AttributeDefinition", +}, smithy.ShapeTypeStructure, 2) +var AttributeDefinition_AttributeName *smithy.Schema + +var AttributeDefinition_AttributeType *smithy.Schema + +var _AttributeDefinitions = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "AttributeDefinitions", +}, smithy.ShapeTypeList, 1) +var _AttributeDefinitions_member *smithy.Schema + +var _AttributeMap = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "AttributeMap", +}, smithy.ShapeTypeMap, 2) +var _AttributeMap_key *smithy.Schema + +var _AttributeMap_value *smithy.Schema + +var _AttributeName = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "AttributeName", +}, smithy.ShapeTypeString, 0) + +var _AttributeNameList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "AttributeNameList", +}, smithy.ShapeTypeList, 1) +var _AttributeNameList_member *smithy.Schema + +var _AttributeUpdates = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "AttributeUpdates", +}, smithy.ShapeTypeMap, 2) +var _AttributeUpdates_key *smithy.Schema + +var _AttributeUpdates_value *smithy.Schema + +var AttributeValue = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "AttributeValue", +}, smithy.ShapeTypeUnion, 10) +var AttributeValue_S *smithy.Schema + +var AttributeValue_N *smithy.Schema + +var AttributeValue_B *smithy.Schema + +var AttributeValue_SS *smithy.Schema + +var AttributeValue_NS *smithy.Schema + +var AttributeValue_BS *smithy.Schema + +var AttributeValue_M *smithy.Schema + +var AttributeValue_L *smithy.Schema + +var AttributeValue_NULL *smithy.Schema + +var AttributeValue_BOOL *smithy.Schema + +var _AttributeValueList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "AttributeValueList", +}, smithy.ShapeTypeList, 1) +var _AttributeValueList_member *smithy.Schema + +var AttributeValueUpdate = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "AttributeValueUpdate", +}, smithy.ShapeTypeStructure, 2) +var AttributeValueUpdate_Value *smithy.Schema + +var AttributeValueUpdate_Action *smithy.Schema + +var AutoScalingPolicyDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "AutoScalingPolicyDescription", +}, smithy.ShapeTypeStructure, 2) +var AutoScalingPolicyDescription_PolicyName *smithy.Schema + +var AutoScalingPolicyDescription_TargetTrackingScalingPolicyConfiguration *smithy.Schema + +var _AutoScalingPolicyDescriptionList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "AutoScalingPolicyDescriptionList", +}, smithy.ShapeTypeList, 1) +var _AutoScalingPolicyDescriptionList_member *smithy.Schema + +var _AutoScalingPolicyName = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "AutoScalingPolicyName", +}, smithy.ShapeTypeString, 0) + +var AutoScalingPolicyUpdate = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "AutoScalingPolicyUpdate", +}, smithy.ShapeTypeStructure, 2) +var AutoScalingPolicyUpdate_PolicyName *smithy.Schema + +var AutoScalingPolicyUpdate_TargetTrackingScalingPolicyConfiguration *smithy.Schema + +var _AutoScalingRoleArn = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "AutoScalingRoleArn", +}, smithy.ShapeTypeString, 0) + +var AutoScalingSettingsDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "AutoScalingSettingsDescription", +}, smithy.ShapeTypeStructure, 5) +var AutoScalingSettingsDescription_MinimumUnits *smithy.Schema + +var AutoScalingSettingsDescription_MaximumUnits *smithy.Schema + +var AutoScalingSettingsDescription_AutoScalingDisabled *smithy.Schema + +var AutoScalingSettingsDescription_AutoScalingRoleArn *smithy.Schema + +var AutoScalingSettingsDescription_ScalingPolicies *smithy.Schema + +var AutoScalingSettingsUpdate = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "AutoScalingSettingsUpdate", +}, smithy.ShapeTypeStructure, 5) +var AutoScalingSettingsUpdate_MinimumUnits *smithy.Schema + +var AutoScalingSettingsUpdate_MaximumUnits *smithy.Schema + +var AutoScalingSettingsUpdate_AutoScalingDisabled *smithy.Schema + +var AutoScalingSettingsUpdate_AutoScalingRoleArn *smithy.Schema + +var AutoScalingSettingsUpdate_ScalingPolicyUpdate *smithy.Schema + +var AutoScalingTargetTrackingScalingPolicyConfigurationDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "AutoScalingTargetTrackingScalingPolicyConfigurationDescription", +}, smithy.ShapeTypeStructure, 4) +var AutoScalingTargetTrackingScalingPolicyConfigurationDescription_DisableScaleIn *smithy.Schema + +var AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleInCooldown *smithy.Schema + +var AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleOutCooldown *smithy.Schema + +var AutoScalingTargetTrackingScalingPolicyConfigurationDescription_TargetValue *smithy.Schema + +var AutoScalingTargetTrackingScalingPolicyConfigurationUpdate = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "AutoScalingTargetTrackingScalingPolicyConfigurationUpdate", +}, smithy.ShapeTypeStructure, 4) +var AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_DisableScaleIn *smithy.Schema + +var AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleInCooldown *smithy.Schema + +var AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleOutCooldown *smithy.Schema + +var AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_TargetValue *smithy.Schema + +var _AvailabilityErrorMessage = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "AvailabilityErrorMessage", +}, smithy.ShapeTypeString, 0) + +var _Backfilling = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "Backfilling", +}, smithy.ShapeTypeBoolean, 0) + +var _BackupArn = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BackupArn", +}, smithy.ShapeTypeString, 0) + +var _BackupCreationDateTime = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BackupCreationDateTime", +}, smithy.ShapeTypeTimestamp, 0) + +var BackupDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BackupDescription", +}, smithy.ShapeTypeStructure, 3) +var BackupDescription_BackupDetails *smithy.Schema + +var BackupDescription_SourceTableDetails *smithy.Schema + +var BackupDescription_SourceTableFeatureDetails *smithy.Schema + +var BackupDetails = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BackupDetails", +}, smithy.ShapeTypeStructure, 7) +var BackupDetails_BackupArn *smithy.Schema + +var BackupDetails_BackupName *smithy.Schema + +var BackupDetails_BackupSizeBytes *smithy.Schema + +var BackupDetails_BackupStatus *smithy.Schema + +var BackupDetails_BackupType *smithy.Schema + +var BackupDetails_BackupCreationDateTime *smithy.Schema + +var BackupDetails_BackupExpiryDateTime *smithy.Schema + +var BackupInUseException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BackupInUseException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}) +var BackupInUseException_message *smithy.Schema + +var _BackupName = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BackupName", +}, smithy.ShapeTypeString, 0) + +var BackupNotFoundException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BackupNotFoundException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}) +var BackupNotFoundException_message *smithy.Schema + +var _BackupsInputLimit = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BackupsInputLimit", +}, smithy.ShapeTypeInteger, 0) + +var _BackupSizeBytes = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BackupSizeBytes", +}, smithy.ShapeTypeLong, 0) + +var BackupStatus = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BackupStatus", +}, smithy.ShapeTypeEnum, 3) +var BackupStatus_CREATING *smithy.Schema + +var BackupStatus_DELETED *smithy.Schema + +var BackupStatus_AVAILABLE *smithy.Schema + +var _BackupSummaries = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BackupSummaries", +}, smithy.ShapeTypeList, 1) +var _BackupSummaries_member *smithy.Schema + +var BackupSummary = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BackupSummary", +}, smithy.ShapeTypeStructure, 10) +var BackupSummary_TableName *smithy.Schema + +var BackupSummary_TableId *smithy.Schema + +var BackupSummary_TableArn *smithy.Schema + +var BackupSummary_BackupArn *smithy.Schema + +var BackupSummary_BackupName *smithy.Schema + +var BackupSummary_BackupCreationDateTime *smithy.Schema + +var BackupSummary_BackupExpiryDateTime *smithy.Schema + +var BackupSummary_BackupStatus *smithy.Schema + +var BackupSummary_BackupType *smithy.Schema + +var BackupSummary_BackupSizeBytes *smithy.Schema + +var BackupType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BackupType", +}, smithy.ShapeTypeEnum, 3) +var BackupType_USER *smithy.Schema + +var BackupType_SYSTEM *smithy.Schema + +var BackupType_AWS_BACKUP *smithy.Schema + +var BackupTypeFilter = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BackupTypeFilter", +}, smithy.ShapeTypeEnum, 4) +var BackupTypeFilter_USER *smithy.Schema + +var BackupTypeFilter_SYSTEM *smithy.Schema + +var BackupTypeFilter_AWS_BACKUP *smithy.Schema + +var BackupTypeFilter_ALL *smithy.Schema + +var _BatchGetRequestMap = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BatchGetRequestMap", +}, smithy.ShapeTypeMap, 2) +var _BatchGetRequestMap_key *smithy.Schema + +var _BatchGetRequestMap_value *smithy.Schema + +var _BatchGetResponseMap = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BatchGetResponseMap", +}, smithy.ShapeTypeMap, 2) +var _BatchGetResponseMap_key *smithy.Schema + +var _BatchGetResponseMap_value *smithy.Schema + +var BatchStatementError = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BatchStatementError", +}, smithy.ShapeTypeStructure, 3) +var BatchStatementError_Code *smithy.Schema + +var BatchStatementError_Message *smithy.Schema + +var BatchStatementError_Item *smithy.Schema + +var BatchStatementErrorCodeEnum = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BatchStatementErrorCodeEnum", +}, smithy.ShapeTypeEnum, 11) +var BatchStatementErrorCodeEnum_ConditionalCheckFailed *smithy.Schema + +var BatchStatementErrorCodeEnum_ItemCollectionSizeLimitExceeded *smithy.Schema + +var BatchStatementErrorCodeEnum_RequestLimitExceeded *smithy.Schema + +var BatchStatementErrorCodeEnum_ValidationError *smithy.Schema + +var BatchStatementErrorCodeEnum_ProvisionedThroughputExceeded *smithy.Schema + +var BatchStatementErrorCodeEnum_TransactionConflict *smithy.Schema + +var BatchStatementErrorCodeEnum_ThrottlingError *smithy.Schema + +var BatchStatementErrorCodeEnum_InternalServerError *smithy.Schema + +var BatchStatementErrorCodeEnum_ResourceNotFound *smithy.Schema + +var BatchStatementErrorCodeEnum_AccessDenied *smithy.Schema + +var BatchStatementErrorCodeEnum_DuplicateItem *smithy.Schema + +var BatchStatementRequest = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BatchStatementRequest", +}, smithy.ShapeTypeStructure, 4) +var BatchStatementRequest_Statement *smithy.Schema + +var BatchStatementRequest_Parameters *smithy.Schema + +var BatchStatementRequest_ConsistentRead *smithy.Schema + +var BatchStatementRequest_ReturnValuesOnConditionCheckFailure *smithy.Schema + +var BatchStatementResponse = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BatchStatementResponse", +}, smithy.ShapeTypeStructure, 3) +var BatchStatementResponse_Error *smithy.Schema + +var BatchStatementResponse_TableName *smithy.Schema + +var BatchStatementResponse_Item *smithy.Schema + +var _BatchWriteItemRequestMap = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BatchWriteItemRequestMap", +}, smithy.ShapeTypeMap, 2) +var _BatchWriteItemRequestMap_key *smithy.Schema + +var _BatchWriteItemRequestMap_value *smithy.Schema + +var _BilledSizeBytes = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BilledSizeBytes", +}, smithy.ShapeTypeLong, 0) + +var BillingMode = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BillingMode", +}, smithy.ShapeTypeEnum, 2) +var BillingMode_PROVISIONED *smithy.Schema + +var BillingMode_PAY_PER_REQUEST *smithy.Schema + +var BillingModeSummary = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BillingModeSummary", +}, smithy.ShapeTypeStructure, 2) +var BillingModeSummary_BillingMode *smithy.Schema + +var BillingModeSummary_LastUpdateToPayPerRequestDateTime *smithy.Schema + +var _BinaryAttributeValue = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BinaryAttributeValue", +}, smithy.ShapeTypeBlob, 0) + +var _BinarySetAttributeValue = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BinarySetAttributeValue", +}, smithy.ShapeTypeList, 1) +var _BinarySetAttributeValue_member *smithy.Schema + +var _BooleanAttributeValue = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BooleanAttributeValue", +}, smithy.ShapeTypeBoolean, 0) + +var _BooleanObject = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BooleanObject", +}, smithy.ShapeTypeBoolean, 0) + +var CancellationReason = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "CancellationReason", +}, smithy.ShapeTypeStructure, 3) +var CancellationReason_Item *smithy.Schema + +var CancellationReason_Code *smithy.Schema + +var CancellationReason_Message *smithy.Schema + +var _CancellationReasonList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "CancellationReasonList", +}, smithy.ShapeTypeList, 1) +var _CancellationReasonList_member *smithy.Schema + +var Capacity = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "Capacity", +}, smithy.ShapeTypeStructure, 3) +var Capacity_ReadCapacityUnits *smithy.Schema + +var Capacity_WriteCapacityUnits *smithy.Schema + +var Capacity_CapacityUnits *smithy.Schema + +var _ClientRequestToken = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ClientRequestToken", +}, smithy.ShapeTypeString, 0) + +var _ClientToken = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ClientToken", +}, smithy.ShapeTypeString, 0) + +var _CloudWatchLogGroupArn = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "CloudWatchLogGroupArn", +}, smithy.ShapeTypeString, 0) + +var _Code = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "Code", +}, smithy.ShapeTypeString, 0) + +var ComparisonOperator = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ComparisonOperator", +}, smithy.ShapeTypeEnum, 13) +var ComparisonOperator_EQ *smithy.Schema + +var ComparisonOperator_NE *smithy.Schema + +var ComparisonOperator_IN *smithy.Schema + +var ComparisonOperator_LE *smithy.Schema + +var ComparisonOperator_LT *smithy.Schema + +var ComparisonOperator_GE *smithy.Schema + +var ComparisonOperator_GT *smithy.Schema + +var ComparisonOperator_BETWEEN *smithy.Schema + +var ComparisonOperator_NOT_NULL *smithy.Schema + +var ComparisonOperator_NULL *smithy.Schema + +var ComparisonOperator_CONTAINS *smithy.Schema + +var ComparisonOperator_NOT_CONTAINS *smithy.Schema + +var ComparisonOperator_BEGINS_WITH *smithy.Schema + +var Condition = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "Condition", +}, smithy.ShapeTypeStructure, 2) +var Condition_AttributeValueList *smithy.Schema + +var Condition_ComparisonOperator *smithy.Schema + +var ConditionalCheckFailedException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ConditionalCheckFailedException", +}, smithy.ShapeTypeStructure, 2, &smithytraits.Error{Type: "client"}) +var ConditionalCheckFailedException_message *smithy.Schema + +var ConditionalCheckFailedException_Item *smithy.Schema + +var ConditionalOperator = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ConditionalOperator", +}, smithy.ShapeTypeEnum, 2) +var ConditionalOperator_AND *smithy.Schema + +var ConditionalOperator_OR *smithy.Schema + +var ConditionCheck = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ConditionCheck", +}, smithy.ShapeTypeStructure, 6) +var ConditionCheck_Key *smithy.Schema + +var ConditionCheck_TableName *smithy.Schema + +var ConditionCheck_ConditionExpression *smithy.Schema + +var ConditionCheck_ExpressionAttributeNames *smithy.Schema + +var ConditionCheck_ExpressionAttributeValues *smithy.Schema + +var ConditionCheck_ReturnValuesOnConditionCheckFailure *smithy.Schema + +var _ConditionExpression = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ConditionExpression", +}, smithy.ShapeTypeString, 0) + +var _ConfirmRemoveSelfResourceAccess = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ConfirmRemoveSelfResourceAccess", +}, smithy.ShapeTypeBoolean, 0) + +var _ConsistentRead = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ConsistentRead", +}, smithy.ShapeTypeBoolean, 0) + +var ConsumedCapacity = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ConsumedCapacity", +}, smithy.ShapeTypeStructure, 8) +var ConsumedCapacity_TableName *smithy.Schema + +var ConsumedCapacity_CapacityUnits *smithy.Schema + +var ConsumedCapacity_ReadCapacityUnits *smithy.Schema + +var ConsumedCapacity_WriteCapacityUnits *smithy.Schema + +var ConsumedCapacity_Table *smithy.Schema + +var ConsumedCapacity_LocalSecondaryIndexes *smithy.Schema + +var ConsumedCapacity_GlobalSecondaryIndexes *smithy.Schema + +var ConsumedCapacity_VectorIndexes *smithy.Schema + +var _ConsumedCapacityMultiple = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ConsumedCapacityMultiple", +}, smithy.ShapeTypeList, 1) +var _ConsumedCapacityMultiple_member *smithy.Schema + +var _ConsumedCapacityUnits = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ConsumedCapacityUnits", +}, smithy.ShapeTypeDouble, 0) + +var ContinuousBackupsDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ContinuousBackupsDescription", +}, smithy.ShapeTypeStructure, 2) +var ContinuousBackupsDescription_ContinuousBackupsStatus *smithy.Schema + +var ContinuousBackupsDescription_PointInTimeRecoveryDescription *smithy.Schema + +var ContinuousBackupsStatus = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ContinuousBackupsStatus", +}, smithy.ShapeTypeEnum, 2) +var ContinuousBackupsStatus_ENABLED *smithy.Schema + +var ContinuousBackupsStatus_DISABLED *smithy.Schema + +var ContinuousBackupsUnavailableException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ContinuousBackupsUnavailableException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}) +var ContinuousBackupsUnavailableException_message *smithy.Schema + +var ContributorInsightsAction = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ContributorInsightsAction", +}, smithy.ShapeTypeEnum, 2) +var ContributorInsightsAction_ENABLE *smithy.Schema + +var ContributorInsightsAction_DISABLE *smithy.Schema + +var ContributorInsightsMode = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ContributorInsightsMode", +}, smithy.ShapeTypeEnum, 2) +var ContributorInsightsMode_ACCESSED_AND_THROTTLED_KEYS *smithy.Schema + +var ContributorInsightsMode_THROTTLED_KEYS *smithy.Schema + +var _ContributorInsightsRule = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ContributorInsightsRule", +}, smithy.ShapeTypeString, 0) + +var _ContributorInsightsRuleList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ContributorInsightsRuleList", +}, smithy.ShapeTypeList, 1) +var _ContributorInsightsRuleList_member *smithy.Schema + +var ContributorInsightsStatus = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ContributorInsightsStatus", +}, smithy.ShapeTypeEnum, 5) +var ContributorInsightsStatus_ENABLING *smithy.Schema + +var ContributorInsightsStatus_ENABLED *smithy.Schema + +var ContributorInsightsStatus_DISABLING *smithy.Schema + +var ContributorInsightsStatus_DISABLED *smithy.Schema + +var ContributorInsightsStatus_FAILED *smithy.Schema + +var _ContributorInsightsSummaries = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ContributorInsightsSummaries", +}, smithy.ShapeTypeList, 1) +var _ContributorInsightsSummaries_member *smithy.Schema + +var ContributorInsightsSummary = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ContributorInsightsSummary", +}, smithy.ShapeTypeStructure, 4) +var ContributorInsightsSummary_TableName *smithy.Schema + +var ContributorInsightsSummary_IndexName *smithy.Schema + +var ContributorInsightsSummary_ContributorInsightsStatus *smithy.Schema + +var ContributorInsightsSummary_ContributorInsightsMode *smithy.Schema + +var CreateGlobalSecondaryIndexAction = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "CreateGlobalSecondaryIndexAction", +}, smithy.ShapeTypeStructure, 6) +var CreateGlobalSecondaryIndexAction_IndexName *smithy.Schema + +var CreateGlobalSecondaryIndexAction_KeySchema *smithy.Schema + +var CreateGlobalSecondaryIndexAction_Projection *smithy.Schema + +var CreateGlobalSecondaryIndexAction_ProvisionedThroughput *smithy.Schema + +var CreateGlobalSecondaryIndexAction_OnDemandThroughput *smithy.Schema + +var CreateGlobalSecondaryIndexAction_WarmThroughput *smithy.Schema + +var CreateGlobalTableWitnessGroupMemberAction = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "CreateGlobalTableWitnessGroupMemberAction", +}, smithy.ShapeTypeStructure, 1) +var CreateGlobalTableWitnessGroupMemberAction_RegionName *smithy.Schema + +var CreateReplicaAction = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "CreateReplicaAction", +}, smithy.ShapeTypeStructure, 1) +var CreateReplicaAction_RegionName *smithy.Schema + +var CreateReplicationGroupMemberAction = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "CreateReplicationGroupMemberAction", +}, smithy.ShapeTypeStructure, 6) +var CreateReplicationGroupMemberAction_RegionName *smithy.Schema + +var CreateReplicationGroupMemberAction_KMSMasterKeyId *smithy.Schema + +var CreateReplicationGroupMemberAction_ProvisionedThroughputOverride *smithy.Schema + +var CreateReplicationGroupMemberAction_OnDemandThroughputOverride *smithy.Schema + +var CreateReplicationGroupMemberAction_GlobalSecondaryIndexes *smithy.Schema + +var CreateReplicationGroupMemberAction_TableClassOverride *smithy.Schema + +var CreateVectorIndexAction = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "CreateVectorIndexAction", +}, smithy.ShapeTypeStructure, 6) +var CreateVectorIndexAction_IndexName *smithy.Schema + +var CreateVectorIndexAction_VectorAttribute *smithy.Schema + +var CreateVectorIndexAction_SearchSchema *smithy.Schema + +var CreateVectorIndexAction_Projection *smithy.Schema + +var CreateVectorIndexAction_Dimensions *smithy.Schema + +var CreateVectorIndexAction_DistanceFunction *smithy.Schema + +var _CsvDelimiter = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "CsvDelimiter", +}, smithy.ShapeTypeString, 0) + +var _CsvHeader = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "CsvHeader", +}, smithy.ShapeTypeString, 0) + +var _CsvHeaderList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "CsvHeaderList", +}, smithy.ShapeTypeList, 1) +var _CsvHeaderList_member *smithy.Schema + +var CsvOptions = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "CsvOptions", +}, smithy.ShapeTypeStructure, 2) +var CsvOptions_Delimiter *smithy.Schema + +var CsvOptions_HeaderList *smithy.Schema + +var _Date = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "Date", +}, smithy.ShapeTypeTimestamp, 0) + +var Delete = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "Delete", +}, smithy.ShapeTypeStructure, 6) +var Delete_Key *smithy.Schema + +var Delete_TableName *smithy.Schema + +var Delete_ConditionExpression *smithy.Schema + +var Delete_ExpressionAttributeNames *smithy.Schema + +var Delete_ExpressionAttributeValues *smithy.Schema + +var Delete_ReturnValuesOnConditionCheckFailure *smithy.Schema + +var DeleteGlobalSecondaryIndexAction = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DeleteGlobalSecondaryIndexAction", +}, smithy.ShapeTypeStructure, 1) +var DeleteGlobalSecondaryIndexAction_IndexName *smithy.Schema + +var DeleteGlobalTableWitnessGroupMemberAction = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DeleteGlobalTableWitnessGroupMemberAction", +}, smithy.ShapeTypeStructure, 1) +var DeleteGlobalTableWitnessGroupMemberAction_RegionName *smithy.Schema + +var DeleteReplicaAction = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DeleteReplicaAction", +}, smithy.ShapeTypeStructure, 1) +var DeleteReplicaAction_RegionName *smithy.Schema + +var DeleteReplicationGroupMemberAction = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DeleteReplicationGroupMemberAction", +}, smithy.ShapeTypeStructure, 1) +var DeleteReplicationGroupMemberAction_RegionName *smithy.Schema + +var DeleteRequest = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DeleteRequest", +}, smithy.ShapeTypeStructure, 1) +var DeleteRequest_Key *smithy.Schema + +var DeleteVectorIndexAction = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DeleteVectorIndexAction", +}, smithy.ShapeTypeStructure, 1) +var DeleteVectorIndexAction_IndexName *smithy.Schema + +var _DeletionProtectionEnabled = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DeletionProtectionEnabled", +}, smithy.ShapeTypeBoolean, 0) + +var DestinationStatus = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DestinationStatus", +}, smithy.ShapeTypeEnum, 6) +var DestinationStatus_ENABLING *smithy.Schema + +var DestinationStatus_ACTIVE *smithy.Schema + +var DestinationStatus_DISABLING *smithy.Schema + +var DestinationStatus_DISABLED *smithy.Schema + +var DestinationStatus_ENABLE_FAILED *smithy.Schema + +var DestinationStatus_UPDATING *smithy.Schema + +var _DoubleObject = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DoubleObject", +}, smithy.ShapeTypeDouble, 0) + +var DuplicateItemException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DuplicateItemException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}) +var DuplicateItemException_message *smithy.Schema + +var EnableKinesisStreamingConfiguration = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "EnableKinesisStreamingConfiguration", +}, smithy.ShapeTypeStructure, 1) +var EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision *smithy.Schema + +var Endpoint = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "Endpoint", +}, smithy.ShapeTypeStructure, 2) +var Endpoint_Address *smithy.Schema + +var Endpoint_CachePeriodInMinutes *smithy.Schema + +var _Endpoints = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "Endpoints", +}, smithy.ShapeTypeList, 1) +var _Endpoints_member *smithy.Schema + +var _ErrorCount = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ErrorCount", +}, smithy.ShapeTypeLong, 0) + +var _ErrorMessage = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ErrorMessage", +}, smithy.ShapeTypeString, 0) + +var _ExceptionDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExceptionDescription", +}, smithy.ShapeTypeString, 0) + +var _ExceptionName = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExceptionName", +}, smithy.ShapeTypeString, 0) + +var _ExpectedAttributeMap = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExpectedAttributeMap", +}, smithy.ShapeTypeMap, 2) +var _ExpectedAttributeMap_key *smithy.Schema + +var _ExpectedAttributeMap_value *smithy.Schema + +var ExpectedAttributeValue = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExpectedAttributeValue", +}, smithy.ShapeTypeStructure, 4) +var ExpectedAttributeValue_Value *smithy.Schema + +var ExpectedAttributeValue_Exists *smithy.Schema + +var ExpectedAttributeValue_ComparisonOperator *smithy.Schema + +var ExpectedAttributeValue_AttributeValueList *smithy.Schema + +var _ExportArn = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExportArn", +}, smithy.ShapeTypeString, 0) + +var ExportConflictException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExportConflictException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}) +var ExportConflictException_message *smithy.Schema + +var ExportDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExportDescription", +}, smithy.ShapeTypeStructure, 22) +var ExportDescription_ExportArn *smithy.Schema + +var ExportDescription_ExportStatus *smithy.Schema + +var ExportDescription_StartTime *smithy.Schema + +var ExportDescription_EndTime *smithy.Schema + +var ExportDescription_ExportManifest *smithy.Schema + +var ExportDescription_TableArn *smithy.Schema + +var ExportDescription_TableId *smithy.Schema + +var ExportDescription_ExportTime *smithy.Schema + +var ExportDescription_ClientToken *smithy.Schema + +var ExportDescription_S3Bucket *smithy.Schema + +var ExportDescription_S3BucketOwner *smithy.Schema + +var ExportDescription_S3Prefix *smithy.Schema + +var ExportDescription_S3SseAlgorithm *smithy.Schema + +var ExportDescription_S3SseKmsKeyId *smithy.Schema + +var ExportDescription_FailureCode *smithy.Schema + +var ExportDescription_FailureMessage *smithy.Schema + +var ExportDescription_ExportFormat *smithy.Schema + +var ExportDescription_BilledSizeBytes *smithy.Schema + +var ExportDescription_ItemCount *smithy.Schema + +var ExportDescription_ExportType *smithy.Schema + +var ExportDescription_IncrementalExportSpecification *smithy.Schema + +var ExportDescription_FilterSpecification *smithy.Schema + +var _ExportEndTime = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExportEndTime", +}, smithy.ShapeTypeTimestamp, 0) + +var ExportFormat = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExportFormat", +}, smithy.ShapeTypeEnum, 2) +var ExportFormat_DYNAMODB_JSON *smithy.Schema + +var ExportFormat_ION *smithy.Schema + +var _ExportFromTime = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExportFromTime", +}, smithy.ShapeTypeTimestamp, 0) + +var _ExportManifest = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExportManifest", +}, smithy.ShapeTypeString, 0) + +var _ExportNextToken = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExportNextToken", +}, smithy.ShapeTypeString, 0) + +var ExportNotFoundException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExportNotFoundException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}) +var ExportNotFoundException_message *smithy.Schema + +var _ExportStartTime = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExportStartTime", +}, smithy.ShapeTypeTimestamp, 0) + +var ExportStatus = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExportStatus", +}, smithy.ShapeTypeEnum, 3) +var ExportStatus_IN_PROGRESS *smithy.Schema + +var ExportStatus_COMPLETED *smithy.Schema + +var ExportStatus_FAILED *smithy.Schema + +var _ExportSummaries = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExportSummaries", +}, smithy.ShapeTypeList, 1) +var _ExportSummaries_member *smithy.Schema + +var ExportSummary = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExportSummary", +}, smithy.ShapeTypeStructure, 3) +var ExportSummary_ExportArn *smithy.Schema + +var ExportSummary_ExportStatus *smithy.Schema + +var ExportSummary_ExportType *smithy.Schema + +var _ExportTime = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExportTime", +}, smithy.ShapeTypeTimestamp, 0) + +var _ExportToTime = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExportToTime", +}, smithy.ShapeTypeTimestamp, 0) + +var ExportType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExportType", +}, smithy.ShapeTypeEnum, 2) +var ExportType_FULL_EXPORT *smithy.Schema + +var ExportType_INCREMENTAL_EXPORT *smithy.Schema + +var ExportViewType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExportViewType", +}, smithy.ShapeTypeEnum, 2) +var ExportViewType_NEW_IMAGE *smithy.Schema + +var ExportViewType_NEW_AND_OLD_IMAGES *smithy.Schema + +var _ExpressionAttributeNameMap = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExpressionAttributeNameMap", +}, smithy.ShapeTypeMap, 2) +var _ExpressionAttributeNameMap_key *smithy.Schema + +var _ExpressionAttributeNameMap_value *smithy.Schema + +var _ExpressionAttributeNameVariable = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExpressionAttributeNameVariable", +}, smithy.ShapeTypeString, 0) + +var _ExpressionAttributeValueMap = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExpressionAttributeValueMap", +}, smithy.ShapeTypeMap, 2) +var _ExpressionAttributeValueMap_key *smithy.Schema + +var _ExpressionAttributeValueMap_value *smithy.Schema + +var _ExpressionAttributeValueVariable = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExpressionAttributeValueVariable", +}, smithy.ShapeTypeString, 0) + +var _FailureCode = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "FailureCode", +}, smithy.ShapeTypeString, 0) + +var FailureException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "FailureException", +}, smithy.ShapeTypeStructure, 2) +var FailureException_ExceptionName *smithy.Schema + +var FailureException_ExceptionDescription *smithy.Schema + +var _FailureMessage = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "FailureMessage", +}, smithy.ShapeTypeString, 0) + +var _FilterConditionMap = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "FilterConditionMap", +}, smithy.ShapeTypeMap, 2) +var _FilterConditionMap_key *smithy.Schema + +var _FilterConditionMap_value *smithy.Schema + +var FilterSpecification = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "FilterSpecification", +}, smithy.ShapeTypeStructure, 5) +var FilterSpecification_FilterExpression *smithy.Schema + +var FilterSpecification_ProjectionExpression *smithy.Schema + +var FilterSpecification_KeyConditionExpression *smithy.Schema + +var FilterSpecification_ExpressionAttributeNames *smithy.Schema + +var FilterSpecification_ExpressionAttributeValues *smithy.Schema + +var Get = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "Get", +}, smithy.ShapeTypeStructure, 4) +var Get_Key *smithy.Schema + +var Get_TableName *smithy.Schema + +var Get_ProjectionExpression *smithy.Schema + +var Get_ExpressionAttributeNames *smithy.Schema + +var GlobalSecondaryIndex = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GlobalSecondaryIndex", +}, smithy.ShapeTypeStructure, 6) +var GlobalSecondaryIndex_IndexName *smithy.Schema + +var GlobalSecondaryIndex_KeySchema *smithy.Schema + +var GlobalSecondaryIndex_Projection *smithy.Schema + +var GlobalSecondaryIndex_ProvisionedThroughput *smithy.Schema + +var GlobalSecondaryIndex_OnDemandThroughput *smithy.Schema + +var GlobalSecondaryIndex_WarmThroughput *smithy.Schema + +var GlobalSecondaryIndexAutoScalingUpdate = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GlobalSecondaryIndexAutoScalingUpdate", +}, smithy.ShapeTypeStructure, 2) +var GlobalSecondaryIndexAutoScalingUpdate_IndexName *smithy.Schema + +var GlobalSecondaryIndexAutoScalingUpdate_ProvisionedWriteCapacityAutoScalingUpdate *smithy.Schema + +var _GlobalSecondaryIndexAutoScalingUpdateList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GlobalSecondaryIndexAutoScalingUpdateList", +}, smithy.ShapeTypeList, 1) +var _GlobalSecondaryIndexAutoScalingUpdateList_member *smithy.Schema + +var GlobalSecondaryIndexDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GlobalSecondaryIndexDescription", +}, smithy.ShapeTypeStructure, 11) +var GlobalSecondaryIndexDescription_IndexName *smithy.Schema + +var GlobalSecondaryIndexDescription_KeySchema *smithy.Schema + +var GlobalSecondaryIndexDescription_Projection *smithy.Schema + +var GlobalSecondaryIndexDescription_IndexStatus *smithy.Schema + +var GlobalSecondaryIndexDescription_Backfilling *smithy.Schema + +var GlobalSecondaryIndexDescription_ProvisionedThroughput *smithy.Schema + +var GlobalSecondaryIndexDescription_IndexSizeBytes *smithy.Schema + +var GlobalSecondaryIndexDescription_ItemCount *smithy.Schema + +var GlobalSecondaryIndexDescription_IndexArn *smithy.Schema + +var GlobalSecondaryIndexDescription_OnDemandThroughput *smithy.Schema + +var GlobalSecondaryIndexDescription_WarmThroughput *smithy.Schema + +var _GlobalSecondaryIndexDescriptionList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GlobalSecondaryIndexDescriptionList", +}, smithy.ShapeTypeList, 1) +var _GlobalSecondaryIndexDescriptionList_member *smithy.Schema + +var _GlobalSecondaryIndexes = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GlobalSecondaryIndexes", +}, smithy.ShapeTypeList, 1) +var _GlobalSecondaryIndexes_member *smithy.Schema + +var GlobalSecondaryIndexInfo = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GlobalSecondaryIndexInfo", +}, smithy.ShapeTypeStructure, 5) +var GlobalSecondaryIndexInfo_IndexName *smithy.Schema + +var GlobalSecondaryIndexInfo_KeySchema *smithy.Schema + +var GlobalSecondaryIndexInfo_Projection *smithy.Schema + +var GlobalSecondaryIndexInfo_ProvisionedThroughput *smithy.Schema + +var GlobalSecondaryIndexInfo_OnDemandThroughput *smithy.Schema + +var _GlobalSecondaryIndexList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GlobalSecondaryIndexList", +}, smithy.ShapeTypeList, 1) +var _GlobalSecondaryIndexList_member *smithy.Schema + +var GlobalSecondaryIndexUpdate = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GlobalSecondaryIndexUpdate", +}, smithy.ShapeTypeStructure, 3) +var GlobalSecondaryIndexUpdate_Update *smithy.Schema + +var GlobalSecondaryIndexUpdate_Create *smithy.Schema + +var GlobalSecondaryIndexUpdate_Delete *smithy.Schema + +var _GlobalSecondaryIndexUpdateList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GlobalSecondaryIndexUpdateList", +}, smithy.ShapeTypeList, 1) +var _GlobalSecondaryIndexUpdateList_member *smithy.Schema + +var GlobalSecondaryIndexWarmThroughputDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GlobalSecondaryIndexWarmThroughputDescription", +}, smithy.ShapeTypeStructure, 3) +var GlobalSecondaryIndexWarmThroughputDescription_ReadUnitsPerSecond *smithy.Schema + +var GlobalSecondaryIndexWarmThroughputDescription_WriteUnitsPerSecond *smithy.Schema + +var GlobalSecondaryIndexWarmThroughputDescription_Status *smithy.Schema + +var GlobalTable = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GlobalTable", +}, smithy.ShapeTypeStructure, 2) +var GlobalTable_GlobalTableName *smithy.Schema + +var GlobalTable_ReplicationGroup *smithy.Schema + +var GlobalTableAlreadyExistsException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GlobalTableAlreadyExistsException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}) +var GlobalTableAlreadyExistsException_message *smithy.Schema + +var _GlobalTableArnString = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GlobalTableArnString", +}, smithy.ShapeTypeString, 0) + +var GlobalTableDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GlobalTableDescription", +}, smithy.ShapeTypeStructure, 5) +var GlobalTableDescription_ReplicationGroup *smithy.Schema + +var GlobalTableDescription_GlobalTableArn *smithy.Schema + +var GlobalTableDescription_CreationDateTime *smithy.Schema + +var GlobalTableDescription_GlobalTableStatus *smithy.Schema + +var GlobalTableDescription_GlobalTableName *smithy.Schema + +var GlobalTableGlobalSecondaryIndexSettingsUpdate = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GlobalTableGlobalSecondaryIndexSettingsUpdate", +}, smithy.ShapeTypeStructure, 3) +var GlobalTableGlobalSecondaryIndexSettingsUpdate_IndexName *smithy.Schema + +var GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityUnits *smithy.Schema + +var GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityAutoScalingSettingsUpdate *smithy.Schema + +var _GlobalTableGlobalSecondaryIndexSettingsUpdateList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GlobalTableGlobalSecondaryIndexSettingsUpdateList", +}, smithy.ShapeTypeList, 1) +var _GlobalTableGlobalSecondaryIndexSettingsUpdateList_member *smithy.Schema + +var _GlobalTableList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GlobalTableList", +}, smithy.ShapeTypeList, 1) +var _GlobalTableList_member *smithy.Schema + +var GlobalTableNotFoundException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GlobalTableNotFoundException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}) +var GlobalTableNotFoundException_message *smithy.Schema + +var GlobalTableSettingsReplicationMode = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GlobalTableSettingsReplicationMode", +}, smithy.ShapeTypeEnum, 3) +var GlobalTableSettingsReplicationMode_ENABLED *smithy.Schema + +var GlobalTableSettingsReplicationMode_DISABLED *smithy.Schema + +var GlobalTableSettingsReplicationMode_ENABLED_WITH_OVERRIDES *smithy.Schema + +var GlobalTableStatus = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GlobalTableStatus", +}, smithy.ShapeTypeEnum, 4) +var GlobalTableStatus_CREATING *smithy.Schema + +var GlobalTableStatus_ACTIVE *smithy.Schema + +var GlobalTableStatus_DELETING *smithy.Schema + +var GlobalTableStatus_UPDATING *smithy.Schema + +var GlobalTableWitnessDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GlobalTableWitnessDescription", +}, smithy.ShapeTypeStructure, 2) +var GlobalTableWitnessDescription_RegionName *smithy.Schema + +var GlobalTableWitnessDescription_WitnessStatus *smithy.Schema + +var _GlobalTableWitnessDescriptionList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GlobalTableWitnessDescriptionList", +}, smithy.ShapeTypeList, 1) +var _GlobalTableWitnessDescriptionList_member *smithy.Schema + +var GlobalTableWitnessGroupUpdate = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GlobalTableWitnessGroupUpdate", +}, smithy.ShapeTypeStructure, 2) +var GlobalTableWitnessGroupUpdate_Create *smithy.Schema + +var GlobalTableWitnessGroupUpdate_Delete *smithy.Schema + +var _GlobalTableWitnessGroupUpdateList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GlobalTableWitnessGroupUpdateList", +}, smithy.ShapeTypeList, 1) +var _GlobalTableWitnessGroupUpdateList_member *smithy.Schema + +var IdempotentParameterMismatchException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "IdempotentParameterMismatchException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}) +var IdempotentParameterMismatchException_Message *smithy.Schema + +var _ImportArn = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ImportArn", +}, smithy.ShapeTypeString, 0) + +var ImportConflictException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ImportConflictException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}) +var ImportConflictException_message *smithy.Schema + +var _ImportedItemCount = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ImportedItemCount", +}, smithy.ShapeTypeLong, 0) + +var _ImportEndTime = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ImportEndTime", +}, smithy.ShapeTypeTimestamp, 0) + +var _ImportNextToken = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ImportNextToken", +}, smithy.ShapeTypeString, 0) + +var ImportNotFoundException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ImportNotFoundException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}) +var ImportNotFoundException_message *smithy.Schema + +var _ImportStartTime = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ImportStartTime", +}, smithy.ShapeTypeTimestamp, 0) + +var ImportStatus = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ImportStatus", +}, smithy.ShapeTypeEnum, 5) +var ImportStatus_IN_PROGRESS *smithy.Schema + +var ImportStatus_COMPLETED *smithy.Schema + +var ImportStatus_CANCELLING *smithy.Schema + +var ImportStatus_CANCELLED *smithy.Schema + +var ImportStatus_FAILED *smithy.Schema + +var ImportSummary = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ImportSummary", +}, smithy.ShapeTypeStructure, 8) +var ImportSummary_ImportArn *smithy.Schema + +var ImportSummary_ImportStatus *smithy.Schema + +var ImportSummary_TableArn *smithy.Schema + +var ImportSummary_S3BucketSource *smithy.Schema + +var ImportSummary_CloudWatchLogGroupArn *smithy.Schema + +var ImportSummary_InputFormat *smithy.Schema + +var ImportSummary_StartTime *smithy.Schema + +var ImportSummary_EndTime *smithy.Schema + +var _ImportSummaryList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ImportSummaryList", +}, smithy.ShapeTypeList, 1) +var _ImportSummaryList_member *smithy.Schema + +var ImportTableDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ImportTableDescription", +}, smithy.ShapeTypeStructure, 19) +var ImportTableDescription_ImportArn *smithy.Schema + +var ImportTableDescription_ImportStatus *smithy.Schema + +var ImportTableDescription_TableArn *smithy.Schema + +var ImportTableDescription_TableId *smithy.Schema + +var ImportTableDescription_ClientToken *smithy.Schema + +var ImportTableDescription_S3BucketSource *smithy.Schema + +var ImportTableDescription_ErrorCount *smithy.Schema + +var ImportTableDescription_CloudWatchLogGroupArn *smithy.Schema + +var ImportTableDescription_InputFormat *smithy.Schema + +var ImportTableDescription_InputFormatOptions *smithy.Schema + +var ImportTableDescription_InputCompressionType *smithy.Schema + +var ImportTableDescription_TableCreationParameters *smithy.Schema + +var ImportTableDescription_StartTime *smithy.Schema + +var ImportTableDescription_EndTime *smithy.Schema + +var ImportTableDescription_ProcessedSizeBytes *smithy.Schema + +var ImportTableDescription_ProcessedItemCount *smithy.Schema + +var ImportTableDescription_ImportedItemCount *smithy.Schema + +var ImportTableDescription_FailureCode *smithy.Schema + +var ImportTableDescription_FailureMessage *smithy.Schema + +var IncrementalExportSpecification = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "IncrementalExportSpecification", +}, smithy.ShapeTypeStructure, 3) +var IncrementalExportSpecification_ExportFromTime *smithy.Schema + +var IncrementalExportSpecification_ExportToTime *smithy.Schema + +var IncrementalExportSpecification_ExportViewType *smithy.Schema + +var _IndexName = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "IndexName", +}, smithy.ShapeTypeString, 0) + +var IndexNotFoundException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "IndexNotFoundException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}) +var IndexNotFoundException_message *smithy.Schema + +var IndexStatus = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "IndexStatus", +}, smithy.ShapeTypeEnum, 4) +var IndexStatus_CREATING *smithy.Schema + +var IndexStatus_UPDATING *smithy.Schema + +var IndexStatus_DELETING *smithy.Schema + +var IndexStatus_ACTIVE *smithy.Schema + +var InputCompressionType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "InputCompressionType", +}, smithy.ShapeTypeEnum, 3) +var InputCompressionType_GZIP *smithy.Schema + +var InputCompressionType_ZSTD *smithy.Schema + +var InputCompressionType_NONE *smithy.Schema + +var InputFormat = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "InputFormat", +}, smithy.ShapeTypeEnum, 3) +var InputFormat_DYNAMODB_JSON *smithy.Schema + +var InputFormat_ION *smithy.Schema + +var InputFormat_CSV *smithy.Schema + +var InputFormatOptions = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "InputFormatOptions", +}, smithy.ShapeTypeStructure, 1) +var InputFormatOptions_Csv *smithy.Schema + +var _Integer = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "Integer", +}, smithy.ShapeTypeInteger, 0) + +var _IntegerObject = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "IntegerObject", +}, smithy.ShapeTypeInteger, 0) + +var InternalServerError = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "InternalServerError", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "server"}) +var InternalServerError_message *smithy.Schema + +var InvalidEndpointException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "InvalidEndpointException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}, + &smithytraits.HTTPError{Code: 421}) +var InvalidEndpointException_Message *smithy.Schema + +var InvalidExportTimeException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "InvalidExportTimeException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}) +var InvalidExportTimeException_message *smithy.Schema + +var InvalidRestoreTimeException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "InvalidRestoreTimeException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}) +var InvalidRestoreTimeException_message *smithy.Schema + +var _ItemCollectionKeyAttributeMap = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ItemCollectionKeyAttributeMap", +}, smithy.ShapeTypeMap, 2) +var _ItemCollectionKeyAttributeMap_key *smithy.Schema + +var _ItemCollectionKeyAttributeMap_value *smithy.Schema + +var ItemCollectionMetrics = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ItemCollectionMetrics", +}, smithy.ShapeTypeStructure, 2) +var ItemCollectionMetrics_ItemCollectionKey *smithy.Schema + +var ItemCollectionMetrics_SizeEstimateRangeGB *smithy.Schema + +var _ItemCollectionMetricsMultiple = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ItemCollectionMetricsMultiple", +}, smithy.ShapeTypeList, 1) +var _ItemCollectionMetricsMultiple_member *smithy.Schema + +var _ItemCollectionMetricsPerTable = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ItemCollectionMetricsPerTable", +}, smithy.ShapeTypeMap, 2) +var _ItemCollectionMetricsPerTable_key *smithy.Schema + +var _ItemCollectionMetricsPerTable_value *smithy.Schema + +var _ItemCollectionSizeEstimateBound = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ItemCollectionSizeEstimateBound", +}, smithy.ShapeTypeDouble, 0) + +var _ItemCollectionSizeEstimateRange = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ItemCollectionSizeEstimateRange", +}, smithy.ShapeTypeList, 1) +var _ItemCollectionSizeEstimateRange_member *smithy.Schema + +var ItemCollectionSizeLimitExceededException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ItemCollectionSizeLimitExceededException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}) +var ItemCollectionSizeLimitExceededException_message *smithy.Schema + +var _ItemCount = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ItemCount", +}, smithy.ShapeTypeLong, 0) + +var _ItemList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ItemList", +}, smithy.ShapeTypeList, 1) +var _ItemList_member *smithy.Schema + +var ItemResponse = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ItemResponse", +}, smithy.ShapeTypeStructure, 1) +var ItemResponse_Item *smithy.Schema + +var _ItemResponseList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ItemResponseList", +}, smithy.ShapeTypeList, 1) +var _ItemResponseList_member *smithy.Schema + +var _Key = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "Key", +}, smithy.ShapeTypeMap, 2) +var _Key_key *smithy.Schema + +var _Key_value *smithy.Schema + +var _KeyConditions = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "KeyConditions", +}, smithy.ShapeTypeMap, 2) +var _KeyConditions_key *smithy.Schema + +var _KeyConditions_value *smithy.Schema + +var _KeyExpression = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "KeyExpression", +}, smithy.ShapeTypeString, 0) + +var _KeyList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "KeyList", +}, smithy.ShapeTypeList, 1) +var _KeyList_member *smithy.Schema + +var KeysAndAttributes = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "KeysAndAttributes", +}, smithy.ShapeTypeStructure, 5) +var KeysAndAttributes_Keys *smithy.Schema + +var KeysAndAttributes_AttributesToGet *smithy.Schema + +var KeysAndAttributes_ConsistentRead *smithy.Schema + +var KeysAndAttributes_ProjectionExpression *smithy.Schema + +var KeysAndAttributes_ExpressionAttributeNames *smithy.Schema + +var _KeySchema = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "KeySchema", +}, smithy.ShapeTypeList, 1) +var _KeySchema_member *smithy.Schema + +var _KeySchemaAttributeName = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "KeySchemaAttributeName", +}, smithy.ShapeTypeString, 0) + +var KeySchemaElement = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "KeySchemaElement", +}, smithy.ShapeTypeStructure, 2) +var KeySchemaElement_AttributeName *smithy.Schema + +var KeySchemaElement_KeyType *smithy.Schema + +var KeyType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "KeyType", +}, smithy.ShapeTypeEnum, 2) +var KeyType_HASH *smithy.Schema + +var KeyType_RANGE *smithy.Schema + +var KinesisDataStreamDestination = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "KinesisDataStreamDestination", +}, smithy.ShapeTypeStructure, 4) +var KinesisDataStreamDestination_StreamArn *smithy.Schema + +var KinesisDataStreamDestination_DestinationStatus *smithy.Schema + +var KinesisDataStreamDestination_DestinationStatusDescription *smithy.Schema + +var KinesisDataStreamDestination_ApproximateCreationDateTimePrecision *smithy.Schema + +var _KinesisDataStreamDestinations = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "KinesisDataStreamDestinations", +}, smithy.ShapeTypeList, 1) +var _KinesisDataStreamDestinations_member *smithy.Schema + +var _KMSMasterKeyArn = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "KMSMasterKeyArn", +}, smithy.ShapeTypeString, 0) + +var _KMSMasterKeyId = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "KMSMasterKeyId", +}, smithy.ShapeTypeString, 0) + +var _LastUpdateDateTime = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "LastUpdateDateTime", +}, smithy.ShapeTypeTimestamp, 0) + +var LimitExceededException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "LimitExceededException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}) +var LimitExceededException_message *smithy.Schema + +var _ListAttributeValue = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ListAttributeValue", +}, smithy.ShapeTypeList, 1) +var _ListAttributeValue_member *smithy.Schema + +var _ListContributorInsightsLimit = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ListContributorInsightsLimit", +}, smithy.ShapeTypeInteger, 0) + +var _ListExportsMaxLimit = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ListExportsMaxLimit", +}, smithy.ShapeTypeInteger, 0) + +var _ListImportsMaxLimit = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ListImportsMaxLimit", +}, smithy.ShapeTypeInteger, 0) + +var _ListTablesInputLimit = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ListTablesInputLimit", +}, smithy.ShapeTypeInteger, 0) + +var LocalSecondaryIndex = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "LocalSecondaryIndex", +}, smithy.ShapeTypeStructure, 3) +var LocalSecondaryIndex_IndexName *smithy.Schema + +var LocalSecondaryIndex_KeySchema *smithy.Schema + +var LocalSecondaryIndex_Projection *smithy.Schema + +var LocalSecondaryIndexDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "LocalSecondaryIndexDescription", +}, smithy.ShapeTypeStructure, 6) +var LocalSecondaryIndexDescription_IndexName *smithy.Schema + +var LocalSecondaryIndexDescription_KeySchema *smithy.Schema + +var LocalSecondaryIndexDescription_Projection *smithy.Schema + +var LocalSecondaryIndexDescription_IndexSizeBytes *smithy.Schema + +var LocalSecondaryIndexDescription_ItemCount *smithy.Schema + +var LocalSecondaryIndexDescription_IndexArn *smithy.Schema + +var _LocalSecondaryIndexDescriptionList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "LocalSecondaryIndexDescriptionList", +}, smithy.ShapeTypeList, 1) +var _LocalSecondaryIndexDescriptionList_member *smithy.Schema + +var _LocalSecondaryIndexes = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "LocalSecondaryIndexes", +}, smithy.ShapeTypeList, 1) +var _LocalSecondaryIndexes_member *smithy.Schema + +var LocalSecondaryIndexInfo = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "LocalSecondaryIndexInfo", +}, smithy.ShapeTypeStructure, 3) +var LocalSecondaryIndexInfo_IndexName *smithy.Schema + +var LocalSecondaryIndexInfo_KeySchema *smithy.Schema + +var LocalSecondaryIndexInfo_Projection *smithy.Schema + +var _LocalSecondaryIndexList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "LocalSecondaryIndexList", +}, smithy.ShapeTypeList, 1) +var _LocalSecondaryIndexList_member *smithy.Schema + +var _Long = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "Long", +}, smithy.ShapeTypeLong, 0) + +var _LongObject = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "LongObject", +}, smithy.ShapeTypeLong, 0) + +var _MapAttributeValue = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "MapAttributeValue", +}, smithy.ShapeTypeMap, 2) +var _MapAttributeValue_key *smithy.Schema + +var _MapAttributeValue_value *smithy.Schema + +var MultiRegionConsistency = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "MultiRegionConsistency", +}, smithy.ShapeTypeEnum, 2) +var MultiRegionConsistency_EVENTUAL *smithy.Schema + +var MultiRegionConsistency_STRONG *smithy.Schema + +var _NextTokenString = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "NextTokenString", +}, smithy.ShapeTypeString, 0) + +var _NonKeyAttributeName = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "NonKeyAttributeName", +}, smithy.ShapeTypeString, 0) + +var _NonKeyAttributeNameList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "NonKeyAttributeNameList", +}, smithy.ShapeTypeList, 1) +var _NonKeyAttributeNameList_member *smithy.Schema + +var _NonNegativeLongObject = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "NonNegativeLongObject", +}, smithy.ShapeTypeLong, 0) + +var _NullAttributeValue = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "NullAttributeValue", +}, smithy.ShapeTypeBoolean, 0) + +var _NumberAttributeValue = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "NumberAttributeValue", +}, smithy.ShapeTypeString, 0) + +var _NumberSetAttributeValue = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "NumberSetAttributeValue", +}, smithy.ShapeTypeList, 1) +var _NumberSetAttributeValue_member *smithy.Schema + +var OnDemandThroughput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "OnDemandThroughput", +}, smithy.ShapeTypeStructure, 2) +var OnDemandThroughput_MaxReadRequestUnits *smithy.Schema + +var OnDemandThroughput_MaxWriteRequestUnits *smithy.Schema + +var OnDemandThroughputOverride = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "OnDemandThroughputOverride", +}, smithy.ShapeTypeStructure, 1) +var OnDemandThroughputOverride_MaxReadRequestUnits *smithy.Schema + +var ParameterizedStatement = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ParameterizedStatement", +}, smithy.ShapeTypeStructure, 3) +var ParameterizedStatement_Statement *smithy.Schema + +var ParameterizedStatement_Parameters *smithy.Schema + +var ParameterizedStatement_ReturnValuesOnConditionCheckFailure *smithy.Schema + +var _ParameterizedStatements = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ParameterizedStatements", +}, smithy.ShapeTypeList, 1) +var _ParameterizedStatements_member *smithy.Schema + +var _PartiQLBatchRequest = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "PartiQLBatchRequest", +}, smithy.ShapeTypeList, 1) +var _PartiQLBatchRequest_member *smithy.Schema + +var _PartiQLBatchResponse = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "PartiQLBatchResponse", +}, smithy.ShapeTypeList, 1) +var _PartiQLBatchResponse_member *smithy.Schema + +var _PartiQLNextToken = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "PartiQLNextToken", +}, smithy.ShapeTypeString, 0) + +var _PartiQLStatement = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "PartiQLStatement", +}, smithy.ShapeTypeString, 0) + +var PointInTimeRecoveryDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "PointInTimeRecoveryDescription", +}, smithy.ShapeTypeStructure, 4) +var PointInTimeRecoveryDescription_PointInTimeRecoveryStatus *smithy.Schema + +var PointInTimeRecoveryDescription_RecoveryPeriodInDays *smithy.Schema + +var PointInTimeRecoveryDescription_EarliestRestorableDateTime *smithy.Schema + +var PointInTimeRecoveryDescription_LatestRestorableDateTime *smithy.Schema + +var PointInTimeRecoverySpecification = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "PointInTimeRecoverySpecification", +}, smithy.ShapeTypeStructure, 2) +var PointInTimeRecoverySpecification_PointInTimeRecoveryEnabled *smithy.Schema + +var PointInTimeRecoverySpecification_RecoveryPeriodInDays *smithy.Schema + +var PointInTimeRecoveryStatus = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "PointInTimeRecoveryStatus", +}, smithy.ShapeTypeEnum, 2) +var PointInTimeRecoveryStatus_ENABLED *smithy.Schema + +var PointInTimeRecoveryStatus_DISABLED *smithy.Schema + +var PointInTimeRecoveryUnavailableException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "PointInTimeRecoveryUnavailableException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}) +var PointInTimeRecoveryUnavailableException_message *smithy.Schema + +var PolicyNotFoundException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "PolicyNotFoundException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}) +var PolicyNotFoundException_message *smithy.Schema + +var _PolicyRevisionId = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "PolicyRevisionId", +}, smithy.ShapeTypeString, 0) + +var _PositiveIntegerObject = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "PositiveIntegerObject", +}, smithy.ShapeTypeInteger, 0) + +var _PositiveLongObject = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "PositiveLongObject", +}, smithy.ShapeTypeLong, 0) + +var _PreparedStatementParameters = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "PreparedStatementParameters", +}, smithy.ShapeTypeList, 1) +var _PreparedStatementParameters_member *smithy.Schema + +var _ProcessedItemCount = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ProcessedItemCount", +}, smithy.ShapeTypeLong, 0) + +var Projection = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "Projection", +}, smithy.ShapeTypeStructure, 2) +var Projection_ProjectionType *smithy.Schema + +var Projection_NonKeyAttributes *smithy.Schema + +var _ProjectionExpression = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ProjectionExpression", +}, smithy.ShapeTypeString, 0) + +var ProjectionType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ProjectionType", +}, smithy.ShapeTypeEnum, 3) +var ProjectionType_ALL *smithy.Schema + +var ProjectionType_KEYS_ONLY *smithy.Schema + +var ProjectionType_INCLUDE *smithy.Schema + +var ProvisionedThroughput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ProvisionedThroughput", +}, smithy.ShapeTypeStructure, 2) +var ProvisionedThroughput_ReadCapacityUnits *smithy.Schema + +var ProvisionedThroughput_WriteCapacityUnits *smithy.Schema + +var ProvisionedThroughputDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ProvisionedThroughputDescription", +}, smithy.ShapeTypeStructure, 5) +var ProvisionedThroughputDescription_LastIncreaseDateTime *smithy.Schema + +var ProvisionedThroughputDescription_LastDecreaseDateTime *smithy.Schema + +var ProvisionedThroughputDescription_NumberOfDecreasesToday *smithy.Schema + +var ProvisionedThroughputDescription_ReadCapacityUnits *smithy.Schema + +var ProvisionedThroughputDescription_WriteCapacityUnits *smithy.Schema + +var ProvisionedThroughputExceededException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ProvisionedThroughputExceededException", +}, smithy.ShapeTypeStructure, 2, &smithytraits.Error{Type: "client"}) +var ProvisionedThroughputExceededException_message *smithy.Schema + +var ProvisionedThroughputExceededException_ThrottlingReasons *smithy.Schema + +var ProvisionedThroughputOverride = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ProvisionedThroughputOverride", +}, smithy.ShapeTypeStructure, 1) +var ProvisionedThroughputOverride_ReadCapacityUnits *smithy.Schema + +var Put = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "Put", +}, smithy.ShapeTypeStructure, 6) +var Put_Item *smithy.Schema + +var Put_TableName *smithy.Schema + +var Put_ConditionExpression *smithy.Schema + +var Put_ExpressionAttributeNames *smithy.Schema + +var Put_ExpressionAttributeValues *smithy.Schema + +var Put_ReturnValuesOnConditionCheckFailure *smithy.Schema + +var _PutItemInputAttributeMap = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "PutItemInputAttributeMap", +}, smithy.ShapeTypeMap, 2) +var _PutItemInputAttributeMap_key *smithy.Schema + +var _PutItemInputAttributeMap_value *smithy.Schema + +var PutRequest = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "PutRequest", +}, smithy.ShapeTypeStructure, 1) +var PutRequest_Item *smithy.Schema + +var _Reason = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "Reason", +}, smithy.ShapeTypeString, 0) + +var _RecoveryPeriodInDays = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "RecoveryPeriodInDays", +}, smithy.ShapeTypeInteger, 0) + +var _RegionName = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "RegionName", +}, smithy.ShapeTypeString, 0) + +var Replica = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "Replica", +}, smithy.ShapeTypeStructure, 1) +var Replica_RegionName *smithy.Schema + +var ReplicaAlreadyExistsException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaAlreadyExistsException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}) +var ReplicaAlreadyExistsException_message *smithy.Schema + +var ReplicaAutoScalingDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaAutoScalingDescription", +}, smithy.ShapeTypeStructure, 5) +var ReplicaAutoScalingDescription_RegionName *smithy.Schema + +var ReplicaAutoScalingDescription_GlobalSecondaryIndexes *smithy.Schema + +var ReplicaAutoScalingDescription_ReplicaProvisionedReadCapacityAutoScalingSettings *smithy.Schema + +var ReplicaAutoScalingDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings *smithy.Schema + +var ReplicaAutoScalingDescription_ReplicaStatus *smithy.Schema + +var _ReplicaAutoScalingDescriptionList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaAutoScalingDescriptionList", +}, smithy.ShapeTypeList, 1) +var _ReplicaAutoScalingDescriptionList_member *smithy.Schema + +var ReplicaAutoScalingUpdate = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaAutoScalingUpdate", +}, smithy.ShapeTypeStructure, 3) +var ReplicaAutoScalingUpdate_RegionName *smithy.Schema + +var ReplicaAutoScalingUpdate_ReplicaGlobalSecondaryIndexUpdates *smithy.Schema + +var ReplicaAutoScalingUpdate_ReplicaProvisionedReadCapacityAutoScalingUpdate *smithy.Schema + +var _ReplicaAutoScalingUpdateList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaAutoScalingUpdateList", +}, smithy.ShapeTypeList, 1) +var _ReplicaAutoScalingUpdateList_member *smithy.Schema + +var ReplicaDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaDescription", +}, smithy.ShapeTypeStructure, 13) +var ReplicaDescription_RegionName *smithy.Schema + +var ReplicaDescription_ReplicaStatus *smithy.Schema + +var ReplicaDescription_ReplicaArn *smithy.Schema + +var ReplicaDescription_ReplicaStatusDescription *smithy.Schema + +var ReplicaDescription_ReplicaStatusPercentProgress *smithy.Schema + +var ReplicaDescription_KMSMasterKeyId *smithy.Schema + +var ReplicaDescription_ProvisionedThroughputOverride *smithy.Schema + +var ReplicaDescription_OnDemandThroughputOverride *smithy.Schema + +var ReplicaDescription_WarmThroughput *smithy.Schema + +var ReplicaDescription_GlobalSecondaryIndexes *smithy.Schema + +var ReplicaDescription_ReplicaInaccessibleDateTime *smithy.Schema + +var ReplicaDescription_ReplicaTableClassSummary *smithy.Schema + +var ReplicaDescription_GlobalTableSettingsReplicationMode *smithy.Schema + +var _ReplicaDescriptionList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaDescriptionList", +}, smithy.ShapeTypeList, 1) +var _ReplicaDescriptionList_member *smithy.Schema + +var ReplicaGlobalSecondaryIndex = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaGlobalSecondaryIndex", +}, smithy.ShapeTypeStructure, 3) +var ReplicaGlobalSecondaryIndex_IndexName *smithy.Schema + +var ReplicaGlobalSecondaryIndex_ProvisionedThroughputOverride *smithy.Schema + +var ReplicaGlobalSecondaryIndex_OnDemandThroughputOverride *smithy.Schema + +var ReplicaGlobalSecondaryIndexAutoScalingDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaGlobalSecondaryIndexAutoScalingDescription", +}, smithy.ShapeTypeStructure, 4) +var ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexName *smithy.Schema + +var ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexStatus *smithy.Schema + +var ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedReadCapacityAutoScalingSettings *smithy.Schema + +var ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedWriteCapacityAutoScalingSettings *smithy.Schema + +var _ReplicaGlobalSecondaryIndexAutoScalingDescriptionList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaGlobalSecondaryIndexAutoScalingDescriptionList", +}, smithy.ShapeTypeList, 1) +var _ReplicaGlobalSecondaryIndexAutoScalingDescriptionList_member *smithy.Schema + +var ReplicaGlobalSecondaryIndexAutoScalingUpdate = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaGlobalSecondaryIndexAutoScalingUpdate", +}, smithy.ShapeTypeStructure, 2) +var ReplicaGlobalSecondaryIndexAutoScalingUpdate_IndexName *smithy.Schema + +var ReplicaGlobalSecondaryIndexAutoScalingUpdate_ProvisionedReadCapacityAutoScalingUpdate *smithy.Schema + +var _ReplicaGlobalSecondaryIndexAutoScalingUpdateList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaGlobalSecondaryIndexAutoScalingUpdateList", +}, smithy.ShapeTypeList, 1) +var _ReplicaGlobalSecondaryIndexAutoScalingUpdateList_member *smithy.Schema + +var ReplicaGlobalSecondaryIndexDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaGlobalSecondaryIndexDescription", +}, smithy.ShapeTypeStructure, 4) +var ReplicaGlobalSecondaryIndexDescription_IndexName *smithy.Schema + +var ReplicaGlobalSecondaryIndexDescription_ProvisionedThroughputOverride *smithy.Schema + +var ReplicaGlobalSecondaryIndexDescription_OnDemandThroughputOverride *smithy.Schema + +var ReplicaGlobalSecondaryIndexDescription_WarmThroughput *smithy.Schema + +var _ReplicaGlobalSecondaryIndexDescriptionList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaGlobalSecondaryIndexDescriptionList", +}, smithy.ShapeTypeList, 1) +var _ReplicaGlobalSecondaryIndexDescriptionList_member *smithy.Schema + +var _ReplicaGlobalSecondaryIndexList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaGlobalSecondaryIndexList", +}, smithy.ShapeTypeList, 1) +var _ReplicaGlobalSecondaryIndexList_member *smithy.Schema + +var ReplicaGlobalSecondaryIndexSettingsDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaGlobalSecondaryIndexSettingsDescription", +}, smithy.ShapeTypeStructure, 6) +var ReplicaGlobalSecondaryIndexSettingsDescription_IndexName *smithy.Schema + +var ReplicaGlobalSecondaryIndexSettingsDescription_IndexStatus *smithy.Schema + +var ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityUnits *smithy.Schema + +var ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityAutoScalingSettings *smithy.Schema + +var ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityUnits *smithy.Schema + +var ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityAutoScalingSettings *smithy.Schema + +var _ReplicaGlobalSecondaryIndexSettingsDescriptionList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaGlobalSecondaryIndexSettingsDescriptionList", +}, smithy.ShapeTypeList, 1) +var _ReplicaGlobalSecondaryIndexSettingsDescriptionList_member *smithy.Schema + +var ReplicaGlobalSecondaryIndexSettingsUpdate = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaGlobalSecondaryIndexSettingsUpdate", +}, smithy.ShapeTypeStructure, 3) +var ReplicaGlobalSecondaryIndexSettingsUpdate_IndexName *smithy.Schema + +var ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityUnits *smithy.Schema + +var ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityAutoScalingSettingsUpdate *smithy.Schema + +var _ReplicaGlobalSecondaryIndexSettingsUpdateList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaGlobalSecondaryIndexSettingsUpdateList", +}, smithy.ShapeTypeList, 1) +var _ReplicaGlobalSecondaryIndexSettingsUpdateList_member *smithy.Schema + +var _ReplicaList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaList", +}, smithy.ShapeTypeList, 1) +var _ReplicaList_member *smithy.Schema + +var ReplicaNotFoundException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaNotFoundException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}) +var ReplicaNotFoundException_message *smithy.Schema + +var ReplicaSettingsDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaSettingsDescription", +}, smithy.ShapeTypeStructure, 9) +var ReplicaSettingsDescription_RegionName *smithy.Schema + +var ReplicaSettingsDescription_ReplicaStatus *smithy.Schema + +var ReplicaSettingsDescription_ReplicaBillingModeSummary *smithy.Schema + +var ReplicaSettingsDescription_ReplicaProvisionedReadCapacityUnits *smithy.Schema + +var ReplicaSettingsDescription_ReplicaProvisionedReadCapacityAutoScalingSettings *smithy.Schema + +var ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityUnits *smithy.Schema + +var ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings *smithy.Schema + +var ReplicaSettingsDescription_ReplicaGlobalSecondaryIndexSettings *smithy.Schema + +var ReplicaSettingsDescription_ReplicaTableClassSummary *smithy.Schema + +var _ReplicaSettingsDescriptionList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaSettingsDescriptionList", +}, smithy.ShapeTypeList, 1) +var _ReplicaSettingsDescriptionList_member *smithy.Schema + +var ReplicaSettingsUpdate = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaSettingsUpdate", +}, smithy.ShapeTypeStructure, 5) +var ReplicaSettingsUpdate_RegionName *smithy.Schema + +var ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityUnits *smithy.Schema + +var ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate *smithy.Schema + +var ReplicaSettingsUpdate_ReplicaGlobalSecondaryIndexSettingsUpdate *smithy.Schema + +var ReplicaSettingsUpdate_ReplicaTableClass *smithy.Schema + +var _ReplicaSettingsUpdateList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaSettingsUpdateList", +}, smithy.ShapeTypeList, 1) +var _ReplicaSettingsUpdateList_member *smithy.Schema + +var ReplicaStatus = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaStatus", +}, smithy.ShapeTypeEnum, 10) +var ReplicaStatus_CREATING *smithy.Schema + +var ReplicaStatus_CREATION_FAILED *smithy.Schema + +var ReplicaStatus_UPDATING *smithy.Schema + +var ReplicaStatus_DELETING *smithy.Schema + +var ReplicaStatus_ACTIVE *smithy.Schema + +var ReplicaStatus_REGION_DISABLED *smithy.Schema + +var ReplicaStatus_INACCESSIBLE_ENCRYPTION_CREDENTIALS *smithy.Schema + +var ReplicaStatus_ARCHIVING *smithy.Schema + +var ReplicaStatus_ARCHIVED *smithy.Schema + +var ReplicaStatus_REPLICATION_NOT_AUTHORIZED *smithy.Schema + +var _ReplicaStatusDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaStatusDescription", +}, smithy.ShapeTypeString, 0) + +var _ReplicaStatusPercentProgress = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaStatusPercentProgress", +}, smithy.ShapeTypeString, 0) + +var ReplicatedWriteConflictException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicatedWriteConflictException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}) +var ReplicatedWriteConflictException_message *smithy.Schema + +var ReplicationGroupUpdate = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicationGroupUpdate", +}, smithy.ShapeTypeStructure, 3) +var ReplicationGroupUpdate_Create *smithy.Schema + +var ReplicationGroupUpdate_Update *smithy.Schema + +var ReplicationGroupUpdate_Delete *smithy.Schema + +var _ReplicationGroupUpdateList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicationGroupUpdateList", +}, smithy.ShapeTypeList, 1) +var _ReplicationGroupUpdateList_member *smithy.Schema + +var ReplicaUpdate = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaUpdate", +}, smithy.ShapeTypeStructure, 2) +var ReplicaUpdate_Create *smithy.Schema + +var ReplicaUpdate_Delete *smithy.Schema + +var _ReplicaUpdateList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReplicaUpdateList", +}, smithy.ShapeTypeList, 1) +var _ReplicaUpdateList_member *smithy.Schema + +var RequestLimitExceeded = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "RequestLimitExceeded", +}, smithy.ShapeTypeStructure, 2, &smithytraits.Error{Type: "client"}) +var RequestLimitExceeded_message *smithy.Schema + +var RequestLimitExceeded_ThrottlingReasons *smithy.Schema + +var _Resource = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "Resource", +}, smithy.ShapeTypeString, 0) + +var _ResourceArnString = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ResourceArnString", +}, smithy.ShapeTypeString, 0) + +var ResourceInUseException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ResourceInUseException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}) +var ResourceInUseException_message *smithy.Schema + +var ResourceNotFoundException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ResourceNotFoundException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}) +var ResourceNotFoundException_message *smithy.Schema + +var _ResourcePolicy = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ResourcePolicy", +}, smithy.ShapeTypeString, 0) + +var _RestoreInProgress = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "RestoreInProgress", +}, smithy.ShapeTypeBoolean, 0) + +var RestoreSummary = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "RestoreSummary", +}, smithy.ShapeTypeStructure, 4) +var RestoreSummary_SourceBackupArn *smithy.Schema + +var RestoreSummary_SourceTableArn *smithy.Schema + +var RestoreSummary_RestoreDateTime *smithy.Schema + +var RestoreSummary_RestoreInProgress *smithy.Schema + +var ReturnConsumedCapacity = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReturnConsumedCapacity", +}, smithy.ShapeTypeEnum, 3) +var ReturnConsumedCapacity_INDEXES *smithy.Schema + +var ReturnConsumedCapacity_TOTAL *smithy.Schema + +var ReturnConsumedCapacity_NONE *smithy.Schema + +var ReturnItemCollectionMetrics = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReturnItemCollectionMetrics", +}, smithy.ShapeTypeEnum, 2) +var ReturnItemCollectionMetrics_SIZE *smithy.Schema + +var ReturnItemCollectionMetrics_NONE *smithy.Schema + +var ReturnValue = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReturnValue", +}, smithy.ShapeTypeEnum, 5) +var ReturnValue_NONE *smithy.Schema + +var ReturnValue_ALL_OLD *smithy.Schema + +var ReturnValue_UPDATED_OLD *smithy.Schema + +var ReturnValue_ALL_NEW *smithy.Schema + +var ReturnValue_UPDATED_NEW *smithy.Schema + +var ReturnValuesOnConditionCheckFailure = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ReturnValuesOnConditionCheckFailure", +}, smithy.ShapeTypeEnum, 2) +var ReturnValuesOnConditionCheckFailure_ALL_OLD *smithy.Schema + +var ReturnValuesOnConditionCheckFailure_NONE *smithy.Schema + +var _S3Bucket = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "S3Bucket", +}, smithy.ShapeTypeString, 0) + +var _S3BucketOwner = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "S3BucketOwner", +}, smithy.ShapeTypeString, 0) + +var S3BucketSource = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "S3BucketSource", +}, smithy.ShapeTypeStructure, 3) +var S3BucketSource_S3BucketOwner *smithy.Schema + +var S3BucketSource_S3Bucket *smithy.Schema + +var S3BucketSource_S3KeyPrefix *smithy.Schema + +var _S3Prefix = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "S3Prefix", +}, smithy.ShapeTypeString, 0) + +var S3SseAlgorithm = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "S3SseAlgorithm", +}, smithy.ShapeTypeEnum, 2) +var S3SseAlgorithm_AES256 *smithy.Schema + +var S3SseAlgorithm_KMS *smithy.Schema + +var _S3SseKmsKeyId = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "S3SseKmsKeyId", +}, smithy.ShapeTypeString, 0) + +var ScalarAttributeType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ScalarAttributeType", +}, smithy.ShapeTypeEnum, 3) +var ScalarAttributeType_S *smithy.Schema + +var ScalarAttributeType_N *smithy.Schema + +var ScalarAttributeType_B *smithy.Schema + +var _ScanSegment = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ScanSegment", +}, smithy.ShapeTypeInteger, 0) + +var _ScanTotalSegments = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ScanTotalSegments", +}, smithy.ShapeTypeInteger, 0) + +var _ScoreNumber = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ScoreNumber", +}, smithy.ShapeTypeDouble, 0) + +var SearchResultItem = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "SearchResultItem", +}, smithy.ShapeTypeStructure, 2) +var SearchResultItem_Item *smithy.Schema + +var SearchResultItem_Score *smithy.Schema + +var _SearchResultList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "SearchResultList", +}, smithy.ShapeTypeList, 1) +var _SearchResultList_member *smithy.Schema + +var _SearchSchema = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "SearchSchema", +}, smithy.ShapeTypeList, 1) +var _SearchSchema_member *smithy.Schema + +var SearchSchemaElement = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "SearchSchemaElement", +}, smithy.ShapeTypeStructure, 2) +var SearchSchemaElement_AttributeName *smithy.Schema + +var SearchSchemaElement_SearchSchemaElementType *smithy.Schema + +var SearchSchemaElementType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "SearchSchemaElementType", +}, smithy.ShapeTypeEnum, 2) +var SearchSchemaElementType_HASH *smithy.Schema + +var SearchSchemaElementType_INLINE_FILTER *smithy.Schema + +var _SearchVectorList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "SearchVectorList", +}, smithy.ShapeTypeList, 1) +var _SearchVectorList_member *smithy.Schema + +var _SecondaryIndexesCapacityMap = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "SecondaryIndexesCapacityMap", +}, smithy.ShapeTypeMap, 2) +var _SecondaryIndexesCapacityMap_key *smithy.Schema + +var _SecondaryIndexesCapacityMap_value *smithy.Schema + +var Select = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "Select", +}, smithy.ShapeTypeEnum, 4) +var Select_ALL_ATTRIBUTES *smithy.Schema + +var Select_ALL_PROJECTED_ATTRIBUTES *smithy.Schema + +var Select_SPECIFIC_ATTRIBUTES *smithy.Schema + +var Select_COUNT *smithy.Schema + +var SourceTableDetails = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "SourceTableDetails", +}, smithy.ShapeTypeStructure, 10) +var SourceTableDetails_TableName *smithy.Schema + +var SourceTableDetails_TableId *smithy.Schema + +var SourceTableDetails_TableArn *smithy.Schema + +var SourceTableDetails_TableSizeBytes *smithy.Schema + +var SourceTableDetails_KeySchema *smithy.Schema + +var SourceTableDetails_TableCreationDateTime *smithy.Schema + +var SourceTableDetails_ProvisionedThroughput *smithy.Schema + +var SourceTableDetails_OnDemandThroughput *smithy.Schema + +var SourceTableDetails_ItemCount *smithy.Schema + +var SourceTableDetails_BillingMode *smithy.Schema + +var SourceTableFeatureDetails = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "SourceTableFeatureDetails", +}, smithy.ShapeTypeStructure, 6) +var SourceTableFeatureDetails_LocalSecondaryIndexes *smithy.Schema + +var SourceTableFeatureDetails_GlobalSecondaryIndexes *smithy.Schema + +var SourceTableFeatureDetails_StreamDescription *smithy.Schema + +var SourceTableFeatureDetails_TimeToLiveDescription *smithy.Schema + +var SourceTableFeatureDetails_SSEDescription *smithy.Schema + +var SourceTableFeatureDetails_VectorIndexes *smithy.Schema + +var SSEDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "SSEDescription", +}, smithy.ShapeTypeStructure, 4) +var SSEDescription_Status *smithy.Schema + +var SSEDescription_SSEType *smithy.Schema + +var SSEDescription_KMSMasterKeyArn *smithy.Schema + +var SSEDescription_InaccessibleEncryptionDateTime *smithy.Schema + +var _SSEEnabled = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "SSEEnabled", +}, smithy.ShapeTypeBoolean, 0) + +var SSESpecification = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "SSESpecification", +}, smithy.ShapeTypeStructure, 3) +var SSESpecification_Enabled *smithy.Schema + +var SSESpecification_SSEType *smithy.Schema + +var SSESpecification_KMSMasterKeyId *smithy.Schema + +var SSEStatus = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "SSEStatus", +}, smithy.ShapeTypeEnum, 5) +var SSEStatus_ENABLING *smithy.Schema + +var SSEStatus_ENABLED *smithy.Schema + +var SSEStatus_DISABLING *smithy.Schema + +var SSEStatus_DISABLED *smithy.Schema + +var SSEStatus_UPDATING *smithy.Schema + +var SSEType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "SSEType", +}, smithy.ShapeTypeEnum, 2) +var SSEType_AES256 *smithy.Schema + +var SSEType_KMS *smithy.Schema + +var _StreamArn = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "StreamArn", +}, smithy.ShapeTypeString, 0) + +var _StreamEnabled = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "StreamEnabled", +}, smithy.ShapeTypeBoolean, 0) + +var StreamSpecification = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "StreamSpecification", +}, smithy.ShapeTypeStructure, 2) +var StreamSpecification_StreamEnabled *smithy.Schema + +var StreamSpecification_StreamViewType *smithy.Schema + +var StreamViewType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "StreamViewType", +}, smithy.ShapeTypeEnum, 4) +var StreamViewType_NEW_IMAGE *smithy.Schema + +var StreamViewType_OLD_IMAGE *smithy.Schema + +var StreamViewType_NEW_AND_OLD_IMAGES *smithy.Schema + +var StreamViewType_KEYS_ONLY *smithy.Schema + +var _String = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "String", +}, smithy.ShapeTypeString, 0) + +var _StringAttributeValue = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "StringAttributeValue", +}, smithy.ShapeTypeString, 0) + +var _StringSetAttributeValue = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "StringSetAttributeValue", +}, smithy.ShapeTypeList, 1) +var _StringSetAttributeValue_member *smithy.Schema + +var TableAlreadyExistsException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TableAlreadyExistsException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}) +var TableAlreadyExistsException_message *smithy.Schema + +var _TableArn = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TableArn", +}, smithy.ShapeTypeString, 0) + +var TableAutoScalingDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TableAutoScalingDescription", +}, smithy.ShapeTypeStructure, 3) +var TableAutoScalingDescription_TableName *smithy.Schema + +var TableAutoScalingDescription_TableStatus *smithy.Schema + +var TableAutoScalingDescription_Replicas *smithy.Schema + +var TableClass = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TableClass", +}, smithy.ShapeTypeEnum, 2) +var TableClass_STANDARD *smithy.Schema + +var TableClass_STANDARD_INFREQUENT_ACCESS *smithy.Schema + +var TableClassSummary = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TableClassSummary", +}, smithy.ShapeTypeStructure, 2) +var TableClassSummary_TableClass *smithy.Schema + +var TableClassSummary_LastUpdateDateTime *smithy.Schema + +var _TableCreationDateTime = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TableCreationDateTime", +}, smithy.ShapeTypeTimestamp, 0) + +var TableCreationParameters = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TableCreationParameters", +}, smithy.ShapeTypeStructure, 9) +var TableCreationParameters_TableName *smithy.Schema + +var TableCreationParameters_AttributeDefinitions *smithy.Schema + +var TableCreationParameters_KeySchema *smithy.Schema + +var TableCreationParameters_BillingMode *smithy.Schema + +var TableCreationParameters_ProvisionedThroughput *smithy.Schema + +var TableCreationParameters_OnDemandThroughput *smithy.Schema + +var TableCreationParameters_SSESpecification *smithy.Schema + +var TableCreationParameters_GlobalSecondaryIndexes *smithy.Schema + +var TableCreationParameters_VectorIndexes *smithy.Schema + +var TableDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TableDescription", +}, smithy.ShapeTypeStructure, 29) +var TableDescription_AttributeDefinitions *smithy.Schema + +var TableDescription_TableName *smithy.Schema + +var TableDescription_KeySchema *smithy.Schema + +var TableDescription_TableStatus *smithy.Schema + +var TableDescription_CreationDateTime *smithy.Schema + +var TableDescription_ProvisionedThroughput *smithy.Schema + +var TableDescription_TableSizeBytes *smithy.Schema + +var TableDescription_ItemCount *smithy.Schema + +var TableDescription_TableArn *smithy.Schema + +var TableDescription_TableId *smithy.Schema + +var TableDescription_BillingModeSummary *smithy.Schema + +var TableDescription_LocalSecondaryIndexes *smithy.Schema + +var TableDescription_GlobalSecondaryIndexes *smithy.Schema + +var TableDescription_StreamSpecification *smithy.Schema + +var TableDescription_LatestStreamLabel *smithy.Schema + +var TableDescription_LatestStreamArn *smithy.Schema + +var TableDescription_GlobalTableVersion *smithy.Schema + +var TableDescription_Replicas *smithy.Schema + +var TableDescription_GlobalTableWitnesses *smithy.Schema + +var TableDescription_GlobalTableSettingsReplicationMode *smithy.Schema + +var TableDescription_RestoreSummary *smithy.Schema + +var TableDescription_SSEDescription *smithy.Schema + +var TableDescription_ArchivalSummary *smithy.Schema + +var TableDescription_TableClassSummary *smithy.Schema + +var TableDescription_DeletionProtectionEnabled *smithy.Schema + +var TableDescription_OnDemandThroughput *smithy.Schema + +var TableDescription_WarmThroughput *smithy.Schema + +var TableDescription_MultiRegionConsistency *smithy.Schema + +var TableDescription_VectorIndexes *smithy.Schema + +var _TableId = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TableId", +}, smithy.ShapeTypeString, 0) + +var TableInUseException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TableInUseException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}) +var TableInUseException_message *smithy.Schema + +var _TableName = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TableName", +}, smithy.ShapeTypeString, 0) + +var _TableNameList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TableNameList", +}, smithy.ShapeTypeList, 1) +var _TableNameList_member *smithy.Schema + +var TableNotFoundException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TableNotFoundException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}) +var TableNotFoundException_message *smithy.Schema + +var TableStatus = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TableStatus", +}, smithy.ShapeTypeEnum, 8) +var TableStatus_CREATING *smithy.Schema + +var TableStatus_UPDATING *smithy.Schema + +var TableStatus_DELETING *smithy.Schema + +var TableStatus_ACTIVE *smithy.Schema + +var TableStatus_INACCESSIBLE_ENCRYPTION_CREDENTIALS *smithy.Schema + +var TableStatus_ARCHIVING *smithy.Schema + +var TableStatus_ARCHIVED *smithy.Schema + +var TableStatus_REPLICATION_NOT_AUTHORIZED *smithy.Schema + +var TableWarmThroughputDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TableWarmThroughputDescription", +}, smithy.ShapeTypeStructure, 3) +var TableWarmThroughputDescription_ReadUnitsPerSecond *smithy.Schema + +var TableWarmThroughputDescription_WriteUnitsPerSecond *smithy.Schema + +var TableWarmThroughputDescription_Status *smithy.Schema + +var Tag = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "Tag", +}, smithy.ShapeTypeStructure, 2) +var Tag_Key *smithy.Schema + +var Tag_Value *smithy.Schema + +var _TagKeyList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TagKeyList", +}, smithy.ShapeTypeList, 1) +var _TagKeyList_member *smithy.Schema + +var _TagKeyString = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TagKeyString", +}, smithy.ShapeTypeString, 0) + +var _TagList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TagList", +}, smithy.ShapeTypeList, 1) +var _TagList_member *smithy.Schema + +var _TagValueString = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TagValueString", +}, smithy.ShapeTypeString, 0) + +var ThrottlingException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ThrottlingException", +}, smithy.ShapeTypeStructure, 2, &smithytraits.Error{Type: "client"}, + &smithytraits.HTTPError{Code: 400}, + &smithytraits.AWSQueryError{ErrorCode: "Throttling", + StatusCode: 400}) +var ThrottlingException_message *smithy.Schema + +var ThrottlingException_throttlingReasons *smithy.Schema + +var ThrottlingReason = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ThrottlingReason", +}, smithy.ShapeTypeStructure, 2) +var ThrottlingReason_reason *smithy.Schema + +var ThrottlingReason_resource *smithy.Schema + +var _ThrottlingReasonList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ThrottlingReasonList", +}, smithy.ShapeTypeList, 1) +var _ThrottlingReasonList_member *smithy.Schema + +var _TimeRangeLowerBound = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TimeRangeLowerBound", +}, smithy.ShapeTypeTimestamp, 0) + +var _TimeRangeUpperBound = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TimeRangeUpperBound", +}, smithy.ShapeTypeTimestamp, 0) + +var _TimeToLiveAttributeName = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TimeToLiveAttributeName", +}, smithy.ShapeTypeString, 0) + +var TimeToLiveDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TimeToLiveDescription", +}, smithy.ShapeTypeStructure, 2) +var TimeToLiveDescription_TimeToLiveStatus *smithy.Schema + +var TimeToLiveDescription_AttributeName *smithy.Schema + +var _TimeToLiveEnabled = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TimeToLiveEnabled", +}, smithy.ShapeTypeBoolean, 0) + +var TimeToLiveSpecification = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TimeToLiveSpecification", +}, smithy.ShapeTypeStructure, 2) +var TimeToLiveSpecification_Enabled *smithy.Schema + +var TimeToLiveSpecification_AttributeName *smithy.Schema + +var TimeToLiveStatus = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TimeToLiveStatus", +}, smithy.ShapeTypeEnum, 4) +var TimeToLiveStatus_ENABLING *smithy.Schema + +var TimeToLiveStatus_DISABLING *smithy.Schema + +var TimeToLiveStatus_ENABLED *smithy.Schema + +var TimeToLiveStatus_DISABLED *smithy.Schema + +var _TopKInteger = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TopKInteger", +}, smithy.ShapeTypeInteger, 0) + +var TransactGetItem = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TransactGetItem", +}, smithy.ShapeTypeStructure, 1) +var TransactGetItem_Get *smithy.Schema + +var _TransactGetItemList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TransactGetItemList", +}, smithy.ShapeTypeList, 1) +var _TransactGetItemList_member *smithy.Schema + +var TransactionCanceledException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TransactionCanceledException", +}, smithy.ShapeTypeStructure, 2, &smithytraits.Error{Type: "client"}) +var TransactionCanceledException_Message *smithy.Schema + +var TransactionCanceledException_CancellationReasons *smithy.Schema + +var TransactionConflictException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TransactionConflictException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}) +var TransactionConflictException_message *smithy.Schema + +var TransactionInProgressException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TransactionInProgressException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}) +var TransactionInProgressException_Message *smithy.Schema + +var TransactWriteItem = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TransactWriteItem", +}, smithy.ShapeTypeStructure, 4) +var TransactWriteItem_ConditionCheck *smithy.Schema + +var TransactWriteItem_Put *smithy.Schema + +var TransactWriteItem_Delete *smithy.Schema + +var TransactWriteItem_Update *smithy.Schema + +var _TransactWriteItemList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TransactWriteItemList", +}, smithy.ShapeTypeList, 1) +var _TransactWriteItemList_member *smithy.Schema + +var Update = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "Update", +}, smithy.ShapeTypeStructure, 7) +var Update_Key *smithy.Schema + +var Update_UpdateExpression *smithy.Schema + +var Update_TableName *smithy.Schema + +var Update_ConditionExpression *smithy.Schema + +var Update_ExpressionAttributeNames *smithy.Schema + +var Update_ExpressionAttributeValues *smithy.Schema + +var Update_ReturnValuesOnConditionCheckFailure *smithy.Schema + +var _UpdateExpression = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateExpression", +}, smithy.ShapeTypeString, 0) + +var UpdateGlobalSecondaryIndexAction = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateGlobalSecondaryIndexAction", +}, smithy.ShapeTypeStructure, 4) +var UpdateGlobalSecondaryIndexAction_IndexName *smithy.Schema + +var UpdateGlobalSecondaryIndexAction_ProvisionedThroughput *smithy.Schema + +var UpdateGlobalSecondaryIndexAction_OnDemandThroughput *smithy.Schema + +var UpdateGlobalSecondaryIndexAction_WarmThroughput *smithy.Schema + +var UpdateKinesisStreamingConfiguration = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateKinesisStreamingConfiguration", +}, smithy.ShapeTypeStructure, 1) +var UpdateKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision *smithy.Schema + +var UpdateReplicationGroupMemberAction = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateReplicationGroupMemberAction", +}, smithy.ShapeTypeStructure, 6) +var UpdateReplicationGroupMemberAction_RegionName *smithy.Schema + +var UpdateReplicationGroupMemberAction_KMSMasterKeyId *smithy.Schema + +var UpdateReplicationGroupMemberAction_ProvisionedThroughputOverride *smithy.Schema + +var UpdateReplicationGroupMemberAction_OnDemandThroughputOverride *smithy.Schema + +var UpdateReplicationGroupMemberAction_GlobalSecondaryIndexes *smithy.Schema + +var UpdateReplicationGroupMemberAction_TableClassOverride *smithy.Schema + +var VectorAttributeDefinition = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "VectorAttributeDefinition", +}, smithy.ShapeTypeStructure, 1) +var VectorAttributeDefinition_AttributeName *smithy.Schema + +var _VectorAttributeName = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "VectorAttributeName", +}, smithy.ShapeTypeString, 0) + +var VectorCapacity = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "VectorCapacity", +}, smithy.ShapeTypeStructure, 2) +var VectorCapacity_VectorSearchRequestBytes *smithy.Schema + +var VectorCapacity_VectorWriteRequestBytes *smithy.Schema + +var VectorDistanceFunction = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "VectorDistanceFunction", +}, smithy.ShapeTypeEnum, 3) +var VectorDistanceFunction_COSINE *smithy.Schema + +var VectorDistanceFunction_DOT_PRODUCT *smithy.Schema + +var VectorDistanceFunction_EUCLIDEAN *smithy.Schema + +var VectorIndex = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "VectorIndex", +}, smithy.ShapeTypeStructure, 6) +var VectorIndex_IndexName *smithy.Schema + +var VectorIndex_VectorAttribute *smithy.Schema + +var VectorIndex_SearchSchema *smithy.Schema + +var VectorIndex_Projection *smithy.Schema + +var VectorIndex_Dimensions *smithy.Schema + +var VectorIndex_DistanceFunction *smithy.Schema + +var VectorIndexDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "VectorIndexDescription", +}, smithy.ShapeTypeStructure, 11) +var VectorIndexDescription_IndexName *smithy.Schema + +var VectorIndexDescription_SearchSchema *smithy.Schema + +var VectorIndexDescription_Projection *smithy.Schema + +var VectorIndexDescription_VectorAttribute *smithy.Schema + +var VectorIndexDescription_Dimensions *smithy.Schema + +var VectorIndexDescription_DistanceFunction *smithy.Schema + +var VectorIndexDescription_IndexStatus *smithy.Schema + +var VectorIndexDescription_Backfilling *smithy.Schema + +var VectorIndexDescription_IndexSizeBytes *smithy.Schema + +var VectorIndexDescription_ItemCount *smithy.Schema + +var VectorIndexDescription_IndexArn *smithy.Schema + +var _VectorIndexDescriptionList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "VectorIndexDescriptionList", +}, smithy.ShapeTypeList, 1) +var _VectorIndexDescriptionList_member *smithy.Schema + +var _VectorIndexes = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "VectorIndexes", +}, smithy.ShapeTypeList, 1) +var _VectorIndexes_member *smithy.Schema + +var _VectorIndexesCapacityMap = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "VectorIndexesCapacityMap", +}, smithy.ShapeTypeMap, 2) +var _VectorIndexesCapacityMap_key *smithy.Schema + +var _VectorIndexesCapacityMap_value *smithy.Schema + +var VectorIndexInfo = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "VectorIndexInfo", +}, smithy.ShapeTypeStructure, 6) +var VectorIndexInfo_IndexName *smithy.Schema + +var VectorIndexInfo_VectorAttribute *smithy.Schema + +var VectorIndexInfo_SearchSchema *smithy.Schema + +var VectorIndexInfo_Projection *smithy.Schema + +var VectorIndexInfo_Dimensions *smithy.Schema + +var VectorIndexInfo_DistanceFunction *smithy.Schema + +var _VectorIndexList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "VectorIndexList", +}, smithy.ShapeTypeList, 1) +var _VectorIndexList_member *smithy.Schema + +var VectorIndexUpdate = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "VectorIndexUpdate", +}, smithy.ShapeTypeStructure, 2) +var VectorIndexUpdate_Create *smithy.Schema + +var VectorIndexUpdate_Delete *smithy.Schema + +var _VectorIndexUpdateList = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "VectorIndexUpdateList", +}, smithy.ShapeTypeList, 1) +var _VectorIndexUpdateList_member *smithy.Schema + +var WarmThroughput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "WarmThroughput", +}, smithy.ShapeTypeStructure, 2) +var WarmThroughput_ReadUnitsPerSecond *smithy.Schema + +var WarmThroughput_WriteUnitsPerSecond *smithy.Schema + +var WitnessStatus = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "WitnessStatus", +}, smithy.ShapeTypeEnum, 3) +var WitnessStatus_CREATING *smithy.Schema + +var WitnessStatus_DELETING *smithy.Schema + +var WitnessStatus_ACTIVE *smithy.Schema + +var WriteRequest = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "WriteRequest", +}, smithy.ShapeTypeStructure, 2) +var WriteRequest_PutRequest *smithy.Schema + +var WriteRequest_DeleteRequest *smithy.Schema + +var _WriteRequests = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "WriteRequests", +}, smithy.ShapeTypeList, 1) +var _WriteRequests_member *smithy.Schema + +var BatchExecuteStatementInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BatchExecuteStatementInput", +}, smithy.ShapeTypeStructure, 2) +var BatchExecuteStatementInput_Statements *smithy.Schema + +var BatchExecuteStatementInput_ReturnConsumedCapacity *smithy.Schema + +var BatchExecuteStatementOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BatchExecuteStatementOutput", +}, smithy.ShapeTypeStructure, 2) +var BatchExecuteStatementOutput_Responses *smithy.Schema + +var BatchExecuteStatementOutput_ConsumedCapacity *smithy.Schema + +var BatchGetItemInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BatchGetItemInput", +}, smithy.ShapeTypeStructure, 2) +var BatchGetItemInput_RequestItems *smithy.Schema + +var BatchGetItemInput_ReturnConsumedCapacity *smithy.Schema + +var BatchGetItemOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BatchGetItemOutput", +}, smithy.ShapeTypeStructure, 3) +var BatchGetItemOutput_Responses *smithy.Schema + +var BatchGetItemOutput_UnprocessedKeys *smithy.Schema + +var BatchGetItemOutput_ConsumedCapacity *smithy.Schema + +var BatchWriteItemInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BatchWriteItemInput", +}, smithy.ShapeTypeStructure, 3) +var BatchWriteItemInput_RequestItems *smithy.Schema + +var BatchWriteItemInput_ReturnConsumedCapacity *smithy.Schema + +var BatchWriteItemInput_ReturnItemCollectionMetrics *smithy.Schema + +var BatchWriteItemOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "BatchWriteItemOutput", +}, smithy.ShapeTypeStructure, 3) +var BatchWriteItemOutput_UnprocessedItems *smithy.Schema + +var BatchWriteItemOutput_ItemCollectionMetrics *smithy.Schema + +var BatchWriteItemOutput_ConsumedCapacity *smithy.Schema + +var CreateBackupInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "CreateBackupInput", +}, smithy.ShapeTypeStructure, 2) +var CreateBackupInput_TableName *smithy.Schema + +var CreateBackupInput_BackupName *smithy.Schema + +var CreateBackupOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "CreateBackupOutput", +}, smithy.ShapeTypeStructure, 1) +var CreateBackupOutput_BackupDetails *smithy.Schema + +var CreateGlobalTableInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "CreateGlobalTableInput", +}, smithy.ShapeTypeStructure, 2) +var CreateGlobalTableInput_GlobalTableName *smithy.Schema + +var CreateGlobalTableInput_ReplicationGroup *smithy.Schema + +var CreateGlobalTableOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "CreateGlobalTableOutput", +}, smithy.ShapeTypeStructure, 1) +var CreateGlobalTableOutput_GlobalTableDescription *smithy.Schema + +var CreateTableInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "CreateTableInput", +}, smithy.ShapeTypeStructure, 18) +var CreateTableInput_AttributeDefinitions *smithy.Schema + +var CreateTableInput_TableName *smithy.Schema + +var CreateTableInput_KeySchema *smithy.Schema + +var CreateTableInput_LocalSecondaryIndexes *smithy.Schema + +var CreateTableInput_GlobalSecondaryIndexes *smithy.Schema + +var CreateTableInput_BillingMode *smithy.Schema + +var CreateTableInput_ProvisionedThroughput *smithy.Schema + +var CreateTableInput_StreamSpecification *smithy.Schema + +var CreateTableInput_SSESpecification *smithy.Schema + +var CreateTableInput_Tags *smithy.Schema + +var CreateTableInput_TableClass *smithy.Schema + +var CreateTableInput_DeletionProtectionEnabled *smithy.Schema + +var CreateTableInput_WarmThroughput *smithy.Schema + +var CreateTableInput_ResourcePolicy *smithy.Schema + +var CreateTableInput_OnDemandThroughput *smithy.Schema + +var CreateTableInput_GlobalTableSourceArn *smithy.Schema + +var CreateTableInput_GlobalTableSettingsReplicationMode *smithy.Schema + +var CreateTableInput_VectorIndexes *smithy.Schema + +var CreateTableOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "CreateTableOutput", +}, smithy.ShapeTypeStructure, 1) +var CreateTableOutput_TableDescription *smithy.Schema + +var DeleteBackupInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DeleteBackupInput", +}, smithy.ShapeTypeStructure, 1) +var DeleteBackupInput_BackupArn *smithy.Schema + +var DeleteBackupOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DeleteBackupOutput", +}, smithy.ShapeTypeStructure, 1) +var DeleteBackupOutput_BackupDescription *smithy.Schema + +var DeleteItemInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DeleteItemInput", +}, smithy.ShapeTypeStructure, 11) +var DeleteItemInput_TableName *smithy.Schema + +var DeleteItemInput_Key *smithy.Schema + +var DeleteItemInput_Expected *smithy.Schema + +var DeleteItemInput_ConditionalOperator *smithy.Schema + +var DeleteItemInput_ReturnValues *smithy.Schema + +var DeleteItemInput_ReturnConsumedCapacity *smithy.Schema + +var DeleteItemInput_ReturnItemCollectionMetrics *smithy.Schema + +var DeleteItemInput_ConditionExpression *smithy.Schema + +var DeleteItemInput_ExpressionAttributeNames *smithy.Schema + +var DeleteItemInput_ExpressionAttributeValues *smithy.Schema + +var DeleteItemInput_ReturnValuesOnConditionCheckFailure *smithy.Schema + +var DeleteItemOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DeleteItemOutput", +}, smithy.ShapeTypeStructure, 3) +var DeleteItemOutput_Attributes *smithy.Schema + +var DeleteItemOutput_ConsumedCapacity *smithy.Schema + +var DeleteItemOutput_ItemCollectionMetrics *smithy.Schema + +var DeleteResourcePolicyInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DeleteResourcePolicyInput", +}, smithy.ShapeTypeStructure, 2) +var DeleteResourcePolicyInput_ResourceArn *smithy.Schema + +var DeleteResourcePolicyInput_ExpectedRevisionId *smithy.Schema + +var DeleteResourcePolicyOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DeleteResourcePolicyOutput", +}, smithy.ShapeTypeStructure, 1) +var DeleteResourcePolicyOutput_RevisionId *smithy.Schema + +var DeleteTableInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DeleteTableInput", +}, smithy.ShapeTypeStructure, 1) +var DeleteTableInput_TableName *smithy.Schema + +var DeleteTableOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DeleteTableOutput", +}, smithy.ShapeTypeStructure, 1) +var DeleteTableOutput_TableDescription *smithy.Schema + +var DescribeBackupInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeBackupInput", +}, smithy.ShapeTypeStructure, 1) +var DescribeBackupInput_BackupArn *smithy.Schema + +var DescribeBackupOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeBackupOutput", +}, smithy.ShapeTypeStructure, 1) +var DescribeBackupOutput_BackupDescription *smithy.Schema + +var DescribeContinuousBackupsInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeContinuousBackupsInput", +}, smithy.ShapeTypeStructure, 1) +var DescribeContinuousBackupsInput_TableName *smithy.Schema + +var DescribeContinuousBackupsOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeContinuousBackupsOutput", +}, smithy.ShapeTypeStructure, 1) +var DescribeContinuousBackupsOutput_ContinuousBackupsDescription *smithy.Schema + +var DescribeContributorInsightsInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeContributorInsightsInput", +}, smithy.ShapeTypeStructure, 2) +var DescribeContributorInsightsInput_TableName *smithy.Schema + +var DescribeContributorInsightsInput_IndexName *smithy.Schema + +var DescribeContributorInsightsOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeContributorInsightsOutput", +}, smithy.ShapeTypeStructure, 7) +var DescribeContributorInsightsOutput_TableName *smithy.Schema + +var DescribeContributorInsightsOutput_IndexName *smithy.Schema + +var DescribeContributorInsightsOutput_ContributorInsightsRuleList *smithy.Schema + +var DescribeContributorInsightsOutput_ContributorInsightsStatus *smithy.Schema + +var DescribeContributorInsightsOutput_LastUpdateDateTime *smithy.Schema + +var DescribeContributorInsightsOutput_FailureException *smithy.Schema + +var DescribeContributorInsightsOutput_ContributorInsightsMode *smithy.Schema + +var DescribeEndpointsRequest = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeEndpointsRequest", +}, smithy.ShapeTypeStructure, 0) + +var DescribeEndpointsResponse = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeEndpointsResponse", +}, smithy.ShapeTypeStructure, 1) +var DescribeEndpointsResponse_Endpoints *smithy.Schema + +var DescribeExportInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeExportInput", +}, smithy.ShapeTypeStructure, 1) +var DescribeExportInput_ExportArn *smithy.Schema + +var DescribeExportOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeExportOutput", +}, smithy.ShapeTypeStructure, 1) +var DescribeExportOutput_ExportDescription *smithy.Schema + +var DescribeGlobalTableInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeGlobalTableInput", +}, smithy.ShapeTypeStructure, 1) +var DescribeGlobalTableInput_GlobalTableName *smithy.Schema + +var DescribeGlobalTableOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeGlobalTableOutput", +}, smithy.ShapeTypeStructure, 1) +var DescribeGlobalTableOutput_GlobalTableDescription *smithy.Schema + +var DescribeGlobalTableSettingsInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeGlobalTableSettingsInput", +}, smithy.ShapeTypeStructure, 1) +var DescribeGlobalTableSettingsInput_GlobalTableName *smithy.Schema + +var DescribeGlobalTableSettingsOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeGlobalTableSettingsOutput", +}, smithy.ShapeTypeStructure, 2) +var DescribeGlobalTableSettingsOutput_GlobalTableName *smithy.Schema + +var DescribeGlobalTableSettingsOutput_ReplicaSettings *smithy.Schema + +var DescribeImportInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeImportInput", +}, smithy.ShapeTypeStructure, 1) +var DescribeImportInput_ImportArn *smithy.Schema + +var DescribeImportOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeImportOutput", +}, smithy.ShapeTypeStructure, 1) +var DescribeImportOutput_ImportTableDescription *smithy.Schema + +var DescribeKinesisStreamingDestinationInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeKinesisStreamingDestinationInput", +}, smithy.ShapeTypeStructure, 1) +var DescribeKinesisStreamingDestinationInput_TableName *smithy.Schema + +var DescribeKinesisStreamingDestinationOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeKinesisStreamingDestinationOutput", +}, smithy.ShapeTypeStructure, 2) +var DescribeKinesisStreamingDestinationOutput_TableName *smithy.Schema + +var DescribeKinesisStreamingDestinationOutput_KinesisDataStreamDestinations *smithy.Schema + +var DescribeLimitsInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeLimitsInput", +}, smithy.ShapeTypeStructure, 0) + +var DescribeLimitsOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeLimitsOutput", +}, smithy.ShapeTypeStructure, 4) +var DescribeLimitsOutput_AccountMaxReadCapacityUnits *smithy.Schema + +var DescribeLimitsOutput_AccountMaxWriteCapacityUnits *smithy.Schema + +var DescribeLimitsOutput_TableMaxReadCapacityUnits *smithy.Schema + +var DescribeLimitsOutput_TableMaxWriteCapacityUnits *smithy.Schema + +var DescribeTableInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeTableInput", +}, smithy.ShapeTypeStructure, 1) +var DescribeTableInput_TableName *smithy.Schema + +var DescribeTableOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeTableOutput", +}, smithy.ShapeTypeStructure, 1) +var DescribeTableOutput_Table *smithy.Schema + +var DescribeTableReplicaAutoScalingInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeTableReplicaAutoScalingInput", +}, smithy.ShapeTypeStructure, 1) +var DescribeTableReplicaAutoScalingInput_TableName *smithy.Schema + +var DescribeTableReplicaAutoScalingOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeTableReplicaAutoScalingOutput", +}, smithy.ShapeTypeStructure, 1) +var DescribeTableReplicaAutoScalingOutput_TableAutoScalingDescription *smithy.Schema + +var DescribeTimeToLiveInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeTimeToLiveInput", +}, smithy.ShapeTypeStructure, 1) +var DescribeTimeToLiveInput_TableName *smithy.Schema + +var DescribeTimeToLiveOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "DescribeTimeToLiveOutput", +}, smithy.ShapeTypeStructure, 1) +var DescribeTimeToLiveOutput_TimeToLiveDescription *smithy.Schema + +var KinesisStreamingDestinationInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "KinesisStreamingDestinationInput", +}, smithy.ShapeTypeStructure, 3) +var KinesisStreamingDestinationInput_TableName *smithy.Schema + +var KinesisStreamingDestinationInput_StreamArn *smithy.Schema + +var KinesisStreamingDestinationInput_EnableKinesisStreamingConfiguration *smithy.Schema + +var KinesisStreamingDestinationOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "KinesisStreamingDestinationOutput", +}, smithy.ShapeTypeStructure, 4) +var KinesisStreamingDestinationOutput_TableName *smithy.Schema + +var KinesisStreamingDestinationOutput_StreamArn *smithy.Schema + +var KinesisStreamingDestinationOutput_DestinationStatus *smithy.Schema + +var KinesisStreamingDestinationOutput_EnableKinesisStreamingConfiguration *smithy.Schema + +var ExecuteStatementInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExecuteStatementInput", +}, smithy.ShapeTypeStructure, 7) +var ExecuteStatementInput_Statement *smithy.Schema + +var ExecuteStatementInput_Parameters *smithy.Schema + +var ExecuteStatementInput_ConsistentRead *smithy.Schema + +var ExecuteStatementInput_NextToken *smithy.Schema + +var ExecuteStatementInput_ReturnConsumedCapacity *smithy.Schema + +var ExecuteStatementInput_Limit *smithy.Schema + +var ExecuteStatementInput_ReturnValuesOnConditionCheckFailure *smithy.Schema + +var ExecuteStatementOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExecuteStatementOutput", +}, smithy.ShapeTypeStructure, 4) +var ExecuteStatementOutput_Items *smithy.Schema + +var ExecuteStatementOutput_NextToken *smithy.Schema + +var ExecuteStatementOutput_ConsumedCapacity *smithy.Schema + +var ExecuteStatementOutput_LastEvaluatedKey *smithy.Schema + +var ExecuteTransactionInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExecuteTransactionInput", +}, smithy.ShapeTypeStructure, 3) +var ExecuteTransactionInput_TransactStatements *smithy.Schema + +var ExecuteTransactionInput_ClientRequestToken *smithy.Schema + +var ExecuteTransactionInput_ReturnConsumedCapacity *smithy.Schema + +var ExecuteTransactionOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExecuteTransactionOutput", +}, smithy.ShapeTypeStructure, 2) +var ExecuteTransactionOutput_Responses *smithy.Schema + +var ExecuteTransactionOutput_ConsumedCapacity *smithy.Schema + +var ExportTableToPointInTimeInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExportTableToPointInTimeInput", +}, smithy.ShapeTypeStructure, 12) +var ExportTableToPointInTimeInput_TableArn *smithy.Schema + +var ExportTableToPointInTimeInput_ExportTime *smithy.Schema + +var ExportTableToPointInTimeInput_ClientToken *smithy.Schema + +var ExportTableToPointInTimeInput_S3Bucket *smithy.Schema + +var ExportTableToPointInTimeInput_S3BucketOwner *smithy.Schema + +var ExportTableToPointInTimeInput_S3Prefix *smithy.Schema + +var ExportTableToPointInTimeInput_S3SseAlgorithm *smithy.Schema + +var ExportTableToPointInTimeInput_S3SseKmsKeyId *smithy.Schema + +var ExportTableToPointInTimeInput_ExportFormat *smithy.Schema + +var ExportTableToPointInTimeInput_ExportType *smithy.Schema + +var ExportTableToPointInTimeInput_IncrementalExportSpecification *smithy.Schema + +var ExportTableToPointInTimeInput_FilterSpecification *smithy.Schema + +var ExportTableToPointInTimeOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ExportTableToPointInTimeOutput", +}, smithy.ShapeTypeStructure, 1) +var ExportTableToPointInTimeOutput_ExportDescription *smithy.Schema + +var GetItemInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GetItemInput", +}, smithy.ShapeTypeStructure, 7) +var GetItemInput_TableName *smithy.Schema + +var GetItemInput_Key *smithy.Schema + +var GetItemInput_AttributesToGet *smithy.Schema + +var GetItemInput_ConsistentRead *smithy.Schema + +var GetItemInput_ReturnConsumedCapacity *smithy.Schema + +var GetItemInput_ProjectionExpression *smithy.Schema + +var GetItemInput_ExpressionAttributeNames *smithy.Schema + +var GetItemOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GetItemOutput", +}, smithy.ShapeTypeStructure, 2) +var GetItemOutput_Item *smithy.Schema + +var GetItemOutput_ConsumedCapacity *smithy.Schema + +var GetResourcePolicyInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GetResourcePolicyInput", +}, smithy.ShapeTypeStructure, 1) +var GetResourcePolicyInput_ResourceArn *smithy.Schema + +var GetResourcePolicyOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "GetResourcePolicyOutput", +}, smithy.ShapeTypeStructure, 2) +var GetResourcePolicyOutput_Policy *smithy.Schema + +var GetResourcePolicyOutput_RevisionId *smithy.Schema + +var ImportTableInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ImportTableInput", +}, smithy.ShapeTypeStructure, 6) +var ImportTableInput_ClientToken *smithy.Schema + +var ImportTableInput_S3BucketSource *smithy.Schema + +var ImportTableInput_InputFormat *smithy.Schema + +var ImportTableInput_InputFormatOptions *smithy.Schema + +var ImportTableInput_InputCompressionType *smithy.Schema + +var ImportTableInput_TableCreationParameters *smithy.Schema + +var ImportTableOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ImportTableOutput", +}, smithy.ShapeTypeStructure, 1) +var ImportTableOutput_ImportTableDescription *smithy.Schema + +var ListBackupsInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ListBackupsInput", +}, smithy.ShapeTypeStructure, 6) +var ListBackupsInput_TableName *smithy.Schema + +var ListBackupsInput_Limit *smithy.Schema + +var ListBackupsInput_TimeRangeLowerBound *smithy.Schema + +var ListBackupsInput_TimeRangeUpperBound *smithy.Schema + +var ListBackupsInput_ExclusiveStartBackupArn *smithy.Schema + +var ListBackupsInput_BackupType *smithy.Schema + +var ListBackupsOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ListBackupsOutput", +}, smithy.ShapeTypeStructure, 2) +var ListBackupsOutput_BackupSummaries *smithy.Schema + +var ListBackupsOutput_LastEvaluatedBackupArn *smithy.Schema + +var ListContributorInsightsInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ListContributorInsightsInput", +}, smithy.ShapeTypeStructure, 3) +var ListContributorInsightsInput_TableName *smithy.Schema + +var ListContributorInsightsInput_NextToken *smithy.Schema + +var ListContributorInsightsInput_MaxResults *smithy.Schema + +var ListContributorInsightsOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ListContributorInsightsOutput", +}, smithy.ShapeTypeStructure, 2) +var ListContributorInsightsOutput_ContributorInsightsSummaries *smithy.Schema + +var ListContributorInsightsOutput_NextToken *smithy.Schema + +var ListExportsInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ListExportsInput", +}, smithy.ShapeTypeStructure, 3) +var ListExportsInput_TableArn *smithy.Schema + +var ListExportsInput_MaxResults *smithy.Schema + +var ListExportsInput_NextToken *smithy.Schema + +var ListExportsOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ListExportsOutput", +}, smithy.ShapeTypeStructure, 2) +var ListExportsOutput_ExportSummaries *smithy.Schema + +var ListExportsOutput_NextToken *smithy.Schema + +var ListGlobalTablesInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ListGlobalTablesInput", +}, smithy.ShapeTypeStructure, 3) +var ListGlobalTablesInput_ExclusiveStartGlobalTableName *smithy.Schema + +var ListGlobalTablesInput_Limit *smithy.Schema + +var ListGlobalTablesInput_RegionName *smithy.Schema + +var ListGlobalTablesOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ListGlobalTablesOutput", +}, smithy.ShapeTypeStructure, 2) +var ListGlobalTablesOutput_GlobalTables *smithy.Schema + +var ListGlobalTablesOutput_LastEvaluatedGlobalTableName *smithy.Schema + +var ListImportsInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ListImportsInput", +}, smithy.ShapeTypeStructure, 3) +var ListImportsInput_TableArn *smithy.Schema + +var ListImportsInput_PageSize *smithy.Schema + +var ListImportsInput_NextToken *smithy.Schema + +var ListImportsOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ListImportsOutput", +}, smithy.ShapeTypeStructure, 2) +var ListImportsOutput_ImportSummaryList *smithy.Schema + +var ListImportsOutput_NextToken *smithy.Schema + +var ListTablesInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ListTablesInput", +}, smithy.ShapeTypeStructure, 2) +var ListTablesInput_ExclusiveStartTableName *smithy.Schema + +var ListTablesInput_Limit *smithy.Schema + +var ListTablesOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ListTablesOutput", +}, smithy.ShapeTypeStructure, 2) +var ListTablesOutput_TableNames *smithy.Schema + +var ListTablesOutput_LastEvaluatedTableName *smithy.Schema + +var ListTagsOfResourceInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ListTagsOfResourceInput", +}, smithy.ShapeTypeStructure, 2) +var ListTagsOfResourceInput_ResourceArn *smithy.Schema + +var ListTagsOfResourceInput_NextToken *smithy.Schema + +var ListTagsOfResourceOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ListTagsOfResourceOutput", +}, smithy.ShapeTypeStructure, 2) +var ListTagsOfResourceOutput_Tags *smithy.Schema + +var ListTagsOfResourceOutput_NextToken *smithy.Schema + +var PutItemInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "PutItemInput", +}, smithy.ShapeTypeStructure, 11) +var PutItemInput_TableName *smithy.Schema + +var PutItemInput_Item *smithy.Schema + +var PutItemInput_Expected *smithy.Schema + +var PutItemInput_ReturnValues *smithy.Schema + +var PutItemInput_ReturnConsumedCapacity *smithy.Schema + +var PutItemInput_ReturnItemCollectionMetrics *smithy.Schema + +var PutItemInput_ConditionalOperator *smithy.Schema + +var PutItemInput_ConditionExpression *smithy.Schema + +var PutItemInput_ExpressionAttributeNames *smithy.Schema + +var PutItemInput_ExpressionAttributeValues *smithy.Schema + +var PutItemInput_ReturnValuesOnConditionCheckFailure *smithy.Schema + +var PutItemOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "PutItemOutput", +}, smithy.ShapeTypeStructure, 3) +var PutItemOutput_Attributes *smithy.Schema + +var PutItemOutput_ConsumedCapacity *smithy.Schema + +var PutItemOutput_ItemCollectionMetrics *smithy.Schema + +var PutResourcePolicyInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "PutResourcePolicyInput", +}, smithy.ShapeTypeStructure, 4) +var PutResourcePolicyInput_ResourceArn *smithy.Schema + +var PutResourcePolicyInput_Policy *smithy.Schema + +var PutResourcePolicyInput_ExpectedRevisionId *smithy.Schema + +var PutResourcePolicyInput_ConfirmRemoveSelfResourceAccess *smithy.Schema + +var PutResourcePolicyOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "PutResourcePolicyOutput", +}, smithy.ShapeTypeStructure, 1) +var PutResourcePolicyOutput_RevisionId *smithy.Schema + +var QueryInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "QueryInput", +}, smithy.ShapeTypeStructure, 17) +var QueryInput_TableName *smithy.Schema + +var QueryInput_IndexName *smithy.Schema + +var QueryInput_Select *smithy.Schema + +var QueryInput_AttributesToGet *smithy.Schema + +var QueryInput_Limit *smithy.Schema + +var QueryInput_ConsistentRead *smithy.Schema + +var QueryInput_KeyConditions *smithy.Schema + +var QueryInput_QueryFilter *smithy.Schema + +var QueryInput_ConditionalOperator *smithy.Schema + +var QueryInput_ScanIndexForward *smithy.Schema + +var QueryInput_ExclusiveStartKey *smithy.Schema + +var QueryInput_ReturnConsumedCapacity *smithy.Schema + +var QueryInput_ProjectionExpression *smithy.Schema + +var QueryInput_FilterExpression *smithy.Schema + +var QueryInput_KeyConditionExpression *smithy.Schema + +var QueryInput_ExpressionAttributeNames *smithy.Schema + +var QueryInput_ExpressionAttributeValues *smithy.Schema + +var QueryOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "QueryOutput", +}, smithy.ShapeTypeStructure, 5) +var QueryOutput_Items *smithy.Schema + +var QueryOutput_Count *smithy.Schema + +var QueryOutput_ScannedCount *smithy.Schema + +var QueryOutput_LastEvaluatedKey *smithy.Schema + +var QueryOutput_ConsumedCapacity *smithy.Schema + +var RestoreTableFromBackupInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "RestoreTableFromBackupInput", +}, smithy.ShapeTypeStructure, 9) +var RestoreTableFromBackupInput_TargetTableName *smithy.Schema + +var RestoreTableFromBackupInput_BackupArn *smithy.Schema + +var RestoreTableFromBackupInput_BillingModeOverride *smithy.Schema + +var RestoreTableFromBackupInput_GlobalSecondaryIndexOverride *smithy.Schema + +var RestoreTableFromBackupInput_LocalSecondaryIndexOverride *smithy.Schema + +var RestoreTableFromBackupInput_ProvisionedThroughputOverride *smithy.Schema + +var RestoreTableFromBackupInput_OnDemandThroughputOverride *smithy.Schema + +var RestoreTableFromBackupInput_SSESpecificationOverride *smithy.Schema + +var RestoreTableFromBackupInput_VectorIndexOverride *smithy.Schema + +var RestoreTableFromBackupOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "RestoreTableFromBackupOutput", +}, smithy.ShapeTypeStructure, 1) +var RestoreTableFromBackupOutput_TableDescription *smithy.Schema + +var RestoreTableToPointInTimeInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "RestoreTableToPointInTimeInput", +}, smithy.ShapeTypeStructure, 12) +var RestoreTableToPointInTimeInput_SourceTableArn *smithy.Schema + +var RestoreTableToPointInTimeInput_SourceTableName *smithy.Schema + +var RestoreTableToPointInTimeInput_TargetTableName *smithy.Schema + +var RestoreTableToPointInTimeInput_UseLatestRestorableTime *smithy.Schema + +var RestoreTableToPointInTimeInput_RestoreDateTime *smithy.Schema + +var RestoreTableToPointInTimeInput_BillingModeOverride *smithy.Schema + +var RestoreTableToPointInTimeInput_GlobalSecondaryIndexOverride *smithy.Schema + +var RestoreTableToPointInTimeInput_LocalSecondaryIndexOverride *smithy.Schema + +var RestoreTableToPointInTimeInput_ProvisionedThroughputOverride *smithy.Schema + +var RestoreTableToPointInTimeInput_OnDemandThroughputOverride *smithy.Schema + +var RestoreTableToPointInTimeInput_SSESpecificationOverride *smithy.Schema + +var RestoreTableToPointInTimeInput_VectorIndexOverride *smithy.Schema + +var RestoreTableToPointInTimeOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "RestoreTableToPointInTimeOutput", +}, smithy.ShapeTypeStructure, 1) +var RestoreTableToPointInTimeOutput_TableDescription *smithy.Schema + +var ScanInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ScanInput", +}, smithy.ShapeTypeStructure, 16) +var ScanInput_TableName *smithy.Schema + +var ScanInput_IndexName *smithy.Schema + +var ScanInput_AttributesToGet *smithy.Schema + +var ScanInput_Limit *smithy.Schema + +var ScanInput_Select *smithy.Schema + +var ScanInput_ScanFilter *smithy.Schema + +var ScanInput_ConditionalOperator *smithy.Schema + +var ScanInput_ExclusiveStartKey *smithy.Schema + +var ScanInput_ReturnConsumedCapacity *smithy.Schema + +var ScanInput_TotalSegments *smithy.Schema + +var ScanInput_Segment *smithy.Schema + +var ScanInput_ProjectionExpression *smithy.Schema + +var ScanInput_FilterExpression *smithy.Schema + +var ScanInput_ExpressionAttributeNames *smithy.Schema + +var ScanInput_ExpressionAttributeValues *smithy.Schema + +var ScanInput_ConsistentRead *smithy.Schema + +var ScanOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "ScanOutput", +}, smithy.ShapeTypeStructure, 5) +var ScanOutput_Items *smithy.Schema + +var ScanOutput_Count *smithy.Schema + +var ScanOutput_ScannedCount *smithy.Schema + +var ScanOutput_LastEvaluatedKey *smithy.Schema + +var ScanOutput_ConsumedCapacity *smithy.Schema + +var SearchVectorsInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "SearchVectorsInput", +}, smithy.ShapeTypeStructure, 9) +var SearchVectorsInput_TableName *smithy.Schema + +var SearchVectorsInput_IndexName *smithy.Schema + +var SearchVectorsInput_ReturnConsumedCapacity *smithy.Schema + +var SearchVectorsInput_ExpressionAttributeNames *smithy.Schema + +var SearchVectorsInput_ExpressionAttributeValues *smithy.Schema + +var SearchVectorsInput_ProjectionExpression *smithy.Schema + +var SearchVectorsInput_SearchVector *smithy.Schema + +var SearchVectorsInput_SearchConditionExpression *smithy.Schema + +var SearchVectorsInput_TopK *smithy.Schema + +var SearchVectorsOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "SearchVectorsOutput", +}, smithy.ShapeTypeStructure, 2) +var SearchVectorsOutput_ConsumedCapacity *smithy.Schema + +var SearchVectorsOutput_SearchResults *smithy.Schema + +var TagResourceInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TagResourceInput", +}, smithy.ShapeTypeStructure, 2) +var TagResourceInput_ResourceArn *smithy.Schema + +var TagResourceInput_Tags *smithy.Schema + +var TransactGetItemsInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TransactGetItemsInput", +}, smithy.ShapeTypeStructure, 2) +var TransactGetItemsInput_TransactItems *smithy.Schema + +var TransactGetItemsInput_ReturnConsumedCapacity *smithy.Schema + +var TransactGetItemsOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TransactGetItemsOutput", +}, smithy.ShapeTypeStructure, 2) +var TransactGetItemsOutput_ConsumedCapacity *smithy.Schema + +var TransactGetItemsOutput_Responses *smithy.Schema + +var TransactWriteItemsInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TransactWriteItemsInput", +}, smithy.ShapeTypeStructure, 4) +var TransactWriteItemsInput_TransactItems *smithy.Schema + +var TransactWriteItemsInput_ReturnConsumedCapacity *smithy.Schema + +var TransactWriteItemsInput_ReturnItemCollectionMetrics *smithy.Schema + +var TransactWriteItemsInput_ClientRequestToken *smithy.Schema + +var TransactWriteItemsOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "TransactWriteItemsOutput", +}, smithy.ShapeTypeStructure, 2) +var TransactWriteItemsOutput_ConsumedCapacity *smithy.Schema + +var TransactWriteItemsOutput_ItemCollectionMetrics *smithy.Schema + +var UntagResourceInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UntagResourceInput", +}, smithy.ShapeTypeStructure, 2) +var UntagResourceInput_ResourceArn *smithy.Schema + +var UntagResourceInput_TagKeys *smithy.Schema + +var UpdateContinuousBackupsInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateContinuousBackupsInput", +}, smithy.ShapeTypeStructure, 2) +var UpdateContinuousBackupsInput_TableName *smithy.Schema + +var UpdateContinuousBackupsInput_PointInTimeRecoverySpecification *smithy.Schema + +var UpdateContinuousBackupsOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateContinuousBackupsOutput", +}, smithy.ShapeTypeStructure, 1) +var UpdateContinuousBackupsOutput_ContinuousBackupsDescription *smithy.Schema + +var UpdateContributorInsightsInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateContributorInsightsInput", +}, smithy.ShapeTypeStructure, 4) +var UpdateContributorInsightsInput_TableName *smithy.Schema + +var UpdateContributorInsightsInput_IndexName *smithy.Schema + +var UpdateContributorInsightsInput_ContributorInsightsAction *smithy.Schema + +var UpdateContributorInsightsInput_ContributorInsightsMode *smithy.Schema + +var UpdateContributorInsightsOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateContributorInsightsOutput", +}, smithy.ShapeTypeStructure, 4) +var UpdateContributorInsightsOutput_TableName *smithy.Schema + +var UpdateContributorInsightsOutput_IndexName *smithy.Schema + +var UpdateContributorInsightsOutput_ContributorInsightsStatus *smithy.Schema + +var UpdateContributorInsightsOutput_ContributorInsightsMode *smithy.Schema + +var UpdateGlobalTableInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateGlobalTableInput", +}, smithy.ShapeTypeStructure, 2) +var UpdateGlobalTableInput_GlobalTableName *smithy.Schema + +var UpdateGlobalTableInput_ReplicaUpdates *smithy.Schema + +var UpdateGlobalTableOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateGlobalTableOutput", +}, smithy.ShapeTypeStructure, 1) +var UpdateGlobalTableOutput_GlobalTableDescription *smithy.Schema + +var UpdateGlobalTableSettingsInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateGlobalTableSettingsInput", +}, smithy.ShapeTypeStructure, 6) +var UpdateGlobalTableSettingsInput_GlobalTableName *smithy.Schema + +var UpdateGlobalTableSettingsInput_GlobalTableBillingMode *smithy.Schema + +var UpdateGlobalTableSettingsInput_GlobalTableProvisionedWriteCapacityUnits *smithy.Schema + +var UpdateGlobalTableSettingsInput_GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate *smithy.Schema + +var UpdateGlobalTableSettingsInput_GlobalTableGlobalSecondaryIndexSettingsUpdate *smithy.Schema + +var UpdateGlobalTableSettingsInput_ReplicaSettingsUpdate *smithy.Schema + +var UpdateGlobalTableSettingsOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateGlobalTableSettingsOutput", +}, smithy.ShapeTypeStructure, 2) +var UpdateGlobalTableSettingsOutput_GlobalTableName *smithy.Schema + +var UpdateGlobalTableSettingsOutput_ReplicaSettings *smithy.Schema + +var UpdateItemInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateItemInput", +}, smithy.ShapeTypeStructure, 13) +var UpdateItemInput_TableName *smithy.Schema + +var UpdateItemInput_Key *smithy.Schema + +var UpdateItemInput_AttributeUpdates *smithy.Schema + +var UpdateItemInput_Expected *smithy.Schema + +var UpdateItemInput_ConditionalOperator *smithy.Schema + +var UpdateItemInput_ReturnValues *smithy.Schema + +var UpdateItemInput_ReturnConsumedCapacity *smithy.Schema + +var UpdateItemInput_ReturnItemCollectionMetrics *smithy.Schema + +var UpdateItemInput_UpdateExpression *smithy.Schema + +var UpdateItemInput_ConditionExpression *smithy.Schema + +var UpdateItemInput_ExpressionAttributeNames *smithy.Schema + +var UpdateItemInput_ExpressionAttributeValues *smithy.Schema + +var UpdateItemInput_ReturnValuesOnConditionCheckFailure *smithy.Schema + +var UpdateItemOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateItemOutput", +}, smithy.ShapeTypeStructure, 3) +var UpdateItemOutput_Attributes *smithy.Schema + +var UpdateItemOutput_ConsumedCapacity *smithy.Schema + +var UpdateItemOutput_ItemCollectionMetrics *smithy.Schema + +var UpdateKinesisStreamingDestinationInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateKinesisStreamingDestinationInput", +}, smithy.ShapeTypeStructure, 3) +var UpdateKinesisStreamingDestinationInput_TableName *smithy.Schema + +var UpdateKinesisStreamingDestinationInput_StreamArn *smithy.Schema + +var UpdateKinesisStreamingDestinationInput_UpdateKinesisStreamingConfiguration *smithy.Schema + +var UpdateKinesisStreamingDestinationOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateKinesisStreamingDestinationOutput", +}, smithy.ShapeTypeStructure, 4) +var UpdateKinesisStreamingDestinationOutput_TableName *smithy.Schema + +var UpdateKinesisStreamingDestinationOutput_StreamArn *smithy.Schema + +var UpdateKinesisStreamingDestinationOutput_DestinationStatus *smithy.Schema + +var UpdateKinesisStreamingDestinationOutput_UpdateKinesisStreamingConfiguration *smithy.Schema + +var UpdateTableInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateTableInput", +}, smithy.ShapeTypeStructure, 16) +var UpdateTableInput_AttributeDefinitions *smithy.Schema + +var UpdateTableInput_TableName *smithy.Schema + +var UpdateTableInput_BillingMode *smithy.Schema + +var UpdateTableInput_ProvisionedThroughput *smithy.Schema + +var UpdateTableInput_GlobalSecondaryIndexUpdates *smithy.Schema + +var UpdateTableInput_StreamSpecification *smithy.Schema + +var UpdateTableInput_SSESpecification *smithy.Schema + +var UpdateTableInput_ReplicaUpdates *smithy.Schema + +var UpdateTableInput_TableClass *smithy.Schema + +var UpdateTableInput_DeletionProtectionEnabled *smithy.Schema + +var UpdateTableInput_MultiRegionConsistency *smithy.Schema + +var UpdateTableInput_GlobalTableWitnessUpdates *smithy.Schema + +var UpdateTableInput_OnDemandThroughput *smithy.Schema + +var UpdateTableInput_WarmThroughput *smithy.Schema + +var UpdateTableInput_GlobalTableSettingsReplicationMode *smithy.Schema + +var UpdateTableInput_VectorIndexUpdates *smithy.Schema + +var UpdateTableOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateTableOutput", +}, smithy.ShapeTypeStructure, 1) +var UpdateTableOutput_TableDescription *smithy.Schema + +var UpdateTableReplicaAutoScalingInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateTableReplicaAutoScalingInput", +}, smithy.ShapeTypeStructure, 4) +var UpdateTableReplicaAutoScalingInput_GlobalSecondaryIndexUpdates *smithy.Schema + +var UpdateTableReplicaAutoScalingInput_TableName *smithy.Schema + +var UpdateTableReplicaAutoScalingInput_ProvisionedWriteCapacityAutoScalingUpdate *smithy.Schema + +var UpdateTableReplicaAutoScalingInput_ReplicaUpdates *smithy.Schema + +var UpdateTableReplicaAutoScalingOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateTableReplicaAutoScalingOutput", +}, smithy.ShapeTypeStructure, 1) +var UpdateTableReplicaAutoScalingOutput_TableAutoScalingDescription *smithy.Schema + +var UpdateTimeToLiveInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateTimeToLiveInput", +}, smithy.ShapeTypeStructure, 2) +var UpdateTimeToLiveInput_TableName *smithy.Schema + +var UpdateTimeToLiveInput_TimeToLiveSpecification *smithy.Schema + +var UpdateTimeToLiveOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.dynamodb", + Name: "UpdateTimeToLiveOutput", +}, smithy.ShapeTypeStructure, 1) +var UpdateTimeToLiveOutput_TimeToLiveSpecification *smithy.Schema + +// Initialize schema members after all schemas are declared to avoid +// initialization cycles +func init() { + ApproximateCreationDateTimePrecision_MILLISECOND = ApproximateCreationDateTimePrecision.AddMember("MILLISECOND", smithyprelude.Unit) + + ApproximateCreationDateTimePrecision_MICROSECOND = ApproximateCreationDateTimePrecision.AddMember("MICROSECOND", smithyprelude.Unit) + + ArchivalSummary_ArchivalDateTime = ArchivalSummary.AddMember("ArchivalDateTime", _Date) + + ArchivalSummary_ArchivalReason = ArchivalSummary.AddMember("ArchivalReason", _ArchivalReason) + + ArchivalSummary_ArchivalBackupArn = ArchivalSummary.AddMember("ArchivalBackupArn", _BackupArn) + + AttributeAction_ADD = AttributeAction.AddMember("ADD", smithyprelude.Unit) + + AttributeAction_PUT = AttributeAction.AddMember("PUT", smithyprelude.Unit) + + AttributeAction_DELETE = AttributeAction.AddMember("DELETE", smithyprelude.Unit) + + ScalarAttributeType_S = ScalarAttributeType.AddMember("S", smithyprelude.Unit) + + ScalarAttributeType_N = ScalarAttributeType.AddMember("N", smithyprelude.Unit) + + ScalarAttributeType_B = ScalarAttributeType.AddMember("B", smithyprelude.Unit) + + AttributeDefinition_AttributeName = AttributeDefinition.AddMember("AttributeName", _KeySchemaAttributeName) + + AttributeDefinition_AttributeType = AttributeDefinition.AddMember("AttributeType", ScalarAttributeType) + + _AttributeDefinitions_member = _AttributeDefinitions.AddMember("member", AttributeDefinition) + + _StringSetAttributeValue_member = _StringSetAttributeValue.AddMember("member", _StringAttributeValue) + + _NumberSetAttributeValue_member = _NumberSetAttributeValue.AddMember("member", _NumberAttributeValue) + + _BinarySetAttributeValue_member = _BinarySetAttributeValue.AddMember("member", _BinaryAttributeValue) + + _MapAttributeValue_key = _MapAttributeValue.AddMember("key", _AttributeName) + + _MapAttributeValue_value = _MapAttributeValue.AddMember("value", AttributeValue) + + _ListAttributeValue_member = _ListAttributeValue.AddMember("member", AttributeValue) + + AttributeValue_S = AttributeValue.AddMember("S", _StringAttributeValue) + + AttributeValue_N = AttributeValue.AddMember("N", _NumberAttributeValue) + + AttributeValue_B = AttributeValue.AddMember("B", _BinaryAttributeValue) + + AttributeValue_SS = AttributeValue.AddMember("SS", _StringSetAttributeValue) + + AttributeValue_NS = AttributeValue.AddMember("NS", _NumberSetAttributeValue) + + AttributeValue_BS = AttributeValue.AddMember("BS", _BinarySetAttributeValue) + + AttributeValue_M = AttributeValue.AddMember("M", _MapAttributeValue) + + AttributeValue_L = AttributeValue.AddMember("L", _ListAttributeValue) + + AttributeValue_NULL = AttributeValue.AddMember("NULL", _NullAttributeValue) + + AttributeValue_BOOL = AttributeValue.AddMember("BOOL", _BooleanAttributeValue) + + _AttributeMap_key = _AttributeMap.AddMember("key", _AttributeName) + + _AttributeMap_value = _AttributeMap.AddMember("value", AttributeValue) + + _AttributeNameList_member = _AttributeNameList.AddMember("member", _AttributeName) + + AttributeValueUpdate_Value = AttributeValueUpdate.AddMember("Value", AttributeValue) + + AttributeValueUpdate_Action = AttributeValueUpdate.AddMember("Action", AttributeAction) + + _AttributeUpdates_key = _AttributeUpdates.AddMember("key", _AttributeName) + + _AttributeUpdates_value = _AttributeUpdates.AddMember("value", AttributeValueUpdate) + + _AttributeValueList_member = _AttributeValueList.AddMember("member", AttributeValue) + + AutoScalingTargetTrackingScalingPolicyConfigurationDescription_DisableScaleIn = AutoScalingTargetTrackingScalingPolicyConfigurationDescription.AddMember("DisableScaleIn", _BooleanObject) + + AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleInCooldown = AutoScalingTargetTrackingScalingPolicyConfigurationDescription.AddMember("ScaleInCooldown", _IntegerObject) + + AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleOutCooldown = AutoScalingTargetTrackingScalingPolicyConfigurationDescription.AddMember("ScaleOutCooldown", _IntegerObject) + + AutoScalingTargetTrackingScalingPolicyConfigurationDescription_TargetValue = AutoScalingTargetTrackingScalingPolicyConfigurationDescription.AddMember("TargetValue", _DoubleObject) + + AutoScalingPolicyDescription_PolicyName = AutoScalingPolicyDescription.AddMember("PolicyName", _AutoScalingPolicyName) + + AutoScalingPolicyDescription_TargetTrackingScalingPolicyConfiguration = AutoScalingPolicyDescription.AddMember("TargetTrackingScalingPolicyConfiguration", AutoScalingTargetTrackingScalingPolicyConfigurationDescription) + + _AutoScalingPolicyDescriptionList_member = _AutoScalingPolicyDescriptionList.AddMember("member", AutoScalingPolicyDescription) + + AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_DisableScaleIn = AutoScalingTargetTrackingScalingPolicyConfigurationUpdate.AddMember("DisableScaleIn", _BooleanObject) + + AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleInCooldown = AutoScalingTargetTrackingScalingPolicyConfigurationUpdate.AddMember("ScaleInCooldown", _IntegerObject) + + AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleOutCooldown = AutoScalingTargetTrackingScalingPolicyConfigurationUpdate.AddMember("ScaleOutCooldown", _IntegerObject) + + AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_TargetValue = AutoScalingTargetTrackingScalingPolicyConfigurationUpdate.AddMember("TargetValue", _DoubleObject) + + AutoScalingPolicyUpdate_PolicyName = AutoScalingPolicyUpdate.AddMember("PolicyName", _AutoScalingPolicyName) + + AutoScalingPolicyUpdate_TargetTrackingScalingPolicyConfiguration = AutoScalingPolicyUpdate.AddMember("TargetTrackingScalingPolicyConfiguration", AutoScalingTargetTrackingScalingPolicyConfigurationUpdate) + + AutoScalingSettingsDescription_MinimumUnits = AutoScalingSettingsDescription.AddMember("MinimumUnits", _PositiveLongObject) + + AutoScalingSettingsDescription_MaximumUnits = AutoScalingSettingsDescription.AddMember("MaximumUnits", _PositiveLongObject) + + AutoScalingSettingsDescription_AutoScalingDisabled = AutoScalingSettingsDescription.AddMember("AutoScalingDisabled", _BooleanObject) + + AutoScalingSettingsDescription_AutoScalingRoleArn = AutoScalingSettingsDescription.AddMember("AutoScalingRoleArn", _String) + + AutoScalingSettingsDescription_ScalingPolicies = AutoScalingSettingsDescription.AddMember("ScalingPolicies", _AutoScalingPolicyDescriptionList) + + AutoScalingSettingsUpdate_MinimumUnits = AutoScalingSettingsUpdate.AddMember("MinimumUnits", _PositiveLongObject) + + AutoScalingSettingsUpdate_MaximumUnits = AutoScalingSettingsUpdate.AddMember("MaximumUnits", _PositiveLongObject) + + AutoScalingSettingsUpdate_AutoScalingDisabled = AutoScalingSettingsUpdate.AddMember("AutoScalingDisabled", _BooleanObject) + + AutoScalingSettingsUpdate_AutoScalingRoleArn = AutoScalingSettingsUpdate.AddMember("AutoScalingRoleArn", _AutoScalingRoleArn) + + AutoScalingSettingsUpdate_ScalingPolicyUpdate = AutoScalingSettingsUpdate.AddMember("ScalingPolicyUpdate", AutoScalingPolicyUpdate) + + BackupStatus_CREATING = BackupStatus.AddMember("CREATING", smithyprelude.Unit) + + BackupStatus_DELETED = BackupStatus.AddMember("DELETED", smithyprelude.Unit) + + BackupStatus_AVAILABLE = BackupStatus.AddMember("AVAILABLE", smithyprelude.Unit) + + BackupType_USER = BackupType.AddMember("USER", smithyprelude.Unit) + + BackupType_SYSTEM = BackupType.AddMember("SYSTEM", smithyprelude.Unit) + + BackupType_AWS_BACKUP = BackupType.AddMember("AWS_BACKUP", smithyprelude.Unit) + + BackupDetails_BackupArn = BackupDetails.AddMember("BackupArn", _BackupArn) + + BackupDetails_BackupName = BackupDetails.AddMember("BackupName", _BackupName) + + BackupDetails_BackupSizeBytes = BackupDetails.AddMember("BackupSizeBytes", _BackupSizeBytes) + + BackupDetails_BackupStatus = BackupDetails.AddMember("BackupStatus", BackupStatus) + + BackupDetails_BackupType = BackupDetails.AddMember("BackupType", BackupType) + + BackupDetails_BackupCreationDateTime = BackupDetails.AddMember("BackupCreationDateTime", _BackupCreationDateTime) + + BackupDetails_BackupExpiryDateTime = BackupDetails.AddMember("BackupExpiryDateTime", _Date) + + KeyType_HASH = KeyType.AddMember("HASH", smithyprelude.Unit) + + KeyType_RANGE = KeyType.AddMember("RANGE", smithyprelude.Unit) + + KeySchemaElement_AttributeName = KeySchemaElement.AddMember("AttributeName", _KeySchemaAttributeName) + + KeySchemaElement_KeyType = KeySchemaElement.AddMember("KeyType", KeyType) + + _KeySchema_member = _KeySchema.AddMember("member", KeySchemaElement) + + ProvisionedThroughput_ReadCapacityUnits = ProvisionedThroughput.AddMember("ReadCapacityUnits", _PositiveLongObject) + + ProvisionedThroughput_WriteCapacityUnits = ProvisionedThroughput.AddMember("WriteCapacityUnits", _PositiveLongObject) + + OnDemandThroughput_MaxReadRequestUnits = OnDemandThroughput.AddMember("MaxReadRequestUnits", _LongObject) + + OnDemandThroughput_MaxWriteRequestUnits = OnDemandThroughput.AddMember("MaxWriteRequestUnits", _LongObject) + + BillingMode_PROVISIONED = BillingMode.AddMember("PROVISIONED", smithyprelude.Unit) + + BillingMode_PAY_PER_REQUEST = BillingMode.AddMember("PAY_PER_REQUEST", smithyprelude.Unit) + + SourceTableDetails_TableName = SourceTableDetails.AddMember("TableName", _TableName) + + SourceTableDetails_TableId = SourceTableDetails.AddMember("TableId", _TableId) + + SourceTableDetails_TableArn = SourceTableDetails.AddMember("TableArn", _TableArn) + + SourceTableDetails_TableSizeBytes = SourceTableDetails.AddMember("TableSizeBytes", _LongObject) + + SourceTableDetails_KeySchema = SourceTableDetails.AddMember("KeySchema", _KeySchema) + + SourceTableDetails_TableCreationDateTime = SourceTableDetails.AddMember("TableCreationDateTime", _TableCreationDateTime) + + SourceTableDetails_ProvisionedThroughput = SourceTableDetails.AddMember("ProvisionedThroughput", ProvisionedThroughput) + + SourceTableDetails_OnDemandThroughput = SourceTableDetails.AddMember("OnDemandThroughput", OnDemandThroughput) + + SourceTableDetails_ItemCount = SourceTableDetails.AddMember("ItemCount", _ItemCount) + + SourceTableDetails_BillingMode = SourceTableDetails.AddMember("BillingMode", BillingMode) + + ProjectionType_ALL = ProjectionType.AddMember("ALL", smithyprelude.Unit) + + ProjectionType_KEYS_ONLY = ProjectionType.AddMember("KEYS_ONLY", smithyprelude.Unit) + + ProjectionType_INCLUDE = ProjectionType.AddMember("INCLUDE", smithyprelude.Unit) + + _NonKeyAttributeNameList_member = _NonKeyAttributeNameList.AddMember("member", _NonKeyAttributeName) + + Projection_ProjectionType = Projection.AddMember("ProjectionType", ProjectionType) + + Projection_NonKeyAttributes = Projection.AddMember("NonKeyAttributes", _NonKeyAttributeNameList) + + LocalSecondaryIndexInfo_IndexName = LocalSecondaryIndexInfo.AddMember("IndexName", _IndexName) + + LocalSecondaryIndexInfo_KeySchema = LocalSecondaryIndexInfo.AddMember("KeySchema", _KeySchema) + + LocalSecondaryIndexInfo_Projection = LocalSecondaryIndexInfo.AddMember("Projection", Projection) + + _LocalSecondaryIndexes_member = _LocalSecondaryIndexes.AddMember("member", LocalSecondaryIndexInfo) + + GlobalSecondaryIndexInfo_IndexName = GlobalSecondaryIndexInfo.AddMember("IndexName", _IndexName) + + GlobalSecondaryIndexInfo_KeySchema = GlobalSecondaryIndexInfo.AddMember("KeySchema", _KeySchema) + + GlobalSecondaryIndexInfo_Projection = GlobalSecondaryIndexInfo.AddMember("Projection", Projection) + + GlobalSecondaryIndexInfo_ProvisionedThroughput = GlobalSecondaryIndexInfo.AddMember("ProvisionedThroughput", ProvisionedThroughput) + + GlobalSecondaryIndexInfo_OnDemandThroughput = GlobalSecondaryIndexInfo.AddMember("OnDemandThroughput", OnDemandThroughput) + + _GlobalSecondaryIndexes_member = _GlobalSecondaryIndexes.AddMember("member", GlobalSecondaryIndexInfo) + + StreamViewType_NEW_IMAGE = StreamViewType.AddMember("NEW_IMAGE", smithyprelude.Unit) + + StreamViewType_OLD_IMAGE = StreamViewType.AddMember("OLD_IMAGE", smithyprelude.Unit) + + StreamViewType_NEW_AND_OLD_IMAGES = StreamViewType.AddMember("NEW_AND_OLD_IMAGES", smithyprelude.Unit) + + StreamViewType_KEYS_ONLY = StreamViewType.AddMember("KEYS_ONLY", smithyprelude.Unit) + + StreamSpecification_StreamEnabled = StreamSpecification.AddMember("StreamEnabled", _StreamEnabled) + + StreamSpecification_StreamViewType = StreamSpecification.AddMember("StreamViewType", StreamViewType) + + TimeToLiveStatus_ENABLING = TimeToLiveStatus.AddMember("ENABLING", smithyprelude.Unit) + + TimeToLiveStatus_DISABLING = TimeToLiveStatus.AddMember("DISABLING", smithyprelude.Unit) + + TimeToLiveStatus_ENABLED = TimeToLiveStatus.AddMember("ENABLED", smithyprelude.Unit) + + TimeToLiveStatus_DISABLED = TimeToLiveStatus.AddMember("DISABLED", smithyprelude.Unit) + + TimeToLiveDescription_TimeToLiveStatus = TimeToLiveDescription.AddMember("TimeToLiveStatus", TimeToLiveStatus) + + TimeToLiveDescription_AttributeName = TimeToLiveDescription.AddMember("AttributeName", _TimeToLiveAttributeName) + + SSEStatus_ENABLING = SSEStatus.AddMember("ENABLING", smithyprelude.Unit) + + SSEStatus_ENABLED = SSEStatus.AddMember("ENABLED", smithyprelude.Unit) + + SSEStatus_DISABLING = SSEStatus.AddMember("DISABLING", smithyprelude.Unit) + + SSEStatus_DISABLED = SSEStatus.AddMember("DISABLED", smithyprelude.Unit) + + SSEStatus_UPDATING = SSEStatus.AddMember("UPDATING", smithyprelude.Unit) + + SSEType_AES256 = SSEType.AddMember("AES256", smithyprelude.Unit) + + SSEType_KMS = SSEType.AddMember("KMS", smithyprelude.Unit) + + SSEDescription_Status = SSEDescription.AddMember("Status", SSEStatus) + + SSEDescription_SSEType = SSEDescription.AddMember("SSEType", SSEType) + + SSEDescription_KMSMasterKeyArn = SSEDescription.AddMember("KMSMasterKeyArn", _KMSMasterKeyArn) + + SSEDescription_InaccessibleEncryptionDateTime = SSEDescription.AddMember("InaccessibleEncryptionDateTime", _Date) + + VectorAttributeDefinition_AttributeName = VectorAttributeDefinition.AddMember("AttributeName", _VectorAttributeName) + + SearchSchemaElementType_HASH = SearchSchemaElementType.AddMember("HASH", smithyprelude.Unit) + + SearchSchemaElementType_INLINE_FILTER = SearchSchemaElementType.AddMember("INLINE_FILTER", smithyprelude.Unit) + + SearchSchemaElement_AttributeName = SearchSchemaElement.AddMember("AttributeName", _AttributeName) + + SearchSchemaElement_SearchSchemaElementType = SearchSchemaElement.AddMember("SearchSchemaElementType", SearchSchemaElementType) + + _SearchSchema_member = _SearchSchema.AddMember("member", SearchSchemaElement) + + VectorDistanceFunction_COSINE = VectorDistanceFunction.AddMember("COSINE", smithyprelude.Unit) + + VectorDistanceFunction_DOT_PRODUCT = VectorDistanceFunction.AddMember("DOT_PRODUCT", smithyprelude.Unit) + + VectorDistanceFunction_EUCLIDEAN = VectorDistanceFunction.AddMember("EUCLIDEAN", smithyprelude.Unit) + + VectorIndexInfo_IndexName = VectorIndexInfo.AddMember("IndexName", _IndexName) + + VectorIndexInfo_VectorAttribute = VectorIndexInfo.AddMember("VectorAttribute", VectorAttributeDefinition) + + VectorIndexInfo_SearchSchema = VectorIndexInfo.AddMember("SearchSchema", _SearchSchema) + + VectorIndexInfo_Projection = VectorIndexInfo.AddMember("Projection", Projection) + + VectorIndexInfo_Dimensions = VectorIndexInfo.AddMember("Dimensions", _PositiveLongObject) + + VectorIndexInfo_DistanceFunction = VectorIndexInfo.AddMember("DistanceFunction", VectorDistanceFunction) + + _VectorIndexes_member = _VectorIndexes.AddMember("member", VectorIndexInfo) + + SourceTableFeatureDetails_LocalSecondaryIndexes = SourceTableFeatureDetails.AddMember("LocalSecondaryIndexes", _LocalSecondaryIndexes) + + SourceTableFeatureDetails_GlobalSecondaryIndexes = SourceTableFeatureDetails.AddMember("GlobalSecondaryIndexes", _GlobalSecondaryIndexes) + + SourceTableFeatureDetails_StreamDescription = SourceTableFeatureDetails.AddMember("StreamDescription", StreamSpecification) + + SourceTableFeatureDetails_TimeToLiveDescription = SourceTableFeatureDetails.AddMember("TimeToLiveDescription", TimeToLiveDescription) + + SourceTableFeatureDetails_SSEDescription = SourceTableFeatureDetails.AddMember("SSEDescription", SSEDescription) + + SourceTableFeatureDetails_VectorIndexes = SourceTableFeatureDetails.AddMember("VectorIndexes", _VectorIndexes) + + BackupDescription_BackupDetails = BackupDescription.AddMember("BackupDetails", BackupDetails) + + BackupDescription_SourceTableDetails = BackupDescription.AddMember("SourceTableDetails", SourceTableDetails) + + BackupDescription_SourceTableFeatureDetails = BackupDescription.AddMember("SourceTableFeatureDetails", SourceTableFeatureDetails) + + BackupInUseException_message = BackupInUseException.AddMember("message", _ErrorMessage) + + BackupNotFoundException_message = BackupNotFoundException.AddMember("message", _ErrorMessage) + + BackupSummary_TableName = BackupSummary.AddMember("TableName", _TableName) + + BackupSummary_TableId = BackupSummary.AddMember("TableId", _TableId) + + BackupSummary_TableArn = BackupSummary.AddMember("TableArn", _TableArn) + + BackupSummary_BackupArn = BackupSummary.AddMember("BackupArn", _BackupArn) + + BackupSummary_BackupName = BackupSummary.AddMember("BackupName", _BackupName) + + BackupSummary_BackupCreationDateTime = BackupSummary.AddMember("BackupCreationDateTime", _BackupCreationDateTime) + + BackupSummary_BackupExpiryDateTime = BackupSummary.AddMember("BackupExpiryDateTime", _Date) + + BackupSummary_BackupStatus = BackupSummary.AddMember("BackupStatus", BackupStatus) + + BackupSummary_BackupType = BackupSummary.AddMember("BackupType", BackupType) + + BackupSummary_BackupSizeBytes = BackupSummary.AddMember("BackupSizeBytes", _BackupSizeBytes) + + _BackupSummaries_member = _BackupSummaries.AddMember("member", BackupSummary) + + BackupTypeFilter_USER = BackupTypeFilter.AddMember("USER", smithyprelude.Unit) + + BackupTypeFilter_SYSTEM = BackupTypeFilter.AddMember("SYSTEM", smithyprelude.Unit) + + BackupTypeFilter_AWS_BACKUP = BackupTypeFilter.AddMember("AWS_BACKUP", smithyprelude.Unit) + + BackupTypeFilter_ALL = BackupTypeFilter.AddMember("ALL", smithyprelude.Unit) + + _Key_key = _Key.AddMember("key", _AttributeName) + + _Key_value = _Key.AddMember("value", AttributeValue) + + _KeyList_member = _KeyList.AddMember("member", _Key) + + _ExpressionAttributeNameMap_key = _ExpressionAttributeNameMap.AddMember("key", _ExpressionAttributeNameVariable) + + _ExpressionAttributeNameMap_value = _ExpressionAttributeNameMap.AddMember("value", _AttributeName) + + KeysAndAttributes_Keys = KeysAndAttributes.AddMember("Keys", _KeyList) + + KeysAndAttributes_AttributesToGet = KeysAndAttributes.AddMember("AttributesToGet", _AttributeNameList) + + KeysAndAttributes_ConsistentRead = KeysAndAttributes.AddMember("ConsistentRead", _ConsistentRead) + + KeysAndAttributes_ProjectionExpression = KeysAndAttributes.AddMember("ProjectionExpression", _ProjectionExpression) + + KeysAndAttributes_ExpressionAttributeNames = KeysAndAttributes.AddMember("ExpressionAttributeNames", _ExpressionAttributeNameMap) + + _BatchGetRequestMap_key = _BatchGetRequestMap.AddMember("key", _TableArn) + + _BatchGetRequestMap_value = _BatchGetRequestMap.AddMember("value", KeysAndAttributes) + + _ItemList_member = _ItemList.AddMember("member", _AttributeMap) + + _BatchGetResponseMap_key = _BatchGetResponseMap.AddMember("key", _TableArn) + + _BatchGetResponseMap_value = _BatchGetResponseMap.AddMember("value", _ItemList) + + BatchStatementErrorCodeEnum_ConditionalCheckFailed = BatchStatementErrorCodeEnum.AddMember("ConditionalCheckFailed", smithyprelude.Unit) + + BatchStatementErrorCodeEnum_ItemCollectionSizeLimitExceeded = BatchStatementErrorCodeEnum.AddMember("ItemCollectionSizeLimitExceeded", smithyprelude.Unit) + + BatchStatementErrorCodeEnum_RequestLimitExceeded = BatchStatementErrorCodeEnum.AddMember("RequestLimitExceeded", smithyprelude.Unit) + + BatchStatementErrorCodeEnum_ValidationError = BatchStatementErrorCodeEnum.AddMember("ValidationError", smithyprelude.Unit) + + BatchStatementErrorCodeEnum_ProvisionedThroughputExceeded = BatchStatementErrorCodeEnum.AddMember("ProvisionedThroughputExceeded", smithyprelude.Unit) + + BatchStatementErrorCodeEnum_TransactionConflict = BatchStatementErrorCodeEnum.AddMember("TransactionConflict", smithyprelude.Unit) + + BatchStatementErrorCodeEnum_ThrottlingError = BatchStatementErrorCodeEnum.AddMember("ThrottlingError", smithyprelude.Unit) + + BatchStatementErrorCodeEnum_InternalServerError = BatchStatementErrorCodeEnum.AddMember("InternalServerError", smithyprelude.Unit) + + BatchStatementErrorCodeEnum_ResourceNotFound = BatchStatementErrorCodeEnum.AddMember("ResourceNotFound", smithyprelude.Unit) + + BatchStatementErrorCodeEnum_AccessDenied = BatchStatementErrorCodeEnum.AddMember("AccessDenied", smithyprelude.Unit) + + BatchStatementErrorCodeEnum_DuplicateItem = BatchStatementErrorCodeEnum.AddMember("DuplicateItem", smithyprelude.Unit) + + BatchStatementError_Code = BatchStatementError.AddMember("Code", BatchStatementErrorCodeEnum) + + BatchStatementError_Message = BatchStatementError.AddMember("Message", _String) + + BatchStatementError_Item = BatchStatementError.AddMember("Item", _AttributeMap) + + _PreparedStatementParameters_member = _PreparedStatementParameters.AddMember("member", AttributeValue) + + ReturnValuesOnConditionCheckFailure_ALL_OLD = ReturnValuesOnConditionCheckFailure.AddMember("ALL_OLD", smithyprelude.Unit) + + ReturnValuesOnConditionCheckFailure_NONE = ReturnValuesOnConditionCheckFailure.AddMember("NONE", smithyprelude.Unit) + + BatchStatementRequest_Statement = BatchStatementRequest.AddMember("Statement", _PartiQLStatement) + + BatchStatementRequest_Parameters = BatchStatementRequest.AddMember("Parameters", _PreparedStatementParameters) + + BatchStatementRequest_ConsistentRead = BatchStatementRequest.AddMember("ConsistentRead", _ConsistentRead) + + BatchStatementRequest_ReturnValuesOnConditionCheckFailure = BatchStatementRequest.AddMember("ReturnValuesOnConditionCheckFailure", ReturnValuesOnConditionCheckFailure) + + BatchStatementResponse_Error = BatchStatementResponse.AddMember("Error", BatchStatementError) + + BatchStatementResponse_TableName = BatchStatementResponse.AddMember("TableName", _TableName) + + BatchStatementResponse_Item = BatchStatementResponse.AddMember("Item", _AttributeMap) + + _PutItemInputAttributeMap_key = _PutItemInputAttributeMap.AddMember("key", _AttributeName) + + _PutItemInputAttributeMap_value = _PutItemInputAttributeMap.AddMember("value", AttributeValue) + + PutRequest_Item = PutRequest.AddMember("Item", _PutItemInputAttributeMap) + + DeleteRequest_Key = DeleteRequest.AddMember("Key", _Key) + + WriteRequest_PutRequest = WriteRequest.AddMember("PutRequest", PutRequest) + + WriteRequest_DeleteRequest = WriteRequest.AddMember("DeleteRequest", DeleteRequest) + + _WriteRequests_member = _WriteRequests.AddMember("member", WriteRequest) + + _BatchWriteItemRequestMap_key = _BatchWriteItemRequestMap.AddMember("key", _TableArn) + + _BatchWriteItemRequestMap_value = _BatchWriteItemRequestMap.AddMember("value", _WriteRequests) + + BillingModeSummary_BillingMode = BillingModeSummary.AddMember("BillingMode", BillingMode) + + BillingModeSummary_LastUpdateToPayPerRequestDateTime = BillingModeSummary.AddMember("LastUpdateToPayPerRequestDateTime", _Date) + + CancellationReason_Item = CancellationReason.AddMember("Item", _AttributeMap) + + CancellationReason_Code = CancellationReason.AddMember("Code", _Code) + + CancellationReason_Message = CancellationReason.AddMember("Message", _ErrorMessage) + + _CancellationReasonList_member = _CancellationReasonList.AddMember("member", CancellationReason) + + Capacity_ReadCapacityUnits = Capacity.AddMember("ReadCapacityUnits", _ConsumedCapacityUnits) + + Capacity_WriteCapacityUnits = Capacity.AddMember("WriteCapacityUnits", _ConsumedCapacityUnits) + + Capacity_CapacityUnits = Capacity.AddMember("CapacityUnits", _ConsumedCapacityUnits) + + ComparisonOperator_EQ = ComparisonOperator.AddMember("EQ", smithyprelude.Unit) + + ComparisonOperator_NE = ComparisonOperator.AddMember("NE", smithyprelude.Unit) + + ComparisonOperator_IN = ComparisonOperator.AddMember("IN", smithyprelude.Unit) + + ComparisonOperator_LE = ComparisonOperator.AddMember("LE", smithyprelude.Unit) + + ComparisonOperator_LT = ComparisonOperator.AddMember("LT", smithyprelude.Unit) + + ComparisonOperator_GE = ComparisonOperator.AddMember("GE", smithyprelude.Unit) + + ComparisonOperator_GT = ComparisonOperator.AddMember("GT", smithyprelude.Unit) + + ComparisonOperator_BETWEEN = ComparisonOperator.AddMember("BETWEEN", smithyprelude.Unit) + + ComparisonOperator_NOT_NULL = ComparisonOperator.AddMember("NOT_NULL", smithyprelude.Unit) + + ComparisonOperator_NULL = ComparisonOperator.AddMember("NULL", smithyprelude.Unit) + + ComparisonOperator_CONTAINS = ComparisonOperator.AddMember("CONTAINS", smithyprelude.Unit) + + ComparisonOperator_NOT_CONTAINS = ComparisonOperator.AddMember("NOT_CONTAINS", smithyprelude.Unit) + + ComparisonOperator_BEGINS_WITH = ComparisonOperator.AddMember("BEGINS_WITH", smithyprelude.Unit) + + Condition_AttributeValueList = Condition.AddMember("AttributeValueList", _AttributeValueList) + + Condition_ComparisonOperator = Condition.AddMember("ComparisonOperator", ComparisonOperator) + + ConditionalCheckFailedException_message = ConditionalCheckFailedException.AddMember("message", _ErrorMessage) + + ConditionalCheckFailedException_Item = ConditionalCheckFailedException.AddMember("Item", _AttributeMap) + + ConditionalOperator_AND = ConditionalOperator.AddMember("AND", smithyprelude.Unit) + + ConditionalOperator_OR = ConditionalOperator.AddMember("OR", smithyprelude.Unit) + + _ExpressionAttributeValueMap_key = _ExpressionAttributeValueMap.AddMember("key", _ExpressionAttributeValueVariable) + + _ExpressionAttributeValueMap_value = _ExpressionAttributeValueMap.AddMember("value", AttributeValue) + + ConditionCheck_Key = ConditionCheck.AddMember("Key", _Key) + + ConditionCheck_TableName = ConditionCheck.AddMember("TableName", _TableArn) + + ConditionCheck_ConditionExpression = ConditionCheck.AddMember("ConditionExpression", _ConditionExpression) + + ConditionCheck_ExpressionAttributeNames = ConditionCheck.AddMember("ExpressionAttributeNames", _ExpressionAttributeNameMap) + + ConditionCheck_ExpressionAttributeValues = ConditionCheck.AddMember("ExpressionAttributeValues", _ExpressionAttributeValueMap) + + ConditionCheck_ReturnValuesOnConditionCheckFailure = ConditionCheck.AddMember("ReturnValuesOnConditionCheckFailure", ReturnValuesOnConditionCheckFailure) + + _SecondaryIndexesCapacityMap_key = _SecondaryIndexesCapacityMap.AddMember("key", _IndexName) + + _SecondaryIndexesCapacityMap_value = _SecondaryIndexesCapacityMap.AddMember("value", Capacity) + + VectorCapacity_VectorSearchRequestBytes = VectorCapacity.AddMember("VectorSearchRequestBytes", _ConsumedCapacityUnits) + + VectorCapacity_VectorWriteRequestBytes = VectorCapacity.AddMember("VectorWriteRequestBytes", _ConsumedCapacityUnits) + + _VectorIndexesCapacityMap_key = _VectorIndexesCapacityMap.AddMember("key", _IndexName) + + _VectorIndexesCapacityMap_value = _VectorIndexesCapacityMap.AddMember("value", VectorCapacity) + + ConsumedCapacity_TableName = ConsumedCapacity.AddMember("TableName", _TableArn) + + ConsumedCapacity_CapacityUnits = ConsumedCapacity.AddMember("CapacityUnits", _ConsumedCapacityUnits) + + ConsumedCapacity_ReadCapacityUnits = ConsumedCapacity.AddMember("ReadCapacityUnits", _ConsumedCapacityUnits) + + ConsumedCapacity_WriteCapacityUnits = ConsumedCapacity.AddMember("WriteCapacityUnits", _ConsumedCapacityUnits) + + ConsumedCapacity_Table = ConsumedCapacity.AddMember("Table", Capacity) + + ConsumedCapacity_LocalSecondaryIndexes = ConsumedCapacity.AddMember("LocalSecondaryIndexes", _SecondaryIndexesCapacityMap) + + ConsumedCapacity_GlobalSecondaryIndexes = ConsumedCapacity.AddMember("GlobalSecondaryIndexes", _SecondaryIndexesCapacityMap) + + ConsumedCapacity_VectorIndexes = ConsumedCapacity.AddMember("VectorIndexes", _VectorIndexesCapacityMap) + + _ConsumedCapacityMultiple_member = _ConsumedCapacityMultiple.AddMember("member", ConsumedCapacity) + + ContinuousBackupsStatus_ENABLED = ContinuousBackupsStatus.AddMember("ENABLED", smithyprelude.Unit) + + ContinuousBackupsStatus_DISABLED = ContinuousBackupsStatus.AddMember("DISABLED", smithyprelude.Unit) + + PointInTimeRecoveryStatus_ENABLED = PointInTimeRecoveryStatus.AddMember("ENABLED", smithyprelude.Unit) + + PointInTimeRecoveryStatus_DISABLED = PointInTimeRecoveryStatus.AddMember("DISABLED", smithyprelude.Unit) + + PointInTimeRecoveryDescription_PointInTimeRecoveryStatus = PointInTimeRecoveryDescription.AddMember("PointInTimeRecoveryStatus", PointInTimeRecoveryStatus) + + PointInTimeRecoveryDescription_RecoveryPeriodInDays = PointInTimeRecoveryDescription.AddMember("RecoveryPeriodInDays", _RecoveryPeriodInDays) + + PointInTimeRecoveryDescription_EarliestRestorableDateTime = PointInTimeRecoveryDescription.AddMember("EarliestRestorableDateTime", _Date) + + PointInTimeRecoveryDescription_LatestRestorableDateTime = PointInTimeRecoveryDescription.AddMember("LatestRestorableDateTime", _Date) + + ContinuousBackupsDescription_ContinuousBackupsStatus = ContinuousBackupsDescription.AddMember("ContinuousBackupsStatus", ContinuousBackupsStatus) + + ContinuousBackupsDescription_PointInTimeRecoveryDescription = ContinuousBackupsDescription.AddMember("PointInTimeRecoveryDescription", PointInTimeRecoveryDescription) + + ContinuousBackupsUnavailableException_message = ContinuousBackupsUnavailableException.AddMember("message", _ErrorMessage) + + ContributorInsightsAction_ENABLE = ContributorInsightsAction.AddMember("ENABLE", smithyprelude.Unit) + + ContributorInsightsAction_DISABLE = ContributorInsightsAction.AddMember("DISABLE", smithyprelude.Unit) + + ContributorInsightsMode_ACCESSED_AND_THROTTLED_KEYS = ContributorInsightsMode.AddMember("ACCESSED_AND_THROTTLED_KEYS", smithyprelude.Unit) + + ContributorInsightsMode_THROTTLED_KEYS = ContributorInsightsMode.AddMember("THROTTLED_KEYS", smithyprelude.Unit) + + _ContributorInsightsRuleList_member = _ContributorInsightsRuleList.AddMember("member", _ContributorInsightsRule) + + ContributorInsightsStatus_ENABLING = ContributorInsightsStatus.AddMember("ENABLING", smithyprelude.Unit) + + ContributorInsightsStatus_ENABLED = ContributorInsightsStatus.AddMember("ENABLED", smithyprelude.Unit) + + ContributorInsightsStatus_DISABLING = ContributorInsightsStatus.AddMember("DISABLING", smithyprelude.Unit) + + ContributorInsightsStatus_DISABLED = ContributorInsightsStatus.AddMember("DISABLED", smithyprelude.Unit) + + ContributorInsightsStatus_FAILED = ContributorInsightsStatus.AddMember("FAILED", smithyprelude.Unit) + + ContributorInsightsSummary_TableName = ContributorInsightsSummary.AddMember("TableName", _TableName) + + ContributorInsightsSummary_IndexName = ContributorInsightsSummary.AddMember("IndexName", _IndexName) + + ContributorInsightsSummary_ContributorInsightsStatus = ContributorInsightsSummary.AddMember("ContributorInsightsStatus", ContributorInsightsStatus) + + ContributorInsightsSummary_ContributorInsightsMode = ContributorInsightsSummary.AddMember("ContributorInsightsMode", ContributorInsightsMode) + + _ContributorInsightsSummaries_member = _ContributorInsightsSummaries.AddMember("member", ContributorInsightsSummary) + + WarmThroughput_ReadUnitsPerSecond = WarmThroughput.AddMember("ReadUnitsPerSecond", _LongObject) + + WarmThroughput_WriteUnitsPerSecond = WarmThroughput.AddMember("WriteUnitsPerSecond", _LongObject) + + CreateGlobalSecondaryIndexAction_IndexName = CreateGlobalSecondaryIndexAction.AddMember("IndexName", _IndexName) + + CreateGlobalSecondaryIndexAction_KeySchema = CreateGlobalSecondaryIndexAction.AddMember("KeySchema", _KeySchema) + + CreateGlobalSecondaryIndexAction_Projection = CreateGlobalSecondaryIndexAction.AddMember("Projection", Projection) + + CreateGlobalSecondaryIndexAction_ProvisionedThroughput = CreateGlobalSecondaryIndexAction.AddMember("ProvisionedThroughput", ProvisionedThroughput) + + CreateGlobalSecondaryIndexAction_OnDemandThroughput = CreateGlobalSecondaryIndexAction.AddMember("OnDemandThroughput", OnDemandThroughput) + + CreateGlobalSecondaryIndexAction_WarmThroughput = CreateGlobalSecondaryIndexAction.AddMember("WarmThroughput", WarmThroughput) + + CreateGlobalTableWitnessGroupMemberAction_RegionName = CreateGlobalTableWitnessGroupMemberAction.AddMember("RegionName", _RegionName) + + CreateReplicaAction_RegionName = CreateReplicaAction.AddMember("RegionName", _RegionName) + + ProvisionedThroughputOverride_ReadCapacityUnits = ProvisionedThroughputOverride.AddMember("ReadCapacityUnits", _PositiveLongObject) + + OnDemandThroughputOverride_MaxReadRequestUnits = OnDemandThroughputOverride.AddMember("MaxReadRequestUnits", _LongObject) + + ReplicaGlobalSecondaryIndex_IndexName = ReplicaGlobalSecondaryIndex.AddMember("IndexName", _IndexName) + + ReplicaGlobalSecondaryIndex_ProvisionedThroughputOverride = ReplicaGlobalSecondaryIndex.AddMember("ProvisionedThroughputOverride", ProvisionedThroughputOverride) + + ReplicaGlobalSecondaryIndex_OnDemandThroughputOverride = ReplicaGlobalSecondaryIndex.AddMember("OnDemandThroughputOverride", OnDemandThroughputOverride) + + _ReplicaGlobalSecondaryIndexList_member = _ReplicaGlobalSecondaryIndexList.AddMember("member", ReplicaGlobalSecondaryIndex) + + TableClass_STANDARD = TableClass.AddMember("STANDARD", smithyprelude.Unit) + + TableClass_STANDARD_INFREQUENT_ACCESS = TableClass.AddMember("STANDARD_INFREQUENT_ACCESS", smithyprelude.Unit) + + CreateReplicationGroupMemberAction_RegionName = CreateReplicationGroupMemberAction.AddMember("RegionName", _RegionName) + + CreateReplicationGroupMemberAction_KMSMasterKeyId = CreateReplicationGroupMemberAction.AddMember("KMSMasterKeyId", _KMSMasterKeyId) + + CreateReplicationGroupMemberAction_ProvisionedThroughputOverride = CreateReplicationGroupMemberAction.AddMember("ProvisionedThroughputOverride", ProvisionedThroughputOverride) + + CreateReplicationGroupMemberAction_OnDemandThroughputOverride = CreateReplicationGroupMemberAction.AddMember("OnDemandThroughputOverride", OnDemandThroughputOverride) + + CreateReplicationGroupMemberAction_GlobalSecondaryIndexes = CreateReplicationGroupMemberAction.AddMember("GlobalSecondaryIndexes", _ReplicaGlobalSecondaryIndexList) + + CreateReplicationGroupMemberAction_TableClassOverride = CreateReplicationGroupMemberAction.AddMember("TableClassOverride", TableClass) + + CreateVectorIndexAction_IndexName = CreateVectorIndexAction.AddMember("IndexName", _IndexName) + + CreateVectorIndexAction_VectorAttribute = CreateVectorIndexAction.AddMember("VectorAttribute", VectorAttributeDefinition) + + CreateVectorIndexAction_SearchSchema = CreateVectorIndexAction.AddMember("SearchSchema", _SearchSchema) + + CreateVectorIndexAction_Projection = CreateVectorIndexAction.AddMember("Projection", Projection) + + CreateVectorIndexAction_Dimensions = CreateVectorIndexAction.AddMember("Dimensions", _PositiveLongObject) + + CreateVectorIndexAction_DistanceFunction = CreateVectorIndexAction.AddMember("DistanceFunction", VectorDistanceFunction) + + _CsvHeaderList_member = _CsvHeaderList.AddMember("member", _CsvHeader) + + CsvOptions_Delimiter = CsvOptions.AddMember("Delimiter", _CsvDelimiter) + + CsvOptions_HeaderList = CsvOptions.AddMember("HeaderList", _CsvHeaderList) + + Delete_Key = Delete.AddMember("Key", _Key) + + Delete_TableName = Delete.AddMember("TableName", _TableArn) + + Delete_ConditionExpression = Delete.AddMember("ConditionExpression", _ConditionExpression) + + Delete_ExpressionAttributeNames = Delete.AddMember("ExpressionAttributeNames", _ExpressionAttributeNameMap) + + Delete_ExpressionAttributeValues = Delete.AddMember("ExpressionAttributeValues", _ExpressionAttributeValueMap) + + Delete_ReturnValuesOnConditionCheckFailure = Delete.AddMember("ReturnValuesOnConditionCheckFailure", ReturnValuesOnConditionCheckFailure) + + DeleteGlobalSecondaryIndexAction_IndexName = DeleteGlobalSecondaryIndexAction.AddMember("IndexName", _IndexName) + + DeleteGlobalTableWitnessGroupMemberAction_RegionName = DeleteGlobalTableWitnessGroupMemberAction.AddMember("RegionName", _RegionName) + + DeleteReplicaAction_RegionName = DeleteReplicaAction.AddMember("RegionName", _RegionName) + + DeleteReplicationGroupMemberAction_RegionName = DeleteReplicationGroupMemberAction.AddMember("RegionName", _RegionName) + + DeleteVectorIndexAction_IndexName = DeleteVectorIndexAction.AddMember("IndexName", _IndexName) + + DestinationStatus_ENABLING = DestinationStatus.AddMember("ENABLING", smithyprelude.Unit) + + DestinationStatus_ACTIVE = DestinationStatus.AddMember("ACTIVE", smithyprelude.Unit) + + DestinationStatus_DISABLING = DestinationStatus.AddMember("DISABLING", smithyprelude.Unit) + + DestinationStatus_DISABLED = DestinationStatus.AddMember("DISABLED", smithyprelude.Unit) + + DestinationStatus_ENABLE_FAILED = DestinationStatus.AddMember("ENABLE_FAILED", smithyprelude.Unit) + + DestinationStatus_UPDATING = DestinationStatus.AddMember("UPDATING", smithyprelude.Unit) + + DuplicateItemException_message = DuplicateItemException.AddMember("message", _ErrorMessage) + + EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision = EnableKinesisStreamingConfiguration.AddMember("ApproximateCreationDateTimePrecision", ApproximateCreationDateTimePrecision) + + Endpoint_Address = Endpoint.AddMember("Address", _String) + + Endpoint_CachePeriodInMinutes = Endpoint.AddMember("CachePeriodInMinutes", _Long) + + _Endpoints_member = _Endpoints.AddMember("member", Endpoint) + + ExpectedAttributeValue_Value = ExpectedAttributeValue.AddMember("Value", AttributeValue) + + ExpectedAttributeValue_Exists = ExpectedAttributeValue.AddMember("Exists", _BooleanObject) + + ExpectedAttributeValue_ComparisonOperator = ExpectedAttributeValue.AddMember("ComparisonOperator", ComparisonOperator) + + ExpectedAttributeValue_AttributeValueList = ExpectedAttributeValue.AddMember("AttributeValueList", _AttributeValueList) + + _ExpectedAttributeMap_key = _ExpectedAttributeMap.AddMember("key", _AttributeName) + + _ExpectedAttributeMap_value = _ExpectedAttributeMap.AddMember("value", ExpectedAttributeValue) + + ExportConflictException_message = ExportConflictException.AddMember("message", _ErrorMessage) + + ExportStatus_IN_PROGRESS = ExportStatus.AddMember("IN_PROGRESS", smithyprelude.Unit) + + ExportStatus_COMPLETED = ExportStatus.AddMember("COMPLETED", smithyprelude.Unit) + + ExportStatus_FAILED = ExportStatus.AddMember("FAILED", smithyprelude.Unit) + + S3SseAlgorithm_AES256 = S3SseAlgorithm.AddMember("AES256", smithyprelude.Unit) + + S3SseAlgorithm_KMS = S3SseAlgorithm.AddMember("KMS", smithyprelude.Unit) + + ExportFormat_DYNAMODB_JSON = ExportFormat.AddMember("DYNAMODB_JSON", smithyprelude.Unit) + + ExportFormat_ION = ExportFormat.AddMember("ION", smithyprelude.Unit) + + ExportType_FULL_EXPORT = ExportType.AddMember("FULL_EXPORT", smithyprelude.Unit) + + ExportType_INCREMENTAL_EXPORT = ExportType.AddMember("INCREMENTAL_EXPORT", smithyprelude.Unit) + + ExportViewType_NEW_IMAGE = ExportViewType.AddMember("NEW_IMAGE", smithyprelude.Unit) + + ExportViewType_NEW_AND_OLD_IMAGES = ExportViewType.AddMember("NEW_AND_OLD_IMAGES", smithyprelude.Unit) + + IncrementalExportSpecification_ExportFromTime = IncrementalExportSpecification.AddMember("ExportFromTime", _ExportFromTime) + + IncrementalExportSpecification_ExportToTime = IncrementalExportSpecification.AddMember("ExportToTime", _ExportToTime) + + IncrementalExportSpecification_ExportViewType = IncrementalExportSpecification.AddMember("ExportViewType", ExportViewType) + + FilterSpecification_FilterExpression = FilterSpecification.AddMember("FilterExpression", _ConditionExpression) + + FilterSpecification_ProjectionExpression = FilterSpecification.AddMember("ProjectionExpression", _ProjectionExpression) + + FilterSpecification_KeyConditionExpression = FilterSpecification.AddMember("KeyConditionExpression", _KeyExpression) + + FilterSpecification_ExpressionAttributeNames = FilterSpecification.AddMember("ExpressionAttributeNames", _ExpressionAttributeNameMap) + + FilterSpecification_ExpressionAttributeValues = FilterSpecification.AddMember("ExpressionAttributeValues", _ExpressionAttributeValueMap) + + ExportDescription_ExportArn = ExportDescription.AddMember("ExportArn", _ExportArn) + + ExportDescription_ExportStatus = ExportDescription.AddMember("ExportStatus", ExportStatus) + + ExportDescription_StartTime = ExportDescription.AddMember("StartTime", _ExportStartTime) + + ExportDescription_EndTime = ExportDescription.AddMember("EndTime", _ExportEndTime) + + ExportDescription_ExportManifest = ExportDescription.AddMember("ExportManifest", _ExportManifest) + + ExportDescription_TableArn = ExportDescription.AddMember("TableArn", _TableArn) + + ExportDescription_TableId = ExportDescription.AddMember("TableId", _TableId) + + ExportDescription_ExportTime = ExportDescription.AddMember("ExportTime", _ExportTime) + + ExportDescription_ClientToken = ExportDescription.AddMember("ClientToken", _ClientToken) + + ExportDescription_S3Bucket = ExportDescription.AddMember("S3Bucket", _S3Bucket) + + ExportDescription_S3BucketOwner = ExportDescription.AddMember("S3BucketOwner", _S3BucketOwner) + + ExportDescription_S3Prefix = ExportDescription.AddMember("S3Prefix", _S3Prefix) + + ExportDescription_S3SseAlgorithm = ExportDescription.AddMember("S3SseAlgorithm", S3SseAlgorithm) + + ExportDescription_S3SseKmsKeyId = ExportDescription.AddMember("S3SseKmsKeyId", _S3SseKmsKeyId) + + ExportDescription_FailureCode = ExportDescription.AddMember("FailureCode", _FailureCode) + + ExportDescription_FailureMessage = ExportDescription.AddMember("FailureMessage", _FailureMessage) + + ExportDescription_ExportFormat = ExportDescription.AddMember("ExportFormat", ExportFormat) + + ExportDescription_BilledSizeBytes = ExportDescription.AddMember("BilledSizeBytes", _BilledSizeBytes) + + ExportDescription_ItemCount = ExportDescription.AddMember("ItemCount", _ItemCount) + + ExportDescription_ExportType = ExportDescription.AddMember("ExportType", ExportType) + + ExportDescription_IncrementalExportSpecification = ExportDescription.AddMember("IncrementalExportSpecification", IncrementalExportSpecification) + + ExportDescription_FilterSpecification = ExportDescription.AddMember("FilterSpecification", FilterSpecification) + + ExportNotFoundException_message = ExportNotFoundException.AddMember("message", _ErrorMessage) + + ExportSummary_ExportArn = ExportSummary.AddMember("ExportArn", _ExportArn) + + ExportSummary_ExportStatus = ExportSummary.AddMember("ExportStatus", ExportStatus) + + ExportSummary_ExportType = ExportSummary.AddMember("ExportType", ExportType) + + _ExportSummaries_member = _ExportSummaries.AddMember("member", ExportSummary) + + FailureException_ExceptionName = FailureException.AddMember("ExceptionName", _ExceptionName) + + FailureException_ExceptionDescription = FailureException.AddMember("ExceptionDescription", _ExceptionDescription) + + _FilterConditionMap_key = _FilterConditionMap.AddMember("key", _AttributeName) + + _FilterConditionMap_value = _FilterConditionMap.AddMember("value", Condition) + + Get_Key = Get.AddMember("Key", _Key) + + Get_TableName = Get.AddMember("TableName", _TableArn) + + Get_ProjectionExpression = Get.AddMember("ProjectionExpression", _ProjectionExpression) + + Get_ExpressionAttributeNames = Get.AddMember("ExpressionAttributeNames", _ExpressionAttributeNameMap) + + GlobalSecondaryIndex_IndexName = GlobalSecondaryIndex.AddMember("IndexName", _IndexName) + + GlobalSecondaryIndex_KeySchema = GlobalSecondaryIndex.AddMember("KeySchema", _KeySchema) + + GlobalSecondaryIndex_Projection = GlobalSecondaryIndex.AddMember("Projection", Projection) + + GlobalSecondaryIndex_ProvisionedThroughput = GlobalSecondaryIndex.AddMember("ProvisionedThroughput", ProvisionedThroughput) + + GlobalSecondaryIndex_OnDemandThroughput = GlobalSecondaryIndex.AddMember("OnDemandThroughput", OnDemandThroughput) + + GlobalSecondaryIndex_WarmThroughput = GlobalSecondaryIndex.AddMember("WarmThroughput", WarmThroughput) + + GlobalSecondaryIndexAutoScalingUpdate_IndexName = GlobalSecondaryIndexAutoScalingUpdate.AddMember("IndexName", _IndexName) + + GlobalSecondaryIndexAutoScalingUpdate_ProvisionedWriteCapacityAutoScalingUpdate = GlobalSecondaryIndexAutoScalingUpdate.AddMember("ProvisionedWriteCapacityAutoScalingUpdate", AutoScalingSettingsUpdate) + + _GlobalSecondaryIndexAutoScalingUpdateList_member = _GlobalSecondaryIndexAutoScalingUpdateList.AddMember("member", GlobalSecondaryIndexAutoScalingUpdate) + + IndexStatus_CREATING = IndexStatus.AddMember("CREATING", smithyprelude.Unit) + + IndexStatus_UPDATING = IndexStatus.AddMember("UPDATING", smithyprelude.Unit) + + IndexStatus_DELETING = IndexStatus.AddMember("DELETING", smithyprelude.Unit) + + IndexStatus_ACTIVE = IndexStatus.AddMember("ACTIVE", smithyprelude.Unit) + + ProvisionedThroughputDescription_LastIncreaseDateTime = ProvisionedThroughputDescription.AddMember("LastIncreaseDateTime", _Date) + + ProvisionedThroughputDescription_LastDecreaseDateTime = ProvisionedThroughputDescription.AddMember("LastDecreaseDateTime", _Date) + + ProvisionedThroughputDescription_NumberOfDecreasesToday = ProvisionedThroughputDescription.AddMember("NumberOfDecreasesToday", _PositiveLongObject) + + ProvisionedThroughputDescription_ReadCapacityUnits = ProvisionedThroughputDescription.AddMember("ReadCapacityUnits", _NonNegativeLongObject) + + ProvisionedThroughputDescription_WriteCapacityUnits = ProvisionedThroughputDescription.AddMember("WriteCapacityUnits", _NonNegativeLongObject) + + GlobalSecondaryIndexWarmThroughputDescription_ReadUnitsPerSecond = GlobalSecondaryIndexWarmThroughputDescription.AddMember("ReadUnitsPerSecond", _PositiveLongObject) + + GlobalSecondaryIndexWarmThroughputDescription_WriteUnitsPerSecond = GlobalSecondaryIndexWarmThroughputDescription.AddMember("WriteUnitsPerSecond", _PositiveLongObject) + + GlobalSecondaryIndexWarmThroughputDescription_Status = GlobalSecondaryIndexWarmThroughputDescription.AddMember("Status", IndexStatus) + + GlobalSecondaryIndexDescription_IndexName = GlobalSecondaryIndexDescription.AddMember("IndexName", _IndexName) + + GlobalSecondaryIndexDescription_KeySchema = GlobalSecondaryIndexDescription.AddMember("KeySchema", _KeySchema) + + GlobalSecondaryIndexDescription_Projection = GlobalSecondaryIndexDescription.AddMember("Projection", Projection) + + GlobalSecondaryIndexDescription_IndexStatus = GlobalSecondaryIndexDescription.AddMember("IndexStatus", IndexStatus) + + GlobalSecondaryIndexDescription_Backfilling = GlobalSecondaryIndexDescription.AddMember("Backfilling", _Backfilling) + + GlobalSecondaryIndexDescription_ProvisionedThroughput = GlobalSecondaryIndexDescription.AddMember("ProvisionedThroughput", ProvisionedThroughputDescription) + + GlobalSecondaryIndexDescription_IndexSizeBytes = GlobalSecondaryIndexDescription.AddMember("IndexSizeBytes", _LongObject) + + GlobalSecondaryIndexDescription_ItemCount = GlobalSecondaryIndexDescription.AddMember("ItemCount", _LongObject) + + GlobalSecondaryIndexDescription_IndexArn = GlobalSecondaryIndexDescription.AddMember("IndexArn", _String) + + GlobalSecondaryIndexDescription_OnDemandThroughput = GlobalSecondaryIndexDescription.AddMember("OnDemandThroughput", OnDemandThroughput) + + GlobalSecondaryIndexDescription_WarmThroughput = GlobalSecondaryIndexDescription.AddMember("WarmThroughput", GlobalSecondaryIndexWarmThroughputDescription) + + _GlobalSecondaryIndexDescriptionList_member = _GlobalSecondaryIndexDescriptionList.AddMember("member", GlobalSecondaryIndexDescription) + + _GlobalSecondaryIndexList_member = _GlobalSecondaryIndexList.AddMember("member", GlobalSecondaryIndex) + + UpdateGlobalSecondaryIndexAction_IndexName = UpdateGlobalSecondaryIndexAction.AddMember("IndexName", _IndexName) + + UpdateGlobalSecondaryIndexAction_ProvisionedThroughput = UpdateGlobalSecondaryIndexAction.AddMember("ProvisionedThroughput", ProvisionedThroughput) + + UpdateGlobalSecondaryIndexAction_OnDemandThroughput = UpdateGlobalSecondaryIndexAction.AddMember("OnDemandThroughput", OnDemandThroughput) + + UpdateGlobalSecondaryIndexAction_WarmThroughput = UpdateGlobalSecondaryIndexAction.AddMember("WarmThroughput", WarmThroughput) + + GlobalSecondaryIndexUpdate_Update = GlobalSecondaryIndexUpdate.AddMember("Update", UpdateGlobalSecondaryIndexAction) + + GlobalSecondaryIndexUpdate_Create = GlobalSecondaryIndexUpdate.AddMember("Create", CreateGlobalSecondaryIndexAction) + + GlobalSecondaryIndexUpdate_Delete = GlobalSecondaryIndexUpdate.AddMember("Delete", DeleteGlobalSecondaryIndexAction) + + _GlobalSecondaryIndexUpdateList_member = _GlobalSecondaryIndexUpdateList.AddMember("member", GlobalSecondaryIndexUpdate) + + Replica_RegionName = Replica.AddMember("RegionName", _RegionName) + + _ReplicaList_member = _ReplicaList.AddMember("member", Replica) + + GlobalTable_GlobalTableName = GlobalTable.AddMember("GlobalTableName", _TableName) + + GlobalTable_ReplicationGroup = GlobalTable.AddMember("ReplicationGroup", _ReplicaList) + + GlobalTableAlreadyExistsException_message = GlobalTableAlreadyExistsException.AddMember("message", _ErrorMessage) + + ReplicaStatus_CREATING = ReplicaStatus.AddMember("CREATING", smithyprelude.Unit) + + ReplicaStatus_CREATION_FAILED = ReplicaStatus.AddMember("CREATION_FAILED", smithyprelude.Unit) + + ReplicaStatus_UPDATING = ReplicaStatus.AddMember("UPDATING", smithyprelude.Unit) + + ReplicaStatus_DELETING = ReplicaStatus.AddMember("DELETING", smithyprelude.Unit) + + ReplicaStatus_ACTIVE = ReplicaStatus.AddMember("ACTIVE", smithyprelude.Unit) + + ReplicaStatus_REGION_DISABLED = ReplicaStatus.AddMember("REGION_DISABLED", smithyprelude.Unit) + + ReplicaStatus_INACCESSIBLE_ENCRYPTION_CREDENTIALS = ReplicaStatus.AddMember("INACCESSIBLE_ENCRYPTION_CREDENTIALS", smithyprelude.Unit) + + ReplicaStatus_ARCHIVING = ReplicaStatus.AddMember("ARCHIVING", smithyprelude.Unit) + + ReplicaStatus_ARCHIVED = ReplicaStatus.AddMember("ARCHIVED", smithyprelude.Unit) + + ReplicaStatus_REPLICATION_NOT_AUTHORIZED = ReplicaStatus.AddMember("REPLICATION_NOT_AUTHORIZED", smithyprelude.Unit) + + TableStatus_CREATING = TableStatus.AddMember("CREATING", smithyprelude.Unit) + + TableStatus_UPDATING = TableStatus.AddMember("UPDATING", smithyprelude.Unit) + + TableStatus_DELETING = TableStatus.AddMember("DELETING", smithyprelude.Unit) + + TableStatus_ACTIVE = TableStatus.AddMember("ACTIVE", smithyprelude.Unit) + + TableStatus_INACCESSIBLE_ENCRYPTION_CREDENTIALS = TableStatus.AddMember("INACCESSIBLE_ENCRYPTION_CREDENTIALS", smithyprelude.Unit) + + TableStatus_ARCHIVING = TableStatus.AddMember("ARCHIVING", smithyprelude.Unit) + + TableStatus_ARCHIVED = TableStatus.AddMember("ARCHIVED", smithyprelude.Unit) + + TableStatus_REPLICATION_NOT_AUTHORIZED = TableStatus.AddMember("REPLICATION_NOT_AUTHORIZED", smithyprelude.Unit) + + TableWarmThroughputDescription_ReadUnitsPerSecond = TableWarmThroughputDescription.AddMember("ReadUnitsPerSecond", _PositiveLongObject) + + TableWarmThroughputDescription_WriteUnitsPerSecond = TableWarmThroughputDescription.AddMember("WriteUnitsPerSecond", _PositiveLongObject) + + TableWarmThroughputDescription_Status = TableWarmThroughputDescription.AddMember("Status", TableStatus) + + ReplicaGlobalSecondaryIndexDescription_IndexName = ReplicaGlobalSecondaryIndexDescription.AddMember("IndexName", _IndexName) + + ReplicaGlobalSecondaryIndexDescription_ProvisionedThroughputOverride = ReplicaGlobalSecondaryIndexDescription.AddMember("ProvisionedThroughputOverride", ProvisionedThroughputOverride) + + ReplicaGlobalSecondaryIndexDescription_OnDemandThroughputOverride = ReplicaGlobalSecondaryIndexDescription.AddMember("OnDemandThroughputOverride", OnDemandThroughputOverride) + + ReplicaGlobalSecondaryIndexDescription_WarmThroughput = ReplicaGlobalSecondaryIndexDescription.AddMember("WarmThroughput", GlobalSecondaryIndexWarmThroughputDescription) + + _ReplicaGlobalSecondaryIndexDescriptionList_member = _ReplicaGlobalSecondaryIndexDescriptionList.AddMember("member", ReplicaGlobalSecondaryIndexDescription) + + TableClassSummary_TableClass = TableClassSummary.AddMember("TableClass", TableClass) + + TableClassSummary_LastUpdateDateTime = TableClassSummary.AddMember("LastUpdateDateTime", _Date) + + GlobalTableSettingsReplicationMode_ENABLED = GlobalTableSettingsReplicationMode.AddMember("ENABLED", smithyprelude.Unit) + + GlobalTableSettingsReplicationMode_DISABLED = GlobalTableSettingsReplicationMode.AddMember("DISABLED", smithyprelude.Unit) + + GlobalTableSettingsReplicationMode_ENABLED_WITH_OVERRIDES = GlobalTableSettingsReplicationMode.AddMember("ENABLED_WITH_OVERRIDES", smithyprelude.Unit) + + ReplicaDescription_RegionName = ReplicaDescription.AddMember("RegionName", _RegionName) + + ReplicaDescription_ReplicaStatus = ReplicaDescription.AddMember("ReplicaStatus", ReplicaStatus) + + ReplicaDescription_ReplicaArn = ReplicaDescription.AddMember("ReplicaArn", _String) + + ReplicaDescription_ReplicaStatusDescription = ReplicaDescription.AddMember("ReplicaStatusDescription", _ReplicaStatusDescription) + + ReplicaDescription_ReplicaStatusPercentProgress = ReplicaDescription.AddMember("ReplicaStatusPercentProgress", _ReplicaStatusPercentProgress) + + ReplicaDescription_KMSMasterKeyId = ReplicaDescription.AddMember("KMSMasterKeyId", _KMSMasterKeyId) + + ReplicaDescription_ProvisionedThroughputOverride = ReplicaDescription.AddMember("ProvisionedThroughputOverride", ProvisionedThroughputOverride) + + ReplicaDescription_OnDemandThroughputOverride = ReplicaDescription.AddMember("OnDemandThroughputOverride", OnDemandThroughputOverride) + + ReplicaDescription_WarmThroughput = ReplicaDescription.AddMember("WarmThroughput", TableWarmThroughputDescription) + + ReplicaDescription_GlobalSecondaryIndexes = ReplicaDescription.AddMember("GlobalSecondaryIndexes", _ReplicaGlobalSecondaryIndexDescriptionList) + + ReplicaDescription_ReplicaInaccessibleDateTime = ReplicaDescription.AddMember("ReplicaInaccessibleDateTime", _Date) + + ReplicaDescription_ReplicaTableClassSummary = ReplicaDescription.AddMember("ReplicaTableClassSummary", TableClassSummary) + + ReplicaDescription_GlobalTableSettingsReplicationMode = ReplicaDescription.AddMember("GlobalTableSettingsReplicationMode", GlobalTableSettingsReplicationMode) + + _ReplicaDescriptionList_member = _ReplicaDescriptionList.AddMember("member", ReplicaDescription) + + GlobalTableStatus_CREATING = GlobalTableStatus.AddMember("CREATING", smithyprelude.Unit) + + GlobalTableStatus_ACTIVE = GlobalTableStatus.AddMember("ACTIVE", smithyprelude.Unit) + + GlobalTableStatus_DELETING = GlobalTableStatus.AddMember("DELETING", smithyprelude.Unit) + + GlobalTableStatus_UPDATING = GlobalTableStatus.AddMember("UPDATING", smithyprelude.Unit) + + GlobalTableDescription_ReplicationGroup = GlobalTableDescription.AddMember("ReplicationGroup", _ReplicaDescriptionList) + + GlobalTableDescription_GlobalTableArn = GlobalTableDescription.AddMember("GlobalTableArn", _GlobalTableArnString) + + GlobalTableDescription_CreationDateTime = GlobalTableDescription.AddMember("CreationDateTime", _Date) + + GlobalTableDescription_GlobalTableStatus = GlobalTableDescription.AddMember("GlobalTableStatus", GlobalTableStatus) + + GlobalTableDescription_GlobalTableName = GlobalTableDescription.AddMember("GlobalTableName", _TableName) + + GlobalTableGlobalSecondaryIndexSettingsUpdate_IndexName = GlobalTableGlobalSecondaryIndexSettingsUpdate.AddMember("IndexName", _IndexName) + + GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityUnits = GlobalTableGlobalSecondaryIndexSettingsUpdate.AddMember("ProvisionedWriteCapacityUnits", _PositiveLongObject) + + GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityAutoScalingSettingsUpdate = GlobalTableGlobalSecondaryIndexSettingsUpdate.AddMember("ProvisionedWriteCapacityAutoScalingSettingsUpdate", AutoScalingSettingsUpdate) + + _GlobalTableGlobalSecondaryIndexSettingsUpdateList_member = _GlobalTableGlobalSecondaryIndexSettingsUpdateList.AddMember("member", GlobalTableGlobalSecondaryIndexSettingsUpdate) + + _GlobalTableList_member = _GlobalTableList.AddMember("member", GlobalTable) + + GlobalTableNotFoundException_message = GlobalTableNotFoundException.AddMember("message", _ErrorMessage) + + WitnessStatus_CREATING = WitnessStatus.AddMember("CREATING", smithyprelude.Unit) + + WitnessStatus_DELETING = WitnessStatus.AddMember("DELETING", smithyprelude.Unit) + + WitnessStatus_ACTIVE = WitnessStatus.AddMember("ACTIVE", smithyprelude.Unit) + + GlobalTableWitnessDescription_RegionName = GlobalTableWitnessDescription.AddMember("RegionName", _RegionName) + + GlobalTableWitnessDescription_WitnessStatus = GlobalTableWitnessDescription.AddMember("WitnessStatus", WitnessStatus) + + _GlobalTableWitnessDescriptionList_member = _GlobalTableWitnessDescriptionList.AddMember("member", GlobalTableWitnessDescription) + + GlobalTableWitnessGroupUpdate_Create = GlobalTableWitnessGroupUpdate.AddMember("Create", CreateGlobalTableWitnessGroupMemberAction) + + GlobalTableWitnessGroupUpdate_Delete = GlobalTableWitnessGroupUpdate.AddMember("Delete", DeleteGlobalTableWitnessGroupMemberAction) + + _GlobalTableWitnessGroupUpdateList_member = _GlobalTableWitnessGroupUpdateList.AddMember("member", GlobalTableWitnessGroupUpdate) + + IdempotentParameterMismatchException_Message = IdempotentParameterMismatchException.AddMember("Message", _ErrorMessage) + + ImportConflictException_message = ImportConflictException.AddMember("message", _ErrorMessage) + + ImportNotFoundException_message = ImportNotFoundException.AddMember("message", _ErrorMessage) + + ImportStatus_IN_PROGRESS = ImportStatus.AddMember("IN_PROGRESS", smithyprelude.Unit) + + ImportStatus_COMPLETED = ImportStatus.AddMember("COMPLETED", smithyprelude.Unit) + + ImportStatus_CANCELLING = ImportStatus.AddMember("CANCELLING", smithyprelude.Unit) + + ImportStatus_CANCELLED = ImportStatus.AddMember("CANCELLED", smithyprelude.Unit) + + ImportStatus_FAILED = ImportStatus.AddMember("FAILED", smithyprelude.Unit) + + S3BucketSource_S3BucketOwner = S3BucketSource.AddMember("S3BucketOwner", _S3BucketOwner) + + S3BucketSource_S3Bucket = S3BucketSource.AddMember("S3Bucket", _S3Bucket) + + S3BucketSource_S3KeyPrefix = S3BucketSource.AddMember("S3KeyPrefix", _S3Prefix) + + InputFormat_DYNAMODB_JSON = InputFormat.AddMember("DYNAMODB_JSON", smithyprelude.Unit) + + InputFormat_ION = InputFormat.AddMember("ION", smithyprelude.Unit) + + InputFormat_CSV = InputFormat.AddMember("CSV", smithyprelude.Unit) + + ImportSummary_ImportArn = ImportSummary.AddMember("ImportArn", _ImportArn) + + ImportSummary_ImportStatus = ImportSummary.AddMember("ImportStatus", ImportStatus) + + ImportSummary_TableArn = ImportSummary.AddMember("TableArn", _TableArn) + + ImportSummary_S3BucketSource = ImportSummary.AddMember("S3BucketSource", S3BucketSource) + + ImportSummary_CloudWatchLogGroupArn = ImportSummary.AddMember("CloudWatchLogGroupArn", _CloudWatchLogGroupArn) + + ImportSummary_InputFormat = ImportSummary.AddMember("InputFormat", InputFormat) + + ImportSummary_StartTime = ImportSummary.AddMember("StartTime", _ImportStartTime) + + ImportSummary_EndTime = ImportSummary.AddMember("EndTime", _ImportEndTime) + + _ImportSummaryList_member = _ImportSummaryList.AddMember("member", ImportSummary) + + InputFormatOptions_Csv = InputFormatOptions.AddMember("Csv", CsvOptions) + + InputCompressionType_GZIP = InputCompressionType.AddMember("GZIP", smithyprelude.Unit) + + InputCompressionType_ZSTD = InputCompressionType.AddMember("ZSTD", smithyprelude.Unit) + + InputCompressionType_NONE = InputCompressionType.AddMember("NONE", smithyprelude.Unit) + + SSESpecification_Enabled = SSESpecification.AddMember("Enabled", _SSEEnabled) + + SSESpecification_SSEType = SSESpecification.AddMember("SSEType", SSEType) + + SSESpecification_KMSMasterKeyId = SSESpecification.AddMember("KMSMasterKeyId", _KMSMasterKeyId) + + VectorIndex_IndexName = VectorIndex.AddMember("IndexName", _IndexName) + + VectorIndex_VectorAttribute = VectorIndex.AddMember("VectorAttribute", VectorAttributeDefinition) + + VectorIndex_SearchSchema = VectorIndex.AddMember("SearchSchema", _SearchSchema) + + VectorIndex_Projection = VectorIndex.AddMember("Projection", Projection) + + VectorIndex_Dimensions = VectorIndex.AddMember("Dimensions", _PositiveLongObject) + + VectorIndex_DistanceFunction = VectorIndex.AddMember("DistanceFunction", VectorDistanceFunction) + + _VectorIndexList_member = _VectorIndexList.AddMember("member", VectorIndex) + + TableCreationParameters_TableName = TableCreationParameters.AddMember("TableName", _TableName) + + TableCreationParameters_AttributeDefinitions = TableCreationParameters.AddMember("AttributeDefinitions", _AttributeDefinitions) + + TableCreationParameters_KeySchema = TableCreationParameters.AddMember("KeySchema", _KeySchema) + + TableCreationParameters_BillingMode = TableCreationParameters.AddMember("BillingMode", BillingMode) + + TableCreationParameters_ProvisionedThroughput = TableCreationParameters.AddMember("ProvisionedThroughput", ProvisionedThroughput) + + TableCreationParameters_OnDemandThroughput = TableCreationParameters.AddMember("OnDemandThroughput", OnDemandThroughput) + + TableCreationParameters_SSESpecification = TableCreationParameters.AddMember("SSESpecification", SSESpecification) + + TableCreationParameters_GlobalSecondaryIndexes = TableCreationParameters.AddMember("GlobalSecondaryIndexes", _GlobalSecondaryIndexList) + + TableCreationParameters_VectorIndexes = TableCreationParameters.AddMember("VectorIndexes", _VectorIndexList) + + ImportTableDescription_ImportArn = ImportTableDescription.AddMember("ImportArn", _ImportArn) + + ImportTableDescription_ImportStatus = ImportTableDescription.AddMember("ImportStatus", ImportStatus) + + ImportTableDescription_TableArn = ImportTableDescription.AddMember("TableArn", _TableArn) + + ImportTableDescription_TableId = ImportTableDescription.AddMember("TableId", _TableId) + + ImportTableDescription_ClientToken = ImportTableDescription.AddMember("ClientToken", _ClientToken) + + ImportTableDescription_S3BucketSource = ImportTableDescription.AddMember("S3BucketSource", S3BucketSource) + + ImportTableDescription_ErrorCount = ImportTableDescription.AddMember("ErrorCount", _ErrorCount) + + ImportTableDescription_CloudWatchLogGroupArn = ImportTableDescription.AddMember("CloudWatchLogGroupArn", _CloudWatchLogGroupArn) + + ImportTableDescription_InputFormat = ImportTableDescription.AddMember("InputFormat", InputFormat) + + ImportTableDescription_InputFormatOptions = ImportTableDescription.AddMember("InputFormatOptions", InputFormatOptions) + + ImportTableDescription_InputCompressionType = ImportTableDescription.AddMember("InputCompressionType", InputCompressionType) + + ImportTableDescription_TableCreationParameters = ImportTableDescription.AddMember("TableCreationParameters", TableCreationParameters) + + ImportTableDescription_StartTime = ImportTableDescription.AddMember("StartTime", _ImportStartTime) + + ImportTableDescription_EndTime = ImportTableDescription.AddMember("EndTime", _ImportEndTime) + + ImportTableDescription_ProcessedSizeBytes = ImportTableDescription.AddMember("ProcessedSizeBytes", _LongObject) + + ImportTableDescription_ProcessedItemCount = ImportTableDescription.AddMember("ProcessedItemCount", _ProcessedItemCount) + + ImportTableDescription_ImportedItemCount = ImportTableDescription.AddMember("ImportedItemCount", _ImportedItemCount) + + ImportTableDescription_FailureCode = ImportTableDescription.AddMember("FailureCode", _FailureCode) + + ImportTableDescription_FailureMessage = ImportTableDescription.AddMember("FailureMessage", _FailureMessage) + + IndexNotFoundException_message = IndexNotFoundException.AddMember("message", _ErrorMessage) + + InternalServerError_message = InternalServerError.AddMember("message", _ErrorMessage) + + InvalidEndpointException_Message = InvalidEndpointException.AddMember("Message", _String) + + InvalidExportTimeException_message = InvalidExportTimeException.AddMember("message", _ErrorMessage) + + InvalidRestoreTimeException_message = InvalidRestoreTimeException.AddMember("message", _ErrorMessage) + + _ItemCollectionKeyAttributeMap_key = _ItemCollectionKeyAttributeMap.AddMember("key", _AttributeName) + + _ItemCollectionKeyAttributeMap_value = _ItemCollectionKeyAttributeMap.AddMember("value", AttributeValue) + + _ItemCollectionSizeEstimateRange_member = _ItemCollectionSizeEstimateRange.AddMember("member", _ItemCollectionSizeEstimateBound) + + ItemCollectionMetrics_ItemCollectionKey = ItemCollectionMetrics.AddMember("ItemCollectionKey", _ItemCollectionKeyAttributeMap) + + ItemCollectionMetrics_SizeEstimateRangeGB = ItemCollectionMetrics.AddMember("SizeEstimateRangeGB", _ItemCollectionSizeEstimateRange) + + _ItemCollectionMetricsMultiple_member = _ItemCollectionMetricsMultiple.AddMember("member", ItemCollectionMetrics) + + _ItemCollectionMetricsPerTable_key = _ItemCollectionMetricsPerTable.AddMember("key", _TableArn) + + _ItemCollectionMetricsPerTable_value = _ItemCollectionMetricsPerTable.AddMember("value", _ItemCollectionMetricsMultiple) + + ItemCollectionSizeLimitExceededException_message = ItemCollectionSizeLimitExceededException.AddMember("message", _ErrorMessage) + + ItemResponse_Item = ItemResponse.AddMember("Item", _AttributeMap) + + _ItemResponseList_member = _ItemResponseList.AddMember("member", ItemResponse) + + _KeyConditions_key = _KeyConditions.AddMember("key", _AttributeName) + + _KeyConditions_value = _KeyConditions.AddMember("value", Condition) + + KinesisDataStreamDestination_StreamArn = KinesisDataStreamDestination.AddMember("StreamArn", _StreamArn) + + KinesisDataStreamDestination_DestinationStatus = KinesisDataStreamDestination.AddMember("DestinationStatus", DestinationStatus) + + KinesisDataStreamDestination_DestinationStatusDescription = KinesisDataStreamDestination.AddMember("DestinationStatusDescription", _String) + + KinesisDataStreamDestination_ApproximateCreationDateTimePrecision = KinesisDataStreamDestination.AddMember("ApproximateCreationDateTimePrecision", ApproximateCreationDateTimePrecision) + + _KinesisDataStreamDestinations_member = _KinesisDataStreamDestinations.AddMember("member", KinesisDataStreamDestination) + + LimitExceededException_message = LimitExceededException.AddMember("message", _ErrorMessage) + + LocalSecondaryIndex_IndexName = LocalSecondaryIndex.AddMember("IndexName", _IndexName) + + LocalSecondaryIndex_KeySchema = LocalSecondaryIndex.AddMember("KeySchema", _KeySchema) + + LocalSecondaryIndex_Projection = LocalSecondaryIndex.AddMember("Projection", Projection) + + LocalSecondaryIndexDescription_IndexName = LocalSecondaryIndexDescription.AddMember("IndexName", _IndexName) + + LocalSecondaryIndexDescription_KeySchema = LocalSecondaryIndexDescription.AddMember("KeySchema", _KeySchema) + + LocalSecondaryIndexDescription_Projection = LocalSecondaryIndexDescription.AddMember("Projection", Projection) + + LocalSecondaryIndexDescription_IndexSizeBytes = LocalSecondaryIndexDescription.AddMember("IndexSizeBytes", _LongObject) + + LocalSecondaryIndexDescription_ItemCount = LocalSecondaryIndexDescription.AddMember("ItemCount", _LongObject) + + LocalSecondaryIndexDescription_IndexArn = LocalSecondaryIndexDescription.AddMember("IndexArn", _String) + + _LocalSecondaryIndexDescriptionList_member = _LocalSecondaryIndexDescriptionList.AddMember("member", LocalSecondaryIndexDescription) + + _LocalSecondaryIndexList_member = _LocalSecondaryIndexList.AddMember("member", LocalSecondaryIndex) + + MultiRegionConsistency_EVENTUAL = MultiRegionConsistency.AddMember("EVENTUAL", smithyprelude.Unit) + + MultiRegionConsistency_STRONG = MultiRegionConsistency.AddMember("STRONG", smithyprelude.Unit) + + ParameterizedStatement_Statement = ParameterizedStatement.AddMember("Statement", _PartiQLStatement) + + ParameterizedStatement_Parameters = ParameterizedStatement.AddMember("Parameters", _PreparedStatementParameters) + + ParameterizedStatement_ReturnValuesOnConditionCheckFailure = ParameterizedStatement.AddMember("ReturnValuesOnConditionCheckFailure", ReturnValuesOnConditionCheckFailure) + + _ParameterizedStatements_member = _ParameterizedStatements.AddMember("member", ParameterizedStatement) + + _PartiQLBatchRequest_member = _PartiQLBatchRequest.AddMember("member", BatchStatementRequest) + + _PartiQLBatchResponse_member = _PartiQLBatchResponse.AddMember("member", BatchStatementResponse) + + PointInTimeRecoverySpecification_PointInTimeRecoveryEnabled = PointInTimeRecoverySpecification.AddMember("PointInTimeRecoveryEnabled", _BooleanObject) + + PointInTimeRecoverySpecification_RecoveryPeriodInDays = PointInTimeRecoverySpecification.AddMember("RecoveryPeriodInDays", _RecoveryPeriodInDays) + + PointInTimeRecoveryUnavailableException_message = PointInTimeRecoveryUnavailableException.AddMember("message", _ErrorMessage) + + PolicyNotFoundException_message = PolicyNotFoundException.AddMember("message", _ErrorMessage) + + ThrottlingReason_reason = ThrottlingReason.AddMember("reason", _Reason) + + ThrottlingReason_resource = ThrottlingReason.AddMember("resource", _Resource) + + _ThrottlingReasonList_member = _ThrottlingReasonList.AddMember("member", ThrottlingReason) + + ProvisionedThroughputExceededException_message = ProvisionedThroughputExceededException.AddMember("message", _ErrorMessage) + + ProvisionedThroughputExceededException_ThrottlingReasons = ProvisionedThroughputExceededException.AddMember("ThrottlingReasons", _ThrottlingReasonList) + + Put_Item = Put.AddMember("Item", _PutItemInputAttributeMap) + + Put_TableName = Put.AddMember("TableName", _TableArn) + + Put_ConditionExpression = Put.AddMember("ConditionExpression", _ConditionExpression) + + Put_ExpressionAttributeNames = Put.AddMember("ExpressionAttributeNames", _ExpressionAttributeNameMap) + + Put_ExpressionAttributeValues = Put.AddMember("ExpressionAttributeValues", _ExpressionAttributeValueMap) + + Put_ReturnValuesOnConditionCheckFailure = Put.AddMember("ReturnValuesOnConditionCheckFailure", ReturnValuesOnConditionCheckFailure) + + ReplicaAlreadyExistsException_message = ReplicaAlreadyExistsException.AddMember("message", _ErrorMessage) + + ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexName = ReplicaGlobalSecondaryIndexAutoScalingDescription.AddMember("IndexName", _IndexName) + + ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexStatus = ReplicaGlobalSecondaryIndexAutoScalingDescription.AddMember("IndexStatus", IndexStatus) + + ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedReadCapacityAutoScalingSettings = ReplicaGlobalSecondaryIndexAutoScalingDescription.AddMember("ProvisionedReadCapacityAutoScalingSettings", AutoScalingSettingsDescription) + + ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedWriteCapacityAutoScalingSettings = ReplicaGlobalSecondaryIndexAutoScalingDescription.AddMember("ProvisionedWriteCapacityAutoScalingSettings", AutoScalingSettingsDescription) + + _ReplicaGlobalSecondaryIndexAutoScalingDescriptionList_member = _ReplicaGlobalSecondaryIndexAutoScalingDescriptionList.AddMember("member", ReplicaGlobalSecondaryIndexAutoScalingDescription) + + ReplicaAutoScalingDescription_RegionName = ReplicaAutoScalingDescription.AddMember("RegionName", _RegionName) + + ReplicaAutoScalingDescription_GlobalSecondaryIndexes = ReplicaAutoScalingDescription.AddMember("GlobalSecondaryIndexes", _ReplicaGlobalSecondaryIndexAutoScalingDescriptionList) + + ReplicaAutoScalingDescription_ReplicaProvisionedReadCapacityAutoScalingSettings = ReplicaAutoScalingDescription.AddMember("ReplicaProvisionedReadCapacityAutoScalingSettings", AutoScalingSettingsDescription) + + ReplicaAutoScalingDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings = ReplicaAutoScalingDescription.AddMember("ReplicaProvisionedWriteCapacityAutoScalingSettings", AutoScalingSettingsDescription) + + ReplicaAutoScalingDescription_ReplicaStatus = ReplicaAutoScalingDescription.AddMember("ReplicaStatus", ReplicaStatus) + + _ReplicaAutoScalingDescriptionList_member = _ReplicaAutoScalingDescriptionList.AddMember("member", ReplicaAutoScalingDescription) + + ReplicaGlobalSecondaryIndexAutoScalingUpdate_IndexName = ReplicaGlobalSecondaryIndexAutoScalingUpdate.AddMember("IndexName", _IndexName) + + ReplicaGlobalSecondaryIndexAutoScalingUpdate_ProvisionedReadCapacityAutoScalingUpdate = ReplicaGlobalSecondaryIndexAutoScalingUpdate.AddMember("ProvisionedReadCapacityAutoScalingUpdate", AutoScalingSettingsUpdate) + + _ReplicaGlobalSecondaryIndexAutoScalingUpdateList_member = _ReplicaGlobalSecondaryIndexAutoScalingUpdateList.AddMember("member", ReplicaGlobalSecondaryIndexAutoScalingUpdate) + + ReplicaAutoScalingUpdate_RegionName = ReplicaAutoScalingUpdate.AddMember("RegionName", _RegionName) + + ReplicaAutoScalingUpdate_ReplicaGlobalSecondaryIndexUpdates = ReplicaAutoScalingUpdate.AddMember("ReplicaGlobalSecondaryIndexUpdates", _ReplicaGlobalSecondaryIndexAutoScalingUpdateList) + + ReplicaAutoScalingUpdate_ReplicaProvisionedReadCapacityAutoScalingUpdate = ReplicaAutoScalingUpdate.AddMember("ReplicaProvisionedReadCapacityAutoScalingUpdate", AutoScalingSettingsUpdate) + + _ReplicaAutoScalingUpdateList_member = _ReplicaAutoScalingUpdateList.AddMember("member", ReplicaAutoScalingUpdate) + + ReplicaGlobalSecondaryIndexSettingsDescription_IndexName = ReplicaGlobalSecondaryIndexSettingsDescription.AddMember("IndexName", _IndexName) + + ReplicaGlobalSecondaryIndexSettingsDescription_IndexStatus = ReplicaGlobalSecondaryIndexSettingsDescription.AddMember("IndexStatus", IndexStatus) + + ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityUnits = ReplicaGlobalSecondaryIndexSettingsDescription.AddMember("ProvisionedReadCapacityUnits", _PositiveLongObject) + + ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityAutoScalingSettings = ReplicaGlobalSecondaryIndexSettingsDescription.AddMember("ProvisionedReadCapacityAutoScalingSettings", AutoScalingSettingsDescription) + + ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityUnits = ReplicaGlobalSecondaryIndexSettingsDescription.AddMember("ProvisionedWriteCapacityUnits", _PositiveLongObject) + + ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityAutoScalingSettings = ReplicaGlobalSecondaryIndexSettingsDescription.AddMember("ProvisionedWriteCapacityAutoScalingSettings", AutoScalingSettingsDescription) + + _ReplicaGlobalSecondaryIndexSettingsDescriptionList_member = _ReplicaGlobalSecondaryIndexSettingsDescriptionList.AddMember("member", ReplicaGlobalSecondaryIndexSettingsDescription) + + ReplicaGlobalSecondaryIndexSettingsUpdate_IndexName = ReplicaGlobalSecondaryIndexSettingsUpdate.AddMember("IndexName", _IndexName) + + ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityUnits = ReplicaGlobalSecondaryIndexSettingsUpdate.AddMember("ProvisionedReadCapacityUnits", _PositiveLongObject) + + ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityAutoScalingSettingsUpdate = ReplicaGlobalSecondaryIndexSettingsUpdate.AddMember("ProvisionedReadCapacityAutoScalingSettingsUpdate", AutoScalingSettingsUpdate) + + _ReplicaGlobalSecondaryIndexSettingsUpdateList_member = _ReplicaGlobalSecondaryIndexSettingsUpdateList.AddMember("member", ReplicaGlobalSecondaryIndexSettingsUpdate) + + ReplicaNotFoundException_message = ReplicaNotFoundException.AddMember("message", _ErrorMessage) + + ReplicaSettingsDescription_RegionName = ReplicaSettingsDescription.AddMember("RegionName", _RegionName) + + ReplicaSettingsDescription_ReplicaStatus = ReplicaSettingsDescription.AddMember("ReplicaStatus", ReplicaStatus) + + ReplicaSettingsDescription_ReplicaBillingModeSummary = ReplicaSettingsDescription.AddMember("ReplicaBillingModeSummary", BillingModeSummary) + + ReplicaSettingsDescription_ReplicaProvisionedReadCapacityUnits = ReplicaSettingsDescription.AddMember("ReplicaProvisionedReadCapacityUnits", _NonNegativeLongObject) + + ReplicaSettingsDescription_ReplicaProvisionedReadCapacityAutoScalingSettings = ReplicaSettingsDescription.AddMember("ReplicaProvisionedReadCapacityAutoScalingSettings", AutoScalingSettingsDescription) + + ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityUnits = ReplicaSettingsDescription.AddMember("ReplicaProvisionedWriteCapacityUnits", _NonNegativeLongObject) + + ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings = ReplicaSettingsDescription.AddMember("ReplicaProvisionedWriteCapacityAutoScalingSettings", AutoScalingSettingsDescription) + + ReplicaSettingsDescription_ReplicaGlobalSecondaryIndexSettings = ReplicaSettingsDescription.AddMember("ReplicaGlobalSecondaryIndexSettings", _ReplicaGlobalSecondaryIndexSettingsDescriptionList) + + ReplicaSettingsDescription_ReplicaTableClassSummary = ReplicaSettingsDescription.AddMember("ReplicaTableClassSummary", TableClassSummary) + + _ReplicaSettingsDescriptionList_member = _ReplicaSettingsDescriptionList.AddMember("member", ReplicaSettingsDescription) + + ReplicaSettingsUpdate_RegionName = ReplicaSettingsUpdate.AddMember("RegionName", _RegionName) + + ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityUnits = ReplicaSettingsUpdate.AddMember("ReplicaProvisionedReadCapacityUnits", _PositiveLongObject) + + ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate = ReplicaSettingsUpdate.AddMember("ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate", AutoScalingSettingsUpdate) + + ReplicaSettingsUpdate_ReplicaGlobalSecondaryIndexSettingsUpdate = ReplicaSettingsUpdate.AddMember("ReplicaGlobalSecondaryIndexSettingsUpdate", _ReplicaGlobalSecondaryIndexSettingsUpdateList) + + ReplicaSettingsUpdate_ReplicaTableClass = ReplicaSettingsUpdate.AddMember("ReplicaTableClass", TableClass) + + _ReplicaSettingsUpdateList_member = _ReplicaSettingsUpdateList.AddMember("member", ReplicaSettingsUpdate) + + ReplicatedWriteConflictException_message = ReplicatedWriteConflictException.AddMember("message", _ErrorMessage) + + UpdateReplicationGroupMemberAction_RegionName = UpdateReplicationGroupMemberAction.AddMember("RegionName", _RegionName) + + UpdateReplicationGroupMemberAction_KMSMasterKeyId = UpdateReplicationGroupMemberAction.AddMember("KMSMasterKeyId", _KMSMasterKeyId) + + UpdateReplicationGroupMemberAction_ProvisionedThroughputOverride = UpdateReplicationGroupMemberAction.AddMember("ProvisionedThroughputOverride", ProvisionedThroughputOverride) + + UpdateReplicationGroupMemberAction_OnDemandThroughputOverride = UpdateReplicationGroupMemberAction.AddMember("OnDemandThroughputOverride", OnDemandThroughputOverride) + + UpdateReplicationGroupMemberAction_GlobalSecondaryIndexes = UpdateReplicationGroupMemberAction.AddMember("GlobalSecondaryIndexes", _ReplicaGlobalSecondaryIndexList) + + UpdateReplicationGroupMemberAction_TableClassOverride = UpdateReplicationGroupMemberAction.AddMember("TableClassOverride", TableClass) + + ReplicationGroupUpdate_Create = ReplicationGroupUpdate.AddMember("Create", CreateReplicationGroupMemberAction) + + ReplicationGroupUpdate_Update = ReplicationGroupUpdate.AddMember("Update", UpdateReplicationGroupMemberAction) + + ReplicationGroupUpdate_Delete = ReplicationGroupUpdate.AddMember("Delete", DeleteReplicationGroupMemberAction) + + _ReplicationGroupUpdateList_member = _ReplicationGroupUpdateList.AddMember("member", ReplicationGroupUpdate) + + ReplicaUpdate_Create = ReplicaUpdate.AddMember("Create", CreateReplicaAction) + + ReplicaUpdate_Delete = ReplicaUpdate.AddMember("Delete", DeleteReplicaAction) + + _ReplicaUpdateList_member = _ReplicaUpdateList.AddMember("member", ReplicaUpdate) + + RequestLimitExceeded_message = RequestLimitExceeded.AddMember("message", _ErrorMessage) + + RequestLimitExceeded_ThrottlingReasons = RequestLimitExceeded.AddMember("ThrottlingReasons", _ThrottlingReasonList) + + ResourceInUseException_message = ResourceInUseException.AddMember("message", _ErrorMessage) + + ResourceNotFoundException_message = ResourceNotFoundException.AddMember("message", _ErrorMessage) + + RestoreSummary_SourceBackupArn = RestoreSummary.AddMember("SourceBackupArn", _BackupArn) + + RestoreSummary_SourceTableArn = RestoreSummary.AddMember("SourceTableArn", _TableArn) + + RestoreSummary_RestoreDateTime = RestoreSummary.AddMember("RestoreDateTime", _Date) + + RestoreSummary_RestoreInProgress = RestoreSummary.AddMember("RestoreInProgress", _RestoreInProgress) + + ReturnConsumedCapacity_INDEXES = ReturnConsumedCapacity.AddMember("INDEXES", smithyprelude.Unit) + + ReturnConsumedCapacity_TOTAL = ReturnConsumedCapacity.AddMember("TOTAL", smithyprelude.Unit) + + ReturnConsumedCapacity_NONE = ReturnConsumedCapacity.AddMember("NONE", smithyprelude.Unit) + + ReturnItemCollectionMetrics_SIZE = ReturnItemCollectionMetrics.AddMember("SIZE", smithyprelude.Unit) + + ReturnItemCollectionMetrics_NONE = ReturnItemCollectionMetrics.AddMember("NONE", smithyprelude.Unit) + + ReturnValue_NONE = ReturnValue.AddMember("NONE", smithyprelude.Unit) + + ReturnValue_ALL_OLD = ReturnValue.AddMember("ALL_OLD", smithyprelude.Unit) + + ReturnValue_UPDATED_OLD = ReturnValue.AddMember("UPDATED_OLD", smithyprelude.Unit) + + ReturnValue_ALL_NEW = ReturnValue.AddMember("ALL_NEW", smithyprelude.Unit) + + ReturnValue_UPDATED_NEW = ReturnValue.AddMember("UPDATED_NEW", smithyprelude.Unit) + + SearchResultItem_Item = SearchResultItem.AddMember("Item", _AttributeMap) + + SearchResultItem_Score = SearchResultItem.AddMember("Score", _ScoreNumber) + + _SearchResultList_member = _SearchResultList.AddMember("member", SearchResultItem) + + _SearchVectorList_member = _SearchVectorList.AddMember("member", AttributeValue) + + Select_ALL_ATTRIBUTES = Select.AddMember("ALL_ATTRIBUTES", smithyprelude.Unit) + + Select_ALL_PROJECTED_ATTRIBUTES = Select.AddMember("ALL_PROJECTED_ATTRIBUTES", smithyprelude.Unit) + + Select_SPECIFIC_ATTRIBUTES = Select.AddMember("SPECIFIC_ATTRIBUTES", smithyprelude.Unit) + + Select_COUNT = Select.AddMember("COUNT", smithyprelude.Unit) + + TableAlreadyExistsException_message = TableAlreadyExistsException.AddMember("message", _ErrorMessage) + + TableAutoScalingDescription_TableName = TableAutoScalingDescription.AddMember("TableName", _TableName) + + TableAutoScalingDescription_TableStatus = TableAutoScalingDescription.AddMember("TableStatus", TableStatus) + + TableAutoScalingDescription_Replicas = TableAutoScalingDescription.AddMember("Replicas", _ReplicaAutoScalingDescriptionList) + + VectorIndexDescription_IndexName = VectorIndexDescription.AddMember("IndexName", _IndexName) + + VectorIndexDescription_SearchSchema = VectorIndexDescription.AddMember("SearchSchema", _SearchSchema) + + VectorIndexDescription_Projection = VectorIndexDescription.AddMember("Projection", Projection) + + VectorIndexDescription_VectorAttribute = VectorIndexDescription.AddMember("VectorAttribute", VectorAttributeDefinition) + + VectorIndexDescription_Dimensions = VectorIndexDescription.AddMember("Dimensions", _PositiveLongObject) + + VectorIndexDescription_DistanceFunction = VectorIndexDescription.AddMember("DistanceFunction", VectorDistanceFunction) + + VectorIndexDescription_IndexStatus = VectorIndexDescription.AddMember("IndexStatus", IndexStatus) + + VectorIndexDescription_Backfilling = VectorIndexDescription.AddMember("Backfilling", _Backfilling) + + VectorIndexDescription_IndexSizeBytes = VectorIndexDescription.AddMember("IndexSizeBytes", _LongObject) + + VectorIndexDescription_ItemCount = VectorIndexDescription.AddMember("ItemCount", _LongObject) + + VectorIndexDescription_IndexArn = VectorIndexDescription.AddMember("IndexArn", _String) + + _VectorIndexDescriptionList_member = _VectorIndexDescriptionList.AddMember("member", VectorIndexDescription) + + TableDescription_AttributeDefinitions = TableDescription.AddMember("AttributeDefinitions", _AttributeDefinitions) + + TableDescription_TableName = TableDescription.AddMember("TableName", _TableName) + + TableDescription_KeySchema = TableDescription.AddMember("KeySchema", _KeySchema) + + TableDescription_TableStatus = TableDescription.AddMember("TableStatus", TableStatus) + + TableDescription_CreationDateTime = TableDescription.AddMember("CreationDateTime", _Date) + + TableDescription_ProvisionedThroughput = TableDescription.AddMember("ProvisionedThroughput", ProvisionedThroughputDescription) + + TableDescription_TableSizeBytes = TableDescription.AddMember("TableSizeBytes", _LongObject) + + TableDescription_ItemCount = TableDescription.AddMember("ItemCount", _LongObject) + + TableDescription_TableArn = TableDescription.AddMember("TableArn", _String) + + TableDescription_TableId = TableDescription.AddMember("TableId", _TableId) + + TableDescription_BillingModeSummary = TableDescription.AddMember("BillingModeSummary", BillingModeSummary) + + TableDescription_LocalSecondaryIndexes = TableDescription.AddMember("LocalSecondaryIndexes", _LocalSecondaryIndexDescriptionList) + + TableDescription_GlobalSecondaryIndexes = TableDescription.AddMember("GlobalSecondaryIndexes", _GlobalSecondaryIndexDescriptionList) + + TableDescription_StreamSpecification = TableDescription.AddMember("StreamSpecification", StreamSpecification) + + TableDescription_LatestStreamLabel = TableDescription.AddMember("LatestStreamLabel", _String) + + TableDescription_LatestStreamArn = TableDescription.AddMember("LatestStreamArn", _StreamArn) + + TableDescription_GlobalTableVersion = TableDescription.AddMember("GlobalTableVersion", _String) + + TableDescription_Replicas = TableDescription.AddMember("Replicas", _ReplicaDescriptionList) + + TableDescription_GlobalTableWitnesses = TableDescription.AddMember("GlobalTableWitnesses", _GlobalTableWitnessDescriptionList) + + TableDescription_GlobalTableSettingsReplicationMode = TableDescription.AddMember("GlobalTableSettingsReplicationMode", GlobalTableSettingsReplicationMode) + + TableDescription_RestoreSummary = TableDescription.AddMember("RestoreSummary", RestoreSummary) + + TableDescription_SSEDescription = TableDescription.AddMember("SSEDescription", SSEDescription) + + TableDescription_ArchivalSummary = TableDescription.AddMember("ArchivalSummary", ArchivalSummary) + + TableDescription_TableClassSummary = TableDescription.AddMember("TableClassSummary", TableClassSummary) + + TableDescription_DeletionProtectionEnabled = TableDescription.AddMember("DeletionProtectionEnabled", _DeletionProtectionEnabled) + + TableDescription_OnDemandThroughput = TableDescription.AddMember("OnDemandThroughput", OnDemandThroughput) + + TableDescription_WarmThroughput = TableDescription.AddMember("WarmThroughput", TableWarmThroughputDescription) + + TableDescription_MultiRegionConsistency = TableDescription.AddMember("MultiRegionConsistency", MultiRegionConsistency) + + TableDescription_VectorIndexes = TableDescription.AddMember("VectorIndexes", _VectorIndexDescriptionList) + + TableInUseException_message = TableInUseException.AddMember("message", _ErrorMessage) + + _TableNameList_member = _TableNameList.AddMember("member", _TableName) + + TableNotFoundException_message = TableNotFoundException.AddMember("message", _ErrorMessage) + + Tag_Key = Tag.AddMember("Key", _TagKeyString) + + Tag_Value = Tag.AddMember("Value", _TagValueString) + + _TagKeyList_member = _TagKeyList.AddMember("member", _TagKeyString) + + _TagList_member = _TagList.AddMember("member", Tag) + + ThrottlingException_message = ThrottlingException.AddMember("message", _AvailabilityErrorMessage) + + ThrottlingException_throttlingReasons = ThrottlingException.AddMember("throttlingReasons", _ThrottlingReasonList) + + TimeToLiveSpecification_Enabled = TimeToLiveSpecification.AddMember("Enabled", _TimeToLiveEnabled) + + TimeToLiveSpecification_AttributeName = TimeToLiveSpecification.AddMember("AttributeName", _TimeToLiveAttributeName) + + TransactGetItem_Get = TransactGetItem.AddMember("Get", Get) + + _TransactGetItemList_member = _TransactGetItemList.AddMember("member", TransactGetItem) + + TransactionCanceledException_Message = TransactionCanceledException.AddMember("Message", _ErrorMessage) + + TransactionCanceledException_CancellationReasons = TransactionCanceledException.AddMember("CancellationReasons", _CancellationReasonList) + + TransactionConflictException_message = TransactionConflictException.AddMember("message", _ErrorMessage) + + TransactionInProgressException_Message = TransactionInProgressException.AddMember("Message", _ErrorMessage) + + Update_Key = Update.AddMember("Key", _Key) + + Update_UpdateExpression = Update.AddMember("UpdateExpression", _UpdateExpression) + + Update_TableName = Update.AddMember("TableName", _TableArn) + + Update_ConditionExpression = Update.AddMember("ConditionExpression", _ConditionExpression) + + Update_ExpressionAttributeNames = Update.AddMember("ExpressionAttributeNames", _ExpressionAttributeNameMap) + + Update_ExpressionAttributeValues = Update.AddMember("ExpressionAttributeValues", _ExpressionAttributeValueMap) + + Update_ReturnValuesOnConditionCheckFailure = Update.AddMember("ReturnValuesOnConditionCheckFailure", ReturnValuesOnConditionCheckFailure) + + TransactWriteItem_ConditionCheck = TransactWriteItem.AddMember("ConditionCheck", ConditionCheck) + + TransactWriteItem_Put = TransactWriteItem.AddMember("Put", Put) + + TransactWriteItem_Delete = TransactWriteItem.AddMember("Delete", Delete) + + TransactWriteItem_Update = TransactWriteItem.AddMember("Update", Update) + + _TransactWriteItemList_member = _TransactWriteItemList.AddMember("member", TransactWriteItem) + + UpdateKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision = UpdateKinesisStreamingConfiguration.AddMember("ApproximateCreationDateTimePrecision", ApproximateCreationDateTimePrecision) + + VectorIndexUpdate_Create = VectorIndexUpdate.AddMember("Create", CreateVectorIndexAction) + + VectorIndexUpdate_Delete = VectorIndexUpdate.AddMember("Delete", DeleteVectorIndexAction) + + _VectorIndexUpdateList_member = _VectorIndexUpdateList.AddMember("member", VectorIndexUpdate) + + BatchExecuteStatementInput_Statements = BatchExecuteStatementInput.AddMember("Statements", _PartiQLBatchRequest) + + BatchExecuteStatementInput_ReturnConsumedCapacity = BatchExecuteStatementInput.AddMember("ReturnConsumedCapacity", ReturnConsumedCapacity) + + BatchExecuteStatementOutput_Responses = BatchExecuteStatementOutput.AddMember("Responses", _PartiQLBatchResponse) + + BatchExecuteStatementOutput_ConsumedCapacity = BatchExecuteStatementOutput.AddMember("ConsumedCapacity", _ConsumedCapacityMultiple) + + BatchGetItemInput_RequestItems = BatchGetItemInput.AddMember("RequestItems", _BatchGetRequestMap) + + BatchGetItemInput_ReturnConsumedCapacity = BatchGetItemInput.AddMember("ReturnConsumedCapacity", ReturnConsumedCapacity) + + BatchGetItemOutput_Responses = BatchGetItemOutput.AddMember("Responses", _BatchGetResponseMap) + + BatchGetItemOutput_UnprocessedKeys = BatchGetItemOutput.AddMember("UnprocessedKeys", _BatchGetRequestMap) + + BatchGetItemOutput_ConsumedCapacity = BatchGetItemOutput.AddMember("ConsumedCapacity", _ConsumedCapacityMultiple) + + BatchWriteItemInput_RequestItems = BatchWriteItemInput.AddMember("RequestItems", _BatchWriteItemRequestMap) + + BatchWriteItemInput_ReturnConsumedCapacity = BatchWriteItemInput.AddMember("ReturnConsumedCapacity", ReturnConsumedCapacity) + + BatchWriteItemInput_ReturnItemCollectionMetrics = BatchWriteItemInput.AddMember("ReturnItemCollectionMetrics", ReturnItemCollectionMetrics) + + BatchWriteItemOutput_UnprocessedItems = BatchWriteItemOutput.AddMember("UnprocessedItems", _BatchWriteItemRequestMap) + + BatchWriteItemOutput_ItemCollectionMetrics = BatchWriteItemOutput.AddMember("ItemCollectionMetrics", _ItemCollectionMetricsPerTable) + + BatchWriteItemOutput_ConsumedCapacity = BatchWriteItemOutput.AddMember("ConsumedCapacity", _ConsumedCapacityMultiple) + + CreateBackupInput_TableName = CreateBackupInput.AddMember("TableName", _TableArn, &smithytraits.ContextParam{}) + + CreateBackupInput_BackupName = CreateBackupInput.AddMember("BackupName", _BackupName) + + CreateBackupOutput_BackupDetails = CreateBackupOutput.AddMember("BackupDetails", BackupDetails) + + CreateGlobalTableInput_GlobalTableName = CreateGlobalTableInput.AddMember("GlobalTableName", _TableName, &smithytraits.ContextParam{}) + + CreateGlobalTableInput_ReplicationGroup = CreateGlobalTableInput.AddMember("ReplicationGroup", _ReplicaList) + + CreateGlobalTableOutput_GlobalTableDescription = CreateGlobalTableOutput.AddMember("GlobalTableDescription", GlobalTableDescription) + + CreateTableInput_AttributeDefinitions = CreateTableInput.AddMember("AttributeDefinitions", _AttributeDefinitions) + + CreateTableInput_TableName = CreateTableInput.AddMember("TableName", _TableArn, &smithytraits.ContextParam{}) + + CreateTableInput_KeySchema = CreateTableInput.AddMember("KeySchema", _KeySchema) + + CreateTableInput_LocalSecondaryIndexes = CreateTableInput.AddMember("LocalSecondaryIndexes", _LocalSecondaryIndexList) + + CreateTableInput_GlobalSecondaryIndexes = CreateTableInput.AddMember("GlobalSecondaryIndexes", _GlobalSecondaryIndexList) + + CreateTableInput_BillingMode = CreateTableInput.AddMember("BillingMode", BillingMode) + + CreateTableInput_ProvisionedThroughput = CreateTableInput.AddMember("ProvisionedThroughput", ProvisionedThroughput) + + CreateTableInput_StreamSpecification = CreateTableInput.AddMember("StreamSpecification", StreamSpecification) + + CreateTableInput_SSESpecification = CreateTableInput.AddMember("SSESpecification", SSESpecification) + + CreateTableInput_Tags = CreateTableInput.AddMember("Tags", _TagList) + + CreateTableInput_TableClass = CreateTableInput.AddMember("TableClass", TableClass) + + CreateTableInput_DeletionProtectionEnabled = CreateTableInput.AddMember("DeletionProtectionEnabled", _DeletionProtectionEnabled) + + CreateTableInput_WarmThroughput = CreateTableInput.AddMember("WarmThroughput", WarmThroughput) + + CreateTableInput_ResourcePolicy = CreateTableInput.AddMember("ResourcePolicy", _ResourcePolicy) + + CreateTableInput_OnDemandThroughput = CreateTableInput.AddMember("OnDemandThroughput", OnDemandThroughput) + + CreateTableInput_GlobalTableSourceArn = CreateTableInput.AddMember("GlobalTableSourceArn", _TableArn) + + CreateTableInput_GlobalTableSettingsReplicationMode = CreateTableInput.AddMember("GlobalTableSettingsReplicationMode", GlobalTableSettingsReplicationMode) + + CreateTableInput_VectorIndexes = CreateTableInput.AddMember("VectorIndexes", _VectorIndexList) + + CreateTableOutput_TableDescription = CreateTableOutput.AddMember("TableDescription", TableDescription) + + DeleteBackupInput_BackupArn = DeleteBackupInput.AddMember("BackupArn", _BackupArn, &smithytraits.ContextParam{}) + + DeleteBackupOutput_BackupDescription = DeleteBackupOutput.AddMember("BackupDescription", BackupDescription) + + DeleteItemInput_TableName = DeleteItemInput.AddMember("TableName", _TableArn, &smithytraits.ContextParam{}) + + DeleteItemInput_Key = DeleteItemInput.AddMember("Key", _Key) + + DeleteItemInput_Expected = DeleteItemInput.AddMember("Expected", _ExpectedAttributeMap) + + DeleteItemInput_ConditionalOperator = DeleteItemInput.AddMember("ConditionalOperator", ConditionalOperator) + + DeleteItemInput_ReturnValues = DeleteItemInput.AddMember("ReturnValues", ReturnValue) + + DeleteItemInput_ReturnConsumedCapacity = DeleteItemInput.AddMember("ReturnConsumedCapacity", ReturnConsumedCapacity) + + DeleteItemInput_ReturnItemCollectionMetrics = DeleteItemInput.AddMember("ReturnItemCollectionMetrics", ReturnItemCollectionMetrics) + + DeleteItemInput_ConditionExpression = DeleteItemInput.AddMember("ConditionExpression", _ConditionExpression) + + DeleteItemInput_ExpressionAttributeNames = DeleteItemInput.AddMember("ExpressionAttributeNames", _ExpressionAttributeNameMap) + + DeleteItemInput_ExpressionAttributeValues = DeleteItemInput.AddMember("ExpressionAttributeValues", _ExpressionAttributeValueMap) + + DeleteItemInput_ReturnValuesOnConditionCheckFailure = DeleteItemInput.AddMember("ReturnValuesOnConditionCheckFailure", ReturnValuesOnConditionCheckFailure) + + DeleteItemOutput_Attributes = DeleteItemOutput.AddMember("Attributes", _AttributeMap) + + DeleteItemOutput_ConsumedCapacity = DeleteItemOutput.AddMember("ConsumedCapacity", ConsumedCapacity) + + DeleteItemOutput_ItemCollectionMetrics = DeleteItemOutput.AddMember("ItemCollectionMetrics", ItemCollectionMetrics) + + DeleteResourcePolicyInput_ResourceArn = DeleteResourcePolicyInput.AddMember("ResourceArn", _ResourceArnString, &smithytraits.ContextParam{}) + + DeleteResourcePolicyInput_ExpectedRevisionId = DeleteResourcePolicyInput.AddMember("ExpectedRevisionId", _PolicyRevisionId) + + DeleteResourcePolicyOutput_RevisionId = DeleteResourcePolicyOutput.AddMember("RevisionId", _PolicyRevisionId) + + DeleteTableInput_TableName = DeleteTableInput.AddMember("TableName", _TableArn, &smithytraits.ContextParam{}) + + DeleteTableOutput_TableDescription = DeleteTableOutput.AddMember("TableDescription", TableDescription) + + DescribeBackupInput_BackupArn = DescribeBackupInput.AddMember("BackupArn", _BackupArn, &smithytraits.ContextParam{}) + + DescribeBackupOutput_BackupDescription = DescribeBackupOutput.AddMember("BackupDescription", BackupDescription) + + DescribeContinuousBackupsInput_TableName = DescribeContinuousBackupsInput.AddMember("TableName", _TableArn, &smithytraits.ContextParam{}) + + DescribeContinuousBackupsOutput_ContinuousBackupsDescription = DescribeContinuousBackupsOutput.AddMember("ContinuousBackupsDescription", ContinuousBackupsDescription) + + DescribeContributorInsightsInput_TableName = DescribeContributorInsightsInput.AddMember("TableName", _TableArn, &smithytraits.ContextParam{}) + + DescribeContributorInsightsInput_IndexName = DescribeContributorInsightsInput.AddMember("IndexName", _IndexName) + + DescribeContributorInsightsOutput_TableName = DescribeContributorInsightsOutput.AddMember("TableName", _TableName) + + DescribeContributorInsightsOutput_IndexName = DescribeContributorInsightsOutput.AddMember("IndexName", _IndexName) + + DescribeContributorInsightsOutput_ContributorInsightsRuleList = DescribeContributorInsightsOutput.AddMember("ContributorInsightsRuleList", _ContributorInsightsRuleList) + + DescribeContributorInsightsOutput_ContributorInsightsStatus = DescribeContributorInsightsOutput.AddMember("ContributorInsightsStatus", ContributorInsightsStatus) + + DescribeContributorInsightsOutput_LastUpdateDateTime = DescribeContributorInsightsOutput.AddMember("LastUpdateDateTime", _LastUpdateDateTime) + + DescribeContributorInsightsOutput_FailureException = DescribeContributorInsightsOutput.AddMember("FailureException", FailureException) + + DescribeContributorInsightsOutput_ContributorInsightsMode = DescribeContributorInsightsOutput.AddMember("ContributorInsightsMode", ContributorInsightsMode) + + DescribeEndpointsResponse_Endpoints = DescribeEndpointsResponse.AddMember("Endpoints", _Endpoints) + + DescribeExportInput_ExportArn = DescribeExportInput.AddMember("ExportArn", _ExportArn, &smithytraits.ContextParam{}) + + DescribeExportOutput_ExportDescription = DescribeExportOutput.AddMember("ExportDescription", ExportDescription) + + DescribeGlobalTableInput_GlobalTableName = DescribeGlobalTableInput.AddMember("GlobalTableName", _TableName, &smithytraits.ContextParam{}) + + DescribeGlobalTableOutput_GlobalTableDescription = DescribeGlobalTableOutput.AddMember("GlobalTableDescription", GlobalTableDescription) + + DescribeGlobalTableSettingsInput_GlobalTableName = DescribeGlobalTableSettingsInput.AddMember("GlobalTableName", _TableName, &smithytraits.ContextParam{}) + + DescribeGlobalTableSettingsOutput_GlobalTableName = DescribeGlobalTableSettingsOutput.AddMember("GlobalTableName", _TableName) + + DescribeGlobalTableSettingsOutput_ReplicaSettings = DescribeGlobalTableSettingsOutput.AddMember("ReplicaSettings", _ReplicaSettingsDescriptionList) + + DescribeImportInput_ImportArn = DescribeImportInput.AddMember("ImportArn", _ImportArn, &smithytraits.ContextParam{}) + + DescribeImportOutput_ImportTableDescription = DescribeImportOutput.AddMember("ImportTableDescription", ImportTableDescription) + + DescribeKinesisStreamingDestinationInput_TableName = DescribeKinesisStreamingDestinationInput.AddMember("TableName", _TableArn, &smithytraits.ContextParam{}) + + DescribeKinesisStreamingDestinationOutput_TableName = DescribeKinesisStreamingDestinationOutput.AddMember("TableName", _TableName) + + DescribeKinesisStreamingDestinationOutput_KinesisDataStreamDestinations = DescribeKinesisStreamingDestinationOutput.AddMember("KinesisDataStreamDestinations", _KinesisDataStreamDestinations) + + DescribeLimitsOutput_AccountMaxReadCapacityUnits = DescribeLimitsOutput.AddMember("AccountMaxReadCapacityUnits", _PositiveLongObject) + + DescribeLimitsOutput_AccountMaxWriteCapacityUnits = DescribeLimitsOutput.AddMember("AccountMaxWriteCapacityUnits", _PositiveLongObject) + + DescribeLimitsOutput_TableMaxReadCapacityUnits = DescribeLimitsOutput.AddMember("TableMaxReadCapacityUnits", _PositiveLongObject) + + DescribeLimitsOutput_TableMaxWriteCapacityUnits = DescribeLimitsOutput.AddMember("TableMaxWriteCapacityUnits", _PositiveLongObject) + + DescribeTableInput_TableName = DescribeTableInput.AddMember("TableName", _TableArn, &smithytraits.ContextParam{}) + + DescribeTableOutput_Table = DescribeTableOutput.AddMember("Table", TableDescription) + + DescribeTableReplicaAutoScalingInput_TableName = DescribeTableReplicaAutoScalingInput.AddMember("TableName", _TableArn, &smithytraits.ContextParam{}) + + DescribeTableReplicaAutoScalingOutput_TableAutoScalingDescription = DescribeTableReplicaAutoScalingOutput.AddMember("TableAutoScalingDescription", TableAutoScalingDescription) + + DescribeTimeToLiveInput_TableName = DescribeTimeToLiveInput.AddMember("TableName", _TableArn, &smithytraits.ContextParam{}) + + DescribeTimeToLiveOutput_TimeToLiveDescription = DescribeTimeToLiveOutput.AddMember("TimeToLiveDescription", TimeToLiveDescription) + + KinesisStreamingDestinationInput_TableName = KinesisStreamingDestinationInput.AddMember("TableName", _TableArn, &smithytraits.ContextParam{}) + + KinesisStreamingDestinationInput_StreamArn = KinesisStreamingDestinationInput.AddMember("StreamArn", _StreamArn) + + KinesisStreamingDestinationInput_EnableKinesisStreamingConfiguration = KinesisStreamingDestinationInput.AddMember("EnableKinesisStreamingConfiguration", EnableKinesisStreamingConfiguration) + + KinesisStreamingDestinationOutput_TableName = KinesisStreamingDestinationOutput.AddMember("TableName", _TableName) + + KinesisStreamingDestinationOutput_StreamArn = KinesisStreamingDestinationOutput.AddMember("StreamArn", _StreamArn) + + KinesisStreamingDestinationOutput_DestinationStatus = KinesisStreamingDestinationOutput.AddMember("DestinationStatus", DestinationStatus) + + KinesisStreamingDestinationOutput_EnableKinesisStreamingConfiguration = KinesisStreamingDestinationOutput.AddMember("EnableKinesisStreamingConfiguration", EnableKinesisStreamingConfiguration) + + ExecuteStatementInput_Statement = ExecuteStatementInput.AddMember("Statement", _PartiQLStatement) + + ExecuteStatementInput_Parameters = ExecuteStatementInput.AddMember("Parameters", _PreparedStatementParameters) + + ExecuteStatementInput_ConsistentRead = ExecuteStatementInput.AddMember("ConsistentRead", _ConsistentRead) + + ExecuteStatementInput_NextToken = ExecuteStatementInput.AddMember("NextToken", _PartiQLNextToken) + + ExecuteStatementInput_ReturnConsumedCapacity = ExecuteStatementInput.AddMember("ReturnConsumedCapacity", ReturnConsumedCapacity) + + ExecuteStatementInput_Limit = ExecuteStatementInput.AddMember("Limit", _PositiveIntegerObject) + + ExecuteStatementInput_ReturnValuesOnConditionCheckFailure = ExecuteStatementInput.AddMember("ReturnValuesOnConditionCheckFailure", ReturnValuesOnConditionCheckFailure) + + ExecuteStatementOutput_Items = ExecuteStatementOutput.AddMember("Items", _ItemList) + + ExecuteStatementOutput_NextToken = ExecuteStatementOutput.AddMember("NextToken", _PartiQLNextToken) + + ExecuteStatementOutput_ConsumedCapacity = ExecuteStatementOutput.AddMember("ConsumedCapacity", ConsumedCapacity) + + ExecuteStatementOutput_LastEvaluatedKey = ExecuteStatementOutput.AddMember("LastEvaluatedKey", _Key) + + ExecuteTransactionInput_TransactStatements = ExecuteTransactionInput.AddMember("TransactStatements", _ParameterizedStatements) + + ExecuteTransactionInput_ClientRequestToken = ExecuteTransactionInput.AddMember("ClientRequestToken", _ClientRequestToken) + + ExecuteTransactionInput_ReturnConsumedCapacity = ExecuteTransactionInput.AddMember("ReturnConsumedCapacity", ReturnConsumedCapacity) + + ExecuteTransactionOutput_Responses = ExecuteTransactionOutput.AddMember("Responses", _ItemResponseList) + + ExecuteTransactionOutput_ConsumedCapacity = ExecuteTransactionOutput.AddMember("ConsumedCapacity", _ConsumedCapacityMultiple) + + ExportTableToPointInTimeInput_TableArn = ExportTableToPointInTimeInput.AddMember("TableArn", _TableArn, &smithytraits.ContextParam{}) + + ExportTableToPointInTimeInput_ExportTime = ExportTableToPointInTimeInput.AddMember("ExportTime", _ExportTime) + + ExportTableToPointInTimeInput_ClientToken = ExportTableToPointInTimeInput.AddMember("ClientToken", _ClientToken) + + ExportTableToPointInTimeInput_S3Bucket = ExportTableToPointInTimeInput.AddMember("S3Bucket", _S3Bucket) + + ExportTableToPointInTimeInput_S3BucketOwner = ExportTableToPointInTimeInput.AddMember("S3BucketOwner", _S3BucketOwner) + + ExportTableToPointInTimeInput_S3Prefix = ExportTableToPointInTimeInput.AddMember("S3Prefix", _S3Prefix) + + ExportTableToPointInTimeInput_S3SseAlgorithm = ExportTableToPointInTimeInput.AddMember("S3SseAlgorithm", S3SseAlgorithm) + + ExportTableToPointInTimeInput_S3SseKmsKeyId = ExportTableToPointInTimeInput.AddMember("S3SseKmsKeyId", _S3SseKmsKeyId) + + ExportTableToPointInTimeInput_ExportFormat = ExportTableToPointInTimeInput.AddMember("ExportFormat", ExportFormat) + + ExportTableToPointInTimeInput_ExportType = ExportTableToPointInTimeInput.AddMember("ExportType", ExportType) + + ExportTableToPointInTimeInput_IncrementalExportSpecification = ExportTableToPointInTimeInput.AddMember("IncrementalExportSpecification", IncrementalExportSpecification) + + ExportTableToPointInTimeInput_FilterSpecification = ExportTableToPointInTimeInput.AddMember("FilterSpecification", FilterSpecification) + + ExportTableToPointInTimeOutput_ExportDescription = ExportTableToPointInTimeOutput.AddMember("ExportDescription", ExportDescription) + + GetItemInput_TableName = GetItemInput.AddMember("TableName", _TableArn, &smithytraits.ContextParam{}) + + GetItemInput_Key = GetItemInput.AddMember("Key", _Key) + + GetItemInput_AttributesToGet = GetItemInput.AddMember("AttributesToGet", _AttributeNameList) + + GetItemInput_ConsistentRead = GetItemInput.AddMember("ConsistentRead", _ConsistentRead) + + GetItemInput_ReturnConsumedCapacity = GetItemInput.AddMember("ReturnConsumedCapacity", ReturnConsumedCapacity) + + GetItemInput_ProjectionExpression = GetItemInput.AddMember("ProjectionExpression", _ProjectionExpression) + + GetItemInput_ExpressionAttributeNames = GetItemInput.AddMember("ExpressionAttributeNames", _ExpressionAttributeNameMap) + + GetItemOutput_Item = GetItemOutput.AddMember("Item", _AttributeMap) + + GetItemOutput_ConsumedCapacity = GetItemOutput.AddMember("ConsumedCapacity", ConsumedCapacity) + + GetResourcePolicyInput_ResourceArn = GetResourcePolicyInput.AddMember("ResourceArn", _ResourceArnString, &smithytraits.ContextParam{}) + + GetResourcePolicyOutput_Policy = GetResourcePolicyOutput.AddMember("Policy", _ResourcePolicy) + + GetResourcePolicyOutput_RevisionId = GetResourcePolicyOutput.AddMember("RevisionId", _PolicyRevisionId) + + ImportTableInput_ClientToken = ImportTableInput.AddMember("ClientToken", _ClientToken) + + ImportTableInput_S3BucketSource = ImportTableInput.AddMember("S3BucketSource", S3BucketSource) + + ImportTableInput_InputFormat = ImportTableInput.AddMember("InputFormat", InputFormat) + + ImportTableInput_InputFormatOptions = ImportTableInput.AddMember("InputFormatOptions", InputFormatOptions) + + ImportTableInput_InputCompressionType = ImportTableInput.AddMember("InputCompressionType", InputCompressionType) + + ImportTableInput_TableCreationParameters = ImportTableInput.AddMember("TableCreationParameters", TableCreationParameters) + + ImportTableOutput_ImportTableDescription = ImportTableOutput.AddMember("ImportTableDescription", ImportTableDescription) + + ListBackupsInput_TableName = ListBackupsInput.AddMember("TableName", _TableArn, &smithytraits.ContextParam{}) + + ListBackupsInput_Limit = ListBackupsInput.AddMember("Limit", _BackupsInputLimit) + + ListBackupsInput_TimeRangeLowerBound = ListBackupsInput.AddMember("TimeRangeLowerBound", _TimeRangeLowerBound) + + ListBackupsInput_TimeRangeUpperBound = ListBackupsInput.AddMember("TimeRangeUpperBound", _TimeRangeUpperBound) + + ListBackupsInput_ExclusiveStartBackupArn = ListBackupsInput.AddMember("ExclusiveStartBackupArn", _BackupArn) + + ListBackupsInput_BackupType = ListBackupsInput.AddMember("BackupType", BackupTypeFilter) + + ListBackupsOutput_BackupSummaries = ListBackupsOutput.AddMember("BackupSummaries", _BackupSummaries) + + ListBackupsOutput_LastEvaluatedBackupArn = ListBackupsOutput.AddMember("LastEvaluatedBackupArn", _BackupArn) + + ListContributorInsightsInput_TableName = ListContributorInsightsInput.AddMember("TableName", _TableArn, &smithytraits.ContextParam{}) + + ListContributorInsightsInput_NextToken = ListContributorInsightsInput.AddMember("NextToken", _NextTokenString) + + ListContributorInsightsInput_MaxResults = ListContributorInsightsInput.AddMember("MaxResults", _ListContributorInsightsLimit) + + ListContributorInsightsOutput_ContributorInsightsSummaries = ListContributorInsightsOutput.AddMember("ContributorInsightsSummaries", _ContributorInsightsSummaries) + + ListContributorInsightsOutput_NextToken = ListContributorInsightsOutput.AddMember("NextToken", _NextTokenString) + + ListExportsInput_TableArn = ListExportsInput.AddMember("TableArn", _TableArn, &smithytraits.ContextParam{}) + + ListExportsInput_MaxResults = ListExportsInput.AddMember("MaxResults", _ListExportsMaxLimit) + + ListExportsInput_NextToken = ListExportsInput.AddMember("NextToken", _ExportNextToken) + + ListExportsOutput_ExportSummaries = ListExportsOutput.AddMember("ExportSummaries", _ExportSummaries) + + ListExportsOutput_NextToken = ListExportsOutput.AddMember("NextToken", _ExportNextToken) + + ListGlobalTablesInput_ExclusiveStartGlobalTableName = ListGlobalTablesInput.AddMember("ExclusiveStartGlobalTableName", _TableName) + + ListGlobalTablesInput_Limit = ListGlobalTablesInput.AddMember("Limit", _PositiveIntegerObject) + + ListGlobalTablesInput_RegionName = ListGlobalTablesInput.AddMember("RegionName", _RegionName) + + ListGlobalTablesOutput_GlobalTables = ListGlobalTablesOutput.AddMember("GlobalTables", _GlobalTableList) + + ListGlobalTablesOutput_LastEvaluatedGlobalTableName = ListGlobalTablesOutput.AddMember("LastEvaluatedGlobalTableName", _TableName) + + ListImportsInput_TableArn = ListImportsInput.AddMember("TableArn", _TableArn, &smithytraits.ContextParam{}) + + ListImportsInput_PageSize = ListImportsInput.AddMember("PageSize", _ListImportsMaxLimit) + + ListImportsInput_NextToken = ListImportsInput.AddMember("NextToken", _ImportNextToken) + + ListImportsOutput_ImportSummaryList = ListImportsOutput.AddMember("ImportSummaryList", _ImportSummaryList) + + ListImportsOutput_NextToken = ListImportsOutput.AddMember("NextToken", _ImportNextToken) + + ListTablesInput_ExclusiveStartTableName = ListTablesInput.AddMember("ExclusiveStartTableName", _TableName) + + ListTablesInput_Limit = ListTablesInput.AddMember("Limit", _ListTablesInputLimit) + + ListTablesOutput_TableNames = ListTablesOutput.AddMember("TableNames", _TableNameList) + + ListTablesOutput_LastEvaluatedTableName = ListTablesOutput.AddMember("LastEvaluatedTableName", _TableName) + + ListTagsOfResourceInput_ResourceArn = ListTagsOfResourceInput.AddMember("ResourceArn", _ResourceArnString, &smithytraits.ContextParam{}) + + ListTagsOfResourceInput_NextToken = ListTagsOfResourceInput.AddMember("NextToken", _NextTokenString) + + ListTagsOfResourceOutput_Tags = ListTagsOfResourceOutput.AddMember("Tags", _TagList) + + ListTagsOfResourceOutput_NextToken = ListTagsOfResourceOutput.AddMember("NextToken", _NextTokenString) + + PutItemInput_TableName = PutItemInput.AddMember("TableName", _TableArn, &smithytraits.ContextParam{}) + + PutItemInput_Item = PutItemInput.AddMember("Item", _PutItemInputAttributeMap) + + PutItemInput_Expected = PutItemInput.AddMember("Expected", _ExpectedAttributeMap) + + PutItemInput_ReturnValues = PutItemInput.AddMember("ReturnValues", ReturnValue) + + PutItemInput_ReturnConsumedCapacity = PutItemInput.AddMember("ReturnConsumedCapacity", ReturnConsumedCapacity) + + PutItemInput_ReturnItemCollectionMetrics = PutItemInput.AddMember("ReturnItemCollectionMetrics", ReturnItemCollectionMetrics) + + PutItemInput_ConditionalOperator = PutItemInput.AddMember("ConditionalOperator", ConditionalOperator) + + PutItemInput_ConditionExpression = PutItemInput.AddMember("ConditionExpression", _ConditionExpression) + + PutItemInput_ExpressionAttributeNames = PutItemInput.AddMember("ExpressionAttributeNames", _ExpressionAttributeNameMap) + + PutItemInput_ExpressionAttributeValues = PutItemInput.AddMember("ExpressionAttributeValues", _ExpressionAttributeValueMap) + + PutItemInput_ReturnValuesOnConditionCheckFailure = PutItemInput.AddMember("ReturnValuesOnConditionCheckFailure", ReturnValuesOnConditionCheckFailure) + + PutItemOutput_Attributes = PutItemOutput.AddMember("Attributes", _AttributeMap) + + PutItemOutput_ConsumedCapacity = PutItemOutput.AddMember("ConsumedCapacity", ConsumedCapacity) + + PutItemOutput_ItemCollectionMetrics = PutItemOutput.AddMember("ItemCollectionMetrics", ItemCollectionMetrics) + + PutResourcePolicyInput_ResourceArn = PutResourcePolicyInput.AddMember("ResourceArn", _ResourceArnString, &smithytraits.ContextParam{}) + + PutResourcePolicyInput_Policy = PutResourcePolicyInput.AddMember("Policy", _ResourcePolicy) + + PutResourcePolicyInput_ExpectedRevisionId = PutResourcePolicyInput.AddMember("ExpectedRevisionId", _PolicyRevisionId) + + PutResourcePolicyInput_ConfirmRemoveSelfResourceAccess = PutResourcePolicyInput.AddMember("ConfirmRemoveSelfResourceAccess", _ConfirmRemoveSelfResourceAccess, &smithytraits.HTTPHeader{Name: "x-amz-confirm-remove-self-resource-access"}) + + PutResourcePolicyOutput_RevisionId = PutResourcePolicyOutput.AddMember("RevisionId", _PolicyRevisionId) + + QueryInput_TableName = QueryInput.AddMember("TableName", _TableArn, &smithytraits.ContextParam{}) + + QueryInput_IndexName = QueryInput.AddMember("IndexName", _IndexName) + + QueryInput_Select = QueryInput.AddMember("Select", Select) + + QueryInput_AttributesToGet = QueryInput.AddMember("AttributesToGet", _AttributeNameList) + + QueryInput_Limit = QueryInput.AddMember("Limit", _PositiveIntegerObject) + + QueryInput_ConsistentRead = QueryInput.AddMember("ConsistentRead", _ConsistentRead) + + QueryInput_KeyConditions = QueryInput.AddMember("KeyConditions", _KeyConditions) + + QueryInput_QueryFilter = QueryInput.AddMember("QueryFilter", _FilterConditionMap) + + QueryInput_ConditionalOperator = QueryInput.AddMember("ConditionalOperator", ConditionalOperator) + + QueryInput_ScanIndexForward = QueryInput.AddMember("ScanIndexForward", _BooleanObject) + + QueryInput_ExclusiveStartKey = QueryInput.AddMember("ExclusiveStartKey", _Key) + + QueryInput_ReturnConsumedCapacity = QueryInput.AddMember("ReturnConsumedCapacity", ReturnConsumedCapacity) + + QueryInput_ProjectionExpression = QueryInput.AddMember("ProjectionExpression", _ProjectionExpression) + + QueryInput_FilterExpression = QueryInput.AddMember("FilterExpression", _ConditionExpression) + + QueryInput_KeyConditionExpression = QueryInput.AddMember("KeyConditionExpression", _KeyExpression) + + QueryInput_ExpressionAttributeNames = QueryInput.AddMember("ExpressionAttributeNames", _ExpressionAttributeNameMap) + + QueryInput_ExpressionAttributeValues = QueryInput.AddMember("ExpressionAttributeValues", _ExpressionAttributeValueMap) + + QueryOutput_Items = QueryOutput.AddMember("Items", _ItemList) + + QueryOutput_Count = QueryOutput.AddMember("Count", _Integer) + + QueryOutput_ScannedCount = QueryOutput.AddMember("ScannedCount", _Integer) + + QueryOutput_LastEvaluatedKey = QueryOutput.AddMember("LastEvaluatedKey", _Key) + + QueryOutput_ConsumedCapacity = QueryOutput.AddMember("ConsumedCapacity", ConsumedCapacity) + + RestoreTableFromBackupInput_TargetTableName = RestoreTableFromBackupInput.AddMember("TargetTableName", _TableName, &smithytraits.ContextParam{}) + + RestoreTableFromBackupInput_BackupArn = RestoreTableFromBackupInput.AddMember("BackupArn", _BackupArn) + + RestoreTableFromBackupInput_BillingModeOverride = RestoreTableFromBackupInput.AddMember("BillingModeOverride", BillingMode) + + RestoreTableFromBackupInput_GlobalSecondaryIndexOverride = RestoreTableFromBackupInput.AddMember("GlobalSecondaryIndexOverride", _GlobalSecondaryIndexList) + + RestoreTableFromBackupInput_LocalSecondaryIndexOverride = RestoreTableFromBackupInput.AddMember("LocalSecondaryIndexOverride", _LocalSecondaryIndexList) + + RestoreTableFromBackupInput_ProvisionedThroughputOverride = RestoreTableFromBackupInput.AddMember("ProvisionedThroughputOverride", ProvisionedThroughput) + + RestoreTableFromBackupInput_OnDemandThroughputOverride = RestoreTableFromBackupInput.AddMember("OnDemandThroughputOverride", OnDemandThroughput) + + RestoreTableFromBackupInput_SSESpecificationOverride = RestoreTableFromBackupInput.AddMember("SSESpecificationOverride", SSESpecification) + + RestoreTableFromBackupInput_VectorIndexOverride = RestoreTableFromBackupInput.AddMember("VectorIndexOverride", _VectorIndexList) + + RestoreTableFromBackupOutput_TableDescription = RestoreTableFromBackupOutput.AddMember("TableDescription", TableDescription) + + RestoreTableToPointInTimeInput_SourceTableArn = RestoreTableToPointInTimeInput.AddMember("SourceTableArn", _TableArn) + + RestoreTableToPointInTimeInput_SourceTableName = RestoreTableToPointInTimeInput.AddMember("SourceTableName", _TableName) + + RestoreTableToPointInTimeInput_TargetTableName = RestoreTableToPointInTimeInput.AddMember("TargetTableName", _TableName, &smithytraits.ContextParam{}) + + RestoreTableToPointInTimeInput_UseLatestRestorableTime = RestoreTableToPointInTimeInput.AddMember("UseLatestRestorableTime", _BooleanObject) + + RestoreTableToPointInTimeInput_RestoreDateTime = RestoreTableToPointInTimeInput.AddMember("RestoreDateTime", _Date) + + RestoreTableToPointInTimeInput_BillingModeOverride = RestoreTableToPointInTimeInput.AddMember("BillingModeOverride", BillingMode) + + RestoreTableToPointInTimeInput_GlobalSecondaryIndexOverride = RestoreTableToPointInTimeInput.AddMember("GlobalSecondaryIndexOverride", _GlobalSecondaryIndexList) + + RestoreTableToPointInTimeInput_LocalSecondaryIndexOverride = RestoreTableToPointInTimeInput.AddMember("LocalSecondaryIndexOverride", _LocalSecondaryIndexList) + + RestoreTableToPointInTimeInput_ProvisionedThroughputOverride = RestoreTableToPointInTimeInput.AddMember("ProvisionedThroughputOverride", ProvisionedThroughput) + + RestoreTableToPointInTimeInput_OnDemandThroughputOverride = RestoreTableToPointInTimeInput.AddMember("OnDemandThroughputOverride", OnDemandThroughput) + + RestoreTableToPointInTimeInput_SSESpecificationOverride = RestoreTableToPointInTimeInput.AddMember("SSESpecificationOverride", SSESpecification) + + RestoreTableToPointInTimeInput_VectorIndexOverride = RestoreTableToPointInTimeInput.AddMember("VectorIndexOverride", _VectorIndexList) + + RestoreTableToPointInTimeOutput_TableDescription = RestoreTableToPointInTimeOutput.AddMember("TableDescription", TableDescription) + + ScanInput_TableName = ScanInput.AddMember("TableName", _TableArn, &smithytraits.ContextParam{}) + + ScanInput_IndexName = ScanInput.AddMember("IndexName", _IndexName) + + ScanInput_AttributesToGet = ScanInput.AddMember("AttributesToGet", _AttributeNameList) + + ScanInput_Limit = ScanInput.AddMember("Limit", _PositiveIntegerObject) + + ScanInput_Select = ScanInput.AddMember("Select", Select) + + ScanInput_ScanFilter = ScanInput.AddMember("ScanFilter", _FilterConditionMap) + + ScanInput_ConditionalOperator = ScanInput.AddMember("ConditionalOperator", ConditionalOperator) + + ScanInput_ExclusiveStartKey = ScanInput.AddMember("ExclusiveStartKey", _Key) + + ScanInput_ReturnConsumedCapacity = ScanInput.AddMember("ReturnConsumedCapacity", ReturnConsumedCapacity) + + ScanInput_TotalSegments = ScanInput.AddMember("TotalSegments", _ScanTotalSegments) + + ScanInput_Segment = ScanInput.AddMember("Segment", _ScanSegment) + + ScanInput_ProjectionExpression = ScanInput.AddMember("ProjectionExpression", _ProjectionExpression) + + ScanInput_FilterExpression = ScanInput.AddMember("FilterExpression", _ConditionExpression) + + ScanInput_ExpressionAttributeNames = ScanInput.AddMember("ExpressionAttributeNames", _ExpressionAttributeNameMap) + + ScanInput_ExpressionAttributeValues = ScanInput.AddMember("ExpressionAttributeValues", _ExpressionAttributeValueMap) + + ScanInput_ConsistentRead = ScanInput.AddMember("ConsistentRead", _ConsistentRead) + + ScanOutput_Items = ScanOutput.AddMember("Items", _ItemList) + + ScanOutput_Count = ScanOutput.AddMember("Count", _Integer) + + ScanOutput_ScannedCount = ScanOutput.AddMember("ScannedCount", _Integer) + + ScanOutput_LastEvaluatedKey = ScanOutput.AddMember("LastEvaluatedKey", _Key) + + ScanOutput_ConsumedCapacity = ScanOutput.AddMember("ConsumedCapacity", ConsumedCapacity) + + SearchVectorsInput_TableName = SearchVectorsInput.AddMember("TableName", _TableArn, &smithytraits.ContextParam{}) + + SearchVectorsInput_IndexName = SearchVectorsInput.AddMember("IndexName", _IndexName) + + SearchVectorsInput_ReturnConsumedCapacity = SearchVectorsInput.AddMember("ReturnConsumedCapacity", ReturnConsumedCapacity) + + SearchVectorsInput_ExpressionAttributeNames = SearchVectorsInput.AddMember("ExpressionAttributeNames", _ExpressionAttributeNameMap) + + SearchVectorsInput_ExpressionAttributeValues = SearchVectorsInput.AddMember("ExpressionAttributeValues", _ExpressionAttributeValueMap) + + SearchVectorsInput_ProjectionExpression = SearchVectorsInput.AddMember("ProjectionExpression", _ProjectionExpression) + + SearchVectorsInput_SearchVector = SearchVectorsInput.AddMember("SearchVector", _SearchVectorList) + + SearchVectorsInput_SearchConditionExpression = SearchVectorsInput.AddMember("SearchConditionExpression", _String) + + SearchVectorsInput_TopK = SearchVectorsInput.AddMember("TopK", _TopKInteger) + + SearchVectorsOutput_ConsumedCapacity = SearchVectorsOutput.AddMember("ConsumedCapacity", VectorCapacity) + + SearchVectorsOutput_SearchResults = SearchVectorsOutput.AddMember("SearchResults", _SearchResultList) + + TagResourceInput_ResourceArn = TagResourceInput.AddMember("ResourceArn", _ResourceArnString, &smithytraits.ContextParam{}) + + TagResourceInput_Tags = TagResourceInput.AddMember("Tags", _TagList) + + TransactGetItemsInput_TransactItems = TransactGetItemsInput.AddMember("TransactItems", _TransactGetItemList) + + TransactGetItemsInput_ReturnConsumedCapacity = TransactGetItemsInput.AddMember("ReturnConsumedCapacity", ReturnConsumedCapacity) + + TransactGetItemsOutput_ConsumedCapacity = TransactGetItemsOutput.AddMember("ConsumedCapacity", _ConsumedCapacityMultiple) + + TransactGetItemsOutput_Responses = TransactGetItemsOutput.AddMember("Responses", _ItemResponseList) + + TransactWriteItemsInput_TransactItems = TransactWriteItemsInput.AddMember("TransactItems", _TransactWriteItemList) + + TransactWriteItemsInput_ReturnConsumedCapacity = TransactWriteItemsInput.AddMember("ReturnConsumedCapacity", ReturnConsumedCapacity) + + TransactWriteItemsInput_ReturnItemCollectionMetrics = TransactWriteItemsInput.AddMember("ReturnItemCollectionMetrics", ReturnItemCollectionMetrics) + + TransactWriteItemsInput_ClientRequestToken = TransactWriteItemsInput.AddMember("ClientRequestToken", _ClientRequestToken) + + TransactWriteItemsOutput_ConsumedCapacity = TransactWriteItemsOutput.AddMember("ConsumedCapacity", _ConsumedCapacityMultiple) + + TransactWriteItemsOutput_ItemCollectionMetrics = TransactWriteItemsOutput.AddMember("ItemCollectionMetrics", _ItemCollectionMetricsPerTable) + + UntagResourceInput_ResourceArn = UntagResourceInput.AddMember("ResourceArn", _ResourceArnString, &smithytraits.ContextParam{}) + + UntagResourceInput_TagKeys = UntagResourceInput.AddMember("TagKeys", _TagKeyList) + + UpdateContinuousBackupsInput_TableName = UpdateContinuousBackupsInput.AddMember("TableName", _TableArn, &smithytraits.ContextParam{}) + + UpdateContinuousBackupsInput_PointInTimeRecoverySpecification = UpdateContinuousBackupsInput.AddMember("PointInTimeRecoverySpecification", PointInTimeRecoverySpecification) + + UpdateContinuousBackupsOutput_ContinuousBackupsDescription = UpdateContinuousBackupsOutput.AddMember("ContinuousBackupsDescription", ContinuousBackupsDescription) + + UpdateContributorInsightsInput_TableName = UpdateContributorInsightsInput.AddMember("TableName", _TableArn, &smithytraits.ContextParam{}) + + UpdateContributorInsightsInput_IndexName = UpdateContributorInsightsInput.AddMember("IndexName", _IndexName) + + UpdateContributorInsightsInput_ContributorInsightsAction = UpdateContributorInsightsInput.AddMember("ContributorInsightsAction", ContributorInsightsAction) + + UpdateContributorInsightsInput_ContributorInsightsMode = UpdateContributorInsightsInput.AddMember("ContributorInsightsMode", ContributorInsightsMode) + + UpdateContributorInsightsOutput_TableName = UpdateContributorInsightsOutput.AddMember("TableName", _TableName) + + UpdateContributorInsightsOutput_IndexName = UpdateContributorInsightsOutput.AddMember("IndexName", _IndexName) + + UpdateContributorInsightsOutput_ContributorInsightsStatus = UpdateContributorInsightsOutput.AddMember("ContributorInsightsStatus", ContributorInsightsStatus) + + UpdateContributorInsightsOutput_ContributorInsightsMode = UpdateContributorInsightsOutput.AddMember("ContributorInsightsMode", ContributorInsightsMode) + + UpdateGlobalTableInput_GlobalTableName = UpdateGlobalTableInput.AddMember("GlobalTableName", _TableName, &smithytraits.ContextParam{}) + + UpdateGlobalTableInput_ReplicaUpdates = UpdateGlobalTableInput.AddMember("ReplicaUpdates", _ReplicaUpdateList) + + UpdateGlobalTableOutput_GlobalTableDescription = UpdateGlobalTableOutput.AddMember("GlobalTableDescription", GlobalTableDescription) + + UpdateGlobalTableSettingsInput_GlobalTableName = UpdateGlobalTableSettingsInput.AddMember("GlobalTableName", _TableName, &smithytraits.ContextParam{}) + + UpdateGlobalTableSettingsInput_GlobalTableBillingMode = UpdateGlobalTableSettingsInput.AddMember("GlobalTableBillingMode", BillingMode) + + UpdateGlobalTableSettingsInput_GlobalTableProvisionedWriteCapacityUnits = UpdateGlobalTableSettingsInput.AddMember("GlobalTableProvisionedWriteCapacityUnits", _PositiveLongObject) + + UpdateGlobalTableSettingsInput_GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate = UpdateGlobalTableSettingsInput.AddMember("GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate", AutoScalingSettingsUpdate) + + UpdateGlobalTableSettingsInput_GlobalTableGlobalSecondaryIndexSettingsUpdate = UpdateGlobalTableSettingsInput.AddMember("GlobalTableGlobalSecondaryIndexSettingsUpdate", _GlobalTableGlobalSecondaryIndexSettingsUpdateList) + + UpdateGlobalTableSettingsInput_ReplicaSettingsUpdate = UpdateGlobalTableSettingsInput.AddMember("ReplicaSettingsUpdate", _ReplicaSettingsUpdateList) + + UpdateGlobalTableSettingsOutput_GlobalTableName = UpdateGlobalTableSettingsOutput.AddMember("GlobalTableName", _TableName) + + UpdateGlobalTableSettingsOutput_ReplicaSettings = UpdateGlobalTableSettingsOutput.AddMember("ReplicaSettings", _ReplicaSettingsDescriptionList) + + UpdateItemInput_TableName = UpdateItemInput.AddMember("TableName", _TableArn, &smithytraits.ContextParam{}) + + UpdateItemInput_Key = UpdateItemInput.AddMember("Key", _Key) + + UpdateItemInput_AttributeUpdates = UpdateItemInput.AddMember("AttributeUpdates", _AttributeUpdates) + + UpdateItemInput_Expected = UpdateItemInput.AddMember("Expected", _ExpectedAttributeMap) + + UpdateItemInput_ConditionalOperator = UpdateItemInput.AddMember("ConditionalOperator", ConditionalOperator) + + UpdateItemInput_ReturnValues = UpdateItemInput.AddMember("ReturnValues", ReturnValue) + + UpdateItemInput_ReturnConsumedCapacity = UpdateItemInput.AddMember("ReturnConsumedCapacity", ReturnConsumedCapacity) + + UpdateItemInput_ReturnItemCollectionMetrics = UpdateItemInput.AddMember("ReturnItemCollectionMetrics", ReturnItemCollectionMetrics) + + UpdateItemInput_UpdateExpression = UpdateItemInput.AddMember("UpdateExpression", _UpdateExpression) + + UpdateItemInput_ConditionExpression = UpdateItemInput.AddMember("ConditionExpression", _ConditionExpression) + + UpdateItemInput_ExpressionAttributeNames = UpdateItemInput.AddMember("ExpressionAttributeNames", _ExpressionAttributeNameMap) + + UpdateItemInput_ExpressionAttributeValues = UpdateItemInput.AddMember("ExpressionAttributeValues", _ExpressionAttributeValueMap) + + UpdateItemInput_ReturnValuesOnConditionCheckFailure = UpdateItemInput.AddMember("ReturnValuesOnConditionCheckFailure", ReturnValuesOnConditionCheckFailure) + + UpdateItemOutput_Attributes = UpdateItemOutput.AddMember("Attributes", _AttributeMap) + + UpdateItemOutput_ConsumedCapacity = UpdateItemOutput.AddMember("ConsumedCapacity", ConsumedCapacity) + + UpdateItemOutput_ItemCollectionMetrics = UpdateItemOutput.AddMember("ItemCollectionMetrics", ItemCollectionMetrics) + + UpdateKinesisStreamingDestinationInput_TableName = UpdateKinesisStreamingDestinationInput.AddMember("TableName", _TableArn, &smithytraits.ContextParam{}) + + UpdateKinesisStreamingDestinationInput_StreamArn = UpdateKinesisStreamingDestinationInput.AddMember("StreamArn", _StreamArn) + + UpdateKinesisStreamingDestinationInput_UpdateKinesisStreamingConfiguration = UpdateKinesisStreamingDestinationInput.AddMember("UpdateKinesisStreamingConfiguration", UpdateKinesisStreamingConfiguration) + + UpdateKinesisStreamingDestinationOutput_TableName = UpdateKinesisStreamingDestinationOutput.AddMember("TableName", _TableName) + + UpdateKinesisStreamingDestinationOutput_StreamArn = UpdateKinesisStreamingDestinationOutput.AddMember("StreamArn", _StreamArn) + + UpdateKinesisStreamingDestinationOutput_DestinationStatus = UpdateKinesisStreamingDestinationOutput.AddMember("DestinationStatus", DestinationStatus) + + UpdateKinesisStreamingDestinationOutput_UpdateKinesisStreamingConfiguration = UpdateKinesisStreamingDestinationOutput.AddMember("UpdateKinesisStreamingConfiguration", UpdateKinesisStreamingConfiguration) + + UpdateTableInput_AttributeDefinitions = UpdateTableInput.AddMember("AttributeDefinitions", _AttributeDefinitions) + + UpdateTableInput_TableName = UpdateTableInput.AddMember("TableName", _TableArn, &smithytraits.ContextParam{}) + + UpdateTableInput_BillingMode = UpdateTableInput.AddMember("BillingMode", BillingMode) + + UpdateTableInput_ProvisionedThroughput = UpdateTableInput.AddMember("ProvisionedThroughput", ProvisionedThroughput) + + UpdateTableInput_GlobalSecondaryIndexUpdates = UpdateTableInput.AddMember("GlobalSecondaryIndexUpdates", _GlobalSecondaryIndexUpdateList) + + UpdateTableInput_StreamSpecification = UpdateTableInput.AddMember("StreamSpecification", StreamSpecification) + + UpdateTableInput_SSESpecification = UpdateTableInput.AddMember("SSESpecification", SSESpecification) + + UpdateTableInput_ReplicaUpdates = UpdateTableInput.AddMember("ReplicaUpdates", _ReplicationGroupUpdateList) + + UpdateTableInput_TableClass = UpdateTableInput.AddMember("TableClass", TableClass) + + UpdateTableInput_DeletionProtectionEnabled = UpdateTableInput.AddMember("DeletionProtectionEnabled", _DeletionProtectionEnabled) + + UpdateTableInput_MultiRegionConsistency = UpdateTableInput.AddMember("MultiRegionConsistency", MultiRegionConsistency) + + UpdateTableInput_GlobalTableWitnessUpdates = UpdateTableInput.AddMember("GlobalTableWitnessUpdates", _GlobalTableWitnessGroupUpdateList) + + UpdateTableInput_OnDemandThroughput = UpdateTableInput.AddMember("OnDemandThroughput", OnDemandThroughput) + + UpdateTableInput_WarmThroughput = UpdateTableInput.AddMember("WarmThroughput", WarmThroughput) + + UpdateTableInput_GlobalTableSettingsReplicationMode = UpdateTableInput.AddMember("GlobalTableSettingsReplicationMode", GlobalTableSettingsReplicationMode) + + UpdateTableInput_VectorIndexUpdates = UpdateTableInput.AddMember("VectorIndexUpdates", _VectorIndexUpdateList) + + UpdateTableOutput_TableDescription = UpdateTableOutput.AddMember("TableDescription", TableDescription) + + UpdateTableReplicaAutoScalingInput_GlobalSecondaryIndexUpdates = UpdateTableReplicaAutoScalingInput.AddMember("GlobalSecondaryIndexUpdates", _GlobalSecondaryIndexAutoScalingUpdateList) + + UpdateTableReplicaAutoScalingInput_TableName = UpdateTableReplicaAutoScalingInput.AddMember("TableName", _TableArn, &smithytraits.ContextParam{}) + + UpdateTableReplicaAutoScalingInput_ProvisionedWriteCapacityAutoScalingUpdate = UpdateTableReplicaAutoScalingInput.AddMember("ProvisionedWriteCapacityAutoScalingUpdate", AutoScalingSettingsUpdate) + + UpdateTableReplicaAutoScalingInput_ReplicaUpdates = UpdateTableReplicaAutoScalingInput.AddMember("ReplicaUpdates", _ReplicaAutoScalingUpdateList) + + UpdateTableReplicaAutoScalingOutput_TableAutoScalingDescription = UpdateTableReplicaAutoScalingOutput.AddMember("TableAutoScalingDescription", TableAutoScalingDescription) + + UpdateTimeToLiveInput_TableName = UpdateTimeToLiveInput.AddMember("TableName", _TableArn, &smithytraits.ContextParam{}) + + UpdateTimeToLiveInput_TimeToLiveSpecification = UpdateTimeToLiveInput.AddMember("TimeToLiveSpecification", TimeToLiveSpecification) + + UpdateTimeToLiveOutput_TimeToLiveSpecification = UpdateTimeToLiveOutput.AddMember("TimeToLiveSpecification", TimeToLiveSpecification) + +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/type_registry.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/type_registry.go new file mode 100644 index 00000000000..501f575b1db --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/type_registry.go @@ -0,0 +1,155 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package dynamodb + +import ( + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" + smithy "github.com/aws/smithy-go" +) + +// TypeRegistry is the type registry for this service. +var TypeRegistry = &smithy.TypeRegistry{ + Entries: map[string]*smithy.TypeRegistryEntry{ + "com.amazonaws.dynamodb#BackupInUseException": { + Schema: schemas.BackupInUseException, + New: func() any { return &types.BackupInUseException{} }, + }, + "com.amazonaws.dynamodb#BackupNotFoundException": { + Schema: schemas.BackupNotFoundException, + New: func() any { return &types.BackupNotFoundException{} }, + }, + "com.amazonaws.dynamodb#ConditionalCheckFailedException": { + Schema: schemas.ConditionalCheckFailedException, + New: func() any { return &types.ConditionalCheckFailedException{} }, + }, + "com.amazonaws.dynamodb#ContinuousBackupsUnavailableException": { + Schema: schemas.ContinuousBackupsUnavailableException, + New: func() any { return &types.ContinuousBackupsUnavailableException{} }, + }, + "com.amazonaws.dynamodb#DuplicateItemException": { + Schema: schemas.DuplicateItemException, + New: func() any { return &types.DuplicateItemException{} }, + }, + "com.amazonaws.dynamodb#ExportConflictException": { + Schema: schemas.ExportConflictException, + New: func() any { return &types.ExportConflictException{} }, + }, + "com.amazonaws.dynamodb#ExportNotFoundException": { + Schema: schemas.ExportNotFoundException, + New: func() any { return &types.ExportNotFoundException{} }, + }, + "com.amazonaws.dynamodb#GlobalTableAlreadyExistsException": { + Schema: schemas.GlobalTableAlreadyExistsException, + New: func() any { return &types.GlobalTableAlreadyExistsException{} }, + }, + "com.amazonaws.dynamodb#GlobalTableNotFoundException": { + Schema: schemas.GlobalTableNotFoundException, + New: func() any { return &types.GlobalTableNotFoundException{} }, + }, + "com.amazonaws.dynamodb#IdempotentParameterMismatchException": { + Schema: schemas.IdempotentParameterMismatchException, + New: func() any { return &types.IdempotentParameterMismatchException{} }, + }, + "com.amazonaws.dynamodb#ImportConflictException": { + Schema: schemas.ImportConflictException, + New: func() any { return &types.ImportConflictException{} }, + }, + "com.amazonaws.dynamodb#ImportNotFoundException": { + Schema: schemas.ImportNotFoundException, + New: func() any { return &types.ImportNotFoundException{} }, + }, + "com.amazonaws.dynamodb#IndexNotFoundException": { + Schema: schemas.IndexNotFoundException, + New: func() any { return &types.IndexNotFoundException{} }, + }, + "com.amazonaws.dynamodb#InternalServerError": { + Schema: schemas.InternalServerError, + New: func() any { return &types.InternalServerError{} }, + }, + "com.amazonaws.dynamodb#InvalidEndpointException": { + Schema: schemas.InvalidEndpointException, + New: func() any { return &types.InvalidEndpointException{} }, + }, + "com.amazonaws.dynamodb#InvalidExportTimeException": { + Schema: schemas.InvalidExportTimeException, + New: func() any { return &types.InvalidExportTimeException{} }, + }, + "com.amazonaws.dynamodb#InvalidRestoreTimeException": { + Schema: schemas.InvalidRestoreTimeException, + New: func() any { return &types.InvalidRestoreTimeException{} }, + }, + "com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException": { + Schema: schemas.ItemCollectionSizeLimitExceededException, + New: func() any { return &types.ItemCollectionSizeLimitExceededException{} }, + }, + "com.amazonaws.dynamodb#LimitExceededException": { + Schema: schemas.LimitExceededException, + New: func() any { return &types.LimitExceededException{} }, + }, + "com.amazonaws.dynamodb#PointInTimeRecoveryUnavailableException": { + Schema: schemas.PointInTimeRecoveryUnavailableException, + New: func() any { return &types.PointInTimeRecoveryUnavailableException{} }, + }, + "com.amazonaws.dynamodb#PolicyNotFoundException": { + Schema: schemas.PolicyNotFoundException, + New: func() any { return &types.PolicyNotFoundException{} }, + }, + "com.amazonaws.dynamodb#ProvisionedThroughputExceededException": { + Schema: schemas.ProvisionedThroughputExceededException, + New: func() any { return &types.ProvisionedThroughputExceededException{} }, + }, + "com.amazonaws.dynamodb#ReplicaAlreadyExistsException": { + Schema: schemas.ReplicaAlreadyExistsException, + New: func() any { return &types.ReplicaAlreadyExistsException{} }, + }, + "com.amazonaws.dynamodb#ReplicaNotFoundException": { + Schema: schemas.ReplicaNotFoundException, + New: func() any { return &types.ReplicaNotFoundException{} }, + }, + "com.amazonaws.dynamodb#ReplicatedWriteConflictException": { + Schema: schemas.ReplicatedWriteConflictException, + New: func() any { return &types.ReplicatedWriteConflictException{} }, + }, + "com.amazonaws.dynamodb#RequestLimitExceeded": { + Schema: schemas.RequestLimitExceeded, + New: func() any { return &types.RequestLimitExceeded{} }, + }, + "com.amazonaws.dynamodb#ResourceInUseException": { + Schema: schemas.ResourceInUseException, + New: func() any { return &types.ResourceInUseException{} }, + }, + "com.amazonaws.dynamodb#ResourceNotFoundException": { + Schema: schemas.ResourceNotFoundException, + New: func() any { return &types.ResourceNotFoundException{} }, + }, + "com.amazonaws.dynamodb#TableAlreadyExistsException": { + Schema: schemas.TableAlreadyExistsException, + New: func() any { return &types.TableAlreadyExistsException{} }, + }, + "com.amazonaws.dynamodb#TableInUseException": { + Schema: schemas.TableInUseException, + New: func() any { return &types.TableInUseException{} }, + }, + "com.amazonaws.dynamodb#TableNotFoundException": { + Schema: schemas.TableNotFoundException, + New: func() any { return &types.TableNotFoundException{} }, + }, + "com.amazonaws.dynamodb#ThrottlingException": { + Schema: schemas.ThrottlingException, + New: func() any { return &types.ThrottlingException{} }, + }, + "com.amazonaws.dynamodb#TransactionCanceledException": { + Schema: schemas.TransactionCanceledException, + New: func() any { return &types.TransactionCanceledException{} }, + }, + "com.amazonaws.dynamodb#TransactionConflictException": { + Schema: schemas.TransactionConflictException, + New: func() any { return &types.TransactionConflictException{} }, + }, + "com.amazonaws.dynamodb#TransactionInProgressException": { + Schema: schemas.TransactionInProgressException, + New: func() any { return &types.TransactionInProgressException{} }, + }, + }, +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/types/common_serde.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/types/common_serde.go new file mode 100644 index 00000000000..4547d3ec2e2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/types/common_serde.go @@ -0,0 +1,2517 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" + smithy "github.com/aws/smithy-go" +) + +func serializeAttributeValue(s smithy.ShapeSerializer, schema *smithy.Schema, v AttributeValue) { + switch vv := v.(type) { + case *AttributeValueMemberB: + s.WriteUnion(schema, schemas.AttributeValue_B) + s.WriteBlob(schemas.AttributeValue_B, vv.Value) + s.CloseUnion() + case *AttributeValueMemberBOOL: + s.WriteUnion(schema, schemas.AttributeValue_BOOL) + s.WriteBool(schemas.AttributeValue_BOOL, vv.Value) + s.CloseUnion() + case *AttributeValueMemberBS: + s.WriteUnion(schema, schemas.AttributeValue_BS) + serializeBinarySetAttributeValue(s, schemas.AttributeValue_BS, vv.Value) + s.CloseUnion() + case *AttributeValueMemberL: + s.WriteUnion(schema, schemas.AttributeValue_L) + serializeListAttributeValue(s, schemas.AttributeValue_L, vv.Value) + s.CloseUnion() + case *AttributeValueMemberM: + s.WriteUnion(schema, schemas.AttributeValue_M) + serializeMapAttributeValue(s, schemas.AttributeValue_M, vv.Value) + s.CloseUnion() + case *AttributeValueMemberN: + s.WriteUnion(schema, schemas.AttributeValue_N) + s.WriteString(schemas.AttributeValue_N, vv.Value) + s.CloseUnion() + case *AttributeValueMemberNS: + s.WriteUnion(schema, schemas.AttributeValue_NS) + serializeNumberSetAttributeValue(s, schemas.AttributeValue_NS, vv.Value) + s.CloseUnion() + case *AttributeValueMemberNULL: + s.WriteUnion(schema, schemas.AttributeValue_NULL) + s.WriteBool(schemas.AttributeValue_NULL, vv.Value) + s.CloseUnion() + case *AttributeValueMemberS: + s.WriteUnion(schema, schemas.AttributeValue_S) + s.WriteString(schemas.AttributeValue_S, vv.Value) + s.CloseUnion() + case *AttributeValueMemberSS: + s.WriteUnion(schema, schemas.AttributeValue_SS) + serializeStringSetAttributeValue(s, schemas.AttributeValue_SS, vv.Value) + s.CloseUnion() + } +} + +func deserializeAttributeValue(d smithy.ShapeDeserializer, s *smithy.Schema, v *AttributeValue) error { + return smithy.ReadUnion(d, s, func(ms *smithy.Schema) error { + switch ms { + case schemas.AttributeValue_B: + vv := &AttributeValueMemberB{} + *v = vv + return vv.Deserialize(d) + case schemas.AttributeValue_BOOL: + vv := &AttributeValueMemberBOOL{} + *v = vv + return vv.Deserialize(d) + case schemas.AttributeValue_BS: + vv := &AttributeValueMemberBS{} + *v = vv + return vv.Deserialize(d) + case schemas.AttributeValue_L: + vv := &AttributeValueMemberL{} + *v = vv + return vv.Deserialize(d) + case schemas.AttributeValue_M: + vv := &AttributeValueMemberM{} + *v = vv + return vv.Deserialize(d) + case schemas.AttributeValue_N: + vv := &AttributeValueMemberN{} + *v = vv + return vv.Deserialize(d) + case schemas.AttributeValue_NS: + vv := &AttributeValueMemberNS{} + *v = vv + return vv.Deserialize(d) + case schemas.AttributeValue_NULL: + vv := &AttributeValueMemberNULL{} + *v = vv + return vv.Deserialize(d) + case schemas.AttributeValue_S: + vv := &AttributeValueMemberS{} + *v = vv + return vv.Deserialize(d) + case schemas.AttributeValue_SS: + vv := &AttributeValueMemberSS{} + *v = vv + return vv.Deserialize(d) + } + return nil + }) +} + +func serializeAttributeDefinitions(s smithy.ShapeSerializer, schema *smithy.Schema, v []AttributeDefinition) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeAttributeNameList(s smithy.ShapeSerializer, schema *smithy.Schema, v []string) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteString(schema.ListMember(), string(vv)) + } + s.CloseList() +} + +func serializeAttributeValueList(s smithy.ShapeSerializer, schema *smithy.Schema, v []AttributeValue) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + serializeAttributeValue(s, schema.ListMember(), vv) + } + s.CloseList() +} + +func serializeAutoScalingPolicyDescriptionList(s smithy.ShapeSerializer, schema *smithy.Schema, v []AutoScalingPolicyDescription) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeBackupSummaries(s smithy.ShapeSerializer, schema *smithy.Schema, v []BackupSummary) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeBinarySetAttributeValue(s smithy.ShapeSerializer, schema *smithy.Schema, v [][]byte) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteBlob(schema.ListMember(), vv) + } + s.CloseList() +} + +func serializeCancellationReasonList(s smithy.ShapeSerializer, schema *smithy.Schema, v []CancellationReason) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeConsumedCapacityMultiple(s smithy.ShapeSerializer, schema *smithy.Schema, v []ConsumedCapacity) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeContributorInsightsRuleList(s smithy.ShapeSerializer, schema *smithy.Schema, v []string) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteString(schema.ListMember(), string(vv)) + } + s.CloseList() +} + +func serializeContributorInsightsSummaries(s smithy.ShapeSerializer, schema *smithy.Schema, v []ContributorInsightsSummary) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeCsvHeaderList(s smithy.ShapeSerializer, schema *smithy.Schema, v []string) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteString(schema.ListMember(), string(vv)) + } + s.CloseList() +} + +func serializeEndpoints(s smithy.ShapeSerializer, schema *smithy.Schema, v []Endpoint) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeExportSummaries(s smithy.ShapeSerializer, schema *smithy.Schema, v []ExportSummary) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeGlobalSecondaryIndexAutoScalingUpdateList(s smithy.ShapeSerializer, schema *smithy.Schema, v []GlobalSecondaryIndexAutoScalingUpdate) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeGlobalSecondaryIndexDescriptionList(s smithy.ShapeSerializer, schema *smithy.Schema, v []GlobalSecondaryIndexDescription) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeGlobalSecondaryIndexes(s smithy.ShapeSerializer, schema *smithy.Schema, v []GlobalSecondaryIndexInfo) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeGlobalSecondaryIndexList(s smithy.ShapeSerializer, schema *smithy.Schema, v []GlobalSecondaryIndex) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeGlobalSecondaryIndexUpdateList(s smithy.ShapeSerializer, schema *smithy.Schema, v []GlobalSecondaryIndexUpdate) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeGlobalTableGlobalSecondaryIndexSettingsUpdateList(s smithy.ShapeSerializer, schema *smithy.Schema, v []GlobalTableGlobalSecondaryIndexSettingsUpdate) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeGlobalTableList(s smithy.ShapeSerializer, schema *smithy.Schema, v []GlobalTable) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeGlobalTableWitnessDescriptionList(s smithy.ShapeSerializer, schema *smithy.Schema, v []GlobalTableWitnessDescription) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeGlobalTableWitnessGroupUpdateList(s smithy.ShapeSerializer, schema *smithy.Schema, v []GlobalTableWitnessGroupUpdate) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeImportSummaryList(s smithy.ShapeSerializer, schema *smithy.Schema, v []ImportSummary) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeItemCollectionMetricsMultiple(s smithy.ShapeSerializer, schema *smithy.Schema, v []ItemCollectionMetrics) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeItemCollectionSizeEstimateRange(s smithy.ShapeSerializer, schema *smithy.Schema, v []float64) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteFloat64(schema.ListMember(), vv) + } + s.CloseList() +} + +func serializeItemList(s smithy.ShapeSerializer, schema *smithy.Schema, v []map[string]AttributeValue) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + serializeAttributeMap(s, schema.ListMember(), vv) + } + s.CloseList() +} + +func serializeItemResponseList(s smithy.ShapeSerializer, schema *smithy.Schema, v []ItemResponse) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeKeyList(s smithy.ShapeSerializer, schema *smithy.Schema, v []map[string]AttributeValue) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + serializeKey(s, schema.ListMember(), vv) + } + s.CloseList() +} + +func serializeKeySchema(s smithy.ShapeSerializer, schema *smithy.Schema, v []KeySchemaElement) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeKinesisDataStreamDestinations(s smithy.ShapeSerializer, schema *smithy.Schema, v []KinesisDataStreamDestination) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeListAttributeValue(s smithy.ShapeSerializer, schema *smithy.Schema, v []AttributeValue) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + serializeAttributeValue(s, schema.ListMember(), vv) + } + s.CloseList() +} + +func serializeLocalSecondaryIndexDescriptionList(s smithy.ShapeSerializer, schema *smithy.Schema, v []LocalSecondaryIndexDescription) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeLocalSecondaryIndexes(s smithy.ShapeSerializer, schema *smithy.Schema, v []LocalSecondaryIndexInfo) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeLocalSecondaryIndexList(s smithy.ShapeSerializer, schema *smithy.Schema, v []LocalSecondaryIndex) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeNonKeyAttributeNameList(s smithy.ShapeSerializer, schema *smithy.Schema, v []string) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteString(schema.ListMember(), string(vv)) + } + s.CloseList() +} + +func serializeNumberSetAttributeValue(s smithy.ShapeSerializer, schema *smithy.Schema, v []string) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteString(schema.ListMember(), string(vv)) + } + s.CloseList() +} + +func serializeParameterizedStatements(s smithy.ShapeSerializer, schema *smithy.Schema, v []ParameterizedStatement) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializePartiQLBatchRequest(s smithy.ShapeSerializer, schema *smithy.Schema, v []BatchStatementRequest) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializePartiQLBatchResponse(s smithy.ShapeSerializer, schema *smithy.Schema, v []BatchStatementResponse) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializePreparedStatementParameters(s smithy.ShapeSerializer, schema *smithy.Schema, v []AttributeValue) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + serializeAttributeValue(s, schema.ListMember(), vv) + } + s.CloseList() +} + +func serializeReplicaAutoScalingDescriptionList(s smithy.ShapeSerializer, schema *smithy.Schema, v []ReplicaAutoScalingDescription) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeReplicaAutoScalingUpdateList(s smithy.ShapeSerializer, schema *smithy.Schema, v []ReplicaAutoScalingUpdate) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeReplicaDescriptionList(s smithy.ShapeSerializer, schema *smithy.Schema, v []ReplicaDescription) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeReplicaGlobalSecondaryIndexAutoScalingDescriptionList(s smithy.ShapeSerializer, schema *smithy.Schema, v []ReplicaGlobalSecondaryIndexAutoScalingDescription) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeReplicaGlobalSecondaryIndexAutoScalingUpdateList(s smithy.ShapeSerializer, schema *smithy.Schema, v []ReplicaGlobalSecondaryIndexAutoScalingUpdate) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeReplicaGlobalSecondaryIndexDescriptionList(s smithy.ShapeSerializer, schema *smithy.Schema, v []ReplicaGlobalSecondaryIndexDescription) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeReplicaGlobalSecondaryIndexList(s smithy.ShapeSerializer, schema *smithy.Schema, v []ReplicaGlobalSecondaryIndex) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeReplicaGlobalSecondaryIndexSettingsDescriptionList(s smithy.ShapeSerializer, schema *smithy.Schema, v []ReplicaGlobalSecondaryIndexSettingsDescription) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeReplicaGlobalSecondaryIndexSettingsUpdateList(s smithy.ShapeSerializer, schema *smithy.Schema, v []ReplicaGlobalSecondaryIndexSettingsUpdate) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeReplicaList(s smithy.ShapeSerializer, schema *smithy.Schema, v []Replica) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeReplicaSettingsDescriptionList(s smithy.ShapeSerializer, schema *smithy.Schema, v []ReplicaSettingsDescription) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeReplicaSettingsUpdateList(s smithy.ShapeSerializer, schema *smithy.Schema, v []ReplicaSettingsUpdate) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeReplicationGroupUpdateList(s smithy.ShapeSerializer, schema *smithy.Schema, v []ReplicationGroupUpdate) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeReplicaUpdateList(s smithy.ShapeSerializer, schema *smithy.Schema, v []ReplicaUpdate) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeSearchResultList(s smithy.ShapeSerializer, schema *smithy.Schema, v []SearchResultItem) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeSearchSchema(s smithy.ShapeSerializer, schema *smithy.Schema, v []SearchSchemaElement) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeSearchVectorList(s smithy.ShapeSerializer, schema *smithy.Schema, v []AttributeValue) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + serializeAttributeValue(s, schema.ListMember(), vv) + } + s.CloseList() +} + +func serializeStringSetAttributeValue(s smithy.ShapeSerializer, schema *smithy.Schema, v []string) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteString(schema.ListMember(), string(vv)) + } + s.CloseList() +} + +func serializeTableNameList(s smithy.ShapeSerializer, schema *smithy.Schema, v []string) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteString(schema.ListMember(), string(vv)) + } + s.CloseList() +} + +func serializeTagKeyList(s smithy.ShapeSerializer, schema *smithy.Schema, v []string) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteString(schema.ListMember(), string(vv)) + } + s.CloseList() +} + +func serializeTagList(s smithy.ShapeSerializer, schema *smithy.Schema, v []Tag) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeThrottlingReasonList(s smithy.ShapeSerializer, schema *smithy.Schema, v []ThrottlingReason) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeTransactGetItemList(s smithy.ShapeSerializer, schema *smithy.Schema, v []TransactGetItem) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeTransactWriteItemList(s smithy.ShapeSerializer, schema *smithy.Schema, v []TransactWriteItem) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeVectorIndexDescriptionList(s smithy.ShapeSerializer, schema *smithy.Schema, v []VectorIndexDescription) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeVectorIndexes(s smithy.ShapeSerializer, schema *smithy.Schema, v []VectorIndexInfo) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeVectorIndexList(s smithy.ShapeSerializer, schema *smithy.Schema, v []VectorIndex) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeVectorIndexUpdateList(s smithy.ShapeSerializer, schema *smithy.Schema, v []VectorIndexUpdate) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeWriteRequests(s smithy.ShapeSerializer, schema *smithy.Schema, v []WriteRequest) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func deserializeAttributeDefinitions(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]AttributeDefinition) error { + *v = make([]AttributeDefinition, 0) + var vv AttributeDefinition + return smithy.ReadList(d, s, func() error { + vv = AttributeDefinition{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeAttributeNameList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]string) error { + *v = make([]string, 0) + var vv string + return smithy.ReadList(d, s, func() error { + + if err := d.ReadString(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeAttributeValueList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]AttributeValue) error { + *v = make([]AttributeValue, 0) + var vv AttributeValue + return smithy.ReadList(d, s, func() error { + + if err := deserializeAttributeValue(d, s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeAutoScalingPolicyDescriptionList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]AutoScalingPolicyDescription) error { + *v = make([]AutoScalingPolicyDescription, 0) + var vv AutoScalingPolicyDescription + return smithy.ReadList(d, s, func() error { + vv = AutoScalingPolicyDescription{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeBackupSummaries(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]BackupSummary) error { + *v = make([]BackupSummary, 0) + var vv BackupSummary + return smithy.ReadList(d, s, func() error { + vv = BackupSummary{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeBinarySetAttributeValue(d smithy.ShapeDeserializer, s *smithy.Schema, v *[][]byte) error { + *v = make([][]byte, 0) + var vv []byte + return smithy.ReadList(d, s, func() error { + + if err := d.ReadBlob(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeCancellationReasonList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]CancellationReason) error { + *v = make([]CancellationReason, 0) + var vv CancellationReason + return smithy.ReadList(d, s, func() error { + vv = CancellationReason{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeConsumedCapacityMultiple(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]ConsumedCapacity) error { + *v = make([]ConsumedCapacity, 0) + var vv ConsumedCapacity + return smithy.ReadList(d, s, func() error { + vv = ConsumedCapacity{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeContributorInsightsRuleList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]string) error { + *v = make([]string, 0) + var vv string + return smithy.ReadList(d, s, func() error { + + if err := d.ReadString(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeContributorInsightsSummaries(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]ContributorInsightsSummary) error { + *v = make([]ContributorInsightsSummary, 0) + var vv ContributorInsightsSummary + return smithy.ReadList(d, s, func() error { + vv = ContributorInsightsSummary{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeCsvHeaderList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]string) error { + *v = make([]string, 0) + var vv string + return smithy.ReadList(d, s, func() error { + + if err := d.ReadString(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeEndpoints(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]Endpoint) error { + *v = make([]Endpoint, 0) + var vv Endpoint + return smithy.ReadList(d, s, func() error { + vv = Endpoint{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeExportSummaries(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]ExportSummary) error { + *v = make([]ExportSummary, 0) + var vv ExportSummary + return smithy.ReadList(d, s, func() error { + vv = ExportSummary{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeGlobalSecondaryIndexAutoScalingUpdateList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]GlobalSecondaryIndexAutoScalingUpdate) error { + *v = make([]GlobalSecondaryIndexAutoScalingUpdate, 0) + var vv GlobalSecondaryIndexAutoScalingUpdate + return smithy.ReadList(d, s, func() error { + vv = GlobalSecondaryIndexAutoScalingUpdate{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeGlobalSecondaryIndexDescriptionList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]GlobalSecondaryIndexDescription) error { + *v = make([]GlobalSecondaryIndexDescription, 0) + var vv GlobalSecondaryIndexDescription + return smithy.ReadList(d, s, func() error { + vv = GlobalSecondaryIndexDescription{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeGlobalSecondaryIndexes(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]GlobalSecondaryIndexInfo) error { + *v = make([]GlobalSecondaryIndexInfo, 0) + var vv GlobalSecondaryIndexInfo + return smithy.ReadList(d, s, func() error { + vv = GlobalSecondaryIndexInfo{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeGlobalSecondaryIndexList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]GlobalSecondaryIndex) error { + *v = make([]GlobalSecondaryIndex, 0) + var vv GlobalSecondaryIndex + return smithy.ReadList(d, s, func() error { + vv = GlobalSecondaryIndex{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeGlobalSecondaryIndexUpdateList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]GlobalSecondaryIndexUpdate) error { + *v = make([]GlobalSecondaryIndexUpdate, 0) + var vv GlobalSecondaryIndexUpdate + return smithy.ReadList(d, s, func() error { + vv = GlobalSecondaryIndexUpdate{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeGlobalTableGlobalSecondaryIndexSettingsUpdateList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]GlobalTableGlobalSecondaryIndexSettingsUpdate) error { + *v = make([]GlobalTableGlobalSecondaryIndexSettingsUpdate, 0) + var vv GlobalTableGlobalSecondaryIndexSettingsUpdate + return smithy.ReadList(d, s, func() error { + vv = GlobalTableGlobalSecondaryIndexSettingsUpdate{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeGlobalTableList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]GlobalTable) error { + *v = make([]GlobalTable, 0) + var vv GlobalTable + return smithy.ReadList(d, s, func() error { + vv = GlobalTable{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeGlobalTableWitnessDescriptionList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]GlobalTableWitnessDescription) error { + *v = make([]GlobalTableWitnessDescription, 0) + var vv GlobalTableWitnessDescription + return smithy.ReadList(d, s, func() error { + vv = GlobalTableWitnessDescription{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeGlobalTableWitnessGroupUpdateList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]GlobalTableWitnessGroupUpdate) error { + *v = make([]GlobalTableWitnessGroupUpdate, 0) + var vv GlobalTableWitnessGroupUpdate + return smithy.ReadList(d, s, func() error { + vv = GlobalTableWitnessGroupUpdate{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeImportSummaryList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]ImportSummary) error { + *v = make([]ImportSummary, 0) + var vv ImportSummary + return smithy.ReadList(d, s, func() error { + vv = ImportSummary{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeItemCollectionMetricsMultiple(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]ItemCollectionMetrics) error { + *v = make([]ItemCollectionMetrics, 0) + var vv ItemCollectionMetrics + return smithy.ReadList(d, s, func() error { + vv = ItemCollectionMetrics{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeItemCollectionSizeEstimateRange(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]float64) error { + *v = make([]float64, 0) + var vv float64 + return smithy.ReadList(d, s, func() error { + + if err := d.ReadFloat64(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeItemList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]map[string]AttributeValue) error { + *v = make([]map[string]AttributeValue, 0) + var vv map[string]AttributeValue + return smithy.ReadList(d, s, func() error { + vv = nil + if err := deserializeAttributeMap(d, s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeItemResponseList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]ItemResponse) error { + *v = make([]ItemResponse, 0) + var vv ItemResponse + return smithy.ReadList(d, s, func() error { + vv = ItemResponse{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeKeyList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]map[string]AttributeValue) error { + *v = make([]map[string]AttributeValue, 0) + var vv map[string]AttributeValue + return smithy.ReadList(d, s, func() error { + vv = nil + if err := deserializeKey(d, s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeKeySchema(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]KeySchemaElement) error { + *v = make([]KeySchemaElement, 0) + var vv KeySchemaElement + return smithy.ReadList(d, s, func() error { + vv = KeySchemaElement{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeKinesisDataStreamDestinations(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]KinesisDataStreamDestination) error { + *v = make([]KinesisDataStreamDestination, 0) + var vv KinesisDataStreamDestination + return smithy.ReadList(d, s, func() error { + vv = KinesisDataStreamDestination{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeListAttributeValue(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]AttributeValue) error { + *v = make([]AttributeValue, 0) + var vv AttributeValue + return smithy.ReadList(d, s, func() error { + + if err := deserializeAttributeValue(d, s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeLocalSecondaryIndexDescriptionList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]LocalSecondaryIndexDescription) error { + *v = make([]LocalSecondaryIndexDescription, 0) + var vv LocalSecondaryIndexDescription + return smithy.ReadList(d, s, func() error { + vv = LocalSecondaryIndexDescription{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeLocalSecondaryIndexes(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]LocalSecondaryIndexInfo) error { + *v = make([]LocalSecondaryIndexInfo, 0) + var vv LocalSecondaryIndexInfo + return smithy.ReadList(d, s, func() error { + vv = LocalSecondaryIndexInfo{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeLocalSecondaryIndexList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]LocalSecondaryIndex) error { + *v = make([]LocalSecondaryIndex, 0) + var vv LocalSecondaryIndex + return smithy.ReadList(d, s, func() error { + vv = LocalSecondaryIndex{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeNonKeyAttributeNameList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]string) error { + *v = make([]string, 0) + var vv string + return smithy.ReadList(d, s, func() error { + + if err := d.ReadString(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeNumberSetAttributeValue(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]string) error { + *v = make([]string, 0) + var vv string + return smithy.ReadList(d, s, func() error { + + if err := d.ReadString(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeParameterizedStatements(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]ParameterizedStatement) error { + *v = make([]ParameterizedStatement, 0) + var vv ParameterizedStatement + return smithy.ReadList(d, s, func() error { + vv = ParameterizedStatement{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializePartiQLBatchRequest(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]BatchStatementRequest) error { + *v = make([]BatchStatementRequest, 0) + var vv BatchStatementRequest + return smithy.ReadList(d, s, func() error { + vv = BatchStatementRequest{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializePartiQLBatchResponse(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]BatchStatementResponse) error { + *v = make([]BatchStatementResponse, 0) + var vv BatchStatementResponse + return smithy.ReadList(d, s, func() error { + vv = BatchStatementResponse{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializePreparedStatementParameters(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]AttributeValue) error { + *v = make([]AttributeValue, 0) + var vv AttributeValue + return smithy.ReadList(d, s, func() error { + + if err := deserializeAttributeValue(d, s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeReplicaAutoScalingDescriptionList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]ReplicaAutoScalingDescription) error { + *v = make([]ReplicaAutoScalingDescription, 0) + var vv ReplicaAutoScalingDescription + return smithy.ReadList(d, s, func() error { + vv = ReplicaAutoScalingDescription{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeReplicaAutoScalingUpdateList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]ReplicaAutoScalingUpdate) error { + *v = make([]ReplicaAutoScalingUpdate, 0) + var vv ReplicaAutoScalingUpdate + return smithy.ReadList(d, s, func() error { + vv = ReplicaAutoScalingUpdate{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeReplicaDescriptionList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]ReplicaDescription) error { + *v = make([]ReplicaDescription, 0) + var vv ReplicaDescription + return smithy.ReadList(d, s, func() error { + vv = ReplicaDescription{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeReplicaGlobalSecondaryIndexAutoScalingDescriptionList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]ReplicaGlobalSecondaryIndexAutoScalingDescription) error { + *v = make([]ReplicaGlobalSecondaryIndexAutoScalingDescription, 0) + var vv ReplicaGlobalSecondaryIndexAutoScalingDescription + return smithy.ReadList(d, s, func() error { + vv = ReplicaGlobalSecondaryIndexAutoScalingDescription{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeReplicaGlobalSecondaryIndexAutoScalingUpdateList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]ReplicaGlobalSecondaryIndexAutoScalingUpdate) error { + *v = make([]ReplicaGlobalSecondaryIndexAutoScalingUpdate, 0) + var vv ReplicaGlobalSecondaryIndexAutoScalingUpdate + return smithy.ReadList(d, s, func() error { + vv = ReplicaGlobalSecondaryIndexAutoScalingUpdate{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeReplicaGlobalSecondaryIndexDescriptionList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]ReplicaGlobalSecondaryIndexDescription) error { + *v = make([]ReplicaGlobalSecondaryIndexDescription, 0) + var vv ReplicaGlobalSecondaryIndexDescription + return smithy.ReadList(d, s, func() error { + vv = ReplicaGlobalSecondaryIndexDescription{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeReplicaGlobalSecondaryIndexList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]ReplicaGlobalSecondaryIndex) error { + *v = make([]ReplicaGlobalSecondaryIndex, 0) + var vv ReplicaGlobalSecondaryIndex + return smithy.ReadList(d, s, func() error { + vv = ReplicaGlobalSecondaryIndex{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeReplicaGlobalSecondaryIndexSettingsDescriptionList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]ReplicaGlobalSecondaryIndexSettingsDescription) error { + *v = make([]ReplicaGlobalSecondaryIndexSettingsDescription, 0) + var vv ReplicaGlobalSecondaryIndexSettingsDescription + return smithy.ReadList(d, s, func() error { + vv = ReplicaGlobalSecondaryIndexSettingsDescription{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeReplicaGlobalSecondaryIndexSettingsUpdateList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]ReplicaGlobalSecondaryIndexSettingsUpdate) error { + *v = make([]ReplicaGlobalSecondaryIndexSettingsUpdate, 0) + var vv ReplicaGlobalSecondaryIndexSettingsUpdate + return smithy.ReadList(d, s, func() error { + vv = ReplicaGlobalSecondaryIndexSettingsUpdate{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeReplicaList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]Replica) error { + *v = make([]Replica, 0) + var vv Replica + return smithy.ReadList(d, s, func() error { + vv = Replica{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeReplicaSettingsDescriptionList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]ReplicaSettingsDescription) error { + *v = make([]ReplicaSettingsDescription, 0) + var vv ReplicaSettingsDescription + return smithy.ReadList(d, s, func() error { + vv = ReplicaSettingsDescription{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeReplicaSettingsUpdateList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]ReplicaSettingsUpdate) error { + *v = make([]ReplicaSettingsUpdate, 0) + var vv ReplicaSettingsUpdate + return smithy.ReadList(d, s, func() error { + vv = ReplicaSettingsUpdate{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeReplicationGroupUpdateList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]ReplicationGroupUpdate) error { + *v = make([]ReplicationGroupUpdate, 0) + var vv ReplicationGroupUpdate + return smithy.ReadList(d, s, func() error { + vv = ReplicationGroupUpdate{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeReplicaUpdateList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]ReplicaUpdate) error { + *v = make([]ReplicaUpdate, 0) + var vv ReplicaUpdate + return smithy.ReadList(d, s, func() error { + vv = ReplicaUpdate{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeSearchResultList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]SearchResultItem) error { + *v = make([]SearchResultItem, 0) + var vv SearchResultItem + return smithy.ReadList(d, s, func() error { + vv = SearchResultItem{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeSearchSchema(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]SearchSchemaElement) error { + *v = make([]SearchSchemaElement, 0) + var vv SearchSchemaElement + return smithy.ReadList(d, s, func() error { + vv = SearchSchemaElement{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeSearchVectorList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]AttributeValue) error { + *v = make([]AttributeValue, 0) + var vv AttributeValue + return smithy.ReadList(d, s, func() error { + + if err := deserializeAttributeValue(d, s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeStringSetAttributeValue(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]string) error { + *v = make([]string, 0) + var vv string + return smithy.ReadList(d, s, func() error { + + if err := d.ReadString(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeTableNameList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]string) error { + *v = make([]string, 0) + var vv string + return smithy.ReadList(d, s, func() error { + + if err := d.ReadString(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeTagKeyList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]string) error { + *v = make([]string, 0) + var vv string + return smithy.ReadList(d, s, func() error { + + if err := d.ReadString(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeTagList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]Tag) error { + *v = make([]Tag, 0) + var vv Tag + return smithy.ReadList(d, s, func() error { + vv = Tag{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeThrottlingReasonList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]ThrottlingReason) error { + *v = make([]ThrottlingReason, 0) + var vv ThrottlingReason + return smithy.ReadList(d, s, func() error { + vv = ThrottlingReason{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeTransactGetItemList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]TransactGetItem) error { + *v = make([]TransactGetItem, 0) + var vv TransactGetItem + return smithy.ReadList(d, s, func() error { + vv = TransactGetItem{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeTransactWriteItemList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]TransactWriteItem) error { + *v = make([]TransactWriteItem, 0) + var vv TransactWriteItem + return smithy.ReadList(d, s, func() error { + vv = TransactWriteItem{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeVectorIndexDescriptionList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]VectorIndexDescription) error { + *v = make([]VectorIndexDescription, 0) + var vv VectorIndexDescription + return smithy.ReadList(d, s, func() error { + vv = VectorIndexDescription{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeVectorIndexes(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]VectorIndexInfo) error { + *v = make([]VectorIndexInfo, 0) + var vv VectorIndexInfo + return smithy.ReadList(d, s, func() error { + vv = VectorIndexInfo{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeVectorIndexList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]VectorIndex) error { + *v = make([]VectorIndex, 0) + var vv VectorIndex + return smithy.ReadList(d, s, func() error { + vv = VectorIndex{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeVectorIndexUpdateList(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]VectorIndexUpdate) error { + *v = make([]VectorIndexUpdate, 0) + var vv VectorIndexUpdate + return smithy.ReadList(d, s, func() error { + vv = VectorIndexUpdate{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeWriteRequests(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]WriteRequest) error { + *v = make([]WriteRequest, 0) + var vv WriteRequest + return smithy.ReadList(d, s, func() error { + vv = WriteRequest{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func serializeAttributeMap(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]AttributeValue) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + serializeAttributeValue(s, schema.MapValue(), vv) + } + s.CloseMap() +} + +func serializeAttributeUpdates(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]AttributeValueUpdate) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + s.WriteStruct(schema.MapValue()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseMap() +} + +func serializeBatchGetRequestMap(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]KeysAndAttributes) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + s.WriteStruct(schema.MapValue()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseMap() +} + +func serializeBatchGetResponseMap(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string][]map[string]AttributeValue) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + serializeItemList(s, schema.MapValue(), vv) + } + s.CloseMap() +} + +func serializeBatchWriteItemRequestMap(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string][]WriteRequest) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + serializeWriteRequests(s, schema.MapValue(), vv) + } + s.CloseMap() +} + +func serializeExpectedAttributeMap(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]ExpectedAttributeValue) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + s.WriteStruct(schema.MapValue()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseMap() +} + +func serializeExpressionAttributeNameMap(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]string) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + s.WriteString(schema.MapValue(), string(vv)) + } + s.CloseMap() +} + +func serializeExpressionAttributeValueMap(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]AttributeValue) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + serializeAttributeValue(s, schema.MapValue(), vv) + } + s.CloseMap() +} + +func serializeFilterConditionMap(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]Condition) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + s.WriteStruct(schema.MapValue()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseMap() +} + +func serializeItemCollectionKeyAttributeMap(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]AttributeValue) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + serializeAttributeValue(s, schema.MapValue(), vv) + } + s.CloseMap() +} + +func serializeItemCollectionMetricsPerTable(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string][]ItemCollectionMetrics) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + serializeItemCollectionMetricsMultiple(s, schema.MapValue(), vv) + } + s.CloseMap() +} + +func serializeKey(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]AttributeValue) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + serializeAttributeValue(s, schema.MapValue(), vv) + } + s.CloseMap() +} + +func serializeKeyConditions(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]Condition) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + s.WriteStruct(schema.MapValue()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseMap() +} + +func serializeMapAttributeValue(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]AttributeValue) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + serializeAttributeValue(s, schema.MapValue(), vv) + } + s.CloseMap() +} + +func serializePutItemInputAttributeMap(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]AttributeValue) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + serializeAttributeValue(s, schema.MapValue(), vv) + } + s.CloseMap() +} + +func serializeSecondaryIndexesCapacityMap(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]Capacity) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + s.WriteStruct(schema.MapValue()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseMap() +} + +func serializeVectorIndexesCapacityMap(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]VectorCapacity) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + s.WriteStruct(schema.MapValue()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseMap() +} + +func deserializeAttributeMap(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]AttributeValue) error { + *v = make(map[string]AttributeValue) + var vv AttributeValue + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero AttributeValue + (*v)[k] = zero + return nil + } + + if err := deserializeAttributeValue(d, s.MapValue(), &vv); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeAttributeUpdates(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]AttributeValueUpdate) error { + *v = make(map[string]AttributeValueUpdate) + var vv AttributeValueUpdate + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero AttributeValueUpdate + (*v)[k] = zero + return nil + } + + vv = AttributeValueUpdate{} + if err := vv.Deserialize(d); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeBatchGetRequestMap(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]KeysAndAttributes) error { + *v = make(map[string]KeysAndAttributes) + var vv KeysAndAttributes + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero KeysAndAttributes + (*v)[k] = zero + return nil + } + + vv = KeysAndAttributes{} + if err := vv.Deserialize(d); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeBatchGetResponseMap(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string][]map[string]AttributeValue) error { + *v = make(map[string][]map[string]AttributeValue) + var vv []map[string]AttributeValue + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero []map[string]AttributeValue + (*v)[k] = zero + return nil + } + + vv = nil + if err := deserializeItemList(d, s.MapValue(), &vv); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeBatchWriteItemRequestMap(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string][]WriteRequest) error { + *v = make(map[string][]WriteRequest) + var vv []WriteRequest + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero []WriteRequest + (*v)[k] = zero + return nil + } + + vv = nil + if err := deserializeWriteRequests(d, s.MapValue(), &vv); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeExpectedAttributeMap(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]ExpectedAttributeValue) error { + *v = make(map[string]ExpectedAttributeValue) + var vv ExpectedAttributeValue + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero ExpectedAttributeValue + (*v)[k] = zero + return nil + } + + vv = ExpectedAttributeValue{} + if err := vv.Deserialize(d); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeExpressionAttributeNameMap(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]string) error { + *v = make(map[string]string) + var vv string + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero string + (*v)[k] = zero + return nil + } + + if err := d.ReadString(s.MapValue(), &vv); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeExpressionAttributeValueMap(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]AttributeValue) error { + *v = make(map[string]AttributeValue) + var vv AttributeValue + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero AttributeValue + (*v)[k] = zero + return nil + } + + if err := deserializeAttributeValue(d, s.MapValue(), &vv); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeFilterConditionMap(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]Condition) error { + *v = make(map[string]Condition) + var vv Condition + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero Condition + (*v)[k] = zero + return nil + } + + vv = Condition{} + if err := vv.Deserialize(d); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeItemCollectionKeyAttributeMap(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]AttributeValue) error { + *v = make(map[string]AttributeValue) + var vv AttributeValue + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero AttributeValue + (*v)[k] = zero + return nil + } + + if err := deserializeAttributeValue(d, s.MapValue(), &vv); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeItemCollectionMetricsPerTable(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string][]ItemCollectionMetrics) error { + *v = make(map[string][]ItemCollectionMetrics) + var vv []ItemCollectionMetrics + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero []ItemCollectionMetrics + (*v)[k] = zero + return nil + } + + vv = nil + if err := deserializeItemCollectionMetricsMultiple(d, s.MapValue(), &vv); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeKey(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]AttributeValue) error { + *v = make(map[string]AttributeValue) + var vv AttributeValue + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero AttributeValue + (*v)[k] = zero + return nil + } + + if err := deserializeAttributeValue(d, s.MapValue(), &vv); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeKeyConditions(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]Condition) error { + *v = make(map[string]Condition) + var vv Condition + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero Condition + (*v)[k] = zero + return nil + } + + vv = Condition{} + if err := vv.Deserialize(d); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeMapAttributeValue(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]AttributeValue) error { + *v = make(map[string]AttributeValue) + var vv AttributeValue + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero AttributeValue + (*v)[k] = zero + return nil + } + + if err := deserializeAttributeValue(d, s.MapValue(), &vv); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializePutItemInputAttributeMap(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]AttributeValue) error { + *v = make(map[string]AttributeValue) + var vv AttributeValue + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero AttributeValue + (*v)[k] = zero + return nil + } + + if err := deserializeAttributeValue(d, s.MapValue(), &vv); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeSecondaryIndexesCapacityMap(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]Capacity) error { + *v = make(map[string]Capacity) + var vv Capacity + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero Capacity + (*v)[k] = zero + return nil + } + + vv = Capacity{} + if err := vv.Deserialize(d); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeVectorIndexesCapacityMap(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]VectorCapacity) error { + *v = make(map[string]VectorCapacity) + var vv VectorCapacity + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero VectorCapacity + (*v)[k] = zero + return nil + } + + vv = VectorCapacity{} + if err := vv.Deserialize(d); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/types/enums.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/types/enums.go index c9beca8696c..8bd97fef518 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/types/enums.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/types/enums.go @@ -784,6 +784,25 @@ func (ScalarAttributeType) Values() []ScalarAttributeType { } } +type SearchSchemaElementType string + +// Enum values for SearchSchemaElementType +const ( + SearchSchemaElementTypeHash SearchSchemaElementType = "HASH" + SearchSchemaElementTypeInlineFilter SearchSchemaElementType = "INLINE_FILTER" +) + +// Values returns all known values for SearchSchemaElementType. 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 (SearchSchemaElementType) Values() []SearchSchemaElementType { + return []SearchSchemaElementType{ + "HASH", + "INLINE_FILTER", + } +} + type Select string // Enum values for Select @@ -947,6 +966,27 @@ func (TimeToLiveStatus) Values() []TimeToLiveStatus { } } +type VectorDistanceFunction string + +// Enum values for VectorDistanceFunction +const ( + VectorDistanceFunctionCosine VectorDistanceFunction = "COSINE" + VectorDistanceFunctionDotProduct VectorDistanceFunction = "DOT_PRODUCT" + VectorDistanceFunctionEuclidean VectorDistanceFunction = "EUCLIDEAN" +) + +// Values returns all known values for VectorDistanceFunction. 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 (VectorDistanceFunction) Values() []VectorDistanceFunction { + return []VectorDistanceFunction{ + "COSINE", + "DOT_PRODUCT", + "EUCLIDEAN", + } +} + type WitnessStatus string // Enum values for WitnessStatus diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/types/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/types/errors.go index 3774a406e5f..b191c138df4 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/types/errors.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/types/errors.go @@ -4,6 +4,7 @@ package types import ( "fmt" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" smithy "github.com/aws/smithy-go" ) @@ -33,6 +34,27 @@ func (e *BackupInUseException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *BackupInUseException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *BackupInUseException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.BackupInUseException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *BackupInUseException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.BackupInUseException_message, *v.Message) + } +} +func (v *BackupInUseException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.BackupInUseException, func(s *smithy.Schema) error { + switch s { + case schemas.BackupInUseException_message: + v.Message = new(string) + return d.ReadString(schemas.BackupInUseException_message, v.Message) + } + return nil + }) +} // Backup not found for the given BackupARN. type BackupNotFoundException struct { @@ -59,6 +81,27 @@ func (e *BackupNotFoundException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *BackupNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *BackupNotFoundException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.BackupNotFoundException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *BackupNotFoundException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.BackupNotFoundException_message, *v.Message) + } +} +func (v *BackupNotFoundException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.BackupNotFoundException, func(s *smithy.Schema) error { + switch s { + case schemas.BackupNotFoundException_message: + v.Message = new(string) + return d.ReadString(schemas.BackupNotFoundException_message, v.Message) + } + return nil + }) +} // A condition specified in the operation failed to be evaluated. type ConditionalCheckFailedException struct { @@ -87,6 +130,30 @@ func (e *ConditionalCheckFailedException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *ConditionalCheckFailedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *ConditionalCheckFailedException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ConditionalCheckFailedException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ConditionalCheckFailedException) SerializeMembers(s smithy.ShapeSerializer) { + serializeAttributeMap(s, schemas.ConditionalCheckFailedException_Item, v.Item) + if v.Message != nil { + s.WriteString(schemas.ConditionalCheckFailedException_message, *v.Message) + } +} +func (v *ConditionalCheckFailedException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ConditionalCheckFailedException, func(s *smithy.Schema) error { + switch s { + case schemas.ConditionalCheckFailedException_Item: + return deserializeAttributeMap(d, schemas.ConditionalCheckFailedException_Item, &v.Item) + case schemas.ConditionalCheckFailedException_message: + v.Message = new(string) + return d.ReadString(schemas.ConditionalCheckFailedException_message, v.Message) + } + return nil + }) +} // Backups have not yet been enabled for this table. type ContinuousBackupsUnavailableException struct { @@ -115,6 +182,27 @@ func (e *ContinuousBackupsUnavailableException) ErrorCode() string { func (e *ContinuousBackupsUnavailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *ContinuousBackupsUnavailableException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ContinuousBackupsUnavailableException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ContinuousBackupsUnavailableException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.ContinuousBackupsUnavailableException_message, *v.Message) + } +} +func (v *ContinuousBackupsUnavailableException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ContinuousBackupsUnavailableException, func(s *smithy.Schema) error { + switch s { + case schemas.ContinuousBackupsUnavailableException_message: + v.Message = new(string) + return d.ReadString(schemas.ContinuousBackupsUnavailableException_message, v.Message) + } + return nil + }) +} // There was an attempt to insert an item with the same primary key as an item // @@ -143,6 +231,27 @@ func (e *DuplicateItemException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *DuplicateItemException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *DuplicateItemException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DuplicateItemException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DuplicateItemException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.DuplicateItemException_message, *v.Message) + } +} +func (v *DuplicateItemException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.DuplicateItemException, func(s *smithy.Schema) error { + switch s { + case schemas.DuplicateItemException_message: + v.Message = new(string) + return d.ReadString(schemas.DuplicateItemException_message, v.Message) + } + return nil + }) +} // There was a conflict when writing to the specified S3 bucket. type ExportConflictException struct { @@ -169,6 +278,27 @@ func (e *ExportConflictException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *ExportConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *ExportConflictException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ExportConflictException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ExportConflictException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.ExportConflictException_message, *v.Message) + } +} +func (v *ExportConflictException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ExportConflictException, func(s *smithy.Schema) error { + switch s { + case schemas.ExportConflictException_message: + v.Message = new(string) + return d.ReadString(schemas.ExportConflictException_message, v.Message) + } + return nil + }) +} // The specified export was not found. type ExportNotFoundException struct { @@ -195,6 +325,27 @@ func (e *ExportNotFoundException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *ExportNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *ExportNotFoundException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ExportNotFoundException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ExportNotFoundException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.ExportNotFoundException_message, *v.Message) + } +} +func (v *ExportNotFoundException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ExportNotFoundException, func(s *smithy.Schema) error { + switch s { + case schemas.ExportNotFoundException_message: + v.Message = new(string) + return d.ReadString(schemas.ExportNotFoundException_message, v.Message) + } + return nil + }) +} // The specified global table already exists. type GlobalTableAlreadyExistsException struct { @@ -221,6 +372,27 @@ func (e *GlobalTableAlreadyExistsException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *GlobalTableAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *GlobalTableAlreadyExistsException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.GlobalTableAlreadyExistsException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *GlobalTableAlreadyExistsException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.GlobalTableAlreadyExistsException_message, *v.Message) + } +} +func (v *GlobalTableAlreadyExistsException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.GlobalTableAlreadyExistsException, func(s *smithy.Schema) error { + switch s { + case schemas.GlobalTableAlreadyExistsException_message: + v.Message = new(string) + return d.ReadString(schemas.GlobalTableAlreadyExistsException_message, v.Message) + } + return nil + }) +} // The specified global table does not exist. type GlobalTableNotFoundException struct { @@ -247,6 +419,27 @@ func (e *GlobalTableNotFoundException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *GlobalTableNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *GlobalTableNotFoundException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.GlobalTableNotFoundException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *GlobalTableNotFoundException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.GlobalTableNotFoundException_message, *v.Message) + } +} +func (v *GlobalTableNotFoundException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.GlobalTableNotFoundException, func(s *smithy.Schema) error { + switch s { + case schemas.GlobalTableNotFoundException_message: + v.Message = new(string) + return d.ReadString(schemas.GlobalTableNotFoundException_message, v.Message) + } + return nil + }) +} // DynamoDB rejected the request because you retried a request with a different // payload but with an idempotent token that was already used. @@ -276,6 +469,27 @@ func (e *IdempotentParameterMismatchException) ErrorCode() string { func (e *IdempotentParameterMismatchException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *IdempotentParameterMismatchException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.IdempotentParameterMismatchException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *IdempotentParameterMismatchException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.IdempotentParameterMismatchException_Message, *v.Message) + } +} +func (v *IdempotentParameterMismatchException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.IdempotentParameterMismatchException, func(s *smithy.Schema) error { + switch s { + case schemas.IdempotentParameterMismatchException_Message: + v.Message = new(string) + return d.ReadString(schemas.IdempotentParameterMismatchException_Message, v.Message) + } + return nil + }) +} // There was a conflict when importing from the specified S3 source. This can // @@ -305,6 +519,27 @@ func (e *ImportConflictException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *ImportConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *ImportConflictException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ImportConflictException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ImportConflictException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.ImportConflictException_message, *v.Message) + } +} +func (v *ImportConflictException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ImportConflictException, func(s *smithy.Schema) error { + switch s { + case schemas.ImportConflictException_message: + v.Message = new(string) + return d.ReadString(schemas.ImportConflictException_message, v.Message) + } + return nil + }) +} // The specified import was not found. type ImportNotFoundException struct { @@ -331,6 +566,27 @@ func (e *ImportNotFoundException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *ImportNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *ImportNotFoundException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ImportNotFoundException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ImportNotFoundException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.ImportNotFoundException_message, *v.Message) + } +} +func (v *ImportNotFoundException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ImportNotFoundException, func(s *smithy.Schema) error { + switch s { + case schemas.ImportNotFoundException_message: + v.Message = new(string) + return d.ReadString(schemas.ImportNotFoundException_message, v.Message) + } + return nil + }) +} // The operation tried to access a nonexistent index. type IndexNotFoundException struct { @@ -357,6 +613,27 @@ func (e *IndexNotFoundException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *IndexNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *IndexNotFoundException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.IndexNotFoundException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *IndexNotFoundException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.IndexNotFoundException_message, *v.Message) + } +} +func (v *IndexNotFoundException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.IndexNotFoundException, func(s *smithy.Schema) error { + switch s { + case schemas.IndexNotFoundException_message: + v.Message = new(string) + return d.ReadString(schemas.IndexNotFoundException_message, v.Message) + } + return nil + }) +} // An error occurred on the server side. type InternalServerError struct { @@ -383,6 +660,27 @@ func (e *InternalServerError) ErrorCode() string { return *e.ErrorCodeOverride } func (e *InternalServerError) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } +func (v *InternalServerError) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.InternalServerError) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *InternalServerError) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.InternalServerError_message, *v.Message) + } +} +func (v *InternalServerError) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.InternalServerError, func(s *smithy.Schema) error { + switch s { + case schemas.InternalServerError_message: + v.Message = new(string) + return d.ReadString(schemas.InternalServerError_message, v.Message) + } + return nil + }) +} type InvalidEndpointException struct { Message *string @@ -408,6 +706,27 @@ func (e *InvalidEndpointException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *InvalidEndpointException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *InvalidEndpointException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.InvalidEndpointException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *InvalidEndpointException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.InvalidEndpointException_Message, *v.Message) + } +} +func (v *InvalidEndpointException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.InvalidEndpointException, func(s *smithy.Schema) error { + switch s { + case schemas.InvalidEndpointException_Message: + v.Message = new(string) + return d.ReadString(schemas.InvalidEndpointException_Message, v.Message) + } + return nil + }) +} // The specified ExportTime is outside of the point in time recovery window. type InvalidExportTimeException struct { @@ -434,6 +753,27 @@ func (e *InvalidExportTimeException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *InvalidExportTimeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *InvalidExportTimeException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.InvalidExportTimeException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *InvalidExportTimeException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.InvalidExportTimeException_message, *v.Message) + } +} +func (v *InvalidExportTimeException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.InvalidExportTimeException, func(s *smithy.Schema) error { + switch s { + case schemas.InvalidExportTimeException_message: + v.Message = new(string) + return d.ReadString(schemas.InvalidExportTimeException_message, v.Message) + } + return nil + }) +} // An invalid restore time was specified. RestoreDateTime must be between // EarliestRestorableDateTime and LatestRestorableDateTime. @@ -461,6 +801,27 @@ func (e *InvalidRestoreTimeException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *InvalidRestoreTimeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *InvalidRestoreTimeException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.InvalidRestoreTimeException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *InvalidRestoreTimeException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.InvalidRestoreTimeException_message, *v.Message) + } +} +func (v *InvalidRestoreTimeException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.InvalidRestoreTimeException, func(s *smithy.Schema) error { + switch s { + case schemas.InvalidRestoreTimeException_message: + v.Message = new(string) + return d.ReadString(schemas.InvalidRestoreTimeException_message, v.Message) + } + return nil + }) +} // An item collection is too large. This exception is only returned for tables // that have one or more local secondary indexes. @@ -490,6 +851,27 @@ func (e *ItemCollectionSizeLimitExceededException) ErrorCode() string { func (e *ItemCollectionSizeLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *ItemCollectionSizeLimitExceededException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ItemCollectionSizeLimitExceededException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ItemCollectionSizeLimitExceededException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.ItemCollectionSizeLimitExceededException_message, *v.Message) + } +} +func (v *ItemCollectionSizeLimitExceededException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ItemCollectionSizeLimitExceededException, func(s *smithy.Schema) error { + switch s { + case schemas.ItemCollectionSizeLimitExceededException_message: + v.Message = new(string) + return d.ReadString(schemas.ItemCollectionSizeLimitExceededException_message, v.Message) + } + return nil + }) +} // There is no limit to the number of daily on-demand backups that can be taken. // @@ -536,6 +918,27 @@ func (e *LimitExceededException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *LimitExceededException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.LimitExceededException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *LimitExceededException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.LimitExceededException_message, *v.Message) + } +} +func (v *LimitExceededException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.LimitExceededException, func(s *smithy.Schema) error { + switch s { + case schemas.LimitExceededException_message: + v.Message = new(string) + return d.ReadString(schemas.LimitExceededException_message, v.Message) + } + return nil + }) +} // Point in time recovery has not yet been enabled for this source table. type PointInTimeRecoveryUnavailableException struct { @@ -564,6 +967,27 @@ func (e *PointInTimeRecoveryUnavailableException) ErrorCode() string { func (e *PointInTimeRecoveryUnavailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *PointInTimeRecoveryUnavailableException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.PointInTimeRecoveryUnavailableException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *PointInTimeRecoveryUnavailableException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.PointInTimeRecoveryUnavailableException_message, *v.Message) + } +} +func (v *PointInTimeRecoveryUnavailableException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.PointInTimeRecoveryUnavailableException, func(s *smithy.Schema) error { + switch s { + case schemas.PointInTimeRecoveryUnavailableException_message: + v.Message = new(string) + return d.ReadString(schemas.PointInTimeRecoveryUnavailableException_message, v.Message) + } + return nil + }) +} // The operation tried to access a nonexistent resource-based policy. // @@ -593,6 +1017,27 @@ func (e *PolicyNotFoundException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *PolicyNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *PolicyNotFoundException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.PolicyNotFoundException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *PolicyNotFoundException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.PolicyNotFoundException_message, *v.Message) + } +} +func (v *PolicyNotFoundException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.PolicyNotFoundException, func(s *smithy.Schema) error { + switch s { + case schemas.PolicyNotFoundException_message: + v.Message = new(string) + return d.ReadString(schemas.PolicyNotFoundException_message, v.Message) + } + return nil + }) +} // The request was denied due to request throttling. For detailed information // about why the request was throttled and the ARN of the impacted resource, find @@ -632,6 +1077,30 @@ func (e *ProvisionedThroughputExceededException) ErrorCode() string { func (e *ProvisionedThroughputExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *ProvisionedThroughputExceededException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ProvisionedThroughputExceededException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ProvisionedThroughputExceededException) SerializeMembers(s smithy.ShapeSerializer) { + serializeThrottlingReasonList(s, schemas.ProvisionedThroughputExceededException_ThrottlingReasons, v.ThrottlingReasons) + if v.Message != nil { + s.WriteString(schemas.ProvisionedThroughputExceededException_message, *v.Message) + } +} +func (v *ProvisionedThroughputExceededException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ProvisionedThroughputExceededException, func(s *smithy.Schema) error { + switch s { + case schemas.ProvisionedThroughputExceededException_ThrottlingReasons: + return deserializeThrottlingReasonList(d, schemas.ProvisionedThroughputExceededException_ThrottlingReasons, &v.ThrottlingReasons) + case schemas.ProvisionedThroughputExceededException_message: + v.Message = new(string) + return d.ReadString(schemas.ProvisionedThroughputExceededException_message, v.Message) + } + return nil + }) +} // The specified replica is already part of the global table. type ReplicaAlreadyExistsException struct { @@ -658,6 +1127,27 @@ func (e *ReplicaAlreadyExistsException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *ReplicaAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *ReplicaAlreadyExistsException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ReplicaAlreadyExistsException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ReplicaAlreadyExistsException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.ReplicaAlreadyExistsException_message, *v.Message) + } +} +func (v *ReplicaAlreadyExistsException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ReplicaAlreadyExistsException, func(s *smithy.Schema) error { + switch s { + case schemas.ReplicaAlreadyExistsException_message: + v.Message = new(string) + return d.ReadString(schemas.ReplicaAlreadyExistsException_message, v.Message) + } + return nil + }) +} // The specified replica is no longer part of the global table. type ReplicaNotFoundException struct { @@ -684,6 +1174,27 @@ func (e *ReplicaNotFoundException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *ReplicaNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *ReplicaNotFoundException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ReplicaNotFoundException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ReplicaNotFoundException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.ReplicaNotFoundException_message, *v.Message) + } +} +func (v *ReplicaNotFoundException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ReplicaNotFoundException, func(s *smithy.Schema) error { + switch s { + case schemas.ReplicaNotFoundException_message: + v.Message = new(string) + return d.ReadString(schemas.ReplicaNotFoundException_message, v.Message) + } + return nil + }) +} // The request was rejected because one or more items in the request are being // modified by a request in another Region. @@ -711,6 +1222,27 @@ func (e *ReplicatedWriteConflictException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *ReplicatedWriteConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *ReplicatedWriteConflictException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ReplicatedWriteConflictException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ReplicatedWriteConflictException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.ReplicatedWriteConflictException_message, *v.Message) + } +} +func (v *ReplicatedWriteConflictException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ReplicatedWriteConflictException, func(s *smithy.Schema) error { + switch s { + case schemas.ReplicatedWriteConflictException_message: + v.Message = new(string) + return d.ReadString(schemas.ReplicatedWriteConflictException_message, v.Message) + } + return nil + }) +} // Throughput exceeds the current throughput quota for your account. For detailed // information about why the request was throttled and the ARN of the impacted @@ -745,6 +1277,30 @@ func (e *RequestLimitExceeded) ErrorCode() string { return *e.ErrorCodeOverride } func (e *RequestLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *RequestLimitExceeded) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.RequestLimitExceeded) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *RequestLimitExceeded) SerializeMembers(s smithy.ShapeSerializer) { + serializeThrottlingReasonList(s, schemas.RequestLimitExceeded_ThrottlingReasons, v.ThrottlingReasons) + if v.Message != nil { + s.WriteString(schemas.RequestLimitExceeded_message, *v.Message) + } +} +func (v *RequestLimitExceeded) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.RequestLimitExceeded, func(s *smithy.Schema) error { + switch s { + case schemas.RequestLimitExceeded_ThrottlingReasons: + return deserializeThrottlingReasonList(d, schemas.RequestLimitExceeded_ThrottlingReasons, &v.ThrottlingReasons) + case schemas.RequestLimitExceeded_message: + v.Message = new(string) + return d.ReadString(schemas.RequestLimitExceeded_message, v.Message) + } + return nil + }) +} // The operation conflicts with the resource's availability. For example: // @@ -780,6 +1336,27 @@ func (e *ResourceInUseException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *ResourceInUseException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *ResourceInUseException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ResourceInUseException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ResourceInUseException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.ResourceInUseException_message, *v.Message) + } +} +func (v *ResourceInUseException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ResourceInUseException, func(s *smithy.Schema) error { + switch s { + case schemas.ResourceInUseException_message: + v.Message = new(string) + return d.ReadString(schemas.ResourceInUseException_message, v.Message) + } + return nil + }) +} // The operation tried to access a nonexistent table or index. The resource might // not be specified correctly, or its status might not be ACTIVE . @@ -807,6 +1384,27 @@ func (e *ResourceNotFoundException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *ResourceNotFoundException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ResourceNotFoundException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ResourceNotFoundException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.ResourceNotFoundException_message, *v.Message) + } +} +func (v *ResourceNotFoundException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ResourceNotFoundException, func(s *smithy.Schema) error { + switch s { + case schemas.ResourceNotFoundException_message: + v.Message = new(string) + return d.ReadString(schemas.ResourceNotFoundException_message, v.Message) + } + return nil + }) +} // A target table with the specified name already exists. type TableAlreadyExistsException struct { @@ -833,6 +1431,27 @@ func (e *TableAlreadyExistsException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *TableAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *TableAlreadyExistsException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.TableAlreadyExistsException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *TableAlreadyExistsException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.TableAlreadyExistsException_message, *v.Message) + } +} +func (v *TableAlreadyExistsException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.TableAlreadyExistsException, func(s *smithy.Schema) error { + switch s { + case schemas.TableAlreadyExistsException_message: + v.Message = new(string) + return d.ReadString(schemas.TableAlreadyExistsException_message, v.Message) + } + return nil + }) +} // A target table with the specified name is either being created or deleted. type TableInUseException struct { @@ -859,6 +1478,27 @@ func (e *TableInUseException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *TableInUseException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *TableInUseException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.TableInUseException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *TableInUseException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.TableInUseException_message, *v.Message) + } +} +func (v *TableInUseException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.TableInUseException, func(s *smithy.Schema) error { + switch s { + case schemas.TableInUseException_message: + v.Message = new(string) + return d.ReadString(schemas.TableInUseException_message, v.Message) + } + return nil + }) +} // A source table with the name TableName does not currently exist within the // subscriber's account or the subscriber is operating in the wrong Amazon Web @@ -887,6 +1527,27 @@ func (e *TableNotFoundException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *TableNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *TableNotFoundException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.TableNotFoundException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *TableNotFoundException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.TableNotFoundException_message, *v.Message) + } +} +func (v *TableNotFoundException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.TableNotFoundException, func(s *smithy.Schema) error { + switch s { + case schemas.TableNotFoundException_message: + v.Message = new(string) + return d.ReadString(schemas.TableNotFoundException_message, v.Message) + } + return nil + }) +} // The request was denied due to request throttling. For detailed information // about why the request was throttled and the ARN of the impacted resource, find @@ -919,6 +1580,30 @@ func (e *ThrottlingException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *ThrottlingException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ThrottlingException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ThrottlingException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.ThrottlingException_message, *v.Message) + } + serializeThrottlingReasonList(s, schemas.ThrottlingException_throttlingReasons, v.ThrottlingReasons) +} +func (v *ThrottlingException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ThrottlingException, func(s *smithy.Schema) error { + switch s { + case schemas.ThrottlingException_message: + v.Message = new(string) + return d.ReadString(schemas.ThrottlingException_message, v.Message) + case schemas.ThrottlingException_throttlingReasons: + return deserializeThrottlingReasonList(d, schemas.ThrottlingException_throttlingReasons, &v.ThrottlingReasons) + } + return nil + }) +} // The entire transaction request was canceled. // @@ -961,7 +1646,10 @@ func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.Fau // // DynamoDB lists the cancellation reasons on the CancellationReasons property. // Transaction cancellation reasons are ordered in the order of requested items, if -// an item has no error it will have None code and Null message. +// an item has no error it will have None code and Null message. The None code is +// returned as the literal string "None" , not a null or absent value; the message +// field is omitted entirely for an item that has no error. This is important to +// note when using an SDK that surfaces the code as an optional or nullable type. // // Cancellation reason codes and possible error messages: // @@ -1089,6 +1777,30 @@ func (e *TransactionCanceledException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *TransactionCanceledException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *TransactionCanceledException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.TransactionCanceledException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *TransactionCanceledException) SerializeMembers(s smithy.ShapeSerializer) { + serializeCancellationReasonList(s, schemas.TransactionCanceledException_CancellationReasons, v.CancellationReasons) + if v.Message != nil { + s.WriteString(schemas.TransactionCanceledException_Message, *v.Message) + } +} +func (v *TransactionCanceledException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.TransactionCanceledException, func(s *smithy.Schema) error { + switch s { + case schemas.TransactionCanceledException_CancellationReasons: + return deserializeCancellationReasonList(d, schemas.TransactionCanceledException_CancellationReasons, &v.CancellationReasons) + case schemas.TransactionCanceledException_Message: + v.Message = new(string) + return d.ReadString(schemas.TransactionCanceledException_Message, v.Message) + } + return nil + }) +} // Operation was rejected because there is an ongoing transaction for the item. type TransactionConflictException struct { @@ -1115,6 +1827,27 @@ func (e *TransactionConflictException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *TransactionConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *TransactionConflictException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.TransactionConflictException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *TransactionConflictException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.TransactionConflictException_message, *v.Message) + } +} +func (v *TransactionConflictException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.TransactionConflictException, func(s *smithy.Schema) error { + switch s { + case schemas.TransactionConflictException_message: + v.Message = new(string) + return d.ReadString(schemas.TransactionConflictException_message, v.Message) + } + return nil + }) +} // The transaction with the given request token is already in progress. // @@ -1183,3 +1916,24 @@ func (e *TransactionInProgressException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *TransactionInProgressException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *TransactionInProgressException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.TransactionInProgressException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *TransactionInProgressException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.TransactionInProgressException_Message, *v.Message) + } +} +func (v *TransactionInProgressException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.TransactionInProgressException, func(s *smithy.Schema) error { + switch s { + case schemas.TransactionInProgressException_Message: + v.Message = new(string) + return d.ReadString(schemas.TransactionInProgressException_Message, v.Message) + } + return nil + }) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/types/types.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/types/types.go index cfcc5041669..cd3340a154b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/types/types.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/types/types.go @@ -3,6 +3,8 @@ package types import ( + "github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas" + smithy "github.com/aws/smithy-go" smithydocument "github.com/aws/smithy-go/document" "time" ) @@ -29,6 +31,40 @@ type ArchivalSummary struct { noSmithyDocumentSerde } +func (v *ArchivalSummary) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ArchivalSummary) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ArchivalSummary) SerializeMembers(s smithy.ShapeSerializer) { + if v.ArchivalBackupArn != nil { + s.WriteString(schemas.ArchivalSummary_ArchivalBackupArn, *v.ArchivalBackupArn) + } + if v.ArchivalDateTime != nil { + s.WriteTime(schemas.ArchivalSummary_ArchivalDateTime, *v.ArchivalDateTime) + } + if v.ArchivalReason != nil { + s.WriteString(schemas.ArchivalSummary_ArchivalReason, *v.ArchivalReason) + } +} +func (v *ArchivalSummary) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ArchivalSummary, func(s *smithy.Schema) error { + switch s { + case schemas.ArchivalSummary_ArchivalBackupArn: + v.ArchivalBackupArn = new(string) + return d.ReadString(schemas.ArchivalSummary_ArchivalBackupArn, v.ArchivalBackupArn) + case schemas.ArchivalSummary_ArchivalDateTime: + v.ArchivalDateTime = new(time.Time) + return d.ReadTime(schemas.ArchivalSummary_ArchivalDateTime, v.ArchivalDateTime) + case schemas.ArchivalSummary_ArchivalReason: + v.ArchivalReason = new(string) + return d.ReadString(schemas.ArchivalSummary_ArchivalReason, v.ArchivalReason) + } + return nil + }) +} + // Represents an attribute for describing the schema for the table and indexes. type AttributeDefinition struct { @@ -51,6 +87,38 @@ type AttributeDefinition struct { noSmithyDocumentSerde } +func (v *AttributeDefinition) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.AttributeDefinition) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *AttributeDefinition) SerializeMembers(s smithy.ShapeSerializer) { + if v.AttributeName != nil { + s.WriteString(schemas.AttributeDefinition_AttributeName, *v.AttributeName) + } + if v.AttributeType != "" { + s.WriteString(schemas.AttributeDefinition_AttributeType, string(v.AttributeType)) + } +} +func (v *AttributeDefinition) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.AttributeDefinition, func(s *smithy.Schema) error { + switch s { + case schemas.AttributeDefinition_AttributeName: + v.AttributeName = new(string) + return d.ReadString(schemas.AttributeDefinition_AttributeName, v.AttributeName) + case schemas.AttributeDefinition_AttributeType: + var ev string + if err := d.ReadString(schemas.AttributeDefinition_AttributeType, &ev); err != nil { + return err + } + v.AttributeType = ScalarAttributeType(ev) + return nil + } + return nil + }) +} + // Represents the data for an attribute. // // Each attribute value is described as a name-value pair. The name is the data @@ -86,6 +154,12 @@ type AttributeValueMemberB struct { } func (*AttributeValueMemberB) isAttributeValue() {} +func (v *AttributeValueMemberB) Serialize(s smithy.ShapeSerializer) { + s.WriteBlob(schemas.AttributeValue_B, v.Value) +} +func (v *AttributeValueMemberB) Deserialize(d smithy.ShapeDeserializer) error { + return d.ReadBlob(schemas.AttributeValue_B, &v.Value) +} // An attribute of type Boolean. For example: // @@ -97,6 +171,12 @@ type AttributeValueMemberBOOL struct { } func (*AttributeValueMemberBOOL) isAttributeValue() {} +func (v *AttributeValueMemberBOOL) Serialize(s smithy.ShapeSerializer) { + s.WriteBool(schemas.AttributeValue_BOOL, v.Value) +} +func (v *AttributeValueMemberBOOL) Deserialize(d smithy.ShapeDeserializer) error { + return d.ReadBool(schemas.AttributeValue_BOOL, &v.Value) +} // An attribute of type Binary Set. For example: // @@ -108,6 +188,12 @@ type AttributeValueMemberBS struct { } func (*AttributeValueMemberBS) isAttributeValue() {} +func (v *AttributeValueMemberBS) Serialize(s smithy.ShapeSerializer) { + serializeBinarySetAttributeValue(s, schemas.AttributeValue_BS, v.Value) +} +func (v *AttributeValueMemberBS) Deserialize(d smithy.ShapeDeserializer) error { + return deserializeBinarySetAttributeValue(d, schemas.AttributeValue_BS, &v.Value) +} // An attribute of type List. For example: // @@ -119,6 +205,12 @@ type AttributeValueMemberL struct { } func (*AttributeValueMemberL) isAttributeValue() {} +func (v *AttributeValueMemberL) Serialize(s smithy.ShapeSerializer) { + serializeListAttributeValue(s, schemas.AttributeValue_L, v.Value) +} +func (v *AttributeValueMemberL) Deserialize(d smithy.ShapeDeserializer) error { + return deserializeListAttributeValue(d, schemas.AttributeValue_L, &v.Value) +} // An attribute of type Map. For example: // @@ -130,6 +222,12 @@ type AttributeValueMemberM struct { } func (*AttributeValueMemberM) isAttributeValue() {} +func (v *AttributeValueMemberM) Serialize(s smithy.ShapeSerializer) { + serializeMapAttributeValue(s, schemas.AttributeValue_M, v.Value) +} +func (v *AttributeValueMemberM) Deserialize(d smithy.ShapeDeserializer) error { + return deserializeMapAttributeValue(d, schemas.AttributeValue_M, &v.Value) +} // An attribute of type Number. For example: // @@ -145,6 +243,12 @@ type AttributeValueMemberN struct { } func (*AttributeValueMemberN) isAttributeValue() {} +func (v *AttributeValueMemberN) Serialize(s smithy.ShapeSerializer) { + s.WriteString(schemas.AttributeValue_N, v.Value) +} +func (v *AttributeValueMemberN) Deserialize(d smithy.ShapeDeserializer) error { + return d.ReadString(schemas.AttributeValue_N, &v.Value) +} // An attribute of type Number Set. For example: // @@ -160,6 +264,12 @@ type AttributeValueMemberNS struct { } func (*AttributeValueMemberNS) isAttributeValue() {} +func (v *AttributeValueMemberNS) Serialize(s smithy.ShapeSerializer) { + serializeNumberSetAttributeValue(s, schemas.AttributeValue_NS, v.Value) +} +func (v *AttributeValueMemberNS) Deserialize(d smithy.ShapeDeserializer) error { + return deserializeNumberSetAttributeValue(d, schemas.AttributeValue_NS, &v.Value) +} // An attribute of type Null. For example: // @@ -171,6 +281,12 @@ type AttributeValueMemberNULL struct { } func (*AttributeValueMemberNULL) isAttributeValue() {} +func (v *AttributeValueMemberNULL) Serialize(s smithy.ShapeSerializer) { + s.WriteBool(schemas.AttributeValue_NULL, v.Value) +} +func (v *AttributeValueMemberNULL) Deserialize(d smithy.ShapeDeserializer) error { + return d.ReadBool(schemas.AttributeValue_NULL, &v.Value) +} // An attribute of type String. For example: // @@ -182,6 +298,12 @@ type AttributeValueMemberS struct { } func (*AttributeValueMemberS) isAttributeValue() {} +func (v *AttributeValueMemberS) Serialize(s smithy.ShapeSerializer) { + s.WriteString(schemas.AttributeValue_S, v.Value) +} +func (v *AttributeValueMemberS) Deserialize(d smithy.ShapeDeserializer) error { + return d.ReadString(schemas.AttributeValue_S, &v.Value) +} // An attribute of type String Set. For example: // @@ -193,6 +315,12 @@ type AttributeValueMemberSS struct { } func (*AttributeValueMemberSS) isAttributeValue() {} +func (v *AttributeValueMemberSS) Serialize(s smithy.ShapeSerializer) { + serializeStringSetAttributeValue(s, schemas.AttributeValue_SS, v.Value) +} +func (v *AttributeValueMemberSS) Deserialize(d smithy.ShapeDeserializer) error { + return deserializeStringSetAttributeValue(d, schemas.AttributeValue_SS, &v.Value) +} // For the UpdateItem operation, represents the attributes to be modified, the // action to perform on each, and the new value for each. @@ -283,6 +411,35 @@ type AttributeValueUpdate struct { noSmithyDocumentSerde } +func (v *AttributeValueUpdate) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.AttributeValueUpdate) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *AttributeValueUpdate) SerializeMembers(s smithy.ShapeSerializer) { + if v.Action != "" { + s.WriteString(schemas.AttributeValueUpdate_Action, string(v.Action)) + } + serializeAttributeValue(s, schemas.AttributeValueUpdate_Value, v.Value) +} +func (v *AttributeValueUpdate) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.AttributeValueUpdate, func(s *smithy.Schema) error { + switch s { + case schemas.AttributeValueUpdate_Action: + var ev string + if err := d.ReadString(schemas.AttributeValueUpdate_Action, &ev); err != nil { + return err + } + v.Action = AttributeAction(ev) + return nil + case schemas.AttributeValueUpdate_Value: + return deserializeAttributeValue(d, schemas.AttributeValueUpdate_Value, &v.Value) + } + return nil + }) +} + // Represents the properties of the scaling policy. type AutoScalingPolicyDescription struct { @@ -295,6 +452,36 @@ type AutoScalingPolicyDescription struct { noSmithyDocumentSerde } +func (v *AutoScalingPolicyDescription) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.AutoScalingPolicyDescription) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *AutoScalingPolicyDescription) SerializeMembers(s smithy.ShapeSerializer) { + if v.PolicyName != nil { + s.WriteString(schemas.AutoScalingPolicyDescription_PolicyName, *v.PolicyName) + } + if v.TargetTrackingScalingPolicyConfiguration != nil { + s.WriteStruct(schemas.AutoScalingPolicyDescription_TargetTrackingScalingPolicyConfiguration) + v.TargetTrackingScalingPolicyConfiguration.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *AutoScalingPolicyDescription) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.AutoScalingPolicyDescription, func(s *smithy.Schema) error { + switch s { + case schemas.AutoScalingPolicyDescription_PolicyName: + v.PolicyName = new(string) + return d.ReadString(schemas.AutoScalingPolicyDescription_PolicyName, v.PolicyName) + case schemas.AutoScalingPolicyDescription_TargetTrackingScalingPolicyConfiguration: + v.TargetTrackingScalingPolicyConfiguration = &AutoScalingTargetTrackingScalingPolicyConfigurationDescription{} + return v.TargetTrackingScalingPolicyConfiguration.Deserialize(d) + } + return nil + }) +} + // Represents the auto scaling policy to be modified. type AutoScalingPolicyUpdate struct { @@ -309,6 +496,36 @@ type AutoScalingPolicyUpdate struct { noSmithyDocumentSerde } +func (v *AutoScalingPolicyUpdate) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.AutoScalingPolicyUpdate) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *AutoScalingPolicyUpdate) SerializeMembers(s smithy.ShapeSerializer) { + if v.PolicyName != nil { + s.WriteString(schemas.AutoScalingPolicyUpdate_PolicyName, *v.PolicyName) + } + if v.TargetTrackingScalingPolicyConfiguration != nil { + s.WriteStruct(schemas.AutoScalingPolicyUpdate_TargetTrackingScalingPolicyConfiguration) + v.TargetTrackingScalingPolicyConfiguration.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *AutoScalingPolicyUpdate) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.AutoScalingPolicyUpdate, func(s *smithy.Schema) error { + switch s { + case schemas.AutoScalingPolicyUpdate_PolicyName: + v.PolicyName = new(string) + return d.ReadString(schemas.AutoScalingPolicyUpdate_PolicyName, v.PolicyName) + case schemas.AutoScalingPolicyUpdate_TargetTrackingScalingPolicyConfiguration: + v.TargetTrackingScalingPolicyConfiguration = &AutoScalingTargetTrackingScalingPolicyConfigurationUpdate{} + return v.TargetTrackingScalingPolicyConfiguration.Deserialize(d) + } + return nil + }) +} + // Represents the auto scaling settings for a global table or global secondary // index. type AutoScalingSettingsDescription struct { @@ -333,6 +550,49 @@ type AutoScalingSettingsDescription struct { noSmithyDocumentSerde } +func (v *AutoScalingSettingsDescription) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.AutoScalingSettingsDescription) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *AutoScalingSettingsDescription) SerializeMembers(s smithy.ShapeSerializer) { + if v.AutoScalingDisabled != nil { + s.WriteBool(schemas.AutoScalingSettingsDescription_AutoScalingDisabled, *v.AutoScalingDisabled) + } + if v.AutoScalingRoleArn != nil { + s.WriteString(schemas.AutoScalingSettingsDescription_AutoScalingRoleArn, *v.AutoScalingRoleArn) + } + if v.MaximumUnits != nil { + s.WriteInt64(schemas.AutoScalingSettingsDescription_MaximumUnits, *v.MaximumUnits) + } + if v.MinimumUnits != nil { + s.WriteInt64(schemas.AutoScalingSettingsDescription_MinimumUnits, *v.MinimumUnits) + } + serializeAutoScalingPolicyDescriptionList(s, schemas.AutoScalingSettingsDescription_ScalingPolicies, v.ScalingPolicies) +} +func (v *AutoScalingSettingsDescription) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.AutoScalingSettingsDescription, func(s *smithy.Schema) error { + switch s { + case schemas.AutoScalingSettingsDescription_AutoScalingDisabled: + v.AutoScalingDisabled = new(bool) + return d.ReadBool(schemas.AutoScalingSettingsDescription_AutoScalingDisabled, v.AutoScalingDisabled) + case schemas.AutoScalingSettingsDescription_AutoScalingRoleArn: + v.AutoScalingRoleArn = new(string) + return d.ReadString(schemas.AutoScalingSettingsDescription_AutoScalingRoleArn, v.AutoScalingRoleArn) + case schemas.AutoScalingSettingsDescription_MaximumUnits: + v.MaximumUnits = new(int64) + return d.ReadInt64(schemas.AutoScalingSettingsDescription_MaximumUnits, v.MaximumUnits) + case schemas.AutoScalingSettingsDescription_MinimumUnits: + v.MinimumUnits = new(int64) + return d.ReadInt64(schemas.AutoScalingSettingsDescription_MinimumUnits, v.MinimumUnits) + case schemas.AutoScalingSettingsDescription_ScalingPolicies: + return deserializeAutoScalingPolicyDescriptionList(d, schemas.AutoScalingSettingsDescription_ScalingPolicies, &v.ScalingPolicies) + } + return nil + }) +} + // Represents the auto scaling settings to be modified for a global table or // global secondary index. type AutoScalingSettingsUpdate struct { @@ -358,6 +618,54 @@ type AutoScalingSettingsUpdate struct { noSmithyDocumentSerde } +func (v *AutoScalingSettingsUpdate) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.AutoScalingSettingsUpdate) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *AutoScalingSettingsUpdate) SerializeMembers(s smithy.ShapeSerializer) { + if v.AutoScalingDisabled != nil { + s.WriteBool(schemas.AutoScalingSettingsUpdate_AutoScalingDisabled, *v.AutoScalingDisabled) + } + if v.AutoScalingRoleArn != nil { + s.WriteString(schemas.AutoScalingSettingsUpdate_AutoScalingRoleArn, *v.AutoScalingRoleArn) + } + if v.MaximumUnits != nil { + s.WriteInt64(schemas.AutoScalingSettingsUpdate_MaximumUnits, *v.MaximumUnits) + } + if v.MinimumUnits != nil { + s.WriteInt64(schemas.AutoScalingSettingsUpdate_MinimumUnits, *v.MinimumUnits) + } + if v.ScalingPolicyUpdate != nil { + s.WriteStruct(schemas.AutoScalingSettingsUpdate_ScalingPolicyUpdate) + v.ScalingPolicyUpdate.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *AutoScalingSettingsUpdate) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.AutoScalingSettingsUpdate, func(s *smithy.Schema) error { + switch s { + case schemas.AutoScalingSettingsUpdate_AutoScalingDisabled: + v.AutoScalingDisabled = new(bool) + return d.ReadBool(schemas.AutoScalingSettingsUpdate_AutoScalingDisabled, v.AutoScalingDisabled) + case schemas.AutoScalingSettingsUpdate_AutoScalingRoleArn: + v.AutoScalingRoleArn = new(string) + return d.ReadString(schemas.AutoScalingSettingsUpdate_AutoScalingRoleArn, v.AutoScalingRoleArn) + case schemas.AutoScalingSettingsUpdate_MaximumUnits: + v.MaximumUnits = new(int64) + return d.ReadInt64(schemas.AutoScalingSettingsUpdate_MaximumUnits, v.MaximumUnits) + case schemas.AutoScalingSettingsUpdate_MinimumUnits: + v.MinimumUnits = new(int64) + return d.ReadInt64(schemas.AutoScalingSettingsUpdate_MinimumUnits, v.MinimumUnits) + case schemas.AutoScalingSettingsUpdate_ScalingPolicyUpdate: + v.ScalingPolicyUpdate = &AutoScalingPolicyUpdate{} + return v.ScalingPolicyUpdate.Deserialize(d) + } + return nil + }) +} + // Represents the properties of a target tracking scaling policy. type AutoScalingTargetTrackingScalingPolicyConfigurationDescription struct { @@ -392,6 +700,46 @@ type AutoScalingTargetTrackingScalingPolicyConfigurationDescription struct { noSmithyDocumentSerde } +func (v *AutoScalingTargetTrackingScalingPolicyConfigurationDescription) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.AutoScalingTargetTrackingScalingPolicyConfigurationDescription) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *AutoScalingTargetTrackingScalingPolicyConfigurationDescription) SerializeMembers(s smithy.ShapeSerializer) { + if v.DisableScaleIn != nil { + s.WriteBool(schemas.AutoScalingTargetTrackingScalingPolicyConfigurationDescription_DisableScaleIn, *v.DisableScaleIn) + } + if v.ScaleInCooldown != nil { + s.WriteInt32(schemas.AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleInCooldown, *v.ScaleInCooldown) + } + if v.ScaleOutCooldown != nil { + s.WriteInt32(schemas.AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleOutCooldown, *v.ScaleOutCooldown) + } + if v.TargetValue != nil { + s.WriteFloat64(schemas.AutoScalingTargetTrackingScalingPolicyConfigurationDescription_TargetValue, *v.TargetValue) + } +} +func (v *AutoScalingTargetTrackingScalingPolicyConfigurationDescription) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.AutoScalingTargetTrackingScalingPolicyConfigurationDescription, func(s *smithy.Schema) error { + switch s { + case schemas.AutoScalingTargetTrackingScalingPolicyConfigurationDescription_DisableScaleIn: + v.DisableScaleIn = new(bool) + return d.ReadBool(schemas.AutoScalingTargetTrackingScalingPolicyConfigurationDescription_DisableScaleIn, v.DisableScaleIn) + case schemas.AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleInCooldown: + v.ScaleInCooldown = new(int32) + return d.ReadInt32(schemas.AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleInCooldown, v.ScaleInCooldown) + case schemas.AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleOutCooldown: + v.ScaleOutCooldown = new(int32) + return d.ReadInt32(schemas.AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleOutCooldown, v.ScaleOutCooldown) + case schemas.AutoScalingTargetTrackingScalingPolicyConfigurationDescription_TargetValue: + v.TargetValue = new(float64) + return d.ReadFloat64(schemas.AutoScalingTargetTrackingScalingPolicyConfigurationDescription_TargetValue, v.TargetValue) + } + return nil + }) +} + // Represents the settings of a target tracking scaling policy that will be // modified. type AutoScalingTargetTrackingScalingPolicyConfigurationUpdate struct { @@ -427,6 +775,46 @@ type AutoScalingTargetTrackingScalingPolicyConfigurationUpdate struct { noSmithyDocumentSerde } +func (v *AutoScalingTargetTrackingScalingPolicyConfigurationUpdate) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *AutoScalingTargetTrackingScalingPolicyConfigurationUpdate) SerializeMembers(s smithy.ShapeSerializer) { + if v.DisableScaleIn != nil { + s.WriteBool(schemas.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_DisableScaleIn, *v.DisableScaleIn) + } + if v.ScaleInCooldown != nil { + s.WriteInt32(schemas.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleInCooldown, *v.ScaleInCooldown) + } + if v.ScaleOutCooldown != nil { + s.WriteInt32(schemas.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleOutCooldown, *v.ScaleOutCooldown) + } + if v.TargetValue != nil { + s.WriteFloat64(schemas.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_TargetValue, *v.TargetValue) + } +} +func (v *AutoScalingTargetTrackingScalingPolicyConfigurationUpdate) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate, func(s *smithy.Schema) error { + switch s { + case schemas.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_DisableScaleIn: + v.DisableScaleIn = new(bool) + return d.ReadBool(schemas.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_DisableScaleIn, v.DisableScaleIn) + case schemas.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleInCooldown: + v.ScaleInCooldown = new(int32) + return d.ReadInt32(schemas.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleInCooldown, v.ScaleInCooldown) + case schemas.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleOutCooldown: + v.ScaleOutCooldown = new(int32) + return d.ReadInt32(schemas.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleOutCooldown, v.ScaleOutCooldown) + case schemas.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_TargetValue: + v.TargetValue = new(float64) + return d.ReadFloat64(schemas.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_TargetValue, v.TargetValue) + } + return nil + }) +} + // Contains the description of the backup created for the table. type BackupDescription struct { @@ -443,6 +831,46 @@ type BackupDescription struct { noSmithyDocumentSerde } +func (v *BackupDescription) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.BackupDescription) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *BackupDescription) SerializeMembers(s smithy.ShapeSerializer) { + if v.BackupDetails != nil { + s.WriteStruct(schemas.BackupDescription_BackupDetails) + v.BackupDetails.SerializeMembers(s) + s.CloseStruct() + } + if v.SourceTableDetails != nil { + s.WriteStruct(schemas.BackupDescription_SourceTableDetails) + v.SourceTableDetails.SerializeMembers(s) + s.CloseStruct() + } + if v.SourceTableFeatureDetails != nil { + s.WriteStruct(schemas.BackupDescription_SourceTableFeatureDetails) + v.SourceTableFeatureDetails.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *BackupDescription) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.BackupDescription, func(s *smithy.Schema) error { + switch s { + case schemas.BackupDescription_BackupDetails: + v.BackupDetails = &BackupDetails{} + return v.BackupDetails.Deserialize(d) + case schemas.BackupDescription_SourceTableDetails: + v.SourceTableDetails = &SourceTableDetails{} + return v.SourceTableDetails.Deserialize(d) + case schemas.BackupDescription_SourceTableFeatureDetails: + v.SourceTableFeatureDetails = &SourceTableFeatureDetails{} + return v.SourceTableFeatureDetails.Deserialize(d) + } + return nil + }) +} + // Contains the details of the backup created for the table. type BackupDetails struct { @@ -491,6 +919,72 @@ type BackupDetails struct { noSmithyDocumentSerde } +func (v *BackupDetails) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.BackupDetails) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *BackupDetails) SerializeMembers(s smithy.ShapeSerializer) { + if v.BackupArn != nil { + s.WriteString(schemas.BackupDetails_BackupArn, *v.BackupArn) + } + if v.BackupCreationDateTime != nil { + s.WriteTime(schemas.BackupDetails_BackupCreationDateTime, *v.BackupCreationDateTime) + } + if v.BackupExpiryDateTime != nil { + s.WriteTime(schemas.BackupDetails_BackupExpiryDateTime, *v.BackupExpiryDateTime) + } + if v.BackupName != nil { + s.WriteString(schemas.BackupDetails_BackupName, *v.BackupName) + } + if v.BackupSizeBytes != nil { + s.WriteInt64(schemas.BackupDetails_BackupSizeBytes, *v.BackupSizeBytes) + } + if v.BackupStatus != "" { + s.WriteString(schemas.BackupDetails_BackupStatus, string(v.BackupStatus)) + } + if v.BackupType != "" { + s.WriteString(schemas.BackupDetails_BackupType, string(v.BackupType)) + } +} +func (v *BackupDetails) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.BackupDetails, func(s *smithy.Schema) error { + switch s { + case schemas.BackupDetails_BackupArn: + v.BackupArn = new(string) + return d.ReadString(schemas.BackupDetails_BackupArn, v.BackupArn) + case schemas.BackupDetails_BackupCreationDateTime: + v.BackupCreationDateTime = new(time.Time) + return d.ReadTime(schemas.BackupDetails_BackupCreationDateTime, v.BackupCreationDateTime) + case schemas.BackupDetails_BackupExpiryDateTime: + v.BackupExpiryDateTime = new(time.Time) + return d.ReadTime(schemas.BackupDetails_BackupExpiryDateTime, v.BackupExpiryDateTime) + case schemas.BackupDetails_BackupName: + v.BackupName = new(string) + return d.ReadString(schemas.BackupDetails_BackupName, v.BackupName) + case schemas.BackupDetails_BackupSizeBytes: + v.BackupSizeBytes = new(int64) + return d.ReadInt64(schemas.BackupDetails_BackupSizeBytes, v.BackupSizeBytes) + case schemas.BackupDetails_BackupStatus: + var ev string + if err := d.ReadString(schemas.BackupDetails_BackupStatus, &ev); err != nil { + return err + } + v.BackupStatus = BackupStatus(ev) + return nil + case schemas.BackupDetails_BackupType: + var ev string + if err := d.ReadString(schemas.BackupDetails_BackupType, &ev); err != nil { + return err + } + v.BackupType = BackupType(ev) + return nil + } + return nil + }) +} + // Contains details for the backup. type BackupSummary struct { @@ -537,6 +1031,90 @@ type BackupSummary struct { noSmithyDocumentSerde } +func (v *BackupSummary) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.BackupSummary) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *BackupSummary) SerializeMembers(s smithy.ShapeSerializer) { + if v.BackupArn != nil { + s.WriteString(schemas.BackupSummary_BackupArn, *v.BackupArn) + } + if v.BackupCreationDateTime != nil { + s.WriteTime(schemas.BackupSummary_BackupCreationDateTime, *v.BackupCreationDateTime) + } + if v.BackupExpiryDateTime != nil { + s.WriteTime(schemas.BackupSummary_BackupExpiryDateTime, *v.BackupExpiryDateTime) + } + if v.BackupName != nil { + s.WriteString(schemas.BackupSummary_BackupName, *v.BackupName) + } + if v.BackupSizeBytes != nil { + s.WriteInt64(schemas.BackupSummary_BackupSizeBytes, *v.BackupSizeBytes) + } + if v.BackupStatus != "" { + s.WriteString(schemas.BackupSummary_BackupStatus, string(v.BackupStatus)) + } + if v.BackupType != "" { + s.WriteString(schemas.BackupSummary_BackupType, string(v.BackupType)) + } + if v.TableArn != nil { + s.WriteString(schemas.BackupSummary_TableArn, *v.TableArn) + } + if v.TableId != nil { + s.WriteString(schemas.BackupSummary_TableId, *v.TableId) + } + if v.TableName != nil { + s.WriteString(schemas.BackupSummary_TableName, *v.TableName) + } +} +func (v *BackupSummary) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.BackupSummary, func(s *smithy.Schema) error { + switch s { + case schemas.BackupSummary_BackupArn: + v.BackupArn = new(string) + return d.ReadString(schemas.BackupSummary_BackupArn, v.BackupArn) + case schemas.BackupSummary_BackupCreationDateTime: + v.BackupCreationDateTime = new(time.Time) + return d.ReadTime(schemas.BackupSummary_BackupCreationDateTime, v.BackupCreationDateTime) + case schemas.BackupSummary_BackupExpiryDateTime: + v.BackupExpiryDateTime = new(time.Time) + return d.ReadTime(schemas.BackupSummary_BackupExpiryDateTime, v.BackupExpiryDateTime) + case schemas.BackupSummary_BackupName: + v.BackupName = new(string) + return d.ReadString(schemas.BackupSummary_BackupName, v.BackupName) + case schemas.BackupSummary_BackupSizeBytes: + v.BackupSizeBytes = new(int64) + return d.ReadInt64(schemas.BackupSummary_BackupSizeBytes, v.BackupSizeBytes) + case schemas.BackupSummary_BackupStatus: + var ev string + if err := d.ReadString(schemas.BackupSummary_BackupStatus, &ev); err != nil { + return err + } + v.BackupStatus = BackupStatus(ev) + return nil + case schemas.BackupSummary_BackupType: + var ev string + if err := d.ReadString(schemas.BackupSummary_BackupType, &ev); err != nil { + return err + } + v.BackupType = BackupType(ev) + return nil + case schemas.BackupSummary_TableArn: + v.TableArn = new(string) + return d.ReadString(schemas.BackupSummary_TableArn, v.TableArn) + case schemas.BackupSummary_TableId: + v.TableId = new(string) + return d.ReadString(schemas.BackupSummary_TableId, v.TableId) + case schemas.BackupSummary_TableName: + v.TableName = new(string) + return d.ReadString(schemas.BackupSummary_TableName, v.TableName) + } + return nil + }) +} + // An error associated with a statement in a PartiQL batch that was run. type BatchStatementError struct { @@ -553,6 +1131,41 @@ type BatchStatementError struct { noSmithyDocumentSerde } +func (v *BatchStatementError) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.BatchStatementError) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *BatchStatementError) SerializeMembers(s smithy.ShapeSerializer) { + if v.Code != "" { + s.WriteString(schemas.BatchStatementError_Code, string(v.Code)) + } + serializeAttributeMap(s, schemas.BatchStatementError_Item, v.Item) + if v.Message != nil { + s.WriteString(schemas.BatchStatementError_Message, *v.Message) + } +} +func (v *BatchStatementError) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.BatchStatementError, func(s *smithy.Schema) error { + switch s { + case schemas.BatchStatementError_Code: + var ev string + if err := d.ReadString(schemas.BatchStatementError_Code, &ev); err != nil { + return err + } + v.Code = BatchStatementErrorCodeEnum(ev) + return nil + case schemas.BatchStatementError_Item: + return deserializeAttributeMap(d, schemas.BatchStatementError_Item, &v.Item) + case schemas.BatchStatementError_Message: + v.Message = new(string) + return d.ReadString(schemas.BatchStatementError_Message, v.Message) + } + return nil + }) +} + // A PartiQL batch statement request. type BatchStatementRequest struct { @@ -578,6 +1191,47 @@ type BatchStatementRequest struct { noSmithyDocumentSerde } +func (v *BatchStatementRequest) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.BatchStatementRequest) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *BatchStatementRequest) SerializeMembers(s smithy.ShapeSerializer) { + if v.ConsistentRead != nil { + s.WriteBool(schemas.BatchStatementRequest_ConsistentRead, *v.ConsistentRead) + } + serializePreparedStatementParameters(s, schemas.BatchStatementRequest_Parameters, v.Parameters) + if v.ReturnValuesOnConditionCheckFailure != "" { + s.WriteString(schemas.BatchStatementRequest_ReturnValuesOnConditionCheckFailure, string(v.ReturnValuesOnConditionCheckFailure)) + } + if v.Statement != nil { + s.WriteString(schemas.BatchStatementRequest_Statement, *v.Statement) + } +} +func (v *BatchStatementRequest) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.BatchStatementRequest, func(s *smithy.Schema) error { + switch s { + case schemas.BatchStatementRequest_ConsistentRead: + v.ConsistentRead = new(bool) + return d.ReadBool(schemas.BatchStatementRequest_ConsistentRead, v.ConsistentRead) + case schemas.BatchStatementRequest_Parameters: + return deserializePreparedStatementParameters(d, schemas.BatchStatementRequest_Parameters, &v.Parameters) + case schemas.BatchStatementRequest_ReturnValuesOnConditionCheckFailure: + var ev string + if err := d.ReadString(schemas.BatchStatementRequest_ReturnValuesOnConditionCheckFailure, &ev); err != nil { + return err + } + v.ReturnValuesOnConditionCheckFailure = ReturnValuesOnConditionCheckFailure(ev) + return nil + case schemas.BatchStatementRequest_Statement: + v.Statement = new(string) + return d.ReadString(schemas.BatchStatementRequest_Statement, v.Statement) + } + return nil + }) +} + // A PartiQL batch statement response.. type BatchStatementResponse struct { @@ -593,6 +1247,39 @@ type BatchStatementResponse struct { noSmithyDocumentSerde } +func (v *BatchStatementResponse) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.BatchStatementResponse) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *BatchStatementResponse) SerializeMembers(s smithy.ShapeSerializer) { + if v.Error != nil { + s.WriteStruct(schemas.BatchStatementResponse_Error) + v.Error.SerializeMembers(s) + s.CloseStruct() + } + serializeAttributeMap(s, schemas.BatchStatementResponse_Item, v.Item) + if v.TableName != nil { + s.WriteString(schemas.BatchStatementResponse_TableName, *v.TableName) + } +} +func (v *BatchStatementResponse) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.BatchStatementResponse, func(s *smithy.Schema) error { + switch s { + case schemas.BatchStatementResponse_Error: + v.Error = &BatchStatementError{} + return v.Error.Deserialize(d) + case schemas.BatchStatementResponse_Item: + return deserializeAttributeMap(d, schemas.BatchStatementResponse_Item, &v.Item) + case schemas.BatchStatementResponse_TableName: + v.TableName = new(string) + return d.ReadString(schemas.BatchStatementResponse_TableName, v.TableName) + } + return nil + }) +} + // Contains the details for the read/write capacity mode. This page talks about // PROVISIONED and PAY_PER_REQUEST billing modes. For more information about these // modes, see [Read/write capacity mode]. @@ -620,6 +1307,38 @@ type BillingModeSummary struct { noSmithyDocumentSerde } +func (v *BillingModeSummary) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.BillingModeSummary) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *BillingModeSummary) SerializeMembers(s smithy.ShapeSerializer) { + if v.BillingMode != "" { + s.WriteString(schemas.BillingModeSummary_BillingMode, string(v.BillingMode)) + } + if v.LastUpdateToPayPerRequestDateTime != nil { + s.WriteTime(schemas.BillingModeSummary_LastUpdateToPayPerRequestDateTime, *v.LastUpdateToPayPerRequestDateTime) + } +} +func (v *BillingModeSummary) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.BillingModeSummary, func(s *smithy.Schema) error { + switch s { + case schemas.BillingModeSummary_BillingMode: + var ev string + if err := d.ReadString(schemas.BillingModeSummary_BillingMode, &ev); err != nil { + return err + } + v.BillingMode = BillingMode(ev) + return nil + case schemas.BillingModeSummary_LastUpdateToPayPerRequestDateTime: + v.LastUpdateToPayPerRequestDateTime = new(time.Time) + return d.ReadTime(schemas.BillingModeSummary_LastUpdateToPayPerRequestDateTime, v.LastUpdateToPayPerRequestDateTime) + } + return nil + }) +} + // An ordered list of errors for each item in the request which caused the // transaction to get cancelled. The values of the list are ordered according to // the ordering of the TransactWriteItems request parameter. If no error occurred @@ -639,6 +1358,37 @@ type CancellationReason struct { noSmithyDocumentSerde } +func (v *CancellationReason) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.CancellationReason) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *CancellationReason) SerializeMembers(s smithy.ShapeSerializer) { + if v.Code != nil { + s.WriteString(schemas.CancellationReason_Code, *v.Code) + } + serializeAttributeMap(s, schemas.CancellationReason_Item, v.Item) + if v.Message != nil { + s.WriteString(schemas.CancellationReason_Message, *v.Message) + } +} +func (v *CancellationReason) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.CancellationReason, func(s *smithy.Schema) error { + switch s { + case schemas.CancellationReason_Code: + v.Code = new(string) + return d.ReadString(schemas.CancellationReason_Code, v.Code) + case schemas.CancellationReason_Item: + return deserializeAttributeMap(d, schemas.CancellationReason_Item, &v.Item) + case schemas.CancellationReason_Message: + v.Message = new(string) + return d.ReadString(schemas.CancellationReason_Message, v.Message) + } + return nil + }) +} + // Represents the amount of provisioned throughput capacity consumed on a table or // an index. type Capacity struct { @@ -655,6 +1405,40 @@ type Capacity struct { noSmithyDocumentSerde } +func (v *Capacity) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.Capacity) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *Capacity) SerializeMembers(s smithy.ShapeSerializer) { + if v.CapacityUnits != nil { + s.WriteFloat64(schemas.Capacity_CapacityUnits, *v.CapacityUnits) + } + if v.ReadCapacityUnits != nil { + s.WriteFloat64(schemas.Capacity_ReadCapacityUnits, *v.ReadCapacityUnits) + } + if v.WriteCapacityUnits != nil { + s.WriteFloat64(schemas.Capacity_WriteCapacityUnits, *v.WriteCapacityUnits) + } +} +func (v *Capacity) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.Capacity, func(s *smithy.Schema) error { + switch s { + case schemas.Capacity_CapacityUnits: + v.CapacityUnits = new(float64) + return d.ReadFloat64(schemas.Capacity_CapacityUnits, v.CapacityUnits) + case schemas.Capacity_ReadCapacityUnits: + v.ReadCapacityUnits = new(float64) + return d.ReadFloat64(schemas.Capacity_ReadCapacityUnits, v.ReadCapacityUnits) + case schemas.Capacity_WriteCapacityUnits: + v.WriteCapacityUnits = new(float64) + return d.ReadFloat64(schemas.Capacity_WriteCapacityUnits, v.WriteCapacityUnits) + } + return nil + }) +} + // Represents the selection criteria for a Query or Scan operation: // // - For a Query operation, Condition is used for specifying the KeyConditions to @@ -823,6 +1607,35 @@ type Condition struct { noSmithyDocumentSerde } +func (v *Condition) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.Condition) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *Condition) SerializeMembers(s smithy.ShapeSerializer) { + serializeAttributeValueList(s, schemas.Condition_AttributeValueList, v.AttributeValueList) + if v.ComparisonOperator != "" { + s.WriteString(schemas.Condition_ComparisonOperator, string(v.ComparisonOperator)) + } +} +func (v *Condition) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.Condition, func(s *smithy.Schema) error { + switch s { + case schemas.Condition_AttributeValueList: + return deserializeAttributeValueList(d, schemas.Condition_AttributeValueList, &v.AttributeValueList) + case schemas.Condition_ComparisonOperator: + var ev string + if err := d.ReadString(schemas.Condition_ComparisonOperator, &ev); err != nil { + return err + } + v.ComparisonOperator = ComparisonOperator(ev) + return nil + } + return nil + }) +} + // Represents a request to perform a check that an item exists or to check the // condition of specific attributes of the item. type ConditionCheck struct { @@ -867,6 +1680,53 @@ type ConditionCheck struct { noSmithyDocumentSerde } +func (v *ConditionCheck) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ConditionCheck) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ConditionCheck) SerializeMembers(s smithy.ShapeSerializer) { + if v.ConditionExpression != nil { + s.WriteString(schemas.ConditionCheck_ConditionExpression, *v.ConditionExpression) + } + serializeExpressionAttributeNameMap(s, schemas.ConditionCheck_ExpressionAttributeNames, v.ExpressionAttributeNames) + serializeExpressionAttributeValueMap(s, schemas.ConditionCheck_ExpressionAttributeValues, v.ExpressionAttributeValues) + serializeKey(s, schemas.ConditionCheck_Key, v.Key) + if v.ReturnValuesOnConditionCheckFailure != "" { + s.WriteString(schemas.ConditionCheck_ReturnValuesOnConditionCheckFailure, string(v.ReturnValuesOnConditionCheckFailure)) + } + if v.TableName != nil { + s.WriteString(schemas.ConditionCheck_TableName, *v.TableName) + } +} +func (v *ConditionCheck) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ConditionCheck, func(s *smithy.Schema) error { + switch s { + case schemas.ConditionCheck_ConditionExpression: + v.ConditionExpression = new(string) + return d.ReadString(schemas.ConditionCheck_ConditionExpression, v.ConditionExpression) + case schemas.ConditionCheck_ExpressionAttributeNames: + return deserializeExpressionAttributeNameMap(d, schemas.ConditionCheck_ExpressionAttributeNames, &v.ExpressionAttributeNames) + case schemas.ConditionCheck_ExpressionAttributeValues: + return deserializeExpressionAttributeValueMap(d, schemas.ConditionCheck_ExpressionAttributeValues, &v.ExpressionAttributeValues) + case schemas.ConditionCheck_Key: + return deserializeKey(d, schemas.ConditionCheck_Key, &v.Key) + case schemas.ConditionCheck_ReturnValuesOnConditionCheckFailure: + var ev string + if err := d.ReadString(schemas.ConditionCheck_ReturnValuesOnConditionCheckFailure, &ev); err != nil { + return err + } + v.ReturnValuesOnConditionCheckFailure = ReturnValuesOnConditionCheckFailure(ev) + return nil + case schemas.ConditionCheck_TableName: + v.TableName = new(string) + return d.ReadString(schemas.ConditionCheck_TableName, v.TableName) + } + return nil + }) +} + // The capacity units consumed by an operation. The data returned includes the // total provisioned throughput consumed, along with statistics for the table and // any indexes involved in the operation. ConsumedCapacity is only returned if the @@ -897,12 +1757,74 @@ type ConsumedCapacity struct { // in the response. TableName *string + // The amount of throughput consumed on each vector index affected by the + // operation. Each entry contains VectorWriteRequestBytes (for write operations) + // or VectorSearchRequestBytes (for search operations). + VectorIndexes map[string]VectorCapacity + // The total number of write capacity units consumed by the operation. WriteCapacityUnits *float64 noSmithyDocumentSerde } +func (v *ConsumedCapacity) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ConsumedCapacity) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ConsumedCapacity) SerializeMembers(s smithy.ShapeSerializer) { + if v.CapacityUnits != nil { + s.WriteFloat64(schemas.ConsumedCapacity_CapacityUnits, *v.CapacityUnits) + } + serializeSecondaryIndexesCapacityMap(s, schemas.ConsumedCapacity_GlobalSecondaryIndexes, v.GlobalSecondaryIndexes) + serializeSecondaryIndexesCapacityMap(s, schemas.ConsumedCapacity_LocalSecondaryIndexes, v.LocalSecondaryIndexes) + if v.ReadCapacityUnits != nil { + s.WriteFloat64(schemas.ConsumedCapacity_ReadCapacityUnits, *v.ReadCapacityUnits) + } + if v.Table != nil { + s.WriteStruct(schemas.ConsumedCapacity_Table) + v.Table.SerializeMembers(s) + s.CloseStruct() + } + if v.TableName != nil { + s.WriteString(schemas.ConsumedCapacity_TableName, *v.TableName) + } + serializeVectorIndexesCapacityMap(s, schemas.ConsumedCapacity_VectorIndexes, v.VectorIndexes) + if v.WriteCapacityUnits != nil { + s.WriteFloat64(schemas.ConsumedCapacity_WriteCapacityUnits, *v.WriteCapacityUnits) + } +} +func (v *ConsumedCapacity) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ConsumedCapacity, func(s *smithy.Schema) error { + switch s { + case schemas.ConsumedCapacity_CapacityUnits: + v.CapacityUnits = new(float64) + return d.ReadFloat64(schemas.ConsumedCapacity_CapacityUnits, v.CapacityUnits) + case schemas.ConsumedCapacity_GlobalSecondaryIndexes: + return deserializeSecondaryIndexesCapacityMap(d, schemas.ConsumedCapacity_GlobalSecondaryIndexes, &v.GlobalSecondaryIndexes) + case schemas.ConsumedCapacity_LocalSecondaryIndexes: + return deserializeSecondaryIndexesCapacityMap(d, schemas.ConsumedCapacity_LocalSecondaryIndexes, &v.LocalSecondaryIndexes) + case schemas.ConsumedCapacity_ReadCapacityUnits: + v.ReadCapacityUnits = new(float64) + return d.ReadFloat64(schemas.ConsumedCapacity_ReadCapacityUnits, v.ReadCapacityUnits) + case schemas.ConsumedCapacity_Table: + v.Table = &Capacity{} + return v.Table.Deserialize(d) + case schemas.ConsumedCapacity_TableName: + v.TableName = new(string) + return d.ReadString(schemas.ConsumedCapacity_TableName, v.TableName) + case schemas.ConsumedCapacity_VectorIndexes: + return deserializeVectorIndexesCapacityMap(d, schemas.ConsumedCapacity_VectorIndexes, &v.VectorIndexes) + case schemas.ConsumedCapacity_WriteCapacityUnits: + v.WriteCapacityUnits = new(float64) + return d.ReadFloat64(schemas.ConsumedCapacity_WriteCapacityUnits, v.WriteCapacityUnits) + } + return nil + }) +} + // Represents the continuous backups and point in time recovery settings on the // table. type ContinuousBackupsDescription struct { @@ -918,6 +1840,40 @@ type ContinuousBackupsDescription struct { noSmithyDocumentSerde } +func (v *ContinuousBackupsDescription) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ContinuousBackupsDescription) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ContinuousBackupsDescription) SerializeMembers(s smithy.ShapeSerializer) { + if v.ContinuousBackupsStatus != "" { + s.WriteString(schemas.ContinuousBackupsDescription_ContinuousBackupsStatus, string(v.ContinuousBackupsStatus)) + } + if v.PointInTimeRecoveryDescription != nil { + s.WriteStruct(schemas.ContinuousBackupsDescription_PointInTimeRecoveryDescription) + v.PointInTimeRecoveryDescription.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *ContinuousBackupsDescription) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ContinuousBackupsDescription, func(s *smithy.Schema) error { + switch s { + case schemas.ContinuousBackupsDescription_ContinuousBackupsStatus: + var ev string + if err := d.ReadString(schemas.ContinuousBackupsDescription_ContinuousBackupsStatus, &ev); err != nil { + return err + } + v.ContinuousBackupsStatus = ContinuousBackupsStatus(ev) + return nil + case schemas.ContinuousBackupsDescription_PointInTimeRecoveryDescription: + v.PointInTimeRecoveryDescription = &PointInTimeRecoveryDescription{} + return v.PointInTimeRecoveryDescription.Deserialize(d) + } + return nil + }) +} + // Represents a Contributor Insights summary entry. type ContributorInsightsSummary struct { @@ -939,6 +1895,54 @@ type ContributorInsightsSummary struct { noSmithyDocumentSerde } +func (v *ContributorInsightsSummary) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ContributorInsightsSummary) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ContributorInsightsSummary) SerializeMembers(s smithy.ShapeSerializer) { + if v.ContributorInsightsMode != "" { + s.WriteString(schemas.ContributorInsightsSummary_ContributorInsightsMode, string(v.ContributorInsightsMode)) + } + if v.ContributorInsightsStatus != "" { + s.WriteString(schemas.ContributorInsightsSummary_ContributorInsightsStatus, string(v.ContributorInsightsStatus)) + } + if v.IndexName != nil { + s.WriteString(schemas.ContributorInsightsSummary_IndexName, *v.IndexName) + } + if v.TableName != nil { + s.WriteString(schemas.ContributorInsightsSummary_TableName, *v.TableName) + } +} +func (v *ContributorInsightsSummary) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ContributorInsightsSummary, func(s *smithy.Schema) error { + switch s { + case schemas.ContributorInsightsSummary_ContributorInsightsMode: + var ev string + if err := d.ReadString(schemas.ContributorInsightsSummary_ContributorInsightsMode, &ev); err != nil { + return err + } + v.ContributorInsightsMode = ContributorInsightsMode(ev) + return nil + case schemas.ContributorInsightsSummary_ContributorInsightsStatus: + var ev string + if err := d.ReadString(schemas.ContributorInsightsSummary_ContributorInsightsStatus, &ev); err != nil { + return err + } + v.ContributorInsightsStatus = ContributorInsightsStatus(ev) + return nil + case schemas.ContributorInsightsSummary_IndexName: + v.IndexName = new(string) + return d.ReadString(schemas.ContributorInsightsSummary_IndexName, v.IndexName) + case schemas.ContributorInsightsSummary_TableName: + v.TableName = new(string) + return d.ReadString(schemas.ContributorInsightsSummary_TableName, v.TableName) + } + return nil + }) +} + // Represents a new global secondary index to be added to an existing table. type CreateGlobalSecondaryIndexAction struct { @@ -982,6 +1986,63 @@ type CreateGlobalSecondaryIndexAction struct { noSmithyDocumentSerde } +func (v *CreateGlobalSecondaryIndexAction) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.CreateGlobalSecondaryIndexAction) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *CreateGlobalSecondaryIndexAction) SerializeMembers(s smithy.ShapeSerializer) { + if v.IndexName != nil { + s.WriteString(schemas.CreateGlobalSecondaryIndexAction_IndexName, *v.IndexName) + } + serializeKeySchema(s, schemas.CreateGlobalSecondaryIndexAction_KeySchema, v.KeySchema) + if v.OnDemandThroughput != nil { + s.WriteStruct(schemas.CreateGlobalSecondaryIndexAction_OnDemandThroughput) + v.OnDemandThroughput.SerializeMembers(s) + s.CloseStruct() + } + if v.Projection != nil { + s.WriteStruct(schemas.CreateGlobalSecondaryIndexAction_Projection) + v.Projection.SerializeMembers(s) + s.CloseStruct() + } + if v.ProvisionedThroughput != nil { + s.WriteStruct(schemas.CreateGlobalSecondaryIndexAction_ProvisionedThroughput) + v.ProvisionedThroughput.SerializeMembers(s) + s.CloseStruct() + } + if v.WarmThroughput != nil { + s.WriteStruct(schemas.CreateGlobalSecondaryIndexAction_WarmThroughput) + v.WarmThroughput.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *CreateGlobalSecondaryIndexAction) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.CreateGlobalSecondaryIndexAction, func(s *smithy.Schema) error { + switch s { + case schemas.CreateGlobalSecondaryIndexAction_IndexName: + v.IndexName = new(string) + return d.ReadString(schemas.CreateGlobalSecondaryIndexAction_IndexName, v.IndexName) + case schemas.CreateGlobalSecondaryIndexAction_KeySchema: + return deserializeKeySchema(d, schemas.CreateGlobalSecondaryIndexAction_KeySchema, &v.KeySchema) + case schemas.CreateGlobalSecondaryIndexAction_OnDemandThroughput: + v.OnDemandThroughput = &OnDemandThroughput{} + return v.OnDemandThroughput.Deserialize(d) + case schemas.CreateGlobalSecondaryIndexAction_Projection: + v.Projection = &Projection{} + return v.Projection.Deserialize(d) + case schemas.CreateGlobalSecondaryIndexAction_ProvisionedThroughput: + v.ProvisionedThroughput = &ProvisionedThroughput{} + return v.ProvisionedThroughput.Deserialize(d) + case schemas.CreateGlobalSecondaryIndexAction_WarmThroughput: + v.WarmThroughput = &WarmThroughput{} + return v.WarmThroughput.Deserialize(d) + } + return nil + }) +} + // Specifies the action to add a new witness Region to a MRSC global table. A MRSC // global table can be configured with either three replicas, or with two replicas // and one witness. @@ -1005,6 +2066,28 @@ type CreateGlobalTableWitnessGroupMemberAction struct { noSmithyDocumentSerde } +func (v *CreateGlobalTableWitnessGroupMemberAction) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.CreateGlobalTableWitnessGroupMemberAction) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *CreateGlobalTableWitnessGroupMemberAction) SerializeMembers(s smithy.ShapeSerializer) { + if v.RegionName != nil { + s.WriteString(schemas.CreateGlobalTableWitnessGroupMemberAction_RegionName, *v.RegionName) + } +} +func (v *CreateGlobalTableWitnessGroupMemberAction) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.CreateGlobalTableWitnessGroupMemberAction, func(s *smithy.Schema) error { + switch s { + case schemas.CreateGlobalTableWitnessGroupMemberAction_RegionName: + v.RegionName = new(string) + return d.ReadString(schemas.CreateGlobalTableWitnessGroupMemberAction_RegionName, v.RegionName) + } + return nil + }) +} + // Represents a replica to be added. type CreateReplicaAction struct { @@ -1016,6 +2099,28 @@ type CreateReplicaAction struct { noSmithyDocumentSerde } +func (v *CreateReplicaAction) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.CreateReplicaAction) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *CreateReplicaAction) SerializeMembers(s smithy.ShapeSerializer) { + if v.RegionName != nil { + s.WriteString(schemas.CreateReplicaAction_RegionName, *v.RegionName) + } +} +func (v *CreateReplicaAction) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.CreateReplicaAction, func(s *smithy.Schema) error { + switch s { + case schemas.CreateReplicaAction_RegionName: + v.RegionName = new(string) + return d.ReadString(schemas.CreateReplicaAction_RegionName, v.RegionName) + } + return nil + }) +} + // Represents a replica to be created. type CreateReplicationGroupMemberAction struct { @@ -1049,6 +2154,157 @@ type CreateReplicationGroupMemberAction struct { noSmithyDocumentSerde } +func (v *CreateReplicationGroupMemberAction) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.CreateReplicationGroupMemberAction) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *CreateReplicationGroupMemberAction) SerializeMembers(s smithy.ShapeSerializer) { + serializeReplicaGlobalSecondaryIndexList(s, schemas.CreateReplicationGroupMemberAction_GlobalSecondaryIndexes, v.GlobalSecondaryIndexes) + if v.KMSMasterKeyId != nil { + s.WriteString(schemas.CreateReplicationGroupMemberAction_KMSMasterKeyId, *v.KMSMasterKeyId) + } + if v.OnDemandThroughputOverride != nil { + s.WriteStruct(schemas.CreateReplicationGroupMemberAction_OnDemandThroughputOverride) + v.OnDemandThroughputOverride.SerializeMembers(s) + s.CloseStruct() + } + if v.ProvisionedThroughputOverride != nil { + s.WriteStruct(schemas.CreateReplicationGroupMemberAction_ProvisionedThroughputOverride) + v.ProvisionedThroughputOverride.SerializeMembers(s) + s.CloseStruct() + } + if v.RegionName != nil { + s.WriteString(schemas.CreateReplicationGroupMemberAction_RegionName, *v.RegionName) + } + if v.TableClassOverride != "" { + s.WriteString(schemas.CreateReplicationGroupMemberAction_TableClassOverride, string(v.TableClassOverride)) + } +} +func (v *CreateReplicationGroupMemberAction) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.CreateReplicationGroupMemberAction, func(s *smithy.Schema) error { + switch s { + case schemas.CreateReplicationGroupMemberAction_GlobalSecondaryIndexes: + return deserializeReplicaGlobalSecondaryIndexList(d, schemas.CreateReplicationGroupMemberAction_GlobalSecondaryIndexes, &v.GlobalSecondaryIndexes) + case schemas.CreateReplicationGroupMemberAction_KMSMasterKeyId: + v.KMSMasterKeyId = new(string) + return d.ReadString(schemas.CreateReplicationGroupMemberAction_KMSMasterKeyId, v.KMSMasterKeyId) + case schemas.CreateReplicationGroupMemberAction_OnDemandThroughputOverride: + v.OnDemandThroughputOverride = &OnDemandThroughputOverride{} + return v.OnDemandThroughputOverride.Deserialize(d) + case schemas.CreateReplicationGroupMemberAction_ProvisionedThroughputOverride: + v.ProvisionedThroughputOverride = &ProvisionedThroughputOverride{} + return v.ProvisionedThroughputOverride.Deserialize(d) + case schemas.CreateReplicationGroupMemberAction_RegionName: + v.RegionName = new(string) + return d.ReadString(schemas.CreateReplicationGroupMemberAction_RegionName, v.RegionName) + case schemas.CreateReplicationGroupMemberAction_TableClassOverride: + var ev string + if err := d.ReadString(schemas.CreateReplicationGroupMemberAction_TableClassOverride, &ev); err != nil { + return err + } + v.TableClassOverride = TableClass(ev) + return nil + } + return nil + }) +} + +// A new vector index to be added to a table. +type CreateVectorIndexAction struct { + + // The number of dimensions in each vector. + // + // This member is required. + Dimensions *int64 + + // The distance function used to calculate similarity. Valid values: COSINE , + // EUCLIDEAN , DOT_PRODUCT . + // + // This member is required. + DistanceFunction VectorDistanceFunction + + // The name of the vector index. Must be unique within the table. + // + // This member is required. + IndexName *string + + // Specifies attributes that are copied (projected) from the table into the vector + // index. + // + // This member is required. + Projection *Projection + + // The attribute that contains vector embeddings. If multiple vector indexes + // reference the same attribute, they must all use the same number of dimensions. + // + // This member is required. + VectorAttribute *VectorAttributeDefinition + + // The partition key and inline filter attribute definitions for the vector index. + SearchSchema []SearchSchemaElement + + noSmithyDocumentSerde +} + +func (v *CreateVectorIndexAction) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.CreateVectorIndexAction) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *CreateVectorIndexAction) SerializeMembers(s smithy.ShapeSerializer) { + if v.Dimensions != nil { + s.WriteInt64(schemas.CreateVectorIndexAction_Dimensions, *v.Dimensions) + } + if v.DistanceFunction != "" { + s.WriteString(schemas.CreateVectorIndexAction_DistanceFunction, string(v.DistanceFunction)) + } + if v.IndexName != nil { + s.WriteString(schemas.CreateVectorIndexAction_IndexName, *v.IndexName) + } + if v.Projection != nil { + s.WriteStruct(schemas.CreateVectorIndexAction_Projection) + v.Projection.SerializeMembers(s) + s.CloseStruct() + } + serializeSearchSchema(s, schemas.CreateVectorIndexAction_SearchSchema, v.SearchSchema) + if v.VectorAttribute != nil { + s.WriteStruct(schemas.CreateVectorIndexAction_VectorAttribute) + v.VectorAttribute.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *CreateVectorIndexAction) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.CreateVectorIndexAction, func(s *smithy.Schema) error { + switch s { + case schemas.CreateVectorIndexAction_Dimensions: + v.Dimensions = new(int64) + return d.ReadInt64(schemas.CreateVectorIndexAction_Dimensions, v.Dimensions) + case schemas.CreateVectorIndexAction_DistanceFunction: + var ev string + if err := d.ReadString(schemas.CreateVectorIndexAction_DistanceFunction, &ev); err != nil { + return err + } + v.DistanceFunction = VectorDistanceFunction(ev) + return nil + case schemas.CreateVectorIndexAction_IndexName: + v.IndexName = new(string) + return d.ReadString(schemas.CreateVectorIndexAction_IndexName, v.IndexName) + case schemas.CreateVectorIndexAction_Projection: + v.Projection = &Projection{} + return v.Projection.Deserialize(d) + case schemas.CreateVectorIndexAction_SearchSchema: + return deserializeSearchSchema(d, schemas.CreateVectorIndexAction_SearchSchema, &v.SearchSchema) + case schemas.CreateVectorIndexAction_VectorAttribute: + v.VectorAttribute = &VectorAttributeDefinition{} + return v.VectorAttribute.Deserialize(d) + } + return nil + }) +} + // Processing options for the CSV file being imported. type CsvOptions struct { @@ -1064,6 +2320,31 @@ type CsvOptions struct { noSmithyDocumentSerde } +func (v *CsvOptions) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.CsvOptions) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *CsvOptions) SerializeMembers(s smithy.ShapeSerializer) { + if v.Delimiter != nil { + s.WriteString(schemas.CsvOptions_Delimiter, *v.Delimiter) + } + serializeCsvHeaderList(s, schemas.CsvOptions_HeaderList, v.HeaderList) +} +func (v *CsvOptions) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.CsvOptions, func(s *smithy.Schema) error { + switch s { + case schemas.CsvOptions_Delimiter: + v.Delimiter = new(string) + return d.ReadString(schemas.CsvOptions_Delimiter, v.Delimiter) + case schemas.CsvOptions_HeaderList: + return deserializeCsvHeaderList(d, schemas.CsvOptions_HeaderList, &v.HeaderList) + } + return nil + }) +} + // Represents a request to perform a DeleteItem operation. type Delete struct { @@ -1096,6 +2377,53 @@ type Delete struct { noSmithyDocumentSerde } +func (v *Delete) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.Delete) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *Delete) SerializeMembers(s smithy.ShapeSerializer) { + if v.ConditionExpression != nil { + s.WriteString(schemas.Delete_ConditionExpression, *v.ConditionExpression) + } + serializeExpressionAttributeNameMap(s, schemas.Delete_ExpressionAttributeNames, v.ExpressionAttributeNames) + serializeExpressionAttributeValueMap(s, schemas.Delete_ExpressionAttributeValues, v.ExpressionAttributeValues) + serializeKey(s, schemas.Delete_Key, v.Key) + if v.ReturnValuesOnConditionCheckFailure != "" { + s.WriteString(schemas.Delete_ReturnValuesOnConditionCheckFailure, string(v.ReturnValuesOnConditionCheckFailure)) + } + if v.TableName != nil { + s.WriteString(schemas.Delete_TableName, *v.TableName) + } +} +func (v *Delete) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.Delete, func(s *smithy.Schema) error { + switch s { + case schemas.Delete_ConditionExpression: + v.ConditionExpression = new(string) + return d.ReadString(schemas.Delete_ConditionExpression, v.ConditionExpression) + case schemas.Delete_ExpressionAttributeNames: + return deserializeExpressionAttributeNameMap(d, schemas.Delete_ExpressionAttributeNames, &v.ExpressionAttributeNames) + case schemas.Delete_ExpressionAttributeValues: + return deserializeExpressionAttributeValueMap(d, schemas.Delete_ExpressionAttributeValues, &v.ExpressionAttributeValues) + case schemas.Delete_Key: + return deserializeKey(d, schemas.Delete_Key, &v.Key) + case schemas.Delete_ReturnValuesOnConditionCheckFailure: + var ev string + if err := d.ReadString(schemas.Delete_ReturnValuesOnConditionCheckFailure, &ev); err != nil { + return err + } + v.ReturnValuesOnConditionCheckFailure = ReturnValuesOnConditionCheckFailure(ev) + return nil + case schemas.Delete_TableName: + v.TableName = new(string) + return d.ReadString(schemas.Delete_TableName, v.TableName) + } + return nil + }) +} + // Represents a global secondary index to be deleted from an existing table. type DeleteGlobalSecondaryIndexAction struct { @@ -1107,6 +2435,28 @@ type DeleteGlobalSecondaryIndexAction struct { noSmithyDocumentSerde } +func (v *DeleteGlobalSecondaryIndexAction) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DeleteGlobalSecondaryIndexAction) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DeleteGlobalSecondaryIndexAction) SerializeMembers(s smithy.ShapeSerializer) { + if v.IndexName != nil { + s.WriteString(schemas.DeleteGlobalSecondaryIndexAction_IndexName, *v.IndexName) + } +} +func (v *DeleteGlobalSecondaryIndexAction) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.DeleteGlobalSecondaryIndexAction, func(s *smithy.Schema) error { + switch s { + case schemas.DeleteGlobalSecondaryIndexAction_IndexName: + v.IndexName = new(string) + return d.ReadString(schemas.DeleteGlobalSecondaryIndexAction_IndexName, v.IndexName) + } + return nil + }) +} + // Specifies the action to remove a witness Region from a MRSC global table. You // cannot delete a single witness from a MRSC global table - you must delete both a // replica and the witness together. The deletion of both a witness and replica @@ -1121,6 +2471,28 @@ type DeleteGlobalTableWitnessGroupMemberAction struct { noSmithyDocumentSerde } +func (v *DeleteGlobalTableWitnessGroupMemberAction) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DeleteGlobalTableWitnessGroupMemberAction) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DeleteGlobalTableWitnessGroupMemberAction) SerializeMembers(s smithy.ShapeSerializer) { + if v.RegionName != nil { + s.WriteString(schemas.DeleteGlobalTableWitnessGroupMemberAction_RegionName, *v.RegionName) + } +} +func (v *DeleteGlobalTableWitnessGroupMemberAction) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.DeleteGlobalTableWitnessGroupMemberAction, func(s *smithy.Schema) error { + switch s { + case schemas.DeleteGlobalTableWitnessGroupMemberAction_RegionName: + v.RegionName = new(string) + return d.ReadString(schemas.DeleteGlobalTableWitnessGroupMemberAction_RegionName, v.RegionName) + } + return nil + }) +} + // Represents a replica to be removed. type DeleteReplicaAction struct { @@ -1132,6 +2504,28 @@ type DeleteReplicaAction struct { noSmithyDocumentSerde } +func (v *DeleteReplicaAction) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DeleteReplicaAction) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DeleteReplicaAction) SerializeMembers(s smithy.ShapeSerializer) { + if v.RegionName != nil { + s.WriteString(schemas.DeleteReplicaAction_RegionName, *v.RegionName) + } +} +func (v *DeleteReplicaAction) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.DeleteReplicaAction, func(s *smithy.Schema) error { + switch s { + case schemas.DeleteReplicaAction_RegionName: + v.RegionName = new(string) + return d.ReadString(schemas.DeleteReplicaAction_RegionName, v.RegionName) + } + return nil + }) +} + // Represents a replica to be deleted. type DeleteReplicationGroupMemberAction struct { @@ -1143,6 +2537,28 @@ type DeleteReplicationGroupMemberAction struct { noSmithyDocumentSerde } +func (v *DeleteReplicationGroupMemberAction) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DeleteReplicationGroupMemberAction) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DeleteReplicationGroupMemberAction) SerializeMembers(s smithy.ShapeSerializer) { + if v.RegionName != nil { + s.WriteString(schemas.DeleteReplicationGroupMemberAction_RegionName, *v.RegionName) + } +} +func (v *DeleteReplicationGroupMemberAction) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.DeleteReplicationGroupMemberAction, func(s *smithy.Schema) error { + switch s { + case schemas.DeleteReplicationGroupMemberAction_RegionName: + v.RegionName = new(string) + return d.ReadString(schemas.DeleteReplicationGroupMemberAction_RegionName, v.RegionName) + } + return nil + }) +} + // Represents a request to perform a DeleteItem operation on an item. type DeleteRequest struct { @@ -1156,6 +2572,58 @@ type DeleteRequest struct { noSmithyDocumentSerde } +func (v *DeleteRequest) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DeleteRequest) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DeleteRequest) SerializeMembers(s smithy.ShapeSerializer) { + serializeKey(s, schemas.DeleteRequest_Key, v.Key) +} +func (v *DeleteRequest) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.DeleteRequest, func(s *smithy.Schema) error { + switch s { + case schemas.DeleteRequest_Key: + return deserializeKey(d, schemas.DeleteRequest_Key, &v.Key) + } + return nil + }) +} + +// A vector index to be removed from a table. +type DeleteVectorIndexAction struct { + + // The name of the vector index to delete. + // + // This member is required. + IndexName *string + + noSmithyDocumentSerde +} + +func (v *DeleteVectorIndexAction) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DeleteVectorIndexAction) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DeleteVectorIndexAction) SerializeMembers(s smithy.ShapeSerializer) { + if v.IndexName != nil { + s.WriteString(schemas.DeleteVectorIndexAction_IndexName, *v.IndexName) + } +} +func (v *DeleteVectorIndexAction) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.DeleteVectorIndexAction, func(s *smithy.Schema) error { + switch s { + case schemas.DeleteVectorIndexAction_IndexName: + v.IndexName = new(string) + return d.ReadString(schemas.DeleteVectorIndexAction_IndexName, v.IndexName) + } + return nil + }) +} + // Enables setting the configuration for Kinesis Streaming. type EnableKinesisStreamingConfiguration struct { @@ -1166,6 +2634,32 @@ type EnableKinesisStreamingConfiguration struct { noSmithyDocumentSerde } +func (v *EnableKinesisStreamingConfiguration) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.EnableKinesisStreamingConfiguration) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *EnableKinesisStreamingConfiguration) SerializeMembers(s smithy.ShapeSerializer) { + if v.ApproximateCreationDateTimePrecision != "" { + s.WriteString(schemas.EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision, string(v.ApproximateCreationDateTimePrecision)) + } +} +func (v *EnableKinesisStreamingConfiguration) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.EnableKinesisStreamingConfiguration, func(s *smithy.Schema) error { + switch s { + case schemas.EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision: + var ev string + if err := d.ReadString(schemas.EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision, &ev); err != nil { + return err + } + v.ApproximateCreationDateTimePrecision = ApproximateCreationDateTimePrecision(ev) + return nil + } + return nil + }) +} + // An endpoint information details. type Endpoint struct { @@ -1182,6 +2676,31 @@ type Endpoint struct { noSmithyDocumentSerde } +func (v *Endpoint) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.Endpoint) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *Endpoint) SerializeMembers(s smithy.ShapeSerializer) { + if v.Address != nil { + s.WriteString(schemas.Endpoint_Address, *v.Address) + } + s.WriteInt64(schemas.Endpoint_CachePeriodInMinutes, v.CachePeriodInMinutes) +} +func (v *Endpoint) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.Endpoint, func(s *smithy.Schema) error { + switch s { + case schemas.Endpoint_Address: + v.Address = new(string) + return d.ReadString(schemas.Endpoint_Address, v.Address) + case schemas.Endpoint_CachePeriodInMinutes: + return d.ReadInt64(schemas.Endpoint_CachePeriodInMinutes, &v.CachePeriodInMinutes) + } + return nil + }) +} + // Represents a condition to be compared with an attribute value. This condition // can be used with DeleteItem , PutItem , or UpdateItem operations; if the // comparison evaluates to true, the operation succeeds; if not, the operation @@ -1388,6 +2907,44 @@ type ExpectedAttributeValue struct { noSmithyDocumentSerde } +func (v *ExpectedAttributeValue) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ExpectedAttributeValue) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ExpectedAttributeValue) SerializeMembers(s smithy.ShapeSerializer) { + serializeAttributeValueList(s, schemas.ExpectedAttributeValue_AttributeValueList, v.AttributeValueList) + if v.ComparisonOperator != "" { + s.WriteString(schemas.ExpectedAttributeValue_ComparisonOperator, string(v.ComparisonOperator)) + } + if v.Exists != nil { + s.WriteBool(schemas.ExpectedAttributeValue_Exists, *v.Exists) + } + serializeAttributeValue(s, schemas.ExpectedAttributeValue_Value, v.Value) +} +func (v *ExpectedAttributeValue) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ExpectedAttributeValue, func(s *smithy.Schema) error { + switch s { + case schemas.ExpectedAttributeValue_AttributeValueList: + return deserializeAttributeValueList(d, schemas.ExpectedAttributeValue_AttributeValueList, &v.AttributeValueList) + case schemas.ExpectedAttributeValue_ComparisonOperator: + var ev string + if err := d.ReadString(schemas.ExpectedAttributeValue_ComparisonOperator, &ev); err != nil { + return err + } + v.ComparisonOperator = ComparisonOperator(ev) + return nil + case schemas.ExpectedAttributeValue_Exists: + v.Exists = new(bool) + return d.ReadBool(schemas.ExpectedAttributeValue_Exists, v.Exists) + case schemas.ExpectedAttributeValue_Value: + return deserializeAttributeValue(d, schemas.ExpectedAttributeValue_Value, &v.Value) + } + return nil + }) +} + // Represents the properties of the exported table. type ExportDescription struct { @@ -1428,6 +2985,11 @@ type ExportDescription struct { // Export failure reason description. FailureMessage *string + // The filter criteria applied to the export. When present, only items that match + // the specified key conditions and filter expressions are included in the export + // output. + FilterSpecification *FilterSpecification + // Optional object containing the parameters specific to an incremental export. IncrementalExportSpecification *IncrementalExportSpecification @@ -1469,6 +3031,174 @@ type ExportDescription struct { noSmithyDocumentSerde } +func (v *ExportDescription) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ExportDescription) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ExportDescription) SerializeMembers(s smithy.ShapeSerializer) { + if v.BilledSizeBytes != nil { + s.WriteInt64(schemas.ExportDescription_BilledSizeBytes, *v.BilledSizeBytes) + } + if v.ClientToken != nil { + s.WriteString(schemas.ExportDescription_ClientToken, *v.ClientToken) + } + if v.EndTime != nil { + s.WriteTime(schemas.ExportDescription_EndTime, *v.EndTime) + } + if v.ExportArn != nil { + s.WriteString(schemas.ExportDescription_ExportArn, *v.ExportArn) + } + if v.ExportFormat != "" { + s.WriteString(schemas.ExportDescription_ExportFormat, string(v.ExportFormat)) + } + if v.ExportManifest != nil { + s.WriteString(schemas.ExportDescription_ExportManifest, *v.ExportManifest) + } + if v.ExportStatus != "" { + s.WriteString(schemas.ExportDescription_ExportStatus, string(v.ExportStatus)) + } + if v.ExportTime != nil { + s.WriteTime(schemas.ExportDescription_ExportTime, *v.ExportTime) + } + if v.ExportType != "" { + s.WriteString(schemas.ExportDescription_ExportType, string(v.ExportType)) + } + if v.FailureCode != nil { + s.WriteString(schemas.ExportDescription_FailureCode, *v.FailureCode) + } + if v.FailureMessage != nil { + s.WriteString(schemas.ExportDescription_FailureMessage, *v.FailureMessage) + } + if v.FilterSpecification != nil { + s.WriteStruct(schemas.ExportDescription_FilterSpecification) + v.FilterSpecification.SerializeMembers(s) + s.CloseStruct() + } + if v.IncrementalExportSpecification != nil { + s.WriteStruct(schemas.ExportDescription_IncrementalExportSpecification) + v.IncrementalExportSpecification.SerializeMembers(s) + s.CloseStruct() + } + if v.ItemCount != nil { + s.WriteInt64(schemas.ExportDescription_ItemCount, *v.ItemCount) + } + if v.S3Bucket != nil { + s.WriteString(schemas.ExportDescription_S3Bucket, *v.S3Bucket) + } + if v.S3BucketOwner != nil { + s.WriteString(schemas.ExportDescription_S3BucketOwner, *v.S3BucketOwner) + } + if v.S3Prefix != nil { + s.WriteString(schemas.ExportDescription_S3Prefix, *v.S3Prefix) + } + if v.S3SseAlgorithm != "" { + s.WriteString(schemas.ExportDescription_S3SseAlgorithm, string(v.S3SseAlgorithm)) + } + if v.S3SseKmsKeyId != nil { + s.WriteString(schemas.ExportDescription_S3SseKmsKeyId, *v.S3SseKmsKeyId) + } + if v.StartTime != nil { + s.WriteTime(schemas.ExportDescription_StartTime, *v.StartTime) + } + if v.TableArn != nil { + s.WriteString(schemas.ExportDescription_TableArn, *v.TableArn) + } + if v.TableId != nil { + s.WriteString(schemas.ExportDescription_TableId, *v.TableId) + } +} +func (v *ExportDescription) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ExportDescription, func(s *smithy.Schema) error { + switch s { + case schemas.ExportDescription_BilledSizeBytes: + v.BilledSizeBytes = new(int64) + return d.ReadInt64(schemas.ExportDescription_BilledSizeBytes, v.BilledSizeBytes) + case schemas.ExportDescription_ClientToken: + v.ClientToken = new(string) + return d.ReadString(schemas.ExportDescription_ClientToken, v.ClientToken) + case schemas.ExportDescription_EndTime: + v.EndTime = new(time.Time) + return d.ReadTime(schemas.ExportDescription_EndTime, v.EndTime) + case schemas.ExportDescription_ExportArn: + v.ExportArn = new(string) + return d.ReadString(schemas.ExportDescription_ExportArn, v.ExportArn) + case schemas.ExportDescription_ExportFormat: + var ev string + if err := d.ReadString(schemas.ExportDescription_ExportFormat, &ev); err != nil { + return err + } + v.ExportFormat = ExportFormat(ev) + return nil + case schemas.ExportDescription_ExportManifest: + v.ExportManifest = new(string) + return d.ReadString(schemas.ExportDescription_ExportManifest, v.ExportManifest) + case schemas.ExportDescription_ExportStatus: + var ev string + if err := d.ReadString(schemas.ExportDescription_ExportStatus, &ev); err != nil { + return err + } + v.ExportStatus = ExportStatus(ev) + return nil + case schemas.ExportDescription_ExportTime: + v.ExportTime = new(time.Time) + return d.ReadTime(schemas.ExportDescription_ExportTime, v.ExportTime) + case schemas.ExportDescription_ExportType: + var ev string + if err := d.ReadString(schemas.ExportDescription_ExportType, &ev); err != nil { + return err + } + v.ExportType = ExportType(ev) + return nil + case schemas.ExportDescription_FailureCode: + v.FailureCode = new(string) + return d.ReadString(schemas.ExportDescription_FailureCode, v.FailureCode) + case schemas.ExportDescription_FailureMessage: + v.FailureMessage = new(string) + return d.ReadString(schemas.ExportDescription_FailureMessage, v.FailureMessage) + case schemas.ExportDescription_FilterSpecification: + v.FilterSpecification = &FilterSpecification{} + return v.FilterSpecification.Deserialize(d) + case schemas.ExportDescription_IncrementalExportSpecification: + v.IncrementalExportSpecification = &IncrementalExportSpecification{} + return v.IncrementalExportSpecification.Deserialize(d) + case schemas.ExportDescription_ItemCount: + v.ItemCount = new(int64) + return d.ReadInt64(schemas.ExportDescription_ItemCount, v.ItemCount) + case schemas.ExportDescription_S3Bucket: + v.S3Bucket = new(string) + return d.ReadString(schemas.ExportDescription_S3Bucket, v.S3Bucket) + case schemas.ExportDescription_S3BucketOwner: + v.S3BucketOwner = new(string) + return d.ReadString(schemas.ExportDescription_S3BucketOwner, v.S3BucketOwner) + case schemas.ExportDescription_S3Prefix: + v.S3Prefix = new(string) + return d.ReadString(schemas.ExportDescription_S3Prefix, v.S3Prefix) + case schemas.ExportDescription_S3SseAlgorithm: + var ev string + if err := d.ReadString(schemas.ExportDescription_S3SseAlgorithm, &ev); err != nil { + return err + } + v.S3SseAlgorithm = S3SseAlgorithm(ev) + return nil + case schemas.ExportDescription_S3SseKmsKeyId: + v.S3SseKmsKeyId = new(string) + return d.ReadString(schemas.ExportDescription_S3SseKmsKeyId, v.S3SseKmsKeyId) + case schemas.ExportDescription_StartTime: + v.StartTime = new(time.Time) + return d.ReadTime(schemas.ExportDescription_StartTime, v.StartTime) + case schemas.ExportDescription_TableArn: + v.TableArn = new(string) + return d.ReadString(schemas.ExportDescription_TableArn, v.TableArn) + case schemas.ExportDescription_TableId: + v.TableId = new(string) + return d.ReadString(schemas.ExportDescription_TableId, v.TableId) + } + return nil + }) +} + // Summary information about an export task. type ExportSummary struct { @@ -1485,8 +3215,50 @@ type ExportSummary struct { noSmithyDocumentSerde } -// Represents a failure a contributor insights operation. -type FailureException struct { +func (v *ExportSummary) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ExportSummary) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ExportSummary) SerializeMembers(s smithy.ShapeSerializer) { + if v.ExportArn != nil { + s.WriteString(schemas.ExportSummary_ExportArn, *v.ExportArn) + } + if v.ExportStatus != "" { + s.WriteString(schemas.ExportSummary_ExportStatus, string(v.ExportStatus)) + } + if v.ExportType != "" { + s.WriteString(schemas.ExportSummary_ExportType, string(v.ExportType)) + } +} +func (v *ExportSummary) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ExportSummary, func(s *smithy.Schema) error { + switch s { + case schemas.ExportSummary_ExportArn: + v.ExportArn = new(string) + return d.ReadString(schemas.ExportSummary_ExportArn, v.ExportArn) + case schemas.ExportSummary_ExportStatus: + var ev string + if err := d.ReadString(schemas.ExportSummary_ExportStatus, &ev); err != nil { + return err + } + v.ExportStatus = ExportStatus(ev) + return nil + case schemas.ExportSummary_ExportType: + var ev string + if err := d.ReadString(schemas.ExportSummary_ExportType, &ev); err != nil { + return err + } + v.ExportType = ExportType(ev) + return nil + } + return nil + }) +} + +// Represents a failure a contributor insights operation. +type FailureException struct { // Description of the failure. ExceptionDescription *string @@ -1497,6 +3269,114 @@ type FailureException struct { noSmithyDocumentSerde } +func (v *FailureException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.FailureException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *FailureException) SerializeMembers(s smithy.ShapeSerializer) { + if v.ExceptionDescription != nil { + s.WriteString(schemas.FailureException_ExceptionDescription, *v.ExceptionDescription) + } + if v.ExceptionName != nil { + s.WriteString(schemas.FailureException_ExceptionName, *v.ExceptionName) + } +} +func (v *FailureException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.FailureException, func(s *smithy.Schema) error { + switch s { + case schemas.FailureException_ExceptionDescription: + v.ExceptionDescription = new(string) + return d.ReadString(schemas.FailureException_ExceptionDescription, v.ExceptionDescription) + case schemas.FailureException_ExceptionName: + v.ExceptionName = new(string) + return d.ReadString(schemas.FailureException_ExceptionName, v.ExceptionName) + } + return nil + }) +} + +// Contains the filter criteria used to limit which items are included in an +// export. If you don't include this parameter, all items and attributes are +// exported. +type FilterSpecification struct { + + // One or more substitution tokens for attribute names in an expression. For more + // information, see [Expression Attribute Names]in the Amazon DynamoDB Developer Guide. + // + // [Expression Attribute Names]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ExpressionAttributeNames.html + ExpressionAttributeNames map[string]string + + // One or more values that can be substituted in an expression. For more + // information, see [Expression Attribute Values]in the Amazon DynamoDB Developer Guide. + // + // [Expression Attribute Values]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ExpressionAttributeValues.html + ExpressionAttributeValues map[string]AttributeValue + + // A condition that filters which items are included in the export. This parameter + // uses the same syntax as FilterExpression in Query and Scan . If you don't + // provide KeyConditionExpression , this expression can also reference key + // attributes. If you don't specify this parameter, all items are included in the + // export. + FilterExpression *string + + // A condition expression that filters items by key values. The expression must + // test equality on a single partition key value and can optionally compare a sort + // key value. This parameter uses the same syntax as KeyConditionExpression in + // Query . When you provide this parameter, FilterExpression can only reference + // non-key attributes. If you don't specify this parameter, all items are eligible + // for export. + KeyConditionExpression *string + + // The attributes you want to retrieve for items included in the export. Separate + // attribute names in the expression with commas. If you don't specify this + // parameter, all attributes are returned. + ProjectionExpression *string + + noSmithyDocumentSerde +} + +func (v *FilterSpecification) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.FilterSpecification) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *FilterSpecification) SerializeMembers(s smithy.ShapeSerializer) { + serializeExpressionAttributeNameMap(s, schemas.FilterSpecification_ExpressionAttributeNames, v.ExpressionAttributeNames) + serializeExpressionAttributeValueMap(s, schemas.FilterSpecification_ExpressionAttributeValues, v.ExpressionAttributeValues) + if v.FilterExpression != nil { + s.WriteString(schemas.FilterSpecification_FilterExpression, *v.FilterExpression) + } + if v.KeyConditionExpression != nil { + s.WriteString(schemas.FilterSpecification_KeyConditionExpression, *v.KeyConditionExpression) + } + if v.ProjectionExpression != nil { + s.WriteString(schemas.FilterSpecification_ProjectionExpression, *v.ProjectionExpression) + } +} +func (v *FilterSpecification) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.FilterSpecification, func(s *smithy.Schema) error { + switch s { + case schemas.FilterSpecification_ExpressionAttributeNames: + return deserializeExpressionAttributeNameMap(d, schemas.FilterSpecification_ExpressionAttributeNames, &v.ExpressionAttributeNames) + case schemas.FilterSpecification_ExpressionAttributeValues: + return deserializeExpressionAttributeValueMap(d, schemas.FilterSpecification_ExpressionAttributeValues, &v.ExpressionAttributeValues) + case schemas.FilterSpecification_FilterExpression: + v.FilterExpression = new(string) + return d.ReadString(schemas.FilterSpecification_FilterExpression, v.FilterExpression) + case schemas.FilterSpecification_KeyConditionExpression: + v.KeyConditionExpression = new(string) + return d.ReadString(schemas.FilterSpecification_KeyConditionExpression, v.KeyConditionExpression) + case schemas.FilterSpecification_ProjectionExpression: + v.ProjectionExpression = new(string) + return d.ReadString(schemas.FilterSpecification_ProjectionExpression, v.ProjectionExpression) + } + return nil + }) +} + // Specifies an item and related attribute values to retrieve in a TransactGetItem // object. type Get struct { @@ -1527,6 +3407,40 @@ type Get struct { noSmithyDocumentSerde } +func (v *Get) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.Get) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *Get) SerializeMembers(s smithy.ShapeSerializer) { + serializeExpressionAttributeNameMap(s, schemas.Get_ExpressionAttributeNames, v.ExpressionAttributeNames) + serializeKey(s, schemas.Get_Key, v.Key) + if v.ProjectionExpression != nil { + s.WriteString(schemas.Get_ProjectionExpression, *v.ProjectionExpression) + } + if v.TableName != nil { + s.WriteString(schemas.Get_TableName, *v.TableName) + } +} +func (v *Get) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.Get, func(s *smithy.Schema) error { + switch s { + case schemas.Get_ExpressionAttributeNames: + return deserializeExpressionAttributeNameMap(d, schemas.Get_ExpressionAttributeNames, &v.ExpressionAttributeNames) + case schemas.Get_Key: + return deserializeKey(d, schemas.Get_Key, &v.Key) + case schemas.Get_ProjectionExpression: + v.ProjectionExpression = new(string) + return d.ReadString(schemas.Get_ProjectionExpression, v.ProjectionExpression) + case schemas.Get_TableName: + v.TableName = new(string) + return d.ReadString(schemas.Get_TableName, v.TableName) + } + return nil + }) +} + // Represents the properties of a global secondary index. type GlobalSecondaryIndex struct { @@ -1586,6 +3500,63 @@ type GlobalSecondaryIndex struct { noSmithyDocumentSerde } +func (v *GlobalSecondaryIndex) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.GlobalSecondaryIndex) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *GlobalSecondaryIndex) SerializeMembers(s smithy.ShapeSerializer) { + if v.IndexName != nil { + s.WriteString(schemas.GlobalSecondaryIndex_IndexName, *v.IndexName) + } + serializeKeySchema(s, schemas.GlobalSecondaryIndex_KeySchema, v.KeySchema) + if v.OnDemandThroughput != nil { + s.WriteStruct(schemas.GlobalSecondaryIndex_OnDemandThroughput) + v.OnDemandThroughput.SerializeMembers(s) + s.CloseStruct() + } + if v.Projection != nil { + s.WriteStruct(schemas.GlobalSecondaryIndex_Projection) + v.Projection.SerializeMembers(s) + s.CloseStruct() + } + if v.ProvisionedThroughput != nil { + s.WriteStruct(schemas.GlobalSecondaryIndex_ProvisionedThroughput) + v.ProvisionedThroughput.SerializeMembers(s) + s.CloseStruct() + } + if v.WarmThroughput != nil { + s.WriteStruct(schemas.GlobalSecondaryIndex_WarmThroughput) + v.WarmThroughput.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *GlobalSecondaryIndex) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.GlobalSecondaryIndex, func(s *smithy.Schema) error { + switch s { + case schemas.GlobalSecondaryIndex_IndexName: + v.IndexName = new(string) + return d.ReadString(schemas.GlobalSecondaryIndex_IndexName, v.IndexName) + case schemas.GlobalSecondaryIndex_KeySchema: + return deserializeKeySchema(d, schemas.GlobalSecondaryIndex_KeySchema, &v.KeySchema) + case schemas.GlobalSecondaryIndex_OnDemandThroughput: + v.OnDemandThroughput = &OnDemandThroughput{} + return v.OnDemandThroughput.Deserialize(d) + case schemas.GlobalSecondaryIndex_Projection: + v.Projection = &Projection{} + return v.Projection.Deserialize(d) + case schemas.GlobalSecondaryIndex_ProvisionedThroughput: + v.ProvisionedThroughput = &ProvisionedThroughput{} + return v.ProvisionedThroughput.Deserialize(d) + case schemas.GlobalSecondaryIndex_WarmThroughput: + v.WarmThroughput = &WarmThroughput{} + return v.WarmThroughput.Deserialize(d) + } + return nil + }) +} + // Represents the auto scaling settings of a global secondary index for a global // table that will be modified. type GlobalSecondaryIndexAutoScalingUpdate struct { @@ -1600,6 +3571,36 @@ type GlobalSecondaryIndexAutoScalingUpdate struct { noSmithyDocumentSerde } +func (v *GlobalSecondaryIndexAutoScalingUpdate) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.GlobalSecondaryIndexAutoScalingUpdate) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *GlobalSecondaryIndexAutoScalingUpdate) SerializeMembers(s smithy.ShapeSerializer) { + if v.IndexName != nil { + s.WriteString(schemas.GlobalSecondaryIndexAutoScalingUpdate_IndexName, *v.IndexName) + } + if v.ProvisionedWriteCapacityAutoScalingUpdate != nil { + s.WriteStruct(schemas.GlobalSecondaryIndexAutoScalingUpdate_ProvisionedWriteCapacityAutoScalingUpdate) + v.ProvisionedWriteCapacityAutoScalingUpdate.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *GlobalSecondaryIndexAutoScalingUpdate) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.GlobalSecondaryIndexAutoScalingUpdate, func(s *smithy.Schema) error { + switch s { + case schemas.GlobalSecondaryIndexAutoScalingUpdate_IndexName: + v.IndexName = new(string) + return d.ReadString(schemas.GlobalSecondaryIndexAutoScalingUpdate_IndexName, v.IndexName) + case schemas.GlobalSecondaryIndexAutoScalingUpdate_ProvisionedWriteCapacityAutoScalingUpdate: + v.ProvisionedWriteCapacityAutoScalingUpdate = &AutoScalingSettingsUpdate{} + return v.ProvisionedWriteCapacityAutoScalingUpdate.Deserialize(d) + } + return nil + }) +} + // Represents the properties of a global secondary index. type GlobalSecondaryIndexDescription struct { @@ -1689,6 +3690,97 @@ type GlobalSecondaryIndexDescription struct { noSmithyDocumentSerde } +func (v *GlobalSecondaryIndexDescription) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.GlobalSecondaryIndexDescription) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *GlobalSecondaryIndexDescription) SerializeMembers(s smithy.ShapeSerializer) { + if v.Backfilling != nil { + s.WriteBool(schemas.GlobalSecondaryIndexDescription_Backfilling, *v.Backfilling) + } + if v.IndexArn != nil { + s.WriteString(schemas.GlobalSecondaryIndexDescription_IndexArn, *v.IndexArn) + } + if v.IndexName != nil { + s.WriteString(schemas.GlobalSecondaryIndexDescription_IndexName, *v.IndexName) + } + if v.IndexSizeBytes != nil { + s.WriteInt64(schemas.GlobalSecondaryIndexDescription_IndexSizeBytes, *v.IndexSizeBytes) + } + if v.IndexStatus != "" { + s.WriteString(schemas.GlobalSecondaryIndexDescription_IndexStatus, string(v.IndexStatus)) + } + if v.ItemCount != nil { + s.WriteInt64(schemas.GlobalSecondaryIndexDescription_ItemCount, *v.ItemCount) + } + serializeKeySchema(s, schemas.GlobalSecondaryIndexDescription_KeySchema, v.KeySchema) + if v.OnDemandThroughput != nil { + s.WriteStruct(schemas.GlobalSecondaryIndexDescription_OnDemandThroughput) + v.OnDemandThroughput.SerializeMembers(s) + s.CloseStruct() + } + if v.Projection != nil { + s.WriteStruct(schemas.GlobalSecondaryIndexDescription_Projection) + v.Projection.SerializeMembers(s) + s.CloseStruct() + } + if v.ProvisionedThroughput != nil { + s.WriteStruct(schemas.GlobalSecondaryIndexDescription_ProvisionedThroughput) + v.ProvisionedThroughput.SerializeMembers(s) + s.CloseStruct() + } + if v.WarmThroughput != nil { + s.WriteStruct(schemas.GlobalSecondaryIndexDescription_WarmThroughput) + v.WarmThroughput.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *GlobalSecondaryIndexDescription) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.GlobalSecondaryIndexDescription, func(s *smithy.Schema) error { + switch s { + case schemas.GlobalSecondaryIndexDescription_Backfilling: + v.Backfilling = new(bool) + return d.ReadBool(schemas.GlobalSecondaryIndexDescription_Backfilling, v.Backfilling) + case schemas.GlobalSecondaryIndexDescription_IndexArn: + v.IndexArn = new(string) + return d.ReadString(schemas.GlobalSecondaryIndexDescription_IndexArn, v.IndexArn) + case schemas.GlobalSecondaryIndexDescription_IndexName: + v.IndexName = new(string) + return d.ReadString(schemas.GlobalSecondaryIndexDescription_IndexName, v.IndexName) + case schemas.GlobalSecondaryIndexDescription_IndexSizeBytes: + v.IndexSizeBytes = new(int64) + return d.ReadInt64(schemas.GlobalSecondaryIndexDescription_IndexSizeBytes, v.IndexSizeBytes) + case schemas.GlobalSecondaryIndexDescription_IndexStatus: + var ev string + if err := d.ReadString(schemas.GlobalSecondaryIndexDescription_IndexStatus, &ev); err != nil { + return err + } + v.IndexStatus = IndexStatus(ev) + return nil + case schemas.GlobalSecondaryIndexDescription_ItemCount: + v.ItemCount = new(int64) + return d.ReadInt64(schemas.GlobalSecondaryIndexDescription_ItemCount, v.ItemCount) + case schemas.GlobalSecondaryIndexDescription_KeySchema: + return deserializeKeySchema(d, schemas.GlobalSecondaryIndexDescription_KeySchema, &v.KeySchema) + case schemas.GlobalSecondaryIndexDescription_OnDemandThroughput: + v.OnDemandThroughput = &OnDemandThroughput{} + return v.OnDemandThroughput.Deserialize(d) + case schemas.GlobalSecondaryIndexDescription_Projection: + v.Projection = &Projection{} + return v.Projection.Deserialize(d) + case schemas.GlobalSecondaryIndexDescription_ProvisionedThroughput: + v.ProvisionedThroughput = &ProvisionedThroughputDescription{} + return v.ProvisionedThroughput.Deserialize(d) + case schemas.GlobalSecondaryIndexDescription_WarmThroughput: + v.WarmThroughput = &GlobalSecondaryIndexWarmThroughputDescription{} + return v.WarmThroughput.Deserialize(d) + } + return nil + }) +} + // Represents the properties of a global secondary index for the table when the // backup was created. type GlobalSecondaryIndexInfo struct { @@ -1730,6 +3822,55 @@ type GlobalSecondaryIndexInfo struct { noSmithyDocumentSerde } +func (v *GlobalSecondaryIndexInfo) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.GlobalSecondaryIndexInfo) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *GlobalSecondaryIndexInfo) SerializeMembers(s smithy.ShapeSerializer) { + if v.IndexName != nil { + s.WriteString(schemas.GlobalSecondaryIndexInfo_IndexName, *v.IndexName) + } + serializeKeySchema(s, schemas.GlobalSecondaryIndexInfo_KeySchema, v.KeySchema) + if v.OnDemandThroughput != nil { + s.WriteStruct(schemas.GlobalSecondaryIndexInfo_OnDemandThroughput) + v.OnDemandThroughput.SerializeMembers(s) + s.CloseStruct() + } + if v.Projection != nil { + s.WriteStruct(schemas.GlobalSecondaryIndexInfo_Projection) + v.Projection.SerializeMembers(s) + s.CloseStruct() + } + if v.ProvisionedThroughput != nil { + s.WriteStruct(schemas.GlobalSecondaryIndexInfo_ProvisionedThroughput) + v.ProvisionedThroughput.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *GlobalSecondaryIndexInfo) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.GlobalSecondaryIndexInfo, func(s *smithy.Schema) error { + switch s { + case schemas.GlobalSecondaryIndexInfo_IndexName: + v.IndexName = new(string) + return d.ReadString(schemas.GlobalSecondaryIndexInfo_IndexName, v.IndexName) + case schemas.GlobalSecondaryIndexInfo_KeySchema: + return deserializeKeySchema(d, schemas.GlobalSecondaryIndexInfo_KeySchema, &v.KeySchema) + case schemas.GlobalSecondaryIndexInfo_OnDemandThroughput: + v.OnDemandThroughput = &OnDemandThroughput{} + return v.OnDemandThroughput.Deserialize(d) + case schemas.GlobalSecondaryIndexInfo_Projection: + v.Projection = &Projection{} + return v.Projection.Deserialize(d) + case schemas.GlobalSecondaryIndexInfo_ProvisionedThroughput: + v.ProvisionedThroughput = &ProvisionedThroughput{} + return v.ProvisionedThroughput.Deserialize(d) + } + return nil + }) +} + // Represents one of the following: // // - A new global secondary index to be added to an existing table. @@ -1764,6 +3905,46 @@ type GlobalSecondaryIndexUpdate struct { noSmithyDocumentSerde } +func (v *GlobalSecondaryIndexUpdate) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.GlobalSecondaryIndexUpdate) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *GlobalSecondaryIndexUpdate) SerializeMembers(s smithy.ShapeSerializer) { + if v.Create != nil { + s.WriteStruct(schemas.GlobalSecondaryIndexUpdate_Create) + v.Create.SerializeMembers(s) + s.CloseStruct() + } + if v.Delete != nil { + s.WriteStruct(schemas.GlobalSecondaryIndexUpdate_Delete) + v.Delete.SerializeMembers(s) + s.CloseStruct() + } + if v.Update != nil { + s.WriteStruct(schemas.GlobalSecondaryIndexUpdate_Update) + v.Update.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *GlobalSecondaryIndexUpdate) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.GlobalSecondaryIndexUpdate, func(s *smithy.Schema) error { + switch s { + case schemas.GlobalSecondaryIndexUpdate_Create: + v.Create = &CreateGlobalSecondaryIndexAction{} + return v.Create.Deserialize(d) + case schemas.GlobalSecondaryIndexUpdate_Delete: + v.Delete = &DeleteGlobalSecondaryIndexAction{} + return v.Delete.Deserialize(d) + case schemas.GlobalSecondaryIndexUpdate_Update: + v.Update = &UpdateGlobalSecondaryIndexAction{} + return v.Update.Deserialize(d) + } + return nil + }) +} + // The description of the warm throughput value on a global secondary index. type GlobalSecondaryIndexWarmThroughputDescription struct { @@ -1782,6 +3963,44 @@ type GlobalSecondaryIndexWarmThroughputDescription struct { noSmithyDocumentSerde } +func (v *GlobalSecondaryIndexWarmThroughputDescription) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.GlobalSecondaryIndexWarmThroughputDescription) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *GlobalSecondaryIndexWarmThroughputDescription) SerializeMembers(s smithy.ShapeSerializer) { + if v.ReadUnitsPerSecond != nil { + s.WriteInt64(schemas.GlobalSecondaryIndexWarmThroughputDescription_ReadUnitsPerSecond, *v.ReadUnitsPerSecond) + } + if v.Status != "" { + s.WriteString(schemas.GlobalSecondaryIndexWarmThroughputDescription_Status, string(v.Status)) + } + if v.WriteUnitsPerSecond != nil { + s.WriteInt64(schemas.GlobalSecondaryIndexWarmThroughputDescription_WriteUnitsPerSecond, *v.WriteUnitsPerSecond) + } +} +func (v *GlobalSecondaryIndexWarmThroughputDescription) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.GlobalSecondaryIndexWarmThroughputDescription, func(s *smithy.Schema) error { + switch s { + case schemas.GlobalSecondaryIndexWarmThroughputDescription_ReadUnitsPerSecond: + v.ReadUnitsPerSecond = new(int64) + return d.ReadInt64(schemas.GlobalSecondaryIndexWarmThroughputDescription_ReadUnitsPerSecond, v.ReadUnitsPerSecond) + case schemas.GlobalSecondaryIndexWarmThroughputDescription_Status: + var ev string + if err := d.ReadString(schemas.GlobalSecondaryIndexWarmThroughputDescription_Status, &ev); err != nil { + return err + } + v.Status = IndexStatus(ev) + return nil + case schemas.GlobalSecondaryIndexWarmThroughputDescription_WriteUnitsPerSecond: + v.WriteUnitsPerSecond = new(int64) + return d.ReadInt64(schemas.GlobalSecondaryIndexWarmThroughputDescription_WriteUnitsPerSecond, v.WriteUnitsPerSecond) + } + return nil + }) +} + // Represents the properties of a global table. type GlobalTable struct { @@ -1794,6 +4013,31 @@ type GlobalTable struct { noSmithyDocumentSerde } +func (v *GlobalTable) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.GlobalTable) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *GlobalTable) SerializeMembers(s smithy.ShapeSerializer) { + if v.GlobalTableName != nil { + s.WriteString(schemas.GlobalTable_GlobalTableName, *v.GlobalTableName) + } + serializeReplicaList(s, schemas.GlobalTable_ReplicationGroup, v.ReplicationGroup) +} +func (v *GlobalTable) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.GlobalTable, func(s *smithy.Schema) error { + switch s { + case schemas.GlobalTable_GlobalTableName: + v.GlobalTableName = new(string) + return d.ReadString(schemas.GlobalTable_GlobalTableName, v.GlobalTableName) + case schemas.GlobalTable_ReplicationGroup: + return deserializeReplicaList(d, schemas.GlobalTable_ReplicationGroup, &v.ReplicationGroup) + } + return nil + }) +} + // Contains details about the global table. type GlobalTableDescription struct { @@ -1823,6 +4067,53 @@ type GlobalTableDescription struct { noSmithyDocumentSerde } +func (v *GlobalTableDescription) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.GlobalTableDescription) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *GlobalTableDescription) SerializeMembers(s smithy.ShapeSerializer) { + if v.CreationDateTime != nil { + s.WriteTime(schemas.GlobalTableDescription_CreationDateTime, *v.CreationDateTime) + } + if v.GlobalTableArn != nil { + s.WriteString(schemas.GlobalTableDescription_GlobalTableArn, *v.GlobalTableArn) + } + if v.GlobalTableName != nil { + s.WriteString(schemas.GlobalTableDescription_GlobalTableName, *v.GlobalTableName) + } + if v.GlobalTableStatus != "" { + s.WriteString(schemas.GlobalTableDescription_GlobalTableStatus, string(v.GlobalTableStatus)) + } + serializeReplicaDescriptionList(s, schemas.GlobalTableDescription_ReplicationGroup, v.ReplicationGroup) +} +func (v *GlobalTableDescription) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.GlobalTableDescription, func(s *smithy.Schema) error { + switch s { + case schemas.GlobalTableDescription_CreationDateTime: + v.CreationDateTime = new(time.Time) + return d.ReadTime(schemas.GlobalTableDescription_CreationDateTime, v.CreationDateTime) + case schemas.GlobalTableDescription_GlobalTableArn: + v.GlobalTableArn = new(string) + return d.ReadString(schemas.GlobalTableDescription_GlobalTableArn, v.GlobalTableArn) + case schemas.GlobalTableDescription_GlobalTableName: + v.GlobalTableName = new(string) + return d.ReadString(schemas.GlobalTableDescription_GlobalTableName, v.GlobalTableName) + case schemas.GlobalTableDescription_GlobalTableStatus: + var ev string + if err := d.ReadString(schemas.GlobalTableDescription_GlobalTableStatus, &ev); err != nil { + return err + } + v.GlobalTableStatus = GlobalTableStatus(ev) + return nil + case schemas.GlobalTableDescription_ReplicationGroup: + return deserializeReplicaDescriptionList(d, schemas.GlobalTableDescription_ReplicationGroup, &v.ReplicationGroup) + } + return nil + }) +} + // Represents the settings of a global secondary index for a global table that // will be modified. type GlobalTableGlobalSecondaryIndexSettingsUpdate struct { @@ -1844,6 +4135,42 @@ type GlobalTableGlobalSecondaryIndexSettingsUpdate struct { noSmithyDocumentSerde } +func (v *GlobalTableGlobalSecondaryIndexSettingsUpdate) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.GlobalTableGlobalSecondaryIndexSettingsUpdate) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *GlobalTableGlobalSecondaryIndexSettingsUpdate) SerializeMembers(s smithy.ShapeSerializer) { + if v.IndexName != nil { + s.WriteString(schemas.GlobalTableGlobalSecondaryIndexSettingsUpdate_IndexName, *v.IndexName) + } + if v.ProvisionedWriteCapacityAutoScalingSettingsUpdate != nil { + s.WriteStruct(schemas.GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityAutoScalingSettingsUpdate) + v.ProvisionedWriteCapacityAutoScalingSettingsUpdate.SerializeMembers(s) + s.CloseStruct() + } + if v.ProvisionedWriteCapacityUnits != nil { + s.WriteInt64(schemas.GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityUnits, *v.ProvisionedWriteCapacityUnits) + } +} +func (v *GlobalTableGlobalSecondaryIndexSettingsUpdate) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.GlobalTableGlobalSecondaryIndexSettingsUpdate, func(s *smithy.Schema) error { + switch s { + case schemas.GlobalTableGlobalSecondaryIndexSettingsUpdate_IndexName: + v.IndexName = new(string) + return d.ReadString(schemas.GlobalTableGlobalSecondaryIndexSettingsUpdate_IndexName, v.IndexName) + case schemas.GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityAutoScalingSettingsUpdate: + v.ProvisionedWriteCapacityAutoScalingSettingsUpdate = &AutoScalingSettingsUpdate{} + return v.ProvisionedWriteCapacityAutoScalingSettingsUpdate.Deserialize(d) + case schemas.GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityUnits: + v.ProvisionedWriteCapacityUnits = new(int64) + return d.ReadInt64(schemas.GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityUnits, v.ProvisionedWriteCapacityUnits) + } + return nil + }) +} + // Represents the properties of a witness Region in a MRSC global table. type GlobalTableWitnessDescription struct { @@ -1857,6 +4184,38 @@ type GlobalTableWitnessDescription struct { noSmithyDocumentSerde } +func (v *GlobalTableWitnessDescription) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.GlobalTableWitnessDescription) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *GlobalTableWitnessDescription) SerializeMembers(s smithy.ShapeSerializer) { + if v.RegionName != nil { + s.WriteString(schemas.GlobalTableWitnessDescription_RegionName, *v.RegionName) + } + if v.WitnessStatus != "" { + s.WriteString(schemas.GlobalTableWitnessDescription_WitnessStatus, string(v.WitnessStatus)) + } +} +func (v *GlobalTableWitnessDescription) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.GlobalTableWitnessDescription, func(s *smithy.Schema) error { + switch s { + case schemas.GlobalTableWitnessDescription_RegionName: + v.RegionName = new(string) + return d.ReadString(schemas.GlobalTableWitnessDescription_RegionName, v.RegionName) + case schemas.GlobalTableWitnessDescription_WitnessStatus: + var ev string + if err := d.ReadString(schemas.GlobalTableWitnessDescription_WitnessStatus, &ev); err != nil { + return err + } + v.WitnessStatus = WitnessStatus(ev) + return nil + } + return nil + }) +} + // Represents one of the following: // // - A new witness to be added to a new global table. @@ -1878,6 +4237,38 @@ type GlobalTableWitnessGroupUpdate struct { noSmithyDocumentSerde } +func (v *GlobalTableWitnessGroupUpdate) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.GlobalTableWitnessGroupUpdate) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *GlobalTableWitnessGroupUpdate) SerializeMembers(s smithy.ShapeSerializer) { + if v.Create != nil { + s.WriteStruct(schemas.GlobalTableWitnessGroupUpdate_Create) + v.Create.SerializeMembers(s) + s.CloseStruct() + } + if v.Delete != nil { + s.WriteStruct(schemas.GlobalTableWitnessGroupUpdate_Delete) + v.Delete.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *GlobalTableWitnessGroupUpdate) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.GlobalTableWitnessGroupUpdate, func(s *smithy.Schema) error { + switch s { + case schemas.GlobalTableWitnessGroupUpdate_Create: + v.Create = &CreateGlobalTableWitnessGroupMemberAction{} + return v.Create.Deserialize(d) + case schemas.GlobalTableWitnessGroupUpdate_Delete: + v.Delete = &DeleteGlobalTableWitnessGroupMemberAction{} + return v.Delete.Deserialize(d) + } + return nil + }) +} + // Summary information about the source file for the import. type ImportSummary struct { @@ -1885,8 +4276,7 @@ type ImportSummary struct { // this import task. CloudWatchLogGroupArn *string - // The time at which this import task ended. (Does this include the successful - // complete creation of the table it was imported to?) + // The time at which this import task ended. EndTime *time.Time // The Amazon Resource Number (ARN) corresponding to the import request. @@ -1912,6 +4302,80 @@ type ImportSummary struct { noSmithyDocumentSerde } +func (v *ImportSummary) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ImportSummary) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ImportSummary) SerializeMembers(s smithy.ShapeSerializer) { + if v.CloudWatchLogGroupArn != nil { + s.WriteString(schemas.ImportSummary_CloudWatchLogGroupArn, *v.CloudWatchLogGroupArn) + } + if v.EndTime != nil { + s.WriteTime(schemas.ImportSummary_EndTime, *v.EndTime) + } + if v.ImportArn != nil { + s.WriteString(schemas.ImportSummary_ImportArn, *v.ImportArn) + } + if v.ImportStatus != "" { + s.WriteString(schemas.ImportSummary_ImportStatus, string(v.ImportStatus)) + } + if v.InputFormat != "" { + s.WriteString(schemas.ImportSummary_InputFormat, string(v.InputFormat)) + } + if v.S3BucketSource != nil { + s.WriteStruct(schemas.ImportSummary_S3BucketSource) + v.S3BucketSource.SerializeMembers(s) + s.CloseStruct() + } + if v.StartTime != nil { + s.WriteTime(schemas.ImportSummary_StartTime, *v.StartTime) + } + if v.TableArn != nil { + s.WriteString(schemas.ImportSummary_TableArn, *v.TableArn) + } +} +func (v *ImportSummary) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ImportSummary, func(s *smithy.Schema) error { + switch s { + case schemas.ImportSummary_CloudWatchLogGroupArn: + v.CloudWatchLogGroupArn = new(string) + return d.ReadString(schemas.ImportSummary_CloudWatchLogGroupArn, v.CloudWatchLogGroupArn) + case schemas.ImportSummary_EndTime: + v.EndTime = new(time.Time) + return d.ReadTime(schemas.ImportSummary_EndTime, v.EndTime) + case schemas.ImportSummary_ImportArn: + v.ImportArn = new(string) + return d.ReadString(schemas.ImportSummary_ImportArn, v.ImportArn) + case schemas.ImportSummary_ImportStatus: + var ev string + if err := d.ReadString(schemas.ImportSummary_ImportStatus, &ev); err != nil { + return err + } + v.ImportStatus = ImportStatus(ev) + return nil + case schemas.ImportSummary_InputFormat: + var ev string + if err := d.ReadString(schemas.ImportSummary_InputFormat, &ev); err != nil { + return err + } + v.InputFormat = InputFormat(ev) + return nil + case schemas.ImportSummary_S3BucketSource: + v.S3BucketSource = &S3BucketSource{} + return v.S3BucketSource.Deserialize(d) + case schemas.ImportSummary_StartTime: + v.StartTime = new(time.Time) + return d.ReadTime(schemas.ImportSummary_StartTime, v.StartTime) + case schemas.ImportSummary_TableArn: + v.TableArn = new(string) + return d.ReadString(schemas.ImportSummary_TableArn, v.TableArn) + } + return nil + }) +} + // Represents the properties of the table being imported into. type ImportTableDescription struct { @@ -1984,6 +4448,151 @@ type ImportTableDescription struct { noSmithyDocumentSerde } +func (v *ImportTableDescription) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ImportTableDescription) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ImportTableDescription) SerializeMembers(s smithy.ShapeSerializer) { + if v.ClientToken != nil { + s.WriteString(schemas.ImportTableDescription_ClientToken, *v.ClientToken) + } + if v.CloudWatchLogGroupArn != nil { + s.WriteString(schemas.ImportTableDescription_CloudWatchLogGroupArn, *v.CloudWatchLogGroupArn) + } + if v.EndTime != nil { + s.WriteTime(schemas.ImportTableDescription_EndTime, *v.EndTime) + } + if v.ErrorCount != 0 { + s.WriteInt64(schemas.ImportTableDescription_ErrorCount, v.ErrorCount) + } + if v.FailureCode != nil { + s.WriteString(schemas.ImportTableDescription_FailureCode, *v.FailureCode) + } + if v.FailureMessage != nil { + s.WriteString(schemas.ImportTableDescription_FailureMessage, *v.FailureMessage) + } + if v.ImportArn != nil { + s.WriteString(schemas.ImportTableDescription_ImportArn, *v.ImportArn) + } + if v.ImportStatus != "" { + s.WriteString(schemas.ImportTableDescription_ImportStatus, string(v.ImportStatus)) + } + if v.ImportedItemCount != 0 { + s.WriteInt64(schemas.ImportTableDescription_ImportedItemCount, v.ImportedItemCount) + } + if v.InputCompressionType != "" { + s.WriteString(schemas.ImportTableDescription_InputCompressionType, string(v.InputCompressionType)) + } + if v.InputFormat != "" { + s.WriteString(schemas.ImportTableDescription_InputFormat, string(v.InputFormat)) + } + if v.InputFormatOptions != nil { + s.WriteStruct(schemas.ImportTableDescription_InputFormatOptions) + v.InputFormatOptions.SerializeMembers(s) + s.CloseStruct() + } + if v.ProcessedItemCount != 0 { + s.WriteInt64(schemas.ImportTableDescription_ProcessedItemCount, v.ProcessedItemCount) + } + if v.ProcessedSizeBytes != nil { + s.WriteInt64(schemas.ImportTableDescription_ProcessedSizeBytes, *v.ProcessedSizeBytes) + } + if v.S3BucketSource != nil { + s.WriteStruct(schemas.ImportTableDescription_S3BucketSource) + v.S3BucketSource.SerializeMembers(s) + s.CloseStruct() + } + if v.StartTime != nil { + s.WriteTime(schemas.ImportTableDescription_StartTime, *v.StartTime) + } + if v.TableArn != nil { + s.WriteString(schemas.ImportTableDescription_TableArn, *v.TableArn) + } + if v.TableCreationParameters != nil { + s.WriteStruct(schemas.ImportTableDescription_TableCreationParameters) + v.TableCreationParameters.SerializeMembers(s) + s.CloseStruct() + } + if v.TableId != nil { + s.WriteString(schemas.ImportTableDescription_TableId, *v.TableId) + } +} +func (v *ImportTableDescription) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ImportTableDescription, func(s *smithy.Schema) error { + switch s { + case schemas.ImportTableDescription_ClientToken: + v.ClientToken = new(string) + return d.ReadString(schemas.ImportTableDescription_ClientToken, v.ClientToken) + case schemas.ImportTableDescription_CloudWatchLogGroupArn: + v.CloudWatchLogGroupArn = new(string) + return d.ReadString(schemas.ImportTableDescription_CloudWatchLogGroupArn, v.CloudWatchLogGroupArn) + case schemas.ImportTableDescription_EndTime: + v.EndTime = new(time.Time) + return d.ReadTime(schemas.ImportTableDescription_EndTime, v.EndTime) + case schemas.ImportTableDescription_ErrorCount: + return d.ReadInt64(schemas.ImportTableDescription_ErrorCount, &v.ErrorCount) + case schemas.ImportTableDescription_FailureCode: + v.FailureCode = new(string) + return d.ReadString(schemas.ImportTableDescription_FailureCode, v.FailureCode) + case schemas.ImportTableDescription_FailureMessage: + v.FailureMessage = new(string) + return d.ReadString(schemas.ImportTableDescription_FailureMessage, v.FailureMessage) + case schemas.ImportTableDescription_ImportArn: + v.ImportArn = new(string) + return d.ReadString(schemas.ImportTableDescription_ImportArn, v.ImportArn) + case schemas.ImportTableDescription_ImportStatus: + var ev string + if err := d.ReadString(schemas.ImportTableDescription_ImportStatus, &ev); err != nil { + return err + } + v.ImportStatus = ImportStatus(ev) + return nil + case schemas.ImportTableDescription_ImportedItemCount: + return d.ReadInt64(schemas.ImportTableDescription_ImportedItemCount, &v.ImportedItemCount) + case schemas.ImportTableDescription_InputCompressionType: + var ev string + if err := d.ReadString(schemas.ImportTableDescription_InputCompressionType, &ev); err != nil { + return err + } + v.InputCompressionType = InputCompressionType(ev) + return nil + case schemas.ImportTableDescription_InputFormat: + var ev string + if err := d.ReadString(schemas.ImportTableDescription_InputFormat, &ev); err != nil { + return err + } + v.InputFormat = InputFormat(ev) + return nil + case schemas.ImportTableDescription_InputFormatOptions: + v.InputFormatOptions = &InputFormatOptions{} + return v.InputFormatOptions.Deserialize(d) + case schemas.ImportTableDescription_ProcessedItemCount: + return d.ReadInt64(schemas.ImportTableDescription_ProcessedItemCount, &v.ProcessedItemCount) + case schemas.ImportTableDescription_ProcessedSizeBytes: + v.ProcessedSizeBytes = new(int64) + return d.ReadInt64(schemas.ImportTableDescription_ProcessedSizeBytes, v.ProcessedSizeBytes) + case schemas.ImportTableDescription_S3BucketSource: + v.S3BucketSource = &S3BucketSource{} + return v.S3BucketSource.Deserialize(d) + case schemas.ImportTableDescription_StartTime: + v.StartTime = new(time.Time) + return d.ReadTime(schemas.ImportTableDescription_StartTime, v.StartTime) + case schemas.ImportTableDescription_TableArn: + v.TableArn = new(string) + return d.ReadString(schemas.ImportTableDescription_TableArn, v.TableArn) + case schemas.ImportTableDescription_TableCreationParameters: + v.TableCreationParameters = &TableCreationParameters{} + return v.TableCreationParameters.Deserialize(d) + case schemas.ImportTableDescription_TableId: + v.TableId = new(string) + return d.ReadString(schemas.ImportTableDescription_TableId, v.TableId) + } + return nil + }) +} + // Optional object containing the parameters specific to an incremental export. type IncrementalExportSpecification struct { @@ -2001,11 +4610,57 @@ type IncrementalExportSpecification struct { // The view type that was chosen for the export. Valid values are // NEW_AND_OLD_IMAGES and NEW_IMAGES . The default value is NEW_AND_OLD_IMAGES . + // + // NEW_AND_OLD_IMAGES exports both the new and old images of each changed item, + // while NEW_IMAGES exports only the new (latest) image. The view type you choose + // determines the structure of each item in the output for insert , update , and + // delete operations. For details and examples of how each view type shapes the + // export output, see [DynamoDB table export output format]in the Amazon DynamoDB Developer Guide. + // + // [DynamoDB table export output format]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/S3DataExport.Output.html ExportViewType ExportViewType noSmithyDocumentSerde } +func (v *IncrementalExportSpecification) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.IncrementalExportSpecification) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *IncrementalExportSpecification) SerializeMembers(s smithy.ShapeSerializer) { + if v.ExportFromTime != nil { + s.WriteTime(schemas.IncrementalExportSpecification_ExportFromTime, *v.ExportFromTime) + } + if v.ExportToTime != nil { + s.WriteTime(schemas.IncrementalExportSpecification_ExportToTime, *v.ExportToTime) + } + if v.ExportViewType != "" { + s.WriteString(schemas.IncrementalExportSpecification_ExportViewType, string(v.ExportViewType)) + } +} +func (v *IncrementalExportSpecification) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.IncrementalExportSpecification, func(s *smithy.Schema) error { + switch s { + case schemas.IncrementalExportSpecification_ExportFromTime: + v.ExportFromTime = new(time.Time) + return d.ReadTime(schemas.IncrementalExportSpecification_ExportFromTime, v.ExportFromTime) + case schemas.IncrementalExportSpecification_ExportToTime: + v.ExportToTime = new(time.Time) + return d.ReadTime(schemas.IncrementalExportSpecification_ExportToTime, v.ExportToTime) + case schemas.IncrementalExportSpecification_ExportViewType: + var ev string + if err := d.ReadString(schemas.IncrementalExportSpecification_ExportViewType, &ev); err != nil { + return err + } + v.ExportViewType = ExportViewType(ev) + return nil + } + return nil + }) +} + // The format options for the data that was imported into the target table. There // // is one value, CsvOption. @@ -2018,6 +4673,30 @@ type InputFormatOptions struct { noSmithyDocumentSerde } +func (v *InputFormatOptions) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.InputFormatOptions) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *InputFormatOptions) SerializeMembers(s smithy.ShapeSerializer) { + if v.Csv != nil { + s.WriteStruct(schemas.InputFormatOptions_Csv) + v.Csv.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *InputFormatOptions) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.InputFormatOptions, func(s *smithy.Schema) error { + switch s { + case schemas.InputFormatOptions_Csv: + v.Csv = &CsvOptions{} + return v.Csv.Deserialize(d) + } + return nil + }) +} + // Information about item collections, if any, that were affected by the // operation. ItemCollectionMetrics is only returned if the request asked for it. // If the table does not have any local secondary indexes, this information is not @@ -2042,6 +4721,28 @@ type ItemCollectionMetrics struct { noSmithyDocumentSerde } +func (v *ItemCollectionMetrics) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ItemCollectionMetrics) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ItemCollectionMetrics) SerializeMembers(s smithy.ShapeSerializer) { + serializeItemCollectionKeyAttributeMap(s, schemas.ItemCollectionMetrics_ItemCollectionKey, v.ItemCollectionKey) + serializeItemCollectionSizeEstimateRange(s, schemas.ItemCollectionMetrics_SizeEstimateRangeGB, v.SizeEstimateRangeGB) +} +func (v *ItemCollectionMetrics) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ItemCollectionMetrics, func(s *smithy.Schema) error { + switch s { + case schemas.ItemCollectionMetrics_ItemCollectionKey: + return deserializeItemCollectionKeyAttributeMap(d, schemas.ItemCollectionMetrics_ItemCollectionKey, &v.ItemCollectionKey) + case schemas.ItemCollectionMetrics_SizeEstimateRangeGB: + return deserializeItemCollectionSizeEstimateRange(d, schemas.ItemCollectionMetrics_SizeEstimateRangeGB, &v.SizeEstimateRangeGB) + } + return nil + }) +} + // Details for the requested item. type ItemResponse struct { @@ -2051,6 +4752,25 @@ type ItemResponse struct { noSmithyDocumentSerde } +func (v *ItemResponse) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ItemResponse) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ItemResponse) SerializeMembers(s smithy.ShapeSerializer) { + serializeAttributeMap(s, schemas.ItemResponse_Item, v.Item) +} +func (v *ItemResponse) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ItemResponse, func(s *smithy.Schema) error { + switch s { + case schemas.ItemResponse_Item: + return deserializeAttributeMap(d, schemas.ItemResponse_Item, &v.Item) + } + return nil + }) +} + // Represents a set of primary keys and, for each key, the attributes to retrieve // from the table. // @@ -2128,6 +4848,43 @@ type KeysAndAttributes struct { noSmithyDocumentSerde } +func (v *KeysAndAttributes) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.KeysAndAttributes) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *KeysAndAttributes) SerializeMembers(s smithy.ShapeSerializer) { + serializeAttributeNameList(s, schemas.KeysAndAttributes_AttributesToGet, v.AttributesToGet) + if v.ConsistentRead != nil { + s.WriteBool(schemas.KeysAndAttributes_ConsistentRead, *v.ConsistentRead) + } + serializeExpressionAttributeNameMap(s, schemas.KeysAndAttributes_ExpressionAttributeNames, v.ExpressionAttributeNames) + serializeKeyList(s, schemas.KeysAndAttributes_Keys, v.Keys) + if v.ProjectionExpression != nil { + s.WriteString(schemas.KeysAndAttributes_ProjectionExpression, *v.ProjectionExpression) + } +} +func (v *KeysAndAttributes) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.KeysAndAttributes, func(s *smithy.Schema) error { + switch s { + case schemas.KeysAndAttributes_AttributesToGet: + return deserializeAttributeNameList(d, schemas.KeysAndAttributes_AttributesToGet, &v.AttributesToGet) + case schemas.KeysAndAttributes_ConsistentRead: + v.ConsistentRead = new(bool) + return d.ReadBool(schemas.KeysAndAttributes_ConsistentRead, v.ConsistentRead) + case schemas.KeysAndAttributes_ExpressionAttributeNames: + return deserializeExpressionAttributeNameMap(d, schemas.KeysAndAttributes_ExpressionAttributeNames, &v.ExpressionAttributeNames) + case schemas.KeysAndAttributes_Keys: + return deserializeKeyList(d, schemas.KeysAndAttributes_Keys, &v.Keys) + case schemas.KeysAndAttributes_ProjectionExpression: + v.ProjectionExpression = new(string) + return d.ReadString(schemas.KeysAndAttributes_ProjectionExpression, v.ProjectionExpression) + } + return nil + }) +} + // Represents a single element of a key schema. A key schema specifies the // attributes that make up the primary key of a table, or the key attributes of an // index. @@ -2168,6 +4925,38 @@ type KeySchemaElement struct { noSmithyDocumentSerde } +func (v *KeySchemaElement) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.KeySchemaElement) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *KeySchemaElement) SerializeMembers(s smithy.ShapeSerializer) { + if v.AttributeName != nil { + s.WriteString(schemas.KeySchemaElement_AttributeName, *v.AttributeName) + } + if v.KeyType != "" { + s.WriteString(schemas.KeySchemaElement_KeyType, string(v.KeyType)) + } +} +func (v *KeySchemaElement) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.KeySchemaElement, func(s *smithy.Schema) error { + switch s { + case schemas.KeySchemaElement_AttributeName: + v.AttributeName = new(string) + return d.ReadString(schemas.KeySchemaElement_AttributeName, v.AttributeName) + case schemas.KeySchemaElement_KeyType: + var ev string + if err := d.ReadString(schemas.KeySchemaElement_KeyType, &ev); err != nil { + return err + } + v.KeyType = KeyType(ev) + return nil + } + return nil + }) +} + // Describes a Kinesis data stream destination. type KinesisDataStreamDestination struct { @@ -2187,6 +4976,54 @@ type KinesisDataStreamDestination struct { noSmithyDocumentSerde } +func (v *KinesisDataStreamDestination) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.KinesisDataStreamDestination) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *KinesisDataStreamDestination) SerializeMembers(s smithy.ShapeSerializer) { + if v.ApproximateCreationDateTimePrecision != "" { + s.WriteString(schemas.KinesisDataStreamDestination_ApproximateCreationDateTimePrecision, string(v.ApproximateCreationDateTimePrecision)) + } + if v.DestinationStatus != "" { + s.WriteString(schemas.KinesisDataStreamDestination_DestinationStatus, string(v.DestinationStatus)) + } + if v.DestinationStatusDescription != nil { + s.WriteString(schemas.KinesisDataStreamDestination_DestinationStatusDescription, *v.DestinationStatusDescription) + } + if v.StreamArn != nil { + s.WriteString(schemas.KinesisDataStreamDestination_StreamArn, *v.StreamArn) + } +} +func (v *KinesisDataStreamDestination) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.KinesisDataStreamDestination, func(s *smithy.Schema) error { + switch s { + case schemas.KinesisDataStreamDestination_ApproximateCreationDateTimePrecision: + var ev string + if err := d.ReadString(schemas.KinesisDataStreamDestination_ApproximateCreationDateTimePrecision, &ev); err != nil { + return err + } + v.ApproximateCreationDateTimePrecision = ApproximateCreationDateTimePrecision(ev) + return nil + case schemas.KinesisDataStreamDestination_DestinationStatus: + var ev string + if err := d.ReadString(schemas.KinesisDataStreamDestination_DestinationStatus, &ev); err != nil { + return err + } + v.DestinationStatus = DestinationStatus(ev) + return nil + case schemas.KinesisDataStreamDestination_DestinationStatusDescription: + v.DestinationStatusDescription = new(string) + return d.ReadString(schemas.KinesisDataStreamDestination_DestinationStatusDescription, v.DestinationStatusDescription) + case schemas.KinesisDataStreamDestination_StreamArn: + v.StreamArn = new(string) + return d.ReadString(schemas.KinesisDataStreamDestination_StreamArn, v.StreamArn) + } + return nil + }) +} + // Represents the properties of a local secondary index. type LocalSecondaryIndex struct { @@ -2225,6 +5062,39 @@ type LocalSecondaryIndex struct { noSmithyDocumentSerde } +func (v *LocalSecondaryIndex) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.LocalSecondaryIndex) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *LocalSecondaryIndex) SerializeMembers(s smithy.ShapeSerializer) { + if v.IndexName != nil { + s.WriteString(schemas.LocalSecondaryIndex_IndexName, *v.IndexName) + } + serializeKeySchema(s, schemas.LocalSecondaryIndex_KeySchema, v.KeySchema) + if v.Projection != nil { + s.WriteStruct(schemas.LocalSecondaryIndex_Projection) + v.Projection.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *LocalSecondaryIndex) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.LocalSecondaryIndex, func(s *smithy.Schema) error { + switch s { + case schemas.LocalSecondaryIndex_IndexName: + v.IndexName = new(string) + return d.ReadString(schemas.LocalSecondaryIndex_IndexName, v.IndexName) + case schemas.LocalSecondaryIndex_KeySchema: + return deserializeKeySchema(d, schemas.LocalSecondaryIndex_KeySchema, &v.KeySchema) + case schemas.LocalSecondaryIndex_Projection: + v.Projection = &Projection{} + return v.Projection.Deserialize(d) + } + return nil + }) +} + // Represents the properties of a local secondary index. type LocalSecondaryIndexDescription struct { @@ -2269,6 +5139,57 @@ type LocalSecondaryIndexDescription struct { noSmithyDocumentSerde } +func (v *LocalSecondaryIndexDescription) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.LocalSecondaryIndexDescription) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *LocalSecondaryIndexDescription) SerializeMembers(s smithy.ShapeSerializer) { + if v.IndexArn != nil { + s.WriteString(schemas.LocalSecondaryIndexDescription_IndexArn, *v.IndexArn) + } + if v.IndexName != nil { + s.WriteString(schemas.LocalSecondaryIndexDescription_IndexName, *v.IndexName) + } + if v.IndexSizeBytes != nil { + s.WriteInt64(schemas.LocalSecondaryIndexDescription_IndexSizeBytes, *v.IndexSizeBytes) + } + if v.ItemCount != nil { + s.WriteInt64(schemas.LocalSecondaryIndexDescription_ItemCount, *v.ItemCount) + } + serializeKeySchema(s, schemas.LocalSecondaryIndexDescription_KeySchema, v.KeySchema) + if v.Projection != nil { + s.WriteStruct(schemas.LocalSecondaryIndexDescription_Projection) + v.Projection.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *LocalSecondaryIndexDescription) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.LocalSecondaryIndexDescription, func(s *smithy.Schema) error { + switch s { + case schemas.LocalSecondaryIndexDescription_IndexArn: + v.IndexArn = new(string) + return d.ReadString(schemas.LocalSecondaryIndexDescription_IndexArn, v.IndexArn) + case schemas.LocalSecondaryIndexDescription_IndexName: + v.IndexName = new(string) + return d.ReadString(schemas.LocalSecondaryIndexDescription_IndexName, v.IndexName) + case schemas.LocalSecondaryIndexDescription_IndexSizeBytes: + v.IndexSizeBytes = new(int64) + return d.ReadInt64(schemas.LocalSecondaryIndexDescription_IndexSizeBytes, v.IndexSizeBytes) + case schemas.LocalSecondaryIndexDescription_ItemCount: + v.ItemCount = new(int64) + return d.ReadInt64(schemas.LocalSecondaryIndexDescription_ItemCount, v.ItemCount) + case schemas.LocalSecondaryIndexDescription_KeySchema: + return deserializeKeySchema(d, schemas.LocalSecondaryIndexDescription_KeySchema, &v.KeySchema) + case schemas.LocalSecondaryIndexDescription_Projection: + v.Projection = &Projection{} + return v.Projection.Deserialize(d) + } + return nil + }) +} + // Represents the properties of a local secondary index for the table when the // backup was created. type LocalSecondaryIndexInfo struct { @@ -2301,6 +5222,39 @@ type LocalSecondaryIndexInfo struct { noSmithyDocumentSerde } +func (v *LocalSecondaryIndexInfo) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.LocalSecondaryIndexInfo) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *LocalSecondaryIndexInfo) SerializeMembers(s smithy.ShapeSerializer) { + if v.IndexName != nil { + s.WriteString(schemas.LocalSecondaryIndexInfo_IndexName, *v.IndexName) + } + serializeKeySchema(s, schemas.LocalSecondaryIndexInfo_KeySchema, v.KeySchema) + if v.Projection != nil { + s.WriteStruct(schemas.LocalSecondaryIndexInfo_Projection) + v.Projection.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *LocalSecondaryIndexInfo) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.LocalSecondaryIndexInfo, func(s *smithy.Schema) error { + switch s { + case schemas.LocalSecondaryIndexInfo_IndexName: + v.IndexName = new(string) + return d.ReadString(schemas.LocalSecondaryIndexInfo_IndexName, v.IndexName) + case schemas.LocalSecondaryIndexInfo_KeySchema: + return deserializeKeySchema(d, schemas.LocalSecondaryIndexInfo_KeySchema, &v.KeySchema) + case schemas.LocalSecondaryIndexInfo_Projection: + v.Projection = &Projection{} + return v.Projection.Deserialize(d) + } + return nil + }) +} + // Sets the maximum number of read and write units for the specified on-demand // table. If you use this parameter, you must specify MaxReadRequestUnits , // MaxWriteRequestUnits , or both. @@ -2325,6 +5279,34 @@ type OnDemandThroughput struct { noSmithyDocumentSerde } +func (v *OnDemandThroughput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.OnDemandThroughput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *OnDemandThroughput) SerializeMembers(s smithy.ShapeSerializer) { + if v.MaxReadRequestUnits != nil { + s.WriteInt64(schemas.OnDemandThroughput_MaxReadRequestUnits, *v.MaxReadRequestUnits) + } + if v.MaxWriteRequestUnits != nil { + s.WriteInt64(schemas.OnDemandThroughput_MaxWriteRequestUnits, *v.MaxWriteRequestUnits) + } +} +func (v *OnDemandThroughput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.OnDemandThroughput, func(s *smithy.Schema) error { + switch s { + case schemas.OnDemandThroughput_MaxReadRequestUnits: + v.MaxReadRequestUnits = new(int64) + return d.ReadInt64(schemas.OnDemandThroughput_MaxReadRequestUnits, v.MaxReadRequestUnits) + case schemas.OnDemandThroughput_MaxWriteRequestUnits: + v.MaxWriteRequestUnits = new(int64) + return d.ReadInt64(schemas.OnDemandThroughput_MaxWriteRequestUnits, v.MaxWriteRequestUnits) + } + return nil + }) +} + // Overrides the on-demand throughput settings for this replica table. If you // don't specify a value for this parameter, it uses the source table's on-demand // throughput settings. @@ -2336,6 +5318,28 @@ type OnDemandThroughputOverride struct { noSmithyDocumentSerde } +func (v *OnDemandThroughputOverride) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.OnDemandThroughputOverride) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *OnDemandThroughputOverride) SerializeMembers(s smithy.ShapeSerializer) { + if v.MaxReadRequestUnits != nil { + s.WriteInt64(schemas.OnDemandThroughputOverride_MaxReadRequestUnits, *v.MaxReadRequestUnits) + } +} +func (v *OnDemandThroughputOverride) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.OnDemandThroughputOverride, func(s *smithy.Schema) error { + switch s { + case schemas.OnDemandThroughputOverride_MaxReadRequestUnits: + v.MaxReadRequestUnits = new(int64) + return d.ReadInt64(schemas.OnDemandThroughputOverride_MaxReadRequestUnits, v.MaxReadRequestUnits) + } + return nil + }) +} + // Represents a PartiQL statement that uses parameters. type ParameterizedStatement struct { @@ -2358,6 +5362,41 @@ type ParameterizedStatement struct { noSmithyDocumentSerde } +func (v *ParameterizedStatement) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ParameterizedStatement) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ParameterizedStatement) SerializeMembers(s smithy.ShapeSerializer) { + serializePreparedStatementParameters(s, schemas.ParameterizedStatement_Parameters, v.Parameters) + if v.ReturnValuesOnConditionCheckFailure != "" { + s.WriteString(schemas.ParameterizedStatement_ReturnValuesOnConditionCheckFailure, string(v.ReturnValuesOnConditionCheckFailure)) + } + if v.Statement != nil { + s.WriteString(schemas.ParameterizedStatement_Statement, *v.Statement) + } +} +func (v *ParameterizedStatement) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ParameterizedStatement, func(s *smithy.Schema) error { + switch s { + case schemas.ParameterizedStatement_Parameters: + return deserializePreparedStatementParameters(d, schemas.ParameterizedStatement_Parameters, &v.Parameters) + case schemas.ParameterizedStatement_ReturnValuesOnConditionCheckFailure: + var ev string + if err := d.ReadString(schemas.ParameterizedStatement_ReturnValuesOnConditionCheckFailure, &ev); err != nil { + return err + } + v.ReturnValuesOnConditionCheckFailure = ReturnValuesOnConditionCheckFailure(ev) + return nil + case schemas.ParameterizedStatement_Statement: + v.Statement = new(string) + return d.ReadString(schemas.ParameterizedStatement_Statement, v.Statement) + } + return nil + }) +} + // The description of the point in time settings applied to the table. type PointInTimeRecoveryDescription struct { @@ -2383,6 +5422,50 @@ type PointInTimeRecoveryDescription struct { noSmithyDocumentSerde } +func (v *PointInTimeRecoveryDescription) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.PointInTimeRecoveryDescription) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *PointInTimeRecoveryDescription) SerializeMembers(s smithy.ShapeSerializer) { + if v.EarliestRestorableDateTime != nil { + s.WriteTime(schemas.PointInTimeRecoveryDescription_EarliestRestorableDateTime, *v.EarliestRestorableDateTime) + } + if v.LatestRestorableDateTime != nil { + s.WriteTime(schemas.PointInTimeRecoveryDescription_LatestRestorableDateTime, *v.LatestRestorableDateTime) + } + if v.PointInTimeRecoveryStatus != "" { + s.WriteString(schemas.PointInTimeRecoveryDescription_PointInTimeRecoveryStatus, string(v.PointInTimeRecoveryStatus)) + } + if v.RecoveryPeriodInDays != nil { + s.WriteInt32(schemas.PointInTimeRecoveryDescription_RecoveryPeriodInDays, *v.RecoveryPeriodInDays) + } +} +func (v *PointInTimeRecoveryDescription) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.PointInTimeRecoveryDescription, func(s *smithy.Schema) error { + switch s { + case schemas.PointInTimeRecoveryDescription_EarliestRestorableDateTime: + v.EarliestRestorableDateTime = new(time.Time) + return d.ReadTime(schemas.PointInTimeRecoveryDescription_EarliestRestorableDateTime, v.EarliestRestorableDateTime) + case schemas.PointInTimeRecoveryDescription_LatestRestorableDateTime: + v.LatestRestorableDateTime = new(time.Time) + return d.ReadTime(schemas.PointInTimeRecoveryDescription_LatestRestorableDateTime, v.LatestRestorableDateTime) + case schemas.PointInTimeRecoveryDescription_PointInTimeRecoveryStatus: + var ev string + if err := d.ReadString(schemas.PointInTimeRecoveryDescription_PointInTimeRecoveryStatus, &ev); err != nil { + return err + } + v.PointInTimeRecoveryStatus = PointInTimeRecoveryStatus(ev) + return nil + case schemas.PointInTimeRecoveryDescription_RecoveryPeriodInDays: + v.RecoveryPeriodInDays = new(int32) + return d.ReadInt32(schemas.PointInTimeRecoveryDescription_RecoveryPeriodInDays, v.RecoveryPeriodInDays) + } + return nil + }) +} + // Represents the settings used to enable point in time recovery. type PointInTimeRecoverySpecification struct { @@ -2401,6 +5484,34 @@ type PointInTimeRecoverySpecification struct { noSmithyDocumentSerde } +func (v *PointInTimeRecoverySpecification) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.PointInTimeRecoverySpecification) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *PointInTimeRecoverySpecification) SerializeMembers(s smithy.ShapeSerializer) { + if v.PointInTimeRecoveryEnabled != nil { + s.WriteBool(schemas.PointInTimeRecoverySpecification_PointInTimeRecoveryEnabled, *v.PointInTimeRecoveryEnabled) + } + if v.RecoveryPeriodInDays != nil { + s.WriteInt32(schemas.PointInTimeRecoverySpecification_RecoveryPeriodInDays, *v.RecoveryPeriodInDays) + } +} +func (v *PointInTimeRecoverySpecification) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.PointInTimeRecoverySpecification, func(s *smithy.Schema) error { + switch s { + case schemas.PointInTimeRecoverySpecification_PointInTimeRecoveryEnabled: + v.PointInTimeRecoveryEnabled = new(bool) + return d.ReadBool(schemas.PointInTimeRecoverySpecification_PointInTimeRecoveryEnabled, v.PointInTimeRecoveryEnabled) + case schemas.PointInTimeRecoverySpecification_RecoveryPeriodInDays: + v.RecoveryPeriodInDays = new(int32) + return d.ReadInt32(schemas.PointInTimeRecoverySpecification_RecoveryPeriodInDays, v.RecoveryPeriodInDays) + } + return nil + }) +} + // Represents attributes that are copied (projected) from the table into an index. // These are in addition to the primary key attributes and index key attributes, // which are automatically projected. @@ -2432,6 +5543,35 @@ type Projection struct { noSmithyDocumentSerde } +func (v *Projection) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.Projection) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *Projection) SerializeMembers(s smithy.ShapeSerializer) { + serializeNonKeyAttributeNameList(s, schemas.Projection_NonKeyAttributes, v.NonKeyAttributes) + if v.ProjectionType != "" { + s.WriteString(schemas.Projection_ProjectionType, string(v.ProjectionType)) + } +} +func (v *Projection) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.Projection, func(s *smithy.Schema) error { + switch s { + case schemas.Projection_NonKeyAttributes: + return deserializeNonKeyAttributeNameList(d, schemas.Projection_NonKeyAttributes, &v.NonKeyAttributes) + case schemas.Projection_ProjectionType: + var ev string + if err := d.ReadString(schemas.Projection_ProjectionType, &ev); err != nil { + return err + } + v.ProjectionType = ProjectionType(ev) + return nil + } + return nil + }) +} + // Represents the provisioned throughput settings for the specified global // secondary index. You must use ProvisionedThroughput or OnDemandThroughput based // on your table’s capacity mode. @@ -2467,6 +5607,34 @@ type ProvisionedThroughput struct { noSmithyDocumentSerde } +func (v *ProvisionedThroughput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ProvisionedThroughput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ProvisionedThroughput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ReadCapacityUnits != nil { + s.WriteInt64(schemas.ProvisionedThroughput_ReadCapacityUnits, *v.ReadCapacityUnits) + } + if v.WriteCapacityUnits != nil { + s.WriteInt64(schemas.ProvisionedThroughput_WriteCapacityUnits, *v.WriteCapacityUnits) + } +} +func (v *ProvisionedThroughput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ProvisionedThroughput, func(s *smithy.Schema) error { + switch s { + case schemas.ProvisionedThroughput_ReadCapacityUnits: + v.ReadCapacityUnits = new(int64) + return d.ReadInt64(schemas.ProvisionedThroughput_ReadCapacityUnits, v.ReadCapacityUnits) + case schemas.ProvisionedThroughput_WriteCapacityUnits: + v.WriteCapacityUnits = new(int64) + return d.ReadInt64(schemas.ProvisionedThroughput_WriteCapacityUnits, v.WriteCapacityUnits) + } + return nil + }) +} + // Represents the provisioned throughput settings for the table, consisting of // read and write capacity units, along with data about increases and decreases. type ProvisionedThroughputDescription struct { @@ -2488,15 +5656,69 @@ type ProvisionedThroughputDescription struct { // DynamoDB returns a ThrottlingException . Eventually consistent reads require // less effort than strongly consistent reads, so a setting of 50 ReadCapacityUnits // per second provides 100 eventually consistent ReadCapacityUnits per second. + // + // For a table or global secondary index that uses on-demand capacity mode ( + // PAY_PER_REQUEST ), this value is 0 , because on-demand mode does not use + // provisioned throughput. ReadCapacityUnits *int64 // The maximum number of writes consumed per second before DynamoDB returns a // ThrottlingException . + // + // For a table or global secondary index that uses on-demand capacity mode ( + // PAY_PER_REQUEST ), this value is 0 , because on-demand mode does not use + // provisioned throughput. WriteCapacityUnits *int64 noSmithyDocumentSerde } +func (v *ProvisionedThroughputDescription) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ProvisionedThroughputDescription) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ProvisionedThroughputDescription) SerializeMembers(s smithy.ShapeSerializer) { + if v.LastDecreaseDateTime != nil { + s.WriteTime(schemas.ProvisionedThroughputDescription_LastDecreaseDateTime, *v.LastDecreaseDateTime) + } + if v.LastIncreaseDateTime != nil { + s.WriteTime(schemas.ProvisionedThroughputDescription_LastIncreaseDateTime, *v.LastIncreaseDateTime) + } + if v.NumberOfDecreasesToday != nil { + s.WriteInt64(schemas.ProvisionedThroughputDescription_NumberOfDecreasesToday, *v.NumberOfDecreasesToday) + } + if v.ReadCapacityUnits != nil { + s.WriteInt64(schemas.ProvisionedThroughputDescription_ReadCapacityUnits, *v.ReadCapacityUnits) + } + if v.WriteCapacityUnits != nil { + s.WriteInt64(schemas.ProvisionedThroughputDescription_WriteCapacityUnits, *v.WriteCapacityUnits) + } +} +func (v *ProvisionedThroughputDescription) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ProvisionedThroughputDescription, func(s *smithy.Schema) error { + switch s { + case schemas.ProvisionedThroughputDescription_LastDecreaseDateTime: + v.LastDecreaseDateTime = new(time.Time) + return d.ReadTime(schemas.ProvisionedThroughputDescription_LastDecreaseDateTime, v.LastDecreaseDateTime) + case schemas.ProvisionedThroughputDescription_LastIncreaseDateTime: + v.LastIncreaseDateTime = new(time.Time) + return d.ReadTime(schemas.ProvisionedThroughputDescription_LastIncreaseDateTime, v.LastIncreaseDateTime) + case schemas.ProvisionedThroughputDescription_NumberOfDecreasesToday: + v.NumberOfDecreasesToday = new(int64) + return d.ReadInt64(schemas.ProvisionedThroughputDescription_NumberOfDecreasesToday, v.NumberOfDecreasesToday) + case schemas.ProvisionedThroughputDescription_ReadCapacityUnits: + v.ReadCapacityUnits = new(int64) + return d.ReadInt64(schemas.ProvisionedThroughputDescription_ReadCapacityUnits, v.ReadCapacityUnits) + case schemas.ProvisionedThroughputDescription_WriteCapacityUnits: + v.WriteCapacityUnits = new(int64) + return d.ReadInt64(schemas.ProvisionedThroughputDescription_WriteCapacityUnits, v.WriteCapacityUnits) + } + return nil + }) +} + // Replica-specific provisioned throughput settings. If not specified, uses the // source table's provisioned throughput settings. type ProvisionedThroughputOverride struct { @@ -2508,6 +5730,28 @@ type ProvisionedThroughputOverride struct { noSmithyDocumentSerde } +func (v *ProvisionedThroughputOverride) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ProvisionedThroughputOverride) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ProvisionedThroughputOverride) SerializeMembers(s smithy.ShapeSerializer) { + if v.ReadCapacityUnits != nil { + s.WriteInt64(schemas.ProvisionedThroughputOverride_ReadCapacityUnits, *v.ReadCapacityUnits) + } +} +func (v *ProvisionedThroughputOverride) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ProvisionedThroughputOverride, func(s *smithy.Schema) error { + switch s { + case schemas.ProvisionedThroughputOverride_ReadCapacityUnits: + v.ReadCapacityUnits = new(int64) + return d.ReadInt64(schemas.ProvisionedThroughputOverride_ReadCapacityUnits, v.ReadCapacityUnits) + } + return nil + }) +} + // Represents a request to perform a PutItem operation. type Put struct { @@ -2543,6 +5787,53 @@ type Put struct { noSmithyDocumentSerde } +func (v *Put) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.Put) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *Put) SerializeMembers(s smithy.ShapeSerializer) { + if v.ConditionExpression != nil { + s.WriteString(schemas.Put_ConditionExpression, *v.ConditionExpression) + } + serializeExpressionAttributeNameMap(s, schemas.Put_ExpressionAttributeNames, v.ExpressionAttributeNames) + serializeExpressionAttributeValueMap(s, schemas.Put_ExpressionAttributeValues, v.ExpressionAttributeValues) + serializePutItemInputAttributeMap(s, schemas.Put_Item, v.Item) + if v.ReturnValuesOnConditionCheckFailure != "" { + s.WriteString(schemas.Put_ReturnValuesOnConditionCheckFailure, string(v.ReturnValuesOnConditionCheckFailure)) + } + if v.TableName != nil { + s.WriteString(schemas.Put_TableName, *v.TableName) + } +} +func (v *Put) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.Put, func(s *smithy.Schema) error { + switch s { + case schemas.Put_ConditionExpression: + v.ConditionExpression = new(string) + return d.ReadString(schemas.Put_ConditionExpression, v.ConditionExpression) + case schemas.Put_ExpressionAttributeNames: + return deserializeExpressionAttributeNameMap(d, schemas.Put_ExpressionAttributeNames, &v.ExpressionAttributeNames) + case schemas.Put_ExpressionAttributeValues: + return deserializeExpressionAttributeValueMap(d, schemas.Put_ExpressionAttributeValues, &v.ExpressionAttributeValues) + case schemas.Put_Item: + return deserializePutItemInputAttributeMap(d, schemas.Put_Item, &v.Item) + case schemas.Put_ReturnValuesOnConditionCheckFailure: + var ev string + if err := d.ReadString(schemas.Put_ReturnValuesOnConditionCheckFailure, &ev); err != nil { + return err + } + v.ReturnValuesOnConditionCheckFailure = ReturnValuesOnConditionCheckFailure(ev) + return nil + case schemas.Put_TableName: + v.TableName = new(string) + return d.ReadString(schemas.Put_TableName, v.TableName) + } + return nil + }) +} + // Represents a request to perform a PutItem operation on an item. type PutRequest struct { @@ -2558,6 +5849,25 @@ type PutRequest struct { noSmithyDocumentSerde } +func (v *PutRequest) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.PutRequest) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *PutRequest) SerializeMembers(s smithy.ShapeSerializer) { + serializePutItemInputAttributeMap(s, schemas.PutRequest_Item, v.Item) +} +func (v *PutRequest) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.PutRequest, func(s *smithy.Schema) error { + switch s { + case schemas.PutRequest_Item: + return deserializePutItemInputAttributeMap(d, schemas.PutRequest_Item, &v.Item) + } + return nil + }) +} + // Represents the properties of a replica. type Replica struct { @@ -2567,6 +5877,28 @@ type Replica struct { noSmithyDocumentSerde } +func (v *Replica) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.Replica) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *Replica) SerializeMembers(s smithy.ShapeSerializer) { + if v.RegionName != nil { + s.WriteString(schemas.Replica_RegionName, *v.RegionName) + } +} +func (v *Replica) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.Replica, func(s *smithy.Schema) error { + switch s { + case schemas.Replica_RegionName: + v.RegionName = new(string) + return d.ReadString(schemas.Replica_RegionName, v.RegionName) + } + return nil + }) +} + // Represents the auto scaling settings of the replica. type ReplicaAutoScalingDescription struct { @@ -2598,6 +5930,57 @@ type ReplicaAutoScalingDescription struct { noSmithyDocumentSerde } +func (v *ReplicaAutoScalingDescription) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ReplicaAutoScalingDescription) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ReplicaAutoScalingDescription) SerializeMembers(s smithy.ShapeSerializer) { + serializeReplicaGlobalSecondaryIndexAutoScalingDescriptionList(s, schemas.ReplicaAutoScalingDescription_GlobalSecondaryIndexes, v.GlobalSecondaryIndexes) + if v.RegionName != nil { + s.WriteString(schemas.ReplicaAutoScalingDescription_RegionName, *v.RegionName) + } + if v.ReplicaProvisionedReadCapacityAutoScalingSettings != nil { + s.WriteStruct(schemas.ReplicaAutoScalingDescription_ReplicaProvisionedReadCapacityAutoScalingSettings) + v.ReplicaProvisionedReadCapacityAutoScalingSettings.SerializeMembers(s) + s.CloseStruct() + } + if v.ReplicaProvisionedWriteCapacityAutoScalingSettings != nil { + s.WriteStruct(schemas.ReplicaAutoScalingDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings) + v.ReplicaProvisionedWriteCapacityAutoScalingSettings.SerializeMembers(s) + s.CloseStruct() + } + if v.ReplicaStatus != "" { + s.WriteString(schemas.ReplicaAutoScalingDescription_ReplicaStatus, string(v.ReplicaStatus)) + } +} +func (v *ReplicaAutoScalingDescription) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ReplicaAutoScalingDescription, func(s *smithy.Schema) error { + switch s { + case schemas.ReplicaAutoScalingDescription_GlobalSecondaryIndexes: + return deserializeReplicaGlobalSecondaryIndexAutoScalingDescriptionList(d, schemas.ReplicaAutoScalingDescription_GlobalSecondaryIndexes, &v.GlobalSecondaryIndexes) + case schemas.ReplicaAutoScalingDescription_RegionName: + v.RegionName = new(string) + return d.ReadString(schemas.ReplicaAutoScalingDescription_RegionName, v.RegionName) + case schemas.ReplicaAutoScalingDescription_ReplicaProvisionedReadCapacityAutoScalingSettings: + v.ReplicaProvisionedReadCapacityAutoScalingSettings = &AutoScalingSettingsDescription{} + return v.ReplicaProvisionedReadCapacityAutoScalingSettings.Deserialize(d) + case schemas.ReplicaAutoScalingDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings: + v.ReplicaProvisionedWriteCapacityAutoScalingSettings = &AutoScalingSettingsDescription{} + return v.ReplicaProvisionedWriteCapacityAutoScalingSettings.Deserialize(d) + case schemas.ReplicaAutoScalingDescription_ReplicaStatus: + var ev string + if err := d.ReadString(schemas.ReplicaAutoScalingDescription_ReplicaStatus, &ev); err != nil { + return err + } + v.ReplicaStatus = ReplicaStatus(ev) + return nil + } + return nil + }) +} + // Represents the auto scaling settings of a replica that will be modified. type ReplicaAutoScalingUpdate struct { @@ -2617,6 +6000,39 @@ type ReplicaAutoScalingUpdate struct { noSmithyDocumentSerde } +func (v *ReplicaAutoScalingUpdate) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ReplicaAutoScalingUpdate) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ReplicaAutoScalingUpdate) SerializeMembers(s smithy.ShapeSerializer) { + if v.RegionName != nil { + s.WriteString(schemas.ReplicaAutoScalingUpdate_RegionName, *v.RegionName) + } + serializeReplicaGlobalSecondaryIndexAutoScalingUpdateList(s, schemas.ReplicaAutoScalingUpdate_ReplicaGlobalSecondaryIndexUpdates, v.ReplicaGlobalSecondaryIndexUpdates) + if v.ReplicaProvisionedReadCapacityAutoScalingUpdate != nil { + s.WriteStruct(schemas.ReplicaAutoScalingUpdate_ReplicaProvisionedReadCapacityAutoScalingUpdate) + v.ReplicaProvisionedReadCapacityAutoScalingUpdate.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *ReplicaAutoScalingUpdate) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ReplicaAutoScalingUpdate, func(s *smithy.Schema) error { + switch s { + case schemas.ReplicaAutoScalingUpdate_RegionName: + v.RegionName = new(string) + return d.ReadString(schemas.ReplicaAutoScalingUpdate_RegionName, v.RegionName) + case schemas.ReplicaAutoScalingUpdate_ReplicaGlobalSecondaryIndexUpdates: + return deserializeReplicaGlobalSecondaryIndexAutoScalingUpdateList(d, schemas.ReplicaAutoScalingUpdate_ReplicaGlobalSecondaryIndexUpdates, &v.ReplicaGlobalSecondaryIndexUpdates) + case schemas.ReplicaAutoScalingUpdate_ReplicaProvisionedReadCapacityAutoScalingUpdate: + v.ReplicaProvisionedReadCapacityAutoScalingUpdate = &AutoScalingSettingsUpdate{} + return v.ReplicaProvisionedReadCapacityAutoScalingUpdate.Deserialize(d) + } + return nil + }) +} + // Contains the details of the replica. type ReplicaDescription struct { @@ -2698,6 +6114,113 @@ type ReplicaDescription struct { noSmithyDocumentSerde } +func (v *ReplicaDescription) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ReplicaDescription) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ReplicaDescription) SerializeMembers(s smithy.ShapeSerializer) { + serializeReplicaGlobalSecondaryIndexDescriptionList(s, schemas.ReplicaDescription_GlobalSecondaryIndexes, v.GlobalSecondaryIndexes) + if v.GlobalTableSettingsReplicationMode != "" { + s.WriteString(schemas.ReplicaDescription_GlobalTableSettingsReplicationMode, string(v.GlobalTableSettingsReplicationMode)) + } + if v.KMSMasterKeyId != nil { + s.WriteString(schemas.ReplicaDescription_KMSMasterKeyId, *v.KMSMasterKeyId) + } + if v.OnDemandThroughputOverride != nil { + s.WriteStruct(schemas.ReplicaDescription_OnDemandThroughputOverride) + v.OnDemandThroughputOverride.SerializeMembers(s) + s.CloseStruct() + } + if v.ProvisionedThroughputOverride != nil { + s.WriteStruct(schemas.ReplicaDescription_ProvisionedThroughputOverride) + v.ProvisionedThroughputOverride.SerializeMembers(s) + s.CloseStruct() + } + if v.RegionName != nil { + s.WriteString(schemas.ReplicaDescription_RegionName, *v.RegionName) + } + if v.ReplicaArn != nil { + s.WriteString(schemas.ReplicaDescription_ReplicaArn, *v.ReplicaArn) + } + if v.ReplicaInaccessibleDateTime != nil { + s.WriteTime(schemas.ReplicaDescription_ReplicaInaccessibleDateTime, *v.ReplicaInaccessibleDateTime) + } + if v.ReplicaStatus != "" { + s.WriteString(schemas.ReplicaDescription_ReplicaStatus, string(v.ReplicaStatus)) + } + if v.ReplicaStatusDescription != nil { + s.WriteString(schemas.ReplicaDescription_ReplicaStatusDescription, *v.ReplicaStatusDescription) + } + if v.ReplicaStatusPercentProgress != nil { + s.WriteString(schemas.ReplicaDescription_ReplicaStatusPercentProgress, *v.ReplicaStatusPercentProgress) + } + if v.ReplicaTableClassSummary != nil { + s.WriteStruct(schemas.ReplicaDescription_ReplicaTableClassSummary) + v.ReplicaTableClassSummary.SerializeMembers(s) + s.CloseStruct() + } + if v.WarmThroughput != nil { + s.WriteStruct(schemas.ReplicaDescription_WarmThroughput) + v.WarmThroughput.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *ReplicaDescription) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ReplicaDescription, func(s *smithy.Schema) error { + switch s { + case schemas.ReplicaDescription_GlobalSecondaryIndexes: + return deserializeReplicaGlobalSecondaryIndexDescriptionList(d, schemas.ReplicaDescription_GlobalSecondaryIndexes, &v.GlobalSecondaryIndexes) + case schemas.ReplicaDescription_GlobalTableSettingsReplicationMode: + var ev string + if err := d.ReadString(schemas.ReplicaDescription_GlobalTableSettingsReplicationMode, &ev); err != nil { + return err + } + v.GlobalTableSettingsReplicationMode = GlobalTableSettingsReplicationMode(ev) + return nil + case schemas.ReplicaDescription_KMSMasterKeyId: + v.KMSMasterKeyId = new(string) + return d.ReadString(schemas.ReplicaDescription_KMSMasterKeyId, v.KMSMasterKeyId) + case schemas.ReplicaDescription_OnDemandThroughputOverride: + v.OnDemandThroughputOverride = &OnDemandThroughputOverride{} + return v.OnDemandThroughputOverride.Deserialize(d) + case schemas.ReplicaDescription_ProvisionedThroughputOverride: + v.ProvisionedThroughputOverride = &ProvisionedThroughputOverride{} + return v.ProvisionedThroughputOverride.Deserialize(d) + case schemas.ReplicaDescription_RegionName: + v.RegionName = new(string) + return d.ReadString(schemas.ReplicaDescription_RegionName, v.RegionName) + case schemas.ReplicaDescription_ReplicaArn: + v.ReplicaArn = new(string) + return d.ReadString(schemas.ReplicaDescription_ReplicaArn, v.ReplicaArn) + case schemas.ReplicaDescription_ReplicaInaccessibleDateTime: + v.ReplicaInaccessibleDateTime = new(time.Time) + return d.ReadTime(schemas.ReplicaDescription_ReplicaInaccessibleDateTime, v.ReplicaInaccessibleDateTime) + case schemas.ReplicaDescription_ReplicaStatus: + var ev string + if err := d.ReadString(schemas.ReplicaDescription_ReplicaStatus, &ev); err != nil { + return err + } + v.ReplicaStatus = ReplicaStatus(ev) + return nil + case schemas.ReplicaDescription_ReplicaStatusDescription: + v.ReplicaStatusDescription = new(string) + return d.ReadString(schemas.ReplicaDescription_ReplicaStatusDescription, v.ReplicaStatusDescription) + case schemas.ReplicaDescription_ReplicaStatusPercentProgress: + v.ReplicaStatusPercentProgress = new(string) + return d.ReadString(schemas.ReplicaDescription_ReplicaStatusPercentProgress, v.ReplicaStatusPercentProgress) + case schemas.ReplicaDescription_ReplicaTableClassSummary: + v.ReplicaTableClassSummary = &TableClassSummary{} + return v.ReplicaTableClassSummary.Deserialize(d) + case schemas.ReplicaDescription_WarmThroughput: + v.WarmThroughput = &TableWarmThroughputDescription{} + return v.WarmThroughput.Deserialize(d) + } + return nil + }) +} + // Represents the properties of a replica global secondary index. type ReplicaGlobalSecondaryIndex struct { @@ -2717,6 +6240,44 @@ type ReplicaGlobalSecondaryIndex struct { noSmithyDocumentSerde } +func (v *ReplicaGlobalSecondaryIndex) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ReplicaGlobalSecondaryIndex) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ReplicaGlobalSecondaryIndex) SerializeMembers(s smithy.ShapeSerializer) { + if v.IndexName != nil { + s.WriteString(schemas.ReplicaGlobalSecondaryIndex_IndexName, *v.IndexName) + } + if v.OnDemandThroughputOverride != nil { + s.WriteStruct(schemas.ReplicaGlobalSecondaryIndex_OnDemandThroughputOverride) + v.OnDemandThroughputOverride.SerializeMembers(s) + s.CloseStruct() + } + if v.ProvisionedThroughputOverride != nil { + s.WriteStruct(schemas.ReplicaGlobalSecondaryIndex_ProvisionedThroughputOverride) + v.ProvisionedThroughputOverride.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *ReplicaGlobalSecondaryIndex) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ReplicaGlobalSecondaryIndex, func(s *smithy.Schema) error { + switch s { + case schemas.ReplicaGlobalSecondaryIndex_IndexName: + v.IndexName = new(string) + return d.ReadString(schemas.ReplicaGlobalSecondaryIndex_IndexName, v.IndexName) + case schemas.ReplicaGlobalSecondaryIndex_OnDemandThroughputOverride: + v.OnDemandThroughputOverride = &OnDemandThroughputOverride{} + return v.OnDemandThroughputOverride.Deserialize(d) + case schemas.ReplicaGlobalSecondaryIndex_ProvisionedThroughputOverride: + v.ProvisionedThroughputOverride = &ProvisionedThroughputOverride{} + return v.ProvisionedThroughputOverride.Deserialize(d) + } + return nil + }) +} + // Represents the auto scaling configuration for a replica global secondary index. type ReplicaGlobalSecondaryIndexAutoScalingDescription struct { @@ -2746,6 +6307,54 @@ type ReplicaGlobalSecondaryIndexAutoScalingDescription struct { noSmithyDocumentSerde } +func (v *ReplicaGlobalSecondaryIndexAutoScalingDescription) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ReplicaGlobalSecondaryIndexAutoScalingDescription) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ReplicaGlobalSecondaryIndexAutoScalingDescription) SerializeMembers(s smithy.ShapeSerializer) { + if v.IndexName != nil { + s.WriteString(schemas.ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexName, *v.IndexName) + } + if v.IndexStatus != "" { + s.WriteString(schemas.ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexStatus, string(v.IndexStatus)) + } + if v.ProvisionedReadCapacityAutoScalingSettings != nil { + s.WriteStruct(schemas.ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedReadCapacityAutoScalingSettings) + v.ProvisionedReadCapacityAutoScalingSettings.SerializeMembers(s) + s.CloseStruct() + } + if v.ProvisionedWriteCapacityAutoScalingSettings != nil { + s.WriteStruct(schemas.ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedWriteCapacityAutoScalingSettings) + v.ProvisionedWriteCapacityAutoScalingSettings.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *ReplicaGlobalSecondaryIndexAutoScalingDescription) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ReplicaGlobalSecondaryIndexAutoScalingDescription, func(s *smithy.Schema) error { + switch s { + case schemas.ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexName: + v.IndexName = new(string) + return d.ReadString(schemas.ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexName, v.IndexName) + case schemas.ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexStatus: + var ev string + if err := d.ReadString(schemas.ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexStatus, &ev); err != nil { + return err + } + v.IndexStatus = IndexStatus(ev) + return nil + case schemas.ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedReadCapacityAutoScalingSettings: + v.ProvisionedReadCapacityAutoScalingSettings = &AutoScalingSettingsDescription{} + return v.ProvisionedReadCapacityAutoScalingSettings.Deserialize(d) + case schemas.ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedWriteCapacityAutoScalingSettings: + v.ProvisionedWriteCapacityAutoScalingSettings = &AutoScalingSettingsDescription{} + return v.ProvisionedWriteCapacityAutoScalingSettings.Deserialize(d) + } + return nil + }) +} + // Represents the auto scaling settings of a global secondary index for a replica // that will be modified. type ReplicaGlobalSecondaryIndexAutoScalingUpdate struct { @@ -2760,6 +6369,36 @@ type ReplicaGlobalSecondaryIndexAutoScalingUpdate struct { noSmithyDocumentSerde } +func (v *ReplicaGlobalSecondaryIndexAutoScalingUpdate) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ReplicaGlobalSecondaryIndexAutoScalingUpdate) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ReplicaGlobalSecondaryIndexAutoScalingUpdate) SerializeMembers(s smithy.ShapeSerializer) { + if v.IndexName != nil { + s.WriteString(schemas.ReplicaGlobalSecondaryIndexAutoScalingUpdate_IndexName, *v.IndexName) + } + if v.ProvisionedReadCapacityAutoScalingUpdate != nil { + s.WriteStruct(schemas.ReplicaGlobalSecondaryIndexAutoScalingUpdate_ProvisionedReadCapacityAutoScalingUpdate) + v.ProvisionedReadCapacityAutoScalingUpdate.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *ReplicaGlobalSecondaryIndexAutoScalingUpdate) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ReplicaGlobalSecondaryIndexAutoScalingUpdate, func(s *smithy.Schema) error { + switch s { + case schemas.ReplicaGlobalSecondaryIndexAutoScalingUpdate_IndexName: + v.IndexName = new(string) + return d.ReadString(schemas.ReplicaGlobalSecondaryIndexAutoScalingUpdate_IndexName, v.IndexName) + case schemas.ReplicaGlobalSecondaryIndexAutoScalingUpdate_ProvisionedReadCapacityAutoScalingUpdate: + v.ProvisionedReadCapacityAutoScalingUpdate = &AutoScalingSettingsUpdate{} + return v.ProvisionedReadCapacityAutoScalingUpdate.Deserialize(d) + } + return nil + }) +} + // Represents the properties of a replica global secondary index. type ReplicaGlobalSecondaryIndexDescription struct { @@ -2779,6 +6418,52 @@ type ReplicaGlobalSecondaryIndexDescription struct { noSmithyDocumentSerde } +func (v *ReplicaGlobalSecondaryIndexDescription) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ReplicaGlobalSecondaryIndexDescription) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ReplicaGlobalSecondaryIndexDescription) SerializeMembers(s smithy.ShapeSerializer) { + if v.IndexName != nil { + s.WriteString(schemas.ReplicaGlobalSecondaryIndexDescription_IndexName, *v.IndexName) + } + if v.OnDemandThroughputOverride != nil { + s.WriteStruct(schemas.ReplicaGlobalSecondaryIndexDescription_OnDemandThroughputOverride) + v.OnDemandThroughputOverride.SerializeMembers(s) + s.CloseStruct() + } + if v.ProvisionedThroughputOverride != nil { + s.WriteStruct(schemas.ReplicaGlobalSecondaryIndexDescription_ProvisionedThroughputOverride) + v.ProvisionedThroughputOverride.SerializeMembers(s) + s.CloseStruct() + } + if v.WarmThroughput != nil { + s.WriteStruct(schemas.ReplicaGlobalSecondaryIndexDescription_WarmThroughput) + v.WarmThroughput.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *ReplicaGlobalSecondaryIndexDescription) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ReplicaGlobalSecondaryIndexDescription, func(s *smithy.Schema) error { + switch s { + case schemas.ReplicaGlobalSecondaryIndexDescription_IndexName: + v.IndexName = new(string) + return d.ReadString(schemas.ReplicaGlobalSecondaryIndexDescription_IndexName, v.IndexName) + case schemas.ReplicaGlobalSecondaryIndexDescription_OnDemandThroughputOverride: + v.OnDemandThroughputOverride = &OnDemandThroughputOverride{} + return v.OnDemandThroughputOverride.Deserialize(d) + case schemas.ReplicaGlobalSecondaryIndexDescription_ProvisionedThroughputOverride: + v.ProvisionedThroughputOverride = &ProvisionedThroughputOverride{} + return v.ProvisionedThroughputOverride.Deserialize(d) + case schemas.ReplicaGlobalSecondaryIndexDescription_WarmThroughput: + v.WarmThroughput = &GlobalSecondaryIndexWarmThroughputDescription{} + return v.WarmThroughput.Deserialize(d) + } + return nil + }) +} + // Represents the properties of a global secondary index. type ReplicaGlobalSecondaryIndexSettingsDescription struct { @@ -2818,6 +6503,66 @@ type ReplicaGlobalSecondaryIndexSettingsDescription struct { noSmithyDocumentSerde } +func (v *ReplicaGlobalSecondaryIndexSettingsDescription) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ReplicaGlobalSecondaryIndexSettingsDescription) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ReplicaGlobalSecondaryIndexSettingsDescription) SerializeMembers(s smithy.ShapeSerializer) { + if v.IndexName != nil { + s.WriteString(schemas.ReplicaGlobalSecondaryIndexSettingsDescription_IndexName, *v.IndexName) + } + if v.IndexStatus != "" { + s.WriteString(schemas.ReplicaGlobalSecondaryIndexSettingsDescription_IndexStatus, string(v.IndexStatus)) + } + if v.ProvisionedReadCapacityAutoScalingSettings != nil { + s.WriteStruct(schemas.ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityAutoScalingSettings) + v.ProvisionedReadCapacityAutoScalingSettings.SerializeMembers(s) + s.CloseStruct() + } + if v.ProvisionedReadCapacityUnits != nil { + s.WriteInt64(schemas.ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityUnits, *v.ProvisionedReadCapacityUnits) + } + if v.ProvisionedWriteCapacityAutoScalingSettings != nil { + s.WriteStruct(schemas.ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityAutoScalingSettings) + v.ProvisionedWriteCapacityAutoScalingSettings.SerializeMembers(s) + s.CloseStruct() + } + if v.ProvisionedWriteCapacityUnits != nil { + s.WriteInt64(schemas.ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityUnits, *v.ProvisionedWriteCapacityUnits) + } +} +func (v *ReplicaGlobalSecondaryIndexSettingsDescription) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ReplicaGlobalSecondaryIndexSettingsDescription, func(s *smithy.Schema) error { + switch s { + case schemas.ReplicaGlobalSecondaryIndexSettingsDescription_IndexName: + v.IndexName = new(string) + return d.ReadString(schemas.ReplicaGlobalSecondaryIndexSettingsDescription_IndexName, v.IndexName) + case schemas.ReplicaGlobalSecondaryIndexSettingsDescription_IndexStatus: + var ev string + if err := d.ReadString(schemas.ReplicaGlobalSecondaryIndexSettingsDescription_IndexStatus, &ev); err != nil { + return err + } + v.IndexStatus = IndexStatus(ev) + return nil + case schemas.ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityAutoScalingSettings: + v.ProvisionedReadCapacityAutoScalingSettings = &AutoScalingSettingsDescription{} + return v.ProvisionedReadCapacityAutoScalingSettings.Deserialize(d) + case schemas.ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityUnits: + v.ProvisionedReadCapacityUnits = new(int64) + return d.ReadInt64(schemas.ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityUnits, v.ProvisionedReadCapacityUnits) + case schemas.ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityAutoScalingSettings: + v.ProvisionedWriteCapacityAutoScalingSettings = &AutoScalingSettingsDescription{} + return v.ProvisionedWriteCapacityAutoScalingSettings.Deserialize(d) + case schemas.ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityUnits: + v.ProvisionedWriteCapacityUnits = new(int64) + return d.ReadInt64(schemas.ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityUnits, v.ProvisionedWriteCapacityUnits) + } + return nil + }) +} + // Represents the settings of a global secondary index for a global table that // will be modified. type ReplicaGlobalSecondaryIndexSettingsUpdate struct { @@ -2839,7 +6584,43 @@ type ReplicaGlobalSecondaryIndexSettingsUpdate struct { noSmithyDocumentSerde } -// Represents the properties of a replica. +func (v *ReplicaGlobalSecondaryIndexSettingsUpdate) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ReplicaGlobalSecondaryIndexSettingsUpdate) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ReplicaGlobalSecondaryIndexSettingsUpdate) SerializeMembers(s smithy.ShapeSerializer) { + if v.IndexName != nil { + s.WriteString(schemas.ReplicaGlobalSecondaryIndexSettingsUpdate_IndexName, *v.IndexName) + } + if v.ProvisionedReadCapacityAutoScalingSettingsUpdate != nil { + s.WriteStruct(schemas.ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityAutoScalingSettingsUpdate) + v.ProvisionedReadCapacityAutoScalingSettingsUpdate.SerializeMembers(s) + s.CloseStruct() + } + if v.ProvisionedReadCapacityUnits != nil { + s.WriteInt64(schemas.ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityUnits, *v.ProvisionedReadCapacityUnits) + } +} +func (v *ReplicaGlobalSecondaryIndexSettingsUpdate) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ReplicaGlobalSecondaryIndexSettingsUpdate, func(s *smithy.Schema) error { + switch s { + case schemas.ReplicaGlobalSecondaryIndexSettingsUpdate_IndexName: + v.IndexName = new(string) + return d.ReadString(schemas.ReplicaGlobalSecondaryIndexSettingsUpdate_IndexName, v.IndexName) + case schemas.ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityAutoScalingSettingsUpdate: + v.ProvisionedReadCapacityAutoScalingSettingsUpdate = &AutoScalingSettingsUpdate{} + return v.ProvisionedReadCapacityAutoScalingSettingsUpdate.Deserialize(d) + case schemas.ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityUnits: + v.ProvisionedReadCapacityUnits = new(int64) + return d.ReadInt64(schemas.ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityUnits, v.ProvisionedReadCapacityUnits) + } + return nil + }) +} + +// Represents the properties of a replica. type ReplicaSettingsDescription struct { // The Region name of the replica. @@ -2890,6 +6671,85 @@ type ReplicaSettingsDescription struct { noSmithyDocumentSerde } +func (v *ReplicaSettingsDescription) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ReplicaSettingsDescription) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ReplicaSettingsDescription) SerializeMembers(s smithy.ShapeSerializer) { + if v.RegionName != nil { + s.WriteString(schemas.ReplicaSettingsDescription_RegionName, *v.RegionName) + } + if v.ReplicaBillingModeSummary != nil { + s.WriteStruct(schemas.ReplicaSettingsDescription_ReplicaBillingModeSummary) + v.ReplicaBillingModeSummary.SerializeMembers(s) + s.CloseStruct() + } + serializeReplicaGlobalSecondaryIndexSettingsDescriptionList(s, schemas.ReplicaSettingsDescription_ReplicaGlobalSecondaryIndexSettings, v.ReplicaGlobalSecondaryIndexSettings) + if v.ReplicaProvisionedReadCapacityAutoScalingSettings != nil { + s.WriteStruct(schemas.ReplicaSettingsDescription_ReplicaProvisionedReadCapacityAutoScalingSettings) + v.ReplicaProvisionedReadCapacityAutoScalingSettings.SerializeMembers(s) + s.CloseStruct() + } + if v.ReplicaProvisionedReadCapacityUnits != nil { + s.WriteInt64(schemas.ReplicaSettingsDescription_ReplicaProvisionedReadCapacityUnits, *v.ReplicaProvisionedReadCapacityUnits) + } + if v.ReplicaProvisionedWriteCapacityAutoScalingSettings != nil { + s.WriteStruct(schemas.ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings) + v.ReplicaProvisionedWriteCapacityAutoScalingSettings.SerializeMembers(s) + s.CloseStruct() + } + if v.ReplicaProvisionedWriteCapacityUnits != nil { + s.WriteInt64(schemas.ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityUnits, *v.ReplicaProvisionedWriteCapacityUnits) + } + if v.ReplicaStatus != "" { + s.WriteString(schemas.ReplicaSettingsDescription_ReplicaStatus, string(v.ReplicaStatus)) + } + if v.ReplicaTableClassSummary != nil { + s.WriteStruct(schemas.ReplicaSettingsDescription_ReplicaTableClassSummary) + v.ReplicaTableClassSummary.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *ReplicaSettingsDescription) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ReplicaSettingsDescription, func(s *smithy.Schema) error { + switch s { + case schemas.ReplicaSettingsDescription_RegionName: + v.RegionName = new(string) + return d.ReadString(schemas.ReplicaSettingsDescription_RegionName, v.RegionName) + case schemas.ReplicaSettingsDescription_ReplicaBillingModeSummary: + v.ReplicaBillingModeSummary = &BillingModeSummary{} + return v.ReplicaBillingModeSummary.Deserialize(d) + case schemas.ReplicaSettingsDescription_ReplicaGlobalSecondaryIndexSettings: + return deserializeReplicaGlobalSecondaryIndexSettingsDescriptionList(d, schemas.ReplicaSettingsDescription_ReplicaGlobalSecondaryIndexSettings, &v.ReplicaGlobalSecondaryIndexSettings) + case schemas.ReplicaSettingsDescription_ReplicaProvisionedReadCapacityAutoScalingSettings: + v.ReplicaProvisionedReadCapacityAutoScalingSettings = &AutoScalingSettingsDescription{} + return v.ReplicaProvisionedReadCapacityAutoScalingSettings.Deserialize(d) + case schemas.ReplicaSettingsDescription_ReplicaProvisionedReadCapacityUnits: + v.ReplicaProvisionedReadCapacityUnits = new(int64) + return d.ReadInt64(schemas.ReplicaSettingsDescription_ReplicaProvisionedReadCapacityUnits, v.ReplicaProvisionedReadCapacityUnits) + case schemas.ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings: + v.ReplicaProvisionedWriteCapacityAutoScalingSettings = &AutoScalingSettingsDescription{} + return v.ReplicaProvisionedWriteCapacityAutoScalingSettings.Deserialize(d) + case schemas.ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityUnits: + v.ReplicaProvisionedWriteCapacityUnits = new(int64) + return d.ReadInt64(schemas.ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityUnits, v.ReplicaProvisionedWriteCapacityUnits) + case schemas.ReplicaSettingsDescription_ReplicaStatus: + var ev string + if err := d.ReadString(schemas.ReplicaSettingsDescription_ReplicaStatus, &ev); err != nil { + return err + } + v.ReplicaStatus = ReplicaStatus(ev) + return nil + case schemas.ReplicaSettingsDescription_ReplicaTableClassSummary: + v.ReplicaTableClassSummary = &TableClassSummary{} + return v.ReplicaTableClassSummary.Deserialize(d) + } + return nil + }) +} + // Represents the settings for a global table in a Region that will be modified. type ReplicaSettingsUpdate struct { @@ -2919,6 +6779,55 @@ type ReplicaSettingsUpdate struct { noSmithyDocumentSerde } +func (v *ReplicaSettingsUpdate) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ReplicaSettingsUpdate) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ReplicaSettingsUpdate) SerializeMembers(s smithy.ShapeSerializer) { + if v.RegionName != nil { + s.WriteString(schemas.ReplicaSettingsUpdate_RegionName, *v.RegionName) + } + serializeReplicaGlobalSecondaryIndexSettingsUpdateList(s, schemas.ReplicaSettingsUpdate_ReplicaGlobalSecondaryIndexSettingsUpdate, v.ReplicaGlobalSecondaryIndexSettingsUpdate) + if v.ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate != nil { + s.WriteStruct(schemas.ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate) + v.ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate.SerializeMembers(s) + s.CloseStruct() + } + if v.ReplicaProvisionedReadCapacityUnits != nil { + s.WriteInt64(schemas.ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityUnits, *v.ReplicaProvisionedReadCapacityUnits) + } + if v.ReplicaTableClass != "" { + s.WriteString(schemas.ReplicaSettingsUpdate_ReplicaTableClass, string(v.ReplicaTableClass)) + } +} +func (v *ReplicaSettingsUpdate) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ReplicaSettingsUpdate, func(s *smithy.Schema) error { + switch s { + case schemas.ReplicaSettingsUpdate_RegionName: + v.RegionName = new(string) + return d.ReadString(schemas.ReplicaSettingsUpdate_RegionName, v.RegionName) + case schemas.ReplicaSettingsUpdate_ReplicaGlobalSecondaryIndexSettingsUpdate: + return deserializeReplicaGlobalSecondaryIndexSettingsUpdateList(d, schemas.ReplicaSettingsUpdate_ReplicaGlobalSecondaryIndexSettingsUpdate, &v.ReplicaGlobalSecondaryIndexSettingsUpdate) + case schemas.ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate: + v.ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate = &AutoScalingSettingsUpdate{} + return v.ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate.Deserialize(d) + case schemas.ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityUnits: + v.ReplicaProvisionedReadCapacityUnits = new(int64) + return d.ReadInt64(schemas.ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityUnits, v.ReplicaProvisionedReadCapacityUnits) + case schemas.ReplicaSettingsUpdate_ReplicaTableClass: + var ev string + if err := d.ReadString(schemas.ReplicaSettingsUpdate_ReplicaTableClass, &ev); err != nil { + return err + } + v.ReplicaTableClass = TableClass(ev) + return nil + } + return nil + }) +} + // Represents one of the following: // // - A new replica to be added to an existing regional table or global table. @@ -2948,6 +6857,46 @@ type ReplicationGroupUpdate struct { noSmithyDocumentSerde } +func (v *ReplicationGroupUpdate) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ReplicationGroupUpdate) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ReplicationGroupUpdate) SerializeMembers(s smithy.ShapeSerializer) { + if v.Create != nil { + s.WriteStruct(schemas.ReplicationGroupUpdate_Create) + v.Create.SerializeMembers(s) + s.CloseStruct() + } + if v.Delete != nil { + s.WriteStruct(schemas.ReplicationGroupUpdate_Delete) + v.Delete.SerializeMembers(s) + s.CloseStruct() + } + if v.Update != nil { + s.WriteStruct(schemas.ReplicationGroupUpdate_Update) + v.Update.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *ReplicationGroupUpdate) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ReplicationGroupUpdate, func(s *smithy.Schema) error { + switch s { + case schemas.ReplicationGroupUpdate_Create: + v.Create = &CreateReplicationGroupMemberAction{} + return v.Create.Deserialize(d) + case schemas.ReplicationGroupUpdate_Delete: + v.Delete = &DeleteReplicationGroupMemberAction{} + return v.Delete.Deserialize(d) + case schemas.ReplicationGroupUpdate_Update: + v.Update = &UpdateReplicationGroupMemberAction{} + return v.Update.Deserialize(d) + } + return nil + }) +} + // Represents one of the following: // // - A new replica to be added to an existing global table. @@ -2966,6 +6915,38 @@ type ReplicaUpdate struct { noSmithyDocumentSerde } +func (v *ReplicaUpdate) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ReplicaUpdate) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ReplicaUpdate) SerializeMembers(s smithy.ShapeSerializer) { + if v.Create != nil { + s.WriteStruct(schemas.ReplicaUpdate_Create) + v.Create.SerializeMembers(s) + s.CloseStruct() + } + if v.Delete != nil { + s.WriteStruct(schemas.ReplicaUpdate_Delete) + v.Delete.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *ReplicaUpdate) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ReplicaUpdate, func(s *smithy.Schema) error { + switch s { + case schemas.ReplicaUpdate_Create: + v.Create = &CreateReplicaAction{} + return v.Create.Deserialize(d) + case schemas.ReplicaUpdate_Delete: + v.Delete = &DeleteReplicaAction{} + return v.Delete.Deserialize(d) + } + return nil + }) +} + // Contains details for the restore. type RestoreSummary struct { @@ -2988,6 +6969,46 @@ type RestoreSummary struct { noSmithyDocumentSerde } +func (v *RestoreSummary) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.RestoreSummary) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *RestoreSummary) SerializeMembers(s smithy.ShapeSerializer) { + if v.RestoreDateTime != nil { + s.WriteTime(schemas.RestoreSummary_RestoreDateTime, *v.RestoreDateTime) + } + if v.RestoreInProgress != nil { + s.WriteBool(schemas.RestoreSummary_RestoreInProgress, *v.RestoreInProgress) + } + if v.SourceBackupArn != nil { + s.WriteString(schemas.RestoreSummary_SourceBackupArn, *v.SourceBackupArn) + } + if v.SourceTableArn != nil { + s.WriteString(schemas.RestoreSummary_SourceTableArn, *v.SourceTableArn) + } +} +func (v *RestoreSummary) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.RestoreSummary, func(s *smithy.Schema) error { + switch s { + case schemas.RestoreSummary_RestoreDateTime: + v.RestoreDateTime = new(time.Time) + return d.ReadTime(schemas.RestoreSummary_RestoreDateTime, v.RestoreDateTime) + case schemas.RestoreSummary_RestoreInProgress: + v.RestoreInProgress = new(bool) + return d.ReadBool(schemas.RestoreSummary_RestoreInProgress, v.RestoreInProgress) + case schemas.RestoreSummary_SourceBackupArn: + v.SourceBackupArn = new(string) + return d.ReadString(schemas.RestoreSummary_SourceBackupArn, v.SourceBackupArn) + case schemas.RestoreSummary_SourceTableArn: + v.SourceTableArn = new(string) + return d.ReadString(schemas.RestoreSummary_SourceTableArn, v.SourceTableArn) + } + return nil + }) +} + // The S3 bucket that is being imported from. type S3BucketSource struct { @@ -3006,6 +7027,134 @@ type S3BucketSource struct { noSmithyDocumentSerde } +func (v *S3BucketSource) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.S3BucketSource) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *S3BucketSource) SerializeMembers(s smithy.ShapeSerializer) { + if v.S3Bucket != nil { + s.WriteString(schemas.S3BucketSource_S3Bucket, *v.S3Bucket) + } + if v.S3BucketOwner != nil { + s.WriteString(schemas.S3BucketSource_S3BucketOwner, *v.S3BucketOwner) + } + if v.S3KeyPrefix != nil { + s.WriteString(schemas.S3BucketSource_S3KeyPrefix, *v.S3KeyPrefix) + } +} +func (v *S3BucketSource) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.S3BucketSource, func(s *smithy.Schema) error { + switch s { + case schemas.S3BucketSource_S3Bucket: + v.S3Bucket = new(string) + return d.ReadString(schemas.S3BucketSource_S3Bucket, v.S3Bucket) + case schemas.S3BucketSource_S3BucketOwner: + v.S3BucketOwner = new(string) + return d.ReadString(schemas.S3BucketSource_S3BucketOwner, v.S3BucketOwner) + case schemas.S3BucketSource_S3KeyPrefix: + v.S3KeyPrefix = new(string) + return d.ReadString(schemas.S3BucketSource_S3KeyPrefix, v.S3KeyPrefix) + } + return nil + }) +} + +// A single result from a SearchVectors operation. +type SearchResultItem struct { + + // A map of attribute names to AttributeValue objects, representing the projected + // attributes of the item returned by the vector search. + Item map[string]AttributeValue + + // The similarity score for this item relative to the search vector. The + // interpretation depends on the distance function configured for the vector index. + Score float64 + + noSmithyDocumentSerde +} + +func (v *SearchResultItem) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.SearchResultItem) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *SearchResultItem) SerializeMembers(s smithy.ShapeSerializer) { + serializeAttributeMap(s, schemas.SearchResultItem_Item, v.Item) + if v.Score != 0 { + s.WriteFloat64(schemas.SearchResultItem_Score, v.Score) + } +} +func (v *SearchResultItem) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.SearchResultItem, func(s *smithy.Schema) error { + switch s { + case schemas.SearchResultItem_Item: + return deserializeAttributeMap(d, schemas.SearchResultItem_Item, &v.Item) + case schemas.SearchResultItem_Score: + return d.ReadFloat64(schemas.SearchResultItem_Score, &v.Score) + } + return nil + }) +} + +// An element in the search schema of a vector index. +type SearchSchemaElement struct { + + // The name of the attribute. + // + // This member is required. + AttributeName *string + + // The role of the attribute in the search schema. Valid values: + // + // - HASH - A partition key that partitions the vector index for independent + // scaling. When specified, you must provide this attribute's value in the + // SearchConditionExpression . + // + // - INLINE_FILTER - An attribute projected into the vector index for filtering + // at the storage layer during search. Inline filters are optional in the + // SearchConditionExpression . + // + // This member is required. + SearchSchemaElementType SearchSchemaElementType + + noSmithyDocumentSerde +} + +func (v *SearchSchemaElement) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.SearchSchemaElement) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *SearchSchemaElement) SerializeMembers(s smithy.ShapeSerializer) { + if v.AttributeName != nil { + s.WriteString(schemas.SearchSchemaElement_AttributeName, *v.AttributeName) + } + if v.SearchSchemaElementType != "" { + s.WriteString(schemas.SearchSchemaElement_SearchSchemaElementType, string(v.SearchSchemaElementType)) + } +} +func (v *SearchSchemaElement) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.SearchSchemaElement, func(s *smithy.Schema) error { + switch s { + case schemas.SearchSchemaElement_AttributeName: + v.AttributeName = new(string) + return d.ReadString(schemas.SearchSchemaElement_AttributeName, v.AttributeName) + case schemas.SearchSchemaElement_SearchSchemaElementType: + var ev string + if err := d.ReadString(schemas.SearchSchemaElement_SearchSchemaElementType, &ev); err != nil { + return err + } + v.SearchSchemaElementType = SearchSchemaElementType(ev) + return nil + } + return nil + }) +} + // Contains the details of the table when the backup was created. type SourceTableDetails struct { @@ -3061,6 +7210,87 @@ type SourceTableDetails struct { noSmithyDocumentSerde } +func (v *SourceTableDetails) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.SourceTableDetails) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *SourceTableDetails) SerializeMembers(s smithy.ShapeSerializer) { + if v.BillingMode != "" { + s.WriteString(schemas.SourceTableDetails_BillingMode, string(v.BillingMode)) + } + if v.ItemCount != nil { + s.WriteInt64(schemas.SourceTableDetails_ItemCount, *v.ItemCount) + } + serializeKeySchema(s, schemas.SourceTableDetails_KeySchema, v.KeySchema) + if v.OnDemandThroughput != nil { + s.WriteStruct(schemas.SourceTableDetails_OnDemandThroughput) + v.OnDemandThroughput.SerializeMembers(s) + s.CloseStruct() + } + if v.ProvisionedThroughput != nil { + s.WriteStruct(schemas.SourceTableDetails_ProvisionedThroughput) + v.ProvisionedThroughput.SerializeMembers(s) + s.CloseStruct() + } + if v.TableArn != nil { + s.WriteString(schemas.SourceTableDetails_TableArn, *v.TableArn) + } + if v.TableCreationDateTime != nil { + s.WriteTime(schemas.SourceTableDetails_TableCreationDateTime, *v.TableCreationDateTime) + } + if v.TableId != nil { + s.WriteString(schemas.SourceTableDetails_TableId, *v.TableId) + } + if v.TableName != nil { + s.WriteString(schemas.SourceTableDetails_TableName, *v.TableName) + } + if v.TableSizeBytes != nil { + s.WriteInt64(schemas.SourceTableDetails_TableSizeBytes, *v.TableSizeBytes) + } +} +func (v *SourceTableDetails) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.SourceTableDetails, func(s *smithy.Schema) error { + switch s { + case schemas.SourceTableDetails_BillingMode: + var ev string + if err := d.ReadString(schemas.SourceTableDetails_BillingMode, &ev); err != nil { + return err + } + v.BillingMode = BillingMode(ev) + return nil + case schemas.SourceTableDetails_ItemCount: + v.ItemCount = new(int64) + return d.ReadInt64(schemas.SourceTableDetails_ItemCount, v.ItemCount) + case schemas.SourceTableDetails_KeySchema: + return deserializeKeySchema(d, schemas.SourceTableDetails_KeySchema, &v.KeySchema) + case schemas.SourceTableDetails_OnDemandThroughput: + v.OnDemandThroughput = &OnDemandThroughput{} + return v.OnDemandThroughput.Deserialize(d) + case schemas.SourceTableDetails_ProvisionedThroughput: + v.ProvisionedThroughput = &ProvisionedThroughput{} + return v.ProvisionedThroughput.Deserialize(d) + case schemas.SourceTableDetails_TableArn: + v.TableArn = new(string) + return d.ReadString(schemas.SourceTableDetails_TableArn, v.TableArn) + case schemas.SourceTableDetails_TableCreationDateTime: + v.TableCreationDateTime = new(time.Time) + return d.ReadTime(schemas.SourceTableDetails_TableCreationDateTime, v.TableCreationDateTime) + case schemas.SourceTableDetails_TableId: + v.TableId = new(string) + return d.ReadString(schemas.SourceTableDetails_TableId, v.TableId) + case schemas.SourceTableDetails_TableName: + v.TableName = new(string) + return d.ReadString(schemas.SourceTableDetails_TableName, v.TableName) + case schemas.SourceTableDetails_TableSizeBytes: + v.TableSizeBytes = new(int64) + return d.ReadInt64(schemas.SourceTableDetails_TableSizeBytes, v.TableSizeBytes) + } + return nil + }) +} + // Contains the details of the features enabled on the table when the backup was // created. For example, LSIs, GSIs, streams, TTL. type SourceTableFeatureDetails struct { @@ -3085,9 +7315,63 @@ type SourceTableFeatureDetails struct { // Time to Live settings on the table when the backup was created. TimeToLiveDescription *TimeToLiveDescription + // The vector index properties for the table at the time the backup was created, + // including the index name, vector attribute, dimensions, distance function, + // search schema, and projection. + VectorIndexes []VectorIndexInfo + noSmithyDocumentSerde } +func (v *SourceTableFeatureDetails) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.SourceTableFeatureDetails) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *SourceTableFeatureDetails) SerializeMembers(s smithy.ShapeSerializer) { + serializeGlobalSecondaryIndexes(s, schemas.SourceTableFeatureDetails_GlobalSecondaryIndexes, v.GlobalSecondaryIndexes) + serializeLocalSecondaryIndexes(s, schemas.SourceTableFeatureDetails_LocalSecondaryIndexes, v.LocalSecondaryIndexes) + if v.SSEDescription != nil { + s.WriteStruct(schemas.SourceTableFeatureDetails_SSEDescription) + v.SSEDescription.SerializeMembers(s) + s.CloseStruct() + } + if v.StreamDescription != nil { + s.WriteStruct(schemas.SourceTableFeatureDetails_StreamDescription) + v.StreamDescription.SerializeMembers(s) + s.CloseStruct() + } + if v.TimeToLiveDescription != nil { + s.WriteStruct(schemas.SourceTableFeatureDetails_TimeToLiveDescription) + v.TimeToLiveDescription.SerializeMembers(s) + s.CloseStruct() + } + serializeVectorIndexes(s, schemas.SourceTableFeatureDetails_VectorIndexes, v.VectorIndexes) +} +func (v *SourceTableFeatureDetails) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.SourceTableFeatureDetails, func(s *smithy.Schema) error { + switch s { + case schemas.SourceTableFeatureDetails_GlobalSecondaryIndexes: + return deserializeGlobalSecondaryIndexes(d, schemas.SourceTableFeatureDetails_GlobalSecondaryIndexes, &v.GlobalSecondaryIndexes) + case schemas.SourceTableFeatureDetails_LocalSecondaryIndexes: + return deserializeLocalSecondaryIndexes(d, schemas.SourceTableFeatureDetails_LocalSecondaryIndexes, &v.LocalSecondaryIndexes) + case schemas.SourceTableFeatureDetails_SSEDescription: + v.SSEDescription = &SSEDescription{} + return v.SSEDescription.Deserialize(d) + case schemas.SourceTableFeatureDetails_StreamDescription: + v.StreamDescription = &StreamSpecification{} + return v.StreamDescription.Deserialize(d) + case schemas.SourceTableFeatureDetails_TimeToLiveDescription: + v.TimeToLiveDescription = &TimeToLiveDescription{} + return v.TimeToLiveDescription.Deserialize(d) + case schemas.SourceTableFeatureDetails_VectorIndexes: + return deserializeVectorIndexes(d, schemas.SourceTableFeatureDetails_VectorIndexes, &v.VectorIndexes) + } + return nil + }) +} + // The description of the server-side encryption status on the specified table. type SSEDescription struct { @@ -3118,6 +7402,54 @@ type SSEDescription struct { noSmithyDocumentSerde } +func (v *SSEDescription) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.SSEDescription) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *SSEDescription) SerializeMembers(s smithy.ShapeSerializer) { + if v.InaccessibleEncryptionDateTime != nil { + s.WriteTime(schemas.SSEDescription_InaccessibleEncryptionDateTime, *v.InaccessibleEncryptionDateTime) + } + if v.KMSMasterKeyArn != nil { + s.WriteString(schemas.SSEDescription_KMSMasterKeyArn, *v.KMSMasterKeyArn) + } + if v.SSEType != "" { + s.WriteString(schemas.SSEDescription_SSEType, string(v.SSEType)) + } + if v.Status != "" { + s.WriteString(schemas.SSEDescription_Status, string(v.Status)) + } +} +func (v *SSEDescription) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.SSEDescription, func(s *smithy.Schema) error { + switch s { + case schemas.SSEDescription_InaccessibleEncryptionDateTime: + v.InaccessibleEncryptionDateTime = new(time.Time) + return d.ReadTime(schemas.SSEDescription_InaccessibleEncryptionDateTime, v.InaccessibleEncryptionDateTime) + case schemas.SSEDescription_KMSMasterKeyArn: + v.KMSMasterKeyArn = new(string) + return d.ReadString(schemas.SSEDescription_KMSMasterKeyArn, v.KMSMasterKeyArn) + case schemas.SSEDescription_SSEType: + var ev string + if err := d.ReadString(schemas.SSEDescription_SSEType, &ev); err != nil { + return err + } + v.SSEType = SSEType(ev) + return nil + case schemas.SSEDescription_Status: + var ev string + if err := d.ReadString(schemas.SSEDescription_Status, &ev); err != nil { + return err + } + v.Status = SSEStatus(ev) + return nil + } + return nil + }) +} + // Represents the settings used to enable server-side encryption. type SSESpecification struct { @@ -3143,6 +7475,44 @@ type SSESpecification struct { noSmithyDocumentSerde } +func (v *SSESpecification) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.SSESpecification) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *SSESpecification) SerializeMembers(s smithy.ShapeSerializer) { + if v.Enabled != nil { + s.WriteBool(schemas.SSESpecification_Enabled, *v.Enabled) + } + if v.KMSMasterKeyId != nil { + s.WriteString(schemas.SSESpecification_KMSMasterKeyId, *v.KMSMasterKeyId) + } + if v.SSEType != "" { + s.WriteString(schemas.SSESpecification_SSEType, string(v.SSEType)) + } +} +func (v *SSESpecification) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.SSESpecification, func(s *smithy.Schema) error { + switch s { + case schemas.SSESpecification_Enabled: + v.Enabled = new(bool) + return d.ReadBool(schemas.SSESpecification_Enabled, v.Enabled) + case schemas.SSESpecification_KMSMasterKeyId: + v.KMSMasterKeyId = new(string) + return d.ReadString(schemas.SSESpecification_KMSMasterKeyId, v.KMSMasterKeyId) + case schemas.SSESpecification_SSEType: + var ev string + if err := d.ReadString(schemas.SSESpecification_SSEType, &ev); err != nil { + return err + } + v.SSEType = SSEType(ev) + return nil + } + return nil + }) +} + // Represents the DynamoDB Streams configuration for a table in DynamoDB. type StreamSpecification struct { @@ -3172,6 +7542,38 @@ type StreamSpecification struct { noSmithyDocumentSerde } +func (v *StreamSpecification) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.StreamSpecification) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *StreamSpecification) SerializeMembers(s smithy.ShapeSerializer) { + if v.StreamEnabled != nil { + s.WriteBool(schemas.StreamSpecification_StreamEnabled, *v.StreamEnabled) + } + if v.StreamViewType != "" { + s.WriteString(schemas.StreamSpecification_StreamViewType, string(v.StreamViewType)) + } +} +func (v *StreamSpecification) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.StreamSpecification, func(s *smithy.Schema) error { + switch s { + case schemas.StreamSpecification_StreamEnabled: + v.StreamEnabled = new(bool) + return d.ReadBool(schemas.StreamSpecification_StreamEnabled, v.StreamEnabled) + case schemas.StreamSpecification_StreamViewType: + var ev string + if err := d.ReadString(schemas.StreamSpecification_StreamViewType, &ev); err != nil { + return err + } + v.StreamViewType = StreamViewType(ev) + return nil + } + return nil + }) +} + // Represents the auto scaling configuration for a global table. type TableAutoScalingDescription struct { @@ -3195,6 +7597,41 @@ type TableAutoScalingDescription struct { noSmithyDocumentSerde } +func (v *TableAutoScalingDescription) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.TableAutoScalingDescription) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *TableAutoScalingDescription) SerializeMembers(s smithy.ShapeSerializer) { + serializeReplicaAutoScalingDescriptionList(s, schemas.TableAutoScalingDescription_Replicas, v.Replicas) + if v.TableName != nil { + s.WriteString(schemas.TableAutoScalingDescription_TableName, *v.TableName) + } + if v.TableStatus != "" { + s.WriteString(schemas.TableAutoScalingDescription_TableStatus, string(v.TableStatus)) + } +} +func (v *TableAutoScalingDescription) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.TableAutoScalingDescription, func(s *smithy.Schema) error { + switch s { + case schemas.TableAutoScalingDescription_Replicas: + return deserializeReplicaAutoScalingDescriptionList(d, schemas.TableAutoScalingDescription_Replicas, &v.Replicas) + case schemas.TableAutoScalingDescription_TableName: + v.TableName = new(string) + return d.ReadString(schemas.TableAutoScalingDescription_TableName, v.TableName) + case schemas.TableAutoScalingDescription_TableStatus: + var ev string + if err := d.ReadString(schemas.TableAutoScalingDescription_TableStatus, &ev); err != nil { + return err + } + v.TableStatus = TableStatus(ev) + return nil + } + return nil + }) +} + // Contains details of the table class. type TableClassSummary struct { @@ -3208,6 +7645,38 @@ type TableClassSummary struct { noSmithyDocumentSerde } +func (v *TableClassSummary) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.TableClassSummary) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *TableClassSummary) SerializeMembers(s smithy.ShapeSerializer) { + if v.LastUpdateDateTime != nil { + s.WriteTime(schemas.TableClassSummary_LastUpdateDateTime, *v.LastUpdateDateTime) + } + if v.TableClass != "" { + s.WriteString(schemas.TableClassSummary_TableClass, string(v.TableClass)) + } +} +func (v *TableClassSummary) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.TableClassSummary, func(s *smithy.Schema) error { + switch s { + case schemas.TableClassSummary_LastUpdateDateTime: + v.LastUpdateDateTime = new(time.Time) + return d.ReadTime(schemas.TableClassSummary_LastUpdateDateTime, v.LastUpdateDateTime) + case schemas.TableClassSummary_TableClass: + var ev string + if err := d.ReadString(schemas.TableClassSummary_TableClass, &ev); err != nil { + return err + } + v.TableClass = TableClass(ev) + return nil + } + return nil + }) +} + // The parameters for the table created as part of the import operation. type TableCreationParameters struct { @@ -3253,9 +7722,80 @@ type TableCreationParameters struct { // Represents the settings used to enable server-side encryption. SSESpecification *SSESpecification + // The vector indexes of the table to be created as part of the import operation. + VectorIndexes []VectorIndex + noSmithyDocumentSerde } +func (v *TableCreationParameters) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.TableCreationParameters) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *TableCreationParameters) SerializeMembers(s smithy.ShapeSerializer) { + serializeAttributeDefinitions(s, schemas.TableCreationParameters_AttributeDefinitions, v.AttributeDefinitions) + if v.BillingMode != "" { + s.WriteString(schemas.TableCreationParameters_BillingMode, string(v.BillingMode)) + } + serializeGlobalSecondaryIndexList(s, schemas.TableCreationParameters_GlobalSecondaryIndexes, v.GlobalSecondaryIndexes) + serializeKeySchema(s, schemas.TableCreationParameters_KeySchema, v.KeySchema) + if v.OnDemandThroughput != nil { + s.WriteStruct(schemas.TableCreationParameters_OnDemandThroughput) + v.OnDemandThroughput.SerializeMembers(s) + s.CloseStruct() + } + if v.ProvisionedThroughput != nil { + s.WriteStruct(schemas.TableCreationParameters_ProvisionedThroughput) + v.ProvisionedThroughput.SerializeMembers(s) + s.CloseStruct() + } + if v.SSESpecification != nil { + s.WriteStruct(schemas.TableCreationParameters_SSESpecification) + v.SSESpecification.SerializeMembers(s) + s.CloseStruct() + } + if v.TableName != nil { + s.WriteString(schemas.TableCreationParameters_TableName, *v.TableName) + } + serializeVectorIndexList(s, schemas.TableCreationParameters_VectorIndexes, v.VectorIndexes) +} +func (v *TableCreationParameters) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.TableCreationParameters, func(s *smithy.Schema) error { + switch s { + case schemas.TableCreationParameters_AttributeDefinitions: + return deserializeAttributeDefinitions(d, schemas.TableCreationParameters_AttributeDefinitions, &v.AttributeDefinitions) + case schemas.TableCreationParameters_BillingMode: + var ev string + if err := d.ReadString(schemas.TableCreationParameters_BillingMode, &ev); err != nil { + return err + } + v.BillingMode = BillingMode(ev) + return nil + case schemas.TableCreationParameters_GlobalSecondaryIndexes: + return deserializeGlobalSecondaryIndexList(d, schemas.TableCreationParameters_GlobalSecondaryIndexes, &v.GlobalSecondaryIndexes) + case schemas.TableCreationParameters_KeySchema: + return deserializeKeySchema(d, schemas.TableCreationParameters_KeySchema, &v.KeySchema) + case schemas.TableCreationParameters_OnDemandThroughput: + v.OnDemandThroughput = &OnDemandThroughput{} + return v.OnDemandThroughput.Deserialize(d) + case schemas.TableCreationParameters_ProvisionedThroughput: + v.ProvisionedThroughput = &ProvisionedThroughput{} + return v.ProvisionedThroughput.Deserialize(d) + case schemas.TableCreationParameters_SSESpecification: + v.SSESpecification = &SSESpecification{} + return v.SSESpecification.Deserialize(d) + case schemas.TableCreationParameters_TableName: + v.TableName = new(string) + return d.ReadString(schemas.TableCreationParameters_TableName, v.TableName) + case schemas.TableCreationParameters_VectorIndexes: + return deserializeVectorIndexList(d, schemas.TableCreationParameters_VectorIndexes, &v.VectorIndexes) + } + return nil + }) +} + // Represents the properties of a table. type TableDescription struct { @@ -3512,7 +8052,8 @@ type TableDescription struct { // Contains details of the table class. TableClassSummary *TableClassSummary - // Unique identifier for the table for which the backup was created. + // A unique identifier for the table, in UUID format, generated by DynamoDB when + // the table is created. TableId *string // The name of the table. @@ -3546,12 +8087,245 @@ type TableDescription struct { // information. TableStatus TableStatus + // The vector indexes, if any, on the table. Each element is composed of: + // + // - IndexName - The name of the vector index. + // + // - IndexStatus - The current status of the vector index: CREATING , ACTIVE , or + // DELETING . + // + // - Backfilling - Specifies whether the index is currently backfilling. During + // backfill, SearchVectors operations might return incomplete results. + // + // - VectorAttribute - The attribute that contains vector embeddings. + // + // - Dimensions - The number of dimensions in each vector. + // + // - DistanceFunction - The distance function used to calculate similarity ( + // COSINE , EUCLIDEAN , or DOT_PRODUCT ). + // + // - SearchSchema - The partition key and inline filter attributes for the vector + // index. + // + // - Projection - Specifies attributes that are copied (projected) from the table + // into the vector index. + // + // - IndexArn - The Amazon Resource Name (ARN) that uniquely identifies the index. + // + // - IndexSizeBytes - The total size of the vector index, in bytes. Amazon + // DynamoDB updates this value approximately every six hours. Recent changes might + // not be reflected in this value. + // + // - ItemCount - The number of items indexed in the vector index. Amazon DynamoDB + // updates this value approximately every six hours. Recent changes might not be + // reflected in this value. + VectorIndexes []VectorIndexDescription + // Describes the warm throughput value of the base table. WarmThroughput *TableWarmThroughputDescription noSmithyDocumentSerde } +func (v *TableDescription) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.TableDescription) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *TableDescription) SerializeMembers(s smithy.ShapeSerializer) { + if v.ArchivalSummary != nil { + s.WriteStruct(schemas.TableDescription_ArchivalSummary) + v.ArchivalSummary.SerializeMembers(s) + s.CloseStruct() + } + serializeAttributeDefinitions(s, schemas.TableDescription_AttributeDefinitions, v.AttributeDefinitions) + if v.BillingModeSummary != nil { + s.WriteStruct(schemas.TableDescription_BillingModeSummary) + v.BillingModeSummary.SerializeMembers(s) + s.CloseStruct() + } + if v.CreationDateTime != nil { + s.WriteTime(schemas.TableDescription_CreationDateTime, *v.CreationDateTime) + } + if v.DeletionProtectionEnabled != nil { + s.WriteBool(schemas.TableDescription_DeletionProtectionEnabled, *v.DeletionProtectionEnabled) + } + serializeGlobalSecondaryIndexDescriptionList(s, schemas.TableDescription_GlobalSecondaryIndexes, v.GlobalSecondaryIndexes) + if v.GlobalTableSettingsReplicationMode != "" { + s.WriteString(schemas.TableDescription_GlobalTableSettingsReplicationMode, string(v.GlobalTableSettingsReplicationMode)) + } + if v.GlobalTableVersion != nil { + s.WriteString(schemas.TableDescription_GlobalTableVersion, *v.GlobalTableVersion) + } + serializeGlobalTableWitnessDescriptionList(s, schemas.TableDescription_GlobalTableWitnesses, v.GlobalTableWitnesses) + if v.ItemCount != nil { + s.WriteInt64(schemas.TableDescription_ItemCount, *v.ItemCount) + } + serializeKeySchema(s, schemas.TableDescription_KeySchema, v.KeySchema) + if v.LatestStreamArn != nil { + s.WriteString(schemas.TableDescription_LatestStreamArn, *v.LatestStreamArn) + } + if v.LatestStreamLabel != nil { + s.WriteString(schemas.TableDescription_LatestStreamLabel, *v.LatestStreamLabel) + } + serializeLocalSecondaryIndexDescriptionList(s, schemas.TableDescription_LocalSecondaryIndexes, v.LocalSecondaryIndexes) + if v.MultiRegionConsistency != "" { + s.WriteString(schemas.TableDescription_MultiRegionConsistency, string(v.MultiRegionConsistency)) + } + if v.OnDemandThroughput != nil { + s.WriteStruct(schemas.TableDescription_OnDemandThroughput) + v.OnDemandThroughput.SerializeMembers(s) + s.CloseStruct() + } + if v.ProvisionedThroughput != nil { + s.WriteStruct(schemas.TableDescription_ProvisionedThroughput) + v.ProvisionedThroughput.SerializeMembers(s) + s.CloseStruct() + } + serializeReplicaDescriptionList(s, schemas.TableDescription_Replicas, v.Replicas) + if v.RestoreSummary != nil { + s.WriteStruct(schemas.TableDescription_RestoreSummary) + v.RestoreSummary.SerializeMembers(s) + s.CloseStruct() + } + if v.SSEDescription != nil { + s.WriteStruct(schemas.TableDescription_SSEDescription) + v.SSEDescription.SerializeMembers(s) + s.CloseStruct() + } + if v.StreamSpecification != nil { + s.WriteStruct(schemas.TableDescription_StreamSpecification) + v.StreamSpecification.SerializeMembers(s) + s.CloseStruct() + } + if v.TableArn != nil { + s.WriteString(schemas.TableDescription_TableArn, *v.TableArn) + } + if v.TableClassSummary != nil { + s.WriteStruct(schemas.TableDescription_TableClassSummary) + v.TableClassSummary.SerializeMembers(s) + s.CloseStruct() + } + if v.TableId != nil { + s.WriteString(schemas.TableDescription_TableId, *v.TableId) + } + if v.TableName != nil { + s.WriteString(schemas.TableDescription_TableName, *v.TableName) + } + if v.TableSizeBytes != nil { + s.WriteInt64(schemas.TableDescription_TableSizeBytes, *v.TableSizeBytes) + } + if v.TableStatus != "" { + s.WriteString(schemas.TableDescription_TableStatus, string(v.TableStatus)) + } + serializeVectorIndexDescriptionList(s, schemas.TableDescription_VectorIndexes, v.VectorIndexes) + if v.WarmThroughput != nil { + s.WriteStruct(schemas.TableDescription_WarmThroughput) + v.WarmThroughput.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *TableDescription) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.TableDescription, func(s *smithy.Schema) error { + switch s { + case schemas.TableDescription_ArchivalSummary: + v.ArchivalSummary = &ArchivalSummary{} + return v.ArchivalSummary.Deserialize(d) + case schemas.TableDescription_AttributeDefinitions: + return deserializeAttributeDefinitions(d, schemas.TableDescription_AttributeDefinitions, &v.AttributeDefinitions) + case schemas.TableDescription_BillingModeSummary: + v.BillingModeSummary = &BillingModeSummary{} + return v.BillingModeSummary.Deserialize(d) + case schemas.TableDescription_CreationDateTime: + v.CreationDateTime = new(time.Time) + return d.ReadTime(schemas.TableDescription_CreationDateTime, v.CreationDateTime) + case schemas.TableDescription_DeletionProtectionEnabled: + v.DeletionProtectionEnabled = new(bool) + return d.ReadBool(schemas.TableDescription_DeletionProtectionEnabled, v.DeletionProtectionEnabled) + case schemas.TableDescription_GlobalSecondaryIndexes: + return deserializeGlobalSecondaryIndexDescriptionList(d, schemas.TableDescription_GlobalSecondaryIndexes, &v.GlobalSecondaryIndexes) + case schemas.TableDescription_GlobalTableSettingsReplicationMode: + var ev string + if err := d.ReadString(schemas.TableDescription_GlobalTableSettingsReplicationMode, &ev); err != nil { + return err + } + v.GlobalTableSettingsReplicationMode = GlobalTableSettingsReplicationMode(ev) + return nil + case schemas.TableDescription_GlobalTableVersion: + v.GlobalTableVersion = new(string) + return d.ReadString(schemas.TableDescription_GlobalTableVersion, v.GlobalTableVersion) + case schemas.TableDescription_GlobalTableWitnesses: + return deserializeGlobalTableWitnessDescriptionList(d, schemas.TableDescription_GlobalTableWitnesses, &v.GlobalTableWitnesses) + case schemas.TableDescription_ItemCount: + v.ItemCount = new(int64) + return d.ReadInt64(schemas.TableDescription_ItemCount, v.ItemCount) + case schemas.TableDescription_KeySchema: + return deserializeKeySchema(d, schemas.TableDescription_KeySchema, &v.KeySchema) + case schemas.TableDescription_LatestStreamArn: + v.LatestStreamArn = new(string) + return d.ReadString(schemas.TableDescription_LatestStreamArn, v.LatestStreamArn) + case schemas.TableDescription_LatestStreamLabel: + v.LatestStreamLabel = new(string) + return d.ReadString(schemas.TableDescription_LatestStreamLabel, v.LatestStreamLabel) + case schemas.TableDescription_LocalSecondaryIndexes: + return deserializeLocalSecondaryIndexDescriptionList(d, schemas.TableDescription_LocalSecondaryIndexes, &v.LocalSecondaryIndexes) + case schemas.TableDescription_MultiRegionConsistency: + var ev string + if err := d.ReadString(schemas.TableDescription_MultiRegionConsistency, &ev); err != nil { + return err + } + v.MultiRegionConsistency = MultiRegionConsistency(ev) + return nil + case schemas.TableDescription_OnDemandThroughput: + v.OnDemandThroughput = &OnDemandThroughput{} + return v.OnDemandThroughput.Deserialize(d) + case schemas.TableDescription_ProvisionedThroughput: + v.ProvisionedThroughput = &ProvisionedThroughputDescription{} + return v.ProvisionedThroughput.Deserialize(d) + case schemas.TableDescription_Replicas: + return deserializeReplicaDescriptionList(d, schemas.TableDescription_Replicas, &v.Replicas) + case schemas.TableDescription_RestoreSummary: + v.RestoreSummary = &RestoreSummary{} + return v.RestoreSummary.Deserialize(d) + case schemas.TableDescription_SSEDescription: + v.SSEDescription = &SSEDescription{} + return v.SSEDescription.Deserialize(d) + case schemas.TableDescription_StreamSpecification: + v.StreamSpecification = &StreamSpecification{} + return v.StreamSpecification.Deserialize(d) + case schemas.TableDescription_TableArn: + v.TableArn = new(string) + return d.ReadString(schemas.TableDescription_TableArn, v.TableArn) + case schemas.TableDescription_TableClassSummary: + v.TableClassSummary = &TableClassSummary{} + return v.TableClassSummary.Deserialize(d) + case schemas.TableDescription_TableId: + v.TableId = new(string) + return d.ReadString(schemas.TableDescription_TableId, v.TableId) + case schemas.TableDescription_TableName: + v.TableName = new(string) + return d.ReadString(schemas.TableDescription_TableName, v.TableName) + case schemas.TableDescription_TableSizeBytes: + v.TableSizeBytes = new(int64) + return d.ReadInt64(schemas.TableDescription_TableSizeBytes, v.TableSizeBytes) + case schemas.TableDescription_TableStatus: + var ev string + if err := d.ReadString(schemas.TableDescription_TableStatus, &ev); err != nil { + return err + } + v.TableStatus = TableStatus(ev) + return nil + case schemas.TableDescription_VectorIndexes: + return deserializeVectorIndexDescriptionList(d, schemas.TableDescription_VectorIndexes, &v.VectorIndexes) + case schemas.TableDescription_WarmThroughput: + v.WarmThroughput = &TableWarmThroughputDescription{} + return v.WarmThroughput.Deserialize(d) + } + return nil + }) +} + // Represents the warm throughput value (in read units per second and write units // per second) of the table. Warm throughput is applicable for DynamoDB Standard-IA // tables and specifies the minimum provisioned capacity maintained for immediate @@ -3570,6 +8344,44 @@ type TableWarmThroughputDescription struct { noSmithyDocumentSerde } +func (v *TableWarmThroughputDescription) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.TableWarmThroughputDescription) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *TableWarmThroughputDescription) SerializeMembers(s smithy.ShapeSerializer) { + if v.ReadUnitsPerSecond != nil { + s.WriteInt64(schemas.TableWarmThroughputDescription_ReadUnitsPerSecond, *v.ReadUnitsPerSecond) + } + if v.Status != "" { + s.WriteString(schemas.TableWarmThroughputDescription_Status, string(v.Status)) + } + if v.WriteUnitsPerSecond != nil { + s.WriteInt64(schemas.TableWarmThroughputDescription_WriteUnitsPerSecond, *v.WriteUnitsPerSecond) + } +} +func (v *TableWarmThroughputDescription) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.TableWarmThroughputDescription, func(s *smithy.Schema) error { + switch s { + case schemas.TableWarmThroughputDescription_ReadUnitsPerSecond: + v.ReadUnitsPerSecond = new(int64) + return d.ReadInt64(schemas.TableWarmThroughputDescription_ReadUnitsPerSecond, v.ReadUnitsPerSecond) + case schemas.TableWarmThroughputDescription_Status: + var ev string + if err := d.ReadString(schemas.TableWarmThroughputDescription_Status, &ev); err != nil { + return err + } + v.Status = TableStatus(ev) + return nil + case schemas.TableWarmThroughputDescription_WriteUnitsPerSecond: + v.WriteUnitsPerSecond = new(int64) + return d.ReadInt64(schemas.TableWarmThroughputDescription_WriteUnitsPerSecond, v.WriteUnitsPerSecond) + } + return nil + }) +} + // Describes a tag. A tag is a key-value pair. You can add up to 50 tags to a // single DynamoDB table. // @@ -3600,6 +8412,34 @@ type Tag struct { noSmithyDocumentSerde } +func (v *Tag) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.Tag) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *Tag) SerializeMembers(s smithy.ShapeSerializer) { + if v.Key != nil { + s.WriteString(schemas.Tag_Key, *v.Key) + } + if v.Value != nil { + s.WriteString(schemas.Tag_Value, *v.Value) + } +} +func (v *Tag) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.Tag, func(s *smithy.Schema) error { + switch s { + case schemas.Tag_Key: + v.Key = new(string) + return d.ReadString(schemas.Tag_Key, v.Key) + case schemas.Tag_Value: + v.Value = new(string) + return d.ReadString(schemas.Tag_Value, v.Value) + } + return nil + }) +} + // Represents the specific reason why a DynamoDB request was throttled and the ARN // of the impacted resource. This helps identify exactly what resource is being // throttled, what type of operation caused it, and why the throttling occurred. @@ -3651,6 +8491,34 @@ type ThrottlingReason struct { noSmithyDocumentSerde } +func (v *ThrottlingReason) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ThrottlingReason) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ThrottlingReason) SerializeMembers(s smithy.ShapeSerializer) { + if v.Reason != nil { + s.WriteString(schemas.ThrottlingReason_reason, *v.Reason) + } + if v.Resource != nil { + s.WriteString(schemas.ThrottlingReason_resource, *v.Resource) + } +} +func (v *ThrottlingReason) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ThrottlingReason, func(s *smithy.Schema) error { + switch s { + case schemas.ThrottlingReason_reason: + v.Reason = new(string) + return d.ReadString(schemas.ThrottlingReason_reason, v.Reason) + case schemas.ThrottlingReason_resource: + v.Resource = new(string) + return d.ReadString(schemas.ThrottlingReason_resource, v.Resource) + } + return nil + }) +} + // The description of the Time to Live (TTL) status on the specified table. type TimeToLiveDescription struct { @@ -3663,6 +8531,38 @@ type TimeToLiveDescription struct { noSmithyDocumentSerde } +func (v *TimeToLiveDescription) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.TimeToLiveDescription) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *TimeToLiveDescription) SerializeMembers(s smithy.ShapeSerializer) { + if v.AttributeName != nil { + s.WriteString(schemas.TimeToLiveDescription_AttributeName, *v.AttributeName) + } + if v.TimeToLiveStatus != "" { + s.WriteString(schemas.TimeToLiveDescription_TimeToLiveStatus, string(v.TimeToLiveStatus)) + } +} +func (v *TimeToLiveDescription) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.TimeToLiveDescription, func(s *smithy.Schema) error { + switch s { + case schemas.TimeToLiveDescription_AttributeName: + v.AttributeName = new(string) + return d.ReadString(schemas.TimeToLiveDescription_AttributeName, v.AttributeName) + case schemas.TimeToLiveDescription_TimeToLiveStatus: + var ev string + if err := d.ReadString(schemas.TimeToLiveDescription_TimeToLiveStatus, &ev); err != nil { + return err + } + v.TimeToLiveStatus = TimeToLiveStatus(ev) + return nil + } + return nil + }) +} + // Represents the settings used to enable or disable Time to Live (TTL) for the // specified table. type TimeToLiveSpecification struct { @@ -3681,6 +8581,34 @@ type TimeToLiveSpecification struct { noSmithyDocumentSerde } +func (v *TimeToLiveSpecification) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.TimeToLiveSpecification) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *TimeToLiveSpecification) SerializeMembers(s smithy.ShapeSerializer) { + if v.AttributeName != nil { + s.WriteString(schemas.TimeToLiveSpecification_AttributeName, *v.AttributeName) + } + if v.Enabled != nil { + s.WriteBool(schemas.TimeToLiveSpecification_Enabled, *v.Enabled) + } +} +func (v *TimeToLiveSpecification) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.TimeToLiveSpecification, func(s *smithy.Schema) error { + switch s { + case schemas.TimeToLiveSpecification_AttributeName: + v.AttributeName = new(string) + return d.ReadString(schemas.TimeToLiveSpecification_AttributeName, v.AttributeName) + case schemas.TimeToLiveSpecification_Enabled: + v.Enabled = new(bool) + return d.ReadBool(schemas.TimeToLiveSpecification_Enabled, v.Enabled) + } + return nil + }) +} + // Specifies an item to be retrieved as part of the transaction. type TransactGetItem struct { @@ -3694,6 +8622,30 @@ type TransactGetItem struct { noSmithyDocumentSerde } +func (v *TransactGetItem) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.TransactGetItem) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *TransactGetItem) SerializeMembers(s smithy.ShapeSerializer) { + if v.Get != nil { + s.WriteStruct(schemas.TransactGetItem_Get) + v.Get.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *TransactGetItem) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.TransactGetItem, func(s *smithy.Schema) error { + switch s { + case schemas.TransactGetItem_Get: + v.Get = &Get{} + return v.Get.Deserialize(d) + } + return nil + }) +} + // A list of requests that can perform update, put, delete, or check operations on // multiple items in one or more tables atomically. type TransactWriteItem struct { @@ -3713,6 +8665,54 @@ type TransactWriteItem struct { noSmithyDocumentSerde } +func (v *TransactWriteItem) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.TransactWriteItem) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *TransactWriteItem) SerializeMembers(s smithy.ShapeSerializer) { + if v.ConditionCheck != nil { + s.WriteStruct(schemas.TransactWriteItem_ConditionCheck) + v.ConditionCheck.SerializeMembers(s) + s.CloseStruct() + } + if v.Delete != nil { + s.WriteStruct(schemas.TransactWriteItem_Delete) + v.Delete.SerializeMembers(s) + s.CloseStruct() + } + if v.Put != nil { + s.WriteStruct(schemas.TransactWriteItem_Put) + v.Put.SerializeMembers(s) + s.CloseStruct() + } + if v.Update != nil { + s.WriteStruct(schemas.TransactWriteItem_Update) + v.Update.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *TransactWriteItem) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.TransactWriteItem, func(s *smithy.Schema) error { + switch s { + case schemas.TransactWriteItem_ConditionCheck: + v.ConditionCheck = &ConditionCheck{} + return v.ConditionCheck.Deserialize(d) + case schemas.TransactWriteItem_Delete: + v.Delete = &Delete{} + return v.Delete.Deserialize(d) + case schemas.TransactWriteItem_Put: + v.Put = &Put{} + return v.Put.Deserialize(d) + case schemas.TransactWriteItem_Update: + v.Update = &Update{} + return v.Update.Deserialize(d) + } + return nil + }) +} + // Represents a request to perform an UpdateItem operation. type Update struct { @@ -3751,6 +8751,59 @@ type Update struct { noSmithyDocumentSerde } +func (v *Update) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.Update) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *Update) SerializeMembers(s smithy.ShapeSerializer) { + if v.ConditionExpression != nil { + s.WriteString(schemas.Update_ConditionExpression, *v.ConditionExpression) + } + serializeExpressionAttributeNameMap(s, schemas.Update_ExpressionAttributeNames, v.ExpressionAttributeNames) + serializeExpressionAttributeValueMap(s, schemas.Update_ExpressionAttributeValues, v.ExpressionAttributeValues) + serializeKey(s, schemas.Update_Key, v.Key) + if v.ReturnValuesOnConditionCheckFailure != "" { + s.WriteString(schemas.Update_ReturnValuesOnConditionCheckFailure, string(v.ReturnValuesOnConditionCheckFailure)) + } + if v.TableName != nil { + s.WriteString(schemas.Update_TableName, *v.TableName) + } + if v.UpdateExpression != nil { + s.WriteString(schemas.Update_UpdateExpression, *v.UpdateExpression) + } +} +func (v *Update) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.Update, func(s *smithy.Schema) error { + switch s { + case schemas.Update_ConditionExpression: + v.ConditionExpression = new(string) + return d.ReadString(schemas.Update_ConditionExpression, v.ConditionExpression) + case schemas.Update_ExpressionAttributeNames: + return deserializeExpressionAttributeNameMap(d, schemas.Update_ExpressionAttributeNames, &v.ExpressionAttributeNames) + case schemas.Update_ExpressionAttributeValues: + return deserializeExpressionAttributeValueMap(d, schemas.Update_ExpressionAttributeValues, &v.ExpressionAttributeValues) + case schemas.Update_Key: + return deserializeKey(d, schemas.Update_Key, &v.Key) + case schemas.Update_ReturnValuesOnConditionCheckFailure: + var ev string + if err := d.ReadString(schemas.Update_ReturnValuesOnConditionCheckFailure, &ev); err != nil { + return err + } + v.ReturnValuesOnConditionCheckFailure = ReturnValuesOnConditionCheckFailure(ev) + return nil + case schemas.Update_TableName: + v.TableName = new(string) + return d.ReadString(schemas.Update_TableName, v.TableName) + case schemas.Update_UpdateExpression: + v.UpdateExpression = new(string) + return d.ReadString(schemas.Update_UpdateExpression, v.UpdateExpression) + } + return nil + }) +} + // Represents the new provisioned throughput settings to be applied to a global // secondary index. type UpdateGlobalSecondaryIndexAction struct { @@ -3781,6 +8834,52 @@ type UpdateGlobalSecondaryIndexAction struct { noSmithyDocumentSerde } +func (v *UpdateGlobalSecondaryIndexAction) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.UpdateGlobalSecondaryIndexAction) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *UpdateGlobalSecondaryIndexAction) SerializeMembers(s smithy.ShapeSerializer) { + if v.IndexName != nil { + s.WriteString(schemas.UpdateGlobalSecondaryIndexAction_IndexName, *v.IndexName) + } + if v.OnDemandThroughput != nil { + s.WriteStruct(schemas.UpdateGlobalSecondaryIndexAction_OnDemandThroughput) + v.OnDemandThroughput.SerializeMembers(s) + s.CloseStruct() + } + if v.ProvisionedThroughput != nil { + s.WriteStruct(schemas.UpdateGlobalSecondaryIndexAction_ProvisionedThroughput) + v.ProvisionedThroughput.SerializeMembers(s) + s.CloseStruct() + } + if v.WarmThroughput != nil { + s.WriteStruct(schemas.UpdateGlobalSecondaryIndexAction_WarmThroughput) + v.WarmThroughput.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *UpdateGlobalSecondaryIndexAction) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.UpdateGlobalSecondaryIndexAction, func(s *smithy.Schema) error { + switch s { + case schemas.UpdateGlobalSecondaryIndexAction_IndexName: + v.IndexName = new(string) + return d.ReadString(schemas.UpdateGlobalSecondaryIndexAction_IndexName, v.IndexName) + case schemas.UpdateGlobalSecondaryIndexAction_OnDemandThroughput: + v.OnDemandThroughput = &OnDemandThroughput{} + return v.OnDemandThroughput.Deserialize(d) + case schemas.UpdateGlobalSecondaryIndexAction_ProvisionedThroughput: + v.ProvisionedThroughput = &ProvisionedThroughput{} + return v.ProvisionedThroughput.Deserialize(d) + case schemas.UpdateGlobalSecondaryIndexAction_WarmThroughput: + v.WarmThroughput = &WarmThroughput{} + return v.WarmThroughput.Deserialize(d) + } + return nil + }) +} + // Enables updating the configuration for Kinesis Streaming. type UpdateKinesisStreamingConfiguration struct { @@ -3790,6 +8889,32 @@ type UpdateKinesisStreamingConfiguration struct { noSmithyDocumentSerde } +func (v *UpdateKinesisStreamingConfiguration) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.UpdateKinesisStreamingConfiguration) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *UpdateKinesisStreamingConfiguration) SerializeMembers(s smithy.ShapeSerializer) { + if v.ApproximateCreationDateTimePrecision != "" { + s.WriteString(schemas.UpdateKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision, string(v.ApproximateCreationDateTimePrecision)) + } +} +func (v *UpdateKinesisStreamingConfiguration) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.UpdateKinesisStreamingConfiguration, func(s *smithy.Schema) error { + switch s { + case schemas.UpdateKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision: + var ev string + if err := d.ReadString(schemas.UpdateKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision, &ev); err != nil { + return err + } + v.ApproximateCreationDateTimePrecision = ApproximateCreationDateTimePrecision(ev) + return nil + } + return nil + }) +} + // Represents a replica to be modified. type UpdateReplicationGroupMemberAction struct { @@ -3821,6 +8946,507 @@ type UpdateReplicationGroupMemberAction struct { noSmithyDocumentSerde } +func (v *UpdateReplicationGroupMemberAction) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.UpdateReplicationGroupMemberAction) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *UpdateReplicationGroupMemberAction) SerializeMembers(s smithy.ShapeSerializer) { + serializeReplicaGlobalSecondaryIndexList(s, schemas.UpdateReplicationGroupMemberAction_GlobalSecondaryIndexes, v.GlobalSecondaryIndexes) + if v.KMSMasterKeyId != nil { + s.WriteString(schemas.UpdateReplicationGroupMemberAction_KMSMasterKeyId, *v.KMSMasterKeyId) + } + if v.OnDemandThroughputOverride != nil { + s.WriteStruct(schemas.UpdateReplicationGroupMemberAction_OnDemandThroughputOverride) + v.OnDemandThroughputOverride.SerializeMembers(s) + s.CloseStruct() + } + if v.ProvisionedThroughputOverride != nil { + s.WriteStruct(schemas.UpdateReplicationGroupMemberAction_ProvisionedThroughputOverride) + v.ProvisionedThroughputOverride.SerializeMembers(s) + s.CloseStruct() + } + if v.RegionName != nil { + s.WriteString(schemas.UpdateReplicationGroupMemberAction_RegionName, *v.RegionName) + } + if v.TableClassOverride != "" { + s.WriteString(schemas.UpdateReplicationGroupMemberAction_TableClassOverride, string(v.TableClassOverride)) + } +} +func (v *UpdateReplicationGroupMemberAction) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.UpdateReplicationGroupMemberAction, func(s *smithy.Schema) error { + switch s { + case schemas.UpdateReplicationGroupMemberAction_GlobalSecondaryIndexes: + return deserializeReplicaGlobalSecondaryIndexList(d, schemas.UpdateReplicationGroupMemberAction_GlobalSecondaryIndexes, &v.GlobalSecondaryIndexes) + case schemas.UpdateReplicationGroupMemberAction_KMSMasterKeyId: + v.KMSMasterKeyId = new(string) + return d.ReadString(schemas.UpdateReplicationGroupMemberAction_KMSMasterKeyId, v.KMSMasterKeyId) + case schemas.UpdateReplicationGroupMemberAction_OnDemandThroughputOverride: + v.OnDemandThroughputOverride = &OnDemandThroughputOverride{} + return v.OnDemandThroughputOverride.Deserialize(d) + case schemas.UpdateReplicationGroupMemberAction_ProvisionedThroughputOverride: + v.ProvisionedThroughputOverride = &ProvisionedThroughputOverride{} + return v.ProvisionedThroughputOverride.Deserialize(d) + case schemas.UpdateReplicationGroupMemberAction_RegionName: + v.RegionName = new(string) + return d.ReadString(schemas.UpdateReplicationGroupMemberAction_RegionName, v.RegionName) + case schemas.UpdateReplicationGroupMemberAction_TableClassOverride: + var ev string + if err := d.ReadString(schemas.UpdateReplicationGroupMemberAction_TableClassOverride, &ev); err != nil { + return err + } + v.TableClassOverride = TableClass(ev) + return nil + } + return nil + }) +} + +// The definition of a vector attribute for a vector index. +type VectorAttributeDefinition struct { + + // The name of the vector attribute. + // + // This member is required. + AttributeName *string + + noSmithyDocumentSerde +} + +func (v *VectorAttributeDefinition) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.VectorAttributeDefinition) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *VectorAttributeDefinition) SerializeMembers(s smithy.ShapeSerializer) { + if v.AttributeName != nil { + s.WriteString(schemas.VectorAttributeDefinition_AttributeName, *v.AttributeName) + } +} +func (v *VectorAttributeDefinition) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.VectorAttributeDefinition, func(s *smithy.Schema) error { + switch s { + case schemas.VectorAttributeDefinition_AttributeName: + v.AttributeName = new(string) + return d.ReadString(schemas.VectorAttributeDefinition_AttributeName, v.AttributeName) + } + return nil + }) +} + +// The consumed capacity for vector index operations, including vector search +// request bytes and vector write request bytes. +type VectorCapacity struct { + + // The number of vector search request bytes consumed by a SearchVectors operation. + VectorSearchRequestBytes *float64 + + // The number of vector write request bytes consumed when writing to a vector + // index. Reported for write operations that modify attributes indexed by a vector + // index. + VectorWriteRequestBytes *float64 + + noSmithyDocumentSerde +} + +func (v *VectorCapacity) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.VectorCapacity) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *VectorCapacity) SerializeMembers(s smithy.ShapeSerializer) { + if v.VectorSearchRequestBytes != nil { + s.WriteFloat64(schemas.VectorCapacity_VectorSearchRequestBytes, *v.VectorSearchRequestBytes) + } + if v.VectorWriteRequestBytes != nil { + s.WriteFloat64(schemas.VectorCapacity_VectorWriteRequestBytes, *v.VectorWriteRequestBytes) + } +} +func (v *VectorCapacity) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.VectorCapacity, func(s *smithy.Schema) error { + switch s { + case schemas.VectorCapacity_VectorSearchRequestBytes: + v.VectorSearchRequestBytes = new(float64) + return d.ReadFloat64(schemas.VectorCapacity_VectorSearchRequestBytes, v.VectorSearchRequestBytes) + case schemas.VectorCapacity_VectorWriteRequestBytes: + v.VectorWriteRequestBytes = new(float64) + return d.ReadFloat64(schemas.VectorCapacity_VectorWriteRequestBytes, v.VectorWriteRequestBytes) + } + return nil + }) +} + +// Contains the configuration settings for a vector index, including the index +// name, vector attribute, dimensions, distance function, search schema, and +// projection. +type VectorIndex struct { + + // The number of dimensions in each vector. + // + // This member is required. + Dimensions *int64 + + // The distance function used to calculate similarity between vectors. Valid + // values: COSINE , EUCLIDEAN , DOT_PRODUCT . + // + // This member is required. + DistanceFunction VectorDistanceFunction + + // The name of the vector index. + // + // This member is required. + IndexName *string + + // Specifies attributes that are copied (projected) from the table into the vector + // index. + // + // This member is required. + Projection *Projection + + // The vector attribute configuration for the index. + // + // This member is required. + VectorAttribute *VectorAttributeDefinition + + // The search schema that defines partition key and inline filter attributes for + // the vector index. + SearchSchema []SearchSchemaElement + + noSmithyDocumentSerde +} + +func (v *VectorIndex) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.VectorIndex) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *VectorIndex) SerializeMembers(s smithy.ShapeSerializer) { + if v.Dimensions != nil { + s.WriteInt64(schemas.VectorIndex_Dimensions, *v.Dimensions) + } + if v.DistanceFunction != "" { + s.WriteString(schemas.VectorIndex_DistanceFunction, string(v.DistanceFunction)) + } + if v.IndexName != nil { + s.WriteString(schemas.VectorIndex_IndexName, *v.IndexName) + } + if v.Projection != nil { + s.WriteStruct(schemas.VectorIndex_Projection) + v.Projection.SerializeMembers(s) + s.CloseStruct() + } + serializeSearchSchema(s, schemas.VectorIndex_SearchSchema, v.SearchSchema) + if v.VectorAttribute != nil { + s.WriteStruct(schemas.VectorIndex_VectorAttribute) + v.VectorAttribute.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *VectorIndex) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.VectorIndex, func(s *smithy.Schema) error { + switch s { + case schemas.VectorIndex_Dimensions: + v.Dimensions = new(int64) + return d.ReadInt64(schemas.VectorIndex_Dimensions, v.Dimensions) + case schemas.VectorIndex_DistanceFunction: + var ev string + if err := d.ReadString(schemas.VectorIndex_DistanceFunction, &ev); err != nil { + return err + } + v.DistanceFunction = VectorDistanceFunction(ev) + return nil + case schemas.VectorIndex_IndexName: + v.IndexName = new(string) + return d.ReadString(schemas.VectorIndex_IndexName, v.IndexName) + case schemas.VectorIndex_Projection: + v.Projection = &Projection{} + return v.Projection.Deserialize(d) + case schemas.VectorIndex_SearchSchema: + return deserializeSearchSchema(d, schemas.VectorIndex_SearchSchema, &v.SearchSchema) + case schemas.VectorIndex_VectorAttribute: + v.VectorAttribute = &VectorAttributeDefinition{} + return v.VectorAttribute.Deserialize(d) + } + return nil + }) +} + +// Contains the current state and configuration of a vector index, including its +// status, size, item count, and the settings specified when the index was created. +type VectorIndexDescription struct { + + // Specifies whether the index is currently backfilling. During backfill, + // SearchVectors operations might return incomplete results. + Backfilling *bool + + // The number of dimensions in each vector. + Dimensions *int64 + + // The distance function used to calculate similarity between vectors. + DistanceFunction VectorDistanceFunction + + // The Amazon Resource Name (ARN) that uniquely identifies the vector index. + IndexArn *string + + // The name of the vector index. + IndexName *string + + // The total size of the vector index, in bytes. Amazon DynamoDB updates this + // value approximately every six hours. Recent changes might not be reflected in + // this value. + IndexSizeBytes *int64 + + // The current state of the vector index: + // + // - CREATING - The index is being created. + // + // - ACTIVE - The index is ready for use. + // + // - DELETING - The index is being deleted. + IndexStatus IndexStatus + + // The number of items indexed in the vector index. Amazon DynamoDB updates this + // value approximately every six hours. Recent changes might not be reflected in + // this value. + ItemCount *int64 + + // Specifies attributes that are copied (projected) from the table into the vector + // index. + Projection *Projection + + // The search schema that defines partition key and inline filter attributes for + // the vector index. + SearchSchema []SearchSchemaElement + + // The vector attribute configuration for the index. + VectorAttribute *VectorAttributeDefinition + + noSmithyDocumentSerde +} + +func (v *VectorIndexDescription) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.VectorIndexDescription) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *VectorIndexDescription) SerializeMembers(s smithy.ShapeSerializer) { + if v.Backfilling != nil { + s.WriteBool(schemas.VectorIndexDescription_Backfilling, *v.Backfilling) + } + if v.Dimensions != nil { + s.WriteInt64(schemas.VectorIndexDescription_Dimensions, *v.Dimensions) + } + if v.DistanceFunction != "" { + s.WriteString(schemas.VectorIndexDescription_DistanceFunction, string(v.DistanceFunction)) + } + if v.IndexArn != nil { + s.WriteString(schemas.VectorIndexDescription_IndexArn, *v.IndexArn) + } + if v.IndexName != nil { + s.WriteString(schemas.VectorIndexDescription_IndexName, *v.IndexName) + } + if v.IndexSizeBytes != nil { + s.WriteInt64(schemas.VectorIndexDescription_IndexSizeBytes, *v.IndexSizeBytes) + } + if v.IndexStatus != "" { + s.WriteString(schemas.VectorIndexDescription_IndexStatus, string(v.IndexStatus)) + } + if v.ItemCount != nil { + s.WriteInt64(schemas.VectorIndexDescription_ItemCount, *v.ItemCount) + } + if v.Projection != nil { + s.WriteStruct(schemas.VectorIndexDescription_Projection) + v.Projection.SerializeMembers(s) + s.CloseStruct() + } + serializeSearchSchema(s, schemas.VectorIndexDescription_SearchSchema, v.SearchSchema) + if v.VectorAttribute != nil { + s.WriteStruct(schemas.VectorIndexDescription_VectorAttribute) + v.VectorAttribute.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *VectorIndexDescription) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.VectorIndexDescription, func(s *smithy.Schema) error { + switch s { + case schemas.VectorIndexDescription_Backfilling: + v.Backfilling = new(bool) + return d.ReadBool(schemas.VectorIndexDescription_Backfilling, v.Backfilling) + case schemas.VectorIndexDescription_Dimensions: + v.Dimensions = new(int64) + return d.ReadInt64(schemas.VectorIndexDescription_Dimensions, v.Dimensions) + case schemas.VectorIndexDescription_DistanceFunction: + var ev string + if err := d.ReadString(schemas.VectorIndexDescription_DistanceFunction, &ev); err != nil { + return err + } + v.DistanceFunction = VectorDistanceFunction(ev) + return nil + case schemas.VectorIndexDescription_IndexArn: + v.IndexArn = new(string) + return d.ReadString(schemas.VectorIndexDescription_IndexArn, v.IndexArn) + case schemas.VectorIndexDescription_IndexName: + v.IndexName = new(string) + return d.ReadString(schemas.VectorIndexDescription_IndexName, v.IndexName) + case schemas.VectorIndexDescription_IndexSizeBytes: + v.IndexSizeBytes = new(int64) + return d.ReadInt64(schemas.VectorIndexDescription_IndexSizeBytes, v.IndexSizeBytes) + case schemas.VectorIndexDescription_IndexStatus: + var ev string + if err := d.ReadString(schemas.VectorIndexDescription_IndexStatus, &ev); err != nil { + return err + } + v.IndexStatus = IndexStatus(ev) + return nil + case schemas.VectorIndexDescription_ItemCount: + v.ItemCount = new(int64) + return d.ReadInt64(schemas.VectorIndexDescription_ItemCount, v.ItemCount) + case schemas.VectorIndexDescription_Projection: + v.Projection = &Projection{} + return v.Projection.Deserialize(d) + case schemas.VectorIndexDescription_SearchSchema: + return deserializeSearchSchema(d, schemas.VectorIndexDescription_SearchSchema, &v.SearchSchema) + case schemas.VectorIndexDescription_VectorAttribute: + v.VectorAttribute = &VectorAttributeDefinition{} + return v.VectorAttribute.Deserialize(d) + } + return nil + }) +} + +// Contains the configuration of a vector index as it existed at the time a backup +// was created. +type VectorIndexInfo struct { + + // The number of dimensions in each vector. + Dimensions *int64 + + // The distance function used to calculate similarity between vectors. + DistanceFunction VectorDistanceFunction + + // The name of the vector index. + IndexName *string + + // Specifies attributes that are copied (projected) from the table into the vector + // index. + Projection *Projection + + // The search schema that defines partition key and inline filter attributes for + // the vector index. + SearchSchema []SearchSchemaElement + + // The vector attribute configuration for the index. + VectorAttribute *VectorAttributeDefinition + + noSmithyDocumentSerde +} + +func (v *VectorIndexInfo) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.VectorIndexInfo) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *VectorIndexInfo) SerializeMembers(s smithy.ShapeSerializer) { + if v.Dimensions != nil { + s.WriteInt64(schemas.VectorIndexInfo_Dimensions, *v.Dimensions) + } + if v.DistanceFunction != "" { + s.WriteString(schemas.VectorIndexInfo_DistanceFunction, string(v.DistanceFunction)) + } + if v.IndexName != nil { + s.WriteString(schemas.VectorIndexInfo_IndexName, *v.IndexName) + } + if v.Projection != nil { + s.WriteStruct(schemas.VectorIndexInfo_Projection) + v.Projection.SerializeMembers(s) + s.CloseStruct() + } + serializeSearchSchema(s, schemas.VectorIndexInfo_SearchSchema, v.SearchSchema) + if v.VectorAttribute != nil { + s.WriteStruct(schemas.VectorIndexInfo_VectorAttribute) + v.VectorAttribute.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *VectorIndexInfo) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.VectorIndexInfo, func(s *smithy.Schema) error { + switch s { + case schemas.VectorIndexInfo_Dimensions: + v.Dimensions = new(int64) + return d.ReadInt64(schemas.VectorIndexInfo_Dimensions, v.Dimensions) + case schemas.VectorIndexInfo_DistanceFunction: + var ev string + if err := d.ReadString(schemas.VectorIndexInfo_DistanceFunction, &ev); err != nil { + return err + } + v.DistanceFunction = VectorDistanceFunction(ev) + return nil + case schemas.VectorIndexInfo_IndexName: + v.IndexName = new(string) + return d.ReadString(schemas.VectorIndexInfo_IndexName, v.IndexName) + case schemas.VectorIndexInfo_Projection: + v.Projection = &Projection{} + return v.Projection.Deserialize(d) + case schemas.VectorIndexInfo_SearchSchema: + return deserializeSearchSchema(d, schemas.VectorIndexInfo_SearchSchema, &v.SearchSchema) + case schemas.VectorIndexInfo_VectorAttribute: + v.VectorAttribute = &VectorAttributeDefinition{} + return v.VectorAttribute.Deserialize(d) + } + return nil + }) +} + +// A vector index to be added to or removed from a table. +type VectorIndexUpdate struct { + + // The configuration for creating a new vector index on the table. + Create *CreateVectorIndexAction + + // The configuration for deleting an existing vector index from the table. + Delete *DeleteVectorIndexAction + + noSmithyDocumentSerde +} + +func (v *VectorIndexUpdate) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.VectorIndexUpdate) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *VectorIndexUpdate) SerializeMembers(s smithy.ShapeSerializer) { + if v.Create != nil { + s.WriteStruct(schemas.VectorIndexUpdate_Create) + v.Create.SerializeMembers(s) + s.CloseStruct() + } + if v.Delete != nil { + s.WriteStruct(schemas.VectorIndexUpdate_Delete) + v.Delete.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *VectorIndexUpdate) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.VectorIndexUpdate, func(s *smithy.Schema) error { + switch s { + case schemas.VectorIndexUpdate_Create: + v.Create = &CreateVectorIndexAction{} + return v.Create.Deserialize(d) + case schemas.VectorIndexUpdate_Delete: + v.Delete = &DeleteVectorIndexAction{} + return v.Delete.Deserialize(d) + } + return nil + }) +} + // Provides visibility into the number of read and write operations your table or // secondary index can instantaneously support. The settings can be modified using // the UpdateTable operation to meet the throughput requirements of an upcoming @@ -3838,6 +9464,34 @@ type WarmThroughput struct { noSmithyDocumentSerde } +func (v *WarmThroughput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.WarmThroughput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *WarmThroughput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ReadUnitsPerSecond != nil { + s.WriteInt64(schemas.WarmThroughput_ReadUnitsPerSecond, *v.ReadUnitsPerSecond) + } + if v.WriteUnitsPerSecond != nil { + s.WriteInt64(schemas.WarmThroughput_WriteUnitsPerSecond, *v.WriteUnitsPerSecond) + } +} +func (v *WarmThroughput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.WarmThroughput, func(s *smithy.Schema) error { + switch s { + case schemas.WarmThroughput_ReadUnitsPerSecond: + v.ReadUnitsPerSecond = new(int64) + return d.ReadInt64(schemas.WarmThroughput_ReadUnitsPerSecond, v.ReadUnitsPerSecond) + case schemas.WarmThroughput_WriteUnitsPerSecond: + v.WriteUnitsPerSecond = new(int64) + return d.ReadInt64(schemas.WarmThroughput_WriteUnitsPerSecond, v.WriteUnitsPerSecond) + } + return nil + }) +} + // Represents an operation to perform - either DeleteItem or PutItem . You can only // request one of these operations, not both, in a single WriteRequest . If you do // need to perform both of these operations, you need to provide two separate @@ -3853,6 +9507,38 @@ type WriteRequest struct { noSmithyDocumentSerde } +func (v *WriteRequest) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.WriteRequest) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *WriteRequest) SerializeMembers(s smithy.ShapeSerializer) { + if v.DeleteRequest != nil { + s.WriteStruct(schemas.WriteRequest_DeleteRequest) + v.DeleteRequest.SerializeMembers(s) + s.CloseStruct() + } + if v.PutRequest != nil { + s.WriteStruct(schemas.WriteRequest_PutRequest) + v.PutRequest.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *WriteRequest) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.WriteRequest, func(s *smithy.Schema) error { + switch s { + case schemas.WriteRequest_DeleteRequest: + v.DeleteRequest = &DeleteRequest{} + return v.DeleteRequest.Deserialize(d) + case schemas.WriteRequest_PutRequest: + v.PutRequest = &PutRequest{} + return v.PutRequest.Deserialize(d) + } + return nil + }) +} + type noSmithyDocumentSerde = smithydocument.NoSerde // UnknownUnionMember is returned when a union member is returned over the wire, diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/validators.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/validators.go index cd5187a3076..435b56e94c6 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/validators.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/validators.go @@ -730,6 +730,26 @@ func (m *validateOpScan) HandleInitialize(ctx context.Context, in middleware.Ini return next.HandleInitialize(ctx, in) } +type validateOpSearchVectors struct { +} + +func (*validateOpSearchVectors) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSearchVectors) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SearchVectorsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSearchVectorsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpTagResource struct { } @@ -1134,6 +1154,10 @@ func addOpScanValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpScan{}, middleware.After) } +func addOpSearchVectorsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSearchVectors{}, middleware.After) +} + func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } @@ -1438,6 +1462,42 @@ func validateCreateReplicationGroupMemberAction(v *types.CreateReplicationGroupM } } +func validateCreateVectorIndexAction(v *types.CreateVectorIndexAction) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateVectorIndexAction"} + if v.IndexName == nil { + invalidParams.Add(smithy.NewErrParamRequired("IndexName")) + } + if v.VectorAttribute == nil { + invalidParams.Add(smithy.NewErrParamRequired("VectorAttribute")) + } else if v.VectorAttribute != nil { + if err := validateVectorAttributeDefinition(v.VectorAttribute); err != nil { + invalidParams.AddNested("VectorAttribute", err.(smithy.InvalidParamsError)) + } + } + if v.SearchSchema != nil { + if err := validateSearchSchema(v.SearchSchema); err != nil { + invalidParams.AddNested("SearchSchema", err.(smithy.InvalidParamsError)) + } + } + if v.Projection == nil { + invalidParams.Add(smithy.NewErrParamRequired("Projection")) + } + if v.Dimensions == nil { + invalidParams.Add(smithy.NewErrParamRequired("Dimensions")) + } + if len(v.DistanceFunction) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("DistanceFunction")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateDelete(v *types.Delete) error { if v == nil { return nil @@ -1531,6 +1591,21 @@ func validateDeleteRequest(v *types.DeleteRequest) error { } } +func validateDeleteVectorIndexAction(v *types.DeleteVectorIndexAction) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteVectorIndexAction"} + if v.IndexName == nil { + invalidParams.Add(smithy.NewErrParamRequired("IndexName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateFilterConditionMap(v map[string]types.Condition) error { if v == nil { return nil @@ -2278,6 +2353,41 @@ func validateS3BucketSource(v *types.S3BucketSource) error { } } +func validateSearchSchema(v []types.SearchSchemaElement) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SearchSchema"} + for i := range v { + if err := validateSearchSchemaElement(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSearchSchemaElement(v *types.SearchSchemaElement) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SearchSchemaElement"} + if v.AttributeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("AttributeName")) + } + if len(v.SearchSchemaElementType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("SearchSchemaElementType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateStreamSpecification(v *types.StreamSpecification) error { if v == nil { return nil @@ -2325,6 +2435,11 @@ func validateTableCreationParameters(v *types.TableCreationParameters) error { invalidParams.AddNested("GlobalSecondaryIndexes", err.(smithy.InvalidParamsError)) } } + if v.VectorIndexes != nil { + if err := validateVectorIndexList(v.VectorIndexes); err != nil { + invalidParams.AddNested("VectorIndexes", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -2531,6 +2646,113 @@ func validateUpdateReplicationGroupMemberAction(v *types.UpdateReplicationGroupM } } +func validateVectorAttributeDefinition(v *types.VectorAttributeDefinition) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "VectorAttributeDefinition"} + if v.AttributeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("AttributeName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateVectorIndex(v *types.VectorIndex) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "VectorIndex"} + if v.IndexName == nil { + invalidParams.Add(smithy.NewErrParamRequired("IndexName")) + } + if v.VectorAttribute == nil { + invalidParams.Add(smithy.NewErrParamRequired("VectorAttribute")) + } else if v.VectorAttribute != nil { + if err := validateVectorAttributeDefinition(v.VectorAttribute); err != nil { + invalidParams.AddNested("VectorAttribute", err.(smithy.InvalidParamsError)) + } + } + if v.SearchSchema != nil { + if err := validateSearchSchema(v.SearchSchema); err != nil { + invalidParams.AddNested("SearchSchema", err.(smithy.InvalidParamsError)) + } + } + if v.Projection == nil { + invalidParams.Add(smithy.NewErrParamRequired("Projection")) + } + if v.Dimensions == nil { + invalidParams.Add(smithy.NewErrParamRequired("Dimensions")) + } + if len(v.DistanceFunction) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("DistanceFunction")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateVectorIndexList(v []types.VectorIndex) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "VectorIndexList"} + for i := range v { + if err := validateVectorIndex(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateVectorIndexUpdate(v *types.VectorIndexUpdate) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "VectorIndexUpdate"} + if v.Create != nil { + if err := validateCreateVectorIndexAction(v.Create); err != nil { + invalidParams.AddNested("Create", err.(smithy.InvalidParamsError)) + } + } + if v.Delete != nil { + if err := validateDeleteVectorIndexAction(v.Delete); err != nil { + invalidParams.AddNested("Delete", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateVectorIndexUpdateList(v []types.VectorIndexUpdate) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "VectorIndexUpdateList"} + for i := range v { + if err := validateVectorIndexUpdate(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateWriteRequest(v *types.WriteRequest) error { if v == nil { return nil @@ -2706,6 +2928,11 @@ func validateOpCreateTableInput(v *CreateTableInput) error { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } + if v.VectorIndexes != nil { + if err := validateVectorIndexList(v.VectorIndexes); err != nil { + invalidParams.AddNested("VectorIndexes", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -3193,6 +3420,11 @@ func validateOpRestoreTableFromBackupInput(v *RestoreTableFromBackupInput) error invalidParams.AddNested("ProvisionedThroughputOverride", err.(smithy.InvalidParamsError)) } } + if v.VectorIndexOverride != nil { + if err := validateVectorIndexList(v.VectorIndexOverride); err != nil { + invalidParams.AddNested("VectorIndexOverride", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -3223,6 +3455,11 @@ func validateOpRestoreTableToPointInTimeInput(v *RestoreTableToPointInTimeInput) invalidParams.AddNested("ProvisionedThroughputOverride", err.(smithy.InvalidParamsError)) } } + if v.VectorIndexOverride != nil { + if err := validateVectorIndexList(v.VectorIndexOverride); err != nil { + invalidParams.AddNested("VectorIndexOverride", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -3250,6 +3487,30 @@ func validateOpScanInput(v *ScanInput) error { } } +func validateOpSearchVectorsInput(v *SearchVectorsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SearchVectorsInput"} + if v.TableName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TableName")) + } + if v.IndexName == nil { + invalidParams.Add(smithy.NewErrParamRequired("IndexName")) + } + if v.SearchVector == nil { + invalidParams.Add(smithy.NewErrParamRequired("SearchVector")) + } + if v.TopK == nil { + invalidParams.Add(smithy.NewErrParamRequired("TopK")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil @@ -3494,6 +3755,11 @@ func validateOpUpdateTableInput(v *UpdateTableInput) error { invalidParams.AddNested("GlobalTableWitnessUpdates", err.(smithy.InvalidParamsError)) } } + if v.VectorIndexUpdates != nil { + if err := validateVectorIndexUpdateList(v.VectorIndexUpdates); err != nil { + invalidParams.AddNested("VectorIndexUpdates", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { 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 44b20890073..957c2c12519 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,31 @@ +# v1.13.21 (2026-10-09.2) + +* **Dependency Update**: Update to smithy-go v1.28.5. + +# v1.13.20 (2026-10-08) + +* **Dependency Update**: Update to smithy-go v1.28.4. + +# v1.13.19 (2026-08-26) + +* **Dependency Update**: Update to smithy-go v1.28.0. + +# v1.13.18 (2026-08-25) + +* **Dependency Update**: Update to smithy-go v1.27.10. + +# v1.13.17 (2026-08-14) + +* **Dependency Update**: Update to smithy-go v1.27.8. + +# v1.13.16 (2026-08-10) + +* **Dependency Update**: Update to smithy-go v1.27.7. + +# v1.13.15 (2026-07-31.2) + +* **Dependency Update**: Upgrade to smithy-go v1.27.6 to fix various serde issues in HTTP binding services. + # v1.13.14 (2026-07-28) * **Dependency Update**: Update to smithy-go v1.27.5. 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 2898c5e5253..bb48751e666 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.14" +const goModuleVersion = "1.13.21" 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 cfcd48ae2b1..bd720958bea 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,84 @@ +# v1.13.6 (2026-10-09.2) + +* **Dependency Update**: Update to smithy-go v1.28.5. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.5 (2026-10-08) + +* **Dependency Update**: Update to smithy-go v1.28.4. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.4 (2026-09-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.3 (2026-09-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.2 (2026-09-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.1 (2026-08-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.0 (2026-08-27) + +* **Feature**: Support connection read timeouts in the SDK. This is currently available on an opt-in basis by setting env `AWS_ENABLE_DEFAULT_SOCKET_TIMEOUT_2026=true`. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.17 (2026-08-26) + +* **Dependency Update**: Update to smithy-go v1.28.0. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.16 (2026-08-25) + +* **Dependency Update**: Update to smithy-go v1.27.10. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.15 (2026-08-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.14 (2026-08-14) + +* **Dependency Update**: Update to smithy-go v1.27.8. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.13 (2026-08-10) + +* **Dependency Update**: Update to smithy-go v1.27.7. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.12 (2026-08-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.11 (2026-07-31.2) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.27.6 to fix various serde issues in HTTP binding services. + +# v1.12.10 (2026-07-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.9 (2026-07-28) + +* **Dependency Update**: Update to smithy-go v1.27.5. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.8 (2026-07-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.7 (2026-07-01) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.12.6 (2026-06-08) * **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 19fd00e2c08..aa64f5fde5d 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.12.6" +const goModuleVersion = "1.13.6" 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 90dcc45c999..3b42b3532d9 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,67 @@ +# v1.14.6 (2026-10-09.2) + +* **Dependency Update**: Update to smithy-go v1.28.5. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.5 (2026-10-08) + +* **Dependency Update**: Update to smithy-go v1.28.4. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.4 (2026-09-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.3 (2026-09-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.2 (2026-09-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.1 (2026-08-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.0 (2026-08-27) + +* **Feature**: Support connection read timeouts in the SDK. This is currently available on an opt-in basis by setting env `AWS_ENABLE_DEFAULT_SOCKET_TIMEOUT_2026=true`. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.40 (2026-08-26) + +* **Dependency Update**: Update to smithy-go v1.28.0. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.39 (2026-08-25) + +* **Dependency Update**: Update to smithy-go v1.27.10. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.38 (2026-08-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.37 (2026-08-14) + +* **Dependency Update**: Update to smithy-go v1.27.8. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.36 (2026-08-10) + +* **Dependency Update**: Update to smithy-go v1.27.7. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.35 (2026-08-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.34 (2026-07-31.2) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.27.6 to fix various serde issues in HTTP binding services. + # v1.13.33 (2026-07-29) * **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 8a073d2487c..ad756ed31a1 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.33" +const goModuleVersion = "1.14.6" 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 index 561b01cb7c7..e71b5cdae44 100644 --- 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 @@ -1,3 +1,78 @@ +# v1.10.4 (2026-10-09.2) + +* **Dependency Update**: Update to smithy-go v1.28.5. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.3 (2026-10-08) + +* **Dependency Update**: Update to smithy-go v1.28.4. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.2 (2026-10-06) + +* No change notes available for this release. + +# v1.10.1 (2026-09-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.0 (2026-09-09) + +* **Feature**: Stop registering the `retry.MetricsHeader` middleware in generated clients. The `Amz-Sdk-Request` header is now set by the retry middleware itself. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.0 (2026-09-04) + +* **Feature**: Stop registering the `spanRetryLoop` middleware in generated clients. The retry loop's tracing span is now opened by the retry middleware itself. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.0 (2026-08-31.2) + +* **Feature**: Stop registering the `SetCredentialSourceMiddleware` middleware in generated clients. Credential source user agent features are now set when the client's middleware stack is constructed. + +# v1.7.1 (2026-08-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.7.0 (2026-08-27) + +* **Feature**: Support connection read timeouts in the SDK. This is currently available on an opt-in basis by setting env `AWS_ENABLE_DEFAULT_SOCKET_TIMEOUT_2026=true`. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.0 (2026-08-26) + +* **Feature**: Stop registering the `ComputeContentLength` middleware in generated clients. `Content-Length` is now set when the request body is set via `SetStream`. +* **Dependency Update**: Update to smithy-go v1.28.0. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.8 (2026-08-25) + +* **Dependency Update**: Update to smithy-go v1.27.10. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.7 (2026-08-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.6 (2026-08-14) + +* **Dependency Update**: Update to smithy-go v1.27.8. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.5 (2026-08-10) + +* **Dependency Update**: Update to smithy-go v1.27.7. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.4 (2026-08-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.3 (2026-07-31.2) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.27.6 to fix various serde issues in HTTP binding services. + # v1.5.2 (2026-07-29) * **Dependency Update**: Updated to the latest SDK module versions 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 index 2094f01d271..b7040dc6b13 100644 --- 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 @@ -16,6 +16,7 @@ import ( 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" + "github.com/aws/aws-sdk-go-v2/internal/timeouts" smithy "github.com/aws/smithy-go" smithydocument "github.com/aws/smithy-go/document" "github.com/aws/smithy-go/logging" @@ -263,6 +264,10 @@ func (c *Client) invokeOperation( finalizeClientEndpointResolverOptions(&options) + ctx = setLoggerContext(ctx, options, opID) + + ctx = resolveServiceMetadata(ctx, options, opID) + if err := c.addCommonMiddlewares(stack, options, opID); err != nil { return nil, metadata, err } @@ -379,9 +384,6 @@ func (c *Client) addCommonMiddlewares(stack *middleware.Stack, options Options, if err := addProtocolFinalizerMiddlewares(stack, options, operation); err != nil { return fmt.Errorf("add protocol finalizers: %v", err) } - if err := addSetLoggerMiddleware(stack, options); err != nil { - return err - } if err := addClientRequestID(stack); err != nil { return err } @@ -391,9 +393,6 @@ func (c *Client) addCommonMiddlewares(stack *middleware.Stack, options Options, if err := addRawResponseToMetadata(stack); err != nil { return err } - if err := addSpanRetryLoop(stack, options); err != nil { - return err - } if err := addClientUserAgent(stack, options); err != nil { return err } @@ -434,30 +433,6 @@ func resolveAuthSchemes(options *Options) { 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 @@ -465,8 +440,9 @@ func resolveDefaultLogger(o *Options) { o.Logger = logging.Nop{} } -func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { - return middleware.AddSetLoggerMiddleware(stack, o.Logger) +func setLoggerContext(ctx context.Context, options Options, operation string) context.Context { + _ = operation + return middleware.SetLogger(ctx, options.Logger) } func setResolvedDefaultsMode(o *Options) { @@ -545,6 +521,12 @@ func resolveHTTPClient(o *Options) { }) } + if _, ok := buildable.GetReadTimeout(); !ok { + if timeout, ok := timeouts.GetServiceReadTimeout(ServiceID); ok { + buildable = buildable.WithReadTimeout(timeout) + } + } + o.HTTPClient = buildable } @@ -686,10 +668,6 @@ func addClientRequestID(stack *middleware.Stack) error { return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) } -func addComputeContentLength(stack *middleware.Stack) error { - return stack.Build.Insert(&smithyhttp.ComputeContentLength{}, "ClientRequestID", middleware.After) -} - func addRawResponseToMetadata(stack *middleware.Stack) error { return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) } @@ -699,30 +677,6 @@ func addRecordResponseTiming(stack *middleware.Stack, options Options) error { DisableClockSkewCorrection: options.DisableClockSkewCorrection, }, 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) } @@ -780,9 +734,6 @@ func addRetry(stack *middleware.Stack, o Options, c *Client) error { 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 } @@ -835,35 +786,21 @@ func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { 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) + asProviderSource, ok := options.Credentials.(aws.CredentialProviderSource) + if !ok { + return nil + } + + for _, source := range asProviderSource.ProviderSources() { + ua.AddCredentialsSource(source) + } + return nil } func resolveTracerProvider(options *Options) { @@ -883,12 +820,16 @@ type IdempotencyTokenProvider interface { GetIdempotencyToken() (string, error) } -func newServiceMetadataMiddleware(region, operation string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: operation, +func resolveServiceMetadata(ctx context.Context, options Options, operation string) context.Context { + ctx = awsmiddleware.SetServiceID(ctx, ServiceID) + if options.Region != "" { + ctx = awsmiddleware.SetRegion(ctx, options.Region) + } + ctx = awsmiddleware.SetOperationName(ctx, operation) + if options.EndpointResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) } + return ctx } func addRecursionDetection(stack *middleware.Stack) error { 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 index 00bec7fb7ea..d58473ac8d2 100644 --- 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 @@ -7,7 +7,6 @@ import ( "github.com/aws/aws-sdk-go-v2/service/signin/types" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // CreateOAuth2Token API @@ -117,33 +116,18 @@ func (c *Client) addOperationCreateOAuth2TokenMiddlewares(stack *middleware.Stac return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } if err = addOpCreateOAuth2TokenValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "CreateOAuth2Token"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_CreateOAuth2TokenWithIAM.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_CreateOAuth2TokenWithIAM.go index f66701cd3db..ee19239b258 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_CreateOAuth2TokenWithIAM.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_CreateOAuth2TokenWithIAM.go @@ -6,7 +6,6 @@ import ( "context" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Grants permission to exchange client credentials for an OAuth 2.0 access token @@ -85,12 +84,6 @@ func (c *Client) addOperationCreateOAuth2TokenWithIAMMiddlewares(stack *middlewa return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -100,21 +93,12 @@ func (c *Client) addOperationCreateOAuth2TokenWithIAMMiddlewares(stack *middlewa if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } if err = addOpCreateOAuth2TokenWithIAMValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "CreateOAuth2TokenWithIAM"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_DeleteConsoleAuthorizationConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_DeleteConsoleAuthorizationConfiguration.go index 749157c227a..0471b9c5692 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_DeleteConsoleAuthorizationConfiguration.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_DeleteConsoleAuthorizationConfiguration.go @@ -6,7 +6,6 @@ import ( "context" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Delete console authorization configuration with automatic scope detection @@ -73,12 +72,6 @@ func (c *Client) addOperationDeleteConsoleAuthorizationConfigurationMiddlewares( return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -88,18 +81,9 @@ func (c *Client) addOperationDeleteConsoleAuthorizationConfigurationMiddlewares( if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "DeleteConsoleAuthorizationConfiguration"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_DeleteResourcePermissionStatement.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_DeleteResourcePermissionStatement.go index d76325ff805..513a82481d7 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_DeleteResourcePermissionStatement.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_DeleteResourcePermissionStatement.go @@ -7,7 +7,6 @@ import ( "fmt" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Remove a permission statement from the account's SignIn resource-based policy @@ -63,12 +62,6 @@ func (c *Client) addOperationDeleteResourcePermissionStatementMiddlewares(stack return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -78,12 +71,6 @@ func (c *Client) addOperationDeleteResourcePermissionStatementMiddlewares(stack if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } @@ -93,9 +80,6 @@ func (c *Client) addOperationDeleteResourcePermissionStatementMiddlewares(stack if err = addOpDeleteResourcePermissionStatementValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "DeleteResourcePermissionStatement"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_GetConsoleAuthorizationConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_GetConsoleAuthorizationConfiguration.go index 74a927da1bf..90498a68c1a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_GetConsoleAuthorizationConfiguration.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_GetConsoleAuthorizationConfiguration.go @@ -6,7 +6,6 @@ import ( "context" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Get console authorization configuration with automatic scope detection @@ -73,12 +72,6 @@ func (c *Client) addOperationGetConsoleAuthorizationConfigurationMiddlewares(sta return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -88,18 +81,9 @@ func (c *Client) addOperationGetConsoleAuthorizationConfigurationMiddlewares(sta if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "GetConsoleAuthorizationConfiguration"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_GetResourcePolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_GetResourcePolicy.go index 4ee0d496ad0..087ff167f51 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_GetResourcePolicy.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_GetResourcePolicy.go @@ -7,7 +7,6 @@ import ( "github.com/aws/aws-sdk-go-v2/service/signin/types" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieve the account's consolidated SignIn resource-based policy @@ -60,12 +59,6 @@ func (c *Client) addOperationGetResourcePolicyMiddlewares(stack *middleware.Stac return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -75,18 +68,9 @@ func (c *Client) addOperationGetResourcePolicyMiddlewares(stack *middleware.Stac if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "GetResourcePolicy"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_IntrospectOAuth2TokenWithIAM.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_IntrospectOAuth2TokenWithIAM.go index 610390995d6..a2894eca9bf 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_IntrospectOAuth2TokenWithIAM.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_IntrospectOAuth2TokenWithIAM.go @@ -6,7 +6,6 @@ import ( "context" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Grants permission to inspect the metadata and state of an OAuth 2.0 access @@ -135,12 +134,6 @@ func (c *Client) addOperationIntrospectOAuth2TokenWithIAMMiddlewares(stack *midd return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -150,21 +143,12 @@ func (c *Client) addOperationIntrospectOAuth2TokenWithIAMMiddlewares(stack *midd if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } if err = addOpIntrospectOAuth2TokenWithIAMValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "IntrospectOAuth2TokenWithIAM"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_ListResourcePermissionStatements.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_ListResourcePermissionStatements.go index 2cb7c5c67ff..22d0b58a915 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_ListResourcePermissionStatements.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_ListResourcePermissionStatements.go @@ -8,7 +8,6 @@ import ( "github.com/aws/aws-sdk-go-v2/service/signin/types" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieve all permission statements in the account's SignIn resource-based policy @@ -71,12 +70,6 @@ func (c *Client) addOperationListResourcePermissionStatementsMiddlewares(stack * return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -86,18 +79,9 @@ func (c *Client) addOperationListResourcePermissionStatementsMiddlewares(stack * if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "ListResourcePermissionStatements"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_PutConsoleAuthorizationConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_PutConsoleAuthorizationConfiguration.go index 7f2bc68ada0..ab698a339f8 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_PutConsoleAuthorizationConfiguration.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_PutConsoleAuthorizationConfiguration.go @@ -6,7 +6,6 @@ import ( "context" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Enable console authorization configuration with automatic scope detection @@ -73,12 +72,6 @@ func (c *Client) addOperationPutConsoleAuthorizationConfigurationMiddlewares(sta return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -88,18 +81,9 @@ func (c *Client) addOperationPutConsoleAuthorizationConfigurationMiddlewares(sta if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "PutConsoleAuthorizationConfiguration"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_PutResourcePermissionStatement.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_PutResourcePermissionStatement.go index 071e1fb506e..7013ae576d8 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_PutResourcePermissionStatement.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_PutResourcePermissionStatement.go @@ -7,7 +7,6 @@ import ( "fmt" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Create a permission statement in the account's SignIn resource-based policy @@ -86,12 +85,6 @@ func (c *Client) addOperationPutResourcePermissionStatementMiddlewares(stack *mi return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -101,21 +94,12 @@ func (c *Client) addOperationPutResourcePermissionStatementMiddlewares(stack *mi if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } if err = addIdempotencyToken_opPutResourcePermissionStatementMiddleware(stack, options); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "PutResourcePermissionStatement"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_RevokeOAuth2TokenWithIAM.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_RevokeOAuth2TokenWithIAM.go index 3524e1eccd3..366d76c4936 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_RevokeOAuth2TokenWithIAM.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_RevokeOAuth2TokenWithIAM.go @@ -6,7 +6,6 @@ import ( "context" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Grants permission to revoke an OAuth 2.0 refresh token and its associated @@ -73,12 +72,6 @@ func (c *Client) addOperationRevokeOAuth2TokenWithIAMMiddlewares(stack *middlewa return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -88,21 +81,12 @@ func (c *Client) addOperationRevokeOAuth2TokenWithIAMMiddlewares(stack *middlewa if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } if err = addOpRevokeOAuth2TokenWithIAMValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "RevokeOAuth2TokenWithIAM"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 index e78be3229e4..71314a86842 100644 --- 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 @@ -30,6 +30,18 @@ func (m *awsRestjson1_deserializeOpCreateOAuth2Token) HandleDeserialize(ctx cont out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -38,10 +50,6 @@ func (m *awsRestjson1_deserializeOpCreateOAuth2Token) HandleDeserialize(ctx cont 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) @@ -191,6 +199,18 @@ func (m *awsRestjson1_deserializeOpCreateOAuth2TokenWithIAM) HandleDeserialize(c out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -199,10 +219,6 @@ func (m *awsRestjson1_deserializeOpCreateOAuth2TokenWithIAM) HandleDeserialize(c 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_deserializeOpErrorCreateOAuth2TokenWithIAM(response, &metadata) @@ -378,6 +394,18 @@ func (m *awsRestjson1_deserializeOpDeleteConsoleAuthorizationConfiguration) Hand out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -386,10 +414,6 @@ func (m *awsRestjson1_deserializeOpDeleteConsoleAuthorizationConfiguration) Hand 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_deserializeOpErrorDeleteConsoleAuthorizationConfiguration(response, &metadata) @@ -564,6 +588,18 @@ func (m *awsRestjson1_deserializeOpDeleteResourcePermissionStatement) HandleDese out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -572,10 +608,6 @@ func (m *awsRestjson1_deserializeOpDeleteResourcePermissionStatement) HandleDese 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_deserializeOpErrorDeleteResourcePermissionStatement(response, &metadata) @@ -664,6 +696,18 @@ func (m *awsRestjson1_deserializeOpGetConsoleAuthorizationConfiguration) HandleD out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -672,10 +716,6 @@ func (m *awsRestjson1_deserializeOpGetConsoleAuthorizationConfiguration) HandleD 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_deserializeOpErrorGetConsoleAuthorizationConfiguration(response, &metadata) @@ -850,6 +890,18 @@ func (m *awsRestjson1_deserializeOpGetResourcePolicy) HandleDeserialize(ctx cont out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -858,10 +910,6 @@ func (m *awsRestjson1_deserializeOpGetResourcePolicy) HandleDeserialize(ctx cont 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_deserializeOpErrorGetResourcePolicy(response, &metadata) @@ -1011,6 +1059,18 @@ func (m *awsRestjson1_deserializeOpIntrospectOAuth2TokenWithIAM) HandleDeseriali out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -1019,10 +1079,6 @@ func (m *awsRestjson1_deserializeOpIntrospectOAuth2TokenWithIAM) HandleDeseriali 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_deserializeOpErrorIntrospectOAuth2TokenWithIAM(response, &metadata) @@ -1305,6 +1361,18 @@ func (m *awsRestjson1_deserializeOpListResourcePermissionStatements) HandleDeser out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -1313,10 +1381,6 @@ func (m *awsRestjson1_deserializeOpListResourcePermissionStatements) HandleDeser 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_deserializeOpErrorListResourcePermissionStatements(response, &metadata) @@ -1478,6 +1542,18 @@ func (m *awsRestjson1_deserializeOpPutConsoleAuthorizationConfiguration) HandleD out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -1486,10 +1562,6 @@ func (m *awsRestjson1_deserializeOpPutConsoleAuthorizationConfiguration) HandleD 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_deserializeOpErrorPutConsoleAuthorizationConfiguration(response, &metadata) @@ -1667,6 +1739,18 @@ func (m *awsRestjson1_deserializeOpPutResourcePermissionStatement) HandleDeseria out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -1675,10 +1759,6 @@ func (m *awsRestjson1_deserializeOpPutResourcePermissionStatement) HandleDeseria 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_deserializeOpErrorPutResourcePermissionStatement(response, &metadata) @@ -1838,6 +1918,18 @@ func (m *awsRestjson1_deserializeOpRevokeOAuth2TokenWithIAM) HandleDeserialize(c out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -1846,10 +1938,6 @@ func (m *awsRestjson1_deserializeOpRevokeOAuth2TokenWithIAM) HandleDeserialize(c 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_deserializeOpErrorRevokeOAuth2TokenWithIAM(response, &metadata) 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 index d41dad1b6bf..5ec2db2be68 100644 --- 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 @@ -3,4 +3,4 @@ package signin // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.5.2" +const goModuleVersion = "1.10.4" 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 9b0d76107da..8a786c1720f 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,78 @@ +# v1.38.4 (2026-10-09.2) + +* **Dependency Update**: Update to smithy-go v1.28.5. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.38.3 (2026-10-08) + +* **Dependency Update**: Update to smithy-go v1.28.4. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.38.2 (2026-10-06) + +* No change notes available for this release. + +# v1.38.1 (2026-09-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.38.0 (2026-09-09) + +* **Feature**: Stop registering the `retry.MetricsHeader` middleware in generated clients. The `Amz-Sdk-Request` header is now set by the retry middleware itself. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.37.0 (2026-09-04) + +* **Feature**: Stop registering the `spanRetryLoop` middleware in generated clients. The retry loop's tracing span is now opened by the retry middleware itself. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.36.0 (2026-08-31.2) + +* **Feature**: Stop registering the `SetCredentialSourceMiddleware` middleware in generated clients. Credential source user agent features are now set when the client's middleware stack is constructed. + +# v1.35.1 (2026-08-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.35.0 (2026-08-27) + +* **Feature**: Support connection read timeouts in the SDK. This is currently available on an opt-in basis by setting env `AWS_ENABLE_DEFAULT_SOCKET_TIMEOUT_2026=true`. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.34.0 (2026-08-26) + +* **Feature**: Stop registering the `ComputeContentLength` middleware in generated clients. `Content-Length` is now set when the request body is set via `SetStream`. +* **Dependency Update**: Update to smithy-go v1.28.0. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.33.8 (2026-08-25) + +* **Dependency Update**: Update to smithy-go v1.27.10. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.33.7 (2026-08-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.33.6 (2026-08-14) + +* **Dependency Update**: Update to smithy-go v1.27.8. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.33.5 (2026-08-10) + +* **Dependency Update**: Update to smithy-go v1.27.7. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.33.4 (2026-08-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.33.3 (2026-07-31.2) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.27.6 to fix various serde issues in HTTP binding services. + # v1.33.2 (2026-07-29) * **Dependency Update**: Updated to the latest SDK module versions 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 76b3527d35d..6fd750495b3 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 @@ -15,6 +15,7 @@ import ( 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" + "github.com/aws/aws-sdk-go-v2/internal/timeouts" smithy "github.com/aws/smithy-go" smithydocument "github.com/aws/smithy-go/document" "github.com/aws/smithy-go/logging" @@ -259,6 +260,10 @@ func (c *Client) invokeOperation( finalizeClientEndpointResolverOptions(&options) + ctx = setLoggerContext(ctx, options, opID) + + ctx = resolveServiceMetadata(ctx, options, opID) + if err := c.addCommonMiddlewares(stack, options, opID); err != nil { return nil, metadata, err } @@ -375,9 +380,6 @@ func (c *Client) addCommonMiddlewares(stack *middleware.Stack, options Options, if err := addProtocolFinalizerMiddlewares(stack, options, operation); err != nil { return fmt.Errorf("add protocol finalizers: %v", err) } - if err := addSetLoggerMiddleware(stack, options); err != nil { - return err - } if err := addClientRequestID(stack); err != nil { return err } @@ -387,9 +389,6 @@ func (c *Client) addCommonMiddlewares(stack *middleware.Stack, options Options, if err := addRawResponseToMetadata(stack); err != nil { return err } - if err := addSpanRetryLoop(stack, options); err != nil { - return err - } if err := addClientUserAgent(stack, options); err != nil { return err } @@ -430,30 +429,6 @@ func resolveAuthSchemes(options *Options) { 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 @@ -461,8 +436,9 @@ func resolveDefaultLogger(o *Options) { o.Logger = logging.Nop{} } -func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { - return middleware.AddSetLoggerMiddleware(stack, o.Logger) +func setLoggerContext(ctx context.Context, options Options, operation string) context.Context { + _ = operation + return middleware.SetLogger(ctx, options.Logger) } func setResolvedDefaultsMode(o *Options) { @@ -541,6 +517,12 @@ func resolveHTTPClient(o *Options) { }) } + if _, ok := buildable.GetReadTimeout(); !ok { + if timeout, ok := timeouts.GetServiceReadTimeout(ServiceID); ok { + buildable = buildable.WithReadTimeout(timeout) + } + } + o.HTTPClient = buildable } @@ -682,10 +664,6 @@ func addClientRequestID(stack *middleware.Stack) error { return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) } -func addComputeContentLength(stack *middleware.Stack) error { - return stack.Build.Insert(&smithyhttp.ComputeContentLength{}, "ClientRequestID", middleware.After) -} - func addRawResponseToMetadata(stack *middleware.Stack) error { return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) } @@ -695,30 +673,6 @@ func addRecordResponseTiming(stack *middleware.Stack, options Options) error { DisableClockSkewCorrection: options.DisableClockSkewCorrection, }, 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) } @@ -769,9 +723,6 @@ func addRetry(stack *middleware.Stack, o Options, c *Client) error { 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 } @@ -824,35 +775,21 @@ func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { 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) + asProviderSource, ok := options.Credentials.(aws.CredentialProviderSource) + if !ok { + return nil + } + + for _, source := range asProviderSource.ProviderSources() { + ua.AddCredentialsSource(source) + } + return nil } func resolveTracerProvider(options *Options) { @@ -867,12 +804,16 @@ func resolveMeterProvider(options *Options) { } } -func newServiceMetadataMiddleware(region, operation string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: operation, +func resolveServiceMetadata(ctx context.Context, options Options, operation string) context.Context { + ctx = awsmiddleware.SetServiceID(ctx, ServiceID) + if options.Region != "" { + ctx = awsmiddleware.SetRegion(ctx, options.Region) + } + ctx = awsmiddleware.SetOperationName(ctx, operation) + if options.EndpointResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) } + return ctx } func addRecursionDetection(stack *middleware.Stack) error { 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 cefc88ad8eb..b26651c439d 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 @@ -6,7 +6,6 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/service/sso/types" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns the STS short-term credentials for a given role name that is assigned @@ -70,33 +69,18 @@ func (c *Client) addOperationGetRoleCredentialsMiddlewares(stack *middleware.Sta return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } if err = addOpGetRoleCredentialsValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "GetRoleCredentials"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 c766f1c44e4..38fee5926c5 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 @@ -7,7 +7,6 @@ import ( "fmt" "github.com/aws/aws-sdk-go-v2/service/sso/types" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists all roles that are assigned to the user for a given AWS account. @@ -76,33 +75,18 @@ func (c *Client) addOperationListAccountRolesMiddlewares(stack *middleware.Stack return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } if err = addOpListAccountRolesValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "ListAccountRoles"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 e8af94746c2..342aa88e310 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 @@ -7,7 +7,6 @@ import ( "fmt" "github.com/aws/aws-sdk-go-v2/service/sso/types" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists all AWS accounts assigned to the user. These AWS accounts are assigned by @@ -75,33 +74,18 @@ func (c *Client) addOperationListAccountsMiddlewares(stack *middleware.Stack, op return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } if err = addOpListAccountsValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "ListAccounts"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 2f38f944e14..44d1c57d5ac 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 @@ -5,7 +5,6 @@ package sso import ( "context" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Removes the locally stored SSO tokens from the client-side cache and sends an @@ -69,33 +68,18 @@ func (c *Client) addOperationLogoutMiddlewares(stack *middleware.Stack, options return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } if err = addOpLogoutValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "Logout"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/deserializers.go index bfa1758c8a7..3a91f84923f 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/deserializers.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/deserializers.go @@ -30,6 +30,18 @@ func (m *awsRestjson1_deserializeOpGetRoleCredentials) HandleDeserialize(ctx con out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -38,10 +50,6 @@ func (m *awsRestjson1_deserializeOpGetRoleCredentials) HandleDeserialize(ctx con 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_deserializeOpErrorGetRoleCredentials(response, &metadata) @@ -191,6 +199,18 @@ func (m *awsRestjson1_deserializeOpListAccountRoles) HandleDeserialize(ctx conte out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -199,10 +219,6 @@ func (m *awsRestjson1_deserializeOpListAccountRoles) HandleDeserialize(ctx conte 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_deserializeOpErrorListAccountRoles(response, &metadata) @@ -361,6 +377,18 @@ func (m *awsRestjson1_deserializeOpListAccounts) HandleDeserialize(ctx context.C out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -369,10 +397,6 @@ func (m *awsRestjson1_deserializeOpListAccounts) HandleDeserialize(ctx context.C 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_deserializeOpErrorListAccounts(response, &metadata) @@ -531,6 +555,18 @@ func (m *awsRestjson1_deserializeOpLogout) HandleDeserialize(ctx context.Context out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -539,10 +575,6 @@ func (m *awsRestjson1_deserializeOpLogout) HandleDeserialize(ctx context.Context 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_deserializeOpErrorLogout(response, &metadata) 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 7366a4fae86..196463467c7 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.33.2" +const goModuleVersion = "1.38.4" 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 7879f2345de..7991e360a5c 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,78 @@ +# v1.43.4 (2026-10-09.2) + +* **Dependency Update**: Update to smithy-go v1.28.5. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.43.3 (2026-10-08) + +* **Dependency Update**: Update to smithy-go v1.28.4. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.43.2 (2026-10-06) + +* No change notes available for this release. + +# v1.43.1 (2026-09-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.43.0 (2026-09-09) + +* **Feature**: Stop registering the `retry.MetricsHeader` middleware in generated clients. The `Amz-Sdk-Request` header is now set by the retry middleware itself. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.42.0 (2026-09-04) + +* **Feature**: Stop registering the `spanRetryLoop` middleware in generated clients. The retry loop's tracing span is now opened by the retry middleware itself. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.41.0 (2026-08-31.2) + +* **Feature**: Stop registering the `SetCredentialSourceMiddleware` middleware in generated clients. Credential source user agent features are now set when the client's middleware stack is constructed. + +# v1.40.1 (2026-08-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.40.0 (2026-08-27) + +* **Feature**: Support connection read timeouts in the SDK. This is currently available on an opt-in basis by setting env `AWS_ENABLE_DEFAULT_SOCKET_TIMEOUT_2026=true`. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.39.0 (2026-08-26) + +* **Feature**: Stop registering the `ComputeContentLength` middleware in generated clients. `Content-Length` is now set when the request body is set via `SetStream`. +* **Dependency Update**: Update to smithy-go v1.28.0. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.38.8 (2026-08-25) + +* **Dependency Update**: Update to smithy-go v1.27.10. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.38.7 (2026-08-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.38.6 (2026-08-14) + +* **Dependency Update**: Update to smithy-go v1.27.8. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.38.5 (2026-08-10) + +* **Dependency Update**: Update to smithy-go v1.27.7. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.38.4 (2026-08-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.38.3 (2026-07-31.2) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.27.6 to fix various serde issues in HTTP binding services. + # v1.38.2 (2026-07-29) * **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 0ab277871b5..4992093a27d 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 @@ -15,6 +15,7 @@ import ( 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" + "github.com/aws/aws-sdk-go-v2/internal/timeouts" smithy "github.com/aws/smithy-go" smithydocument "github.com/aws/smithy-go/document" "github.com/aws/smithy-go/logging" @@ -259,6 +260,10 @@ func (c *Client) invokeOperation( finalizeClientEndpointResolverOptions(&options) + ctx = setLoggerContext(ctx, options, opID) + + ctx = resolveServiceMetadata(ctx, options, opID) + if err := c.addCommonMiddlewares(stack, options, opID); err != nil { return nil, metadata, err } @@ -375,9 +380,6 @@ func (c *Client) addCommonMiddlewares(stack *middleware.Stack, options Options, if err := addProtocolFinalizerMiddlewares(stack, options, operation); err != nil { return fmt.Errorf("add protocol finalizers: %v", err) } - if err := addSetLoggerMiddleware(stack, options); err != nil { - return err - } if err := addClientRequestID(stack); err != nil { return err } @@ -387,9 +389,6 @@ func (c *Client) addCommonMiddlewares(stack *middleware.Stack, options Options, if err := addRawResponseToMetadata(stack); err != nil { return err } - if err := addSpanRetryLoop(stack, options); err != nil { - return err - } if err := addClientUserAgent(stack, options); err != nil { return err } @@ -430,30 +429,6 @@ func resolveAuthSchemes(options *Options) { 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 @@ -461,8 +436,9 @@ func resolveDefaultLogger(o *Options) { o.Logger = logging.Nop{} } -func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { - return middleware.AddSetLoggerMiddleware(stack, o.Logger) +func setLoggerContext(ctx context.Context, options Options, operation string) context.Context { + _ = operation + return middleware.SetLogger(ctx, options.Logger) } func setResolvedDefaultsMode(o *Options) { @@ -541,6 +517,12 @@ func resolveHTTPClient(o *Options) { }) } + if _, ok := buildable.GetReadTimeout(); !ok { + if timeout, ok := timeouts.GetServiceReadTimeout(ServiceID); ok { + buildable = buildable.WithReadTimeout(timeout) + } + } + o.HTTPClient = buildable } @@ -682,10 +664,6 @@ func addClientRequestID(stack *middleware.Stack) error { return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) } -func addComputeContentLength(stack *middleware.Stack) error { - return stack.Build.Insert(&smithyhttp.ComputeContentLength{}, "ClientRequestID", middleware.After) -} - func addRawResponseToMetadata(stack *middleware.Stack) error { return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) } @@ -695,30 +673,6 @@ func addRecordResponseTiming(stack *middleware.Stack, options Options) error { DisableClockSkewCorrection: options.DisableClockSkewCorrection, }, 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) } @@ -769,9 +723,6 @@ func addRetry(stack *middleware.Stack, o Options, c *Client) error { 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 } @@ -824,35 +775,21 @@ func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { 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) + asProviderSource, ok := options.Credentials.(aws.CredentialProviderSource) + if !ok { + return nil + } + + for _, source := range asProviderSource.ProviderSources() { + ua.AddCredentialsSource(source) + } + return nil } func resolveTracerProvider(options *Options) { @@ -867,12 +804,16 @@ func resolveMeterProvider(options *Options) { } } -func newServiceMetadataMiddleware(region, operation string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: operation, +func resolveServiceMetadata(ctx context.Context, options Options, operation string) context.Context { + ctx = awsmiddleware.SetServiceID(ctx, ServiceID) + if options.Region != "" { + ctx = awsmiddleware.SetRegion(ctx, options.Region) + } + ctx = awsmiddleware.SetOperationName(ctx, operation) + if options.EndpointResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) } + return ctx } func addRecursionDetection(stack *middleware.Stack) error { 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 bba750bc707..a770ccb54f5 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 @@ -5,7 +5,6 @@ package ssooidc import ( "context" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates and returns access and refresh tokens for clients that are @@ -140,33 +139,18 @@ func (c *Client) addOperationCreateTokenMiddlewares(stack *middleware.Stack, opt return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } if err = addOpCreateTokenValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "CreateToken"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 2c6de5a8394..a7a7d761824 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 @@ -6,7 +6,6 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/service/ssooidc/types" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates and returns access and refresh tokens for authorized client @@ -184,12 +183,6 @@ func (c *Client) addOperationCreateTokenWithIAMMiddlewares(stack *middleware.Sta return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -199,21 +192,12 @@ func (c *Client) addOperationCreateTokenWithIAMMiddlewares(stack *middleware.Sta if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } if err = addOpCreateTokenWithIAMValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "CreateTokenWithIAM"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 2df6cba224a..cdb1c3cfa9f 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 @@ -5,7 +5,6 @@ package ssooidc import ( "context" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Registers a public client with IAM Identity Center. This allows clients to @@ -111,33 +110,18 @@ func (c *Client) addOperationRegisterClientMiddlewares(stack *middleware.Stack, return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } if err = addOpRegisterClientValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "RegisterClient"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 232ff802ebd..3cec46e23aa 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 @@ -5,7 +5,6 @@ package ssooidc import ( "context" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Initiates device authorization by requesting a pair of verification codes from @@ -93,33 +92,18 @@ func (c *Client) addOperationStartDeviceAuthorizationMiddlewares(stack *middlewa return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } if err = addOpStartDeviceAuthorizationValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "StartDeviceAuthorization"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go index fb9a0df5194..448dd0f4448 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go @@ -30,6 +30,18 @@ func (m *awsRestjson1_deserializeOpCreateToken) HandleDeserialize(ctx context.Co out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -38,10 +50,6 @@ func (m *awsRestjson1_deserializeOpCreateToken) HandleDeserialize(ctx context.Co 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_deserializeOpErrorCreateToken(response, &metadata) @@ -256,6 +264,18 @@ func (m *awsRestjson1_deserializeOpCreateTokenWithIAM) HandleDeserialize(ctx con out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -264,10 +284,6 @@ func (m *awsRestjson1_deserializeOpCreateTokenWithIAM) HandleDeserialize(ctx con 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_deserializeOpErrorCreateTokenWithIAM(response, &metadata) @@ -504,6 +520,18 @@ func (m *awsRestjson1_deserializeOpRegisterClient) HandleDeserialize(ctx context out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -512,10 +540,6 @@ func (m *awsRestjson1_deserializeOpRegisterClient) HandleDeserialize(ctx context 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_deserializeOpErrorRegisterClient(response, &metadata) @@ -731,6 +755,18 @@ func (m *awsRestjson1_deserializeOpStartDeviceAuthorization) HandleDeserialize(c out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -739,10 +775,6 @@ func (m *awsRestjson1_deserializeOpStartDeviceAuthorization) HandleDeserialize(c 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_deserializeOpErrorStartDeviceAuthorization(response, &metadata) 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 7b63f480f71..cbbfb51137a 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.38.2" +const goModuleVersion = "1.43.4" 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 4613abde315..25ea8ac9308 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,82 @@ +# v1.51.4 (2026-10-09.2) + +* **Dependency Update**: Update to smithy-go v1.28.5. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.51.3 (2026-10-08) + +* **Dependency Update**: Update to smithy-go v1.28.4. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.51.2 (2026-10-06) + +* No change notes available for this release. + +# v1.51.1 (2026-09-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.51.0 (2026-09-14) + +* **Feature**: Increases the maximum session token size to 4,096 bytes and removes the packed policy size limit. Adds SessionTokenSize and SessionTokenUtilization fields and a new MinimumSessionTokenSize parameter. PackedPolicySize is deprecated. + +# v1.50.0 (2026-09-09) + +* **Feature**: Stop registering the `retry.MetricsHeader` middleware in generated clients. The `Amz-Sdk-Request` header is now set by the retry middleware itself. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.49.0 (2026-09-04) + +* **Feature**: Stop registering the `spanRetryLoop` middleware in generated clients. The retry loop's tracing span is now opened by the retry middleware itself. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.48.0 (2026-08-31.2) + +* **Feature**: Stop registering the `SetCredentialSourceMiddleware` middleware in generated clients. Credential source user agent features are now set when the client's middleware stack is constructed. + +# v1.47.1 (2026-08-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.47.0 (2026-08-27) + +* **Feature**: Support connection read timeouts in the SDK. This is currently available on an opt-in basis by setting env `AWS_ENABLE_DEFAULT_SOCKET_TIMEOUT_2026=true`. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.46.0 (2026-08-26) + +* **Feature**: Stop registering the `ComputeContentLength` middleware in generated clients. `Content-Length` is now set when the request body is set via `SetStream`. +* **Dependency Update**: Update to smithy-go v1.28.0. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.45.8 (2026-08-25) + +* **Dependency Update**: Update to smithy-go v1.27.10. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.45.7 (2026-08-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.45.6 (2026-08-14) + +* **Dependency Update**: Update to smithy-go v1.27.8. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.45.5 (2026-08-10) + +* **Dependency Update**: Update to smithy-go v1.27.7. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.45.4 (2026-08-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.45.3 (2026-07-31.2) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.27.6 to fix various serde issues in HTTP binding services. + # v1.45.2 (2026-07-29) * **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 da6a5b3060c..25412cf71c2 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 @@ -16,6 +16,7 @@ import ( 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" + "github.com/aws/aws-sdk-go-v2/internal/timeouts" "github.com/aws/aws-sdk-go-v2/internal/v4a" acceptencodingcust "github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding" presignedurlcust "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url" @@ -268,6 +269,10 @@ func (c *Client) invokeOperation( finalizeClientEndpointResolverOptions(&options) + ctx = setLoggerContext(ctx, options, opID) + + ctx = resolveServiceMetadata(ctx, options, opID) + if err := c.addCommonMiddlewares(stack, options, opID); err != nil { return nil, metadata, err } @@ -384,9 +389,6 @@ func (c *Client) addCommonMiddlewares(stack *middleware.Stack, options Options, if err := addProtocolFinalizerMiddlewares(stack, options, operation); err != nil { return fmt.Errorf("add protocol finalizers: %v", err) } - if err := addSetLoggerMiddleware(stack, options); err != nil { - return err - } if err := addClientRequestID(stack); err != nil { return err } @@ -396,9 +398,6 @@ func (c *Client) addCommonMiddlewares(stack *middleware.Stack, options Options, if err := addRawResponseToMetadata(stack); err != nil { return err } - if err := addSpanRetryLoop(stack, options); err != nil { - return err - } if err := addClientUserAgent(stack, options); err != nil { return err } @@ -444,30 +443,6 @@ func resolveAuthSchemes(options *Options) { 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 @@ -475,8 +450,9 @@ func resolveDefaultLogger(o *Options) { o.Logger = logging.Nop{} } -func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { - return middleware.AddSetLoggerMiddleware(stack, o.Logger) +func setLoggerContext(ctx context.Context, options Options, operation string) context.Context { + _ = operation + return middleware.SetLogger(ctx, options.Logger) } func setResolvedDefaultsMode(o *Options) { @@ -555,6 +531,12 @@ func resolveHTTPClient(o *Options) { }) } + if _, ok := buildable.GetReadTimeout(); !ok { + if timeout, ok := timeouts.GetServiceReadTimeout(ServiceID); ok { + buildable = buildable.WithReadTimeout(timeout) + } + } + o.HTTPClient = buildable } @@ -696,10 +678,6 @@ func addClientRequestID(stack *middleware.Stack) error { return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) } -func addComputeContentLength(stack *middleware.Stack) error { - return stack.Build.Insert(&smithyhttp.ComputeContentLength{}, "ClientRequestID", middleware.After) -} - func addRawResponseToMetadata(stack *middleware.Stack) error { return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) } @@ -709,30 +687,6 @@ func addRecordResponseTiming(stack *middleware.Stack, options Options) error { DisableClockSkewCorrection: options.DisableClockSkewCorrection, }, 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) } @@ -783,9 +737,6 @@ func addRetry(stack *middleware.Stack, o Options, c *Client) error { 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 } @@ -858,35 +809,21 @@ func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { 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) + asProviderSource, ok := options.Credentials.(aws.CredentialProviderSource) + if !ok { + return nil + } + + for _, source := range asProviderSource.ProviderSources() { + ua.AddCredentialsSource(source) + } + return nil } func finalizeSTSRetryableErrors(o *Options) { @@ -905,12 +842,16 @@ func resolveMeterProvider(options *Options) { } } -func newServiceMetadataMiddleware(region, operation string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: operation, +func resolveServiceMetadata(ctx context.Context, options Options, operation string) context.Context { + ctx = awsmiddleware.SetServiceID(ctx, ServiceID) + if options.Region != "" { + ctx = awsmiddleware.SetRegion(ctx, options.Region) } + ctx = awsmiddleware.SetOperationName(ctx, operation) + if options.EndpointResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) + } + return ctx } func addRecursionDetection(stack *middleware.Stack) error { @@ -1042,9 +983,6 @@ func (c presignConverter) convertToPresignMiddleware(stack *middleware.Stack, op if _, ok := stack.Finalize.Get((*retry.Attempt)(nil).ID()); ok { stack.Finalize.Remove((*retry.Attempt)(nil).ID()) } - if _, ok := stack.Finalize.Get((*retry.MetricsHeader)(nil).ID()); ok { - stack.Finalize.Remove((*retry.MetricsHeader)(nil).ID()) - } stack.Deserialize.Clear() stack.Build.Remove((*awsmiddleware.ClientRequestID)(nil).ID()) stack.Build.Remove("UserAgent") 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 d10f11a620c..958bfaa8939 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 @@ -7,7 +7,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sts/types" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a set of temporary security credentials that you can use to access @@ -199,6 +198,12 @@ type AssumeRoleInput struct { // [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 + // The minimum size, in bytes, of the session token that STS issues for the + // request. STS increases the session token to at least this size, regardless of + // its actual content. The value must not exceed 4,096 bytes. When set to 0 or not + // specified, the session token size is unchanged. + MinimumSessionTokenSize *int32 + // An IAM policy in JSON format that you want to use as an inline session policy. // // This parameter is optional. Passing policies to this operation returns new @@ -386,8 +391,18 @@ type AssumeRoleOutput struct { // session tags combined passed in the request. The request fails if the packed // size is greater than 100 percent, which means the policies and tags exceeded the // allowed space. + // + // Deprecated: Deprecated. Replaced by SessionTokenUtilization. PackedPolicySize *int32 + // The size, in bytes, of the session token returned in the Credentials for this + // response. + SessionTokenSize *int32 + + // The percentage (0-100) of the maximum allowed session token size that the + // returned session token consumes. + SessionTokenUtilization *int32 + // The source identity specified by the principal that is calling the AssumeRole // operation. // @@ -422,12 +437,6 @@ func (c *Client) addOperationAssumeRoleMiddlewares(stack *middleware.Stack, opti return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -437,21 +446,12 @@ func (c *Client) addOperationAssumeRoleMiddlewares(stack *middleware.Stack, opti if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } if err = addOpAssumeRoleValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "AssumeRole"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 bd5bfdc224c..e4050fce806 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 @@ -6,7 +6,6 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/service/sts/types" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a set of temporary security credentials for users who have been @@ -203,6 +202,12 @@ type AssumeRoleWithSAMLInput struct { // [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html DurationSeconds *int32 + // The minimum size, in bytes, of the session token that STS issues for the + // request. STS increases the session token to at least this size, regardless of + // its actual content. The value must not exceed 4,096 bytes. When set to 0 or not + // specified, the session token size is unchanged. + MinimumSessionTokenSize *int32 + // An IAM policy in JSON format that you want to use as an inline session policy. // // This parameter is optional. Passing policies to this operation returns new @@ -306,8 +311,18 @@ type AssumeRoleWithSAMLOutput struct { // session tags combined passed in the request. The request fails if the packed // size is greater than 100 percent, which means the policies and tags exceeded the // allowed space. + // + // Deprecated: Deprecated. Replaced by SessionTokenUtilization. PackedPolicySize *int32 + // The size, in bytes, of the session token returned in the Credentials for this + // response. + SessionTokenSize *int32 + + // The percentage (0-100) of the maximum allowed session token size that the + // returned session token consumes. + SessionTokenUtilization *int32 + // The value in the SourceIdentity attribute in the SAML assertion. The source // identity value persists across [chained role]sessions. // @@ -360,33 +375,18 @@ func (c *Client) addOperationAssumeRoleWithSAMLMiddlewares(stack *middleware.Sta return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } if err = addOpAssumeRoleWithSAMLValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "AssumeRoleWithSAML"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 6f6ea05b5ed..662b45a8293 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 @@ -6,7 +6,6 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/service/sts/types" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a set of temporary security credentials for users who have been @@ -223,6 +222,12 @@ type AssumeRoleWithWebIdentityInput struct { // [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html DurationSeconds *int32 + // The minimum size, in bytes, of the session token that STS issues for the + // request. STS increases the session token to at least this size, regardless of + // its actual content. The value must not exceed 4,096 bytes. When set to 0 or not + // specified, the session token size is unchanged. + MinimumSessionTokenSize *int32 + // An IAM policy in JSON format that you want to use as an inline session policy. // // This parameter is optional. Passing policies to this operation returns new @@ -321,6 +326,8 @@ type AssumeRoleWithWebIdentityOutput struct { // session tags combined passed in the request. The request fails if the packed // size is greater than 100 percent, which means the policies and tags exceeded the // allowed space. + // + // Deprecated: Deprecated. Replaced by SessionTokenUtilization. PackedPolicySize *int32 // The issuing authority of the web identity token presented. For OpenID Connect @@ -329,6 +336,14 @@ type AssumeRoleWithWebIdentityOutput struct { // the AssumeRoleWithWebIdentity request. Provider *string + // The size, in bytes, of the session token returned in the Credentials for this + // response. + SessionTokenSize *int32 + + // The percentage (0-100) of the maximum allowed session token size that the + // returned session token consumes. + SessionTokenUtilization *int32 + // The value of the source identity that is returned in the JSON web token (JWT) // from the identity provider. // @@ -377,33 +392,18 @@ func (c *Client) addOperationAssumeRoleWithWebIdentityMiddlewares(stack *middlew return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } if err = addOpAssumeRoleWithWebIdentityValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "AssumeRoleWithWebIdentity"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 92aee490801..c3437ca439e 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 @@ -6,7 +6,6 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/service/sts/types" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a set of short term credentials you can use to perform privileged tasks @@ -89,6 +88,12 @@ type AssumeRootInput struct { // By default, the value is set to 900 seconds. DurationSeconds *int32 + // The minimum size, in bytes, of the session token that STS issues for the + // request. STS increases the session token to at least this size, regardless of + // its actual content. The value must not exceed 4,096 bytes. When set to 0 or not + // specified, the session token size is unchanged. + MinimumSessionTokenSize *int32 + noSmithyDocumentSerde } @@ -101,6 +106,14 @@ type AssumeRootOutput struct { // strongly recommend that you make no assumptions about the maximum size. Credentials *types.Credentials + // The size, in bytes, of the session token returned in the Credentials for this + // response. + SessionTokenSize *int32 + + // The percentage (0-100) of the maximum allowed session token size that the + // returned session token consumes. + SessionTokenUtilization *int32 + // The source identity specified by the principal that is calling the AssumeRoot // operation. // @@ -131,12 +144,6 @@ func (c *Client) addOperationAssumeRootMiddlewares(stack *middleware.Stack, opti return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -146,21 +153,12 @@ func (c *Client) addOperationAssumeRootMiddlewares(stack *middleware.Stack, opti if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } if err = addOpAssumeRootValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "AssumeRoot"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 e3294e3241d..41b3fe02f17 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 @@ -5,7 +5,6 @@ package sts import ( "context" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Decodes additional information about the authorization status of a request from @@ -91,12 +90,6 @@ func (c *Client) addOperationDecodeAuthorizationMessageMiddlewares(stack *middle return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -106,21 +99,12 @@ func (c *Client) addOperationDecodeAuthorizationMessageMiddlewares(stack *middle if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } if err = addOpDecodeAuthorizationMessageValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "DecodeAuthorizationMessage"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 4d1dbed59dc..da652ff1c74 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 @@ -5,7 +5,6 @@ package sts import ( "context" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns the account identifier for the specified access key ID. @@ -82,12 +81,6 @@ func (c *Client) addOperationGetAccessKeyInfoMiddlewares(stack *middleware.Stack return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -97,21 +90,12 @@ func (c *Client) addOperationGetAccessKeyInfoMiddlewares(stack *middleware.Stack if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } if err = addOpGetAccessKeyInfoValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "GetAccessKeyInfo"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 8901bef2c40..56dbdbf574f 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 @@ -6,7 +6,6 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns details about the IAM user or role whose credentials are used to call @@ -73,12 +72,6 @@ func (c *Client) addOperationGetCallerIdentityMiddlewares(stack *middleware.Stac return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -88,18 +81,9 @@ func (c *Client) addOperationGetCallerIdentityMiddlewares(stack *middleware.Stac if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "GetCallerIdentity"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 index f013cb9330d..d3c8543f547 100644 --- 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 @@ -6,7 +6,6 @@ import ( "context" "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 @@ -53,6 +52,8 @@ type GetDelegatedAccessTokenOutput struct { // 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. + // + // Deprecated: Deprecated. This field is not populated for GetDelegatedAccessToken. PackedPolicySize *int32 // Metadata pertaining to the operation's result. @@ -71,12 +72,6 @@ func (c *Client) addOperationGetDelegatedAccessTokenMiddlewares(stack *middlewar return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -86,21 +81,12 @@ func (c *Client) addOperationGetDelegatedAccessTokenMiddlewares(stack *middlewar if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } if err = addOpGetDelegatedAccessTokenValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "GetDelegatedAccessToken"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 fbee53221e7..ce0aef697ee 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 @@ -6,7 +6,6 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/service/sts/types" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a set of temporary security credentials (consisting of an access key @@ -143,6 +142,12 @@ type GetFederationTokenInput struct { // by using root user credentials defaults to one hour. DurationSeconds *int32 + // The minimum size, in bytes, of the session token that STS issues for the + // request. STS increases the session token to at least this size, regardless of + // its actual content. The value must not exceed 4,096 bytes. When set to 0 or not + // specified, the session token size is unchanged. + MinimumSessionTokenSize *int32 + // An IAM policy in JSON format that you want to use as an inline session policy. // // You must pass an inline or managed [session policy] to this operation. You can pass a single @@ -277,8 +282,18 @@ type GetFederationTokenOutput struct { // session tags combined passed in the request. The request fails if the packed // size is greater than 100 percent, which means the policies and tags exceeded the // allowed space. + // + // Deprecated: Deprecated. Replaced by SessionTokenUtilization. PackedPolicySize *int32 + // The size, in bytes, of the session token returned in the Credentials for this + // response. + SessionTokenSize *int32 + + // The percentage (0-100) of the maximum allowed session token size that the + // returned session token consumes. + SessionTokenUtilization *int32 + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -295,12 +310,6 @@ func (c *Client) addOperationGetFederationTokenMiddlewares(stack *middleware.Sta return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -310,21 +319,12 @@ func (c *Client) addOperationGetFederationTokenMiddlewares(stack *middleware.Sta if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } if err = addOpGetFederationTokenValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "GetFederationToken"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 6b5c8ed171d..159aa08bac6 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 @@ -6,7 +6,6 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/service/sts/types" "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a set of temporary credentials for an Amazon Web Services account or @@ -90,6 +89,12 @@ type GetSessionTokenInput struct { // Services account owners defaults to one hour. DurationSeconds *int32 + // The minimum size, in bytes, of the session token that STS issues for the + // request. STS increases the session token to at least this size, regardless of + // its actual content. The value must not exceed 4,096 bytes. When set to 0 or not + // specified, the session token size is unchanged. + MinimumSessionTokenSize *int32 + // The identification number of the MFA device that is associated with the IAM // user who is making the GetSessionToken call. Specify this value if the IAM user // has a policy that requires MFA authentication. The value is either the serial @@ -128,6 +133,14 @@ type GetSessionTokenOutput struct { // strongly recommend that you make no assumptions about the maximum size. Credentials *types.Credentials + // The size, in bytes, of the session token returned in the Credentials for this + // response. + SessionTokenSize *int32 + + // The percentage (0-100) of the maximum allowed session token size that the + // returned session token consumes. + SessionTokenUtilization *int32 + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -144,12 +157,6 @@ func (c *Client) addOperationGetSessionTokenMiddlewares(stack *middleware.Stack, return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -159,18 +166,9 @@ func (c *Client) addOperationGetSessionTokenMiddlewares(stack *middleware.Stack, if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "GetSessionToken"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } 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 index 1c45a28e736..255f77e5213 100644 --- 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 @@ -6,7 +6,6 @@ import ( "context" "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" ) @@ -15,6 +14,8 @@ import ( // 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. +// +// The GetWebIdentityToken API is not available on the STS Global endpoint. func (c *Client) GetWebIdentityToken(ctx context.Context, params *GetWebIdentityTokenInput, optFns ...func(*Options)) (*GetWebIdentityTokenOutput, error) { if params == nil { params = &GetWebIdentityTokenInput{} @@ -94,12 +95,6 @@ func (c *Client) addOperationGetWebIdentityTokenMiddlewares(stack *middleware.St return err } - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } @@ -109,21 +104,12 @@ func (c *Client) addOperationGetWebIdentityTokenMiddlewares(stack *middleware.St if err = addRecordResponseTiming(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 = addCredentialSource(stack, options); err != nil { return err } if err = addOpGetWebIdentityTokenValidationMiddleware(stack); err != nil { return err } - if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "GetWebIdentityToken"), middleware.Before); err != nil { - return err - } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return 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 8c1ce351616..be49fc7ab32 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 @@ -34,6 +34,18 @@ func (m *awsAwsquery_deserializeOpAssumeRole) HandleDeserialize(ctx context.Cont out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -42,10 +54,6 @@ func (m *awsAwsquery_deserializeOpAssumeRole) HandleDeserialize(ctx context.Cont 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_deserializeOpErrorAssumeRole(response, &metadata) @@ -155,6 +163,18 @@ func (m *awsAwsquery_deserializeOpAssumeRoleWithSAML) HandleDeserialize(ctx cont out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -163,10 +183,6 @@ func (m *awsAwsquery_deserializeOpAssumeRoleWithSAML) HandleDeserialize(ctx cont 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_deserializeOpErrorAssumeRoleWithSAML(response, &metadata) @@ -282,6 +298,18 @@ func (m *awsAwsquery_deserializeOpAssumeRoleWithWebIdentity) HandleDeserialize(c out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -290,10 +318,6 @@ func (m *awsAwsquery_deserializeOpAssumeRoleWithWebIdentity) HandleDeserialize(c 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_deserializeOpErrorAssumeRoleWithWebIdentity(response, &metadata) @@ -412,6 +436,18 @@ func (m *awsAwsquery_deserializeOpAssumeRoot) HandleDeserialize(ctx context.Cont out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -420,10 +456,6 @@ func (m *awsAwsquery_deserializeOpAssumeRoot) HandleDeserialize(ctx context.Cont 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_deserializeOpErrorAssumeRoot(response, &metadata) @@ -527,6 +559,18 @@ func (m *awsAwsquery_deserializeOpDecodeAuthorizationMessage) HandleDeserialize( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -535,10 +579,6 @@ func (m *awsAwsquery_deserializeOpDecodeAuthorizationMessage) HandleDeserialize( 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_deserializeOpErrorDecodeAuthorizationMessage(response, &metadata) @@ -639,6 +679,18 @@ func (m *awsAwsquery_deserializeOpGetAccessKeyInfo) HandleDeserialize(ctx contex out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -647,10 +699,6 @@ func (m *awsAwsquery_deserializeOpGetAccessKeyInfo) HandleDeserialize(ctx contex 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_deserializeOpErrorGetAccessKeyInfo(response, &metadata) @@ -748,6 +796,18 @@ func (m *awsAwsquery_deserializeOpGetCallerIdentity) HandleDeserialize(ctx conte out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -756,10 +816,6 @@ func (m *awsAwsquery_deserializeOpGetCallerIdentity) HandleDeserialize(ctx conte 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_deserializeOpErrorGetCallerIdentity(response, &metadata) @@ -857,6 +913,18 @@ func (m *awsAwsquery_deserializeOpGetDelegatedAccessToken) HandleDeserialize(ctx out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -865,10 +933,6 @@ func (m *awsAwsquery_deserializeOpGetDelegatedAccessToken) HandleDeserialize(ctx 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) @@ -975,6 +1039,18 @@ func (m *awsAwsquery_deserializeOpGetFederationToken) HandleDeserialize(ctx cont out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -983,10 +1059,6 @@ func (m *awsAwsquery_deserializeOpGetFederationToken) HandleDeserialize(ctx cont 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_deserializeOpErrorGetFederationToken(response, &metadata) @@ -1093,6 +1165,18 @@ func (m *awsAwsquery_deserializeOpGetSessionToken) HandleDeserialize(ctx context out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -1101,10 +1185,6 @@ func (m *awsAwsquery_deserializeOpGetSessionToken) HandleDeserialize(ctx context 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_deserializeOpErrorGetSessionToken(response, &metadata) @@ -1205,6 +1285,18 @@ func (m *awsAwsquery_deserializeOpGetWebIdentityToken) HandleDeserialize(ctx con out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { return out, metadata, err } @@ -1213,10 +1305,6 @@ func (m *awsAwsquery_deserializeOpGetWebIdentityToken) HandleDeserialize(ctx con 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) @@ -2695,6 +2783,40 @@ func awsAwsquery_deserializeOpDocumentAssumeRoleOutput(v **AssumeRoleOutput, dec sv.PackedPolicySize = ptr.Int32(int32(i64)) } + case strings.EqualFold("SessionTokenSize", 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.SessionTokenSize = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("SessionTokenUtilization", 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.SessionTokenUtilization = ptr.Int32(int32(i64)) + } + case strings.EqualFold("SourceIdentity", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -2812,6 +2934,40 @@ func awsAwsquery_deserializeOpDocumentAssumeRoleWithSAMLOutput(v **AssumeRoleWit sv.PackedPolicySize = ptr.Int32(int32(i64)) } + case strings.EqualFold("SessionTokenSize", 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.SessionTokenSize = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("SessionTokenUtilization", 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.SessionTokenUtilization = ptr.Int32(int32(i64)) + } + case strings.EqualFold("SourceIdentity", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -2942,6 +3098,40 @@ func awsAwsquery_deserializeOpDocumentAssumeRoleWithWebIdentityOutput(v **Assume sv.Provider = ptr.String(xtv) } + case strings.EqualFold("SessionTokenSize", 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.SessionTokenSize = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("SessionTokenUtilization", 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.SessionTokenUtilization = ptr.Int32(int32(i64)) + } + case strings.EqualFold("SourceIdentity", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -3010,6 +3200,40 @@ func awsAwsquery_deserializeOpDocumentAssumeRootOutput(v **AssumeRootOutput, dec return err } + case strings.EqualFold("SessionTokenSize", 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.SessionTokenSize = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("SessionTokenUtilization", 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.SessionTokenUtilization = ptr.Int32(int32(i64)) + } + case strings.EqualFold("SourceIdentity", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -3333,6 +3557,40 @@ func awsAwsquery_deserializeOpDocumentGetFederationTokenOutput(v **GetFederation sv.PackedPolicySize = ptr.Int32(int32(i64)) } + case strings.EqualFold("SessionTokenSize", 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.SessionTokenSize = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("SessionTokenUtilization", 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.SessionTokenUtilization = ptr.Int32(int32(i64)) + } + default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() @@ -3375,6 +3633,40 @@ func awsAwsquery_deserializeOpDocumentGetSessionTokenOutput(v **GetSessionTokenO return err } + case strings.EqualFold("SessionTokenSize", 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.SessionTokenSize = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("SessionTokenUtilization", 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.SessionTokenUtilization = ptr.Int32(int32(i64)) + } + default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.go index cbb19c7f668..97efe4f9336 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.go @@ -5,9 +5,30 @@ // // # Security Token Service // -// Security Token Service (STS) enables you to request temporary, -// limited-privilege credentials for users. This guide provides descriptions of the -// STS API. For more information about using this service, see [Temporary Security Credentials]. +// Amazon Web Services provides Security Token Service (STS) as a web service that +// enables you to request temporary, limited-privilege credentials for users. This +// guide describes the STS API. For more information, see [Temporary Security Credentials]in the IAM User Guide. +// +// As an alternative to using the API, you can use one of the Amazon Web Services +// SDKs, which consist of libraries and sample code for various programming +// languages and platforms such as Java, Ruby, .NET, iOS, Android, and others. The +// SDKs provide a convenient way to create programmatic access to STS. For example, +// the SDKs can cryptographically sign requests, manage errors, and retry requests +// automatically. For information about the Amazon Web Services SDKs, see [Tools to Build on Amazon Web Services]. +// +// For information about setting up signatures and authorization through the API, +// see [Signing Amazon Web Services API Requests]in the Amazon Web Services General Reference. For general information about +// the Query API, see [Making Query Requests]in the IAM User Guide. For information about using security +// tokens with other Amazon Web Services products, see [Amazon Web Services Services That Work with IAM]in the IAM User Guide. +// +// For information about STS endpoints, see [STS Regions and endpoints] in the IAM User Guide. For +// information about logging STS API calls, see [Logging IAM and STS API calls with CloudTrail]in the IAM User Guide. // // [Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html +// [Making Query Requests]: https://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_UsingQueryAPI.html +// [Tools to Build on Amazon Web Services]: http://aws.amazon.com/tools/ +// [Amazon Web Services Services That Work with IAM]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html +// [STS Regions and endpoints]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_region-endpoints.html +// [Logging IAM and STS API calls with CloudTrail]: https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html +// [Signing Amazon Web Services API Requests]: https://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html package sts 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 6079b28d330..465a0fe04a8 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.45.2" +const goModuleVersion = "1.51.4" 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 5e227387827..e361a3661e0 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 @@ -897,6 +897,11 @@ func awsAwsquery_serializeOpDocumentAssumeRoleInput(v *AssumeRoleInput, value qu objectKey.String(*v.ExternalId) } + if v.MinimumSessionTokenSize != nil { + objectKey := object.Key("MinimumSessionTokenSize") + objectKey.Integer(*v.MinimumSessionTokenSize) + } + if v.Policy != nil { objectKey := object.Key("Policy") objectKey.String(*v.Policy) @@ -967,6 +972,11 @@ func awsAwsquery_serializeOpDocumentAssumeRoleWithSAMLInput(v *AssumeRoleWithSAM objectKey.Integer(*v.DurationSeconds) } + if v.MinimumSessionTokenSize != nil { + objectKey := object.Key("MinimumSessionTokenSize") + objectKey.Integer(*v.MinimumSessionTokenSize) + } + if v.Policy != nil { objectKey := object.Key("Policy") objectKey.String(*v.Policy) @@ -1006,6 +1016,11 @@ func awsAwsquery_serializeOpDocumentAssumeRoleWithWebIdentityInput(v *AssumeRole objectKey.Integer(*v.DurationSeconds) } + if v.MinimumSessionTokenSize != nil { + objectKey := object.Key("MinimumSessionTokenSize") + objectKey.Integer(*v.MinimumSessionTokenSize) + } + if v.Policy != nil { objectKey := object.Key("Policy") objectKey.String(*v.Policy) @@ -1050,6 +1065,11 @@ func awsAwsquery_serializeOpDocumentAssumeRootInput(v *AssumeRootInput, value qu objectKey.Integer(*v.DurationSeconds) } + if v.MinimumSessionTokenSize != nil { + objectKey := object.Key("MinimumSessionTokenSize") + objectKey.Integer(*v.MinimumSessionTokenSize) + } + if v.TargetPrincipal != nil { objectKey := object.Key("TargetPrincipal") objectKey.String(*v.TargetPrincipal) @@ -1117,6 +1137,11 @@ func awsAwsquery_serializeOpDocumentGetFederationTokenInput(v *GetFederationToke objectKey.Integer(*v.DurationSeconds) } + if v.MinimumSessionTokenSize != nil { + objectKey := object.Key("MinimumSessionTokenSize") + objectKey.Integer(*v.MinimumSessionTokenSize) + } + if v.Name != nil { objectKey := object.Key("Name") objectKey.String(*v.Name) @@ -1153,6 +1178,11 @@ func awsAwsquery_serializeOpDocumentGetSessionTokenInput(v *GetSessionTokenInput objectKey.Integer(*v.DurationSeconds) } + if v.MinimumSessionTokenSize != nil { + objectKey := object.Key("MinimumSessionTokenSize") + objectKey.Integer(*v.MinimumSessionTokenSize) + } + if v.SerialNumber != nil { objectKey := object.Key("SerialNumber") objectKey.String(*v.SerialNumber) diff --git a/vendor/github.com/aws/smithy-go/CHANGELOG.md b/vendor/github.com/aws/smithy-go/CHANGELOG.md index 0140cf10eab..a4c14bfe0a1 100644 --- a/vendor/github.com/aws/smithy-go/CHANGELOG.md +++ b/vendor/github.com/aws/smithy-go/CHANGELOG.md @@ -1,3 +1,112 @@ +# Release (2026-10-09) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/smithy-go`: v1.28.5 + * **Bug Fix**: Retain the key with the zero value when encountering a null-value key in a dense map. This matches how legacy code-generated JSON deserializers behaved. + +# Release (2026-10-07) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/smithy-go`: v1.28.4 + * **Bug Fix**: Revert #698 that fixed JoinPath with trailing slash. This has a side effect on certain S3 API paths in the downstream SDK that need more consideration. + +# Release (2026-10-06) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/smithy-go`: v1.28.3 + * **Bug Fix**: Accept either casing of `message`/`Message` on modeled JSON error structures in schema-based deserialization, and emit the `smithy.api#error` trait in generated schemas + * **Bug Fix**: Include the underlying error when logging failures to discard or close an HTTP response body + +# Release (2026-09-18) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/smithy-go`: v1.28.2 + * **Bug Fix**: Avoid allocating a slice in ValidateEndpointHost by indexing into the hostname instead of using strings.Split. + * **Bug Fix**: Fix event stream decode panic on unknown header value type. + * **Bug Fix**: Fix schema-serde CBOR decode panic on malformed string/blob length. + * **Bug Fix**: JoinPath keeps a trailing slash when the added path is a slash. + +# Release (2026-08-26) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/smithy-go`: v1.28.1 + * **Bug Fix**: Fix broken AddLogger middleware since its insert point was removed. + +# Release (2026-08-25.2) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/smithy-go`: v1.28.0 + * **Feature**: Set `Content-Length` inline when the request body is set via `SetStream`. The `ComputeContentLength` middleware is now deprecated. + +# Release (2026-08-25) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/smithy-go`: v1.27.10 + * **Bug Fix**: Fix a data race on the underlying writer when an event stream is closed while an event write is in flight. + * **Bug Fix**: Restore draining the HTTP response body in `CloseResponseBody` to avoid issues with TCP connection reuse. + +# Release (2026-08-21) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/smithy-go`: v1.27.9 + * **Bug Fix**: Fix a generic event stream exception not carrying the error code and message from its payload. + * **Bug Fix**: Fix an event stream not being closed when its connection is lost, which would cause a caller writing to the stream to block indefinitely. + * **Bug Fix**: Fix deserialization of an empty list producing a nil slice instead of an empty one. + * **Bug Fix**: Restore draining the HTTP response body in `CloseResponseBody` to avoid issues with TCP connection reuse. + +# Release (2026-08-14) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/smithy-go`: v1.27.8 + * **Bug Fix**: Restore draining the HTTP response body in `CloseResponseBody` to avoid issues with TCP connection reuse. + +# Release (2026-08-07) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/smithy-go`: v1.27.7 + * **Bug Fix**: Don't serialize unset JSON documents as `nil` in structure members. + * **Bug Fix**: Fix a deserialization panic around collection members in recursive shape configs. + +# Release (2026-07-31) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/smithy-go`: v1.27.6 + * **Bug Fix**: Fix failure to deserialize any `@httpPayload` struct with a non-string member. + * **Bug Fix**: Fix failure to serialize any `@httpPayload` struct with a nested struct. + # Release (2026-07-27) ## General Highlights diff --git a/vendor/github.com/aws/smithy-go/Makefile b/vendor/github.com/aws/smithy-go/Makefile index a12b124d505..fb0670f0ef6 100644 --- a/vendor/github.com/aws/smithy-go/Makefile +++ b/vendor/github.com/aws/smithy-go/Makefile @@ -26,7 +26,7 @@ smithy-publish-local: cd codegen && ./gradlew publishToMavenLocal smithy-build: - cd codegen && ./gradlew build + cd codegen && ./gradlew build --stacktrace smithy-clean: cd codegen && ./gradlew clean diff --git a/vendor/github.com/aws/smithy-go/README.md b/vendor/github.com/aws/smithy-go/README.md index ac5a0a6139f..28f3d1d5bd9 100644 --- a/vendor/github.com/aws/smithy-go/README.md +++ b/vendor/github.com/aws/smithy-go/README.md @@ -1,73 +1,52 @@ # Smithy Go -[![Go Build Status](https://github.com/aws/smithy-go/actions/workflows/go.yml/badge.svg?branch=main)](https://github.com/aws/smithy-go/actions/workflows/go.yml)[![Codegen Build Status](https://github.com/aws/smithy-go/actions/workflows/codegen.yml/badge.svg?branch=main)](https://github.com/aws/smithy-go/actions/workflows/codegen.yml) +[![Go Build Status](https://github.com/aws/smithy-go/actions/workflows/go.yml/badge.svg?branch=main)](https://github.com/aws/smithy-go/actions/workflows/go.yml) +[![Codegen Build Status](https://github.com/aws/smithy-go/actions/workflows/codegen.yml/badge.svg?branch=main)](https://github.com/aws/smithy-go/actions/workflows/codegen.yml) +[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE) -[Smithy](https://smithy.io/) code generators for Go and the accompanying smithy-go runtime. +[Smithy](https://smithy.io/) code generators for [Go](https://go.dev/), and +the runtime package the generated code depends on. -The smithy-go runtime requires a minimum version of Go 1.24. +> [!WARNING] +> All interfaces in this repository are subject to change. The client code +> generator in particular powers +> [aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2), but arbitrary client +> generation is in an early stage of development: +> * Generated clients are missing certain features that were originally +> implemented SDK-side (e.g. retries) +> * There may be bugs +> * The public APIs of generated clients may be unstable +> +> If you are interested in using the client code generators, we encourage you +> to experiment and share any feedback with us in an issue. -**WARNING: All interfaces are subject to change.** +--- -## :warning: Client codegen is unstable +This repository contains two major components: -The client code generator in this repository powers the aws-sdk-go-v2. -Arbitrary client generation, while possible, is in an early stage of -development: +1. **Codegen** ([`codegen/`](codegen)): A Java/Gradle-based Smithy build + plugin that generates Go client, server, and shape code from Smithy + models. +2. **Runtime** (this module, `github.com/aws/smithy-go`): The Go packages + that code generated by the plugins above depends on. -* Generated clients are missing certain features that were originally - implemented SDK-side (e.g. retries) -* There may be bugs -* The public APIs of generated clients may be unstable +> [!NOTE] +> This repository does not contain any generated clients, such as for S3 or +> other AWS services. Rather, these are the tools that facilitate generating +> those clients (and non-AWS Smithy clients) from a Smithy model. -If you are interested in using the client code generators, we encourage you to -experiment and share any feedback with us in an issue. +## Getting started -## Plugins +If this is your first time using Smithy, follow the +[Smithy Quickstart guide](https://smithy.io/2.0/quickstart.html) to learn the +basics and create a simple Smithy model. -This repository implements the following Smithy build plugins: - -| ID | GAV prefix | Description | -|----|------------|-------------| -| `go-codegen` | `software.amazon.smithy.go:smithy-go-codegen` | Implements Go client code generation for Smithy models. | -| `go-server-codegen` | `software.amazon.smithy.go:smithy-go-codegen` | Implements Go server code generation for Smithy models. | -| `go-shape-codegen` | `software.amazon.smithy.go:smithy-go-codegen` | Implements Go shape code generation (types only) for Smithy models. | - -## `go-codegen` - -### Configuration - -[`GoSettings`](codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/GoSettings.java) -contains all of the settings enabled from `smithy-build.json` and helper -methods and types. The up-to-date list of top-level properties enabled for -`go-client-codegen` can be found in `GoSettings::from()`. - -| Setting | Type | Required | Description | -|-----------------|---------|----------|-----------------------------------------------------------------------------------------------------------------------------| -| `service` | string | yes | The Shape ID of the service for which to generate the client. | -| `module` | string | yes | Name of the module in `generated.json` (and `go.mod` if `generateGoMod` is enabled) and `doc.go`. | -| `generateGoMod` | boolean | | Whether to generate a default `go.mod` file. The default value is `false`. | -| `goDirective` | string | | [Go directive](https://go.dev/ref/mod#go-mod-file-go) of the module. The default value is the minimum supported Go version. | +The smithy-go runtime requires a minimum version of **Go 1.24**. -### Supported protocols +### Codegen -The protocol a client uses is configured by the `Protocol` field on a client's -`Options`. The SDK will configure a default based on the protocol traits -applied to the modeled service. - -| Protocol | Notes | -|----------|-------| -| [`smithy.protocols#rpcv2Cbor`](https://smithy.io/2.0/additional-specs/protocols/smithy-rpc-v2.html) | | -| [`aws.protocols#restJson1`](https://smithy.io/2.0/aws/protocols/aws-restjson1-protocol.html) | | -| [`aws.protocols#restXml`](https://smithy.io/2.0/aws/protocols/aws-restxml-protocol.html) | | -| [`aws.protocols#awsJson1_0`](https://smithy.io/2.0/aws/protocols/aws-json-1_0-protocol.html) | | -| [`aws.protocols#awsJson1_1`](https://smithy.io/2.0/aws/protocols/aws-json-1_1-protocol.html) | | -| [`aws.protocols#awsQuery`](https://smithy.io/2.0/aws/protocols/aws-query-protocol.html) | | -| [`aws.protocols#ec2Query`](https://smithy.io/2.0/aws/protocols/aws-ec2-query-protocol.html) | | - -### Example - -This example applies the `go-codegen` build plugin to the Smithy quickstart -example created from `smithy init`: +To generate a Go client from a Smithy model, apply the `go-codegen` plugin in +your `smithy-build.json`: ```json { @@ -91,15 +70,136 @@ example created from `smithy init`: } ``` -## `go-server-codegen` +This repository implements the following Smithy build plugins: + +| ID | GAV prefix | Description | +|----|------------|-------------| +| `go-codegen` | `software.amazon.smithy.go:smithy-go-codegen` | Go client code generation for Smithy models. | +| `go-server-codegen` | `software.amazon.smithy.go:smithy-go-codegen` | Go server code generation for Smithy models (work-in-progress, undocumented). | +| `go-shape-codegen` | `software.amazon.smithy.go:smithy-go-codegen` | Go shape code generation (types only) for Smithy models (work-in-progress, undocumented). | -This plugin is a work-in-progress and is currently undocumented. +#### `go-codegen` settings -## `go-shape-codegen` +[`GoSettings`](codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/GoSettings.java) +contains all of the settings enabled from `smithy-build.json`. The up-to-date +list of top-level properties enabled for `go-codegen` can be found in +`GoSettings::from()`. -This plugin is a work-in-progress and is currently undocumented. +| Setting | Type | Required | Description | +|-----------------|---------|----------|-------------------------------------------------------------------------------------------------------------------------------| +| `service` | string | yes | The Shape ID of the service for which to generate the client. | +| `module` | string | yes | Name of the module in `generated.json` (and `go.mod` if `generateGoMod` is enabled) and `doc.go`. | +| `generateGoMod` | boolean | | Whether to generate a default `go.mod` file. The default value is `false`. | +| `goDirective` | string | | [Go directive](https://go.dev/ref/mod#go-mod-file-go) of the module. The default value is the minimum supported Go version. | + +#### Supported protocols + +The protocol a generated client uses is configured by the `Protocol` field on +the client's `Options`. The SDK configures a default based on the protocol +traits applied to the modeled service. + +Each protocol is implemented as its own package under +[`transport/http/protocol`](transport/http/protocol). Serialization for these +protocols is handled by internal codecs under `protocol/internal` (e.g. +`protocol/internal/json`, `protocol/internal/cbor`, +`protocol/internal/xml`); these largely supersede the top-level +[`encoding/`](encoding) packages of the same name; see +[Encoding](#encoding) below. + +| Protocol | Package | Notes | +|----------|---------|-------| +| [`smithy.protocols#rpcv2Cbor`](https://smithy.io/2.0/additional-specs/protocols/smithy-rpc-v2.html) | [`protocol/rpcv2`](transport/http/protocol/rpcv2) | | +| [`aws.protocols#restJson1`](https://smithy.io/2.0/aws/protocols/aws-restjson1-protocol.html) | [`protocol/restjson1`](transport/http/protocol/restjson1) | | +| [`aws.protocols#restXml`](https://smithy.io/2.0/aws/protocols/aws-restxml-protocol.html) | [`protocol/restxml`](transport/http/protocol/restxml) | | +| [`aws.protocols#awsJson1_0`](https://smithy.io/2.0/aws/protocols/aws-json-1_0-protocol.html) | [`protocol/awsjson`](transport/http/protocol/awsjson) | `awsjson.New10` | +| [`aws.protocols#awsJson1_1`](https://smithy.io/2.0/aws/protocols/aws-json-1_1-protocol.html) | [`protocol/awsjson`](transport/http/protocol/awsjson) | `awsjson.New11` | +| [`aws.protocols#awsQuery`](https://smithy.io/2.0/aws/protocols/aws-query-protocol.html) | [`protocol/awsquery`](transport/http/protocol/awsquery) | | +| [`aws.protocols#ec2Query`](https://smithy.io/2.0/aws/protocols/aws-ec2-query-protocol.html) | [`protocol/ec2query`](transport/http/protocol/ec2query) | | + +These packages are client-only; smithy-go does not currently implement +server-side protocol support. + +Building and testing the codegen plugins is done via Gradle from the +`codegen/` directory: + +```bash +# Build and test codegen +cd codegen && ./gradlew build + +# Publish to local Maven for downstream use +cd codegen && ./gradlew publishToMavenLocal +``` + +See [`codegen/README.md`](codegen/README.md) for local setup instructions. + +## Runtime packages + +All generated clients depend on this module (`github.com/aws/smithy-go`) at +runtime. It also includes a few standalone submodules published separately. + +### Core + +- [`middleware`](middleware): The middleware stack that drives the operation + pipeline. +- [`transport/http`](transport/http): HTTP request/response types and + middleware. +- [`auth`](auth): Auth identity and scheme interfaces. + - [`auth/bearer`](auth/bearer): Bearer token auth. +- [`endpoints`](endpoints): Endpoint resolution types. +- [`context`](context): Context helpers. +- [`logging`](logging): Logging interfaces. +- [`tracing`](tracing): Tracing interfaces. +- [`metrics`](metrics): Metrics interfaces. + +### Encoding + +Wire format encoders/decoders under [`encoding/`](encoding). + +> [!NOTE] +> Most of these packages are effectively legacy. The protocol +> implementations under [`transport/http/protocol`](transport/http/protocol) +> (used by current client codegen) have their own internal codecs under +> `protocol/internal/*` and generally do not build on these packages. +> The `encoding/json`, `encoding/xml`, and `encoding/cbor` packages otherwise +> remain in use by [`document/json`](document/json)/[`document/cbor`](document/cbor) +> and [`eventstream`](eventstream), and by existing generated SDK code that +> predates the newer protocol implementations. + +- [`encoding/json`](encoding/json): JSON encoding/decoding. +- [`encoding/xml`](encoding/xml): XML encoding/decoding. +- [`encoding/cbor`](encoding/cbor): CBOR encoding/decoding (used by + `rpcv2Cbor`). +- [`encoding/httpbinding`](encoding/httpbinding): HTTP binding serde helpers. + +### Document + +- [`document`](document): Smithy document type abstraction. + - [`document/json`](document/json): JSON document codec. + +### Utilities + +- [`container`](container): Generic container types. +- [`io`](io): I/O helpers. +- [`ptr`](ptr): Pointer-to/from-value helpers. +- [`time`](time): Smithy timestamp format helpers. +- [`rand`](rand): UUID/randomness helpers. +- [`testing`](testing): Test assertion helpers for generated protocol tests. + +### Standalone modules + +These are published as separate Go modules, each with its own `go.mod`. + +- [`aws-http-auth`](aws-http-auth): AWS SigV4/SigV4A HTTP signing. +- [`tracing/smithyoteltracing`](tracing/smithyoteltracing): OpenTelemetry + tracing adapter. +- [`metrics/smithyotelmetrics`](metrics/smithyotelmetrics): OpenTelemetry + metrics adapter. + +## Development + +See [CONTRIBUTING](CONTRIBUTING.md) for more information on contributing to +this project, including the changelog process for runtime changes. ## License This project is licensed under the Apache-2.0 License. - diff --git a/vendor/github.com/aws/smithy-go/document/internal/serde/field.go b/vendor/github.com/aws/smithy-go/document/internal/serde/field.go new file mode 100644 index 00000000000..64a9fdb332f --- /dev/null +++ b/vendor/github.com/aws/smithy-go/document/internal/serde/field.go @@ -0,0 +1,293 @@ +package serde + +import ( + "reflect" + "sort" +) + +const tagKey = "document" + +// Field is represents a struct field, tag, type, and index. +type Field struct { + Tag + + Name string + NameFromTag bool + + Index []int + Type reflect.Type +} + +func buildField(pIdx []int, i int, sf reflect.StructField, fieldTag Tag) Field { + f := Field{ + Name: sf.Name, + Type: sf.Type, + Tag: fieldTag, + } + + if len(fieldTag.Name) != 0 { + f.NameFromTag = true + f.Name = fieldTag.Name + } + + f.Index = make([]int, len(pIdx)+1) + copy(f.Index, pIdx) + f.Index[len(pIdx)] = i + + return f +} + +// GetStructFields returns a list of fields for the given type. Type info is cached +// to avoid repeated calls into the reflect package +func GetStructFields(t reflect.Type) *CachedFields { + if cached, ok := fieldCache.Load(t); ok { + return cached + } + + f := enumFields(t) + sort.Sort(fieldsByName(f)) + f = visibleFields(f) + + fs := &CachedFields{ + fields: f, + fieldsByName: make(map[string]int, len(f)), + } + for i, f := range fs.fields { + fs.fieldsByName[f.Name] = i + } + + cached, _ := fieldCache.LoadOrStore(t, fs) + return cached +} + +// enumFields will recursively iterate through a structure and its nested +// anonymous fields. +// +// Based on the enoding/json struct field enumeration of the Go Stdlib +// https://golang.org/src/encoding/json/encode.go typeField func. +func enumFields(t reflect.Type) []Field { + // Fields to explore + current := []Field{} + next := []Field{{Type: t}} + + // count of queued names + count := map[reflect.Type]int{} + nextCount := map[reflect.Type]int{} + + visited := map[reflect.Type]struct{}{} + fields := []Field{} + + for len(next) > 0 { + current, next = next, current[:0] + count, nextCount = nextCount, map[reflect.Type]int{} + + for _, f := range current { + if _, ok := visited[f.Type]; ok { + continue + } + visited[f.Type] = struct{}{} + + for i := 0; i < f.Type.NumField(); i++ { + sf := f.Type.Field(i) + if sf.PkgPath != "" && !sf.Anonymous { + // Ignore unexported and non-anonymous fields + // unexported but anonymous field may still be used if + // the type has exported nested fields + continue + } + + fieldTag := ParseTag(sf.Tag.Get(tagKey)) + + if fieldTag.Ignore { + continue + } + + ft := sf.Type + if ft.Name() == "" && ft.Kind() == reflect.Ptr { + ft = ft.Elem() + } + + structField := buildField(f.Index, i, sf, fieldTag) + structField.Type = ft + + if !sf.Anonymous || ft.Kind() != reflect.Struct { + fields = append(fields, structField) + if count[f.Type] > 1 { + // If there were multiple instances, add a second, + // so that the annihilation code will see a duplicate. + // It only cares about the distinction between 1 or 2, + // so don't bother generating any more copies. + fields = append(fields, structField) + } + continue + } + + // Record new anon struct to explore next round + nextCount[ft]++ + if nextCount[ft] == 1 { + next = append(next, structField) + } + } + } + } + + return fields +} + +// visibleFields will return a slice of fields which are visible based on +// Go's standard visiblity rules with the exception of ties being broken +// by depth and struct tag naming. +// +// Based on the enoding/json field filtering of the Go Stdlib +// https://golang.org/src/encoding/json/encode.go typeField func. +func visibleFields(fields []Field) []Field { + // Delete all fields that are hidden by the Go rules for embedded fields, + // except that fields with JSON tags are promoted. + + // The fields are sorted in primary order of name, secondary order + // of field index length. Loop over names; for each name, delete + // hidden fields by choosing the one dominant field that survives. + out := fields[:0] + for advance, i := 0, 0; i < len(fields); i += advance { + // One iteration per name. + // Find the sequence of fields with the name of this first field. + fi := fields[i] + name := fi.Name + for advance = 1; i+advance < len(fields); advance++ { + fj := fields[i+advance] + if fj.Name != name { + break + } + } + if advance == 1 { // Only one field with this name + out = append(out, fi) + continue + } + dominant, ok := dominantField(fields[i : i+advance]) + if ok { + out = append(out, dominant) + } + } + + fields = out + sort.Sort(fieldsByIndex(fields)) + + return fields +} + +// dominantField looks through the fields, all of which are known to +// have the same name, to find the single field that dominates the +// others using Go's embedding rules, modified by the presence of +// JSON tags. If there are multiple top-level fields, the boolean +// will be false: This condition is an error in Go and we skip all +// the fields. +// +// Based on the enoding/json field filtering of the Go Stdlib +// https://golang.org/src/encoding/json/encode.go dominantField func. +func dominantField(fields []Field) (Field, bool) { + // The fields are sorted in increasing index-length order. The winner + // must therefore be one with the shortest index length. Drop all + // longer entries, which is easy: just truncate the slice. + length := len(fields[0].Index) + tagged := -1 // Index of first tagged field. + for i, f := range fields { + if len(f.Index) > length { + fields = fields[:i] + break + } + if f.NameFromTag { + if tagged >= 0 { + // Multiple tagged fields at the same level: conflict. + // Return no field. + return Field{}, false + } + tagged = i + } + } + if tagged >= 0 { + return fields[tagged], true + } + // All remaining fields have the same length. If there's more than one, + // we have a conflict (two fields named "X" at the same level) and we + // return no field. + if len(fields) > 1 { + return Field{}, false + } + return fields[0], true +} + +// fieldsByName sorts field by name, breaking ties with depth, +// then breaking ties with "name came from json tag", then +// breaking ties with index sequence. +// +// Based on the enoding/json field filtering of the Go Stdlib +// https://golang.org/src/encoding/json/encode.go fieldsByName type. +type fieldsByName []Field + +func (x fieldsByName) Len() int { return len(x) } + +func (x fieldsByName) Swap(i, j int) { x[i], x[j] = x[j], x[i] } + +func (x fieldsByName) Less(i, j int) bool { + if x[i].Name != x[j].Name { + return x[i].Name < x[j].Name + } + if len(x[i].Index) != len(x[j].Index) { + return len(x[i].Index) < len(x[j].Index) + } + if x[i].NameFromTag != x[j].NameFromTag { + return x[i].NameFromTag + } + return fieldsByIndex(x).Less(i, j) +} + +// fieldsByIndex sorts field by index sequence. +// +// Based on the enoding/json field filtering of the Go Stdlib +// https://golang.org/src/encoding/json/encode.go fieldsByIndex type. +type fieldsByIndex []Field + +func (x fieldsByIndex) Len() int { return len(x) } + +func (x fieldsByIndex) Swap(i, j int) { x[i], x[j] = x[j], x[i] } + +func (x fieldsByIndex) Less(i, j int) bool { + for k, xik := range x[i].Index { + if k >= len(x[j].Index) { + return false + } + if xik != x[j].Index[k] { + return xik < x[j].Index[k] + } + } + return len(x[i].Index) < len(x[j].Index) +} + +// DecoderFieldByIndex finds the field with the provided nested index, allocating +// embedded parent structs if needed +func DecoderFieldByIndex(v reflect.Value, index []int) reflect.Value { + for i, x := range index { + if i > 0 && v.Kind() == reflect.Ptr && v.Type().Elem().Kind() == reflect.Struct { + if v.IsNil() { + v.Set(reflect.New(v.Type().Elem())) + } + v = v.Elem() + } + v = v.Field(x) + } + return v +} + +// EncoderFieldByIndex finds the field with the provided nested index +func EncoderFieldByIndex(v reflect.Value, index []int) (reflect.Value, bool) { + for i, x := range index { + if i > 0 && v.Kind() == reflect.Ptr && v.Type().Elem().Kind() == reflect.Struct { + if v.IsNil() { + return reflect.Value{}, false + } + v = v.Elem() + } + v = v.Field(x) + } + return v, true +} diff --git a/vendor/github.com/aws/smithy-go/document/internal/serde/field_cache.go b/vendor/github.com/aws/smithy-go/document/internal/serde/field_cache.go new file mode 100644 index 00000000000..b00569e4fcc --- /dev/null +++ b/vendor/github.com/aws/smithy-go/document/internal/serde/field_cache.go @@ -0,0 +1,48 @@ +package serde + +import ( + "strings" + "sync" +) + +var fieldCache fieldCacher + +type fieldCacher struct { + cache sync.Map +} + +func (c *fieldCacher) Load(t interface{}) (*CachedFields, bool) { + if v, ok := c.cache.Load(t); ok { + return v.(*CachedFields), true + } + return nil, false +} + +func (c *fieldCacher) LoadOrStore(t interface{}, fs *CachedFields) (*CachedFields, bool) { + v, ok := c.cache.LoadOrStore(t, fs) + return v.(*CachedFields), ok +} + +// CachedFields is a cache entry for a type's fields. +type CachedFields struct { + fields []Field + fieldsByName map[string]int +} + +// All returns all the fields for the cached type. +func (f *CachedFields) All() []Field { + return f.fields +} + +// FieldByName retrieves a field by name. +func (f *CachedFields) FieldByName(name string) (Field, bool) { + if i, ok := f.fieldsByName[name]; ok { + return f.fields[i], ok + } + for _, f := range f.fields { + if strings.EqualFold(f.Name, name) { + return f, true + } + } + return Field{}, false +} diff --git a/vendor/github.com/aws/smithy-go/document/internal/serde/reflect.go b/vendor/github.com/aws/smithy-go/document/internal/serde/reflect.go new file mode 100644 index 00000000000..165145cda13 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/document/internal/serde/reflect.go @@ -0,0 +1,24 @@ +package serde + +import ( + "github.com/aws/smithy-go/document" + "math/big" + "reflect" + "time" +) + +// ReflectTypeOf is a structure containing various reflect.Type members that are useful +// to document Marshaler or Unmarshaler implementations. +var ReflectTypeOf = struct { + BigFloat reflect.Type + BigInt reflect.Type + DocumentNumber reflect.Type + MapStringToInterface reflect.Type + Time reflect.Type +}{ + BigFloat: reflect.TypeOf((*big.Float)(nil)).Elem(), + BigInt: reflect.TypeOf((*big.Int)(nil)).Elem(), + DocumentNumber: reflect.TypeOf((*document.Number)(nil)).Elem(), + MapStringToInterface: reflect.TypeOf((map[string]interface{})(nil)), + Time: reflect.TypeOf((*time.Time)(nil)).Elem(), +} diff --git a/vendor/github.com/aws/smithy-go/document/internal/serde/serde.go b/vendor/github.com/aws/smithy-go/document/internal/serde/serde.go new file mode 100644 index 00000000000..c2bdbd38bf1 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/document/internal/serde/serde.go @@ -0,0 +1,100 @@ +package serde + +import ( + "reflect" +) + +// Indirect will walk a value's interface or pointer value types. Returning +// the final value or the value a unmarshaler is defined on. +// +// Based on the enoding/json type reflect value type indirection in Go Stdlib +// https://golang.org/src/encoding/json/decode.go Indirect func. +func Indirect(v reflect.Value, decodingNull bool) reflect.Value { + v0 := v + haveAddr := false + + if v.Kind() != reflect.Ptr && v.Type().Name() != "" && v.CanAddr() { + v = v.Addr() + haveAddr = true + } + for { + if v.Kind() == reflect.Interface && !v.IsNil() { + e := v.Elem() + if e.Kind() == reflect.Ptr && !e.IsNil() && (!decodingNull || e.Elem().Kind() == reflect.Ptr) { + haveAddr = false + v = e + continue + } + } + if v.Kind() != reflect.Ptr { + break + } + if v.Elem().Kind() != reflect.Ptr && decodingNull && v.CanSet() { + break + } + if v.IsNil() { + v.Set(reflect.New(v.Type().Elem())) + } + + if haveAddr { + v = v0 + haveAddr = false + } else { + v = v.Elem() + } + } + + return v +} + +// PtrToValue given the input value will dereference pointers and returning the element pointed to. +func PtrToValue(in interface{}) interface{} { + v := reflect.ValueOf(in) + if v.Kind() == reflect.Ptr { + v = v.Elem() + } + if !v.IsValid() { + return nil + } + if v.Kind() == reflect.Ptr { + return PtrToValue(v.Interface()) + } + return v.Interface() +} + +// IsZeroValue returns whether v is the zero-value for its type. +func IsZeroValue(v reflect.Value) bool { + switch v.Kind() { + case reflect.Invalid: + return true + case reflect.Array: + return v.Len() == 0 + case reflect.Map, reflect.Slice: + return v.IsNil() + case reflect.String: + return v.Len() == 0 + 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 false +} + +// ValueElem walks interface and pointer types and returns the underlying element. +func ValueElem(v reflect.Value) reflect.Value { + switch v.Kind() { + case reflect.Interface, reflect.Ptr: + for v.Kind() == reflect.Interface || v.Kind() == reflect.Ptr { + v = v.Elem() + } + } + + return v +} diff --git a/vendor/github.com/aws/smithy-go/document/internal/serde/tags.go b/vendor/github.com/aws/smithy-go/document/internal/serde/tags.go new file mode 100644 index 00000000000..2097f12b408 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/document/internal/serde/tags.go @@ -0,0 +1,38 @@ +package serde + +import ( + "strings" +) + +// Tag represents the `document` struct field tag and associated options +type Tag struct { + Name string + Ignore bool + OmitEmpty bool +} + +// ParseTag splits a struct field tag into its name and +// comma-separated options. +func ParseTag(tagStr string) (tag Tag) { + parts := strings.Split(tagStr, ",") + if len(parts) == 0 { + return tag + } + + if name := parts[0]; name == "-" { + tag.Name = "" + tag.Ignore = true + } else { + tag.Name = name + tag.Ignore = false + } + + for _, opt := range parts[1:] { + switch opt { + case "omitempty": + tag.OmitEmpty = true + } + } + + return tag +} diff --git a/vendor/github.com/aws/smithy-go/document/json/decoder.go b/vendor/github.com/aws/smithy-go/document/json/decoder.go new file mode 100644 index 00000000000..366406c7a06 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/document/json/decoder.go @@ -0,0 +1,349 @@ +package json + +import ( + "encoding/json" + "fmt" + "math/big" + "reflect" + + "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/document/internal/serde" +) + +// DecoderOptions is the set of options that can be configured for a Decoder. +type DecoderOptions struct{} + +// Decoder is a Smithy document decoder for JSON based protocols. +type Decoder struct { + options DecoderOptions +} + +// DecodeJSONInterface decodes the supported JSON input types and stores the result in the value pointed by toValue. +// +// If toValue is not a compatible type, or an error occurs while decoding DecodeJSONInterface will return an error. +// +// The supported input JSON types are: +// bool -> JSON boolean +// float64 -> JSON number +// json.Number -> JSON number +// string -> JSON string +// []interface{} -> JSON array +// map[string]interface{} -> JSON object +// nil -> JSON null +// +func (d *Decoder) DecodeJSONInterface(input interface{}, toValue interface{}) error { + if document.IsNoSerde(toValue) { + return fmt.Errorf("unsupported type: %T", toValue) + } + + v := reflect.ValueOf(toValue) + + if v.Kind() != reflect.Ptr || v.IsNil() || !v.IsValid() { + return &document.InvalidUnmarshalError{Type: reflect.TypeOf(toValue)} + } + + return d.decode(input, v, serde.Tag{}) +} + +func (d *Decoder) decode(jv interface{}, rv reflect.Value, tag serde.Tag) error { + if jv == nil { + rv := serde.Indirect(rv, true) + return d.decodeJSONNull(rv) + } + + rv = serde.Indirect(rv, false) + + if err := d.unsupportedType(jv, rv); err != nil { + return err + } + + switch tv := jv.(type) { + case bool: + return d.decodeJSONBoolean(tv, rv) + case json.Number: + return d.decodeJSONNumber(tv, rv) + case float64: + return d.decodeJSONFloat64(tv, rv) + case string: + return d.decodeJSONString(tv, rv) + case []interface{}: + return d.decodeJSONArray(tv, rv) + case map[string]interface{}: + return d.decodeJSONObject(tv, rv) + default: + return fmt.Errorf("unsupported json type, %T", tv) + } +} + +func (d *Decoder) decodeJSONNull(rv reflect.Value) error { + if rv.IsValid() && rv.CanSet() { + rv.Set(reflect.Zero(rv.Type())) + } + + return nil +} + +func (d *Decoder) decodeJSONBoolean(tv bool, rv reflect.Value) error { + switch rv.Kind() { + case reflect.Bool, reflect.Interface: + rv.Set(reflect.ValueOf(tv).Convert(rv.Type())) + default: + return &document.UnmarshalTypeError{Value: "bool", Type: rv.Type()} + } + + return nil +} + +func (d *Decoder) decodeJSONNumber(tv json.Number, rv reflect.Value) error { + switch rv.Kind() { + case reflect.Interface: + rv.Set(reflect.ValueOf(document.Number(tv))) + case reflect.String: + // covers document.Number + rv.SetString(tv.String()) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + i, err := tv.Int64() + if err != nil { + return err + } + if rv.OverflowInt(i) { + return &document.UnmarshalTypeError{ + Value: fmt.Sprintf("number overflow, %s", tv.String()), + Type: rv.Type(), + } + } + rv.SetInt(i) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + u, err := document.Number(tv).Uint64() + if err != nil { + return err + } + if rv.OverflowUint(u) { + return &document.UnmarshalTypeError{ + Value: fmt.Sprintf("number overflow, %s", tv.String()), + Type: rv.Type(), + } + } + rv.SetUint(u) + case reflect.Float32: + f, err := document.Number(tv).Float32() + if err != nil { + return err + } + if rv.OverflowFloat(f) { + return &document.UnmarshalTypeError{ + Value: fmt.Sprintf("float overflow, %s", tv.String()), + Type: rv.Type(), + } + } + rv.SetFloat(f) + case reflect.Float64: + f, err := document.Number(tv).Float64() + if err != nil { + return err + } + if rv.OverflowFloat(f) { + return &document.UnmarshalTypeError{ + Value: fmt.Sprintf("float overflow, %s", tv.String()), + Type: rv.Type(), + } + } + rv.SetFloat(f) + default: + rvt := rv.Type() + switch { + case rvt.ConvertibleTo(serde.ReflectTypeOf.BigFloat): + sv := tv.String() + f, ok := (&big.Float{}).SetString(sv) + if !ok { + return &document.UnmarshalTypeError{ + Value: fmt.Sprintf("invalid number format, %s", sv), + Type: rv.Type(), + } + } + rv.Set(reflect.ValueOf(*f).Convert(rvt)) + case rvt.ConvertibleTo(serde.ReflectTypeOf.BigInt): + sv := tv.String() + i, ok := (&big.Int{}).SetString(sv, 10) + if !ok { + return &document.UnmarshalTypeError{ + Value: fmt.Sprintf("invalid number format, %s", sv), + Type: rv.Type(), + } + } + rv.Set(reflect.ValueOf(*i).Convert(rvt)) + default: + return &document.UnmarshalTypeError{Value: "number", Type: rv.Type()} + } + } + + return nil +} + +func (d *Decoder) decodeJSONFloat64(tv float64, rv reflect.Value) error { + switch rv.Kind() { + case reflect.Interface: + rv.Set(reflect.ValueOf(tv)) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + i, accuracy := big.NewFloat(tv).Int64() + if accuracy != big.Exact || rv.OverflowInt(i) { + return &document.UnmarshalTypeError{ + Value: fmt.Sprintf("number overflow, %e", tv), + Type: rv.Type(), + } + } + rv.SetInt(i) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + u, accuracy := big.NewFloat(tv).Uint64() + if accuracy != big.Exact || rv.OverflowUint(u) { + return &document.UnmarshalTypeError{ + Value: fmt.Sprintf("number overflow, %e", tv), + Type: rv.Type(), + } + } + rv.SetUint(u) + case reflect.Float32, reflect.Float64: + if rv.OverflowFloat(tv) { + return &document.UnmarshalTypeError{ + Value: fmt.Sprintf("float overflow, %e", tv), + Type: rv.Type(), + } + } + rv.SetFloat(tv) + default: + rvt := rv.Type() + switch { + case rvt.ConvertibleTo(serde.ReflectTypeOf.BigFloat): + f := big.NewFloat(tv) + rv.Set(reflect.ValueOf(*f).Convert(rvt)) + case rvt.ConvertibleTo(serde.ReflectTypeOf.BigInt): + i, accuracy := big.NewFloat(tv).Int(nil) + if accuracy != big.Exact { + return &document.UnmarshalTypeError{ + Value: fmt.Sprintf("int overflow, %e", tv), + Type: rv.Type(), + } + } + rv.Set(reflect.ValueOf(*i).Convert(rvt)) + default: + return &document.UnmarshalTypeError{Value: "number", Type: rv.Type()} + } + } + + return nil +} + +func (d *Decoder) decodeJSONArray(tv []interface{}, rv reflect.Value) error { + var isArray bool + + switch rv.Kind() { + case reflect.Slice: + // Make room for the slice elements if needed + if rv.IsNil() || rv.Cap() < len(tv) { + rv.Set(reflect.MakeSlice(rv.Type(), 0, len(tv))) + } + case reflect.Array: + // Limited to capacity of existing array. + isArray = true + case reflect.Interface: + s := make([]interface{}, len(tv)) + for i, av := range tv { + if err := d.decode(av, reflect.ValueOf(&s[i]).Elem(), serde.Tag{}); err != nil { + return err + } + } + rv.Set(reflect.ValueOf(s)) + return nil + default: + return &document.UnmarshalTypeError{Value: "list", Type: rv.Type()} + } + + // If rv is not a slice, array + for i := 0; i < rv.Cap() && i < len(tv); i++ { + if !isArray { + rv.SetLen(i + 1) + } + if err := d.decode(tv[i], rv.Index(i), serde.Tag{}); err != nil { + return err + } + } + + return nil +} + +func (d *Decoder) decodeJSONString(tv string, rv reflect.Value) error { + switch rv.Kind() { + case reflect.String: + rv.SetString(tv) + case reflect.Interface: + // Ensure type aliasing is handled properly + rv.Set(reflect.ValueOf(tv).Convert(rv.Type())) + default: + return &document.UnmarshalTypeError{Value: "string", Type: rv.Type()} + } + + return nil +} + +func (d *Decoder) decodeJSONObject(tv map[string]interface{}, rv reflect.Value) error { + switch rv.Kind() { + case reflect.Map: + t := rv.Type() + if t.Key().Kind() != reflect.String { + return &document.UnmarshalTypeError{Value: "map string key", Type: t.Key()} + } + if rv.IsNil() { + rv.Set(reflect.MakeMap(t)) + } + case reflect.Struct: + if rv.CanInterface() && document.IsNoSerde(rv.Interface()) { + return &document.UnmarshalTypeError{ + Value: fmt.Sprintf("unsupported type"), + Type: rv.Type(), + } + } + case reflect.Interface: + rv.Set(reflect.MakeMap(serde.ReflectTypeOf.MapStringToInterface)) + rv = rv.Elem() + default: + return &document.UnmarshalTypeError{Value: "map", Type: rv.Type()} + } + + if rv.Kind() == reflect.Map { + for k, kv := range tv { + key := reflect.New(rv.Type().Key()).Elem() + key.SetString(k) + elem := reflect.New(rv.Type().Elem()).Elem() + if err := d.decode(kv, elem, serde.Tag{}); err != nil { + return err + } + rv.SetMapIndex(key, elem) + } + } else if rv.Kind() == reflect.Struct { + fields := serde.GetStructFields(rv.Type()) + for k, kv := range tv { + if f, ok := fields.FieldByName(k); ok { + fv := serde.DecoderFieldByIndex(rv, f.Index) + if err := d.decode(kv, fv, f.Tag); err != nil { + return err + } + } + } + } + + return nil +} + +func (d *Decoder) unsupportedType(jv interface{}, rv reflect.Value) error { + if rv.Kind() == reflect.Interface && rv.NumMethod() != 0 { + return &document.UnmarshalTypeError{Value: "non-empty interface", Type: rv.Type()} + } + + if rv.Type().ConvertibleTo(serde.ReflectTypeOf.Time) { + return &document.UnmarshalTypeError{ + Type: rv.Type(), + Value: fmt.Sprintf("time value: %v", jv), + } + } + return nil +} diff --git a/vendor/github.com/aws/smithy-go/document/json/doc.go b/vendor/github.com/aws/smithy-go/document/json/doc.go new file mode 100644 index 00000000000..cc5c04c3416 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/document/json/doc.go @@ -0,0 +1,8 @@ +// Package json provides a document Encoder and Decoder implementation that is used to implement Smithy document types +// for JSON based protocols. The Encoder and Decoder implement the document.Marshaler and document.Unmarshaler +// interfaces respectively. +// +// This package handles protocol specific implementation details about documents, and can not be used to construct +// a document type for a service client. To construct a document type see each service clients respective document +// package and NewLazyDocument function. +package json diff --git a/vendor/github.com/aws/smithy-go/document/json/encoder.go b/vendor/github.com/aws/smithy-go/document/json/encoder.go new file mode 100644 index 00000000000..e9138330c66 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/document/json/encoder.go @@ -0,0 +1,352 @@ +package json + +import ( + "fmt" + "math/big" + "reflect" + "slices" + "strings" + + "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/document/internal/serde" + smithyjson "github.com/aws/smithy-go/encoding/json" +) + +// EncoderOptions is the set of options that can be configured for an Encoder. +type EncoderOptions struct{} + +// Encoder is a Smithy document decoder for JSON based protocols. +type Encoder struct { + options EncoderOptions +} + +// Encode returns the JSON encoding of v. +func (e *Encoder) Encode(v interface{}) ([]byte, error) { + encoder := smithyjson.NewEncoder() + + if err := e.encode(jsonValueProvider(encoder.Value), reflect.ValueOf(v), serde.Tag{}); err != nil { + return nil, err + } + + encodedBytes := encoder.Bytes() + + if len(encodedBytes) == 0 { + return nil, nil + } + + return encodedBytes, nil +} + +// valueProvider is an interface for retrieving a JSON Value type used for encoding. +type valueProvider interface { + GetValue() smithyjson.Value +} + +// jsonValueProvider is a valueProvider that returns the JSON value encoder as is. +type jsonValueProvider smithyjson.Value + +func (p jsonValueProvider) GetValue() smithyjson.Value { + return smithyjson.Value(p) +} + +// jsonObjectKeyProvider is a valueProvider that returns a JSON value type for encoding a value for the given JSON object +// key. +type jsonObjectKeyProvider struct { + Object *smithyjson.Object + Key string +} + +func (p jsonObjectKeyProvider) GetValue() smithyjson.Value { + return p.Object.Key(p.Key) +} + +// jsonArrayProvider is a valueProvider that returns a JSON value type for encoding a value in the given JSON array. +type jsonArrayProvider struct { + Array *smithyjson.Array +} + +func (p jsonArrayProvider) GetValue() smithyjson.Value { + return p.Array.Value() +} + +func (e *Encoder) encode(vp valueProvider, rv reflect.Value, tag serde.Tag) error { + // Zero values are serialized as null, or skipped if omitEmpty. + if serde.IsZeroValue(rv) { + if tag.OmitEmpty { + return nil + } + return e.encodeZeroValue(vp, rv) + } + + // Handle both pointers and interface conversion into types + rv = serde.ValueElem(rv) + + switch rv.Kind() { + case reflect.Invalid: + if tag.OmitEmpty { + return nil + } + vp.GetValue().Null() + return nil + + case reflect.Struct: + return e.encodeStruct(vp, rv) + + case reflect.Map: + return e.encodeMap(vp, rv) + + case reflect.Slice, reflect.Array: + return e.encodeSlice(vp, rv) + + case reflect.Chan, reflect.Func, reflect.UnsafePointer: + // skip unsupported types + return nil + + default: + return e.encodeScalar(vp, rv) + } +} + +func (e *Encoder) encodeZeroValue(vp valueProvider, rv reflect.Value) error { + switch rv.Kind() { + case reflect.Invalid: + vp.GetValue().Null() + case reflect.Array: + vp.GetValue().Array().Close() + case reflect.Map, reflect.Slice: + vp.GetValue().Null() + case reflect.String: + vp.GetValue().String("") + case reflect.Bool: + vp.GetValue().Boolean(false) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + vp.GetValue().Long(0) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + vp.GetValue().ULong(0) + case reflect.Float32, reflect.Float64: + vp.GetValue().Double(0) + case reflect.Interface, reflect.Ptr: + vp.GetValue().Null() + default: + return &document.InvalidMarshalError{Message: fmt.Sprintf("unknown value type: %s", rv.String())} + } + + return nil +} + +func (e *Encoder) encodeStruct(vp valueProvider, rv reflect.Value) error { + if rv.CanInterface() && document.IsNoSerde(rv.Interface()) { + return &document.UnmarshalTypeError{ + Value: fmt.Sprintf("unsupported type"), + Type: rv.Type(), + } + } + + switch { + case rv.Type().ConvertibleTo(serde.ReflectTypeOf.Time): + return &document.InvalidMarshalError{ + Message: fmt.Sprintf("unsupported type %s", rv.Type().String()), + } + case rv.Type().ConvertibleTo(serde.ReflectTypeOf.BigFloat): + fallthrough + case rv.Type().ConvertibleTo(serde.ReflectTypeOf.BigInt): + return e.encodeNumber(vp, rv) + } + + object := vp.GetValue().Object() + defer object.Close() + + fields := serde.GetStructFields(rv.Type()) + for _, f := range fields.All() { + if f.Name == "" { + return &document.InvalidMarshalError{Message: "map key cannot be empty"} + } + + fv, found := serde.EncoderFieldByIndex(rv, f.Index) + if !found { + continue + } + + err := e.encode(jsonObjectKeyProvider{ + Object: object, + Key: f.Name, + }, fv, f.Tag) + if err != nil { + return err + } + } + + return nil +} + +func (e *Encoder) encodeMap(vp valueProvider, rv reflect.Value) error { + object := vp.GetValue().Object() + defer object.Close() + + rawKeys := rv.MapKeys() + keys := make([]*mapKey, 0, len(rawKeys)) + for _, raw := range rawKeys { + keys = append(keys, &mapKey{ + Value: raw, + Underlying: fmt.Sprint(raw.Interface()), + }) + } + + slices.SortFunc(keys, sortMapKeys) + for _, key := range keys { + if key.Underlying == "" { + return &document.InvalidMarshalError{Message: "map key cannot be empty"} + } + + ev := rv.MapIndex(key.Value) + err := e.encode(jsonObjectKeyProvider{ + Object: object, + Key: key.Underlying, + }, ev, serde.Tag{}) + if err != nil { + return err + } + } + + return nil +} + +func (e *Encoder) encodeSlice(value valueProvider, rv reflect.Value) error { + array := value.GetValue().Array() + defer array.Close() + + for i := 0; i < rv.Len(); i++ { + err := e.encode(jsonArrayProvider{Array: array}, rv.Index(i), serde.Tag{}) + if err != nil { + return err + } + } + + return nil +} + +func (e *Encoder) encodeScalar(vp valueProvider, rv reflect.Value) error { + if rv.Type() == serde.ReflectTypeOf.DocumentNumber { + number := rv.Interface().(document.Number) + if !isValidJSONNumber(number.String()) { + return &document.InvalidMarshalError{Message: fmt.Sprintf("invalid number literal: %s", number)} + } + vp.GetValue().Write([]byte(number)) + return nil + } + + switch rv.Kind() { + case reflect.Bool: + vp.GetValue().Boolean(rv.Bool()) + case reflect.String: + vp.GetValue().String(rv.String()) + default: + // Fallback to encoding numbers, will return invalid type if not supported + err := e.encodeNumber(vp, rv) + if err != nil { + return err + } + } + + return nil +} + +func (e *Encoder) encodeNumber(vp valueProvider, rv reflect.Value) error { + switch rv.Kind() { + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + vp.GetValue().Long(rv.Int()) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + vp.GetValue().ULong(rv.Uint()) + case reflect.Float32: + vp.GetValue().Float(float32(rv.Float())) + case reflect.Float64: + vp.GetValue().Double(rv.Float()) + default: + rvt := rv.Type() + switch { + case rvt.ConvertibleTo(serde.ReflectTypeOf.BigInt): + bi := rv.Convert(serde.ReflectTypeOf.BigInt).Interface().(big.Int) + vp.GetValue().BigInteger(&bi) + case rvt.ConvertibleTo(serde.ReflectTypeOf.BigFloat): + bf := rv.Convert(serde.ReflectTypeOf.BigFloat).Interface().(big.Float) + vp.GetValue().BigDecimal(&bf) + default: + return &document.InvalidMarshalError{Message: fmt.Sprintf("incompatible type: %s", rvt.String())} + } + } + + return nil +} + +// isValidJSONNumber reports whether s is a valid JSON number literal. +// From https://golang.org/src/encoding/json/encode.go#L652 isValidNumber +// Copyright 2010 The Go Authors. +func isValidJSONNumber(s string) bool { + // This function implements the JSON numbers grammar. + // See https://tools.ietf.org/html/rfc7159#section-6 + // and https://www.json.org/img/number.png + + if s == "" { + return false + } + + // Optional - + if s[0] == '-' { + s = s[1:] + if s == "" { + return false + } + } + + // Digits + switch { + default: + return false + + case s[0] == '0': + s = s[1:] + + case '1' <= s[0] && s[0] <= '9': + s = s[1:] + for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { + s = s[1:] + } + } + + // . followed by 1 or more digits. + if len(s) >= 2 && s[0] == '.' && '0' <= s[1] && s[1] <= '9' { + s = s[2:] + for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { + s = s[1:] + } + } + + // e or E followed by an optional - or + and + // 1 or more digits. + if len(s) >= 2 && (s[0] == 'e' || s[0] == 'E') { + s = s[1:] + if s[0] == '+' || s[0] == '-' { + s = s[1:] + if s == "" { + return false + } + } + for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { + s = s[1:] + } + } + + // Make sure we are at the end. + return s == "" +} + +// cache struct to cache a map key's reflect.Value with its underlying value, +// since repeated calls to reflect.Value.Interface() may be expensive +type mapKey struct { + Value reflect.Value + Underlying string +} + +func sortMapKeys(i, j *mapKey) int { + return strings.Compare(i.Underlying, j.Underlying) +} diff --git a/vendor/github.com/aws/smithy-go/document/json/json.go b/vendor/github.com/aws/smithy-go/document/json/json.go new file mode 100644 index 00000000000..ec4d29260e0 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/document/json/json.go @@ -0,0 +1,27 @@ +package json + +// NewEncoder returns an Encoder for serializing Smithy documents for JSON based protocols. +func NewEncoder(optFns ...func(options *EncoderOptions)) *Encoder { + o := EncoderOptions{} + + for _, fn := range optFns { + fn(&o) + } + + return &Encoder{ + options: o, + } +} + +// NewDecoder returns a Decoder for deserializing Smithy documents for JSON based protocols. +func NewDecoder(optFns ...func(*DecoderOptions)) *Decoder { + o := DecoderOptions{} + + for _, fn := range optFns { + fn(&o) + } + + return &Decoder{ + options: o, + } +} diff --git a/vendor/github.com/aws/smithy-go/eventstream/debug.go b/vendor/github.com/aws/smithy-go/eventstream/debug.go index 6049402b1f7..ca4394f8bf7 100644 --- a/vendor/github.com/aws/smithy-go/eventstream/debug.go +++ b/vendor/github.com/aws/smithy-go/eventstream/debug.go @@ -139,6 +139,6 @@ func valueFromType(typ valueType, val any) (Value, error) { copy(tv[:], v) return tv, err default: - panic(fmt.Sprintf("unknown type, %s, %T", typ.String(), val)) + return nil, fmt.Errorf("unable to decode unknown type, %s, %T", typ.String(), val) } } diff --git a/vendor/github.com/aws/smithy-go/eventstream/header.go b/vendor/github.com/aws/smithy-go/eventstream/header.go index f580bda4c02..b5aacca00ec 100644 --- a/vendor/github.com/aws/smithy-go/eventstream/header.go +++ b/vendor/github.com/aws/smithy-go/eventstream/header.go @@ -151,7 +151,7 @@ func decodeHeaderValue(r io.Reader) (Value, error) { err = tv.decode(r) v = tv default: - panic(fmt.Sprintf("unknown value type %d", raw.Type)) + return nil, fmt.Errorf("unable to decode header of unknown value type %d", raw.Type) } // Error could be EOF, let caller deal with it 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 4277e6869ad..b676a4e1487 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.27.5" +const goModuleVersion = "1.28.5" diff --git a/vendor/github.com/aws/smithy-go/internal/errors/errors.go b/vendor/github.com/aws/smithy-go/internal/errors/errors.go new file mode 100644 index 00000000000..5eea7b79800 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/internal/errors/errors.go @@ -0,0 +1,56 @@ +package errors + +import ( + "reflect" + "strings" + + "github.com/aws/smithy-go" +) + +// SetErrorCodeOverride sets the ErrorCodeOverride field on err if present. +// +// This is used by protocols in awsquery-compatible mode that need to override +// the error code on a deserialized error. +func SetErrorCodeOverride(err error, code string) { + // yes it's reflection but i don't really view errors as a hot path so i + // think it's fine + v := reflect.ValueOf(err) + if v.Kind() == reflect.Ptr { + v = v.Elem() + } + if v.Kind() != reflect.Struct { + return + } + + f := v.FieldByName("ErrorCodeOverride") + if !f.IsValid() || !f.CanSet() || f.Type() != reflect.TypeOf((*string)(nil)) { + return + } + + f.Set(reflect.ValueOf(&code)) +} + +// SanitizeErrorCode strips namespace prefixes and colon suffixes from protocol +// error codes. +func SanitizeErrorCode(code string) string { + _, noprefix, ok := strings.Cut(code, "#") + if !ok { + noprefix = code // If sep does not appear in s, cut returns s, "", false. + } + + code, _, _ = strings.Cut(noprefix, ":") + return code +} + +// ParseQueryError extracts the error code and fault from X-Amzn-Query-Error. +func ParseQueryError(header string) (string, smithy.ErrorFault) { + code, fault, _ := strings.Cut(header, ";") + switch fault { + case "Sender": + return code, smithy.FaultClient + case "Receiver": + return code, smithy.FaultServer + default: + return code, smithy.FaultUnknown + } +} diff --git a/vendor/github.com/aws/smithy-go/internal/eventstream/codec.go b/vendor/github.com/aws/smithy-go/internal/eventstream/codec.go new file mode 100644 index 00000000000..d0a8d00c8dc --- /dev/null +++ b/vendor/github.com/aws/smithy-go/internal/eventstream/codec.go @@ -0,0 +1,244 @@ +package eventstream + +import ( + "bytes" + "fmt" + "io" + + "github.com/aws/smithy-go" + "github.com/aws/smithy-go/eventstream" +) + +// Codec orchestrates event stream message serde for protocols that use the +// standard event stream binary framing. +type Codec struct { + Serializer func() smithy.ShapeSerializer + Deserializer func([]byte) smithy.ShapeDeserializer + ContentType string + + // Protocol-specific hook to retrieve error information from some payload. + ErrorInfo func(payload []byte) (code, message string, err error) + + encoder *eventstream.Encoder + decoder *eventstream.Decoder + payloadBuf []byte +} + +func (c *Codec) enc() *eventstream.Encoder { + if c.encoder == nil { + c.encoder = eventstream.NewEncoder() + } + return c.encoder +} + +func (c *Codec) dec() *eventstream.Decoder { + if c.decoder == nil { + c.decoder = eventstream.NewDecoder() + } + return c.decoder +} + +// SerializeEventMessage serializes an event to the input stream. +func (c *Codec) SerializeEventMessage(schema, variant *smithy.Schema, v smithy.Serializable, w io.Writer) error { + var msg eventstream.Message + + inner := c.Serializer() + ss := eventstream.NewShapeSerializer(&msg, inner) + + v.Serialize(ss) + + // header order matches the legacy per-operation serializers: the event type + // is written before the message type + msg.Headers.Set(eventstream.EventTypeHeader, eventstream.StringValue(variant.MemberName())) + msg.Headers.Set(eventstream.MessageTypeHeader, eventstream.StringValue(eventstream.EventMessageType)) + + if ct := ss.ContentType(); ct != "" { + msg.Headers.Set(eventstream.ContentTypeHeader, eventstream.StringValue(ct)) + } else if payload := inner.Bytes(); len(payload) > 0 { + msg.Payload = payload + msg.Headers.Set(eventstream.ContentTypeHeader, eventstream.StringValue(c.ContentType)) + } + + return c.enc().Encode(w, msg) +} + +// DeserializeEventMessage reads an event from the output stream. +func (c *Codec) DeserializeEventMessage(schema *smithy.Schema, types *smithy.TypeRegistry, r io.Reader) (smithy.Deserializable, error) { + for { + c.payloadBuf = c.payloadBuf[0:0] + msg, err := c.dec().Decode(r, c.payloadBuf) + if err != nil { + if isEOF(err) { + return nil, io.EOF + } + return nil, fmt.Errorf("decode event: %w", err) + } + + msgType := msg.Headers.Get(eventstream.MessageTypeHeader) + if msgType == nil { + return nil, fmt.Errorf("missing %s header", eventstream.MessageTypeHeader) + } + + switch msgType.String() { + case eventstream.EventMessageType: + event, err := c.deserializeEvent(schema, types, &msg) + if err != nil { + return nil, err + } + return event, nil + case eventstream.ExceptionMessageType: + return nil, c.deserializeException(schema, types, &msg) + case eventstream.ErrorMessageType: + return nil, deserializeError(&msg) + default: + mc := msg.Clone() + return nil, &eventstream.UnknownMessageError{ + Type: msgType.String(), + Message: &mc, + } + } + } +} + +func (c *Codec) deserializeEvent(schema *smithy.Schema, types *smithy.TypeRegistry, msg *eventstream.Message) (smithy.Deserializable, error) { + eventType := msg.Headers.Get(eventstream.EventTypeHeader) + if eventType == nil { + return nil, fmt.Errorf("missing %s header", eventstream.EventTypeHeader) + } + + member := schema.Member(eventType.String()) + if member == nil { + return c.unknownEvent(eventType.String(), msg) + } + + entry, ok := types.LookupEntry(member.TargetID().String()) + if !ok { + return c.unknownEvent(eventType.String(), msg) + } + + instance, ok := entry.New().(smithy.Deserializable) + if !ok { + return nil, fmt.Errorf("event type %s is not deserializable", eventType.String()) + } + + inner := c.Deserializer(msg.Payload) + ed := eventstream.NewShapeDeserializer(msg, inner) + if err := instance.Deserialize(ed); err != nil { + return nil, fmt.Errorf("deserialize event %s: %w", eventType.String(), err) + } + + return instance, nil +} + +func (c *Codec) unknownEvent(tag string, msg *eventstream.Message) (*eventstream.UnknownUnionMember, error) { + var buf bytes.Buffer + c.enc().Encode(&buf, *msg) + return &eventstream.UnknownUnionMember{Tag: tag, Value: buf.Bytes()}, nil +} + +func (c *Codec) deserializeException(schema *smithy.Schema, types *smithy.TypeRegistry, msg *eventstream.Message) error { + exType := msg.Headers.Get(eventstream.ExceptionTypeHeader) + if exType == nil { + return fmt.Errorf("missing %s header", eventstream.ExceptionTypeHeader) + } + + var id string + if member := schema.Member(exType.String()); member != nil { + id = member.TargetID().String() + } else { + id = exType.String() + } + + perr, ok := types.DeserializableError(id) + if !ok { + code := exType.String() + message := "UnknownError" + if c.ErrorInfo != nil { + bodyCode, bodyMessage, err := c.ErrorInfo(msg.Payload) + if err != nil { + return &smithy.DeserializationError{ + Err: fmt.Errorf("get error info: %w", err), + Snapshot: msg.Payload, + } + } + if len(code) == 0 && len(bodyCode) != 0 { + code = bodyCode + } + if len(bodyMessage) != 0 { + message = bodyMessage + } + } + return &smithy.GenericAPIError{ + Code: code, + Message: message, + } + } + + inner := c.Deserializer(msg.Payload) + ed := eventstream.NewShapeDeserializer(msg, inner) + if err := perr.Deserialize(ed); err != nil { + return fmt.Errorf("deserialize exception %s: %w", exType.String(), err) + } + + return perr +} + +// SerializeInitialRequest serializes the operation input as the first event +// stream message with :event-type "initial-request". +func (c *Codec) SerializeInitialRequest(schema *smithy.Schema, v smithy.Serializable, w io.Writer) error { + ss := c.Serializer() + v.Serialize(ss) + + var msg eventstream.Message + msg.Headers.Set(eventstream.MessageTypeHeader, eventstream.StringValue(eventstream.EventMessageType)) + msg.Headers.Set(eventstream.EventTypeHeader, eventstream.StringValue("initial-request")) + if payload := ss.Bytes(); len(payload) > 0 { + msg.Payload = payload + msg.Headers.Set(eventstream.ContentTypeHeader, eventstream.StringValue(c.ContentType)) + } + + return c.enc().Encode(w, msg) +} + +// DeserializeInitialResponse reads the first event stream message and +// deserializes it as the operation output. +func (c *Codec) DeserializeInitialResponse(schema *smithy.Schema, r io.Reader, out smithy.Deserializable) error { + c.payloadBuf = c.payloadBuf[0:0] + msg, err := c.dec().Decode(r, c.payloadBuf) + if err != nil { + return fmt.Errorf("decode initial response: %w", err) + } + + eventType := msg.Headers.Get(eventstream.EventTypeHeader) + if eventType == nil || eventType.String() != "initial-response" { + return fmt.Errorf("expected initial-response, got %v", eventType) + } + + if len(msg.Payload) > 0 { + sd := c.Deserializer(msg.Payload) + if err := out.Deserialize(sd); err != nil { + return fmt.Errorf("deserialize initial response: %w", err) + } + } + + return nil +} + +func deserializeError(msg *eventstream.Message) error { + code := "UnknownError" + message := code + if v := msg.Headers.Get(eventstream.ErrorCodeHeader); v != nil { + code = v.String() + } + if v := msg.Headers.Get(eventstream.ErrorMessageHeader); v != nil { + message = v.String() + } + return &smithy.GenericAPIError{ + Code: code, + Message: message, + } +} + +func isEOF(err error) bool { + return err == io.EOF || err == io.ErrUnexpectedEOF +} diff --git a/vendor/github.com/aws/smithy-go/internal/eventstream/no_event_stream.go b/vendor/github.com/aws/smithy-go/internal/eventstream/no_event_stream.go new file mode 100644 index 00000000000..3862cdb5301 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/internal/eventstream/no_event_stream.go @@ -0,0 +1,36 @@ +package eventstream + +import ( + "fmt" + "io" + + "github.com/aws/smithy-go" +) + +// NoEventStream implements the event stream methods of +// [github.com/aws/smithy-go/transport/http.ClientProtocol] for protocols +// that do not support event streams. +type NoEventStream struct{} + +// HasInitialEventMessage returns false. +func (NoEventStream) HasInitialEventMessage() bool { return false } + +// SerializeEventMessage returns an error. +func (NoEventStream) SerializeEventMessage(_, _ *smithy.Schema, _ smithy.Serializable, _ io.Writer) error { + return fmt.Errorf("event streams are not supported by this protocol") +} + +// DeserializeEventMessage returns an error. +func (NoEventStream) DeserializeEventMessage(_ *smithy.Schema, _ *smithy.TypeRegistry, _ io.Reader) (smithy.Deserializable, error) { + return nil, fmt.Errorf("event streams are not supported by this protocol") +} + +// SerializeInitialRequest returns an error. +func (NoEventStream) SerializeInitialRequest(_ *smithy.Schema, _ smithy.Serializable, _ io.Writer) error { + return fmt.Errorf("event streams are not supported by this protocol") +} + +// DeserializeInitialResponse returns an error. +func (NoEventStream) DeserializeInitialResponse(_ *smithy.Schema, _ io.Reader, _ smithy.Deserializable) error { + return fmt.Errorf("event streams are not supported by this protocol") +} diff --git a/vendor/github.com/aws/smithy-go/internal/eventstream/require_http2.go b/vendor/github.com/aws/smithy-go/internal/eventstream/require_http2.go new file mode 100644 index 00000000000..78910b7d52f --- /dev/null +++ b/vendor/github.com/aws/smithy-go/internal/eventstream/require_http2.go @@ -0,0 +1,12 @@ +package eventstream + +import "fmt" + +// RequireBidiHTTP2 returns an error if the response protocol is not at least +// HTTP/2, which is required for bidirectional event streams. +func (c *Codec) RequireBidiHTTP2(proto string, protoMajor int) error { + if protoMajor < 2 { + return fmt.Errorf("operation requires minimum HTTP protocol of HTTP/2, but was %s", proto) + } + return nil +} diff --git a/vendor/github.com/aws/smithy-go/internal/serde/read_payload_blob.go b/vendor/github.com/aws/smithy-go/internal/serde/read_payload_blob.go new file mode 100644 index 00000000000..184389bb442 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/internal/serde/read_payload_blob.go @@ -0,0 +1,34 @@ +package serde + +import ( + "bytes" + "io" +) + +// maxPresize bounds how large a buffer we will allocate up front from a +// Content-Length header. Past this point we allocate maxPresize and let the read +// grow the buffer to fit whatever actually arrives. +// +// We arbitrarily choose 512K. +const maxPresize = 512 * 1024 + +// ReadPayloadBlob consumes the given reader into a buffer that does not come +// from (and will never be returned to) a pool, sizing it from contentLength +// when that is known and within bounds. +func ReadPayloadBlob(r io.Reader, contentLength int64) (*bytes.Buffer, error) { + buf := &bytes.Buffer{} + if contentLength > 0 { + presize := contentLength + if presize > maxPresize { + presize = maxPresize + } + + // + bytes.MinRead prevents pointless doubling on EOF + buf.Grow(int(presize) + bytes.MinRead) + } + + if _, err := buf.ReadFrom(r); err != nil { + return nil, err + } + return buf, nil +} diff --git a/vendor/github.com/aws/smithy-go/internal/serde/stack.go b/vendor/github.com/aws/smithy-go/internal/serde/stack.go new file mode 100644 index 00000000000..dd236e3ab96 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/internal/serde/stack.go @@ -0,0 +1,53 @@ +package serde + +// Stack is a generic slice-backed stack pre-allocated to avoid growth +// allocations for typical serde nesting depths. +type Stack[T any] struct { + values []T +} + +// NewStack returns a Stack pre-allocated with capacity 8. +func NewStack[T any]() Stack[T] { + return Stack[T]{values: make([]T, 0, 8)} +} + +// Push adds a value to the top of the stack. +func (s *Stack[T]) Push(v T) { + s.values = append(s.values, v) +} + +// Pop removes and returns the top value. +func (s *Stack[T]) Pop() T { + v := s.values[len(s.values)-1] + var zero T + s.values[len(s.values)-1] = zero + s.values = s.values[:len(s.values)-1] + return v +} + +// Top returns a pointer to the top value without removing it. +func (s *Stack[T]) Top() *T { + if len(s.values) == 0 { + return nil + } + return &s.values[len(s.values)-1] +} + +// Len returns the number of elements in the stack. +func (s *Stack[T]) Len() int { + return len(s.values) +} + +// Reset clears the stack while retaining allocated capacity. +func (s *Stack[T]) Reset() { + var zero T + for i := range s.values { + s.values[i] = zero + } + s.values = s.values[:0] +} + +// Values returns the underlying slice for indexed access. +func (s *Stack[T]) Values() []T { + return s.values +} diff --git a/vendor/github.com/aws/smithy-go/internal/serde/string_arena.go b/vendor/github.com/aws/smithy-go/internal/serde/string_arena.go new file mode 100644 index 00000000000..b2fc257f5cb --- /dev/null +++ b/vendor/github.com/aws/smithy-go/internal/serde/string_arena.go @@ -0,0 +1,66 @@ +package serde + +import "unsafe" + +// ArenaPayloadFactor is the ratio at which we size string arenas to the payload +// (clamped by StringArenaMin/Max) +// +// We limit arenas to 4k but smaller payloads likely don't need it, so we size +// down (somewhat arbitrarily) until we hit the 512-byte floor at which we just +// don't arena. +const ArenaPayloadFactor = 4 + +// The size of a string arena is bounded, but not strictly by [min, max]: +// - Attempting to set a capacity below MinArenaSize will have no effect as +// beneath this limit it is not worth it. Calls to String with a capacity below +// this boundary will simply allocate. +// - An arena WILL be capped at MaxArenaSize. +const ( + MinArenaSize = 512 + MaxArenaSize = 4096 +) + +// StringArena batches many small string allocations into one block. +// +// You MUST call Reset with the desired capacity before use. Failure to do so +// will mean any calls to String will simply allocate and you won't get the +// performance benefit of the arena. +type StringArena struct { + buf []byte + cap int +} + +// Reset prepares the arena for a new document, sizing its next block to cap. +func (a *StringArena) Reset(cap int) { + if cap > MaxArenaSize { + cap = MaxArenaSize + } + a.buf = nil + a.cap = cap +} + +// String attempts to intern a copy of b in the arena, returning a string slice +// for it. +// +// If the arena is at capacity, it will just allocate a new string. +func (a *StringArena) String(b []byte) string { + if len(b) == 0 { + return "" + } + + if a.buf == nil { // lazy init, there might be no strings at all + if a.cap < MinArenaSize || len(b) > a.cap { + return string(b) // "not worth it" fallback + } + + a.buf = make([]byte, 0, a.cap) + } + + if len(b) > cap(a.buf)-len(a.buf) { + return string(b) // "over budget" fallback + } + + off := len(a.buf) + a.buf = append(a.buf, b...) + return unsafe.String(&a.buf[off], len(b)) +} diff --git a/vendor/github.com/aws/smithy-go/internal/sync/buffer_pool.go b/vendor/github.com/aws/smithy-go/internal/sync/buffer_pool.go new file mode 100644 index 00000000000..fdcb1abf2cc --- /dev/null +++ b/vendor/github.com/aws/smithy-go/internal/sync/buffer_pool.go @@ -0,0 +1,52 @@ +package sync + +import ( + "bytes" + "io" + "sync" +) + +// maxBufferSize is the largest buffer that will be returned to the pool. +// +// A pooled buffer retains the capacity its largest occupant forced it to grow +// to, for the life of the pool. Dropping oversized buffers bounds that +// retention, at the cost of re-growing after an unusually large response. +// +// We arbitrarily choose 64K. +const maxBufferSize = 64 * 1024 + +func newBuffer() any { + return new(bytes.Buffer) +} + +// BufferPool pools bytes.Buffers for reading response bodies during protocol +// deserialization. +type BufferPool struct { + pool sync.Pool +} + +// NewBufferPool returns a buffer pool ready for use. +func NewBufferPool() *BufferPool { + return &BufferPool{ + pool: sync.Pool{New: newBuffer}, + } +} + +// Get consumes the given reader into a buffer from the pool, returning that +// buffer. +func (p *BufferPool) Get(r io.Reader) (*bytes.Buffer, error) { + buf := p.pool.Get().(*bytes.Buffer) + if _, err := buf.ReadFrom(r); err != nil { + return nil, err + } + + return buf, nil +} + +// Put returns the buffer if it is within the cap limit. +func (p *BufferPool) Put(buf *bytes.Buffer) { + if buf.Cap() <= maxBufferSize { + buf.Reset() + p.pool.Put(buf) + } +} diff --git a/vendor/github.com/aws/smithy-go/prelude/prelude.go b/vendor/github.com/aws/smithy-go/prelude/prelude.go new file mode 100644 index 00000000000..8d3333a7558 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/prelude/prelude.go @@ -0,0 +1,31 @@ +// Package prelude defines schemas for the Smithy prelude shapes. +package prelude + +import "github.com/aws/smithy-go" + +// All shapes in the prelude. +var ( + String = smithy.NewSchema(smithy.ShapeID{Namespace: "smithy.api", Name: "String"}, smithy.ShapeTypeString, 0) + Blob = smithy.NewSchema(smithy.ShapeID{Namespace: "smithy.api", Name: "Blob"}, smithy.ShapeTypeBlob, 0) + Boolean = smithy.NewSchema(smithy.ShapeID{Namespace: "smithy.api", Name: "Boolean"}, smithy.ShapeTypeBoolean, 0) + Byte = smithy.NewSchema(smithy.ShapeID{Namespace: "smithy.api", Name: "Byte"}, smithy.ShapeTypeByte, 0) + Short = smithy.NewSchema(smithy.ShapeID{Namespace: "smithy.api", Name: "Short"}, smithy.ShapeTypeShort, 0) + Integer = smithy.NewSchema(smithy.ShapeID{Namespace: "smithy.api", Name: "Integer"}, smithy.ShapeTypeInteger, 0) + Long = smithy.NewSchema(smithy.ShapeID{Namespace: "smithy.api", Name: "Long"}, smithy.ShapeTypeLong, 0) + Float = smithy.NewSchema(smithy.ShapeID{Namespace: "smithy.api", Name: "Float"}, smithy.ShapeTypeFloat, 0) + Double = smithy.NewSchema(smithy.ShapeID{Namespace: "smithy.api", Name: "Double"}, smithy.ShapeTypeDouble, 0) + Timestamp = smithy.NewSchema(smithy.ShapeID{Namespace: "smithy.api", Name: "Timestamp"}, smithy.ShapeTypeTimestamp, 0) + Document = smithy.NewSchema(smithy.ShapeID{Namespace: "smithy.api", Name: "Document"}, smithy.ShapeTypeDocument, 0) + Unit = smithy.NewSchema(smithy.ShapeID{Namespace: "smithy.api", Name: "Unit"}, smithy.ShapeTypeStructure, 0) + + PrimitiveBoolean = smithy.NewSchema(smithy.ShapeID{Namespace: "smithy.api", Name: "PrimitiveBoolean"}, smithy.ShapeTypeBoolean, 0) + PrimitiveByte = smithy.NewSchema(smithy.ShapeID{Namespace: "smithy.api", Name: "PrimitiveByte"}, smithy.ShapeTypeByte, 0) + PrimitiveShort = smithy.NewSchema(smithy.ShapeID{Namespace: "smithy.api", Name: "PrimitiveShort"}, smithy.ShapeTypeShort, 0) + PrimitiveInteger = smithy.NewSchema(smithy.ShapeID{Namespace: "smithy.api", Name: "PrimitiveInteger"}, smithy.ShapeTypeInteger, 0) + PrimitiveLong = smithy.NewSchema(smithy.ShapeID{Namespace: "smithy.api", Name: "PrimitiveLong"}, smithy.ShapeTypeLong, 0) + PrimitiveFloat = smithy.NewSchema(smithy.ShapeID{Namespace: "smithy.api", Name: "PrimitiveFloat"}, smithy.ShapeTypeFloat, 0) + PrimitiveDouble = smithy.NewSchema(smithy.ShapeID{Namespace: "smithy.api", Name: "PrimitiveDouble"}, smithy.ShapeTypeDouble, 0) + + BigInteger = smithy.NewSchema(smithy.ShapeID{Namespace: "smithy.api", Name: "BigInteger"}, smithy.ShapeTypeBigInteger, 0) + BigDecimal = smithy.NewSchema(smithy.ShapeID{Namespace: "smithy.api", Name: "BigDecimal"}, smithy.ShapeTypeBigDecimal, 0) +) diff --git a/vendor/github.com/aws/smithy-go/schema.go b/vendor/github.com/aws/smithy-go/schema.go index 6293d34b1e3..8e9c209a580 100644 --- a/vendor/github.com/aws/smithy-go/schema.go +++ b/vendor/github.com/aws/smithy-go/schema.go @@ -71,8 +71,9 @@ type Schema struct { directMask uint64 // bitmask: bit i set means indexed[i] was declared directly on this schema targetID ShapeID // for member schemas, the target's shape ID - listMember *Schema - mapKey, mapValue *Schema + // resolved on the fly and cached + listMember atomic.Pointer[Schema] + mapKey, mapValue atomic.Pointer[Schema] ext [numExtensionSlots]unsafe.Pointer // lazily-computed codec extensions, accessed atomically } @@ -126,9 +127,6 @@ func (s *Schema) AddMember(name string, target *Schema, ts ...Trait) *Schema { traits: cloneTraits(target.traits), directMask: 0, // inherited traits are not direct targetID: target.id, - listMember: target.listMember, - mapKey: target.mapKey, - mapValue: target.mapValue, } // member-declared traits override and are direct @@ -143,14 +141,6 @@ func (s *Schema) AddMember(name string, target *Schema, ts ...Trait) *Schema { atomic.StorePointer(&s.ext[i], nil) } - switch name { - case "member": - s.listMember = m - case "key": - s.mapKey = m - case "value": - s.mapValue = m - } return m } @@ -176,17 +166,31 @@ func cloneTraits(src map[ShapeID]Trait) map[ShapeID]Trait { // ListMember returns the "member" schema for list types. func (s *Schema) ListMember() *Schema { - return s.listMember + return s.lookup(&s.listMember, "member") } // MapKey returns the "key" schema for map types. func (s *Schema) MapKey() *Schema { - return s.mapKey + return s.lookup(&s.mapKey, "key") } // MapValue returns the "value" schema for map types. func (s *Schema) MapValue() *Schema { - return s.mapValue + return s.lookup(&s.mapValue, "value") +} + +func (s *Schema) lookup(cached *atomic.Pointer[Schema], name string) *Schema { + if v := cached.Load(); v != nil { + return v + } + + m, ok := s.members[name] + if !ok { + return nil + } + + cached.Store(m) + return m } // MemberName returns the member component of the schema's shape ID. diff --git a/vendor/github.com/aws/smithy-go/schema_ext.go b/vendor/github.com/aws/smithy-go/schema_ext.go index 7503b30b806..e98427ae345 100644 --- a/vendor/github.com/aws/smithy-go/schema_ext.go +++ b/vendor/github.com/aws/smithy-go/schema_ext.go @@ -9,13 +9,14 @@ import ( // (JSON, CBOR, etc.) uses a distinct slot to cache precomputed data. type ExtensionID int -const numExtensionSlots = 4 +const numExtensionSlots = 5 const ( - ExtJSON ExtensionID = iota // transport/http/protocol/internal/json - ExtCBOR // transport/http/protocol/internal/cbor - ExtXML // transport/http/protocol/internal/xml - ExtQuery // transport/http/protocol/internal/query + ExtJSON ExtensionID = iota // transport/http/protocol/internal/json + ExtCBOR // transport/http/protocol/internal/cbor + ExtXML // transport/http/protocol/internal/xml + ExtQuery // transport/http/protocol/internal/query + ExtHTTPBinding // transport/http/protocol/internal/httpbinding ) // SchemaExtension retrieves or lazily computes the extension for the given diff --git a/vendor/github.com/aws/smithy-go/traits/traits.go b/vendor/github.com/aws/smithy-go/traits/traits.go index 599be4e54e5..8f5770bec2e 100644 --- a/vendor/github.com/aws/smithy-go/traits/traits.go +++ b/vendor/github.com/aws/smithy-go/traits/traits.go @@ -10,6 +10,14 @@ type Sensitive struct{} // TraitID identifies the trait. func (*Sensitive) TraitID() smithy.ShapeID { return smithy.ShapeID{Namespace: "smithy.api", Name: "sensitive"} } +// Error represents smithy.api#error. +type Error struct { + Type string +} + +// TraitID identifies the trait. +func (*Error) TraitID() smithy.ShapeID { return smithy.ShapeID{Namespace: "smithy.api", Name: "error"} } + // EventHeader represents smithy.api#eventHeader. type EventHeader struct{} diff --git a/vendor/github.com/aws/smithy-go/transport/http/eventstream.go b/vendor/github.com/aws/smithy-go/transport/http/eventstream.go index 251db8ac35b..970ade30e20 100644 --- a/vendor/github.com/aws/smithy-go/transport/http/eventstream.go +++ b/vendor/github.com/aws/smithy-go/transport/http/eventstream.go @@ -56,7 +56,10 @@ func NewEventStreamWriter(protocol ClientProtocol, schema *smithy.Schema, stream } func (w *EventStreamWriter) writeStream() { - defer w.Close() + defer func() { + w.err.SetError(w.eventStream.Close()) + }() + defer w.signalClose() for { select { @@ -100,11 +103,14 @@ func (w *EventStreamWriter) Send(ctx context.Context, variant *smithy.Schema, ev // Close signals end-of-stream and closes the underlying writer. Close is // safe for concurrent calls. func (w *EventStreamWriter) Close() error { + w.signalClose() + return w.err.Err() +} + +func (w *EventStreamWriter) signalClose() { w.closeOnce.Do(func() { close(w.done) - w.err.SetError(w.eventStream.Close()) }) - return w.err.Err() } // Err returns the first error encountered during writing. diff --git a/vendor/github.com/aws/smithy-go/transport/http/host.go b/vendor/github.com/aws/smithy-go/transport/http/host.go index b504a455da2..b1227bf9e00 100644 --- a/vendor/github.com/aws/smithy-go/transport/http/host.go +++ b/vendor/github.com/aws/smithy-go/transport/http/host.go @@ -29,17 +29,23 @@ func ValidateEndpointHost(host string) error { hostname = host } - labels := strings.Split(hostname, ".") - for i, label := range labels { - if i == len(labels)-1 && len(label) == 0 { - // Allow trailing dot for FQDN hosts. - continue + for start := 0; ; { + idx := strings.IndexByte(hostname[start:], '.') + if idx < 0 { + // Last label. Allow it to be empty to permit a trailing dot for + // FQDN hosts. + if label := hostname[start:]; len(label) != 0 && !ValidHostLabel(label) { + errors.WriteString("\nendpoint host domain labels must match \"[a-zA-Z0-9-]{1,63}\", but found: ") + errors.WriteString(label) + } + break } - if !ValidHostLabel(label) { + if label := hostname[start : start+idx]; !ValidHostLabel(label) { errors.WriteString("\nendpoint host domain labels must match \"[a-zA-Z0-9-]{1,63}\", but found: ") errors.WriteString(label) } + start += idx + 1 } if len(hostname) == 0 && len(port) != 0 { diff --git a/vendor/github.com/aws/smithy-go/transport/http/middleware_close_response_body.go b/vendor/github.com/aws/smithy-go/transport/http/middleware_close_response_body.go index 914338f2e75..247b9bf1792 100644 --- a/vendor/github.com/aws/smithy-go/transport/http/middleware_close_response_body.go +++ b/vendor/github.com/aws/smithy-go/transport/http/middleware_close_response_body.go @@ -8,9 +8,35 @@ import ( "github.com/aws/smithy-go/middleware" ) +// CloseResponseBody closes the HTTP response body. It leaves the body open only +// for a successful response whose payload is a caller-owned stream (isStreaming +// with a nil opErr); on error, or for a non-streaming response, it closes the +// body — an error response body is diagnostic, not a caller-owned stream. +func CloseResponseBody(ctx context.Context, resp *Response, isStreaming bool, opErr error) { + if resp == nil || resp.Body == nil { + return + } + if isStreaming && opErr == nil { + return + } + + // Drain to EOF before closing; a body closed while unread prevents + // connection reuse. + if _, copyErr := io.Copy(io.Discard, resp.Body); copyErr != nil { + middleware.GetLogger(ctx).Logf(logging.Warn, "failed to discard remaining HTTP response body, this may affect connection reuse: %v", copyErr) + } + + if closeErr := resp.Body.Close(); closeErr != nil { + middleware.GetLogger(ctx).Logf(logging.Warn, "failed to close HTTP response body, this may affect connection reuse: %v", closeErr) + } +} + // AddErrorCloseResponseBodyMiddleware adds the middleware to automatically // close the response body of an operation request if the request response // failed. +// +// Deprecated: generated operation deserializers now close the response body +// via CloseResponseBody, so this middleware is no longer used. func AddErrorCloseResponseBodyMiddleware(stack *middleware.Stack) error { return stack.Deserialize.Insert(&errorCloseResponseBodyMiddleware{}, "OperationDeserializer", middleware.Before) } @@ -42,6 +68,9 @@ func (m *errorCloseResponseBodyMiddleware) HandleDeserialize( // AddCloseResponseBodyMiddleware adds the middleware to automatically close // the response body of an operation request, after the response had been // deserialized. +// +// Deprecated: generated operation deserializers now close the response body +// via CloseResponseBody, so this middleware is no longer used. func AddCloseResponseBodyMiddleware(stack *middleware.Stack) error { return stack.Deserialize.Insert(&closeResponseBody{}, "OperationDeserializer", middleware.Before) } @@ -66,12 +95,12 @@ func (m *closeResponseBody) HandleDeserialize( // Consume the full body to prevent TCP connection resets on some platforms _, copyErr := io.Copy(io.Discard, resp.Body) if copyErr != nil { - middleware.GetLogger(ctx).Logf(logging.Warn, "failed to discard remaining HTTP response body, this may affect connection reuse") + middleware.GetLogger(ctx).Logf(logging.Warn, "failed to discard remaining HTTP response body, this may affect connection reuse: %v", copyErr) } closeErr := resp.Body.Close() if closeErr != nil { - middleware.GetLogger(ctx).Logf(logging.Warn, "failed to close HTTP response body, this may affect connection reuse") + middleware.GetLogger(ctx).Logf(logging.Warn, "failed to close HTTP response body, this may affect connection reuse: %v", closeErr) } } diff --git a/vendor/github.com/aws/smithy-go/transport/http/middleware_content_length.go b/vendor/github.com/aws/smithy-go/transport/http/middleware_content_length.go index 9969389bb29..7a1c47fe367 100644 --- a/vendor/github.com/aws/smithy-go/transport/http/middleware_content_length.go +++ b/vendor/github.com/aws/smithy-go/transport/http/middleware_content_length.go @@ -14,6 +14,9 @@ type ComputeContentLength struct { // AddComputeContentLengthMiddleware adds ComputeContentLength to the middleware // stack's Build step. +// +// Deprecated: Content-Length is now set when the request body is set via +// Request.SetStream, so this middleware is no longer used. func AddComputeContentLengthMiddleware(stack *middleware.Stack) error { return stack.Build.Add(&ComputeContentLength{}, middleware.After) } diff --git a/vendor/github.com/aws/smithy-go/transport/http/protocol/awsjson/awsjson.go b/vendor/github.com/aws/smithy-go/transport/http/protocol/awsjson/awsjson.go new file mode 100644 index 00000000000..1c9f61f332c --- /dev/null +++ b/vendor/github.com/aws/smithy-go/transport/http/protocol/awsjson/awsjson.go @@ -0,0 +1,265 @@ +package awsjson + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "strings" + + "github.com/aws/smithy-go" + internalerrors "github.com/aws/smithy-go/internal/errors" + internales "github.com/aws/smithy-go/internal/eventstream" + internalsync "github.com/aws/smithy-go/internal/sync" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/traits" + smithyhttp "github.com/aws/smithy-go/transport/http" + internaljson "github.com/aws/smithy-go/transport/http/protocol/internal/json" +) + +// ProtocolOptions configures aws.protocols#awsJson1_0. +type ProtocolOptions struct{} + +// New10 returns an instance of the awsJson 1.0 protocol. +func New10(service *smithy.ServiceSchema, opts ...func(*ProtocolOptions)) *Protocol { + return new("1.0", service, opts...) +} + +// New11 returns an instance of the awsJson 1.1 protocol. +func New11(service *smithy.ServiceSchema, opts ...func(*ProtocolOptions)) *Protocol { + return new("1.1", service, opts...) +} + +func new(version string, service *smithy.ServiceSchema, opts ...func(*ProtocolOptions)) *Protocol { + var o ProtocolOptions + for _, fn := range opts { + fn(&o) + } + + _, qc := smithy.SchemaTrait[*traits.AWSQueryCompatible](service.Schema) + return &Protocol{ + version: version, + queryCompatible: qc, + serviceName: service.Schema.ID().Name, + bufs: internalsync.NewBufferPool(), + eventstream: &internales.Codec{ + Serializer: func() smithy.ShapeSerializer { return internaljson.NewShapeSerializer() }, + Deserializer: func(p []byte) smithy.ShapeDeserializer { return internaljson.NewShapeDeserializer(p) }, + ContentType: "application/json", + ErrorInfo: internaljson.EventStreamErrorInfo, + }, + } +} + +// Protocol implements aws.protocols#awsJson1_0 and aws.protocols#awsJson1_1. +type Protocol struct { + version string + queryCompatible bool + serviceName string + + bufs *internalsync.BufferPool + eventstream *internales.Codec +} + +var _ smithyhttp.ClientProtocol = (*Protocol)(nil) + +// ID identifies the protocol. +func (p *Protocol) ID() smithy.ShapeID { + if p.version == "1.1" { + return smithy.ShapeID{Namespace: "aws.protocols", Name: "awsJson1_1"} + } + return smithy.ShapeID{Namespace: "aws.protocols", Name: "awsJson1_0"} +} + +// SerializeRequest serializes a request for AWS Json 1.0. +func (p *Protocol) SerializeRequest( + ctx context.Context, + schema *smithy.OperationSchema, + in smithy.Serializable, + req *smithyhttp.Request, +) error { + req.Method = http.MethodPost + if len(req.URL.Path) == 0 { + req.URL.Path = "/" + } + req.Header.Set("X-Amz-Target", fmt.Sprintf("%s.%s", p.serviceName, schema.ID().Name)) + if schema.IsInputEventStream() { + req.Header.Set("Content-Type", "application/vnd.amazon.eventstream") + return nil + } + + req.Header.Set("Content-Type", "application/x-amz-json-"+p.version) + if p.queryCompatible { + req.Header.Set("X-Amzn-Query-Mode", "true") + } + + if schema.Input == nil { + sreq, err := req.SetStream(strings.NewReader("{}")) + if err != nil { + return fmt.Errorf("set stream: %w", err) + } + *req = *sreq + return nil + } + + ss := internaljson.NewShapeSerializer() + in.Serialize(ss) + + sreq, err := req.SetStream(bytes.NewReader(ss.Bytes())) + if err != nil { + return fmt.Errorf("set stream: %w", err) + } + + *req = *sreq + return nil +} + +// DeserializeResponse deserializes a response for AWS Json 1.0. +func (p *Protocol) DeserializeResponse( + ctx context.Context, + schema *smithy.OperationSchema, + types *smithy.TypeRegistry, + resp *smithyhttp.Response, + out smithy.Deserializable, +) error { + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + return p.deserializeError(types, resp) + } + + if schema.IsOutputEventStream() { + if schema.IsInputEventStream() { + if err := p.eventstream.RequireBidiHTTP2(resp.Proto, resp.ProtoMajor); err != nil { + return err + } + } + return nil + } + + if schema.Output == nil { + return nil + } + + buf, err := p.bufs.Get(resp.Body) + if err != nil { + return &smithy.DeserializationError{Err: err} + } + defer p.bufs.Put(buf) + + payload := buf.Bytes() + if len(payload) == 0 { + return nil + } + + sd := internaljson.NewShapeDeserializer(payload) + if err := out.Deserialize(sd); err != nil { + return &smithy.DeserializationError{Err: err} + } + + return nil +} + +// HasInitialEventMessage is true because this is an RPC protocol. +func (*Protocol) HasInitialEventMessage() bool { + return true +} + +// SerializeEventMessage implements [smithyhttp.ClientProtocol]. +func (p *Protocol) SerializeEventMessage(schema, variant *smithy.Schema, v smithy.Serializable, w io.Writer) error { + return p.eventstream.SerializeEventMessage(schema, variant, v, w) +} + +// DeserializeEventMessage implements [smithyhttp.ClientProtocol]. +func (p *Protocol) DeserializeEventMessage(schema *smithy.Schema, types *smithy.TypeRegistry, r io.Reader) (smithy.Deserializable, error) { + return p.eventstream.DeserializeEventMessage(schema, types, r) +} + +// SerializeInitialRequest implements [smithyhttp.ClientProtocol]. +func (p *Protocol) SerializeInitialRequest(schema *smithy.Schema, v smithy.Serializable, w io.Writer) error { + return p.eventstream.SerializeInitialRequest(schema, v, w) +} + +// DeserializeInitialResponse implements [smithyhttp.ClientProtocol]. +func (p *Protocol) DeserializeInitialResponse(schema *smithy.Schema, r io.Reader, out smithy.Deserializable) error { + return p.eventstream.DeserializeInitialResponse(schema, r, out) +} + +// this handles both awsJson 1.0 and 1.1 - the only thing that 1.1 adds is +// error shape renaming (basically not having the namespace) but both versions +// of the protocol are supposed to support this anyway so it doesn't matter +func (p *Protocol) deserializeError(types *smithy.TypeRegistry, response *smithyhttp.Response) 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 + + var headerCode string + headerCode = response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := internaljson.GetProtocolErrorInfo(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 typ, ok := internaljson.ResolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = typ + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + + errorCode = internaljson.SanitizeErrorCode(errorCode) + + var queryCode string + var queryFault smithy.ErrorFault + if p.queryCompatible { + queryHeader := response.Header.Get("X-Amzn-Query-Error") + queryCode, queryFault = internalerrors.ParseQueryError(queryHeader) + } + + perr, ok := types.DeserializableError(errorCode) + if !ok { + code := errorCode + if queryCode != "" { + code = queryCode + } + return &smithy.GenericAPIError{ + Code: code, + Message: errorMessage, + Fault: queryFault, + } + } + + errorBody.Seek(0, io.SeekStart) + errorBytes, _ := io.ReadAll(errorBody) + if len(errorBytes) > 0 { + deser := internaljson.NewShapeDeserializer(errorBytes) + if err := perr.Deserialize(deser); err != nil { + return &smithy.DeserializationError{Err: err} + } + } + + if queryCode != "" { + internalerrors.SetErrorCodeOverride(perr, queryCode) + } + + return perr +} diff --git a/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/error.go b/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/error.go new file mode 100644 index 00000000000..785532c40a4 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/error.go @@ -0,0 +1,76 @@ +package json + +import ( + "bytes" + "encoding/json" + "io" + "strings" +) + +// ProtocolErrorInfo holds the error type and message decoded from a JSON +// error response body. +type ProtocolErrorInfo struct { + Type string `json:"__type"` + Message string + + // nonstandard, but some AWS services do present the type here + Code any +} + +// GetProtocolErrorInfo decodes error type/message from a JSON response body. +func GetProtocolErrorInfo(decoder *json.Decoder) (ProtocolErrorInfo, error) { + var errInfo ProtocolErrorInfo + if err := decoder.Decode(&errInfo); err != nil { + if err == io.EOF { + return errInfo, nil + } + return errInfo, err + } + return errInfo, nil +} + +// ResolveProtocolErrorType resolves the error type from the header value and +// body info, returning the type and whether one was found. +func ResolveProtocolErrorType(headerType string, bodyInfo ProtocolErrorInfo) (string, bool) { + if len(headerType) != 0 { + return headerType, true + } else if len(bodyInfo.Type) != 0 { + return bodyInfo.Type, true + } else if code, ok := bodyInfo.Code.(string); ok && len(code) != 0 { + return code, true + } + return "", false +} + +// SanitizeErrorCode strips namespace prefixes and URI suffixes from error +// codes received on the wire. +func SanitizeErrorCode(code string) string { + if idx := strings.Index(code, ":"); idx != -1 { + code = code[:idx] + } + if idx := strings.Index(code, "#"); idx != -1 { + code = code[idx+1:] + } + return code +} + +// EventStreamErrorInfo extracts the error code and message from a JSON +// exception payload. +func EventStreamErrorInfo(payload []byte) (string, string, error) { + if len(payload) == 0 { + return "", "", nil + } + + decoder := json.NewDecoder(bytes.NewReader(payload)) + decoder.UseNumber() + info, err := GetProtocolErrorInfo(decoder) + if err != nil { + return "", "", err + } + + var code string + if typ, ok := ResolveProtocolErrorType("", info); ok { + code = SanitizeErrorCode(typ) + } + return code, info.Message, nil +} diff --git a/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/ext.go b/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/ext.go new file mode 100644 index 00000000000..46961c60420 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/ext.go @@ -0,0 +1,62 @@ +package json + +import ( + "github.com/aws/smithy-go" + "github.com/aws/smithy-go/traits" +) + +type jsonExt struct { + jsonKey []byte // `,"memberName":` -- use [1:] when no comma needed + jsonNameKey []byte // `,"jsonName":` -- use [1:] when no comma needed (nil if no @jsonName) +} + +func getExt(s *smithy.Schema) *jsonExt { + return smithy.SchemaExtension(s, smithy.ExtJSON, buildJSONExt) +} + +func buildJSONExt(s *smithy.Schema) *jsonExt { + ext := &jsonExt{} + + if name := s.MemberName(); name != "" { + ext.jsonKey = encodeJSONKey(name) + if jn, ok := smithy.SchemaTrait[*traits.JSONName](s); ok { + ext.jsonNameKey = encodeJSONKey(jn.Name) + } + } + + return ext +} + +// memberByBytes looks a member up without allocating a string for its name: the +// conversion in a map index expression is optimized away. +func memberByBytes(s *smithy.Schema, name []byte) *smithy.Schema { + return s.Members()[string(name)] +} + +func encodeJSONKey(name string) []byte { + buf := make([]byte, 0, len(name)+4) + buf = append(buf, ',', '"') + for i := 0; i < len(name); i++ { + c := name[i] + switch c { + case '"': + buf = append(buf, '\\', '"') + case '\\': + buf = append(buf, '\\', '\\') + case '\n': + buf = append(buf, '\\', 'n') + case '\r': + buf = append(buf, '\\', 'r') + case '\t': + buf = append(buf, '\\', 't') + default: + if c < 0x20 { + buf = append(buf, '\\', 'u', '0', '0', "0123456789abcdef"[c>>4], "0123456789abcdef"[c&0xF]) + } else { + buf = append(buf, c) + } + } + } + buf = append(buf, '"', ':') + return buf +} diff --git a/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/internal/stdlib/LICENSE b/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/internal/stdlib/LICENSE new file mode 100644 index 00000000000..6a66aea5eaf --- /dev/null +++ b/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/internal/stdlib/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/internal/stdlib/stdlib.go b/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/internal/stdlib/stdlib.go new file mode 100644 index 00000000000..fa84c43d836 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/internal/stdlib/stdlib.go @@ -0,0 +1,145 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package stdlib contains code copied from the Go standard library's +// encoding/json package (Go 1.24). +// +// We cannot use strconv.Unquote because JSON string rules differ from Go, +// JSON allows \/ and uses UTF-16 surrogate pairs. +// +// Source: https://cs.opensource.google/go/go/+/refs/tags/go1.24.0:src/encoding/json/decode.go +package stdlib + +import ( + "unicode" + "unicode/utf16" + "unicode/utf8" +) + +// Getu4 is copied from Go stdlib. +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 +} + + +// UnquoteBytes is copied from Go stdlib. +func UnquoteBytes(s []byte) (t []byte, ok bool) { + if len(s) < 2 || s[0] != '"' || s[len(s)-1] != '"' { + return + } + s = s[1 : len(s)-1] + + r := 0 + for r < len(s) { + 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 == len(s) { + return s, true + } + + b := make([]byte, len(s)+2*utf8.UTFMax) + w := copy(b, s[0:r]) + for r < len(s) { + 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 >= len(s) { + 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 { + r += 6 + w += utf8.EncodeRune(b[w:], dec) + break + } + rr = unicode.ReplacementChar + } + w += utf8.EncodeRune(b[w:], rr) + } + + case c == '"', c < ' ': + return + + case c < utf8.RuneSelf: + b[w] = c + r++ + w++ + + default: + rr, size := utf8.DecodeRune(s[r:]) + r += size + w += utf8.EncodeRune(b[w:], rr) + } + } + return b[0:w], true +} diff --git a/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/parser.go b/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/parser.go new file mode 100644 index 00000000000..2a4e9d173ce --- /dev/null +++ b/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/parser.go @@ -0,0 +1,466 @@ +package json + +import ( + "errors" + "fmt" + "io" + "strconv" + "unsafe" + + "github.com/aws/smithy-go/internal/serde" +) + +// matches stdlib +const maxDepth = 10_000 + +const ( + inObject int8 = iota + 1 + inArray +) + +type parseState uint8 + +const ( + stValue parseState = iota + stObjectKey + stObjectColon + stObjectComma + stObjectKeyAfterComma + stArrayValue + stArrayComma +) + +func errUnexpectedToken(c byte) error { + return fmt.Errorf("unexpected token '%c'", c) +} + +// parser is a combined scanner+validator that pulls tokens from a JSON body. +// It integrates tokenization and grammar validation into a single loop to +// minimize function call overhead on the hot path. +type parser struct { + p []byte + i int + stack serde.Stack[int8] + done bool + state parseState + + // set by scanString: true if the last string token contained escapes + escaped bool +} + +func (p *parser) Next() ([]byte, error) { + if p.done { + return nil, io.EOF + } + + for { + // inline whitespace scanning + token identification + i := p.i + buf := p.p + for ; i < len(buf); i++ { + if charClass[buf[i]] != ccWhite { + break + } + } + if i >= len(buf) { + p.i = i + return nil, fmt.Errorf("unexpected end of JSON input") + } + + c := buf[i] + p.i = i + + // get the token + var next []byte + var err error + if charClass[c] == ccDelim { + p.i = i + 1 + next = buf[i : i+1] + } else { + switch c { + case '"': + next, err = p.scanString() + case 't': + next, err = p.scanLiteral("true") + case 'f': + next, err = p.scanLiteral("false") + case 'n': + next, err = p.scanLiteral("null") + default: + next, err = p.scanNumber() + } + if err != nil { + return nil, err + } + } + + // validate grammar + switch p.state { + case stValue: + switch next[0] { + case '{': + p.state = stObjectKey + p.stack.Push(inObject) + if p.stack.Len() > maxDepth { + return nil, errors.New("exceeded max nesting depth") + } + return next, nil + case '[': + p.state = stArrayValue + p.stack.Push(inArray) + if p.stack.Len() > maxDepth { + return nil, errors.New("exceeded max nesting depth") + } + return next, nil + case ',', ':', '}', ']': + return nil, errUnexpectedToken(next[0]) + } + p.afterValue() + return next, nil + + case stObjectKey: + switch next[0] { + case '"': + p.state = stObjectColon + return next, nil + case '}': + p.close() + return next, nil + default: + return nil, errUnexpectedToken(next[0]) + } + + case stObjectColon: + if next[0] != ':' { + return nil, errUnexpectedToken(next[0]) + } + p.state = stValue + continue + + case stObjectComma: + switch next[0] { + case ',': + p.state = stObjectKeyAfterComma + continue + case '}': + p.close() + return next, nil + default: + return nil, errUnexpectedToken(next[0]) + } + + case stObjectKeyAfterComma: + if next[0] != '"' { + return nil, errUnexpectedToken(next[0]) + } + p.state = stObjectColon + return next, nil + + case stArrayValue: + if next[0] == ']' { + p.close() + return next, nil + } + // handle as value + switch next[0] { + case '{': + p.state = stObjectKey + p.stack.Push(inObject) + if p.stack.Len() > maxDepth { + return nil, errors.New("exceeded max nesting depth") + } + return next, nil + case '[': + p.state = stArrayValue + p.stack.Push(inArray) + if p.stack.Len() > maxDepth { + return nil, errors.New("exceeded max nesting depth") + } + return next, nil + case ',', ':', '}': + return nil, errUnexpectedToken(next[0]) + } + p.afterValue() + return next, nil + + case stArrayComma: + switch next[0] { + case ',': + p.state = stValue + continue + case ']': + p.close() + return next, nil + default: + return nil, errUnexpectedToken(next[0]) + } + } + } +} + +func (p *parser) Skip() error { + var depth int + for { + tok, err := p.Next() + if err != nil { + return err + } + switch tok[0] { + case '{', '[': + depth++ + case '}', ']': + depth-- + } + if depth == 0 { + return nil + } + } +} + +func (p *parser) Value() (any, error) { + tok, err := p.Next() + if err != nil { + return nil, err + } + return p.value(tok) +} + +func (p *parser) value(tok []byte) (any, error) { + switch tok[0] { + case 'n': + return nil, nil + case 't': + return true, nil + case 'f': + return false, nil + case '"': + return unquote(tok) + case '{': + m := map[string]any{} + for { + ktok, err := p.Next() + if err != nil { + return nil, err + } + if ktok[0] == '}' { + return m, nil + } + key, err := unquote(ktok) + if err != nil { + return nil, err + } + val, err := p.Value() + if err != nil { + return nil, err + } + m[key] = val + } + case '[': + var list []any + for { + tok, err := p.Next() + if err != nil { + return nil, err + } + if tok[0] == ']' { + if list == nil { + list = []any{} + } + return list, nil + } + val, err := p.value(tok) + if err != nil { + return nil, err + } + list = append(list, val) + } + default: + return strconv.ParseFloat(string(tok), 64) + } +} + +func (p *parser) close() { + p.stack.Pop() + p.afterValue() +} + +func (p *parser) afterValue() { + top := p.stack.Top() + if top == nil { + p.done = true + return + } + + switch *top { + case inObject: + p.state = stObjectComma + case inArray: + p.state = stArrayComma + default: + p.done = true + } +} + +// --- Integrated scanner methods --- + +const ( + lo = uint64(0x0101010101010101) + hi = uint64(0x8080808080808080) +) + +func hasValue(v uint64, c byte) uint64 { + x := v ^ (lo * uint64(c)) + return (x - lo) & ^x & hi +} + +func hasLess(v uint64, n byte) uint64 { + return (v - lo*uint64(n)) & ^v & hi +} + +func (p *parser) scanString() ([]byte, error) { + start := p.i + i := p.i + 1 // skip opening " + p.escaped = false + + // SWAR: scan 8 bytes at a time for '"', '\', or control chars (< 0x20) + for i+8 <= len(p.p) { + v := *(*uint64)(unsafe.Pointer(&p.p[i])) + mask := hasLess(v, 0x20) | hasValue(v, '"') | hasValue(v, '\\') + if mask != 0 { + break + } + i += 8 + } + + for i < len(p.p) { + c := p.p[i] + if c < 0x20 { + p.i = i + return nil, fmt.Errorf("invalid control character at offset %d", i) + } + + if c == '\\' { + p.escaped = true + p.i = i + 1 + if err := p.scanEscape(); err != nil { + return nil, err + } + i = p.i + continue + } + + if c == '"' { + i++ + p.i = i + return p.p[start:i], nil + } + + i++ + } + p.i = i + return nil, fmt.Errorf("unterminated string at offset %d", start) +} + +func (p *parser) scanEscape() error { + if p.i >= len(p.p) { + return fmt.Errorf("unterminated escape at offset %d", p.i-1) + } + c := p.p[p.i] + p.i++ + switch c { + case '"', '\\', '/', 'b', 'f', 'n', 'r', 't': + return nil + case 'u': + return p.scanUnicodeEscape() + default: + return fmt.Errorf("invalid escape character '%c' at offset %d", c, p.i-1) + } +} + +func (p *parser) scanUnicodeEscape() error { + if p.i+4 > len(p.p) { + return fmt.Errorf("incomplete unicode escape at offset %d", p.i-2) + } + for _, c := range p.p[p.i : p.i+4] { + if !('0' <= c && c <= '9' || 'a' <= c && c <= 'f' || 'A' <= c && c <= 'F') { + return fmt.Errorf("invalid character '%c' in unicode escape at offset %d", c, p.i-2) + } + } + p.i += 4 + return nil +} + +func (p *parser) scanNumber() ([]byte, error) { + i := p.i + if i < len(p.p) && p.p[i] == '-' { + i++ + } + digitStart := i + for i < len(p.p) && p.p[i] >= '0' && p.p[i] <= '9' { + i++ + } + if i == digitStart { + return nil, fmt.Errorf("unexpected token at offset %d", p.i) + } + if p.p[digitStart] == '0' && i-digitStart > 1 { + return nil, fmt.Errorf("leading zeros not allowed at offset %d", digitStart) + } + + if i < len(p.p) && p.p[i] == '.' { + i++ + digitStart = i + for i < len(p.p) && p.p[i] >= '0' && p.p[i] <= '9' { + i++ + } + if i == digitStart { + return nil, fmt.Errorf("no digits after decimal point at offset %d", i) + } + } + + if i < len(p.p) && (p.p[i] == 'e' || p.p[i] == 'E') { + i++ + if i < len(p.p) && (p.p[i] == '+' || p.p[i] == '-') { + i++ + } + digitStart = i + for i < len(p.p) && p.p[i] >= '0' && p.p[i] <= '9' { + i++ + } + if i == digitStart { + return nil, fmt.Errorf("no digits after exponent at offset %d", i) + } + } + + start := p.i + p.i = i + return p.p[start:i], nil +} + +func (p *parser) scanLiteral(lit string) ([]byte, error) { + end := p.i + len(lit) + if end > len(p.p) || string(p.p[p.i:end]) != lit { + return nil, fmt.Errorf("invalid literal at offset %d", p.i) + } + start := p.i + p.i = end + return p.p[start:end], nil +} + +const ( + ccNone byte = 0 + ccWhite byte = 1 + ccDelim byte = 2 +) + +var charClass = [256]byte{ + ' ': ccWhite, + '\t': ccWhite, + '\n': ccWhite, + '\r': ccWhite, + '{': ccDelim, + '}': ccDelim, + '[': ccDelim, + ']': ccDelim, + ':': ccDelim, + ',': ccDelim, +} diff --git a/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/scanner.go b/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/scanner.go new file mode 100644 index 00000000000..a5b981cc690 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/scanner.go @@ -0,0 +1 @@ +package json diff --git a/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/shape_deserializer.go b/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/shape_deserializer.go new file mode 100644 index 00000000000..40c277f45ec --- /dev/null +++ b/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/shape_deserializer.go @@ -0,0 +1,881 @@ +package json + +import ( + "encoding/base64" + "fmt" + "math" + "math/big" + "strconv" + "strings" + "sync" + "time" + + "github.com/aws/smithy-go" + "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/internal/serde" + smithytime "github.com/aws/smithy-go/time" + "github.com/aws/smithy-go/traits" + "github.com/aws/smithy-go/transport/http/protocol/internal/json/internal/stdlib" +) + +type ctxKind int8 + +const ( + ctxList ctxKind = iota + 1 + ctxMap + ctxStruct + ctxUnion +) + +type deserCtx struct { + kind ctxKind + schema *smithy.Schema // for ctxStruct +} + +// ShapeDeserializer implements unmarshaling of JSON into Smithy shapes. +type ShapeDeserializer struct { + p parser + head serde.Stack[deserCtx] + opts Options + + peeked []byte + peekedEscaped bool + + arena serde.StringArena +} + +var deserPool = sync.Pool{ + New: func() any { + return &ShapeDeserializer{ + p: parser{stack: serde.NewStack[int8]()}, + head: serde.NewStack[deserCtx](), + } + }, +} + +// NewShapeDeserializer creates a new ShapeDeserializer. +func NewShapeDeserializer(p []byte, opts ...func(*Options)) *ShapeDeserializer { + o := Options{} + for _, fn := range opts { + fn(&o) + } + d := deserPool.Get().(*ShapeDeserializer) + d.p.p = p + d.p.i = 0 + d.p.state = stValue + d.p.done = false + d.p.stack.Reset() + d.head.Reset() + d.peeked = nil + d.opts = o + d.arena.Reset(len(p) / serde.ArenaPayloadFactor) + return d +} + +// Close returns the deserializer to the pool for reuse. +func (d *ShapeDeserializer) Close() { + deserPool.Put(d) +} + +var _ smithy.ShapeDeserializer = (*ShapeDeserializer)(nil) + +func (d *ShapeDeserializer) next() ([]byte, error) { + if d.peeked != nil { + peeked := d.peeked + d.peeked = nil + d.p.escaped = d.peekedEscaped + return peeked, nil + } + return d.p.Next() +} + +func (d *ShapeDeserializer) peek() ([]byte, error) { + if d.peeked != nil { + return d.peeked, nil + } + tok, err := d.p.Next() + if err != nil { + return nil, err + } + d.peeked = tok + d.peekedEscaped = d.p.escaped + return tok, nil +} + +// ReadNil implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadNil(s *smithy.Schema) (bool, error) { + tok, err := d.peek() + if err != nil { + return false, err + } + if isN(tok) { + d.peeked = nil + return true, nil + } + return false, nil +} + +// ReadInt8 implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadInt8(s *smithy.Schema, v *int8) error { + n, err := d.readInt(math.MinInt8, math.MaxInt8) + *v = int8(n) + return err +} + +// ReadInt16 implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadInt16(s *smithy.Schema, v *int16) error { + n, err := d.readInt(math.MinInt16, math.MaxInt16) + *v = int16(n) + return err +} + +// ReadInt32 implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadInt32(s *smithy.Schema, v *int32) error { + n, err := d.readInt(math.MinInt32, math.MaxInt32) + *v = int32(n) + return err +} + +// ReadInt64 implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadInt64(s *smithy.Schema, v *int64) error { + n, err := d.readInt(math.MinInt64, math.MaxInt64) + *v = n + return err +} + +func (d *ShapeDeserializer) readInt(min, max int64) (int64, error) { + tok, err := d.next() + if err != nil { + return 0, err + } + + if isS(tok) || isLCB(tok) || isLSB(tok) { + return 0, fmt.Errorf("expected number, got %s", tok) + } + + n, ok := parseInt(tok) + if !ok { + return 0, fmt.Errorf("invalid int: %s", tok) + } + + if n < min || n > max { + return 0, fmt.Errorf("int %d exceeds range [%d, %d]", n, min, max) + } + + return n, nil +} + +// parseInt parses a decimal int directly from bytes, avoiding string alloc. +func parseInt(b []byte) (int64, bool) { + if len(b) == 0 { + return 0, false + } + neg := false + if b[0] == '-' { + neg = true + b = b[1:] + if len(b) == 0 { + return 0, false + } + } + + const cutoff = math.MaxUint64/10 + 1 + var n uint64 + for _, c := range b { + if c < '0' || c > '9' { + return 0, false + } + if n >= cutoff { + return 0, false + } + nn := n*10 + uint64(c-'0') + if nn < n { + return 0, false + } + n = nn + if n > uint64(math.MaxInt64) { + if neg && n == uint64(math.MaxInt64)+1 { + return math.MinInt64, true + } + return 0, false + } + } + + if neg { + return -int64(n), true + } + return int64(n), true +} + +// ReadFloat32 implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadFloat32(s *smithy.Schema, v *float32) error { + n, err := d.readFloat() + *v = float32(n) + return err +} + +// ReadFloat64 implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadFloat64(s *smithy.Schema, v *float64) error { + n, err := d.readFloat() + *v = n + return err +} + +func (d *ShapeDeserializer) readFloat() (float64, error) { + tok, err := d.next() + if err != nil { + return 0, err + } + + if isS(tok) { + s, err := unquote(tok) + if err != nil { + return 0, err + } + switch { + case strings.EqualFold(s, "NaN"): + return math.NaN(), nil + case strings.EqualFold(s, "Infinity"): + return math.Inf(1), nil + case strings.EqualFold(s, "-Infinity"): + return math.Inf(-1), nil + default: + return 0, fmt.Errorf("unexpected string value for float: %s", s) + } + } + + // fast path: if it's a plain integer, parse directly without alloc + if n, ok := parseInt(tok); ok { + return float64(n), nil + } + return strconv.ParseFloat(string(tok), 64) +} + +// ReadBool implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadBool(s *smithy.Schema, v *bool) error { + tok, err := d.next() + if err != nil { + return err + } + + switch { + case isT(tok): + *v = true + return nil + case isF(tok): + *v = false + return nil + default: + return fmt.Errorf("expected bool, got %s", tok) + } +} + +// ReadString implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadString(s *smithy.Schema, v *string) error { + tok, err := d.next() + if err != nil { + return err + } + if tok == nil { + return nil + } + + if !isS(tok) { + return fmt.Errorf("expected string, got %s", tok) + } + + if !d.p.escaped { + *v = d.arena.String(tok[1 : len(tok)-1]) + return nil + } + + sv, err := d.unquoteArena(tok) + if err != nil { + return err + } + + *v = sv + return nil +} + +// ReadTime implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadTime(schema *smithy.Schema, v *time.Time) error { + format := "epoch-seconds" + if t, ok := smithy.SchemaTrait[*traits.TimestampFormat](schema); ok { + format = t.Format + } + + switch format { + case "epoch-seconds": + n, err := d.readFloat() + if err != nil { + return err + } + *v = smithytime.ParseEpochSeconds(n) + return nil + case "date-time": + var s string + if err := d.ReadString(schema, &s); err != nil { + return err + } + t, err := smithytime.ParseDateTime(s) + if err != nil { + return err + } + *v = t + return nil + case "http-date": + var s string + if err := d.ReadString(schema, &s); err != nil { + return err + } + t, err := smithytime.ParseHTTPDate(s) + if err != nil { + return err + } + *v = t + return nil + default: + return fmt.Errorf("unknown timestamp format: %s", format) + } +} + +// ReadBlob implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadBlob(s *smithy.Schema, v *[]byte) error { + if isNil, err := d.ReadNil(s); isNil || err != nil { + return err + } + + tok, err := d.next() + if err != nil { + return err + } + + if !isS(tok) { + return fmt.Errorf("expected string, got %s", tok) + } + + sv, err := unquote(tok) + if err != nil { + return err + } + + b, err := base64.StdEncoding.DecodeString(sv) + if err != nil { + return fmt.Errorf("decode base64 blob: %w", err) + } + + *v = b + return nil +} + +// ReadList implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadList(s *smithy.Schema) error { + tok, err := d.next() + if err != nil { + return err + } + if !isLSB(tok) { + return fmt.Errorf("expected '[', got %s", tok) + } + d.head.Push(deserCtx{kind: ctxList}) + return nil +} + +// ReadListItem implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadListItem(s *smithy.Schema) (bool, error) { + tok, err := d.peek() + if err != nil { + return false, err + } + if isRSB(tok) { + d.peeked = nil + d.head.Pop() + return false, nil + } + return true, nil +} + +// ReadMap implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadMap(s *smithy.Schema) error { + tok, err := d.next() + if err != nil { + return err + } + if !isLCB(tok) { + return fmt.Errorf("expected '{', got %s", tok) + } + d.head.Push(deserCtx{kind: ctxMap}) + return nil +} + +// ReadMapKey implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadMapKey(s *smithy.Schema) (string, bool, error) { + tok, err := d.next() + if err != nil { + return "", false, err + } + if isRCB(tok) { + d.head.Pop() + return "", false, nil + } + + if !d.p.escaped { + return d.arena.String(tok[1 : len(tok)-1]), true, nil + } + + key, err := d.unquoteArena(tok) + if err != nil { + return "", false, err + } + return key, true, nil +} + +// ReadStruct implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadStruct(s *smithy.Schema) error { + if isNil, err := d.ReadNil(s); isNil || err != nil { + return err + } + + tok, err := d.next() + if err != nil { + return err + } + if !isLCB(tok) { + return fmt.Errorf("expected '{', got %s", tok) + } + d.head.Push(deserCtx{kind: ctxStruct, schema: s}) + return nil +} + +// ReadStructMember implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadStructMember() (*smithy.Schema, error) { + tok, err := d.next() + if err != nil { + return nil, err + } + if isRCB(tok) { + d.head.Pop() + return nil, nil + } + + top := d.head.Top() + if top == nil || top.kind != ctxStruct { + return nil, fmt.Errorf("ReadStructMember called without ReadStruct?") + } + + member, err := memberFromToken(top.schema, tok, d.p.escaped) + if err != nil { + return nil, err + } + + if member == nil && d.opts.UseJSONName { + key, err := unquote(tok) + if err != nil { + return nil, err + } + for _, m := range top.schema.Members() { + if jn, ok := smithy.SchemaTrait[*traits.JSONName](m); ok && jn.Name == key { + member = m + break + } + } + } + if member == nil { + if err := d.p.Skip(); err != nil { + return nil, err + } + return d.ReadStructMember() + } + + // inline null check to avoid function call overhead of ReadNil + ptok, err := d.peek() + if err != nil { + return nil, err + } + if isN(ptok) { + d.peeked = nil + return d.ReadStructMember() + } + + return member, nil +} + +// ReadUnion implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadUnion(s *smithy.Schema) (*smithy.Schema, error) { + if top := d.head.Top(); top == nil || top.kind != ctxUnion || top.schema != s { + if isNil, err := d.ReadNil(s); isNil || err != nil { + return nil, err + } + + tok, err := d.next() + if err != nil { + return nil, err + } + if !isLCB(tok) { + return nil, fmt.Errorf("expected '{', got %s", tok) + } + d.head.Push(deserCtx{kind: ctxUnion, schema: s}) + } + + for { + tok, err := d.next() + if err != nil { + return nil, err + } + if isRCB(tok) { + d.head.Pop() + return nil, nil + } + + // save escaped before peek overwrites it + keyEscaped := d.p.escaped + + // inline null check + ptok, err := d.peek() + if err != nil { + return nil, err + } + if isN(ptok) { + d.peeked = nil + continue + } + + member, err := memberFromToken(s, tok, keyEscaped) + if err != nil { + return nil, err + } + + if member == nil && d.opts.UseJSONName { + key, err := unquote(tok) + if err != nil { + return nil, err + } + for _, m := range s.Members() { + if jn, ok := smithy.SchemaTrait[*traits.JSONName](m); ok && jn.Name == key { + member = m + break + } + } + } + if member == nil { + if err := d.p.Skip(); err != nil { + return nil, err + } + continue + } + + return member, nil + } +} + +// ReadDocument reads a JSON value into a document Value. +func (d *ShapeDeserializer) ReadDocument(schema *smithy.Schema, v *document.Value) error { + tok, err := d.next() + if err != nil { + return err + } + vv, err := d.p.value(tok) + if err != nil { + return err + } + *v = document.Opaque{Value: vv} + return nil +} + +func unquote(tok []byte) (string, error) { + if s, ok := stdlib.UnquoteBytes(tok); ok { + return string(s), nil + } + return "", fmt.Errorf("cannot unquote %s", tok) +} + +func (d *ShapeDeserializer) unquoteArena(tok []byte) (string, error) { + if s, ok := stdlib.UnquoteBytes(tok); ok { + return d.arena.String(s), nil + } + return "", fmt.Errorf("cannot unquote %s", tok) +} + +func memberFromToken(s *smithy.Schema, tok []byte, escaped bool) (*smithy.Schema, error) { + inner := tok[1 : len(tok)-1] + if m := memberByBytes(s, inner); m != nil { + return m, nil + } + + // if the string had no escapes, the raw bytes ARE the unquoted form -- + // no point re-trying the lookup + if !escaped { + return errorMessageMember(s, inner), nil + } + + unq, err := unquote(tok) + if err != nil { + return nil, err + } + + if m := s.Member(unq); m != nil { + return m, nil + } + return errorMessageMember(s, []byte(unq)), nil +} + +// Services do not consistently use the casing that is modeled for the message +// part of errors, handle that here. +func errorMessageMember(s *smithy.Schema, name []byte) *smithy.Schema { + var alt string + switch string(name) { + case "message": + alt = "Message" + case "Message": + alt = "message" + default: + return nil + } + + if _, ok := smithy.SchemaTrait[*traits.Error](s); !ok { + return nil + } + return s.Members()[alt] +} + +func isN(tok []byte) bool { return tok[0] == 'n' } +func isT(tok []byte) bool { return tok[0] == 't' } +func isF(tok []byte) bool { return tok[0] == 'f' } +func isS(tok []byte) bool { return tok[0] == '"' } +func isLCB(tok []byte) bool { return tok[0] == '{' } +func isRCB(tok []byte) bool { return tok[0] == '}' } +func isLSB(tok []byte) bool { return tok[0] == '[' } +func isRSB(tok []byte) bool { return tok[0] == ']' } + +// ReadBigInt is unimplemented and will return an error. +func (d *ShapeDeserializer) ReadBigInt(_ *smithy.Schema, _ *big.Int) error { + return fmt.Errorf("unimplemented") +} + +// ReadBigFloat is unimplemented and will return an error. +func (d *ShapeDeserializer) ReadBigFloat(_ *smithy.Schema, _ *big.Float) error { + return fmt.Errorf("unimplemented") +} + +// DirectReadStruct is a concrete-type fast path that avoids interface dispatch. +// It skips the head stack and reads struct members directly. +func (d *ShapeDeserializer) DirectReadStruct(schema *smithy.Schema, memberFn func(*smithy.Schema) error) error { + // null check + tok, err := d.peek() + if err != nil { + return err + } + if isN(tok) { + d.peeked = nil + return nil + } + + // consume '{' + tok, err = d.next() + if err != nil { + return err + } + if !isLCB(tok) { + return fmt.Errorf("expected '{', got %s", tok) + } + + for { + tok, err = d.next() + if err != nil { + return err + } + if isRCB(tok) { + return nil + } + + keyEscaped := d.p.escaped + + member, err := memberFromToken(schema, tok, keyEscaped) + if err != nil { + return err + } + + if member == nil && d.opts.UseJSONName { + key, qerr := unquote(tok) + if qerr != nil { + return qerr + } + for _, m := range schema.Members() { + if jn, ok := smithy.SchemaTrait[*traits.JSONName](m); ok && jn.Name == key { + member = m + break + } + } + } + if member == nil { + if err := d.p.Skip(); err != nil { + return err + } + continue + } + + // inline null check for the value + ptok, err := d.peek() + if err != nil { + return err + } + if isN(ptok) { + d.peeked = nil + continue + } + + if err := memberFn(member); err != nil { + return err + } + } +} + +// DirectReadUnion is a concrete-type fast path that avoids interface dispatch. +// It opens the union object, finds the single non-null member, calls memberFn, +// then drains to the closing brace. +func (d *ShapeDeserializer) DirectReadUnion(schema *smithy.Schema, memberFn func(*smithy.Schema) error) error { + // open phase: consume '{' (or 'null') + tok, err := d.next() + if err != nil { + return err + } + if isN(tok) { + return nil + } + if !isLCB(tok) { + return fmt.Errorf("expected '{', got %s", tok) + } + + // find the single non-null member + var member *smithy.Schema + for { + tok, err = d.next() + if err != nil { + return err + } + if isRCB(tok) { + return nil + } + + keyEscaped := d.p.escaped + + ptok, err := d.peek() + if err != nil { + return err + } + if isN(ptok) { + d.peeked = nil + continue + } + + member, err = memberFromToken(schema, tok, keyEscaped) + if err != nil { + return err + } + + if member == nil && d.opts.UseJSONName { + key, err := unquote(tok) + if err != nil { + return err + } + for _, m := range schema.Members() { + if jn, ok := smithy.SchemaTrait[*traits.JSONName](m); ok && jn.Name == key { + member = m + break + } + } + } + if member == nil { + if err := d.p.Skip(); err != nil { + return err + } + continue + } + + break + } + + // call the member function + if err := memberFn(member); err != nil { + return err + } + + // drain remaining members to closing '}' + for { + tok, err = d.next() + if err != nil { + return err + } + if isRCB(tok) { + return nil + } + + // skip any extra keys (lenient: tolerate services sending extra fields) + if err := d.p.Skip(); err != nil { + return err + } + } +} + +// DirectReadMap is a concrete-type fast path that avoids interface dispatch. +// It skips the head stack and reads map entries directly. +func (d *ShapeDeserializer) DirectReadMap(schema *smithy.Schema, memberFn func(string) error) error { + tok, err := d.next() + if err != nil { + return err + } + if !isLCB(tok) { + return fmt.Errorf("expected '{', got %s", tok) + } + + for { + tok, err = d.next() + if err != nil { + return err + } + if isRCB(tok) { + return nil + } + + var key string + if !d.p.escaped { + key = d.arena.String(tok[1 : len(tok)-1]) + } else { + key, err = d.unquoteArena(tok) + if err != nil { + return err + } + } + + if err := memberFn(key); err != nil { + return err + } + } +} + +// DirectReadList is a concrete-type fast path that avoids interface dispatch. +// It skips the head stack and reads list elements directly using peek. +func (d *ShapeDeserializer) DirectReadList(schema *smithy.Schema, memberFn func() error) error { + tok, err := d.next() + if err != nil { + return err + } + if !isLSB(tok) { + return fmt.Errorf("expected '[', got %s", tok) + } + + for { + tok, err = d.peek() + if err != nil { + return err + } + if isRSB(tok) { + d.peeked = nil + return nil + } + if err := memberFn(); err != nil { + return err + } + } +} diff --git a/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/shape_serializer.go b/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/shape_serializer.go new file mode 100644 index 00000000000..b421a8326cb --- /dev/null +++ b/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/shape_serializer.go @@ -0,0 +1,562 @@ +package json + +import ( + "encoding/base64" + "math" + "math/big" + "strconv" + "sync" + "time" + "unicode/utf8" + "unsafe" + + "github.com/aws/smithy-go" + "github.com/aws/smithy-go/document" + smithydocumentjson "github.com/aws/smithy-go/document/json" + "github.com/aws/smithy-go/encoding" + smithytime "github.com/aws/smithy-go/time" + "github.com/aws/smithy-go/traits" +) + +// Options configures JSON shape serialization and deserialization. +type Options struct { + // Controls whether the @jsonName trait is used to determine JSON object + // keys. If false (the default), the member name is used as-is. + UseJSONName bool +} + +type serCtx struct { + comma bool + inObject bool +} + +// ShapeSerializer implements marshaling of Smithy shapes to JSON. +// It writes directly to a []byte buffer without intermediate allocations. +type ShapeSerializer struct { + buf []byte + opts Options + stack []serCtx + depth int + noKey bool + initStack [64]serCtx +} + +const ( + defaultBufSize = 1024 + maxCacheableBuf = defaultBufSize * 4 +) + +var serPool = sync.Pool{ + New: func() any { + s := &ShapeSerializer{ + buf: make([]byte, 0, defaultBufSize), + } + s.stack = s.initStack[:1] + return s + }, +} + +var _ smithy.ShapeSerializer = (*ShapeSerializer)(nil) + +// NewShapeSerializer creates a new ShapeSerializer. +func NewShapeSerializer(opts ...func(*Options)) *ShapeSerializer { + o := Options{} + for _, fn := range opts { + fn(&o) + } + s := serPool.Get().(*ShapeSerializer) + s.buf = s.buf[:0] + s.opts = o + s.depth = 0 + s.noKey = false + s.stack = s.initStack[:1] + s.stack[0] = serCtx{} + return s +} + +// Close returns the serializer to the pool for reuse. +func (s *ShapeSerializer) Close() { + if cap(s.buf) > maxCacheableBuf { + s.buf = make([]byte, 0, defaultBufSize) + } + serPool.Put(s) +} + +// Bytes returns a copy of the serialized JSON bytes, safe to retain after Close(). +func (s *ShapeSerializer) Bytes() []byte { + return append([]byte(nil), s.buf...) +} + +func (s *ShapeSerializer) writeComma() { + if s.depth > 0 && s.stack[s.depth].comma { + s.buf = append(s.buf, ',') + } + s.stack[s.depth].comma = true +} + +// writePrefix handles the key-or-comma logic before a value, respecting noKey. +func (s *ShapeSerializer) writePrefix(schema *smithy.Schema) { + if s.noKey { + s.noKey = false + return + } + if schema != nil && s.depth > 0 && s.stack[s.depth].inObject { + s.writeKey(schema) + } else { + s.writeComma() + } +} + +func (s *ShapeSerializer) writeKey(schema *smithy.Schema) { + ext := getExt(schema) + if s.opts.UseJSONName { + if jk := ext.jsonNameKey; jk != nil { + if s.stack[s.depth].comma { + s.buf = append(s.buf, jk...) + } else { + s.stack[s.depth].comma = true + s.buf = append(s.buf, jk[1:]...) + } + return + } + } + jk := ext.jsonKey + if len(jk) == 0 { + s.writeComma() + return + } + if s.stack[s.depth].comma { + s.buf = append(s.buf, jk...) + } else { + s.stack[s.depth].comma = true + s.buf = append(s.buf, jk[1:]...) + } +} + +// WriteBool implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteBool(schema *smithy.Schema, v bool) { + s.writePrefix(schema) + if v { + s.buf = append(s.buf, "true"...) + } else { + s.buf = append(s.buf, "false"...) + } +} + +// WriteInt8 implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteInt8(schema *smithy.Schema, v int8) { + s.WriteInt64(schema, int64(v)) +} + +// WriteInt16 implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteInt16(schema *smithy.Schema, v int16) { + s.WriteInt64(schema, int64(v)) +} + +// WriteInt32 implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteInt32(schema *smithy.Schema, v int32) { + s.WriteInt64(schema, int64(v)) +} + +// WriteInt64 implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteInt64(schema *smithy.Schema, v int64) { + s.writePrefix(schema) + s.buf = strconv.AppendInt(s.buf, v, 10) +} + +// WriteFloat32 implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteFloat32(schema *smithy.Schema, v float32) { + s.writePrefix(schema) + if math.IsInf(float64(v), 1) { + s.buf = append(s.buf, `"Infinity"`...) + } else if math.IsInf(float64(v), -1) { + s.buf = append(s.buf, `"-Infinity"`...) + } else if math.IsNaN(float64(v)) { + s.buf = append(s.buf, `"NaN"`...) + } else { + s.buf = encoding.EncodeFloat(s.buf, float64(v), 32) + } +} + +// WriteFloat64 implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteFloat64(schema *smithy.Schema, v float64) { + s.writePrefix(schema) + if math.IsInf(v, 1) { + s.buf = append(s.buf, `"Infinity"`...) + } else if math.IsInf(v, -1) { + s.buf = append(s.buf, `"-Infinity"`...) + } else if math.IsNaN(v) { + s.buf = append(s.buf, `"NaN"`...) + } else { + s.buf = encoding.EncodeFloat(s.buf, v, 64) + } +} + +// WriteString implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteString(schema *smithy.Schema, v string) { + s.writePrefix(schema) + s.appendEscapedString(v) +} + +// WriteBlob implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteBlob(schema *smithy.Schema, v []byte) { + s.writePrefix(schema) + if v == nil { + s.buf = append(s.buf, "null"...) + return + } + s.buf = append(s.buf, '"') + encodedLen := base64.StdEncoding.EncodedLen(len(v)) + start := len(s.buf) + s.buf = append(s.buf, make([]byte, encodedLen)...) + base64.StdEncoding.Encode(s.buf[start:], v) + s.buf = append(s.buf, '"') +} + +// WriteList implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteList(schema *smithy.Schema) { + s.writePrefix(schema) + s.buf = append(s.buf, '[') + s.depth++; s.stack = append(s.stack, serCtx{}) +} + +// CloseList implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) CloseList() { + s.buf = append(s.buf, ']') + s.stack = s.stack[:s.depth]; s.depth-- +} + +// WriteMap implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteMap(schema *smithy.Schema) { + s.writePrefix(schema) + s.buf = append(s.buf, '{') + s.depth++; s.stack = append(s.stack, serCtx{inObject: true}) +} + +// WriteKey implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteKey(_ *smithy.Schema, key string) { + s.writeComma() + s.appendEscapedString(key) + s.buf = append(s.buf, ':') + s.noKey = true +} + +// CloseMap implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) CloseMap() { + s.buf = append(s.buf, '}') + s.stack = s.stack[:s.depth]; s.depth-- +} + +// WriteTime implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteTime(schema *smithy.Schema, v time.Time) { + format := "epoch-seconds" + if t, ok := smithy.SchemaTrait[*traits.TimestampFormat](schema); ok { + format = t.Format + } + + switch format { + case "date-time": + s.WriteString(schema, smithytime.FormatDateTime(v)) + case "http-date": + s.WriteString(schema, smithytime.FormatHTTPDate(v)) + default: + s.WriteFloat64(schema, smithytime.FormatEpochSeconds(v)) + } +} + +// WriteUnion implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteUnion(schema, variant *smithy.Schema) { + s.writePrefix(schema) + s.buf = append(s.buf, '{') + s.depth++; s.stack = append(s.stack, serCtx{inObject: true}) + s.writeKey(variant) + s.noKey = true +} + +// CloseUnion implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) CloseUnion() { + s.noKey = false + s.buf = append(s.buf, '}') + s.stack = s.stack[:s.depth]; s.depth-- +} + +// WriteStruct implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteStruct(schema *smithy.Schema) { + s.writePrefix(schema) + s.buf = append(s.buf, '{') + s.depth++; s.stack = append(s.stack, serCtx{inObject: true}) +} + +// CloseStruct implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) CloseStruct() { + s.buf = append(s.buf, '}') + s.stack = s.stack[:s.depth]; s.depth-- +} + +// WriteNil implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteNil(schema *smithy.Schema) { + s.writePrefix(schema) + s.buf = append(s.buf, "null"...) +} + +// WriteBigInt is unimplemented and will panic. +func (s *ShapeSerializer) WriteBigInt(_ *smithy.Schema, _ *big.Int) { + panic("unimplemented") +} + +// WriteBigFloat is unimplemented and will panic. +func (s *ShapeSerializer) WriteBigFloat(_ *smithy.Schema, _ *big.Float) { + panic("unimplemented") +} + +// WriteDocument writes a document value to JSON. +func (s *ShapeSerializer) WriteDocument(schema *smithy.Schema, v document.Value) { + switch vv := v.(type) { + case document.Null: + s.WriteNil(schema) + case document.Boolean: + s.WriteBool(schema, bool(vv)) + case document.Number: + s.writeRaw(schema, []byte(vv)) + case document.String: + s.WriteString(schema, string(vv)) + case document.Blob: + s.WriteBlob(schema, []byte(vv)) + case document.Timestamp: + s.WriteTime(schema, time.Time(vv)) + case document.List: + s.WriteList(schema) + for _, item := range vv { + s.WriteDocument(schema.ListMember(), item) + } + s.CloseList() + case document.Map: + s.WriteMap(schema) + for k, item := range vv { + s.WriteKey(schema.MapKey(), k) + s.WriteDocument(schema.MapValue(), item) + } + s.CloseMap() + case document.Structure: + s.WriteMap(schema) + for k, item := range vv.Members { + s.WriteKey(nil, k) + s.WriteDocument(nil, item) + } + s.CloseMap() + case document.Opaque: + s.writeOpaqueDocument(schema, vv.Value) + case *document.Opaque: + s.writeOpaqueDocument(schema, vv.Value) + } +} + +func (s *ShapeSerializer) writeOpaqueDocument(schema *smithy.Schema, v any) { + if m, ok := v.(document.Marshaler); ok { + p, _ := m.MarshalSmithyDocument() + s.writeRaw(schema, p) + return + } + denc := smithydocumentjson.NewEncoder() + p, _ := denc.Encode(v) + s.writeRaw(schema, p) +} + +func (s *ShapeSerializer) writeRaw(schema *smithy.Schema, p []byte) { + s.writePrefix(schema) + s.buf = append(s.buf, p...) +} + +// jsonMemberName returns the JSON key for a schema member. +func (s *ShapeSerializer) jsonMemberName(schema *smithy.Schema) string { + if s.opts.UseJSONName { + if jn, ok := smithy.SchemaTrait[*traits.JSONName](schema); ok { + return jn.Name + } + } + return schema.MemberName() +} + +// appendEscapedString writes a JSON-escaped string to the buffer. +func (s *ShapeSerializer) appendEscapedString(v string) { + s.buf = append(s.buf, '"') + + // fast path: SWAR check if entire string is safe ASCII + i := 0 + p := unsafe.StringData(v) + for i+8 <= len(v) { + w := *(*uint64)(unsafe.Pointer(uintptr(unsafe.Pointer(p)) + uintptr(i))) + // high bit set means >= 0x80, hasLess detects control chars, + // hasValue detects '"', '\\', and DEL (0x7F) + if w&hi|hasLess(w, 0x20)|hasValue(w, '"')|hasValue(w, '\\')|hasValue(w, 0x7F) != 0 { + break + } + i += 8 + } + for ; i < len(v); i++ { + if v[i] >= utf8.RuneSelf || !safeSet[v[i]] { + break + } + } + if i == len(v) { + s.buf = append(s.buf, v...) + s.buf = append(s.buf, '"') + return + } + + // write the safe prefix we already validated, escape from i onward + s.buf = append(s.buf, v[:i]...) + start := i + for i < len(v) { + b := v[i] + if b < utf8.RuneSelf { + if safeSet[b] { + i++ + continue + } + if start < i { + s.buf = append(s.buf, v[start:i]...) + } + switch b { + case '\\', '"': + s.buf = append(s.buf, '\\', b) + case '\n': + s.buf = append(s.buf, '\\', 'n') + case '\r': + s.buf = append(s.buf, '\\', 'r') + case '\t': + s.buf = append(s.buf, '\\', 't') + default: + s.buf = append(s.buf, '\\', 'u', '0', '0', hex[b>>4], hex[b&0xF]) + } + i++ + start = i + continue + } + c, size := utf8.DecodeRuneInString(v[i:]) + if c == utf8.RuneError && size == 1 { + if start < i { + s.buf = append(s.buf, v[start:i]...) + } + s.buf = append(s.buf, `�`...) + i += size + start = i + continue + } + if c == '\u2028' || c == '\u2029' { + if start < i { + s.buf = append(s.buf, v[start:i]...) + } + s.buf = append(s.buf, '\\', 'u', '2', '0', '2', hex[c&0xF]) + i += size + start = i + continue + } + i += size + } + if start < len(v) { + s.buf = append(s.buf, v[start:]...) + } + s.buf = append(s.buf, '"') +} + +var safeSet = [utf8.RuneSelf]bool{ + ' ': true, + '!': true, + '"': false, + '#': true, + '$': true, + '%': true, + '&': true, + '\'': true, + '(': true, + ')': true, + '*': true, + '+': true, + ',': true, + '-': true, + '.': true, + '/': true, + '0': true, + '1': true, + '2': true, + '3': true, + '4': true, + '5': true, + '6': true, + '7': true, + '8': true, + '9': true, + ':': true, + ';': true, + '<': true, + '=': true, + '>': true, + '?': true, + '@': true, + 'A': true, + 'B': true, + 'C': true, + 'D': true, + 'E': true, + 'F': true, + 'G': true, + 'H': true, + 'I': true, + 'J': true, + 'K': true, + 'L': true, + 'M': true, + 'N': true, + 'O': true, + 'P': true, + 'Q': true, + 'R': true, + 'S': true, + 'T': true, + 'U': true, + 'V': true, + 'W': true, + 'X': true, + 'Y': true, + 'Z': true, + '[': true, + '\\': false, + ']': true, + '^': true, + '_': true, + '`': true, + 'a': true, + 'b': true, + 'c': true, + 'd': true, + 'e': true, + 'f': true, + 'g': true, + 'h': true, + 'i': true, + 'j': true, + 'k': true, + 'l': true, + 'm': true, + 'n': true, + 'o': true, + 'p': true, + 'q': true, + 'r': true, + 's': true, + 't': true, + 'u': true, + 'v': true, + 'w': true, + 'x': true, + 'y': true, + 'z': true, + '{': true, + '|': true, + '}': true, + '~': true, + '': false, +} + +var hex = "0123456789abcdef" diff --git a/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/stack.go b/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/stack.go new file mode 100644 index 00000000000..8ee85b6be4e --- /dev/null +++ b/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/stack.go @@ -0,0 +1,38 @@ +package json + +// chosen as an arbitrary average max depth for the RPC-style payloads we +// typically deal with in an SDK client +const initialCap = 8 + +type stackT[T any] struct { + values []T + sentinel T +} + +func newStackT[T any](sentinel T) stackT[T] { + return stackT[T]{ + values: make([]T, 0, initialCap), + sentinel: sentinel, + } +} + +func (s *stackT[T]) Push(v T) { + s.values = append(s.values, v) +} + +func (s *stackT[T]) Pop() T { + if len(s.values) == 0 { + return s.sentinel + } + idx := len(s.values) - 1 + v := s.values[idx] + s.values = s.values[:idx] + return v +} + +func (s *stackT[T]) Top() T { + if len(s.values) == 0 { + return s.sentinel + } + return s.values[len(s.values)-1] +} diff --git a/vendor/github.com/aws/smithy-go/transport/http/request.go b/vendor/github.com/aws/smithy-go/transport/http/request.go index 5cbf6f10acc..87acdfe57c1 100644 --- a/vendor/github.com/aws/smithy-go/transport/http/request.go +++ b/vendor/github.com/aws/smithy-go/transport/http/request.go @@ -118,6 +118,9 @@ func (r *Request) IsStreamSeekable() bool { // SetStream returns a clone of the request with the stream set to the provided // reader. May return an error if the provided reader is seekable but returns // an error. +// +// ContentLength is set to the stream's length when it can be determined, and +// left unchanged otherwise. func (r *Request) SetStream(reader io.Reader) (rc *Request, err error) { rc = r.Clone() @@ -151,6 +154,12 @@ func (r *Request) SetStream(reader io.Reader) (rc *Request, err error) { rc.isStreamSeekable = isStreamSeekable rc.streamStartPos = streamStartPos + if n, ok, err := rc.StreamLength(); err != nil { + return rc, err + } else if ok { + rc.ContentLength = n + } + return rc, err } diff --git a/vendor/github.com/aws/smithy-go/waiter/logger.go b/vendor/github.com/aws/smithy-go/waiter/logger.go index 8d70a03ff2f..cb31a2e099c 100644 --- a/vendor/github.com/aws/smithy-go/waiter/logger.go +++ b/vendor/github.com/aws/smithy-go/waiter/logger.go @@ -30,7 +30,7 @@ func (m *Logger) HandleInitialize(ctx context.Context, in middleware.InitializeI return next.HandleInitialize(ctx, in) } -// AddLogger is a helper util to add waiter logger after `SetLogger` middleware in +// AddLogger is a helper util to add a waiter logger to the initialize stack. func (m Logger) AddLogger(stack *middleware.Stack) error { - return stack.Initialize.Insert(&m, "SetLogger", middleware.After) + return stack.Initialize.Add(&m, middleware.After) } diff --git a/vendor/github.com/axiomhq/hyperloglog/.gitignore b/vendor/github.com/axiomhq/hyperloglog/.gitignore index a1338d68517..524c0890d29 100644 --- a/vendor/github.com/axiomhq/hyperloglog/.gitignore +++ b/vendor/github.com/axiomhq/hyperloglog/.gitignore @@ -7,8 +7,11 @@ # Test binary, build with `go test -c` *.test -# Output of the go coverage tool, specifically when used with LiteIDE +# Output of the Go coverage tool *.out # Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 .glide/ + +# Project-local development tools +.tools/ diff --git a/vendor/github.com/axiomhq/hyperloglog/.golangci-lint-version b/vendor/github.com/axiomhq/hyperloglog/.golangci-lint-version new file mode 100644 index 00000000000..6f9cc441d90 --- /dev/null +++ b/vendor/github.com/axiomhq/hyperloglog/.golangci-lint-version @@ -0,0 +1 @@ +v2.12.2 diff --git a/vendor/github.com/axiomhq/hyperloglog/.golangci.yml b/vendor/github.com/axiomhq/hyperloglog/.golangci.yml new file mode 100644 index 00000000000..d76be70fef3 --- /dev/null +++ b/vendor/github.com/axiomhq/hyperloglog/.golangci.yml @@ -0,0 +1,25 @@ +version: "2" + +run: + timeout: 5m + relative-path-mode: gomod + modules-download-mode: readonly + +linters: + default: standard + enable: + - errorlint + - misspell + - testifylint + - unconvert + settings: + staticcheck: + checks: + - all + # Generated polynomial coefficients intentionally use explicit powers. + - -QF1005 + +formatters: + enable: + - gofmt + - goimports diff --git a/vendor/github.com/axiomhq/hyperloglog/.goreleaser.yaml b/vendor/github.com/axiomhq/hyperloglog/.goreleaser.yaml new file mode 100644 index 00000000000..ca9a1605647 --- /dev/null +++ b/vendor/github.com/axiomhq/hyperloglog/.goreleaser.yaml @@ -0,0 +1,19 @@ +version: 2 + +project_name: hyperloglog + +git: + prerelease_suffix: "-" + +builds: + - skip: true + +changelog: + use: github-native + +release: + github: + owner: axiomhq + name: hyperloglog + prerelease: auto + name_template: "{{ .Tag }}" diff --git a/vendor/github.com/axiomhq/hyperloglog/Contributing.md b/vendor/github.com/axiomhq/hyperloglog/Contributing.md index d0eee971789..5cd89401e80 100644 --- a/vendor/github.com/axiomhq/hyperloglog/Contributing.md +++ b/vendor/github.com/axiomhq/hyperloglog/Contributing.md @@ -1,6 +1,6 @@ -## How to Contribute +# How to Contribute -👍🎉 First of all, thank you for your interest in Axiom-node! We'd love to accept your patches and contributions! 🎉👍 +👍🎉 First of all, thank you for your interest in hyperloglog! We'd love to accept your patches and contributions! 🎉👍 This project accepts contributions. In order to contribute, you should pay attention to a few guidelines: @@ -12,13 +12,17 @@ When reporting a bug, please try and provide as much context as possible such as ## Setup -[Fork](https://github.com/axiomhq/hyperloglog.git), then clone this repository: +[Fork](https://github.com/axiomhq/hyperloglog/fork), then clone this repository: ``` -git clone https://github.com/axiomhq/hyperloglog.git +git clone https://github.com//hyperloglog.git cd hyperloglog -cd demo -go run hyperloglog_demo.go + +# Run formatting, linting, tests, and a build +make ci + +# Run examples (see output demonstrating library usage) +go test -run Example -v ``` ## Submitting Modifications @@ -27,15 +31,15 @@ go run hyperloglog_demo.go 2. Follow the normal process of [forking](https://docs.github.com/en/free-pro-team@latest/github/getting-started-with-github/fork-a-repo) the project, and setup a new branch to work in. It's important that each group of changes be done in separate branches in order to ensure that a pull request only includes the commits related to that bug or feature. -3. Go makes it very simple to ensure properly formatted code, so always run `go fmt` on your code before committing it. +3. Run `make ci` before committing. Use `make fmt` to apply Go formatting. -4. Do your best to have [well-formated commit messages](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) +4. Do your best to have [well-formatted commit messages](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) for each change. This provides consistency throughout the project and ensures that commit messages are able to be formatted properly by various git tools. -5. Finally, push the commits to your fork and submit a [pull request](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request) +5. Finally, push the commits to your fork and submit a [pull request](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request). ### Once you've filed the PR: - One or more maintainers will use GitHub's review feature to review your PR. - If the maintainer asks for any changes, edit your changes, push, and ask for another review. -- If the maintainer decides to suggest some improvements or alternatives, modify and make improvements. Once your changes are approved, one of the project maintainers will merge them. \ No newline at end of file +- If the maintainer decides to suggest some improvements or alternatives, modify and make improvements. Once your changes are approved, one of the project maintainers will merge them. diff --git a/vendor/github.com/axiomhq/hyperloglog/Makefile b/vendor/github.com/axiomhq/hyperloglog/Makefile new file mode 100644 index 00000000000..66f4dd9ff80 --- /dev/null +++ b/vendor/github.com/axiomhq/hyperloglog/Makefile @@ -0,0 +1,42 @@ +GO_FILES := $(shell git ls-files '*.go') +GOLANGCI_LINT_VERSION := $(shell cat .golangci-lint-version) +TOOLS_DIR := $(CURDIR)/.tools +GOLANGCI_LINT := $(TOOLS_DIR)/golangci-lint + +.PHONY: ci fmt fmt-check lint test test-race coverage build clean + +ci: fmt-check lint test-race build + +fmt: + gofmt -w $(GO_FILES) + +fmt-check: + @unformatted="$$(gofmt -l $(GO_FILES))"; \ + if [ -n "$$unformatted" ]; then \ + echo "The following files need gofmt:"; \ + echo "$$unformatted"; \ + exit 1; \ + fi + +$(GOLANGCI_LINT): .golangci-lint-version + @mkdir -p $(TOOLS_DIR) + GOBIN=$(TOOLS_DIR) go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) + +lint: $(GOLANGCI_LINT) + $(GOLANGCI_LINT) run + +test: + go test ./... + +test-race: + go test -race -shuffle=on ./... + +coverage: + go test -race -shuffle=on -covermode=atomic -coverprofile=coverage.out ./... + +build: + go build ./... + +clean: + go clean + rm -f coverage.out diff --git a/vendor/github.com/axiomhq/hyperloglog/README.md b/vendor/github.com/axiomhq/hyperloglog/README.md index f2eee54f990..f2ad25ec52b 100644 --- a/vendor/github.com/axiomhq/hyperloglog/README.md +++ b/vendor/github.com/axiomhq/hyperloglog/README.md @@ -1,6 +1,8 @@ # HyperLogLog - an algorithm for approximating the number of distinct elements -[![GoDoc](https://godoc.org/github.com/axiomhq/hyperloglog?status.svg)](https://godoc.org/github.com/axiomhq/hyperloglog) [![Go Report Card](https://goreportcard.com/badge/github.com/axiomhq/hyperloglog)](https://goreportcard.com/report/github.com/axiomhq/hyperloglog) [![CircleCI](https://circleci.com/gh/axiomhq/hyperloglog/tree/master.svg?style=svg)](https://circleci.com/gh/axiomhq/hyperloglog/tree/master) +[![CI](https://github.com/axiomhq/hyperloglog/actions/workflows/ci.yml/badge.svg)](https://github.com/axiomhq/hyperloglog/actions/workflows/ci.yml) +[![Go Reference](https://pkg.go.dev/badge/github.com/axiomhq/hyperloglog.svg)](https://pkg.go.dev/github.com/axiomhq/hyperloglog) +[![Go Report Card](https://goreportcard.com/badge/github.com/axiomhq/hyperloglog)](https://goreportcard.com/report/github.com/axiomhq/hyperloglog) An improved version of [HyperLogLog](https://en.wikipedia.org/wiki/HyperLogLog) for the count-distinct problem, approximating the number of distinct elements in a multiset. This implementation offers enhanced performance, flexibility, and simplicity while maintaining accuracy. @@ -40,12 +42,26 @@ A big thank you to Prof. Shigang Chen and his team at the University of Florida ## Contributing -Kindly check our [contributing guide](https://github.com/axiomhq/hyperloglog/blob/main/Contributing.md) on how to propose bugfixes and improvements, and submitting pull requests to the project +Kindly check our [contributing guide](https://github.com/axiomhq/hyperloglog/blob/main/Contributing.md) on how to propose bugfixes and improvements, and submit pull requests to the project. + +Run the same checks used by CI before opening a pull request: + +```sh +make ci +``` + +Individual targets are available for formatting (`make fmt`), linting +(`make lint`), tests (`make test`), race-enabled tests (`make test-race`), and +coverage (`make coverage`). + +Version tags matching `v*.*.*` are validated by the release workflow before it +publishes a GitHub Release with generated release notes. Tags with a pre-release +suffix, such as `v1.0.0-rc.1`, publish as pre-releases. ## License -© Axiom, Inc., 2024 +© Axiom, Inc., 2026 -Distributed under MIT License (`The MIT License`). +Distributed under the MIT License (`The MIT License`). See [LICENSE](LICENSE) for more information. diff --git a/vendor/github.com/axiomhq/hyperloglog/beta.go b/vendor/github.com/axiomhq/hyperloglog/beta.go index 29d560136ac..040371eb409 100644 --- a/vendor/github.com/axiomhq/hyperloglog/beta.go +++ b/vendor/github.com/axiomhq/hyperloglog/beta.go @@ -5,30 +5,41 @@ import ( "math" ) -var betaMap = map[uint8]func(float64) float64{ - 4: beta4, - 5: beta5, - 6: beta6, - 7: beta7, - 8: beta8, - 9: beta9, - 10: beta10, - 11: beta11, - 12: beta12, - 13: beta13, - 14: beta14, - 15: beta15, - 16: beta16, - 17: beta17, - 18: beta18, -} - func beta(p uint8, ez float64) float64 { - f, ok := betaMap[p] - if !ok { + switch p { + case 4: + return beta4(ez) + case 5: + return beta5(ez) + case 6: + return beta6(ez) + case 7: + return beta7(ez) + case 8: + return beta8(ez) + case 9: + return beta9(ez) + case 10: + return beta10(ez) + case 11: + return beta11(ez) + case 12: + return beta12(ez) + case 13: + return beta13(ez) + case 14: + return beta14(ez) + case 15: + return beta15(ez) + case 16: + return beta16(ez) + case 17: + return beta17(ez) + case 18: + return beta18(ez) + default: panic(fmt.Sprintf("invalid precision %d", p)) } - return f(ez) } /* diff --git a/vendor/github.com/axiomhq/hyperloglog/compressed.go b/vendor/github.com/axiomhq/hyperloglog/compressed.go index 24425b4da6f..6832ff0f29a 100644 --- a/vendor/github.com/axiomhq/hyperloglog/compressed.go +++ b/vendor/github.com/axiomhq/hyperloglog/compressed.go @@ -2,6 +2,7 @@ package hyperloglog import ( "encoding/binary" + "fmt" "slices" ) @@ -76,26 +77,70 @@ func (v *compressedList) AppendBinary(data []byte) ([]byte, error) { return v.b.AppendBinary(data) } -func (v *compressedList) UnmarshalBinary(data []byte) error { +// unmarshal requires p to have passed checkPrecision, and data to be exactly +// the compressed list; trailing bytes are rejected. +func (v *compressedList) unmarshal(data []byte, p uint8) error { if len(data) < 12 { - return ErrorTooShort + return fmt.Errorf("hyperloglog: compressed list header needs 12 bytes, have %d: %w", len(data), ErrorTooShort) } - // Set the count. - v.count, data = binary.BigEndian.Uint32(data[:4]), data[4:] + // Read the count. + count, data := binary.BigEndian.Uint32(data[:4]), data[4:] - // Set the last value. - v.last, data = binary.BigEndian.Uint32(data[:4]), data[4:] + // Read the last value. + last, data := binary.BigEndian.Uint32(data[:4]), data[4:] - // Set the list. + // Read the size of the list. sz, data := binary.BigEndian.Uint32(data[:4]), data[4:] - v.b = make([]uint8, sz) - if uint32(len(data)) < sz { - return ErrorTooShort + if err := exactLen("compressed list stream", uint64(len(data)), uint64(sz)); err != nil { + return err } - for i := uint32(0); i < sz; i++ { - v.b[i] = data[i] + if count >= mp { + return fmt.Errorf("hyperloglog: compressed list count %d >= %d: %w", count, mp, ErrorInvalidData) } + if count == 0 { + if sz != 0 || last != 0 { + return fmt.Errorf("hyperloglog: empty compressed list has size %d and last %d: %w", sz, last, ErrorInvalidData) + } + } else if sz < count || sz > 5*count { + return fmt.Errorf("hyperloglog: compressed list of %d entries has impossible stream size %d: %w", count, sz, ErrorInvalidData) + } + + b := make(variableLengthList, sz) + copy(b, data[:sz]) + + // Walk the stream once, decoding each varint exactly once, so that count + // and last cannot describe something the payload does not contain. + var entries uint32 + var running uint32 + for i := 0; i < int(sz); { + off := i + x, end, ok := b.decode(off) + if !ok { + return fmt.Errorf("hyperloglog: compressed list varint at compressed-list offset %d is malformed: %w", off, ErrorInvalidData) + } + i = end + // Every delta after the first strictly increases the running key, so + // the decoded keys strictly increase, the sum cannot wrap, and count + // cannot be inflated by duplicates. + next := running + x + if entries > 0 && next <= running { + return fmt.Errorf("hyperloglog: compressed list delta %d at compressed-list offset %d does not increase the key past %d: %w", entries, off, running, ErrorInvalidData) + } + running = next + if err := checkSparseKey(running, p); err != nil { + return fmt.Errorf("hyperloglog: compressed-list offset %d: %w", off, err) + } + entries++ + } + if count != entries { + return fmt.Errorf("hyperloglog: compressed list count %d, decoded %d entries: %w", count, entries, ErrorInvalidData) + } + if last != running { + return fmt.Errorf("hyperloglog: compressed list last %d, decoded %d: %w", last, running, ErrorInvalidData) + } + + v.count, v.last, v.b = count, last, b return nil } @@ -109,11 +154,18 @@ func (v *compressedList) Len() int { return len(v.b) } +// decode ignores b.decode's ok: streams reach here only after unmarshal validated them or Append built them, and a malformed stream would still return next == len(v), terminating Iter. func (v *compressedList) decode(i int, last uint32) (uint32, int) { - n, i := v.b.decode(i) + n, i, _ := v.b.decode(i) return n + last, i } +func (v *compressedList) clear() { + v.count = 0 + v.last = 0 + v.b.clear() +} + func (v *compressedList) Append(x uint32) { v.count++ v.b = v.b.Append(x - v.last) @@ -147,14 +199,28 @@ func (v variableLengthList) AppendBinary(data []byte) ([]byte, error) { return data, nil } -func (v variableLengthList) decode(i int) (uint32, int) { - var x uint32 +func (v *variableLengthList) clear() { + *v = (*v)[:0] +} + +// decode reads the varint at offset i and returns its value and the offset of +// the next one. ok is false when the varint runs past the end of v, spans more +// than 5 bytes, does not fit in 32 bits, or is not minimally encoded; next is +// then len(v), so a loop driven by next terminates on a malformed stream. +func (v variableLengthList) decode(i int) (x uint32, next int, ok bool) { j := i - for ; v[j]&0x80 != 0; j++ { + for ; j < len(v) && v[j]&0x80 != 0; j++ { x |= uint32(v[j]&0x7f) << (uint(j-i) * 7) } + if j >= len(v) { + return x, len(v), false + } x |= uint32(v[j]) << (uint(j-i) * 7) - return x, j + 1 + n := j - i + 1 + if n > 5 || (n == 5 && v[j] > 0x0f) || (n > 1 && v[j] == 0) { + return x, len(v), false + } + return x, j + 1, true } func (v variableLengthList) Append(x uint32) variableLengthList { diff --git a/vendor/github.com/axiomhq/hyperloglog/hyperloglog.go b/vendor/github.com/axiomhq/hyperloglog/hyperloglog.go index 0ebfd124f12..4c9770c91bb 100644 --- a/vendor/github.com/axiomhq/hyperloglog/hyperloglog.go +++ b/vendor/github.com/axiomhq/hyperloglog/hyperloglog.go @@ -1,3 +1,5 @@ +// Package hyperloglog implements the HyperLogLog cardinality estimator with +// sparse and dense representations. package hyperloglog import ( @@ -14,6 +16,11 @@ const ( version = 2 ) +// Sketch is a HyperLogLog estimator. Do not copy one after first use; use +// Clone. Its zero value is empty and initializes on insertion or merge: a zero +// value first used with Insert or InsertHash takes New's configuration +// (precision 14, sparse), while a zero value first used with Merge adopts the +// other sketch's precision and representation. type Sketch struct { p uint8 m uint32 @@ -43,9 +50,33 @@ func newSketchNoError(precision uint8, sparse bool) *Sketch { return sk } +func checkPrecision(p uint8) error { + if p < 4 || p > 18 { + return ErrorInvalidPrecision + } + return nil +} + +func exactLen(what string, have, want uint64) error { + switch { + case have == want: + return nil + case have < want: + return fmt.Errorf("hyperloglog: %s need %d bytes, have %d: %w", what, want, have, ErrorTooShort) + default: + return fmt.Errorf("hyperloglog: %s need %d bytes, %d bytes follow them: %w", what, want, have-want, ErrorInvalidData) + } +} + +func maxRho(p uint8) uint8 { return 64 - p + 1 } + +// NewSketch returns a HyperLogLog Sketch with 2^precision registers. The +// precision has to be >= 4 and <= 18, otherwise ErrorInvalidPrecision is +// returned. When sparse is true the Sketch starts out in the sparse +// representation. func NewSketch(precision uint8, sparse bool) (*Sketch, error) { - if precision < 4 || precision > 18 { - return nil, fmt.Errorf("p has to be >= 4 and <= 18") + if err := checkPrecision(precision); err != nil { + return nil, err } m := uint32(1) << precision s := &Sketch{ @@ -82,12 +113,17 @@ func (sk *Sketch) maybeToNormal() { } } +// Merge adds other to sk. Nil and zero-value sketches are treated as empty. func (sk *Sketch) Merge(other *Sketch) error { - if other == nil { + if other == nil || other.p == 0 { + return nil + } + if sk.p == 0 { + *sk = *other.Clone() return nil } if sk.p != other.p { - return errors.New("precisions must be equal") + return fmt.Errorf("hyperloglog: cannot merge precision %d with precision %d: %w", sk.p, other.p, ErrorPrecisionMismatch) } if sk.sparse() && other.sparse() { @@ -145,9 +181,15 @@ func (sk *Sketch) toNormal() { } func (sk *Sketch) insert(i uint32, r uint8) { sk.regs[i] = max(r, sk.regs[i]) } -func (sk *Sketch) Insert(e []byte) { sk.InsertHash(hash(e)) } +// Insert hashes e with the package's MetroHash64 seed and adds it to sk. +func (sk *Sketch) Insert(e []byte) { sk.InsertHash(hash(e)) } + +// InsertHash adds a uniformly distributed 64-bit hash to sk. func (sk *Sketch) InsertHash(x uint64) { + if sk.p == 0 { + *sk = *New() + } if sk.sparse() { if sk.tmpSet.add(encodeHash(x, sk.p, pp)) { sk.maybeToNormal() @@ -158,10 +200,22 @@ func (sk *Sketch) InsertHash(x uint64) { sk.insert(uint32(i), r) } +// Estimate returns the cardinality estimate and may compact sparse state. func (sk *Sketch) Estimate() uint64 { + if sk.p == 0 { + return 0 + } if sk.sparse() { sk.mergeSparse() - return uint64(linearCount(mp, mp-sk.sparseList.count)) + // mergeSparse drains tmpSet into sparseList without consulting + // maybeToNormal, whose threshold only ever fires on insertion. Without + // this check a caller alternating small batches of Insert with + // Estimate keeps the sparse list growing past m forever. + if uint32(sk.sparseList.Len()) > sk.m { + sk.toNormal() + } else { + return uint64(linearCount(mp, mp-min(sk.sparseList.count, mp-1))) + } } sum, ez := sumAndZeros(sk.regs) @@ -211,11 +265,14 @@ func (sk *Sketch) mergeSparse() { } sk.sparseList = newList - sk.tmpSet = makeSet(0) + sk.tmpSet.clear() } // MarshalBinary implements the encoding.BinaryMarshaler interface. // +// An uninitialized (zero value) Sketch has no encoding: its precision is 0, so +// MarshalBinary returns an error wrapping ErrorInvalidPrecision. +// // When the result will be appended to another buffer, consider using // AppendBinary to avoid additional allocations and copying. func (sk *Sketch) MarshalBinary() (data []byte, err error) { @@ -223,7 +280,27 @@ func (sk *Sketch) MarshalBinary() (data []byte, err error) { } // AppendBinary implements the encoding.BinaryAppender interface. +// +// An uninitialized (zero value) Sketch has no encoding: its precision is 0, so +// AppendBinary returns an error wrapping ErrorInvalidPrecision and leaves the +// caller's buffer unmodified. +// +// UnmarshalBinary requires the encoding to be the entire buffer it is handed +// and rejects trailing bytes with ErrorInvalidData. A caller appending a Sketch +// into a larger buffer must frame the record itself; the number of bytes +// appended is len(result) - len(data). +// +// The encoding is not canonical: two sketches holding the same values may +// encode to different bytes, depending on insertion order and on whether +// Estimate has compacted the sparse representation. An encoding must not be +// hashed, deduplicated, or compared for equality to decide whether two +// sketches hold the same values. func (sk *Sketch) AppendBinary(data []byte) ([]byte, error) { + // Refuse to write a header no UnmarshalBinary would accept, and leave the + // caller's buffer untouched when we do. + if err := checkPrecision(sk.p); err != nil { + return data, fmt.Errorf("hyperloglog: precision %d: %w", sk.p, err) + } data = slices.Grow(data, 8+len(sk.regs)) // Marshal a version marker. data = append(data, version) @@ -259,74 +336,188 @@ func (sk *Sketch) AppendBinary(data []byte) ([]byte, error) { ) // Marshal each element in the list. - for _, v := range sk.regs { - data = append(data, byte(v)) - } + data = append(data, sk.regs...) return data, nil } -// ErrorTooShort is an error that UnmarshalBinary try to parse too short -// binary. +// ErrorTooShort is returned, wrapped, when a buffer ends before the format +// requires. UnmarshalBinary used to return it unwrapped, so err == +// ErrorTooShort is now always false and callers have to use errors.Is. var ErrorTooShort = errors.New("too short binary") +// ErrorInvalidVersion is returned by UnmarshalBinary when the version byte is +// neither 1 nor 2. +var ErrorInvalidVersion = errors.New("unknown serialization version") + +// ErrorInvalidPrecision is returned unwrapped by NewSketch, and wrapped by +// UnmarshalBinary, MarshalBinary and AppendBinary, when the precision is +// outside the supported range. +var ErrorInvalidPrecision = errors.New("p has to be >= 4 and <= 18") + +// ErrorInvalidData is returned by UnmarshalBinary when the binary is long +// enough but describes a state that cannot be decoded. +var ErrorInvalidData = errors.New("invalid binary data") + +// ErrorPrecisionMismatch is wrapped by Merge when the sketches have different +// precisions. +var ErrorPrecisionMismatch = errors.New("precisions must be equal") + // UnmarshalBinary implements the encoding.BinaryUnmarshaler interface. +// +// The binary format starts with a 4 byte header: +// +// byte 0: version. 2 is written; 1 and 2 are accepted, anything else +// returns ErrorInvalidVersion. +// byte 1: precision p, which must be in [4, 18], otherwise +// ErrorInvalidPrecision is returned. +// byte 2: b, the register bias of the version 1 dense payload. It is +// ignored for sparse payloads of either version. Version 2 writes +// 0 and requires 0. +// byte 3: 1 if the payload is sparse, 0 if it is dense. +// +// The sparse payload is identical for version 1 and 2: a uint32 big endian +// count N of tmp set keys, followed by N uint32 big endian keys, followed by +// the compressed list: a uint32 big endian count, a uint32 big endian last +// value, a uint32 big endian size sz, and sz bytes of a delta varint stream +// whose final byte must have its high bit clear. The tmp set keys may appear in +// any order. +// +// Version 2 pins the hash function to MetroHash64 with seed 1337 and the sparse +// precision pp to 25. Sparse keys and dense registers are only meaningful under +// those two constants, so changing either requires a new version byte. +// +// The version 2 dense payload is a uint32 big endian register count, which +// must equal m = 1< 1 { + return fmt.Errorf("hyperloglog: header byte 3 = %d: %w", data[3], ErrorInvalidData) + } + sparse := data[3] == 1 - // Make a newSketch Sketch if the precision doesn't match or if the Sketch was used - if sk.p != p || sk.regs != nil || sk.tmpSet.Len() > 0 || (sk.sparseList != nil && sk.sparseList.Len() > 0) { - newh, err := NewSketch(p, sparse) - if err != nil { - return err - } - *sk = *newh + // Unmarshal b. Only the version 1 dense encoding has a register bias. + b := data[2] + if v == 2 && b != 0 { + return fmt.Errorf("hyperloglog: header byte 2 = %d for version 2: %w", b, ErrorInvalidData) } - // h is now initialised with the correct p. We just need to fill the - // rest of the details out. - if sparse { + // Validate the precision before anything is sized from it, so that a + // header declaring a large p cannot allocate registers the payload does + // not have. The scratch Sketch below is only built once the declared + // lengths check out, and the receiver is only replaced once the whole + // payload has parsed. + if err := checkPrecision(p); err != nil { + return fmt.Errorf("hyperloglog: precision %d: %w", p, err) + } + m := uint32(1) << p + + // The parsed sketch is only committed to the receiver at the single exit + // below, after the whole payload has been validated. + var tmp *Sketch + + switch { + case sparse: // Using the sparse Sketch. // Unmarshal the tmp_set. tssz := binary.BigEndian.Uint32(data[4:8]) - sk.tmpSet = makeSet(int(tssz)) // We need to unmarshal tssz values in total, and each value requires us // to read 4 bytes. - tsLastByte := int((tssz * 4) + 8) + need := 8 + 4*uint64(tssz) + if need > uint64(len(data)) { + return fmt.Errorf("hyperloglog: tmp set of %d keys needs %d bytes, have %d: %w", tssz, need, len(data), ErrorTooShort) + } + if tssz > m { + return fmt.Errorf("hyperloglog: tmp set count %d exceeds register count %d: %w", tssz, m, ErrorInvalidData) + } + tmp = newSketchNoError(p, true) + tmp.tmpSet = makeSet(int(tssz)) + + tsLastByte := int(need) for i := 8; i < tsLastByte; i += 4 { k := binary.BigEndian.Uint32(data[i : i+4]) - sk.tmpSet.add(k) + if err := checkSparseKey(k, p); err != nil { + return fmt.Errorf("hyperloglog: tmp set key at offset %d: %w", i, err) + } + tmp.tmpSet.add(k) } // Unmarshal the sparse Sketch. - return sk.sparseList.UnmarshalBinary(data[tsLastByte:]) - } + if err := tmp.sparseList.unmarshal(data[tsLastByte:], p); err != nil { + return fmt.Errorf("hyperloglog: compressed list at offset %d: %w", tsLastByte, err) + } - // Using the dense Sketch. - sk.sparseList = nil - sk.tmpSet = nilSet + case v == 1: + // Using the version 1 dense Sketch, where two 4 bit registers are + // packed into each byte. + payload := data[8:] + nb := int(m) / 2 + if err := exactLen("v1 dense registers at offset 8", uint64(len(payload)), uint64(nb)); err != nil { + return err + } + tmp = newSketchNoError(p, false) + if err := tmp.unmarshalBinaryV1(payload, b); err != nil { + return err + } - if v == 1 { - return sk.unmarshalBinaryV1(data[8:], b) + default: + // Using the version 2 dense Sketch. + payload := data[8:] + sz := binary.BigEndian.Uint32(data[4:8]) + if uint64(sz) != uint64(m) { + return fmt.Errorf("hyperloglog: dense register count %d, want m = %d: %w", sz, m, ErrorInvalidData) + } + if err := exactLen("dense registers at offset 8", uint64(len(payload)), uint64(sz)); err != nil { + return err + } + tmp = newSketchNoError(p, false) + if err := tmp.unmarshalBinaryV2(payload); err != nil { + return err + } } - return sk.unmarshalBinaryV2(data) + + *sk = *tmp + return nil } func sumAndZeros(regs []uint8) (res, ez float64) { @@ -339,16 +530,46 @@ func sumAndZeros(regs []uint8) (res, ez float64) { return res, ez } +// unmarshalBinaryV1 requires len(sk.regs) == int(sk.m) and +// len(data) == int(sk.m)/2. func (sk *Sketch) unmarshalBinaryV1(data []byte, b uint8) error { - sk.regs = make([]uint8, len(data)*2) + maxRho := maxRho(sk.p) for i, v := range data { - sk.regs[i*2] = uint8((v >> 4)) + b - sk.regs[i*2+1] = uint8((v<<4)>>4) + b + // Widen before adding the bias so that it cannot wrap. + hi := uint16(v>>4) + uint16(b) + lo := uint16(v&0x0f) + uint16(b) + if hi > uint16(maxRho) { + return fmt.Errorf("hyperloglog: v1 register %d = %d at offset %d, max %d: %w", i*2, hi, 8+i, maxRho, ErrorInvalidData) + } + if lo > uint16(maxRho) { + return fmt.Errorf("hyperloglog: v1 register %d = %d at offset %d, max %d: %w", i*2+1, lo, 8+i, maxRho, ErrorInvalidData) + } + sk.regs[i*2] = uint8(hi) + sk.regs[i*2+1] = uint8(lo) } return nil } +// unmarshalBinaryV2 requires len(sk.regs) == int(sk.m) and +// len(data) == int(sk.m). func (sk *Sketch) unmarshalBinaryV2(data []byte) error { - sk.regs = data[8:] + maxRho := maxRho(sk.p) + copy(sk.regs, data) + for i, r := range sk.regs { + if r > maxRho { + return fmt.Errorf("hyperloglog: register %d = %d, max %d: %w", i, r, maxRho, ErrorInvalidData) + } + } return nil } + +// Reset clears the sketch while preserving its current representation and +// allocated backing storage. +func (sk *Sketch) Reset() { + if sk.sparse() { + sk.tmpSet.clear() + sk.sparseList.clear() + return + } + clear(sk.regs) +} diff --git a/vendor/github.com/axiomhq/hyperloglog/sparse.go b/vendor/github.com/axiomhq/hyperloglog/sparse.go index 487d4083cf0..fc74173e5e8 100644 --- a/vendor/github.com/axiomhq/hyperloglog/sparse.go +++ b/vendor/github.com/axiomhq/hyperloglog/sparse.go @@ -1,6 +1,7 @@ package hyperloglog import ( + "fmt" "math/bits" "slices" @@ -37,6 +38,15 @@ func decodeHash(k uint32, p, pp uint8) (uint32, uint8) { return getIndex(k, p, pp), r } +// checkSparseKey requires p to have passed checkPrecision. +func checkSparseKey(k uint32, p uint8) error { + maxRho := maxRho(p) + if _, r := decodeHash(k, p, pp); r > maxRho { + return fmt.Errorf("hyperloglog: sparse key %#08x decodes to rho %d, max %d: %w", k, r, maxRho, ErrorInvalidData) + } + return nil +} + type set struct { m *intmap.Set[uint32] } @@ -69,6 +79,12 @@ func (s set) add(v uint32) bool { return s.m.Add(v) } +func (s set) clear() { + if s.m != nil { + s.m.Clear() + } +} + func (s set) Clone() set { if s == nilSet { return nilSet diff --git a/vendor/github.com/axiomhq/hyperloglog/utils.go b/vendor/github.com/axiomhq/hyperloglog/utils.go index c032c88d4ba..54d364a8dd8 100644 --- a/vendor/github.com/axiomhq/hyperloglog/utils.go +++ b/vendor/github.com/axiomhq/hyperloglog/utils.go @@ -7,8 +7,6 @@ import ( metro "github.com/dgryski/go-metro" ) -var hash = hashFunc - func alpha(m float64) float64 { switch m { case 16: @@ -41,6 +39,6 @@ func bextr32(v uint32, start, length uint8) uint32 { return (v >> start) & ((1 << length) - 1) } -func hashFunc(e []byte) uint64 { +func hash(e []byte) uint64 { return metro.Hash64(e, 1337) } diff --git a/vendor/github.com/dustin/go-humanize/.envrc b/vendor/github.com/dustin/go-humanize/.envrc new file mode 100644 index 00000000000..fb30e6c5de3 --- /dev/null +++ b/vendor/github.com/dustin/go-humanize/.envrc @@ -0,0 +1,4 @@ +# shellcheck shell=bash +set -eu + +use flake diff --git a/vendor/github.com/dustin/go-humanize/.gitignore b/vendor/github.com/dustin/go-humanize/.gitignore new file mode 100644 index 00000000000..92b27930be4 --- /dev/null +++ b/vendor/github.com/dustin/go-humanize/.gitignore @@ -0,0 +1 @@ +.direnv diff --git a/vendor/github.com/dustin/go-humanize/README.markdown b/vendor/github.com/dustin/go-humanize/README.markdown index 7d0b16b34f5..c8beb000d24 100644 --- a/vendor/github.com/dustin/go-humanize/README.markdown +++ b/vendor/github.com/dustin/go-humanize/README.markdown @@ -1,4 +1,4 @@ -# Humane Units [![Build Status](https://travis-ci.org/dustin/go-humanize.svg?branch=master)](https://travis-ci.org/dustin/go-humanize) [![GoDoc](https://godoc.org/github.com/dustin/go-humanize?status.svg)](https://godoc.org/github.com/dustin/go-humanize) +# Humane Units [![Build Status](https://travis-ci.org/dustin/go-humanize.svg?branch=master)](https://travis-ci.org/dustin/go-humanize) [![GoDoc](https://godoc.org/github.com/dustin/go-humanize?status.svg)](https://godoc.org/github.com/dustin/go-humanize) [![Coverage](https://img.shields.io/badge/coverage-report-brightgreen)](https://dustin.github.io/go-humanize/) Just a few functions for helping humanize times and sizes. @@ -8,6 +8,9 @@ Just a few functions for helping humanize times and sizes. See [godoc](https://pkg.go.dev/github.com/dustin/go-humanize) for complete documentation. +See the [test coverage report](https://dustin.github.io/go-humanize/) for +coverage details. + ## Sizes This lets you take numbers like `82854982` and convert them to useful diff --git a/vendor/github.com/dustin/go-humanize/SECURITY.md b/vendor/github.com/dustin/go-humanize/SECURITY.md new file mode 100644 index 00000000000..e0744020ead --- /dev/null +++ b/vendor/github.com/dustin/go-humanize/SECURITY.md @@ -0,0 +1,5 @@ +# Security Policy + +To report a security issue, please disclose it at [security advisory](https://github.com/dustin/go-humanize/security/advisories/new). + +We will respond within 7 working days of your submission. If the issue is confirmed as a vulnerability, we will open a Security Advisory and acknowledge your contributions as part of it. This project follows a 90 day disclosure timeline. diff --git a/vendor/github.com/dustin/go-humanize/bytes.go b/vendor/github.com/dustin/go-humanize/bytes.go index 0b498f4885c..e07fce8d23d 100644 --- a/vendor/github.com/dustin/go-humanize/bytes.go +++ b/vendor/github.com/dustin/go-humanize/bytes.go @@ -3,6 +3,7 @@ package humanize import ( "fmt" "math" + "math/bits" "strconv" "strings" "unicode" @@ -65,39 +66,90 @@ func logn(n, b float64) float64 { return math.Log(n) / math.Log(b) } -func humanateBytes(s uint64, base float64, sizes []string) string { +func countDigits(n int64) int { + digits := 0 + for n != 0 { + n /= 10 + digits += 1 + } + return digits +} + +func humanateBytes(s uint64, base float64, minDigits int, sizes []string) string { if s < 10 { return fmt.Sprintf("%d B", s) } e := math.Floor(logn(float64(s), base)) suffix := sizes[int(e)] - val := math.Floor(float64(s)/math.Pow(base, e)*10+0.5) / 10 - f := "%.0f %s" - if val < 10 { - f = "%.1f %s" + val := float64(s) / math.Pow(base, e) + + // Determine how many decimal places to keep based on the unrounded + // value's integer-digit count, then round exactly once to that + // precision. Rounding first to a fixed precision and then again when + // formatting (double rounding) can flip the result at a boundary due + // to floating point error (see #103). + intDigits := countDigits(int64(val)) + digits := max(minDigits-intDigits, 0) + rounding := math.Pow10(digits) + val = math.Floor(val*rounding+0.5) / rounding + + // Rounding may have carried into an additional integer digit (e.g. + // 9.996 -> 10.0), which means fewer decimal places should be shown + // than originally computed. + if newIntDigits := countDigits(int64(val)); newIntDigits > intDigits { + digits = max(digits-(newIntDigits-intDigits), 0) } + ff := "%%.%df %%s" + f := fmt.Sprintf(ff, digits) return fmt.Sprintf(f, val, suffix) } -// Bytes produces a human readable representation of an SI size. +// Bytes produces a human-readable representation of an SI size. // // See also: ParseBytes. // // Bytes(82854982) -> 83 MB func Bytes(s uint64) string { sizes := []string{"B", "kB", "MB", "GB", "TB", "PB", "EB"} - return humanateBytes(s, 1000, sizes) + return humanateBytes(s, 1000, 2, sizes) +} + +// BytesN produces a human-readable representation of an SI size. +// n specifies the total number of digits to output, including the decimal part. +// If n is less than or equal to the number of digits in the integer part, the decimal part will be omitted. +// +// See also: ParseBytes. +// +// BytesN(82854982, 3) -> 82.9 MB +// BytesN(82854982, 4) -> 82.85 MB +func BytesN(s uint64, n int) string { + sizes := []string{"B", "kB", "MB", "GB", "TB", "PB", "EB"} + return humanateBytes(s, 1000, n, sizes) } -// IBytes produces a human readable representation of an IEC size. +// IBytes produces a human-readable representation of an IEC size. // // See also: ParseBytes. // // IBytes(82854982) -> 79 MiB func IBytes(s uint64) string { sizes := []string{"B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB"} - return humanateBytes(s, 1024, sizes) + return humanateBytes(s, 1024, 2, sizes) +} + +// IBytesN produces a human-readable representation of an IEC size. +// n specifies the total number of digits to output, including the decimal part. +// If n is less than or equal to the number of digits in the integer part, the decimal part will be omitted. +// +// See also: ParseBytes. +// +// IBytesN(82854982, 4) -> 79.02 MiB +// IBytesN(123456789, 3) -> 118 MiB +// IBytesN(123456789, 6) -> 117.738 MiB +func IBytesN(s uint64, n int) string { + sizes := []string{"B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB"} + return humanateBytes(s, 1024, n, sizes) } // ParseBytes parses a string representation of bytes into the number @@ -132,6 +184,18 @@ func ParseBytes(s string) (uint64, error) { extra := strings.ToLower(strings.TrimSpace(s[lastDigit:])) if m, ok := bytesSizeTable[extra]; ok { + // Parse whole-number inputs exactly. A float64 cannot represent + // integers above 2^53, and the multiplication below would also reject + // otherwise-valid values near math.MaxUint64, so route integers through + // uint64 arithmetic with an overflow check. + if !strings.ContainsRune(num, '.') { + if v, perr := strconv.ParseUint(num, 10, 64); perr == nil { + if hi, lo := bits.Mul64(v, m); hi == 0 { + return lo, nil + } + return 0, fmt.Errorf("too large: %v", s) + } + } f *= float64(m) if f >= math.MaxUint64 { return 0, fmt.Errorf("too large: %v", s) diff --git a/vendor/github.com/dustin/go-humanize/comma.go b/vendor/github.com/dustin/go-humanize/comma.go index 520ae3e57d9..a870e912d10 100644 --- a/vendor/github.com/dustin/go-humanize/comma.go +++ b/vendor/github.com/dustin/go-humanize/comma.go @@ -13,34 +13,48 @@ import ( // // e.g. Comma(834142) -> 834,142 func Comma(v int64) string { - sign := "" + // Shortcut for [0, 7] + if v&^0b111 == 0 { + return string([]byte{byte(v) + 48}) + } // Min int64 can't be negated to a usable value, so it has to be special cased. if v == math.MinInt64 { return "-9,223,372,036,854,775,808" } + // Counting the number of digits. + var count byte = 0 + for n := v; n != 0; n = n / 10 { + count++ + } + count += (count - 1) / 3 if v < 0 { - sign = "-" v = 0 - v + count++ } + output := make([]byte, count) + j := len(output) - 1 - parts := []string{"", "", "", "", "", "", ""} - j := len(parts) - 1 - - for v > 999 { - parts[j] = strconv.FormatInt(v%1000, 10) - switch len(parts[j]) { - case 2: - parts[j] = "0" + parts[j] - case 1: - parts[j] = "00" + parts[j] - } - v = v / 1000 + var counter byte = 0 + for v > 9 { + output[j] = byte(v%10) + 48 + v = v / 10 j-- + if counter == 2 { + counter = 0 + output[j] = ',' + j-- + } else { + counter++ + } } - parts[j] = strconv.Itoa(int(v)) - return sign + strings.Join(parts[j:], ",") + + output[j] = byte(v) + 48 + if j == 1 { + output[0] = '-' + } + return string(output) } // Commaf produces a string form of the given number in base 10 with @@ -48,6 +62,16 @@ func Comma(v int64) string { // // e.g. Commaf(834142.32) -> 834,142.32 func Commaf(v float64) string { + if math.IsNaN(v) { + return "NaN" + } + if math.IsInf(v, 1) { + return "+Inf" + } + if math.IsInf(v, -1) { + return "-Inf" + } + buf := &bytes.Buffer{} if v < 0 { buf.Write([]byte{'-'}) @@ -76,17 +100,30 @@ func Commaf(v float64) string { return buf.String() } -// CommafWithDigits works like the Commaf but limits the resulting -// string to the given number of decimal places. +// CommafWithDigits works like the Commaf but always formats the +// resulting string to exactly the given number of decimal places, +// truncating extra digits or padding with zeros as needed. // // e.g. CommafWithDigits(834142.32, 1) -> 834,142.3 +// e.g. CommafWithDigits(1000, 2) -> 1,000.00 func CommafWithDigits(f float64, decimals int) string { - return stripTrailingDigits(Commaf(f), decimals) + s := stripTrailingDigits(Commaf(f), decimals) + if decimals <= 0 { + return s + } + + if dot := strings.IndexByte(s, '.'); dot < 0 { + s += "." + strings.Repeat("0", decimals) + } else if have := len(s) - dot - 1; have < decimals { + s += strings.Repeat("0", decimals-have) + } + return s } // BigComma produces a string form of the given big.Int in base 10 // with commas after every three orders of magnitude. -func BigComma(b *big.Int) string { +func BigComma(bin *big.Int) string { + b := new(big.Int).Set(bin) sign := "" if b.Sign() < 0 { sign = "-" @@ -114,3 +151,19 @@ func BigComma(b *big.Int) string { parts[j] = strconv.Itoa(int(b.Int64())) return sign + strings.Join(parts[j:], ",") } + +// ParseComma parses a string produced by Comma. +// It strips commas and returns the int64 value, or an error if the +// string cannot be parsed. +func ParseComma(s string) (int64, error) { + s = strings.ReplaceAll(s, ",", "") + return strconv.ParseInt(s, 10, 64) +} + +// ParseCommaf parses a string produced by Commaf. +// It strips commas and returns the float64 value, or an error if the +// string cannot be parsed. +func ParseCommaf(s string) (float64, error) { + s = strings.ReplaceAll(s, ",", "") + return strconv.ParseFloat(s, 64) +} diff --git a/vendor/github.com/dustin/go-humanize/commaf.go b/vendor/github.com/dustin/go-humanize/commaf.go index 2bc83a03cf8..12726e923b9 100644 --- a/vendor/github.com/dustin/go-humanize/commaf.go +++ b/vendor/github.com/dustin/go-humanize/commaf.go @@ -12,6 +12,13 @@ import ( // BigCommaf produces a string form of the given big.Float in base 10 // with commas after every three orders of magnitude. func BigCommaf(v *big.Float) string { + if v.IsInf() { + if v.Sign() < 0 { + return "-Inf" + } + return "+Inf" + } + buf := &bytes.Buffer{} if v.Sign() < 0 { buf.Write([]byte{'-'}) diff --git a/vendor/github.com/dustin/go-humanize/flake.lock b/vendor/github.com/dustin/go-humanize/flake.lock new file mode 100644 index 00000000000..a7393823915 --- /dev/null +++ b/vendor/github.com/dustin/go-humanize/flake.lock @@ -0,0 +1,58 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1789370336, + "narHash": "sha256-obwZbWHP7htCIoq2Z0g/uTMcEgN6yqcMNIcOMe6P2qI=", + "rev": "c7def046b9a883d46974757852106483d741586f", + "type": "tarball", + "url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.11pre1073483.c7def046b9a8/nixexprs.tar.zst" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/vendor/github.com/dustin/go-humanize/flake.nix b/vendor/github.com/dustin/go-humanize/flake.nix new file mode 100644 index 00000000000..82186f2208d --- /dev/null +++ b/vendor/github.com/dustin/go-humanize/flake.nix @@ -0,0 +1,15 @@ +{ + description = "go-humanize"; + nixConfig.bash-prompt = "\[go-humanize\]$ "; + + inputs.flake-utils.url = "github:numtide/flake-utils"; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem + (system: + let pkgs = nixpkgs.legacyPackages.${system}; in + { + devShells.default = import ./shell.nix { inherit pkgs; }; + } + ); +} diff --git a/vendor/github.com/dustin/go-humanize/ftoa.go b/vendor/github.com/dustin/go-humanize/ftoa.go index bce923f371a..a4433afa6b5 100644 --- a/vendor/github.com/dustin/go-humanize/ftoa.go +++ b/vendor/github.com/dustin/go-humanize/ftoa.go @@ -29,7 +29,7 @@ func stripTrailingDigits(s string, digits int) string { return s[:i] } i++ - if i+digits >= len(s) { + if digits >= len(s)-i { return s } return s[:i+digits] diff --git a/vendor/github.com/dustin/go-humanize/number.go b/vendor/github.com/dustin/go-humanize/number.go index 6470d0d47a8..e9e20bc526f 100644 --- a/vendor/github.com/dustin/go-humanize/number.go +++ b/vendor/github.com/dustin/go-humanize/number.go @@ -42,11 +42,12 @@ var ( ) // FormatFloat produces a formatted number as string based on the following user-specified criteria: +// // * thousands separator // * decimal separator // * decimal precision // -// Usage: s := RenderFloat(format, n) +// Usage: s := FormatFloat(format, n) // The format parameter tells how to render the number n. // // See examples: http://play.golang.org/p/LXc1Ddm1lJ @@ -111,7 +112,7 @@ func FormatFloat(format string, n float64) string { // +0000 if formatIndx[0] == 0 { if format[formatIndx[0]] != '+' { - panic("RenderFloat(): invalid positive sign directive") + panic("FormatFloat(): invalid positive sign directive") } positiveStr = "+" formatIndx = formatIndx[1:] @@ -125,7 +126,7 @@ func FormatFloat(format string, n float64) string { // 000,000.00 if len(formatIndx) == 2 { if (formatIndx[1] - formatIndx[0]) != 4 { - panic("RenderFloat(): thousands separator directive must be followed by 3 digit-specifiers") + panic("FormatFloat(): thousands separator directive must be followed by 3 digit-specifiers") } thousandStr = string(format[formatIndx[0]]) formatIndx = formatIndx[1:] @@ -160,7 +161,7 @@ func FormatFloat(format string, n float64) string { intf, fracf := math.Modf(n + renderFloatPrecisionRounders[precision]) // generate integer part string - intStr := strconv.FormatInt(int64(intf), 10) + intStr := strconv.FormatFloat(intf, 'f', 0, 64) // add thousand separator if required if len(thousandStr) > 0 { diff --git a/vendor/github.com/dustin/go-humanize/shell.nix b/vendor/github.com/dustin/go-humanize/shell.nix new file mode 100644 index 00000000000..8c3ed9b1792 --- /dev/null +++ b/vendor/github.com/dustin/go-humanize/shell.nix @@ -0,0 +1,11 @@ +{ pkgs ? import { } }: +with pkgs; +mkShell { + buildInputs = [ + go + gotools + ]; + + shellHook = '' + ''; +} diff --git a/vendor/github.com/dustin/go-humanize/si.go b/vendor/github.com/dustin/go-humanize/si.go index 8b85019849a..7c9abaebbdf 100644 --- a/vendor/github.com/dustin/go-humanize/si.go +++ b/vendor/github.com/dustin/go-humanize/si.go @@ -33,12 +33,39 @@ var siPrefixTable = map[float64]string{ var revSIPrefixTable = revfmap(siPrefixTable) +// minSIExponent and maxSIExponent are the smallest and largest exponents +// siPrefixTable can name. They are derived from the table rather than written +// down so that adding a prefix (as ronto/quecto/ronna/quetta were added) keeps +// them correct. +var minSIExponent, maxSIExponent = func() (float64, float64) { + min, max := math.Inf(1), math.Inf(-1) + for k := range siPrefixTable { + if k < min { + min = k + } + if k > max { + max = k + } + } + return min, max +}() + +// siParseAliases lets ParseSI accept extra spellings of prefixes that look +// identical to the canonical ones in siPrefixTable. Output still uses the +// canonical character; this is input-side only. +var siParseAliases = map[string]float64{ + "μ": 1e-6, // GREEK SMALL LETTER MU, often typed instead of µ (U+00B5) +} + // revfmap reverses the map and precomputes the power multiplier func revfmap(in map[float64]string) map[string]float64 { rv := map[string]float64{} for k, v := range in { rv[v] = math.Pow(10, k) } + for a, v := range siParseAliases { + rv[a] = v + } return rv } @@ -49,6 +76,9 @@ func init() { for _, v := range siPrefixTable { ri += v } + for a := range siParseAliases { + ri += a + } ri += `]?)(.*)` riParseRegex = regexp.MustCompile(ri) @@ -69,11 +99,23 @@ func ComputeSI(input float64) (float64, string) { exponent := math.Floor(logn(mag, 10)) exponent = math.Floor(exponent/3) * 3 + // Outside the table there is no prefix that can name the magnitude, so + // clamp to the nearest one there is and let the returned value carry the + // remaining orders of magnitude. Without this the lookup below misses, + // the prefix comes back as the empty string, and the value is left scaled + // for a prefix that was never returned - so the caller silently gets a + // number off by as much as 10^300 with no error. + if exponent < minSIExponent { + exponent = minSIExponent + } else if exponent > maxSIExponent { + exponent = maxSIExponent + } + value := mag / math.Pow(10, exponent) // Handle special case where value is exactly 1000.0 // Should return 1 M instead of 1000 k - if value == 1000.0 { + if value == 1000.0 && exponent+3 <= maxSIExponent { exponent += 3 value = mag / math.Pow(10, exponent) } diff --git a/vendor/github.com/dustin/go-humanize/times.go b/vendor/github.com/dustin/go-humanize/times.go index dd3fbf5efc0..96f173c2c1f 100644 --- a/vendor/github.com/dustin/go-humanize/times.go +++ b/vendor/github.com/dustin/go-humanize/times.go @@ -4,6 +4,7 @@ import ( "fmt" "math" "sort" + "strings" "time" ) @@ -113,5 +114,12 @@ func CustomRelTime(a, b time.Time, albl, blbl string, magnitudes []RelTimeMagnit escaped = ch == '%' } } - return fmt.Sprintf(mag.Format, args...) + s := fmt.Sprintf(mag.Format, args...) + if lbl == "" { + // When the label is empty, trim the whitespace its "%s" + // placeholder would otherwise leave behind (e.g. a trailing + // space in "3 weeks %s"). + s = strings.TrimRight(s, " ") + } + return s } diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc.pb.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc.pb.go new file mode 100644 index 00000000000..9845b37c32c --- /dev/null +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc.pb.go @@ -0,0 +1,1214 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v6.33.2 +// source: envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto + +package ext_procv3 + +import ( + _ "github.com/cncf/xds/go/udpa/annotations" + _ "github.com/cncf/xds/go/xds/annotations/v3" + _ "github.com/envoyproxy/go-control-plane/envoy/annotations" + v31 "github.com/envoyproxy/go-control-plane/envoy/config/common/mutation_rules/v3" + v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" + v33 "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3" + v32 "github.com/envoyproxy/go-control-plane/envoy/type/v3" + _ "github.com/envoyproxy/protoc-gen-validate/validate" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + structpb "google.golang.org/protobuf/types/known/structpb" + wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Describes the route cache action to be taken when an external processor response +// is received in response to request headers. +type ExternalProcessor_RouteCacheAction int32 + +const ( + // The default behavior is to clear the route cache only when the + // :ref:`clear_route_cache ` + // field is set in an external processor response. + ExternalProcessor_DEFAULT ExternalProcessor_RouteCacheAction = 0 + // Always clear the route cache irrespective of the “clear_route_cache“ bit in + // the external processor response. + ExternalProcessor_CLEAR ExternalProcessor_RouteCacheAction = 1 + // Do not clear the route cache irrespective of the “clear_route_cache“ bit in + // the external processor response. Setting to “RETAIN“ is equivalent to setting the + // :ref:`disable_clear_route_cache ` + // to true. + ExternalProcessor_RETAIN ExternalProcessor_RouteCacheAction = 2 +) + +// Enum value maps for ExternalProcessor_RouteCacheAction. +var ( + ExternalProcessor_RouteCacheAction_name = map[int32]string{ + 0: "DEFAULT", + 1: "CLEAR", + 2: "RETAIN", + } + ExternalProcessor_RouteCacheAction_value = map[string]int32{ + "DEFAULT": 0, + "CLEAR": 1, + "RETAIN": 2, + } +) + +func (x ExternalProcessor_RouteCacheAction) Enum() *ExternalProcessor_RouteCacheAction { + p := new(ExternalProcessor_RouteCacheAction) + *p = x + return p +} + +func (x ExternalProcessor_RouteCacheAction) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ExternalProcessor_RouteCacheAction) Descriptor() protoreflect.EnumDescriptor { + return file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_enumTypes[0].Descriptor() +} + +func (ExternalProcessor_RouteCacheAction) Type() protoreflect.EnumType { + return &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_enumTypes[0] +} + +func (x ExternalProcessor_RouteCacheAction) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ExternalProcessor_RouteCacheAction.Descriptor instead. +func (ExternalProcessor_RouteCacheAction) EnumDescriptor() ([]byte, []int) { + return file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescGZIP(), []int{0, 0} +} + +// The filter communicates with an external gRPC service called an "external processor" +// that can do a variety of things with the request and response: +// +// * Access and modify the HTTP headers on the request, response, or both. +// * Access and modify the HTTP request and response bodies. +// * Access and modify the dynamic stream metadata. +// * Immediately send an HTTP response downstream and terminate other processing. +// +// The filter communicates with the server using a gRPC bidirectional stream. After the initial +// request, the external server is in control over what additional data is sent to it +// and how it should be processed. +// +// By implementing the protocol specified by the stream, the external server can choose: +// +// * Whether it receives the response message at all. +// * Whether it receives the message body at all, in separate chunks, or as a single buffer. +// * To modify request or response trailers if they already exist. +// +// The filter supports up to six different processing steps. Each is represented by +// a gRPC stream message that is sent to the external processor. For each message, the +// processor must send a matching response. +// +// - Request headers: Contains the headers from the original HTTP request. +// - Request body: If the body is present, the behavior depends on the +// body send mode. In “BUFFERED“ or “BUFFERED_PARTIAL“ mode, the body is sent to the external +// processor in a single message. In “STREAMED“ or “FULL_DUPLEX_STREAMED“ mode, the body will +// be split across multiple messages sent to the external processor. In “GRPC“ mode, as each +// gRPC message arrives, it will be sent to the external processor (there will be exactly one +// gRPC message in each message sent to the external processor). In “NONE“ mode, the body will +// not be sent to the external processor. +// - Request trailers: Delivered if they are present and if the trailer mode is set +// to “SEND“. +// - Response headers: Contains the headers from the HTTP response. Keep in mind +// that if the upstream system sends them before processing the request body that +// this message may arrive before the complete body. +// - Response body: Sent according to the processing mode like the request body. +// - Response trailers: Delivered according to the processing mode like the +// request trailers. +// +// By default, the processor sends only the request and response headers messages. +// This may be changed to include any of the six steps by changing the “processing_mode“ +// setting of the filter configuration, or by setting the “mode_override“ of any response +// from the external processor. The latter is only enabled if “allow_mode_override“ is +// set to true. This way, a processor may, for example, use information +// in the request header to determine whether the message body must be examined, or whether +// the data plane should simply stream it straight through. +// +// All of this together allows a server to process the filter traffic in fairly +// sophisticated ways. For example: +// +// - A server may choose to examine all or part of the HTTP message bodies depending +// on the content of the headers. +// - A server may choose to immediately reject some messages based on their HTTP +// headers (or other dynamic metadata) and more carefully examine others. +// +// The protocol itself is based on a bidirectional gRPC stream. The data plane will send the server +// :ref:`ProcessingRequest ` +// messages, and the server must reply with +// :ref:`ProcessingResponse `. +// +// Stats about each gRPC call are recorded in a :ref:`dynamic filter state +// ` object in a namespace matching the filter +// name. +// +// [#next-free-field: 26] +type ExternalProcessor struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Configuration for the gRPC service that the filter will communicate with. + // Only one of “grpc_service“ or “http_service“ can be set. + // It is required that one of them must be set. + GrpcService *v3.GrpcService `protobuf:"bytes,1,opt,name=grpc_service,json=grpcService,proto3" json:"grpc_service,omitempty"` + // Configuration for the HTTP service that the filter will communicate with. + // Only one of “http_service“ or + // :ref:`grpc_service ` + // can be set. It is required that one of them must be set. + // + // If “http_service“ is set, the + // :ref:`processing_mode ` + // cannot be configured to send any body or trailers. i.e., “http_service“ only supports + // sending request or response headers to the side stream server. + // + // With this configuration, the data plane behavior is: + // + // 1. The headers are first put in a proto message + // :ref:`ProcessingRequest `. + // + // 2. This proto message is then transcoded into a JSON text. + // + // 3. The data plane then sends an HTTP POST message with content-type as "application/json", + // and this JSON text as body to the side stream server. + // + // After the side-stream receives this HTTP request message, it is expected to do as follows: + // + // 1. It converts the body, which is a JSON string, into a “ProcessingRequest“ + // proto message to examine and mutate the headers. + // + // 2. It then sets the mutated headers into a new proto message + // :ref:`ProcessingResponse `. + // + // 3. It converts the “ProcessingResponse“ proto message into a JSON text. + // + // 4. It then sends an HTTP response back to the data plane with status code as “"200"“, + // “content-type“ as “"application/json"“ and sets the JSON text as the body. + HttpService *ExtProcHttpService `protobuf:"bytes,20,opt,name=http_service,json=httpService,proto3" json:"http_service,omitempty"` + // By default, if in the following cases: + // + // 1. The gRPC stream cannot be established. + // + // 2. The gRPC stream is closed prematurely with an error. + // + // 3. The external processing timeouts. + // + // 4. The ext_proc server sends back spurious response messages. + // + // The filter will fail and a local reply with error code + // 504(for timeout case) or 500(for all other cases), will be sent to the downstream. + // + // However, with this parameter set to true and if the above cases happen, the processing + // continues without error. + FailureModeAllow bool `protobuf:"varint,2,opt,name=failure_mode_allow,json=failureModeAllow,proto3" json:"failure_mode_allow,omitempty"` + // Specifies default options for how HTTP headers, trailers, and bodies are + // sent. See “ProcessingMode“ for details. + ProcessingMode *ProcessingMode `protobuf:"bytes,3,opt,name=processing_mode,json=processingMode,proto3" json:"processing_mode,omitempty"` + // The data plane provides a number of :ref:`attributes ` + // for expressive policies. Each attribute name provided in this field will be + // matched against that list and populated in the + // :ref:`ProcessingRequest.attributes ` field. + // See the :ref:`attribute documentation ` + // for the list of supported attributes and their types. + RequestAttributes []string `protobuf:"bytes,5,rep,name=request_attributes,json=requestAttributes,proto3" json:"request_attributes,omitempty"` + // The data plane provides a number of :ref:`attributes ` + // for expressive policies. Each attribute name provided in this field will be + // matched against that list and populated in the + // :ref:`ProcessingRequest.attributes ` field. + // See the :ref:`attribute documentation ` + // for the list of supported attributes and their types. + ResponseAttributes []string `protobuf:"bytes,6,rep,name=response_attributes,json=responseAttributes,proto3" json:"response_attributes,omitempty"` + // Specifies the timeout for each individual message sent on the stream. + // Whenever the data plane sends a message on the stream that requires a + // response, it will reset this timer, and will stop processing and return + // an error (subject to the processing mode) if the timer expires before a + // matching response is received. There is no timeout when the filter is + // running in observability mode or when the body send mode is + // “FULL_DUPLEX_STREAMED“ or “GRPC“. Zero is a valid config which means + // the timer will be triggered immediately. If not configured, default is + // 200 milliseconds. + MessageTimeout *durationpb.Duration `protobuf:"bytes,7,opt,name=message_timeout,json=messageTimeout,proto3" json:"message_timeout,omitempty"` + // Optional additional prefix to use when emitting statistics. This allows to distinguish + // emitted statistics between configured “ext_proc“ filters in an HTTP filter chain. + StatPrefix string `protobuf:"bytes,8,opt,name=stat_prefix,json=statPrefix,proto3" json:"stat_prefix,omitempty"` + // Rules that determine what modifications an external processing server may + // make to message headers. If not set, all headers may be modified except + // for "host", ":authority", ":scheme", ":method", and headers that start + // with the header prefix set via + // :ref:`header_prefix ` + // (which is usually "x-envoy"). + // Note that changing headers such as "host" or ":authority" may not in itself + // change the data plane's routing decision, as routes can be cached. To also force the + // route to be recomputed, set the + // :ref:`clear_route_cache ` + // field to true in the same response. + MutationRules *v31.HeaderMutationRules `protobuf:"bytes,9,opt,name=mutation_rules,json=mutationRules,proto3" json:"mutation_rules,omitempty"` + // Specify the upper bound of + // :ref:`override_message_timeout ` + // If not specified, by default it is 0, which will effectively disable the “override_message_timeout“ API. + MaxMessageTimeout *durationpb.Duration `protobuf:"bytes,10,opt,name=max_message_timeout,json=maxMessageTimeout,proto3" json:"max_message_timeout,omitempty"` + // Allow headers matching the “forward_rules“ to be forwarded to the external processing server. + // If not set, all headers are forwarded to the external processing server. + ForwardRules *HeaderForwardingRules `protobuf:"bytes,12,opt,name=forward_rules,json=forwardRules,proto3" json:"forward_rules,omitempty"` + // Additional metadata to be added to the filter state for logging purposes. The metadata + // will be added to StreamInfo's filter state under the namespace corresponding to the + // ext_proc filter name. + FilterMetadata *structpb.Struct `protobuf:"bytes,13,opt,name=filter_metadata,json=filterMetadata,proto3" json:"filter_metadata,omitempty"` + // If “allow_mode_override“ is set to true, the filter config :ref:`processing_mode + // ` + // can be overridden by the response message from the external processing server + // :ref:`mode_override `. + // If not set, “mode_override“ API in the response message will be ignored. + // Mode override is not supported if the body send mode is “FULL_DUPLEX_STREAMED“. + AllowModeOverride bool `protobuf:"varint,14,opt,name=allow_mode_override,json=allowModeOverride,proto3" json:"allow_mode_override,omitempty"` + // If set to true, ignore the + // :ref:`immediate_response ` + // message in an external processor response. In such case, no local reply will be sent. + // Instead, the stream to the external processor will be closed. There will be no + // more external processing for this stream from now on. + DisableImmediateResponse bool `protobuf:"varint,15,opt,name=disable_immediate_response,json=disableImmediateResponse,proto3" json:"disable_immediate_response,omitempty"` + // Options related to the sending and receiving of dynamic metadata. + MetadataOptions *MetadataOptions `protobuf:"bytes,16,opt,name=metadata_options,json=metadataOptions,proto3" json:"metadata_options,omitempty"` + // If true, send each part of the HTTP request or response specified by “ProcessingMode“ + // without pausing on filter chain iteration. It is "Send and Go" mode that can be used + // by external processor to observe the request's data and status. In this mode: + // + // 1. Only “STREAMED“, “GRPC“, and “NONE“ body processing modes are supported; for any + // other body processing mode, the body will not be sent. + // + // 2. External processor should not send back processing response, as any responses will be ignored. + // This also means that + // :ref:`message_timeout ` + // restriction doesn't apply to this mode. + // + // 3. External processor may still close the stream to indicate that no more messages are needed. + // + // .. warning:: + // + // Flow control is a necessary mechanism to prevent the fast sender (either downstream client or upstream server) + // from overwhelming the external processor when its processing speed is slower. + // This protective measure is being explored and developed but has not been ready yet, so please use your own + // discretion when enabling this feature. + // This work is currently tracked under https://github.com/envoyproxy/envoy/issues/33319. + ObservabilityMode bool `protobuf:"varint,17,opt,name=observability_mode,json=observabilityMode,proto3" json:"observability_mode,omitempty"` + // Prevents clearing the route-cache when the + // :ref:`clear_route_cache ` + // field is set in an external processor response. + // Only one of “disable_clear_route_cache“ or “route_cache_action“ can be set. + // It is recommended to set “route_cache_action“ which supersedes “disable_clear_route_cache“. + DisableClearRouteCache bool `protobuf:"varint,11,opt,name=disable_clear_route_cache,json=disableClearRouteCache,proto3" json:"disable_clear_route_cache,omitempty"` + // Specifies the action to be taken when an external processor response is + // received in response to request headers. It is recommended to set this field rather than set + // :ref:`disable_clear_route_cache `. + // Only one of “disable_clear_route_cache“ or “route_cache_action“ can be set. + RouteCacheAction ExternalProcessor_RouteCacheAction `protobuf:"varint,18,opt,name=route_cache_action,json=routeCacheAction,proto3,enum=envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor_RouteCacheAction" json:"route_cache_action,omitempty"` + // Specifies the deferred closure timeout for gRPC stream that connects to external processor. Currently, the deferred stream closure + // is only used in :ref:`observability_mode `. + // In observability mode, gRPC streams may be held open to the external processor longer than the lifetime of the regular client to + // backend stream lifetime. In this case, the data plane will eventually timeout the external processor stream according to this time limit. + // The default value is 5000 milliseconds (5 seconds) if not specified. + DeferredCloseTimeout *durationpb.Duration `protobuf:"bytes,19,opt,name=deferred_close_timeout,json=deferredCloseTimeout,proto3" json:"deferred_close_timeout,omitempty"` + // Send body to the side stream server once it arrives without waiting for the header response from that server. + // It only works for “STREAMED“ body processing mode. For any other body + // processing modes, it is ignored. + // The server has two options upon receiving a header request: + // + // 1. Instant Response: send the header response as soon as the header request is received. + // + // 2. Delayed Response: wait for the body before sending any response. + // + // In all scenarios, the header-body ordering must always be maintained. + // + // If enabled the data plane will ignore the + // :ref:`mode_override ` + // value that the server sends in the header response. This is because the data plane may have already + // sent the body to the server, prior to processing the header response. + SendBodyWithoutWaitingForHeaderResponse bool `protobuf:"varint,21,opt,name=send_body_without_waiting_for_header_response,json=sendBodyWithoutWaitingForHeaderResponse,proto3" json:"send_body_without_waiting_for_header_response,omitempty"` + // When :ref:`allow_mode_override + // ` is enabled and + // “allowed_override_modes“ is configured, the filter config :ref:`processing_mode + // ` + // can only be overridden by the response message from the external processing server iff the + // :ref:`mode_override ` is allowed by + // the “allowed_override_modes“ allow-list below. + // Since “request_header_mode“ is not applicable in any way, it's ignored in comparison. + AllowedOverrideModes []*ProcessingMode `protobuf:"bytes,22,rep,name=allowed_override_modes,json=allowedOverrideModes,proto3" json:"allowed_override_modes,omitempty"` + // Decorator to introduce custom logic that runs after the “ProcessingRequest“ is constructed, but + // before it is sent to the External Processor. The “ProcessingRequest“ may be modified. + // + // .. note:: + // + // Processing request modifiers are currently in alpha. + // + // [#extension-category: envoy.http.ext_proc.processing_request_modifiers] + ProcessingRequestModifier *v3.TypedExtensionConfig `protobuf:"bytes,25,opt,name=processing_request_modifier,json=processingRequestModifier,proto3" json:"processing_request_modifier,omitempty"` + // Decorator to introduce custom logic that runs after a message received from + // the External Processor is processed, but before continuing filter chain iteration. + // + // .. note:: + // + // Response processors are currently in alpha. + // + // [#extension-category: envoy.http.ext_proc.response_processors] + OnProcessingResponse *v3.TypedExtensionConfig `protobuf:"bytes,23,opt,name=on_processing_response,json=onProcessingResponse,proto3" json:"on_processing_response,omitempty"` + // Sets the HTTP status code that is returned to the client when the external processing server returns + // an error, fails to respond, or cannot be reached. + // + // The default status is “HTTP 500 Internal Server Error“. + StatusOnError *v32.HttpStatus `protobuf:"bytes,24,opt,name=status_on_error,json=statusOnError,proto3" json:"status_on_error,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ExternalProcessor) Reset() { + *x = ExternalProcessor{} + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ExternalProcessor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExternalProcessor) ProtoMessage() {} + +func (x *ExternalProcessor) ProtoReflect() protoreflect.Message { + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[0] + 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 ExternalProcessor.ProtoReflect.Descriptor instead. +func (*ExternalProcessor) Descriptor() ([]byte, []int) { + return file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescGZIP(), []int{0} +} + +func (x *ExternalProcessor) GetGrpcService() *v3.GrpcService { + if x != nil { + return x.GrpcService + } + return nil +} + +func (x *ExternalProcessor) GetHttpService() *ExtProcHttpService { + if x != nil { + return x.HttpService + } + return nil +} + +func (x *ExternalProcessor) GetFailureModeAllow() bool { + if x != nil { + return x.FailureModeAllow + } + return false +} + +func (x *ExternalProcessor) GetProcessingMode() *ProcessingMode { + if x != nil { + return x.ProcessingMode + } + return nil +} + +func (x *ExternalProcessor) GetRequestAttributes() []string { + if x != nil { + return x.RequestAttributes + } + return nil +} + +func (x *ExternalProcessor) GetResponseAttributes() []string { + if x != nil { + return x.ResponseAttributes + } + return nil +} + +func (x *ExternalProcessor) GetMessageTimeout() *durationpb.Duration { + if x != nil { + return x.MessageTimeout + } + return nil +} + +func (x *ExternalProcessor) GetStatPrefix() string { + if x != nil { + return x.StatPrefix + } + return "" +} + +func (x *ExternalProcessor) GetMutationRules() *v31.HeaderMutationRules { + if x != nil { + return x.MutationRules + } + return nil +} + +func (x *ExternalProcessor) GetMaxMessageTimeout() *durationpb.Duration { + if x != nil { + return x.MaxMessageTimeout + } + return nil +} + +func (x *ExternalProcessor) GetForwardRules() *HeaderForwardingRules { + if x != nil { + return x.ForwardRules + } + return nil +} + +func (x *ExternalProcessor) GetFilterMetadata() *structpb.Struct { + if x != nil { + return x.FilterMetadata + } + return nil +} + +func (x *ExternalProcessor) GetAllowModeOverride() bool { + if x != nil { + return x.AllowModeOverride + } + return false +} + +func (x *ExternalProcessor) GetDisableImmediateResponse() bool { + if x != nil { + return x.DisableImmediateResponse + } + return false +} + +func (x *ExternalProcessor) GetMetadataOptions() *MetadataOptions { + if x != nil { + return x.MetadataOptions + } + return nil +} + +func (x *ExternalProcessor) GetObservabilityMode() bool { + if x != nil { + return x.ObservabilityMode + } + return false +} + +func (x *ExternalProcessor) GetDisableClearRouteCache() bool { + if x != nil { + return x.DisableClearRouteCache + } + return false +} + +func (x *ExternalProcessor) GetRouteCacheAction() ExternalProcessor_RouteCacheAction { + if x != nil { + return x.RouteCacheAction + } + return ExternalProcessor_DEFAULT +} + +func (x *ExternalProcessor) GetDeferredCloseTimeout() *durationpb.Duration { + if x != nil { + return x.DeferredCloseTimeout + } + return nil +} + +func (x *ExternalProcessor) GetSendBodyWithoutWaitingForHeaderResponse() bool { + if x != nil { + return x.SendBodyWithoutWaitingForHeaderResponse + } + return false +} + +func (x *ExternalProcessor) GetAllowedOverrideModes() []*ProcessingMode { + if x != nil { + return x.AllowedOverrideModes + } + return nil +} + +func (x *ExternalProcessor) GetProcessingRequestModifier() *v3.TypedExtensionConfig { + if x != nil { + return x.ProcessingRequestModifier + } + return nil +} + +func (x *ExternalProcessor) GetOnProcessingResponse() *v3.TypedExtensionConfig { + if x != nil { + return x.OnProcessingResponse + } + return nil +} + +func (x *ExternalProcessor) GetStatusOnError() *v32.HttpStatus { + if x != nil { + return x.StatusOnError + } + return nil +} + +// ExtProcHttpService is used for HTTP communication between the filter and the external processing service. +type ExtProcHttpService struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Sets the HTTP service which the external processing requests must be sent to. + HttpService *v3.HttpService `protobuf:"bytes,1,opt,name=http_service,json=httpService,proto3" json:"http_service,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ExtProcHttpService) Reset() { + *x = ExtProcHttpService{} + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ExtProcHttpService) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExtProcHttpService) ProtoMessage() {} + +func (x *ExtProcHttpService) ProtoReflect() protoreflect.Message { + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[1] + 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 ExtProcHttpService.ProtoReflect.Descriptor instead. +func (*ExtProcHttpService) Descriptor() ([]byte, []int) { + return file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescGZIP(), []int{1} +} + +func (x *ExtProcHttpService) GetHttpService() *v3.HttpService { + if x != nil { + return x.HttpService + } + return nil +} + +// The MetadataOptions structure defines options for the sending and receiving of +// dynamic metadata. Specifically, which namespaces to send to the server, whether +// metadata returned by the server may be written, and how that metadata may be written. +type MetadataOptions struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Describes which typed or untyped filter dynamic metadata namespaces to forward to + // the external processing server. + ForwardingNamespaces *MetadataOptions_MetadataNamespaces `protobuf:"bytes,1,opt,name=forwarding_namespaces,json=forwardingNamespaces,proto3" json:"forwarding_namespaces,omitempty"` + // Describes which typed or untyped filter dynamic metadata namespaces to accept from + // the external processing server. Set to empty or leave unset to disallow writing + // any received dynamic metadata. Receiving of typed metadata is not supported. + ReceivingNamespaces *MetadataOptions_MetadataNamespaces `protobuf:"bytes,2,opt,name=receiving_namespaces,json=receivingNamespaces,proto3" json:"receiving_namespaces,omitempty"` + // Describes which cluster metadata namespaces to forward to + // the external processing server. + // .. note:: + // This is the least specific metadata. Should there be any namespace collision, + // cluster level metadata can be overridden by filter metadata. + ClusterMetadataForwardingNamespaces *MetadataOptions_MetadataNamespaces `protobuf:"bytes,3,opt,name=cluster_metadata_forwarding_namespaces,json=clusterMetadataForwardingNamespaces,proto3" json:"cluster_metadata_forwarding_namespaces,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MetadataOptions) Reset() { + *x = MetadataOptions{} + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MetadataOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MetadataOptions) ProtoMessage() {} + +func (x *MetadataOptions) ProtoReflect() protoreflect.Message { + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[2] + 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 MetadataOptions.ProtoReflect.Descriptor instead. +func (*MetadataOptions) Descriptor() ([]byte, []int) { + return file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescGZIP(), []int{2} +} + +func (x *MetadataOptions) GetForwardingNamespaces() *MetadataOptions_MetadataNamespaces { + if x != nil { + return x.ForwardingNamespaces + } + return nil +} + +func (x *MetadataOptions) GetReceivingNamespaces() *MetadataOptions_MetadataNamespaces { + if x != nil { + return x.ReceivingNamespaces + } + return nil +} + +func (x *MetadataOptions) GetClusterMetadataForwardingNamespaces() *MetadataOptions_MetadataNamespaces { + if x != nil { + return x.ClusterMetadataForwardingNamespaces + } + return nil +} + +// The HeaderForwardingRules structure specifies what headers are +// allowed to be forwarded to the external processing server. +// +// This works as below: +// +// 1. If neither “allowed_headers“ nor “disallowed_headers“ is set, all headers are forwarded. +// 2. If both “allowed_headers“ and “disallowed_headers“ are set, only headers in the +// “allowed_headers“ but not in the “disallowed_headers“ are forwarded. +// 3. If “allowed_headers“ is set, and “disallowed_headers“ is not set, only headers in +// the “allowed_headers“ are forwarded. +// 4. If “disallowed_headers“ is set, and “allowed_headers“ is not set, all headers except +// headers in the “disallowed_headers“ are forwarded. +type HeaderForwardingRules struct { + state protoimpl.MessageState `protogen:"open.v1"` + // If set, specifically allow any header in this list to be forwarded to the external + // processing server. This can be overridden by the below “disallowed_headers“. + AllowedHeaders *v33.ListStringMatcher `protobuf:"bytes,1,opt,name=allowed_headers,json=allowedHeaders,proto3" json:"allowed_headers,omitempty"` + // If set, specifically disallow any header in this list to be forwarded to the external + // processing server. This overrides the above “allowed_headers“ if a header matches both. + DisallowedHeaders *v33.ListStringMatcher `protobuf:"bytes,2,opt,name=disallowed_headers,json=disallowedHeaders,proto3" json:"disallowed_headers,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HeaderForwardingRules) Reset() { + *x = HeaderForwardingRules{} + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *HeaderForwardingRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HeaderForwardingRules) ProtoMessage() {} + +func (x *HeaderForwardingRules) ProtoReflect() protoreflect.Message { + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[3] + 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 HeaderForwardingRules.ProtoReflect.Descriptor instead. +func (*HeaderForwardingRules) Descriptor() ([]byte, []int) { + return file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescGZIP(), []int{3} +} + +func (x *HeaderForwardingRules) GetAllowedHeaders() *v33.ListStringMatcher { + if x != nil { + return x.AllowedHeaders + } + return nil +} + +func (x *HeaderForwardingRules) GetDisallowedHeaders() *v33.ListStringMatcher { + if x != nil { + return x.DisallowedHeaders + } + return nil +} + +// Extra settings that may be added to per-route configuration for a +// virtual host or cluster. +type ExtProcPerRoute struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Override: + // + // *ExtProcPerRoute_Disabled + // *ExtProcPerRoute_Overrides + Override isExtProcPerRoute_Override `protobuf_oneof:"override"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ExtProcPerRoute) Reset() { + *x = ExtProcPerRoute{} + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ExtProcPerRoute) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExtProcPerRoute) ProtoMessage() {} + +func (x *ExtProcPerRoute) ProtoReflect() protoreflect.Message { + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[4] + 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 ExtProcPerRoute.ProtoReflect.Descriptor instead. +func (*ExtProcPerRoute) Descriptor() ([]byte, []int) { + return file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescGZIP(), []int{4} +} + +func (x *ExtProcPerRoute) GetOverride() isExtProcPerRoute_Override { + if x != nil { + return x.Override + } + return nil +} + +func (x *ExtProcPerRoute) GetDisabled() bool { + if x != nil { + if x, ok := x.Override.(*ExtProcPerRoute_Disabled); ok { + return x.Disabled + } + } + return false +} + +func (x *ExtProcPerRoute) GetOverrides() *ExtProcOverrides { + if x != nil { + if x, ok := x.Override.(*ExtProcPerRoute_Overrides); ok { + return x.Overrides + } + } + return nil +} + +type isExtProcPerRoute_Override interface { + isExtProcPerRoute_Override() +} + +type ExtProcPerRoute_Disabled struct { + // Disable the filter for this particular vhost or route. + // If disabled is specified in multiple per-filter-configs, the most specific one will be used. + Disabled bool `protobuf:"varint,1,opt,name=disabled,proto3,oneof"` +} + +type ExtProcPerRoute_Overrides struct { + // Override aspects of the configuration for this route. A set of + // overrides in a more specific configuration will override a "disabled" + // flag set in a less-specific one. + Overrides *ExtProcOverrides `protobuf:"bytes,2,opt,name=overrides,proto3,oneof"` +} + +func (*ExtProcPerRoute_Disabled) isExtProcPerRoute_Override() {} + +func (*ExtProcPerRoute_Overrides) isExtProcPerRoute_Override() {} + +// Overrides that may be set on a per-route basis +// [#next-free-field: 10] +type ExtProcOverrides struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Set a different processing mode for this route than the default. + ProcessingMode *ProcessingMode `protobuf:"bytes,1,opt,name=processing_mode,json=processingMode,proto3" json:"processing_mode,omitempty"` + // [#not-implemented-hide:] + // Set a different asynchronous processing option than the default. + // Deprecated and not implemented. + // + // Deprecated: Marked as deprecated in envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto. + AsyncMode bool `protobuf:"varint,2,opt,name=async_mode,json=asyncMode,proto3" json:"async_mode,omitempty"` + // [#not-implemented-hide:] + // Set different optional attributes than the default setting of the + // “request_attributes“ field. + RequestAttributes []string `protobuf:"bytes,3,rep,name=request_attributes,json=requestAttributes,proto3" json:"request_attributes,omitempty"` + // [#not-implemented-hide:] + // Set different optional properties than the default setting of the + // “response_attributes“ field. + ResponseAttributes []string `protobuf:"bytes,4,rep,name=response_attributes,json=responseAttributes,proto3" json:"response_attributes,omitempty"` + // Set a different gRPC service for this route than the default. + GrpcService *v3.GrpcService `protobuf:"bytes,5,opt,name=grpc_service,json=grpcService,proto3" json:"grpc_service,omitempty"` + // Options related to the sending and receiving of dynamic metadata. + // Lists of forwarding and receiving namespaces will be overridden in their entirety, + // meaning the most-specific config that specifies this override will be the final + // config used. It is the prerogative of the control plane to ensure this + // most-specific config contains the correct final overrides. + MetadataOptions *MetadataOptions `protobuf:"bytes,6,opt,name=metadata_options,json=metadataOptions,proto3" json:"metadata_options,omitempty"` + // Additional metadata to include into streams initiated to the “ext_proc“ gRPC + // service. This can be used for scenarios in which additional ad hoc + // authorization headers (e.g. “x-foo-bar: baz-key“) are to be injected or + // when a route needs to partially override inherited metadata. + GrpcInitialMetadata []*v3.HeaderValue `protobuf:"bytes,7,rep,name=grpc_initial_metadata,json=grpcInitialMetadata,proto3" json:"grpc_initial_metadata,omitempty"` + // If true, the filter will not fail closed if the gRPC stream is prematurely closed + // or could not be opened. This field is the per-route override of + // :ref:`failure_mode_allow `. + FailureModeAllow *wrapperspb.BoolValue `protobuf:"bytes,8,opt,name=failure_mode_allow,json=failureModeAllow,proto3" json:"failure_mode_allow,omitempty"` + // Decorator to introduce custom logic that runs after the “ProcessingRequest“ is constructed, but + // before it is sent to the External Processor. The “ProcessingRequest“ may be modified. + // This is a per-route override of + // :ref:`processing_request_modifier `. + ProcessingRequestModifier *v3.TypedExtensionConfig `protobuf:"bytes,9,opt,name=processing_request_modifier,json=processingRequestModifier,proto3" json:"processing_request_modifier,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ExtProcOverrides) Reset() { + *x = ExtProcOverrides{} + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ExtProcOverrides) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExtProcOverrides) ProtoMessage() {} + +func (x *ExtProcOverrides) ProtoReflect() protoreflect.Message { + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[5] + 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 ExtProcOverrides.ProtoReflect.Descriptor instead. +func (*ExtProcOverrides) Descriptor() ([]byte, []int) { + return file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescGZIP(), []int{5} +} + +func (x *ExtProcOverrides) GetProcessingMode() *ProcessingMode { + if x != nil { + return x.ProcessingMode + } + return nil +} + +// Deprecated: Marked as deprecated in envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto. +func (x *ExtProcOverrides) GetAsyncMode() bool { + if x != nil { + return x.AsyncMode + } + return false +} + +func (x *ExtProcOverrides) GetRequestAttributes() []string { + if x != nil { + return x.RequestAttributes + } + return nil +} + +func (x *ExtProcOverrides) GetResponseAttributes() []string { + if x != nil { + return x.ResponseAttributes + } + return nil +} + +func (x *ExtProcOverrides) GetGrpcService() *v3.GrpcService { + if x != nil { + return x.GrpcService + } + return nil +} + +func (x *ExtProcOverrides) GetMetadataOptions() *MetadataOptions { + if x != nil { + return x.MetadataOptions + } + return nil +} + +func (x *ExtProcOverrides) GetGrpcInitialMetadata() []*v3.HeaderValue { + if x != nil { + return x.GrpcInitialMetadata + } + return nil +} + +func (x *ExtProcOverrides) GetFailureModeAllow() *wrapperspb.BoolValue { + if x != nil { + return x.FailureModeAllow + } + return nil +} + +func (x *ExtProcOverrides) GetProcessingRequestModifier() *v3.TypedExtensionConfig { + if x != nil { + return x.ProcessingRequestModifier + } + return nil +} + +type MetadataOptions_MetadataNamespaces struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Specifies a list of metadata namespaces whose values, if present, + // will be passed to the “ext_proc“ service as an opaque “protobuf::Struct“. + Untyped []string `protobuf:"bytes,1,rep,name=untyped,proto3" json:"untyped,omitempty"` + // Specifies a list of metadata namespaces whose values, if present, + // will be passed to the “ext_proc“ service as a “protobuf::Any“. This allows + // envoy and the external processing server to share the protobuf message + // definition for safe parsing. + Typed []string `protobuf:"bytes,2,rep,name=typed,proto3" json:"typed,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MetadataOptions_MetadataNamespaces) Reset() { + *x = MetadataOptions_MetadataNamespaces{} + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MetadataOptions_MetadataNamespaces) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MetadataOptions_MetadataNamespaces) ProtoMessage() {} + +func (x *MetadataOptions_MetadataNamespaces) ProtoReflect() protoreflect.Message { + mi := &file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[6] + 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 MetadataOptions_MetadataNamespaces.ProtoReflect.Descriptor instead. +func (*MetadataOptions_MetadataNamespaces) Descriptor() ([]byte, []int) { + return file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescGZIP(), []int{2, 0} +} + +func (x *MetadataOptions_MetadataNamespaces) GetUntyped() []string { + if x != nil { + return x.Untyped + } + return nil +} + +func (x *MetadataOptions_MetadataNamespaces) GetTyped() []string { + if x != nil { + return x.Typed + } + return nil +} + +var File_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto protoreflect.FileDescriptor + +const file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDesc = "" + + "\n" + + "8envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto\x12)envoy.extensions.filters.http.ext_proc.v3\x1a:envoy/config/common/mutation_rules/v3/mutation_rules.proto\x1a\x1fenvoy/config/core/v3/base.proto\x1a$envoy/config/core/v3/extension.proto\x1a'envoy/config/core/v3/grpc_service.proto\x1a'envoy/config/core/v3/http_service.proto\x1a?envoy/extensions/filters/http/ext_proc/v3/processing_mode.proto\x1a\"envoy/type/matcher/v3/string.proto\x1a\x1fenvoy/type/v3/http_status.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x1fxds/annotations/v3/status.proto\x1a#envoy/annotations/deprecation.proto\x1a\x1eudpa/annotations/migrate.proto\x1a\x1dudpa/annotations/status.proto\x1a\x17validate/validate.proto\"\xdc\x10\n" + + "\x11ExternalProcessor\x12c\n" + + "\fgrpc_service\x18\x01 \x01(\v2!.envoy.config.core.v3.GrpcServiceB\x1d\xf2\x98\xfe\x8f\x05\x17\x12\x15ext_proc_service_typeR\vgrpcService\x12\x87\x01\n" + + "\fhttp_service\x18\x14 \x01(\v2=.envoy.extensions.filters.http.ext_proc.v3.ExtProcHttpServiceB%\xf2\x98\xfe\x8f\x05\x17\x12\x15ext_proc_service_type\xd2Ƥ\xe1\x06\x02\b\x01R\vhttpService\x12,\n" + + "\x12failure_mode_allow\x18\x02 \x01(\bR\x10failureModeAllow\x12b\n" + + "\x0fprocessing_mode\x18\x03 \x01(\v29.envoy.extensions.filters.http.ext_proc.v3.ProcessingModeR\x0eprocessingMode\x12-\n" + + "\x12request_attributes\x18\x05 \x03(\tR\x11requestAttributes\x12/\n" + + "\x13response_attributes\x18\x06 \x03(\tR\x12responseAttributes\x12Q\n" + + "\x0fmessage_timeout\x18\a \x01(\v2\x19.google.protobuf.DurationB\r\xfaB\n" + + "\xaa\x01\a\"\x03\b\x90\x1c2\x00R\x0emessageTimeout\x12\x1f\n" + + "\vstat_prefix\x18\b \x01(\tR\n" + + "statPrefix\x12a\n" + + "\x0emutation_rules\x18\t \x01(\v2:.envoy.config.common.mutation_rules.v3.HeaderMutationRulesR\rmutationRules\x12X\n" + + "\x13max_message_timeout\x18\n" + + " \x01(\v2\x19.google.protobuf.DurationB\r\xfaB\n" + + "\xaa\x01\a\"\x03\b\x90\x1c2\x00R\x11maxMessageTimeout\x12e\n" + + "\rforward_rules\x18\f \x01(\v2@.envoy.extensions.filters.http.ext_proc.v3.HeaderForwardingRulesR\fforwardRules\x12@\n" + + "\x0ffilter_metadata\x18\r \x01(\v2\x17.google.protobuf.StructR\x0efilterMetadata\x12.\n" + + "\x13allow_mode_override\x18\x0e \x01(\bR\x11allowModeOverride\x12<\n" + + "\x1adisable_immediate_response\x18\x0f \x01(\bR\x18disableImmediateResponse\x12e\n" + + "\x10metadata_options\x18\x10 \x01(\v2:.envoy.extensions.filters.http.ext_proc.v3.MetadataOptionsR\x0fmetadataOptions\x12-\n" + + "\x12observability_mode\x18\x11 \x01(\bR\x11observabilityMode\x12Y\n" + + "\x19disable_clear_route_cache\x18\v \x01(\bB\x1e\xf2\x98\xfe\x8f\x05\x18\x12\x16clear_route_cache_typeR\x16disableClearRouteCache\x12\x9b\x01\n" + + "\x12route_cache_action\x18\x12 \x01(\x0e2M.envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.RouteCacheActionB\x1e\xf2\x98\xfe\x8f\x05\x18\x12\x16clear_route_cache_typeR\x10routeCacheAction\x12O\n" + + "\x16deferred_close_timeout\x18\x13 \x01(\v2\x19.google.protobuf.DurationR\x14deferredCloseTimeout\x12^\n" + + "-send_body_without_waiting_for_header_response\x18\x15 \x01(\bR'sendBodyWithoutWaitingForHeaderResponse\x12o\n" + + "\x16allowed_override_modes\x18\x16 \x03(\v29.envoy.extensions.filters.http.ext_proc.v3.ProcessingModeR\x14allowedOverrideModes\x12t\n" + + "\x1bprocessing_request_modifier\x18\x19 \x01(\v2*.envoy.config.core.v3.TypedExtensionConfigB\b\xd2Ƥ\xe1\x06\x02\b\x01R\x19processingRequestModifier\x12j\n" + + "\x16on_processing_response\x18\x17 \x01(\v2*.envoy.config.core.v3.TypedExtensionConfigB\b\xd2Ƥ\xe1\x06\x02\b\x01R\x14onProcessingResponse\x12A\n" + + "\x0fstatus_on_error\x18\x18 \x01(\v2\x19.envoy.type.v3.HttpStatusR\rstatusOnError\"6\n" + + "\x10RouteCacheAction\x12\v\n" + + "\aDEFAULT\x10\x00\x12\t\n" + + "\x05CLEAR\x10\x01\x12\n" + + "\n" + + "\x06RETAIN\x10\x02J\x04\b\x04\x10\x05R\n" + + "async_mode\"Z\n" + + "\x12ExtProcHttpService\x12D\n" + + "\fhttp_service\x18\x01 \x01(\v2!.envoy.config.core.v3.HttpServiceR\vhttpService\"\x84\x04\n" + + "\x0fMetadataOptions\x12\x82\x01\n" + + "\x15forwarding_namespaces\x18\x01 \x01(\v2M.envoy.extensions.filters.http.ext_proc.v3.MetadataOptions.MetadataNamespacesR\x14forwardingNamespaces\x12\x80\x01\n" + + "\x14receiving_namespaces\x18\x02 \x01(\v2M.envoy.extensions.filters.http.ext_proc.v3.MetadataOptions.MetadataNamespacesR\x13receivingNamespaces\x12\xa2\x01\n" + + "&cluster_metadata_forwarding_namespaces\x18\x03 \x01(\v2M.envoy.extensions.filters.http.ext_proc.v3.MetadataOptions.MetadataNamespacesR#clusterMetadataForwardingNamespaces\x1aD\n" + + "\x12MetadataNamespaces\x12\x18\n" + + "\auntyped\x18\x01 \x03(\tR\auntyped\x12\x14\n" + + "\x05typed\x18\x02 \x03(\tR\x05typed\"\xc3\x01\n" + + "\x15HeaderForwardingRules\x12Q\n" + + "\x0fallowed_headers\x18\x01 \x01(\v2(.envoy.type.matcher.v3.ListStringMatcherR\x0eallowedHeaders\x12W\n" + + "\x12disallowed_headers\x18\x02 \x01(\v2(.envoy.type.matcher.v3.ListStringMatcherR\x11disallowedHeaders\"\xa6\x01\n" + + "\x0fExtProcPerRoute\x12%\n" + + "\bdisabled\x18\x01 \x01(\bB\a\xfaB\x04j\x02\b\x01H\x00R\bdisabled\x12[\n" + + "\toverrides\x18\x02 \x01(\v2;.envoy.extensions.filters.http.ext_proc.v3.ExtProcOverridesH\x00R\toverridesB\x0f\n" + + "\boverride\x12\x03\xf8B\x01\"\xc6\x05\n" + + "\x10ExtProcOverrides\x12b\n" + + "\x0fprocessing_mode\x18\x01 \x01(\v29.envoy.extensions.filters.http.ext_proc.v3.ProcessingModeR\x0eprocessingMode\x12*\n" + + "\n" + + "async_mode\x18\x02 \x01(\bB\v\x92dž\xd8\x04\x033.0\x18\x01R\tasyncMode\x12-\n" + + "\x12request_attributes\x18\x03 \x03(\tR\x11requestAttributes\x12/\n" + + "\x13response_attributes\x18\x04 \x03(\tR\x12responseAttributes\x12D\n" + + "\fgrpc_service\x18\x05 \x01(\v2!.envoy.config.core.v3.GrpcServiceR\vgrpcService\x12e\n" + + "\x10metadata_options\x18\x06 \x01(\v2:.envoy.extensions.filters.http.ext_proc.v3.MetadataOptionsR\x0fmetadataOptions\x12U\n" + + "\x15grpc_initial_metadata\x18\a \x03(\v2!.envoy.config.core.v3.HeaderValueR\x13grpcInitialMetadata\x12H\n" + + "\x12failure_mode_allow\x18\b \x01(\v2\x1a.google.protobuf.BoolValueR\x10failureModeAllow\x12t\n" + + "\x1bprocessing_request_modifier\x18\t \x01(\v2*.envoy.config.core.v3.TypedExtensionConfigB\b\xd2Ƥ\xe1\x06\x02\b\x01R\x19processingRequestModifierB\xae\x01\xba\x80\xc8\xd1\x06\x02\x10\x02\n" + + "7io.envoyproxy.envoy.extensions.filters.http.ext_proc.v3B\fExtProcProtoP\x01Z[github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3;ext_procv3b\x06proto3" + +var ( + file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescOnce sync.Once + file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescData []byte +) + +func file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescGZIP() []byte { + file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescOnce.Do(func() { + file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDesc), len(file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDesc))) + }) + return file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDescData +} + +var file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_goTypes = []any{ + (ExternalProcessor_RouteCacheAction)(0), // 0: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.RouteCacheAction + (*ExternalProcessor)(nil), // 1: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor + (*ExtProcHttpService)(nil), // 2: envoy.extensions.filters.http.ext_proc.v3.ExtProcHttpService + (*MetadataOptions)(nil), // 3: envoy.extensions.filters.http.ext_proc.v3.MetadataOptions + (*HeaderForwardingRules)(nil), // 4: envoy.extensions.filters.http.ext_proc.v3.HeaderForwardingRules + (*ExtProcPerRoute)(nil), // 5: envoy.extensions.filters.http.ext_proc.v3.ExtProcPerRoute + (*ExtProcOverrides)(nil), // 6: envoy.extensions.filters.http.ext_proc.v3.ExtProcOverrides + (*MetadataOptions_MetadataNamespaces)(nil), // 7: envoy.extensions.filters.http.ext_proc.v3.MetadataOptions.MetadataNamespaces + (*v3.GrpcService)(nil), // 8: envoy.config.core.v3.GrpcService + (*ProcessingMode)(nil), // 9: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode + (*durationpb.Duration)(nil), // 10: google.protobuf.Duration + (*v31.HeaderMutationRules)(nil), // 11: envoy.config.common.mutation_rules.v3.HeaderMutationRules + (*structpb.Struct)(nil), // 12: google.protobuf.Struct + (*v3.TypedExtensionConfig)(nil), // 13: envoy.config.core.v3.TypedExtensionConfig + (*v32.HttpStatus)(nil), // 14: envoy.type.v3.HttpStatus + (*v3.HttpService)(nil), // 15: envoy.config.core.v3.HttpService + (*v33.ListStringMatcher)(nil), // 16: envoy.type.matcher.v3.ListStringMatcher + (*v3.HeaderValue)(nil), // 17: envoy.config.core.v3.HeaderValue + (*wrapperspb.BoolValue)(nil), // 18: google.protobuf.BoolValue +} +var file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_depIdxs = []int32{ + 8, // 0: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.grpc_service:type_name -> envoy.config.core.v3.GrpcService + 2, // 1: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.http_service:type_name -> envoy.extensions.filters.http.ext_proc.v3.ExtProcHttpService + 9, // 2: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.processing_mode:type_name -> envoy.extensions.filters.http.ext_proc.v3.ProcessingMode + 10, // 3: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.message_timeout:type_name -> google.protobuf.Duration + 11, // 4: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.mutation_rules:type_name -> envoy.config.common.mutation_rules.v3.HeaderMutationRules + 10, // 5: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.max_message_timeout:type_name -> google.protobuf.Duration + 4, // 6: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.forward_rules:type_name -> envoy.extensions.filters.http.ext_proc.v3.HeaderForwardingRules + 12, // 7: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.filter_metadata:type_name -> google.protobuf.Struct + 3, // 8: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.metadata_options:type_name -> envoy.extensions.filters.http.ext_proc.v3.MetadataOptions + 0, // 9: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.route_cache_action:type_name -> envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.RouteCacheAction + 10, // 10: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.deferred_close_timeout:type_name -> google.protobuf.Duration + 9, // 11: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.allowed_override_modes:type_name -> envoy.extensions.filters.http.ext_proc.v3.ProcessingMode + 13, // 12: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.processing_request_modifier:type_name -> envoy.config.core.v3.TypedExtensionConfig + 13, // 13: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.on_processing_response:type_name -> envoy.config.core.v3.TypedExtensionConfig + 14, // 14: envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor.status_on_error:type_name -> envoy.type.v3.HttpStatus + 15, // 15: envoy.extensions.filters.http.ext_proc.v3.ExtProcHttpService.http_service:type_name -> envoy.config.core.v3.HttpService + 7, // 16: envoy.extensions.filters.http.ext_proc.v3.MetadataOptions.forwarding_namespaces:type_name -> envoy.extensions.filters.http.ext_proc.v3.MetadataOptions.MetadataNamespaces + 7, // 17: envoy.extensions.filters.http.ext_proc.v3.MetadataOptions.receiving_namespaces:type_name -> envoy.extensions.filters.http.ext_proc.v3.MetadataOptions.MetadataNamespaces + 7, // 18: envoy.extensions.filters.http.ext_proc.v3.MetadataOptions.cluster_metadata_forwarding_namespaces:type_name -> envoy.extensions.filters.http.ext_proc.v3.MetadataOptions.MetadataNamespaces + 16, // 19: envoy.extensions.filters.http.ext_proc.v3.HeaderForwardingRules.allowed_headers:type_name -> envoy.type.matcher.v3.ListStringMatcher + 16, // 20: envoy.extensions.filters.http.ext_proc.v3.HeaderForwardingRules.disallowed_headers:type_name -> envoy.type.matcher.v3.ListStringMatcher + 6, // 21: envoy.extensions.filters.http.ext_proc.v3.ExtProcPerRoute.overrides:type_name -> envoy.extensions.filters.http.ext_proc.v3.ExtProcOverrides + 9, // 22: envoy.extensions.filters.http.ext_proc.v3.ExtProcOverrides.processing_mode:type_name -> envoy.extensions.filters.http.ext_proc.v3.ProcessingMode + 8, // 23: envoy.extensions.filters.http.ext_proc.v3.ExtProcOverrides.grpc_service:type_name -> envoy.config.core.v3.GrpcService + 3, // 24: envoy.extensions.filters.http.ext_proc.v3.ExtProcOverrides.metadata_options:type_name -> envoy.extensions.filters.http.ext_proc.v3.MetadataOptions + 17, // 25: envoy.extensions.filters.http.ext_proc.v3.ExtProcOverrides.grpc_initial_metadata:type_name -> envoy.config.core.v3.HeaderValue + 18, // 26: envoy.extensions.filters.http.ext_proc.v3.ExtProcOverrides.failure_mode_allow:type_name -> google.protobuf.BoolValue + 13, // 27: envoy.extensions.filters.http.ext_proc.v3.ExtProcOverrides.processing_request_modifier:type_name -> envoy.config.core.v3.TypedExtensionConfig + 28, // [28:28] is the sub-list for method output_type + 28, // [28:28] is the sub-list for method input_type + 28, // [28:28] is the sub-list for extension type_name + 28, // [28:28] is the sub-list for extension extendee + 0, // [0:28] is the sub-list for field type_name +} + +func init() { file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_init() } +func file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_init() { + if File_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto != nil { + return + } + file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_init() + file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes[4].OneofWrappers = []any{ + (*ExtProcPerRoute_Disabled)(nil), + (*ExtProcPerRoute_Overrides)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDesc), len(file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_rawDesc)), + NumEnums: 1, + NumMessages: 7, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_goTypes, + DependencyIndexes: file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_depIdxs, + EnumInfos: file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_enumTypes, + MessageInfos: file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_msgTypes, + }.Build() + File_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto = out.File + file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_goTypes = nil + file_envoy_extensions_filters_http_ext_proc_v3_ext_proc_proto_depIdxs = nil +} diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc.pb.validate.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc.pb.validate.go new file mode 100644 index 00000000000..01db7378d7b --- /dev/null +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc.pb.validate.go @@ -0,0 +1,1616 @@ +//go:build !disable_pgv +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto + +package ext_procv3 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on ExternalProcessor with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *ExternalProcessor) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ExternalProcessor with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ExternalProcessorMultiError, or nil if none found. +func (m *ExternalProcessor) ValidateAll() error { + return m.validate(true) +} + +func (m *ExternalProcessor) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetGrpcService()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "GrpcService", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "GrpcService", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetGrpcService()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExternalProcessorValidationError{ + field: "GrpcService", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetHttpService()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "HttpService", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "HttpService", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetHttpService()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExternalProcessorValidationError{ + field: "HttpService", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for FailureModeAllow + + if all { + switch v := interface{}(m.GetProcessingMode()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "ProcessingMode", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "ProcessingMode", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetProcessingMode()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExternalProcessorValidationError{ + field: "ProcessingMode", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if d := m.GetMessageTimeout(); d != nil { + dur, err := d.AsDuration(), d.CheckValid() + if err != nil { + err = ExternalProcessorValidationError{ + field: "MessageTimeout", + reason: "value is not a valid duration", + cause: err, + } + if !all { + return err + } + errors = append(errors, err) + } else { + + lte := time.Duration(3600*time.Second + 0*time.Nanosecond) + gte := time.Duration(0*time.Second + 0*time.Nanosecond) + + if dur < gte || dur > lte { + err := ExternalProcessorValidationError{ + field: "MessageTimeout", + reason: "value must be inside range [0s, 1h0m0s]", + } + if !all { + return err + } + errors = append(errors, err) + } + + } + } + + // no validation rules for StatPrefix + + if all { + switch v := interface{}(m.GetMutationRules()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "MutationRules", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "MutationRules", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMutationRules()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExternalProcessorValidationError{ + field: "MutationRules", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if d := m.GetMaxMessageTimeout(); d != nil { + dur, err := d.AsDuration(), d.CheckValid() + if err != nil { + err = ExternalProcessorValidationError{ + field: "MaxMessageTimeout", + reason: "value is not a valid duration", + cause: err, + } + if !all { + return err + } + errors = append(errors, err) + } else { + + lte := time.Duration(3600*time.Second + 0*time.Nanosecond) + gte := time.Duration(0*time.Second + 0*time.Nanosecond) + + if dur < gte || dur > lte { + err := ExternalProcessorValidationError{ + field: "MaxMessageTimeout", + reason: "value must be inside range [0s, 1h0m0s]", + } + if !all { + return err + } + errors = append(errors, err) + } + + } + } + + if all { + switch v := interface{}(m.GetForwardRules()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "ForwardRules", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "ForwardRules", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetForwardRules()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExternalProcessorValidationError{ + field: "ForwardRules", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetFilterMetadata()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "FilterMetadata", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "FilterMetadata", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetFilterMetadata()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExternalProcessorValidationError{ + field: "FilterMetadata", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for AllowModeOverride + + // no validation rules for DisableImmediateResponse + + if all { + switch v := interface{}(m.GetMetadataOptions()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "MetadataOptions", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "MetadataOptions", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMetadataOptions()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExternalProcessorValidationError{ + field: "MetadataOptions", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for ObservabilityMode + + // no validation rules for DisableClearRouteCache + + // no validation rules for RouteCacheAction + + if all { + switch v := interface{}(m.GetDeferredCloseTimeout()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "DeferredCloseTimeout", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "DeferredCloseTimeout", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDeferredCloseTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExternalProcessorValidationError{ + field: "DeferredCloseTimeout", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for SendBodyWithoutWaitingForHeaderResponse + + for idx, item := range m.GetAllowedOverrideModes() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: fmt.Sprintf("AllowedOverrideModes[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: fmt.Sprintf("AllowedOverrideModes[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExternalProcessorValidationError{ + field: fmt.Sprintf("AllowedOverrideModes[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if all { + switch v := interface{}(m.GetProcessingRequestModifier()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "ProcessingRequestModifier", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "ProcessingRequestModifier", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetProcessingRequestModifier()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExternalProcessorValidationError{ + field: "ProcessingRequestModifier", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetOnProcessingResponse()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "OnProcessingResponse", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "OnProcessingResponse", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetOnProcessingResponse()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExternalProcessorValidationError{ + field: "OnProcessingResponse", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetStatusOnError()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "StatusOnError", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExternalProcessorValidationError{ + field: "StatusOnError", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetStatusOnError()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExternalProcessorValidationError{ + field: "StatusOnError", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return ExternalProcessorMultiError(errors) + } + + return nil +} + +// ExternalProcessorMultiError is an error wrapping multiple validation errors +// returned by ExternalProcessor.ValidateAll() if the designated constraints +// aren't met. +type ExternalProcessorMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ExternalProcessorMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ExternalProcessorMultiError) AllErrors() []error { return m } + +// ExternalProcessorValidationError is the validation error returned by +// ExternalProcessor.Validate if the designated constraints aren't met. +type ExternalProcessorValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ExternalProcessorValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ExternalProcessorValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ExternalProcessorValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ExternalProcessorValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ExternalProcessorValidationError) ErrorName() string { + return "ExternalProcessorValidationError" +} + +// Error satisfies the builtin error interface +func (e ExternalProcessorValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sExternalProcessor.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ExternalProcessorValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ExternalProcessorValidationError{} + +// Validate checks the field values on ExtProcHttpService with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *ExtProcHttpService) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ExtProcHttpService with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ExtProcHttpServiceMultiError, or nil if none found. +func (m *ExtProcHttpService) ValidateAll() error { + return m.validate(true) +} + +func (m *ExtProcHttpService) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetHttpService()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExtProcHttpServiceValidationError{ + field: "HttpService", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExtProcHttpServiceValidationError{ + field: "HttpService", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetHttpService()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExtProcHttpServiceValidationError{ + field: "HttpService", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return ExtProcHttpServiceMultiError(errors) + } + + return nil +} + +// ExtProcHttpServiceMultiError is an error wrapping multiple validation errors +// returned by ExtProcHttpService.ValidateAll() if the designated constraints +// aren't met. +type ExtProcHttpServiceMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ExtProcHttpServiceMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ExtProcHttpServiceMultiError) AllErrors() []error { return m } + +// ExtProcHttpServiceValidationError is the validation error returned by +// ExtProcHttpService.Validate if the designated constraints aren't met. +type ExtProcHttpServiceValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ExtProcHttpServiceValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ExtProcHttpServiceValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ExtProcHttpServiceValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ExtProcHttpServiceValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ExtProcHttpServiceValidationError) ErrorName() string { + return "ExtProcHttpServiceValidationError" +} + +// Error satisfies the builtin error interface +func (e ExtProcHttpServiceValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sExtProcHttpService.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ExtProcHttpServiceValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ExtProcHttpServiceValidationError{} + +// Validate checks the field values on MetadataOptions with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *MetadataOptions) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on MetadataOptions with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// MetadataOptionsMultiError, or nil if none found. +func (m *MetadataOptions) ValidateAll() error { + return m.validate(true) +} + +func (m *MetadataOptions) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetForwardingNamespaces()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, MetadataOptionsValidationError{ + field: "ForwardingNamespaces", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, MetadataOptionsValidationError{ + field: "ForwardingNamespaces", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetForwardingNamespaces()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return MetadataOptionsValidationError{ + field: "ForwardingNamespaces", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetReceivingNamespaces()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, MetadataOptionsValidationError{ + field: "ReceivingNamespaces", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, MetadataOptionsValidationError{ + field: "ReceivingNamespaces", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetReceivingNamespaces()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return MetadataOptionsValidationError{ + field: "ReceivingNamespaces", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetClusterMetadataForwardingNamespaces()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, MetadataOptionsValidationError{ + field: "ClusterMetadataForwardingNamespaces", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, MetadataOptionsValidationError{ + field: "ClusterMetadataForwardingNamespaces", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetClusterMetadataForwardingNamespaces()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return MetadataOptionsValidationError{ + field: "ClusterMetadataForwardingNamespaces", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return MetadataOptionsMultiError(errors) + } + + return nil +} + +// MetadataOptionsMultiError is an error wrapping multiple validation errors +// returned by MetadataOptions.ValidateAll() if the designated constraints +// aren't met. +type MetadataOptionsMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m MetadataOptionsMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m MetadataOptionsMultiError) AllErrors() []error { return m } + +// MetadataOptionsValidationError is the validation error returned by +// MetadataOptions.Validate if the designated constraints aren't met. +type MetadataOptionsValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e MetadataOptionsValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e MetadataOptionsValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e MetadataOptionsValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e MetadataOptionsValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e MetadataOptionsValidationError) ErrorName() string { return "MetadataOptionsValidationError" } + +// Error satisfies the builtin error interface +func (e MetadataOptionsValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sMetadataOptions.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = MetadataOptionsValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = MetadataOptionsValidationError{} + +// Validate checks the field values on HeaderForwardingRules with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *HeaderForwardingRules) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on HeaderForwardingRules with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// HeaderForwardingRulesMultiError, or nil if none found. +func (m *HeaderForwardingRules) ValidateAll() error { + return m.validate(true) +} + +func (m *HeaderForwardingRules) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetAllowedHeaders()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, HeaderForwardingRulesValidationError{ + field: "AllowedHeaders", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, HeaderForwardingRulesValidationError{ + field: "AllowedHeaders", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAllowedHeaders()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HeaderForwardingRulesValidationError{ + field: "AllowedHeaders", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetDisallowedHeaders()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, HeaderForwardingRulesValidationError{ + field: "DisallowedHeaders", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, HeaderForwardingRulesValidationError{ + field: "DisallowedHeaders", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDisallowedHeaders()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HeaderForwardingRulesValidationError{ + field: "DisallowedHeaders", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return HeaderForwardingRulesMultiError(errors) + } + + return nil +} + +// HeaderForwardingRulesMultiError is an error wrapping multiple validation +// errors returned by HeaderForwardingRules.ValidateAll() if the designated +// constraints aren't met. +type HeaderForwardingRulesMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m HeaderForwardingRulesMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m HeaderForwardingRulesMultiError) AllErrors() []error { return m } + +// HeaderForwardingRulesValidationError is the validation error returned by +// HeaderForwardingRules.Validate if the designated constraints aren't met. +type HeaderForwardingRulesValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e HeaderForwardingRulesValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e HeaderForwardingRulesValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e HeaderForwardingRulesValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e HeaderForwardingRulesValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e HeaderForwardingRulesValidationError) ErrorName() string { + return "HeaderForwardingRulesValidationError" +} + +// Error satisfies the builtin error interface +func (e HeaderForwardingRulesValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sHeaderForwardingRules.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = HeaderForwardingRulesValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = HeaderForwardingRulesValidationError{} + +// Validate checks the field values on ExtProcPerRoute with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *ExtProcPerRoute) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ExtProcPerRoute with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ExtProcPerRouteMultiError, or nil if none found. +func (m *ExtProcPerRoute) ValidateAll() error { + return m.validate(true) +} + +func (m *ExtProcPerRoute) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + oneofOverridePresent := false + switch v := m.Override.(type) { + case *ExtProcPerRoute_Disabled: + if v == nil { + err := ExtProcPerRouteValidationError{ + field: "Override", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofOverridePresent = true + + if m.GetDisabled() != true { + err := ExtProcPerRouteValidationError{ + field: "Disabled", + reason: "value must equal true", + } + if !all { + return err + } + errors = append(errors, err) + } + + case *ExtProcPerRoute_Overrides: + if v == nil { + err := ExtProcPerRouteValidationError{ + field: "Override", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofOverridePresent = true + + if all { + switch v := interface{}(m.GetOverrides()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExtProcPerRouteValidationError{ + field: "Overrides", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExtProcPerRouteValidationError{ + field: "Overrides", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetOverrides()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExtProcPerRouteValidationError{ + field: "Overrides", + reason: "embedded message failed validation", + cause: err, + } + } + } + + default: + _ = v // ensures v is used + } + if !oneofOverridePresent { + err := ExtProcPerRouteValidationError{ + field: "Override", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(errors) > 0 { + return ExtProcPerRouteMultiError(errors) + } + + return nil +} + +// ExtProcPerRouteMultiError is an error wrapping multiple validation errors +// returned by ExtProcPerRoute.ValidateAll() if the designated constraints +// aren't met. +type ExtProcPerRouteMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ExtProcPerRouteMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ExtProcPerRouteMultiError) AllErrors() []error { return m } + +// ExtProcPerRouteValidationError is the validation error returned by +// ExtProcPerRoute.Validate if the designated constraints aren't met. +type ExtProcPerRouteValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ExtProcPerRouteValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ExtProcPerRouteValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ExtProcPerRouteValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ExtProcPerRouteValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ExtProcPerRouteValidationError) ErrorName() string { return "ExtProcPerRouteValidationError" } + +// Error satisfies the builtin error interface +func (e ExtProcPerRouteValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sExtProcPerRoute.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ExtProcPerRouteValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ExtProcPerRouteValidationError{} + +// Validate checks the field values on ExtProcOverrides with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *ExtProcOverrides) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ExtProcOverrides with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ExtProcOverridesMultiError, or nil if none found. +func (m *ExtProcOverrides) ValidateAll() error { + return m.validate(true) +} + +func (m *ExtProcOverrides) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetProcessingMode()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExtProcOverridesValidationError{ + field: "ProcessingMode", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExtProcOverridesValidationError{ + field: "ProcessingMode", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetProcessingMode()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExtProcOverridesValidationError{ + field: "ProcessingMode", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for AsyncMode + + if all { + switch v := interface{}(m.GetGrpcService()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExtProcOverridesValidationError{ + field: "GrpcService", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExtProcOverridesValidationError{ + field: "GrpcService", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetGrpcService()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExtProcOverridesValidationError{ + field: "GrpcService", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetMetadataOptions()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExtProcOverridesValidationError{ + field: "MetadataOptions", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExtProcOverridesValidationError{ + field: "MetadataOptions", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMetadataOptions()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExtProcOverridesValidationError{ + field: "MetadataOptions", + reason: "embedded message failed validation", + cause: err, + } + } + } + + for idx, item := range m.GetGrpcInitialMetadata() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExtProcOverridesValidationError{ + field: fmt.Sprintf("GrpcInitialMetadata[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExtProcOverridesValidationError{ + field: fmt.Sprintf("GrpcInitialMetadata[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExtProcOverridesValidationError{ + field: fmt.Sprintf("GrpcInitialMetadata[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if all { + switch v := interface{}(m.GetFailureModeAllow()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExtProcOverridesValidationError{ + field: "FailureModeAllow", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExtProcOverridesValidationError{ + field: "FailureModeAllow", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetFailureModeAllow()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExtProcOverridesValidationError{ + field: "FailureModeAllow", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetProcessingRequestModifier()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ExtProcOverridesValidationError{ + field: "ProcessingRequestModifier", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ExtProcOverridesValidationError{ + field: "ProcessingRequestModifier", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetProcessingRequestModifier()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExtProcOverridesValidationError{ + field: "ProcessingRequestModifier", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return ExtProcOverridesMultiError(errors) + } + + return nil +} + +// ExtProcOverridesMultiError is an error wrapping multiple validation errors +// returned by ExtProcOverrides.ValidateAll() if the designated constraints +// aren't met. +type ExtProcOverridesMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ExtProcOverridesMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ExtProcOverridesMultiError) AllErrors() []error { return m } + +// ExtProcOverridesValidationError is the validation error returned by +// ExtProcOverrides.Validate if the designated constraints aren't met. +type ExtProcOverridesValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ExtProcOverridesValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ExtProcOverridesValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ExtProcOverridesValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ExtProcOverridesValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ExtProcOverridesValidationError) ErrorName() string { return "ExtProcOverridesValidationError" } + +// Error satisfies the builtin error interface +func (e ExtProcOverridesValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sExtProcOverrides.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ExtProcOverridesValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ExtProcOverridesValidationError{} + +// Validate checks the field values on MetadataOptions_MetadataNamespaces with +// the rules defined in the proto definition for this message. If any rules +// are violated, the first error encountered is returned, or nil if there are +// no violations. +func (m *MetadataOptions_MetadataNamespaces) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on MetadataOptions_MetadataNamespaces +// with the rules defined in the proto definition for this message. If any +// rules are violated, the result is a list of violation errors wrapped in +// MetadataOptions_MetadataNamespacesMultiError, or nil if none found. +func (m *MetadataOptions_MetadataNamespaces) ValidateAll() error { + return m.validate(true) +} + +func (m *MetadataOptions_MetadataNamespaces) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return MetadataOptions_MetadataNamespacesMultiError(errors) + } + + return nil +} + +// MetadataOptions_MetadataNamespacesMultiError is an error wrapping multiple +// validation errors returned by +// MetadataOptions_MetadataNamespaces.ValidateAll() if the designated +// constraints aren't met. +type MetadataOptions_MetadataNamespacesMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m MetadataOptions_MetadataNamespacesMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m MetadataOptions_MetadataNamespacesMultiError) AllErrors() []error { return m } + +// MetadataOptions_MetadataNamespacesValidationError is the validation error +// returned by MetadataOptions_MetadataNamespaces.Validate if the designated +// constraints aren't met. +type MetadataOptions_MetadataNamespacesValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e MetadataOptions_MetadataNamespacesValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e MetadataOptions_MetadataNamespacesValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e MetadataOptions_MetadataNamespacesValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e MetadataOptions_MetadataNamespacesValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e MetadataOptions_MetadataNamespacesValidationError) ErrorName() string { + return "MetadataOptions_MetadataNamespacesValidationError" +} + +// Error satisfies the builtin error interface +func (e MetadataOptions_MetadataNamespacesValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sMetadataOptions_MetadataNamespaces.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = MetadataOptions_MetadataNamespacesValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = MetadataOptions_MetadataNamespacesValidationError{} diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc_vtproto.pb.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc_vtproto.pb.go new file mode 100644 index 00000000000..8b6aebf1724 --- /dev/null +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/ext_proc_vtproto.pb.go @@ -0,0 +1,1194 @@ +//go:build vtprotobuf +// +build vtprotobuf + +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// source: envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto + +package ext_procv3 + +import ( + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + durationpb "github.com/planetscale/vtprotobuf/types/known/durationpb" + structpb "github.com/planetscale/vtprotobuf/types/known/structpb" + wrapperspb "github.com/planetscale/vtprotobuf/types/known/wrapperspb" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +func (m *ExternalProcessor) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExternalProcessor) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ExternalProcessor) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.ProcessingRequestModifier != nil { + if vtmsg, ok := interface{}(m.ProcessingRequestModifier).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.ProcessingRequestModifier) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xca + } + if m.StatusOnError != nil { + if vtmsg, ok := interface{}(m.StatusOnError).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.StatusOnError) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xc2 + } + if m.OnProcessingResponse != nil { + if vtmsg, ok := interface{}(m.OnProcessingResponse).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.OnProcessingResponse) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xba + } + if len(m.AllowedOverrideModes) > 0 { + for iNdEx := len(m.AllowedOverrideModes) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.AllowedOverrideModes[iNdEx].MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + } + if m.SendBodyWithoutWaitingForHeaderResponse { + i-- + if m.SendBodyWithoutWaitingForHeaderResponse { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa8 + } + if m.HttpService != nil { + size, err := m.HttpService.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + if m.DeferredCloseTimeout != nil { + size, err := (*durationpb.Duration)(m.DeferredCloseTimeout).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + } + if m.RouteCacheAction != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RouteCacheAction)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x90 + } + if m.ObservabilityMode { + i-- + if m.ObservabilityMode { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x88 + } + if m.MetadataOptions != nil { + size, err := m.MetadataOptions.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + if m.DisableImmediateResponse { + i-- + if m.DisableImmediateResponse { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x78 + } + if m.AllowModeOverride { + i-- + if m.AllowModeOverride { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x70 + } + if m.FilterMetadata != nil { + size, err := (*structpb.Struct)(m.FilterMetadata).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x6a + } + if m.ForwardRules != nil { + size, err := m.ForwardRules.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x62 + } + if m.DisableClearRouteCache { + i-- + if m.DisableClearRouteCache { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x58 + } + if m.MaxMessageTimeout != nil { + size, err := (*durationpb.Duration)(m.MaxMessageTimeout).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x52 + } + if m.MutationRules != nil { + if vtmsg, ok := interface{}(m.MutationRules).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.MutationRules) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x4a + } + if len(m.StatPrefix) > 0 { + i -= len(m.StatPrefix) + copy(dAtA[i:], m.StatPrefix) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.StatPrefix))) + i-- + dAtA[i] = 0x42 + } + if m.MessageTimeout != nil { + size, err := (*durationpb.Duration)(m.MessageTimeout).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x3a + } + if len(m.ResponseAttributes) > 0 { + for iNdEx := len(m.ResponseAttributes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ResponseAttributes[iNdEx]) + copy(dAtA[i:], m.ResponseAttributes[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ResponseAttributes[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if len(m.RequestAttributes) > 0 { + for iNdEx := len(m.RequestAttributes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RequestAttributes[iNdEx]) + copy(dAtA[i:], m.RequestAttributes[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RequestAttributes[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if m.ProcessingMode != nil { + size, err := m.ProcessingMode.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if m.FailureModeAllow { + i-- + if m.FailureModeAllow { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.GrpcService != nil { + if vtmsg, ok := interface{}(m.GrpcService).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.GrpcService) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ExtProcHttpService) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExtProcHttpService) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ExtProcHttpService) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.HttpService != nil { + if vtmsg, ok := interface{}(m.HttpService).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.HttpService) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MetadataOptions_MetadataNamespaces) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MetadataOptions_MetadataNamespaces) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *MetadataOptions_MetadataNamespaces) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Typed) > 0 { + for iNdEx := len(m.Typed) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Typed[iNdEx]) + copy(dAtA[i:], m.Typed[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Typed[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Untyped) > 0 { + for iNdEx := len(m.Untyped) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Untyped[iNdEx]) + copy(dAtA[i:], m.Untyped[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Untyped[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *MetadataOptions) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MetadataOptions) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *MetadataOptions) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.ClusterMetadataForwardingNamespaces != nil { + size, err := m.ClusterMetadataForwardingNamespaces.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if m.ReceivingNamespaces != nil { + size, err := m.ReceivingNamespaces.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.ForwardingNamespaces != nil { + size, err := m.ForwardingNamespaces.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HeaderForwardingRules) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HeaderForwardingRules) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *HeaderForwardingRules) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.DisallowedHeaders != nil { + if vtmsg, ok := interface{}(m.DisallowedHeaders).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.DisallowedHeaders) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x12 + } + if m.AllowedHeaders != nil { + if vtmsg, ok := interface{}(m.AllowedHeaders).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.AllowedHeaders) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ExtProcPerRoute) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExtProcPerRoute) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ExtProcPerRoute) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if msg, ok := m.Override.(*ExtProcPerRoute_Overrides); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Override.(*ExtProcPerRoute_Disabled); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *ExtProcPerRoute_Disabled) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ExtProcPerRoute_Disabled) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + i-- + if m.Disabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} +func (m *ExtProcPerRoute_Overrides) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ExtProcPerRoute_Overrides) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Overrides != nil { + size, err := m.Overrides.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *ExtProcOverrides) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExtProcOverrides) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ExtProcOverrides) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.ProcessingRequestModifier != nil { + if vtmsg, ok := interface{}(m.ProcessingRequestModifier).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.ProcessingRequestModifier) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x4a + } + if m.FailureModeAllow != nil { + size, err := (*wrapperspb.BoolValue)(m.FailureModeAllow).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x42 + } + if len(m.GrpcInitialMetadata) > 0 { + for iNdEx := len(m.GrpcInitialMetadata) - 1; iNdEx >= 0; iNdEx-- { + if vtmsg, ok := interface{}(m.GrpcInitialMetadata[iNdEx]).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.GrpcInitialMetadata[iNdEx]) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x3a + } + } + if m.MetadataOptions != nil { + size, err := m.MetadataOptions.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } + if m.GrpcService != nil { + if vtmsg, ok := interface{}(m.GrpcService).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.GrpcService) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x2a + } + if len(m.ResponseAttributes) > 0 { + for iNdEx := len(m.ResponseAttributes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ResponseAttributes[iNdEx]) + copy(dAtA[i:], m.ResponseAttributes[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ResponseAttributes[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.RequestAttributes) > 0 { + for iNdEx := len(m.RequestAttributes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RequestAttributes[iNdEx]) + copy(dAtA[i:], m.RequestAttributes[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RequestAttributes[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if m.AsyncMode { + i-- + if m.AsyncMode { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.ProcessingMode != nil { + size, err := m.ProcessingMode.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ExternalProcessor) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.GrpcService != nil { + if size, ok := interface{}(m.GrpcService).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.GrpcService) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.FailureModeAllow { + n += 2 + } + if m.ProcessingMode != nil { + l = m.ProcessingMode.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.RequestAttributes) > 0 { + for _, s := range m.RequestAttributes { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.ResponseAttributes) > 0 { + for _, s := range m.ResponseAttributes { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.MessageTimeout != nil { + l = (*durationpb.Duration)(m.MessageTimeout).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.StatPrefix) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.MutationRules != nil { + if size, ok := interface{}(m.MutationRules).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.MutationRules) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.MaxMessageTimeout != nil { + l = (*durationpb.Duration)(m.MaxMessageTimeout).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.DisableClearRouteCache { + n += 2 + } + if m.ForwardRules != nil { + l = m.ForwardRules.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.FilterMetadata != nil { + l = (*structpb.Struct)(m.FilterMetadata).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.AllowModeOverride { + n += 2 + } + if m.DisableImmediateResponse { + n += 2 + } + if m.MetadataOptions != nil { + l = m.MetadataOptions.SizeVT() + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.ObservabilityMode { + n += 3 + } + if m.RouteCacheAction != 0 { + n += 2 + protohelpers.SizeOfVarint(uint64(m.RouteCacheAction)) + } + if m.DeferredCloseTimeout != nil { + l = (*durationpb.Duration)(m.DeferredCloseTimeout).SizeVT() + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.HttpService != nil { + l = m.HttpService.SizeVT() + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.SendBodyWithoutWaitingForHeaderResponse { + n += 3 + } + if len(m.AllowedOverrideModes) > 0 { + for _, e := range m.AllowedOverrideModes { + l = e.SizeVT() + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.OnProcessingResponse != nil { + if size, ok := interface{}(m.OnProcessingResponse).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.OnProcessingResponse) + } + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.StatusOnError != nil { + if size, ok := interface{}(m.StatusOnError).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.StatusOnError) + } + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.ProcessingRequestModifier != nil { + if size, ok := interface{}(m.ProcessingRequestModifier).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.ProcessingRequestModifier) + } + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *ExtProcHttpService) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.HttpService != nil { + if size, ok := interface{}(m.HttpService).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.HttpService) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *MetadataOptions_MetadataNamespaces) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Untyped) > 0 { + for _, s := range m.Untyped { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.Typed) > 0 { + for _, s := range m.Typed { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *MetadataOptions) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ForwardingNamespaces != nil { + l = m.ForwardingNamespaces.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.ReceivingNamespaces != nil { + l = m.ReceivingNamespaces.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.ClusterMetadataForwardingNamespaces != nil { + l = m.ClusterMetadataForwardingNamespaces.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *HeaderForwardingRules) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AllowedHeaders != nil { + if size, ok := interface{}(m.AllowedHeaders).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.AllowedHeaders) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.DisallowedHeaders != nil { + if size, ok := interface{}(m.DisallowedHeaders).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.DisallowedHeaders) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *ExtProcPerRoute) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Override.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + n += len(m.unknownFields) + return n +} + +func (m *ExtProcPerRoute_Disabled) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 2 + return n +} +func (m *ExtProcPerRoute_Overrides) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Overrides != nil { + l = m.Overrides.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *ExtProcOverrides) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProcessingMode != nil { + l = m.ProcessingMode.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.AsyncMode { + n += 2 + } + if len(m.RequestAttributes) > 0 { + for _, s := range m.RequestAttributes { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.ResponseAttributes) > 0 { + for _, s := range m.ResponseAttributes { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.GrpcService != nil { + if size, ok := interface{}(m.GrpcService).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.GrpcService) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.MetadataOptions != nil { + l = m.MetadataOptions.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.GrpcInitialMetadata) > 0 { + for _, e := range m.GrpcInitialMetadata { + if size, ok := interface{}(e).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(e) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.FailureModeAllow != nil { + l = (*wrapperspb.BoolValue)(m.FailureModeAllow).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.ProcessingRequestModifier != nil { + if size, ok := interface{}(m.ProcessingRequestModifier).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.ProcessingRequestModifier) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode.pb.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode.pb.go new file mode 100644 index 00000000000..4b8b0c34d28 --- /dev/null +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode.pb.go @@ -0,0 +1,366 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v6.33.2 +// source: envoy/extensions/filters/http/ext_proc/v3/processing_mode.proto + +package ext_procv3 + +import ( + _ "github.com/cncf/xds/go/udpa/annotations" + _ "github.com/envoyproxy/protoc-gen-validate/validate" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Control how headers and trailers are handled +type ProcessingMode_HeaderSendMode int32 + +const ( + // When used to configure the ext_proc filter :ref:`processing_mode + // `, + // the default HeaderSendMode depends on which part of the message is being processed. By + // default, request and response headers are sent, while trailers are skipped. + // + // When used in :ref:`mode_override + // ` or + // :ref:`allowed_override_modes + // `, + // a value of DEFAULT indicates that there is no change from the behavior that is configured for + // the filter in :ref:`processing_mode + // `. + ProcessingMode_DEFAULT ProcessingMode_HeaderSendMode = 0 + // Send the header or trailer. + ProcessingMode_SEND ProcessingMode_HeaderSendMode = 1 + // Do not send the header or trailer. + ProcessingMode_SKIP ProcessingMode_HeaderSendMode = 2 +) + +// Enum value maps for ProcessingMode_HeaderSendMode. +var ( + ProcessingMode_HeaderSendMode_name = map[int32]string{ + 0: "DEFAULT", + 1: "SEND", + 2: "SKIP", + } + ProcessingMode_HeaderSendMode_value = map[string]int32{ + "DEFAULT": 0, + "SEND": 1, + "SKIP": 2, + } +) + +func (x ProcessingMode_HeaderSendMode) Enum() *ProcessingMode_HeaderSendMode { + p := new(ProcessingMode_HeaderSendMode) + *p = x + return p +} + +func (x ProcessingMode_HeaderSendMode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ProcessingMode_HeaderSendMode) Descriptor() protoreflect.EnumDescriptor { + return file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_enumTypes[0].Descriptor() +} + +func (ProcessingMode_HeaderSendMode) Type() protoreflect.EnumType { + return &file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_enumTypes[0] +} + +func (x ProcessingMode_HeaderSendMode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ProcessingMode_HeaderSendMode.Descriptor instead. +func (ProcessingMode_HeaderSendMode) EnumDescriptor() ([]byte, []int) { + return file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_rawDescGZIP(), []int{0, 0} +} + +// Control how the request and response bodies are handled +// When body mutation by external processor is enabled, ext_proc filter will always remove +// the content length header in four cases below because content length can not be guaranteed +// to be set correctly: +// 1) STREAMED BodySendMode: header processing completes before body mutation comes back. +// 2) BUFFERED_PARTIAL BodySendMode: body is buffered and could be injected in different phases. +// 3) BUFFERED BodySendMode + SKIP HeaderSendMode: header processing (e.g., update content-length) is skipped. +// 4) FULL_DUPLEX_STREAMED BodySendMode: header processing completes before body mutation comes back. +// +// In Envoy's http1 codec implementation, removing content length will enable chunked transfer +// encoding whenever feasible. The recipient (either client or server) must be able +// to parse and decode the chunked transfer coding. +// (see `details in RFC9112 `_). +// +// In BUFFERED BodySendMode + SEND HeaderSendMode, content length header is allowed but it is +// external processor's responsibility to set the content length correctly matched to the length +// of mutated body. If they don't match, the corresponding body mutation will be rejected and +// local reply will be sent with an error message. +type ProcessingMode_BodySendMode int32 + +const ( + // Do not send the body at all. This is the default. + ProcessingMode_NONE ProcessingMode_BodySendMode = 0 + // Stream the body to the server in pieces as they are seen. + ProcessingMode_STREAMED ProcessingMode_BodySendMode = 1 + // Buffer the message body in memory and send the entire body at once. + // If the body exceeds the configured buffer limit, then the + // downstream system will receive an error. + ProcessingMode_BUFFERED ProcessingMode_BodySendMode = 2 + // Buffer the message body in memory and send the entire body in one + // chunk. If the body exceeds the configured buffer limit, then the body contents + // up to the buffer limit will be sent. + ProcessingMode_BUFFERED_PARTIAL ProcessingMode_BodySendMode = 3 + ProcessingMode_FULL_DUPLEX_STREAMED ProcessingMode_BodySendMode = 4 + // [#not-implemented-hide:] + // A mode for gRPC traffic. This is similar to “FULL_DUPLEX_STREAMED“, + // except that instead of sending raw chunks of the HTTP/2 DATA frames, + // the ext_proc client will de-frame the individual gRPC messages inside + // the HTTP/2 DATA frames, and as each message is de-framed, it will be + // sent to the ext_proc server as a :ref:`request_body + // ` + // or :ref:`response_body + // `. + // The ext_proc server will stream back individual gRPC messages in the + // :ref:`StreamedBodyResponse ` + // field, but the number of messages sent by the ext_proc server + // does not need to equal the number of messages sent by the data + // plane. This allows the ext_proc server to change the number of + // messages sent on the stream. + // In this mode, the client will send body and trailers to the server as + // they arrive. + ProcessingMode_GRPC ProcessingMode_BodySendMode = 5 +) + +// Enum value maps for ProcessingMode_BodySendMode. +var ( + ProcessingMode_BodySendMode_name = map[int32]string{ + 0: "NONE", + 1: "STREAMED", + 2: "BUFFERED", + 3: "BUFFERED_PARTIAL", + 4: "FULL_DUPLEX_STREAMED", + 5: "GRPC", + } + ProcessingMode_BodySendMode_value = map[string]int32{ + "NONE": 0, + "STREAMED": 1, + "BUFFERED": 2, + "BUFFERED_PARTIAL": 3, + "FULL_DUPLEX_STREAMED": 4, + "GRPC": 5, + } +) + +func (x ProcessingMode_BodySendMode) Enum() *ProcessingMode_BodySendMode { + p := new(ProcessingMode_BodySendMode) + *p = x + return p +} + +func (x ProcessingMode_BodySendMode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ProcessingMode_BodySendMode) Descriptor() protoreflect.EnumDescriptor { + return file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_enumTypes[1].Descriptor() +} + +func (ProcessingMode_BodySendMode) Type() protoreflect.EnumType { + return &file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_enumTypes[1] +} + +func (x ProcessingMode_BodySendMode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ProcessingMode_BodySendMode.Descriptor instead. +func (ProcessingMode_BodySendMode) EnumDescriptor() ([]byte, []int) { + return file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_rawDescGZIP(), []int{0, 1} +} + +// [#next-free-field: 7] +type ProcessingMode struct { + state protoimpl.MessageState `protogen:"open.v1"` + // How to handle the request header. Default is "SEND". + // Note this field is ignored in :ref:`mode_override + // `, since mode + // overrides can only affect messages exchanged after the request header is processed. + RequestHeaderMode ProcessingMode_HeaderSendMode `protobuf:"varint,1,opt,name=request_header_mode,json=requestHeaderMode,proto3,enum=envoy.extensions.filters.http.ext_proc.v3.ProcessingMode_HeaderSendMode" json:"request_header_mode,omitempty"` + // How to handle the response header. Default is "SEND". + ResponseHeaderMode ProcessingMode_HeaderSendMode `protobuf:"varint,2,opt,name=response_header_mode,json=responseHeaderMode,proto3,enum=envoy.extensions.filters.http.ext_proc.v3.ProcessingMode_HeaderSendMode" json:"response_header_mode,omitempty"` + // How to handle the request body. Default is "NONE". + RequestBodyMode ProcessingMode_BodySendMode `protobuf:"varint,3,opt,name=request_body_mode,json=requestBodyMode,proto3,enum=envoy.extensions.filters.http.ext_proc.v3.ProcessingMode_BodySendMode" json:"request_body_mode,omitempty"` + // How do handle the response body. Default is "NONE". + ResponseBodyMode ProcessingMode_BodySendMode `protobuf:"varint,4,opt,name=response_body_mode,json=responseBodyMode,proto3,enum=envoy.extensions.filters.http.ext_proc.v3.ProcessingMode_BodySendMode" json:"response_body_mode,omitempty"` + // How to handle the request trailers. Default is "SKIP". + RequestTrailerMode ProcessingMode_HeaderSendMode `protobuf:"varint,5,opt,name=request_trailer_mode,json=requestTrailerMode,proto3,enum=envoy.extensions.filters.http.ext_proc.v3.ProcessingMode_HeaderSendMode" json:"request_trailer_mode,omitempty"` + // How to handle the response trailers. Default is "SKIP". + ResponseTrailerMode ProcessingMode_HeaderSendMode `protobuf:"varint,6,opt,name=response_trailer_mode,json=responseTrailerMode,proto3,enum=envoy.extensions.filters.http.ext_proc.v3.ProcessingMode_HeaderSendMode" json:"response_trailer_mode,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProcessingMode) Reset() { + *x = ProcessingMode{} + mi := &file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProcessingMode) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProcessingMode) ProtoMessage() {} + +func (x *ProcessingMode) ProtoReflect() protoreflect.Message { + mi := &file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_msgTypes[0] + 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 ProcessingMode.ProtoReflect.Descriptor instead. +func (*ProcessingMode) Descriptor() ([]byte, []int) { + return file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_rawDescGZIP(), []int{0} +} + +func (x *ProcessingMode) GetRequestHeaderMode() ProcessingMode_HeaderSendMode { + if x != nil { + return x.RequestHeaderMode + } + return ProcessingMode_DEFAULT +} + +func (x *ProcessingMode) GetResponseHeaderMode() ProcessingMode_HeaderSendMode { + if x != nil { + return x.ResponseHeaderMode + } + return ProcessingMode_DEFAULT +} + +func (x *ProcessingMode) GetRequestBodyMode() ProcessingMode_BodySendMode { + if x != nil { + return x.RequestBodyMode + } + return ProcessingMode_NONE +} + +func (x *ProcessingMode) GetResponseBodyMode() ProcessingMode_BodySendMode { + if x != nil { + return x.ResponseBodyMode + } + return ProcessingMode_NONE +} + +func (x *ProcessingMode) GetRequestTrailerMode() ProcessingMode_HeaderSendMode { + if x != nil { + return x.RequestTrailerMode + } + return ProcessingMode_DEFAULT +} + +func (x *ProcessingMode) GetResponseTrailerMode() ProcessingMode_HeaderSendMode { + if x != nil { + return x.ResponseTrailerMode + } + return ProcessingMode_DEFAULT +} + +var File_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto protoreflect.FileDescriptor + +const file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_rawDesc = "" + + "\n" + + "?envoy/extensions/filters/http/ext_proc/v3/processing_mode.proto\x12)envoy.extensions.filters.http.ext_proc.v3\x1a\x1dudpa/annotations/status.proto\x1a\x17validate/validate.proto\"\xcd\a\n" + + "\x0eProcessingMode\x12\x82\x01\n" + + "\x13request_header_mode\x18\x01 \x01(\x0e2H.envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.HeaderSendModeB\b\xfaB\x05\x82\x01\x02\x10\x01R\x11requestHeaderMode\x12\x84\x01\n" + + "\x14response_header_mode\x18\x02 \x01(\x0e2H.envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.HeaderSendModeB\b\xfaB\x05\x82\x01\x02\x10\x01R\x12responseHeaderMode\x12|\n" + + "\x11request_body_mode\x18\x03 \x01(\x0e2F.envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.BodySendModeB\b\xfaB\x05\x82\x01\x02\x10\x01R\x0frequestBodyMode\x12~\n" + + "\x12response_body_mode\x18\x04 \x01(\x0e2F.envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.BodySendModeB\b\xfaB\x05\x82\x01\x02\x10\x01R\x10responseBodyMode\x12\x84\x01\n" + + "\x14request_trailer_mode\x18\x05 \x01(\x0e2H.envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.HeaderSendModeB\b\xfaB\x05\x82\x01\x02\x10\x01R\x12requestTrailerMode\x12\x86\x01\n" + + "\x15response_trailer_mode\x18\x06 \x01(\x0e2H.envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.HeaderSendModeB\b\xfaB\x05\x82\x01\x02\x10\x01R\x13responseTrailerMode\"1\n" + + "\x0eHeaderSendMode\x12\v\n" + + "\aDEFAULT\x10\x00\x12\b\n" + + "\x04SEND\x10\x01\x12\b\n" + + "\x04SKIP\x10\x02\"n\n" + + "\fBodySendMode\x12\b\n" + + "\x04NONE\x10\x00\x12\f\n" + + "\bSTREAMED\x10\x01\x12\f\n" + + "\bBUFFERED\x10\x02\x12\x14\n" + + "\x10BUFFERED_PARTIAL\x10\x03\x12\x18\n" + + "\x14FULL_DUPLEX_STREAMED\x10\x04\x12\b\n" + + "\x04GRPC\x10\x05B\xb5\x01\xba\x80\xc8\xd1\x06\x02\x10\x02\n" + + "7io.envoyproxy.envoy.extensions.filters.http.ext_proc.v3B\x13ProcessingModeProtoP\x01Z[github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3;ext_procv3b\x06proto3" + +var ( + file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_rawDescOnce sync.Once + file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_rawDescData []byte +) + +func file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_rawDescGZIP() []byte { + file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_rawDescOnce.Do(func() { + file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_rawDesc), len(file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_rawDesc))) + }) + return file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_rawDescData +} + +var file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_goTypes = []any{ + (ProcessingMode_HeaderSendMode)(0), // 0: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.HeaderSendMode + (ProcessingMode_BodySendMode)(0), // 1: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.BodySendMode + (*ProcessingMode)(nil), // 2: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode +} +var file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_depIdxs = []int32{ + 0, // 0: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.request_header_mode:type_name -> envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.HeaderSendMode + 0, // 1: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.response_header_mode:type_name -> envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.HeaderSendMode + 1, // 2: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.request_body_mode:type_name -> envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.BodySendMode + 1, // 3: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.response_body_mode:type_name -> envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.BodySendMode + 0, // 4: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.request_trailer_mode:type_name -> envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.HeaderSendMode + 0, // 5: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.response_trailer_mode:type_name -> envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.HeaderSendMode + 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 +} + +func init() { file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_init() } +func file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_init() { + if File_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_rawDesc), len(file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_rawDesc)), + NumEnums: 2, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_goTypes, + DependencyIndexes: file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_depIdxs, + EnumInfos: file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_enumTypes, + MessageInfos: file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_msgTypes, + }.Build() + File_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto = out.File + file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_goTypes = nil + file_envoy_extensions_filters_http_ext_proc_v3_processing_mode_proto_depIdxs = nil +} diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode.pb.validate.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode.pb.validate.go new file mode 100644 index 00000000000..63cbec2102d --- /dev/null +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode.pb.validate.go @@ -0,0 +1,203 @@ +//go:build !disable_pgv +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: envoy/extensions/filters/http/ext_proc/v3/processing_mode.proto + +package ext_procv3 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on ProcessingMode with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *ProcessingMode) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ProcessingMode with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in ProcessingModeMultiError, +// or nil if none found. +func (m *ProcessingMode) ValidateAll() error { + return m.validate(true) +} + +func (m *ProcessingMode) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if _, ok := ProcessingMode_HeaderSendMode_name[int32(m.GetRequestHeaderMode())]; !ok { + err := ProcessingModeValidationError{ + field: "RequestHeaderMode", + reason: "value must be one of the defined enum values", + } + if !all { + return err + } + errors = append(errors, err) + } + + if _, ok := ProcessingMode_HeaderSendMode_name[int32(m.GetResponseHeaderMode())]; !ok { + err := ProcessingModeValidationError{ + field: "ResponseHeaderMode", + reason: "value must be one of the defined enum values", + } + if !all { + return err + } + errors = append(errors, err) + } + + if _, ok := ProcessingMode_BodySendMode_name[int32(m.GetRequestBodyMode())]; !ok { + err := ProcessingModeValidationError{ + field: "RequestBodyMode", + reason: "value must be one of the defined enum values", + } + if !all { + return err + } + errors = append(errors, err) + } + + if _, ok := ProcessingMode_BodySendMode_name[int32(m.GetResponseBodyMode())]; !ok { + err := ProcessingModeValidationError{ + field: "ResponseBodyMode", + reason: "value must be one of the defined enum values", + } + if !all { + return err + } + errors = append(errors, err) + } + + if _, ok := ProcessingMode_HeaderSendMode_name[int32(m.GetRequestTrailerMode())]; !ok { + err := ProcessingModeValidationError{ + field: "RequestTrailerMode", + reason: "value must be one of the defined enum values", + } + if !all { + return err + } + errors = append(errors, err) + } + + if _, ok := ProcessingMode_HeaderSendMode_name[int32(m.GetResponseTrailerMode())]; !ok { + err := ProcessingModeValidationError{ + field: "ResponseTrailerMode", + reason: "value must be one of the defined enum values", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(errors) > 0 { + return ProcessingModeMultiError(errors) + } + + return nil +} + +// ProcessingModeMultiError is an error wrapping multiple validation errors +// returned by ProcessingMode.ValidateAll() if the designated constraints +// aren't met. +type ProcessingModeMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ProcessingModeMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ProcessingModeMultiError) AllErrors() []error { return m } + +// ProcessingModeValidationError is the validation error returned by +// ProcessingMode.Validate if the designated constraints aren't met. +type ProcessingModeValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ProcessingModeValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ProcessingModeValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ProcessingModeValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ProcessingModeValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ProcessingModeValidationError) ErrorName() string { return "ProcessingModeValidationError" } + +// Error satisfies the builtin error interface +func (e ProcessingModeValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sProcessingMode.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ProcessingModeValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ProcessingModeValidationError{} diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode_vtproto.pb.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode_vtproto.pb.go new file mode 100644 index 00000000000..b59fc6748f8 --- /dev/null +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3/processing_mode_vtproto.pb.go @@ -0,0 +1,110 @@ +//go:build vtprotobuf +// +build vtprotobuf + +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// source: envoy/extensions/filters/http/ext_proc/v3/processing_mode.proto + +package ext_procv3 + +import ( + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +func (m *ProcessingMode) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ProcessingMode) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingMode) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.ResponseTrailerMode != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ResponseTrailerMode)) + i-- + dAtA[i] = 0x30 + } + if m.RequestTrailerMode != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RequestTrailerMode)) + i-- + dAtA[i] = 0x28 + } + if m.ResponseBodyMode != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ResponseBodyMode)) + i-- + dAtA[i] = 0x20 + } + if m.RequestBodyMode != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RequestBodyMode)) + i-- + dAtA[i] = 0x18 + } + if m.ResponseHeaderMode != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ResponseHeaderMode)) + i-- + dAtA[i] = 0x10 + } + if m.RequestHeaderMode != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RequestHeaderMode)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ProcessingMode) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RequestHeaderMode != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.RequestHeaderMode)) + } + if m.ResponseHeaderMode != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.ResponseHeaderMode)) + } + if m.RequestBodyMode != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.RequestBodyMode)) + } + if m.ResponseBodyMode != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.ResponseBodyMode)) + } + if m.RequestTrailerMode != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.RequestTrailerMode)) + } + if m.ResponseTrailerMode != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.ResponseTrailerMode)) + } + n += len(m.unknownFields) + return n +} diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor.pb.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor.pb.go new file mode 100644 index 00000000000..c89cd76aad5 --- /dev/null +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor.pb.go @@ -0,0 +1,1898 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v6.33.2 +// source: envoy/service/ext_proc/v3/external_processor.proto + +package ext_procv3 + +import ( + _ "github.com/cncf/xds/go/udpa/annotations" + _ "github.com/cncf/xds/go/xds/annotations/v3" + _ "github.com/envoyproxy/go-control-plane/envoy/annotations" + v31 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" + v3 "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3" + v32 "github.com/envoyproxy/go-control-plane/envoy/type/v3" + _ "github.com/envoyproxy/protoc-gen-validate/validate" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + structpb "google.golang.org/protobuf/types/known/structpb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// The status of the response. +type CommonResponse_ResponseStatus int32 + +const ( + // Apply the mutation instructions in this message to the + // request or response, and then continue processing the filter + // stream as normal. This is the default. + CommonResponse_CONTINUE CommonResponse_ResponseStatus = 0 + // Apply the specified header mutation, replace the body with the body + // specified in the body mutation (if present), and do not send any + // further messages for this request or response even if the processing + // mode is configured to do so. + // + // When used in response to a request_headers or response_headers message, + // this status makes it possible to either completely replace the body + // while discarding the original body, or to add a body to a message that + // formerly did not have one. + // + // In other words, this response makes it possible to turn an HTTP GET + // into a POST, PUT, or PATCH. + // + // Not supported if the body send mode is “GRPC“. + CommonResponse_CONTINUE_AND_REPLACE CommonResponse_ResponseStatus = 1 +) + +// Enum value maps for CommonResponse_ResponseStatus. +var ( + CommonResponse_ResponseStatus_name = map[int32]string{ + 0: "CONTINUE", + 1: "CONTINUE_AND_REPLACE", + } + CommonResponse_ResponseStatus_value = map[string]int32{ + "CONTINUE": 0, + "CONTINUE_AND_REPLACE": 1, + } +) + +func (x CommonResponse_ResponseStatus) Enum() *CommonResponse_ResponseStatus { + p := new(CommonResponse_ResponseStatus) + *p = x + return p +} + +func (x CommonResponse_ResponseStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CommonResponse_ResponseStatus) Descriptor() protoreflect.EnumDescriptor { + return file_envoy_service_ext_proc_v3_external_processor_proto_enumTypes[0].Descriptor() +} + +func (CommonResponse_ResponseStatus) Type() protoreflect.EnumType { + return &file_envoy_service_ext_proc_v3_external_processor_proto_enumTypes[0] +} + +func (x CommonResponse_ResponseStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use CommonResponse_ResponseStatus.Descriptor instead. +func (CommonResponse_ResponseStatus) EnumDescriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{10, 0} +} + +// This message specifies the filter protocol configurations which will be sent to the ext_proc +// server in a :ref:`ProcessingRequest `. +// If the server does not support these protocol configurations, it may choose to close the gRPC stream. +// If the server supports these protocol configurations, it should respond based on the API specifications. +type ProtocolConfiguration struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Specify the filter configuration :ref:`request_body_mode + // ` + RequestBodyMode v3.ProcessingMode_BodySendMode `protobuf:"varint,1,opt,name=request_body_mode,json=requestBodyMode,proto3,enum=envoy.extensions.filters.http.ext_proc.v3.ProcessingMode_BodySendMode" json:"request_body_mode,omitempty"` + // Specify the filter configuration :ref:`response_body_mode + // ` + ResponseBodyMode v3.ProcessingMode_BodySendMode `protobuf:"varint,2,opt,name=response_body_mode,json=responseBodyMode,proto3,enum=envoy.extensions.filters.http.ext_proc.v3.ProcessingMode_BodySendMode" json:"response_body_mode,omitempty"` + // Specify the filter configuration :ref:`send_body_without_waiting_for_header_response + // ` + // If the client is waiting for a header response from the server, setting “true“ means the client will send body to the server + // as they arrive. Setting “false“ means the client will buffer the arrived data and not send it to the server immediately. + SendBodyWithoutWaitingForHeaderResponse bool `protobuf:"varint,3,opt,name=send_body_without_waiting_for_header_response,json=sendBodyWithoutWaitingForHeaderResponse,proto3" json:"send_body_without_waiting_for_header_response,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProtocolConfiguration) Reset() { + *x = ProtocolConfiguration{} + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProtocolConfiguration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProtocolConfiguration) ProtoMessage() {} + +func (x *ProtocolConfiguration) ProtoReflect() protoreflect.Message { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[0] + 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 ProtocolConfiguration.ProtoReflect.Descriptor instead. +func (*ProtocolConfiguration) Descriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{0} +} + +func (x *ProtocolConfiguration) GetRequestBodyMode() v3.ProcessingMode_BodySendMode { + if x != nil { + return x.RequestBodyMode + } + return v3.ProcessingMode_BodySendMode(0) +} + +func (x *ProtocolConfiguration) GetResponseBodyMode() v3.ProcessingMode_BodySendMode { + if x != nil { + return x.ResponseBodyMode + } + return v3.ProcessingMode_BodySendMode(0) +} + +func (x *ProtocolConfiguration) GetSendBodyWithoutWaitingForHeaderResponse() bool { + if x != nil { + return x.SendBodyWithoutWaitingForHeaderResponse + } + return false +} + +// This represents the different types of messages that the data plane can send +// to an external processing server. +// [#next-free-field: 12] +type ProcessingRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Each request message will include one of the following sub-messages. Which + // ones are set for a particular HTTP request/response depend on the + // processing mode. + // + // Types that are valid to be assigned to Request: + // + // *ProcessingRequest_RequestHeaders + // *ProcessingRequest_ResponseHeaders + // *ProcessingRequest_RequestBody + // *ProcessingRequest_ResponseBody + // *ProcessingRequest_RequestTrailers + // *ProcessingRequest_ResponseTrailers + Request isProcessingRequest_Request `protobuf_oneof:"request"` + // Dynamic metadata associated with the request. + MetadataContext *v31.Metadata `protobuf:"bytes,8,opt,name=metadata_context,json=metadataContext,proto3" json:"metadata_context,omitempty"` + // The values of properties selected by the “request_attributes“ + // or “response_attributes“ list in the configuration. Each entry + // in the list is populated from the standard + // :ref:`attributes ` supported in the data plane. + Attributes map[string]*structpb.Struct `protobuf:"bytes,9,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Specify whether the filter that sent this request is running in :ref:`observability_mode + // ` + // and defaults to false. + // + // - A value of “false“ indicates that the server must respond + // to this message by either sending back a matching ProcessingResponse message, + // or by closing the stream. + // - A value of “true“ indicates that the server should not respond to this message, as any + // responses will be ignored. However, it may still close the stream to indicate that no more messages + // are needed. + ObservabilityMode bool `protobuf:"varint,10,opt,name=observability_mode,json=observabilityMode,proto3" json:"observability_mode,omitempty"` + // Specify the filter protocol configurations to be sent to the server. + // “protocol_config“ is only encoded in the first “ProcessingRequest“ message from the client to the server. + ProtocolConfig *ProtocolConfiguration `protobuf:"bytes,11,opt,name=protocol_config,json=protocolConfig,proto3" json:"protocol_config,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProcessingRequest) Reset() { + *x = ProcessingRequest{} + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProcessingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProcessingRequest) ProtoMessage() {} + +func (x *ProcessingRequest) ProtoReflect() protoreflect.Message { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[1] + 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 ProcessingRequest.ProtoReflect.Descriptor instead. +func (*ProcessingRequest) Descriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{1} +} + +func (x *ProcessingRequest) GetRequest() isProcessingRequest_Request { + if x != nil { + return x.Request + } + return nil +} + +func (x *ProcessingRequest) GetRequestHeaders() *HttpHeaders { + if x != nil { + if x, ok := x.Request.(*ProcessingRequest_RequestHeaders); ok { + return x.RequestHeaders + } + } + return nil +} + +func (x *ProcessingRequest) GetResponseHeaders() *HttpHeaders { + if x != nil { + if x, ok := x.Request.(*ProcessingRequest_ResponseHeaders); ok { + return x.ResponseHeaders + } + } + return nil +} + +func (x *ProcessingRequest) GetRequestBody() *HttpBody { + if x != nil { + if x, ok := x.Request.(*ProcessingRequest_RequestBody); ok { + return x.RequestBody + } + } + return nil +} + +func (x *ProcessingRequest) GetResponseBody() *HttpBody { + if x != nil { + if x, ok := x.Request.(*ProcessingRequest_ResponseBody); ok { + return x.ResponseBody + } + } + return nil +} + +func (x *ProcessingRequest) GetRequestTrailers() *HttpTrailers { + if x != nil { + if x, ok := x.Request.(*ProcessingRequest_RequestTrailers); ok { + return x.RequestTrailers + } + } + return nil +} + +func (x *ProcessingRequest) GetResponseTrailers() *HttpTrailers { + if x != nil { + if x, ok := x.Request.(*ProcessingRequest_ResponseTrailers); ok { + return x.ResponseTrailers + } + } + return nil +} + +func (x *ProcessingRequest) GetMetadataContext() *v31.Metadata { + if x != nil { + return x.MetadataContext + } + return nil +} + +func (x *ProcessingRequest) GetAttributes() map[string]*structpb.Struct { + if x != nil { + return x.Attributes + } + return nil +} + +func (x *ProcessingRequest) GetObservabilityMode() bool { + if x != nil { + return x.ObservabilityMode + } + return false +} + +func (x *ProcessingRequest) GetProtocolConfig() *ProtocolConfiguration { + if x != nil { + return x.ProtocolConfig + } + return nil +} + +type isProcessingRequest_Request interface { + isProcessingRequest_Request() +} + +type ProcessingRequest_RequestHeaders struct { + // Information about the HTTP request headers, as well as peer info and additional + // properties. Unless “observability_mode“ is “true“, the server must send back a + // HeaderResponse message, an ImmediateResponse message, or close the stream. + RequestHeaders *HttpHeaders `protobuf:"bytes,2,opt,name=request_headers,json=requestHeaders,proto3,oneof"` +} + +type ProcessingRequest_ResponseHeaders struct { + // Information about the HTTP response headers, as well as peer info and additional + // properties. Unless “observability_mode“ is “true“, the server must send back a + // HeaderResponse message or close the stream. + ResponseHeaders *HttpHeaders `protobuf:"bytes,3,opt,name=response_headers,json=responseHeaders,proto3,oneof"` +} + +type ProcessingRequest_RequestBody struct { + // A chunk of the HTTP request body. Unless “observability_mode“ is true, the server must send back + // a BodyResponse message, an ImmediateResponse message, or close the stream. + RequestBody *HttpBody `protobuf:"bytes,4,opt,name=request_body,json=requestBody,proto3,oneof"` +} + +type ProcessingRequest_ResponseBody struct { + // A chunk of the HTTP response body. Unless “observability_mode“ is “true“, the server must send back + // a BodyResponse message or close the stream. + ResponseBody *HttpBody `protobuf:"bytes,5,opt,name=response_body,json=responseBody,proto3,oneof"` +} + +type ProcessingRequest_RequestTrailers struct { + // The HTTP trailers for the request path. Unless “observability_mode“ is “true“, the server + // must send back a TrailerResponse message or close the stream. + // + // This message is only sent if the trailers processing mode is set to “SEND“ and + // the original downstream request has trailers. + RequestTrailers *HttpTrailers `protobuf:"bytes,6,opt,name=request_trailers,json=requestTrailers,proto3,oneof"` +} + +type ProcessingRequest_ResponseTrailers struct { + // The HTTP trailers for the response path. Unless “observability_mode“ is “true“, the server + // must send back a TrailerResponse message or close the stream. + // + // This message is only sent if the trailers processing mode is set to “SEND“ and + // the original upstream response has trailers. + ResponseTrailers *HttpTrailers `protobuf:"bytes,7,opt,name=response_trailers,json=responseTrailers,proto3,oneof"` +} + +func (*ProcessingRequest_RequestHeaders) isProcessingRequest_Request() {} + +func (*ProcessingRequest_ResponseHeaders) isProcessingRequest_Request() {} + +func (*ProcessingRequest_RequestBody) isProcessingRequest_Request() {} + +func (*ProcessingRequest_ResponseBody) isProcessingRequest_Request() {} + +func (*ProcessingRequest_RequestTrailers) isProcessingRequest_Request() {} + +func (*ProcessingRequest_ResponseTrailers) isProcessingRequest_Request() {} + +// This represents the different types of messages the server may send back to the data plane +// when the “observability_mode“ field in the received ProcessingRequest is set to false. +// +// - If the corresponding “BodySendMode“ in the +// :ref:`processing_mode ` +// is not set to “FULL_DUPLEX_STREAMED“, then for every received ProcessingRequest, +// the server must send back exactly one ProcessingResponse message. +// - If it is set to “FULL_DUPLEX_STREAMED“, the server must follow the API defined +// for this mode to send the ProcessingResponse messages. +// +// [#next-free-field: 13] +type ProcessingResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The response type that is sent by the server. + // + // Types that are valid to be assigned to Response: + // + // *ProcessingResponse_RequestHeaders + // *ProcessingResponse_ResponseHeaders + // *ProcessingResponse_RequestBody + // *ProcessingResponse_ResponseBody + // *ProcessingResponse_RequestTrailers + // *ProcessingResponse_ResponseTrailers + // *ProcessingResponse_ImmediateResponse + // *ProcessingResponse_StreamedImmediateResponse + Response isProcessingResponse_Response `protobuf_oneof:"response"` + // Optional metadata that will be emitted as dynamic metadata to be consumed by + // following filters. This metadata will be placed in the namespace(s) specified by the top-level + // field name(s) of the struct. + DynamicMetadata *structpb.Struct `protobuf:"bytes,8,opt,name=dynamic_metadata,json=dynamicMetadata,proto3" json:"dynamic_metadata,omitempty"` + // Override how parts of the HTTP request and response are processed + // for the duration of this particular request/response only. Servers + // may use this to intelligently control how requests are processed + // based on the headers and other metadata that they see. + // This field is only applicable when servers responding to the header requests. + // If it is set in the response to the body or trailer requests, it will be ignored by the data plane. + // It is also ignored by the data plane when the ext_proc filter config + // :ref:`allow_mode_override + // ` + // is set to false, or + // :ref:`send_body_without_waiting_for_header_response + // ` + // is set to true. + ModeOverride *v3.ProcessingMode `protobuf:"bytes,9,opt,name=mode_override,json=modeOverride,proto3" json:"mode_override,omitempty"` + // [#not-implemented-hide:] + // Used only in “FULL_DUPLEX_STREAMED“ and “GRPC“ body send modes. + // Instructs the data plane to stop sending body data and to send a + // half-close on the ext_proc stream. The ext_proc server should then echo + // back all subsequent body contents as-is until it sees the client's + // half-close, at which point the ext_proc server can terminate the stream + // with an OK status. This provides a safe way for the ext_proc server + // to indicate that it does not need to see the rest of the stream; + // without this, the ext_proc server could not terminate the stream + // early, because it would wind up dropping any body contents that the + // client had already sent before it saw the ext_proc stream termination. + RequestDrain bool `protobuf:"varint,12,opt,name=request_drain,json=requestDrain,proto3" json:"request_drain,omitempty"` + // When ext_proc server receives a request message, in case it needs more + // time to process the message, it sends back a ProcessingResponse message + // with a new timeout value. When the data plane receives this response + // message, it ignores other fields in the response, just stop the original + // timer, which has the timeout value specified in + // :ref:`message_timeout + // ` + // and start a new timer with this “override_message_timeout“ value and keep the + // data plane ext_proc filter state machine intact. + // Has to be >= 1ms and <= + // :ref:`max_message_timeout ` + // Such message can be sent at most once in a particular data plane ext_proc filter processing state. + // To enable this API, one has to set “max_message_timeout“ to a number >= 1ms. + OverrideMessageTimeout *durationpb.Duration `protobuf:"bytes,10,opt,name=override_message_timeout,json=overrideMessageTimeout,proto3" json:"override_message_timeout,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProcessingResponse) Reset() { + *x = ProcessingResponse{} + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProcessingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProcessingResponse) ProtoMessage() {} + +func (x *ProcessingResponse) ProtoReflect() protoreflect.Message { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[2] + 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 ProcessingResponse.ProtoReflect.Descriptor instead. +func (*ProcessingResponse) Descriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{2} +} + +func (x *ProcessingResponse) GetResponse() isProcessingResponse_Response { + if x != nil { + return x.Response + } + return nil +} + +func (x *ProcessingResponse) GetRequestHeaders() *HeadersResponse { + if x != nil { + if x, ok := x.Response.(*ProcessingResponse_RequestHeaders); ok { + return x.RequestHeaders + } + } + return nil +} + +func (x *ProcessingResponse) GetResponseHeaders() *HeadersResponse { + if x != nil { + if x, ok := x.Response.(*ProcessingResponse_ResponseHeaders); ok { + return x.ResponseHeaders + } + } + return nil +} + +func (x *ProcessingResponse) GetRequestBody() *BodyResponse { + if x != nil { + if x, ok := x.Response.(*ProcessingResponse_RequestBody); ok { + return x.RequestBody + } + } + return nil +} + +func (x *ProcessingResponse) GetResponseBody() *BodyResponse { + if x != nil { + if x, ok := x.Response.(*ProcessingResponse_ResponseBody); ok { + return x.ResponseBody + } + } + return nil +} + +func (x *ProcessingResponse) GetRequestTrailers() *TrailersResponse { + if x != nil { + if x, ok := x.Response.(*ProcessingResponse_RequestTrailers); ok { + return x.RequestTrailers + } + } + return nil +} + +func (x *ProcessingResponse) GetResponseTrailers() *TrailersResponse { + if x != nil { + if x, ok := x.Response.(*ProcessingResponse_ResponseTrailers); ok { + return x.ResponseTrailers + } + } + return nil +} + +func (x *ProcessingResponse) GetImmediateResponse() *ImmediateResponse { + if x != nil { + if x, ok := x.Response.(*ProcessingResponse_ImmediateResponse); ok { + return x.ImmediateResponse + } + } + return nil +} + +func (x *ProcessingResponse) GetStreamedImmediateResponse() *StreamedImmediateResponse { + if x != nil { + if x, ok := x.Response.(*ProcessingResponse_StreamedImmediateResponse); ok { + return x.StreamedImmediateResponse + } + } + return nil +} + +func (x *ProcessingResponse) GetDynamicMetadata() *structpb.Struct { + if x != nil { + return x.DynamicMetadata + } + return nil +} + +func (x *ProcessingResponse) GetModeOverride() *v3.ProcessingMode { + if x != nil { + return x.ModeOverride + } + return nil +} + +func (x *ProcessingResponse) GetRequestDrain() bool { + if x != nil { + return x.RequestDrain + } + return false +} + +func (x *ProcessingResponse) GetOverrideMessageTimeout() *durationpb.Duration { + if x != nil { + return x.OverrideMessageTimeout + } + return nil +} + +type isProcessingResponse_Response interface { + isProcessingResponse_Response() +} + +type ProcessingResponse_RequestHeaders struct { + // The server must send back this message in response to a message with the + // “request_headers“ field set. + RequestHeaders *HeadersResponse `protobuf:"bytes,1,opt,name=request_headers,json=requestHeaders,proto3,oneof"` +} + +type ProcessingResponse_ResponseHeaders struct { + // The server must send back this message in response to a message with the + // “response_headers“ field set. + ResponseHeaders *HeadersResponse `protobuf:"bytes,2,opt,name=response_headers,json=responseHeaders,proto3,oneof"` +} + +type ProcessingResponse_RequestBody struct { + // The server must send back this message in response to a message with + // the “request_body“ field set. + RequestBody *BodyResponse `protobuf:"bytes,3,opt,name=request_body,json=requestBody,proto3,oneof"` +} + +type ProcessingResponse_ResponseBody struct { + // The server must send back this message in response to a message with + // the “response_body“ field set. + ResponseBody *BodyResponse `protobuf:"bytes,4,opt,name=response_body,json=responseBody,proto3,oneof"` +} + +type ProcessingResponse_RequestTrailers struct { + // The server must send back this message in response to a message with + // the “request_trailers“ field set. + RequestTrailers *TrailersResponse `protobuf:"bytes,5,opt,name=request_trailers,json=requestTrailers,proto3,oneof"` +} + +type ProcessingResponse_ResponseTrailers struct { + // The server must send back this message in response to a message with + // the “response_trailers“ field set. + ResponseTrailers *TrailersResponse `protobuf:"bytes,6,opt,name=response_trailers,json=responseTrailers,proto3,oneof"` +} + +type ProcessingResponse_ImmediateResponse struct { + // If specified, attempt to create a locally generated response, send it + // downstream, and stop processing additional filters and ignore any + // additional messages received from the remote server for this request or + // response. If a response has already started -- for example, if this + // message is sent response to a “response_body“ message -- then + // this will either ship the reply directly to the downstream codec, + // or reset the stream. + ImmediateResponse *ImmediateResponse `protobuf:"bytes,7,opt,name=immediate_response,json=immediateResponse,proto3,oneof"` +} + +type ProcessingResponse_StreamedImmediateResponse struct { + // The server sends back this message to initiate or continue local response streaming. + // The server must initiate local response streaming with the “headers_response“ in response to a ProcessingRequest + // with the “request_headers“ only. + // The server may follow up with multiple messages containing “body_response“. The server must indicate + // end of stream by setting “end_of_stream“ to “true“ in the “headers_response“ + // or “body_response“ message or by sending a “trailers_response“ message. + // The client may send a “request_body“ or “request_trailers“ to the server depending on configuration. + // The streaming local response can only be sent when the “request_header_mode“ in the filter + // :ref:`processing_mode ` + // is set to “SEND“. The ext_proc server should not send StreamedImmediateResponse if it did not observe request headers, + // as it will result in the race with the upstream server response and reset of the client request. + // Presently only the FULL_DUPLEX_STREAMED or NONE body modes are supported. + StreamedImmediateResponse *StreamedImmediateResponse `protobuf:"bytes,11,opt,name=streamed_immediate_response,json=streamedImmediateResponse,proto3,oneof"` +} + +func (*ProcessingResponse_RequestHeaders) isProcessingResponse_Response() {} + +func (*ProcessingResponse_ResponseHeaders) isProcessingResponse_Response() {} + +func (*ProcessingResponse_RequestBody) isProcessingResponse_Response() {} + +func (*ProcessingResponse_ResponseBody) isProcessingResponse_Response() {} + +func (*ProcessingResponse_RequestTrailers) isProcessingResponse_Response() {} + +func (*ProcessingResponse_ResponseTrailers) isProcessingResponse_Response() {} + +func (*ProcessingResponse_ImmediateResponse) isProcessingResponse_Response() {} + +func (*ProcessingResponse_StreamedImmediateResponse) isProcessingResponse_Response() {} + +// This message is sent to the external server when the HTTP request and responses +// are first received. +type HttpHeaders struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The HTTP request headers. All header keys will be + // lower-cased, because HTTP header keys are case-insensitive. + // The header value is encoded in the + // :ref:`raw_value ` field. + Headers *v31.HeaderMap `protobuf:"bytes,1,opt,name=headers,proto3" json:"headers,omitempty"` + // [#not-implemented-hide:] + // This field is deprecated and not implemented. Attributes will be sent in + // the top-level :ref:`attributes ` field. + Trailers *v31.HeaderMap `protobuf:"bytes,1,opt,name=trailers,proto3" json:"trailers,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HttpTrailers) Reset() { + *x = HttpTrailers{} + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *HttpTrailers) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HttpTrailers) ProtoMessage() {} + +func (x *HttpTrailers) ProtoReflect() protoreflect.Message { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[5] + 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 HttpTrailers.ProtoReflect.Descriptor instead. +func (*HttpTrailers) Descriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{5} +} + +func (x *HttpTrailers) GetTrailers() *v31.HeaderMap { + if x != nil { + return x.Trailers + } + return nil +} + +// This message is sent by the external server to the data plane after “HttpHeaders“ was +// sent to it. +type HeadersResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Details the modifications (if any) to be made by the data plane to the current + // request/response. + Response *CommonResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HeadersResponse) Reset() { + *x = HeadersResponse{} + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *HeadersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HeadersResponse) ProtoMessage() {} + +func (x *HeadersResponse) ProtoReflect() protoreflect.Message { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[6] + 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 HeadersResponse.ProtoReflect.Descriptor instead. +func (*HeadersResponse) Descriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{6} +} + +func (x *HeadersResponse) GetResponse() *CommonResponse { + if x != nil { + return x.Response + } + return nil +} + +// This message is sent by the external server to the data plane after “HttpBody“ was +// sent to it. +type BodyResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Details the modifications (if any) to be made by the data plane to the current + // request/response. + Response *CommonResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BodyResponse) Reset() { + *x = BodyResponse{} + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BodyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BodyResponse) ProtoMessage() {} + +func (x *BodyResponse) ProtoReflect() protoreflect.Message { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[7] + 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 BodyResponse.ProtoReflect.Descriptor instead. +func (*BodyResponse) Descriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{7} +} + +func (x *BodyResponse) GetResponse() *CommonResponse { + if x != nil { + return x.Response + } + return nil +} + +// This message is sent by the external server to the data plane after “HttpTrailers“ was +// sent to it. +type TrailersResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Details the modifications (if any) to be made by the data plane to the current + // request/response trailers. + HeaderMutation *HeaderMutation `protobuf:"bytes,1,opt,name=header_mutation,json=headerMutation,proto3" json:"header_mutation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TrailersResponse) Reset() { + *x = TrailersResponse{} + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TrailersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TrailersResponse) ProtoMessage() {} + +func (x *TrailersResponse) ProtoReflect() protoreflect.Message { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[8] + 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 TrailersResponse.ProtoReflect.Descriptor instead. +func (*TrailersResponse) Descriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{8} +} + +func (x *TrailersResponse) GetHeaderMutation() *HeaderMutation { + if x != nil { + return x.HeaderMutation + } + return nil +} + +// This message is sent by the external server to the data plane after “HttpHeaders“ +// to initiate local response streaming. The server may follow up with multiple messages containing “body_response“. +// The server must indicate end of stream by setting “end_of_stream“ to “true“ in the “headers_response“ +// or “body_response“ message or by sending a “trailers_response“ message. +type StreamedImmediateResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Response: + // + // *StreamedImmediateResponse_HeadersResponse + // *StreamedImmediateResponse_BodyResponse + // *StreamedImmediateResponse_TrailersResponse + Response isStreamedImmediateResponse_Response `protobuf_oneof:"response"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *StreamedImmediateResponse) Reset() { + *x = StreamedImmediateResponse{} + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *StreamedImmediateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StreamedImmediateResponse) ProtoMessage() {} + +func (x *StreamedImmediateResponse) ProtoReflect() protoreflect.Message { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[9] + 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 StreamedImmediateResponse.ProtoReflect.Descriptor instead. +func (*StreamedImmediateResponse) Descriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{9} +} + +func (x *StreamedImmediateResponse) GetResponse() isStreamedImmediateResponse_Response { + if x != nil { + return x.Response + } + return nil +} + +func (x *StreamedImmediateResponse) GetHeadersResponse() *HttpHeaders { + if x != nil { + if x, ok := x.Response.(*StreamedImmediateResponse_HeadersResponse); ok { + return x.HeadersResponse + } + } + return nil +} + +func (x *StreamedImmediateResponse) GetBodyResponse() *StreamedBodyResponse { + if x != nil { + if x, ok := x.Response.(*StreamedImmediateResponse_BodyResponse); ok { + return x.BodyResponse + } + } + return nil +} + +func (x *StreamedImmediateResponse) GetTrailersResponse() *v31.HeaderMap { + if x != nil { + if x, ok := x.Response.(*StreamedImmediateResponse_TrailersResponse); ok { + return x.TrailersResponse + } + } + return nil +} + +type isStreamedImmediateResponse_Response interface { + isStreamedImmediateResponse_Response() +} + +type StreamedImmediateResponse_HeadersResponse struct { + // Response headers to be sent downstream. The ":status" header must be set. + HeadersResponse *HttpHeaders `protobuf:"bytes,1,opt,name=headers_response,json=headersResponse,proto3,oneof"` +} + +type StreamedImmediateResponse_BodyResponse struct { + // Response body to be sent downstream. + BodyResponse *StreamedBodyResponse `protobuf:"bytes,2,opt,name=body_response,json=bodyResponse,proto3,oneof"` +} + +type StreamedImmediateResponse_TrailersResponse struct { + // Response trailers to be sent downstream. + TrailersResponse *v31.HeaderMap `protobuf:"bytes,3,opt,name=trailers_response,json=trailersResponse,proto3,oneof"` +} + +func (*StreamedImmediateResponse_HeadersResponse) isStreamedImmediateResponse_Response() {} + +func (*StreamedImmediateResponse_BodyResponse) isStreamedImmediateResponse_Response() {} + +func (*StreamedImmediateResponse_TrailersResponse) isStreamedImmediateResponse_Response() {} + +// This message contains common fields between header and body responses. +// [#next-free-field: 6] +type CommonResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // If set, provide additional direction on how the data plane should + // handle the rest of the HTTP filter chain. + Status CommonResponse_ResponseStatus `protobuf:"varint,1,opt,name=status,proto3,enum=envoy.service.ext_proc.v3.CommonResponse_ResponseStatus" json:"status,omitempty"` + // Instructions on how to manipulate the headers. When responding to an + // HttpBody request, header mutations will only take effect if + // the current processing mode for the body is BUFFERED. + HeaderMutation *HeaderMutation `protobuf:"bytes,2,opt,name=header_mutation,json=headerMutation,proto3" json:"header_mutation,omitempty"` + // Replace the body of the last message sent to the remote server on this + // stream. If responding to an HttpBody request, simply replace or clear + // the body chunk that was sent with that request. Body mutations may take + // effect in response either to “header“ or “body“ messages. When it is + // in response to “header“ messages, it only take effect if the + // :ref:`status ` + // is set to CONTINUE_AND_REPLACE. + BodyMutation *BodyMutation `protobuf:"bytes,3,opt,name=body_mutation,json=bodyMutation,proto3" json:"body_mutation,omitempty"` + // [#not-implemented-hide:] + // Add new trailers to the message. This may be used when responding to either a + // HttpHeaders or HttpBody message, but only if this message is returned + // along with the CONTINUE_AND_REPLACE status. + // The header value is encoded in the + // :ref:`raw_value ` field. + Trailers *v31.HeaderMap `protobuf:"bytes,4,opt,name=trailers,proto3" json:"trailers,omitempty"` + // Clear the route cache for the current client request. This is necessary + // if the remote server modified headers that are used to calculate the route. + // This field is ignored in the response direction. This field is also ignored + // if the data plane ext_proc filter is in the upstream filter chain. + ClearRouteCache bool `protobuf:"varint,5,opt,name=clear_route_cache,json=clearRouteCache,proto3" json:"clear_route_cache,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CommonResponse) Reset() { + *x = CommonResponse{} + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CommonResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommonResponse) ProtoMessage() {} + +func (x *CommonResponse) ProtoReflect() protoreflect.Message { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[10] + 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 CommonResponse.ProtoReflect.Descriptor instead. +func (*CommonResponse) Descriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{10} +} + +func (x *CommonResponse) GetStatus() CommonResponse_ResponseStatus { + if x != nil { + return x.Status + } + return CommonResponse_CONTINUE +} + +func (x *CommonResponse) GetHeaderMutation() *HeaderMutation { + if x != nil { + return x.HeaderMutation + } + return nil +} + +func (x *CommonResponse) GetBodyMutation() *BodyMutation { + if x != nil { + return x.BodyMutation + } + return nil +} + +func (x *CommonResponse) GetTrailers() *v31.HeaderMap { + if x != nil { + return x.Trailers + } + return nil +} + +func (x *CommonResponse) GetClearRouteCache() bool { + if x != nil { + return x.ClearRouteCache + } + return false +} + +// This message causes the filter to attempt to create a locally +// generated response, send it downstream, stop processing +// additional filters, and ignore any additional messages received +// from the remote server for this request or response. If a response +// has already started, then this will either ship the reply directly +// to the downstream codec, or reset the stream. +// [#next-free-field: 6] +type ImmediateResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The response code to return. + Status *v32.HttpStatus `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + // Apply changes to the default headers, which will include content-type. + Headers *HeaderMutation `protobuf:"bytes,2,opt,name=headers,proto3" json:"headers,omitempty"` + // The message body to return with the response which is sent using the + // text/plain content type, or encoded in the grpc-message header. + Body []byte `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"` + // If set, then include a gRPC status trailer. + GrpcStatus *GrpcStatus `protobuf:"bytes,4,opt,name=grpc_status,json=grpcStatus,proto3" json:"grpc_status,omitempty"` + // A string detailing why this local reply was sent, which may be included + // in log and debug output (e.g. this populates the %RESPONSE_CODE_DETAILS% + // command operator field for use in access logging). + Details string `protobuf:"bytes,5,opt,name=details,proto3" json:"details,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ImmediateResponse) Reset() { + *x = ImmediateResponse{} + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ImmediateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImmediateResponse) ProtoMessage() {} + +func (x *ImmediateResponse) ProtoReflect() protoreflect.Message { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[11] + 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 ImmediateResponse.ProtoReflect.Descriptor instead. +func (*ImmediateResponse) Descriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{11} +} + +func (x *ImmediateResponse) GetStatus() *v32.HttpStatus { + if x != nil { + return x.Status + } + return nil +} + +func (x *ImmediateResponse) GetHeaders() *HeaderMutation { + if x != nil { + return x.Headers + } + return nil +} + +func (x *ImmediateResponse) GetBody() []byte { + if x != nil { + return x.Body + } + return nil +} + +func (x *ImmediateResponse) GetGrpcStatus() *GrpcStatus { + if x != nil { + return x.GrpcStatus + } + return nil +} + +func (x *ImmediateResponse) GetDetails() string { + if x != nil { + return x.Details + } + return "" +} + +// This message specifies a gRPC status for an ImmediateResponse message. +type GrpcStatus struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The actual gRPC status. + Status uint32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GrpcStatus) Reset() { + *x = GrpcStatus{} + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GrpcStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GrpcStatus) ProtoMessage() {} + +func (x *GrpcStatus) ProtoReflect() protoreflect.Message { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[12] + 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 GrpcStatus.ProtoReflect.Descriptor instead. +func (*GrpcStatus) Descriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{12} +} + +func (x *GrpcStatus) GetStatus() uint32 { + if x != nil { + return x.Status + } + return 0 +} + +// Change HTTP headers or trailers by appending, replacing, or removing +// headers. +type HeaderMutation struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Add or replace HTTP headers. Attempts to set the value of + // any “x-envoy“ header, and attempts to set the “:method“, + // “:authority“, “:scheme“, or “host“ headers will be ignored. + // The header value is encoded in the + // :ref:`raw_value ` field. + SetHeaders []*v31.HeaderValueOption `protobuf:"bytes,1,rep,name=set_headers,json=setHeaders,proto3" json:"set_headers,omitempty"` + // Remove these HTTP headers. Attempts to remove system headers -- + // any header starting with “:“, plus “host“ -- will be ignored. + RemoveHeaders []string `protobuf:"bytes,2,rep,name=remove_headers,json=removeHeaders,proto3" json:"remove_headers,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HeaderMutation) Reset() { + *x = HeaderMutation{} + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *HeaderMutation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HeaderMutation) ProtoMessage() {} + +func (x *HeaderMutation) ProtoReflect() protoreflect.Message { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[13] + 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 HeaderMutation.ProtoReflect.Descriptor instead. +func (*HeaderMutation) Descriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{13} +} + +func (x *HeaderMutation) GetSetHeaders() []*v31.HeaderValueOption { + if x != nil { + return x.SetHeaders + } + return nil +} + +func (x *HeaderMutation) GetRemoveHeaders() []string { + if x != nil { + return x.RemoveHeaders + } + return nil +} + +// The body response message corresponding to “FULL_DUPLEX_STREAMED“ or “GRPC“ body modes. +type StreamedBodyResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // In “FULL_DUPLEX_STREAMED“ body send mode, contains the body response chunk that will be + // passed to the upstream/downstream by the data plane. In “GRPC“ body send mode, contains + // a serialized gRPC message to be passed to the upstream/downstream by the data plane. + Body []byte `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + // The server sets this flag to true if it has received a body request with + // :ref:`end_of_stream ` set to true, + // and this is the last chunk of body responses. + // Note that in “GRPC“ body send mode, this allows the ext_proc + // server to tell the data plane to send a half close after a client + // message, which will result in discarding any other messages sent by + // the client application. + EndOfStream bool `protobuf:"varint,2,opt,name=end_of_stream,json=endOfStream,proto3" json:"end_of_stream,omitempty"` + // This field is used in “GRPC“ body send mode when “end_of_stream“ is + // true and “body“ is empty. Those values would normally indicate an + // empty message on the stream with the end-of-stream bit set. + // However, if the half-close happens after the last message on the + // stream was already sent, then this field will be true to indicate an + // end-of-stream with *no* message (as opposed to an empty message). + EndOfStreamWithoutMessage bool `protobuf:"varint,3,opt,name=end_of_stream_without_message,json=endOfStreamWithoutMessage,proto3" json:"end_of_stream_without_message,omitempty"` + // This field is used in “GRPC“ body send mode to indicate whether + // the message is compressed. This will never be set to true by gRPC + // but may be set to true by a proxy like Envoy. + GrpcMessageCompressed bool `protobuf:"varint,4,opt,name=grpc_message_compressed,json=grpcMessageCompressed,proto3" json:"grpc_message_compressed,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *StreamedBodyResponse) Reset() { + *x = StreamedBodyResponse{} + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *StreamedBodyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StreamedBodyResponse) ProtoMessage() {} + +func (x *StreamedBodyResponse) ProtoReflect() protoreflect.Message { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[14] + 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 StreamedBodyResponse.ProtoReflect.Descriptor instead. +func (*StreamedBodyResponse) Descriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{14} +} + +func (x *StreamedBodyResponse) GetBody() []byte { + if x != nil { + return x.Body + } + return nil +} + +func (x *StreamedBodyResponse) GetEndOfStream() bool { + if x != nil { + return x.EndOfStream + } + return false +} + +func (x *StreamedBodyResponse) GetEndOfStreamWithoutMessage() bool { + if x != nil { + return x.EndOfStreamWithoutMessage + } + return false +} + +func (x *StreamedBodyResponse) GetGrpcMessageCompressed() bool { + if x != nil { + return x.GrpcMessageCompressed + } + return false +} + +// This message specifies the body mutation the server sends to the data plane. +type BodyMutation struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The type of mutation for the body. + // + // Types that are valid to be assigned to Mutation: + // + // *BodyMutation_Body + // *BodyMutation_ClearBody + // *BodyMutation_StreamedResponse + Mutation isBodyMutation_Mutation `protobuf_oneof:"mutation"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BodyMutation) Reset() { + *x = BodyMutation{} + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BodyMutation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BodyMutation) ProtoMessage() {} + +func (x *BodyMutation) ProtoReflect() protoreflect.Message { + mi := &file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[15] + 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 BodyMutation.ProtoReflect.Descriptor instead. +func (*BodyMutation) Descriptor() ([]byte, []int) { + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP(), []int{15} +} + +func (x *BodyMutation) GetMutation() isBodyMutation_Mutation { + if x != nil { + return x.Mutation + } + return nil +} + +func (x *BodyMutation) GetBody() []byte { + if x != nil { + if x, ok := x.Mutation.(*BodyMutation_Body); ok { + return x.Body + } + } + return nil +} + +func (x *BodyMutation) GetClearBody() bool { + if x != nil { + if x, ok := x.Mutation.(*BodyMutation_ClearBody); ok { + return x.ClearBody + } + } + return false +} + +func (x *BodyMutation) GetStreamedResponse() *StreamedBodyResponse { + if x != nil { + if x, ok := x.Mutation.(*BodyMutation_StreamedResponse); ok { + return x.StreamedResponse + } + } + return nil +} + +type isBodyMutation_Mutation interface { + isBodyMutation_Mutation() +} + +type BodyMutation_Body struct { + // The entire body to replace. + // Should only be used when the corresponding “BodySendMode“ in the + // :ref:`processing_mode ` + // is not set to “FULL_DUPLEX_STREAMED“ or “GRPC“. + Body []byte `protobuf:"bytes,1,opt,name=body,proto3,oneof"` +} + +type BodyMutation_ClearBody struct { + // Clear the corresponding body chunk. + // Should only be used when the corresponding “BodySendMode“ in the + // :ref:`processing_mode ` + // is not set to “FULL_DUPLEX_STREAMED“ or “GRPC“. + // Clear the corresponding body chunk. + ClearBody bool `protobuf:"varint,2,opt,name=clear_body,json=clearBody,proto3,oneof"` +} + +type BodyMutation_StreamedResponse struct { + // Must be used when the corresponding “BodySendMode“ in the + // :ref:`processing_mode ` + // is set to “FULL_DUPLEX_STREAMED“ or “GRPC“. + StreamedResponse *StreamedBodyResponse `protobuf:"bytes,3,opt,name=streamed_response,json=streamedResponse,proto3,oneof"` +} + +func (*BodyMutation_Body) isBodyMutation_Mutation() {} + +func (*BodyMutation_ClearBody) isBodyMutation_Mutation() {} + +func (*BodyMutation_StreamedResponse) isBodyMutation_Mutation() {} + +var File_envoy_service_ext_proc_v3_external_processor_proto protoreflect.FileDescriptor + +const file_envoy_service_ext_proc_v3_external_processor_proto_rawDesc = "" + + "\n" + + "2envoy/service/ext_proc/v3/external_processor.proto\x12\x19envoy.service.ext_proc.v3\x1a\x1fenvoy/config/core/v3/base.proto\x1a?envoy/extensions/filters/http/ext_proc/v3/processing_mode.proto\x1a\x1fenvoy/type/v3/http_status.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fxds/annotations/v3/status.proto\x1a#envoy/annotations/deprecation.proto\x1a\x1dudpa/annotations/status.proto\x1a\x17validate/validate.proto\"\xf5\x02\n" + + "\x15ProtocolConfiguration\x12|\n" + + "\x11request_body_mode\x18\x01 \x01(\x0e2F.envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.BodySendModeB\b\xfaB\x05\x82\x01\x02\x10\x01R\x0frequestBodyMode\x12~\n" + + "\x12response_body_mode\x18\x02 \x01(\x0e2F.envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.BodySendModeB\b\xfaB\x05\x82\x01\x02\x10\x01R\x10responseBodyMode\x12^\n" + + "-send_body_without_waiting_for_header_response\x18\x03 \x01(\bR'sendBodyWithoutWaitingForHeaderResponse\"\xac\a\n" + + "\x11ProcessingRequest\x12Q\n" + + "\x0frequest_headers\x18\x02 \x01(\v2&.envoy.service.ext_proc.v3.HttpHeadersH\x00R\x0erequestHeaders\x12S\n" + + "\x10response_headers\x18\x03 \x01(\v2&.envoy.service.ext_proc.v3.HttpHeadersH\x00R\x0fresponseHeaders\x12H\n" + + "\frequest_body\x18\x04 \x01(\v2#.envoy.service.ext_proc.v3.HttpBodyH\x00R\vrequestBody\x12J\n" + + "\rresponse_body\x18\x05 \x01(\v2#.envoy.service.ext_proc.v3.HttpBodyH\x00R\fresponseBody\x12T\n" + + "\x10request_trailers\x18\x06 \x01(\v2'.envoy.service.ext_proc.v3.HttpTrailersH\x00R\x0frequestTrailers\x12V\n" + + "\x11response_trailers\x18\a \x01(\v2'.envoy.service.ext_proc.v3.HttpTrailersH\x00R\x10responseTrailers\x12I\n" + + "\x10metadata_context\x18\b \x01(\v2\x1e.envoy.config.core.v3.MetadataR\x0fmetadataContext\x12\\\n" + + "\n" + + "attributes\x18\t \x03(\v2<.envoy.service.ext_proc.v3.ProcessingRequest.AttributesEntryR\n" + + "attributes\x12-\n" + + "\x12observability_mode\x18\n" + + " \x01(\bR\x11observabilityMode\x12Y\n" + + "\x0fprotocol_config\x18\v \x01(\v20.envoy.service.ext_proc.v3.ProtocolConfigurationR\x0eprotocolConfig\x1aV\n" + + "\x0fAttributesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12-\n" + + "\x05value\x18\x02 \x01(\v2\x17.google.protobuf.StructR\x05value:\x028\x01B\x0e\n" + + "\arequest\x12\x03\xf8B\x01J\x04\b\x01\x10\x02R\n" + + "async_mode\"\x9e\b\n" + + "\x12ProcessingResponse\x12U\n" + + "\x0frequest_headers\x18\x01 \x01(\v2*.envoy.service.ext_proc.v3.HeadersResponseH\x00R\x0erequestHeaders\x12W\n" + + "\x10response_headers\x18\x02 \x01(\v2*.envoy.service.ext_proc.v3.HeadersResponseH\x00R\x0fresponseHeaders\x12L\n" + + "\frequest_body\x18\x03 \x01(\v2'.envoy.service.ext_proc.v3.BodyResponseH\x00R\vrequestBody\x12N\n" + + "\rresponse_body\x18\x04 \x01(\v2'.envoy.service.ext_proc.v3.BodyResponseH\x00R\fresponseBody\x12X\n" + + "\x10request_trailers\x18\x05 \x01(\v2+.envoy.service.ext_proc.v3.TrailersResponseH\x00R\x0frequestTrailers\x12Z\n" + + "\x11response_trailers\x18\x06 \x01(\v2+.envoy.service.ext_proc.v3.TrailersResponseH\x00R\x10responseTrailers\x12]\n" + + "\x12immediate_response\x18\a \x01(\v2,.envoy.service.ext_proc.v3.ImmediateResponseH\x00R\x11immediateResponse\x12v\n" + + "\x1bstreamed_immediate_response\x18\v \x01(\v24.envoy.service.ext_proc.v3.StreamedImmediateResponseH\x00R\x19streamedImmediateResponse\x12B\n" + + "\x10dynamic_metadata\x18\b \x01(\v2\x17.google.protobuf.StructR\x0fdynamicMetadata\x12^\n" + + "\rmode_override\x18\t \x01(\v29.envoy.extensions.filters.http.ext_proc.v3.ProcessingModeR\fmodeOverride\x12#\n" + + "\rrequest_drain\x18\f \x01(\bR\frequestDrain\x12S\n" + + "\x18override_message_timeout\x18\n" + + " \x01(\v2\x19.google.protobuf.DurationR\x16overrideMessageTimeoutB\x0f\n" + + "\bresponse\x12\x03\xf8B\x01\"\xa9\x02\n" + + "\vHttpHeaders\x129\n" + + "\aheaders\x18\x01 \x01(\v2\x1f.envoy.config.core.v3.HeaderMapR\aheaders\x12c\n" + + "\n" + + "attributes\x18\x02 \x03(\v26.envoy.service.ext_proc.v3.HttpHeaders.AttributesEntryB\v\x92dž\xd8\x04\x033.0\x18\x01R\n" + + "attributes\x12\"\n" + + "\rend_of_stream\x18\x03 \x01(\bR\vendOfStream\x1aV\n" + + "\x0fAttributesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12-\n" + + "\x05value\x18\x02 \x01(\v2\x17.google.protobuf.StructR\x05value:\x028\x01\"\xbc\x01\n" + + "\bHttpBody\x12\x12\n" + + "\x04body\x18\x01 \x01(\fR\x04body\x12\"\n" + + "\rend_of_stream\x18\x02 \x01(\bR\vendOfStream\x12@\n" + + "\x1dend_of_stream_without_message\x18\x03 \x01(\bR\x19endOfStreamWithoutMessage\x126\n" + + "\x17grpc_message_compressed\x18\x04 \x01(\bR\x15grpcMessageCompressed\"K\n" + + "\fHttpTrailers\x12;\n" + + "\btrailers\x18\x01 \x01(\v2\x1f.envoy.config.core.v3.HeaderMapR\btrailers\"X\n" + + "\x0fHeadersResponse\x12E\n" + + "\bresponse\x18\x01 \x01(\v2).envoy.service.ext_proc.v3.CommonResponseR\bresponse\"U\n" + + "\fBodyResponse\x12E\n" + + "\bresponse\x18\x01 \x01(\v2).envoy.service.ext_proc.v3.CommonResponseR\bresponse\"f\n" + + "\x10TrailersResponse\x12R\n" + + "\x0fheader_mutation\x18\x01 \x01(\v2).envoy.service.ext_proc.v3.HeaderMutationR\x0eheaderMutation\"\xa4\x02\n" + + "\x19StreamedImmediateResponse\x12S\n" + + "\x10headers_response\x18\x01 \x01(\v2&.envoy.service.ext_proc.v3.HttpHeadersH\x00R\x0fheadersResponse\x12V\n" + + "\rbody_response\x18\x02 \x01(\v2/.envoy.service.ext_proc.v3.StreamedBodyResponseH\x00R\fbodyResponse\x12N\n" + + "\x11trailers_response\x18\x03 \x01(\v2\x1f.envoy.config.core.v3.HeaderMapH\x00R\x10trailersResponseB\n" + + "\n" + + "\bresponse\"\xb1\x03\n" + + "\x0eCommonResponse\x12Z\n" + + "\x06status\x18\x01 \x01(\x0e28.envoy.service.ext_proc.v3.CommonResponse.ResponseStatusB\b\xfaB\x05\x82\x01\x02\x10\x01R\x06status\x12R\n" + + "\x0fheader_mutation\x18\x02 \x01(\v2).envoy.service.ext_proc.v3.HeaderMutationR\x0eheaderMutation\x12L\n" + + "\rbody_mutation\x18\x03 \x01(\v2'.envoy.service.ext_proc.v3.BodyMutationR\fbodyMutation\x12;\n" + + "\btrailers\x18\x04 \x01(\v2\x1f.envoy.config.core.v3.HeaderMapR\btrailers\x12*\n" + + "\x11clear_route_cache\x18\x05 \x01(\bR\x0fclearRouteCache\"8\n" + + "\x0eResponseStatus\x12\f\n" + + "\bCONTINUE\x10\x00\x12\x18\n" + + "\x14CONTINUE_AND_REPLACE\x10\x01\"\x8b\x02\n" + + "\x11ImmediateResponse\x12;\n" + + "\x06status\x18\x01 \x01(\v2\x19.envoy.type.v3.HttpStatusB\b\xfaB\x05\x8a\x01\x02\x10\x01R\x06status\x12C\n" + + "\aheaders\x18\x02 \x01(\v2).envoy.service.ext_proc.v3.HeaderMutationR\aheaders\x12\x12\n" + + "\x04body\x18\x03 \x01(\fR\x04body\x12F\n" + + "\vgrpc_status\x18\x04 \x01(\v2%.envoy.service.ext_proc.v3.GrpcStatusR\n" + + "grpcStatus\x12\x18\n" + + "\adetails\x18\x05 \x01(\tR\adetails\"$\n" + + "\n" + + "GrpcStatus\x12\x16\n" + + "\x06status\x18\x01 \x01(\rR\x06status\"\x81\x01\n" + + "\x0eHeaderMutation\x12H\n" + + "\vset_headers\x18\x01 \x03(\v2'.envoy.config.core.v3.HeaderValueOptionR\n" + + "setHeaders\x12%\n" + + "\x0eremove_headers\x18\x02 \x03(\tR\rremoveHeaders\"\xc8\x01\n" + + "\x14StreamedBodyResponse\x12\x12\n" + + "\x04body\x18\x01 \x01(\fR\x04body\x12\"\n" + + "\rend_of_stream\x18\x02 \x01(\bR\vendOfStream\x12@\n" + + "\x1dend_of_stream_without_message\x18\x03 \x01(\bR\x19endOfStreamWithoutMessage\x126\n" + + "\x17grpc_message_compressed\x18\x04 \x01(\bR\x15grpcMessageCompressed\"\xbb\x01\n" + + "\fBodyMutation\x12\x14\n" + + "\x04body\x18\x01 \x01(\fH\x00R\x04body\x12\x1f\n" + + "\n" + + "clear_body\x18\x02 \x01(\bH\x00R\tclearBody\x12h\n" + + "\x11streamed_response\x18\x03 \x01(\v2/.envoy.service.ext_proc.v3.StreamedBodyResponseB\b\xd2Ƥ\xe1\x06\x02\b\x01H\x00R\x10streamedResponseB\n" + + "\n" + + "\bmutation2\x81\x01\n" + + "\x11ExternalProcessor\x12l\n" + + "\aProcess\x12,.envoy.service.ext_proc.v3.ProcessingRequest\x1a-.envoy.service.ext_proc.v3.ProcessingResponse\"\x00(\x010\x01B\x98\x01\xba\x80\xc8\xd1\x06\x02\x10\x02\n" + + "'io.envoyproxy.envoy.service.ext_proc.v3B\x16ExternalProcessorProtoP\x01ZKgithub.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3;ext_procv3b\x06proto3" + +var ( + file_envoy_service_ext_proc_v3_external_processor_proto_rawDescOnce sync.Once + file_envoy_service_ext_proc_v3_external_processor_proto_rawDescData []byte +) + +func file_envoy_service_ext_proc_v3_external_processor_proto_rawDescGZIP() []byte { + file_envoy_service_ext_proc_v3_external_processor_proto_rawDescOnce.Do(func() { + file_envoy_service_ext_proc_v3_external_processor_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_envoy_service_ext_proc_v3_external_processor_proto_rawDesc), len(file_envoy_service_ext_proc_v3_external_processor_proto_rawDesc))) + }) + return file_envoy_service_ext_proc_v3_external_processor_proto_rawDescData +} + +var file_envoy_service_ext_proc_v3_external_processor_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes = make([]protoimpl.MessageInfo, 18) +var file_envoy_service_ext_proc_v3_external_processor_proto_goTypes = []any{ + (CommonResponse_ResponseStatus)(0), // 0: envoy.service.ext_proc.v3.CommonResponse.ResponseStatus + (*ProtocolConfiguration)(nil), // 1: envoy.service.ext_proc.v3.ProtocolConfiguration + (*ProcessingRequest)(nil), // 2: envoy.service.ext_proc.v3.ProcessingRequest + (*ProcessingResponse)(nil), // 3: envoy.service.ext_proc.v3.ProcessingResponse + (*HttpHeaders)(nil), // 4: envoy.service.ext_proc.v3.HttpHeaders + (*HttpBody)(nil), // 5: envoy.service.ext_proc.v3.HttpBody + (*HttpTrailers)(nil), // 6: envoy.service.ext_proc.v3.HttpTrailers + (*HeadersResponse)(nil), // 7: envoy.service.ext_proc.v3.HeadersResponse + (*BodyResponse)(nil), // 8: envoy.service.ext_proc.v3.BodyResponse + (*TrailersResponse)(nil), // 9: envoy.service.ext_proc.v3.TrailersResponse + (*StreamedImmediateResponse)(nil), // 10: envoy.service.ext_proc.v3.StreamedImmediateResponse + (*CommonResponse)(nil), // 11: envoy.service.ext_proc.v3.CommonResponse + (*ImmediateResponse)(nil), // 12: envoy.service.ext_proc.v3.ImmediateResponse + (*GrpcStatus)(nil), // 13: envoy.service.ext_proc.v3.GrpcStatus + (*HeaderMutation)(nil), // 14: envoy.service.ext_proc.v3.HeaderMutation + (*StreamedBodyResponse)(nil), // 15: envoy.service.ext_proc.v3.StreamedBodyResponse + (*BodyMutation)(nil), // 16: envoy.service.ext_proc.v3.BodyMutation + nil, // 17: envoy.service.ext_proc.v3.ProcessingRequest.AttributesEntry + nil, // 18: envoy.service.ext_proc.v3.HttpHeaders.AttributesEntry + (v3.ProcessingMode_BodySendMode)(0), // 19: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.BodySendMode + (*v31.Metadata)(nil), // 20: envoy.config.core.v3.Metadata + (*structpb.Struct)(nil), // 21: google.protobuf.Struct + (*v3.ProcessingMode)(nil), // 22: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode + (*durationpb.Duration)(nil), // 23: google.protobuf.Duration + (*v31.HeaderMap)(nil), // 24: envoy.config.core.v3.HeaderMap + (*v32.HttpStatus)(nil), // 25: envoy.type.v3.HttpStatus + (*v31.HeaderValueOption)(nil), // 26: envoy.config.core.v3.HeaderValueOption +} +var file_envoy_service_ext_proc_v3_external_processor_proto_depIdxs = []int32{ + 19, // 0: envoy.service.ext_proc.v3.ProtocolConfiguration.request_body_mode:type_name -> envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.BodySendMode + 19, // 1: envoy.service.ext_proc.v3.ProtocolConfiguration.response_body_mode:type_name -> envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.BodySendMode + 4, // 2: envoy.service.ext_proc.v3.ProcessingRequest.request_headers:type_name -> envoy.service.ext_proc.v3.HttpHeaders + 4, // 3: envoy.service.ext_proc.v3.ProcessingRequest.response_headers:type_name -> envoy.service.ext_proc.v3.HttpHeaders + 5, // 4: envoy.service.ext_proc.v3.ProcessingRequest.request_body:type_name -> envoy.service.ext_proc.v3.HttpBody + 5, // 5: envoy.service.ext_proc.v3.ProcessingRequest.response_body:type_name -> envoy.service.ext_proc.v3.HttpBody + 6, // 6: envoy.service.ext_proc.v3.ProcessingRequest.request_trailers:type_name -> envoy.service.ext_proc.v3.HttpTrailers + 6, // 7: envoy.service.ext_proc.v3.ProcessingRequest.response_trailers:type_name -> envoy.service.ext_proc.v3.HttpTrailers + 20, // 8: envoy.service.ext_proc.v3.ProcessingRequest.metadata_context:type_name -> envoy.config.core.v3.Metadata + 17, // 9: envoy.service.ext_proc.v3.ProcessingRequest.attributes:type_name -> envoy.service.ext_proc.v3.ProcessingRequest.AttributesEntry + 1, // 10: envoy.service.ext_proc.v3.ProcessingRequest.protocol_config:type_name -> envoy.service.ext_proc.v3.ProtocolConfiguration + 7, // 11: envoy.service.ext_proc.v3.ProcessingResponse.request_headers:type_name -> envoy.service.ext_proc.v3.HeadersResponse + 7, // 12: envoy.service.ext_proc.v3.ProcessingResponse.response_headers:type_name -> envoy.service.ext_proc.v3.HeadersResponse + 8, // 13: envoy.service.ext_proc.v3.ProcessingResponse.request_body:type_name -> envoy.service.ext_proc.v3.BodyResponse + 8, // 14: envoy.service.ext_proc.v3.ProcessingResponse.response_body:type_name -> envoy.service.ext_proc.v3.BodyResponse + 9, // 15: envoy.service.ext_proc.v3.ProcessingResponse.request_trailers:type_name -> envoy.service.ext_proc.v3.TrailersResponse + 9, // 16: envoy.service.ext_proc.v3.ProcessingResponse.response_trailers:type_name -> envoy.service.ext_proc.v3.TrailersResponse + 12, // 17: envoy.service.ext_proc.v3.ProcessingResponse.immediate_response:type_name -> envoy.service.ext_proc.v3.ImmediateResponse + 10, // 18: envoy.service.ext_proc.v3.ProcessingResponse.streamed_immediate_response:type_name -> envoy.service.ext_proc.v3.StreamedImmediateResponse + 21, // 19: envoy.service.ext_proc.v3.ProcessingResponse.dynamic_metadata:type_name -> google.protobuf.Struct + 22, // 20: envoy.service.ext_proc.v3.ProcessingResponse.mode_override:type_name -> envoy.extensions.filters.http.ext_proc.v3.ProcessingMode + 23, // 21: envoy.service.ext_proc.v3.ProcessingResponse.override_message_timeout:type_name -> google.protobuf.Duration + 24, // 22: envoy.service.ext_proc.v3.HttpHeaders.headers:type_name -> envoy.config.core.v3.HeaderMap + 18, // 23: envoy.service.ext_proc.v3.HttpHeaders.attributes:type_name -> envoy.service.ext_proc.v3.HttpHeaders.AttributesEntry + 24, // 24: envoy.service.ext_proc.v3.HttpTrailers.trailers:type_name -> envoy.config.core.v3.HeaderMap + 11, // 25: envoy.service.ext_proc.v3.HeadersResponse.response:type_name -> envoy.service.ext_proc.v3.CommonResponse + 11, // 26: envoy.service.ext_proc.v3.BodyResponse.response:type_name -> envoy.service.ext_proc.v3.CommonResponse + 14, // 27: envoy.service.ext_proc.v3.TrailersResponse.header_mutation:type_name -> envoy.service.ext_proc.v3.HeaderMutation + 4, // 28: envoy.service.ext_proc.v3.StreamedImmediateResponse.headers_response:type_name -> envoy.service.ext_proc.v3.HttpHeaders + 15, // 29: envoy.service.ext_proc.v3.StreamedImmediateResponse.body_response:type_name -> envoy.service.ext_proc.v3.StreamedBodyResponse + 24, // 30: envoy.service.ext_proc.v3.StreamedImmediateResponse.trailers_response:type_name -> envoy.config.core.v3.HeaderMap + 0, // 31: envoy.service.ext_proc.v3.CommonResponse.status:type_name -> envoy.service.ext_proc.v3.CommonResponse.ResponseStatus + 14, // 32: envoy.service.ext_proc.v3.CommonResponse.header_mutation:type_name -> envoy.service.ext_proc.v3.HeaderMutation + 16, // 33: envoy.service.ext_proc.v3.CommonResponse.body_mutation:type_name -> envoy.service.ext_proc.v3.BodyMutation + 24, // 34: envoy.service.ext_proc.v3.CommonResponse.trailers:type_name -> envoy.config.core.v3.HeaderMap + 25, // 35: envoy.service.ext_proc.v3.ImmediateResponse.status:type_name -> envoy.type.v3.HttpStatus + 14, // 36: envoy.service.ext_proc.v3.ImmediateResponse.headers:type_name -> envoy.service.ext_proc.v3.HeaderMutation + 13, // 37: envoy.service.ext_proc.v3.ImmediateResponse.grpc_status:type_name -> envoy.service.ext_proc.v3.GrpcStatus + 26, // 38: envoy.service.ext_proc.v3.HeaderMutation.set_headers:type_name -> envoy.config.core.v3.HeaderValueOption + 15, // 39: envoy.service.ext_proc.v3.BodyMutation.streamed_response:type_name -> envoy.service.ext_proc.v3.StreamedBodyResponse + 21, // 40: envoy.service.ext_proc.v3.ProcessingRequest.AttributesEntry.value:type_name -> google.protobuf.Struct + 21, // 41: envoy.service.ext_proc.v3.HttpHeaders.AttributesEntry.value:type_name -> google.protobuf.Struct + 2, // 42: envoy.service.ext_proc.v3.ExternalProcessor.Process:input_type -> envoy.service.ext_proc.v3.ProcessingRequest + 3, // 43: envoy.service.ext_proc.v3.ExternalProcessor.Process:output_type -> envoy.service.ext_proc.v3.ProcessingResponse + 43, // [43:44] is the sub-list for method output_type + 42, // [42:43] is the sub-list for method input_type + 42, // [42:42] is the sub-list for extension type_name + 42, // [42:42] is the sub-list for extension extendee + 0, // [0:42] is the sub-list for field type_name +} + +func init() { file_envoy_service_ext_proc_v3_external_processor_proto_init() } +func file_envoy_service_ext_proc_v3_external_processor_proto_init() { + if File_envoy_service_ext_proc_v3_external_processor_proto != nil { + return + } + file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[1].OneofWrappers = []any{ + (*ProcessingRequest_RequestHeaders)(nil), + (*ProcessingRequest_ResponseHeaders)(nil), + (*ProcessingRequest_RequestBody)(nil), + (*ProcessingRequest_ResponseBody)(nil), + (*ProcessingRequest_RequestTrailers)(nil), + (*ProcessingRequest_ResponseTrailers)(nil), + } + file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[2].OneofWrappers = []any{ + (*ProcessingResponse_RequestHeaders)(nil), + (*ProcessingResponse_ResponseHeaders)(nil), + (*ProcessingResponse_RequestBody)(nil), + (*ProcessingResponse_ResponseBody)(nil), + (*ProcessingResponse_RequestTrailers)(nil), + (*ProcessingResponse_ResponseTrailers)(nil), + (*ProcessingResponse_ImmediateResponse)(nil), + (*ProcessingResponse_StreamedImmediateResponse)(nil), + } + file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[9].OneofWrappers = []any{ + (*StreamedImmediateResponse_HeadersResponse)(nil), + (*StreamedImmediateResponse_BodyResponse)(nil), + (*StreamedImmediateResponse_TrailersResponse)(nil), + } + file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes[15].OneofWrappers = []any{ + (*BodyMutation_Body)(nil), + (*BodyMutation_ClearBody)(nil), + (*BodyMutation_StreamedResponse)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_envoy_service_ext_proc_v3_external_processor_proto_rawDesc), len(file_envoy_service_ext_proc_v3_external_processor_proto_rawDesc)), + NumEnums: 1, + NumMessages: 18, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_envoy_service_ext_proc_v3_external_processor_proto_goTypes, + DependencyIndexes: file_envoy_service_ext_proc_v3_external_processor_proto_depIdxs, + EnumInfos: file_envoy_service_ext_proc_v3_external_processor_proto_enumTypes, + MessageInfos: file_envoy_service_ext_proc_v3_external_processor_proto_msgTypes, + }.Build() + File_envoy_service_ext_proc_v3_external_processor_proto = out.File + file_envoy_service_ext_proc_v3_external_processor_proto_goTypes = nil + file_envoy_service_ext_proc_v3_external_processor_proto_depIdxs = nil +} diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor.pb.validate.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor.pb.validate.go new file mode 100644 index 00000000000..6725377ac71 --- /dev/null +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor.pb.validate.go @@ -0,0 +1,3131 @@ +//go:build !disable_pgv +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: envoy/service/ext_proc/v3/external_processor.proto + +package ext_procv3 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" + + v3 "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort + + _ = v3.ProcessingMode_BodySendMode(0) +) + +// Validate checks the field values on ProtocolConfiguration with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *ProtocolConfiguration) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ProtocolConfiguration with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ProtocolConfigurationMultiError, or nil if none found. +func (m *ProtocolConfiguration) ValidateAll() error { + return m.validate(true) +} + +func (m *ProtocolConfiguration) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if _, ok := v3.ProcessingMode_BodySendMode_name[int32(m.GetRequestBodyMode())]; !ok { + err := ProtocolConfigurationValidationError{ + field: "RequestBodyMode", + reason: "value must be one of the defined enum values", + } + if !all { + return err + } + errors = append(errors, err) + } + + if _, ok := v3.ProcessingMode_BodySendMode_name[int32(m.GetResponseBodyMode())]; !ok { + err := ProtocolConfigurationValidationError{ + field: "ResponseBodyMode", + reason: "value must be one of the defined enum values", + } + if !all { + return err + } + errors = append(errors, err) + } + + // no validation rules for SendBodyWithoutWaitingForHeaderResponse + + if len(errors) > 0 { + return ProtocolConfigurationMultiError(errors) + } + + return nil +} + +// ProtocolConfigurationMultiError is an error wrapping multiple validation +// errors returned by ProtocolConfiguration.ValidateAll() if the designated +// constraints aren't met. +type ProtocolConfigurationMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ProtocolConfigurationMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ProtocolConfigurationMultiError) AllErrors() []error { return m } + +// ProtocolConfigurationValidationError is the validation error returned by +// ProtocolConfiguration.Validate if the designated constraints aren't met. +type ProtocolConfigurationValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ProtocolConfigurationValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ProtocolConfigurationValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ProtocolConfigurationValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ProtocolConfigurationValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ProtocolConfigurationValidationError) ErrorName() string { + return "ProtocolConfigurationValidationError" +} + +// Error satisfies the builtin error interface +func (e ProtocolConfigurationValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sProtocolConfiguration.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ProtocolConfigurationValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ProtocolConfigurationValidationError{} + +// Validate checks the field values on ProcessingRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *ProcessingRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ProcessingRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ProcessingRequestMultiError, or nil if none found. +func (m *ProcessingRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *ProcessingRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetMetadataContext()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "MetadataContext", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "MetadataContext", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMetadataContext()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingRequestValidationError{ + field: "MetadataContext", + reason: "embedded message failed validation", + cause: err, + } + } + } + + { + sorted_keys := make([]string, len(m.GetAttributes())) + i := 0 + for key := range m.GetAttributes() { + sorted_keys[i] = key + i++ + } + sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) + for _, key := range sorted_keys { + val := m.GetAttributes()[key] + _ = val + + // no validation rules for Attributes[key] + + if all { + switch v := interface{}(val).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: fmt.Sprintf("Attributes[%v]", key), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: fmt.Sprintf("Attributes[%v]", key), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(val).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingRequestValidationError{ + field: fmt.Sprintf("Attributes[%v]", key), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + } + + // no validation rules for ObservabilityMode + + if all { + switch v := interface{}(m.GetProtocolConfig()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "ProtocolConfig", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "ProtocolConfig", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetProtocolConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingRequestValidationError{ + field: "ProtocolConfig", + reason: "embedded message failed validation", + cause: err, + } + } + } + + oneofRequestPresent := false + switch v := m.Request.(type) { + case *ProcessingRequest_RequestHeaders: + if v == nil { + err := ProcessingRequestValidationError{ + field: "Request", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofRequestPresent = true + + if all { + switch v := interface{}(m.GetRequestHeaders()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "RequestHeaders", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "RequestHeaders", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRequestHeaders()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingRequestValidationError{ + field: "RequestHeaders", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *ProcessingRequest_ResponseHeaders: + if v == nil { + err := ProcessingRequestValidationError{ + field: "Request", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofRequestPresent = true + + if all { + switch v := interface{}(m.GetResponseHeaders()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "ResponseHeaders", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "ResponseHeaders", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetResponseHeaders()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingRequestValidationError{ + field: "ResponseHeaders", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *ProcessingRequest_RequestBody: + if v == nil { + err := ProcessingRequestValidationError{ + field: "Request", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofRequestPresent = true + + if all { + switch v := interface{}(m.GetRequestBody()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "RequestBody", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "RequestBody", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRequestBody()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingRequestValidationError{ + field: "RequestBody", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *ProcessingRequest_ResponseBody: + if v == nil { + err := ProcessingRequestValidationError{ + field: "Request", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofRequestPresent = true + + if all { + switch v := interface{}(m.GetResponseBody()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "ResponseBody", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "ResponseBody", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetResponseBody()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingRequestValidationError{ + field: "ResponseBody", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *ProcessingRequest_RequestTrailers: + if v == nil { + err := ProcessingRequestValidationError{ + field: "Request", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofRequestPresent = true + + if all { + switch v := interface{}(m.GetRequestTrailers()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "RequestTrailers", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "RequestTrailers", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRequestTrailers()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingRequestValidationError{ + field: "RequestTrailers", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *ProcessingRequest_ResponseTrailers: + if v == nil { + err := ProcessingRequestValidationError{ + field: "Request", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofRequestPresent = true + + if all { + switch v := interface{}(m.GetResponseTrailers()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "ResponseTrailers", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingRequestValidationError{ + field: "ResponseTrailers", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetResponseTrailers()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingRequestValidationError{ + field: "ResponseTrailers", + reason: "embedded message failed validation", + cause: err, + } + } + } + + default: + _ = v // ensures v is used + } + if !oneofRequestPresent { + err := ProcessingRequestValidationError{ + field: "Request", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(errors) > 0 { + return ProcessingRequestMultiError(errors) + } + + return nil +} + +// ProcessingRequestMultiError is an error wrapping multiple validation errors +// returned by ProcessingRequest.ValidateAll() if the designated constraints +// aren't met. +type ProcessingRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ProcessingRequestMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ProcessingRequestMultiError) AllErrors() []error { return m } + +// ProcessingRequestValidationError is the validation error returned by +// ProcessingRequest.Validate if the designated constraints aren't met. +type ProcessingRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ProcessingRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ProcessingRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ProcessingRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ProcessingRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ProcessingRequestValidationError) ErrorName() string { + return "ProcessingRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e ProcessingRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sProcessingRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ProcessingRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ProcessingRequestValidationError{} + +// Validate checks the field values on ProcessingResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *ProcessingResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ProcessingResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ProcessingResponseMultiError, or nil if none found. +func (m *ProcessingResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *ProcessingResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetDynamicMetadata()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "DynamicMetadata", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "DynamicMetadata", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDynamicMetadata()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingResponseValidationError{ + field: "DynamicMetadata", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetModeOverride()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "ModeOverride", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "ModeOverride", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetModeOverride()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingResponseValidationError{ + field: "ModeOverride", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for RequestDrain + + if all { + switch v := interface{}(m.GetOverrideMessageTimeout()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "OverrideMessageTimeout", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "OverrideMessageTimeout", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetOverrideMessageTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingResponseValidationError{ + field: "OverrideMessageTimeout", + reason: "embedded message failed validation", + cause: err, + } + } + } + + oneofResponsePresent := false + switch v := m.Response.(type) { + case *ProcessingResponse_RequestHeaders: + if v == nil { + err := ProcessingResponseValidationError{ + field: "Response", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofResponsePresent = true + + if all { + switch v := interface{}(m.GetRequestHeaders()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "RequestHeaders", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "RequestHeaders", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRequestHeaders()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingResponseValidationError{ + field: "RequestHeaders", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *ProcessingResponse_ResponseHeaders: + if v == nil { + err := ProcessingResponseValidationError{ + field: "Response", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofResponsePresent = true + + if all { + switch v := interface{}(m.GetResponseHeaders()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "ResponseHeaders", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "ResponseHeaders", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetResponseHeaders()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingResponseValidationError{ + field: "ResponseHeaders", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *ProcessingResponse_RequestBody: + if v == nil { + err := ProcessingResponseValidationError{ + field: "Response", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofResponsePresent = true + + if all { + switch v := interface{}(m.GetRequestBody()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "RequestBody", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "RequestBody", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRequestBody()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingResponseValidationError{ + field: "RequestBody", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *ProcessingResponse_ResponseBody: + if v == nil { + err := ProcessingResponseValidationError{ + field: "Response", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofResponsePresent = true + + if all { + switch v := interface{}(m.GetResponseBody()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "ResponseBody", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "ResponseBody", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetResponseBody()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingResponseValidationError{ + field: "ResponseBody", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *ProcessingResponse_RequestTrailers: + if v == nil { + err := ProcessingResponseValidationError{ + field: "Response", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofResponsePresent = true + + if all { + switch v := interface{}(m.GetRequestTrailers()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "RequestTrailers", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "RequestTrailers", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRequestTrailers()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingResponseValidationError{ + field: "RequestTrailers", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *ProcessingResponse_ResponseTrailers: + if v == nil { + err := ProcessingResponseValidationError{ + field: "Response", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofResponsePresent = true + + if all { + switch v := interface{}(m.GetResponseTrailers()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "ResponseTrailers", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "ResponseTrailers", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetResponseTrailers()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingResponseValidationError{ + field: "ResponseTrailers", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *ProcessingResponse_ImmediateResponse: + if v == nil { + err := ProcessingResponseValidationError{ + field: "Response", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofResponsePresent = true + + if all { + switch v := interface{}(m.GetImmediateResponse()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "ImmediateResponse", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "ImmediateResponse", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetImmediateResponse()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingResponseValidationError{ + field: "ImmediateResponse", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *ProcessingResponse_StreamedImmediateResponse: + if v == nil { + err := ProcessingResponseValidationError{ + field: "Response", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofResponsePresent = true + + if all { + switch v := interface{}(m.GetStreamedImmediateResponse()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "StreamedImmediateResponse", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ProcessingResponseValidationError{ + field: "StreamedImmediateResponse", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetStreamedImmediateResponse()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ProcessingResponseValidationError{ + field: "StreamedImmediateResponse", + reason: "embedded message failed validation", + cause: err, + } + } + } + + default: + _ = v // ensures v is used + } + if !oneofResponsePresent { + err := ProcessingResponseValidationError{ + field: "Response", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(errors) > 0 { + return ProcessingResponseMultiError(errors) + } + + return nil +} + +// ProcessingResponseMultiError is an error wrapping multiple validation errors +// returned by ProcessingResponse.ValidateAll() if the designated constraints +// aren't met. +type ProcessingResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ProcessingResponseMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ProcessingResponseMultiError) AllErrors() []error { return m } + +// ProcessingResponseValidationError is the validation error returned by +// ProcessingResponse.Validate if the designated constraints aren't met. +type ProcessingResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ProcessingResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ProcessingResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ProcessingResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ProcessingResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ProcessingResponseValidationError) ErrorName() string { + return "ProcessingResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e ProcessingResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sProcessingResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ProcessingResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ProcessingResponseValidationError{} + +// Validate checks the field values on HttpHeaders with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *HttpHeaders) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on HttpHeaders with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in HttpHeadersMultiError, or +// nil if none found. +func (m *HttpHeaders) ValidateAll() error { + return m.validate(true) +} + +func (m *HttpHeaders) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetHeaders()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, HttpHeadersValidationError{ + field: "Headers", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, HttpHeadersValidationError{ + field: "Headers", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetHeaders()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HttpHeadersValidationError{ + field: "Headers", + reason: "embedded message failed validation", + cause: err, + } + } + } + + { + sorted_keys := make([]string, len(m.GetAttributes())) + i := 0 + for key := range m.GetAttributes() { + sorted_keys[i] = key + i++ + } + sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) + for _, key := range sorted_keys { + val := m.GetAttributes()[key] + _ = val + + // no validation rules for Attributes[key] + + if all { + switch v := interface{}(val).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, HttpHeadersValidationError{ + field: fmt.Sprintf("Attributes[%v]", key), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, HttpHeadersValidationError{ + field: fmt.Sprintf("Attributes[%v]", key), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(val).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HttpHeadersValidationError{ + field: fmt.Sprintf("Attributes[%v]", key), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + } + + // no validation rules for EndOfStream + + if len(errors) > 0 { + return HttpHeadersMultiError(errors) + } + + return nil +} + +// HttpHeadersMultiError is an error wrapping multiple validation errors +// returned by HttpHeaders.ValidateAll() if the designated constraints aren't met. +type HttpHeadersMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m HttpHeadersMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m HttpHeadersMultiError) AllErrors() []error { return m } + +// HttpHeadersValidationError is the validation error returned by +// HttpHeaders.Validate if the designated constraints aren't met. +type HttpHeadersValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e HttpHeadersValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e HttpHeadersValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e HttpHeadersValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e HttpHeadersValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e HttpHeadersValidationError) ErrorName() string { return "HttpHeadersValidationError" } + +// Error satisfies the builtin error interface +func (e HttpHeadersValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sHttpHeaders.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = HttpHeadersValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = HttpHeadersValidationError{} + +// Validate checks the field values on HttpBody with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *HttpBody) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on HttpBody with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in HttpBodyMultiError, or nil +// if none found. +func (m *HttpBody) ValidateAll() error { + return m.validate(true) +} + +func (m *HttpBody) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Body + + // no validation rules for EndOfStream + + // no validation rules for EndOfStreamWithoutMessage + + // no validation rules for GrpcMessageCompressed + + if len(errors) > 0 { + return HttpBodyMultiError(errors) + } + + return nil +} + +// HttpBodyMultiError is an error wrapping multiple validation errors returned +// by HttpBody.ValidateAll() if the designated constraints aren't met. +type HttpBodyMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m HttpBodyMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m HttpBodyMultiError) AllErrors() []error { return m } + +// HttpBodyValidationError is the validation error returned by +// HttpBody.Validate if the designated constraints aren't met. +type HttpBodyValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e HttpBodyValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e HttpBodyValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e HttpBodyValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e HttpBodyValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e HttpBodyValidationError) ErrorName() string { return "HttpBodyValidationError" } + +// Error satisfies the builtin error interface +func (e HttpBodyValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sHttpBody.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = HttpBodyValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = HttpBodyValidationError{} + +// Validate checks the field values on HttpTrailers with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *HttpTrailers) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on HttpTrailers with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in HttpTrailersMultiError, or +// nil if none found. +func (m *HttpTrailers) ValidateAll() error { + return m.validate(true) +} + +func (m *HttpTrailers) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetTrailers()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, HttpTrailersValidationError{ + field: "Trailers", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, HttpTrailersValidationError{ + field: "Trailers", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTrailers()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HttpTrailersValidationError{ + field: "Trailers", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return HttpTrailersMultiError(errors) + } + + return nil +} + +// HttpTrailersMultiError is an error wrapping multiple validation errors +// returned by HttpTrailers.ValidateAll() if the designated constraints aren't met. +type HttpTrailersMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m HttpTrailersMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m HttpTrailersMultiError) AllErrors() []error { return m } + +// HttpTrailersValidationError is the validation error returned by +// HttpTrailers.Validate if the designated constraints aren't met. +type HttpTrailersValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e HttpTrailersValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e HttpTrailersValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e HttpTrailersValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e HttpTrailersValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e HttpTrailersValidationError) ErrorName() string { return "HttpTrailersValidationError" } + +// Error satisfies the builtin error interface +func (e HttpTrailersValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sHttpTrailers.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = HttpTrailersValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = HttpTrailersValidationError{} + +// Validate checks the field values on HeadersResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *HeadersResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on HeadersResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// HeadersResponseMultiError, or nil if none found. +func (m *HeadersResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *HeadersResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetResponse()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, HeadersResponseValidationError{ + field: "Response", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, HeadersResponseValidationError{ + field: "Response", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetResponse()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HeadersResponseValidationError{ + field: "Response", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return HeadersResponseMultiError(errors) + } + + return nil +} + +// HeadersResponseMultiError is an error wrapping multiple validation errors +// returned by HeadersResponse.ValidateAll() if the designated constraints +// aren't met. +type HeadersResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m HeadersResponseMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m HeadersResponseMultiError) AllErrors() []error { return m } + +// HeadersResponseValidationError is the validation error returned by +// HeadersResponse.Validate if the designated constraints aren't met. +type HeadersResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e HeadersResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e HeadersResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e HeadersResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e HeadersResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e HeadersResponseValidationError) ErrorName() string { return "HeadersResponseValidationError" } + +// Error satisfies the builtin error interface +func (e HeadersResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sHeadersResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = HeadersResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = HeadersResponseValidationError{} + +// Validate checks the field values on BodyResponse with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *BodyResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on BodyResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in BodyResponseMultiError, or +// nil if none found. +func (m *BodyResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *BodyResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetResponse()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BodyResponseValidationError{ + field: "Response", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BodyResponseValidationError{ + field: "Response", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetResponse()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BodyResponseValidationError{ + field: "Response", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return BodyResponseMultiError(errors) + } + + return nil +} + +// BodyResponseMultiError is an error wrapping multiple validation errors +// returned by BodyResponse.ValidateAll() if the designated constraints aren't met. +type BodyResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m BodyResponseMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m BodyResponseMultiError) AllErrors() []error { return m } + +// BodyResponseValidationError is the validation error returned by +// BodyResponse.Validate if the designated constraints aren't met. +type BodyResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e BodyResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e BodyResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e BodyResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e BodyResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e BodyResponseValidationError) ErrorName() string { return "BodyResponseValidationError" } + +// Error satisfies the builtin error interface +func (e BodyResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sBodyResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = BodyResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = BodyResponseValidationError{} + +// Validate checks the field values on TrailersResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *TrailersResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on TrailersResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// TrailersResponseMultiError, or nil if none found. +func (m *TrailersResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *TrailersResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetHeaderMutation()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, TrailersResponseValidationError{ + field: "HeaderMutation", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, TrailersResponseValidationError{ + field: "HeaderMutation", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetHeaderMutation()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TrailersResponseValidationError{ + field: "HeaderMutation", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return TrailersResponseMultiError(errors) + } + + return nil +} + +// TrailersResponseMultiError is an error wrapping multiple validation errors +// returned by TrailersResponse.ValidateAll() if the designated constraints +// aren't met. +type TrailersResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m TrailersResponseMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m TrailersResponseMultiError) AllErrors() []error { return m } + +// TrailersResponseValidationError is the validation error returned by +// TrailersResponse.Validate if the designated constraints aren't met. +type TrailersResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e TrailersResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e TrailersResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e TrailersResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e TrailersResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e TrailersResponseValidationError) ErrorName() string { return "TrailersResponseValidationError" } + +// Error satisfies the builtin error interface +func (e TrailersResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sTrailersResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = TrailersResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = TrailersResponseValidationError{} + +// Validate checks the field values on StreamedImmediateResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *StreamedImmediateResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on StreamedImmediateResponse with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// StreamedImmediateResponseMultiError, or nil if none found. +func (m *StreamedImmediateResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *StreamedImmediateResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + switch v := m.Response.(type) { + case *StreamedImmediateResponse_HeadersResponse: + if v == nil { + err := StreamedImmediateResponseValidationError{ + field: "Response", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetHeadersResponse()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, StreamedImmediateResponseValidationError{ + field: "HeadersResponse", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, StreamedImmediateResponseValidationError{ + field: "HeadersResponse", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetHeadersResponse()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StreamedImmediateResponseValidationError{ + field: "HeadersResponse", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *StreamedImmediateResponse_BodyResponse: + if v == nil { + err := StreamedImmediateResponseValidationError{ + field: "Response", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetBodyResponse()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, StreamedImmediateResponseValidationError{ + field: "BodyResponse", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, StreamedImmediateResponseValidationError{ + field: "BodyResponse", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetBodyResponse()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StreamedImmediateResponseValidationError{ + field: "BodyResponse", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *StreamedImmediateResponse_TrailersResponse: + if v == nil { + err := StreamedImmediateResponseValidationError{ + field: "Response", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetTrailersResponse()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, StreamedImmediateResponseValidationError{ + field: "TrailersResponse", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, StreamedImmediateResponseValidationError{ + field: "TrailersResponse", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTrailersResponse()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StreamedImmediateResponseValidationError{ + field: "TrailersResponse", + reason: "embedded message failed validation", + cause: err, + } + } + } + + default: + _ = v // ensures v is used + } + + if len(errors) > 0 { + return StreamedImmediateResponseMultiError(errors) + } + + return nil +} + +// StreamedImmediateResponseMultiError is an error wrapping multiple validation +// errors returned by StreamedImmediateResponse.ValidateAll() if the +// designated constraints aren't met. +type StreamedImmediateResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m StreamedImmediateResponseMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m StreamedImmediateResponseMultiError) AllErrors() []error { return m } + +// StreamedImmediateResponseValidationError is the validation error returned by +// StreamedImmediateResponse.Validate if the designated constraints aren't met. +type StreamedImmediateResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e StreamedImmediateResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e StreamedImmediateResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e StreamedImmediateResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e StreamedImmediateResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e StreamedImmediateResponseValidationError) ErrorName() string { + return "StreamedImmediateResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e StreamedImmediateResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sStreamedImmediateResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = StreamedImmediateResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = StreamedImmediateResponseValidationError{} + +// Validate checks the field values on CommonResponse with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *CommonResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on CommonResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in CommonResponseMultiError, +// or nil if none found. +func (m *CommonResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *CommonResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if _, ok := CommonResponse_ResponseStatus_name[int32(m.GetStatus())]; !ok { + err := CommonResponseValidationError{ + field: "Status", + reason: "value must be one of the defined enum values", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetHeaderMutation()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CommonResponseValidationError{ + field: "HeaderMutation", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CommonResponseValidationError{ + field: "HeaderMutation", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetHeaderMutation()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CommonResponseValidationError{ + field: "HeaderMutation", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetBodyMutation()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CommonResponseValidationError{ + field: "BodyMutation", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CommonResponseValidationError{ + field: "BodyMutation", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetBodyMutation()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CommonResponseValidationError{ + field: "BodyMutation", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetTrailers()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CommonResponseValidationError{ + field: "Trailers", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CommonResponseValidationError{ + field: "Trailers", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTrailers()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CommonResponseValidationError{ + field: "Trailers", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for ClearRouteCache + + if len(errors) > 0 { + return CommonResponseMultiError(errors) + } + + return nil +} + +// CommonResponseMultiError is an error wrapping multiple validation errors +// returned by CommonResponse.ValidateAll() if the designated constraints +// aren't met. +type CommonResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m CommonResponseMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m CommonResponseMultiError) AllErrors() []error { return m } + +// CommonResponseValidationError is the validation error returned by +// CommonResponse.Validate if the designated constraints aren't met. +type CommonResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CommonResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CommonResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CommonResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CommonResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CommonResponseValidationError) ErrorName() string { return "CommonResponseValidationError" } + +// Error satisfies the builtin error interface +func (e CommonResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCommonResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CommonResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CommonResponseValidationError{} + +// Validate checks the field values on ImmediateResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *ImmediateResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ImmediateResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ImmediateResponseMultiError, or nil if none found. +func (m *ImmediateResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *ImmediateResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.GetStatus() == nil { + err := ImmediateResponseValidationError{ + field: "Status", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetStatus()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ImmediateResponseValidationError{ + field: "Status", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ImmediateResponseValidationError{ + field: "Status", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetStatus()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ImmediateResponseValidationError{ + field: "Status", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetHeaders()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ImmediateResponseValidationError{ + field: "Headers", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ImmediateResponseValidationError{ + field: "Headers", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetHeaders()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ImmediateResponseValidationError{ + field: "Headers", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for Body + + if all { + switch v := interface{}(m.GetGrpcStatus()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ImmediateResponseValidationError{ + field: "GrpcStatus", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ImmediateResponseValidationError{ + field: "GrpcStatus", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetGrpcStatus()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ImmediateResponseValidationError{ + field: "GrpcStatus", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for Details + + if len(errors) > 0 { + return ImmediateResponseMultiError(errors) + } + + return nil +} + +// ImmediateResponseMultiError is an error wrapping multiple validation errors +// returned by ImmediateResponse.ValidateAll() if the designated constraints +// aren't met. +type ImmediateResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ImmediateResponseMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ImmediateResponseMultiError) AllErrors() []error { return m } + +// ImmediateResponseValidationError is the validation error returned by +// ImmediateResponse.Validate if the designated constraints aren't met. +type ImmediateResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ImmediateResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ImmediateResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ImmediateResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ImmediateResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ImmediateResponseValidationError) ErrorName() string { + return "ImmediateResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e ImmediateResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sImmediateResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ImmediateResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ImmediateResponseValidationError{} + +// Validate checks the field values on GrpcStatus with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *GrpcStatus) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GrpcStatus with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in GrpcStatusMultiError, or +// nil if none found. +func (m *GrpcStatus) ValidateAll() error { + return m.validate(true) +} + +func (m *GrpcStatus) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Status + + if len(errors) > 0 { + return GrpcStatusMultiError(errors) + } + + return nil +} + +// GrpcStatusMultiError is an error wrapping multiple validation errors +// returned by GrpcStatus.ValidateAll() if the designated constraints aren't met. +type GrpcStatusMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GrpcStatusMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GrpcStatusMultiError) AllErrors() []error { return m } + +// GrpcStatusValidationError is the validation error returned by +// GrpcStatus.Validate if the designated constraints aren't met. +type GrpcStatusValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GrpcStatusValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GrpcStatusValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GrpcStatusValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GrpcStatusValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GrpcStatusValidationError) ErrorName() string { return "GrpcStatusValidationError" } + +// Error satisfies the builtin error interface +func (e GrpcStatusValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGrpcStatus.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GrpcStatusValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GrpcStatusValidationError{} + +// Validate checks the field values on HeaderMutation with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *HeaderMutation) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on HeaderMutation with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in HeaderMutationMultiError, +// or nil if none found. +func (m *HeaderMutation) ValidateAll() error { + return m.validate(true) +} + +func (m *HeaderMutation) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + for idx, item := range m.GetSetHeaders() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, HeaderMutationValidationError{ + field: fmt.Sprintf("SetHeaders[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, HeaderMutationValidationError{ + field: fmt.Sprintf("SetHeaders[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HeaderMutationValidationError{ + field: fmt.Sprintf("SetHeaders[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return HeaderMutationMultiError(errors) + } + + return nil +} + +// HeaderMutationMultiError is an error wrapping multiple validation errors +// returned by HeaderMutation.ValidateAll() if the designated constraints +// aren't met. +type HeaderMutationMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m HeaderMutationMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m HeaderMutationMultiError) AllErrors() []error { return m } + +// HeaderMutationValidationError is the validation error returned by +// HeaderMutation.Validate if the designated constraints aren't met. +type HeaderMutationValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e HeaderMutationValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e HeaderMutationValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e HeaderMutationValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e HeaderMutationValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e HeaderMutationValidationError) ErrorName() string { return "HeaderMutationValidationError" } + +// Error satisfies the builtin error interface +func (e HeaderMutationValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sHeaderMutation.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = HeaderMutationValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = HeaderMutationValidationError{} + +// Validate checks the field values on StreamedBodyResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *StreamedBodyResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on StreamedBodyResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// StreamedBodyResponseMultiError, or nil if none found. +func (m *StreamedBodyResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *StreamedBodyResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Body + + // no validation rules for EndOfStream + + // no validation rules for EndOfStreamWithoutMessage + + // no validation rules for GrpcMessageCompressed + + if len(errors) > 0 { + return StreamedBodyResponseMultiError(errors) + } + + return nil +} + +// StreamedBodyResponseMultiError is an error wrapping multiple validation +// errors returned by StreamedBodyResponse.ValidateAll() if the designated +// constraints aren't met. +type StreamedBodyResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m StreamedBodyResponseMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m StreamedBodyResponseMultiError) AllErrors() []error { return m } + +// StreamedBodyResponseValidationError is the validation error returned by +// StreamedBodyResponse.Validate if the designated constraints aren't met. +type StreamedBodyResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e StreamedBodyResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e StreamedBodyResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e StreamedBodyResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e StreamedBodyResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e StreamedBodyResponseValidationError) ErrorName() string { + return "StreamedBodyResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e StreamedBodyResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sStreamedBodyResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = StreamedBodyResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = StreamedBodyResponseValidationError{} + +// Validate checks the field values on BodyMutation with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *BodyMutation) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on BodyMutation with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in BodyMutationMultiError, or +// nil if none found. +func (m *BodyMutation) ValidateAll() error { + return m.validate(true) +} + +func (m *BodyMutation) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + switch v := m.Mutation.(type) { + case *BodyMutation_Body: + if v == nil { + err := BodyMutationValidationError{ + field: "Mutation", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + // no validation rules for Body + case *BodyMutation_ClearBody: + if v == nil { + err := BodyMutationValidationError{ + field: "Mutation", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + // no validation rules for ClearBody + case *BodyMutation_StreamedResponse: + if v == nil { + err := BodyMutationValidationError{ + field: "Mutation", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetStreamedResponse()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BodyMutationValidationError{ + field: "StreamedResponse", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BodyMutationValidationError{ + field: "StreamedResponse", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetStreamedResponse()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BodyMutationValidationError{ + field: "StreamedResponse", + reason: "embedded message failed validation", + cause: err, + } + } + } + + default: + _ = v // ensures v is used + } + + if len(errors) > 0 { + return BodyMutationMultiError(errors) + } + + return nil +} + +// BodyMutationMultiError is an error wrapping multiple validation errors +// returned by BodyMutation.ValidateAll() if the designated constraints aren't met. +type BodyMutationMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m BodyMutationMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m BodyMutationMultiError) AllErrors() []error { return m } + +// BodyMutationValidationError is the validation error returned by +// BodyMutation.Validate if the designated constraints aren't met. +type BodyMutationValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e BodyMutationValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e BodyMutationValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e BodyMutationValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e BodyMutationValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e BodyMutationValidationError) ErrorName() string { return "BodyMutationValidationError" } + +// Error satisfies the builtin error interface +func (e BodyMutationValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sBodyMutation.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = BodyMutationValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = BodyMutationValidationError{} diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor_grpc.pb.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor_grpc.pb.go new file mode 100644 index 00000000000..ef6c91c1d16 --- /dev/null +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor_grpc.pb.go @@ -0,0 +1,147 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v6.33.2 +// source: envoy/service/ext_proc/v3/external_processor.proto + +package ext_procv3 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + ExternalProcessor_Process_FullMethodName = "/envoy.service.ext_proc.v3.ExternalProcessor/Process" +) + +// ExternalProcessorClient is the client API for ExternalProcessor service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ExternalProcessorClient interface { + // This begins the bidirectional stream that the data plane will use to + // give the server control over what the filter does. The actual + // protocol is described by the ProcessingRequest and ProcessingResponse + // messages below. + Process(ctx context.Context, opts ...grpc.CallOption) (ExternalProcessor_ProcessClient, error) +} + +type externalProcessorClient struct { + cc grpc.ClientConnInterface +} + +func NewExternalProcessorClient(cc grpc.ClientConnInterface) ExternalProcessorClient { + return &externalProcessorClient{cc} +} + +func (c *externalProcessorClient) Process(ctx context.Context, opts ...grpc.CallOption) (ExternalProcessor_ProcessClient, error) { + stream, err := c.cc.NewStream(ctx, &ExternalProcessor_ServiceDesc.Streams[0], ExternalProcessor_Process_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &externalProcessorProcessClient{stream} + return x, nil +} + +type ExternalProcessor_ProcessClient interface { + Send(*ProcessingRequest) error + Recv() (*ProcessingResponse, error) + grpc.ClientStream +} + +type externalProcessorProcessClient struct { + grpc.ClientStream +} + +func (x *externalProcessorProcessClient) Send(m *ProcessingRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *externalProcessorProcessClient) Recv() (*ProcessingResponse, error) { + m := new(ProcessingResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// ExternalProcessorServer is the server API for ExternalProcessor service. +// All implementations should embed UnimplementedExternalProcessorServer +// for forward compatibility +type ExternalProcessorServer interface { + // This begins the bidirectional stream that the data plane will use to + // give the server control over what the filter does. The actual + // protocol is described by the ProcessingRequest and ProcessingResponse + // messages below. + Process(ExternalProcessor_ProcessServer) error +} + +// UnimplementedExternalProcessorServer should be embedded to have forward compatible implementations. +type UnimplementedExternalProcessorServer struct { +} + +func (UnimplementedExternalProcessorServer) Process(ExternalProcessor_ProcessServer) error { + return status.Errorf(codes.Unimplemented, "method Process not implemented") +} + +// UnsafeExternalProcessorServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ExternalProcessorServer will +// result in compilation errors. +type UnsafeExternalProcessorServer interface { + mustEmbedUnimplementedExternalProcessorServer() +} + +func RegisterExternalProcessorServer(s grpc.ServiceRegistrar, srv ExternalProcessorServer) { + s.RegisterService(&ExternalProcessor_ServiceDesc, srv) +} + +func _ExternalProcessor_Process_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(ExternalProcessorServer).Process(&externalProcessorProcessServer{stream}) +} + +type ExternalProcessor_ProcessServer interface { + Send(*ProcessingResponse) error + Recv() (*ProcessingRequest, error) + grpc.ServerStream +} + +type externalProcessorProcessServer struct { + grpc.ServerStream +} + +func (x *externalProcessorProcessServer) Send(m *ProcessingResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *externalProcessorProcessServer) Recv() (*ProcessingRequest, error) { + m := new(ProcessingRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// ExternalProcessor_ServiceDesc is the grpc.ServiceDesc for ExternalProcessor service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ExternalProcessor_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "envoy.service.ext_proc.v3.ExternalProcessor", + HandlerType: (*ExternalProcessorServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Process", + Handler: _ExternalProcessor_Process_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "envoy/service/ext_proc/v3/external_processor.proto", +} diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor_vtproto.pb.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor_vtproto.pb.go new file mode 100644 index 00000000000..0dbfdcf8171 --- /dev/null +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3/external_processor_vtproto.pb.go @@ -0,0 +1,2269 @@ +//go:build vtprotobuf +// +build vtprotobuf + +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// source: envoy/service/ext_proc/v3/external_processor.proto + +package ext_procv3 + +import ( + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + durationpb "github.com/planetscale/vtprotobuf/types/known/durationpb" + structpb "github.com/planetscale/vtprotobuf/types/known/structpb" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +func (m *ProtocolConfiguration) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ProtocolConfiguration) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProtocolConfiguration) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.SendBodyWithoutWaitingForHeaderResponse { + i-- + if m.SendBodyWithoutWaitingForHeaderResponse { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.ResponseBodyMode != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ResponseBodyMode)) + i-- + dAtA[i] = 0x10 + } + if m.RequestBodyMode != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RequestBodyMode)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ProcessingRequest) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ProcessingRequest) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.ProtocolConfig != nil { + size, err := m.ProtocolConfig.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x5a + } + if m.ObservabilityMode { + i-- + if m.ObservabilityMode { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x50 + } + if len(m.Attributes) > 0 { + for k := range m.Attributes { + v := m.Attributes[k] + baseI := i + size, err := (*structpb.Struct)(v).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x4a + } + } + if m.MetadataContext != nil { + if vtmsg, ok := interface{}(m.MetadataContext).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.MetadataContext) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x42 + } + if msg, ok := m.Request.(*ProcessingRequest_ResponseTrailers); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Request.(*ProcessingRequest_RequestTrailers); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Request.(*ProcessingRequest_ResponseBody); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Request.(*ProcessingRequest_RequestBody); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Request.(*ProcessingRequest_ResponseHeaders); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Request.(*ProcessingRequest_RequestHeaders); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *ProcessingRequest_RequestHeaders) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingRequest_RequestHeaders) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.RequestHeaders != nil { + size, err := m.RequestHeaders.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *ProcessingRequest_ResponseHeaders) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingRequest_ResponseHeaders) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ResponseHeaders != nil { + size, err := m.ResponseHeaders.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *ProcessingRequest_RequestBody) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingRequest_RequestBody) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.RequestBody != nil { + size, err := m.RequestBody.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *ProcessingRequest_ResponseBody) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingRequest_ResponseBody) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ResponseBody != nil { + size, err := m.ResponseBody.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} +func (m *ProcessingRequest_RequestTrailers) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingRequest_RequestTrailers) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.RequestTrailers != nil { + size, err := m.RequestTrailers.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x32 + } + return len(dAtA) - i, nil +} +func (m *ProcessingRequest_ResponseTrailers) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingRequest_ResponseTrailers) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ResponseTrailers != nil { + size, err := m.ResponseTrailers.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x3a + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x3a + } + return len(dAtA) - i, nil +} +func (m *ProcessingResponse) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ProcessingResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.RequestDrain { + i-- + if m.RequestDrain { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x60 + } + if msg, ok := m.Response.(*ProcessingResponse_StreamedImmediateResponse); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if m.OverrideMessageTimeout != nil { + size, err := (*durationpb.Duration)(m.OverrideMessageTimeout).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x52 + } + if m.ModeOverride != nil { + if vtmsg, ok := interface{}(m.ModeOverride).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.ModeOverride) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x4a + } + if m.DynamicMetadata != nil { + size, err := (*structpb.Struct)(m.DynamicMetadata).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x42 + } + if msg, ok := m.Response.(*ProcessingResponse_ImmediateResponse); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Response.(*ProcessingResponse_ResponseTrailers); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Response.(*ProcessingResponse_RequestTrailers); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Response.(*ProcessingResponse_ResponseBody); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Response.(*ProcessingResponse_RequestBody); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Response.(*ProcessingResponse_ResponseHeaders); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Response.(*ProcessingResponse_RequestHeaders); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *ProcessingResponse_RequestHeaders) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingResponse_RequestHeaders) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.RequestHeaders != nil { + size, err := m.RequestHeaders.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *ProcessingResponse_ResponseHeaders) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingResponse_ResponseHeaders) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ResponseHeaders != nil { + size, err := m.ResponseHeaders.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *ProcessingResponse_RequestBody) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingResponse_RequestBody) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.RequestBody != nil { + size, err := m.RequestBody.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *ProcessingResponse_ResponseBody) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingResponse_ResponseBody) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ResponseBody != nil { + size, err := m.ResponseBody.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *ProcessingResponse_RequestTrailers) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingResponse_RequestTrailers) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.RequestTrailers != nil { + size, err := m.RequestTrailers.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} +func (m *ProcessingResponse_ResponseTrailers) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingResponse_ResponseTrailers) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ResponseTrailers != nil { + size, err := m.ResponseTrailers.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x32 + } + return len(dAtA) - i, nil +} +func (m *ProcessingResponse_ImmediateResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingResponse_ImmediateResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ImmediateResponse != nil { + size, err := m.ImmediateResponse.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x3a + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x3a + } + return len(dAtA) - i, nil +} +func (m *ProcessingResponse_StreamedImmediateResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ProcessingResponse_StreamedImmediateResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.StreamedImmediateResponse != nil { + size, err := m.StreamedImmediateResponse.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x5a + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x5a + } + return len(dAtA) - i, nil +} +func (m *HttpHeaders) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HttpHeaders) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *HttpHeaders) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.EndOfStream { + i-- + if m.EndOfStream { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(m.Attributes) > 0 { + for k := range m.Attributes { + v := m.Attributes[k] + baseI := i + size, err := (*structpb.Struct)(v).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if m.Headers != nil { + if vtmsg, ok := interface{}(m.Headers).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Headers) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HttpBody) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HttpBody) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *HttpBody) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.GrpcMessageCompressed { + i-- + if m.GrpcMessageCompressed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.EndOfStreamWithoutMessage { + i-- + if m.EndOfStreamWithoutMessage { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.EndOfStream { + i-- + if m.EndOfStream { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.Body) > 0 { + i -= len(m.Body) + copy(dAtA[i:], m.Body) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Body))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HttpTrailers) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HttpTrailers) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *HttpTrailers) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Trailers != nil { + if vtmsg, ok := interface{}(m.Trailers).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Trailers) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HeadersResponse) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HeadersResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *HeadersResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Response != nil { + size, err := m.Response.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BodyResponse) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BodyResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *BodyResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Response != nil { + size, err := m.Response.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TrailersResponse) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TrailersResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *TrailersResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.HeaderMutation != nil { + size, err := m.HeaderMutation.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *StreamedImmediateResponse) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StreamedImmediateResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *StreamedImmediateResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if msg, ok := m.Response.(*StreamedImmediateResponse_TrailersResponse); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Response.(*StreamedImmediateResponse_BodyResponse); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Response.(*StreamedImmediateResponse_HeadersResponse); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *StreamedImmediateResponse_HeadersResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *StreamedImmediateResponse_HeadersResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.HeadersResponse != nil { + size, err := m.HeadersResponse.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *StreamedImmediateResponse_BodyResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *StreamedImmediateResponse_BodyResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.BodyResponse != nil { + size, err := m.BodyResponse.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *StreamedImmediateResponse_TrailersResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *StreamedImmediateResponse_TrailersResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.TrailersResponse != nil { + if vtmsg, ok := interface{}(m.TrailersResponse).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.TrailersResponse) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x1a + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *CommonResponse) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CommonResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *CommonResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.ClearRouteCache { + i-- + if m.ClearRouteCache { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.Trailers != nil { + if vtmsg, ok := interface{}(m.Trailers).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Trailers) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x22 + } + if m.BodyMutation != nil { + size, err := m.BodyMutation.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if m.HeaderMutation != nil { + size, err := m.HeaderMutation.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.Status != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ImmediateResponse) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ImmediateResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ImmediateResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Details) > 0 { + i -= len(m.Details) + copy(dAtA[i:], m.Details) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Details))) + i-- + dAtA[i] = 0x2a + } + if m.GrpcStatus != nil { + size, err := m.GrpcStatus.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + if len(m.Body) > 0 { + i -= len(m.Body) + copy(dAtA[i:], m.Body) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Body))) + i-- + dAtA[i] = 0x1a + } + if m.Headers != nil { + size, err := m.Headers.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.Status != nil { + if vtmsg, ok := interface{}(m.Status).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Status) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GrpcStatus) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GrpcStatus) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *GrpcStatus) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Status != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *HeaderMutation) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HeaderMutation) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *HeaderMutation) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.RemoveHeaders) > 0 { + for iNdEx := len(m.RemoveHeaders) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RemoveHeaders[iNdEx]) + copy(dAtA[i:], m.RemoveHeaders[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RemoveHeaders[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.SetHeaders) > 0 { + for iNdEx := len(m.SetHeaders) - 1; iNdEx >= 0; iNdEx-- { + if vtmsg, ok := interface{}(m.SetHeaders[iNdEx]).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.SetHeaders[iNdEx]) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *StreamedBodyResponse) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StreamedBodyResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *StreamedBodyResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.GrpcMessageCompressed { + i-- + if m.GrpcMessageCompressed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.EndOfStreamWithoutMessage { + i-- + if m.EndOfStreamWithoutMessage { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.EndOfStream { + i-- + if m.EndOfStream { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.Body) > 0 { + i -= len(m.Body) + copy(dAtA[i:], m.Body) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Body))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BodyMutation) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BodyMutation) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *BodyMutation) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if msg, ok := m.Mutation.(*BodyMutation_StreamedResponse); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Mutation.(*BodyMutation_ClearBody); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.Mutation.(*BodyMutation_Body); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *BodyMutation_Body) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *BodyMutation_Body) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Body) + copy(dAtA[i:], m.Body) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Body))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} +func (m *BodyMutation_ClearBody) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *BodyMutation_ClearBody) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + i-- + if m.ClearBody { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + return len(dAtA) - i, nil +} +func (m *BodyMutation_StreamedResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *BodyMutation_StreamedResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.StreamedResponse != nil { + size, err := m.StreamedResponse.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *ProtocolConfiguration) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RequestBodyMode != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.RequestBodyMode)) + } + if m.ResponseBodyMode != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.ResponseBodyMode)) + } + if m.SendBodyWithoutWaitingForHeaderResponse { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *ProcessingRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Request.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + if m.MetadataContext != nil { + if size, ok := interface{}(m.MetadataContext).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.MetadataContext) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.Attributes) > 0 { + for k, v := range m.Attributes { + _ = k + _ = v + l = 0 + if v != nil { + l = (*structpb.Struct)(v).SizeVT() + } + l += 1 + protohelpers.SizeOfVarint(uint64(l)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + l + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) + } + } + if m.ObservabilityMode { + n += 2 + } + if m.ProtocolConfig != nil { + l = m.ProtocolConfig.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *ProcessingRequest_RequestHeaders) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RequestHeaders != nil { + l = m.RequestHeaders.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *ProcessingRequest_ResponseHeaders) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ResponseHeaders != nil { + l = m.ResponseHeaders.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *ProcessingRequest_RequestBody) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RequestBody != nil { + l = m.RequestBody.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *ProcessingRequest_ResponseBody) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ResponseBody != nil { + l = m.ResponseBody.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *ProcessingRequest_RequestTrailers) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RequestTrailers != nil { + l = m.RequestTrailers.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *ProcessingRequest_ResponseTrailers) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ResponseTrailers != nil { + l = m.ResponseTrailers.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *ProcessingResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Response.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + if m.DynamicMetadata != nil { + l = (*structpb.Struct)(m.DynamicMetadata).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.ModeOverride != nil { + if size, ok := interface{}(m.ModeOverride).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.ModeOverride) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.OverrideMessageTimeout != nil { + l = (*durationpb.Duration)(m.OverrideMessageTimeout).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.RequestDrain { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *ProcessingResponse_RequestHeaders) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RequestHeaders != nil { + l = m.RequestHeaders.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *ProcessingResponse_ResponseHeaders) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ResponseHeaders != nil { + l = m.ResponseHeaders.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *ProcessingResponse_RequestBody) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RequestBody != nil { + l = m.RequestBody.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *ProcessingResponse_ResponseBody) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ResponseBody != nil { + l = m.ResponseBody.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *ProcessingResponse_RequestTrailers) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RequestTrailers != nil { + l = m.RequestTrailers.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *ProcessingResponse_ResponseTrailers) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ResponseTrailers != nil { + l = m.ResponseTrailers.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *ProcessingResponse_ImmediateResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ImmediateResponse != nil { + l = m.ImmediateResponse.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *ProcessingResponse_StreamedImmediateResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.StreamedImmediateResponse != nil { + l = m.StreamedImmediateResponse.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *HttpHeaders) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Headers != nil { + if size, ok := interface{}(m.Headers).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.Headers) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.Attributes) > 0 { + for k, v := range m.Attributes { + _ = k + _ = v + l = 0 + if v != nil { + l = (*structpb.Struct)(v).SizeVT() + } + l += 1 + protohelpers.SizeOfVarint(uint64(l)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + l + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) + } + } + if m.EndOfStream { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *HttpBody) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Body) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.EndOfStream { + n += 2 + } + if m.EndOfStreamWithoutMessage { + n += 2 + } + if m.GrpcMessageCompressed { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *HttpTrailers) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Trailers != nil { + if size, ok := interface{}(m.Trailers).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.Trailers) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *HeadersResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Response != nil { + l = m.Response.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *BodyResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Response != nil { + l = m.Response.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *TrailersResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.HeaderMutation != nil { + l = m.HeaderMutation.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *StreamedImmediateResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Response.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + n += len(m.unknownFields) + return n +} + +func (m *StreamedImmediateResponse_HeadersResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.HeadersResponse != nil { + l = m.HeadersResponse.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *StreamedImmediateResponse_BodyResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BodyResponse != nil { + l = m.BodyResponse.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *StreamedImmediateResponse_TrailersResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TrailersResponse != nil { + if size, ok := interface{}(m.TrailersResponse).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.TrailersResponse) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} +func (m *CommonResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Status != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Status)) + } + if m.HeaderMutation != nil { + l = m.HeaderMutation.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.BodyMutation != nil { + l = m.BodyMutation.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Trailers != nil { + if size, ok := interface{}(m.Trailers).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.Trailers) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.ClearRouteCache { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *ImmediateResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Status != nil { + if size, ok := interface{}(m.Status).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.Status) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Headers != nil { + l = m.Headers.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Body) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.GrpcStatus != nil { + l = m.GrpcStatus.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Details) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *GrpcStatus) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Status != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Status)) + } + n += len(m.unknownFields) + return n +} + +func (m *HeaderMutation) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.SetHeaders) > 0 { + for _, e := range m.SetHeaders { + if size, ok := interface{}(e).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(e) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.RemoveHeaders) > 0 { + for _, s := range m.RemoveHeaders { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *StreamedBodyResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Body) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.EndOfStream { + n += 2 + } + if m.EndOfStreamWithoutMessage { + n += 2 + } + if m.GrpcMessageCompressed { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *BodyMutation) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Mutation.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + n += len(m.unknownFields) + return n +} + +func (m *BodyMutation_Body) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Body) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + return n +} +func (m *BodyMutation_ClearBody) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 2 + return n +} +func (m *BodyMutation_StreamedResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.StreamedResponse != nil { + l = m.StreamedResponse.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 2 + } + return n +} diff --git a/vendor/github.com/felixge/httpsnoop/capture_metrics.go b/vendor/github.com/felixge/httpsnoop/capture_metrics.go index bec7b71b39c..97f0a51de31 100644 --- a/vendor/github.com/felixge/httpsnoop/capture_metrics.go +++ b/vendor/github.com/felixge/httpsnoop/capture_metrics.go @@ -69,6 +69,16 @@ func (m *Metrics) CaptureMetrics(w http.ResponseWriter, fn func(http.ResponseWri } }, + WriteString: func(next WriteStringFunc) WriteStringFunc { + return func(s string) (int, error) { + n, err := next(s) + + m.Written += int64(n) + headerWritten = true + return n, err + } + }, + ReadFrom: func(next ReadFromFunc) ReadFromFunc { return func(src io.Reader) (int64, error) { n, err := next(src) @@ -81,6 +91,31 @@ func (m *Metrics) CaptureMetrics(w http.ResponseWriter, fn func(http.ResponseWri } ) + // defer to ensure duration is updated even if the handler panics + defer func() { + m.Duration += time.Since(start) + }() fn(Wrap(w, hooks)) - m.Duration += time.Since(start) +} + +// deadliner defines two methods introduced in go 1.20. The standard library +// seems not to provide an interface we can import, hence its definition here. +type deadliner interface { + SetReadDeadline(deadline time.Time) error + SetWriteDeadline(deadline time.Time) error +} + +// fullDuplexEnabler defines a method introduced in go 1.21. The standard +// library seems not to provide an interface we can import, hence its definition +// here. +type fullDuplexEnabler interface { + EnableFullDuplex() error +} + +// httpFlushError defines a method introduced in go 1.20. The standard +// library seems not to provide an interface we can import, hence its definition +// here. +// See https://github.com/golang/go/blob/go1.20/src/net/http/responsecontroller.go#L50 +type httpFlushError interface { + FlushError() error } diff --git a/vendor/github.com/felixge/httpsnoop/wrap_generated.go b/vendor/github.com/felixge/httpsnoop/wrap_generated.go new file mode 100644 index 00000000000..b6549ba982b --- /dev/null +++ b/vendor/github.com/felixge/httpsnoop/wrap_generated.go @@ -0,0 +1,16179 @@ +// Code generated by "httpsnoop/codegen"; DO NOT EDIT. + +package httpsnoop + +import ( + "bufio" + "io" + "net" + "net/http" + "time" +) + +// HeaderFunc is part of the http.ResponseWriter interface. +type HeaderFunc func() http.Header + +// WriteHeaderFunc is part of the http.ResponseWriter interface. +type WriteHeaderFunc func(code int) + +// WriteFunc is part of the http.ResponseWriter interface. +type WriteFunc func(b []byte) (int, error) + +// FlushFunc is part of the http.Flusher interface. +type FlushFunc func() + +// FlushErrorFunc is part of the httpFlushError interface. +type FlushErrorFunc func() error + +// CloseNotifyFunc is part of the http.CloseNotifier interface. +type CloseNotifyFunc func() <-chan bool + +// HijackFunc is part of the http.Hijacker interface. +type HijackFunc func() (net.Conn, *bufio.ReadWriter, error) + +// ReadFromFunc is part of the io.ReaderFrom interface. +type ReadFromFunc func(src io.Reader) (int64, error) + +// SetReadDeadlineFunc is part of the deadliner interface. +type SetReadDeadlineFunc func(deadline time.Time) error + +// SetWriteDeadlineFunc is part of the deadliner interface. +type SetWriteDeadlineFunc func(deadline time.Time) error + +// EnableFullDuplexFunc is part of the fullDuplexEnabler interface. +type EnableFullDuplexFunc func() error + +// PushFunc is part of the http.Pusher interface. +type PushFunc func(target string, opts *http.PushOptions) error + +// WriteStringFunc is part of the io.StringWriter interface. +type WriteStringFunc func(s string) (int, error) + +// Hooks defines a set of method interceptors for methods included in +// http.ResponseWriter as well as some others. You can think of them as +// middleware for the function calls they target. See Wrap for more details. +// +// For each method, the exact matching hook takes precedence. For example, +// WriteString calls the WriteString hook when it is configured, even if a +// Write hook is also configured. If the exact hook is not configured, most +// methods call through to the underlying ResponseWriter directly. +// +// Two compatibility fallbacks preserve the behavior users had before Wrap +// learned about newer optional interfaces: +// - If the underlying ResponseWriter implements io.StringWriter and +// WriteString is called, but only the Write hook is configured, WriteString +// is routed through the Write hook with []byte(s). If neither hook is +// configured, WriteString calls the underlying WriteString method directly. +// - If the underlying ResponseWriter implements both http.Flusher and +// FlushError, and FlushError is called, but only the Flush hook is +// configured, FlushError is routed through the Flush hook while preserving +// the error returned by the underlying FlushError method. If neither hook is +// configured, FlushError calls the underlying FlushError method directly. +type Hooks struct { + Header func(HeaderFunc) HeaderFunc + WriteHeader func(WriteHeaderFunc) WriteHeaderFunc + Write func(WriteFunc) WriteFunc + Flush func(FlushFunc) FlushFunc + FlushError func(FlushErrorFunc) FlushErrorFunc + CloseNotify func(CloseNotifyFunc) CloseNotifyFunc + Hijack func(HijackFunc) HijackFunc + ReadFrom func(ReadFromFunc) ReadFromFunc + SetReadDeadline func(SetReadDeadlineFunc) SetReadDeadlineFunc + SetWriteDeadline func(SetWriteDeadlineFunc) SetWriteDeadlineFunc + EnableFullDuplex func(EnableFullDuplexFunc) EnableFullDuplexFunc + Push func(PushFunc) PushFunc + WriteString func(WriteStringFunc) WriteStringFunc +} + +// Wrap returns a wrapped version of w that provides the exact same interface +// as w. Specifically if w implements any combination of: +// +// - http.Flusher +// - httpFlushError +// - http.CloseNotifier +// - http.Hijacker +// - io.ReaderFrom +// - deadliner +// - fullDuplexEnabler +// - http.Pusher +// - io.StringWriter +// +// The wrapped version will implement the exact same combination. If no hooks +// are set, the wrapped version also behaves exactly as w. Hooks targeting +// methods not supported by w are ignored. Any other hooks will intercept the +// method they target and may modify the call's arguments and/or return values. +// The CaptureMetrics implementation serves as a working example for how the +// hooks can be used. +func Wrap(w http.ResponseWriter, hooks Hooks) http.ResponseWriter { + state := &rwState{w: w} + var combo uint16 + if hooks.Header != nil { + state.header = hooks.Header(w.Header) + } + if hooks.WriteHeader != nil { + state.writeHeader = hooks.WriteHeader(w.WriteHeader) + } + if hooks.Write != nil { + state.write = hooks.Write(w.Write) + } + if t0, i0 := w.(http.Flusher); i0 { + combo |= 1 << 8 + if hooks.Flush != nil { + state.flush = hooks.Flush(t0.Flush) + } + } + if t1, i1 := w.(httpFlushError); i1 { + combo |= 1 << 7 + if hooks.FlushError != nil { + state.flushError = hooks.FlushError(t1.FlushError) + } else if state.flush != nil { + state.flushError = func() (err error) { hooks.Flush(func() { err = t1.FlushError() })(); return err } + } + } + if t2, i2 := w.(http.CloseNotifier); i2 { + combo |= 1 << 6 + if hooks.CloseNotify != nil { + state.closeNotify = hooks.CloseNotify(t2.CloseNotify) + } + } + if t3, i3 := w.(http.Hijacker); i3 { + combo |= 1 << 5 + if hooks.Hijack != nil { + state.hijack = hooks.Hijack(t3.Hijack) + } + } + if t4, i4 := w.(io.ReaderFrom); i4 { + combo |= 1 << 4 + if hooks.ReadFrom != nil { + state.readFrom = hooks.ReadFrom(t4.ReadFrom) + } + } + if t5, i5 := w.(deadliner); i5 { + combo |= 1 << 3 + if hooks.SetReadDeadline != nil { + state.setReadDeadline = hooks.SetReadDeadline(t5.SetReadDeadline) + } + if hooks.SetWriteDeadline != nil { + state.setWriteDeadline = hooks.SetWriteDeadline(t5.SetWriteDeadline) + } + } + if t6, i6 := w.(fullDuplexEnabler); i6 { + combo |= 1 << 2 + if hooks.EnableFullDuplex != nil { + state.enableFullDuplex = hooks.EnableFullDuplex(t6.EnableFullDuplex) + } + } + if t7, i7 := w.(http.Pusher); i7 { + combo |= 1 << 1 + if hooks.Push != nil { + state.push = hooks.Push(t7.Push) + } + } + if t8, i8 := w.(io.StringWriter); i8 { + combo |= 1 << 0 + if hooks.WriteString != nil { + state.writeString = hooks.WriteString(t8.WriteString) + } else if state.write != nil { + state.writeString = func(s string) (int, error) { return state.write([]byte(s)) } + } + } + switch combo { + case 0: + return (*rw0)(state) + case 1: + return (*rw1)(state) + case 2: + return (*rw2)(state) + case 3: + return (*rw3)(state) + case 4: + return (*rw4)(state) + case 5: + return (*rw5)(state) + case 6: + return (*rw6)(state) + case 7: + return (*rw7)(state) + case 8: + return (*rw8)(state) + case 9: + return (*rw9)(state) + case 10: + return (*rw10)(state) + case 11: + return (*rw11)(state) + case 12: + return (*rw12)(state) + case 13: + return (*rw13)(state) + case 14: + return (*rw14)(state) + case 15: + return (*rw15)(state) + case 16: + return (*rw16)(state) + case 17: + return (*rw17)(state) + case 18: + return (*rw18)(state) + case 19: + return (*rw19)(state) + case 20: + return (*rw20)(state) + case 21: + return (*rw21)(state) + case 22: + return (*rw22)(state) + case 23: + return (*rw23)(state) + case 24: + return (*rw24)(state) + case 25: + return (*rw25)(state) + case 26: + return (*rw26)(state) + case 27: + return (*rw27)(state) + case 28: + return (*rw28)(state) + case 29: + return (*rw29)(state) + case 30: + return (*rw30)(state) + case 31: + return (*rw31)(state) + case 32: + return (*rw32)(state) + case 33: + return (*rw33)(state) + case 34: + return (*rw34)(state) + case 35: + return (*rw35)(state) + case 36: + return (*rw36)(state) + case 37: + return (*rw37)(state) + case 38: + return (*rw38)(state) + case 39: + return (*rw39)(state) + case 40: + return (*rw40)(state) + case 41: + return (*rw41)(state) + case 42: + return (*rw42)(state) + case 43: + return (*rw43)(state) + case 44: + return (*rw44)(state) + case 45: + return (*rw45)(state) + case 46: + return (*rw46)(state) + case 47: + return (*rw47)(state) + case 48: + return (*rw48)(state) + case 49: + return (*rw49)(state) + case 50: + return (*rw50)(state) + case 51: + return (*rw51)(state) + case 52: + return (*rw52)(state) + case 53: + return (*rw53)(state) + case 54: + return (*rw54)(state) + case 55: + return (*rw55)(state) + case 56: + return (*rw56)(state) + case 57: + return (*rw57)(state) + case 58: + return (*rw58)(state) + case 59: + return (*rw59)(state) + case 60: + return (*rw60)(state) + case 61: + return (*rw61)(state) + case 62: + return (*rw62)(state) + case 63: + return (*rw63)(state) + case 64: + return (*rw64)(state) + case 65: + return (*rw65)(state) + case 66: + return (*rw66)(state) + case 67: + return (*rw67)(state) + case 68: + return (*rw68)(state) + case 69: + return (*rw69)(state) + case 70: + return (*rw70)(state) + case 71: + return (*rw71)(state) + case 72: + return (*rw72)(state) + case 73: + return (*rw73)(state) + case 74: + return (*rw74)(state) + case 75: + return (*rw75)(state) + case 76: + return (*rw76)(state) + case 77: + return (*rw77)(state) + case 78: + return (*rw78)(state) + case 79: + return (*rw79)(state) + case 80: + return (*rw80)(state) + case 81: + return (*rw81)(state) + case 82: + return (*rw82)(state) + case 83: + return (*rw83)(state) + case 84: + return (*rw84)(state) + case 85: + return (*rw85)(state) + case 86: + return (*rw86)(state) + case 87: + return (*rw87)(state) + case 88: + return (*rw88)(state) + case 89: + return (*rw89)(state) + case 90: + return (*rw90)(state) + case 91: + return (*rw91)(state) + case 92: + return (*rw92)(state) + case 93: + return (*rw93)(state) + case 94: + return (*rw94)(state) + case 95: + return (*rw95)(state) + case 96: + return (*rw96)(state) + case 97: + return (*rw97)(state) + case 98: + return (*rw98)(state) + case 99: + return (*rw99)(state) + case 100: + return (*rw100)(state) + case 101: + return (*rw101)(state) + case 102: + return (*rw102)(state) + case 103: + return (*rw103)(state) + case 104: + return (*rw104)(state) + case 105: + return (*rw105)(state) + case 106: + return (*rw106)(state) + case 107: + return (*rw107)(state) + case 108: + return (*rw108)(state) + case 109: + return (*rw109)(state) + case 110: + return (*rw110)(state) + case 111: + return (*rw111)(state) + case 112: + return (*rw112)(state) + case 113: + return (*rw113)(state) + case 114: + return (*rw114)(state) + case 115: + return (*rw115)(state) + case 116: + return (*rw116)(state) + case 117: + return (*rw117)(state) + case 118: + return (*rw118)(state) + case 119: + return (*rw119)(state) + case 120: + return (*rw120)(state) + case 121: + return (*rw121)(state) + case 122: + return (*rw122)(state) + case 123: + return (*rw123)(state) + case 124: + return (*rw124)(state) + case 125: + return (*rw125)(state) + case 126: + return (*rw126)(state) + case 127: + return (*rw127)(state) + case 128: + return (*rw128)(state) + case 129: + return (*rw129)(state) + case 130: + return (*rw130)(state) + case 131: + return (*rw131)(state) + case 132: + return (*rw132)(state) + case 133: + return (*rw133)(state) + case 134: + return (*rw134)(state) + case 135: + return (*rw135)(state) + case 136: + return (*rw136)(state) + case 137: + return (*rw137)(state) + case 138: + return (*rw138)(state) + case 139: + return (*rw139)(state) + case 140: + return (*rw140)(state) + case 141: + return (*rw141)(state) + case 142: + return (*rw142)(state) + case 143: + return (*rw143)(state) + case 144: + return (*rw144)(state) + case 145: + return (*rw145)(state) + case 146: + return (*rw146)(state) + case 147: + return (*rw147)(state) + case 148: + return (*rw148)(state) + case 149: + return (*rw149)(state) + case 150: + return (*rw150)(state) + case 151: + return (*rw151)(state) + case 152: + return (*rw152)(state) + case 153: + return (*rw153)(state) + case 154: + return (*rw154)(state) + case 155: + return (*rw155)(state) + case 156: + return (*rw156)(state) + case 157: + return (*rw157)(state) + case 158: + return (*rw158)(state) + case 159: + return (*rw159)(state) + case 160: + return (*rw160)(state) + case 161: + return (*rw161)(state) + case 162: + return (*rw162)(state) + case 163: + return (*rw163)(state) + case 164: + return (*rw164)(state) + case 165: + return (*rw165)(state) + case 166: + return (*rw166)(state) + case 167: + return (*rw167)(state) + case 168: + return (*rw168)(state) + case 169: + return (*rw169)(state) + case 170: + return (*rw170)(state) + case 171: + return (*rw171)(state) + case 172: + return (*rw172)(state) + case 173: + return (*rw173)(state) + case 174: + return (*rw174)(state) + case 175: + return (*rw175)(state) + case 176: + return (*rw176)(state) + case 177: + return (*rw177)(state) + case 178: + return (*rw178)(state) + case 179: + return (*rw179)(state) + case 180: + return (*rw180)(state) + case 181: + return (*rw181)(state) + case 182: + return (*rw182)(state) + case 183: + return (*rw183)(state) + case 184: + return (*rw184)(state) + case 185: + return (*rw185)(state) + case 186: + return (*rw186)(state) + case 187: + return (*rw187)(state) + case 188: + return (*rw188)(state) + case 189: + return (*rw189)(state) + case 190: + return (*rw190)(state) + case 191: + return (*rw191)(state) + case 192: + return (*rw192)(state) + case 193: + return (*rw193)(state) + case 194: + return (*rw194)(state) + case 195: + return (*rw195)(state) + case 196: + return (*rw196)(state) + case 197: + return (*rw197)(state) + case 198: + return (*rw198)(state) + case 199: + return (*rw199)(state) + case 200: + return (*rw200)(state) + case 201: + return (*rw201)(state) + case 202: + return (*rw202)(state) + case 203: + return (*rw203)(state) + case 204: + return (*rw204)(state) + case 205: + return (*rw205)(state) + case 206: + return (*rw206)(state) + case 207: + return (*rw207)(state) + case 208: + return (*rw208)(state) + case 209: + return (*rw209)(state) + case 210: + return (*rw210)(state) + case 211: + return (*rw211)(state) + case 212: + return (*rw212)(state) + case 213: + return (*rw213)(state) + case 214: + return (*rw214)(state) + case 215: + return (*rw215)(state) + case 216: + return (*rw216)(state) + case 217: + return (*rw217)(state) + case 218: + return (*rw218)(state) + case 219: + return (*rw219)(state) + case 220: + return (*rw220)(state) + case 221: + return (*rw221)(state) + case 222: + return (*rw222)(state) + case 223: + return (*rw223)(state) + case 224: + return (*rw224)(state) + case 225: + return (*rw225)(state) + case 226: + return (*rw226)(state) + case 227: + return (*rw227)(state) + case 228: + return (*rw228)(state) + case 229: + return (*rw229)(state) + case 230: + return (*rw230)(state) + case 231: + return (*rw231)(state) + case 232: + return (*rw232)(state) + case 233: + return (*rw233)(state) + case 234: + return (*rw234)(state) + case 235: + return (*rw235)(state) + case 236: + return (*rw236)(state) + case 237: + return (*rw237)(state) + case 238: + return (*rw238)(state) + case 239: + return (*rw239)(state) + case 240: + return (*rw240)(state) + case 241: + return (*rw241)(state) + case 242: + return (*rw242)(state) + case 243: + return (*rw243)(state) + case 244: + return (*rw244)(state) + case 245: + return (*rw245)(state) + case 246: + return (*rw246)(state) + case 247: + return (*rw247)(state) + case 248: + return (*rw248)(state) + case 249: + return (*rw249)(state) + case 250: + return (*rw250)(state) + case 251: + return (*rw251)(state) + case 252: + return (*rw252)(state) + case 253: + return (*rw253)(state) + case 254: + return (*rw254)(state) + case 255: + return (*rw255)(state) + case 256: + return (*rw256)(state) + case 257: + return (*rw257)(state) + case 258: + return (*rw258)(state) + case 259: + return (*rw259)(state) + case 260: + return (*rw260)(state) + case 261: + return (*rw261)(state) + case 262: + return (*rw262)(state) + case 263: + return (*rw263)(state) + case 264: + return (*rw264)(state) + case 265: + return (*rw265)(state) + case 266: + return (*rw266)(state) + case 267: + return (*rw267)(state) + case 268: + return (*rw268)(state) + case 269: + return (*rw269)(state) + case 270: + return (*rw270)(state) + case 271: + return (*rw271)(state) + case 272: + return (*rw272)(state) + case 273: + return (*rw273)(state) + case 274: + return (*rw274)(state) + case 275: + return (*rw275)(state) + case 276: + return (*rw276)(state) + case 277: + return (*rw277)(state) + case 278: + return (*rw278)(state) + case 279: + return (*rw279)(state) + case 280: + return (*rw280)(state) + case 281: + return (*rw281)(state) + case 282: + return (*rw282)(state) + case 283: + return (*rw283)(state) + case 284: + return (*rw284)(state) + case 285: + return (*rw285)(state) + case 286: + return (*rw286)(state) + case 287: + return (*rw287)(state) + case 288: + return (*rw288)(state) + case 289: + return (*rw289)(state) + case 290: + return (*rw290)(state) + case 291: + return (*rw291)(state) + case 292: + return (*rw292)(state) + case 293: + return (*rw293)(state) + case 294: + return (*rw294)(state) + case 295: + return (*rw295)(state) + case 296: + return (*rw296)(state) + case 297: + return (*rw297)(state) + case 298: + return (*rw298)(state) + case 299: + return (*rw299)(state) + case 300: + return (*rw300)(state) + case 301: + return (*rw301)(state) + case 302: + return (*rw302)(state) + case 303: + return (*rw303)(state) + case 304: + return (*rw304)(state) + case 305: + return (*rw305)(state) + case 306: + return (*rw306)(state) + case 307: + return (*rw307)(state) + case 308: + return (*rw308)(state) + case 309: + return (*rw309)(state) + case 310: + return (*rw310)(state) + case 311: + return (*rw311)(state) + case 312: + return (*rw312)(state) + case 313: + return (*rw313)(state) + case 314: + return (*rw314)(state) + case 315: + return (*rw315)(state) + case 316: + return (*rw316)(state) + case 317: + return (*rw317)(state) + case 318: + return (*rw318)(state) + case 319: + return (*rw319)(state) + case 320: + return (*rw320)(state) + case 321: + return (*rw321)(state) + case 322: + return (*rw322)(state) + case 323: + return (*rw323)(state) + case 324: + return (*rw324)(state) + case 325: + return (*rw325)(state) + case 326: + return (*rw326)(state) + case 327: + return (*rw327)(state) + case 328: + return (*rw328)(state) + case 329: + return (*rw329)(state) + case 330: + return (*rw330)(state) + case 331: + return (*rw331)(state) + case 332: + return (*rw332)(state) + case 333: + return (*rw333)(state) + case 334: + return (*rw334)(state) + case 335: + return (*rw335)(state) + case 336: + return (*rw336)(state) + case 337: + return (*rw337)(state) + case 338: + return (*rw338)(state) + case 339: + return (*rw339)(state) + case 340: + return (*rw340)(state) + case 341: + return (*rw341)(state) + case 342: + return (*rw342)(state) + case 343: + return (*rw343)(state) + case 344: + return (*rw344)(state) + case 345: + return (*rw345)(state) + case 346: + return (*rw346)(state) + case 347: + return (*rw347)(state) + case 348: + return (*rw348)(state) + case 349: + return (*rw349)(state) + case 350: + return (*rw350)(state) + case 351: + return (*rw351)(state) + case 352: + return (*rw352)(state) + case 353: + return (*rw353)(state) + case 354: + return (*rw354)(state) + case 355: + return (*rw355)(state) + case 356: + return (*rw356)(state) + case 357: + return (*rw357)(state) + case 358: + return (*rw358)(state) + case 359: + return (*rw359)(state) + case 360: + return (*rw360)(state) + case 361: + return (*rw361)(state) + case 362: + return (*rw362)(state) + case 363: + return (*rw363)(state) + case 364: + return (*rw364)(state) + case 365: + return (*rw365)(state) + case 366: + return (*rw366)(state) + case 367: + return (*rw367)(state) + case 368: + return (*rw368)(state) + case 369: + return (*rw369)(state) + case 370: + return (*rw370)(state) + case 371: + return (*rw371)(state) + case 372: + return (*rw372)(state) + case 373: + return (*rw373)(state) + case 374: + return (*rw374)(state) + case 375: + return (*rw375)(state) + case 376: + return (*rw376)(state) + case 377: + return (*rw377)(state) + case 378: + return (*rw378)(state) + case 379: + return (*rw379)(state) + case 380: + return (*rw380)(state) + case 381: + return (*rw381)(state) + case 382: + return (*rw382)(state) + case 383: + return (*rw383)(state) + case 384: + return (*rw384)(state) + case 385: + return (*rw385)(state) + case 386: + return (*rw386)(state) + case 387: + return (*rw387)(state) + case 388: + return (*rw388)(state) + case 389: + return (*rw389)(state) + case 390: + return (*rw390)(state) + case 391: + return (*rw391)(state) + case 392: + return (*rw392)(state) + case 393: + return (*rw393)(state) + case 394: + return (*rw394)(state) + case 395: + return (*rw395)(state) + case 396: + return (*rw396)(state) + case 397: + return (*rw397)(state) + case 398: + return (*rw398)(state) + case 399: + return (*rw399)(state) + case 400: + return (*rw400)(state) + case 401: + return (*rw401)(state) + case 402: + return (*rw402)(state) + case 403: + return (*rw403)(state) + case 404: + return (*rw404)(state) + case 405: + return (*rw405)(state) + case 406: + return (*rw406)(state) + case 407: + return (*rw407)(state) + case 408: + return (*rw408)(state) + case 409: + return (*rw409)(state) + case 410: + return (*rw410)(state) + case 411: + return (*rw411)(state) + case 412: + return (*rw412)(state) + case 413: + return (*rw413)(state) + case 414: + return (*rw414)(state) + case 415: + return (*rw415)(state) + case 416: + return (*rw416)(state) + case 417: + return (*rw417)(state) + case 418: + return (*rw418)(state) + case 419: + return (*rw419)(state) + case 420: + return (*rw420)(state) + case 421: + return (*rw421)(state) + case 422: + return (*rw422)(state) + case 423: + return (*rw423)(state) + case 424: + return (*rw424)(state) + case 425: + return (*rw425)(state) + case 426: + return (*rw426)(state) + case 427: + return (*rw427)(state) + case 428: + return (*rw428)(state) + case 429: + return (*rw429)(state) + case 430: + return (*rw430)(state) + case 431: + return (*rw431)(state) + case 432: + return (*rw432)(state) + case 433: + return (*rw433)(state) + case 434: + return (*rw434)(state) + case 435: + return (*rw435)(state) + case 436: + return (*rw436)(state) + case 437: + return (*rw437)(state) + case 438: + return (*rw438)(state) + case 439: + return (*rw439)(state) + case 440: + return (*rw440)(state) + case 441: + return (*rw441)(state) + case 442: + return (*rw442)(state) + case 443: + return (*rw443)(state) + case 444: + return (*rw444)(state) + case 445: + return (*rw445)(state) + case 446: + return (*rw446)(state) + case 447: + return (*rw447)(state) + case 448: + return (*rw448)(state) + case 449: + return (*rw449)(state) + case 450: + return (*rw450)(state) + case 451: + return (*rw451)(state) + case 452: + return (*rw452)(state) + case 453: + return (*rw453)(state) + case 454: + return (*rw454)(state) + case 455: + return (*rw455)(state) + case 456: + return (*rw456)(state) + case 457: + return (*rw457)(state) + case 458: + return (*rw458)(state) + case 459: + return (*rw459)(state) + case 460: + return (*rw460)(state) + case 461: + return (*rw461)(state) + case 462: + return (*rw462)(state) + case 463: + return (*rw463)(state) + case 464: + return (*rw464)(state) + case 465: + return (*rw465)(state) + case 466: + return (*rw466)(state) + case 467: + return (*rw467)(state) + case 468: + return (*rw468)(state) + case 469: + return (*rw469)(state) + case 470: + return (*rw470)(state) + case 471: + return (*rw471)(state) + case 472: + return (*rw472)(state) + case 473: + return (*rw473)(state) + case 474: + return (*rw474)(state) + case 475: + return (*rw475)(state) + case 476: + return (*rw476)(state) + case 477: + return (*rw477)(state) + case 478: + return (*rw478)(state) + case 479: + return (*rw479)(state) + case 480: + return (*rw480)(state) + case 481: + return (*rw481)(state) + case 482: + return (*rw482)(state) + case 483: + return (*rw483)(state) + case 484: + return (*rw484)(state) + case 485: + return (*rw485)(state) + case 486: + return (*rw486)(state) + case 487: + return (*rw487)(state) + case 488: + return (*rw488)(state) + case 489: + return (*rw489)(state) + case 490: + return (*rw490)(state) + case 491: + return (*rw491)(state) + case 492: + return (*rw492)(state) + case 493: + return (*rw493)(state) + case 494: + return (*rw494)(state) + case 495: + return (*rw495)(state) + case 496: + return (*rw496)(state) + case 497: + return (*rw497)(state) + case 498: + return (*rw498)(state) + case 499: + return (*rw499)(state) + case 500: + return (*rw500)(state) + case 501: + return (*rw501)(state) + case 502: + return (*rw502)(state) + case 503: + return (*rw503)(state) + case 504: + return (*rw504)(state) + case 505: + return (*rw505)(state) + case 506: + return (*rw506)(state) + case 507: + return (*rw507)(state) + case 508: + return (*rw508)(state) + case 509: + return (*rw509)(state) + case 510: + return (*rw510)(state) + case 511: + return (*rw511)(state) + } + panic("unreachable") +} + +type rwState struct { + w http.ResponseWriter + header HeaderFunc + writeHeader WriteHeaderFunc + write WriteFunc + flush FlushFunc + flushError FlushErrorFunc + closeNotify CloseNotifyFunc + hijack HijackFunc + readFrom ReadFromFunc + setReadDeadline SetReadDeadlineFunc + setWriteDeadline SetWriteDeadlineFunc + enableFullDuplex EnableFullDuplexFunc + push PushFunc + writeString WriteStringFunc +} + +func (r *rwState) doHeader() http.Header { + if r.header != nil { + return r.header() + } + return r.w.Header() +} + +func (r *rwState) doWriteHeader(code int) { + if r.writeHeader != nil { + r.writeHeader(code) + return + } + r.w.WriteHeader(code) +} + +func (r *rwState) doWrite(b []byte) (int, error) { + if r.write != nil { + return r.write(b) + } + return r.w.Write(b) +} + +func (r *rwState) doFlush() { + if r.flush != nil { + r.flush() + return + } + r.w.(http.Flusher).Flush() +} + +func (r *rwState) doFlushError() error { + if r.flushError != nil { + return r.flushError() + } + return r.w.(httpFlushError).FlushError() +} + +func (r *rwState) doCloseNotify() <-chan bool { + if r.closeNotify != nil { + return r.closeNotify() + } + return r.w.(http.CloseNotifier).CloseNotify() +} + +func (r *rwState) doHijack() (net.Conn, *bufio.ReadWriter, error) { + if r.hijack != nil { + return r.hijack() + } + return r.w.(http.Hijacker).Hijack() +} + +func (r *rwState) doReadFrom(src io.Reader) (int64, error) { + if r.readFrom != nil { + return r.readFrom(src) + } + return r.w.(io.ReaderFrom).ReadFrom(src) +} + +func (r *rwState) doSetReadDeadline(deadline time.Time) error { + if r.setReadDeadline != nil { + return r.setReadDeadline(deadline) + } + return r.w.(deadliner).SetReadDeadline(deadline) +} + +func (r *rwState) doSetWriteDeadline(deadline time.Time) error { + if r.setWriteDeadline != nil { + return r.setWriteDeadline(deadline) + } + return r.w.(deadliner).SetWriteDeadline(deadline) +} + +func (r *rwState) doEnableFullDuplex() error { + if r.enableFullDuplex != nil { + return r.enableFullDuplex() + } + return r.w.(fullDuplexEnabler).EnableFullDuplex() +} + +func (r *rwState) doPush(target string, opts *http.PushOptions) error { + if r.push != nil { + return r.push(target, opts) + } + return r.w.(http.Pusher).Push(target, opts) +} + +func (r *rwState) doWriteString(s string) (int, error) { + if r.writeString != nil { + return r.writeString(s) + } + return r.w.(io.StringWriter).WriteString(s) +} + +// combination 1/512: http.ResponseWriter +type rw0 rwState + +func (w *rw0) Unwrap() http.ResponseWriter { return w.w } +func (w *rw0) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw0) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw0) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} + +// combination 2/512: http.ResponseWriter, io.StringWriter +type rw1 rwState + +func (w *rw1) Unwrap() http.ResponseWriter { return w.w } +func (w *rw1) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw1) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw1) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw1) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 3/512: http.ResponseWriter, http.Pusher +type rw2 rwState + +func (w *rw2) Unwrap() http.ResponseWriter { return w.w } +func (w *rw2) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw2) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw2) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw2) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 4/512: http.ResponseWriter, http.Pusher, io.StringWriter +type rw3 rwState + +func (w *rw3) Unwrap() http.ResponseWriter { return w.w } +func (w *rw3) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw3) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw3) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw3) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw3) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 5/512: http.ResponseWriter, fullDuplexEnabler +type rw4 rwState + +func (w *rw4) Unwrap() http.ResponseWriter { return w.w } +func (w *rw4) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw4) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw4) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw4) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 6/512: http.ResponseWriter, fullDuplexEnabler, io.StringWriter +type rw5 rwState + +func (w *rw5) Unwrap() http.ResponseWriter { return w.w } +func (w *rw5) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw5) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw5) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw5) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw5) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 7/512: http.ResponseWriter, fullDuplexEnabler, http.Pusher +type rw6 rwState + +func (w *rw6) Unwrap() http.ResponseWriter { return w.w } +func (w *rw6) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw6) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw6) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw6) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw6) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 8/512: http.ResponseWriter, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw7 rwState + +func (w *rw7) Unwrap() http.ResponseWriter { return w.w } +func (w *rw7) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw7) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw7) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw7) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw7) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw7) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 9/512: http.ResponseWriter, deadliner +type rw8 rwState + +func (w *rw8) Unwrap() http.ResponseWriter { return w.w } +func (w *rw8) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw8) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw8) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw8) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw8) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 10/512: http.ResponseWriter, deadliner, io.StringWriter +type rw9 rwState + +func (w *rw9) Unwrap() http.ResponseWriter { return w.w } +func (w *rw9) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw9) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw9) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw9) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw9) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw9) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 11/512: http.ResponseWriter, deadliner, http.Pusher +type rw10 rwState + +func (w *rw10) Unwrap() http.ResponseWriter { return w.w } +func (w *rw10) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw10) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw10) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw10) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw10) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw10) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 12/512: http.ResponseWriter, deadliner, http.Pusher, io.StringWriter +type rw11 rwState + +func (w *rw11) Unwrap() http.ResponseWriter { return w.w } +func (w *rw11) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw11) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw11) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw11) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw11) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw11) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw11) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 13/512: http.ResponseWriter, deadliner, fullDuplexEnabler +type rw12 rwState + +func (w *rw12) Unwrap() http.ResponseWriter { return w.w } +func (w *rw12) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw12) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw12) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw12) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw12) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw12) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 14/512: http.ResponseWriter, deadliner, fullDuplexEnabler, io.StringWriter +type rw13 rwState + +func (w *rw13) Unwrap() http.ResponseWriter { return w.w } +func (w *rw13) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw13) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw13) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw13) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw13) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw13) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw13) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 15/512: http.ResponseWriter, deadliner, fullDuplexEnabler, http.Pusher +type rw14 rwState + +func (w *rw14) Unwrap() http.ResponseWriter { return w.w } +func (w *rw14) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw14) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw14) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw14) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw14) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw14) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw14) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 16/512: http.ResponseWriter, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw15 rwState + +func (w *rw15) Unwrap() http.ResponseWriter { return w.w } +func (w *rw15) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw15) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw15) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw15) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw15) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw15) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw15) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw15) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 17/512: http.ResponseWriter, io.ReaderFrom +type rw16 rwState + +func (w *rw16) Unwrap() http.ResponseWriter { return w.w } +func (w *rw16) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw16) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw16) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw16) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 18/512: http.ResponseWriter, io.ReaderFrom, io.StringWriter +type rw17 rwState + +func (w *rw17) Unwrap() http.ResponseWriter { return w.w } +func (w *rw17) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw17) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw17) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw17) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw17) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 19/512: http.ResponseWriter, io.ReaderFrom, http.Pusher +type rw18 rwState + +func (w *rw18) Unwrap() http.ResponseWriter { return w.w } +func (w *rw18) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw18) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw18) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw18) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw18) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 20/512: http.ResponseWriter, io.ReaderFrom, http.Pusher, io.StringWriter +type rw19 rwState + +func (w *rw19) Unwrap() http.ResponseWriter { return w.w } +func (w *rw19) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw19) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw19) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw19) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw19) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw19) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 21/512: http.ResponseWriter, io.ReaderFrom, fullDuplexEnabler +type rw20 rwState + +func (w *rw20) Unwrap() http.ResponseWriter { return w.w } +func (w *rw20) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw20) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw20) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw20) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw20) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 22/512: http.ResponseWriter, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw21 rwState + +func (w *rw21) Unwrap() http.ResponseWriter { return w.w } +func (w *rw21) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw21) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw21) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw21) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw21) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw21) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 23/512: http.ResponseWriter, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw22 rwState + +func (w *rw22) Unwrap() http.ResponseWriter { return w.w } +func (w *rw22) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw22) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw22) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw22) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw22) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw22) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 24/512: http.ResponseWriter, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw23 rwState + +func (w *rw23) Unwrap() http.ResponseWriter { return w.w } +func (w *rw23) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw23) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw23) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw23) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw23) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw23) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw23) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 25/512: http.ResponseWriter, io.ReaderFrom, deadliner +type rw24 rwState + +func (w *rw24) Unwrap() http.ResponseWriter { return w.w } +func (w *rw24) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw24) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw24) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw24) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw24) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw24) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 26/512: http.ResponseWriter, io.ReaderFrom, deadliner, io.StringWriter +type rw25 rwState + +func (w *rw25) Unwrap() http.ResponseWriter { return w.w } +func (w *rw25) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw25) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw25) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw25) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw25) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw25) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw25) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 27/512: http.ResponseWriter, io.ReaderFrom, deadliner, http.Pusher +type rw26 rwState + +func (w *rw26) Unwrap() http.ResponseWriter { return w.w } +func (w *rw26) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw26) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw26) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw26) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw26) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw26) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw26) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 28/512: http.ResponseWriter, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw27 rwState + +func (w *rw27) Unwrap() http.ResponseWriter { return w.w } +func (w *rw27) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw27) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw27) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw27) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw27) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw27) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw27) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw27) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 29/512: http.ResponseWriter, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw28 rwState + +func (w *rw28) Unwrap() http.ResponseWriter { return w.w } +func (w *rw28) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw28) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw28) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw28) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw28) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw28) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw28) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 30/512: http.ResponseWriter, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw29 rwState + +func (w *rw29) Unwrap() http.ResponseWriter { return w.w } +func (w *rw29) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw29) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw29) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw29) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw29) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw29) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw29) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw29) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 31/512: http.ResponseWriter, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw30 rwState + +func (w *rw30) Unwrap() http.ResponseWriter { return w.w } +func (w *rw30) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw30) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw30) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw30) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw30) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw30) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw30) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw30) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 32/512: http.ResponseWriter, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw31 rwState + +func (w *rw31) Unwrap() http.ResponseWriter { return w.w } +func (w *rw31) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw31) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw31) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw31) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw31) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw31) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw31) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw31) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw31) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 33/512: http.ResponseWriter, http.Hijacker +type rw32 rwState + +func (w *rw32) Unwrap() http.ResponseWriter { return w.w } +func (w *rw32) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw32) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw32) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw32) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} + +// combination 34/512: http.ResponseWriter, http.Hijacker, io.StringWriter +type rw33 rwState + +func (w *rw33) Unwrap() http.ResponseWriter { return w.w } +func (w *rw33) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw33) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw33) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw33) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw33) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 35/512: http.ResponseWriter, http.Hijacker, http.Pusher +type rw34 rwState + +func (w *rw34) Unwrap() http.ResponseWriter { return w.w } +func (w *rw34) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw34) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw34) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw34) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw34) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 36/512: http.ResponseWriter, http.Hijacker, http.Pusher, io.StringWriter +type rw35 rwState + +func (w *rw35) Unwrap() http.ResponseWriter { return w.w } +func (w *rw35) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw35) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw35) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw35) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw35) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw35) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 37/512: http.ResponseWriter, http.Hijacker, fullDuplexEnabler +type rw36 rwState + +func (w *rw36) Unwrap() http.ResponseWriter { return w.w } +func (w *rw36) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw36) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw36) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw36) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw36) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 38/512: http.ResponseWriter, http.Hijacker, fullDuplexEnabler, io.StringWriter +type rw37 rwState + +func (w *rw37) Unwrap() http.ResponseWriter { return w.w } +func (w *rw37) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw37) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw37) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw37) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw37) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw37) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 39/512: http.ResponseWriter, http.Hijacker, fullDuplexEnabler, http.Pusher +type rw38 rwState + +func (w *rw38) Unwrap() http.ResponseWriter { return w.w } +func (w *rw38) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw38) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw38) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw38) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw38) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw38) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 40/512: http.ResponseWriter, http.Hijacker, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw39 rwState + +func (w *rw39) Unwrap() http.ResponseWriter { return w.w } +func (w *rw39) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw39) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw39) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw39) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw39) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw39) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw39) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 41/512: http.ResponseWriter, http.Hijacker, deadliner +type rw40 rwState + +func (w *rw40) Unwrap() http.ResponseWriter { return w.w } +func (w *rw40) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw40) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw40) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw40) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw40) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw40) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 42/512: http.ResponseWriter, http.Hijacker, deadliner, io.StringWriter +type rw41 rwState + +func (w *rw41) Unwrap() http.ResponseWriter { return w.w } +func (w *rw41) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw41) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw41) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw41) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw41) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw41) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw41) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 43/512: http.ResponseWriter, http.Hijacker, deadliner, http.Pusher +type rw42 rwState + +func (w *rw42) Unwrap() http.ResponseWriter { return w.w } +func (w *rw42) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw42) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw42) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw42) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw42) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw42) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw42) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 44/512: http.ResponseWriter, http.Hijacker, deadliner, http.Pusher, io.StringWriter +type rw43 rwState + +func (w *rw43) Unwrap() http.ResponseWriter { return w.w } +func (w *rw43) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw43) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw43) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw43) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw43) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw43) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw43) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw43) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 45/512: http.ResponseWriter, http.Hijacker, deadliner, fullDuplexEnabler +type rw44 rwState + +func (w *rw44) Unwrap() http.ResponseWriter { return w.w } +func (w *rw44) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw44) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw44) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw44) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw44) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw44) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw44) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 46/512: http.ResponseWriter, http.Hijacker, deadliner, fullDuplexEnabler, io.StringWriter +type rw45 rwState + +func (w *rw45) Unwrap() http.ResponseWriter { return w.w } +func (w *rw45) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw45) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw45) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw45) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw45) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw45) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw45) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw45) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 47/512: http.ResponseWriter, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher +type rw46 rwState + +func (w *rw46) Unwrap() http.ResponseWriter { return w.w } +func (w *rw46) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw46) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw46) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw46) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw46) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw46) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw46) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw46) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 48/512: http.ResponseWriter, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw47 rwState + +func (w *rw47) Unwrap() http.ResponseWriter { return w.w } +func (w *rw47) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw47) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw47) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw47) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw47) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw47) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw47) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw47) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw47) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 49/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom +type rw48 rwState + +func (w *rw48) Unwrap() http.ResponseWriter { return w.w } +func (w *rw48) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw48) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw48) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw48) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw48) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 50/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, io.StringWriter +type rw49 rwState + +func (w *rw49) Unwrap() http.ResponseWriter { return w.w } +func (w *rw49) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw49) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw49) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw49) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw49) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw49) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 51/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, http.Pusher +type rw50 rwState + +func (w *rw50) Unwrap() http.ResponseWriter { return w.w } +func (w *rw50) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw50) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw50) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw50) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw50) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw50) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 52/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, http.Pusher, io.StringWriter +type rw51 rwState + +func (w *rw51) Unwrap() http.ResponseWriter { return w.w } +func (w *rw51) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw51) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw51) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw51) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw51) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw51) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw51) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 53/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, fullDuplexEnabler +type rw52 rwState + +func (w *rw52) Unwrap() http.ResponseWriter { return w.w } +func (w *rw52) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw52) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw52) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw52) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw52) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw52) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 54/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw53 rwState + +func (w *rw53) Unwrap() http.ResponseWriter { return w.w } +func (w *rw53) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw53) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw53) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw53) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw53) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw53) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw53) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 55/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw54 rwState + +func (w *rw54) Unwrap() http.ResponseWriter { return w.w } +func (w *rw54) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw54) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw54) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw54) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw54) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw54) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw54) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 56/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw55 rwState + +func (w *rw55) Unwrap() http.ResponseWriter { return w.w } +func (w *rw55) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw55) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw55) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw55) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw55) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw55) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw55) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw55) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 57/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, deadliner +type rw56 rwState + +func (w *rw56) Unwrap() http.ResponseWriter { return w.w } +func (w *rw56) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw56) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw56) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw56) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw56) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw56) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw56) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 58/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, deadliner, io.StringWriter +type rw57 rwState + +func (w *rw57) Unwrap() http.ResponseWriter { return w.w } +func (w *rw57) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw57) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw57) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw57) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw57) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw57) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw57) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw57) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 59/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher +type rw58 rwState + +func (w *rw58) Unwrap() http.ResponseWriter { return w.w } +func (w *rw58) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw58) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw58) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw58) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw58) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw58) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw58) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw58) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 60/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw59 rwState + +func (w *rw59) Unwrap() http.ResponseWriter { return w.w } +func (w *rw59) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw59) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw59) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw59) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw59) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw59) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw59) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw59) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw59) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 61/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw60 rwState + +func (w *rw60) Unwrap() http.ResponseWriter { return w.w } +func (w *rw60) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw60) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw60) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw60) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw60) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw60) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw60) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw60) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 62/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw61 rwState + +func (w *rw61) Unwrap() http.ResponseWriter { return w.w } +func (w *rw61) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw61) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw61) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw61) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw61) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw61) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw61) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw61) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw61) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 63/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw62 rwState + +func (w *rw62) Unwrap() http.ResponseWriter { return w.w } +func (w *rw62) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw62) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw62) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw62) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw62) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw62) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw62) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw62) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw62) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 64/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw63 rwState + +func (w *rw63) Unwrap() http.ResponseWriter { return w.w } +func (w *rw63) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw63) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw63) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw63) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw63) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw63) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw63) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw63) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw63) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw63) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 65/512: http.ResponseWriter, http.CloseNotifier +type rw64 rwState + +func (w *rw64) Unwrap() http.ResponseWriter { return w.w } +func (w *rw64) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw64) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw64) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw64) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} + +// combination 66/512: http.ResponseWriter, http.CloseNotifier, io.StringWriter +type rw65 rwState + +func (w *rw65) Unwrap() http.ResponseWriter { return w.w } +func (w *rw65) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw65) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw65) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw65) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw65) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 67/512: http.ResponseWriter, http.CloseNotifier, http.Pusher +type rw66 rwState + +func (w *rw66) Unwrap() http.ResponseWriter { return w.w } +func (w *rw66) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw66) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw66) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw66) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw66) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 68/512: http.ResponseWriter, http.CloseNotifier, http.Pusher, io.StringWriter +type rw67 rwState + +func (w *rw67) Unwrap() http.ResponseWriter { return w.w } +func (w *rw67) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw67) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw67) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw67) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw67) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw67) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 69/512: http.ResponseWriter, http.CloseNotifier, fullDuplexEnabler +type rw68 rwState + +func (w *rw68) Unwrap() http.ResponseWriter { return w.w } +func (w *rw68) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw68) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw68) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw68) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw68) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 70/512: http.ResponseWriter, http.CloseNotifier, fullDuplexEnabler, io.StringWriter +type rw69 rwState + +func (w *rw69) Unwrap() http.ResponseWriter { return w.w } +func (w *rw69) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw69) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw69) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw69) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw69) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw69) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 71/512: http.ResponseWriter, http.CloseNotifier, fullDuplexEnabler, http.Pusher +type rw70 rwState + +func (w *rw70) Unwrap() http.ResponseWriter { return w.w } +func (w *rw70) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw70) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw70) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw70) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw70) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw70) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 72/512: http.ResponseWriter, http.CloseNotifier, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw71 rwState + +func (w *rw71) Unwrap() http.ResponseWriter { return w.w } +func (w *rw71) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw71) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw71) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw71) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw71) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw71) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw71) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 73/512: http.ResponseWriter, http.CloseNotifier, deadliner +type rw72 rwState + +func (w *rw72) Unwrap() http.ResponseWriter { return w.w } +func (w *rw72) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw72) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw72) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw72) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw72) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw72) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 74/512: http.ResponseWriter, http.CloseNotifier, deadliner, io.StringWriter +type rw73 rwState + +func (w *rw73) Unwrap() http.ResponseWriter { return w.w } +func (w *rw73) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw73) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw73) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw73) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw73) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw73) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw73) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 75/512: http.ResponseWriter, http.CloseNotifier, deadliner, http.Pusher +type rw74 rwState + +func (w *rw74) Unwrap() http.ResponseWriter { return w.w } +func (w *rw74) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw74) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw74) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw74) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw74) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw74) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw74) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 76/512: http.ResponseWriter, http.CloseNotifier, deadliner, http.Pusher, io.StringWriter +type rw75 rwState + +func (w *rw75) Unwrap() http.ResponseWriter { return w.w } +func (w *rw75) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw75) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw75) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw75) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw75) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw75) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw75) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw75) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 77/512: http.ResponseWriter, http.CloseNotifier, deadliner, fullDuplexEnabler +type rw76 rwState + +func (w *rw76) Unwrap() http.ResponseWriter { return w.w } +func (w *rw76) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw76) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw76) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw76) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw76) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw76) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw76) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 78/512: http.ResponseWriter, http.CloseNotifier, deadliner, fullDuplexEnabler, io.StringWriter +type rw77 rwState + +func (w *rw77) Unwrap() http.ResponseWriter { return w.w } +func (w *rw77) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw77) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw77) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw77) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw77) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw77) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw77) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw77) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 79/512: http.ResponseWriter, http.CloseNotifier, deadliner, fullDuplexEnabler, http.Pusher +type rw78 rwState + +func (w *rw78) Unwrap() http.ResponseWriter { return w.w } +func (w *rw78) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw78) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw78) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw78) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw78) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw78) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw78) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw78) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 80/512: http.ResponseWriter, http.CloseNotifier, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw79 rwState + +func (w *rw79) Unwrap() http.ResponseWriter { return w.w } +func (w *rw79) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw79) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw79) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw79) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw79) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw79) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw79) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw79) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw79) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 81/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom +type rw80 rwState + +func (w *rw80) Unwrap() http.ResponseWriter { return w.w } +func (w *rw80) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw80) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw80) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw80) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw80) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 82/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, io.StringWriter +type rw81 rwState + +func (w *rw81) Unwrap() http.ResponseWriter { return w.w } +func (w *rw81) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw81) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw81) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw81) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw81) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw81) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 83/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, http.Pusher +type rw82 rwState + +func (w *rw82) Unwrap() http.ResponseWriter { return w.w } +func (w *rw82) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw82) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw82) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw82) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw82) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw82) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 84/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, http.Pusher, io.StringWriter +type rw83 rwState + +func (w *rw83) Unwrap() http.ResponseWriter { return w.w } +func (w *rw83) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw83) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw83) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw83) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw83) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw83) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw83) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 85/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler +type rw84 rwState + +func (w *rw84) Unwrap() http.ResponseWriter { return w.w } +func (w *rw84) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw84) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw84) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw84) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw84) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw84) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 86/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw85 rwState + +func (w *rw85) Unwrap() http.ResponseWriter { return w.w } +func (w *rw85) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw85) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw85) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw85) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw85) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw85) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw85) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 87/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw86 rwState + +func (w *rw86) Unwrap() http.ResponseWriter { return w.w } +func (w *rw86) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw86) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw86) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw86) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw86) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw86) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw86) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 88/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw87 rwState + +func (w *rw87) Unwrap() http.ResponseWriter { return w.w } +func (w *rw87) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw87) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw87) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw87) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw87) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw87) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw87) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw87) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 89/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, deadliner +type rw88 rwState + +func (w *rw88) Unwrap() http.ResponseWriter { return w.w } +func (w *rw88) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw88) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw88) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw88) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw88) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw88) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw88) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 90/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, deadliner, io.StringWriter +type rw89 rwState + +func (w *rw89) Unwrap() http.ResponseWriter { return w.w } +func (w *rw89) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw89) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw89) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw89) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw89) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw89) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw89) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw89) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 91/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, deadliner, http.Pusher +type rw90 rwState + +func (w *rw90) Unwrap() http.ResponseWriter { return w.w } +func (w *rw90) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw90) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw90) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw90) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw90) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw90) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw90) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw90) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 92/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw91 rwState + +func (w *rw91) Unwrap() http.ResponseWriter { return w.w } +func (w *rw91) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw91) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw91) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw91) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw91) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw91) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw91) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw91) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw91) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 93/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw92 rwState + +func (w *rw92) Unwrap() http.ResponseWriter { return w.w } +func (w *rw92) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw92) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw92) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw92) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw92) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw92) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw92) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw92) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 94/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw93 rwState + +func (w *rw93) Unwrap() http.ResponseWriter { return w.w } +func (w *rw93) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw93) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw93) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw93) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw93) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw93) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw93) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw93) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw93) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 95/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw94 rwState + +func (w *rw94) Unwrap() http.ResponseWriter { return w.w } +func (w *rw94) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw94) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw94) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw94) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw94) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw94) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw94) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw94) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw94) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 96/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw95 rwState + +func (w *rw95) Unwrap() http.ResponseWriter { return w.w } +func (w *rw95) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw95) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw95) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw95) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw95) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw95) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw95) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw95) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw95) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw95) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 97/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker +type rw96 rwState + +func (w *rw96) Unwrap() http.ResponseWriter { return w.w } +func (w *rw96) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw96) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw96) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw96) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw96) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} + +// combination 98/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.StringWriter +type rw97 rwState + +func (w *rw97) Unwrap() http.ResponseWriter { return w.w } +func (w *rw97) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw97) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw97) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw97) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw97) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw97) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 99/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, http.Pusher +type rw98 rwState + +func (w *rw98) Unwrap() http.ResponseWriter { return w.w } +func (w *rw98) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw98) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw98) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw98) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw98) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw98) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 100/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, http.Pusher, io.StringWriter +type rw99 rwState + +func (w *rw99) Unwrap() http.ResponseWriter { return w.w } +func (w *rw99) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw99) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw99) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw99) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw99) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw99) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw99) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 101/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, fullDuplexEnabler +type rw100 rwState + +func (w *rw100) Unwrap() http.ResponseWriter { return w.w } +func (w *rw100) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw100) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw100) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw100) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw100) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw100) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 102/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, fullDuplexEnabler, io.StringWriter +type rw101 rwState + +func (w *rw101) Unwrap() http.ResponseWriter { return w.w } +func (w *rw101) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw101) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw101) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw101) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw101) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw101) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw101) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 103/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, fullDuplexEnabler, http.Pusher +type rw102 rwState + +func (w *rw102) Unwrap() http.ResponseWriter { return w.w } +func (w *rw102) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw102) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw102) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw102) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw102) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw102) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw102) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 104/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw103 rwState + +func (w *rw103) Unwrap() http.ResponseWriter { return w.w } +func (w *rw103) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw103) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw103) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw103) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw103) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw103) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw103) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw103) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 105/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, deadliner +type rw104 rwState + +func (w *rw104) Unwrap() http.ResponseWriter { return w.w } +func (w *rw104) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw104) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw104) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw104) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw104) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw104) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw104) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 106/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, deadliner, io.StringWriter +type rw105 rwState + +func (w *rw105) Unwrap() http.ResponseWriter { return w.w } +func (w *rw105) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw105) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw105) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw105) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw105) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw105) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw105) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw105) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 107/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, deadliner, http.Pusher +type rw106 rwState + +func (w *rw106) Unwrap() http.ResponseWriter { return w.w } +func (w *rw106) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw106) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw106) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw106) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw106) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw106) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw106) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw106) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 108/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, deadliner, http.Pusher, io.StringWriter +type rw107 rwState + +func (w *rw107) Unwrap() http.ResponseWriter { return w.w } +func (w *rw107) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw107) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw107) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw107) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw107) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw107) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw107) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw107) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw107) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 109/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler +type rw108 rwState + +func (w *rw108) Unwrap() http.ResponseWriter { return w.w } +func (w *rw108) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw108) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw108) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw108) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw108) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw108) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw108) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw108) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 110/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler, io.StringWriter +type rw109 rwState + +func (w *rw109) Unwrap() http.ResponseWriter { return w.w } +func (w *rw109) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw109) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw109) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw109) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw109) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw109) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw109) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw109) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw109) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 111/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher +type rw110 rwState + +func (w *rw110) Unwrap() http.ResponseWriter { return w.w } +func (w *rw110) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw110) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw110) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw110) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw110) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw110) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw110) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw110) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw110) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 112/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw111 rwState + +func (w *rw111) Unwrap() http.ResponseWriter { return w.w } +func (w *rw111) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw111) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw111) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw111) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw111) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw111) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw111) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw111) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw111) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw111) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 113/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom +type rw112 rwState + +func (w *rw112) Unwrap() http.ResponseWriter { return w.w } +func (w *rw112) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw112) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw112) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw112) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw112) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw112) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 114/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, io.StringWriter +type rw113 rwState + +func (w *rw113) Unwrap() http.ResponseWriter { return w.w } +func (w *rw113) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw113) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw113) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw113) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw113) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw113) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw113) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 115/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, http.Pusher +type rw114 rwState + +func (w *rw114) Unwrap() http.ResponseWriter { return w.w } +func (w *rw114) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw114) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw114) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw114) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw114) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw114) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw114) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 116/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, http.Pusher, io.StringWriter +type rw115 rwState + +func (w *rw115) Unwrap() http.ResponseWriter { return w.w } +func (w *rw115) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw115) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw115) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw115) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw115) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw115) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw115) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw115) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 117/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler +type rw116 rwState + +func (w *rw116) Unwrap() http.ResponseWriter { return w.w } +func (w *rw116) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw116) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw116) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw116) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw116) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw116) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw116) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 118/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw117 rwState + +func (w *rw117) Unwrap() http.ResponseWriter { return w.w } +func (w *rw117) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw117) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw117) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw117) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw117) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw117) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw117) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw117) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 119/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw118 rwState + +func (w *rw118) Unwrap() http.ResponseWriter { return w.w } +func (w *rw118) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw118) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw118) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw118) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw118) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw118) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw118) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw118) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 120/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw119 rwState + +func (w *rw119) Unwrap() http.ResponseWriter { return w.w } +func (w *rw119) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw119) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw119) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw119) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw119) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw119) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw119) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw119) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw119) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 121/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner +type rw120 rwState + +func (w *rw120) Unwrap() http.ResponseWriter { return w.w } +func (w *rw120) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw120) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw120) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw120) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw120) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw120) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw120) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw120) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 122/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, io.StringWriter +type rw121 rwState + +func (w *rw121) Unwrap() http.ResponseWriter { return w.w } +func (w *rw121) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw121) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw121) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw121) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw121) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw121) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw121) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw121) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw121) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 123/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher +type rw122 rwState + +func (w *rw122) Unwrap() http.ResponseWriter { return w.w } +func (w *rw122) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw122) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw122) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw122) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw122) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw122) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw122) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw122) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw122) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 124/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw123 rwState + +func (w *rw123) Unwrap() http.ResponseWriter { return w.w } +func (w *rw123) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw123) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw123) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw123) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw123) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw123) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw123) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw123) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw123) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw123) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 125/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw124 rwState + +func (w *rw124) Unwrap() http.ResponseWriter { return w.w } +func (w *rw124) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw124) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw124) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw124) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw124) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw124) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw124) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw124) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw124) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 126/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw125 rwState + +func (w *rw125) Unwrap() http.ResponseWriter { return w.w } +func (w *rw125) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw125) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw125) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw125) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw125) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw125) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw125) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw125) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw125) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw125) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 127/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw126 rwState + +func (w *rw126) Unwrap() http.ResponseWriter { return w.w } +func (w *rw126) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw126) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw126) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw126) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw126) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw126) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw126) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw126) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw126) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw126) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 128/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw127 rwState + +func (w *rw127) Unwrap() http.ResponseWriter { return w.w } +func (w *rw127) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw127) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw127) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw127) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw127) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw127) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw127) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw127) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw127) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw127) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw127) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 129/512: http.ResponseWriter, httpFlushError +type rw128 rwState + +func (w *rw128) Unwrap() http.ResponseWriter { return w.w } +func (w *rw128) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw128) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw128) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw128) FlushError() error { + return (*rwState)(w).doFlushError() +} + +// combination 130/512: http.ResponseWriter, httpFlushError, io.StringWriter +type rw129 rwState + +func (w *rw129) Unwrap() http.ResponseWriter { return w.w } +func (w *rw129) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw129) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw129) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw129) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw129) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 131/512: http.ResponseWriter, httpFlushError, http.Pusher +type rw130 rwState + +func (w *rw130) Unwrap() http.ResponseWriter { return w.w } +func (w *rw130) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw130) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw130) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw130) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw130) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 132/512: http.ResponseWriter, httpFlushError, http.Pusher, io.StringWriter +type rw131 rwState + +func (w *rw131) Unwrap() http.ResponseWriter { return w.w } +func (w *rw131) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw131) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw131) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw131) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw131) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw131) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 133/512: http.ResponseWriter, httpFlushError, fullDuplexEnabler +type rw132 rwState + +func (w *rw132) Unwrap() http.ResponseWriter { return w.w } +func (w *rw132) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw132) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw132) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw132) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw132) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 134/512: http.ResponseWriter, httpFlushError, fullDuplexEnabler, io.StringWriter +type rw133 rwState + +func (w *rw133) Unwrap() http.ResponseWriter { return w.w } +func (w *rw133) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw133) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw133) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw133) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw133) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw133) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 135/512: http.ResponseWriter, httpFlushError, fullDuplexEnabler, http.Pusher +type rw134 rwState + +func (w *rw134) Unwrap() http.ResponseWriter { return w.w } +func (w *rw134) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw134) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw134) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw134) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw134) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw134) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 136/512: http.ResponseWriter, httpFlushError, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw135 rwState + +func (w *rw135) Unwrap() http.ResponseWriter { return w.w } +func (w *rw135) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw135) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw135) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw135) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw135) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw135) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw135) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 137/512: http.ResponseWriter, httpFlushError, deadliner +type rw136 rwState + +func (w *rw136) Unwrap() http.ResponseWriter { return w.w } +func (w *rw136) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw136) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw136) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw136) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw136) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw136) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 138/512: http.ResponseWriter, httpFlushError, deadliner, io.StringWriter +type rw137 rwState + +func (w *rw137) Unwrap() http.ResponseWriter { return w.w } +func (w *rw137) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw137) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw137) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw137) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw137) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw137) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw137) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 139/512: http.ResponseWriter, httpFlushError, deadliner, http.Pusher +type rw138 rwState + +func (w *rw138) Unwrap() http.ResponseWriter { return w.w } +func (w *rw138) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw138) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw138) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw138) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw138) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw138) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw138) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 140/512: http.ResponseWriter, httpFlushError, deadliner, http.Pusher, io.StringWriter +type rw139 rwState + +func (w *rw139) Unwrap() http.ResponseWriter { return w.w } +func (w *rw139) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw139) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw139) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw139) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw139) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw139) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw139) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw139) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 141/512: http.ResponseWriter, httpFlushError, deadliner, fullDuplexEnabler +type rw140 rwState + +func (w *rw140) Unwrap() http.ResponseWriter { return w.w } +func (w *rw140) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw140) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw140) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw140) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw140) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw140) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw140) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 142/512: http.ResponseWriter, httpFlushError, deadliner, fullDuplexEnabler, io.StringWriter +type rw141 rwState + +func (w *rw141) Unwrap() http.ResponseWriter { return w.w } +func (w *rw141) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw141) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw141) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw141) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw141) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw141) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw141) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw141) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 143/512: http.ResponseWriter, httpFlushError, deadliner, fullDuplexEnabler, http.Pusher +type rw142 rwState + +func (w *rw142) Unwrap() http.ResponseWriter { return w.w } +func (w *rw142) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw142) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw142) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw142) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw142) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw142) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw142) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw142) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 144/512: http.ResponseWriter, httpFlushError, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw143 rwState + +func (w *rw143) Unwrap() http.ResponseWriter { return w.w } +func (w *rw143) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw143) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw143) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw143) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw143) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw143) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw143) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw143) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw143) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 145/512: http.ResponseWriter, httpFlushError, io.ReaderFrom +type rw144 rwState + +func (w *rw144) Unwrap() http.ResponseWriter { return w.w } +func (w *rw144) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw144) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw144) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw144) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw144) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 146/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, io.StringWriter +type rw145 rwState + +func (w *rw145) Unwrap() http.ResponseWriter { return w.w } +func (w *rw145) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw145) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw145) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw145) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw145) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw145) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 147/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, http.Pusher +type rw146 rwState + +func (w *rw146) Unwrap() http.ResponseWriter { return w.w } +func (w *rw146) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw146) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw146) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw146) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw146) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw146) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 148/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, http.Pusher, io.StringWriter +type rw147 rwState + +func (w *rw147) Unwrap() http.ResponseWriter { return w.w } +func (w *rw147) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw147) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw147) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw147) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw147) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw147) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw147) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 149/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, fullDuplexEnabler +type rw148 rwState + +func (w *rw148) Unwrap() http.ResponseWriter { return w.w } +func (w *rw148) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw148) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw148) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw148) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw148) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw148) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 150/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw149 rwState + +func (w *rw149) Unwrap() http.ResponseWriter { return w.w } +func (w *rw149) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw149) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw149) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw149) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw149) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw149) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw149) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 151/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw150 rwState + +func (w *rw150) Unwrap() http.ResponseWriter { return w.w } +func (w *rw150) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw150) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw150) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw150) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw150) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw150) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw150) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 152/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw151 rwState + +func (w *rw151) Unwrap() http.ResponseWriter { return w.w } +func (w *rw151) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw151) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw151) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw151) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw151) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw151) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw151) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw151) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 153/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, deadliner +type rw152 rwState + +func (w *rw152) Unwrap() http.ResponseWriter { return w.w } +func (w *rw152) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw152) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw152) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw152) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw152) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw152) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw152) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 154/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, deadliner, io.StringWriter +type rw153 rwState + +func (w *rw153) Unwrap() http.ResponseWriter { return w.w } +func (w *rw153) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw153) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw153) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw153) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw153) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw153) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw153) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw153) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 155/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, deadliner, http.Pusher +type rw154 rwState + +func (w *rw154) Unwrap() http.ResponseWriter { return w.w } +func (w *rw154) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw154) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw154) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw154) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw154) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw154) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw154) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw154) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 156/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw155 rwState + +func (w *rw155) Unwrap() http.ResponseWriter { return w.w } +func (w *rw155) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw155) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw155) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw155) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw155) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw155) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw155) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw155) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw155) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 157/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw156 rwState + +func (w *rw156) Unwrap() http.ResponseWriter { return w.w } +func (w *rw156) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw156) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw156) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw156) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw156) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw156) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw156) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw156) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 158/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw157 rwState + +func (w *rw157) Unwrap() http.ResponseWriter { return w.w } +func (w *rw157) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw157) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw157) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw157) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw157) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw157) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw157) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw157) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw157) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 159/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw158 rwState + +func (w *rw158) Unwrap() http.ResponseWriter { return w.w } +func (w *rw158) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw158) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw158) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw158) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw158) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw158) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw158) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw158) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw158) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 160/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw159 rwState + +func (w *rw159) Unwrap() http.ResponseWriter { return w.w } +func (w *rw159) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw159) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw159) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw159) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw159) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw159) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw159) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw159) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw159) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw159) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 161/512: http.ResponseWriter, httpFlushError, http.Hijacker +type rw160 rwState + +func (w *rw160) Unwrap() http.ResponseWriter { return w.w } +func (w *rw160) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw160) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw160) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw160) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw160) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} + +// combination 162/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.StringWriter +type rw161 rwState + +func (w *rw161) Unwrap() http.ResponseWriter { return w.w } +func (w *rw161) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw161) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw161) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw161) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw161) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw161) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 163/512: http.ResponseWriter, httpFlushError, http.Hijacker, http.Pusher +type rw162 rwState + +func (w *rw162) Unwrap() http.ResponseWriter { return w.w } +func (w *rw162) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw162) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw162) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw162) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw162) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw162) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 164/512: http.ResponseWriter, httpFlushError, http.Hijacker, http.Pusher, io.StringWriter +type rw163 rwState + +func (w *rw163) Unwrap() http.ResponseWriter { return w.w } +func (w *rw163) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw163) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw163) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw163) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw163) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw163) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw163) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 165/512: http.ResponseWriter, httpFlushError, http.Hijacker, fullDuplexEnabler +type rw164 rwState + +func (w *rw164) Unwrap() http.ResponseWriter { return w.w } +func (w *rw164) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw164) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw164) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw164) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw164) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw164) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 166/512: http.ResponseWriter, httpFlushError, http.Hijacker, fullDuplexEnabler, io.StringWriter +type rw165 rwState + +func (w *rw165) Unwrap() http.ResponseWriter { return w.w } +func (w *rw165) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw165) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw165) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw165) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw165) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw165) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw165) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 167/512: http.ResponseWriter, httpFlushError, http.Hijacker, fullDuplexEnabler, http.Pusher +type rw166 rwState + +func (w *rw166) Unwrap() http.ResponseWriter { return w.w } +func (w *rw166) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw166) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw166) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw166) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw166) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw166) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw166) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 168/512: http.ResponseWriter, httpFlushError, http.Hijacker, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw167 rwState + +func (w *rw167) Unwrap() http.ResponseWriter { return w.w } +func (w *rw167) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw167) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw167) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw167) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw167) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw167) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw167) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw167) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 169/512: http.ResponseWriter, httpFlushError, http.Hijacker, deadliner +type rw168 rwState + +func (w *rw168) Unwrap() http.ResponseWriter { return w.w } +func (w *rw168) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw168) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw168) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw168) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw168) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw168) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw168) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 170/512: http.ResponseWriter, httpFlushError, http.Hijacker, deadliner, io.StringWriter +type rw169 rwState + +func (w *rw169) Unwrap() http.ResponseWriter { return w.w } +func (w *rw169) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw169) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw169) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw169) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw169) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw169) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw169) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw169) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 171/512: http.ResponseWriter, httpFlushError, http.Hijacker, deadliner, http.Pusher +type rw170 rwState + +func (w *rw170) Unwrap() http.ResponseWriter { return w.w } +func (w *rw170) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw170) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw170) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw170) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw170) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw170) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw170) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw170) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 172/512: http.ResponseWriter, httpFlushError, http.Hijacker, deadliner, http.Pusher, io.StringWriter +type rw171 rwState + +func (w *rw171) Unwrap() http.ResponseWriter { return w.w } +func (w *rw171) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw171) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw171) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw171) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw171) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw171) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw171) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw171) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw171) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 173/512: http.ResponseWriter, httpFlushError, http.Hijacker, deadliner, fullDuplexEnabler +type rw172 rwState + +func (w *rw172) Unwrap() http.ResponseWriter { return w.w } +func (w *rw172) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw172) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw172) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw172) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw172) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw172) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw172) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw172) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 174/512: http.ResponseWriter, httpFlushError, http.Hijacker, deadliner, fullDuplexEnabler, io.StringWriter +type rw173 rwState + +func (w *rw173) Unwrap() http.ResponseWriter { return w.w } +func (w *rw173) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw173) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw173) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw173) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw173) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw173) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw173) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw173) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw173) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 175/512: http.ResponseWriter, httpFlushError, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher +type rw174 rwState + +func (w *rw174) Unwrap() http.ResponseWriter { return w.w } +func (w *rw174) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw174) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw174) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw174) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw174) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw174) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw174) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw174) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw174) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 176/512: http.ResponseWriter, httpFlushError, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw175 rwState + +func (w *rw175) Unwrap() http.ResponseWriter { return w.w } +func (w *rw175) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw175) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw175) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw175) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw175) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw175) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw175) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw175) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw175) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw175) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 177/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom +type rw176 rwState + +func (w *rw176) Unwrap() http.ResponseWriter { return w.w } +func (w *rw176) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw176) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw176) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw176) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw176) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw176) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 178/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, io.StringWriter +type rw177 rwState + +func (w *rw177) Unwrap() http.ResponseWriter { return w.w } +func (w *rw177) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw177) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw177) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw177) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw177) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw177) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw177) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 179/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, http.Pusher +type rw178 rwState + +func (w *rw178) Unwrap() http.ResponseWriter { return w.w } +func (w *rw178) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw178) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw178) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw178) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw178) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw178) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw178) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 180/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, http.Pusher, io.StringWriter +type rw179 rwState + +func (w *rw179) Unwrap() http.ResponseWriter { return w.w } +func (w *rw179) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw179) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw179) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw179) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw179) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw179) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw179) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw179) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 181/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, fullDuplexEnabler +type rw180 rwState + +func (w *rw180) Unwrap() http.ResponseWriter { return w.w } +func (w *rw180) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw180) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw180) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw180) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw180) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw180) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw180) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 182/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw181 rwState + +func (w *rw181) Unwrap() http.ResponseWriter { return w.w } +func (w *rw181) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw181) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw181) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw181) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw181) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw181) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw181) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw181) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 183/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw182 rwState + +func (w *rw182) Unwrap() http.ResponseWriter { return w.w } +func (w *rw182) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw182) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw182) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw182) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw182) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw182) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw182) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw182) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 184/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw183 rwState + +func (w *rw183) Unwrap() http.ResponseWriter { return w.w } +func (w *rw183) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw183) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw183) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw183) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw183) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw183) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw183) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw183) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw183) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 185/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner +type rw184 rwState + +func (w *rw184) Unwrap() http.ResponseWriter { return w.w } +func (w *rw184) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw184) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw184) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw184) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw184) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw184) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw184) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw184) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 186/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner, io.StringWriter +type rw185 rwState + +func (w *rw185) Unwrap() http.ResponseWriter { return w.w } +func (w *rw185) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw185) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw185) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw185) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw185) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw185) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw185) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw185) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw185) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 187/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher +type rw186 rwState + +func (w *rw186) Unwrap() http.ResponseWriter { return w.w } +func (w *rw186) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw186) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw186) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw186) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw186) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw186) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw186) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw186) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw186) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 188/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw187 rwState + +func (w *rw187) Unwrap() http.ResponseWriter { return w.w } +func (w *rw187) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw187) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw187) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw187) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw187) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw187) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw187) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw187) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw187) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw187) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 189/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw188 rwState + +func (w *rw188) Unwrap() http.ResponseWriter { return w.w } +func (w *rw188) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw188) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw188) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw188) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw188) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw188) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw188) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw188) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw188) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 190/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw189 rwState + +func (w *rw189) Unwrap() http.ResponseWriter { return w.w } +func (w *rw189) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw189) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw189) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw189) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw189) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw189) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw189) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw189) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw189) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw189) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 191/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw190 rwState + +func (w *rw190) Unwrap() http.ResponseWriter { return w.w } +func (w *rw190) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw190) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw190) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw190) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw190) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw190) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw190) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw190) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw190) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw190) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 192/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw191 rwState + +func (w *rw191) Unwrap() http.ResponseWriter { return w.w } +func (w *rw191) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw191) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw191) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw191) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw191) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw191) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw191) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw191) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw191) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw191) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw191) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 193/512: http.ResponseWriter, httpFlushError, http.CloseNotifier +type rw192 rwState + +func (w *rw192) Unwrap() http.ResponseWriter { return w.w } +func (w *rw192) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw192) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw192) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw192) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw192) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} + +// combination 194/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.StringWriter +type rw193 rwState + +func (w *rw193) Unwrap() http.ResponseWriter { return w.w } +func (w *rw193) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw193) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw193) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw193) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw193) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw193) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 195/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Pusher +type rw194 rwState + +func (w *rw194) Unwrap() http.ResponseWriter { return w.w } +func (w *rw194) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw194) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw194) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw194) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw194) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw194) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 196/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Pusher, io.StringWriter +type rw195 rwState + +func (w *rw195) Unwrap() http.ResponseWriter { return w.w } +func (w *rw195) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw195) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw195) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw195) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw195) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw195) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw195) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 197/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, fullDuplexEnabler +type rw196 rwState + +func (w *rw196) Unwrap() http.ResponseWriter { return w.w } +func (w *rw196) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw196) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw196) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw196) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw196) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw196) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 198/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, fullDuplexEnabler, io.StringWriter +type rw197 rwState + +func (w *rw197) Unwrap() http.ResponseWriter { return w.w } +func (w *rw197) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw197) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw197) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw197) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw197) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw197) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw197) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 199/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, fullDuplexEnabler, http.Pusher +type rw198 rwState + +func (w *rw198) Unwrap() http.ResponseWriter { return w.w } +func (w *rw198) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw198) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw198) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw198) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw198) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw198) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw198) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 200/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw199 rwState + +func (w *rw199) Unwrap() http.ResponseWriter { return w.w } +func (w *rw199) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw199) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw199) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw199) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw199) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw199) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw199) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw199) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 201/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, deadliner +type rw200 rwState + +func (w *rw200) Unwrap() http.ResponseWriter { return w.w } +func (w *rw200) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw200) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw200) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw200) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw200) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw200) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw200) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 202/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, deadliner, io.StringWriter +type rw201 rwState + +func (w *rw201) Unwrap() http.ResponseWriter { return w.w } +func (w *rw201) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw201) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw201) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw201) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw201) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw201) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw201) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw201) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 203/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, deadliner, http.Pusher +type rw202 rwState + +func (w *rw202) Unwrap() http.ResponseWriter { return w.w } +func (w *rw202) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw202) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw202) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw202) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw202) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw202) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw202) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw202) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 204/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, deadliner, http.Pusher, io.StringWriter +type rw203 rwState + +func (w *rw203) Unwrap() http.ResponseWriter { return w.w } +func (w *rw203) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw203) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw203) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw203) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw203) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw203) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw203) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw203) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw203) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 205/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, deadliner, fullDuplexEnabler +type rw204 rwState + +func (w *rw204) Unwrap() http.ResponseWriter { return w.w } +func (w *rw204) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw204) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw204) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw204) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw204) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw204) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw204) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw204) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 206/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, deadliner, fullDuplexEnabler, io.StringWriter +type rw205 rwState + +func (w *rw205) Unwrap() http.ResponseWriter { return w.w } +func (w *rw205) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw205) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw205) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw205) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw205) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw205) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw205) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw205) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw205) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 207/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, deadliner, fullDuplexEnabler, http.Pusher +type rw206 rwState + +func (w *rw206) Unwrap() http.ResponseWriter { return w.w } +func (w *rw206) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw206) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw206) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw206) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw206) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw206) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw206) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw206) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw206) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 208/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw207 rwState + +func (w *rw207) Unwrap() http.ResponseWriter { return w.w } +func (w *rw207) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw207) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw207) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw207) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw207) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw207) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw207) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw207) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw207) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw207) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 209/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom +type rw208 rwState + +func (w *rw208) Unwrap() http.ResponseWriter { return w.w } +func (w *rw208) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw208) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw208) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw208) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw208) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw208) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 210/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, io.StringWriter +type rw209 rwState + +func (w *rw209) Unwrap() http.ResponseWriter { return w.w } +func (w *rw209) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw209) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw209) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw209) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw209) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw209) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw209) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 211/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, http.Pusher +type rw210 rwState + +func (w *rw210) Unwrap() http.ResponseWriter { return w.w } +func (w *rw210) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw210) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw210) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw210) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw210) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw210) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw210) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 212/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, http.Pusher, io.StringWriter +type rw211 rwState + +func (w *rw211) Unwrap() http.ResponseWriter { return w.w } +func (w *rw211) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw211) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw211) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw211) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw211) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw211) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw211) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw211) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 213/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler +type rw212 rwState + +func (w *rw212) Unwrap() http.ResponseWriter { return w.w } +func (w *rw212) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw212) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw212) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw212) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw212) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw212) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw212) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 214/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw213 rwState + +func (w *rw213) Unwrap() http.ResponseWriter { return w.w } +func (w *rw213) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw213) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw213) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw213) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw213) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw213) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw213) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw213) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 215/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw214 rwState + +func (w *rw214) Unwrap() http.ResponseWriter { return w.w } +func (w *rw214) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw214) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw214) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw214) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw214) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw214) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw214) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw214) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 216/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw215 rwState + +func (w *rw215) Unwrap() http.ResponseWriter { return w.w } +func (w *rw215) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw215) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw215) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw215) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw215) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw215) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw215) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw215) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw215) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 217/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner +type rw216 rwState + +func (w *rw216) Unwrap() http.ResponseWriter { return w.w } +func (w *rw216) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw216) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw216) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw216) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw216) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw216) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw216) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw216) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 218/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner, io.StringWriter +type rw217 rwState + +func (w *rw217) Unwrap() http.ResponseWriter { return w.w } +func (w *rw217) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw217) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw217) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw217) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw217) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw217) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw217) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw217) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw217) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 219/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner, http.Pusher +type rw218 rwState + +func (w *rw218) Unwrap() http.ResponseWriter { return w.w } +func (w *rw218) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw218) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw218) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw218) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw218) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw218) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw218) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw218) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw218) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 220/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw219 rwState + +func (w *rw219) Unwrap() http.ResponseWriter { return w.w } +func (w *rw219) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw219) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw219) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw219) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw219) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw219) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw219) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw219) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw219) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw219) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 221/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw220 rwState + +func (w *rw220) Unwrap() http.ResponseWriter { return w.w } +func (w *rw220) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw220) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw220) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw220) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw220) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw220) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw220) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw220) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw220) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 222/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw221 rwState + +func (w *rw221) Unwrap() http.ResponseWriter { return w.w } +func (w *rw221) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw221) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw221) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw221) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw221) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw221) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw221) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw221) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw221) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw221) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 223/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw222 rwState + +func (w *rw222) Unwrap() http.ResponseWriter { return w.w } +func (w *rw222) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw222) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw222) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw222) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw222) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw222) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw222) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw222) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw222) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw222) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 224/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw223 rwState + +func (w *rw223) Unwrap() http.ResponseWriter { return w.w } +func (w *rw223) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw223) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw223) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw223) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw223) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw223) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw223) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw223) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw223) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw223) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw223) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 225/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker +type rw224 rwState + +func (w *rw224) Unwrap() http.ResponseWriter { return w.w } +func (w *rw224) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw224) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw224) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw224) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw224) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw224) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} + +// combination 226/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.StringWriter +type rw225 rwState + +func (w *rw225) Unwrap() http.ResponseWriter { return w.w } +func (w *rw225) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw225) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw225) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw225) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw225) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw225) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw225) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 227/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, http.Pusher +type rw226 rwState + +func (w *rw226) Unwrap() http.ResponseWriter { return w.w } +func (w *rw226) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw226) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw226) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw226) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw226) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw226) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw226) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 228/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, http.Pusher, io.StringWriter +type rw227 rwState + +func (w *rw227) Unwrap() http.ResponseWriter { return w.w } +func (w *rw227) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw227) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw227) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw227) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw227) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw227) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw227) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw227) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 229/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, fullDuplexEnabler +type rw228 rwState + +func (w *rw228) Unwrap() http.ResponseWriter { return w.w } +func (w *rw228) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw228) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw228) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw228) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw228) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw228) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw228) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 230/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, fullDuplexEnabler, io.StringWriter +type rw229 rwState + +func (w *rw229) Unwrap() http.ResponseWriter { return w.w } +func (w *rw229) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw229) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw229) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw229) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw229) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw229) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw229) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw229) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 231/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, fullDuplexEnabler, http.Pusher +type rw230 rwState + +func (w *rw230) Unwrap() http.ResponseWriter { return w.w } +func (w *rw230) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw230) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw230) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw230) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw230) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw230) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw230) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw230) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 232/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw231 rwState + +func (w *rw231) Unwrap() http.ResponseWriter { return w.w } +func (w *rw231) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw231) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw231) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw231) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw231) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw231) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw231) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw231) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw231) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 233/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner +type rw232 rwState + +func (w *rw232) Unwrap() http.ResponseWriter { return w.w } +func (w *rw232) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw232) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw232) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw232) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw232) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw232) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw232) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw232) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 234/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner, io.StringWriter +type rw233 rwState + +func (w *rw233) Unwrap() http.ResponseWriter { return w.w } +func (w *rw233) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw233) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw233) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw233) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw233) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw233) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw233) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw233) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw233) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 235/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner, http.Pusher +type rw234 rwState + +func (w *rw234) Unwrap() http.ResponseWriter { return w.w } +func (w *rw234) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw234) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw234) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw234) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw234) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw234) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw234) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw234) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw234) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 236/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner, http.Pusher, io.StringWriter +type rw235 rwState + +func (w *rw235) Unwrap() http.ResponseWriter { return w.w } +func (w *rw235) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw235) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw235) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw235) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw235) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw235) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw235) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw235) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw235) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw235) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 237/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler +type rw236 rwState + +func (w *rw236) Unwrap() http.ResponseWriter { return w.w } +func (w *rw236) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw236) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw236) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw236) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw236) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw236) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw236) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw236) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw236) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 238/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler, io.StringWriter +type rw237 rwState + +func (w *rw237) Unwrap() http.ResponseWriter { return w.w } +func (w *rw237) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw237) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw237) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw237) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw237) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw237) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw237) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw237) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw237) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw237) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 239/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher +type rw238 rwState + +func (w *rw238) Unwrap() http.ResponseWriter { return w.w } +func (w *rw238) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw238) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw238) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw238) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw238) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw238) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw238) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw238) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw238) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw238) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 240/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw239 rwState + +func (w *rw239) Unwrap() http.ResponseWriter { return w.w } +func (w *rw239) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw239) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw239) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw239) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw239) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw239) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw239) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw239) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw239) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw239) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw239) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 241/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom +type rw240 rwState + +func (w *rw240) Unwrap() http.ResponseWriter { return w.w } +func (w *rw240) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw240) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw240) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw240) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw240) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw240) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw240) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 242/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, io.StringWriter +type rw241 rwState + +func (w *rw241) Unwrap() http.ResponseWriter { return w.w } +func (w *rw241) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw241) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw241) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw241) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw241) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw241) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw241) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw241) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 243/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, http.Pusher +type rw242 rwState + +func (w *rw242) Unwrap() http.ResponseWriter { return w.w } +func (w *rw242) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw242) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw242) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw242) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw242) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw242) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw242) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw242) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 244/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, http.Pusher, io.StringWriter +type rw243 rwState + +func (w *rw243) Unwrap() http.ResponseWriter { return w.w } +func (w *rw243) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw243) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw243) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw243) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw243) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw243) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw243) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw243) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw243) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 245/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler +type rw244 rwState + +func (w *rw244) Unwrap() http.ResponseWriter { return w.w } +func (w *rw244) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw244) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw244) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw244) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw244) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw244) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw244) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw244) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 246/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw245 rwState + +func (w *rw245) Unwrap() http.ResponseWriter { return w.w } +func (w *rw245) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw245) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw245) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw245) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw245) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw245) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw245) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw245) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw245) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 247/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw246 rwState + +func (w *rw246) Unwrap() http.ResponseWriter { return w.w } +func (w *rw246) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw246) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw246) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw246) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw246) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw246) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw246) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw246) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw246) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 248/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw247 rwState + +func (w *rw247) Unwrap() http.ResponseWriter { return w.w } +func (w *rw247) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw247) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw247) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw247) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw247) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw247) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw247) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw247) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw247) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw247) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 249/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner +type rw248 rwState + +func (w *rw248) Unwrap() http.ResponseWriter { return w.w } +func (w *rw248) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw248) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw248) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw248) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw248) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw248) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw248) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw248) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw248) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 250/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, io.StringWriter +type rw249 rwState + +func (w *rw249) Unwrap() http.ResponseWriter { return w.w } +func (w *rw249) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw249) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw249) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw249) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw249) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw249) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw249) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw249) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw249) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw249) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 251/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher +type rw250 rwState + +func (w *rw250) Unwrap() http.ResponseWriter { return w.w } +func (w *rw250) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw250) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw250) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw250) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw250) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw250) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw250) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw250) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw250) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw250) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 252/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw251 rwState + +func (w *rw251) Unwrap() http.ResponseWriter { return w.w } +func (w *rw251) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw251) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw251) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw251) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw251) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw251) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw251) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw251) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw251) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw251) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw251) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 253/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw252 rwState + +func (w *rw252) Unwrap() http.ResponseWriter { return w.w } +func (w *rw252) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw252) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw252) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw252) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw252) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw252) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw252) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw252) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw252) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw252) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 254/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw253 rwState + +func (w *rw253) Unwrap() http.ResponseWriter { return w.w } +func (w *rw253) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw253) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw253) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw253) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw253) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw253) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw253) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw253) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw253) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw253) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw253) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 255/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw254 rwState + +func (w *rw254) Unwrap() http.ResponseWriter { return w.w } +func (w *rw254) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw254) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw254) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw254) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw254) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw254) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw254) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw254) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw254) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw254) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw254) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 256/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw255 rwState + +func (w *rw255) Unwrap() http.ResponseWriter { return w.w } +func (w *rw255) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw255) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw255) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw255) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw255) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw255) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw255) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw255) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw255) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw255) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw255) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw255) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 257/512: http.ResponseWriter, http.Flusher +type rw256 rwState + +func (w *rw256) Unwrap() http.ResponseWriter { return w.w } +func (w *rw256) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw256) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw256) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw256) Flush() { + (*rwState)(w).doFlush() +} + +// combination 258/512: http.ResponseWriter, http.Flusher, io.StringWriter +type rw257 rwState + +func (w *rw257) Unwrap() http.ResponseWriter { return w.w } +func (w *rw257) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw257) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw257) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw257) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw257) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 259/512: http.ResponseWriter, http.Flusher, http.Pusher +type rw258 rwState + +func (w *rw258) Unwrap() http.ResponseWriter { return w.w } +func (w *rw258) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw258) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw258) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw258) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw258) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 260/512: http.ResponseWriter, http.Flusher, http.Pusher, io.StringWriter +type rw259 rwState + +func (w *rw259) Unwrap() http.ResponseWriter { return w.w } +func (w *rw259) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw259) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw259) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw259) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw259) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw259) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 261/512: http.ResponseWriter, http.Flusher, fullDuplexEnabler +type rw260 rwState + +func (w *rw260) Unwrap() http.ResponseWriter { return w.w } +func (w *rw260) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw260) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw260) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw260) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw260) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 262/512: http.ResponseWriter, http.Flusher, fullDuplexEnabler, io.StringWriter +type rw261 rwState + +func (w *rw261) Unwrap() http.ResponseWriter { return w.w } +func (w *rw261) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw261) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw261) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw261) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw261) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw261) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 263/512: http.ResponseWriter, http.Flusher, fullDuplexEnabler, http.Pusher +type rw262 rwState + +func (w *rw262) Unwrap() http.ResponseWriter { return w.w } +func (w *rw262) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw262) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw262) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw262) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw262) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw262) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 264/512: http.ResponseWriter, http.Flusher, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw263 rwState + +func (w *rw263) Unwrap() http.ResponseWriter { return w.w } +func (w *rw263) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw263) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw263) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw263) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw263) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw263) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw263) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 265/512: http.ResponseWriter, http.Flusher, deadliner +type rw264 rwState + +func (w *rw264) Unwrap() http.ResponseWriter { return w.w } +func (w *rw264) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw264) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw264) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw264) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw264) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw264) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 266/512: http.ResponseWriter, http.Flusher, deadliner, io.StringWriter +type rw265 rwState + +func (w *rw265) Unwrap() http.ResponseWriter { return w.w } +func (w *rw265) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw265) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw265) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw265) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw265) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw265) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw265) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 267/512: http.ResponseWriter, http.Flusher, deadliner, http.Pusher +type rw266 rwState + +func (w *rw266) Unwrap() http.ResponseWriter { return w.w } +func (w *rw266) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw266) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw266) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw266) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw266) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw266) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw266) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 268/512: http.ResponseWriter, http.Flusher, deadliner, http.Pusher, io.StringWriter +type rw267 rwState + +func (w *rw267) Unwrap() http.ResponseWriter { return w.w } +func (w *rw267) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw267) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw267) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw267) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw267) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw267) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw267) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw267) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 269/512: http.ResponseWriter, http.Flusher, deadliner, fullDuplexEnabler +type rw268 rwState + +func (w *rw268) Unwrap() http.ResponseWriter { return w.w } +func (w *rw268) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw268) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw268) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw268) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw268) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw268) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw268) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 270/512: http.ResponseWriter, http.Flusher, deadliner, fullDuplexEnabler, io.StringWriter +type rw269 rwState + +func (w *rw269) Unwrap() http.ResponseWriter { return w.w } +func (w *rw269) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw269) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw269) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw269) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw269) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw269) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw269) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw269) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 271/512: http.ResponseWriter, http.Flusher, deadliner, fullDuplexEnabler, http.Pusher +type rw270 rwState + +func (w *rw270) Unwrap() http.ResponseWriter { return w.w } +func (w *rw270) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw270) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw270) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw270) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw270) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw270) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw270) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw270) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 272/512: http.ResponseWriter, http.Flusher, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw271 rwState + +func (w *rw271) Unwrap() http.ResponseWriter { return w.w } +func (w *rw271) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw271) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw271) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw271) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw271) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw271) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw271) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw271) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw271) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 273/512: http.ResponseWriter, http.Flusher, io.ReaderFrom +type rw272 rwState + +func (w *rw272) Unwrap() http.ResponseWriter { return w.w } +func (w *rw272) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw272) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw272) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw272) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw272) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 274/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, io.StringWriter +type rw273 rwState + +func (w *rw273) Unwrap() http.ResponseWriter { return w.w } +func (w *rw273) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw273) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw273) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw273) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw273) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw273) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 275/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, http.Pusher +type rw274 rwState + +func (w *rw274) Unwrap() http.ResponseWriter { return w.w } +func (w *rw274) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw274) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw274) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw274) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw274) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw274) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 276/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, http.Pusher, io.StringWriter +type rw275 rwState + +func (w *rw275) Unwrap() http.ResponseWriter { return w.w } +func (w *rw275) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw275) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw275) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw275) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw275) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw275) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw275) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 277/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, fullDuplexEnabler +type rw276 rwState + +func (w *rw276) Unwrap() http.ResponseWriter { return w.w } +func (w *rw276) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw276) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw276) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw276) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw276) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw276) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 278/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw277 rwState + +func (w *rw277) Unwrap() http.ResponseWriter { return w.w } +func (w *rw277) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw277) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw277) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw277) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw277) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw277) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw277) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 279/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw278 rwState + +func (w *rw278) Unwrap() http.ResponseWriter { return w.w } +func (w *rw278) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw278) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw278) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw278) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw278) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw278) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw278) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 280/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw279 rwState + +func (w *rw279) Unwrap() http.ResponseWriter { return w.w } +func (w *rw279) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw279) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw279) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw279) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw279) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw279) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw279) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw279) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 281/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, deadliner +type rw280 rwState + +func (w *rw280) Unwrap() http.ResponseWriter { return w.w } +func (w *rw280) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw280) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw280) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw280) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw280) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw280) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw280) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 282/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, deadliner, io.StringWriter +type rw281 rwState + +func (w *rw281) Unwrap() http.ResponseWriter { return w.w } +func (w *rw281) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw281) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw281) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw281) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw281) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw281) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw281) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw281) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 283/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, deadliner, http.Pusher +type rw282 rwState + +func (w *rw282) Unwrap() http.ResponseWriter { return w.w } +func (w *rw282) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw282) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw282) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw282) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw282) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw282) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw282) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw282) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 284/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw283 rwState + +func (w *rw283) Unwrap() http.ResponseWriter { return w.w } +func (w *rw283) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw283) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw283) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw283) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw283) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw283) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw283) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw283) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw283) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 285/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw284 rwState + +func (w *rw284) Unwrap() http.ResponseWriter { return w.w } +func (w *rw284) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw284) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw284) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw284) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw284) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw284) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw284) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw284) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 286/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw285 rwState + +func (w *rw285) Unwrap() http.ResponseWriter { return w.w } +func (w *rw285) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw285) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw285) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw285) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw285) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw285) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw285) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw285) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw285) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 287/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw286 rwState + +func (w *rw286) Unwrap() http.ResponseWriter { return w.w } +func (w *rw286) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw286) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw286) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw286) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw286) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw286) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw286) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw286) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw286) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 288/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw287 rwState + +func (w *rw287) Unwrap() http.ResponseWriter { return w.w } +func (w *rw287) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw287) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw287) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw287) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw287) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw287) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw287) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw287) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw287) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw287) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 289/512: http.ResponseWriter, http.Flusher, http.Hijacker +type rw288 rwState + +func (w *rw288) Unwrap() http.ResponseWriter { return w.w } +func (w *rw288) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw288) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw288) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw288) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw288) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} + +// combination 290/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.StringWriter +type rw289 rwState + +func (w *rw289) Unwrap() http.ResponseWriter { return w.w } +func (w *rw289) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw289) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw289) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw289) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw289) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw289) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 291/512: http.ResponseWriter, http.Flusher, http.Hijacker, http.Pusher +type rw290 rwState + +func (w *rw290) Unwrap() http.ResponseWriter { return w.w } +func (w *rw290) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw290) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw290) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw290) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw290) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw290) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 292/512: http.ResponseWriter, http.Flusher, http.Hijacker, http.Pusher, io.StringWriter +type rw291 rwState + +func (w *rw291) Unwrap() http.ResponseWriter { return w.w } +func (w *rw291) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw291) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw291) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw291) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw291) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw291) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw291) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 293/512: http.ResponseWriter, http.Flusher, http.Hijacker, fullDuplexEnabler +type rw292 rwState + +func (w *rw292) Unwrap() http.ResponseWriter { return w.w } +func (w *rw292) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw292) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw292) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw292) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw292) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw292) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 294/512: http.ResponseWriter, http.Flusher, http.Hijacker, fullDuplexEnabler, io.StringWriter +type rw293 rwState + +func (w *rw293) Unwrap() http.ResponseWriter { return w.w } +func (w *rw293) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw293) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw293) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw293) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw293) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw293) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw293) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 295/512: http.ResponseWriter, http.Flusher, http.Hijacker, fullDuplexEnabler, http.Pusher +type rw294 rwState + +func (w *rw294) Unwrap() http.ResponseWriter { return w.w } +func (w *rw294) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw294) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw294) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw294) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw294) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw294) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw294) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 296/512: http.ResponseWriter, http.Flusher, http.Hijacker, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw295 rwState + +func (w *rw295) Unwrap() http.ResponseWriter { return w.w } +func (w *rw295) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw295) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw295) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw295) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw295) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw295) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw295) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw295) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 297/512: http.ResponseWriter, http.Flusher, http.Hijacker, deadliner +type rw296 rwState + +func (w *rw296) Unwrap() http.ResponseWriter { return w.w } +func (w *rw296) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw296) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw296) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw296) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw296) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw296) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw296) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 298/512: http.ResponseWriter, http.Flusher, http.Hijacker, deadliner, io.StringWriter +type rw297 rwState + +func (w *rw297) Unwrap() http.ResponseWriter { return w.w } +func (w *rw297) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw297) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw297) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw297) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw297) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw297) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw297) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw297) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 299/512: http.ResponseWriter, http.Flusher, http.Hijacker, deadliner, http.Pusher +type rw298 rwState + +func (w *rw298) Unwrap() http.ResponseWriter { return w.w } +func (w *rw298) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw298) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw298) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw298) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw298) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw298) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw298) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw298) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 300/512: http.ResponseWriter, http.Flusher, http.Hijacker, deadliner, http.Pusher, io.StringWriter +type rw299 rwState + +func (w *rw299) Unwrap() http.ResponseWriter { return w.w } +func (w *rw299) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw299) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw299) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw299) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw299) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw299) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw299) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw299) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw299) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 301/512: http.ResponseWriter, http.Flusher, http.Hijacker, deadliner, fullDuplexEnabler +type rw300 rwState + +func (w *rw300) Unwrap() http.ResponseWriter { return w.w } +func (w *rw300) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw300) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw300) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw300) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw300) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw300) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw300) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw300) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 302/512: http.ResponseWriter, http.Flusher, http.Hijacker, deadliner, fullDuplexEnabler, io.StringWriter +type rw301 rwState + +func (w *rw301) Unwrap() http.ResponseWriter { return w.w } +func (w *rw301) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw301) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw301) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw301) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw301) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw301) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw301) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw301) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw301) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 303/512: http.ResponseWriter, http.Flusher, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher +type rw302 rwState + +func (w *rw302) Unwrap() http.ResponseWriter { return w.w } +func (w *rw302) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw302) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw302) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw302) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw302) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw302) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw302) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw302) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw302) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 304/512: http.ResponseWriter, http.Flusher, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw303 rwState + +func (w *rw303) Unwrap() http.ResponseWriter { return w.w } +func (w *rw303) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw303) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw303) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw303) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw303) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw303) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw303) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw303) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw303) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw303) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 305/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom +type rw304 rwState + +func (w *rw304) Unwrap() http.ResponseWriter { return w.w } +func (w *rw304) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw304) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw304) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw304) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw304) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw304) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 306/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, io.StringWriter +type rw305 rwState + +func (w *rw305) Unwrap() http.ResponseWriter { return w.w } +func (w *rw305) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw305) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw305) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw305) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw305) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw305) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw305) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 307/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, http.Pusher +type rw306 rwState + +func (w *rw306) Unwrap() http.ResponseWriter { return w.w } +func (w *rw306) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw306) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw306) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw306) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw306) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw306) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw306) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 308/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, http.Pusher, io.StringWriter +type rw307 rwState + +func (w *rw307) Unwrap() http.ResponseWriter { return w.w } +func (w *rw307) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw307) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw307) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw307) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw307) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw307) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw307) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw307) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 309/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, fullDuplexEnabler +type rw308 rwState + +func (w *rw308) Unwrap() http.ResponseWriter { return w.w } +func (w *rw308) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw308) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw308) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw308) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw308) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw308) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw308) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 310/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw309 rwState + +func (w *rw309) Unwrap() http.ResponseWriter { return w.w } +func (w *rw309) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw309) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw309) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw309) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw309) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw309) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw309) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw309) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 311/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw310 rwState + +func (w *rw310) Unwrap() http.ResponseWriter { return w.w } +func (w *rw310) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw310) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw310) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw310) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw310) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw310) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw310) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw310) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 312/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw311 rwState + +func (w *rw311) Unwrap() http.ResponseWriter { return w.w } +func (w *rw311) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw311) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw311) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw311) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw311) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw311) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw311) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw311) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw311) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 313/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, deadliner +type rw312 rwState + +func (w *rw312) Unwrap() http.ResponseWriter { return w.w } +func (w *rw312) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw312) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw312) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw312) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw312) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw312) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw312) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw312) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 314/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, deadliner, io.StringWriter +type rw313 rwState + +func (w *rw313) Unwrap() http.ResponseWriter { return w.w } +func (w *rw313) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw313) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw313) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw313) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw313) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw313) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw313) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw313) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw313) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 315/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher +type rw314 rwState + +func (w *rw314) Unwrap() http.ResponseWriter { return w.w } +func (w *rw314) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw314) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw314) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw314) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw314) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw314) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw314) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw314) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw314) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 316/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw315 rwState + +func (w *rw315) Unwrap() http.ResponseWriter { return w.w } +func (w *rw315) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw315) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw315) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw315) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw315) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw315) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw315) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw315) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw315) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw315) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 317/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw316 rwState + +func (w *rw316) Unwrap() http.ResponseWriter { return w.w } +func (w *rw316) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw316) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw316) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw316) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw316) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw316) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw316) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw316) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw316) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 318/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw317 rwState + +func (w *rw317) Unwrap() http.ResponseWriter { return w.w } +func (w *rw317) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw317) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw317) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw317) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw317) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw317) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw317) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw317) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw317) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw317) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 319/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw318 rwState + +func (w *rw318) Unwrap() http.ResponseWriter { return w.w } +func (w *rw318) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw318) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw318) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw318) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw318) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw318) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw318) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw318) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw318) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw318) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 320/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw319 rwState + +func (w *rw319) Unwrap() http.ResponseWriter { return w.w } +func (w *rw319) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw319) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw319) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw319) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw319) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw319) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw319) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw319) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw319) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw319) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw319) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 321/512: http.ResponseWriter, http.Flusher, http.CloseNotifier +type rw320 rwState + +func (w *rw320) Unwrap() http.ResponseWriter { return w.w } +func (w *rw320) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw320) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw320) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw320) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw320) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} + +// combination 322/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.StringWriter +type rw321 rwState + +func (w *rw321) Unwrap() http.ResponseWriter { return w.w } +func (w *rw321) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw321) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw321) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw321) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw321) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw321) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 323/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Pusher +type rw322 rwState + +func (w *rw322) Unwrap() http.ResponseWriter { return w.w } +func (w *rw322) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw322) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw322) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw322) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw322) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw322) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 324/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Pusher, io.StringWriter +type rw323 rwState + +func (w *rw323) Unwrap() http.ResponseWriter { return w.w } +func (w *rw323) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw323) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw323) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw323) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw323) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw323) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw323) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 325/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, fullDuplexEnabler +type rw324 rwState + +func (w *rw324) Unwrap() http.ResponseWriter { return w.w } +func (w *rw324) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw324) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw324) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw324) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw324) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw324) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 326/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, fullDuplexEnabler, io.StringWriter +type rw325 rwState + +func (w *rw325) Unwrap() http.ResponseWriter { return w.w } +func (w *rw325) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw325) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw325) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw325) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw325) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw325) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw325) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 327/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, fullDuplexEnabler, http.Pusher +type rw326 rwState + +func (w *rw326) Unwrap() http.ResponseWriter { return w.w } +func (w *rw326) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw326) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw326) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw326) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw326) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw326) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw326) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 328/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw327 rwState + +func (w *rw327) Unwrap() http.ResponseWriter { return w.w } +func (w *rw327) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw327) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw327) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw327) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw327) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw327) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw327) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw327) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 329/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, deadliner +type rw328 rwState + +func (w *rw328) Unwrap() http.ResponseWriter { return w.w } +func (w *rw328) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw328) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw328) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw328) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw328) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw328) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw328) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 330/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, deadliner, io.StringWriter +type rw329 rwState + +func (w *rw329) Unwrap() http.ResponseWriter { return w.w } +func (w *rw329) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw329) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw329) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw329) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw329) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw329) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw329) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw329) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 331/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, deadliner, http.Pusher +type rw330 rwState + +func (w *rw330) Unwrap() http.ResponseWriter { return w.w } +func (w *rw330) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw330) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw330) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw330) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw330) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw330) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw330) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw330) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 332/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, deadliner, http.Pusher, io.StringWriter +type rw331 rwState + +func (w *rw331) Unwrap() http.ResponseWriter { return w.w } +func (w *rw331) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw331) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw331) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw331) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw331) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw331) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw331) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw331) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw331) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 333/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, deadliner, fullDuplexEnabler +type rw332 rwState + +func (w *rw332) Unwrap() http.ResponseWriter { return w.w } +func (w *rw332) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw332) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw332) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw332) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw332) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw332) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw332) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw332) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 334/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, deadliner, fullDuplexEnabler, io.StringWriter +type rw333 rwState + +func (w *rw333) Unwrap() http.ResponseWriter { return w.w } +func (w *rw333) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw333) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw333) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw333) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw333) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw333) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw333) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw333) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw333) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 335/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, deadliner, fullDuplexEnabler, http.Pusher +type rw334 rwState + +func (w *rw334) Unwrap() http.ResponseWriter { return w.w } +func (w *rw334) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw334) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw334) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw334) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw334) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw334) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw334) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw334) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw334) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 336/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw335 rwState + +func (w *rw335) Unwrap() http.ResponseWriter { return w.w } +func (w *rw335) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw335) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw335) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw335) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw335) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw335) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw335) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw335) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw335) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw335) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 337/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom +type rw336 rwState + +func (w *rw336) Unwrap() http.ResponseWriter { return w.w } +func (w *rw336) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw336) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw336) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw336) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw336) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw336) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 338/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, io.StringWriter +type rw337 rwState + +func (w *rw337) Unwrap() http.ResponseWriter { return w.w } +func (w *rw337) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw337) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw337) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw337) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw337) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw337) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw337) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 339/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, http.Pusher +type rw338 rwState + +func (w *rw338) Unwrap() http.ResponseWriter { return w.w } +func (w *rw338) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw338) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw338) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw338) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw338) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw338) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw338) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 340/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, http.Pusher, io.StringWriter +type rw339 rwState + +func (w *rw339) Unwrap() http.ResponseWriter { return w.w } +func (w *rw339) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw339) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw339) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw339) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw339) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw339) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw339) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw339) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 341/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler +type rw340 rwState + +func (w *rw340) Unwrap() http.ResponseWriter { return w.w } +func (w *rw340) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw340) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw340) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw340) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw340) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw340) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw340) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 342/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw341 rwState + +func (w *rw341) Unwrap() http.ResponseWriter { return w.w } +func (w *rw341) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw341) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw341) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw341) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw341) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw341) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw341) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw341) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 343/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw342 rwState + +func (w *rw342) Unwrap() http.ResponseWriter { return w.w } +func (w *rw342) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw342) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw342) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw342) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw342) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw342) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw342) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw342) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 344/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw343 rwState + +func (w *rw343) Unwrap() http.ResponseWriter { return w.w } +func (w *rw343) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw343) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw343) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw343) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw343) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw343) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw343) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw343) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw343) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 345/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, deadliner +type rw344 rwState + +func (w *rw344) Unwrap() http.ResponseWriter { return w.w } +func (w *rw344) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw344) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw344) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw344) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw344) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw344) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw344) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw344) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 346/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, deadliner, io.StringWriter +type rw345 rwState + +func (w *rw345) Unwrap() http.ResponseWriter { return w.w } +func (w *rw345) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw345) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw345) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw345) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw345) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw345) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw345) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw345) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw345) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 347/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, deadliner, http.Pusher +type rw346 rwState + +func (w *rw346) Unwrap() http.ResponseWriter { return w.w } +func (w *rw346) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw346) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw346) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw346) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw346) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw346) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw346) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw346) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw346) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 348/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw347 rwState + +func (w *rw347) Unwrap() http.ResponseWriter { return w.w } +func (w *rw347) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw347) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw347) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw347) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw347) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw347) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw347) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw347) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw347) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw347) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 349/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw348 rwState + +func (w *rw348) Unwrap() http.ResponseWriter { return w.w } +func (w *rw348) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw348) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw348) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw348) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw348) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw348) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw348) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw348) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw348) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 350/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw349 rwState + +func (w *rw349) Unwrap() http.ResponseWriter { return w.w } +func (w *rw349) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw349) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw349) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw349) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw349) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw349) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw349) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw349) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw349) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw349) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 351/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw350 rwState + +func (w *rw350) Unwrap() http.ResponseWriter { return w.w } +func (w *rw350) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw350) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw350) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw350) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw350) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw350) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw350) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw350) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw350) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw350) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 352/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw351 rwState + +func (w *rw351) Unwrap() http.ResponseWriter { return w.w } +func (w *rw351) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw351) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw351) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw351) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw351) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw351) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw351) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw351) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw351) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw351) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw351) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 353/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker +type rw352 rwState + +func (w *rw352) Unwrap() http.ResponseWriter { return w.w } +func (w *rw352) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw352) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw352) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw352) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw352) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw352) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} + +// combination 354/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.StringWriter +type rw353 rwState + +func (w *rw353) Unwrap() http.ResponseWriter { return w.w } +func (w *rw353) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw353) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw353) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw353) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw353) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw353) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw353) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 355/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, http.Pusher +type rw354 rwState + +func (w *rw354) Unwrap() http.ResponseWriter { return w.w } +func (w *rw354) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw354) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw354) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw354) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw354) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw354) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw354) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 356/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, http.Pusher, io.StringWriter +type rw355 rwState + +func (w *rw355) Unwrap() http.ResponseWriter { return w.w } +func (w *rw355) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw355) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw355) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw355) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw355) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw355) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw355) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw355) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 357/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, fullDuplexEnabler +type rw356 rwState + +func (w *rw356) Unwrap() http.ResponseWriter { return w.w } +func (w *rw356) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw356) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw356) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw356) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw356) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw356) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw356) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 358/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, fullDuplexEnabler, io.StringWriter +type rw357 rwState + +func (w *rw357) Unwrap() http.ResponseWriter { return w.w } +func (w *rw357) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw357) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw357) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw357) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw357) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw357) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw357) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw357) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 359/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, fullDuplexEnabler, http.Pusher +type rw358 rwState + +func (w *rw358) Unwrap() http.ResponseWriter { return w.w } +func (w *rw358) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw358) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw358) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw358) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw358) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw358) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw358) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw358) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 360/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw359 rwState + +func (w *rw359) Unwrap() http.ResponseWriter { return w.w } +func (w *rw359) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw359) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw359) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw359) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw359) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw359) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw359) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw359) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw359) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 361/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, deadliner +type rw360 rwState + +func (w *rw360) Unwrap() http.ResponseWriter { return w.w } +func (w *rw360) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw360) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw360) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw360) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw360) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw360) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw360) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw360) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 362/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, deadliner, io.StringWriter +type rw361 rwState + +func (w *rw361) Unwrap() http.ResponseWriter { return w.w } +func (w *rw361) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw361) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw361) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw361) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw361) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw361) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw361) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw361) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw361) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 363/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, deadliner, http.Pusher +type rw362 rwState + +func (w *rw362) Unwrap() http.ResponseWriter { return w.w } +func (w *rw362) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw362) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw362) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw362) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw362) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw362) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw362) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw362) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw362) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 364/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, deadliner, http.Pusher, io.StringWriter +type rw363 rwState + +func (w *rw363) Unwrap() http.ResponseWriter { return w.w } +func (w *rw363) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw363) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw363) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw363) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw363) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw363) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw363) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw363) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw363) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw363) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 365/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler +type rw364 rwState + +func (w *rw364) Unwrap() http.ResponseWriter { return w.w } +func (w *rw364) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw364) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw364) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw364) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw364) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw364) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw364) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw364) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw364) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 366/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler, io.StringWriter +type rw365 rwState + +func (w *rw365) Unwrap() http.ResponseWriter { return w.w } +func (w *rw365) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw365) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw365) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw365) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw365) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw365) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw365) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw365) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw365) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw365) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 367/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher +type rw366 rwState + +func (w *rw366) Unwrap() http.ResponseWriter { return w.w } +func (w *rw366) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw366) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw366) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw366) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw366) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw366) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw366) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw366) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw366) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw366) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 368/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw367 rwState + +func (w *rw367) Unwrap() http.ResponseWriter { return w.w } +func (w *rw367) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw367) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw367) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw367) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw367) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw367) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw367) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw367) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw367) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw367) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw367) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 369/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom +type rw368 rwState + +func (w *rw368) Unwrap() http.ResponseWriter { return w.w } +func (w *rw368) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw368) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw368) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw368) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw368) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw368) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw368) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 370/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, io.StringWriter +type rw369 rwState + +func (w *rw369) Unwrap() http.ResponseWriter { return w.w } +func (w *rw369) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw369) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw369) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw369) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw369) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw369) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw369) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw369) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 371/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, http.Pusher +type rw370 rwState + +func (w *rw370) Unwrap() http.ResponseWriter { return w.w } +func (w *rw370) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw370) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw370) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw370) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw370) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw370) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw370) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw370) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 372/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, http.Pusher, io.StringWriter +type rw371 rwState + +func (w *rw371) Unwrap() http.ResponseWriter { return w.w } +func (w *rw371) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw371) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw371) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw371) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw371) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw371) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw371) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw371) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw371) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 373/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler +type rw372 rwState + +func (w *rw372) Unwrap() http.ResponseWriter { return w.w } +func (w *rw372) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw372) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw372) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw372) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw372) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw372) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw372) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw372) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 374/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw373 rwState + +func (w *rw373) Unwrap() http.ResponseWriter { return w.w } +func (w *rw373) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw373) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw373) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw373) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw373) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw373) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw373) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw373) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw373) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 375/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw374 rwState + +func (w *rw374) Unwrap() http.ResponseWriter { return w.w } +func (w *rw374) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw374) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw374) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw374) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw374) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw374) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw374) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw374) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw374) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 376/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw375 rwState + +func (w *rw375) Unwrap() http.ResponseWriter { return w.w } +func (w *rw375) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw375) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw375) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw375) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw375) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw375) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw375) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw375) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw375) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw375) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 377/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner +type rw376 rwState + +func (w *rw376) Unwrap() http.ResponseWriter { return w.w } +func (w *rw376) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw376) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw376) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw376) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw376) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw376) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw376) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw376) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw376) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 378/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, io.StringWriter +type rw377 rwState + +func (w *rw377) Unwrap() http.ResponseWriter { return w.w } +func (w *rw377) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw377) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw377) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw377) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw377) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw377) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw377) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw377) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw377) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw377) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 379/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher +type rw378 rwState + +func (w *rw378) Unwrap() http.ResponseWriter { return w.w } +func (w *rw378) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw378) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw378) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw378) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw378) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw378) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw378) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw378) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw378) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw378) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 380/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw379 rwState + +func (w *rw379) Unwrap() http.ResponseWriter { return w.w } +func (w *rw379) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw379) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw379) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw379) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw379) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw379) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw379) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw379) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw379) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw379) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw379) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 381/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw380 rwState + +func (w *rw380) Unwrap() http.ResponseWriter { return w.w } +func (w *rw380) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw380) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw380) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw380) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw380) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw380) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw380) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw380) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw380) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw380) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 382/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw381 rwState + +func (w *rw381) Unwrap() http.ResponseWriter { return w.w } +func (w *rw381) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw381) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw381) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw381) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw381) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw381) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw381) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw381) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw381) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw381) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw381) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 383/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw382 rwState + +func (w *rw382) Unwrap() http.ResponseWriter { return w.w } +func (w *rw382) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw382) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw382) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw382) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw382) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw382) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw382) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw382) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw382) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw382) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw382) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 384/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw383 rwState + +func (w *rw383) Unwrap() http.ResponseWriter { return w.w } +func (w *rw383) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw383) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw383) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw383) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw383) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw383) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw383) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw383) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw383) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw383) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw383) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw383) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 385/512: http.ResponseWriter, http.Flusher, httpFlushError +type rw384 rwState + +func (w *rw384) Unwrap() http.ResponseWriter { return w.w } +func (w *rw384) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw384) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw384) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw384) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw384) FlushError() error { + return (*rwState)(w).doFlushError() +} + +// combination 386/512: http.ResponseWriter, http.Flusher, httpFlushError, io.StringWriter +type rw385 rwState + +func (w *rw385) Unwrap() http.ResponseWriter { return w.w } +func (w *rw385) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw385) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw385) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw385) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw385) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw385) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 387/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Pusher +type rw386 rwState + +func (w *rw386) Unwrap() http.ResponseWriter { return w.w } +func (w *rw386) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw386) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw386) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw386) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw386) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw386) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 388/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Pusher, io.StringWriter +type rw387 rwState + +func (w *rw387) Unwrap() http.ResponseWriter { return w.w } +func (w *rw387) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw387) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw387) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw387) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw387) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw387) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw387) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 389/512: http.ResponseWriter, http.Flusher, httpFlushError, fullDuplexEnabler +type rw388 rwState + +func (w *rw388) Unwrap() http.ResponseWriter { return w.w } +func (w *rw388) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw388) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw388) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw388) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw388) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw388) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 390/512: http.ResponseWriter, http.Flusher, httpFlushError, fullDuplexEnabler, io.StringWriter +type rw389 rwState + +func (w *rw389) Unwrap() http.ResponseWriter { return w.w } +func (w *rw389) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw389) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw389) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw389) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw389) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw389) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw389) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 391/512: http.ResponseWriter, http.Flusher, httpFlushError, fullDuplexEnabler, http.Pusher +type rw390 rwState + +func (w *rw390) Unwrap() http.ResponseWriter { return w.w } +func (w *rw390) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw390) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw390) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw390) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw390) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw390) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw390) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 392/512: http.ResponseWriter, http.Flusher, httpFlushError, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw391 rwState + +func (w *rw391) Unwrap() http.ResponseWriter { return w.w } +func (w *rw391) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw391) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw391) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw391) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw391) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw391) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw391) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw391) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 393/512: http.ResponseWriter, http.Flusher, httpFlushError, deadliner +type rw392 rwState + +func (w *rw392) Unwrap() http.ResponseWriter { return w.w } +func (w *rw392) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw392) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw392) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw392) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw392) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw392) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw392) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 394/512: http.ResponseWriter, http.Flusher, httpFlushError, deadliner, io.StringWriter +type rw393 rwState + +func (w *rw393) Unwrap() http.ResponseWriter { return w.w } +func (w *rw393) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw393) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw393) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw393) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw393) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw393) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw393) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw393) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 395/512: http.ResponseWriter, http.Flusher, httpFlushError, deadliner, http.Pusher +type rw394 rwState + +func (w *rw394) Unwrap() http.ResponseWriter { return w.w } +func (w *rw394) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw394) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw394) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw394) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw394) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw394) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw394) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw394) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 396/512: http.ResponseWriter, http.Flusher, httpFlushError, deadliner, http.Pusher, io.StringWriter +type rw395 rwState + +func (w *rw395) Unwrap() http.ResponseWriter { return w.w } +func (w *rw395) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw395) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw395) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw395) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw395) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw395) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw395) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw395) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw395) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 397/512: http.ResponseWriter, http.Flusher, httpFlushError, deadliner, fullDuplexEnabler +type rw396 rwState + +func (w *rw396) Unwrap() http.ResponseWriter { return w.w } +func (w *rw396) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw396) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw396) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw396) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw396) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw396) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw396) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw396) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 398/512: http.ResponseWriter, http.Flusher, httpFlushError, deadliner, fullDuplexEnabler, io.StringWriter +type rw397 rwState + +func (w *rw397) Unwrap() http.ResponseWriter { return w.w } +func (w *rw397) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw397) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw397) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw397) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw397) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw397) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw397) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw397) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw397) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 399/512: http.ResponseWriter, http.Flusher, httpFlushError, deadliner, fullDuplexEnabler, http.Pusher +type rw398 rwState + +func (w *rw398) Unwrap() http.ResponseWriter { return w.w } +func (w *rw398) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw398) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw398) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw398) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw398) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw398) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw398) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw398) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw398) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 400/512: http.ResponseWriter, http.Flusher, httpFlushError, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw399 rwState + +func (w *rw399) Unwrap() http.ResponseWriter { return w.w } +func (w *rw399) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw399) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw399) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw399) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw399) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw399) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw399) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw399) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw399) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw399) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 401/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom +type rw400 rwState + +func (w *rw400) Unwrap() http.ResponseWriter { return w.w } +func (w *rw400) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw400) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw400) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw400) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw400) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw400) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 402/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, io.StringWriter +type rw401 rwState + +func (w *rw401) Unwrap() http.ResponseWriter { return w.w } +func (w *rw401) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw401) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw401) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw401) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw401) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw401) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw401) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 403/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, http.Pusher +type rw402 rwState + +func (w *rw402) Unwrap() http.ResponseWriter { return w.w } +func (w *rw402) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw402) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw402) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw402) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw402) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw402) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw402) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 404/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, http.Pusher, io.StringWriter +type rw403 rwState + +func (w *rw403) Unwrap() http.ResponseWriter { return w.w } +func (w *rw403) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw403) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw403) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw403) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw403) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw403) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw403) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw403) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 405/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, fullDuplexEnabler +type rw404 rwState + +func (w *rw404) Unwrap() http.ResponseWriter { return w.w } +func (w *rw404) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw404) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw404) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw404) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw404) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw404) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw404) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 406/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw405 rwState + +func (w *rw405) Unwrap() http.ResponseWriter { return w.w } +func (w *rw405) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw405) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw405) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw405) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw405) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw405) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw405) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw405) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 407/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw406 rwState + +func (w *rw406) Unwrap() http.ResponseWriter { return w.w } +func (w *rw406) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw406) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw406) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw406) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw406) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw406) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw406) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw406) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 408/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw407 rwState + +func (w *rw407) Unwrap() http.ResponseWriter { return w.w } +func (w *rw407) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw407) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw407) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw407) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw407) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw407) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw407) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw407) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw407) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 409/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, deadliner +type rw408 rwState + +func (w *rw408) Unwrap() http.ResponseWriter { return w.w } +func (w *rw408) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw408) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw408) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw408) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw408) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw408) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw408) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw408) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 410/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, deadliner, io.StringWriter +type rw409 rwState + +func (w *rw409) Unwrap() http.ResponseWriter { return w.w } +func (w *rw409) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw409) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw409) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw409) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw409) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw409) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw409) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw409) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw409) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 411/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, deadliner, http.Pusher +type rw410 rwState + +func (w *rw410) Unwrap() http.ResponseWriter { return w.w } +func (w *rw410) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw410) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw410) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw410) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw410) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw410) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw410) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw410) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw410) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 412/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw411 rwState + +func (w *rw411) Unwrap() http.ResponseWriter { return w.w } +func (w *rw411) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw411) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw411) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw411) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw411) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw411) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw411) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw411) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw411) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw411) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 413/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw412 rwState + +func (w *rw412) Unwrap() http.ResponseWriter { return w.w } +func (w *rw412) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw412) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw412) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw412) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw412) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw412) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw412) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw412) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw412) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 414/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw413 rwState + +func (w *rw413) Unwrap() http.ResponseWriter { return w.w } +func (w *rw413) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw413) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw413) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw413) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw413) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw413) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw413) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw413) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw413) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw413) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 415/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw414 rwState + +func (w *rw414) Unwrap() http.ResponseWriter { return w.w } +func (w *rw414) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw414) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw414) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw414) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw414) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw414) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw414) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw414) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw414) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw414) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 416/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw415 rwState + +func (w *rw415) Unwrap() http.ResponseWriter { return w.w } +func (w *rw415) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw415) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw415) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw415) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw415) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw415) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw415) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw415) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw415) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw415) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw415) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 417/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker +type rw416 rwState + +func (w *rw416) Unwrap() http.ResponseWriter { return w.w } +func (w *rw416) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw416) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw416) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw416) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw416) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw416) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} + +// combination 418/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.StringWriter +type rw417 rwState + +func (w *rw417) Unwrap() http.ResponseWriter { return w.w } +func (w *rw417) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw417) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw417) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw417) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw417) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw417) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw417) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 419/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, http.Pusher +type rw418 rwState + +func (w *rw418) Unwrap() http.ResponseWriter { return w.w } +func (w *rw418) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw418) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw418) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw418) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw418) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw418) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw418) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 420/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, http.Pusher, io.StringWriter +type rw419 rwState + +func (w *rw419) Unwrap() http.ResponseWriter { return w.w } +func (w *rw419) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw419) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw419) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw419) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw419) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw419) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw419) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw419) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 421/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, fullDuplexEnabler +type rw420 rwState + +func (w *rw420) Unwrap() http.ResponseWriter { return w.w } +func (w *rw420) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw420) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw420) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw420) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw420) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw420) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw420) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 422/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, fullDuplexEnabler, io.StringWriter +type rw421 rwState + +func (w *rw421) Unwrap() http.ResponseWriter { return w.w } +func (w *rw421) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw421) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw421) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw421) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw421) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw421) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw421) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw421) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 423/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, fullDuplexEnabler, http.Pusher +type rw422 rwState + +func (w *rw422) Unwrap() http.ResponseWriter { return w.w } +func (w *rw422) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw422) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw422) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw422) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw422) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw422) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw422) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw422) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 424/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw423 rwState + +func (w *rw423) Unwrap() http.ResponseWriter { return w.w } +func (w *rw423) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw423) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw423) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw423) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw423) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw423) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw423) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw423) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw423) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 425/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, deadliner +type rw424 rwState + +func (w *rw424) Unwrap() http.ResponseWriter { return w.w } +func (w *rw424) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw424) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw424) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw424) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw424) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw424) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw424) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw424) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 426/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, deadliner, io.StringWriter +type rw425 rwState + +func (w *rw425) Unwrap() http.ResponseWriter { return w.w } +func (w *rw425) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw425) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw425) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw425) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw425) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw425) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw425) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw425) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw425) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 427/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, deadliner, http.Pusher +type rw426 rwState + +func (w *rw426) Unwrap() http.ResponseWriter { return w.w } +func (w *rw426) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw426) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw426) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw426) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw426) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw426) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw426) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw426) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw426) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 428/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, deadliner, http.Pusher, io.StringWriter +type rw427 rwState + +func (w *rw427) Unwrap() http.ResponseWriter { return w.w } +func (w *rw427) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw427) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw427) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw427) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw427) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw427) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw427) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw427) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw427) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw427) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 429/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, deadliner, fullDuplexEnabler +type rw428 rwState + +func (w *rw428) Unwrap() http.ResponseWriter { return w.w } +func (w *rw428) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw428) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw428) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw428) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw428) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw428) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw428) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw428) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw428) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 430/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, deadliner, fullDuplexEnabler, io.StringWriter +type rw429 rwState + +func (w *rw429) Unwrap() http.ResponseWriter { return w.w } +func (w *rw429) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw429) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw429) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw429) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw429) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw429) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw429) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw429) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw429) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw429) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 431/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher +type rw430 rwState + +func (w *rw430) Unwrap() http.ResponseWriter { return w.w } +func (w *rw430) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw430) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw430) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw430) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw430) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw430) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw430) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw430) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw430) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw430) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 432/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw431 rwState + +func (w *rw431) Unwrap() http.ResponseWriter { return w.w } +func (w *rw431) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw431) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw431) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw431) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw431) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw431) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw431) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw431) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw431) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw431) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw431) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 433/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom +type rw432 rwState + +func (w *rw432) Unwrap() http.ResponseWriter { return w.w } +func (w *rw432) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw432) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw432) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw432) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw432) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw432) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw432) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 434/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, io.StringWriter +type rw433 rwState + +func (w *rw433) Unwrap() http.ResponseWriter { return w.w } +func (w *rw433) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw433) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw433) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw433) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw433) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw433) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw433) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw433) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 435/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, http.Pusher +type rw434 rwState + +func (w *rw434) Unwrap() http.ResponseWriter { return w.w } +func (w *rw434) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw434) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw434) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw434) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw434) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw434) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw434) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw434) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 436/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, http.Pusher, io.StringWriter +type rw435 rwState + +func (w *rw435) Unwrap() http.ResponseWriter { return w.w } +func (w *rw435) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw435) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw435) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw435) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw435) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw435) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw435) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw435) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw435) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 437/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, fullDuplexEnabler +type rw436 rwState + +func (w *rw436) Unwrap() http.ResponseWriter { return w.w } +func (w *rw436) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw436) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw436) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw436) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw436) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw436) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw436) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw436) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 438/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw437 rwState + +func (w *rw437) Unwrap() http.ResponseWriter { return w.w } +func (w *rw437) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw437) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw437) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw437) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw437) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw437) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw437) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw437) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw437) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 439/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw438 rwState + +func (w *rw438) Unwrap() http.ResponseWriter { return w.w } +func (w *rw438) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw438) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw438) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw438) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw438) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw438) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw438) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw438) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw438) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 440/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw439 rwState + +func (w *rw439) Unwrap() http.ResponseWriter { return w.w } +func (w *rw439) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw439) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw439) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw439) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw439) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw439) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw439) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw439) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw439) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw439) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 441/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner +type rw440 rwState + +func (w *rw440) Unwrap() http.ResponseWriter { return w.w } +func (w *rw440) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw440) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw440) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw440) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw440) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw440) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw440) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw440) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw440) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 442/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner, io.StringWriter +type rw441 rwState + +func (w *rw441) Unwrap() http.ResponseWriter { return w.w } +func (w *rw441) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw441) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw441) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw441) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw441) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw441) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw441) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw441) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw441) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw441) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 443/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher +type rw442 rwState + +func (w *rw442) Unwrap() http.ResponseWriter { return w.w } +func (w *rw442) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw442) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw442) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw442) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw442) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw442) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw442) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw442) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw442) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw442) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 444/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw443 rwState + +func (w *rw443) Unwrap() http.ResponseWriter { return w.w } +func (w *rw443) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw443) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw443) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw443) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw443) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw443) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw443) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw443) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw443) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw443) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw443) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 445/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw444 rwState + +func (w *rw444) Unwrap() http.ResponseWriter { return w.w } +func (w *rw444) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw444) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw444) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw444) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw444) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw444) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw444) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw444) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw444) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw444) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 446/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw445 rwState + +func (w *rw445) Unwrap() http.ResponseWriter { return w.w } +func (w *rw445) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw445) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw445) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw445) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw445) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw445) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw445) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw445) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw445) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw445) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw445) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 447/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw446 rwState + +func (w *rw446) Unwrap() http.ResponseWriter { return w.w } +func (w *rw446) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw446) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw446) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw446) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw446) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw446) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw446) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw446) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw446) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw446) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw446) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 448/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw447 rwState + +func (w *rw447) Unwrap() http.ResponseWriter { return w.w } +func (w *rw447) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw447) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw447) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw447) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw447) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw447) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw447) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw447) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw447) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw447) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw447) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw447) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 449/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier +type rw448 rwState + +func (w *rw448) Unwrap() http.ResponseWriter { return w.w } +func (w *rw448) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw448) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw448) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw448) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw448) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw448) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} + +// combination 450/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.StringWriter +type rw449 rwState + +func (w *rw449) Unwrap() http.ResponseWriter { return w.w } +func (w *rw449) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw449) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw449) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw449) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw449) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw449) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw449) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 451/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Pusher +type rw450 rwState + +func (w *rw450) Unwrap() http.ResponseWriter { return w.w } +func (w *rw450) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw450) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw450) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw450) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw450) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw450) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw450) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 452/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Pusher, io.StringWriter +type rw451 rwState + +func (w *rw451) Unwrap() http.ResponseWriter { return w.w } +func (w *rw451) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw451) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw451) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw451) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw451) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw451) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw451) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw451) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 453/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, fullDuplexEnabler +type rw452 rwState + +func (w *rw452) Unwrap() http.ResponseWriter { return w.w } +func (w *rw452) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw452) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw452) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw452) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw452) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw452) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw452) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 454/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, fullDuplexEnabler, io.StringWriter +type rw453 rwState + +func (w *rw453) Unwrap() http.ResponseWriter { return w.w } +func (w *rw453) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw453) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw453) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw453) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw453) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw453) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw453) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw453) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 455/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, fullDuplexEnabler, http.Pusher +type rw454 rwState + +func (w *rw454) Unwrap() http.ResponseWriter { return w.w } +func (w *rw454) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw454) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw454) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw454) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw454) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw454) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw454) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw454) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 456/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw455 rwState + +func (w *rw455) Unwrap() http.ResponseWriter { return w.w } +func (w *rw455) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw455) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw455) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw455) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw455) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw455) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw455) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw455) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw455) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 457/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, deadliner +type rw456 rwState + +func (w *rw456) Unwrap() http.ResponseWriter { return w.w } +func (w *rw456) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw456) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw456) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw456) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw456) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw456) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw456) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw456) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 458/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, deadliner, io.StringWriter +type rw457 rwState + +func (w *rw457) Unwrap() http.ResponseWriter { return w.w } +func (w *rw457) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw457) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw457) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw457) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw457) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw457) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw457) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw457) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw457) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 459/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, deadliner, http.Pusher +type rw458 rwState + +func (w *rw458) Unwrap() http.ResponseWriter { return w.w } +func (w *rw458) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw458) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw458) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw458) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw458) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw458) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw458) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw458) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw458) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 460/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, deadliner, http.Pusher, io.StringWriter +type rw459 rwState + +func (w *rw459) Unwrap() http.ResponseWriter { return w.w } +func (w *rw459) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw459) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw459) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw459) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw459) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw459) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw459) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw459) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw459) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw459) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 461/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, deadliner, fullDuplexEnabler +type rw460 rwState + +func (w *rw460) Unwrap() http.ResponseWriter { return w.w } +func (w *rw460) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw460) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw460) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw460) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw460) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw460) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw460) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw460) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw460) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 462/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, deadliner, fullDuplexEnabler, io.StringWriter +type rw461 rwState + +func (w *rw461) Unwrap() http.ResponseWriter { return w.w } +func (w *rw461) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw461) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw461) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw461) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw461) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw461) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw461) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw461) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw461) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw461) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 463/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, deadliner, fullDuplexEnabler, http.Pusher +type rw462 rwState + +func (w *rw462) Unwrap() http.ResponseWriter { return w.w } +func (w *rw462) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw462) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw462) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw462) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw462) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw462) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw462) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw462) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw462) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw462) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 464/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw463 rwState + +func (w *rw463) Unwrap() http.ResponseWriter { return w.w } +func (w *rw463) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw463) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw463) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw463) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw463) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw463) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw463) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw463) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw463) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw463) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw463) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 465/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom +type rw464 rwState + +func (w *rw464) Unwrap() http.ResponseWriter { return w.w } +func (w *rw464) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw464) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw464) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw464) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw464) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw464) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw464) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 466/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, io.StringWriter +type rw465 rwState + +func (w *rw465) Unwrap() http.ResponseWriter { return w.w } +func (w *rw465) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw465) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw465) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw465) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw465) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw465) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw465) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw465) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 467/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, http.Pusher +type rw466 rwState + +func (w *rw466) Unwrap() http.ResponseWriter { return w.w } +func (w *rw466) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw466) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw466) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw466) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw466) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw466) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw466) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw466) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 468/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, http.Pusher, io.StringWriter +type rw467 rwState + +func (w *rw467) Unwrap() http.ResponseWriter { return w.w } +func (w *rw467) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw467) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw467) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw467) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw467) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw467) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw467) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw467) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw467) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 469/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler +type rw468 rwState + +func (w *rw468) Unwrap() http.ResponseWriter { return w.w } +func (w *rw468) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw468) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw468) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw468) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw468) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw468) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw468) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw468) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 470/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw469 rwState + +func (w *rw469) Unwrap() http.ResponseWriter { return w.w } +func (w *rw469) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw469) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw469) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw469) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw469) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw469) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw469) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw469) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw469) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 471/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw470 rwState + +func (w *rw470) Unwrap() http.ResponseWriter { return w.w } +func (w *rw470) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw470) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw470) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw470) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw470) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw470) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw470) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw470) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw470) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 472/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw471 rwState + +func (w *rw471) Unwrap() http.ResponseWriter { return w.w } +func (w *rw471) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw471) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw471) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw471) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw471) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw471) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw471) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw471) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw471) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw471) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 473/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner +type rw472 rwState + +func (w *rw472) Unwrap() http.ResponseWriter { return w.w } +func (w *rw472) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw472) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw472) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw472) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw472) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw472) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw472) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw472) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw472) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 474/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner, io.StringWriter +type rw473 rwState + +func (w *rw473) Unwrap() http.ResponseWriter { return w.w } +func (w *rw473) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw473) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw473) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw473) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw473) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw473) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw473) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw473) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw473) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw473) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 475/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner, http.Pusher +type rw474 rwState + +func (w *rw474) Unwrap() http.ResponseWriter { return w.w } +func (w *rw474) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw474) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw474) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw474) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw474) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw474) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw474) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw474) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw474) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw474) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 476/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw475 rwState + +func (w *rw475) Unwrap() http.ResponseWriter { return w.w } +func (w *rw475) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw475) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw475) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw475) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw475) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw475) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw475) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw475) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw475) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw475) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw475) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 477/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw476 rwState + +func (w *rw476) Unwrap() http.ResponseWriter { return w.w } +func (w *rw476) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw476) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw476) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw476) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw476) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw476) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw476) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw476) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw476) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw476) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 478/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw477 rwState + +func (w *rw477) Unwrap() http.ResponseWriter { return w.w } +func (w *rw477) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw477) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw477) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw477) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw477) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw477) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw477) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw477) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw477) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw477) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw477) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 479/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw478 rwState + +func (w *rw478) Unwrap() http.ResponseWriter { return w.w } +func (w *rw478) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw478) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw478) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw478) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw478) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw478) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw478) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw478) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw478) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw478) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw478) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 480/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw479 rwState + +func (w *rw479) Unwrap() http.ResponseWriter { return w.w } +func (w *rw479) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw479) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw479) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw479) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw479) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw479) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw479) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw479) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw479) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw479) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw479) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw479) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 481/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker +type rw480 rwState + +func (w *rw480) Unwrap() http.ResponseWriter { return w.w } +func (w *rw480) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw480) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw480) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw480) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw480) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw480) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw480) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} + +// combination 482/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.StringWriter +type rw481 rwState + +func (w *rw481) Unwrap() http.ResponseWriter { return w.w } +func (w *rw481) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw481) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw481) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw481) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw481) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw481) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw481) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw481) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 483/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, http.Pusher +type rw482 rwState + +func (w *rw482) Unwrap() http.ResponseWriter { return w.w } +func (w *rw482) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw482) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw482) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw482) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw482) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw482) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw482) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw482) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 484/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, http.Pusher, io.StringWriter +type rw483 rwState + +func (w *rw483) Unwrap() http.ResponseWriter { return w.w } +func (w *rw483) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw483) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw483) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw483) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw483) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw483) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw483) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw483) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw483) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 485/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, fullDuplexEnabler +type rw484 rwState + +func (w *rw484) Unwrap() http.ResponseWriter { return w.w } +func (w *rw484) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw484) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw484) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw484) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw484) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw484) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw484) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw484) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 486/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, fullDuplexEnabler, io.StringWriter +type rw485 rwState + +func (w *rw485) Unwrap() http.ResponseWriter { return w.w } +func (w *rw485) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw485) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw485) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw485) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw485) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw485) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw485) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw485) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw485) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 487/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, fullDuplexEnabler, http.Pusher +type rw486 rwState + +func (w *rw486) Unwrap() http.ResponseWriter { return w.w } +func (w *rw486) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw486) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw486) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw486) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw486) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw486) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw486) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw486) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw486) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 488/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw487 rwState + +func (w *rw487) Unwrap() http.ResponseWriter { return w.w } +func (w *rw487) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw487) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw487) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw487) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw487) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw487) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw487) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw487) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw487) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw487) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 489/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner +type rw488 rwState + +func (w *rw488) Unwrap() http.ResponseWriter { return w.w } +func (w *rw488) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw488) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw488) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw488) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw488) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw488) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw488) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw488) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw488) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 490/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner, io.StringWriter +type rw489 rwState + +func (w *rw489) Unwrap() http.ResponseWriter { return w.w } +func (w *rw489) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw489) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw489) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw489) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw489) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw489) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw489) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw489) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw489) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw489) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 491/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner, http.Pusher +type rw490 rwState + +func (w *rw490) Unwrap() http.ResponseWriter { return w.w } +func (w *rw490) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw490) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw490) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw490) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw490) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw490) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw490) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw490) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw490) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw490) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 492/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner, http.Pusher, io.StringWriter +type rw491 rwState + +func (w *rw491) Unwrap() http.ResponseWriter { return w.w } +func (w *rw491) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw491) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw491) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw491) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw491) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw491) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw491) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw491) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw491) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw491) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw491) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 493/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler +type rw492 rwState + +func (w *rw492) Unwrap() http.ResponseWriter { return w.w } +func (w *rw492) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw492) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw492) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw492) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw492) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw492) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw492) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw492) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw492) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw492) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 494/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler, io.StringWriter +type rw493 rwState + +func (w *rw493) Unwrap() http.ResponseWriter { return w.w } +func (w *rw493) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw493) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw493) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw493) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw493) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw493) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw493) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw493) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw493) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw493) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw493) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 495/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher +type rw494 rwState + +func (w *rw494) Unwrap() http.ResponseWriter { return w.w } +func (w *rw494) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw494) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw494) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw494) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw494) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw494) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw494) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw494) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw494) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw494) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw494) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 496/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw495 rwState + +func (w *rw495) Unwrap() http.ResponseWriter { return w.w } +func (w *rw495) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw495) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw495) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw495) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw495) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw495) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw495) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw495) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw495) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw495) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw495) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw495) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 497/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom +type rw496 rwState + +func (w *rw496) Unwrap() http.ResponseWriter { return w.w } +func (w *rw496) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw496) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw496) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw496) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw496) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw496) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw496) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw496) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 498/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, io.StringWriter +type rw497 rwState + +func (w *rw497) Unwrap() http.ResponseWriter { return w.w } +func (w *rw497) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw497) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw497) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw497) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw497) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw497) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw497) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw497) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw497) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 499/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, http.Pusher +type rw498 rwState + +func (w *rw498) Unwrap() http.ResponseWriter { return w.w } +func (w *rw498) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw498) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw498) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw498) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw498) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw498) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw498) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw498) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw498) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 500/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, http.Pusher, io.StringWriter +type rw499 rwState + +func (w *rw499) Unwrap() http.ResponseWriter { return w.w } +func (w *rw499) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw499) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw499) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw499) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw499) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw499) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw499) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw499) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw499) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw499) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 501/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler +type rw500 rwState + +func (w *rw500) Unwrap() http.ResponseWriter { return w.w } +func (w *rw500) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw500) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw500) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw500) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw500) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw500) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw500) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw500) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw500) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 502/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw501 rwState + +func (w *rw501) Unwrap() http.ResponseWriter { return w.w } +func (w *rw501) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw501) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw501) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw501) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw501) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw501) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw501) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw501) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw501) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw501) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 503/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw502 rwState + +func (w *rw502) Unwrap() http.ResponseWriter { return w.w } +func (w *rw502) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw502) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw502) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw502) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw502) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw502) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw502) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw502) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw502) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw502) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 504/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw503 rwState + +func (w *rw503) Unwrap() http.ResponseWriter { return w.w } +func (w *rw503) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw503) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw503) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw503) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw503) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw503) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw503) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw503) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw503) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw503) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw503) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 505/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner +type rw504 rwState + +func (w *rw504) Unwrap() http.ResponseWriter { return w.w } +func (w *rw504) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw504) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw504) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw504) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw504) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw504) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw504) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw504) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw504) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw504) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 506/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, io.StringWriter +type rw505 rwState + +func (w *rw505) Unwrap() http.ResponseWriter { return w.w } +func (w *rw505) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw505) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw505) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw505) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw505) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw505) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw505) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw505) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw505) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw505) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw505) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 507/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher +type rw506 rwState + +func (w *rw506) Unwrap() http.ResponseWriter { return w.w } +func (w *rw506) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw506) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw506) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw506) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw506) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw506) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw506) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw506) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw506) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw506) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw506) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 508/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw507 rwState + +func (w *rw507) Unwrap() http.ResponseWriter { return w.w } +func (w *rw507) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw507) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw507) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw507) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw507) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw507) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw507) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw507) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw507) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw507) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw507) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw507) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 509/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw508 rwState + +func (w *rw508) Unwrap() http.ResponseWriter { return w.w } +func (w *rw508) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw508) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw508) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw508) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw508) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw508) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw508) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw508) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw508) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw508) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw508) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 510/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw509 rwState + +func (w *rw509) Unwrap() http.ResponseWriter { return w.w } +func (w *rw509) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw509) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw509) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw509) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw509) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw509) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw509) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw509) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw509) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw509) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw509) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw509) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 511/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw510 rwState + +func (w *rw510) Unwrap() http.ResponseWriter { return w.w } +func (w *rw510) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw510) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw510) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw510) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw510) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw510) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw510) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw510) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw510) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw510) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw510) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw510) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 512/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw511 rwState + +func (w *rw511) Unwrap() http.ResponseWriter { return w.w } +func (w *rw511) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw511) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw511) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw511) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw511) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw511) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw511) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw511) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw511) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw511) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw511) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw511) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw511) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +type Unwrapper interface { + Unwrap() http.ResponseWriter +} + +// Unwrap returns the underlying http.ResponseWriter from within zero or more +// layers of httpsnoop wrappers. +func Unwrap(w http.ResponseWriter) http.ResponseWriter { + if rw, ok := w.(Unwrapper); ok { + // recurse until rw.Unwrap() returns a non-Unwrapper + return Unwrap(rw.Unwrap()) + } + return w +} diff --git a/vendor/github.com/go-openapi/errors/CONTRIBUTORS.md b/vendor/github.com/go-openapi/errors/CONTRIBUTORS.md index 68b716b5688..94064c3f7fe 100644 --- a/vendor/github.com/go-openapi/errors/CONTRIBUTORS.md +++ b/vendor/github.com/go-openapi/errors/CONTRIBUTORS.md @@ -4,12 +4,12 @@ | Total Contributors | Total Contributions | | --- | --- | -| 13 | 115 | +| 13 | 121 | | Username | All Time Contribution Count | All Commits | | --- | --- | --- | | @casualjim | 58 | | -| @fredbi | 41 | | +| @fredbi | 47 | | | @youyuanwu | 5 | | | @alexandear | 2 | | | @fiorix | 1 | | diff --git a/vendor/github.com/go-openapi/errors/README.md b/vendor/github.com/go-openapi/errors/README.md index 35e6b69ba82..db87dfde1cc 100644 --- a/vendor/github.com/go-openapi/errors/README.md +++ b/vendor/github.com/go-openapi/errors/README.md @@ -5,7 +5,7 @@ -[![Release][release-badge]][release-url] [![Go Report Card][gocard-badge]][gocard-url] [![CodeFactor Grade][codefactor-badge]][codefactor-url] [![License][license-badge]][license-url] +[![Release][release-badge]][release-url] [![CodeFactor Grade][codefactor-badge]][codefactor-url] [![License][license-badge]][license-url] [![GoDoc][godoc-badge]][godoc-url] [![Discord Channel][discord-badge]][discord-url] [![go version][goversion-badge]][goversion-url] ![Top language][top-badge] ![Commits since latest release][commits-badge] @@ -18,12 +18,9 @@ Shared errors and error interface used throughout the various libraries found in * **2025-12-19** : new community chat on discord * a new discord community channel is available to be notified of changes and support users - * our venerable Slack channel remains open, and will be eventually discontinued on **2026-03-31** You may join the discord community by clicking the invite link on the discord badge (also above). [![Discord Channel][discord-badge]][discord-url] -Or join our Slack channel: [![Slack Channel][slack-logo]![slack-badge]][slack-url] - ## Status API is stable. @@ -69,9 +66,9 @@ This library ships under the [SPDX-License-Identifier: Apache-2.0](./LICENSE). ## Other documentation * [All-time contributors](./CONTRIBUTORS.md) -* [Contributing guidelines](.github/CONTRIBUTING.md) -* [Maintainers documentation](docs/MAINTAINERS.md) -* [Code style](docs/STYLE.md) +* [Contributing guidelines][contributing-doc-site] +* [Maintainers documentation][maintainers-doc-site] +* [Code style][style-doc-site] ## Cutting a new release @@ -95,16 +92,11 @@ Maintainers can cut a new release by either: [release-badge]: https://badge.fury.io/gh/go-openapi%2Ferrors.svg [release-url]: https://badge.fury.io/gh/go-openapi%2Ferrors -[gocard-badge]: https://goreportcard.com/badge/github.com/go-openapi/errors -[gocard-url]: https://goreportcard.com/report/github.com/go-openapi/errors [codefactor-badge]: https://img.shields.io/codefactor/grade/github/go-openapi/errors [codefactor-url]: https://www.codefactor.io/repository/github/go-openapi/errors [godoc-badge]: https://pkg.go.dev/badge/github.com/go-openapi/errors [godoc-url]: http://pkg.go.dev/github.com/go-openapi/errors -[slack-logo]: https://a.slack-edge.com/e6a93c1/img/icons/favicon-32.png -[slack-badge]: https://img.shields.io/badge/slack-blue?link=https%3A%2F%2Fgoswagger.slack.com%2Farchives%2FC04R30YM -[slack-url]: https://goswagger.slack.com/archives/C04R30YMU [discord-badge]: https://img.shields.io/discord/1446918742398341256?logo=discord&label=discord&color=blue [discord-url]: https://discord.gg/FfnFYaC3k5 @@ -116,3 +108,7 @@ Maintainers can cut a new release by either: [goversion-url]: https://github.com/go-openapi/errors/blob/master/go.mod [top-badge]: https://img.shields.io/github/languages/top/go-openapi/errors [commits-badge]: https://img.shields.io/github/commits-since/go-openapi/errors/latest + +[contributing-doc-site]: https://go-openapi.github.io/doc-site/contributing/contributing/index.html +[maintainers-doc-site]: https://go-openapi.github.io/doc-site/maintainers/index.html +[style-doc-site]: https://go-openapi.github.io/doc-site/contributing/style/index.html diff --git a/vendor/github.com/go-openapi/strfmt/.golangci.yml b/vendor/github.com/go-openapi/strfmt/.golangci.yml index 31480c7138a..ce7a6ae47c4 100644 --- a/vendor/github.com/go-openapi/strfmt/.golangci.yml +++ b/vendor/github.com/go-openapi/strfmt/.golangci.yml @@ -10,6 +10,7 @@ linters: - gomodguard_v2 - godox - exhaustruct + - exhaustruct_v5 - nlreturn - nonamedreturns - noinlineerr diff --git a/vendor/github.com/go-openapi/strfmt/CONTRIBUTORS.md b/vendor/github.com/go-openapi/strfmt/CONTRIBUTORS.md index fa17ff3111c..fe4ed18f60b 100644 --- a/vendor/github.com/go-openapi/strfmt/CONTRIBUTORS.md +++ b/vendor/github.com/go-openapi/strfmt/CONTRIBUTORS.md @@ -4,12 +4,12 @@ | Total Contributors | Total Contributions | | --- | --- | -| 41 | 243 | +| 41 | 256 | | Username | All Time Contribution Count | All Commits | | --- | --- | --- | | @casualjim | 88 | | -| @fredbi | 74 | | +| @fredbi | 87 | | | @youyuanwu | 13 | | | @jlambatl | 9 | | | @GlenDC | 5 | | diff --git a/vendor/github.com/go-openapi/strfmt/README.md b/vendor/github.com/go-openapi/strfmt/README.md index 15ee0e5826d..939fba7d291 100644 --- a/vendor/github.com/go-openapi/strfmt/README.md +++ b/vendor/github.com/go-openapi/strfmt/README.md @@ -5,7 +5,7 @@ -[![Release][release-badge]][release-url] [![Go Report Card][gocard-badge]][gocard-url] [![CodeFactor Grade][codefactor-badge]][codefactor-url] [![License][license-badge]][license-url] +[![Release][release-badge]][release-url] [![CodeFactor Grade][codefactor-badge]][codefactor-url] [![License][license-badge]][license-url] [![GoDoc][godoc-badge]][godoc-url] [![Discord Channel][discord-badge]][discord-url] [![go version][goversion-badge]][goversion-url] ![Top language][top-badge] ![Commits since latest release][commits-badge] @@ -213,8 +213,6 @@ Maintainers can cut a new release by either: [gomod-badge]: https://badge.fury.io/go/github.com%2Fgo-openapi%2Fstrfmt.svg [gomod-url]: https://badge.fury.io/go/github.com%2Fgo-openapi%2Fstrfmt -[gocard-badge]: https://goreportcard.com/badge/github.com/go-openapi/strfmt -[gocard-url]: https://goreportcard.com/report/github.com/go-openapi/strfmt [codefactor-badge]: https://img.shields.io/codefactor/grade/github/go-openapi/strfmt [codefactor-url]: https://www.codefactor.io/repository/github/go-openapi/strfmt diff --git a/vendor/github.com/go-openapi/strfmt/default.go b/vendor/github.com/go-openapi/strfmt/default.go index bcc57e6fad3..9168d053c07 100644 --- a/vendor/github.com/go-openapi/strfmt/default.go +++ b/vendor/github.com/go-openapi/strfmt/default.go @@ -119,6 +119,7 @@ func IsHostname(str string) bool { } // IDNA check + str, _ = strings.CutSuffix(str, ".") // tolerates trailing ".", whereas IDNA ValidateLabel rule does not res, err := idnaHostChecker.ToASCII(strings.ToLower(str)) if err != nil || res == "" { return false @@ -1976,7 +1977,7 @@ func isISBN(str string, version int) bool { for i = range isbnVersion13 - 1 { checksum += factor[i%2] * int32(sanitized[i]-'0') } - return (int32(sanitized[isbnVersion13-1]-'0'))-((decimalBase-(checksum%decimalBase))%decimalBase) == 0 + return int32(sanitized[isbnVersion13-1]-'0')-((decimalBase-(checksum%decimalBase))%decimalBase) == 0 default: return isISBN(str, isbnVersion10) || isISBN(str, isbnVersion13) } diff --git a/vendor/github.com/go-openapi/strfmt/duration.go b/vendor/github.com/go-openapi/strfmt/duration.go index fc4de0d14c2..f4fb550c625 100644 --- a/vendor/github.com/go-openapi/strfmt/duration.go +++ b/vendor/github.com/go-openapi/strfmt/duration.go @@ -240,6 +240,12 @@ func ParseDuration(s string) (time.Duration, error) { } } + // The sum is a uint64. 1<<63 ns plus 1<<63 ns wraps to 0, and 0 is not + // greater than maxUint64, so the range check below misses it. + if d > ^uint64(0)-v { + return 0, parseDurationError(orig, "numerical overflow") + } + d += v if d > maxUint64 { return 0, parseDurationError(orig, "numerical overflow") diff --git a/vendor/github.com/go-openapi/strfmt/format.go b/vendor/github.com/go-openapi/strfmt/format.go index 09c37542546..7ec785661a6 100644 --- a/vendor/github.com/go-openapi/strfmt/format.go +++ b/vendor/github.com/go-openapi/strfmt/format.go @@ -122,7 +122,7 @@ func (f *defaultFormats) Add(name string, strfmt Format, validator Validator) bo nme := f.normalizeName(name) tpe := reflect.TypeOf(strfmt) - if tpe.Kind() == reflect.Ptr { + if tpe.Kind() == reflect.Pointer { tpe = tpe.Elem() } @@ -176,7 +176,7 @@ func (f *defaultFormats) DelByFormat(strfmt Format) bool { defer f.Unlock() tpe := reflect.TypeOf(strfmt) - if tpe.Kind() == reflect.Ptr { + if tpe.Kind() == reflect.Pointer { tpe = tpe.Elem() } @@ -208,7 +208,7 @@ func (f *defaultFormats) ContainsFormat(strfmt Format) bool { f.Lock() defer f.Unlock() tpe := reflect.TypeOf(strfmt) - if tpe.Kind() == reflect.Ptr { + if tpe.Kind() == reflect.Pointer { tpe = tpe.Elem() } diff --git a/vendor/github.com/go-openapi/strfmt/go.work b/vendor/github.com/go-openapi/strfmt/go.work index f233e74cfd0..432c541d699 100644 --- a/vendor/github.com/go-openapi/strfmt/go.work +++ b/vendor/github.com/go-openapi/strfmt/go.work @@ -4,4 +4,4 @@ use ( ./internal/testintegration ) -go 1.25.0 +go 1.26.0 diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/options.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/options.go index f114f1f1a1a..cfcd426852a 100644 --- a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/options.go +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/options.go @@ -10,6 +10,11 @@ package json // It mirrors the limit enforced by the standard library's [encoding/json] decoder // (see encoding/json's internal maxNestingDepth), which this adapter would otherwise // not benefit from since it drives [encoding/json.Decoder.Token] directly. +// +// With encoding/json v2 (GOEXPERIMENT=jsonv2, the default from go1.27), Token applies +// that same limit itself and reports "exceeded max depth" before this counter fires. +// Set a lower limit with [WithMaxNestingDepth] to be rejected earlier than the stdlib; +// a higher one does not lift the stdlib's own 10,000-level ceiling on the decode path. const defaultMaxNestingDepth = 10000 // Option selects options for the stdlib adapter. diff --git a/vendor/github.com/gofrs/flock/.golangci.yml b/vendor/github.com/gofrs/flock/.golangci.yml index bc837b266a9..b35be7de812 100644 --- a/vendor/github.com/gofrs/flock/.golangci.yml +++ b/vendor/github.com/gofrs/flock/.golangci.yml @@ -6,7 +6,9 @@ formatters: - goimports settings: gofumpt: - extra-rules: true + extra: + clothe-returns: true + group-params: true linters: enable: diff --git a/vendor/github.com/gofrs/flock/flock.go b/vendor/github.com/gofrs/flock/flock.go index 4cb0746a716..156c4bf2b04 100644 --- a/vendor/github.com/gofrs/flock/flock.go +++ b/vendor/github.com/gofrs/flock/flock.go @@ -1,5 +1,5 @@ // Copyright 2015 Tim Heckman. All rights reserved. -// Copyright 2018-2025 The Gofrs. All rights reserved. +// Copyright 2018-2026 The Gofrs. All rights reserved. // Use of this source code is governed by the BSD 3-Clause // license that can be found in the LICENSE file. @@ -100,7 +100,7 @@ func (f *Flock) Close() error { return f.Unlock() } -// Path returns the path as provided in NewFlock(). +// Path returns the path as provided in New(). func (f *Flock) Path() string { return f.path } diff --git a/vendor/github.com/gofrs/flock/flock_others.go b/vendor/github.com/gofrs/flock/flock_others.go index 92d0f7e95a9..822ace0da02 100644 --- a/vendor/github.com/gofrs/flock/flock_others.go +++ b/vendor/github.com/gofrs/flock/flock_others.go @@ -1,5 +1,5 @@ // Copyright 2015 Tim Heckman. All rights reserved. -// Copyright 2018-2025 The Gofrs. All rights reserved. +// Copyright 2018-2026 The Gofrs. All rights reserved. // Use of this source code is governed by the BSD 3-Clause // license that can be found in the LICENSE file. diff --git a/vendor/github.com/gofrs/flock/flock_unix.go b/vendor/github.com/gofrs/flock/flock_unix.go index 77de7a8837a..c486c5e6bef 100644 --- a/vendor/github.com/gofrs/flock/flock_unix.go +++ b/vendor/github.com/gofrs/flock/flock_unix.go @@ -1,5 +1,5 @@ // Copyright 2015 Tim Heckman. All rights reserved. -// Copyright 2018-2025 The Gofrs. All rights reserved. +// Copyright 2018-2026 The Gofrs. All rights reserved. // Use of this source code is governed by the BSD 3-Clause // license that can be found in the LICENSE file. diff --git a/vendor/github.com/gofrs/flock/flock_unix_fcntl.go b/vendor/github.com/gofrs/flock/flock_unix_fcntl.go index 05c2f88c65b..76a29fc082d 100644 --- a/vendor/github.com/gofrs/flock/flock_unix_fcntl.go +++ b/vendor/github.com/gofrs/flock/flock_unix_fcntl.go @@ -1,5 +1,5 @@ // Copyright 2015 Tim Heckman. All rights reserved. -// Copyright 2018-2025 The Gofrs. All rights reserved. +// Copyright 2018-2026 The Gofrs. All rights reserved. // Use of this source code is governed by the BSD 3-Clause // license that can be found in the LICENSE file. diff --git a/vendor/github.com/gofrs/flock/flock_windows.go b/vendor/github.com/gofrs/flock/flock_windows.go index aa144f156e9..d9f9f883216 100644 --- a/vendor/github.com/gofrs/flock/flock_windows.go +++ b/vendor/github.com/gofrs/flock/flock_windows.go @@ -1,5 +1,5 @@ // Copyright 2015 Tim Heckman. All rights reserved. -// Copyright 2018-2025 The Gofrs. All rights reserved. +// Copyright 2018-2026 The Gofrs. All rights reserved. // Use of this source code is governed by the BSD 3-Clause // license that can be found in the LICENSE file. diff --git a/vendor/github.com/gofrs/flock/zizmor.yml b/vendor/github.com/gofrs/flock/zizmor.yml new file mode 100644 index 00000000000..39d1b180c53 --- /dev/null +++ b/vendor/github.com/gofrs/flock/zizmor.yml @@ -0,0 +1,3 @@ +rules: + secrets-outside-env: + disable: true diff --git a/vendor/github.com/golang-migrate/migrate/v4/.golangci.yml b/vendor/github.com/golang-migrate/migrate/v4/.golangci.yml index 68a8e953ba0..913bddb879e 100644 --- a/vendor/github.com/golang-migrate/migrate/v4/.golangci.yml +++ b/vendor/github.com/golang-migrate/migrate/v4/.golangci.yml @@ -1,30 +1,37 @@ -run: - # timeout for analysis, e.g. 30s, 5m, default is 1m - timeout: 5m +version: "2" linters: enable: - #- golint - #- interfacer - - unconvert - #- dupl - goconst - - gofmt - misspell - - unparam - nakedret - prealloc - revive - #- gosec -linters-settings: - misspell: - locale: US - revive: + - unconvert + - unparam + settings: + misspell: + locale: US + revive: + rules: + - name: redundant-build-tag + exclusions: + generated: lax rules: - - name: redundant-build-tag + - path: (.+)\.go$ + text: G104 + paths: + - third_party$ + - builtin$ + - examples$ issues: - max-same-issues: 0 max-issues-per-linter: 0 - exclude-use-default: false - exclude: - # gosec: Duplicated errcheck checks - - G104 + max-same-issues: 0 +formatters: + enable: + - gofmt + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ diff --git a/vendor/github.com/golang-migrate/migrate/v4/.goreleaser.yml b/vendor/github.com/golang-migrate/migrate/v4/.goreleaser.yml index 682248f65a4..7685e0b6b4b 100644 --- a/vendor/github.com/golang-migrate/migrate/v4/.goreleaser.yml +++ b/vendor/github.com/golang-migrate/migrate/v4/.goreleaser.yml @@ -16,6 +16,13 @@ builds: - 386 goarm: - 7 + ignore: + - goos: windows + goarch: arm + - goos: darwin + goarch: arm + - goos: darwin + goarch: 386 main: ./cmd/migrate ldflags: - '-w -s -X main.Version={{ .Version }} -extldflags "static"' diff --git a/vendor/github.com/golang-migrate/migrate/v4/Dockerfile b/vendor/github.com/golang-migrate/migrate/v4/Dockerfile index eef2a47824c..268fc1590fe 100644 --- a/vendor/github.com/golang-migrate/migrate/v4/Dockerfile +++ b/vendor/github.com/golang-migrate/migrate/v4/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.25-alpine3.21 AS builder +FROM golang:1.26-alpine3.24 AS builder ARG VERSION RUN apk add --no-cache git gcc musl-dev make @@ -15,9 +15,10 @@ COPY . ./ RUN make build-docker -FROM alpine:3.21 +FROM alpine:3.24 -RUN apk add --no-cache ca-certificates +RUN apk upgrade --no-cache \ + && apk add --no-cache ca-certificates COPY --from=builder /go/src/github.com/golang-migrate/migrate/build/migrate.linux-386 /usr/local/bin/migrate RUN ln -s /usr/local/bin/migrate /migrate diff --git a/vendor/github.com/golang-migrate/migrate/v4/Dockerfile.github-actions b/vendor/github.com/golang-migrate/migrate/v4/Dockerfile.github-actions index 9786e1210c6..803b895f0cf 100644 --- a/vendor/github.com/golang-migrate/migrate/v4/Dockerfile.github-actions +++ b/vendor/github.com/golang-migrate/migrate/v4/Dockerfile.github-actions @@ -1,6 +1,7 @@ -FROM alpine:3.19 +FROM alpine:3.24 -RUN apk add --no-cache ca-certificates +RUN apk upgrade --no-cache \ + && apk add --no-cache ca-certificates COPY migrate /usr/local/bin/migrate diff --git a/vendor/github.com/golang-migrate/migrate/v4/README.md b/vendor/github.com/golang-migrate/migrate/v4/README.md index 9b5b4b69efa..a154be33c9c 100644 --- a/vendor/github.com/golang-migrate/migrate/v4/README.md +++ b/vendor/github.com/golang-migrate/migrate/v4/README.md @@ -3,7 +3,7 @@ [![Coverage Status](https://img.shields.io/coveralls/github/golang-migrate/migrate/master.svg)](https://coveralls.io/github/golang-migrate/migrate?branch=master) [![packagecloud.io](https://img.shields.io/badge/deb-packagecloud.io-844fec.svg)](https://packagecloud.io/golang-migrate/migrate?filter=debs) [![Docker Pulls](https://img.shields.io/docker/pulls/migrate/migrate.svg)](https://hub.docker.com/r/migrate/migrate/) -![Supported Go Versions](https://img.shields.io/badge/Go-1.24%2C%201.25-lightgrey.svg) +![Supported Go Versions](https://img.shields.io/badge/Go-1.25%2C%201.26-lightgrey.svg) [![GitHub Release](https://img.shields.io/github/release/golang-migrate/migrate.svg)](https://github.com/golang-migrate/migrate/releases) [![Go Report Card](https://goreportcard.com/badge/github.com/golang-migrate/migrate/v4)](https://goreportcard.com/report/github.com/golang-migrate/migrate/v4) diff --git a/vendor/github.com/golang-migrate/migrate/v4/database/postgres/postgres.go b/vendor/github.com/golang-migrate/migrate/v4/database/postgres/postgres.go index 7a0f546dde9..ed96fe63ecd 100644 --- a/vendor/github.com/golang-migrate/migrate/v4/database/postgres/postgres.go +++ b/vendor/github.com/golang-migrate/migrate/v4/database/postgres/postgres.go @@ -165,7 +165,7 @@ func (p *Postgres) Open(url string) (database.Driver, error) { if s := purl.Query().Get("x-migrations-table-quoted"); len(s) > 0 { migrationsTableQuoted, err = strconv.ParseBool(s) if err != nil { - return nil, fmt.Errorf("Unable to parse option x-migrations-table-quoted: %w", err) + return nil, fmt.Errorf("unable to parse option x-migrations-table-quoted: %w", err) } } if (len(migrationsTable) > 0) && (migrationsTableQuoted) && ((migrationsTable[0] != '"') || (migrationsTable[len(migrationsTable)-1] != '"')) { @@ -196,7 +196,7 @@ func (p *Postgres) Open(url string) (database.Driver, error) { if s := purl.Query().Get("x-multi-statement"); len(s) > 0 { multiStatementEnabled, err = strconv.ParseBool(s) if err != nil { - return nil, fmt.Errorf("Unable to parse option x-multi-statement: %w", err) + return nil, fmt.Errorf("unable to parse option x-multi-statement: %w", err) } } @@ -319,7 +319,7 @@ func (p *Postgres) runStatement(statement []byte) error { func computeLineFromPos(s string, pos int) (line uint, col uint, ok bool) { // replace crlf with lf - s = strings.Replace(s, "\r\n", "\n", -1) + s = strings.ReplaceAll(s, "\r\n", "\n") // pg docs: pos uses index 1 for the first character, and positions are measured in characters not bytes runes := []rune(s) if pos > len(runes) { diff --git a/vendor/github.com/golang-migrate/migrate/v4/source/iofs/iofs.go b/vendor/github.com/golang-migrate/migrate/v4/source/iofs/iofs.go index a9dc7c4b192..4d5733c34ca 100644 --- a/vendor/github.com/golang-migrate/migrate/v4/source/iofs/iofs.go +++ b/vendor/github.com/golang-migrate/migrate/v4/source/iofs/iofs.go @@ -29,7 +29,7 @@ func New(fsys fs.FS, path string) (source.Driver, error) { // Open is part of source.Driver interface implementation. // Open cannot be called on the iofs passthrough driver. func (d *driver) Open(url string) (source.Driver, error) { - return nil, errors.New("Open() cannot be called on the iofs passthrough driver") + return nil, errors.New("open() cannot be called on the iofs passthrough driver") } // PartialDriver is a helper service for creating new source drivers working with diff --git a/vendor/github.com/golang-migrate/migrate/v4/source/migration.go b/vendor/github.com/golang-migrate/migrate/v4/source/migration.go index 74f6523cb74..51c6c15cfb1 100644 --- a/vendor/github.com/golang-migrate/migrate/v4/source/migration.go +++ b/vendor/github.com/golang-migrate/migrate/v4/source/migration.go @@ -35,6 +35,7 @@ type Migration struct { // to keep track of Migration order. type Migrations struct { index uintSlice + dirty bool migrations map[uint]map[Direction]*Migration } @@ -60,7 +61,7 @@ func (i *Migrations) Append(m *Migration) (ok bool) { } i.migrations[m.Version][m.Direction] = m - i.buildIndex() + i.dirty = true return true } @@ -73,9 +74,17 @@ func (i *Migrations) buildIndex() { sort.Slice(i.index, func(x, y int) bool { return i.index[x] < i.index[y] }) + i.dirty = false +} + +func (i *Migrations) ensureIndex() { + if i.dirty { + i.buildIndex() + } } func (i *Migrations) First() (version uint, ok bool) { + i.ensureIndex() if len(i.index) == 0 { return 0, false } @@ -117,6 +126,7 @@ func (i *Migrations) Down(version uint) (m *Migration, ok bool) { } func (i *Migrations) findPos(version uint) int { + i.ensureIndex() if len(i.index) > 0 { ix := i.index.Search(version) if ix < len(i.index) && i.index[ix] == version { diff --git a/vendor/github.com/googleapis/enterprise-certificate-proxy/client/client.go b/vendor/github.com/googleapis/enterprise-certificate-proxy/client/client.go index ea5beb5aa76..c0600808a34 100644 --- a/vendor/github.com/googleapis/enterprise-certificate-proxy/client/client.go +++ b/vendor/github.com/googleapis/enterprise-certificate-proxy/client/client.go @@ -118,7 +118,7 @@ func (k *Key) Public() crypto.PublicKey { // Sign signs a message digest, using the specified signer opts. Implements crypto.Signer interface. func (k *Key) Sign(_ io.Reader, digest []byte, opts crypto.SignerOpts) (signed []byte, err error) { if opts != nil && opts.HashFunc() != 0 && len(digest) != opts.HashFunc().Size() { - return nil, fmt.Errorf("Digest length of %v bytes does not match Hash function size of %v bytes", len(digest), opts.HashFunc().Size()) + return nil, fmt.Errorf("digest length of %v bytes does not match Hash function size of %v bytes", len(digest), opts.HashFunc().Size()) } err = k.client.Call(signAPI, SignArgs{Digest: digest, Opts: opts}, &signed) return @@ -138,7 +138,7 @@ func (k *Key) Decrypt(_ io.Reader, msg []byte, opts crypto.DecrypterOpts) (plain // ErrCredUnavailable is a sentinel error that indicates ECP Cred is unavailable, // possibly due to missing config or missing binary path. -var ErrCredUnavailable = errors.New("Cred is unavailable") +var ErrCredUnavailable = errors.New("cred is unavailable") // Cred spawns a signer subprocess that listens on stdin/stdout to perform certificate // related operations, including signing messages with the private key. diff --git a/vendor/github.com/googleapis/enterprise-certificate-proxy/client/util/util.go b/vendor/github.com/googleapis/enterprise-certificate-proxy/client/util/util.go index f374a7f55f4..ef76e1f047d 100644 --- a/vendor/github.com/googleapis/enterprise-certificate-proxy/client/util/util.go +++ b/vendor/github.com/googleapis/enterprise-certificate-proxy/client/util/util.go @@ -39,7 +39,7 @@ type Libs struct { // ErrConfigUnavailable is a sentinel error that indicates ECP config is unavailable, // possibly due to entire config missing or missing binary path. -var ErrConfigUnavailable = errors.New("Config is unavailable") +var ErrConfigUnavailable = errors.New("config is unavailable") // LoadSignerBinaryPath retrieves the path of the signer binary from the config file. func LoadSignerBinaryPath(configFilePath string) (path string, err error) { diff --git a/vendor/github.com/googleapis/gax-go/v2/CHANGES.md b/vendor/github.com/googleapis/gax-go/v2/CHANGES.md index ac3f57af146..ed27c5ee71c 100644 --- a/vendor/github.com/googleapis/gax-go/v2/CHANGES.md +++ b/vendor/github.com/googleapis/gax-go/v2/CHANGES.md @@ -1,5 +1,42 @@ # Changes +## [2.22.0](https://github.com/googleapis/google-cloud-go/releases/tag/v2.22.0) (2026-04-14) + +## [2.21.0](https://github.com/googleapis/google-cloud-go/releases/tag/v2.21.0) (2026-04-01) + +### Features + +* hook transport telemetry into gax.Invoke and record (#496) ([d531001](https://github.com/googleapis/google-cloud-go/commit/d5310019d6c635956b61558627b13c2c2419044e)) +* update IsFeatureEnabled to not require EXPERIMENTAL (#497) ([a2a329e](https://github.com/googleapis/google-cloud-go/commit/a2a329e31d8ef8348a1ef7bea1c7072f8abcc145)) + +## [2.20.0](https://github.com/googleapis/google-cloud-go/releases/tag/v2.20.0) (2026-03-25) + +### Features + +* add TelemetryErrorInfo and ExtractTelemetryErrorInfo (#487) ([defdded](https://github.com/googleapis/google-cloud-go/commit/defdded3eac5d97e32243ef79216f1865f3250fb)) +* hook metric recording into gax.Invoke (#494) ([1f3e9ae](https://github.com/googleapis/google-cloud-go/commit/1f3e9aefd21a1a18a6e4da1e03ea84a0b46f2d49)) + +## [2.19.0](https://github.com/googleapis/google-cloud-go/releases/tag/v2.19.0) (2026-03-17) + +### Features + +* add ClientMetrics initialization core (#473) ([f53618c](https://github.com/googleapis/google-cloud-go/commit/f53618c2a9f19d5e5945395001fdc9b317e71faf)) +* add TransportTelemetryData for dynamic transport attributes (#481) ([8a7caf0](https://github.com/googleapis/google-cloud-go/commit/8a7caf0014c9ee9bcf448f16a2e1ae77407a78b8)) +* add WithClientMetrics CallOption (#479) ([76f0284](https://github.com/googleapis/google-cloud-go/commit/76f0284ef42fb92484531483975b7ccff9c54016)) +* pass logger to downstream via context (#474) ([434fa67](https://github.com/googleapis/google-cloud-go/commit/434fa6768b9ee50ed1050a2b5aa11dbe7dbd33a6)) +* update WithLogger to WithLoggerContext. (#478) ([1cb70ba](https://github.com/googleapis/google-cloud-go/commit/1cb70baf5fda8cbff587206f94b1b08e078bd175)) + +### Bug Fixes + +* lazy initialization and getters for ClientMetrics (#485) ([fb6c5f4](https://github.com/googleapis/google-cloud-go/commit/fb6c5f4d56fc3177a2d0d2b8f9e8df6e4be95505)) + +## [2.18.0](https://github.com/googleapis/google-cloud-go/releases/tag/v2.18.0) (2026-03-09) + +### Features + +* add callctx telemetry helpers (#472) ([fa319ff](https://github.com/googleapis/google-cloud-go/commit/fa319ffc309366ab21e41f5d7480f450eedd2be9)) +* move gax-go to use 1.25 as the lower bound of support (#469) ([01594ca](https://github.com/googleapis/google-cloud-go/commit/01594ca54717eebe7229a5168ef41be61191a720)) + ## [2.17.0](https://github.com/googleapis/google-cloud-go/releases/tag/v2.17.0) (2026-02-03) ### Features diff --git a/vendor/github.com/googleapis/gax-go/v2/apierror/apierror.go b/vendor/github.com/googleapis/gax-go/v2/apierror/apierror.go index 90a40d29c15..cba5919195b 100644 --- a/vendor/github.com/googleapis/gax-go/v2/apierror/apierror.go +++ b/vendor/github.com/googleapis/gax-go/v2/apierror/apierror.go @@ -248,6 +248,17 @@ func (a *APIError) Error() string { return strings.TrimSpace(fmt.Sprintf("%s\n%s", msg, a.details)) } +// Message returns the original, unformatted error message from the underlying +// googleapi.Error or gRPC Status, without additional details or context. +func (a *APIError) Message() string { + if a.httpErr != nil { + return a.httpErr.Message + } else if a.status != nil { + return a.status.Message() + } + return "" +} + // GRPCStatus extracts the underlying gRPC Status error. // This method is necessary to fulfill the interface // described in https://pkg.go.dev/google.golang.org/grpc/status#FromError. diff --git a/vendor/github.com/googleapis/gax-go/v2/apierror/internal/proto/custom_error.pb.go b/vendor/github.com/googleapis/gax-go/v2/apierror/internal/proto/custom_error.pb.go index e4b03f161d8..90639e66aef 100644 --- a/vendor/github.com/googleapis/gax-go/v2/apierror/internal/proto/custom_error.pb.go +++ b/vendor/github.com/googleapis/gax-go/v2/apierror/internal/proto/custom_error.pb.go @@ -14,8 +14,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 -// protoc v3.17.3 +// protoc-gen-go v1.36.11 +// protoc v6.30.2 // source: custom_error.proto package jsonerror @@ -23,6 +23,7 @@ package jsonerror import ( reflect "reflect" sync "sync" + unsafe "unsafe" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -95,25 +96,22 @@ func (CustomError_CustomErrorCode) EnumDescriptor() ([]byte, []int) { // CustomError is an example of a custom error message which may be included // in an rpc status. It is not meant to reflect a standard error. type CustomError struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Error code specific to the custom API being invoked. Code CustomError_CustomErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=error.CustomError_CustomErrorCode" json:"code,omitempty"` // Name of the failed entity. Entity string `protobuf:"bytes,2,opt,name=entity,proto3" json:"entity,omitempty"` // Message that describes the error. - ErrorMessage string `protobuf:"bytes,3,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` + ErrorMessage string `protobuf:"bytes,3,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *CustomError) Reset() { *x = CustomError{} - if protoimpl.UnsafeEnabled { - mi := &file_custom_error_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_custom_error_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CustomError) String() string { @@ -124,7 +122,7 @@ func (*CustomError) ProtoMessage() {} func (x *CustomError) ProtoReflect() protoreflect.Message { mi := &file_custom_error_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) @@ -162,47 +160,34 @@ func (x *CustomError) GetErrorMessage() string { var File_custom_error_proto protoreflect.FileDescriptor -var file_custom_error_proto_rawDesc = []byte{ - 0x0a, 0x12, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0xfa, 0x01, 0x0a, 0x0b, - 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x36, 0x0a, 0x04, 0x63, - 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x43, 0x75, - 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, - 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x22, 0x76, 0x0a, 0x0f, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, - 0x6f, 0x64, 0x65, 0x12, 0x21, 0x0a, 0x1d, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x45, 0x52, - 0x52, 0x4f, 0x52, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x4f, 0x4f, 0x5f, 0x4d, 0x41, - 0x4e, 0x59, 0x5f, 0x46, 0x4f, 0x4f, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x4e, 0x4f, 0x54, 0x5f, - 0x45, 0x4e, 0x4f, 0x55, 0x47, 0x48, 0x5f, 0x46, 0x4f, 0x4f, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, - 0x55, 0x4e, 0x49, 0x56, 0x45, 0x52, 0x53, 0x45, 0x5f, 0x57, 0x41, 0x53, 0x5f, 0x44, 0x45, 0x53, - 0x54, 0x52, 0x4f, 0x59, 0x45, 0x44, 0x10, 0x03, 0x42, 0x43, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, - 0x73, 0x2f, 0x67, 0x61, 0x78, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x70, 0x69, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x3b, 0x6a, 0x73, 0x6f, 0x6e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_custom_error_proto_rawDesc = "" + + "\n" + + "\x12custom_error.proto\x12\x05error\"\xfa\x01\n" + + "\vCustomError\x126\n" + + "\x04code\x18\x01 \x01(\x0e2\".error.CustomError.CustomErrorCodeR\x04code\x12\x16\n" + + "\x06entity\x18\x02 \x01(\tR\x06entity\x12#\n" + + "\rerror_message\x18\x03 \x01(\tR\ferrorMessage\"v\n" + + "\x0fCustomErrorCode\x12!\n" + + "\x1dCUSTOM_ERROR_CODE_UNSPECIFIED\x10\x00\x12\x10\n" + + "\fTOO_MANY_FOO\x10\x01\x12\x12\n" + + "\x0eNOT_ENOUGH_FOO\x10\x02\x12\x1a\n" + + "\x16UNIVERSE_WAS_DESTROYED\x10\x03BCZAgithub.com/googleapis/gax-go/v2/apierror/internal/proto;jsonerrorb\x06proto3" var ( file_custom_error_proto_rawDescOnce sync.Once - file_custom_error_proto_rawDescData = file_custom_error_proto_rawDesc + file_custom_error_proto_rawDescData []byte ) func file_custom_error_proto_rawDescGZIP() []byte { file_custom_error_proto_rawDescOnce.Do(func() { - file_custom_error_proto_rawDescData = protoimpl.X.CompressGZIP(file_custom_error_proto_rawDescData) + file_custom_error_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_custom_error_proto_rawDesc), len(file_custom_error_proto_rawDesc))) }) return file_custom_error_proto_rawDescData } var file_custom_error_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_custom_error_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_custom_error_proto_goTypes = []interface{}{ +var file_custom_error_proto_goTypes = []any{ (CustomError_CustomErrorCode)(0), // 0: error.CustomError.CustomErrorCode (*CustomError)(nil), // 1: error.CustomError } @@ -220,25 +205,11 @@ func file_custom_error_proto_init() { if File_custom_error_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_custom_error_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CustomError); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_custom_error_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_custom_error_proto_rawDesc), len(file_custom_error_proto_rawDesc)), NumEnums: 1, NumMessages: 1, NumExtensions: 0, @@ -250,7 +221,6 @@ func file_custom_error_proto_init() { MessageInfos: file_custom_error_proto_msgTypes, }.Build() File_custom_error_proto = out.File - file_custom_error_proto_rawDesc = nil file_custom_error_proto_goTypes = nil file_custom_error_proto_depIdxs = nil } diff --git a/vendor/github.com/googleapis/gax-go/v2/apierror/internal/proto/error.pb.go b/vendor/github.com/googleapis/gax-go/v2/apierror/internal/proto/error.pb.go index 7dd9b83739a..1a29ff5c896 100644 --- a/vendor/github.com/googleapis/gax-go/v2/apierror/internal/proto/error.pb.go +++ b/vendor/github.com/googleapis/gax-go/v2/apierror/internal/proto/error.pb.go @@ -14,15 +14,16 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 -// protoc v3.15.8 -// source: apierror/internal/proto/error.proto +// protoc-gen-go v1.36.11 +// protoc v6.30.2 +// source: error.proto package jsonerror import ( reflect "reflect" sync "sync" + unsafe "unsafe" code "google.golang.org/genproto/googleapis/rpc/code" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -42,23 +43,20 @@ const ( // // NOTE: This schema is not used for other wire protocols. type Error struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The actual error payload. The nested message structure is for backward // compatibility with Google API client libraries. It also makes the error // more readable to developers. - Error *Error_Status `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + Error *Error_Status `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Error) Reset() { *x = Error{} - if protoimpl.UnsafeEnabled { - mi := &file_apierror_internal_proto_error_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_error_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Error) String() string { @@ -68,8 +66,8 @@ func (x *Error) String() string { func (*Error) ProtoMessage() {} func (x *Error) ProtoReflect() protoreflect.Message { - mi := &file_apierror_internal_proto_error_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_error_proto_msgTypes[0] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -81,7 +79,7 @@ func (x *Error) ProtoReflect() protoreflect.Message { // Deprecated: Use Error.ProtoReflect.Descriptor instead. func (*Error) Descriptor() ([]byte, []int) { - return file_apierror_internal_proto_error_proto_rawDescGZIP(), []int{0} + return file_error_proto_rawDescGZIP(), []int{0} } func (x *Error) GetError() *Error_Status { @@ -95,10 +93,7 @@ func (x *Error) GetError() *Error_Status { // status code instead of gRPC status code. It has an extra field `status` // for backward compatibility with Google API Client Libraries. type Error_Status struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The HTTP status code that corresponds to `google.rpc.Status.code`. Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // This corresponds to `google.rpc.Status.message`. @@ -106,16 +101,16 @@ type Error_Status struct { // This is the enum version for `google.rpc.Status.code`. Status code.Code `protobuf:"varint,4,opt,name=status,proto3,enum=google.rpc.Code" json:"status,omitempty"` // This corresponds to `google.rpc.Status.details`. - Details []*anypb.Any `protobuf:"bytes,5,rep,name=details,proto3" json:"details,omitempty"` + Details []*anypb.Any `protobuf:"bytes,5,rep,name=details,proto3" json:"details,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Error_Status) Reset() { *x = Error_Status{} - if protoimpl.UnsafeEnabled { - mi := &file_apierror_internal_proto_error_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_error_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Error_Status) String() string { @@ -125,8 +120,8 @@ func (x *Error_Status) String() string { func (*Error_Status) ProtoMessage() {} func (x *Error_Status) ProtoReflect() protoreflect.Message { - mi := &file_apierror_internal_proto_error_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_error_proto_msgTypes[1] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -138,7 +133,7 @@ func (x *Error_Status) ProtoReflect() protoreflect.Message { // Deprecated: Use Error_Status.ProtoReflect.Descriptor instead. func (*Error_Status) Descriptor() ([]byte, []int) { - return file_apierror_internal_proto_error_proto_rawDescGZIP(), []int{0, 0} + return file_error_proto_rawDescGZIP(), []int{0, 0} } func (x *Error_Status) GetCode() int32 { @@ -169,55 +164,39 @@ func (x *Error_Status) GetDetails() []*anypb.Any { return nil } -var File_apierror_internal_proto_error_proto protoreflect.FileDescriptor +var File_error_proto protoreflect.FileDescriptor -var file_apierror_internal_proto_error_proto_rawDesc = []byte{ - 0x0a, 0x23, 0x61, 0x70, 0x69, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x1a, 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, 0x15, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x72, 0x70, 0x63, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc5, - 0x01, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x29, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2e, - 0x45, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x05, 0x65, 0x72, - 0x72, 0x6f, 0x72, 0x1a, 0x90, 0x01, 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, 0x28, 0x0a, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2e, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, - 0x73, 0x18, 0x05, 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, 0x42, 0x43, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, - 0x67, 0x61, 0x78, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x70, 0x69, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x3b, 0x6a, 0x73, 0x6f, 0x6e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} +const file_error_proto_rawDesc = "" + + "\n" + + "\verror.proto\x12\x05error\x1a\x19google/protobuf/any.proto\x1a\x15google/rpc/code.proto\"\xc5\x01\n" + + "\x05Error\x12)\n" + + "\x05error\x18\x01 \x01(\v2\x13.error.Error.StatusR\x05error\x1a\x90\x01\n" + + "\x06Status\x12\x12\n" + + "\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\x12(\n" + + "\x06status\x18\x04 \x01(\x0e2\x10.google.rpc.CodeR\x06status\x12.\n" + + "\adetails\x18\x05 \x03(\v2\x14.google.protobuf.AnyR\adetailsBCZAgithub.com/googleapis/gax-go/v2/apierror/internal/proto;jsonerrorb\x06proto3" var ( - file_apierror_internal_proto_error_proto_rawDescOnce sync.Once - file_apierror_internal_proto_error_proto_rawDescData = file_apierror_internal_proto_error_proto_rawDesc + file_error_proto_rawDescOnce sync.Once + file_error_proto_rawDescData []byte ) -func file_apierror_internal_proto_error_proto_rawDescGZIP() []byte { - file_apierror_internal_proto_error_proto_rawDescOnce.Do(func() { - file_apierror_internal_proto_error_proto_rawDescData = protoimpl.X.CompressGZIP(file_apierror_internal_proto_error_proto_rawDescData) +func file_error_proto_rawDescGZIP() []byte { + file_error_proto_rawDescOnce.Do(func() { + file_error_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_error_proto_rawDesc), len(file_error_proto_rawDesc))) }) - return file_apierror_internal_proto_error_proto_rawDescData + return file_error_proto_rawDescData } -var file_apierror_internal_proto_error_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_apierror_internal_proto_error_proto_goTypes = []interface{}{ +var file_error_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_error_proto_goTypes = []any{ (*Error)(nil), // 0: error.Error (*Error_Status)(nil), // 1: error.Error.Status (code.Code)(0), // 2: google.rpc.Code (*anypb.Any)(nil), // 3: google.protobuf.Any } -var file_apierror_internal_proto_error_proto_depIdxs = []int32{ +var file_error_proto_depIdxs = []int32{ 1, // 0: error.Error.error:type_name -> error.Error.Status 2, // 1: error.Error.Status.status:type_name -> google.rpc.Code 3, // 2: error.Error.Status.details:type_name -> google.protobuf.Any @@ -228,53 +207,26 @@ var file_apierror_internal_proto_error_proto_depIdxs = []int32{ 0, // [0:3] is the sub-list for field type_name } -func init() { file_apierror_internal_proto_error_proto_init() } -func file_apierror_internal_proto_error_proto_init() { - if File_apierror_internal_proto_error_proto != nil { +func init() { file_error_proto_init() } +func file_error_proto_init() { + if File_error_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_apierror_internal_proto_error_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Error); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_apierror_internal_proto_error_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Error_Status); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_apierror_internal_proto_error_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_error_proto_rawDesc), len(file_error_proto_rawDesc)), NumEnums: 0, NumMessages: 2, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_apierror_internal_proto_error_proto_goTypes, - DependencyIndexes: file_apierror_internal_proto_error_proto_depIdxs, - MessageInfos: file_apierror_internal_proto_error_proto_msgTypes, + GoTypes: file_error_proto_goTypes, + DependencyIndexes: file_error_proto_depIdxs, + MessageInfos: file_error_proto_msgTypes, }.Build() - File_apierror_internal_proto_error_proto = out.File - file_apierror_internal_proto_error_proto_rawDesc = nil - file_apierror_internal_proto_error_proto_goTypes = nil - file_apierror_internal_proto_error_proto_depIdxs = nil + File_error_proto = out.File + file_error_proto_goTypes = nil + file_error_proto_depIdxs = nil } diff --git a/vendor/github.com/googleapis/gax-go/v2/call_option.go b/vendor/github.com/googleapis/gax-go/v2/call_option.go index ac1f2b11c98..8f5948eb3eb 100644 --- a/vendor/github.com/googleapis/gax-go/v2/call_option.go +++ b/vendor/github.com/googleapis/gax-go/v2/call_option.go @@ -250,6 +250,22 @@ func WithTimeout(t time.Duration) CallOption { return &timeoutOpt{t: t} } +type clientMetricsOpt struct { + cm *ClientMetrics +} + +// Resolve applies the ClientMetrics to the CallSettings. +func (o clientMetricsOpt) Resolve(s *CallSettings) { + s.clientMetrics = o.cm +} + +// WithClientMetrics applies metrics instrumentation to the CallSettings. +// +// This is for internal use only. +func WithClientMetrics(cm *ClientMetrics) CallOption { + return clientMetricsOpt{cm: cm} +} + // CallSettings allow fine-grained control over how calls are made. type CallSettings struct { // Retry returns a Retryer to be used to control retry logic of a method call. @@ -265,4 +281,8 @@ type CallSettings struct { // Timeout defines the amount of time that Invoke has to complete. // Unexported so it cannot be changed by the code in an APICall. timeout time.Duration + + // clientMetrics holds the pre-allocated OpenTelemetry metrics instruments + // to use for this call. + clientMetrics *ClientMetrics } diff --git a/vendor/github.com/googleapis/gax-go/v2/callctx/callctx.go b/vendor/github.com/googleapis/gax-go/v2/callctx/callctx.go index f5af5c990f9..3d7be5f2aa8 100644 --- a/vendor/github.com/googleapis/gax-go/v2/callctx/callctx.go +++ b/vendor/github.com/googleapis/gax-go/v2/callctx/callctx.go @@ -35,6 +35,7 @@ package callctx import ( "context" "fmt" + "log/slog" ) const ( @@ -98,3 +99,48 @@ func cloneHeaders(h map[string][]string) map[string][]string { } return c } + +// telemetryKey is a private type used to store/retrieve telemetry context values. +type telemetryKey string + +// WithTelemetryContext injects telemetry attribute values (like resource name +// or client version) into the context. In accordance with standard Go context +// guidelines, this should only be used for data that transits processes and APIs, +// and not for passing optional parameters to functions. keyvals should have a +// corresponding value for every key provided. If there is an odd number of keyvals +// this method will panic. +func WithTelemetryContext(ctx context.Context, keyvals ...string) context.Context { + if len(keyvals)%2 != 0 { + panic(fmt.Sprintf("callctx: an even number of key value pairs must be provided, got %d", len(keyvals))) + } + + for i := 0; i < len(keyvals); i = i + 2 { + ctx = context.WithValue(ctx, telemetryKey(keyvals[i]), keyvals[i+1]) + } + return ctx +} + +// TelemetryFromContext extracts a telemetry attribute value from the context. +// The returned bool indicates a successful typecast of the value to a string. +func TelemetryFromContext(ctx context.Context, key string) (string, bool) { + val, ok := ctx.Value(telemetryKey(key)).(string) + return val, ok +} + +// loggerKey is a private type used to store/retrieve the logger context value. +type loggerContextKey string + +const loggerCKey = loggerContextKey("logger") + +// WithLoggerContext injects a slog.Logger into the context. This logger will +// be extracted by the client library or transport wrappers to emit logs. +func WithLoggerContext(ctx context.Context, logger *slog.Logger) context.Context { + return context.WithValue(ctx, loggerCKey, logger) +} + +// LoggerFromContext extracts a slog.Logger from the context. +// The returned bool indicates whether a logger was found. +func LoggerFromContext(ctx context.Context) (*slog.Logger, bool) { + logger, ok := ctx.Value(loggerCKey).(*slog.Logger) + return logger, ok +} diff --git a/vendor/github.com/googleapis/gax-go/v2/content_type.go b/vendor/github.com/googleapis/gax-go/v2/content_type.go index 1b53d0a3ac1..818a3b0152a 100644 --- a/vendor/github.com/googleapis/gax-go/v2/content_type.go +++ b/vendor/github.com/googleapis/gax-go/v2/content_type.go @@ -31,7 +31,7 @@ package gax import ( "io" - "io/ioutil" + "net/http" ) @@ -78,7 +78,7 @@ func (cs *contentSniffer) ContentType() (string, bool) { } cs.sniffed = true // If ReadAll hits EOF, it returns err==nil. - cs.start, cs.err = ioutil.ReadAll(io.LimitReader(cs.r, sniffBuffSize)) + cs.start, cs.err = io.ReadAll(io.LimitReader(cs.r, sniffBuffSize)) // Don't try to detect the content type based on possibly incomplete data. if cs.err != nil { diff --git a/vendor/github.com/googleapis/gax-go/v2/feature.go b/vendor/github.com/googleapis/gax-go/v2/feature.go index 32e05a3234c..c7a9ec88bb8 100644 --- a/vendor/github.com/googleapis/gax-go/v2/feature.go +++ b/vendor/github.com/googleapis/gax-go/v2/feature.go @@ -51,11 +51,17 @@ func IsFeatureEnabled(name string) bool { featureEnabledOnce.Do(func() { featureEnabledStore = make(map[string]bool) for _, env := range os.Environ() { + prefix := "" if strings.HasPrefix(env, "GOOGLE_SDK_GO_EXPERIMENTAL_") { + prefix = "GOOGLE_SDK_GO_EXPERIMENTAL_" + } else if strings.HasPrefix(env, "GOOGLE_SDK_GO_") { + prefix = "GOOGLE_SDK_GO_" + } + if prefix != "" { // Parse "KEY=VALUE" kv := strings.SplitN(env, "=", 2) if len(kv) == 2 && strings.ToLower(kv[1]) == "true" { - key := strings.TrimPrefix(kv[0], "GOOGLE_SDK_GO_EXPERIMENTAL_") + key := strings.TrimPrefix(kv[0], prefix) featureEnabledStore[key] = true } } diff --git a/vendor/github.com/googleapis/gax-go/v2/internal/version.go b/vendor/github.com/googleapis/gax-go/v2/internal/version.go index c3c26b9828b..f324d1ab82a 100644 --- a/vendor/github.com/googleapis/gax-go/v2/internal/version.go +++ b/vendor/github.com/googleapis/gax-go/v2/internal/version.go @@ -17,4 +17,4 @@ package internal // Version is the current tagged release of the library. -const Version = "2.17.0" +const Version = "2.22.0" diff --git a/vendor/github.com/googleapis/gax-go/v2/invoke.go b/vendor/github.com/googleapis/gax-go/v2/invoke.go index af1eebe3e93..ea16c3c5ac0 100644 --- a/vendor/github.com/googleapis/gax-go/v2/invoke.go +++ b/vendor/github.com/googleapis/gax-go/v2/invoke.go @@ -36,19 +36,19 @@ import ( "time" "github.com/googleapis/gax-go/v2/apierror" - "google.golang.org/grpc/metadata" + "github.com/googleapis/gax-go/v2/callctx" ) // APICall is a user defined call stub. type APICall func(context.Context, CallSettings) error // withRetryCount returns a new context with the retry count appended to -// gRPC metadata. The retry count is the number of retries that have been +// the telemetry context. The retry count is the number of retries that have been // attempted. On the initial request, retry count is 0. // On a second request (the first retry), retry count is 1. func withRetryCount(ctx context.Context, retryCount int) context.Context { - // Add to gRPC metadata so it's visible to StatsHandlers - return metadata.AppendToOutgoingContext(ctx, "gcp.grpc.resend_count", strconv.Itoa(retryCount)) + // Add to telemetry context so it's visible to observability wrappers + return callctx.WithTelemetryContext(ctx, "resend_count", strconv.Itoa(retryCount)) } // Invoke calls the given APICall, performing retries as specified by opts, if @@ -77,7 +77,7 @@ func Sleep(ctx context.Context, d time.Duration) error { type sleeper func(ctx context.Context, d time.Duration) error // invoke implements Invoke, taking an additional sleeper argument for testing. -func invoke(ctx context.Context, call APICall, settings CallSettings, sp sleeper) error { +func invoke(ctx context.Context, call APICall, settings CallSettings, sp sleeper) (err error) { var retryer Retryer // Only use the value provided via WithTimeout if the context doesn't @@ -89,6 +89,14 @@ func invoke(ctx context.Context, call APICall, settings CallSettings, sp sleeper ctx = c } + if IsFeatureEnabled("METRICS") { + start := time.Now() + ctx = InjectTransportTelemetry(ctx, &TransportTelemetryData{}) + defer func() { + recordMetric(ctx, settings, time.Since(start), err) + }() + } + retryCount := 0 // Feature gate: GOOGLE_SDK_GO_EXPERIMENTAL_TRACING=true tracingEnabled := IsFeatureEnabled("TRACING") @@ -97,7 +105,7 @@ func invoke(ctx context.Context, call APICall, settings CallSettings, sp sleeper if tracingEnabled { ctxToUse = withRetryCount(ctx, retryCount) } - err := call(ctxToUse, settings) + err = call(ctxToUse, settings) if err == nil { return nil } diff --git a/vendor/github.com/googleapis/gax-go/v2/telemetry.go b/vendor/github.com/googleapis/gax-go/v2/telemetry.go new file mode 100644 index 00000000000..b849b36919d --- /dev/null +++ b/vendor/github.com/googleapis/gax-go/v2/telemetry.go @@ -0,0 +1,469 @@ +// Copyright 2026, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package gax + +import ( + "context" + "errors" + "fmt" + "log/slog" + "strconv" + "sync" + "time" + + "github.com/googleapis/gax-go/v2/apierror" + "github.com/googleapis/gax-go/v2/callctx" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/metric" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +// TransportTelemetryData contains mutable telemetry information that the transport +// layer (e.g. gRPC or HTTP) populates during an RPC. This allows gax.Invoke to +// correctly emit metric data without directly importing those transport layers. +// TransportTelemetryData is experimental and may be modified or removed in future versions, +// regardless of any other documented package stability guarantees. +// It should not be used by external consumers. +type TransportTelemetryData struct { + serverAddress string + serverPort int +} + +// SetServerAddress sets the server address. +// Experimental: This function is experimental and may be modified or removed in future versions, +// regardless of any other documented package stability guarantees. +func (d *TransportTelemetryData) SetServerAddress(addr string) { d.serverAddress = addr } + +// ServerAddress returns the server address. +// Experimental: This function is experimental and may be modified or removed in future versions, +// regardless of any other documented package stability guarantees. +func (d *TransportTelemetryData) ServerAddress() string { return d.serverAddress } + +// SetServerPort sets the server port. +// Experimental: This function is experimental and may be modified or removed in future versions, +// regardless of any other documented package stability guarantees. +func (d *TransportTelemetryData) SetServerPort(port int) { d.serverPort = port } + +// ServerPort returns the server port. +// Experimental: This function is experimental and may be modified or removed in future versions, +// regardless of any other documented package stability guarantees. +func (d *TransportTelemetryData) ServerPort() int { return d.serverPort } + +// transportTelemetryKey is the private context key used to inject TransportTelemetryData +type transportTelemetryKey struct{} + +// InjectTransportTelemetry injects a mutable TransportTelemetryData pointer into the context. +// Experimental: This function is experimental and may be modified or removed in future versions, +// regardless of any other documented package stability guarantees. +func InjectTransportTelemetry(ctx context.Context, data *TransportTelemetryData) context.Context { + return context.WithValue(ctx, transportTelemetryKey{}, data) +} + +// ExtractTransportTelemetry retrieves a mutable TransportTelemetryData pointer from the context. +// It returns nil if the data is not present. +// Experimental: This function is experimental and may be modified or removed in future versions, +// regardless of any other documented package stability guarantees. +func ExtractTransportTelemetry(ctx context.Context) *TransportTelemetryData { + data, _ := ctx.Value(transportTelemetryKey{}).(*TransportTelemetryData) + return data +} + +const ( + metricName = "gcp.client.request.duration" + metricDescription = "Duration of the request to the Google Cloud API" + + // Constants for ClientMetrics configuration map keys. + // These are used by generated clients to pass attributes to the ClientMetrics option. + // Because they are used in generated code, these values must not be changed. + + // ClientService is the Google Cloud API service name. E.g. "storage". + ClientService = "client_service" + // ClientVersion is the version of the client. E.g. "1.43.0". + ClientVersion = "client_version" + // ClientArtifact is the library name. E.g. "cloud.google.com/go/storage". + ClientArtifact = "client_artifact" + // RPCSystem is the RPC system type. E.g. "grpc" or "http". + RPCSystem = "rpc_system" + // URLDomain is the nominal service domain. E.g. "storage.googleapis.com". + URLDomain = "url_domain" + + // Constants for telemetry attribute keys. + keyGCPClientService = "gcp.client.service" + keyRPCSystemName = "rpc.system.name" + keyURLDomain = "url.domain" + + // SchemaURL specifies the OpenTelemetry schema version. + schemaURL = "https://opentelemetry.io/schemas/1.39.0" +) + +// Default bucket boundaries for the duration metric in seconds. +// An exponential-ish distribution. +var defaultHistogramBoundaries = []float64{ + 0.0, 0.0001, 0.0005, 0.0010, 0.005, 0.010, 0.050, 0.100, 0.5, 1.0, 5.0, 10.0, 60.0, 300.0, 900.0, 3600.0, +} + +// ClientMetrics contains the pre-allocated OpenTelemetry instruments and attributes +// for a specific generated Google Cloud client library. +// There should be exactly one ClientMetrics instance instantiated per generated client. +type ClientMetrics struct { + get func() clientMetricsData +} + +type clientMetricsData struct { + duration metric.Float64Histogram + attr []attribute.KeyValue +} + +type telemetryOptions struct { + provider metric.MeterProvider + attributes map[string]string + explicitBucketBoundaries []float64 + logger *slog.Logger +} + +// TelemetryOption is an option to configure a ClientMetrics instance. +// TelemetryOption works by modifying relevant fields of telemetryOptions. +type TelemetryOption interface { + // Resolve applies the option by modifying opts. + Resolve(opts *telemetryOptions) +} + +type providerOpt struct { + p metric.MeterProvider +} + +func (p providerOpt) Resolve(opts *telemetryOptions) { + opts.provider = p.p +} + +// WithMeterProvider specifies the metric.MeterProvider to use for instruments. +func WithMeterProvider(p metric.MeterProvider) TelemetryOption { + return &providerOpt{p: p} +} + +type attrOpt struct { + attrs map[string]string +} + +func (a attrOpt) Resolve(opts *telemetryOptions) { + opts.attributes = a.attrs +} + +// WithTelemetryAttributes specifies the static attributes attachments. +func WithTelemetryAttributes(attr map[string]string) TelemetryOption { + return &attrOpt{attrs: attr} +} + +type boundariesOpt struct { + boundaries []float64 +} + +func (b boundariesOpt) Resolve(opts *telemetryOptions) { + opts.explicitBucketBoundaries = b.boundaries +} + +// WithExplicitBucketBoundaries overrides the default histogram bucket boundaries. +func WithExplicitBucketBoundaries(boundaries []float64) TelemetryOption { + return &boundariesOpt{boundaries: boundaries} +} + +type loggerOpt struct { + l *slog.Logger +} + +func (l loggerOpt) Resolve(opts *telemetryOptions) { + opts.logger = l.l +} + +// WithTelemetryLogger specifies a logger to record internal telemetry errors. +func WithTelemetryLogger(l *slog.Logger) TelemetryOption { + return &loggerOpt{l: l} +} + +func (config *telemetryOptions) meterProvider() metric.MeterProvider { + if config.provider != nil { + return config.provider + } + return otel.GetMeterProvider() +} + +func (config *telemetryOptions) bucketBoundaries() []float64 { + if len(config.explicitBucketBoundaries) > 0 { + return config.explicitBucketBoundaries + } + return defaultHistogramBoundaries +} + +// NewClientMetrics initializes and returns a new ClientMetrics instance. +// It is intended to be called once per generated client during initialization. +func NewClientMetrics(opts ...TelemetryOption) *ClientMetrics { + var config telemetryOptions + for _, opt := range opts { + opt.Resolve(&config) + } + + return &ClientMetrics{ + get: sync.OnceValue(func() clientMetricsData { + provider := config.meterProvider() + + var meterAttrs []attribute.KeyValue + if val, ok := config.attributes[ClientService]; ok { + meterAttrs = append(meterAttrs, attribute.KeyValue{Key: attribute.Key(keyGCPClientService), Value: attribute.StringValue(val)}) + } + + meterOpts := []metric.MeterOption{ + metric.WithInstrumentationVersion(config.attributes[ClientVersion]), + metric.WithSchemaURL(schemaURL), + } + if len(meterAttrs) > 0 { + meterOpts = append(meterOpts, metric.WithInstrumentationAttributes(meterAttrs...)) + } + + meter := provider.Meter(config.attributes[ClientArtifact], meterOpts...) + + boundaries := config.bucketBoundaries() + + duration, err := meter.Float64Histogram( + metricName, + metric.WithDescription(metricDescription), + metric.WithUnit("s"), + metric.WithExplicitBucketBoundaries(boundaries...), + ) + if err != nil && config.logger != nil { + config.logger.Warn("failed to initialize OTel duration histogram", "error", err) + } + + var attr []attribute.KeyValue + if val, ok := config.attributes[URLDomain]; ok { + attr = append(attr, attribute.KeyValue{Key: attribute.Key(keyURLDomain), Value: attribute.StringValue(val)}) + } + if val, ok := config.attributes[RPCSystem]; ok { + attr = append(attr, attribute.KeyValue{Key: attribute.Key(keyRPCSystemName), Value: attribute.StringValue(val)}) + } + return clientMetricsData{ + duration: duration, + attr: attr, + } + }), + } +} + +func (cm *ClientMetrics) durationHistogram() metric.Float64Histogram { + if cm == nil || cm.get == nil { + return nil + } + return cm.get().duration +} + +func (cm *ClientMetrics) attributes() []attribute.KeyValue { + if cm == nil || cm.get == nil { + return nil + } + return cm.get().attr +} + +var codeToStr = [...]string{ + "OK", // codes.OK = 0 + "CANCELED", // codes.Canceled = 1 + "UNKNOWN", // codes.Unknown = 2 + "INVALID_ARGUMENT", // codes.InvalidArgument = 3 + "DEADLINE_EXCEEDED", // codes.DeadlineExceeded = 4 + "NOT_FOUND", // codes.NotFound = 5 + "ALREADY_EXISTS", // codes.AlreadyExists = 6 + "PERMISSION_DENIED", // codes.PermissionDenied = 7 + "RESOURCE_EXHAUSTED", // codes.ResourceExhausted = 8 + "FAILED_PRECONDITION", // codes.FailedPrecondition = 9 + "ABORTED", // codes.Aborted = 10 + "OUT_OF_RANGE", // codes.OutOfRange = 11 + "UNIMPLEMENTED", // codes.Unimplemented = 12 + "INTERNAL", // codes.Internal = 13 + "UNAVAILABLE", // codes.Unavailable = 14 + "DATA_LOSS", // codes.DataLoss = 15 + "UNAUTHENTICATED", // codes.Unauthenticated = 16 +} + +// grpcCodeToStatusString converts a codes.Code to its string representation. +// Experimental: This function is experimental and may be modified or removed in future versions, +// regardless of any other documented package stability guarantees. +func grpcCodeToStatusString(c codes.Code) string { + if int(c) >= 0 && int(c) < len(codeToStr) { + return codeToStr[c] + } + return "UNKNOWN" +} + +// TelemetryErrorInfo contains the mapped error type and status code, as well as +// additional details like status message, domain, and metadata, extracted from an error +// for telemetry purposes. +type TelemetryErrorInfo struct { + // ErrorType is a mapped string for the error type. + // For stability, this maps client-side cancellations, timeouts, and known gRPC + // status codes to standard string literals (e.g., "CLIENT_TIMEOUT", + // "PERMISSION_DENIED"), and falls back to %T for unhandled types. If an + // apierror.APIError is found, it uses its fine-grained Reason() (e.g., + // "SERVICE_DISABLED"). + // This is used by metrics, tracing, and logging. + ErrorType string + // StatusCode is the string representation of the RPC status code. + // This is used by metrics, tracing, and logging. + StatusCode string + // StatusMessage is the raw message from the error. + // This is used for structured logging. + StatusMessage string + // Domain is the domain of the error, extracted from an ErrorInfo, if available. + // This is used for structured logging. + Domain string + // Metadata is the metadata of the error, extracted from an ErrorInfo, if available. + // This is used for structured logging. + Metadata map[string]string + + // _ struct{} prevents unkeyed struct literals, ensuring backwards + // compatibility when new fields are added in the future. + _ struct{} +} + +// ExtractTelemetryErrorInfo parses an error into a TelemetryErrorInfo struct. +// It relies on standard gRPC status codes, apierror.APIError parsing, and +// context inspection to determine the most accurate error classification and +// provide detailed metadata for telemetry systems. +// +// Experimental: This function is experimental and may be modified or removed in future versions, +// regardless of any other documented package stability guarantees. +func ExtractTelemetryErrorInfo(ctx context.Context, err error) TelemetryErrorInfo { + if err == nil { + return TelemetryErrorInfo{ErrorType: "", StatusCode: "OK"} + } + + st, ok := status.FromError(err) + if !ok { + st = status.FromContextError(err) + } + rpcStatusCode := grpcCodeToStatusString(st.Code()) + + var errType string + // 1. Check if the local context expired or was cancelled. This is the only + // reliable way to distinguish a local client timeout from a server timeout + // because gRPC does not wrap context errors in its status.Error types. + if errors.Is(ctx.Err(), context.DeadlineExceeded) { + errType = "CLIENT_TIMEOUT" + } else if errors.Is(ctx.Err(), context.Canceled) { + errType = "CLIENT_CANCELLED" + } else if !ok || st.Code() == codes.Unknown || st.Code() == codes.Internal { + // 2. If the error isn't a context breakdown and the gRPC framework + // doesn't "understand" it (returning ok=false or a generic catch-all + // bucket like Unknown/Internal), we "pack" the actual Go error type + // name into error.type (e.g., "*net.OpError"). This is per the error.type + // [spec](https://opentelemetry.io/docs/specs/semconv/registry/attributes/error/#error-type). + // "When error.type is set to a type (e.g., an exception type), its canonical + // class name identifying the type within the artifact SHOULD be used." + errType = fmt.Sprintf("%T", err) + } else { + // 3. Otherwise, it is a well-understood gRPC protocol error (e.g., + // PERMISSION_DENIED) likely returned by the server. + errType = rpcStatusCode + } + + var msg, domain string + var metadata map[string]string + if ok { + msg = st.Message() + } else { + msg = err.Error() + } + + if parsedErr, parsedOk := apierror.ParseError(err, false); parsedOk { + // If there's an actionable error, the reason takes precedence over our calculated error type. + if reason := parsedErr.Reason(); reason != "" { + errType = reason + } else if httpCode := parsedErr.HTTPCode(); httpCode > 0 { + errType = strconv.Itoa(httpCode) + } + if message := parsedErr.Message(); message != "" { + msg = message + } else if parsedErr.HTTPCode() > 0 { + // For HTTP errors, avoid returning the raw, unformatted err.Error() (e.g. "googleapi: got HTTP response...") + // if the actual parsed message from the response is empty. + msg = "" + } + domain = parsedErr.Domain() + metadata = parsedErr.Metadata() + } + + return TelemetryErrorInfo{ + ErrorType: errType, + StatusCode: rpcStatusCode, + StatusMessage: msg, + Domain: domain, + Metadata: metadata, + } +} + +// recordMetric records a duration measurement for the configured metric. +func recordMetric(ctx context.Context, settings CallSettings, d time.Duration, err error) { + if settings.clientMetrics == nil || settings.clientMetrics.durationHistogram() == nil { + return + } + + // Use context.WithoutCancel to ensure metric records even if context is canceled + // preserving any trace context that might be required for exemplars. + recordCtx := context.WithoutCancel(ctx) + + // Pre-allocate to avoid repeated appends (5 is the max number of dynamic attributes added here) + attrs := make([]attribute.KeyValue, 0, len(settings.clientMetrics.attributes())+5) + attrs = append(attrs, settings.clientMetrics.attributes()...) + + errInfo := ExtractTelemetryErrorInfo(ctx, err) + + if td := ExtractTransportTelemetry(ctx); td != nil { + if td.ServerAddress() != "" { + attrs = append(attrs, attribute.String("server.address", td.ServerAddress())) + } + if td.ServerPort() != 0 { + attrs = append(attrs, attribute.Int("server.port", td.ServerPort())) + } + } + + if errInfo.ErrorType != "" { + attrs = append(attrs, attribute.String("error.type", errInfo.ErrorType)) + } + + attrs = append(attrs, attribute.String("rpc.response.status_code", errInfo.StatusCode)) + + if rpcMethod, ok := callctx.TelemetryFromContext(ctx, "rpc_method"); ok && rpcMethod != "" { + attrs = append(attrs, attribute.String("rpc.method", rpcMethod)) + } + if urlTemplate, ok := callctx.TelemetryFromContext(ctx, "url_template"); ok && urlTemplate != "" { + attrs = append(attrs, attribute.String("url.template", urlTemplate)) + } + + settings.clientMetrics.durationHistogram().Record(recordCtx, d.Seconds(), metric.WithAttributes(attrs...)) +} diff --git a/vendor/github.com/hashicorp/consul/api/agent.go b/vendor/github.com/hashicorp/consul/api/agent.go index 355b2f467b0..fd23dee0ef4 100644 --- a/vendor/github.com/hashicorp/consul/api/agent.go +++ b/vendor/github.com/hashicorp/consul/api/agent.go @@ -159,6 +159,7 @@ type AgentService struct { Proxy *AgentServiceConnectProxyConfig `json:",omitempty"` Connect *AgentServiceConnect `json:",omitempty"` PeerName string `json:",omitempty"` + AI *AgentServiceAI `json:",omitempty" bexpr:"-"` // NOTE: If we ever set the ContentHash outside of singular service lookup then we may need // to include the Namespace in the hash. When we do, then we are in for lots of fun with tests. // For now though, ignoring it works well enough. @@ -211,6 +212,84 @@ type AgentServiceConnectProxyConfig struct { AccessLogs *AccessLogsConfig `json:",omitempty"` } +// AgentServiceAI is the public twin of the internal structs.ServiceAI: the +// inline AI role block on a service registration/lookup. It carries a Role +// discriminator and exactly one role-specific sub-block. Field names mirror the +// internal type so mapstructure-based conversion maps them automatically. +type AgentServiceAI struct { + Role string `json:",omitempty"` + InferenceModel *AgentAIInferenceModel `json:",omitempty"` + MCPServer *AgentAIMCPServer `json:",omitempty"` + Agent *AgentAIAgent `json:",omitempty"` +} + +// AgentAIInferenceModel is the role-specific config for the inference-model role. +type AgentAIInferenceModel struct { + Protocol string `json:",omitempty"` + Path string `json:",omitempty"` + Defaults *AgentAIModelDefaults `json:",omitempty"` +} + +// AgentAIModelDefaults carries optional request defaults for an inference model. +type AgentAIModelDefaults struct { + MaxTokens int `json:",omitempty"` + Temperature float64 `json:",omitempty"` +} + +// AgentAIMCPServer is the role-specific config for the mcp-server role. +type AgentAIMCPServer struct { + Transport string `json:",omitempty"` + Path string `json:",omitempty"` + ProtocolVersion string `json:",omitempty"` +} + +// AgentAIAgent is the role-specific config for the ai-agent role. +type AgentAIAgent struct { + Inference *AgentAIAgentInference `json:",omitempty"` + MCP *AgentAIAgentMCP `json:",omitempty"` + RateLimits *AgentAIAgentRateLimits `json:",omitempty"` + Interceptor *AgentAIAgentInterceptor `json:",omitempty"` +} + +// AgentAIAgentInference describes the inference specialization for an agent. +type AgentAIAgentInference struct { + Specialization []string `json:",omitempty"` + Vendor string `json:",omitempty"` +} + +// AgentAIAgentMCP is the MCP egress configuration for an agent. +type AgentAIAgentMCP struct { + Port int `json:",omitempty"` + HITL *AgentAIAgentMCPHITL `json:",omitempty"` +} + +// AgentAIAgentMCPHITL is the human-in-the-loop approval configuration for MCP +// tool calls. +type AgentAIAgentMCPHITL struct { + Port int `json:",omitempty"` + ApprovalTimeout string `json:",omitempty"` +} + +// AgentAIAgentRateLimits are per-agent tool-call rate limits. +type AgentAIAgentRateLimits struct { + ToolCallsPerMinute int `json:",omitempty"` + ToolCallsPerHour int `json:",omitempty"` +} + +// AgentAIAgentInterceptor configures the co-located governance interceptor the +// sidecar reaches over plaintext loopback. +type AgentAIAgentInterceptor struct { + Port int `json:",omitempty"` +} + +// AgentAISecret is a reference to a secret stored in an external provider. It +// never holds the literal secret value. +type AgentAISecret struct { + Provider string `json:",omitempty"` + Path string `json:",omitempty"` + Field string `json:",omitempty"` +} + const ( // MemberTagKeyACLMode is the key used to indicate what ACL mode the agent is // operating in. The values of this key will be one of the MemberACLMode constants @@ -365,6 +444,7 @@ type AgentServiceRegistration struct { Checks AgentServiceChecks Proxy *AgentServiceConnectProxyConfig `json:",omitempty"` Connect *AgentServiceConnect `json:",omitempty"` + AI *AgentServiceAI `json:",omitempty" bexpr:"-"` Namespace string `json:",omitempty" bexpr:"-" hash:"ignore"` Partition string `json:",omitempty" bexpr:"-" hash:"ignore"` Locality *Locality `json:",omitempty" bexpr:"-" hash:"ignore"` diff --git a/vendor/github.com/hashicorp/consul/api/config_entry.go b/vendor/github.com/hashicorp/consul/api/config_entry.go index e82e14749db..de45fe23c65 100644 --- a/vendor/github.com/hashicorp/consul/api/config_entry.go +++ b/vendor/github.com/hashicorp/consul/api/config_entry.go @@ -43,6 +43,7 @@ const ( const ( BuiltinAWSLambdaExtension string = "builtin/aws/lambda" BuiltinExtAuthzExtension string = "builtin/ext-authz" + BuiltinExtProcExtension string = "builtin/ext-proc" BuiltinLuaExtension string = "builtin/lua" BuiltinOTELAccessLoggingExtension string = "builtin/otel-access-logging" BuiltinPropertyOverrideExtension string = "builtin/property-override" @@ -328,6 +329,12 @@ type UpstreamLimits struct { // to the upstream cluster at a point in time. This is mostly applicable to HTTP/2 // clusters since all HTTP/1.1 requests are limited by MaxConnections. MaxConcurrentRequests *int `alias:"max_concurrent_requests"` + + // PassiveHealthCheck configuration determines how upstream proxy instances will + // be monitored for removal from the load balancing pool. When set on an API + // gateway's Defaults it applies to all routed services; a per-service value + // overrides it. + PassiveHealthCheck *PassiveHealthCheck `json:",omitempty" alias:"passive_health_check"` } // RateLimits is rate limiting configuration that is applied to diff --git a/vendor/github.com/hashicorp/consul/api/config_entry_gateways.go b/vendor/github.com/hashicorp/consul/api/config_entry_gateways.go index 6397088c9e8..9c204f55370 100644 --- a/vendor/github.com/hashicorp/consul/api/config_entry_gateways.go +++ b/vendor/github.com/hashicorp/consul/api/config_entry_gateways.go @@ -228,6 +228,24 @@ func (g *TerminatingGatewayConfigEntry) GetMeta() map[string]string { return g.M func (g *TerminatingGatewayConfigEntry) GetCreateIndex() uint64 { return g.CreateIndex } func (g *TerminatingGatewayConfigEntry) GetModifyIndex() uint64 { return g.ModifyIndex } +// APIGatewayListenerProtocol is the protocol that an APIGateway listener uses. +type APIGatewayListenerProtocol = string + +const ( + // APIGatewayListenerProtocolHTTP configures an HTTP/1.1 listener. + APIGatewayListenerProtocolHTTP APIGatewayListenerProtocol = "http" + // APIGatewayListenerProtocolHTTP2 configures an HTTP/2 listener. The + // downstream connection manager uses the HTTP/2 codec and advertises h2 + // via ALPN; the upstream cluster also negotiates HTTP/2 end-to-end. + APIGatewayListenerProtocolHTTP2 APIGatewayListenerProtocol = "http2" + // APIGatewayListenerProtocolGRPC configures a gRPC listener. It is + // identical to http2 at the transport level; Consul routes gRPC traffic + // using standard HTTP/2 path-based matching (/package.Service/Method). + APIGatewayListenerProtocolGRPC APIGatewayListenerProtocol = "grpc" + // APIGatewayListenerProtocolTCP configures a plain TCP listener. + APIGatewayListenerProtocolTCP APIGatewayListenerProtocol = "tcp" +) + // APIGatewayConfigEntry manages the configuration for an API gateway // with the given name. type APIGatewayConfigEntry struct { @@ -250,6 +268,15 @@ type APIGatewayConfigEntry struct { // Defaults contains default upstream limits for all route destination services. Defaults *UpstreamLimits `json:",omitempty"` + + // ExtAuthz is the gateway-wide external authorization toggle. It controls the + // default ext_authz posture for every endpoint behind this gateway when the + // builtin/ext-authz EnvoyExtension is applied via service-defaults. When nil + // (omitted) ext_authz is enabled by default; when set with Enabled=false the + // filter defaults to disabled and routes must opt in individually. Per-route + // http-route ExtAuthz filters take precedence over this toggle. + ExtAuthz *APIGatewayExtAuthz `json:",omitempty"` + // Status is the asynchronous status which an APIGateway propagates to the user. Status ConfigEntryStatus @@ -279,6 +306,16 @@ func (g *APIGatewayConfigEntry) GetMeta() map[string]string { return g.Meta } func (g *APIGatewayConfigEntry) GetCreateIndex() uint64 { return g.CreateIndex } func (g *APIGatewayConfigEntry) GetModifyIndex() uint64 { return g.ModifyIndex } +// APIGatewayExtAuthz is the gateway-wide external authorization toggle on an +// APIGatewayConfigEntry. See APIGatewayConfigEntry.ExtAuthz. +type APIGatewayExtAuthz struct { + // Enabled controls the default ext_authz posture for all endpoints behind + // the gateway. When false the ext_authz filter defaults to disabled and + // individual http-route rules must opt in. When the containing ExtAuthz + // block is omitted entirely, ext_authz is enabled by default. + Enabled bool +} + // APIGatewayListener represents an individual listener for an APIGateway type APIGatewayListener struct { // Name is the name of the listener in a given gateway. This must be @@ -289,8 +326,10 @@ type APIGatewayListener struct { Hostname string // Port is the port at which this listener should bind. Port int - // Protocol is the protocol that a listener should use, it must - // either be "http" or "tcp" + // Protocol is the protocol that a listener should use. Valid values are + // APIGatewayListenerProtocolHTTP ("http"), APIGatewayListenerProtocolHTTP2 + // ("http2"), APIGatewayListenerProtocolGRPC ("grpc"), and + // APIGatewayListenerProtocolTCP ("tcp"). Protocol string // TLS is the TLS settings for the listener. TLS APIGatewayTLSConfiguration @@ -304,7 +343,7 @@ type APIGatewayListener struct { MaxRequestHeadersKB *uint32 `json:",omitempty"` } -// APIGatewayTLSConfiguration specifies the configuration of a listener’s +// APIGatewayTLSConfiguration specifies the configuration of a listener's // TLS settings. type APIGatewayTLSConfiguration struct { // Certificates is a set of references to certificates diff --git a/vendor/github.com/hashicorp/consul/api/config_entry_routes.go b/vendor/github.com/hashicorp/consul/api/config_entry_routes.go index e6a1d6a722c..cc6d5363f22 100644 --- a/vendor/github.com/hashicorp/consul/api/config_entry_routes.go +++ b/vendor/github.com/hashicorp/consul/api/config_entry_routes.go @@ -159,9 +159,10 @@ const ( // HTTPHeaderMatch specifies how a match should be done // on a request's headers. type HTTPHeaderMatch struct { - Match HTTPHeaderMatchType - Name string - Value string + Match HTTPHeaderMatchType + Name string + Value string + Invert bool `json:",omitempty"` } // HTTPPathMatchType specifies how path matching criteria @@ -207,6 +208,52 @@ type HTTPFilters struct { RetryFilter *RetryFilter TimeoutFilter *TimeoutFilter JWT *JWTFilter + ExtProc []ExtProcFilter + // ExtAuthz controls the ext_authz HTTP filter behaviour for routes on an + // API Gateway that has a builtin/ext-authz EnvoyExtension applied. When set, + // it overrides the gateway-wide ExtAuthz toggle for the matched route: + // Enabled=true forces the ext_authz check to run, Enabled=false skips it. + // When nil, the route inherits the gateway-wide default. Exclusions are + // controlled exclusively at the http-route level. + ExtAuthz *HTTPRouteExtAuthzFilter +} + +// ExtProcFilter provides per-route control of a builtin/ext-proc attachment. +type ExtProcFilter struct { + StatPrefix string `json:",omitempty"` + Mode string `json:",omitempty"` + Overrides *ExtProcOverrides `json:",omitempty"` +} + +// ExtProcOverrides carries per-route overrides applied when Mode is "override". +type ExtProcOverrides struct { + Processing *ExtProcProcessing `json:",omitempty"` + // MessageTimeout string `json:",omitempty"` + // FailureModeAllow *bool `json:",omitempty"` +} + +// ExtProcProcessing configures request and response processing modes. +type ExtProcProcessing struct { + Request *ExtProcProcessingDirection `json:",omitempty"` + Response *ExtProcProcessingDirection `json:",omitempty"` +} + +// ExtProcProcessingDirection configures processing modes for one direction. +type ExtProcProcessingDirection struct { + HeadersMode string `json:",omitempty"` + BodyMode string `json:",omitempty"` + TrailersMode string `json:",omitempty"` + MaxBodyBytes int64 `json:",omitempty"` +} + +// HTTPRouteExtAuthzFilter controls ext_authz filter behaviour at the +// individual http-route rule level. +type HTTPRouteExtAuthzFilter struct { + // Enabled controls whether Envoy runs the ext_authz check for requests + // matched by this rule. Enabled=true force-enables the check (overriding a + // disabled gateway toggle); Enabled=false force-skips it. This takes + // precedence over the gateway-wide ExtAuthz toggle. + Enabled bool } // HTTPResponseFilters specifies a list of filters used to modify a diff --git a/vendor/github.com/hashicorp/consul/api/operator_feature_gate.go b/vendor/github.com/hashicorp/consul/api/operator_feature_gate.go new file mode 100644 index 00000000000..62601a65493 --- /dev/null +++ b/vendor/github.com/hashicorp/consul/api/operator_feature_gate.go @@ -0,0 +1,104 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package api + +import ( + "net/url" + "strconv" +) + +type FeatureGate struct { + Name string + Stage string + MinVersion string + DefaultEnabled bool + BeforeMinimumVersion string + Description string + Owner string + DesiredEnabled bool + EffectiveEnabled bool + Eligible bool + Source string + Reason string + PolicyIndex uint64 + StatusIndex uint64 +} + +type FeatureGateSetRequest struct { + Enabled bool +} + +type FeatureGateSetResponse struct { + Applied bool + Feature FeatureGate +} + +func (op *Operator) FeatureGateList(q *QueryOptions) ([]FeatureGate, *QueryMeta, error) { + r := op.c.newRequest("GET", "/v1/operator/features") + r.setQueryOptions(q) + rtt, resp, err := op.c.doRequest(r) + if err != nil { + return nil, nil, err + } + defer closeResponseBody(resp) + if err := requireOK(resp); err != nil { + return nil, nil, err + } + + meta := &QueryMeta{} + parseQueryMeta(resp, meta) + meta.RequestTime = rtt + var out []FeatureGate + if err := decodeBody(resp, &out); err != nil { + return nil, nil, err + } + return out, meta, nil +} + +func (op *Operator) FeatureGateGet(name string, q *QueryOptions) (*FeatureGate, *QueryMeta, error) { + r := op.c.newRequest("GET", "/v1/operator/feature/"+url.PathEscape(name)) + r.setQueryOptions(q) + rtt, resp, err := op.c.doRequest(r) + if err != nil { + return nil, nil, err + } + defer closeResponseBody(resp) + if err := requireOK(resp); err != nil { + return nil, nil, err + } + + meta := &QueryMeta{} + parseQueryMeta(resp, meta) + meta.RequestTime = rtt + var out FeatureGate + if err := decodeBody(resp, &out); err != nil { + return nil, nil, err + } + return &out, meta, nil +} + +// FeatureGateSet records explicit operator intent. expectedPolicyIndex zero +// means no caller-supplied CAS; the server still uses internal CAS fencing. +func (op *Operator) FeatureGateSet(name string, enabled bool, expectedPolicyIndex uint64, q *WriteOptions) (*FeatureGateSetResponse, error) { + r := op.c.newRequest("PUT", "/v1/operator/feature/"+url.PathEscape(name)) + r.setWriteOptions(q) + if expectedPolicyIndex != 0 { + r.params.Set("cas", strconv.FormatUint(expectedPolicyIndex, 10)) + } + r.obj = FeatureGateSetRequest{Enabled: enabled} + _, resp, err := op.c.doRequest(r) + if err != nil { + return nil, err + } + defer closeResponseBody(resp) + if err := requireOK(resp); err != nil { + return nil, err + } + + var out FeatureGateSetResponse + if err := decodeBody(resp, &out); err != nil { + return nil, err + } + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-metrics/compat/armon.go b/vendor/github.com/hashicorp/go-metrics/compat/armon.go new file mode 100644 index 00000000000..6a9e1e59661 --- /dev/null +++ b/vendor/github.com/hashicorp/go-metrics/compat/armon.go @@ -0,0 +1,131 @@ +// Copyright IBM Corp. 2013, 2025 +// SPDX-License-Identifier: MIT + +//go:build armonmetrics || ignore || !hashicorpmetrics + +package metrics + +import ( + "io" + "net/url" + "syscall" + "time" + + "github.com/armon/go-metrics" +) + +const ( + // DefaultSignal is used with DefaultInmemSignal + DefaultSignal = metrics.DefaultSignal +) + +func AddSample(key []string, val float32) { + metrics.AddSample(key, val) +} +func AddSampleWithLabels(key []string, val float32, labels []Label) { + metrics.AddSampleWithLabels(key, val, labels) +} +func EmitKey(key []string, val float32) { + metrics.EmitKey(key, val) +} +func IncrCounter(key []string, val float32) { + metrics.IncrCounter(key, val) +} +func IncrCounterWithLabels(key []string, val float32, labels []Label) { + metrics.IncrCounterWithLabels(key, val, labels) +} +func MeasureSince(key []string, start time.Time) { + metrics.MeasureSince(key, start) +} +func MeasureSinceWithLabels(key []string, start time.Time, labels []Label) { + metrics.MeasureSinceWithLabels(key, start, labels) +} +func SetGauge(key []string, val float32) { + metrics.SetGauge(key, val) +} +func SetGaugeWithLabels(key []string, val float32, labels []Label) { + metrics.SetGaugeWithLabels(key, val, labels) +} +func Shutdown() { + metrics.Shutdown() +} +func UpdateFilter(allow, block []string) { + metrics.UpdateFilter(allow, block) +} +func UpdateFilterAndLabels(allow, block, allowedLabels, blockedLabels []string) { + metrics.UpdateFilterAndLabels(allow, block, allowedLabels, blockedLabels) +} + +type AggregateSample = metrics.AggregateSample +type BlackholeSink = metrics.BlackholeSink +type Config = metrics.Config +type Encoder = metrics.Encoder +type FanoutSink = metrics.FanoutSink +type GaugeValue = metrics.GaugeValue +type InmemSignal = metrics.InmemSignal +type InmemSink = metrics.InmemSink +type IntervalMetrics = metrics.IntervalMetrics +type Label = metrics.Label +type MetricSink = metrics.MetricSink +type Metrics = metrics.Metrics +type MetricsSummary = metrics.MetricsSummary +type PointValue = metrics.PointValue +type SampledValue = metrics.SampledValue +type ShutdownSink = metrics.ShutdownSink +type StatsdSink = metrics.StatsdSink +type StatsiteSink = metrics.StatsiteSink + +func DefaultConfig(serviceName string) *Config { + return metrics.DefaultConfig(serviceName) +} + +func DefaultInmemSignal(inmem *InmemSink) *InmemSignal { + return metrics.DefaultInmemSignal(inmem) +} +func NewInmemSignal(inmem *InmemSink, sig syscall.Signal, w io.Writer) *InmemSignal { + return metrics.NewInmemSignal(inmem, sig, w) +} + +func NewInmemSink(interval, retain time.Duration) *InmemSink { + return metrics.NewInmemSink(interval, retain) +} + +func NewIntervalMetrics(intv time.Time) *IntervalMetrics { + return metrics.NewIntervalMetrics(intv) +} + +func NewInmemSinkFromURL(u *url.URL) (MetricSink, error) { + return metrics.NewInmemSinkFromURL(u) +} + +func NewMetricSinkFromURL(urlStr string) (MetricSink, error) { + return metrics.NewMetricSinkFromURL(urlStr) +} + +func NewStatsdSinkFromURL(u *url.URL) (MetricSink, error) { + return metrics.NewStatsdSinkFromURL(u) +} + +func NewStatsiteSinkFromURL(u *url.URL) (MetricSink, error) { + return metrics.NewStatsiteSinkFromURL(u) +} + +func Default() *Metrics { + return metrics.Default() +} + +func New(conf *Config, sink MetricSink) (*Metrics, error) { + return metrics.New(conf, sink) +} + +func NewGlobal(conf *Config, sink MetricSink) (*Metrics, error) { + return metrics.NewGlobal(conf, sink) +} + +func NewStatsdSink(addr string) (*StatsdSink, error) { + return metrics.NewStatsdSink(addr) +} + +func NewStatsiteSink(addr string) (*StatsiteSink, error) { + return metrics.NewStatsiteSink(addr) +} diff --git a/vendor/github.com/hashicorp/go-metrics/compat/hashicorp.go b/vendor/github.com/hashicorp/go-metrics/compat/hashicorp.go new file mode 100644 index 00000000000..8a8f7acc1c6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-metrics/compat/hashicorp.go @@ -0,0 +1,131 @@ +// Copyright IBM Corp. 2013, 2025 +// SPDX-License-Identifier: MIT + +//go:build hashicorpmetrics + +package metrics + +import ( + "io" + "net/url" + "syscall" + "time" + + "github.com/hashicorp/go-metrics" +) + +const ( + // DefaultSignal is used with DefaultInmemSignal + DefaultSignal = metrics.DefaultSignal +) + +func AddSample(key []string, val float32) { + metrics.AddSample(key, val) +} +func AddSampleWithLabels(key []string, val float32, labels []Label) { + metrics.AddSampleWithLabels(key, val, labels) +} +func EmitKey(key []string, val float32) { + metrics.EmitKey(key, val) +} +func IncrCounter(key []string, val float32) { + metrics.IncrCounter(key, val) +} +func IncrCounterWithLabels(key []string, val float32, labels []Label) { + metrics.IncrCounterWithLabels(key, val, labels) +} +func MeasureSince(key []string, start time.Time) { + metrics.MeasureSince(key, start) +} +func MeasureSinceWithLabels(key []string, start time.Time, labels []Label) { + metrics.MeasureSinceWithLabels(key, start, labels) +} +func SetGauge(key []string, val float32) { + metrics.SetGauge(key, val) +} +func SetGaugeWithLabels(key []string, val float32, labels []Label) { + metrics.SetGaugeWithLabels(key, val, labels) +} +func Shutdown() { + metrics.Shutdown() +} +func UpdateFilter(allow, block []string) { + metrics.UpdateFilter(allow, block) +} +func UpdateFilterAndLabels(allow, block, allowedLabels, blockedLabels []string) { + metrics.UpdateFilterAndLabels(allow, block, allowedLabels, blockedLabels) +} + +type AggregateSample = metrics.AggregateSample +type BlackholeSink = metrics.BlackholeSink +type Config = metrics.Config +type Encoder = metrics.Encoder +type FanoutSink = metrics.FanoutSink +type GaugeValue = metrics.GaugeValue +type InmemSignal = metrics.InmemSignal +type InmemSink = metrics.InmemSink +type IntervalMetrics = metrics.IntervalMetrics +type Label = metrics.Label +type MetricSink = metrics.MetricSink +type Metrics = metrics.Metrics +type MetricsSummary = metrics.MetricsSummary +type PointValue = metrics.PointValue +type SampledValue = metrics.SampledValue +type ShutdownSink = metrics.ShutdownSink +type StatsdSink = metrics.StatsdSink +type StatsiteSink = metrics.StatsiteSink + +func DefaultConfig(serviceName string) *Config { + return metrics.DefaultConfig(serviceName) +} + +func DefaultInmemSignal(inmem *InmemSink) *InmemSignal { + return metrics.DefaultInmemSignal(inmem) +} +func NewInmemSignal(inmem *InmemSink, sig syscall.Signal, w io.Writer) *InmemSignal { + return metrics.NewInmemSignal(inmem, sig, w) +} + +func NewInmemSink(interval, retain time.Duration) *InmemSink { + return metrics.NewInmemSink(interval, retain) +} + +func NewIntervalMetrics(intv time.Time) *IntervalMetrics { + return metrics.NewIntervalMetrics(intv) +} + +func NewInmemSinkFromURL(u *url.URL) (MetricSink, error) { + return metrics.NewInmemSinkFromURL(u) +} + +func NewMetricSinkFromURL(urlStr string) (MetricSink, error) { + return metrics.NewMetricSinkFromURL(urlStr) +} + +func NewStatsdSinkFromURL(u *url.URL) (MetricSink, error) { + return metrics.NewStatsdSinkFromURL(u) +} + +func NewStatsiteSinkFromURL(u *url.URL) (MetricSink, error) { + return metrics.NewStatsiteSinkFromURL(u) +} + +func Default() *Metrics { + return metrics.Default() +} + +func New(conf *Config, sink MetricSink) (*Metrics, error) { + return metrics.New(conf, sink) +} + +func NewGlobal(conf *Config, sink MetricSink) (*Metrics, error) { + return metrics.NewGlobal(conf, sink) +} + +func NewStatsdSink(addr string) (*StatsdSink, error) { + return metrics.NewStatsdSink(addr) +} + +func NewStatsiteSink(addr string) (*StatsiteSink, error) { + return metrics.NewStatsiteSink(addr) +} diff --git a/vendor/github.com/hashicorp/serf/LICENSE b/vendor/github.com/hashicorp/serf/LICENSE index c33dcc7c928..bfbd0aa577d 100644 --- a/vendor/github.com/hashicorp/serf/LICENSE +++ b/vendor/github.com/hashicorp/serf/LICENSE @@ -1,3 +1,5 @@ +Copyright IBM Corp. 2013, 2026 + Mozilla Public License, version 2.0 1. Definitions diff --git a/vendor/github.com/hashicorp/serf/coordinate/client.go b/vendor/github.com/hashicorp/serf/coordinate/client.go index 32124a73a20..d940987b2b9 100644 --- a/vendor/github.com/hashicorp/serf/coordinate/client.go +++ b/vendor/github.com/hashicorp/serf/coordinate/client.go @@ -1,3 +1,6 @@ +// Copyright IBM Corp. 2013, 2026 +// SPDX-License-Identifier: MPL-2.0 + package coordinate import ( @@ -7,7 +10,7 @@ import ( "sync" "time" - "github.com/armon/go-metrics" + metrics "github.com/hashicorp/go-metrics/compat" ) // Client manages the estimated network coordinate for a given node, and adjusts @@ -52,7 +55,7 @@ type ClientStats struct { // NewClient creates a new Client and verifies the configuration is valid. func NewClient(config *Config) (*Client, error) { - if !(config.Dimensionality > 0) { + if config.Dimensionality == 0 { return nil, fmt.Errorf("dimensionality must be >0") } diff --git a/vendor/github.com/hashicorp/serf/coordinate/config.go b/vendor/github.com/hashicorp/serf/coordinate/config.go index 09c0cafe830..0adcac24451 100644 --- a/vendor/github.com/hashicorp/serf/coordinate/config.go +++ b/vendor/github.com/hashicorp/serf/coordinate/config.go @@ -1,7 +1,12 @@ +// Copyright IBM Corp. 2013, 2026 +// SPDX-License-Identifier: MPL-2.0 + package coordinate import ( - "github.com/armon/go-metrics" + "math/rand" + + metrics "github.com/hashicorp/go-metrics/compat" ) // Config is used to set the parameters of the Vivaldi-based coordinate mapping @@ -11,12 +16,17 @@ import ( // here: // // [1] Dabek, Frank, et al. "Vivaldi: A decentralized network coordinate system." -// ACM SIGCOMM Computer Communication Review. Vol. 34. No. 4. ACM, 2004. +// +// ACM SIGCOMM Computer Communication Review. Vol. 34. No. 4. ACM, 2004. +// // [2] Ledlie, Jonathan, Paul Gardner, and Margo I. Seltzer. "Network Coordinates -// in the Wild." NSDI. Vol. 7. 2007. +// +// in the Wild." NSDI. Vol. 7. 2007. +// // [3] Lee, Sanghwan, et al. "On suitability of Euclidean embedding for -// host-based network coordinate systems." Networking, IEEE/ACM Transactions -// on 18.1 (2010): 27-40. +// +// host-based network coordinate systems." Networking, IEEE/ACM Transactions +// on 18.1 (2010): 27-40. type Config struct { // The dimensionality of the coordinate system. As discussed in [2], more // dimensions improves the accuracy of the estimates up to a point. Per [2] @@ -59,6 +69,8 @@ type Config struct { // metricLabels is the slice of labels to put on all emitted metrics MetricLabels []metrics.Label + + rand *rand.Rand } // DefaultConfig returns a Config that has some default values suitable for @@ -73,5 +85,6 @@ func DefaultConfig() *Config { HeightMin: 10.0e-6, LatencyFilterSize: 3, GravityRho: 150.0, + rand: nil, } } diff --git a/vendor/github.com/hashicorp/serf/coordinate/coordinate.go b/vendor/github.com/hashicorp/serf/coordinate/coordinate.go index fbe792c90d4..09aae3d111f 100644 --- a/vendor/github.com/hashicorp/serf/coordinate/coordinate.go +++ b/vendor/github.com/hashicorp/serf/coordinate/coordinate.go @@ -1,3 +1,6 @@ +// Copyright IBM Corp. 2013, 2026 +// SPDX-License-Identifier: MPL-2.0 + package coordinate import ( @@ -107,7 +110,7 @@ func (c *Coordinate) ApplyForce(config *Config, force float64, other *Coordinate } ret := c.Clone() - unit, mag := unitVectorAt(c.Vec, other.Vec) + unit, mag := unitVectorAt(config.rand, c.Vec, other.Vec) ret.Vec = add(ret.Vec, mul(unit, force)) if mag > zeroThreshold { ret.Height = (ret.Height+other.Height)*force/mag + ret.Height @@ -179,7 +182,7 @@ func magnitude(vec []float64) float64 { // unitVectorAt returns a unit vector pointing at vec1 from vec2. If the two // positions are the same then a random unit vector is returned. We also return // the distance between the points for use in the later height calculation. -func unitVectorAt(vec1 []float64, vec2 []float64) ([]float64, float64) { +func unitVectorAt(rng *rand.Rand, vec1 []float64, vec2 []float64) ([]float64, float64) { ret := diff(vec1, vec2) // If the coordinates aren't on top of each other we can normalize. @@ -189,7 +192,11 @@ func unitVectorAt(vec1 []float64, vec2 []float64) ([]float64, float64) { // Otherwise, just return a random unit vector. for i := range ret { - ret[i] = rand.Float64() - 0.5 + if rng != nil { + ret[i] = rng.Float64() - 0.5 + } else { + ret[i] = rand.Float64() - 0.5 + } } if mag := magnitude(ret); mag > zeroThreshold { return mul(ret, 1.0/mag), 0.0 diff --git a/vendor/github.com/hashicorp/serf/coordinate/phantom.go b/vendor/github.com/hashicorp/serf/coordinate/phantom.go index 66da4e2e92e..4dcdbb66222 100644 --- a/vendor/github.com/hashicorp/serf/coordinate/phantom.go +++ b/vendor/github.com/hashicorp/serf/coordinate/phantom.go @@ -1,3 +1,6 @@ +// Copyright IBM Corp. 2013, 2026 +// SPDX-License-Identifier: MPL-2.0 + package coordinate import ( @@ -30,7 +33,7 @@ func GenerateLine(nodes int, spacing time.Duration) [][]time.Duration { truth[i] = make([]time.Duration, nodes) } - for i := 0; i < nodes; i++ { + for i := range nodes { for j := i + 1; j < nodes; j++ { rtt := time.Duration(j-i) * spacing truth[i][j], truth[j][i] = rtt, rtt @@ -48,7 +51,7 @@ func GenerateGrid(nodes int, spacing time.Duration) [][]time.Duration { } n := int(math.Sqrt(float64(nodes))) - for i := 0; i < nodes; i++ { + for i := range nodes { for j := i + 1; j < nodes; j++ { x1, y1 := float64(i%n), float64(i/n) x2, y2 := float64(j%n), float64(j/n) @@ -72,7 +75,7 @@ func GenerateSplit(nodes int, lan time.Duration, wan time.Duration) [][]time.Dur } split := nodes / 2 - for i := 0; i < nodes; i++ { + for i := range nodes { for j := i + 1; j < nodes; j++ { rtt := lan if (i <= split && j > split) || (i > split && j <= split) { @@ -94,7 +97,7 @@ func GenerateCircle(nodes int, radius time.Duration) [][]time.Duration { truth[i] = make([]time.Duration, nodes) } - for i := 0; i < nodes; i++ { + for i := range nodes { for j := i + 1; j < nodes; j++ { var rtt time.Duration if i == 0 { @@ -118,16 +121,16 @@ func GenerateCircle(nodes int, radius time.Duration) [][]time.Duration { // distributed delays, with the given mean and deviation. The RNG is re-seeded // so you always get the same matrix for a given size. func GenerateRandom(nodes int, mean time.Duration, deviation time.Duration) [][]time.Duration { - rand.Seed(1) + rng := rand.New(rand.NewSource(1)) truth := make([][]time.Duration, nodes) for i := range truth { truth[i] = make([]time.Duration, nodes) } - for i := 0; i < nodes; i++ { + for i := range nodes { for j := i + 1; j < nodes; j++ { - rttSeconds := rand.NormFloat64()*deviation.Seconds() + mean.Seconds() + rttSeconds := rng.NormFloat64()*deviation.Seconds() + mean.Seconds() rtt := time.Duration(rttSeconds * secondsToNanoseconds) truth[i][j], truth[j][i] = rtt, rtt } @@ -142,16 +145,16 @@ func GenerateRandom(nodes int, mean time.Duration, deviation time.Duration) [][] // underlying algorithm which will use random numbers for position vectors when // starting out with everything at the origin). func Simulate(clients []*Client, truth [][]time.Duration, cycles int) { - rand.Seed(1) + rng := rand.New(rand.NewSource(1)) nodes := len(clients) - for cycle := 0; cycle < cycles; cycle++ { + for range cycles { for i := range clients { - if j := rand.Intn(nodes); j != i { + if j := rng.Intn(nodes); j != i { c := clients[j].GetCoordinate() rtt := truth[i][j] node := fmt.Sprintf("node_%d", j) - clients[i].Update(node, c, rtt) + _, _ = clients[i].Update(node, c, rtt) } } } @@ -168,9 +171,12 @@ type Stats struct { // distances and compares them with the given truth matrix, returning summary // stats. func Evaluate(clients []*Client, truth [][]time.Duration) (stats Stats) { + if len(clients) <= 1 { + return + } nodes := len(clients) count := 0 - for i := 0; i < nodes; i++ { + for i := range nodes { for j := i + 1; j < nodes; j++ { est := clients[i].DistanceTo(clients[j].GetCoordinate()).Seconds() actual := truth[i][j].Seconds() diff --git a/vendor/github.com/klauspost/compress/.gitignore b/vendor/github.com/klauspost/compress/.gitignore index d31b3781527..fb06aafe830 100644 --- a/vendor/github.com/klauspost/compress/.gitignore +++ b/vendor/github.com/klauspost/compress/.gitignore @@ -30,3 +30,6 @@ perf.data.old # gdb history .gdb_history + +# Silesia corpus, fetched by testdata/fetch_silesia.sh +**/testdata/silesia.tar* diff --git a/vendor/github.com/klauspost/compress/AGENTS.md b/vendor/github.com/klauspost/compress/AGENTS.md new file mode 100644 index 00000000000..61d24b585ab --- /dev/null +++ b/vendor/github.com/klauspost/compress/AGENTS.md @@ -0,0 +1,104 @@ +# AGENTS.md + +Guidance for people and coding agents changing this repository. It records +conventions and traps learned while working on the decoders and encoders; the +README describes the packages themselves. + +## Checks before sending a change + +- `gofmt`, `go vet ./...` and `go fix -diff ./...` (which should report + nothing). Code written for specific platforms must be vetted for them too: + run `go vet` with `GOOS`/`GOARCH` set to each platform it targets. `go vet` + caches results per package and does not notice edits to files excluded by + build tags; use a fresh `GOCACHE` to confirm a stale-looking error. +- `go test ./...` with and without `-tags=noasm` (and `nounsafe` if you + touched `unsafe` code), on every architecture whose assembly changed. +- Decoder changes: run the fuzzers CI runs (see `.github/workflows/go.yml`), + also with `-tags=noasm`, `-tags=nounsafe` and `-asan`, for longer than CI + does, and for zstd both `FuzzDecodeAll` and the `NoBMI2` variants. +- Raising the Go version in the root `go.mod` breaks the nested modules + (`*/_generate`, `s2/cmd/_s2sx`) until they are updated too. In a `go` + directive, `1.25` sorts before `1.25.0`, so a dependency that needs + `1.25.0` forces the full form. + +## Tests + +- Put a new test in the existing test file for the code it exercises + (`decoder_test.go` for Reader/DecodeAll behaviour, `seqdec_test.go` for + sequence execution, and so on), and reuse its helpers. Use table tests for + three or more similar cases. +- Extend the existing fuzzers (`func Fuzz…`) rather than adding parallel + harnesses; if a new harness supersedes an old one, remove the old one in + the same change. +- Prove which path a test or benchmark exercises. A benchmark once ran the + pure-Go sequence decoder instead of the assembly because of how its buffers + were set up. A `panic` planted in the path is a quick check; `println` + output is easy to miss. +- `sync.Pool` drops about a quarter of `Put`s under `-race` by design; never + assume `Get` returns the last `Put`. +- Don't add tests whose only purpose is to catch someone deliberately undoing + a performance pin (an alignment, say); a comment explaining it is enough. + +## Performance claims + +- Use real data. The maintainer's corpora are at + https://klauspost.com/files/compress/ (logs, JSON, CSV, serialized data, + tar files); put `.zst` files in `zstd/testdata/benchmark-custom/` and run + `BenchmarkDecoderWithCustomFiles`. Silesia, enwik and generated data are + fine for correctness but are not accepted as evidence for a speed-up. +- When a result depends on how the data was compressed, report the levels + separately (for example `SpeedDefault` and `SpeedBestCompression`). +- Anchor `-bench` patterns at every level with `$`: `-bench 'BenchmarkFoo$'` + also runs `BenchmarkFooBar` otherwise, which has produced fake gains and + regressions. +- Code placement alone moves results by about ±2%. For an A/B, insert + `PCALIGN $64` before every `TEXT` in the `.s` files of *both* builds + (measurement only, not committed). +- Build both variants as test binaries up front, then run them in turns: one + short `-count 1` run of each, repeated for ten or more rounds, swapping + which goes first every round (AB, BA, AB, …) so neither build always gets + the warmer or colder slot. Never run all of A and then all of B. Clock + speed, temperature, cache and page-cache state, and background load drift + over a session; alternating spreads that drift over both builds instead of + turning it into a difference between them. Pin to one core, use an + otherwise idle machine, and compare the pooled results with `benchstat`. +- Report the number of regressed cases next to the geomean; a small win with + no regressions is a different result from a larger one with some. +- No CPU-model-specific code paths or thresholds. A gate for arm64 must be + measured on several Neoverse generations (N1, V1, V2, V3), not one core. + +## Pull requests + +- One commit per independent change, with fixups squashed in. Number the + changes in the description as "(1) … (sha)" and name the test file for + each test. +- Mention each `#NNN` once in prose; refer back in words. +- Don't open many PRs against the same area at once; reviewer time is the + scarce resource. +- Keep Go comments short; generator and assembly comments can explain in + detail. +- Keep private or company-internal references (internal service names, + private links, chat or agent-session URLs) out of code, commit messages and + PR text. + +## Assembly is generated + +- zstd, huff0 and s2 assembly is generated with [avo](https://github.com/mmcloughlin/avo) + from `zstd/_generate`, `huff0/_generate` and `s2/_generate`. Never edit the + `.s` files by hand: change the generator, run `go generate -v -x` in the + `_generate` directory, and commit the regenerated output. CI's `generate` job + fails if the committed files differ from the generator's output. +- The arm64 files are lowered from the same amd64 program by the + `honeycombio/avo` fork that the `_generate/go.mod` files `replace` avo with. + A change to the generator changes both architectures; build and test both. +- When moving the avo pin, regenerate and check the output is byte-identical + unless a change is intended, so unrelated printer changes don't slip into a + review. +- Never put a label directly on a `PCALIGN` (emit the `PCALIGN` before the + label). A jump to it makes the amd64 assembler jump to the wrong place + (Go ≤ 1.25, golang/go#74648) or loop forever when it has to widen a branch + (Go ≥ 1.26, golang/go#81792). Current versions of the avo fork reject it. +- Build tags: `noasm` selects the pure-Go code and `nounsafe` the code without + `unsafe`. Every assembly or `unsafe` path needs a portable fallback, and CI + runs the default, `noasm`, `nounsafe` and `nounsafe,noasm` builds. The + library doesn't use cgo. diff --git a/vendor/github.com/klauspost/compress/README.md b/vendor/github.com/klauspost/compress/README.md index 0e9f170d012..2ba61f4c335 100644 --- a/vendor/github.com/klauspost/compress/README.md +++ b/vendor/github.com/klauspost/compress/README.md @@ -6,7 +6,9 @@ This package provides various compression algorithms. * [S2](https://github.com/klauspost/compress/tree/master/s2#s2-compression) is a high performance replacement for Snappy. * Optimized [deflate](https://godoc.org/github.com/klauspost/compress/flate) packages which can be used as a dropin replacement for [gzip](https://godoc.org/github.com/klauspost/compress/gzip), [zip](https://godoc.org/github.com/klauspost/compress/zip) and [zlib](https://godoc.org/github.com/klauspost/compress/zlib). * [snappy](https://github.com/klauspost/compress/tree/master/snappy) is a drop-in replacement for `github.com/golang/snappy` offering better compression and concurrent streams. +* [lzw](https://github.com/klauspost/compress/tree/master/lzw) is a drop-in replacement for `compress/lzw` with 1.4-4x faster decompression and 1.1-2.7x faster compression, depending on the data. * [huff0](https://github.com/klauspost/compress/tree/master/huff0) and [FSE](https://github.com/klauspost/compress/tree/master/fse) implementations for raw entropy encoding. +* [Xpress](https://github.com/klauspost/compress/tree/master/xpress) decompression of the Microsoft XPRESS (MS-XCA) plain LZ77 and LZ77+Huffman formats (the LZ77+Huffman variant is the one used in WIM images and Windows Compact OS / WOF data). * [gzhttp](https://github.com/klauspost/compress/tree/master/gzhttp) Provides client and server wrappers for handling gzipped/zstd HTTP requests efficiently. * [pgzip](https://github.com/klauspost/pgzip) is a separate package that provides a very fast parallel gzip implementation. @@ -27,8 +29,41 @@ Use the links above for more information on each. # changelog +* Sep 25th, 2026 [1.20.1](https://github.com/klauspost/compress/releases/tag/v1.20.1) + * zstd: Apply reset options to reused frame decoders by @pellared in https://github.com/klauspost/compress/pull/1226 + * flate: Report unexpected EOF for truncated Huffman extra bits by @rupayon123 in https://github.com/klauspost/compress/pull/1229 + * flate: Avoid FMA in EstimatedBits for portable rounding by @malt3 in https://github.com/klauspost/compress/pull/1224 + * gzhttp: Preserve caller request headers in Transport by @jakezwang in https://github.com/klauspost/compress/pull/1225 + * gzhttp: Only decompress a request when gzip is the outermost coding by @youdie006 in https://github.com/klauspost/compress/pull/1223 + * zstd/huff0: Optimizations by @lizthegrey in https://github.com/klauspost/compress/pull/1203 https://github.com/klauspost/compress/pull/1205 https://github.com/klauspost/compress/pull/1207 https://github.com/klauspost/compress/pull/1204 https://github.com/klauspost/compress/pull/1208 https://github.com/klauspost/compress/pull/1211 https://github.com/klauspost/compress/pull/1209 https://github.com/klauspost/compress/pull/1210 + * flate: Speed improvements by @alex in https://github.com/klauspost/compress/pull/1220 https://github.com/klauspost/compress/pull/1218 https://github.com/klauspost/compress/pull/1216 https://github.com/klauspost/compress/pull/1215 https://github.com/klauspost/compress/pull/1214 https://github.com/klauspost/compress/pull/1217 + +* Sep 2nd, 2026 [1.20.0](https://github.com/klauspost/compress/releases/tag/v1.20.0) + * lzw: Add lzw reader/writer in https://github.com/klauspost/compress/pull/1189 + * xpress: Add Microsoft XPRESS (MS-XCA) decompression by @MP-GOWTHAM in https://github.com/klauspost/compress/pull/1195 + * s2: arm64 assembly encoders by @lizthegrey in https://github.com/klauspost/compress/pull/1187 + * zstd, huff0: Improved arm64 assembly by @lizthegrey in https://github.com/klauspost/compress/pull/1175 https://github.com/klauspost/compress/pull/1199 https://github.com/klauspost/compress/pull/1197 + * flate: Writer L7-9 with dictionary can emit the dictionary to stream in https://github.com/klauspost/compress/pull/1201 + * gzhttp: Limit jitter hash to jitterBuffer bytes by @VedantMadane in https://github.com/klauspost/compress/pull/1192 + * s2: Clamp the Go EncodeBetter skip to match the assembly by @lizthegrey in https://github.com/klauspost/compress/pull/1190 + * xxhash: Bound input of non-preemptive assembly by @AskAlexSharov in https://github.com/klauspost/compress/pull/1196 + +* Aug 6th, 2026 [1.19.2](https://github.com/klauspost/compress/releases/tag/v1.19.2) + * huff0: Add arm64 assembly for Decompress4X/1X by @lizthegrey in https://github.com/klauspost/compress/pull/1172 + * zstd: Re-enable unsafe decodeSync memory copies by @lizthegrey in https://github.com/klauspost/compress/pull/1171 + * zstd: Fix arm64 asm frame offsets placing locals on the saved LR slot by @lizthegrey in https://github.com/klauspost/compress/pull/1176 + * zstd: Avoid racing MaxDecodedSize write on shared dict litEnc by @zanarellidev in https://github.com/klauspost/compress/pull/1182 + * zstd: Keep BuildDict recent-offsets positive and loadable by @zanarellidev in https://github.com/klauspost/compress/pull/1184 + * zstd: Handle zero-literal BuildDict corpus by @cyphercodes in https://github.com/klauspost/compress/pull/1178 + * zstd: Don't clear the registered dictionary when decoding past the window by @sueun-dev in https://github.com/klauspost/compress/pull/1177 + +* Jul 20th, 2026 [1.19.1](https://github.com/klauspost/compress/releases/tag/v1.19.1) + * zstd: Validate SnappyConverter literal copies in https://github.com/klauspost/compress/pull/1170 + * flate: Use `Peek` instead of `ReadByte` for the `bufio.Reader` decode path by @joechenrh in https://github.com/klauspost/compress/pull/1169 + * zstd: Bump avo pin, regenerate arm64 asm by @lizthegrey in https://github.com/klauspost/compress/pull/1167 + * Jul 1st, 2026 [1.19.0](https://github.com/klauspost/compress/releases/tag/v1.19.0) - * zstd: Add true concurrent stream encodingin https://github.com/klauspost/compress/pull/1136 + * zstd: Add true concurrent stream encoding in https://github.com/klauspost/compress/pull/1136 * zstd: arm64 decoder asm by @lizthegrey in https://github.com/klauspost/compress/pull/1160 * flate: Add inflate checkpoints in https://github.com/klauspost/compress/pull/1154 * zstd: avoid unused BuildDict encoder allocation by @snissn in https://github.com/klauspost/compress/pull/1147 @@ -39,6 +74,22 @@ Use the links above for more information on each. * huff0: Allow building table from oversized histogram in https://github.com/klauspost/compress/pull/1156 * s2sx: Clean symlink targets in https://github.com/klauspost/compress/pull/1163 +
+ See changes to v1.18.x + +* Jun 30th, 2026 [1.18.7](https://github.com/klauspost/compress/releases/tag/v1.18.7) + * s2: Fix `NewDict` out-of-bounds read. Security release without other changes. + +* Apr 30th, 2026 [1.18.6](https://github.com/klauspost/compress/releases/tag/v1.18.6) + * s2: Fix amd64 stack frame corruption in https://github.com/klauspost/compress/pull/1145 + * gzhttp: Canonicalize ETag header by @justinmayhew in https://github.com/klauspost/compress/pull/1139 + * Pool hash tables in Go encode paths to reduce allocations by @huynhanx03 in https://github.com/klauspost/compress/pull/1143 + +* Mar 20th, 2026 [1.18.5](https://github.com/klauspost/compress/releases/tag/v1.18.5) + * zstd: Fix crash when changing encoder dictionary with same ID in https://github.com/klauspost/compress/pull/1135 + * zstd: Default to full zero frames in https://github.com/klauspost/compress/pull/1134 + * flate: Clean up histogram order in https://github.com/klauspost/compress/pull/1133 + * Feb 9th, 2026 [1.18.4](https://github.com/klauspost/compress/releases/tag/v1.18.4) * gzhttp: Add zstandard to server handler wrapper https://github.com/klauspost/compress/pull/1121 * zstd: Add ResetWithOptions to encoder/decoder https://github.com/klauspost/compress/pull/1122 @@ -70,6 +121,8 @@ Use the links above for more information on each. * flate: Fix matchlen L5+L6 https://github.com/klauspost/compress/pull/1049 * flate: Cleanup & reduce casts https://github.com/klauspost/compress/pull/1050 +
+
See changes to v1.17.x diff --git a/vendor/github.com/klauspost/compress/flate/deflate.go b/vendor/github.com/klauspost/compress/flate/deflate.go index 57d17eeab9e..238b1bcdc33 100644 --- a/vendor/github.com/klauspost/compress/flate/deflate.go +++ b/vendor/github.com/klauspost/compress/flate/deflate.go @@ -95,6 +95,11 @@ type advancedState struct { index int hashMatch [maxMatchLength + minMatchLength]uint32 + // litBits[i] is the number of bits needed to encode window[index:i] + // as literals, where index is the window index at the start of the + // current deflateLazy call. Only allocated when d.chain > 100 (level 9). + litBits []int32 + // Input hash chains // hashHead[hashValue] contains the largest inputIndex with the specified hash value // If hashHead[hashValue] is within the current window, then @@ -260,6 +265,7 @@ func (d *compressor) fillWindow(b []byte) { } // Update window information. d.windowEnd += n + d.blockStart = d.windowEnd s.index = n } @@ -283,7 +289,9 @@ func (d *compressor) findMatch(pos int, prevHead int, lookahead int) (length, of minIndex := max(pos-windowSize, 0) offset = 0 - if d.chain < 100 { + // The gain estimate below needs the tables that deflateLazy only + // generates when d.chain > 100, so the conditions must match. + if d.chain <= 100 { for i := prevHead; tries > 0; tries-- { if wEnd == win[i+length] { n := matchLen(win[i:i+minMatchLook], wPos) @@ -311,21 +319,25 @@ func (d *compressor) findMatch(pos int, prevHead int, lookahead int) (length, of } // Minimum gain to accept a match. - cGain := 4 + cGain := int32(4) // Some like it higher (CSV), some like it lower (JSON) const baseCost = 3 // Base is 4 bytes at with an additional cost. // Matches must be better than this. + s := d.state + hashPrev := &s.hashPrev + hashOffset := s.hashOffset + litBits := s.litBits[pos : pos+minMatchLook+1] + for i := prevHead; tries > 0; tries-- { if wEnd == win[i+length] { n := matchLen(win[i:i+minMatchLook], wPos) if n > length { // Calculate gain. Estimate - newGain := d.h.bitLengthRaw(wPos[:n]) - int(offsetExtraBits[offsetCode(uint32(pos-i))]) - baseCost - int(lengthExtraBits[lengthCodes[(n-3)&255]]) + newGain := litBits[n] - litBits[0] - int32(offsetExtraBits[offsetCode(uint32(pos-i))]) - baseCost - int32(lengthExtraBits[lengthCodes[(n-3)&255]]) - //fmt.Println("gain:", newGain, "prev:", cGain, "raw:", d.h.bitLengthRaw(wPos[:n]), "this-len:", n, "prev-len:", length) if newGain > cGain { length = n offset = pos - i @@ -343,7 +355,7 @@ func (d *compressor) findMatch(pos int, prevHead int, lookahead int) (length, of // hashPrev[i & windowMask] has already been overwritten, so stop now. break } - i = int(d.state.hashPrev[i&windowMask]) - d.state.hashOffset + i = int(hashPrev[i&windowMask]) - hashOffset if i < minIndex { break } @@ -427,6 +439,20 @@ func (d *compressor) deflateLazy() { tmp[v]++ } d.h.generate(tmp[:], 15) + + // Compute the cumulative cost of encoding the window as literals, + // so findMatch can look up the cost of any range in constant time. + if s.litBits == nil { + s.litBits = make([]int32, 2*windowSize+1) + } + codes := d.h.codes[:256] + litBits := s.litBits[s.index : d.windowEnd+1] + total := int32(0) + litBits[0] = 0 + for i, v := range d.window[s.index:d.windowEnd] { + total += int32(codes[v].len()) + litBits[i+1] = total + } } s.maxInsertIndex = d.windowEnd - (minMatchLength - 1) diff --git a/vendor/github.com/klauspost/compress/flate/fast_encoder.go b/vendor/github.com/klauspost/compress/flate/fast_encoder.go index 791c9dcbfd9..a8cdc5c9919 100644 --- a/vendor/github.com/klauspost/compress/flate/fast_encoder.go +++ b/vendor/github.com/klauspost/compress/flate/fast_encoder.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/klauspost/compress/internal/le" + "github.com/klauspost/compress/internal/regmask" ) type fastEnc interface { @@ -108,7 +109,7 @@ type tableEntryPrev struct { // hash7 returns the hash of the lowest 7 bytes of u to fit in a hash table with h bits. // Preferably h should be a constant and should always be <64. func hash7(u uint64, h uint8) uint32 { - return uint32(((u << (64 - 56)) * prime7bytes) >> ((64 - h) & reg8SizeMask64)) + return uint32(((u << (64 - 56)) * prime7bytes) >> ((64 - h) & regmask.Shift64ByUint8)) } // hashLen returns a hash of the lowest mls bytes of with length output bits. diff --git a/vendor/github.com/klauspost/compress/flate/huffman_bit_writer.go b/vendor/github.com/klauspost/compress/flate/huffman_bit_writer.go index 7151140ccd7..a0c918aeefc 100644 --- a/vendor/github.com/klauspost/compress/flate/huffman_bit_writer.go +++ b/vendor/github.com/klauspost/compress/flate/huffman_bit_writer.go @@ -32,14 +32,12 @@ const ( // bufferFlushSize indicates the buffer size // after which bytes are flushed to the writer. - // Should preferably be a multiple of 6, since - // we accumulate 6 bytes between writes to the buffer. + // Between checks, at most 7 bytes are added to the buffer, + // and writes are done as unconditional 8-byte stores, so the + // buffer must have at least bufferFlushSize+7+8 bytes. bufferFlushSize = 246 ) -// Minimum length code that emits bits. -const lengthExtraBitsMinCode = 8 - // The number of extra bits needed by length code X - LENGTH_CODES_START. var lengthExtraBits = [32]uint8{ /* 257 */ 0, 0, 0, @@ -55,9 +53,6 @@ var lengthBase = [32]uint8{ 64, 80, 96, 112, 128, 160, 192, 224, 255, } -// Minimum offset code that emits bits. -const offsetExtraBitsMinCode = 4 - // offset code word extra bits. var offsetExtraBits = [32]int8{ 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, @@ -67,8 +62,24 @@ var offsetExtraBits = [32]int8{ 14, 14, } +// offsetCombined combines the number of extra bits and the base offset +// of each offset code in a single table: extra bits in the low 8 bits, +// and the base offset (already reduced by baseMatchOffset) in the upper bits. +// Entries for the extended window codes 30 and 31 are unused. var offsetCombined = [32]uint32{} +// lengthCombined combines, for each match length (reduced by +// baseMatchLength), the length code (relative to lengthCodesStart) in +// bits 0-4, the number of extra bits in bits 5-7 and the value of the +// extra bits in bits 8-12. +var lengthCombined = func() (t [256]uint32) { + for i := range t { + code := lengthCodes[i] + t[i] = uint32(code) | uint32(lengthExtraBits[code])<<5 | uint32(uint8(i)-lengthBase[code])<<8 + } + return t +}() + func init() { var offsetBase = [32]uint32{ /* normal deflate */ @@ -85,7 +96,7 @@ func init() { for i := range offsetCombined[:] { // Don't use extended window values... - if offsetExtraBits[i] == 0 || offsetBase[i] > 0x006000 { + if offsetBase[i] > 0x006000 { continue } offsetCombined[i] = uint32(offsetExtraBits[i]) | (offsetBase[i] << 8) @@ -115,10 +126,14 @@ type huffmanBitWriter struct { lastHeader int // Set between 0 (reused block can be up to 2x the size) logNewTablePenalty uint - bytes [256 + 8]byte - literalFreq [lengthCodesStart + 32]uint16 - offsetFreq [32]uint16 - codegenFreq [codegenCodeCount]uint16 + + // bytes must hold at least bufferFlushSize+7+8 bytes (see bufferFlushSize). + // Its size is rounded up to a multiple of 8 to keep the following + // fields aligned, which is measurably faster in writeBlockHuff. + bytes [(bufferFlushSize + 7 + 8 + 7) &^ 7]byte + literalFreq [lengthCodesStart + 32]uint16 + offsetFreq [32]uint16 + codegenFreq [codegenCodeCount]uint16 // codegen must have an extra space for the final symbol. codegen [literalCount + offsetCodeCount + 1]uint8 @@ -842,124 +857,75 @@ func (w *huffmanBitWriter) writeTokens(tokens []token, leCodes, oeCodes []hcode) lengths := leCodes[lengthCodesStart:] lengths = lengths[:32] - // Go 1.16 LOVES having these on stack. + // Keeping these on the stack instead of in w is significantly faster. bits, nbits, nbytes := w.bits, w.nbits, w.nbytes - for _, t := range tokens { - if t < 256 { - //w.writeCode(lits[t.literal()]) - c := lits[t] - bits |= c.code64() << (nbits & 63) - nbits += c.len() - if nbits >= 48 { - le.Store64(w.bytes[:], nbytes, bits) - bits >>= 48 - nbits -= 48 - nbytes += 6 - if nbytes >= bufferFlushSize { - if w.err != nil { - nbytes = 0 - return - } - _, w.err = w.writer.Write(w.bytes[:nbytes]) - nbytes = 0 - } - } - continue + // Flush whole bytes, so that nbits <= 7 when entering the loop below. + le.Store64(w.bytes[:], nbytes, bits) + nbytes += nbits >> 3 + bits >>= nbits & 56 + nbits &= 7 + if nbytes >= bufferFlushSize { + _, w.err = w.writer.Write(w.bytes[:nbytes]) + nbytes = 0 + if w.err != nil { + return } + } - // Write the length - length := t.length() - lengthCode := lengthCode(length) & 31 - if false { - w.writeCode(lengths[lengthCode]) - } else { - // inlined - c := lengths[lengthCode] + // The loop below flushes whole bytes at the end of every iteration, + // so that nbits <= 7 at the top of every iteration. + // A literal adds at most 15 bits and a match at most + // 15+5+15+13 = 48 bits, so up to three literals or a single match + // can be added to the 64-bit accumulator without an intermediate flush. + // Unconditionally storing 8 bytes and advancing by the number of + // whole bytes avoids a poorly predicted branch per token. + for i := 0; i < len(tokens); i++ { + t := tokens[i] + if t < 256 { + c := lits[t] bits |= c.code64() << (nbits & 63) nbits += c.len() - if nbits >= 48 { - le.Store64(w.bytes[:], nbytes, bits) - bits >>= 48 - nbits -= 48 - nbytes += 6 - if nbytes >= bufferFlushSize { - if w.err != nil { - nbytes = 0 - return - } - _, w.err = w.writer.Write(w.bytes[:nbytes]) - nbytes = 0 - } - } - } - - if lengthCode >= lengthExtraBitsMinCode { - extraLengthBits := lengthExtraBits[lengthCode] - //w.writeBits(extraLength, extraLengthBits) - extraLength := int32(length - lengthBase[lengthCode]) - bits |= uint64(extraLength) << (nbits & 63) - nbits += extraLengthBits - if nbits >= 48 { - le.Store64(w.bytes[:], nbytes, bits) - bits >>= 48 - nbits -= 48 - nbytes += 6 - if nbytes >= bufferFlushSize { - if w.err != nil { - nbytes = 0 - return - } - _, w.err = w.writer.Write(w.bytes[:nbytes]) - nbytes = 0 + // Add up to two more literals before flushing. + if i+1 < len(tokens) && tokens[i+1] < 256 { + i++ + c := lits[tokens[i]] + bits |= c.code64() << (nbits & 63) + nbits += c.len() + if i+1 < len(tokens) && tokens[i+1] < 256 { + i++ + c := lits[tokens[i]] + bits |= c.code64() << (nbits & 63) + nbits += c.len() } } - } - // Write the offset - offset := t.offset() - offsetCode := (offset >> 16) & 31 - if false { - w.writeCode(offs[offsetCode]) } else { - // inlined - c := offs[offsetCode] - bits |= c.code64() << (nbits & 63) - nbits += c.len() - if nbits >= 48 { - le.Store64(w.bytes[:], nbytes, bits) - bits >>= 48 - nbits -= 48 - nbytes += 6 - if nbytes >= bufferFlushSize { - if w.err != nil { - nbytes = 0 - return - } - _, w.err = w.writer.Write(w.bytes[:nbytes]) - nbytes = 0 - } - } + // Write the length code and its extra bits as one unit. + lc := lengthCombined[t.length()] + c := lengths[lc&31] + bits |= (c.code64() | uint64(lc>>8)<<(c.len()&63)) << (nbits & 63) + nbits += c.len() + uint8(lc>>5)&7 + + // Write the offset code and its extra bits as one unit. + offset := t.offset() + offCode := (offset >> 16) & 31 + c = offs[offCode] + offComb := offsetCombined[offCode] + extra := (offset - (offComb >> 8)) & matchOffsetOnlyMask + bits |= (c.code64() | uint64(extra)<<(c.len()&63)) << (nbits & 63) + nbits += c.len() + uint8(offComb) } - - if offsetCode >= offsetExtraBitsMinCode { - offsetComb := offsetCombined[offsetCode] - //w.writeBits(extraOffset, extraOffsetBits) - bits |= uint64((offset-(offsetComb>>8))&matchOffsetOnlyMask) << (nbits & 63) - nbits += uint8(offsetComb) - if nbits >= 48 { - le.Store64(w.bytes[:], nbytes, bits) - bits >>= 48 - nbits -= 48 - nbytes += 6 - if nbytes >= bufferFlushSize { - if w.err != nil { - nbytes = 0 - return - } - _, w.err = w.writer.Write(w.bytes[:nbytes]) - nbytes = 0 - } + le.Store64(w.bytes[:], nbytes, bits) + nbytes += nbits >> 3 + bits >>= nbits & 56 + nbits &= 7 + if nbytes >= bufferFlushSize { + if w.err != nil { + nbytes = 0 + return } + _, w.err = w.writer.Write(w.bytes[:nbytes]) + nbytes = 0 } } // Restore... @@ -1094,8 +1060,8 @@ func (w *huffmanBitWriter) writeBlockHuff(eof bool, input []byte, sync bool) { if debugDeflate { count -= int(nbytes)*8 + int(nbits) } - // Unroll, write 3 codes/loop. - // Fastest number of unrolls. + // Write 3 codes per iteration. The three codes are combined first, + // independently of the accumulator, and merged with a single shift. for len(input) > 3 { // We must have at least 48 bits free. if nbits >= 8 { @@ -1116,13 +1082,13 @@ func (w *huffmanBitWriter) writeBlockHuff(eof bool, input []byte, sync bool) { _, w.err = w.writer.Write(w.bytes[:nbytes]) nbytes = 0 } - a, b := encoding[input[0]], encoding[input[1]] - bits |= a.code64() << (nbits & 63) - bits |= b.code64() << ((nbits + a.len()) & 63) - c := encoding[input[2]] - nbits += b.len() + a.len() - bits |= c.code64() << (nbits & 63) - nbits += c.len() + a, b, c := encoding[input[0]], encoding[input[1]], encoding[input[2]] + v := a.code64() | b.code64()<<(a.len()&63) + n := a.len() + b.len() + v |= c.code64() << (n & 63) + n += c.len() + bits |= v << (nbits & 63) + nbits += n input = input[3:] } diff --git a/vendor/github.com/klauspost/compress/flate/huffman_code.go b/vendor/github.com/klauspost/compress/flate/huffman_code.go index 4b312dea3e5..6082bee3642 100644 --- a/vendor/github.com/klauspost/compress/flate/huffman_code.go +++ b/vendor/github.com/klauspost/compress/flate/huffman_code.go @@ -38,6 +38,9 @@ type huffmanEncoder struct { // Possible lengths are codegenCodeCount, offsetCodeCount and literalCount. // The largest of these is literalCount, so we allocate for that case. freqcache [literalCount + 1]literalNode + + // sortcache is scratch space for sortByFreq. + sortcache [literalCount + 1]literalNode } type literalNode struct { @@ -139,14 +142,6 @@ func (h *huffmanEncoder) bitLength(freq []uint16) int { return total } -func (h *huffmanEncoder) bitLengthRaw(b []byte) int { - var total int - for _, f := range b { - total += int(h.codes[f].len()) - } - return total -} - // canReuseBits returns the number of bits or math.MaxInt32 if the encoder cannot be reused. func (h *huffmanEncoder) canReuseBits(freq []uint16) int { var total int @@ -309,27 +304,93 @@ func (h *huffmanEncoder) bitCounts(list []literalNode, maxBits int32) []int32 { } // Look at the leaves and assign them a bit count and an encoding as specified -// in RFC 1951 3.2.2 -func (h *huffmanEncoder) assignEncodingAndSize(bitCount []int32, list []literalNode) { - code := uint16(0) +// in RFC 1951 3.2.2. +// list must be sorted by increasing frequency and codes must have +// all entries for literals not in list set to zero. +func (h *huffmanEncoder) assignEncodingAndSize(bitCount []int32, list []literalNode, codes []hcode) { + // The literals list[len(list)-bits] .. list[len(list)-1] + // are encoded using "bits" bits. Record the length of each literal + // temporarily in codes. for n, bits := range bitCount { - code <<= 1 if n == 0 || bits == 0 { continue } - // The literals list[len(list)-bits] .. list[len(list)-bits] - // are encoded using "bits" bits, and get the values - // code, code + 1, .... The code values are - // assigned in literal order (not frequency order). - chunk := list[len(list)-int(bits):] - - sortByLiteral(chunk) - for _, node := range chunk { - h.codes[node.literal] = newhcode(reverseBits(code, uint8(n)), uint8(n)) - code++ + for _, node := range list[len(list)-int(bits):] { + codes[node.literal] = hcode(n) } list = list[0 : len(list)-int(bits)] } + + // Code values are assigned in literal order (not frequency order) + // within each code length, starting from the first code of each length. + var nextCode [maxBitsLimit]uint16 + code := uint16(0) + for n := 1; n < len(bitCount); n++ { + code = (code + uint16(bitCount[n-1])) << 1 + nextCode[n] = code + } + for i, c := range codes { + if c == 0 { + continue + } + // n is at most maxBitsLimit-1; the mask only elides bounds checks. + n := uint8(c) + codes[i] = newhcode(reverseBits(nextCode[n&15], n), n) + nextCode[n&15]++ + } +} + +// sortByFreq sorts list by increasing frequency. +// The sort is stable, so nodes with equal frequencies keep their order. +func (h *huffmanEncoder) sortByFreq(list []literalNode) { + if len(list) <= 32 { + // Insertion sort is faster for small lists. + for i := 1; i < len(list); i++ { + n := list[i] + j := i + for ; j > 0 && list[j-1].freq > n.freq; j-- { + list[j] = list[j-1] + } + list[j] = n + } + return + } + + // Counting sort on the low byte and then on the high byte + // of the frequency. Both passes are stable. + tmp := h.sortcache[:len(list)] + var count [256]uint16 + var maxFreq uint16 + for _, n := range list { + count[n.freq&0xff]++ + maxFreq |= n.freq + } + var pos uint16 + for i, c := range count { + count[i] = pos + pos += c + } + for _, n := range list { + tmp[count[n.freq&0xff]] = n + count[n.freq&0xff]++ + } + if maxFreq < 256 { + copy(list, tmp) + return + } + count = [256]uint16{} + for _, n := range tmp { + count[n.freq>>8]++ + } + pos = 0 + for i, c := range count { + count[i] = pos + pos += c + } + for _, n := range tmp { + list[count[n.freq>>8]] = n + count[n.freq>>8]++ + } } // Update this Huffman Code object to be the minimum code for the specified frequency count. @@ -362,12 +423,14 @@ func (h *huffmanEncoder) generate(freq []uint16, maxBits int32) { } return } - sortByFreq(list) + // list is in order of increasing literal value, so a stable sort + // by frequency orders it by (frequency, literal). + h.sortByFreq(list) // Get the number of literals for each bit count bitCount := h.bitCounts(list, maxBits) // And do the assignment - h.assignEncodingAndSize(bitCount, list) + h.assignEncodingAndSize(bitCount, list, codes) } // atLeastOne clamps the result between 1 and 15. @@ -394,24 +457,27 @@ func histogram(b []byte, h []uint16) { } func histogramSplit(b []byte, h []uint16) { - // Tested, and slightly faster than 2-way. - // Writing to separate arrays and combining is also slightly slower. - h = h[:256] + // Walk four quarters in parallel, each into its own table. + // Tested to be faster than walking halves. Using separate tables + // avoids the load/store dependencies that arise when two of the + // streams hit the same byte value, which is common for text. + var h0, h1, h2, h3 [256]uint16 + // Make size divisible by 4 for len(b)&3 != 0 { - h[b[0]]++ + h0[b[0]]++ b = b[1:] } n := len(b) / 4 x, y, z, w := b[:n], b[n:], b[n+n:], b[n+n+n:] y, z, w = y[:len(x)], z[:len(x)], w[:len(x)] for i, t := range x { - v0 := &h[t] - v1 := &h[y[i]] - v2 := &h[z[i]] - v3 := &h[w[i]] - *v0++ - *v1++ - *v2++ - *v3++ + h0[t]++ + h1[y[i]]++ + h2[z[i]]++ + h3[w[i]]++ + } + h = h[:256] + for i := range h { + h[i] += h0[i] + h1[i] + h2[i] + h3[i] } } diff --git a/vendor/github.com/klauspost/compress/flate/inflate.go b/vendor/github.com/klauspost/compress/flate/inflate.go index 39dd683b2dd..ad0ad3e22bc 100644 --- a/vendor/github.com/klauspost/compress/flate/inflate.go +++ b/vendor/github.com/klauspost/compress/flate/inflate.go @@ -14,6 +14,8 @@ import ( "io" "math/bits" "sync" + + "github.com/klauspost/compress/internal/regmask" ) const ( @@ -557,8 +559,8 @@ func (f *decompressor) readHuffman() error { return err } } - rep += int(f.b & uint32(1<<(nb®SizeMaskUint32)-1)) - f.b >>= nb & regSizeMaskUint32 + rep += int(f.b & uint32(1<<(nb®mask.Shift32ByUint)-1)) + f.b >>= nb & regmask.Shift32ByUint f.nb -= nb if i+rep > n { if debugDecode { @@ -731,7 +733,7 @@ func (f *decompressor) moreBits() error { return noEOF(err) } f.roffset++ - f.b |= uint32(c) << (f.nb & regSizeMaskUint32) + f.b |= uint32(c) << (f.nb & regmask.Shift32ByUint) f.nb += 8 return nil } @@ -756,7 +758,7 @@ func (f *decompressor) huffSym(h *huffmanDecoder) (int, error) { return 0, noEOF(err) } f.roffset++ - b |= uint32(c) << (nb & regSizeMaskUint32) + b |= uint32(c) << (nb & regmask.Shift32ByUint) nb += 8 } chunk := h.chunks[b&(huffmanNumChunks-1)] @@ -775,7 +777,7 @@ func (f *decompressor) huffSym(h *huffmanDecoder) (int, error) { f.err = CorruptInputError(f.roffset) return 0, f.err } - f.b = b >> (n & regSizeMaskUint32) + f.b = b >> (n & regmask.Shift32ByUint) f.nb = nb - n return int(chunk >> huffmanValueShift), nil } diff --git a/vendor/github.com/klauspost/compress/flate/inflate_gen.go b/vendor/github.com/klauspost/compress/flate/inflate_gen.go index e80f1965609..55539156a7f 100644 --- a/vendor/github.com/klauspost/compress/flate/inflate_gen.go +++ b/vendor/github.com/klauspost/compress/flate/inflate_gen.go @@ -8,6 +8,8 @@ import ( "fmt" "math/bits" "strings" + + "github.com/klauspost/compress/internal/regmask" ) func peekBufio(fr *bufio.Reader) ([]byte, error) { @@ -62,7 +64,7 @@ readLiteral: return } f.roffset++ - fb |= uint32(c) << (fnb & regSizeMaskUint32) + fb |= uint32(c) << (fnb & regmask.Shift32ByUint) fnb += 8 } chunk := f.hl.chunks[fb&(huffmanNumChunks-1)] @@ -80,7 +82,7 @@ readLiteral: f.err = CorruptInputError(f.roffset) return } - fb = fb >> (n & regSizeMaskUint32) + fb = fb >> (n & regmask.Shift32ByUint) fnb = fnb - n v = int(chunk >> huffmanValueShift) break @@ -118,15 +120,15 @@ readLiteral: if debugDecode { fmt.Println("morebits n>0:", err) } - f.err = err + f.err = noEOF(err) return } f.roffset++ - fb |= uint32(c) << (fnb & regSizeMaskUint32) + fb |= uint32(c) << (fnb & regmask.Shift32ByUint) fnb += 8 } length += int(fb & bitMask32[n]) - fb >>= n & regSizeMaskUint32 + fb >>= n & regmask.Shift32ByUint fnb -= n default: if debugDecode { @@ -146,11 +148,11 @@ readLiteral: if debugDecode { fmt.Println("morebits f.nb<5:", err) } - f.err = err + f.err = noEOF(err) return } f.roffset++ - fb |= uint32(c) << (fnb & regSizeMaskUint32) + fb |= uint32(c) << (fnb & regmask.Shift32ByUint) fnb += 8 } dist = uint32(bits.Reverse8(uint8(fb & 0x1F << 3))) @@ -174,7 +176,7 @@ readLiteral: return } f.roffset++ - fb |= uint32(c) << (fnb & regSizeMaskUint32) + fb |= uint32(c) << (fnb & regmask.Shift32ByUint) fnb += 8 } chunk := f.hd.chunks[fb&(huffmanNumChunks-1)] @@ -192,7 +194,7 @@ readLiteral: f.err = CorruptInputError(f.roffset) return } - fb = fb >> (n & regSizeMaskUint32) + fb = fb >> (n & regmask.Shift32ByUint) fnb = fnb - n dist = uint32(chunk >> huffmanValueShift) break @@ -206,7 +208,7 @@ readLiteral: case dist < maxNumDist: nb := uint(dist-2) >> 1 // have 1 bit in bottom of dist, need nb more. - extra := (dist & 1) << (nb & regSizeMaskUint32) + extra := (dist & 1) << (nb & regmask.Shift32ByUint) for fnb < nb { c, err := fr.ReadByte() if err != nil { @@ -214,17 +216,17 @@ readLiteral: if debugDecode { fmt.Println("morebits f.nb>= nb & regSizeMaskUint32 + fb >>= nb & regmask.Shift32ByUint fnb -= nb - dist = 1<<((nb+1)®SizeMaskUint32) + 1 + extra + dist = 1<<((nb+1)®mask.Shift32ByUint) + 1 + extra // slower: dist = bitMask32[nb+1] + 2 + extra default: f.b, f.nb = fb, fnb @@ -313,7 +315,7 @@ readLiteral: return } f.roffset++ - fb |= uint32(c) << (fnb & regSizeMaskUint32) + fb |= uint32(c) << (fnb & regmask.Shift32ByUint) fnb += 8 } chunk := f.hl.chunks[fb&(huffmanNumChunks-1)] @@ -331,7 +333,7 @@ readLiteral: f.err = CorruptInputError(f.roffset) return } - fb = fb >> (n & regSizeMaskUint32) + fb = fb >> (n & regmask.Shift32ByUint) fnb = fnb - n v = int(chunk >> huffmanValueShift) break @@ -369,15 +371,15 @@ readLiteral: if debugDecode { fmt.Println("morebits n>0:", err) } - f.err = err + f.err = noEOF(err) return } f.roffset++ - fb |= uint32(c) << (fnb & regSizeMaskUint32) + fb |= uint32(c) << (fnb & regmask.Shift32ByUint) fnb += 8 } length += int(fb & bitMask32[n]) - fb >>= n & regSizeMaskUint32 + fb >>= n & regmask.Shift32ByUint fnb -= n default: if debugDecode { @@ -397,11 +399,11 @@ readLiteral: if debugDecode { fmt.Println("morebits f.nb<5:", err) } - f.err = err + f.err = noEOF(err) return } f.roffset++ - fb |= uint32(c) << (fnb & regSizeMaskUint32) + fb |= uint32(c) << (fnb & regmask.Shift32ByUint) fnb += 8 } dist = uint32(bits.Reverse8(uint8(fb & 0x1F << 3))) @@ -425,7 +427,7 @@ readLiteral: return } f.roffset++ - fb |= uint32(c) << (fnb & regSizeMaskUint32) + fb |= uint32(c) << (fnb & regmask.Shift32ByUint) fnb += 8 } chunk := f.hd.chunks[fb&(huffmanNumChunks-1)] @@ -443,7 +445,7 @@ readLiteral: f.err = CorruptInputError(f.roffset) return } - fb = fb >> (n & regSizeMaskUint32) + fb = fb >> (n & regmask.Shift32ByUint) fnb = fnb - n dist = uint32(chunk >> huffmanValueShift) break @@ -457,7 +459,7 @@ readLiteral: case dist < maxNumDist: nb := uint(dist-2) >> 1 // have 1 bit in bottom of dist, need nb more. - extra := (dist & 1) << (nb & regSizeMaskUint32) + extra := (dist & 1) << (nb & regmask.Shift32ByUint) for fnb < nb { c, err := fr.ReadByte() if err != nil { @@ -465,17 +467,17 @@ readLiteral: if debugDecode { fmt.Println("morebits f.nb>= nb & regSizeMaskUint32 + fb >>= nb & regmask.Shift32ByUint fnb -= nb - dist = 1<<((nb+1)®SizeMaskUint32) + 1 + extra + dist = 1<<((nb+1)®mask.Shift32ByUint) + 1 + extra // slower: dist = bitMask32[nb+1] + 2 + extra default: f.b, f.nb = fb, fnb @@ -573,7 +575,7 @@ readLiteral: c := pbuf[pos] pos++ f.roffset++ - fb |= uint32(c) << (fnb & regSizeMaskUint32) + fb |= uint32(c) << (fnb & regmask.Shift32ByUint) fnb += 8 } chunk := f.hl.chunks[fb&(huffmanNumChunks-1)] @@ -592,7 +594,7 @@ readLiteral: f.err = CorruptInputError(f.roffset) return } - fb = fb >> (n & regSizeMaskUint32) + fb = fb >> (n & regmask.Shift32ByUint) fnb = fnb - n v = int(chunk >> huffmanValueShift) break @@ -636,18 +638,18 @@ readLiteral: if debugDecode { fmt.Println("morebits n>0:", err) } - f.err = err + f.err = noEOF(err) return } } c := pbuf[pos] pos++ f.roffset++ - fb |= uint32(c) << (fnb & regSizeMaskUint32) + fb |= uint32(c) << (fnb & regmask.Shift32ByUint) fnb += 8 } length += int(fb & bitMask32[n]) - fb >>= n & regSizeMaskUint32 + fb >>= n & regmask.Shift32ByUint fnb -= n default: fr.Discard(pos) @@ -672,14 +674,14 @@ readLiteral: if debugDecode { fmt.Println("morebits f.nb<5:", err) } - f.err = err + f.err = noEOF(err) return } } c := pbuf[pos] pos++ f.roffset++ - fb |= uint32(c) << (fnb & regSizeMaskUint32) + fb |= uint32(c) << (fnb & regmask.Shift32ByUint) fnb += 8 } dist = uint32(bits.Reverse8(uint8(fb & 0x1F << 3))) @@ -710,7 +712,7 @@ readLiteral: c := pbuf[pos] pos++ f.roffset++ - fb |= uint32(c) << (fnb & regSizeMaskUint32) + fb |= uint32(c) << (fnb & regmask.Shift32ByUint) fnb += 8 } chunk := f.hd.chunks[fb&(huffmanNumChunks-1)] @@ -729,7 +731,7 @@ readLiteral: f.err = CorruptInputError(f.roffset) return } - fb = fb >> (n & regSizeMaskUint32) + fb = fb >> (n & regmask.Shift32ByUint) fnb = fnb - n dist = uint32(chunk >> huffmanValueShift) break @@ -743,7 +745,7 @@ readLiteral: case dist < maxNumDist: nb := uint(dist-2) >> 1 // have 1 bit in bottom of dist, need nb more. - extra := (dist & 1) << (nb & regSizeMaskUint32) + extra := (dist & 1) << (nb & regmask.Shift32ByUint) for fnb < nb { if pos >= len(pbuf) { fr.Discard(pos) @@ -755,20 +757,20 @@ readLiteral: if debugDecode { fmt.Println("morebits f.nb>= nb & regSizeMaskUint32 + fb >>= nb & regmask.Shift32ByUint fnb -= nb - dist = 1<<((nb+1)®SizeMaskUint32) + 1 + extra + dist = 1<<((nb+1)®mask.Shift32ByUint) + 1 + extra // slower: dist = bitMask32[nb+1] + 2 + extra default: fr.Discard(pos) @@ -860,7 +862,7 @@ readLiteral: return } f.roffset++ - fb |= uint32(c) << (fnb & regSizeMaskUint32) + fb |= uint32(c) << (fnb & regmask.Shift32ByUint) fnb += 8 } chunk := f.hl.chunks[fb&(huffmanNumChunks-1)] @@ -878,7 +880,7 @@ readLiteral: f.err = CorruptInputError(f.roffset) return } - fb = fb >> (n & regSizeMaskUint32) + fb = fb >> (n & regmask.Shift32ByUint) fnb = fnb - n v = int(chunk >> huffmanValueShift) break @@ -916,15 +918,15 @@ readLiteral: if debugDecode { fmt.Println("morebits n>0:", err) } - f.err = err + f.err = noEOF(err) return } f.roffset++ - fb |= uint32(c) << (fnb & regSizeMaskUint32) + fb |= uint32(c) << (fnb & regmask.Shift32ByUint) fnb += 8 } length += int(fb & bitMask32[n]) - fb >>= n & regSizeMaskUint32 + fb >>= n & regmask.Shift32ByUint fnb -= n default: if debugDecode { @@ -944,11 +946,11 @@ readLiteral: if debugDecode { fmt.Println("morebits f.nb<5:", err) } - f.err = err + f.err = noEOF(err) return } f.roffset++ - fb |= uint32(c) << (fnb & regSizeMaskUint32) + fb |= uint32(c) << (fnb & regmask.Shift32ByUint) fnb += 8 } dist = uint32(bits.Reverse8(uint8(fb & 0x1F << 3))) @@ -972,7 +974,7 @@ readLiteral: return } f.roffset++ - fb |= uint32(c) << (fnb & regSizeMaskUint32) + fb |= uint32(c) << (fnb & regmask.Shift32ByUint) fnb += 8 } chunk := f.hd.chunks[fb&(huffmanNumChunks-1)] @@ -990,7 +992,7 @@ readLiteral: f.err = CorruptInputError(f.roffset) return } - fb = fb >> (n & regSizeMaskUint32) + fb = fb >> (n & regmask.Shift32ByUint) fnb = fnb - n dist = uint32(chunk >> huffmanValueShift) break @@ -1004,7 +1006,7 @@ readLiteral: case dist < maxNumDist: nb := uint(dist-2) >> 1 // have 1 bit in bottom of dist, need nb more. - extra := (dist & 1) << (nb & regSizeMaskUint32) + extra := (dist & 1) << (nb & regmask.Shift32ByUint) for fnb < nb { c, err := fr.ReadByte() if err != nil { @@ -1012,17 +1014,17 @@ readLiteral: if debugDecode { fmt.Println("morebits f.nb>= nb & regSizeMaskUint32 + fb >>= nb & regmask.Shift32ByUint fnb -= nb - dist = 1<<((nb+1)®SizeMaskUint32) + 1 + extra + dist = 1<<((nb+1)®mask.Shift32ByUint) + 1 + extra // slower: dist = bitMask32[nb+1] + 2 + extra default: f.b, f.nb = fb, fnb @@ -1111,7 +1113,7 @@ readLiteral: return } f.roffset++ - fb |= uint32(c) << (fnb & regSizeMaskUint32) + fb |= uint32(c) << (fnb & regmask.Shift32ByUint) fnb += 8 } chunk := f.hl.chunks[fb&(huffmanNumChunks-1)] @@ -1129,7 +1131,7 @@ readLiteral: f.err = CorruptInputError(f.roffset) return } - fb = fb >> (n & regSizeMaskUint32) + fb = fb >> (n & regmask.Shift32ByUint) fnb = fnb - n v = int(chunk >> huffmanValueShift) break @@ -1167,15 +1169,15 @@ readLiteral: if debugDecode { fmt.Println("morebits n>0:", err) } - f.err = err + f.err = noEOF(err) return } f.roffset++ - fb |= uint32(c) << (fnb & regSizeMaskUint32) + fb |= uint32(c) << (fnb & regmask.Shift32ByUint) fnb += 8 } length += int(fb & bitMask32[n]) - fb >>= n & regSizeMaskUint32 + fb >>= n & regmask.Shift32ByUint fnb -= n default: if debugDecode { @@ -1195,11 +1197,11 @@ readLiteral: if debugDecode { fmt.Println("morebits f.nb<5:", err) } - f.err = err + f.err = noEOF(err) return } f.roffset++ - fb |= uint32(c) << (fnb & regSizeMaskUint32) + fb |= uint32(c) << (fnb & regmask.Shift32ByUint) fnb += 8 } dist = uint32(bits.Reverse8(uint8(fb & 0x1F << 3))) @@ -1223,7 +1225,7 @@ readLiteral: return } f.roffset++ - fb |= uint32(c) << (fnb & regSizeMaskUint32) + fb |= uint32(c) << (fnb & regmask.Shift32ByUint) fnb += 8 } chunk := f.hd.chunks[fb&(huffmanNumChunks-1)] @@ -1241,7 +1243,7 @@ readLiteral: f.err = CorruptInputError(f.roffset) return } - fb = fb >> (n & regSizeMaskUint32) + fb = fb >> (n & regmask.Shift32ByUint) fnb = fnb - n dist = uint32(chunk >> huffmanValueShift) break @@ -1255,7 +1257,7 @@ readLiteral: case dist < maxNumDist: nb := uint(dist-2) >> 1 // have 1 bit in bottom of dist, need nb more. - extra := (dist & 1) << (nb & regSizeMaskUint32) + extra := (dist & 1) << (nb & regmask.Shift32ByUint) for fnb < nb { c, err := fr.ReadByte() if err != nil { @@ -1263,17 +1265,17 @@ readLiteral: if debugDecode { fmt.Println("morebits f.nb>= nb & regSizeMaskUint32 + fb >>= nb & regmask.Shift32ByUint fnb -= nb - dist = 1<<((nb+1)®SizeMaskUint32) + 1 + extra + dist = 1<<((nb+1)®mask.Shift32ByUint) + 1 + extra // slower: dist = bitMask32[nb+1] + 2 + extra default: f.b, f.nb = fb, fnb diff --git a/vendor/github.com/klauspost/compress/flate/matchlen_generic.go b/vendor/github.com/klauspost/compress/flate/matchlen_generic.go index 6149384aaf9..b897261a134 100644 --- a/vendor/github.com/klauspost/compress/flate/matchlen_generic.go +++ b/vendor/github.com/klauspost/compress/flate/matchlen_generic.go @@ -12,18 +12,17 @@ import ( // matchLen returns the maximum common prefix length of a and b. // a must be the shortest of the two. func matchLen(a, b []byte) (n int) { - left := len(a) - for left >= 8 { - diff := le.Load64(a, n) ^ le.Load64(b, n) + // Keeping a and b the same length and reslicing them as we go + // lets the compiler prove that no bounds checks are needed. + b = b[:len(a)] + for len(a) >= 8 { + diff := le.Load64(a, 0) ^ le.Load64(b, 0) if diff != 0 { return n + bits.TrailingZeros64(diff)>>3 } + a, b = a[8:], b[8:] n += 8 - left -= 8 } - - a = a[n:] - b = b[n:] for i := range a { if a[i] != b[i] { break diff --git a/vendor/github.com/klauspost/compress/flate/token.go b/vendor/github.com/klauspost/compress/flate/token.go index d818790c132..d31f6ccb6d9 100644 --- a/vendor/github.com/klauspost/compress/flate/token.go +++ b/vendor/github.com/klauspost/compress/flate/token.go @@ -215,7 +215,11 @@ func mFastLog2(val float32) float32 { ux &= -0x7f800001 ux += 127 << 23 uval := math.Float32frombits(uint32(ux)) - log2 += ((-0.34484843)*uval+2.02466578)*uval - 0.67487759 + + p := float32(-0.34484843*uval) + 2.02466578 + q := float32(p*uval) - 0.67487759 + log2 += q + return log2 } @@ -232,7 +236,8 @@ func (t *tokens) EstimatedBits() int { for _, v := range t.litHist[:] { if v > 0 { n := float32(v) - shannon += atLeastOne(-mFastLog2(n*invTotal)) * n + w := float32(atLeastOne(-mFastLog2(n*invTotal)) * n) + shannon += w } } // Just add 15 for EOB @@ -240,7 +245,8 @@ func (t *tokens) EstimatedBits() int { for i, v := range t.extraHist[1 : literalCount-256] { if v > 0 { n := float32(v) - shannon += atLeastOne(-mFastLog2(n*invTotal)) * n + w := float32(atLeastOne(-mFastLog2(n*invTotal)) * n) + shannon += w bits += int(lengthExtraBits[i&31]) * int(v) nMatches += int(v) } @@ -251,7 +257,8 @@ func (t *tokens) EstimatedBits() int { for i, v := range t.offHist[:offsetCodeCount] { if v > 0 { n := float32(v) - shannon += atLeastOne(-mFastLog2(n*invTotal)) * n + w := float32(atLeastOne(-mFastLog2(n*invTotal)) * n) + shannon += w bits += int(offsetExtraBits[i&31]) * int(v) } } @@ -358,9 +365,6 @@ func (t token) offset() uint32 { return uint32(t) & offsetMask } func (t token) length() uint8 { return uint8(t >> lengthShift) } -// Convert length to code. -func lengthCode(len uint8) uint8 { return lengthCodes[len] } - // Returns the offset code corresponding to a specific offset func offsetCode(off uint32) uint32 { if false { diff --git a/vendor/github.com/klauspost/compress/fse/compress.go b/vendor/github.com/klauspost/compress/fse/compress.go index 8c8baa4fc2c..2a7cd684ea9 100644 --- a/vendor/github.com/klauspost/compress/fse/compress.go +++ b/vendor/github.com/klauspost/compress/fse/compress.go @@ -659,7 +659,8 @@ func (s *Scratch) validateNorm() (err error) { if v >= 0 { total += int(v) } else { - total -= int(v) + // -1 takes one cell. Adding -v would let a wrapped -32768 pass. + total++ } } defer func() { diff --git a/vendor/github.com/klauspost/compress/fse/decompress.go b/vendor/github.com/klauspost/compress/fse/decompress.go index 0c7dd4ffef9..85b55db579b 100644 --- a/vendor/github.com/klauspost/compress/fse/decompress.go +++ b/vendor/github.com/klauspost/compress/fse/decompress.go @@ -3,6 +3,7 @@ package fse import ( "errors" "fmt" + "math" ) const ( @@ -123,6 +124,11 @@ func (s *Scratch) readNCount() error { remaining -= count gotTotal += count } + if count > math.MaxInt16 { + // Only one symbol filling a tableLog 15 table, which cannot be decoded. + // Truncated, it would leave the decoding table unwritten. + return fmt.Errorf("corruption detected (count %d > %d)", count, math.MaxInt16) + } s.norm[charnum&0xff] = int16(count) charnum++ previous0 = count == 0 diff --git a/vendor/github.com/klauspost/compress/gzhttp/compress.go b/vendor/github.com/klauspost/compress/gzhttp/compress.go index da5048ef240..0529106cefb 100644 --- a/vendor/github.com/klauspost/compress/gzhttp/compress.go +++ b/vendor/github.com/klauspost/compress/gzhttp/compress.go @@ -293,26 +293,30 @@ func (w *GzipResponseWriter) startCompression(remain []byte) error { if len(w.randomJitter) > 0 { var jitRNG uint32 if w.jitterBuffer > 0 { + // Use only up to "w.jitterBuffer", otherwise the output depends on write sizes. + // w.buf can grow to wantBuf (max(minSize, 512[, jitterBuffer])), which may exceed jitterBuffer. + hashBuf := w.buf + if len(hashBuf) > w.jitterBuffer { + hashBuf = hashBuf[:w.jitterBuffer] + } if w.sha256Jitter { h := sha256.New() - h.Write(w.buf) - // Use only up to "w.jitterBuffer", otherwise the output depends on write sizes. - if len(remain) > 0 && len(w.buf) < w.jitterBuffer { + h.Write(hashBuf) + if len(remain) > 0 && len(hashBuf) < w.jitterBuffer { remain := remain - if len(remain)+len(w.buf) > w.jitterBuffer { - remain = remain[:w.jitterBuffer-len(w.buf)] + if len(remain)+len(hashBuf) > w.jitterBuffer { + remain = remain[:w.jitterBuffer-len(hashBuf)] } h.Write(remain) } var tmp [sha256.Size]byte jitRNG = binary.LittleEndian.Uint32(h.Sum(tmp[:0])) } else { - h := crc32.Update(0, castagnoliTable, w.buf) - // Use only up to "w.jitterBuffer", otherwise the output depends on write sizes. - if len(remain) > 0 && len(w.buf) < w.jitterBuffer { + h := crc32.Update(0, castagnoliTable, hashBuf) + if len(remain) > 0 && len(hashBuf) < w.jitterBuffer { remain := remain - if len(remain)+len(w.buf) > w.jitterBuffer { - remain = remain[:w.jitterBuffer-len(w.buf)] + if len(remain)+len(hashBuf) > w.jitterBuffer { + remain = remain[:w.jitterBuffer-len(hashBuf)] } h = crc32.Update(h, castagnoliTable, remain) } @@ -386,7 +390,6 @@ func (w *GzipResponseWriter) startPlain() error { // In the specific case of 1xx status codes, WriteHeader is directly calling the wrapped ResponseWriter. func (w *GzipResponseWriter) WriteHeader(code int) { // Handle informational headers - // This is gated to not forward 1xx responses on builds prior to go1.20. if code >= 100 && code <= 199 { w.ResponseWriter.WriteHeader(code) return @@ -611,7 +614,11 @@ func NewWrapper(opts ...option) (func(http.Handler) http.HandlerFunc, error) { return func(w http.ResponseWriter, r *http.Request) { w.Header().Add(vary, acceptEncoding) if c.allowCompressedRequests && contentGzip(r) { - r.Header.Del(contentEncoding) + if rest, _ := splitOuterCoding(joinContentEncoding(r)); rest != "" { + r.Header.Set(contentEncoding, rest) + } else { + r.Header.Del(contentEncoding) + } r.Body = &gzipReader{body: r.Body} } @@ -984,10 +991,35 @@ func RandomJitter(n, buffer int, paranoid bool) option { } } -// contentGzip returns true if the given HTTP request indicates that it gzipped. +// contentGzip returns true if the outermost content coding of the request body is gzip. func contentGzip(r *http.Request) bool { - // See more detail in `acceptsGzip` - return r.Method != http.MethodHead && r.Body != nil && parseEncodingGzip(r.Header.Get(contentEncoding)) > 0 + if r.Method == http.MethodHead || r.Body == nil { + return false + } + // Content-Encoding lists codings in the order they were applied, so only the + // last one is removable here. + _, outer := splitOuterCoding(joinContentEncoding(r)) + coding, _, err := parseCoding(outer) + return err == nil && coding == "gzip" +} + +// joinContentEncoding returns the Content-Encoding field lines as the single +// comma list they are equivalent to. A sender may split the list across lines. +func joinContentEncoding(r *http.Request) string { + v := r.Header.Values(contentEncoding) + if len(v) == 1 { + return v[0] + } + return strings.Join(v, ", ") +} + +// splitOuterCoding splits a Content-Encoding value into the codings that stay +// applied and the outermost one. +func splitOuterCoding(s string) (rest, outer string) { + if i := strings.LastIndexByte(s, ','); i >= 0 { + return strings.TrimSpace(s[:i]), s[i+1:] + } + return "", s } // acceptsGzip returns true if the given HTTP request indicates that it will diff --git a/vendor/github.com/klauspost/compress/gzhttp/transport.go b/vendor/github.com/klauspost/compress/gzhttp/transport.go index d4720a44ede..5374160359c 100644 --- a/vendor/github.com/klauspost/compress/gzhttp/transport.go +++ b/vendor/github.com/klauspost/compress/gzhttp/transport.go @@ -97,6 +97,7 @@ func (g *gzRoundtripper) RoundTrip(req *http.Request) (*http.Response, error) { // auto-decoding a portion of a gzipped document will just fail // anyway. See https://golang.org/issue/8923 requestedComp = len(g.acceptEncoding) > 0 + req = req.Clone(req.Context()) req.Header.Set("Accept-Encoding", g.acceptEncoding) } diff --git a/vendor/github.com/klauspost/compress/huff0/bitreader.go b/vendor/github.com/klauspost/compress/huff0/bitreader.go index bfc7a523dee..faaa418a759 100644 --- a/vendor/github.com/klauspost/compress/huff0/bitreader.go +++ b/vendor/github.com/klauspost/compress/huff0/bitreader.go @@ -9,6 +9,7 @@ import ( "errors" "fmt" "io" + "math/bits" "github.com/klauspost/compress/internal/le" ) @@ -210,6 +211,68 @@ func (b *bitReaderShifted) remaining() uint { return b.off*8 + uint(64-b.bitsRead) } +// canUseAsm reports whether the reader has a full 8-byte window ahead of +// its read pointer, which the Decompress4X asm loops need to take over. +func (b *bitReaderShifted) canUseAsm() bool { + return b.off >= 8 +} + +// prepareForAsm establishes the invariant the Decompress4X asm loops rely +// on: value == load64(in[off:off+8]) << bitsRead with bitsRead <= 7, so +// that a full group of symbols can never shift their sentinel bit out of +// the container. init leaves bitsRead == 8 when the final byte of the +// stream is exactly 0x01; that whole byte is consumed, so the same position +// is the window one byte lower with nothing consumed. Requires canUseAsm. +func (b *bitReaderShifted) prepareForAsm() { + if b.bitsRead >= 8 { + b.off-- + b.value = le.Load64(b.in, b.off) + b.bitsRead -= 8 + } +} + +// restoreFromAsm converts the state left behind by the Decompress4X asm +// loops back to the invariant the Go code relies on: value holds the 8 +// bytes at in[off:off+8] shifted left by bitsRead, with the low bitsRead +// bits zero. +// +// The asm keeps a sentinel bit in value just below the unread bits, so its +// trailing zero count is the number of consumed bits. The sentinel is ORed +// over the lowest bit of the window, which the loop never consumes before +// re-reading memory, so the window is re-read here too rather than taken +// from value. The asm reports off as the signed distance from the start of +// the stream, and it can be negative: a reload always reads a whole 8-byte +// window, so a stream that is nearly drained ends with up to 7 bytes of the +// previous stream (or the jump table) below its start inside the window. +// Those bytes sit below the stream's own bits and count as consumed. +// Anything further below, or more bits consumed than the stream holds, is +// corruption. +func (b *bitReaderShifted) restoreFromAsm() error { + off := int(b.off) + consumed := uint(bits.TrailingZeros64(b.value)) + if off < 0 { + if off < -7 { + return errors.New("corruption detected: stream underrun") + } + consumed += uint(-off) * 8 + if consumed > 64 { + return errors.New("corruption detected: stream underrun") + } + off = 0 + } + if off+8 > len(b.in) { + return errors.New("corruption detected: stream overrun") + } + b.off = uint(off) + b.bitsRead = uint8(consumed) + if consumed >= 64 { + b.value = 0 + } else { + b.value = le.Load64(b.in, b.off) << consumed + } + return nil +} + // close the bitstream and returns an error if out-of-buffer reads occurred. func (b *bitReaderShifted) close() error { // Release reference. diff --git a/vendor/github.com/klauspost/compress/huff0/bitwriter.go b/vendor/github.com/klauspost/compress/huff0/bitwriter.go index 41db94cded0..c48e7eade07 100644 --- a/vendor/github.com/klauspost/compress/huff0/bitwriter.go +++ b/vendor/github.com/klauspost/compress/huff0/bitwriter.go @@ -5,6 +5,50 @@ package huff0 +import ( + "github.com/klauspost/compress/internal/le" + "github.com/klauspost/compress/internal/regmask" +) + +// bitState is a bit writer that stays in registers when passed and +// returned by value. It writes into a buffer owned by the caller. +type bitState struct { + c uint64 + nb uint + pos int +} + +// flush writes the whole bytes with one 8-byte store at pos, leaving +// at most 7 bits. buf must have 8 bytes of room at pos. +func (s bitState) flush(buf []byte) bitState { + le.Store64(buf, s.pos, s.c) + s.pos += int(s.nb >> 3) + s.c >>= (s.nb &^ 7) & regmask.Shift64ByUint + s.nb &= 7 + return s +} + +// add adds n bits from v, which must have no bits set above them. +// There must be room for them. +func (s bitState) add(v uint64, n uint) bitState { + s.c |= v << (s.nb & regmask.Shift64ByUint) + s.nb += n + return s +} + +// fourSymbols returns the codes for a, b, c and d packed in that order +// from the LSB, and their total length. +func fourSymbols(a, b, c, d cTableEntry) (uint64, uint) { + bitsA := uint(a.nBits) + bitsB := bitsA + uint(b.nBits) + bitsC := bitsB + uint(c.nBits) + v := uint64(a.val) | + uint64(b.val)<<(bitsA®mask.Shift64ByUint) | + uint64(c.val)<<(bitsB®mask.Shift64ByUint) | + uint64(d.val)<<(bitsC®mask.Shift64ByUint) + return v, bitsC + uint(d.nBits) +} + // bitWriter will write bits. // First bit will be LSB of the first byte of output. type bitWriter struct { @@ -33,55 +77,6 @@ func (b *bitWriter) encSymbol(ct cTable, symbol byte) { b.nBits += enc.nBits } -// encTwoSymbols will add up to 32 bits. value may not contain more set bits than indicated. -// It will not check if there is space for them, so the caller must ensure that it has flushed recently. -func (b *bitWriter) encTwoSymbols(ct cTable, av, bv byte) { - encA := ct[av] - encB := ct[bv] - sh := b.nBits & 63 - combined := uint64(encA.val) | (uint64(encB.val) << (encA.nBits & 63)) - b.bitContainer |= combined << sh - if false { - if encA.nBits == 0 { - panic("nbitsA 0") - } - if encB.nBits == 0 { - panic("nbitsB 0") - } - } - b.nBits += encA.nBits + encB.nBits -} - -// encFourSymbols adds up to 32 bits from four symbols. -// It will not check if there is space for them, -// so the caller must ensure that b has been flushed recently. -func (b *bitWriter) encFourSymbols(encA, encB, encC, encD cTableEntry) { - bitsA := encA.nBits - bitsB := bitsA + encB.nBits - bitsC := bitsB + encC.nBits - bitsD := bitsC + encD.nBits - combined := uint64(encA.val) | - (uint64(encB.val) << (bitsA & 63)) | - (uint64(encC.val) << (bitsB & 63)) | - (uint64(encD.val) << (bitsC & 63)) - b.bitContainer |= combined << (b.nBits & 63) - b.nBits += bitsD -} - -// flush32 will flush out, so there are at least 32 bits available for writing. -func (b *bitWriter) flush32() { - if b.nBits < 32 { - return - } - b.out = append(b.out, - byte(b.bitContainer), - byte(b.bitContainer>>8), - byte(b.bitContainer>>16), - byte(b.bitContainer>>24)) - b.nBits -= 32 - b.bitContainer >>= 32 -} - // flushAlign will flush remaining full bytes and align to next byte boundary. func (b *bitWriter) flushAlign() { nbBytes := (b.nBits + 7) >> 3 diff --git a/vendor/github.com/klauspost/compress/huff0/compress.go b/vendor/github.com/klauspost/compress/huff0/compress.go index a97cf1b5d35..1406b766c45 100644 --- a/vendor/github.com/klauspost/compress/huff0/compress.go +++ b/vendor/github.com/klauspost/compress/huff0/compress.go @@ -4,6 +4,7 @@ import ( "fmt" "math" "runtime" + "slices" "sync" ) @@ -243,23 +244,27 @@ func (s *Scratch) compress1xDo(dst, src []byte) []byte { bw.encSymbol(cTable, src[n+i-1]) } n -= 4 - if s.actualTableLog <= 8 { - for ; n >= 0; n -= 4 { - tmp := src[n : n+4] - // tmp should be len 4 - bw.flush32() - bw.encFourSymbols(cTable[tmp[3]], cTable[tmp[2]], cTable[tmp[1]], cTable[tmp[0]]) + + // flush leaves at most 7 bits, so four symbols (at most 4*tableLogMax + // bits) always fit. Each chunk checks room for bytesPer4 per four + // symbols plus the 8-byte store. + const bytesPer4 = (7 + 4*tableLogMax) / 8 + w := bitState{c: bw.bitContainer, nb: uint(bw.nBits), pos: len(bw.out)} + buf := bw.out[:cap(bw.out)] + for n >= 0 { + k := (len(buf) - w.pos - 8) / bytesPer4 + if k <= 0 { + buf = slices.Grow(buf[:w.pos], (n/4+1)*bytesPer4+8) + buf = buf[:cap(buf)] + continue } - } else { - for ; n >= 0; n -= 4 { + for stop := max(n-4*k, -4); n > stop; n -= 4 { + w = w.flush(buf) tmp := src[n : n+4] - // tmp should be len 4 - bw.flush32() - bw.encTwoSymbols(cTable, tmp[3], tmp[2]) - bw.flush32() - bw.encTwoSymbols(cTable, tmp[1], tmp[0]) + w = w.add(fourSymbols(cTable[tmp[3]], cTable[tmp[2]], cTable[tmp[1]], cTable[tmp[0]])) } } + bw.bitContainer, bw.nBits, bw.out = w.c, uint8(w.nb), buf[:w.pos] bw.close() return bw.out } diff --git a/vendor/github.com/klauspost/compress/huff0/decompress.go b/vendor/github.com/klauspost/compress/huff0/decompress.go index 7d0efa8818a..9358784417d 100644 --- a/vendor/github.com/klauspost/compress/huff0/decompress.go +++ b/vendor/github.com/klauspost/compress/huff0/decompress.go @@ -54,6 +54,10 @@ func ReadTable(in []byte, s *Scratch) (s2 *Scratch, remain []byte, err error) { if len(in) < int(iSize) { return s, nil, fmt.Errorf("input too small for table, want %d bytes, have %d", iSize, len(in)) } + // The low nibble is the weights' FSE tableLog - 5, which the format limits to 6. + if in[0]&15+5 > 6 { + return s, nil, errors.New("corrupt input: weights tableLog too big") + } // FSE compressed weights s.fse.DecompressLimit = 255 hw := s.huffWeight[:] @@ -70,17 +74,32 @@ func ReadTable(in []byte, s *Scratch) (s2 *Scratch, remain []byte, err error) { in = in[iSize:] } - // collect weight stats + // collect weight stats. Weights repeat, so four histograms keep each + // increment from waiting on the previous store to the same counter. + var hist [4][16]uint32 + var seen uint8 + w := s.huffWeight[:s.symbolLen] + for ; len(w) >= 4; w = w[4:] { + hist[0][w[0]&15]++ + hist[1][w[1]&15]++ + hist[2][w[2]&15]++ + hist[3][w[3]&15]++ + seen |= w[0] | w[1] | w[2] | w[3] + } + for _, v := range w { + hist[0][v&15]++ + seen |= v + } var rankStats [16]uint32 weightTotal := uint32(0) - for _, v := range s.huffWeight[:s.symbolLen] { - if v > tableLogMax { - return s, nil, errors.New("corrupt input: weight too large") - } - v2 := v & 15 - rankStats[v2]++ - // (1 << (v2-1)) is slower since the compiler cannot prove that v2 isn't 0. - weightTotal += (1 << v2) >> 1 + for i := range rankStats { + rankStats[i] = hist[0][i] + hist[1][i] + hist[2][i] + hist[3][i] + } + for i := 1; i < len(rankStats); i++ { + weightTotal += rankStats[i] << (i - 1) + } + if seen > 15 || rankStats[tableLogMax+1]|rankStats[tableLogMax+2]|rankStats[tableLogMax+3]|rankStats[tableLogMax+4] != 0 { + return s, nil, errors.New("corrupt input: weight too large") } if weightTotal == 0 { return s, nil, errors.New("corrupt input: weights zero") @@ -158,9 +177,17 @@ func ReadTable(in []byte, s *Scratch) (s2 *Scratch, remain []byte, err error) { nBits: uint8(d.entry), } + // length is a power of two; runs of 4 or more are filled 4 at a time. single := s.dt.single[*rank : *rank+length] - for i := range single { - single[i] = d + if length >= 4 { + for i := 0; i < len(single); i += 4 { + s4 := single[i : i+4 : i+4] + s4[0], s4[1], s4[2], s4[3] = d, d, d, d + } + } else { + for i := range single { + single[i] = d + } } *rank += length } diff --git a/vendor/github.com/klauspost/compress/huff0/decompress_amd64.go b/vendor/github.com/klauspost/compress/huff0/decompress_amd64.go index 2d6ef64be15..169cf104585 100644 --- a/vendor/github.com/klauspost/compress/huff0/decompress_amd64.go +++ b/vendor/github.com/klauspost/compress/huff0/decompress_amd64.go @@ -1,222 +1,128 @@ -//go:build amd64 && !appengine && !noasm && gc +//go:build amd64 && !noasm && gc -// This file contains the specialisation of Decoder.Decompress4X -// and Decoder.Decompress1X that use an asm implementation of thir main loops. +// amd64 stubs and dispatch for the asm loops used by decompress_asm.go. package huff0 import ( - "errors" - "fmt" - "github.com/klauspost/compress/internal/cpuinfo" ) -// decompress4x_main_loop_x86 is an x86 assembler implementation -// of Decompress4X when tablelog > 8. +// decompress4x_main_loop_amd64 is an x86 assembler implementation +// of Decompress4X when tablelog > 8, decoding fastSymbols symbols per +// stream between bit container reloads. // //go:noescape func decompress4x_main_loop_amd64(ctx *decompress4xContext) -// decompress4x_8b_loop_x86 is an x86 assembler implementation -// of Decompress4X when tablelog <= 8 which decodes 4 entries -// per loop. +// decompress4x_8b_main_loop_amd64 is an x86 assembler implementation +// of Decompress4X when tablelog <= 8, decoding fast8bSymbols symbols +// per stream between bit container reloads. // //go:noescape func decompress4x_8b_main_loop_amd64(ctx *decompress4xContext) -// fallback8BitSize is the size where using Go version is faster. -const fallback8BitSize = 800 - -type decompress4xContext struct { - pbr *[4]bitReaderShifted - peekBits uint8 - out *byte - dstEvery int - tbl *dEntrySingle - decoded int - limit *byte -} +// decompress4x_4b_main_loop_amd64 is an x86 assembler implementation +// of Decompress4X when tablelog <= 4, decoding fast4bSymbols symbols +// per stream between bit container reloads. +// +//go:noescape +func decompress4x_4b_main_loop_amd64(ctx *decompress4xContext) -// Decompress4X will decompress a 4X encoded stream. -// The length of the supplied input must match the end of a block exactly. -// The *capacity* of the dst slice must match the destination size of -// the uncompressed data exactly. -func (d *Decoder) Decompress4X(dst, src []byte) ([]byte, error) { - if len(d.dt.single) == 0 { - return nil, errors.New("no table loaded") - } - if len(src) < 6+(4*1) { - return nil, errors.New("input too small") - } +// decompress4x_4b_main_loop_bmi2 is the BMI2 twin of decompress4x_4b_main_loop_amd64. +// +//go:noescape +func decompress4x_4b_main_loop_bmi2(ctx *decompress4xContext) - use8BitTables := d.actualTableLog <= 8 - if cap(dst) < fallback8BitSize && use8BitTables { - return d.decompress4X8bit(dst, src) - } +// decompress4x_main_loop_bmi2 is the BMI2 twin of decompress4x_main_loop_amd64. +// +//go:noescape +func decompress4x_main_loop_bmi2(ctx *decompress4xContext) - var br [4]bitReaderShifted - // Decode "jump table" - start := 6 - for i := range 3 { - length := int(src[i*2]) | (int(src[i*2+1]) << 8) - if start+length >= len(src) { - return nil, errors.New("truncated input (or invalid offset)") - } - err := br[i].init(src[start : start+length]) - if err != nil { - return nil, err - } - start += length - } - err := br[3].init(src[start:]) - if err != nil { - return nil, err - } +// decompress4x_8b_main_loop_bmi2 is the BMI2 twin of decompress4x_8b_main_loop_amd64. +// +//go:noescape +func decompress4x_8b_main_loop_bmi2(ctx *decompress4xContext) - // destination, offset to match first output - dstSize := cap(dst) - dst = dst[:dstSize] - out := dst - dstEvery := (dstSize + 3) / 4 - - const tlSize = 1 << tableLogMax - const tlMask = tlSize - 1 - single := d.dt.single[:tlSize] - - var decoded int - - if len(out) > 4*4 && !(br[0].off < 4 || br[1].off < 4 || br[2].off < 4 || br[3].off < 4) { - ctx := decompress4xContext{ - pbr: &br, - peekBits: uint8((64 - d.actualTableLog) & 63), // see: bitReaderShifted.peekBitsFast() - out: &out[0], - dstEvery: dstEvery, - tbl: &single[0], - limit: &out[dstEvery-4], // Always stop decoding when first buffer gets here to avoid writing OOB on last. - } - if use8BitTables { - decompress4x_8b_main_loop_amd64(&ctx) - } else { - decompress4x_main_loop_amd64(&ctx) - } - - decoded = ctx.decoded - out = out[decoded/4:] - } +// decompress1x_main_loop_amd64 is an x86 assembler implementation +// of Decompress1X when tablelog > 8, decoding fastSymbols symbols +// between bit container reloads. +// +//go:noescape +func decompress1x_main_loop_amd64(ctx *decompress1xContext) - // Decode remaining. - remainBytes := dstEvery - (decoded / 4) - for i := range br { - offset := dstEvery * i - endsAt := min(offset+remainBytes, len(out)) - br := &br[i] - bitsLeft := br.remaining() - for bitsLeft > 0 { - br.fill() - if offset >= endsAt { - return nil, errors.New("corruption detected: stream overrun 4") - } - - // Read value and increment offset. - val := br.peekBitsFast(d.actualTableLog) - v := single[val&tlMask].entry - nBits := uint8(v) - br.advance(nBits) - bitsLeft -= uint(nBits) - out[offset] = uint8(v >> 8) - offset++ - } - if offset != endsAt { - return nil, fmt.Errorf("corruption detected: short output block %d, end %d != %d", i, offset, endsAt) - } - decoded += offset - dstEvery*i - err = br.close() - if err != nil { - return nil, err - } - } - if dstSize != decoded { - return nil, errors.New("corruption detected: short output block") - } - return dst, nil -} +// decompress1x_8b_main_loop_amd64 is an x86 assembler implementation +// of Decompress1X when tablelog <= 8, decoding fast8bSymbols symbols +// between bit container reloads. +// +//go:noescape +func decompress1x_8b_main_loop_amd64(ctx *decompress1xContext) -// decompress4x_main_loop_x86 is an x86 assembler implementation -// of Decompress1X when tablelog > 8. +// decompress1x_4b_main_loop_amd64 is an x86 assembler implementation +// of Decompress1X when tablelog <= 4, decoding fast4bSymbols symbols +// between bit container reloads. // //go:noescape -func decompress1x_main_loop_amd64(ctx *decompress1xContext) +func decompress1x_4b_main_loop_amd64(ctx *decompress1xContext) -// decompress4x_main_loop_x86 is an x86 with BMI2 assembler implementation -// of Decompress1X when tablelog > 8. +// decompress1x_main_loop_bmi2 is the BMI2 twin of decompress1x_main_loop_amd64. // //go:noescape func decompress1x_main_loop_bmi2(ctx *decompress1xContext) -type decompress1xContext struct { - pbr *bitReaderShifted - peekBits uint8 - out *byte - outCap int - tbl *dEntrySingle - decoded int +// decompress1x_8b_main_loop_bmi2 is the BMI2 twin of decompress1x_8b_main_loop_amd64. +// +//go:noescape +func decompress1x_8b_main_loop_bmi2(ctx *decompress1xContext) + +// decompress1x_4b_main_loop_bmi2 is the BMI2 twin of decompress1x_4b_main_loop_amd64. +// +//go:noescape +func decompress1x_4b_main_loop_bmi2(ctx *decompress1xContext) + +func decompress4x_main_loop_asm(ctx *decompress4xContext) { + if cpuinfo.HasBMI2() { + decompress4x_main_loop_bmi2(ctx) + } else { + decompress4x_main_loop_amd64(ctx) + } } -// Error reported by asm implementations -const error_max_decoded_size_exeeded = -1 +func decompress4x_8b_main_loop_asm(ctx *decompress4xContext) { + if cpuinfo.HasBMI2() { + decompress4x_8b_main_loop_bmi2(ctx) + } else { + decompress4x_8b_main_loop_amd64(ctx) + } +} -// Decompress1X will decompress a 1X encoded stream. -// The cap of the output buffer will be the maximum decompressed size. -// The length of the supplied input must match the end of a block exactly. -func (d *Decoder) Decompress1X(dst, src []byte) ([]byte, error) { - if len(d.dt.single) == 0 { - return nil, errors.New("no table loaded") +func decompress4x_4b_main_loop_asm(ctx *decompress4xContext) { + if cpuinfo.HasBMI2() { + decompress4x_4b_main_loop_bmi2(ctx) + } else { + decompress4x_4b_main_loop_amd64(ctx) } - var br bitReaderShifted - err := br.init(src) - if err != nil { - return dst, err +} + +func decompress1x_main_loop_asm(ctx *decompress1xContext) { + if cpuinfo.HasBMI2() { + decompress1x_main_loop_bmi2(ctx) + } else { + decompress1x_main_loop_amd64(ctx) } - maxDecodedSize := cap(dst) - dst = dst[:maxDecodedSize] - - const tlSize = 1 << tableLogMax - const tlMask = tlSize - 1 - - if maxDecodedSize >= 4 { - ctx := decompress1xContext{ - pbr: &br, - out: &dst[0], - outCap: maxDecodedSize, - peekBits: uint8((64 - d.actualTableLog) & 63), // see: bitReaderShifted.peekBitsFast() - tbl: &d.dt.single[0], - } - - if cpuinfo.HasBMI2() { - decompress1x_main_loop_bmi2(&ctx) - } else { - decompress1x_main_loop_amd64(&ctx) - } - if ctx.decoded == error_max_decoded_size_exeeded { - return nil, ErrMaxDecodedSizeExceeded - } - - dst = dst[:ctx.decoded] +} + +func decompress1x_8b_main_loop_asm(ctx *decompress1xContext) { + if cpuinfo.HasBMI2() { + decompress1x_8b_main_loop_bmi2(ctx) + } else { + decompress1x_8b_main_loop_amd64(ctx) } +} - // br < 8, so uint8 is fine - bitsLeft := uint8(br.off)*8 + 64 - br.bitsRead - for bitsLeft > 0 { - br.fill() - if len(dst) >= maxDecodedSize { - br.close() - return nil, ErrMaxDecodedSizeExceeded - } - v := d.dt.single[br.peekBitsFast(d.actualTableLog)&tlMask] - nBits := uint8(v.entry) - br.advance(nBits) - bitsLeft -= nBits - dst = append(dst, uint8(v.entry>>8)) +func decompress1x_4b_main_loop_asm(ctx *decompress1xContext) { + if cpuinfo.HasBMI2() { + decompress1x_4b_main_loop_bmi2(ctx) + } else { + decompress1x_4b_main_loop_amd64(ctx) } - return dst, br.close() } diff --git a/vendor/github.com/klauspost/compress/huff0/decompress_amd64.s b/vendor/github.com/klauspost/compress/huff0/decompress_amd64.s index c4c7ab2d1fe..a6d5f4b3896 100644 --- a/vendor/github.com/klauspost/compress/huff0/decompress_amd64.s +++ b/vendor/github.com/klauspost/compress/huff0/decompress_amd64.s @@ -1,830 +1,3398 @@ -// Code generated by command: go run gen.go -out ../decompress_amd64.s -pkg=huff0. DO NOT EDIT. +// Code generated by command: go run gen.go -out ../decompress.s -arch amd64,arm64 -pkg=huff0. DO NOT EDIT. -//go:build amd64 && !appengine && !noasm && gc +//go:build !noasm && gc // func decompress4x_main_loop_amd64(ctx *decompress4xContext) +// Requires: BMI, CMOV TEXT ·decompress4x_main_loop_amd64(SB), $0-8 - // Preload values - MOVQ ctx+0(FP), AX - MOVBQZX 8(AX), DI - MOVQ 16(AX), BX - MOVQ 48(AX), SI - MOVQ 24(AX), R8 - MOVQ 32(AX), R9 - MOVQ (AX), R10 - - // Main loop -main_loop: - XORL DX, DX - CMPQ BX, SI - SETGE DL - - // br0.fillFast32() - MOVQ 32(R10), R11 - MOVBQZX 40(R10), R12 - CMPQ R12, $0x20 - JBE skip_fill0 - MOVQ 24(R10), AX - SUBQ $0x20, R12 - SUBQ $0x04, AX - MOVQ (R10), R13 - - // b.value |= uint64(low) << (b.bitsRead & 63) - MOVL (AX)(R13*1), R13 - MOVQ R12, CX - SHLQ CL, R13 - MOVQ AX, 24(R10) - ORQ R13, R11 - - // exhausted += (br0.off < 4) - CMPQ AX, $0x04 - ADCB $+0, DL - -skip_fill0: - // val0 := br0.peekTopBits(peekBits) - MOVQ R11, R13 - MOVQ DI, CX - SHRQ CL, R13 - - // v0 := table[val0&mask] - MOVW (R9)(R13*2), CX - - // br0.advance(uint8(v0.entry) - MOVB CH, AL - SHLQ CL, R11 - ADDB CL, R12 - - // val1 := br0.peekTopBits(peekBits) - MOVQ DI, CX - MOVQ R11, R13 - SHRQ CL, R13 - - // v1 := table[val1&mask] - MOVW (R9)(R13*2), CX - - // br0.advance(uint8(v1.entry)) - MOVB CH, AH - SHLQ CL, R11 - ADDB CL, R12 - - // these two writes get coalesced - // out[id * dstEvery + 0] = uint8(v0.entry >> 8) - // out[id * dstEvery + 1] = uint8(v1.entry >> 8) - MOVW AX, (BX) - - // update the bitreader structure - MOVQ R11, 32(R10) - MOVB R12, 40(R10) - - // br1.fillFast32() - MOVQ 80(R10), R11 - MOVBQZX 88(R10), R12 - CMPQ R12, $0x20 - JBE skip_fill1 - MOVQ 72(R10), AX - SUBQ $0x20, R12 - SUBQ $0x04, AX - MOVQ 48(R10), R13 - - // b.value |= uint64(low) << (b.bitsRead & 63) - MOVL (AX)(R13*1), R13 - MOVQ R12, CX - SHLQ CL, R13 - MOVQ AX, 72(R10) - ORQ R13, R11 - - // exhausted += (br1.off < 4) - CMPQ AX, $0x04 - ADCB $+0, DL - -skip_fill1: - // val0 := br1.peekTopBits(peekBits) - MOVQ R11, R13 - MOVQ DI, CX - SHRQ CL, R13 - - // v0 := table[val0&mask] - MOVW (R9)(R13*2), CX - - // br1.advance(uint8(v0.entry) - MOVB CH, AL - SHLQ CL, R11 - ADDB CL, R12 - - // val1 := br1.peekTopBits(peekBits) - MOVQ DI, CX - MOVQ R11, R13 - SHRQ CL, R13 - - // v1 := table[val1&mask] - MOVW (R9)(R13*2), CX - - // br1.advance(uint8(v1.entry)) - MOVB CH, AH - SHLQ CL, R11 - ADDB CL, R12 - - // these two writes get coalesced - // out[id * dstEvery + 0] = uint8(v0.entry >> 8) - // out[id * dstEvery + 1] = uint8(v1.entry >> 8) - MOVW AX, (BX)(R8*1) - - // update the bitreader structure - MOVQ R11, 80(R10) - MOVB R12, 88(R10) - - // br2.fillFast32() - MOVQ 128(R10), R11 - MOVBQZX 136(R10), R12 - CMPQ R12, $0x20 - JBE skip_fill2 - MOVQ 120(R10), AX - SUBQ $0x20, R12 - SUBQ $0x04, AX - MOVQ 96(R10), R13 - - // b.value |= uint64(low) << (b.bitsRead & 63) - MOVL (AX)(R13*1), R13 - MOVQ R12, CX - SHLQ CL, R13 - MOVQ AX, 120(R10) - ORQ R13, R11 - - // exhausted += (br2.off < 4) - CMPQ AX, $0x04 - ADCB $+0, DL - -skip_fill2: - // val0 := br2.peekTopBits(peekBits) - MOVQ R11, R13 - MOVQ DI, CX - SHRQ CL, R13 - - // v0 := table[val0&mask] - MOVW (R9)(R13*2), CX - - // br2.advance(uint8(v0.entry) - MOVB CH, AL - SHLQ CL, R11 - ADDB CL, R12 - - // val1 := br2.peekTopBits(peekBits) - MOVQ DI, CX - MOVQ R11, R13 - SHRQ CL, R13 - - // v1 := table[val1&mask] - MOVW (R9)(R13*2), CX - - // br2.advance(uint8(v1.entry)) - MOVB CH, AH - SHLQ CL, R11 - ADDB CL, R12 - - // these two writes get coalesced - // out[id * dstEvery + 0] = uint8(v0.entry >> 8) - // out[id * dstEvery + 1] = uint8(v1.entry >> 8) - MOVW AX, (BX)(R8*2) - - // update the bitreader structure - MOVQ R11, 128(R10) - MOVB R12, 136(R10) - - // br3.fillFast32() - MOVQ 176(R10), R11 - MOVBQZX 184(R10), R12 - CMPQ R12, $0x20 - JBE skip_fill3 - MOVQ 168(R10), AX - SUBQ $0x20, R12 - SUBQ $0x04, AX - MOVQ 144(R10), R13 - - // b.value |= uint64(low) << (b.bitsRead & 63) - MOVL (AX)(R13*1), R13 - MOVQ R12, CX - SHLQ CL, R13 - MOVQ AX, 168(R10) - ORQ R13, R11 - - // exhausted += (br3.off < 4) - CMPQ AX, $0x04 - ADCB $+0, DL - -skip_fill3: - // val0 := br3.peekTopBits(peekBits) - MOVQ R11, R13 - MOVQ DI, CX - SHRQ CL, R13 - - // v0 := table[val0&mask] - MOVW (R9)(R13*2), CX - - // br3.advance(uint8(v0.entry) - MOVB CH, AL - SHLQ CL, R11 - ADDB CL, R12 + MOVQ ctx+0(FP), AX - // val1 := br3.peekTopBits(peekBits) - MOVQ DI, CX - MOVQ R11, R13 - SHRQ CL, R13 - - // v1 := table[val1&mask] - MOVW (R9)(R13*2), CX - - // br3.advance(uint8(v1.entry)) - MOVB CH, AH - SHLQ CL, R11 - ADDB CL, R12 - - // these two writes get coalesced - // out[id * dstEvery + 0] = uint8(v0.entry >> 8) - // out[id * dstEvery + 1] = uint8(v1.entry >> 8) - LEAQ (R8)(R8*2), CX - MOVW AX, (BX)(CX*1) - - // update the bitreader structure - MOVQ R11, 176(R10) - MOVB R12, 184(R10) - ADDQ $0x02, BX - TESTB DL, DL - JZ main_loop - MOVQ ctx+0(FP), AX - SUBQ 16(AX), BX - SHLQ $0x02, BX - MOVQ BX, 40(AX) + // Preload values + MOVBQZX 8(AX), DX + MOVQ 32(AX), BX + MOVQ 16(AX), SI + MOVQ 24(AX), CX + LEAQ (SI)(CX*1), R8 + LEAQ (SI)(CX*2), R10 + LEAQ (CX)(CX*2), R12 + ADDQ SI, R12 + + // Convert each bit reader to sentinel form: bits = value | 1<> 8) - // out[id * dstEvery + 1] = uint8(v1.entry >> 8) - // out[id * dstEvery + 3] = uint8(v2.entry >> 8) - // out[id * dstEvery + 4] = uint8(v3.entry >> 8) - MOVL AX, (BX) - - // update the bitreader structure - MOVQ R11, 32(R10) - MOVB R12, 40(R10) - - // br1.fillFast32() - MOVQ 80(R10), R11 - MOVBQZX 88(R10), R12 - CMPQ R12, $0x20 - JBE skip_fill1 - MOVQ 72(R10), R13 - SUBQ $0x20, R12 - SUBQ $0x04, R13 - MOVQ 48(R10), R14 - - // b.value |= uint64(low) << (b.bitsRead & 63) - MOVL (R13)(R14*1), R14 - MOVQ R12, CX - SHLQ CL, R14 - MOVQ R13, 72(R10) - ORQ R14, R11 + TZCNTQ R13, R14 + MOVQ R14, CX + ANDQ $0x07, CX + SHRQ $0x03, R14 + MOVQ 88(AX), R13 + SUBQ R14, R13 + MOVQ R13, 88(AX) + MOVQ (R13), R13 + ORQ $0x01, R13 + SHLQ CL, R13 + ADDQ $0x0e, SI + ADDQ $0x0e, R8 + ADDQ $0x0e, R10 + ADDQ $0x0e, R12 + CMPQ SI, 96(AX) + JB inner_loop + JMP outer_loop + +done: + // Hand the state back: off = ip - in (negative when the window reached below the stream start), + // value = the sentinel-form container. bitReaderShifted.restoreFromAsm normalizes both. + MOVQ (AX), CX + MOVQ 64(AX), DX + SUBQ (CX), DX + MOVQ DX, 24(CX) + MOVQ DI, 32(CX) + MOVQ 72(AX), DX + SUBQ 48(CX), DX + MOVQ DX, 72(CX) + MOVQ R9, 80(CX) + MOVQ 80(AX), DX + SUBQ 96(CX), DX + MOVQ DX, 120(CX) + MOVQ R11, 128(CX) + MOVQ 88(AX), DX + SUBQ 144(CX), DX + MOVQ DX, 168(CX) + MOVQ R13, 176(CX) + SUBQ 16(AX), SI + SHLQ $0x02, SI + MOVQ SI, 40(AX) + RET - // exhausted += (br1.off < 4) - CMPQ R13, $0x04 - ADCB $+0, DL +// func decompress4x_main_loop_bmi2(ctx *decompress4xContext) +// Requires: BMI, BMI2, CMOV +TEXT ·decompress4x_main_loop_bmi2(SB), $0-8 + MOVQ ctx+0(FP), AX -skip_fill1: - // val0 := br1.peekTopBits(peekBits) - MOVQ R11, R13 - MOVQ DI, CX - SHRQ CL, R13 + // Preload values + MOVBQZX 8(AX), CX + MOVQ 32(AX), DX + MOVQ 16(AX), BX + MOVQ 24(AX), SI + LEAQ (BX)(SI*1), DI + LEAQ (BX)(SI*2), R9 + LEAQ (SI)(SI*2), R11 + ADDQ BX, R11 + + // Convert each bit reader to sentinel form: bits = value | 1<> 8) - // out[id * dstEvery + 1] = uint8(v1.entry >> 8) - // out[id * dstEvery + 3] = uint8(v2.entry >> 8) - // out[id * dstEvery + 4] = uint8(v3.entry >> 8) - MOVL AX, (BX)(R8*1) - - // update the bitreader structure - MOVQ R11, 80(R10) - MOVB R12, 88(R10) - - // br2.fillFast32() - MOVQ 128(R10), R11 - MOVBQZX 136(R10), R12 - CMPQ R12, $0x20 - JBE skip_fill2 - MOVQ 120(R10), R13 - SUBQ $0x20, R12 - SUBQ $0x04, R13 - MOVQ 96(R10), R14 - - // b.value |= uint64(low) << (b.bitsRead & 63) - MOVL (R13)(R14*1), R14 - MOVQ R12, CX + ANDQ $0x38, R13 + MOVQ -8(R8), R14 + SHRQ $0x01, R14 + ANDQ $0x07, R11 + MOVQ R13, CX + XORQ $0x3f, CX + SHRQ CL, R14 + MOVQ R11, CX SHLQ CL, R14 - MOVQ R13, 120(R10) - ORQ R14, R11 - - // exhausted += (br2.off < 4) - CMPQ R13, $0x04 - ADCB $+0, DL - -skip_fill2: - // val0 := br2.peekTopBits(peekBits) - MOVQ R11, R13 - MOVQ DI, CX - SHRQ CL, R13 - - // v0 := table[val0&mask] - MOVW (R9)(R13*2), CX - - // br2.advance(uint8(v0.entry) - MOVB CH, AL - SHLQ CL, R11 - ADDB CL, R12 - - // val1 := br2.peekTopBits(peekBits) - MOVQ R11, R13 - MOVQ DI, CX - SHRQ CL, R13 - - // v1 := table[val0&mask] - MOVW (R9)(R13*2), CX + ORQ R14, R10 + SHRQ $0x03, R13 + SUBQ R13, R8 + ADDQ $0x05, SI + CMPQ SI, R12 + JB inner_loop + JMP outer_loop + +done: + // Hand the state back in the Go bit reader's own form: off = ip - in, value, bitsRead. + MOVQ (AX), CX + SUBQ (CX), R8 + MOVQ R8, 24(CX) + MOVQ R10, 32(CX) + MOVB R11, 40(CX) + SUBQ 16(AX), SI + MOVQ SI, 40(AX) + RET - // br2.advance(uint8(v1.entry) - MOVB CH, AH - SHLQ CL, R11 - ADDB CL, R12 - BSWAPL AX +// func decompress1x_8b_main_loop_amd64(ctx *decompress1xContext) +// Requires: CMOV +TEXT ·decompress1x_8b_main_loop_amd64(SB), $0-8 + MOVQ ctx+0(FP), AX - // val2 := br2.peekTopBits(peekBits) - MOVQ R11, R13 + // Preload values + MOVBQZX 8(AX), DX + MOVQ 32(AX), BX + MOVQ 16(AX), SI + MOVQ 24(AX), DI + ADDQ SI, DI + MOVQ 56(AX), R8 + MOVQ 48(AX), R9 + MOVQ (AX), CX + MOVQ 32(CX), R10 + MOVBQZX 40(CX), R11 + +outer_loop: + // Iterations allowed by the output: (limit - op) / 8 MOVQ DI, CX - SHRQ CL, R13 - - // v2 := table[val0&mask] - MOVW (R9)(R13*2), CX - - // br2.advance(uint8(v2.entry) - MOVB CH, AH - SHLQ CL, R11 - ADDB CL, R12 + SUBQ SI, CX + JLE done + SHRQ $0x03, CX + + // Iterations allowed by the input: a refill reads the 8 bytes below the window and + // moves it down by at most 7, so every read stays inside the stream while ip stays + // at least 8 above ilowest. + MOVQ R8, R12 + SUBQ R9, R12 + SHRQ $0x03, R12 + CMPQ R12, CX + CMOVQCS R12, CX + TESTQ CX, CX + JZ done + IMUL3Q $0x07, CX, R12 + ADDQ SI, R12 + PCALIGN $0x40 + +inner_loop: + // symbol 0 + MOVQ DX, CX + MOVQ R10, R13 + SHRQ CL, R13 + MOVWQZX (BX)(R13*2), CX + SHLQ CL, R10 + ADDQ CX, R11 + SHRQ $0x08, CX + MOVB CL, (SI) + + // symbol 1 + MOVQ DX, CX + MOVQ R10, R13 + SHRQ CL, R13 + MOVWQZX (BX)(R13*2), CX + SHLQ CL, R10 + ADDQ CX, R11 + SHRQ $0x08, CX + MOVB CL, 1(SI) + + // symbol 2 + MOVQ DX, CX + MOVQ R10, R13 + SHRQ CL, R13 + MOVWQZX (BX)(R13*2), CX + SHLQ CL, R10 + ADDQ CX, R11 + SHRQ $0x08, CX + MOVB CL, 2(SI) + + // symbol 3 + MOVQ DX, CX + MOVQ R10, R13 + SHRQ CL, R13 + MOVWQZX (BX)(R13*2), CX + SHLQ CL, R10 + ADDQ CX, R11 + SHRQ $0x08, CX + MOVB CL, 3(SI) + + // symbol 4 + MOVQ DX, CX + MOVQ R10, R13 + SHRQ CL, R13 + MOVWQZX (BX)(R13*2), CX + SHLQ CL, R10 + ADDQ CX, R11 + SHRQ $0x08, CX + MOVB CL, 4(SI) + + // symbol 5 + MOVQ DX, CX + MOVQ R10, R13 + SHRQ CL, R13 + MOVWQZX (BX)(R13*2), CX + SHLQ CL, R10 + ADDQ CX, R11 + SHRQ $0x08, CX + MOVB CL, 5(SI) + + // symbol 6 + MOVQ DX, CX + MOVQ R10, R13 + SHRQ CL, R13 + MOVWQZX (BX)(R13*2), CX + SHLQ CL, R10 + ADDQ CX, R11 + SHRQ $0x08, CX + MOVB CL, 6(SI) - // val3 := br2.peekTopBits(peekBits) + // Refill the whole bytes consumed from below the window MOVQ R11, R13 - MOVQ DI, CX - SHRQ CL, R13 - - // v3 := table[val0&mask] - MOVW (R9)(R13*2), CX - - // br2.advance(uint8(v3.entry) - MOVB CH, AL - SHLQ CL, R11 - ADDB CL, R12 - BSWAPL AX - - // these four writes get coalesced - // out[id * dstEvery + 0] = uint8(v0.entry >> 8) - // out[id * dstEvery + 1] = uint8(v1.entry >> 8) - // out[id * dstEvery + 3] = uint8(v2.entry >> 8) - // out[id * dstEvery + 4] = uint8(v3.entry >> 8) - MOVL AX, (BX)(R8*2) - - // update the bitreader structure - MOVQ R11, 128(R10) - MOVB R12, 136(R10) - - // br3.fillFast32() - MOVQ 176(R10), R11 - MOVBQZX 184(R10), R12 - CMPQ R12, $0x20 - JBE skip_fill3 - MOVQ 168(R10), R13 - SUBQ $0x20, R12 - SUBQ $0x04, R13 - MOVQ 144(R10), R14 - - // b.value |= uint64(low) << (b.bitsRead & 63) - MOVL (R13)(R14*1), R14 - MOVQ R12, CX + ANDQ $0x38, R13 + MOVQ -8(R8), R14 + SHRQ $0x01, R14 + ANDQ $0x07, R11 + MOVQ R13, CX + XORQ $0x3f, CX + SHRQ CL, R14 + MOVQ R11, CX SHLQ CL, R14 - MOVQ R13, 168(R10) - ORQ R14, R11 - - // exhausted += (br3.off < 4) - CMPQ R13, $0x04 - ADCB $+0, DL - -skip_fill3: - // val0 := br3.peekTopBits(peekBits) - MOVQ R11, R13 - MOVQ DI, CX - SHRQ CL, R13 - - // v0 := table[val0&mask] - MOVW (R9)(R13*2), CX - - // br3.advance(uint8(v0.entry) - MOVB CH, AL - SHLQ CL, R11 - ADDB CL, R12 - - // val1 := br3.peekTopBits(peekBits) - MOVQ R11, R13 - MOVQ DI, CX - SHRQ CL, R13 - - // v1 := table[val0&mask] - MOVW (R9)(R13*2), CX - - // br3.advance(uint8(v1.entry) - MOVB CH, AH - SHLQ CL, R11 - ADDB CL, R12 - BSWAPL AX - - // val2 := br3.peekTopBits(peekBits) - MOVQ R11, R13 - MOVQ DI, CX - SHRQ CL, R13 - - // v2 := table[val0&mask] - MOVW (R9)(R13*2), CX + ORQ R14, R10 + SHRQ $0x03, R13 + SUBQ R13, R8 + ADDQ $0x07, SI + CMPQ SI, R12 + JB inner_loop + JMP outer_loop + +done: + // Hand the state back in the Go bit reader's own form: off = ip - in, value, bitsRead. + MOVQ (AX), CX + SUBQ (CX), R8 + MOVQ R8, 24(CX) + MOVQ R10, 32(CX) + MOVB R11, 40(CX) + SUBQ 16(AX), SI + MOVQ SI, 40(AX) + RET - // br3.advance(uint8(v2.entry) - MOVB CH, AH - SHLQ CL, R11 - ADDB CL, R12 +// func decompress1x_4b_main_loop_amd64(ctx *decompress1xContext) +// Requires: CMOV +TEXT ·decompress1x_4b_main_loop_amd64(SB), $0-8 + MOVQ ctx+0(FP), AX - // val3 := br3.peekTopBits(peekBits) - MOVQ R11, R13 + // Preload values + MOVBQZX 8(AX), DX + MOVQ 32(AX), BX + MOVQ 16(AX), SI + MOVQ 24(AX), DI + ADDQ SI, DI + MOVQ 56(AX), R8 + MOVQ 48(AX), R9 + MOVQ (AX), CX + MOVQ 32(CX), R10 + MOVBQZX 40(CX), R11 + +outer_loop: + // Iterations allowed by the output: (limit - op) / 16 MOVQ DI, CX - SHRQ CL, R13 - - // v3 := table[val0&mask] - MOVW (R9)(R13*2), CX - - // br3.advance(uint8(v3.entry) - MOVB CH, AL - SHLQ CL, R11 - ADDB CL, R12 - BSWAPL AX - - // these four writes get coalesced - // out[id * dstEvery + 0] = uint8(v0.entry >> 8) - // out[id * dstEvery + 1] = uint8(v1.entry >> 8) - // out[id * dstEvery + 3] = uint8(v2.entry >> 8) - // out[id * dstEvery + 4] = uint8(v3.entry >> 8) - LEAQ (R8)(R8*2), CX - MOVL AX, (BX)(CX*1) - - // update the bitreader structure - MOVQ R11, 176(R10) - MOVB R12, 184(R10) - ADDQ $0x04, BX - TESTB DL, DL - JZ main_loop - MOVQ ctx+0(FP), AX - SUBQ 16(AX), BX - SHLQ $0x02, BX - MOVQ BX, 40(AX) - RET - -// func decompress1x_main_loop_amd64(ctx *decompress1xContext) -TEXT ·decompress1x_main_loop_amd64(SB), $0-8 - MOVQ ctx+0(FP), CX - MOVQ 16(CX), DX - MOVQ 24(CX), BX - CMPQ BX, $0x04 - JB error_max_decoded_size_exceeded - LEAQ (DX)(BX*1), BX - MOVQ (CX), SI - MOVQ (SI), R8 - MOVQ 24(SI), R9 - MOVQ 32(SI), R10 - MOVBQZX 40(SI), R11 - MOVQ 32(CX), SI - MOVBQZX 8(CX), DI - JMP loop_condition - -main_loop: - // Check if we have room for 4 bytes in the output buffer - LEAQ 4(DX), CX - CMPQ CX, BX - JGE error_max_decoded_size_exceeded - - // Decode 4 values - CMPQ R11, $0x20 - JL bitReader_fillFast_1_end - SUBQ $0x20, R11 - SUBQ $0x04, R9 - MOVL (R8)(R9*1), R12 - MOVQ R11, CX - SHLQ CL, R12 - ORQ R12, R10 - -bitReader_fillFast_1_end: - MOVQ DI, CX - MOVQ R10, R12 - SHRQ CL, R12 - MOVW (SI)(R12*2), CX - MOVB CH, AL - MOVBQZX CL, CX + SUBQ SI, CX + JLE done + SHRQ $0x04, CX + + // Iterations allowed by the input: a refill reads the 8 bytes below the window and + // moves it down by at most 7, so every read stays inside the stream while ip stays + // at least 8 above ilowest. + MOVQ R8, R12 + SUBQ R9, R12 + SHRQ $0x03, R12 + CMPQ R12, CX + CMOVQCS R12, CX + TESTQ CX, CX + JZ done + IMUL3Q $0x0e, CX, R12 + ADDQ SI, R12 + PCALIGN $0x40 + +inner_loop: + // symbol 0 + MOVQ DX, CX + MOVQ R10, R13 + SHRQ CL, R13 + MOVWQZX (BX)(R13*2), CX + SHLQ CL, R10 ADDQ CX, R11 + SHRQ $0x08, CX + MOVB CL, (SI) + + // symbol 1 + MOVQ DX, CX + MOVQ R10, R13 + SHRQ CL, R13 + MOVWQZX (BX)(R13*2), CX SHLQ CL, R10 - MOVQ DI, CX - MOVQ R10, R12 - SHRQ CL, R12 - MOVW (SI)(R12*2), CX - MOVB CH, AH - MOVBQZX CL, CX ADDQ CX, R11 + SHRQ $0x08, CX + MOVB CL, 1(SI) + + // symbol 2 + MOVQ DX, CX + MOVQ R10, R13 + SHRQ CL, R13 + MOVWQZX (BX)(R13*2), CX SHLQ CL, R10 - BSWAPL AX - CMPQ R11, $0x20 - JL bitReader_fillFast_2_end - SUBQ $0x20, R11 - SUBQ $0x04, R9 - MOVL (R8)(R9*1), R12 - MOVQ R11, CX - SHLQ CL, R12 - ORQ R12, R10 - -bitReader_fillFast_2_end: - MOVQ DI, CX - MOVQ R10, R12 - SHRQ CL, R12 - MOVW (SI)(R12*2), CX - MOVB CH, AH - MOVBQZX CL, CX ADDQ CX, R11 + SHRQ $0x08, CX + MOVB CL, 2(SI) + + // symbol 3 + MOVQ DX, CX + MOVQ R10, R13 + SHRQ CL, R13 + MOVWQZX (BX)(R13*2), CX SHLQ CL, R10 - MOVQ DI, CX - MOVQ R10, R12 - SHRQ CL, R12 - MOVW (SI)(R12*2), CX - MOVB CH, AL - MOVBQZX CL, CX ADDQ CX, R11 + SHRQ $0x08, CX + MOVB CL, 3(SI) + + // symbol 4 + MOVQ DX, CX + MOVQ R10, R13 + SHRQ CL, R13 + MOVWQZX (BX)(R13*2), CX + SHLQ CL, R10 + ADDQ CX, R11 + SHRQ $0x08, CX + MOVB CL, 4(SI) + + // symbol 5 + MOVQ DX, CX + MOVQ R10, R13 + SHRQ CL, R13 + MOVWQZX (BX)(R13*2), CX + SHLQ CL, R10 + ADDQ CX, R11 + SHRQ $0x08, CX + MOVB CL, 5(SI) + + // symbol 6 + MOVQ DX, CX + MOVQ R10, R13 + SHRQ CL, R13 + MOVWQZX (BX)(R13*2), CX + SHLQ CL, R10 + ADDQ CX, R11 + SHRQ $0x08, CX + MOVB CL, 6(SI) + + // symbol 7 + MOVQ DX, CX + MOVQ R10, R13 + SHRQ CL, R13 + MOVWQZX (BX)(R13*2), CX + SHLQ CL, R10 + ADDQ CX, R11 + SHRQ $0x08, CX + MOVB CL, 7(SI) + + // symbol 8 + MOVQ DX, CX + MOVQ R10, R13 + SHRQ CL, R13 + MOVWQZX (BX)(R13*2), CX + SHLQ CL, R10 + ADDQ CX, R11 + SHRQ $0x08, CX + MOVB CL, 8(SI) + + // symbol 9 + MOVQ DX, CX + MOVQ R10, R13 + SHRQ CL, R13 + MOVWQZX (BX)(R13*2), CX SHLQ CL, R10 - BSWAPL AX - - // Store the decoded values - MOVL AX, (DX) - ADDQ $0x04, DX - -loop_condition: - CMPQ R9, $0x08 - JGE main_loop - - // Update ctx structure - MOVQ ctx+0(FP), AX - SUBQ 16(AX), DX - MOVQ DX, 40(AX) - MOVQ (AX), AX - MOVQ R9, 24(AX) - MOVQ R10, 32(AX) - MOVB R11, 40(AX) - RET - - // Report error -error_max_decoded_size_exceeded: - MOVQ ctx+0(FP), AX - MOVQ $-1, CX - MOVQ CX, 40(AX) - RET - -// func decompress1x_main_loop_bmi2(ctx *decompress1xContext) -// Requires: BMI2 -TEXT ·decompress1x_main_loop_bmi2(SB), $0-8 - MOVQ ctx+0(FP), CX - MOVQ 16(CX), DX - MOVQ 24(CX), BX - CMPQ BX, $0x04 - JB error_max_decoded_size_exceeded - LEAQ (DX)(BX*1), BX - MOVQ (CX), SI - MOVQ (SI), R8 - MOVQ 24(SI), R9 - MOVQ 32(SI), R10 - MOVBQZX 40(SI), R11 - MOVQ 32(CX), SI - MOVBQZX 8(CX), DI - JMP loop_condition - -main_loop: - // Check if we have room for 4 bytes in the output buffer - LEAQ 4(DX), CX - CMPQ CX, BX - JGE error_max_decoded_size_exceeded - - // Decode 4 values - CMPQ R11, $0x20 - JL bitReader_fillFast_1_end - SUBQ $0x20, R11 - SUBQ $0x04, R9 - MOVL (R8)(R9*1), CX - SHLXQ R11, CX, CX - ORQ CX, R10 - -bitReader_fillFast_1_end: - SHRXQ DI, R10, CX - MOVW (SI)(CX*2), CX - MOVB CH, AL - MOVBQZX CL, CX ADDQ CX, R11 - SHLXQ CX, R10, R10 - SHRXQ DI, R10, CX - MOVW (SI)(CX*2), CX - MOVB CH, AH - MOVBQZX CL, CX + SHRQ $0x08, CX + MOVB CL, 9(SI) + + // symbol 10 + MOVQ DX, CX + MOVQ R10, R13 + SHRQ CL, R13 + MOVWQZX (BX)(R13*2), CX + SHLQ CL, R10 ADDQ CX, R11 - SHLXQ CX, R10, R10 - BSWAPL AX - CMPQ R11, $0x20 - JL bitReader_fillFast_2_end - SUBQ $0x20, R11 - SUBQ $0x04, R9 - MOVL (R8)(R9*1), CX - SHLXQ R11, CX, CX - ORQ CX, R10 - -bitReader_fillFast_2_end: - SHRXQ DI, R10, CX - MOVW (SI)(CX*2), CX - MOVB CH, AH - MOVBQZX CL, CX + SHRQ $0x08, CX + MOVB CL, 10(SI) + + // symbol 11 + MOVQ DX, CX + MOVQ R10, R13 + SHRQ CL, R13 + MOVWQZX (BX)(R13*2), CX + SHLQ CL, R10 ADDQ CX, R11 - SHLXQ CX, R10, R10 - SHRXQ DI, R10, CX - MOVW (SI)(CX*2), CX - MOVB CH, AL - MOVBQZX CL, CX + SHRQ $0x08, CX + MOVB CL, 11(SI) + + // symbol 12 + MOVQ DX, CX + MOVQ R10, R13 + SHRQ CL, R13 + MOVWQZX (BX)(R13*2), CX + SHLQ CL, R10 ADDQ CX, R11 - SHLXQ CX, R10, R10 - BSWAPL AX + SHRQ $0x08, CX + MOVB CL, 12(SI) + + // symbol 13 + MOVQ DX, CX + MOVQ R10, R13 + SHRQ CL, R13 + MOVWQZX (BX)(R13*2), CX + SHLQ CL, R10 + ADDQ CX, R11 + SHRQ $0x08, CX + MOVB CL, 13(SI) - // Store the decoded values - MOVL AX, (DX) - ADDQ $0x04, DX + // Refill the whole bytes consumed from below the window + MOVQ R11, R13 + ANDQ $0x38, R13 + MOVQ -8(R8), R14 + SHRQ $0x01, R14 + ANDQ $0x07, R11 + MOVQ R13, CX + XORQ $0x3f, CX + SHRQ CL, R14 + MOVQ R11, CX + SHLQ CL, R14 + ORQ R14, R10 + SHRQ $0x03, R13 + SUBQ R13, R8 + ADDQ $0x0e, SI + CMPQ SI, R12 + JB inner_loop + JMP outer_loop + +done: + // Hand the state back in the Go bit reader's own form: off = ip - in, value, bitsRead. + MOVQ (AX), CX + SUBQ (CX), R8 + MOVQ R8, 24(CX) + MOVQ R10, 32(CX) + MOVB R11, 40(CX) + SUBQ 16(AX), SI + MOVQ SI, 40(AX) + RET + +// func decompress1x_main_loop_bmi2(ctx *decompress1xContext) +// Requires: BMI2, CMOV +TEXT ·decompress1x_main_loop_bmi2(SB), $0-8 + MOVQ ctx+0(FP), AX -loop_condition: - CMPQ R9, $0x08 - JGE main_loop + // Preload values + MOVBQZX 8(AX), CX + MOVQ 32(AX), DX + MOVQ 16(AX), BX + MOVQ 24(AX), SI + ADDQ BX, SI + MOVQ 56(AX), DI + MOVQ 48(AX), R8 + MOVQ (AX), R10 + MOVQ 32(R10), R9 + MOVBQZX 40(R10), R10 + +outer_loop: + // Iterations allowed by the output: (limit - op) / 8 + MOVQ SI, R11 + SUBQ BX, R11 + JLE done + SHRQ $0x03, R11 + + // Iterations allowed by the input: a refill reads the 8 bytes below the window and + // moves it down by at most 7, so every read stays inside the stream while ip stays + // at least 8 above ilowest. + MOVQ DI, R12 + SUBQ R8, R12 + SHRQ $0x03, R12 + CMPQ R12, R11 + CMOVQCS R12, R11 + TESTQ R11, R11 + JZ done + IMUL3Q $0x05, R11, R11 + ADDQ BX, R11 + PCALIGN $0x40 + +inner_loop: + // symbol 0 + SHRXQ CX, R9, R12 + MOVWQZX (DX)(R12*2), R12 + SHLXQ R12, R9, R9 + ADDQ R12, R10 + SHRQ $0x08, R12 + MOVB R12, (BX) + + // symbol 1 + SHRXQ CX, R9, R12 + MOVWQZX (DX)(R12*2), R12 + SHLXQ R12, R9, R9 + ADDQ R12, R10 + SHRQ $0x08, R12 + MOVB R12, 1(BX) + + // symbol 2 + SHRXQ CX, R9, R12 + MOVWQZX (DX)(R12*2), R12 + SHLXQ R12, R9, R9 + ADDQ R12, R10 + SHRQ $0x08, R12 + MOVB R12, 2(BX) + + // symbol 3 + SHRXQ CX, R9, R12 + MOVWQZX (DX)(R12*2), R12 + SHLXQ R12, R9, R9 + ADDQ R12, R10 + SHRQ $0x08, R12 + MOVB R12, 3(BX) + + // symbol 4 + SHRXQ CX, R9, R12 + MOVWQZX (DX)(R12*2), R12 + SHLXQ R12, R9, R9 + ADDQ R12, R10 + SHRQ $0x08, R12 + MOVB R12, 4(BX) + + // Refill the whole bytes consumed from below the window + MOVQ R10, R12 + ANDQ $0x38, R12 + MOVQ -8(DI), R13 + SHRQ $0x01, R13 + ANDQ $0x07, R10 + MOVQ R12, R14 + XORQ $0x3f, R14 + SHRXQ R14, R13, R13 + SHLXQ R10, R13, R13 + ORQ R13, R9 + SHRQ $0x03, R12 + SUBQ R12, DI + ADDQ $0x05, BX + CMPQ BX, R11 + JB inner_loop + JMP outer_loop + +done: + // Hand the state back in the Go bit reader's own form: off = ip - in, value, bitsRead. + MOVQ (AX), CX + SUBQ (CX), DI + MOVQ DI, 24(CX) + MOVQ R9, 32(CX) + MOVB R10, 40(CX) + SUBQ 16(AX), BX + MOVQ BX, 40(AX) + RET - // Update ctx structure +// func decompress1x_8b_main_loop_bmi2(ctx *decompress1xContext) +// Requires: BMI2, CMOV +TEXT ·decompress1x_8b_main_loop_bmi2(SB), $0-8 MOVQ ctx+0(FP), AX - SUBQ 16(AX), DX - MOVQ DX, 40(AX) - MOVQ (AX), AX - MOVQ R9, 24(AX) - MOVQ R10, 32(AX) - MOVB R11, 40(AX) + + // Preload values + MOVBQZX 8(AX), CX + MOVQ 32(AX), DX + MOVQ 16(AX), BX + MOVQ 24(AX), SI + ADDQ BX, SI + MOVQ 56(AX), DI + MOVQ 48(AX), R8 + MOVQ (AX), R10 + MOVQ 32(R10), R9 + MOVBQZX 40(R10), R10 + +outer_loop: + // Iterations allowed by the output: (limit - op) / 8 + MOVQ SI, R11 + SUBQ BX, R11 + JLE done + SHRQ $0x03, R11 + + // Iterations allowed by the input: a refill reads the 8 bytes below the window and + // moves it down by at most 7, so every read stays inside the stream while ip stays + // at least 8 above ilowest. + MOVQ DI, R12 + SUBQ R8, R12 + SHRQ $0x03, R12 + CMPQ R12, R11 + CMOVQCS R12, R11 + TESTQ R11, R11 + JZ done + IMUL3Q $0x07, R11, R11 + ADDQ BX, R11 + PCALIGN $0x40 + +inner_loop: + // symbol 0 + SHRXQ CX, R9, R12 + MOVWQZX (DX)(R12*2), R12 + SHLXQ R12, R9, R9 + ADDQ R12, R10 + SHRQ $0x08, R12 + MOVB R12, (BX) + + // symbol 1 + SHRXQ CX, R9, R12 + MOVWQZX (DX)(R12*2), R12 + SHLXQ R12, R9, R9 + ADDQ R12, R10 + SHRQ $0x08, R12 + MOVB R12, 1(BX) + + // symbol 2 + SHRXQ CX, R9, R12 + MOVWQZX (DX)(R12*2), R12 + SHLXQ R12, R9, R9 + ADDQ R12, R10 + SHRQ $0x08, R12 + MOVB R12, 2(BX) + + // symbol 3 + SHRXQ CX, R9, R12 + MOVWQZX (DX)(R12*2), R12 + SHLXQ R12, R9, R9 + ADDQ R12, R10 + SHRQ $0x08, R12 + MOVB R12, 3(BX) + + // symbol 4 + SHRXQ CX, R9, R12 + MOVWQZX (DX)(R12*2), R12 + SHLXQ R12, R9, R9 + ADDQ R12, R10 + SHRQ $0x08, R12 + MOVB R12, 4(BX) + + // symbol 5 + SHRXQ CX, R9, R12 + MOVWQZX (DX)(R12*2), R12 + SHLXQ R12, R9, R9 + ADDQ R12, R10 + SHRQ $0x08, R12 + MOVB R12, 5(BX) + + // symbol 6 + SHRXQ CX, R9, R12 + MOVWQZX (DX)(R12*2), R12 + SHLXQ R12, R9, R9 + ADDQ R12, R10 + SHRQ $0x08, R12 + MOVB R12, 6(BX) + + // Refill the whole bytes consumed from below the window + MOVQ R10, R12 + ANDQ $0x38, R12 + MOVQ -8(DI), R13 + SHRQ $0x01, R13 + ANDQ $0x07, R10 + MOVQ R12, R14 + XORQ $0x3f, R14 + SHRXQ R14, R13, R13 + SHLXQ R10, R13, R13 + ORQ R13, R9 + SHRQ $0x03, R12 + SUBQ R12, DI + ADDQ $0x07, BX + CMPQ BX, R11 + JB inner_loop + JMP outer_loop + +done: + // Hand the state back in the Go bit reader's own form: off = ip - in, value, bitsRead. + MOVQ (AX), CX + SUBQ (CX), DI + MOVQ DI, 24(CX) + MOVQ R9, 32(CX) + MOVB R10, 40(CX) + SUBQ 16(AX), BX + MOVQ BX, 40(AX) RET - // Report error -error_max_decoded_size_exceeded: +// func decompress1x_4b_main_loop_bmi2(ctx *decompress1xContext) +// Requires: BMI2, CMOV +TEXT ·decompress1x_4b_main_loop_bmi2(SB), $0-8 MOVQ ctx+0(FP), AX - MOVQ $-1, CX - MOVQ CX, 40(AX) + + // Preload values + MOVBQZX 8(AX), CX + MOVQ 32(AX), DX + MOVQ 16(AX), BX + MOVQ 24(AX), SI + ADDQ BX, SI + MOVQ 56(AX), DI + MOVQ 48(AX), R8 + MOVQ (AX), R10 + MOVQ 32(R10), R9 + MOVBQZX 40(R10), R10 + +outer_loop: + // Iterations allowed by the output: (limit - op) / 16 + MOVQ SI, R11 + SUBQ BX, R11 + JLE done + SHRQ $0x04, R11 + + // Iterations allowed by the input: a refill reads the 8 bytes below the window and + // moves it down by at most 7, so every read stays inside the stream while ip stays + // at least 8 above ilowest. + MOVQ DI, R12 + SUBQ R8, R12 + SHRQ $0x03, R12 + CMPQ R12, R11 + CMOVQCS R12, R11 + TESTQ R11, R11 + JZ done + IMUL3Q $0x0e, R11, R11 + ADDQ BX, R11 + PCALIGN $0x40 + +inner_loop: + // symbol 0 + SHRXQ CX, R9, R12 + MOVWQZX (DX)(R12*2), R12 + SHLXQ R12, R9, R9 + ADDQ R12, R10 + SHRQ $0x08, R12 + MOVB R12, (BX) + + // symbol 1 + SHRXQ CX, R9, R12 + MOVWQZX (DX)(R12*2), R12 + SHLXQ R12, R9, R9 + ADDQ R12, R10 + SHRQ $0x08, R12 + MOVB R12, 1(BX) + + // symbol 2 + SHRXQ CX, R9, R12 + MOVWQZX (DX)(R12*2), R12 + SHLXQ R12, R9, R9 + ADDQ R12, R10 + SHRQ $0x08, R12 + MOVB R12, 2(BX) + + // symbol 3 + SHRXQ CX, R9, R12 + MOVWQZX (DX)(R12*2), R12 + SHLXQ R12, R9, R9 + ADDQ R12, R10 + SHRQ $0x08, R12 + MOVB R12, 3(BX) + + // symbol 4 + SHRXQ CX, R9, R12 + MOVWQZX (DX)(R12*2), R12 + SHLXQ R12, R9, R9 + ADDQ R12, R10 + SHRQ $0x08, R12 + MOVB R12, 4(BX) + + // symbol 5 + SHRXQ CX, R9, R12 + MOVWQZX (DX)(R12*2), R12 + SHLXQ R12, R9, R9 + ADDQ R12, R10 + SHRQ $0x08, R12 + MOVB R12, 5(BX) + + // symbol 6 + SHRXQ CX, R9, R12 + MOVWQZX (DX)(R12*2), R12 + SHLXQ R12, R9, R9 + ADDQ R12, R10 + SHRQ $0x08, R12 + MOVB R12, 6(BX) + + // symbol 7 + SHRXQ CX, R9, R12 + MOVWQZX (DX)(R12*2), R12 + SHLXQ R12, R9, R9 + ADDQ R12, R10 + SHRQ $0x08, R12 + MOVB R12, 7(BX) + + // symbol 8 + SHRXQ CX, R9, R12 + MOVWQZX (DX)(R12*2), R12 + SHLXQ R12, R9, R9 + ADDQ R12, R10 + SHRQ $0x08, R12 + MOVB R12, 8(BX) + + // symbol 9 + SHRXQ CX, R9, R12 + MOVWQZX (DX)(R12*2), R12 + SHLXQ R12, R9, R9 + ADDQ R12, R10 + SHRQ $0x08, R12 + MOVB R12, 9(BX) + + // symbol 10 + SHRXQ CX, R9, R12 + MOVWQZX (DX)(R12*2), R12 + SHLXQ R12, R9, R9 + ADDQ R12, R10 + SHRQ $0x08, R12 + MOVB R12, 10(BX) + + // symbol 11 + SHRXQ CX, R9, R12 + MOVWQZX (DX)(R12*2), R12 + SHLXQ R12, R9, R9 + ADDQ R12, R10 + SHRQ $0x08, R12 + MOVB R12, 11(BX) + + // symbol 12 + SHRXQ CX, R9, R12 + MOVWQZX (DX)(R12*2), R12 + SHLXQ R12, R9, R9 + ADDQ R12, R10 + SHRQ $0x08, R12 + MOVB R12, 12(BX) + + // symbol 13 + SHRXQ CX, R9, R12 + MOVWQZX (DX)(R12*2), R12 + SHLXQ R12, R9, R9 + ADDQ R12, R10 + SHRQ $0x08, R12 + MOVB R12, 13(BX) + + // Refill the whole bytes consumed from below the window + MOVQ R10, R12 + ANDQ $0x38, R12 + MOVQ -8(DI), R13 + SHRQ $0x01, R13 + ANDQ $0x07, R10 + MOVQ R12, R14 + XORQ $0x3f, R14 + SHRXQ R14, R13, R13 + SHLXQ R10, R13, R13 + ORQ R13, R9 + SHRQ $0x03, R12 + SUBQ R12, DI + ADDQ $0x0e, BX + CMPQ BX, R11 + JB inner_loop + JMP outer_loop + +done: + // Hand the state back in the Go bit reader's own form: off = ip - in, value, bitsRead. + MOVQ (AX), CX + SUBQ (CX), DI + MOVQ DI, 24(CX) + MOVQ R9, 32(CX) + MOVB R10, 40(CX) + SUBQ 16(AX), BX + MOVQ BX, 40(AX) RET diff --git a/vendor/github.com/klauspost/compress/huff0/decompress_arm64.go b/vendor/github.com/klauspost/compress/huff0/decompress_arm64.go new file mode 100644 index 00000000000..d6bdef6a712 --- /dev/null +++ b/vendor/github.com/klauspost/compress/huff0/decompress_arm64.go @@ -0,0 +1,72 @@ +//go:build arm64 && !noasm && gc + +// arm64 stubs and dispatch for the asm loops used by decompress_asm.go. +// The asm (decompress_arm64.s) is generated by the avo arm64 lowering +// printer from the same source as the amd64 asm; see _generate/gen.go. +package huff0 + +// decompress4x_main_loop_arm64 is an arm64 assembler implementation +// of Decompress4X when tablelog > 8, decoding fastSymbols symbols per +// stream between bit container reloads. +// +//go:noescape +func decompress4x_main_loop_arm64(ctx *decompress4xContext) + +// decompress4x_8b_main_loop_arm64 is an arm64 assembler implementation +// of Decompress4X when tablelog <= 8, decoding fast8bSymbols symbols +// per stream between bit container reloads. +// +//go:noescape +func decompress4x_8b_main_loop_arm64(ctx *decompress4xContext) + +// decompress4x_4b_main_loop_arm64 is an arm64 assembler implementation +// of Decompress4X when tablelog <= 4, decoding fast4bSymbols symbols +// per stream between bit container reloads. +// +//go:noescape +func decompress4x_4b_main_loop_arm64(ctx *decompress4xContext) + +// decompress1x_main_loop_arm64 is an arm64 assembler implementation +// of Decompress1X when tablelog > 8, decoding fastSymbols symbols +// between bit container reloads. +// +//go:noescape +func decompress1x_main_loop_arm64(ctx *decompress1xContext) + +// decompress1x_8b_main_loop_arm64 is an arm64 assembler implementation +// of Decompress1X when tablelog <= 8, decoding fast8bSymbols symbols +// between bit container reloads. +// +//go:noescape +func decompress1x_8b_main_loop_arm64(ctx *decompress1xContext) + +// decompress1x_4b_main_loop_arm64 is an arm64 assembler implementation +// of Decompress1X when tablelog <= 4, decoding fast4bSymbols symbols +// between bit container reloads. +// +//go:noescape +func decompress1x_4b_main_loop_arm64(ctx *decompress1xContext) + +func decompress4x_main_loop_asm(ctx *decompress4xContext) { + decompress4x_main_loop_arm64(ctx) +} + +func decompress4x_8b_main_loop_asm(ctx *decompress4xContext) { + decompress4x_8b_main_loop_arm64(ctx) +} + +func decompress4x_4b_main_loop_asm(ctx *decompress4xContext) { + decompress4x_4b_main_loop_arm64(ctx) +} + +func decompress1x_main_loop_asm(ctx *decompress1xContext) { + decompress1x_main_loop_arm64(ctx) +} + +func decompress1x_8b_main_loop_asm(ctx *decompress1xContext) { + decompress1x_8b_main_loop_arm64(ctx) +} + +func decompress1x_4b_main_loop_asm(ctx *decompress1xContext) { + decompress1x_4b_main_loop_arm64(ctx) +} diff --git a/vendor/github.com/klauspost/compress/huff0/decompress_arm64.s b/vendor/github.com/klauspost/compress/huff0/decompress_arm64.s new file mode 100644 index 00000000000..2db7345f25a --- /dev/null +++ b/vendor/github.com/klauspost/compress/huff0/decompress_arm64.s @@ -0,0 +1,1663 @@ +// Code generated by command: go run gen.go -out ../decompress.s -arch amd64,arm64 -pkg=huff0. DO NOT EDIT. +// EXPERIMENTAL arm64 output lowered from an amd64 avo program. + +//go:build arm64 && (!noasm && gc) + +// func decompress4x_main_loop_amd64(ctx *decompress4xContext) +// Requires: BMI, CMOV +TEXT ·decompress4x_main_loop_arm64(SB), $0-8 + MOVD ctx+0(FP), R0 + + // Preload values + MOVBU 8(R0), R2 + MOVD 32(R0), R3 + MOVD 16(R0), R5 + MOVD 24(R0), R1 + ADD R1, R5, R7 + ADD R1<<1, R5, R9 + ADD R1<<1, R1, R11 + ADD R5, R11, R11 + + // Convert each bit reader to sentinel form: bits = value | 1<= len(src) { + return nil, errors.New("truncated input (or invalid offset)") + } + err := br[i].init(src[start : start+length]) + if err != nil { + return nil, err + } + start += length + } + err := br[3].init(src[start:]) + if err != nil { + return nil, err + } + + // destination, offset to match first output + dstSize := cap(dst) + dst = dst[:dstSize] + out := dst + dstEvery := (dstSize + 3) / 4 + + const tlSize = 1 << tableLogMax + const tlMask = tlSize - 1 + single := d.dt.single[:tlSize] + + var decoded int + + nSyms := fastSymbols + if d.actualTableLog <= 4 { + nSyms = fast4bSymbols + } else if use8BitTables { + nSyms = fast8bSymbols + } + // The asm writes nSyms bytes per stream per iteration and only re-checks + // its bounds between batches of iterations (the batch size is derived + // from limit in _generate/gen.go), so stream 0 must stop early enough + // that stream 3 (which may be up to 3 bytes shorter than dstEvery) + // never writes past the end of out. Every stream needs a full 8-byte + // window ahead of its read pointer to enter the loop. + if limit := dstEvery - nSyms - 2; limit > 0 && br[0].canUseAsm() && br[1].canUseAsm() && br[2].canUseAsm() && br[3].canUseAsm() { + for i := range br { + br[i].prepareForAsm() + } + ctx := decompress4xContext{ + pbr: &br, + peekBits: uint8((64 - d.actualTableLog) & 63), // see: bitReaderShifted.peekBitsFast() + out: &out[0], + dstEvery: dstEvery, + tbl: &single[0], + limit: &out[limit], + // The 6-byte jump table sits below stream 0 inside src, so the + // lowest window may reach into it; restoreFromAsm accounts for + // bytes below a stream's start. Bounding by src rather than by + // stream 0 keeps the asm running about six bytes longer, which + // matters for streams with very short codes. + ilowest: &src[0], + } + for i := range br { + ctx.ip[i] = &br[i].in[br[i].off] + } + switch nSyms { + case fast4bSymbols: + decompress4x_4b_main_loop_asm(&ctx) + case fast8bSymbols: + decompress4x_8b_main_loop_asm(&ctx) + default: + decompress4x_main_loop_asm(&ctx) + } + + decoded = ctx.decoded + out = out[decoded/4:] + for i := range br { + if err := br[i].restoreFromAsm(); err != nil { + return nil, err + } + } + } + + // Decode remaining. + remainBytes := dstEvery - (decoded / 4) + for i := range br { + offset := dstEvery * i + endsAt := min(offset+remainBytes, len(out)) + br := &br[i] + bitsLeft := br.remaining() + for bitsLeft > 0 { + br.fill() + if offset >= endsAt { + return nil, errors.New("corruption detected: stream overrun 4") + } + + // Read value and increment offset. + val := br.peekBitsFast(d.actualTableLog) + v := single[val&tlMask].entry + nBits := uint8(v) + br.advance(nBits) + bitsLeft -= uint(nBits) + out[offset] = uint8(v >> 8) + offset++ + } + if offset != endsAt { + return nil, fmt.Errorf("corruption detected: short output block %d, end %d != %d", i, offset, endsAt) + } + decoded += offset - dstEvery*i + err = br.close() + if err != nil { + return nil, err + } + } + if dstSize != decoded { + return nil, errors.New("corruption detected: short output block") + } + return dst, nil +} + +// decompress1xContext is the argument block of the Decompress1X asm loops. +// Go fills every field but decoded; the asm advances ip, and on return +// leaves the bit reader in the form bitReaderShifted.restoreFromAsm expects. +type decompress1xContext struct { + pbr *bitReaderShifted + peekBits uint8 + out *byte + outCap int // no write reaches out[outCap] + tbl *dEntrySingle + decoded int + ilowest *byte // start of the stream; no read goes below it + ip *byte // the 8-byte input window, advanced by the asm +} + +// Decompress1X will decompress a 1X encoded stream. +// The cap of the output buffer will be the maximum decompressed size. +// The length of the supplied input must match the end of a block exactly. +func (d *Decoder) Decompress1X(dst, src []byte) ([]byte, error) { + if len(d.dt.single) == 0 { + return nil, errors.New("no table loaded") + } + var br bitReaderShifted + err := br.init(src) + if err != nil { + return dst, err + } + maxDecodedSize := cap(dst) + dst = dst[:maxDecodedSize] + + const tlSize = 1 << tableLogMax + const tlMask = tlSize - 1 + + // The asm decodes whole batches of symbols and only re-checks its + // bounds between them, so it needs at least one batch of room (the + // output bound rounds nSyms up to 16, see _generate/gen.go) and a full + // 8-byte window ahead of the read pointer to enter the loop. It also + // needs at most 7 bits consumed on entry so that a batch cannot run + // the container dry, which prepareForAsm establishes. + decoded := 0 + if maxDecodedSize >= 16 && br.canUseAsm() { + br.prepareForAsm() + ctx := decompress1xContext{ + pbr: &br, + out: &dst[0], + outCap: maxDecodedSize, + peekBits: uint8((64 - d.actualTableLog) & 63), // see: bitReaderShifted.peekBitsFast() + tbl: &d.dt.single[0], + ilowest: &src[0], + ip: &br.in[br.off], + } + if d.actualTableLog <= 4 { + decompress1x_4b_main_loop_asm(&ctx) + } else if d.actualTableLog <= 8 { + decompress1x_8b_main_loop_asm(&ctx) + } else { + decompress1x_main_loop_asm(&ctx) + } + decoded = ctx.decoded + } + dst = dst[:decoded] + + bitsLeft := br.remaining() + for bitsLeft > 0 { + br.fill() + if len(dst) >= maxDecodedSize { + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + v := d.dt.single[br.peekBitsFast(d.actualTableLog)&tlMask] + nBits := uint8(v.entry) + br.advance(nBits) + bitsLeft -= uint(nBits) + dst = append(dst, uint8(v.entry>>8)) + } + return dst, br.close() +} diff --git a/vendor/github.com/klauspost/compress/huff0/decompress_generic.go b/vendor/github.com/klauspost/compress/huff0/decompress_generic.go index 61039232224..8db45a11062 100644 --- a/vendor/github.com/klauspost/compress/huff0/decompress_generic.go +++ b/vendor/github.com/klauspost/compress/huff0/decompress_generic.go @@ -1,4 +1,4 @@ -//go:build !amd64 || appengine || !gc || noasm +//go:build (!amd64 && !arm64) || !gc || noasm // This file contains a generic implementation of Decoder.Decompress4X. package huff0 diff --git a/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.go b/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.go index b97f9056f4c..3d9e20f1a0d 100644 --- a/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.go +++ b/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.go @@ -1,4 +1,4 @@ -//go:build amd64 && !appengine && !noasm && gc +//go:build amd64 && !noasm && gc package cpuinfo diff --git a/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.s b/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.s index 4465fbe9e90..f128c10c6f8 100644 --- a/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.s +++ b/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.s @@ -1,6 +1,4 @@ -// +build !appengine -// +build gc -// +build !noasm +//go:build !noasm && gc #include "textflag.h" #include "funcdata.h" diff --git a/vendor/github.com/klauspost/compress/internal/le/unsafe_disabled.go b/vendor/github.com/klauspost/compress/internal/le/unsafe_disabled.go index 4f2a0d8c58d..787ec9ef135 100644 --- a/vendor/github.com/klauspost/compress/internal/le/unsafe_disabled.go +++ b/vendor/github.com/klauspost/compress/internal/le/unsafe_disabled.go @@ -1,4 +1,4 @@ -//go:build !(amd64 || arm64 || ppc64le || riscv64) || nounsafe || purego || appengine +//go:build !(amd64 || arm64 || ppc64le || riscv64) || nounsafe || purego package le diff --git a/vendor/github.com/klauspost/compress/internal/le/unsafe_enabled.go b/vendor/github.com/klauspost/compress/internal/le/unsafe_enabled.go index 218a38bc4a5..e60be8158ed 100644 --- a/vendor/github.com/klauspost/compress/internal/le/unsafe_enabled.go +++ b/vendor/github.com/klauspost/compress/internal/le/unsafe_enabled.go @@ -1,6 +1,6 @@ // We enable 64 bit LE platforms: -//go:build (amd64 || arm64 || ppc64le || riscv64) && !nounsafe && !purego && !appengine +//go:build (amd64 || arm64 || ppc64le || riscv64) && !nounsafe && !purego package le diff --git a/vendor/github.com/klauspost/compress/internal/regmask/regmask.go b/vendor/github.com/klauspost/compress/internal/regmask/regmask.go new file mode 100644 index 00000000000..3da49d15447 --- /dev/null +++ b/vendor/github.com/klauspost/compress/internal/regmask/regmask.go @@ -0,0 +1,50 @@ +//go:build !386 + +// Package regmask provides masks for variable shift counts. +// +// Go defines a shift by more than the width of the shifted value as producing +// zero, so the compiler has to guard every variable shift against that: on +// amd64 with a CMP and an SBB, on arm64 with a CMP and a CSEL, and so on. When +// the count is known to be smaller than the width anyway, masking it with the +// width minus one lets the compiler drop the guard. The mask itself costs +// nothing on the architectures whose shift instructions already use only the +// low bits of the count, which the compiler knows about. +// +// Each constant is named for the width of the value being shifted and the type +// of the shift count, and may only be used where the count is always smaller +// than that width: +// +// x := y >> (n & regmask.Shift64ByUint) // y is 64 bits, n is a uint below 64 +package regmask + +const ( + // ShiftNByUint8 - shifting an N bit value by a uint8 + Shift8ByUint8 = 7 + Shift16ByUint8 = 15 + Shift32ByUint8 = 31 + Shift64ByUint8 = 63 + + // ShiftNByUint16 - shifting an N bit value by a uint16 + Shift8ByUint16 = Shift8ByUint8 + Shift16ByUint16 = Shift16ByUint8 + Shift32ByUint16 = Shift32ByUint8 + Shift64ByUint16 = Shift64ByUint8 + + // ShiftNByUint32 - shifting an N bit value by a uint32 + Shift8ByUint32 = Shift8ByUint8 + Shift16ByUint32 = Shift16ByUint8 + Shift32ByUint32 = Shift32ByUint8 + Shift64ByUint32 = Shift64ByUint8 + + // ShiftNByUint64 - shifting an N bit value by a uint64 + Shift8ByUint64 = Shift8ByUint8 + Shift16ByUint64 = Shift16ByUint8 + Shift32ByUint64 = Shift32ByUint8 + Shift64ByUint64 = Shift64ByUint8 + + // ShiftNByUint - shifting an N bit value by a uint + Shift8ByUint = Shift8ByUint8 + Shift16ByUint = Shift16ByUint8 + Shift32ByUint = Shift32ByUint8 + Shift64ByUint = Shift64ByUint8 +) diff --git a/vendor/github.com/klauspost/compress/internal/regmask/regmask_386.go b/vendor/github.com/klauspost/compress/internal/regmask/regmask_386.go new file mode 100644 index 00000000000..ff15f7c1af1 --- /dev/null +++ b/vendor/github.com/klauspost/compress/internal/regmask/regmask_386.go @@ -0,0 +1,39 @@ +//go:build 386 + +package regmask + +// A 64 bit shift on 386 is synthesized from 32 bit instructions, and masking its +// count makes the compiler emit more code rather than less, so those masks are +// no-ops here: each is the largest value its count type can hold, which the +// compiler folds away. Shifts of narrower values behave as elsewhere. +const ( + // ShiftNByUint8 - shifting an N bit value by a uint8 + Shift8ByUint8 = 7 + Shift16ByUint8 = 15 + Shift32ByUint8 = 31 + Shift64ByUint8 = 0xff + + // ShiftNByUint16 - shifting an N bit value by a uint16 + Shift8ByUint16 = Shift8ByUint8 + Shift16ByUint16 = Shift16ByUint8 + Shift32ByUint16 = Shift32ByUint8 + Shift64ByUint16 = 0xffff + + // ShiftNByUint32 - shifting an N bit value by a uint32 + Shift8ByUint32 = Shift8ByUint8 + Shift16ByUint32 = Shift16ByUint8 + Shift32ByUint32 = Shift32ByUint8 + Shift64ByUint32 = 0xffffffff + + // ShiftNByUint64 - shifting an N bit value by a uint64 + Shift8ByUint64 = Shift8ByUint8 + Shift16ByUint64 = Shift16ByUint8 + Shift32ByUint64 = Shift32ByUint8 + Shift64ByUint64 = 0xffffffffffffffff + + // ShiftNByUint - shifting an N bit value by a uint + Shift8ByUint = Shift8ByUint8 + Shift16ByUint = Shift16ByUint8 + Shift32ByUint = Shift32ByUint8 + Shift64ByUint = ^uint(0) +) diff --git a/vendor/github.com/klauspost/compress/s2/decode_amd64.s b/vendor/github.com/klauspost/compress/s2/decode_amd64.s index 1216df78f5d..0e50dbaa896 100644 --- a/vendor/github.com/klauspost/compress/s2/decode_amd64.s +++ b/vendor/github.com/klauspost/compress/s2/decode_amd64.s @@ -3,9 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !appengine -// +build gc -// +build !noasm +//go:build !noasm && gc #include "textflag.h" diff --git a/vendor/github.com/klauspost/compress/s2/decode_arm64.s b/vendor/github.com/klauspost/compress/s2/decode_arm64.s index 78e463f342b..6b606ee9d3e 100644 --- a/vendor/github.com/klauspost/compress/s2/decode_arm64.s +++ b/vendor/github.com/klauspost/compress/s2/decode_arm64.s @@ -2,9 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !appengine -// +build gc -// +build !noasm +//go:build !noasm && gc #include "textflag.h" diff --git a/vendor/github.com/klauspost/compress/s2/decode_asm.go b/vendor/github.com/klauspost/compress/s2/decode_asm.go index cb3576edd47..02678456973 100644 --- a/vendor/github.com/klauspost/compress/s2/decode_asm.go +++ b/vendor/github.com/klauspost/compress/s2/decode_asm.go @@ -3,11 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build (amd64 || arm64) && !appengine && gc && !noasm -// +build amd64 arm64 -// +build !appengine -// +build gc -// +build !noasm +//go:build (amd64 || arm64) && gc && !noasm package s2 diff --git a/vendor/github.com/klauspost/compress/s2/decode_other.go b/vendor/github.com/klauspost/compress/s2/decode_other.go index 2905ba2774d..aeac3470c4a 100644 --- a/vendor/github.com/klauspost/compress/s2/decode_other.go +++ b/vendor/github.com/klauspost/compress/s2/decode_other.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build (!amd64 && !arm64) || appengine || !gc || noasm +//go:build (!amd64 && !arm64) || !gc || noasm package s2 diff --git a/vendor/github.com/klauspost/compress/s2/encode_asm.go b/vendor/github.com/klauspost/compress/s2/encode_asm.go new file mode 100644 index 00000000000..9ca546c095e --- /dev/null +++ b/vendor/github.com/klauspost/compress/s2/encode_asm.go @@ -0,0 +1,316 @@ +//go:build (amd64 || arm64) && !noasm && gc + +package s2 + +import ( + "sync" + + "github.com/klauspost/compress/internal/race" +) + +const hasAsm = true + +var encPools [4]sync.Pool + +// encodeBlock encodes a non-empty src to a guaranteed-large-enough dst. It +// assumes that the varint-encoded length of the decompressed bytes has already +// been written. +// +// It also assumes that: +// +// len(dst) >= MaxEncodedLen(len(src)) && +// minNonLiteralBlockSize <= len(src) && len(src) <= maxBlockSize +func encodeBlock(dst, src []byte) (d int) { + race.ReadSlice(src) + race.WriteSlice(dst) + + const ( + // Use 12 bit table when less than... + limit12B = 16 << 10 + // Use 10 bit table when less than... + limit10B = 4 << 10 + // Use 8 bit table when less than... + limit8B = 512 + ) + + if len(src) >= 4<<20 { + const sz, pool = 65536, 0 + tmp, ok := encPools[pool].Get().(*[sz]byte) + if !ok { + tmp = &[sz]byte{} + } + race.WriteSlice(tmp[:]) + defer encPools[pool].Put(tmp) + return encodeBlockAsm(dst, src, tmp) + } + if len(src) >= limit12B { + const sz, pool = 65536, 0 + tmp, ok := encPools[pool].Get().(*[sz]byte) + if !ok { + tmp = &[sz]byte{} + } + race.WriteSlice(tmp[:]) + defer encPools[pool].Put(tmp) + return encodeBlockAsm4MB(dst, src, tmp) + } + if len(src) >= limit10B { + const sz, pool = 16384, 1 + tmp, ok := encPools[pool].Get().(*[sz]byte) + if !ok { + tmp = &[sz]byte{} + } + race.WriteSlice(tmp[:]) + defer encPools[pool].Put(tmp) + return encodeBlockAsm12B(dst, src, tmp) + } + if len(src) >= limit8B { + const sz, pool = 4096, 2 + tmp, ok := encPools[pool].Get().(*[sz]byte) + if !ok { + tmp = &[sz]byte{} + } + race.WriteSlice(tmp[:]) + defer encPools[pool].Put(tmp) + return encodeBlockAsm10B(dst, src, tmp) + } + if len(src) < minNonLiteralBlockSize { + return 0 + } + const sz, pool = 1024, 3 + tmp, ok := encPools[pool].Get().(*[sz]byte) + if !ok { + tmp = &[sz]byte{} + } + race.WriteSlice(tmp[:]) + defer encPools[pool].Put(tmp) + return encodeBlockAsm8B(dst, src, tmp) +} + +var encBetterPools [5]sync.Pool + +// encodeBlockBetter encodes a non-empty src to a guaranteed-large-enough dst. It +// assumes that the varint-encoded length of the decompressed bytes has already +// been written. +// +// It also assumes that: +// +// len(dst) >= MaxEncodedLen(len(src)) && +// minNonLiteralBlockSize <= len(src) && len(src) <= maxBlockSize +func encodeBlockBetter(dst, src []byte) (d int) { + race.ReadSlice(src) + race.WriteSlice(dst) + + const ( + // Use 12 bit table when less than... + limit12B = 16 << 10 + // Use 10 bit table when less than... + limit10B = 4 << 10 + // Use 8 bit table when less than... + limit8B = 512 + ) + + if len(src) > 4<<20 { + const sz, pool = 589824, 0 + tmp, ok := encBetterPools[pool].Get().(*[sz]byte) + if !ok { + tmp = &[sz]byte{} + } + race.WriteSlice(tmp[:]) + defer encBetterPools[pool].Put(tmp) + return encodeBetterBlockAsm(dst, src, tmp) + } + if len(src) >= limit12B { + const sz, pool = 589824, 0 + tmp, ok := encBetterPools[pool].Get().(*[sz]byte) + if !ok { + tmp = &[sz]byte{} + } + race.WriteSlice(tmp[:]) + defer encBetterPools[pool].Put(tmp) + + return encodeBetterBlockAsm4MB(dst, src, tmp) + } + if len(src) >= limit10B { + const sz, pool = 81920, 0 + tmp, ok := encBetterPools[pool].Get().(*[sz]byte) + if !ok { + tmp = &[sz]byte{} + } + race.WriteSlice(tmp[:]) + defer encBetterPools[pool].Put(tmp) + + return encodeBetterBlockAsm12B(dst, src, tmp) + } + if len(src) >= limit8B { + const sz, pool = 20480, 1 + tmp, ok := encBetterPools[pool].Get().(*[sz]byte) + if !ok { + tmp = &[sz]byte{} + } + race.WriteSlice(tmp[:]) + defer encBetterPools[pool].Put(tmp) + return encodeBetterBlockAsm10B(dst, src, tmp) + } + if len(src) < minNonLiteralBlockSize { + return 0 + } + + const sz, pool = 5120, 2 + tmp, ok := encBetterPools[pool].Get().(*[sz]byte) + if !ok { + tmp = &[sz]byte{} + } + race.WriteSlice(tmp[:]) + defer encBetterPools[pool].Put(tmp) + return encodeBetterBlockAsm8B(dst, src, tmp) +} + +// encodeBlockSnappy encodes a non-empty src to a guaranteed-large-enough dst. It +// assumes that the varint-encoded length of the decompressed bytes has already +// been written. +// +// It also assumes that: +// +// len(dst) >= MaxEncodedLen(len(src)) && +// minNonLiteralBlockSize <= len(src) && len(src) <= maxBlockSize +func encodeBlockSnappy(dst, src []byte) (d int) { + race.ReadSlice(src) + race.WriteSlice(dst) + + const ( + // Use 12 bit table when less than... + limit12B = 16 << 10 + // Use 10 bit table when less than... + limit10B = 4 << 10 + // Use 8 bit table when less than... + limit8B = 512 + ) + if len(src) > 65536 { + const sz, pool = 65536, 0 + tmp, ok := encPools[pool].Get().(*[sz]byte) + if !ok { + tmp = &[sz]byte{} + } + race.WriteSlice(tmp[:]) + defer encPools[pool].Put(tmp) + return encodeSnappyBlockAsm(dst, src, tmp) + } + if len(src) >= limit12B { + const sz, pool = 65536, 0 + tmp, ok := encPools[pool].Get().(*[sz]byte) + if !ok { + tmp = &[sz]byte{} + } + race.WriteSlice(tmp[:]) + defer encPools[pool].Put(tmp) + return encodeSnappyBlockAsm64K(dst, src, tmp) + } + if len(src) >= limit10B { + const sz, pool = 16384, 1 + tmp, ok := encPools[pool].Get().(*[sz]byte) + if !ok { + tmp = &[sz]byte{} + } + race.WriteSlice(tmp[:]) + defer encPools[pool].Put(tmp) + return encodeSnappyBlockAsm12B(dst, src, tmp) + } + if len(src) >= limit8B { + const sz, pool = 4096, 2 + tmp, ok := encPools[pool].Get().(*[sz]byte) + if !ok { + tmp = &[sz]byte{} + } + race.WriteSlice(tmp[:]) + defer encPools[pool].Put(tmp) + return encodeSnappyBlockAsm10B(dst, src, tmp) + } + if len(src) < minNonLiteralBlockSize { + return 0 + } + const sz, pool = 1024, 3 + tmp, ok := encPools[pool].Get().(*[sz]byte) + if !ok { + tmp = &[sz]byte{} + } + race.WriteSlice(tmp[:]) + defer encPools[pool].Put(tmp) + return encodeSnappyBlockAsm8B(dst, src, tmp) +} + +// encodeBlockSnappy encodes a non-empty src to a guaranteed-large-enough dst. It +// assumes that the varint-encoded length of the decompressed bytes has already +// been written. +// +// It also assumes that: +// +// len(dst) >= MaxEncodedLen(len(src)) && +// minNonLiteralBlockSize <= len(src) && len(src) <= maxBlockSize +func encodeBlockBetterSnappy(dst, src []byte) (d int) { + race.ReadSlice(src) + race.WriteSlice(dst) + + const ( + // Use 12 bit table when less than... + limit12B = 16 << 10 + // Use 10 bit table when less than... + limit10B = 4 << 10 + // Use 8 bit table when less than... + limit8B = 512 + ) + if len(src) > 65536 { + const sz, pool = 589824, 0 + tmp, ok := encBetterPools[pool].Get().(*[sz]byte) + if !ok { + tmp = &[sz]byte{} + } + race.WriteSlice(tmp[:]) + defer encBetterPools[pool].Put(tmp) + return encodeSnappyBetterBlockAsm(dst, src, tmp) + } + + if len(src) >= limit12B { + const sz, pool = 294912, 4 + tmp, ok := encBetterPools[pool].Get().(*[sz]byte) + if !ok { + tmp = &[sz]byte{} + } + race.WriteSlice(tmp[:]) + defer encBetterPools[pool].Put(tmp) + + return encodeSnappyBetterBlockAsm64K(dst, src, tmp) + } + if len(src) >= limit10B { + const sz, pool = 81920, 0 + tmp, ok := encBetterPools[pool].Get().(*[sz]byte) + if !ok { + tmp = &[sz]byte{} + } + race.WriteSlice(tmp[:]) + defer encBetterPools[pool].Put(tmp) + + return encodeSnappyBetterBlockAsm12B(dst, src, tmp) + } + if len(src) >= limit8B { + const sz, pool = 20480, 1 + tmp, ok := encBetterPools[pool].Get().(*[sz]byte) + if !ok { + tmp = &[sz]byte{} + } + race.WriteSlice(tmp[:]) + defer encBetterPools[pool].Put(tmp) + return encodeSnappyBetterBlockAsm10B(dst, src, tmp) + } + if len(src) < minNonLiteralBlockSize { + return 0 + } + + const sz, pool = 5120, 2 + tmp, ok := encBetterPools[pool].Get().(*[sz]byte) + if !ok { + tmp = &[sz]byte{} + } + race.WriteSlice(tmp[:]) + defer encBetterPools[pool].Put(tmp) + return encodeSnappyBetterBlockAsm8B(dst, src, tmp) +} diff --git a/vendor/github.com/klauspost/compress/s2/encode_better.go b/vendor/github.com/klauspost/compress/s2/encode_better.go index adbc57c4d27..2509d1c99e3 100644 --- a/vendor/github.com/klauspost/compress/s2/encode_better.go +++ b/vendor/github.com/klauspost/compress/s2/encode_better.go @@ -86,12 +86,18 @@ func encodeBlockBetterGo(dst, src []byte) (d int) { // We initialize repeat to 0, so we never match on first attempt repeat := 0 + // Cap the adaptive skip, as encodeBetterBlockAsm and the snappy Go encoder + // below already do. Without a cap, a long stretch with no matches lets the + // skip grow geometrically until it strides past the start of the next + // compressible region and loses the matches there. + const maxSkip = 100 + for { candidateL := 0 nextS := 0 for { // Next src position to check - nextS = s + (s-nextEmit)>>7 + 1 + nextS = s + min((s-nextEmit)>>7+1, maxSkip) if nextS > sLimit { goto emitRemainder } diff --git a/vendor/github.com/klauspost/compress/s2/encode_go.go b/vendor/github.com/klauspost/compress/s2/encode_go.go index 5597f3ef2ec..9bc9a54f4dd 100644 --- a/vendor/github.com/klauspost/compress/s2/encode_go.go +++ b/vendor/github.com/klauspost/compress/s2/encode_go.go @@ -1,4 +1,4 @@ -//go:build !amd64 || appengine || !gc || noasm +//go:build (!amd64 && !arm64) || !gc || noasm package s2 @@ -7,7 +7,7 @@ import ( "math/bits" ) -const hasAmd64Asm = false +const hasAsm = false // encodeBlock encodes a non-empty src to a guaranteed-large-enough dst. It // assumes that the varint-encoded length of the decompressed bytes has already diff --git a/vendor/github.com/klauspost/compress/s2/encodeblock_amd64.s b/vendor/github.com/klauspost/compress/s2/encodeblock_amd64.s index df9be687be7..9e80868036d 100644 --- a/vendor/github.com/klauspost/compress/s2/encodeblock_amd64.s +++ b/vendor/github.com/klauspost/compress/s2/encodeblock_amd64.s @@ -1,6 +1,6 @@ -// Code generated by command: go run gen.go -out ../encodeblock_amd64.s -stubs ../encodeblock_amd64.go -pkg=s2. DO NOT EDIT. +// Code generated by command: go run gen.go -out ../encodeblock_amd64.s -stubs ../encodeblock_asm.go -pkg=s2. DO NOT EDIT. -//go:build !appengine && !noasm && gc && !noasm +//go:build !noasm && gc && (amd64 || arm64) #include "textflag.h" @@ -274,16 +274,10 @@ matchlen_loopback_16_repeat_extend_encodeBlockAsm: JMP matchlen_loopback_16_repeat_extend_encodeBlockAsm matchlen_bsf_16repeat_extend_encodeBlockAsm: -#ifdef GOAMD64_v3 TZCNTQ R13, R13 - -#else - BSFQ R13, R13 - -#endif - SARQ $0x03, R13 - LEAL 8(R12)(R13*1), R12 - JMP repeat_extend_forward_end_encodeBlockAsm + SARQ $0x03, R13 + LEAL 8(R12)(R13*1), R12 + JMP repeat_extend_forward_end_encodeBlockAsm matchlen_match8_repeat_extend_encodeBlockAsm: CMPL R9, $0x08 @@ -296,16 +290,10 @@ matchlen_match8_repeat_extend_encodeBlockAsm: JMP matchlen_match4_repeat_extend_encodeBlockAsm matchlen_bsf_8_repeat_extend_encodeBlockAsm: -#ifdef GOAMD64_v3 TZCNTQ R11, R11 - -#else - BSFQ R11, R11 - -#endif - SARQ $0x03, R11 - LEAL (R12)(R11*1), R12 - JMP repeat_extend_forward_end_encodeBlockAsm + SARQ $0x03, R11 + LEAL (R12)(R11*1), R12 + JMP repeat_extend_forward_end_encodeBlockAsm matchlen_match4_repeat_extend_encodeBlockAsm: CMPL R9, $0x04 @@ -898,16 +886,10 @@ matchlen_loopback_16_match_nolit_encodeBlockAsm: JMP matchlen_loopback_16_match_nolit_encodeBlockAsm matchlen_bsf_16match_nolit_encodeBlockAsm: -#ifdef GOAMD64_v3 TZCNTQ R11, R11 - -#else - BSFQ R11, R11 - -#endif - SARQ $0x03, R11 - LEAL 8(R10)(R11*1), R10 - JMP match_nolit_end_encodeBlockAsm + SARQ $0x03, R11 + LEAL 8(R10)(R11*1), R10 + JMP match_nolit_end_encodeBlockAsm matchlen_match8_match_nolit_encodeBlockAsm: CMPL DI, $0x08 @@ -920,16 +902,10 @@ matchlen_match8_match_nolit_encodeBlockAsm: JMP matchlen_match4_match_nolit_encodeBlockAsm matchlen_bsf_8_match_nolit_encodeBlockAsm: -#ifdef GOAMD64_v3 TZCNTQ R9, R9 - -#else - BSFQ R9, R9 - -#endif - SARQ $0x03, R9 - LEAL (R10)(R9*1), R10 - JMP match_nolit_end_encodeBlockAsm + SARQ $0x03, R9 + LEAL (R10)(R9*1), R10 + JMP match_nolit_end_encodeBlockAsm matchlen_match4_match_nolit_encodeBlockAsm: CMPL DI, $0x04 @@ -1689,16 +1665,10 @@ matchlen_loopback_16_repeat_extend_encodeBlockAsm4MB: JMP matchlen_loopback_16_repeat_extend_encodeBlockAsm4MB matchlen_bsf_16repeat_extend_encodeBlockAsm4MB: -#ifdef GOAMD64_v3 TZCNTQ R13, R13 - -#else - BSFQ R13, R13 - -#endif - SARQ $0x03, R13 - LEAL 8(R12)(R13*1), R12 - JMP repeat_extend_forward_end_encodeBlockAsm4MB + SARQ $0x03, R13 + LEAL 8(R12)(R13*1), R12 + JMP repeat_extend_forward_end_encodeBlockAsm4MB matchlen_match8_repeat_extend_encodeBlockAsm4MB: CMPL R9, $0x08 @@ -1711,16 +1681,10 @@ matchlen_match8_repeat_extend_encodeBlockAsm4MB: JMP matchlen_match4_repeat_extend_encodeBlockAsm4MB matchlen_bsf_8_repeat_extend_encodeBlockAsm4MB: -#ifdef GOAMD64_v3 TZCNTQ R11, R11 - -#else - BSFQ R11, R11 - -#endif - SARQ $0x03, R11 - LEAL (R12)(R11*1), R12 - JMP repeat_extend_forward_end_encodeBlockAsm4MB + SARQ $0x03, R11 + LEAL (R12)(R11*1), R12 + JMP repeat_extend_forward_end_encodeBlockAsm4MB matchlen_match4_repeat_extend_encodeBlockAsm4MB: CMPL R9, $0x04 @@ -2263,16 +2227,10 @@ matchlen_loopback_16_match_nolit_encodeBlockAsm4MB: JMP matchlen_loopback_16_match_nolit_encodeBlockAsm4MB matchlen_bsf_16match_nolit_encodeBlockAsm4MB: -#ifdef GOAMD64_v3 TZCNTQ R11, R11 - -#else - BSFQ R11, R11 - -#endif - SARQ $0x03, R11 - LEAL 8(R10)(R11*1), R10 - JMP match_nolit_end_encodeBlockAsm4MB + SARQ $0x03, R11 + LEAL 8(R10)(R11*1), R10 + JMP match_nolit_end_encodeBlockAsm4MB matchlen_match8_match_nolit_encodeBlockAsm4MB: CMPL DI, $0x08 @@ -2285,16 +2243,10 @@ matchlen_match8_match_nolit_encodeBlockAsm4MB: JMP matchlen_match4_match_nolit_encodeBlockAsm4MB matchlen_bsf_8_match_nolit_encodeBlockAsm4MB: -#ifdef GOAMD64_v3 TZCNTQ R9, R9 - -#else - BSFQ R9, R9 - -#endif - SARQ $0x03, R9 - LEAL (R10)(R9*1), R10 - JMP match_nolit_end_encodeBlockAsm4MB + SARQ $0x03, R9 + LEAL (R10)(R9*1), R10 + JMP match_nolit_end_encodeBlockAsm4MB matchlen_match4_match_nolit_encodeBlockAsm4MB: CMPL DI, $0x04 @@ -3006,16 +2958,10 @@ matchlen_loopback_16_repeat_extend_encodeBlockAsm12B: JMP matchlen_loopback_16_repeat_extend_encodeBlockAsm12B matchlen_bsf_16repeat_extend_encodeBlockAsm12B: -#ifdef GOAMD64_v3 TZCNTQ R13, R13 - -#else - BSFQ R13, R13 - -#endif - SARQ $0x03, R13 - LEAL 8(R12)(R13*1), R12 - JMP repeat_extend_forward_end_encodeBlockAsm12B + SARQ $0x03, R13 + LEAL 8(R12)(R13*1), R12 + JMP repeat_extend_forward_end_encodeBlockAsm12B matchlen_match8_repeat_extend_encodeBlockAsm12B: CMPL R9, $0x08 @@ -3028,16 +2974,10 @@ matchlen_match8_repeat_extend_encodeBlockAsm12B: JMP matchlen_match4_repeat_extend_encodeBlockAsm12B matchlen_bsf_8_repeat_extend_encodeBlockAsm12B: -#ifdef GOAMD64_v3 TZCNTQ R11, R11 - -#else - BSFQ R11, R11 - -#endif - SARQ $0x03, R11 - LEAL (R12)(R11*1), R12 - JMP repeat_extend_forward_end_encodeBlockAsm12B + SARQ $0x03, R11 + LEAL (R12)(R11*1), R12 + JMP repeat_extend_forward_end_encodeBlockAsm12B matchlen_match4_repeat_extend_encodeBlockAsm12B: CMPL R9, $0x04 @@ -3458,16 +3398,10 @@ matchlen_loopback_16_match_nolit_encodeBlockAsm12B: JMP matchlen_loopback_16_match_nolit_encodeBlockAsm12B matchlen_bsf_16match_nolit_encodeBlockAsm12B: -#ifdef GOAMD64_v3 TZCNTQ R11, R11 - -#else - BSFQ R11, R11 - -#endif - SARQ $0x03, R11 - LEAL 8(R10)(R11*1), R10 - JMP match_nolit_end_encodeBlockAsm12B + SARQ $0x03, R11 + LEAL 8(R10)(R11*1), R10 + JMP match_nolit_end_encodeBlockAsm12B matchlen_match8_match_nolit_encodeBlockAsm12B: CMPL DI, $0x08 @@ -3480,16 +3414,10 @@ matchlen_match8_match_nolit_encodeBlockAsm12B: JMP matchlen_match4_match_nolit_encodeBlockAsm12B matchlen_bsf_8_match_nolit_encodeBlockAsm12B: -#ifdef GOAMD64_v3 TZCNTQ R9, R9 - -#else - BSFQ R9, R9 - -#endif - SARQ $0x03, R9 - LEAL (R10)(R9*1), R10 - JMP match_nolit_end_encodeBlockAsm12B + SARQ $0x03, R9 + LEAL (R10)(R9*1), R10 + JMP match_nolit_end_encodeBlockAsm12B matchlen_match4_match_nolit_encodeBlockAsm12B: CMPL DI, $0x04 @@ -4091,16 +4019,10 @@ matchlen_loopback_16_repeat_extend_encodeBlockAsm10B: JMP matchlen_loopback_16_repeat_extend_encodeBlockAsm10B matchlen_bsf_16repeat_extend_encodeBlockAsm10B: -#ifdef GOAMD64_v3 TZCNTQ R13, R13 - -#else - BSFQ R13, R13 - -#endif - SARQ $0x03, R13 - LEAL 8(R12)(R13*1), R12 - JMP repeat_extend_forward_end_encodeBlockAsm10B + SARQ $0x03, R13 + LEAL 8(R12)(R13*1), R12 + JMP repeat_extend_forward_end_encodeBlockAsm10B matchlen_match8_repeat_extend_encodeBlockAsm10B: CMPL R9, $0x08 @@ -4113,16 +4035,10 @@ matchlen_match8_repeat_extend_encodeBlockAsm10B: JMP matchlen_match4_repeat_extend_encodeBlockAsm10B matchlen_bsf_8_repeat_extend_encodeBlockAsm10B: -#ifdef GOAMD64_v3 TZCNTQ R11, R11 - -#else - BSFQ R11, R11 - -#endif - SARQ $0x03, R11 - LEAL (R12)(R11*1), R12 - JMP repeat_extend_forward_end_encodeBlockAsm10B + SARQ $0x03, R11 + LEAL (R12)(R11*1), R12 + JMP repeat_extend_forward_end_encodeBlockAsm10B matchlen_match4_repeat_extend_encodeBlockAsm10B: CMPL R9, $0x04 @@ -4543,16 +4459,10 @@ matchlen_loopback_16_match_nolit_encodeBlockAsm10B: JMP matchlen_loopback_16_match_nolit_encodeBlockAsm10B matchlen_bsf_16match_nolit_encodeBlockAsm10B: -#ifdef GOAMD64_v3 TZCNTQ R11, R11 - -#else - BSFQ R11, R11 - -#endif - SARQ $0x03, R11 - LEAL 8(R10)(R11*1), R10 - JMP match_nolit_end_encodeBlockAsm10B + SARQ $0x03, R11 + LEAL 8(R10)(R11*1), R10 + JMP match_nolit_end_encodeBlockAsm10B matchlen_match8_match_nolit_encodeBlockAsm10B: CMPL DI, $0x08 @@ -4565,16 +4475,10 @@ matchlen_match8_match_nolit_encodeBlockAsm10B: JMP matchlen_match4_match_nolit_encodeBlockAsm10B matchlen_bsf_8_match_nolit_encodeBlockAsm10B: -#ifdef GOAMD64_v3 TZCNTQ R9, R9 - -#else - BSFQ R9, R9 - -#endif - SARQ $0x03, R9 - LEAL (R10)(R9*1), R10 - JMP match_nolit_end_encodeBlockAsm10B + SARQ $0x03, R9 + LEAL (R10)(R9*1), R10 + JMP match_nolit_end_encodeBlockAsm10B matchlen_match4_match_nolit_encodeBlockAsm10B: CMPL DI, $0x04 @@ -5176,16 +5080,10 @@ matchlen_loopback_16_repeat_extend_encodeBlockAsm8B: JMP matchlen_loopback_16_repeat_extend_encodeBlockAsm8B matchlen_bsf_16repeat_extend_encodeBlockAsm8B: -#ifdef GOAMD64_v3 TZCNTQ R13, R13 - -#else - BSFQ R13, R13 - -#endif - SARQ $0x03, R13 - LEAL 8(R12)(R13*1), R12 - JMP repeat_extend_forward_end_encodeBlockAsm8B + SARQ $0x03, R13 + LEAL 8(R12)(R13*1), R12 + JMP repeat_extend_forward_end_encodeBlockAsm8B matchlen_match8_repeat_extend_encodeBlockAsm8B: CMPL R9, $0x08 @@ -5198,16 +5096,10 @@ matchlen_match8_repeat_extend_encodeBlockAsm8B: JMP matchlen_match4_repeat_extend_encodeBlockAsm8B matchlen_bsf_8_repeat_extend_encodeBlockAsm8B: -#ifdef GOAMD64_v3 TZCNTQ R11, R11 - -#else - BSFQ R11, R11 - -#endif - SARQ $0x03, R11 - LEAL (R12)(R11*1), R12 - JMP repeat_extend_forward_end_encodeBlockAsm8B + SARQ $0x03, R11 + LEAL (R12)(R11*1), R12 + JMP repeat_extend_forward_end_encodeBlockAsm8B matchlen_match4_repeat_extend_encodeBlockAsm8B: CMPL R9, $0x04 @@ -5614,16 +5506,10 @@ matchlen_loopback_16_match_nolit_encodeBlockAsm8B: JMP matchlen_loopback_16_match_nolit_encodeBlockAsm8B matchlen_bsf_16match_nolit_encodeBlockAsm8B: -#ifdef GOAMD64_v3 TZCNTQ R11, R11 - -#else - BSFQ R11, R11 - -#endif - SARQ $0x03, R11 - LEAL 8(R10)(R11*1), R10 - JMP match_nolit_end_encodeBlockAsm8B + SARQ $0x03, R11 + LEAL 8(R10)(R11*1), R10 + JMP match_nolit_end_encodeBlockAsm8B matchlen_match8_match_nolit_encodeBlockAsm8B: CMPL DI, $0x08 @@ -5636,16 +5522,10 @@ matchlen_match8_match_nolit_encodeBlockAsm8B: JMP matchlen_match4_match_nolit_encodeBlockAsm8B matchlen_bsf_8_match_nolit_encodeBlockAsm8B: -#ifdef GOAMD64_v3 TZCNTQ R9, R9 - -#else - BSFQ R9, R9 - -#endif - SARQ $0x03, R9 - LEAL (R10)(R9*1), R10 - JMP match_nolit_end_encodeBlockAsm8B + SARQ $0x03, R9 + LEAL (R10)(R9*1), R10 + JMP match_nolit_end_encodeBlockAsm8B matchlen_match4_match_nolit_encodeBlockAsm8B: CMPL DI, $0x04 @@ -6140,16 +6020,10 @@ matchlen_loopback_16_match_nolit_encodeBetterBlockAsm: JMP matchlen_loopback_16_match_nolit_encodeBetterBlockAsm matchlen_bsf_16match_nolit_encodeBetterBlockAsm: -#ifdef GOAMD64_v3 TZCNTQ R13, R13 - -#else - BSFQ R13, R13 - -#endif - SARQ $0x03, R13 - LEAL 8(R12)(R13*1), R12 - JMP match_nolit_end_encodeBetterBlockAsm + SARQ $0x03, R13 + LEAL 8(R12)(R13*1), R12 + JMP match_nolit_end_encodeBetterBlockAsm matchlen_match8_match_nolit_encodeBetterBlockAsm: CMPL R8, $0x08 @@ -6162,16 +6036,10 @@ matchlen_match8_match_nolit_encodeBetterBlockAsm: JMP matchlen_match4_match_nolit_encodeBetterBlockAsm matchlen_bsf_8_match_nolit_encodeBetterBlockAsm: -#ifdef GOAMD64_v3 TZCNTQ R11, R11 - -#else - BSFQ R11, R11 - -#endif - SARQ $0x03, R11 - LEAL (R12)(R11*1), R12 - JMP match_nolit_end_encodeBetterBlockAsm + SARQ $0x03, R11 + LEAL (R12)(R11*1), R12 + JMP match_nolit_end_encodeBetterBlockAsm matchlen_match4_match_nolit_encodeBetterBlockAsm: CMPL R8, $0x04 @@ -7235,16 +7103,10 @@ matchlen_loopback_16_match_nolit_encodeBetterBlockAsm4MB: JMP matchlen_loopback_16_match_nolit_encodeBetterBlockAsm4MB matchlen_bsf_16match_nolit_encodeBetterBlockAsm4MB: -#ifdef GOAMD64_v3 TZCNTQ R13, R13 - -#else - BSFQ R13, R13 - -#endif - SARQ $0x03, R13 - LEAL 8(R12)(R13*1), R12 - JMP match_nolit_end_encodeBetterBlockAsm4MB + SARQ $0x03, R13 + LEAL 8(R12)(R13*1), R12 + JMP match_nolit_end_encodeBetterBlockAsm4MB matchlen_match8_match_nolit_encodeBetterBlockAsm4MB: CMPL R8, $0x08 @@ -7257,16 +7119,10 @@ matchlen_match8_match_nolit_encodeBetterBlockAsm4MB: JMP matchlen_match4_match_nolit_encodeBetterBlockAsm4MB matchlen_bsf_8_match_nolit_encodeBetterBlockAsm4MB: -#ifdef GOAMD64_v3 TZCNTQ R11, R11 - -#else - BSFQ R11, R11 - -#endif - SARQ $0x03, R11 - LEAL (R12)(R11*1), R12 - JMP match_nolit_end_encodeBetterBlockAsm4MB + SARQ $0x03, R11 + LEAL (R12)(R11*1), R12 + JMP match_nolit_end_encodeBetterBlockAsm4MB matchlen_match4_match_nolit_encodeBetterBlockAsm4MB: CMPL R8, $0x04 @@ -8256,16 +8112,10 @@ matchlen_loopback_16_match_nolit_encodeBetterBlockAsm12B: JMP matchlen_loopback_16_match_nolit_encodeBetterBlockAsm12B matchlen_bsf_16match_nolit_encodeBetterBlockAsm12B: -#ifdef GOAMD64_v3 TZCNTQ R13, R13 - -#else - BSFQ R13, R13 - -#endif - SARQ $0x03, R13 - LEAL 8(R12)(R13*1), R12 - JMP match_nolit_end_encodeBetterBlockAsm12B + SARQ $0x03, R13 + LEAL 8(R12)(R13*1), R12 + JMP match_nolit_end_encodeBetterBlockAsm12B matchlen_match8_match_nolit_encodeBetterBlockAsm12B: CMPL R8, $0x08 @@ -8278,16 +8128,10 @@ matchlen_match8_match_nolit_encodeBetterBlockAsm12B: JMP matchlen_match4_match_nolit_encodeBetterBlockAsm12B matchlen_bsf_8_match_nolit_encodeBetterBlockAsm12B: -#ifdef GOAMD64_v3 TZCNTQ R11, R11 - -#else - BSFQ R11, R11 - -#endif - SARQ $0x03, R11 - LEAL (R12)(R11*1), R12 - JMP match_nolit_end_encodeBetterBlockAsm12B + SARQ $0x03, R11 + LEAL (R12)(R11*1), R12 + JMP match_nolit_end_encodeBetterBlockAsm12B matchlen_match4_match_nolit_encodeBetterBlockAsm12B: CMPL R8, $0x04 @@ -9130,16 +8974,10 @@ matchlen_loopback_16_match_nolit_encodeBetterBlockAsm10B: JMP matchlen_loopback_16_match_nolit_encodeBetterBlockAsm10B matchlen_bsf_16match_nolit_encodeBetterBlockAsm10B: -#ifdef GOAMD64_v3 TZCNTQ R13, R13 - -#else - BSFQ R13, R13 - -#endif - SARQ $0x03, R13 - LEAL 8(R12)(R13*1), R12 - JMP match_nolit_end_encodeBetterBlockAsm10B + SARQ $0x03, R13 + LEAL 8(R12)(R13*1), R12 + JMP match_nolit_end_encodeBetterBlockAsm10B matchlen_match8_match_nolit_encodeBetterBlockAsm10B: CMPL R8, $0x08 @@ -9152,16 +8990,10 @@ matchlen_match8_match_nolit_encodeBetterBlockAsm10B: JMP matchlen_match4_match_nolit_encodeBetterBlockAsm10B matchlen_bsf_8_match_nolit_encodeBetterBlockAsm10B: -#ifdef GOAMD64_v3 TZCNTQ R11, R11 - -#else - BSFQ R11, R11 - -#endif - SARQ $0x03, R11 - LEAL (R12)(R11*1), R12 - JMP match_nolit_end_encodeBetterBlockAsm10B + SARQ $0x03, R11 + LEAL (R12)(R11*1), R12 + JMP match_nolit_end_encodeBetterBlockAsm10B matchlen_match4_match_nolit_encodeBetterBlockAsm10B: CMPL R8, $0x04 @@ -10004,16 +9836,10 @@ matchlen_loopback_16_match_nolit_encodeBetterBlockAsm8B: JMP matchlen_loopback_16_match_nolit_encodeBetterBlockAsm8B matchlen_bsf_16match_nolit_encodeBetterBlockAsm8B: -#ifdef GOAMD64_v3 TZCNTQ R13, R13 - -#else - BSFQ R13, R13 - -#endif - SARQ $0x03, R13 - LEAL 8(R12)(R13*1), R12 - JMP match_nolit_end_encodeBetterBlockAsm8B + SARQ $0x03, R13 + LEAL 8(R12)(R13*1), R12 + JMP match_nolit_end_encodeBetterBlockAsm8B matchlen_match8_match_nolit_encodeBetterBlockAsm8B: CMPL R8, $0x08 @@ -10026,16 +9852,10 @@ matchlen_match8_match_nolit_encodeBetterBlockAsm8B: JMP matchlen_match4_match_nolit_encodeBetterBlockAsm8B matchlen_bsf_8_match_nolit_encodeBetterBlockAsm8B: -#ifdef GOAMD64_v3 TZCNTQ R11, R11 - -#else - BSFQ R11, R11 - -#endif - SARQ $0x03, R11 - LEAL (R12)(R11*1), R12 - JMP match_nolit_end_encodeBetterBlockAsm8B + SARQ $0x03, R11 + LEAL (R12)(R11*1), R12 + JMP match_nolit_end_encodeBetterBlockAsm8B matchlen_match4_match_nolit_encodeBetterBlockAsm8B: CMPL R8, $0x04 @@ -10985,16 +10805,10 @@ matchlen_loopback_16_repeat_extend_encodeSnappyBlockAsm: JMP matchlen_loopback_16_repeat_extend_encodeSnappyBlockAsm matchlen_bsf_16repeat_extend_encodeSnappyBlockAsm: -#ifdef GOAMD64_v3 TZCNTQ R12, R12 - -#else - BSFQ R12, R12 - -#endif - SARQ $0x03, R12 - LEAL 8(R11)(R12*1), R11 - JMP repeat_extend_forward_end_encodeSnappyBlockAsm + SARQ $0x03, R12 + LEAL 8(R11)(R12*1), R11 + JMP repeat_extend_forward_end_encodeSnappyBlockAsm matchlen_match8_repeat_extend_encodeSnappyBlockAsm: CMPL R8, $0x08 @@ -11007,16 +10821,10 @@ matchlen_match8_repeat_extend_encodeSnappyBlockAsm: JMP matchlen_match4_repeat_extend_encodeSnappyBlockAsm matchlen_bsf_8_repeat_extend_encodeSnappyBlockAsm: -#ifdef GOAMD64_v3 TZCNTQ R10, R10 - -#else - BSFQ R10, R10 - -#endif - SARQ $0x03, R10 - LEAL (R11)(R10*1), R11 - JMP repeat_extend_forward_end_encodeSnappyBlockAsm + SARQ $0x03, R10 + LEAL (R11)(R10*1), R11 + JMP repeat_extend_forward_end_encodeSnappyBlockAsm matchlen_match4_repeat_extend_encodeSnappyBlockAsm: CMPL R8, $0x04 @@ -11329,16 +11137,10 @@ matchlen_loopback_16_match_nolit_encodeSnappyBlockAsm: JMP matchlen_loopback_16_match_nolit_encodeSnappyBlockAsm matchlen_bsf_16match_nolit_encodeSnappyBlockAsm: -#ifdef GOAMD64_v3 TZCNTQ R11, R11 - -#else - BSFQ R11, R11 - -#endif - SARQ $0x03, R11 - LEAL 8(R10)(R11*1), R10 - JMP match_nolit_end_encodeSnappyBlockAsm + SARQ $0x03, R11 + LEAL 8(R10)(R11*1), R10 + JMP match_nolit_end_encodeSnappyBlockAsm matchlen_match8_match_nolit_encodeSnappyBlockAsm: CMPL DI, $0x08 @@ -11351,16 +11153,10 @@ matchlen_match8_match_nolit_encodeSnappyBlockAsm: JMP matchlen_match4_match_nolit_encodeSnappyBlockAsm matchlen_bsf_8_match_nolit_encodeSnappyBlockAsm: -#ifdef GOAMD64_v3 TZCNTQ R9, R9 - -#else - BSFQ R9, R9 - -#endif - SARQ $0x03, R9 - LEAL (R10)(R9*1), R10 - JMP match_nolit_end_encodeSnappyBlockAsm + SARQ $0x03, R9 + LEAL (R10)(R9*1), R10 + JMP match_nolit_end_encodeSnappyBlockAsm matchlen_match4_match_nolit_encodeSnappyBlockAsm: CMPL DI, $0x04 @@ -11901,16 +11697,10 @@ matchlen_loopback_16_repeat_extend_encodeSnappyBlockAsm64K: JMP matchlen_loopback_16_repeat_extend_encodeSnappyBlockAsm64K matchlen_bsf_16repeat_extend_encodeSnappyBlockAsm64K: -#ifdef GOAMD64_v3 TZCNTQ R12, R12 - -#else - BSFQ R12, R12 - -#endif - SARQ $0x03, R12 - LEAL 8(R11)(R12*1), R11 - JMP repeat_extend_forward_end_encodeSnappyBlockAsm64K + SARQ $0x03, R12 + LEAL 8(R11)(R12*1), R11 + JMP repeat_extend_forward_end_encodeSnappyBlockAsm64K matchlen_match8_repeat_extend_encodeSnappyBlockAsm64K: CMPL R8, $0x08 @@ -11923,16 +11713,10 @@ matchlen_match8_repeat_extend_encodeSnappyBlockAsm64K: JMP matchlen_match4_repeat_extend_encodeSnappyBlockAsm64K matchlen_bsf_8_repeat_extend_encodeSnappyBlockAsm64K: -#ifdef GOAMD64_v3 TZCNTQ R10, R10 - -#else - BSFQ R10, R10 - -#endif - SARQ $0x03, R10 - LEAL (R11)(R10*1), R11 - JMP repeat_extend_forward_end_encodeSnappyBlockAsm64K + SARQ $0x03, R10 + LEAL (R11)(R10*1), R11 + JMP repeat_extend_forward_end_encodeSnappyBlockAsm64K matchlen_match4_repeat_extend_encodeSnappyBlockAsm64K: CMPL R8, $0x04 @@ -12205,16 +11989,10 @@ matchlen_loopback_16_match_nolit_encodeSnappyBlockAsm64K: JMP matchlen_loopback_16_match_nolit_encodeSnappyBlockAsm64K matchlen_bsf_16match_nolit_encodeSnappyBlockAsm64K: -#ifdef GOAMD64_v3 TZCNTQ R11, R11 - -#else - BSFQ R11, R11 - -#endif - SARQ $0x03, R11 - LEAL 8(R10)(R11*1), R10 - JMP match_nolit_end_encodeSnappyBlockAsm64K + SARQ $0x03, R11 + LEAL 8(R10)(R11*1), R10 + JMP match_nolit_end_encodeSnappyBlockAsm64K matchlen_match8_match_nolit_encodeSnappyBlockAsm64K: CMPL DI, $0x08 @@ -12227,16 +12005,10 @@ matchlen_match8_match_nolit_encodeSnappyBlockAsm64K: JMP matchlen_match4_match_nolit_encodeSnappyBlockAsm64K matchlen_bsf_8_match_nolit_encodeSnappyBlockAsm64K: -#ifdef GOAMD64_v3 TZCNTQ R9, R9 - -#else - BSFQ R9, R9 - -#endif - SARQ $0x03, R9 - LEAL (R10)(R9*1), R10 - JMP match_nolit_end_encodeSnappyBlockAsm64K + SARQ $0x03, R9 + LEAL (R10)(R9*1), R10 + JMP match_nolit_end_encodeSnappyBlockAsm64K matchlen_match4_match_nolit_encodeSnappyBlockAsm64K: CMPL DI, $0x04 @@ -12737,16 +12509,10 @@ matchlen_loopback_16_repeat_extend_encodeSnappyBlockAsm12B: JMP matchlen_loopback_16_repeat_extend_encodeSnappyBlockAsm12B matchlen_bsf_16repeat_extend_encodeSnappyBlockAsm12B: -#ifdef GOAMD64_v3 TZCNTQ R12, R12 - -#else - BSFQ R12, R12 - -#endif - SARQ $0x03, R12 - LEAL 8(R11)(R12*1), R11 - JMP repeat_extend_forward_end_encodeSnappyBlockAsm12B + SARQ $0x03, R12 + LEAL 8(R11)(R12*1), R11 + JMP repeat_extend_forward_end_encodeSnappyBlockAsm12B matchlen_match8_repeat_extend_encodeSnappyBlockAsm12B: CMPL R8, $0x08 @@ -12759,16 +12525,10 @@ matchlen_match8_repeat_extend_encodeSnappyBlockAsm12B: JMP matchlen_match4_repeat_extend_encodeSnappyBlockAsm12B matchlen_bsf_8_repeat_extend_encodeSnappyBlockAsm12B: -#ifdef GOAMD64_v3 TZCNTQ R10, R10 - -#else - BSFQ R10, R10 - -#endif - SARQ $0x03, R10 - LEAL (R11)(R10*1), R11 - JMP repeat_extend_forward_end_encodeSnappyBlockAsm12B + SARQ $0x03, R10 + LEAL (R11)(R10*1), R11 + JMP repeat_extend_forward_end_encodeSnappyBlockAsm12B matchlen_match4_repeat_extend_encodeSnappyBlockAsm12B: CMPL R8, $0x04 @@ -13041,16 +12801,10 @@ matchlen_loopback_16_match_nolit_encodeSnappyBlockAsm12B: JMP matchlen_loopback_16_match_nolit_encodeSnappyBlockAsm12B matchlen_bsf_16match_nolit_encodeSnappyBlockAsm12B: -#ifdef GOAMD64_v3 TZCNTQ R11, R11 - -#else - BSFQ R11, R11 - -#endif - SARQ $0x03, R11 - LEAL 8(R10)(R11*1), R10 - JMP match_nolit_end_encodeSnappyBlockAsm12B + SARQ $0x03, R11 + LEAL 8(R10)(R11*1), R10 + JMP match_nolit_end_encodeSnappyBlockAsm12B matchlen_match8_match_nolit_encodeSnappyBlockAsm12B: CMPL DI, $0x08 @@ -13063,16 +12817,10 @@ matchlen_match8_match_nolit_encodeSnappyBlockAsm12B: JMP matchlen_match4_match_nolit_encodeSnappyBlockAsm12B matchlen_bsf_8_match_nolit_encodeSnappyBlockAsm12B: -#ifdef GOAMD64_v3 TZCNTQ R9, R9 - -#else - BSFQ R9, R9 - -#endif - SARQ $0x03, R9 - LEAL (R10)(R9*1), R10 - JMP match_nolit_end_encodeSnappyBlockAsm12B + SARQ $0x03, R9 + LEAL (R10)(R9*1), R10 + JMP match_nolit_end_encodeSnappyBlockAsm12B matchlen_match4_match_nolit_encodeSnappyBlockAsm12B: CMPL DI, $0x04 @@ -13573,16 +13321,10 @@ matchlen_loopback_16_repeat_extend_encodeSnappyBlockAsm10B: JMP matchlen_loopback_16_repeat_extend_encodeSnappyBlockAsm10B matchlen_bsf_16repeat_extend_encodeSnappyBlockAsm10B: -#ifdef GOAMD64_v3 TZCNTQ R12, R12 - -#else - BSFQ R12, R12 - -#endif - SARQ $0x03, R12 - LEAL 8(R11)(R12*1), R11 - JMP repeat_extend_forward_end_encodeSnappyBlockAsm10B + SARQ $0x03, R12 + LEAL 8(R11)(R12*1), R11 + JMP repeat_extend_forward_end_encodeSnappyBlockAsm10B matchlen_match8_repeat_extend_encodeSnappyBlockAsm10B: CMPL R8, $0x08 @@ -13595,16 +13337,10 @@ matchlen_match8_repeat_extend_encodeSnappyBlockAsm10B: JMP matchlen_match4_repeat_extend_encodeSnappyBlockAsm10B matchlen_bsf_8_repeat_extend_encodeSnappyBlockAsm10B: -#ifdef GOAMD64_v3 TZCNTQ R10, R10 - -#else - BSFQ R10, R10 - -#endif - SARQ $0x03, R10 - LEAL (R11)(R10*1), R11 - JMP repeat_extend_forward_end_encodeSnappyBlockAsm10B + SARQ $0x03, R10 + LEAL (R11)(R10*1), R11 + JMP repeat_extend_forward_end_encodeSnappyBlockAsm10B matchlen_match4_repeat_extend_encodeSnappyBlockAsm10B: CMPL R8, $0x04 @@ -13877,16 +13613,10 @@ matchlen_loopback_16_match_nolit_encodeSnappyBlockAsm10B: JMP matchlen_loopback_16_match_nolit_encodeSnappyBlockAsm10B matchlen_bsf_16match_nolit_encodeSnappyBlockAsm10B: -#ifdef GOAMD64_v3 TZCNTQ R11, R11 - -#else - BSFQ R11, R11 - -#endif - SARQ $0x03, R11 - LEAL 8(R10)(R11*1), R10 - JMP match_nolit_end_encodeSnappyBlockAsm10B + SARQ $0x03, R11 + LEAL 8(R10)(R11*1), R10 + JMP match_nolit_end_encodeSnappyBlockAsm10B matchlen_match8_match_nolit_encodeSnappyBlockAsm10B: CMPL DI, $0x08 @@ -13899,16 +13629,10 @@ matchlen_match8_match_nolit_encodeSnappyBlockAsm10B: JMP matchlen_match4_match_nolit_encodeSnappyBlockAsm10B matchlen_bsf_8_match_nolit_encodeSnappyBlockAsm10B: -#ifdef GOAMD64_v3 TZCNTQ R9, R9 - -#else - BSFQ R9, R9 - -#endif - SARQ $0x03, R9 - LEAL (R10)(R9*1), R10 - JMP match_nolit_end_encodeSnappyBlockAsm10B + SARQ $0x03, R9 + LEAL (R10)(R9*1), R10 + JMP match_nolit_end_encodeSnappyBlockAsm10B matchlen_match4_match_nolit_encodeSnappyBlockAsm10B: CMPL DI, $0x04 @@ -14409,16 +14133,10 @@ matchlen_loopback_16_repeat_extend_encodeSnappyBlockAsm8B: JMP matchlen_loopback_16_repeat_extend_encodeSnappyBlockAsm8B matchlen_bsf_16repeat_extend_encodeSnappyBlockAsm8B: -#ifdef GOAMD64_v3 TZCNTQ R12, R12 - -#else - BSFQ R12, R12 - -#endif - SARQ $0x03, R12 - LEAL 8(R11)(R12*1), R11 - JMP repeat_extend_forward_end_encodeSnappyBlockAsm8B + SARQ $0x03, R12 + LEAL 8(R11)(R12*1), R11 + JMP repeat_extend_forward_end_encodeSnappyBlockAsm8B matchlen_match8_repeat_extend_encodeSnappyBlockAsm8B: CMPL R8, $0x08 @@ -14431,16 +14149,10 @@ matchlen_match8_repeat_extend_encodeSnappyBlockAsm8B: JMP matchlen_match4_repeat_extend_encodeSnappyBlockAsm8B matchlen_bsf_8_repeat_extend_encodeSnappyBlockAsm8B: -#ifdef GOAMD64_v3 TZCNTQ R10, R10 - -#else - BSFQ R10, R10 - -#endif - SARQ $0x03, R10 - LEAL (R11)(R10*1), R11 - JMP repeat_extend_forward_end_encodeSnappyBlockAsm8B + SARQ $0x03, R10 + LEAL (R11)(R10*1), R11 + JMP repeat_extend_forward_end_encodeSnappyBlockAsm8B matchlen_match4_repeat_extend_encodeSnappyBlockAsm8B: CMPL R8, $0x04 @@ -14711,16 +14423,10 @@ matchlen_loopback_16_match_nolit_encodeSnappyBlockAsm8B: JMP matchlen_loopback_16_match_nolit_encodeSnappyBlockAsm8B matchlen_bsf_16match_nolit_encodeSnappyBlockAsm8B: -#ifdef GOAMD64_v3 TZCNTQ R11, R11 - -#else - BSFQ R11, R11 - -#endif - SARQ $0x03, R11 - LEAL 8(R10)(R11*1), R10 - JMP match_nolit_end_encodeSnappyBlockAsm8B + SARQ $0x03, R11 + LEAL 8(R10)(R11*1), R10 + JMP match_nolit_end_encodeSnappyBlockAsm8B matchlen_match8_match_nolit_encodeSnappyBlockAsm8B: CMPL DI, $0x08 @@ -14733,16 +14439,10 @@ matchlen_match8_match_nolit_encodeSnappyBlockAsm8B: JMP matchlen_match4_match_nolit_encodeSnappyBlockAsm8B matchlen_bsf_8_match_nolit_encodeSnappyBlockAsm8B: -#ifdef GOAMD64_v3 TZCNTQ R9, R9 - -#else - BSFQ R9, R9 - -#endif - SARQ $0x03, R9 - LEAL (R10)(R9*1), R10 - JMP match_nolit_end_encodeSnappyBlockAsm8B + SARQ $0x03, R9 + LEAL (R10)(R9*1), R10 + JMP match_nolit_end_encodeSnappyBlockAsm8B matchlen_match4_match_nolit_encodeSnappyBlockAsm8B: CMPL DI, $0x04 @@ -15144,16 +14844,10 @@ matchlen_loopback_16_match_nolit_encodeSnappyBetterBlockAsm: JMP matchlen_loopback_16_match_nolit_encodeSnappyBetterBlockAsm matchlen_bsf_16match_nolit_encodeSnappyBetterBlockAsm: -#ifdef GOAMD64_v3 TZCNTQ R13, R13 - -#else - BSFQ R13, R13 - -#endif - SARQ $0x03, R13 - LEAL 8(R12)(R13*1), R12 - JMP match_nolit_end_encodeSnappyBetterBlockAsm + SARQ $0x03, R13 + LEAL 8(R12)(R13*1), R12 + JMP match_nolit_end_encodeSnappyBetterBlockAsm matchlen_match8_match_nolit_encodeSnappyBetterBlockAsm: CMPL R8, $0x08 @@ -15166,16 +14860,10 @@ matchlen_match8_match_nolit_encodeSnappyBetterBlockAsm: JMP matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm matchlen_bsf_8_match_nolit_encodeSnappyBetterBlockAsm: -#ifdef GOAMD64_v3 TZCNTQ R11, R11 - -#else - BSFQ R11, R11 - -#endif - SARQ $0x03, R11 - LEAL (R12)(R11*1), R12 - JMP match_nolit_end_encodeSnappyBetterBlockAsm + SARQ $0x03, R11 + LEAL (R12)(R11*1), R12 + JMP match_nolit_end_encodeSnappyBetterBlockAsm matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm: CMPL R8, $0x04 @@ -15790,16 +15478,10 @@ matchlen_loopback_16_match_nolit_encodeSnappyBetterBlockAsm64K: JMP matchlen_loopback_16_match_nolit_encodeSnappyBetterBlockAsm64K matchlen_bsf_16match_nolit_encodeSnappyBetterBlockAsm64K: -#ifdef GOAMD64_v3 TZCNTQ R13, R13 - -#else - BSFQ R13, R13 - -#endif - SARQ $0x03, R13 - LEAL 8(R12)(R13*1), R12 - JMP match_nolit_end_encodeSnappyBetterBlockAsm64K + SARQ $0x03, R13 + LEAL 8(R12)(R13*1), R12 + JMP match_nolit_end_encodeSnappyBetterBlockAsm64K matchlen_match8_match_nolit_encodeSnappyBetterBlockAsm64K: CMPL R8, $0x08 @@ -15812,16 +15494,10 @@ matchlen_match8_match_nolit_encodeSnappyBetterBlockAsm64K: JMP matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm64K matchlen_bsf_8_match_nolit_encodeSnappyBetterBlockAsm64K: -#ifdef GOAMD64_v3 TZCNTQ R11, R11 - -#else - BSFQ R11, R11 - -#endif - SARQ $0x03, R11 - LEAL (R12)(R11*1), R12 - JMP match_nolit_end_encodeSnappyBetterBlockAsm64K + SARQ $0x03, R11 + LEAL (R12)(R11*1), R12 + JMP match_nolit_end_encodeSnappyBetterBlockAsm64K matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm64K: CMPL R8, $0x04 @@ -16371,16 +16047,10 @@ matchlen_loopback_16_match_nolit_encodeSnappyBetterBlockAsm12B: JMP matchlen_loopback_16_match_nolit_encodeSnappyBetterBlockAsm12B matchlen_bsf_16match_nolit_encodeSnappyBetterBlockAsm12B: -#ifdef GOAMD64_v3 TZCNTQ R13, R13 - -#else - BSFQ R13, R13 - -#endif - SARQ $0x03, R13 - LEAL 8(R12)(R13*1), R12 - JMP match_nolit_end_encodeSnappyBetterBlockAsm12B + SARQ $0x03, R13 + LEAL 8(R12)(R13*1), R12 + JMP match_nolit_end_encodeSnappyBetterBlockAsm12B matchlen_match8_match_nolit_encodeSnappyBetterBlockAsm12B: CMPL R8, $0x08 @@ -16393,16 +16063,10 @@ matchlen_match8_match_nolit_encodeSnappyBetterBlockAsm12B: JMP matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm12B matchlen_bsf_8_match_nolit_encodeSnappyBetterBlockAsm12B: -#ifdef GOAMD64_v3 TZCNTQ R11, R11 - -#else - BSFQ R11, R11 - -#endif - SARQ $0x03, R11 - LEAL (R12)(R11*1), R12 - JMP match_nolit_end_encodeSnappyBetterBlockAsm12B + SARQ $0x03, R11 + LEAL (R12)(R11*1), R12 + JMP match_nolit_end_encodeSnappyBetterBlockAsm12B matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm12B: CMPL R8, $0x04 @@ -16952,16 +16616,10 @@ matchlen_loopback_16_match_nolit_encodeSnappyBetterBlockAsm10B: JMP matchlen_loopback_16_match_nolit_encodeSnappyBetterBlockAsm10B matchlen_bsf_16match_nolit_encodeSnappyBetterBlockAsm10B: -#ifdef GOAMD64_v3 TZCNTQ R13, R13 - -#else - BSFQ R13, R13 - -#endif - SARQ $0x03, R13 - LEAL 8(R12)(R13*1), R12 - JMP match_nolit_end_encodeSnappyBetterBlockAsm10B + SARQ $0x03, R13 + LEAL 8(R12)(R13*1), R12 + JMP match_nolit_end_encodeSnappyBetterBlockAsm10B matchlen_match8_match_nolit_encodeSnappyBetterBlockAsm10B: CMPL R8, $0x08 @@ -16974,16 +16632,10 @@ matchlen_match8_match_nolit_encodeSnappyBetterBlockAsm10B: JMP matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm10B matchlen_bsf_8_match_nolit_encodeSnappyBetterBlockAsm10B: -#ifdef GOAMD64_v3 TZCNTQ R11, R11 - -#else - BSFQ R11, R11 - -#endif - SARQ $0x03, R11 - LEAL (R12)(R11*1), R12 - JMP match_nolit_end_encodeSnappyBetterBlockAsm10B + SARQ $0x03, R11 + LEAL (R12)(R11*1), R12 + JMP match_nolit_end_encodeSnappyBetterBlockAsm10B matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm10B: CMPL R8, $0x04 @@ -17533,16 +17185,10 @@ matchlen_loopback_16_match_nolit_encodeSnappyBetterBlockAsm8B: JMP matchlen_loopback_16_match_nolit_encodeSnappyBetterBlockAsm8B matchlen_bsf_16match_nolit_encodeSnappyBetterBlockAsm8B: -#ifdef GOAMD64_v3 TZCNTQ R13, R13 - -#else - BSFQ R13, R13 - -#endif - SARQ $0x03, R13 - LEAL 8(R12)(R13*1), R12 - JMP match_nolit_end_encodeSnappyBetterBlockAsm8B + SARQ $0x03, R13 + LEAL 8(R12)(R13*1), R12 + JMP match_nolit_end_encodeSnappyBetterBlockAsm8B matchlen_match8_match_nolit_encodeSnappyBetterBlockAsm8B: CMPL R8, $0x08 @@ -17555,16 +17201,10 @@ matchlen_match8_match_nolit_encodeSnappyBetterBlockAsm8B: JMP matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm8B matchlen_bsf_8_match_nolit_encodeSnappyBetterBlockAsm8B: -#ifdef GOAMD64_v3 TZCNTQ R11, R11 - -#else - BSFQ R11, R11 - -#endif - SARQ $0x03, R11 - LEAL (R12)(R11*1), R12 - JMP match_nolit_end_encodeSnappyBetterBlockAsm8B + SARQ $0x03, R11 + LEAL (R12)(R11*1), R12 + JMP match_nolit_end_encodeSnappyBetterBlockAsm8B matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm8B: CMPL R8, $0x04 @@ -18138,16 +17778,10 @@ matchlen_loopback_16_repeat_extend_calcBlockSize: JMP matchlen_loopback_16_repeat_extend_calcBlockSize matchlen_bsf_16repeat_extend_calcBlockSize: -#ifdef GOAMD64_v3 TZCNTQ R12, R12 - -#else - BSFQ R12, R12 - -#endif - SARQ $0x03, R12 - LEAL 8(R11)(R12*1), R11 - JMP repeat_extend_forward_end_calcBlockSize + SARQ $0x03, R12 + LEAL 8(R11)(R12*1), R11 + JMP repeat_extend_forward_end_calcBlockSize matchlen_match8_repeat_extend_calcBlockSize: CMPL R8, $0x08 @@ -18160,16 +17794,10 @@ matchlen_match8_repeat_extend_calcBlockSize: JMP matchlen_match4_repeat_extend_calcBlockSize matchlen_bsf_8_repeat_extend_calcBlockSize: -#ifdef GOAMD64_v3 TZCNTQ R10, R10 - -#else - BSFQ R10, R10 - -#endif - SARQ $0x03, R10 - LEAL (R11)(R10*1), R11 - JMP repeat_extend_forward_end_calcBlockSize + SARQ $0x03, R10 + LEAL (R11)(R10*1), R11 + JMP repeat_extend_forward_end_calcBlockSize matchlen_match4_repeat_extend_calcBlockSize: CMPL R8, $0x04 @@ -18371,16 +17999,10 @@ matchlen_loopback_16_match_nolit_calcBlockSize: JMP matchlen_loopback_16_match_nolit_calcBlockSize matchlen_bsf_16match_nolit_calcBlockSize: -#ifdef GOAMD64_v3 TZCNTQ R11, R11 - -#else - BSFQ R11, R11 - -#endif - SARQ $0x03, R11 - LEAL 8(R10)(R11*1), R10 - JMP match_nolit_end_calcBlockSize + SARQ $0x03, R11 + LEAL 8(R10)(R11*1), R10 + JMP match_nolit_end_calcBlockSize matchlen_match8_match_nolit_calcBlockSize: CMPL DI, $0x08 @@ -18393,16 +18015,10 @@ matchlen_match8_match_nolit_calcBlockSize: JMP matchlen_match4_match_nolit_calcBlockSize matchlen_bsf_8_match_nolit_calcBlockSize: -#ifdef GOAMD64_v3 TZCNTQ R9, R9 - -#else - BSFQ R9, R9 - -#endif - SARQ $0x03, R9 - LEAL (R10)(R9*1), R10 - JMP match_nolit_end_calcBlockSize + SARQ $0x03, R9 + LEAL (R10)(R9*1), R10 + JMP match_nolit_end_calcBlockSize matchlen_match4_match_nolit_calcBlockSize: CMPL DI, $0x04 @@ -18723,16 +18339,10 @@ matchlen_loopback_16_repeat_extend_calcBlockSizeSmall: JMP matchlen_loopback_16_repeat_extend_calcBlockSizeSmall matchlen_bsf_16repeat_extend_calcBlockSizeSmall: -#ifdef GOAMD64_v3 TZCNTQ R12, R12 - -#else - BSFQ R12, R12 - -#endif - SARQ $0x03, R12 - LEAL 8(R11)(R12*1), R11 - JMP repeat_extend_forward_end_calcBlockSizeSmall + SARQ $0x03, R12 + LEAL 8(R11)(R12*1), R11 + JMP repeat_extend_forward_end_calcBlockSizeSmall matchlen_match8_repeat_extend_calcBlockSizeSmall: CMPL R8, $0x08 @@ -18745,16 +18355,10 @@ matchlen_match8_repeat_extend_calcBlockSizeSmall: JMP matchlen_match4_repeat_extend_calcBlockSizeSmall matchlen_bsf_8_repeat_extend_calcBlockSizeSmall: -#ifdef GOAMD64_v3 TZCNTQ R10, R10 - -#else - BSFQ R10, R10 - -#endif - SARQ $0x03, R10 - LEAL (R11)(R10*1), R11 - JMP repeat_extend_forward_end_calcBlockSizeSmall + SARQ $0x03, R10 + LEAL (R11)(R10*1), R11 + JMP repeat_extend_forward_end_calcBlockSizeSmall matchlen_match4_repeat_extend_calcBlockSizeSmall: CMPL R8, $0x04 @@ -18926,16 +18530,10 @@ matchlen_loopback_16_match_nolit_calcBlockSizeSmall: JMP matchlen_loopback_16_match_nolit_calcBlockSizeSmall matchlen_bsf_16match_nolit_calcBlockSizeSmall: -#ifdef GOAMD64_v3 TZCNTQ R11, R11 - -#else - BSFQ R11, R11 - -#endif - SARQ $0x03, R11 - LEAL 8(R10)(R11*1), R10 - JMP match_nolit_end_calcBlockSizeSmall + SARQ $0x03, R11 + LEAL 8(R10)(R11*1), R10 + JMP match_nolit_end_calcBlockSizeSmall matchlen_match8_match_nolit_calcBlockSizeSmall: CMPL DI, $0x08 @@ -18948,16 +18546,10 @@ matchlen_match8_match_nolit_calcBlockSizeSmall: JMP matchlen_match4_match_nolit_calcBlockSizeSmall matchlen_bsf_8_match_nolit_calcBlockSizeSmall: -#ifdef GOAMD64_v3 TZCNTQ R9, R9 - -#else - BSFQ R9, R9 - -#endif - SARQ $0x03, R9 - LEAL (R10)(R9*1), R10 - JMP match_nolit_end_calcBlockSizeSmall + SARQ $0x03, R9 + LEAL (R10)(R9*1), R10 + JMP match_nolit_end_calcBlockSizeSmall matchlen_match4_match_nolit_calcBlockSizeSmall: CMPL DI, $0x04 @@ -19737,16 +19329,10 @@ matchlen_loopback_16_standalone: JMP matchlen_loopback_16_standalone matchlen_bsf_16standalone: -#ifdef GOAMD64_v3 TZCNTQ DI, DI - -#else - BSFQ DI, DI - -#endif - SARQ $0x03, DI - LEAL 8(SI)(DI*1), SI - JMP gen_match_len_end + SARQ $0x03, DI + LEAL 8(SI)(DI*1), SI + JMP gen_match_len_end matchlen_match8_standalone: CMPL DX, $0x08 @@ -19759,16 +19345,10 @@ matchlen_match8_standalone: JMP matchlen_match4_standalone matchlen_bsf_8_standalone: -#ifdef GOAMD64_v3 TZCNTQ BX, BX - -#else - BSFQ BX, BX - -#endif - SARQ $0x03, BX - LEAL (SI)(BX*1), SI - JMP gen_match_len_end + SARQ $0x03, BX + LEAL (SI)(BX*1), SI + JMP gen_match_len_end matchlen_match4_standalone: CMPL DX, $0x04 @@ -19802,7 +19382,7 @@ gen_match_len_end: // func cvtLZ4BlockAsm(dst []byte, src []byte) (uncompressed int, dstUsed int) // Requires: SSE2 -TEXT ·cvtLZ4BlockAsm(SB), NOSPLIT, $0-64 +TEXT ·cvtLZ4BlockAsm(SB), NOSPLIT, $8-64 XORQ SI, SI MOVQ dst_base+0(FP), AX MOVQ dst_len+8(FP), CX @@ -19810,457 +19390,464 @@ TEXT ·cvtLZ4BlockAsm(SB), NOSPLIT, $0-64 MOVQ src_len+32(FP), BX LEAQ (DX)(BX*1), BX LEAQ -8(AX)(CX*1), CX - XORQ DI, DI + LEAQ -4(CX), DI + XORQ R8, R8 lz4_s2_loop: CMPQ DX, BX JAE lz4_s2_corrupt CMPQ AX, CX JAE lz4_s2_dstfull - MOVBQZX (DX), R8 - MOVQ R8, R9 - MOVQ R8, R10 - SHRQ $0x04, R9 - ANDQ $0x0f, R10 - CMPQ R8, $0xf0 + MOVBQZX (DX), R9 + MOVQ R9, R10 + MOVQ R9, R11 + SHRQ $0x04, R10 + ANDQ $0x0f, R11 + CMPQ R9, $0xf0 JB lz4_s2_ll_end lz4_s2_ll_loop: INCQ DX CMPQ DX, BX JAE lz4_s2_corrupt - MOVBQZX (DX), R8 - ADDQ R8, R9 - CMPQ R8, $0xff + MOVBQZX (DX), R9 + ADDQ R9, R10 + CMPQ R9, $0xff JEQ lz4_s2_ll_loop lz4_s2_ll_end: - LEAQ (DX)(R9*1), R8 - ADDQ $0x04, R10 - CMPQ R8, BX + LEAQ (DX)(R10*1), R9 + ADDQ $0x04, R11 + CMPQ R9, BX JAE lz4_s2_corrupt INCQ DX - INCQ R8 - TESTQ R9, R9 + INCQ R9 + TESTQ R10, R10 JZ lz4_s2_lits_done - LEAQ (AX)(R9*1), R11 - CMPQ R11, CX + LEAQ (AX)(R10*1), R12 + CMPQ R12, DI JAE lz4_s2_dstfull - ADDQ R9, SI - LEAL -1(R9), R11 - CMPL R11, $0x3c + ADDQ R10, SI + LEAL -1(R10), R12 + CMPL R12, $0x3c JB one_byte_lz4_s2 - CMPL R11, $0x00000100 + CMPL R12, $0x00000100 JB two_bytes_lz4_s2 - CMPL R11, $0x00010000 + CMPL R12, $0x00010000 JB three_bytes_lz4_s2 - CMPL R11, $0x01000000 + CMPL R12, $0x01000000 JB four_bytes_lz4_s2 MOVB $0xfc, (AX) - MOVL R11, 1(AX) + MOVL R12, 1(AX) ADDQ $0x05, AX JMP memmove_long_lz4_s2 four_bytes_lz4_s2: - MOVL R11, R12 - SHRL $0x10, R12 + MOVL R12, R13 + SHRL $0x10, R13 MOVB $0xf8, (AX) - MOVW R11, 1(AX) - MOVB R12, 3(AX) + MOVW R12, 1(AX) + MOVB R13, 3(AX) ADDQ $0x04, AX JMP memmove_long_lz4_s2 three_bytes_lz4_s2: MOVB $0xf4, (AX) - MOVW R11, 1(AX) + MOVW R12, 1(AX) ADDQ $0x03, AX JMP memmove_long_lz4_s2 two_bytes_lz4_s2: MOVB $0xf0, (AX) - MOVB R11, 1(AX) + MOVB R12, 1(AX) ADDQ $0x02, AX - CMPL R11, $0x40 + CMPL R12, $0x40 JB memmove_lz4_s2 JMP memmove_long_lz4_s2 one_byte_lz4_s2: - SHLB $0x02, R11 - MOVB R11, (AX) + SHLB $0x02, R12 + MOVB R12, (AX) ADDQ $0x01, AX memmove_lz4_s2: - LEAQ (AX)(R9*1), R11 + LEAQ (AX)(R10*1), R12 // genMemMoveShort - CMPQ R9, $0x08 + CMPQ R10, $0x08 JBE emit_lit_memmove_lz4_s2_memmove_move_8 - CMPQ R9, $0x10 + CMPQ R10, $0x10 JBE emit_lit_memmove_lz4_s2_memmove_move_8through16 - CMPQ R9, $0x20 + CMPQ R10, $0x20 JBE emit_lit_memmove_lz4_s2_memmove_move_17through32 JMP emit_lit_memmove_lz4_s2_memmove_move_33through64 emit_lit_memmove_lz4_s2_memmove_move_8: - MOVQ (DX), R12 - MOVQ R12, (AX) + MOVQ (DX), R13 + MOVQ R13, (AX) JMP memmove_end_copy_lz4_s2 emit_lit_memmove_lz4_s2_memmove_move_8through16: - MOVQ (DX), R12 - MOVQ -8(DX)(R9*1), DX - MOVQ R12, (AX) - MOVQ DX, -8(AX)(R9*1) + MOVQ (DX), R13 + MOVQ -8(DX)(R10*1), DX + MOVQ R13, (AX) + MOVQ DX, -8(AX)(R10*1) JMP memmove_end_copy_lz4_s2 emit_lit_memmove_lz4_s2_memmove_move_17through32: MOVOU (DX), X0 - MOVOU -16(DX)(R9*1), X1 + MOVOU -16(DX)(R10*1), X1 MOVOU X0, (AX) - MOVOU X1, -16(AX)(R9*1) + MOVOU X1, -16(AX)(R10*1) JMP memmove_end_copy_lz4_s2 emit_lit_memmove_lz4_s2_memmove_move_33through64: MOVOU (DX), X0 MOVOU 16(DX), X1 - MOVOU -32(DX)(R9*1), X2 - MOVOU -16(DX)(R9*1), X3 + MOVOU -32(DX)(R10*1), X2 + MOVOU -16(DX)(R10*1), X3 MOVOU X0, (AX) MOVOU X1, 16(AX) - MOVOU X2, -32(AX)(R9*1) - MOVOU X3, -16(AX)(R9*1) + MOVOU X2, -32(AX)(R10*1) + MOVOU X3, -16(AX)(R10*1) memmove_end_copy_lz4_s2: - MOVQ R11, AX + MOVQ R12, AX JMP lz4_s2_lits_emit_done memmove_long_lz4_s2: - LEAQ (AX)(R9*1), R11 + LEAQ (AX)(R10*1), R12 // genMemMoveLong MOVOU (DX), X0 MOVOU 16(DX), X1 - MOVOU -32(DX)(R9*1), X2 - MOVOU -16(DX)(R9*1), X3 - MOVQ R9, R13 - SHRQ $0x05, R13 - MOVQ AX, R12 - ANDL $0x0000001f, R12 - MOVQ $0x00000040, R14 - SUBQ R12, R14 - DECQ R13 + MOVOU -32(DX)(R10*1), X2 + MOVOU -16(DX)(R10*1), X3 + MOVQ R10, R14 + SHRQ $0x05, R14 + MOVQ AX, R13 + ANDL $0x0000001f, R13 + MOVQ $0x00000040, R15 + SUBQ R13, R15 + DECQ R14 JA emit_lit_memmove_long_lz4_s2large_forward_sse_loop_32 - LEAQ -32(DX)(R14*1), R12 - LEAQ -32(AX)(R14*1), R15 + LEAQ -32(DX)(R15*1), R13 + LEAQ -32(AX)(R15*1), BP emit_lit_memmove_long_lz4_s2large_big_loop_back: - MOVOU (R12), X4 - MOVOU 16(R12), X5 - MOVOA X4, (R15) - MOVOA X5, 16(R15) + MOVOU (R13), X4 + MOVOU 16(R13), X5 + MOVOA X4, (BP) + MOVOA X5, 16(BP) + ADDQ $0x20, BP + ADDQ $0x20, R13 ADDQ $0x20, R15 - ADDQ $0x20, R12 - ADDQ $0x20, R14 - DECQ R13 + DECQ R14 JNA emit_lit_memmove_long_lz4_s2large_big_loop_back emit_lit_memmove_long_lz4_s2large_forward_sse_loop_32: - MOVOU -32(DX)(R14*1), X4 - MOVOU -16(DX)(R14*1), X5 - MOVOA X4, -32(AX)(R14*1) - MOVOA X5, -16(AX)(R14*1) - ADDQ $0x20, R14 - CMPQ R9, R14 + MOVOU -32(DX)(R15*1), X4 + MOVOU -16(DX)(R15*1), X5 + MOVOA X4, -32(AX)(R15*1) + MOVOA X5, -16(AX)(R15*1) + ADDQ $0x20, R15 + CMPQ R10, R15 JAE emit_lit_memmove_long_lz4_s2large_forward_sse_loop_32 MOVOU X0, (AX) MOVOU X1, 16(AX) - MOVOU X2, -32(AX)(R9*1) - MOVOU X3, -16(AX)(R9*1) - MOVQ R11, AX + MOVOU X2, -32(AX)(R10*1) + MOVOU X3, -16(AX)(R10*1) + MOVQ R12, AX lz4_s2_lits_emit_done: - MOVQ R8, DX + MOVQ R9, DX lz4_s2_lits_done: CMPQ DX, BX JNE lz4_s2_match - CMPQ R10, $0x04 + CMPQ R11, $0x04 JEQ lz4_s2_done JMP lz4_s2_corrupt lz4_s2_match: - LEAQ 2(DX), R8 - CMPQ R8, BX + LEAQ 2(DX), R9 + CMPQ R9, BX JAE lz4_s2_corrupt - MOVWQZX (DX), R9 - MOVQ R8, DX - TESTQ R9, R9 + MOVWQZX (DX), R10 + MOVQ R9, DX + TESTQ R10, R10 JZ lz4_s2_corrupt - CMPQ R9, SI + CMPQ R10, SI JA lz4_s2_corrupt - CMPQ R10, $0x13 + CMPQ R11, $0x13 JNE lz4_s2_ml_done lz4_s2_ml_loop: - MOVBQZX (DX), R8 + MOVBQZX (DX), R9 INCQ DX - ADDQ R8, R10 + ADDQ R9, R11 CMPQ DX, BX JAE lz4_s2_corrupt - CMPQ R8, $0xff + CMPQ R9, $0xff JEQ lz4_s2_ml_loop lz4_s2_ml_done: - ADDQ R10, SI - CMPQ R9, DI + ADDQ R11, SI + CMPQ R10, R8 JNE lz4_s2_docopy // emitRepeat emit_repeat_again_lz4_s2: - MOVL R10, R8 - LEAL -4(R10), R10 - CMPL R8, $0x08 + MOVL R11, R9 + LEAL -4(R11), R11 + CMPL R9, $0x08 JBE repeat_two_lz4_s2 - CMPL R8, $0x0c + CMPL R9, $0x0c JAE cant_repeat_two_offset_lz4_s2 - CMPL R9, $0x00000800 + CMPL R10, $0x00000800 JB repeat_two_offset_lz4_s2 cant_repeat_two_offset_lz4_s2: - CMPL R10, $0x00000104 + CMPL R11, $0x00000104 JB repeat_three_lz4_s2 - CMPL R10, $0x00010100 + CMPL R11, $0x00010100 JB repeat_four_lz4_s2 - CMPL R10, $0x0100ffff + CMPL R11, $0x0100ffff JB repeat_five_lz4_s2 - LEAL -16842747(R10), R10 + LEAL -16842747(R11), R11 MOVL $0xfffb001d, (AX) MOVB $0xff, 4(AX) ADDQ $0x05, AX + CMPQ AX, CX + JAE lz4_s2_loop JMP emit_repeat_again_lz4_s2 repeat_five_lz4_s2: - LEAL -65536(R10), R10 - MOVL R10, R9 + LEAL -65536(R11), R11 + MOVL R11, R10 MOVW $0x001d, (AX) - MOVW R10, 2(AX) - SARL $0x10, R9 - MOVB R9, 4(AX) + MOVW R11, 2(AX) + SARL $0x10, R10 + MOVB R10, 4(AX) ADDQ $0x05, AX JMP lz4_s2_loop repeat_four_lz4_s2: - LEAL -256(R10), R10 + LEAL -256(R11), R11 MOVW $0x0019, (AX) - MOVW R10, 2(AX) + MOVW R11, 2(AX) ADDQ $0x04, AX JMP lz4_s2_loop repeat_three_lz4_s2: - LEAL -4(R10), R10 + LEAL -4(R11), R11 MOVW $0x0015, (AX) - MOVB R10, 2(AX) + MOVB R11, 2(AX) ADDQ $0x03, AX JMP lz4_s2_loop repeat_two_lz4_s2: - SHLL $0x02, R10 - ORL $0x01, R10 - MOVW R10, (AX) + SHLL $0x02, R11 + ORL $0x01, R11 + MOVW R11, (AX) ADDQ $0x02, AX JMP lz4_s2_loop repeat_two_offset_lz4_s2: - XORQ R8, R8 - LEAL 1(R8)(R10*4), R10 - MOVB R9, 1(AX) - SARL $0x08, R9 - SHLL $0x05, R9 - ORL R9, R10 - MOVB R10, (AX) + XORQ R9, R9 + LEAL 1(R9)(R11*4), R11 + MOVB R10, 1(AX) + SARL $0x08, R10 + SHLL $0x05, R10 + ORL R10, R11 + MOVB R11, (AX) ADDQ $0x02, AX JMP lz4_s2_loop lz4_s2_docopy: - MOVQ R9, DI + MOVQ R10, R8 // emitCopy - CMPL R10, $0x40 + CMPL R11, $0x40 JBE two_byte_offset_short_lz4_s2 - CMPL R9, $0x00000800 + CMPL R10, $0x00000800 JAE long_offset_short_lz4_s2 - MOVL $0x00000001, R8 - LEAL 16(R8), R8 - MOVB R9, 1(AX) - MOVL R9, R11 - SHRL $0x08, R11 - SHLL $0x05, R11 - ORL R11, R8 - MOVB R8, (AX) + MOVL $0x00000001, R9 + LEAL 16(R9), R9 + MOVB R10, 1(AX) + MOVL R10, R12 + SHRL $0x08, R12 + SHLL $0x05, R12 + ORL R12, R9 + MOVB R9, (AX) ADDQ $0x02, AX - SUBL $0x08, R10 + SUBL $0x08, R11 // emitRepeat - LEAL -4(R10), R10 + LEAL -4(R11), R11 JMP cant_repeat_two_offset_lz4_s2_emit_copy_short_2b emit_repeat_again_lz4_s2_emit_copy_short_2b: - MOVL R10, R8 - LEAL -4(R10), R10 - CMPL R8, $0x08 + MOVL R11, R9 + LEAL -4(R11), R11 + CMPL R9, $0x08 JBE repeat_two_lz4_s2_emit_copy_short_2b - CMPL R8, $0x0c + CMPL R9, $0x0c JAE cant_repeat_two_offset_lz4_s2_emit_copy_short_2b - CMPL R9, $0x00000800 + CMPL R10, $0x00000800 JB repeat_two_offset_lz4_s2_emit_copy_short_2b cant_repeat_two_offset_lz4_s2_emit_copy_short_2b: - CMPL R10, $0x00000104 + CMPL R11, $0x00000104 JB repeat_three_lz4_s2_emit_copy_short_2b - CMPL R10, $0x00010100 + CMPL R11, $0x00010100 JB repeat_four_lz4_s2_emit_copy_short_2b - CMPL R10, $0x0100ffff + CMPL R11, $0x0100ffff JB repeat_five_lz4_s2_emit_copy_short_2b - LEAL -16842747(R10), R10 + LEAL -16842747(R11), R11 MOVL $0xfffb001d, (AX) MOVB $0xff, 4(AX) ADDQ $0x05, AX + CMPQ AX, CX + JAE lz4_s2_loop JMP emit_repeat_again_lz4_s2_emit_copy_short_2b repeat_five_lz4_s2_emit_copy_short_2b: - LEAL -65536(R10), R10 - MOVL R10, R9 + LEAL -65536(R11), R11 + MOVL R11, R10 MOVW $0x001d, (AX) - MOVW R10, 2(AX) - SARL $0x10, R9 - MOVB R9, 4(AX) + MOVW R11, 2(AX) + SARL $0x10, R10 + MOVB R10, 4(AX) ADDQ $0x05, AX JMP lz4_s2_loop repeat_four_lz4_s2_emit_copy_short_2b: - LEAL -256(R10), R10 + LEAL -256(R11), R11 MOVW $0x0019, (AX) - MOVW R10, 2(AX) + MOVW R11, 2(AX) ADDQ $0x04, AX JMP lz4_s2_loop repeat_three_lz4_s2_emit_copy_short_2b: - LEAL -4(R10), R10 + LEAL -4(R11), R11 MOVW $0x0015, (AX) - MOVB R10, 2(AX) + MOVB R11, 2(AX) ADDQ $0x03, AX JMP lz4_s2_loop repeat_two_lz4_s2_emit_copy_short_2b: - SHLL $0x02, R10 - ORL $0x01, R10 - MOVW R10, (AX) + SHLL $0x02, R11 + ORL $0x01, R11 + MOVW R11, (AX) ADDQ $0x02, AX JMP lz4_s2_loop repeat_two_offset_lz4_s2_emit_copy_short_2b: - XORQ R8, R8 - LEAL 1(R8)(R10*4), R10 - MOVB R9, 1(AX) - SARL $0x08, R9 - SHLL $0x05, R9 - ORL R9, R10 - MOVB R10, (AX) + XORQ R9, R9 + LEAL 1(R9)(R11*4), R11 + MOVB R10, 1(AX) + SARL $0x08, R10 + SHLL $0x05, R10 + ORL R10, R11 + MOVB R11, (AX) ADDQ $0x02, AX JMP lz4_s2_loop long_offset_short_lz4_s2: MOVB $0xee, (AX) - MOVW R9, 1(AX) - LEAL -60(R10), R10 + MOVW R10, 1(AX) + LEAL -60(R11), R11 ADDQ $0x03, AX // emitRepeat emit_repeat_again_lz4_s2_emit_copy_short: - MOVL R10, R8 - LEAL -4(R10), R10 - CMPL R8, $0x08 + MOVL R11, R9 + LEAL -4(R11), R11 + CMPL R9, $0x08 JBE repeat_two_lz4_s2_emit_copy_short - CMPL R8, $0x0c + CMPL R9, $0x0c JAE cant_repeat_two_offset_lz4_s2_emit_copy_short - CMPL R9, $0x00000800 + CMPL R10, $0x00000800 JB repeat_two_offset_lz4_s2_emit_copy_short cant_repeat_two_offset_lz4_s2_emit_copy_short: - CMPL R10, $0x00000104 + CMPL R11, $0x00000104 JB repeat_three_lz4_s2_emit_copy_short - CMPL R10, $0x00010100 + CMPL R11, $0x00010100 JB repeat_four_lz4_s2_emit_copy_short - CMPL R10, $0x0100ffff + CMPL R11, $0x0100ffff JB repeat_five_lz4_s2_emit_copy_short - LEAL -16842747(R10), R10 + LEAL -16842747(R11), R11 MOVL $0xfffb001d, (AX) MOVB $0xff, 4(AX) ADDQ $0x05, AX + CMPQ AX, CX + JAE lz4_s2_loop JMP emit_repeat_again_lz4_s2_emit_copy_short repeat_five_lz4_s2_emit_copy_short: - LEAL -65536(R10), R10 - MOVL R10, R9 + LEAL -65536(R11), R11 + MOVL R11, R10 MOVW $0x001d, (AX) - MOVW R10, 2(AX) - SARL $0x10, R9 - MOVB R9, 4(AX) + MOVW R11, 2(AX) + SARL $0x10, R10 + MOVB R10, 4(AX) ADDQ $0x05, AX JMP lz4_s2_loop repeat_four_lz4_s2_emit_copy_short: - LEAL -256(R10), R10 + LEAL -256(R11), R11 MOVW $0x0019, (AX) - MOVW R10, 2(AX) + MOVW R11, 2(AX) ADDQ $0x04, AX JMP lz4_s2_loop repeat_three_lz4_s2_emit_copy_short: - LEAL -4(R10), R10 + LEAL -4(R11), R11 MOVW $0x0015, (AX) - MOVB R10, 2(AX) + MOVB R11, 2(AX) ADDQ $0x03, AX JMP lz4_s2_loop repeat_two_lz4_s2_emit_copy_short: - SHLL $0x02, R10 - ORL $0x01, R10 - MOVW R10, (AX) + SHLL $0x02, R11 + ORL $0x01, R11 + MOVW R11, (AX) ADDQ $0x02, AX JMP lz4_s2_loop repeat_two_offset_lz4_s2_emit_copy_short: - XORQ R8, R8 - LEAL 1(R8)(R10*4), R10 - MOVB R9, 1(AX) - SARL $0x08, R9 - SHLL $0x05, R9 - ORL R9, R10 - MOVB R10, (AX) + XORQ R9, R9 + LEAL 1(R9)(R11*4), R11 + MOVB R10, 1(AX) + SARL $0x08, R10 + SHLL $0x05, R10 + ORL R10, R11 + MOVB R11, (AX) ADDQ $0x02, AX JMP lz4_s2_loop two_byte_offset_short_lz4_s2: - MOVL R10, R8 - SHLL $0x02, R8 - CMPL R10, $0x0c + MOVL R11, R9 + SHLL $0x02, R9 + CMPL R11, $0x0c JAE emit_copy_three_lz4_s2 - CMPL R9, $0x00000800 + CMPL R10, $0x00000800 JAE emit_copy_three_lz4_s2 - LEAL -15(R8), R8 - MOVB R9, 1(AX) - SHRL $0x08, R9 - SHLL $0x05, R9 - ORL R9, R8 - MOVB R8, (AX) + LEAL -15(R9), R9 + MOVB R10, 1(AX) + SHRL $0x08, R10 + SHLL $0x05, R10 + ORL R10, R9 + MOVB R9, (AX) ADDQ $0x02, AX JMP lz4_s2_loop emit_copy_three_lz4_s2: - LEAL -2(R8), R8 - MOVB R8, (AX) - MOVW R9, 1(AX) + LEAL -2(R9), R9 + MOVB R9, (AX) + MOVW R10, 1(AX) ADDQ $0x03, AX JMP lz4_s2_loop @@ -20285,7 +19872,7 @@ lz4_s2_dstfull: // func cvtLZ4sBlockAsm(dst []byte, src []byte) (uncompressed int, dstUsed int) // Requires: SSE2 -TEXT ·cvtLZ4sBlockAsm(SB), NOSPLIT, $0-64 +TEXT ·cvtLZ4sBlockAsm(SB), NOSPLIT, $8-64 XORQ SI, SI MOVQ dst_base+0(FP), AX MOVQ dst_len+8(FP), CX @@ -20293,459 +19880,466 @@ TEXT ·cvtLZ4sBlockAsm(SB), NOSPLIT, $0-64 MOVQ src_len+32(FP), BX LEAQ (DX)(BX*1), BX LEAQ -8(AX)(CX*1), CX - XORQ DI, DI + LEAQ -4(CX), DI + XORQ R8, R8 lz4s_s2_loop: CMPQ DX, BX JAE lz4s_s2_corrupt CMPQ AX, CX JAE lz4s_s2_dstfull - MOVBQZX (DX), R8 - MOVQ R8, R9 - MOVQ R8, R10 - SHRQ $0x04, R9 - ANDQ $0x0f, R10 - CMPQ R8, $0xf0 + MOVBQZX (DX), R9 + MOVQ R9, R10 + MOVQ R9, R11 + SHRQ $0x04, R10 + ANDQ $0x0f, R11 + CMPQ R9, $0xf0 JB lz4s_s2_ll_end lz4s_s2_ll_loop: INCQ DX CMPQ DX, BX JAE lz4s_s2_corrupt - MOVBQZX (DX), R8 - ADDQ R8, R9 - CMPQ R8, $0xff + MOVBQZX (DX), R9 + ADDQ R9, R10 + CMPQ R9, $0xff JEQ lz4s_s2_ll_loop lz4s_s2_ll_end: - LEAQ (DX)(R9*1), R8 - ADDQ $0x03, R10 - CMPQ R8, BX + LEAQ (DX)(R10*1), R9 + ADDQ $0x03, R11 + CMPQ R9, BX JAE lz4s_s2_corrupt INCQ DX - INCQ R8 - TESTQ R9, R9 + INCQ R9 + TESTQ R10, R10 JZ lz4s_s2_lits_done - LEAQ (AX)(R9*1), R11 - CMPQ R11, CX + LEAQ (AX)(R10*1), R12 + CMPQ R12, DI JAE lz4s_s2_dstfull - ADDQ R9, SI - LEAL -1(R9), R11 - CMPL R11, $0x3c + ADDQ R10, SI + LEAL -1(R10), R12 + CMPL R12, $0x3c JB one_byte_lz4s_s2 - CMPL R11, $0x00000100 + CMPL R12, $0x00000100 JB two_bytes_lz4s_s2 - CMPL R11, $0x00010000 + CMPL R12, $0x00010000 JB three_bytes_lz4s_s2 - CMPL R11, $0x01000000 + CMPL R12, $0x01000000 JB four_bytes_lz4s_s2 MOVB $0xfc, (AX) - MOVL R11, 1(AX) + MOVL R12, 1(AX) ADDQ $0x05, AX JMP memmove_long_lz4s_s2 four_bytes_lz4s_s2: - MOVL R11, R12 - SHRL $0x10, R12 + MOVL R12, R13 + SHRL $0x10, R13 MOVB $0xf8, (AX) - MOVW R11, 1(AX) - MOVB R12, 3(AX) + MOVW R12, 1(AX) + MOVB R13, 3(AX) ADDQ $0x04, AX JMP memmove_long_lz4s_s2 three_bytes_lz4s_s2: MOVB $0xf4, (AX) - MOVW R11, 1(AX) + MOVW R12, 1(AX) ADDQ $0x03, AX JMP memmove_long_lz4s_s2 two_bytes_lz4s_s2: MOVB $0xf0, (AX) - MOVB R11, 1(AX) + MOVB R12, 1(AX) ADDQ $0x02, AX - CMPL R11, $0x40 + CMPL R12, $0x40 JB memmove_lz4s_s2 JMP memmove_long_lz4s_s2 one_byte_lz4s_s2: - SHLB $0x02, R11 - MOVB R11, (AX) + SHLB $0x02, R12 + MOVB R12, (AX) ADDQ $0x01, AX memmove_lz4s_s2: - LEAQ (AX)(R9*1), R11 + LEAQ (AX)(R10*1), R12 // genMemMoveShort - CMPQ R9, $0x08 + CMPQ R10, $0x08 JBE emit_lit_memmove_lz4s_s2_memmove_move_8 - CMPQ R9, $0x10 + CMPQ R10, $0x10 JBE emit_lit_memmove_lz4s_s2_memmove_move_8through16 - CMPQ R9, $0x20 + CMPQ R10, $0x20 JBE emit_lit_memmove_lz4s_s2_memmove_move_17through32 JMP emit_lit_memmove_lz4s_s2_memmove_move_33through64 emit_lit_memmove_lz4s_s2_memmove_move_8: - MOVQ (DX), R12 - MOVQ R12, (AX) + MOVQ (DX), R13 + MOVQ R13, (AX) JMP memmove_end_copy_lz4s_s2 emit_lit_memmove_lz4s_s2_memmove_move_8through16: - MOVQ (DX), R12 - MOVQ -8(DX)(R9*1), DX - MOVQ R12, (AX) - MOVQ DX, -8(AX)(R9*1) + MOVQ (DX), R13 + MOVQ -8(DX)(R10*1), DX + MOVQ R13, (AX) + MOVQ DX, -8(AX)(R10*1) JMP memmove_end_copy_lz4s_s2 emit_lit_memmove_lz4s_s2_memmove_move_17through32: MOVOU (DX), X0 - MOVOU -16(DX)(R9*1), X1 + MOVOU -16(DX)(R10*1), X1 MOVOU X0, (AX) - MOVOU X1, -16(AX)(R9*1) + MOVOU X1, -16(AX)(R10*1) JMP memmove_end_copy_lz4s_s2 emit_lit_memmove_lz4s_s2_memmove_move_33through64: MOVOU (DX), X0 MOVOU 16(DX), X1 - MOVOU -32(DX)(R9*1), X2 - MOVOU -16(DX)(R9*1), X3 + MOVOU -32(DX)(R10*1), X2 + MOVOU -16(DX)(R10*1), X3 MOVOU X0, (AX) MOVOU X1, 16(AX) - MOVOU X2, -32(AX)(R9*1) - MOVOU X3, -16(AX)(R9*1) + MOVOU X2, -32(AX)(R10*1) + MOVOU X3, -16(AX)(R10*1) memmove_end_copy_lz4s_s2: - MOVQ R11, AX + MOVQ R12, AX JMP lz4s_s2_lits_emit_done memmove_long_lz4s_s2: - LEAQ (AX)(R9*1), R11 + LEAQ (AX)(R10*1), R12 // genMemMoveLong MOVOU (DX), X0 MOVOU 16(DX), X1 - MOVOU -32(DX)(R9*1), X2 - MOVOU -16(DX)(R9*1), X3 - MOVQ R9, R13 - SHRQ $0x05, R13 - MOVQ AX, R12 - ANDL $0x0000001f, R12 - MOVQ $0x00000040, R14 - SUBQ R12, R14 - DECQ R13 + MOVOU -32(DX)(R10*1), X2 + MOVOU -16(DX)(R10*1), X3 + MOVQ R10, R14 + SHRQ $0x05, R14 + MOVQ AX, R13 + ANDL $0x0000001f, R13 + MOVQ $0x00000040, R15 + SUBQ R13, R15 + DECQ R14 JA emit_lit_memmove_long_lz4s_s2large_forward_sse_loop_32 - LEAQ -32(DX)(R14*1), R12 - LEAQ -32(AX)(R14*1), R15 + LEAQ -32(DX)(R15*1), R13 + LEAQ -32(AX)(R15*1), BP emit_lit_memmove_long_lz4s_s2large_big_loop_back: - MOVOU (R12), X4 - MOVOU 16(R12), X5 - MOVOA X4, (R15) - MOVOA X5, 16(R15) + MOVOU (R13), X4 + MOVOU 16(R13), X5 + MOVOA X4, (BP) + MOVOA X5, 16(BP) + ADDQ $0x20, BP + ADDQ $0x20, R13 ADDQ $0x20, R15 - ADDQ $0x20, R12 - ADDQ $0x20, R14 - DECQ R13 + DECQ R14 JNA emit_lit_memmove_long_lz4s_s2large_big_loop_back emit_lit_memmove_long_lz4s_s2large_forward_sse_loop_32: - MOVOU -32(DX)(R14*1), X4 - MOVOU -16(DX)(R14*1), X5 - MOVOA X4, -32(AX)(R14*1) - MOVOA X5, -16(AX)(R14*1) - ADDQ $0x20, R14 - CMPQ R9, R14 + MOVOU -32(DX)(R15*1), X4 + MOVOU -16(DX)(R15*1), X5 + MOVOA X4, -32(AX)(R15*1) + MOVOA X5, -16(AX)(R15*1) + ADDQ $0x20, R15 + CMPQ R10, R15 JAE emit_lit_memmove_long_lz4s_s2large_forward_sse_loop_32 MOVOU X0, (AX) MOVOU X1, 16(AX) - MOVOU X2, -32(AX)(R9*1) - MOVOU X3, -16(AX)(R9*1) - MOVQ R11, AX + MOVOU X2, -32(AX)(R10*1) + MOVOU X3, -16(AX)(R10*1) + MOVQ R12, AX lz4s_s2_lits_emit_done: - MOVQ R8, DX + MOVQ R9, DX lz4s_s2_lits_done: CMPQ DX, BX JNE lz4s_s2_match - CMPQ R10, $0x03 + CMPQ R11, $0x03 JEQ lz4s_s2_done JMP lz4s_s2_corrupt lz4s_s2_match: - CMPQ R10, $0x03 + CMPQ R11, $0x03 JEQ lz4s_s2_loop - LEAQ 2(DX), R8 - CMPQ R8, BX + LEAQ 2(DX), R9 + CMPQ R9, BX JAE lz4s_s2_corrupt - MOVWQZX (DX), R9 - MOVQ R8, DX - TESTQ R9, R9 + MOVWQZX (DX), R10 + MOVQ R9, DX + TESTQ R10, R10 JZ lz4s_s2_corrupt - CMPQ R9, SI + CMPQ R10, SI JA lz4s_s2_corrupt - CMPQ R10, $0x12 + CMPQ R11, $0x12 JNE lz4s_s2_ml_done lz4s_s2_ml_loop: - MOVBQZX (DX), R8 + MOVBQZX (DX), R9 INCQ DX - ADDQ R8, R10 + ADDQ R9, R11 CMPQ DX, BX JAE lz4s_s2_corrupt - CMPQ R8, $0xff + CMPQ R9, $0xff JEQ lz4s_s2_ml_loop lz4s_s2_ml_done: - ADDQ R10, SI - CMPQ R9, DI + ADDQ R11, SI + CMPQ R10, R8 JNE lz4s_s2_docopy // emitRepeat emit_repeat_again_lz4_s2: - MOVL R10, R8 - LEAL -4(R10), R10 - CMPL R8, $0x08 + MOVL R11, R9 + LEAL -4(R11), R11 + CMPL R9, $0x08 JBE repeat_two_lz4_s2 - CMPL R8, $0x0c + CMPL R9, $0x0c JAE cant_repeat_two_offset_lz4_s2 - CMPL R9, $0x00000800 + CMPL R10, $0x00000800 JB repeat_two_offset_lz4_s2 cant_repeat_two_offset_lz4_s2: - CMPL R10, $0x00000104 + CMPL R11, $0x00000104 JB repeat_three_lz4_s2 - CMPL R10, $0x00010100 + CMPL R11, $0x00010100 JB repeat_four_lz4_s2 - CMPL R10, $0x0100ffff + CMPL R11, $0x0100ffff JB repeat_five_lz4_s2 - LEAL -16842747(R10), R10 + LEAL -16842747(R11), R11 MOVL $0xfffb001d, (AX) MOVB $0xff, 4(AX) ADDQ $0x05, AX + CMPQ AX, CX + JAE lz4s_s2_loop JMP emit_repeat_again_lz4_s2 repeat_five_lz4_s2: - LEAL -65536(R10), R10 - MOVL R10, R9 + LEAL -65536(R11), R11 + MOVL R11, R10 MOVW $0x001d, (AX) - MOVW R10, 2(AX) - SARL $0x10, R9 - MOVB R9, 4(AX) + MOVW R11, 2(AX) + SARL $0x10, R10 + MOVB R10, 4(AX) ADDQ $0x05, AX JMP lz4s_s2_loop repeat_four_lz4_s2: - LEAL -256(R10), R10 + LEAL -256(R11), R11 MOVW $0x0019, (AX) - MOVW R10, 2(AX) + MOVW R11, 2(AX) ADDQ $0x04, AX JMP lz4s_s2_loop repeat_three_lz4_s2: - LEAL -4(R10), R10 + LEAL -4(R11), R11 MOVW $0x0015, (AX) - MOVB R10, 2(AX) + MOVB R11, 2(AX) ADDQ $0x03, AX JMP lz4s_s2_loop repeat_two_lz4_s2: - SHLL $0x02, R10 - ORL $0x01, R10 - MOVW R10, (AX) + SHLL $0x02, R11 + ORL $0x01, R11 + MOVW R11, (AX) ADDQ $0x02, AX JMP lz4s_s2_loop repeat_two_offset_lz4_s2: - XORQ R8, R8 - LEAL 1(R8)(R10*4), R10 - MOVB R9, 1(AX) - SARL $0x08, R9 - SHLL $0x05, R9 - ORL R9, R10 - MOVB R10, (AX) + XORQ R9, R9 + LEAL 1(R9)(R11*4), R11 + MOVB R10, 1(AX) + SARL $0x08, R10 + SHLL $0x05, R10 + ORL R10, R11 + MOVB R11, (AX) ADDQ $0x02, AX JMP lz4s_s2_loop lz4s_s2_docopy: - MOVQ R9, DI + MOVQ R10, R8 // emitCopy - CMPL R10, $0x40 + CMPL R11, $0x40 JBE two_byte_offset_short_lz4_s2 - CMPL R9, $0x00000800 + CMPL R10, $0x00000800 JAE long_offset_short_lz4_s2 - MOVL $0x00000001, R8 - LEAL 16(R8), R8 - MOVB R9, 1(AX) - MOVL R9, R11 - SHRL $0x08, R11 - SHLL $0x05, R11 - ORL R11, R8 - MOVB R8, (AX) + MOVL $0x00000001, R9 + LEAL 16(R9), R9 + MOVB R10, 1(AX) + MOVL R10, R12 + SHRL $0x08, R12 + SHLL $0x05, R12 + ORL R12, R9 + MOVB R9, (AX) ADDQ $0x02, AX - SUBL $0x08, R10 + SUBL $0x08, R11 // emitRepeat - LEAL -4(R10), R10 + LEAL -4(R11), R11 JMP cant_repeat_two_offset_lz4_s2_emit_copy_short_2b emit_repeat_again_lz4_s2_emit_copy_short_2b: - MOVL R10, R8 - LEAL -4(R10), R10 - CMPL R8, $0x08 + MOVL R11, R9 + LEAL -4(R11), R11 + CMPL R9, $0x08 JBE repeat_two_lz4_s2_emit_copy_short_2b - CMPL R8, $0x0c + CMPL R9, $0x0c JAE cant_repeat_two_offset_lz4_s2_emit_copy_short_2b - CMPL R9, $0x00000800 + CMPL R10, $0x00000800 JB repeat_two_offset_lz4_s2_emit_copy_short_2b cant_repeat_two_offset_lz4_s2_emit_copy_short_2b: - CMPL R10, $0x00000104 + CMPL R11, $0x00000104 JB repeat_three_lz4_s2_emit_copy_short_2b - CMPL R10, $0x00010100 + CMPL R11, $0x00010100 JB repeat_four_lz4_s2_emit_copy_short_2b - CMPL R10, $0x0100ffff + CMPL R11, $0x0100ffff JB repeat_five_lz4_s2_emit_copy_short_2b - LEAL -16842747(R10), R10 + LEAL -16842747(R11), R11 MOVL $0xfffb001d, (AX) MOVB $0xff, 4(AX) ADDQ $0x05, AX + CMPQ AX, CX + JAE lz4s_s2_loop JMP emit_repeat_again_lz4_s2_emit_copy_short_2b repeat_five_lz4_s2_emit_copy_short_2b: - LEAL -65536(R10), R10 - MOVL R10, R9 + LEAL -65536(R11), R11 + MOVL R11, R10 MOVW $0x001d, (AX) - MOVW R10, 2(AX) - SARL $0x10, R9 - MOVB R9, 4(AX) + MOVW R11, 2(AX) + SARL $0x10, R10 + MOVB R10, 4(AX) ADDQ $0x05, AX JMP lz4s_s2_loop repeat_four_lz4_s2_emit_copy_short_2b: - LEAL -256(R10), R10 + LEAL -256(R11), R11 MOVW $0x0019, (AX) - MOVW R10, 2(AX) + MOVW R11, 2(AX) ADDQ $0x04, AX JMP lz4s_s2_loop repeat_three_lz4_s2_emit_copy_short_2b: - LEAL -4(R10), R10 + LEAL -4(R11), R11 MOVW $0x0015, (AX) - MOVB R10, 2(AX) + MOVB R11, 2(AX) ADDQ $0x03, AX JMP lz4s_s2_loop repeat_two_lz4_s2_emit_copy_short_2b: - SHLL $0x02, R10 - ORL $0x01, R10 - MOVW R10, (AX) + SHLL $0x02, R11 + ORL $0x01, R11 + MOVW R11, (AX) ADDQ $0x02, AX JMP lz4s_s2_loop repeat_two_offset_lz4_s2_emit_copy_short_2b: - XORQ R8, R8 - LEAL 1(R8)(R10*4), R10 - MOVB R9, 1(AX) - SARL $0x08, R9 - SHLL $0x05, R9 - ORL R9, R10 - MOVB R10, (AX) + XORQ R9, R9 + LEAL 1(R9)(R11*4), R11 + MOVB R10, 1(AX) + SARL $0x08, R10 + SHLL $0x05, R10 + ORL R10, R11 + MOVB R11, (AX) ADDQ $0x02, AX JMP lz4s_s2_loop long_offset_short_lz4_s2: MOVB $0xee, (AX) - MOVW R9, 1(AX) - LEAL -60(R10), R10 + MOVW R10, 1(AX) + LEAL -60(R11), R11 ADDQ $0x03, AX // emitRepeat emit_repeat_again_lz4_s2_emit_copy_short: - MOVL R10, R8 - LEAL -4(R10), R10 - CMPL R8, $0x08 + MOVL R11, R9 + LEAL -4(R11), R11 + CMPL R9, $0x08 JBE repeat_two_lz4_s2_emit_copy_short - CMPL R8, $0x0c + CMPL R9, $0x0c JAE cant_repeat_two_offset_lz4_s2_emit_copy_short - CMPL R9, $0x00000800 + CMPL R10, $0x00000800 JB repeat_two_offset_lz4_s2_emit_copy_short cant_repeat_two_offset_lz4_s2_emit_copy_short: - CMPL R10, $0x00000104 + CMPL R11, $0x00000104 JB repeat_three_lz4_s2_emit_copy_short - CMPL R10, $0x00010100 + CMPL R11, $0x00010100 JB repeat_four_lz4_s2_emit_copy_short - CMPL R10, $0x0100ffff + CMPL R11, $0x0100ffff JB repeat_five_lz4_s2_emit_copy_short - LEAL -16842747(R10), R10 + LEAL -16842747(R11), R11 MOVL $0xfffb001d, (AX) MOVB $0xff, 4(AX) ADDQ $0x05, AX + CMPQ AX, CX + JAE lz4s_s2_loop JMP emit_repeat_again_lz4_s2_emit_copy_short repeat_five_lz4_s2_emit_copy_short: - LEAL -65536(R10), R10 - MOVL R10, R9 + LEAL -65536(R11), R11 + MOVL R11, R10 MOVW $0x001d, (AX) - MOVW R10, 2(AX) - SARL $0x10, R9 - MOVB R9, 4(AX) + MOVW R11, 2(AX) + SARL $0x10, R10 + MOVB R10, 4(AX) ADDQ $0x05, AX JMP lz4s_s2_loop repeat_four_lz4_s2_emit_copy_short: - LEAL -256(R10), R10 + LEAL -256(R11), R11 MOVW $0x0019, (AX) - MOVW R10, 2(AX) + MOVW R11, 2(AX) ADDQ $0x04, AX JMP lz4s_s2_loop repeat_three_lz4_s2_emit_copy_short: - LEAL -4(R10), R10 + LEAL -4(R11), R11 MOVW $0x0015, (AX) - MOVB R10, 2(AX) + MOVB R11, 2(AX) ADDQ $0x03, AX JMP lz4s_s2_loop repeat_two_lz4_s2_emit_copy_short: - SHLL $0x02, R10 - ORL $0x01, R10 - MOVW R10, (AX) + SHLL $0x02, R11 + ORL $0x01, R11 + MOVW R11, (AX) ADDQ $0x02, AX JMP lz4s_s2_loop repeat_two_offset_lz4_s2_emit_copy_short: - XORQ R8, R8 - LEAL 1(R8)(R10*4), R10 - MOVB R9, 1(AX) - SARL $0x08, R9 - SHLL $0x05, R9 - ORL R9, R10 - MOVB R10, (AX) + XORQ R9, R9 + LEAL 1(R9)(R11*4), R11 + MOVB R10, 1(AX) + SARL $0x08, R10 + SHLL $0x05, R10 + ORL R10, R11 + MOVB R11, (AX) ADDQ $0x02, AX JMP lz4s_s2_loop two_byte_offset_short_lz4_s2: - MOVL R10, R8 - SHLL $0x02, R8 - CMPL R10, $0x0c + MOVL R11, R9 + SHLL $0x02, R9 + CMPL R11, $0x0c JAE emit_copy_three_lz4_s2 - CMPL R9, $0x00000800 + CMPL R10, $0x00000800 JAE emit_copy_three_lz4_s2 - LEAL -15(R8), R8 - MOVB R9, 1(AX) - SHRL $0x08, R9 - SHLL $0x05, R9 - ORL R9, R8 - MOVB R8, (AX) + LEAL -15(R9), R9 + MOVB R10, 1(AX) + SHRL $0x08, R10 + SHLL $0x05, R10 + ORL R10, R9 + MOVB R9, (AX) ADDQ $0x02, AX JMP lz4s_s2_loop emit_copy_three_lz4_s2: - LEAL -2(R8), R8 - MOVB R8, (AX) - MOVW R9, 1(AX) + LEAL -2(R9), R9 + MOVB R9, (AX) + MOVW R10, 1(AX) ADDQ $0x03, AX JMP lz4s_s2_loop diff --git a/vendor/github.com/klauspost/compress/s2/encodeblock_arm64.s b/vendor/github.com/klauspost/compress/s2/encodeblock_arm64.s new file mode 100644 index 00000000000..db1666795df --- /dev/null +++ b/vendor/github.com/klauspost/compress/s2/encodeblock_arm64.s @@ -0,0 +1,23576 @@ +// Code generated by command: go run gen.go -out ../encodeblock.s -arch arm64 -arm64gen -pkg=s2. DO NOT EDIT. +// EXPERIMENTAL arm64 output lowered from an amd64 avo program. + +//go:build arm64 && (!noasm && gc) + +#include "textflag.h" + +// func encodeBlockAsm(dst []byte, src []byte, tmp *[65536]byte) int +// Requires: BMI, SSE2 +TEXT ·encodeBlockAsm(SB), $24-64 + MOVD tmp+48(FP), R0 + MOVD dst_base+0(FP), R1 + MOVD $0x00000200, R2 + MOVD R0, R3 + VEOR V0.B16, V0.B16, V0.B16 + +zero_loop_encodeBlockAsm: + FMOVQ F0, (R3) + FMOVQ F0, 16(R3) + FMOVQ F0, 32(R3) + FMOVQ F0, 48(R3) + FMOVQ F0, 64(R3) + FMOVQ F0, 80(R3) + FMOVQ F0, 96(R3) + FMOVQ F0, 112(R3) + ADD $0x80, R3, R3 + SUBS $1, R2, R2 + BNE zero_loop_encodeBlockAsm + MOVD $0x00000000, R16 + MOVW R16, 20(RSP) + MOVD src_len+32(FP), R2 + SUB $9, R2, R3 + SUB $8, R2, R5 + MOVW R5, 16(RSP) + LSR $0x05, R2, R2 + SUBW R2, R3, R3 + ADD R3, R1, R3 + MOVD R3, 8(RSP) + MOVD $0x00000001, R2 + MOVW R2, 24(RSP) + MOVD src_base+24(FP), R3 + +search_loop_encodeBlockAsm: + MOVWU R2, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + LSRW $0x06, R5, R5 + ADD R5, R2, R5 + ADD $4, R5, R5 + MOVWU R5, R5 + MOVWU 16(RSP), R16 + CMPW R16, R5 + BHS emit_remainder_encodeBlockAsm + MOVD (R3)(R2), R6 + MOVW R5, 28(RSP) + MOVD $0x0000cf1bbcdcbf9b, R8 + MOVD R6, R9 + MOVD R6, R10 + LSR $0x08, R10, R10 + LSL $0x10, R9, R9 + MUL R8, R9, R9 + LSR $0x32, R9, R9 + LSL $0x10, R10, R10 + MUL R8, R10, R10 + LSR $0x32, R10, R10 + MOVWU (R0)(R9<<2), R5 + MOVWU (R0)(R10<<2), R7 + MOVW R2, (R0)(R9<<2) + ADD $1, R2, R9 + MOVWU R9, R9 + MOVW R9, (R0)(R10<<2) + MOVD R6, R9 + LSR $0x10, R9, R9 + LSL $0x10, R9, R9 + MUL R8, R9, R9 + LSR $0x32, R9, R9 + MOVWU R2, R8 + MOVWU 24(RSP), R16 + SUBW R16, R8, R8 + ADD R8, R3, R15 + MOVWU 1(R15), R10 + MOVD R6, R8 + LSR $0x08, R8, R8 + CMPW R10, R8 + BNE no_repeat_found_encodeBlockAsm + ADD $1, R2, R6 + MOVWU R6, R6 + MOVWU 20(RSP), R7 + MOVWU R6, R5 + MOVWU 24(RSP), R16 + SUBSW R16, R5, R5 + BEQ repeat_extend_back_end_encodeBlockAsm + +repeat_extend_back_loop_encodeBlockAsm: + CMPW R7, R6 + BLS repeat_extend_back_end_encodeBlockAsm + ADD R5, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + ADD R6, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R9 + AND $0xff, R9, R16 + AND $0xff, R8, R15 + CMP R16, R15 + BNE repeat_extend_back_end_encodeBlockAsm + SUB $1, R6, R6 + MOVWU R6, R6 + SUBSW $1, R5, R5 + BNE repeat_extend_back_loop_encodeBlockAsm + +repeat_extend_back_end_encodeBlockAsm: + MOVWU R6, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + ADD R5, R1, R5 + ADD $5, R5, R5 + MOVD 8(RSP), R16 + CMP R16, R5 + BLO repeat_dst_size_check_encodeBlockAsm + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +repeat_dst_size_check_encodeBlockAsm: + MOVWU 20(RSP), R5 + CMPW R6, R5 + BEQ emit_literal_done_repeat_emit_encodeBlockAsm + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R5, R3, R9 + SUBW R5, R8, R8 + SUB $1, R8, R5 + MOVWU R5, R5 + CMPW $0x3c, R5 + BLO one_byte_repeat_emit_encodeBlockAsm + CMPW $0x00000100, R5 + BLO two_bytes_repeat_emit_encodeBlockAsm + CMPW $0x00010000, R5 + BLO three_bytes_repeat_emit_encodeBlockAsm + CMPW $0x01000000, R5 + BLO four_bytes_repeat_emit_encodeBlockAsm + MOVD $0xfc, R16 + MOVB R16, (R1) + MOVW R5, 1(R1) + ADD $0x05, R1, R1 + JMP memmove_long_repeat_emit_encodeBlockAsm + +four_bytes_repeat_emit_encodeBlockAsm: + MOVWU R5, R10 + LSRW $0x10, R10, R10 + MOVD $0xf8, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + MOVB R10, 3(R1) + ADD $0x04, R1, R1 + JMP memmove_long_repeat_emit_encodeBlockAsm + +three_bytes_repeat_emit_encodeBlockAsm: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_repeat_emit_encodeBlockAsm + +two_bytes_repeat_emit_encodeBlockAsm: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R5, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R5 + BLO memmove_repeat_emit_encodeBlockAsm + JMP memmove_long_repeat_emit_encodeBlockAsm + +one_byte_repeat_emit_encodeBlockAsm: + LSLW $0x02, R5, R16 + BFI $0, R16, $8, R5 + MOVB R5, (R1) + ADD $0x01, R1, R1 + +memmove_repeat_emit_encodeBlockAsm: + ADD R8, R1, R5 + + // genMemMoveShort + CMP $0x08, R8 + BLS emit_lit_memmove_repeat_emit_encodeBlockAsm_memmove_move_8 + CMP $0x10, R8 + BLS emit_lit_memmove_repeat_emit_encodeBlockAsm_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_repeat_emit_encodeBlockAsm_memmove_move_17through32 + JMP emit_lit_memmove_repeat_emit_encodeBlockAsm_memmove_move_33through64 + +emit_lit_memmove_repeat_emit_encodeBlockAsm_memmove_move_8: + MOVD (R9), R10 + MOVD R10, (R1) + JMP memmove_end_copy_repeat_emit_encodeBlockAsm + +emit_lit_memmove_repeat_emit_encodeBlockAsm_memmove_move_8through16: + MOVD (R9), R10 + ADD R8, R9, R15 + MOVD -8(R15), R9 + MOVD R10, (R1) + ADD R8, R1, R15 + MOVD R9, -8(R15) + JMP memmove_end_copy_repeat_emit_encodeBlockAsm + +emit_lit_memmove_repeat_emit_encodeBlockAsm_memmove_move_17through32: + FMOVQ (R9), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_repeat_emit_encodeBlockAsm + +emit_lit_memmove_repeat_emit_encodeBlockAsm_memmove_move_33through64: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + ADD R8, R9, R15 + FMOVQ -32(R15), F2 + ADD R8, R9, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_repeat_emit_encodeBlockAsm: + MOVD R5, R1 + JMP emit_literal_done_repeat_emit_encodeBlockAsm + +memmove_long_repeat_emit_encodeBlockAsm: + ADD R8, R1, R5 + + // genMemMoveLong + MOVD R9, R10 + MOVD R1, R11 + MOVD R8, R12 + +emit_lit_memmove_long_repeat_emit_encodeBlockAsmlarge_big_loop_back: + FMOVQ (R10), F0 + FMOVQ 16(R10), F1 + FMOVQ F0, (R11) + FMOVQ F1, 16(R11) + ADD $0x20, R10, R10 + ADD $0x20, R11, R11 + SUB $0x20, R12, R12 + CMP $0x20, R12 + BHS emit_lit_memmove_long_repeat_emit_encodeBlockAsmlarge_big_loop_back + ADD R8, R9, R15 + FMOVQ -32(R15), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R5, R1 + +emit_literal_done_repeat_emit_encodeBlockAsm: + ADDW $0x05, R2, R2 + MOVWU R2, R5 + MOVWU 24(RSP), R16 + SUBW R16, R5, R5 + MOVD src_len+32(FP), R8 + SUBW R2, R8, R8 + ADD R2, R3, R9 + ADD R5, R3, R5 + + // matchLen + MOVD $0, R11 + +matchlen_loopback_16_repeat_extend_encodeBlockAsm: + CMPW $0x10, R8 + BLO matchlen_match8_repeat_extend_encodeBlockAsm + MOVD (R9)(R11), R10 + ADD R11, R9, R15 + MOVD 8(R15), R12 + MOVD (R5)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_repeat_extend_encodeBlockAsm + ADD R11, R5, R15 + MOVD 8(R15), R16 + EOR R16, R12, R12 + TST R12, R12 + BNE matchlen_bsf_16repeat_extend_encodeBlockAsm + SUB $16, R8, R8 + MOVWU R8, R8 + ADD $16, R11, R11 + MOVWU R11, R11 + JMP matchlen_loopback_16_repeat_extend_encodeBlockAsm + +matchlen_bsf_16repeat_extend_encodeBlockAsm: + RBIT R12, R12 + CLZ R12, R12 + ASR $0x03, R12, R12 + ADD R12, R11, R11 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP repeat_extend_forward_end_encodeBlockAsm + +matchlen_match8_repeat_extend_encodeBlockAsm: + CMPW $0x08, R8 + BLO matchlen_match4_repeat_extend_encodeBlockAsm + MOVD (R9)(R11), R10 + MOVD (R5)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_repeat_extend_encodeBlockAsm + SUB $8, R8, R8 + MOVWU R8, R8 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP matchlen_match4_repeat_extend_encodeBlockAsm + +matchlen_bsf_8_repeat_extend_encodeBlockAsm: + RBIT R10, R10 + CLZ R10, R10 + ASR $0x03, R10, R10 + ADD R10, R11, R11 + MOVWU R11, R11 + JMP repeat_extend_forward_end_encodeBlockAsm + +matchlen_match4_repeat_extend_encodeBlockAsm: + CMPW $0x04, R8 + BLO matchlen_match2_repeat_extend_encodeBlockAsm + MOVWU (R9)(R11), R10 + MOVWU (R5)(R11), R16 + CMPW R10, R16 + BNE matchlen_match2_repeat_extend_encodeBlockAsm + SUB $4, R8, R8 + MOVWU R8, R8 + ADD $4, R11, R11 + MOVWU R11, R11 + +matchlen_match2_repeat_extend_encodeBlockAsm: + CMPW $0x01, R8 + BEQ matchlen_match1_repeat_extend_encodeBlockAsm + BLO repeat_extend_forward_end_encodeBlockAsm + MOVHU (R9)(R11), R16 + BFI $0, R16, $16, R10 + ADD R11, R5, R15 + MOVHU (R15), R15 + AND $0xffff, R10, R16 + CMP R16, R15 + BNE matchlen_match1_repeat_extend_encodeBlockAsm + ADD $2, R11, R11 + MOVWU R11, R11 + SUBSW $0x02, R8, R8 + BEQ repeat_extend_forward_end_encodeBlockAsm + +matchlen_match1_repeat_extend_encodeBlockAsm: + MOVBU (R9)(R11), R16 + BFI $0, R16, $8, R10 + ADD R11, R5, R15 + MOVBU (R15), R15 + AND $0xff, R10, R16 + CMP R16, R15 + BNE repeat_extend_forward_end_encodeBlockAsm + ADD $1, R11, R11 + MOVWU R11, R11 + +repeat_extend_forward_end_encodeBlockAsm: + ADDW R11, R2, R2 + MOVWU R2, R5 + SUBW R6, R5, R5 + MOVWU 24(RSP), R6 + TSTW R7, R7 + BEQ repeat_as_copy_encodeBlockAsm + + // emitRepeat +emit_repeat_again_match_repeat_encodeBlockAsm: + MOVWU R5, R7 + SUB $4, R5, R5 + MOVWU R5, R5 + CMPW $0x08, R7 + BLS repeat_two_match_repeat_encodeBlockAsm + CMPW $0x0c, R7 + BHS cant_repeat_two_offset_match_repeat_encodeBlockAsm + CMPW $0x00000800, R6 + BLO repeat_two_offset_match_repeat_encodeBlockAsm + +cant_repeat_two_offset_match_repeat_encodeBlockAsm: + CMPW $0x00000104, R5 + BLO repeat_three_match_repeat_encodeBlockAsm + CMPW $0x00010100, R5 + BLO repeat_four_match_repeat_encodeBlockAsm + CMPW $0x0100ffff, R5 + BLO repeat_five_match_repeat_encodeBlockAsm + SUB $16842747, R5, R5 + MOVWU R5, R5 + MOVD $0xfffb001d, R16 + MOVW R16, (R1) + MOVD $0xff, R16 + MOVB R16, 4(R1) + ADD $0x05, R1, R1 + JMP emit_repeat_again_match_repeat_encodeBlockAsm + +repeat_five_match_repeat_encodeBlockAsm: + SUB $65536, R5, R5 + MOVWU R5, R5 + MOVWU R5, R6 + MOVD $0x001d, R16 + MOVH R16, (R1) + MOVH R5, 2(R1) + ASRW $0x10, R6, R6 + MOVB R6, 4(R1) + ADD $0x05, R1, R1 + JMP repeat_end_emit_encodeBlockAsm + +repeat_four_match_repeat_encodeBlockAsm: + SUB $256, R5, R5 + MOVWU R5, R5 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R5, 2(R1) + ADD $0x04, R1, R1 + JMP repeat_end_emit_encodeBlockAsm + +repeat_three_match_repeat_encodeBlockAsm: + SUB $4, R5, R5 + MOVWU R5, R5 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R5, 2(R1) + ADD $0x03, R1, R1 + JMP repeat_end_emit_encodeBlockAsm + +repeat_two_match_repeat_encodeBlockAsm: + LSLW $0x02, R5, R5 + ORRW $0x01, R5, R5 + MOVH R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm + +repeat_two_offset_match_repeat_encodeBlockAsm: + MOVD $0, R7 + ADD R5<<2, R7, R5 + ADD $1, R5, R5 + MOVWU R5, R5 + MOVB R6, 1(R1) + ASRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm + +repeat_as_copy_encodeBlockAsm: + // emitCopy + CMPW $0x00010000, R6 + BLO two_byte_offset_repeat_as_copy_encodeBlockAsm + CMPW $0x40, R5 + BLS four_bytes_remain_repeat_as_copy_encodeBlockAsm + MOVD $0xff, R16 + MOVB R16, (R1) + MOVW R6, 1(R1) + SUB $64, R5, R5 + MOVWU R5, R5 + ADD $0x05, R1, R1 + CMPW $0x04, R5 + BLO four_bytes_remain_repeat_as_copy_encodeBlockAsm + + // emitRepeat +emit_repeat_again_repeat_as_copy_encodeBlockAsm_emit_copy: + MOVWU R5, R7 + SUB $4, R5, R5 + MOVWU R5, R5 + CMPW $0x08, R7 + BLS repeat_two_repeat_as_copy_encodeBlockAsm_emit_copy + CMPW $0x0c, R7 + BHS cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy + CMPW $0x00000800, R6 + BLO repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy + +cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy: + CMPW $0x00000104, R5 + BLO repeat_three_repeat_as_copy_encodeBlockAsm_emit_copy + CMPW $0x00010100, R5 + BLO repeat_four_repeat_as_copy_encodeBlockAsm_emit_copy + CMPW $0x0100ffff, R5 + BLO repeat_five_repeat_as_copy_encodeBlockAsm_emit_copy + SUB $16842747, R5, R5 + MOVWU R5, R5 + MOVD $0xfffb001d, R16 + MOVW R16, (R1) + MOVD $0xff, R16 + MOVB R16, 4(R1) + ADD $0x05, R1, R1 + JMP emit_repeat_again_repeat_as_copy_encodeBlockAsm_emit_copy + +repeat_five_repeat_as_copy_encodeBlockAsm_emit_copy: + SUB $65536, R5, R5 + MOVWU R5, R5 + MOVWU R5, R6 + MOVD $0x001d, R16 + MOVH R16, (R1) + MOVH R5, 2(R1) + ASRW $0x10, R6, R6 + MOVB R6, 4(R1) + ADD $0x05, R1, R1 + JMP repeat_end_emit_encodeBlockAsm + +repeat_four_repeat_as_copy_encodeBlockAsm_emit_copy: + SUB $256, R5, R5 + MOVWU R5, R5 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R5, 2(R1) + ADD $0x04, R1, R1 + JMP repeat_end_emit_encodeBlockAsm + +repeat_three_repeat_as_copy_encodeBlockAsm_emit_copy: + SUB $4, R5, R5 + MOVWU R5, R5 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R5, 2(R1) + ADD $0x03, R1, R1 + JMP repeat_end_emit_encodeBlockAsm + +repeat_two_repeat_as_copy_encodeBlockAsm_emit_copy: + LSLW $0x02, R5, R5 + ORRW $0x01, R5, R5 + MOVH R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm + +repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy: + MOVD $0, R7 + ADD R5<<2, R7, R5 + ADD $1, R5, R5 + MOVWU R5, R5 + MOVB R6, 1(R1) + ASRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm + +four_bytes_remain_repeat_as_copy_encodeBlockAsm: + TSTW R5, R5 + BEQ repeat_end_emit_encodeBlockAsm + MOVD $0, R7 + ADD R5<<2, R7, R5 + SUB $1, R5, R5 + MOVWU R5, R5 + MOVB R5, (R1) + MOVW R6, 1(R1) + ADD $0x05, R1, R1 + JMP repeat_end_emit_encodeBlockAsm + +two_byte_offset_repeat_as_copy_encodeBlockAsm: + CMPW $0x40, R5 + BLS two_byte_offset_short_repeat_as_copy_encodeBlockAsm + CMPW $0x00000800, R6 + BHS long_offset_short_repeat_as_copy_encodeBlockAsm + MOVD $0x00000001, R7 + ADD $16, R7, R7 + MOVWU R7, R7 + MOVB R6, 1(R1) + MOVWU R6, R8 + LSRW $0x08, R8, R8 + LSLW $0x05, R8, R8 + ORRW R8, R7, R7 + MOVB R7, (R1) + ADD $0x02, R1, R1 + SUBW $0x08, R5, R5 + + // emitRepeat + SUB $4, R5, R5 + MOVWU R5, R5 + JMP cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b + +emit_repeat_again_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b: + MOVWU R5, R7 + SUB $4, R5, R5 + MOVWU R5, R5 + CMPW $0x08, R7 + BLS repeat_two_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b + CMPW $0x0c, R7 + BHS cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b + CMPW $0x00000800, R6 + BLO repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b + +cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b: + CMPW $0x00000104, R5 + BLO repeat_three_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b + CMPW $0x00010100, R5 + BLO repeat_four_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b + CMPW $0x0100ffff, R5 + BLO repeat_five_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b + SUB $16842747, R5, R5 + MOVWU R5, R5 + MOVD $0xfffb001d, R16 + MOVW R16, (R1) + MOVD $0xff, R16 + MOVB R16, 4(R1) + ADD $0x05, R1, R1 + JMP emit_repeat_again_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b + +repeat_five_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b: + SUB $65536, R5, R5 + MOVWU R5, R5 + MOVWU R5, R6 + MOVD $0x001d, R16 + MOVH R16, (R1) + MOVH R5, 2(R1) + ASRW $0x10, R6, R6 + MOVB R6, 4(R1) + ADD $0x05, R1, R1 + JMP repeat_end_emit_encodeBlockAsm + +repeat_four_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b: + SUB $256, R5, R5 + MOVWU R5, R5 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R5, 2(R1) + ADD $0x04, R1, R1 + JMP repeat_end_emit_encodeBlockAsm + +repeat_three_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b: + SUB $4, R5, R5 + MOVWU R5, R5 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R5, 2(R1) + ADD $0x03, R1, R1 + JMP repeat_end_emit_encodeBlockAsm + +repeat_two_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b: + LSLW $0x02, R5, R5 + ORRW $0x01, R5, R5 + MOVH R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm + +repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b: + MOVD $0, R7 + ADD R5<<2, R7, R5 + ADD $1, R5, R5 + MOVWU R5, R5 + MOVB R6, 1(R1) + ASRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm + +long_offset_short_repeat_as_copy_encodeBlockAsm: + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R6, 1(R1) + SUB $60, R5, R5 + MOVWU R5, R5 + ADD $0x03, R1, R1 + + // emitRepeat +emit_repeat_again_repeat_as_copy_encodeBlockAsm_emit_copy_short: + MOVWU R5, R7 + SUB $4, R5, R5 + MOVWU R5, R5 + CMPW $0x08, R7 + BLS repeat_two_repeat_as_copy_encodeBlockAsm_emit_copy_short + CMPW $0x0c, R7 + BHS cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy_short + CMPW $0x00000800, R6 + BLO repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy_short + +cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy_short: + CMPW $0x00000104, R5 + BLO repeat_three_repeat_as_copy_encodeBlockAsm_emit_copy_short + CMPW $0x00010100, R5 + BLO repeat_four_repeat_as_copy_encodeBlockAsm_emit_copy_short + CMPW $0x0100ffff, R5 + BLO repeat_five_repeat_as_copy_encodeBlockAsm_emit_copy_short + SUB $16842747, R5, R5 + MOVWU R5, R5 + MOVD $0xfffb001d, R16 + MOVW R16, (R1) + MOVD $0xff, R16 + MOVB R16, 4(R1) + ADD $0x05, R1, R1 + JMP emit_repeat_again_repeat_as_copy_encodeBlockAsm_emit_copy_short + +repeat_five_repeat_as_copy_encodeBlockAsm_emit_copy_short: + SUB $65536, R5, R5 + MOVWU R5, R5 + MOVWU R5, R6 + MOVD $0x001d, R16 + MOVH R16, (R1) + MOVH R5, 2(R1) + ASRW $0x10, R6, R6 + MOVB R6, 4(R1) + ADD $0x05, R1, R1 + JMP repeat_end_emit_encodeBlockAsm + +repeat_four_repeat_as_copy_encodeBlockAsm_emit_copy_short: + SUB $256, R5, R5 + MOVWU R5, R5 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R5, 2(R1) + ADD $0x04, R1, R1 + JMP repeat_end_emit_encodeBlockAsm + +repeat_three_repeat_as_copy_encodeBlockAsm_emit_copy_short: + SUB $4, R5, R5 + MOVWU R5, R5 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R5, 2(R1) + ADD $0x03, R1, R1 + JMP repeat_end_emit_encodeBlockAsm + +repeat_two_repeat_as_copy_encodeBlockAsm_emit_copy_short: + LSLW $0x02, R5, R5 + ORRW $0x01, R5, R5 + MOVH R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm + +repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy_short: + MOVD $0, R7 + ADD R5<<2, R7, R5 + ADD $1, R5, R5 + MOVWU R5, R5 + MOVB R6, 1(R1) + ASRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm + +two_byte_offset_short_repeat_as_copy_encodeBlockAsm: + MOVWU R5, R7 + LSLW $0x02, R7, R7 + CMPW $0x0c, R5 + BHS emit_copy_three_repeat_as_copy_encodeBlockAsm + CMPW $0x00000800, R6 + BHS emit_copy_three_repeat_as_copy_encodeBlockAsm + SUB $15, R7, R7 + MOVWU R7, R7 + MOVB R6, 1(R1) + LSRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R7, R7 + MOVB R7, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm + +emit_copy_three_repeat_as_copy_encodeBlockAsm: + SUB $2, R7, R7 + MOVWU R7, R7 + MOVB R7, (R1) + MOVH R6, 1(R1) + ADD $0x03, R1, R1 + +repeat_end_emit_encodeBlockAsm: + MOVW R2, 20(RSP) + JMP search_loop_encodeBlockAsm + +no_repeat_found_encodeBlockAsm: + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate_match_encodeBlockAsm + LSR $0x08, R6, R6 + MOVWU (R0)(R9<<2), R5 + ADD $2, R2, R8 + MOVWU R8, R8 + MOVWU (R3)(R7), R16 + CMPW R6, R16 + BEQ candidate2_match_encodeBlockAsm + MOVW R8, (R0)(R9<<2) + LSR $0x08, R6, R6 + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate3_match_encodeBlockAsm + MOVWU 28(RSP), R2 + JMP search_loop_encodeBlockAsm + +candidate3_match_encodeBlockAsm: + ADDW $0x02, R2, R2 + JMP candidate_match_encodeBlockAsm + +candidate2_match_encodeBlockAsm: + MOVW R8, (R0)(R9<<2) + ADDW $1, R2, R2 + MOVWU R7, R5 + +candidate_match_encodeBlockAsm: + MOVWU 20(RSP), R6 + TSTW R5, R5 + BEQ match_extend_back_end_encodeBlockAsm + +match_extend_back_loop_encodeBlockAsm: + CMPW R6, R2 + BLS match_extend_back_end_encodeBlockAsm + ADD R5, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R7 + ADD R2, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + AND $0xff, R8, R16 + AND $0xff, R7, R15 + CMP R16, R15 + BNE match_extend_back_end_encodeBlockAsm + SUB $1, R2, R2 + MOVWU R2, R2 + SUBSW $1, R5, R5 + BEQ match_extend_back_end_encodeBlockAsm + JMP match_extend_back_loop_encodeBlockAsm + +match_extend_back_end_encodeBlockAsm: + MOVWU R2, R6 + MOVWU 20(RSP), R16 + SUBW R16, R6, R6 + ADD R6, R1, R6 + ADD $5, R6, R6 + MOVD 8(RSP), R16 + CMP R16, R6 + BLO match_dst_size_check_encodeBlockAsm + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_dst_size_check_encodeBlockAsm: + MOVWU R2, R6 + MOVWU 20(RSP), R7 + CMPW R6, R7 + BEQ emit_literal_done_match_emit_encodeBlockAsm + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R7, R3, R6 + SUBW R7, R8, R8 + SUB $1, R8, R7 + MOVWU R7, R7 + CMPW $0x3c, R7 + BLO one_byte_match_emit_encodeBlockAsm + CMPW $0x00000100, R7 + BLO two_bytes_match_emit_encodeBlockAsm + CMPW $0x00010000, R7 + BLO three_bytes_match_emit_encodeBlockAsm + CMPW $0x01000000, R7 + BLO four_bytes_match_emit_encodeBlockAsm + MOVD $0xfc, R16 + MOVB R16, (R1) + MOVW R7, 1(R1) + ADD $0x05, R1, R1 + JMP memmove_long_match_emit_encodeBlockAsm + +four_bytes_match_emit_encodeBlockAsm: + MOVWU R7, R9 + LSRW $0x10, R9, R9 + MOVD $0xf8, R16 + MOVB R16, (R1) + MOVH R7, 1(R1) + MOVB R9, 3(R1) + ADD $0x04, R1, R1 + JMP memmove_long_match_emit_encodeBlockAsm + +three_bytes_match_emit_encodeBlockAsm: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R7, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_match_emit_encodeBlockAsm + +two_bytes_match_emit_encodeBlockAsm: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R7, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R7 + BLO memmove_match_emit_encodeBlockAsm + JMP memmove_long_match_emit_encodeBlockAsm + +one_byte_match_emit_encodeBlockAsm: + LSLW $0x02, R7, R16 + BFI $0, R16, $8, R7 + MOVB R7, (R1) + ADD $0x01, R1, R1 + +memmove_match_emit_encodeBlockAsm: + ADD R8, R1, R7 + + // genMemMoveShort + CMP $0x08, R8 + BLS emit_lit_memmove_match_emit_encodeBlockAsm_memmove_move_8 + CMP $0x10, R8 + BLS emit_lit_memmove_match_emit_encodeBlockAsm_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_match_emit_encodeBlockAsm_memmove_move_17through32 + JMP emit_lit_memmove_match_emit_encodeBlockAsm_memmove_move_33through64 + +emit_lit_memmove_match_emit_encodeBlockAsm_memmove_move_8: + MOVD (R6), R9 + MOVD R9, (R1) + JMP memmove_end_copy_match_emit_encodeBlockAsm + +emit_lit_memmove_match_emit_encodeBlockAsm_memmove_move_8through16: + MOVD (R6), R9 + ADD R8, R6, R15 + MOVD -8(R15), R6 + MOVD R9, (R1) + ADD R8, R1, R15 + MOVD R6, -8(R15) + JMP memmove_end_copy_match_emit_encodeBlockAsm + +emit_lit_memmove_match_emit_encodeBlockAsm_memmove_move_17through32: + FMOVQ (R6), F0 + ADD R8, R6, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_match_emit_encodeBlockAsm + +emit_lit_memmove_match_emit_encodeBlockAsm_memmove_move_33through64: + FMOVQ (R6), F0 + FMOVQ 16(R6), F1 + ADD R8, R6, R15 + FMOVQ -32(R15), F2 + ADD R8, R6, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_match_emit_encodeBlockAsm: + MOVD R7, R1 + JMP emit_literal_done_match_emit_encodeBlockAsm + +memmove_long_match_emit_encodeBlockAsm: + ADD R8, R1, R7 + + // genMemMoveLong + MOVD R6, R9 + MOVD R1, R10 + MOVD R8, R11 + +emit_lit_memmove_long_match_emit_encodeBlockAsmlarge_big_loop_back: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + FMOVQ F0, (R10) + FMOVQ F1, 16(R10) + ADD $0x20, R9, R9 + ADD $0x20, R10, R10 + SUB $0x20, R11, R11 + CMP $0x20, R11 + BHS emit_lit_memmove_long_match_emit_encodeBlockAsmlarge_big_loop_back + ADD R8, R6, R15 + FMOVQ -32(R15), F0 + ADD R8, R6, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R7, R1 + +emit_literal_done_match_emit_encodeBlockAsm: +match_nolit_loop_encodeBlockAsm: + MOVWU R2, R6 + SUBW R5, R6, R6 + MOVW R6, 24(RSP) + ADDW $0x04, R2, R2 + ADDW $0x04, R5, R5 + MOVD src_len+32(FP), R6 + SUBW R2, R6, R6 + ADD R2, R3, R7 + ADD R5, R3, R5 + + // matchLen + MOVD $0, R9 + +matchlen_loopback_16_match_nolit_encodeBlockAsm: + CMPW $0x10, R6 + BLO matchlen_match8_match_nolit_encodeBlockAsm + MOVD (R7)(R9), R8 + ADD R9, R7, R15 + MOVD 8(R15), R10 + MOVD (R5)(R9), R16 + EOR R16, R8, R8 + TST R8, R8 + BNE matchlen_bsf_8_match_nolit_encodeBlockAsm + ADD R9, R5, R15 + MOVD 8(R15), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_16match_nolit_encodeBlockAsm + SUB $16, R6, R6 + MOVWU R6, R6 + ADD $16, R9, R9 + MOVWU R9, R9 + JMP matchlen_loopback_16_match_nolit_encodeBlockAsm + +matchlen_bsf_16match_nolit_encodeBlockAsm: + RBIT R10, R10 + CLZ R10, R10 + ASR $0x03, R10, R10 + ADD R10, R9, R9 + ADD $8, R9, R9 + MOVWU R9, R9 + JMP match_nolit_end_encodeBlockAsm + +matchlen_match8_match_nolit_encodeBlockAsm: + CMPW $0x08, R6 + BLO matchlen_match4_match_nolit_encodeBlockAsm + MOVD (R7)(R9), R8 + MOVD (R5)(R9), R16 + EOR R16, R8, R8 + TST R8, R8 + BNE matchlen_bsf_8_match_nolit_encodeBlockAsm + SUB $8, R6, R6 + MOVWU R6, R6 + ADD $8, R9, R9 + MOVWU R9, R9 + JMP matchlen_match4_match_nolit_encodeBlockAsm + +matchlen_bsf_8_match_nolit_encodeBlockAsm: + RBIT R8, R8 + CLZ R8, R8 + ASR $0x03, R8, R8 + ADD R8, R9, R9 + MOVWU R9, R9 + JMP match_nolit_end_encodeBlockAsm + +matchlen_match4_match_nolit_encodeBlockAsm: + CMPW $0x04, R6 + BLO matchlen_match2_match_nolit_encodeBlockAsm + MOVWU (R7)(R9), R8 + MOVWU (R5)(R9), R16 + CMPW R8, R16 + BNE matchlen_match2_match_nolit_encodeBlockAsm + SUB $4, R6, R6 + MOVWU R6, R6 + ADD $4, R9, R9 + MOVWU R9, R9 + +matchlen_match2_match_nolit_encodeBlockAsm: + CMPW $0x01, R6 + BEQ matchlen_match1_match_nolit_encodeBlockAsm + BLO match_nolit_end_encodeBlockAsm + MOVHU (R7)(R9), R16 + BFI $0, R16, $16, R8 + ADD R9, R5, R15 + MOVHU (R15), R15 + AND $0xffff, R8, R16 + CMP R16, R15 + BNE matchlen_match1_match_nolit_encodeBlockAsm + ADD $2, R9, R9 + MOVWU R9, R9 + SUBSW $0x02, R6, R6 + BEQ match_nolit_end_encodeBlockAsm + +matchlen_match1_match_nolit_encodeBlockAsm: + MOVBU (R7)(R9), R16 + BFI $0, R16, $8, R8 + ADD R9, R5, R15 + MOVBU (R15), R15 + AND $0xff, R8, R16 + CMP R16, R15 + BNE match_nolit_end_encodeBlockAsm + ADD $1, R9, R9 + MOVWU R9, R9 + +match_nolit_end_encodeBlockAsm: + ADDW R9, R2, R2 + MOVWU 24(RSP), R5 + ADDW $0x04, R9, R9 + MOVW R2, 20(RSP) + + // emitCopy + CMPW $0x00010000, R5 + BLO two_byte_offset_match_nolit_encodeBlockAsm + CMPW $0x40, R9 + BLS four_bytes_remain_match_nolit_encodeBlockAsm + MOVD $0xff, R16 + MOVB R16, (R1) + MOVW R5, 1(R1) + SUB $64, R9, R9 + MOVWU R9, R9 + ADD $0x05, R1, R1 + CMPW $0x04, R9 + BLO four_bytes_remain_match_nolit_encodeBlockAsm + + // emitRepeat +emit_repeat_again_match_nolit_encodeBlockAsm_emit_copy: + MOVWU R9, R6 + SUB $4, R9, R9 + MOVWU R9, R9 + CMPW $0x08, R6 + BLS repeat_two_match_nolit_encodeBlockAsm_emit_copy + CMPW $0x0c, R6 + BHS cant_repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy + CMPW $0x00000800, R5 + BLO repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy + +cant_repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy: + CMPW $0x00000104, R9 + BLO repeat_three_match_nolit_encodeBlockAsm_emit_copy + CMPW $0x00010100, R9 + BLO repeat_four_match_nolit_encodeBlockAsm_emit_copy + CMPW $0x0100ffff, R9 + BLO repeat_five_match_nolit_encodeBlockAsm_emit_copy + SUB $16842747, R9, R9 + MOVWU R9, R9 + MOVD $0xfffb001d, R16 + MOVW R16, (R1) + MOVD $0xff, R16 + MOVB R16, 4(R1) + ADD $0x05, R1, R1 + JMP emit_repeat_again_match_nolit_encodeBlockAsm_emit_copy + +repeat_five_match_nolit_encodeBlockAsm_emit_copy: + SUB $65536, R9, R9 + MOVWU R9, R9 + MOVWU R9, R5 + MOVD $0x001d, R16 + MOVH R16, (R1) + MOVH R9, 2(R1) + ASRW $0x10, R5, R5 + MOVB R5, 4(R1) + ADD $0x05, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm + +repeat_four_match_nolit_encodeBlockAsm_emit_copy: + SUB $256, R9, R9 + MOVWU R9, R9 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R9, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm + +repeat_three_match_nolit_encodeBlockAsm_emit_copy: + SUB $4, R9, R9 + MOVWU R9, R9 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R9, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm + +repeat_two_match_nolit_encodeBlockAsm_emit_copy: + LSLW $0x02, R9, R9 + ORRW $0x01, R9, R9 + MOVH R9, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm + +repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy: + MOVD $0, R6 + ADD R9<<2, R6, R9 + ADD $1, R9, R9 + MOVWU R9, R9 + MOVB R5, 1(R1) + ASRW $0x08, R5, R5 + LSLW $0x05, R5, R5 + ORRW R5, R9, R9 + MOVB R9, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm + +four_bytes_remain_match_nolit_encodeBlockAsm: + TSTW R9, R9 + BEQ match_nolit_emitcopy_end_encodeBlockAsm + MOVD $0, R6 + ADD R9<<2, R6, R9 + SUB $1, R9, R9 + MOVWU R9, R9 + MOVB R9, (R1) + MOVW R5, 1(R1) + ADD $0x05, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm + +two_byte_offset_match_nolit_encodeBlockAsm: + CMPW $0x40, R9 + BLS two_byte_offset_short_match_nolit_encodeBlockAsm + CMPW $0x00000800, R5 + BHS long_offset_short_match_nolit_encodeBlockAsm + MOVD $0x00000001, R6 + ADD $16, R6, R6 + MOVWU R6, R6 + MOVB R5, 1(R1) + MOVWU R5, R7 + LSRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R6, R6 + MOVB R6, (R1) + ADD $0x02, R1, R1 + SUBW $0x08, R9, R9 + + // emitRepeat + SUB $4, R9, R9 + MOVWU R9, R9 + JMP cant_repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy_short_2b + +emit_repeat_again_match_nolit_encodeBlockAsm_emit_copy_short_2b: + MOVWU R9, R6 + SUB $4, R9, R9 + MOVWU R9, R9 + CMPW $0x08, R6 + BLS repeat_two_match_nolit_encodeBlockAsm_emit_copy_short_2b + CMPW $0x0c, R6 + BHS cant_repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy_short_2b + CMPW $0x00000800, R5 + BLO repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy_short_2b + +cant_repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy_short_2b: + CMPW $0x00000104, R9 + BLO repeat_three_match_nolit_encodeBlockAsm_emit_copy_short_2b + CMPW $0x00010100, R9 + BLO repeat_four_match_nolit_encodeBlockAsm_emit_copy_short_2b + CMPW $0x0100ffff, R9 + BLO repeat_five_match_nolit_encodeBlockAsm_emit_copy_short_2b + SUB $16842747, R9, R9 + MOVWU R9, R9 + MOVD $0xfffb001d, R16 + MOVW R16, (R1) + MOVD $0xff, R16 + MOVB R16, 4(R1) + ADD $0x05, R1, R1 + JMP emit_repeat_again_match_nolit_encodeBlockAsm_emit_copy_short_2b + +repeat_five_match_nolit_encodeBlockAsm_emit_copy_short_2b: + SUB $65536, R9, R9 + MOVWU R9, R9 + MOVWU R9, R5 + MOVD $0x001d, R16 + MOVH R16, (R1) + MOVH R9, 2(R1) + ASRW $0x10, R5, R5 + MOVB R5, 4(R1) + ADD $0x05, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm + +repeat_four_match_nolit_encodeBlockAsm_emit_copy_short_2b: + SUB $256, R9, R9 + MOVWU R9, R9 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R9, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm + +repeat_three_match_nolit_encodeBlockAsm_emit_copy_short_2b: + SUB $4, R9, R9 + MOVWU R9, R9 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R9, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm + +repeat_two_match_nolit_encodeBlockAsm_emit_copy_short_2b: + LSLW $0x02, R9, R9 + ORRW $0x01, R9, R9 + MOVH R9, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm + +repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy_short_2b: + MOVD $0, R6 + ADD R9<<2, R6, R9 + ADD $1, R9, R9 + MOVWU R9, R9 + MOVB R5, 1(R1) + ASRW $0x08, R5, R5 + LSLW $0x05, R5, R5 + ORRW R5, R9, R9 + MOVB R9, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm + +long_offset_short_match_nolit_encodeBlockAsm: + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + SUB $60, R9, R9 + MOVWU R9, R9 + ADD $0x03, R1, R1 + + // emitRepeat +emit_repeat_again_match_nolit_encodeBlockAsm_emit_copy_short: + MOVWU R9, R6 + SUB $4, R9, R9 + MOVWU R9, R9 + CMPW $0x08, R6 + BLS repeat_two_match_nolit_encodeBlockAsm_emit_copy_short + CMPW $0x0c, R6 + BHS cant_repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy_short + CMPW $0x00000800, R5 + BLO repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy_short + +cant_repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy_short: + CMPW $0x00000104, R9 + BLO repeat_three_match_nolit_encodeBlockAsm_emit_copy_short + CMPW $0x00010100, R9 + BLO repeat_four_match_nolit_encodeBlockAsm_emit_copy_short + CMPW $0x0100ffff, R9 + BLO repeat_five_match_nolit_encodeBlockAsm_emit_copy_short + SUB $16842747, R9, R9 + MOVWU R9, R9 + MOVD $0xfffb001d, R16 + MOVW R16, (R1) + MOVD $0xff, R16 + MOVB R16, 4(R1) + ADD $0x05, R1, R1 + JMP emit_repeat_again_match_nolit_encodeBlockAsm_emit_copy_short + +repeat_five_match_nolit_encodeBlockAsm_emit_copy_short: + SUB $65536, R9, R9 + MOVWU R9, R9 + MOVWU R9, R5 + MOVD $0x001d, R16 + MOVH R16, (R1) + MOVH R9, 2(R1) + ASRW $0x10, R5, R5 + MOVB R5, 4(R1) + ADD $0x05, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm + +repeat_four_match_nolit_encodeBlockAsm_emit_copy_short: + SUB $256, R9, R9 + MOVWU R9, R9 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R9, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm + +repeat_three_match_nolit_encodeBlockAsm_emit_copy_short: + SUB $4, R9, R9 + MOVWU R9, R9 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R9, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm + +repeat_two_match_nolit_encodeBlockAsm_emit_copy_short: + LSLW $0x02, R9, R9 + ORRW $0x01, R9, R9 + MOVH R9, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm + +repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy_short: + MOVD $0, R6 + ADD R9<<2, R6, R9 + ADD $1, R9, R9 + MOVWU R9, R9 + MOVB R5, 1(R1) + ASRW $0x08, R5, R5 + LSLW $0x05, R5, R5 + ORRW R5, R9, R9 + MOVB R9, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm + +two_byte_offset_short_match_nolit_encodeBlockAsm: + MOVWU R9, R6 + LSLW $0x02, R6, R6 + CMPW $0x0c, R9 + BHS emit_copy_three_match_nolit_encodeBlockAsm + CMPW $0x00000800, R5 + BHS emit_copy_three_match_nolit_encodeBlockAsm + SUB $15, R6, R6 + MOVWU R6, R6 + MOVB R5, 1(R1) + LSRW $0x08, R5, R5 + LSLW $0x05, R5, R5 + ORRW R5, R6, R6 + MOVB R6, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm + +emit_copy_three_match_nolit_encodeBlockAsm: + SUB $2, R6, R6 + MOVWU R6, R6 + MOVB R6, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + +match_nolit_emitcopy_end_encodeBlockAsm: + MOVWU 16(RSP), R16 + CMPW R16, R2 + BHS emit_remainder_encodeBlockAsm + ADD R2, R3, R15 + MOVD -2(R15), R6 + MOVD 8(RSP), R16 + CMP R16, R1 + BLO match_nolit_dst_ok_encodeBlockAsm + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_nolit_dst_ok_encodeBlockAsm: + MOVD $0x0000cf1bbcdcbf9b, R8 + MOVD R6, R7 + LSR $0x10, R6, R6 + MOVD R6, R5 + LSL $0x10, R7, R7 + MUL R8, R7, R7 + LSR $0x32, R7, R7 + LSL $0x10, R5, R5 + MUL R8, R5, R5 + LSR $0x32, R5, R5 + SUB $2, R2, R8 + MOVWU R8, R8 + ADD R5<<2, R0, R9 + MOVWU (R9), R5 + MOVW R8, (R0)(R7<<2) + MOVW R2, (R9) + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ match_nolit_loop_encodeBlockAsm + ADDW $1, R2, R2 + JMP search_loop_encodeBlockAsm + +emit_remainder_encodeBlockAsm: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R16 + SUBW R16, R0, R0 + ADD R0, R1, R0 + ADD $5, R0, R0 + MOVD 8(RSP), R16 + CMP R16, R0 + BLO emit_remainder_ok_encodeBlockAsm + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +emit_remainder_ok_encodeBlockAsm: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R2 + CMPW R0, R2 + BEQ emit_literal_done_emit_remainder_encodeBlockAsm + MOVWU R0, R5 + MOVW R0, 20(RSP) + ADD R2, R3, R0 + SUBW R2, R5, R5 + SUB $1, R5, R2 + MOVWU R2, R2 + CMPW $0x3c, R2 + BLO one_byte_emit_remainder_encodeBlockAsm + CMPW $0x00000100, R2 + BLO two_bytes_emit_remainder_encodeBlockAsm + CMPW $0x00010000, R2 + BLO three_bytes_emit_remainder_encodeBlockAsm + CMPW $0x01000000, R2 + BLO four_bytes_emit_remainder_encodeBlockAsm + MOVD $0xfc, R16 + MOVB R16, (R1) + MOVW R2, 1(R1) + ADD $0x05, R1, R1 + JMP memmove_long_emit_remainder_encodeBlockAsm + +four_bytes_emit_remainder_encodeBlockAsm: + MOVWU R2, R3 + LSRW $0x10, R3, R3 + MOVD $0xf8, R16 + MOVB R16, (R1) + MOVH R2, 1(R1) + MOVB R3, 3(R1) + ADD $0x04, R1, R1 + JMP memmove_long_emit_remainder_encodeBlockAsm + +three_bytes_emit_remainder_encodeBlockAsm: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R2, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_emit_remainder_encodeBlockAsm + +two_bytes_emit_remainder_encodeBlockAsm: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R2, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R2 + BLO memmove_emit_remainder_encodeBlockAsm + JMP memmove_long_emit_remainder_encodeBlockAsm + +one_byte_emit_remainder_encodeBlockAsm: + LSLW $0x02, R2, R16 + BFI $0, R16, $8, R2 + MOVB R2, (R1) + ADD $0x01, R1, R1 + +memmove_emit_remainder_encodeBlockAsm: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveShort + CMP $0x03, R3 + BLO emit_lit_memmove_emit_remainder_encodeBlockAsm_memmove_move_1or2 + BEQ emit_lit_memmove_emit_remainder_encodeBlockAsm_memmove_move_3 + CMP $0x08, R3 + BLO emit_lit_memmove_emit_remainder_encodeBlockAsm_memmove_move_4through7 + CMP $0x10, R3 + BLS emit_lit_memmove_emit_remainder_encodeBlockAsm_memmove_move_8through16 + CMP $0x20, R3 + BLS emit_lit_memmove_emit_remainder_encodeBlockAsm_memmove_move_17through32 + JMP emit_lit_memmove_emit_remainder_encodeBlockAsm_memmove_move_33through64 + +emit_lit_memmove_emit_remainder_encodeBlockAsm_memmove_move_1or2: + MOVBU (R0), R16 + BFI $0, R16, $8, R5 + ADD R3, R0, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R0 + MOVB R5, (R1) + ADD R3, R1, R15 + MOVB R0, -1(R15) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm + +emit_lit_memmove_emit_remainder_encodeBlockAsm_memmove_move_3: + MOVHU (R0), R16 + BFI $0, R16, $16, R5 + MOVBU 2(R0), R16 + BFI $0, R16, $8, R0 + MOVH R5, (R1) + MOVB R0, 2(R1) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm + +emit_lit_memmove_emit_remainder_encodeBlockAsm_memmove_move_4through7: + MOVWU (R0), R5 + ADD R3, R0, R15 + MOVWU -4(R15), R0 + MOVW R5, (R1) + ADD R3, R1, R15 + MOVW R0, -4(R15) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm + +emit_lit_memmove_emit_remainder_encodeBlockAsm_memmove_move_8through16: + MOVD (R0), R5 + ADD R3, R0, R15 + MOVD -8(R15), R0 + MOVD R5, (R1) + ADD R3, R1, R15 + MOVD R0, -8(R15) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm + +emit_lit_memmove_emit_remainder_encodeBlockAsm_memmove_move_17through32: + FMOVQ (R0), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm + +emit_lit_memmove_emit_remainder_encodeBlockAsm_memmove_move_33through64: + FMOVQ (R0), F0 + FMOVQ 16(R0), F1 + ADD R3, R0, R15 + FMOVQ -32(R15), F2 + ADD R3, R0, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R3, R1, R15 + FMOVQ F2, -32(R15) + ADD R3, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_emit_remainder_encodeBlockAsm: + MOVD R2, R1 + JMP emit_literal_done_emit_remainder_encodeBlockAsm + +memmove_long_emit_remainder_encodeBlockAsm: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveLong + MOVD R0, R5 + MOVD R1, R6 + MOVD R3, R7 + +emit_lit_memmove_long_emit_remainder_encodeBlockAsmlarge_big_loop_back: + FMOVQ (R5), F0 + FMOVQ 16(R5), F1 + FMOVQ F0, (R6) + FMOVQ F1, 16(R6) + ADD $0x20, R5, R5 + ADD $0x20, R6, R6 + SUB $0x20, R7, R7 + CMP $0x20, R7 + BHS emit_lit_memmove_long_emit_remainder_encodeBlockAsmlarge_big_loop_back + ADD R3, R0, R15 + FMOVQ -32(R15), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + ADD R3, R1, R15 + FMOVQ F0, -32(R15) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + MOVD R2, R1 + +emit_literal_done_emit_remainder_encodeBlockAsm: + MOVD dst_base+0(FP), R0 + SUB R0, R1, R1 + MOVD R1, ret+56(FP) + RET + +// func encodeBlockAsm4MB(dst []byte, src []byte, tmp *[65536]byte) int +// Requires: BMI, SSE2 +TEXT ·encodeBlockAsm4MB(SB), $24-64 + MOVD tmp+48(FP), R0 + MOVD dst_base+0(FP), R1 + MOVD $0x00000200, R2 + MOVD R0, R3 + VEOR V0.B16, V0.B16, V0.B16 + +zero_loop_encodeBlockAsm4MB: + FMOVQ F0, (R3) + FMOVQ F0, 16(R3) + FMOVQ F0, 32(R3) + FMOVQ F0, 48(R3) + FMOVQ F0, 64(R3) + FMOVQ F0, 80(R3) + FMOVQ F0, 96(R3) + FMOVQ F0, 112(R3) + ADD $0x80, R3, R3 + SUBS $1, R2, R2 + BNE zero_loop_encodeBlockAsm4MB + MOVD $0x00000000, R16 + MOVW R16, 20(RSP) + MOVD src_len+32(FP), R2 + SUB $9, R2, R3 + SUB $8, R2, R5 + MOVW R5, 16(RSP) + LSR $0x05, R2, R2 + SUBW R2, R3, R3 + ADD R3, R1, R3 + MOVD R3, 8(RSP) + MOVD $0x00000001, R2 + MOVW R2, 24(RSP) + MOVD src_base+24(FP), R3 + +search_loop_encodeBlockAsm4MB: + MOVWU R2, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + LSRW $0x06, R5, R5 + ADD R5, R2, R5 + ADD $4, R5, R5 + MOVWU R5, R5 + MOVWU 16(RSP), R16 + CMPW R16, R5 + BHS emit_remainder_encodeBlockAsm4MB + MOVD (R3)(R2), R6 + MOVW R5, 28(RSP) + MOVD $0x0000cf1bbcdcbf9b, R8 + MOVD R6, R9 + MOVD R6, R10 + LSR $0x08, R10, R10 + LSL $0x10, R9, R9 + MUL R8, R9, R9 + LSR $0x32, R9, R9 + LSL $0x10, R10, R10 + MUL R8, R10, R10 + LSR $0x32, R10, R10 + MOVWU (R0)(R9<<2), R5 + MOVWU (R0)(R10<<2), R7 + MOVW R2, (R0)(R9<<2) + ADD $1, R2, R9 + MOVWU R9, R9 + MOVW R9, (R0)(R10<<2) + MOVD R6, R9 + LSR $0x10, R9, R9 + LSL $0x10, R9, R9 + MUL R8, R9, R9 + LSR $0x32, R9, R9 + MOVWU R2, R8 + MOVWU 24(RSP), R16 + SUBW R16, R8, R8 + ADD R8, R3, R15 + MOVWU 1(R15), R10 + MOVD R6, R8 + LSR $0x08, R8, R8 + CMPW R10, R8 + BNE no_repeat_found_encodeBlockAsm4MB + ADD $1, R2, R6 + MOVWU R6, R6 + MOVWU 20(RSP), R7 + MOVWU R6, R5 + MOVWU 24(RSP), R16 + SUBSW R16, R5, R5 + BEQ repeat_extend_back_end_encodeBlockAsm4MB + +repeat_extend_back_loop_encodeBlockAsm4MB: + CMPW R7, R6 + BLS repeat_extend_back_end_encodeBlockAsm4MB + ADD R5, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + ADD R6, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R9 + AND $0xff, R9, R16 + AND $0xff, R8, R15 + CMP R16, R15 + BNE repeat_extend_back_end_encodeBlockAsm4MB + SUB $1, R6, R6 + MOVWU R6, R6 + SUBSW $1, R5, R5 + BNE repeat_extend_back_loop_encodeBlockAsm4MB + +repeat_extend_back_end_encodeBlockAsm4MB: + MOVWU R6, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + ADD R5, R1, R5 + ADD $4, R5, R5 + MOVD 8(RSP), R16 + CMP R16, R5 + BLO repeat_dst_size_check_encodeBlockAsm4MB + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +repeat_dst_size_check_encodeBlockAsm4MB: + MOVWU 20(RSP), R5 + CMPW R6, R5 + BEQ emit_literal_done_repeat_emit_encodeBlockAsm4MB + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R5, R3, R9 + SUBW R5, R8, R8 + SUB $1, R8, R5 + MOVWU R5, R5 + CMPW $0x3c, R5 + BLO one_byte_repeat_emit_encodeBlockAsm4MB + CMPW $0x00000100, R5 + BLO two_bytes_repeat_emit_encodeBlockAsm4MB + CMPW $0x00010000, R5 + BLO three_bytes_repeat_emit_encodeBlockAsm4MB + MOVWU R5, R10 + LSRW $0x10, R10, R10 + MOVD $0xf8, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + MOVB R10, 3(R1) + ADD $0x04, R1, R1 + JMP memmove_long_repeat_emit_encodeBlockAsm4MB + +three_bytes_repeat_emit_encodeBlockAsm4MB: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_repeat_emit_encodeBlockAsm4MB + +two_bytes_repeat_emit_encodeBlockAsm4MB: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R5, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R5 + BLO memmove_repeat_emit_encodeBlockAsm4MB + JMP memmove_long_repeat_emit_encodeBlockAsm4MB + +one_byte_repeat_emit_encodeBlockAsm4MB: + LSLW $0x02, R5, R16 + BFI $0, R16, $8, R5 + MOVB R5, (R1) + ADD $0x01, R1, R1 + +memmove_repeat_emit_encodeBlockAsm4MB: + ADD R8, R1, R5 + + // genMemMoveShort + CMP $0x08, R8 + BLS emit_lit_memmove_repeat_emit_encodeBlockAsm4MB_memmove_move_8 + CMP $0x10, R8 + BLS emit_lit_memmove_repeat_emit_encodeBlockAsm4MB_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_repeat_emit_encodeBlockAsm4MB_memmove_move_17through32 + JMP emit_lit_memmove_repeat_emit_encodeBlockAsm4MB_memmove_move_33through64 + +emit_lit_memmove_repeat_emit_encodeBlockAsm4MB_memmove_move_8: + MOVD (R9), R10 + MOVD R10, (R1) + JMP memmove_end_copy_repeat_emit_encodeBlockAsm4MB + +emit_lit_memmove_repeat_emit_encodeBlockAsm4MB_memmove_move_8through16: + MOVD (R9), R10 + ADD R8, R9, R15 + MOVD -8(R15), R9 + MOVD R10, (R1) + ADD R8, R1, R15 + MOVD R9, -8(R15) + JMP memmove_end_copy_repeat_emit_encodeBlockAsm4MB + +emit_lit_memmove_repeat_emit_encodeBlockAsm4MB_memmove_move_17through32: + FMOVQ (R9), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_repeat_emit_encodeBlockAsm4MB + +emit_lit_memmove_repeat_emit_encodeBlockAsm4MB_memmove_move_33through64: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + ADD R8, R9, R15 + FMOVQ -32(R15), F2 + ADD R8, R9, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_repeat_emit_encodeBlockAsm4MB: + MOVD R5, R1 + JMP emit_literal_done_repeat_emit_encodeBlockAsm4MB + +memmove_long_repeat_emit_encodeBlockAsm4MB: + ADD R8, R1, R5 + + // genMemMoveLong + MOVD R9, R10 + MOVD R1, R11 + MOVD R8, R12 + +emit_lit_memmove_long_repeat_emit_encodeBlockAsm4MBlarge_big_loop_back: + FMOVQ (R10), F0 + FMOVQ 16(R10), F1 + FMOVQ F0, (R11) + FMOVQ F1, 16(R11) + ADD $0x20, R10, R10 + ADD $0x20, R11, R11 + SUB $0x20, R12, R12 + CMP $0x20, R12 + BHS emit_lit_memmove_long_repeat_emit_encodeBlockAsm4MBlarge_big_loop_back + ADD R8, R9, R15 + FMOVQ -32(R15), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R5, R1 + +emit_literal_done_repeat_emit_encodeBlockAsm4MB: + ADDW $0x05, R2, R2 + MOVWU R2, R5 + MOVWU 24(RSP), R16 + SUBW R16, R5, R5 + MOVD src_len+32(FP), R8 + SUBW R2, R8, R8 + ADD R2, R3, R9 + ADD R5, R3, R5 + + // matchLen + MOVD $0, R11 + +matchlen_loopback_16_repeat_extend_encodeBlockAsm4MB: + CMPW $0x10, R8 + BLO matchlen_match8_repeat_extend_encodeBlockAsm4MB + MOVD (R9)(R11), R10 + ADD R11, R9, R15 + MOVD 8(R15), R12 + MOVD (R5)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_repeat_extend_encodeBlockAsm4MB + ADD R11, R5, R15 + MOVD 8(R15), R16 + EOR R16, R12, R12 + TST R12, R12 + BNE matchlen_bsf_16repeat_extend_encodeBlockAsm4MB + SUB $16, R8, R8 + MOVWU R8, R8 + ADD $16, R11, R11 + MOVWU R11, R11 + JMP matchlen_loopback_16_repeat_extend_encodeBlockAsm4MB + +matchlen_bsf_16repeat_extend_encodeBlockAsm4MB: + RBIT R12, R12 + CLZ R12, R12 + ASR $0x03, R12, R12 + ADD R12, R11, R11 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP repeat_extend_forward_end_encodeBlockAsm4MB + +matchlen_match8_repeat_extend_encodeBlockAsm4MB: + CMPW $0x08, R8 + BLO matchlen_match4_repeat_extend_encodeBlockAsm4MB + MOVD (R9)(R11), R10 + MOVD (R5)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_repeat_extend_encodeBlockAsm4MB + SUB $8, R8, R8 + MOVWU R8, R8 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP matchlen_match4_repeat_extend_encodeBlockAsm4MB + +matchlen_bsf_8_repeat_extend_encodeBlockAsm4MB: + RBIT R10, R10 + CLZ R10, R10 + ASR $0x03, R10, R10 + ADD R10, R11, R11 + MOVWU R11, R11 + JMP repeat_extend_forward_end_encodeBlockAsm4MB + +matchlen_match4_repeat_extend_encodeBlockAsm4MB: + CMPW $0x04, R8 + BLO matchlen_match2_repeat_extend_encodeBlockAsm4MB + MOVWU (R9)(R11), R10 + MOVWU (R5)(R11), R16 + CMPW R10, R16 + BNE matchlen_match2_repeat_extend_encodeBlockAsm4MB + SUB $4, R8, R8 + MOVWU R8, R8 + ADD $4, R11, R11 + MOVWU R11, R11 + +matchlen_match2_repeat_extend_encodeBlockAsm4MB: + CMPW $0x01, R8 + BEQ matchlen_match1_repeat_extend_encodeBlockAsm4MB + BLO repeat_extend_forward_end_encodeBlockAsm4MB + MOVHU (R9)(R11), R16 + BFI $0, R16, $16, R10 + ADD R11, R5, R15 + MOVHU (R15), R15 + AND $0xffff, R10, R16 + CMP R16, R15 + BNE matchlen_match1_repeat_extend_encodeBlockAsm4MB + ADD $2, R11, R11 + MOVWU R11, R11 + SUBSW $0x02, R8, R8 + BEQ repeat_extend_forward_end_encodeBlockAsm4MB + +matchlen_match1_repeat_extend_encodeBlockAsm4MB: + MOVBU (R9)(R11), R16 + BFI $0, R16, $8, R10 + ADD R11, R5, R15 + MOVBU (R15), R15 + AND $0xff, R10, R16 + CMP R16, R15 + BNE repeat_extend_forward_end_encodeBlockAsm4MB + ADD $1, R11, R11 + MOVWU R11, R11 + +repeat_extend_forward_end_encodeBlockAsm4MB: + ADDW R11, R2, R2 + MOVWU R2, R5 + SUBW R6, R5, R5 + MOVWU 24(RSP), R6 + TSTW R7, R7 + BEQ repeat_as_copy_encodeBlockAsm4MB + + // emitRepeat + MOVWU R5, R7 + SUB $4, R5, R5 + MOVWU R5, R5 + CMPW $0x08, R7 + BLS repeat_two_match_repeat_encodeBlockAsm4MB + CMPW $0x0c, R7 + BHS cant_repeat_two_offset_match_repeat_encodeBlockAsm4MB + CMPW $0x00000800, R6 + BLO repeat_two_offset_match_repeat_encodeBlockAsm4MB + +cant_repeat_two_offset_match_repeat_encodeBlockAsm4MB: + CMPW $0x00000104, R5 + BLO repeat_three_match_repeat_encodeBlockAsm4MB + CMPW $0x00010100, R5 + BLO repeat_four_match_repeat_encodeBlockAsm4MB + SUB $65536, R5, R5 + MOVWU R5, R5 + MOVWU R5, R6 + MOVD $0x001d, R16 + MOVH R16, (R1) + MOVH R5, 2(R1) + ASRW $0x10, R6, R6 + MOVB R6, 4(R1) + ADD $0x05, R1, R1 + JMP repeat_end_emit_encodeBlockAsm4MB + +repeat_four_match_repeat_encodeBlockAsm4MB: + SUB $256, R5, R5 + MOVWU R5, R5 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R5, 2(R1) + ADD $0x04, R1, R1 + JMP repeat_end_emit_encodeBlockAsm4MB + +repeat_three_match_repeat_encodeBlockAsm4MB: + SUB $4, R5, R5 + MOVWU R5, R5 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R5, 2(R1) + ADD $0x03, R1, R1 + JMP repeat_end_emit_encodeBlockAsm4MB + +repeat_two_match_repeat_encodeBlockAsm4MB: + LSLW $0x02, R5, R5 + ORRW $0x01, R5, R5 + MOVH R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm4MB + +repeat_two_offset_match_repeat_encodeBlockAsm4MB: + MOVD $0, R7 + ADD R5<<2, R7, R5 + ADD $1, R5, R5 + MOVWU R5, R5 + MOVB R6, 1(R1) + ASRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm4MB + +repeat_as_copy_encodeBlockAsm4MB: + // emitCopy + CMPW $0x00010000, R6 + BLO two_byte_offset_repeat_as_copy_encodeBlockAsm4MB + CMPW $0x40, R5 + BLS four_bytes_remain_repeat_as_copy_encodeBlockAsm4MB + MOVD $0xff, R16 + MOVB R16, (R1) + MOVW R6, 1(R1) + SUB $64, R5, R5 + MOVWU R5, R5 + ADD $0x05, R1, R1 + CMPW $0x04, R5 + BLO four_bytes_remain_repeat_as_copy_encodeBlockAsm4MB + + // emitRepeat + MOVWU R5, R7 + SUB $4, R5, R5 + MOVWU R5, R5 + CMPW $0x08, R7 + BLS repeat_two_repeat_as_copy_encodeBlockAsm4MB_emit_copy + CMPW $0x0c, R7 + BHS cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy + CMPW $0x00000800, R6 + BLO repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy + +cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy: + CMPW $0x00000104, R5 + BLO repeat_three_repeat_as_copy_encodeBlockAsm4MB_emit_copy + CMPW $0x00010100, R5 + BLO repeat_four_repeat_as_copy_encodeBlockAsm4MB_emit_copy + SUB $65536, R5, R5 + MOVWU R5, R5 + MOVWU R5, R6 + MOVD $0x001d, R16 + MOVH R16, (R1) + MOVH R5, 2(R1) + ASRW $0x10, R6, R6 + MOVB R6, 4(R1) + ADD $0x05, R1, R1 + JMP repeat_end_emit_encodeBlockAsm4MB + +repeat_four_repeat_as_copy_encodeBlockAsm4MB_emit_copy: + SUB $256, R5, R5 + MOVWU R5, R5 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R5, 2(R1) + ADD $0x04, R1, R1 + JMP repeat_end_emit_encodeBlockAsm4MB + +repeat_three_repeat_as_copy_encodeBlockAsm4MB_emit_copy: + SUB $4, R5, R5 + MOVWU R5, R5 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R5, 2(R1) + ADD $0x03, R1, R1 + JMP repeat_end_emit_encodeBlockAsm4MB + +repeat_two_repeat_as_copy_encodeBlockAsm4MB_emit_copy: + LSLW $0x02, R5, R5 + ORRW $0x01, R5, R5 + MOVH R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm4MB + +repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy: + MOVD $0, R7 + ADD R5<<2, R7, R5 + ADD $1, R5, R5 + MOVWU R5, R5 + MOVB R6, 1(R1) + ASRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm4MB + +four_bytes_remain_repeat_as_copy_encodeBlockAsm4MB: + TSTW R5, R5 + BEQ repeat_end_emit_encodeBlockAsm4MB + MOVD $0, R7 + ADD R5<<2, R7, R5 + SUB $1, R5, R5 + MOVWU R5, R5 + MOVB R5, (R1) + MOVW R6, 1(R1) + ADD $0x05, R1, R1 + JMP repeat_end_emit_encodeBlockAsm4MB + +two_byte_offset_repeat_as_copy_encodeBlockAsm4MB: + CMPW $0x40, R5 + BLS two_byte_offset_short_repeat_as_copy_encodeBlockAsm4MB + CMPW $0x00000800, R6 + BHS long_offset_short_repeat_as_copy_encodeBlockAsm4MB + MOVD $0x00000001, R7 + ADD $16, R7, R7 + MOVWU R7, R7 + MOVB R6, 1(R1) + LSRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R7, R7 + MOVB R7, (R1) + ADD $0x02, R1, R1 + SUBW $0x08, R5, R5 + + // emitRepeat + SUB $4, R5, R5 + MOVWU R5, R5 + JMP cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b + MOVWU R5, R7 + SUB $4, R5, R5 + MOVWU R5, R5 + CMPW $0x08, R7 + BLS repeat_two_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b + CMPW $0x0c, R7 + BHS cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b + CMPW $0x00000800, R6 + BLO repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b + +cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b: + CMPW $0x00000104, R5 + BLO repeat_three_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b + CMPW $0x00010100, R5 + BLO repeat_four_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b + SUB $65536, R5, R5 + MOVWU R5, R5 + MOVWU R5, R6 + MOVD $0x001d, R16 + MOVH R16, (R1) + MOVH R5, 2(R1) + ASRW $0x10, R6, R6 + MOVB R6, 4(R1) + ADD $0x05, R1, R1 + JMP repeat_end_emit_encodeBlockAsm4MB + +repeat_four_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b: + SUB $256, R5, R5 + MOVWU R5, R5 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R5, 2(R1) + ADD $0x04, R1, R1 + JMP repeat_end_emit_encodeBlockAsm4MB + +repeat_three_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b: + SUB $4, R5, R5 + MOVWU R5, R5 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R5, 2(R1) + ADD $0x03, R1, R1 + JMP repeat_end_emit_encodeBlockAsm4MB + +repeat_two_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b: + LSLW $0x02, R5, R5 + ORRW $0x01, R5, R5 + MOVH R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm4MB + +repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b: + MOVD $0, R7 + ADD R5<<2, R7, R5 + ADD $1, R5, R5 + MOVWU R5, R5 + MOVB R6, 1(R1) + ASRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm4MB + +long_offset_short_repeat_as_copy_encodeBlockAsm4MB: + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R6, 1(R1) + SUB $60, R5, R5 + MOVWU R5, R5 + ADD $0x03, R1, R1 + + // emitRepeat + MOVWU R5, R7 + SUB $4, R5, R5 + MOVWU R5, R5 + CMPW $0x08, R7 + BLS repeat_two_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short + CMPW $0x0c, R7 + BHS cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short + CMPW $0x00000800, R6 + BLO repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short + +cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short: + CMPW $0x00000104, R5 + BLO repeat_three_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short + CMPW $0x00010100, R5 + BLO repeat_four_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short + SUB $65536, R5, R5 + MOVWU R5, R5 + MOVWU R5, R6 + MOVD $0x001d, R16 + MOVH R16, (R1) + MOVH R5, 2(R1) + ASRW $0x10, R6, R6 + MOVB R6, 4(R1) + ADD $0x05, R1, R1 + JMP repeat_end_emit_encodeBlockAsm4MB + +repeat_four_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short: + SUB $256, R5, R5 + MOVWU R5, R5 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R5, 2(R1) + ADD $0x04, R1, R1 + JMP repeat_end_emit_encodeBlockAsm4MB + +repeat_three_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short: + SUB $4, R5, R5 + MOVWU R5, R5 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R5, 2(R1) + ADD $0x03, R1, R1 + JMP repeat_end_emit_encodeBlockAsm4MB + +repeat_two_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short: + LSLW $0x02, R5, R5 + ORRW $0x01, R5, R5 + MOVH R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm4MB + +repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short: + MOVD $0, R7 + ADD R5<<2, R7, R5 + ADD $1, R5, R5 + MOVWU R5, R5 + MOVB R6, 1(R1) + ASRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm4MB + +two_byte_offset_short_repeat_as_copy_encodeBlockAsm4MB: + MOVWU R5, R7 + LSLW $0x02, R7, R7 + CMPW $0x0c, R5 + BHS emit_copy_three_repeat_as_copy_encodeBlockAsm4MB + CMPW $0x00000800, R6 + BHS emit_copy_three_repeat_as_copy_encodeBlockAsm4MB + SUB $15, R7, R7 + MOVWU R7, R7 + MOVB R6, 1(R1) + LSRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R7, R7 + MOVB R7, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm4MB + +emit_copy_three_repeat_as_copy_encodeBlockAsm4MB: + SUB $2, R7, R7 + MOVWU R7, R7 + MOVB R7, (R1) + MOVH R6, 1(R1) + ADD $0x03, R1, R1 + +repeat_end_emit_encodeBlockAsm4MB: + MOVW R2, 20(RSP) + JMP search_loop_encodeBlockAsm4MB + +no_repeat_found_encodeBlockAsm4MB: + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate_match_encodeBlockAsm4MB + LSR $0x08, R6, R6 + MOVWU (R0)(R9<<2), R5 + ADD $2, R2, R8 + MOVWU R8, R8 + MOVWU (R3)(R7), R16 + CMPW R6, R16 + BEQ candidate2_match_encodeBlockAsm4MB + MOVW R8, (R0)(R9<<2) + LSR $0x08, R6, R6 + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate3_match_encodeBlockAsm4MB + MOVWU 28(RSP), R2 + JMP search_loop_encodeBlockAsm4MB + +candidate3_match_encodeBlockAsm4MB: + ADDW $0x02, R2, R2 + JMP candidate_match_encodeBlockAsm4MB + +candidate2_match_encodeBlockAsm4MB: + MOVW R8, (R0)(R9<<2) + ADDW $1, R2, R2 + MOVWU R7, R5 + +candidate_match_encodeBlockAsm4MB: + MOVWU 20(RSP), R6 + TSTW R5, R5 + BEQ match_extend_back_end_encodeBlockAsm4MB + +match_extend_back_loop_encodeBlockAsm4MB: + CMPW R6, R2 + BLS match_extend_back_end_encodeBlockAsm4MB + ADD R5, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R7 + ADD R2, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + AND $0xff, R8, R16 + AND $0xff, R7, R15 + CMP R16, R15 + BNE match_extend_back_end_encodeBlockAsm4MB + SUB $1, R2, R2 + MOVWU R2, R2 + SUBSW $1, R5, R5 + BEQ match_extend_back_end_encodeBlockAsm4MB + JMP match_extend_back_loop_encodeBlockAsm4MB + +match_extend_back_end_encodeBlockAsm4MB: + MOVWU R2, R6 + MOVWU 20(RSP), R16 + SUBW R16, R6, R6 + ADD R6, R1, R6 + ADD $4, R6, R6 + MOVD 8(RSP), R16 + CMP R16, R6 + BLO match_dst_size_check_encodeBlockAsm4MB + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_dst_size_check_encodeBlockAsm4MB: + MOVWU R2, R6 + MOVWU 20(RSP), R7 + CMPW R6, R7 + BEQ emit_literal_done_match_emit_encodeBlockAsm4MB + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R7, R3, R6 + SUBW R7, R8, R8 + SUB $1, R8, R7 + MOVWU R7, R7 + CMPW $0x3c, R7 + BLO one_byte_match_emit_encodeBlockAsm4MB + CMPW $0x00000100, R7 + BLO two_bytes_match_emit_encodeBlockAsm4MB + CMPW $0x00010000, R7 + BLO three_bytes_match_emit_encodeBlockAsm4MB + MOVWU R7, R9 + LSRW $0x10, R9, R9 + MOVD $0xf8, R16 + MOVB R16, (R1) + MOVH R7, 1(R1) + MOVB R9, 3(R1) + ADD $0x04, R1, R1 + JMP memmove_long_match_emit_encodeBlockAsm4MB + +three_bytes_match_emit_encodeBlockAsm4MB: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R7, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_match_emit_encodeBlockAsm4MB + +two_bytes_match_emit_encodeBlockAsm4MB: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R7, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R7 + BLO memmove_match_emit_encodeBlockAsm4MB + JMP memmove_long_match_emit_encodeBlockAsm4MB + +one_byte_match_emit_encodeBlockAsm4MB: + LSLW $0x02, R7, R16 + BFI $0, R16, $8, R7 + MOVB R7, (R1) + ADD $0x01, R1, R1 + +memmove_match_emit_encodeBlockAsm4MB: + ADD R8, R1, R7 + + // genMemMoveShort + CMP $0x08, R8 + BLS emit_lit_memmove_match_emit_encodeBlockAsm4MB_memmove_move_8 + CMP $0x10, R8 + BLS emit_lit_memmove_match_emit_encodeBlockAsm4MB_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_match_emit_encodeBlockAsm4MB_memmove_move_17through32 + JMP emit_lit_memmove_match_emit_encodeBlockAsm4MB_memmove_move_33through64 + +emit_lit_memmove_match_emit_encodeBlockAsm4MB_memmove_move_8: + MOVD (R6), R9 + MOVD R9, (R1) + JMP memmove_end_copy_match_emit_encodeBlockAsm4MB + +emit_lit_memmove_match_emit_encodeBlockAsm4MB_memmove_move_8through16: + MOVD (R6), R9 + ADD R8, R6, R15 + MOVD -8(R15), R6 + MOVD R9, (R1) + ADD R8, R1, R15 + MOVD R6, -8(R15) + JMP memmove_end_copy_match_emit_encodeBlockAsm4MB + +emit_lit_memmove_match_emit_encodeBlockAsm4MB_memmove_move_17through32: + FMOVQ (R6), F0 + ADD R8, R6, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_match_emit_encodeBlockAsm4MB + +emit_lit_memmove_match_emit_encodeBlockAsm4MB_memmove_move_33through64: + FMOVQ (R6), F0 + FMOVQ 16(R6), F1 + ADD R8, R6, R15 + FMOVQ -32(R15), F2 + ADD R8, R6, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_match_emit_encodeBlockAsm4MB: + MOVD R7, R1 + JMP emit_literal_done_match_emit_encodeBlockAsm4MB + +memmove_long_match_emit_encodeBlockAsm4MB: + ADD R8, R1, R7 + + // genMemMoveLong + MOVD R6, R9 + MOVD R1, R10 + MOVD R8, R11 + +emit_lit_memmove_long_match_emit_encodeBlockAsm4MBlarge_big_loop_back: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + FMOVQ F0, (R10) + FMOVQ F1, 16(R10) + ADD $0x20, R9, R9 + ADD $0x20, R10, R10 + SUB $0x20, R11, R11 + CMP $0x20, R11 + BHS emit_lit_memmove_long_match_emit_encodeBlockAsm4MBlarge_big_loop_back + ADD R8, R6, R15 + FMOVQ -32(R15), F0 + ADD R8, R6, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R7, R1 + +emit_literal_done_match_emit_encodeBlockAsm4MB: +match_nolit_loop_encodeBlockAsm4MB: + MOVWU R2, R6 + SUBW R5, R6, R6 + MOVW R6, 24(RSP) + ADDW $0x04, R2, R2 + ADDW $0x04, R5, R5 + MOVD src_len+32(FP), R6 + SUBW R2, R6, R6 + ADD R2, R3, R7 + ADD R5, R3, R5 + + // matchLen + MOVD $0, R9 + +matchlen_loopback_16_match_nolit_encodeBlockAsm4MB: + CMPW $0x10, R6 + BLO matchlen_match8_match_nolit_encodeBlockAsm4MB + MOVD (R7)(R9), R8 + ADD R9, R7, R15 + MOVD 8(R15), R10 + MOVD (R5)(R9), R16 + EOR R16, R8, R8 + TST R8, R8 + BNE matchlen_bsf_8_match_nolit_encodeBlockAsm4MB + ADD R9, R5, R15 + MOVD 8(R15), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_16match_nolit_encodeBlockAsm4MB + SUB $16, R6, R6 + MOVWU R6, R6 + ADD $16, R9, R9 + MOVWU R9, R9 + JMP matchlen_loopback_16_match_nolit_encodeBlockAsm4MB + +matchlen_bsf_16match_nolit_encodeBlockAsm4MB: + RBIT R10, R10 + CLZ R10, R10 + ASR $0x03, R10, R10 + ADD R10, R9, R9 + ADD $8, R9, R9 + MOVWU R9, R9 + JMP match_nolit_end_encodeBlockAsm4MB + +matchlen_match8_match_nolit_encodeBlockAsm4MB: + CMPW $0x08, R6 + BLO matchlen_match4_match_nolit_encodeBlockAsm4MB + MOVD (R7)(R9), R8 + MOVD (R5)(R9), R16 + EOR R16, R8, R8 + TST R8, R8 + BNE matchlen_bsf_8_match_nolit_encodeBlockAsm4MB + SUB $8, R6, R6 + MOVWU R6, R6 + ADD $8, R9, R9 + MOVWU R9, R9 + JMP matchlen_match4_match_nolit_encodeBlockAsm4MB + +matchlen_bsf_8_match_nolit_encodeBlockAsm4MB: + RBIT R8, R8 + CLZ R8, R8 + ASR $0x03, R8, R8 + ADD R8, R9, R9 + MOVWU R9, R9 + JMP match_nolit_end_encodeBlockAsm4MB + +matchlen_match4_match_nolit_encodeBlockAsm4MB: + CMPW $0x04, R6 + BLO matchlen_match2_match_nolit_encodeBlockAsm4MB + MOVWU (R7)(R9), R8 + MOVWU (R5)(R9), R16 + CMPW R8, R16 + BNE matchlen_match2_match_nolit_encodeBlockAsm4MB + SUB $4, R6, R6 + MOVWU R6, R6 + ADD $4, R9, R9 + MOVWU R9, R9 + +matchlen_match2_match_nolit_encodeBlockAsm4MB: + CMPW $0x01, R6 + BEQ matchlen_match1_match_nolit_encodeBlockAsm4MB + BLO match_nolit_end_encodeBlockAsm4MB + MOVHU (R7)(R9), R16 + BFI $0, R16, $16, R8 + ADD R9, R5, R15 + MOVHU (R15), R15 + AND $0xffff, R8, R16 + CMP R16, R15 + BNE matchlen_match1_match_nolit_encodeBlockAsm4MB + ADD $2, R9, R9 + MOVWU R9, R9 + SUBSW $0x02, R6, R6 + BEQ match_nolit_end_encodeBlockAsm4MB + +matchlen_match1_match_nolit_encodeBlockAsm4MB: + MOVBU (R7)(R9), R16 + BFI $0, R16, $8, R8 + ADD R9, R5, R15 + MOVBU (R15), R15 + AND $0xff, R8, R16 + CMP R16, R15 + BNE match_nolit_end_encodeBlockAsm4MB + ADD $1, R9, R9 + MOVWU R9, R9 + +match_nolit_end_encodeBlockAsm4MB: + ADDW R9, R2, R2 + MOVWU 24(RSP), R5 + ADDW $0x04, R9, R9 + MOVW R2, 20(RSP) + + // emitCopy + CMPW $0x00010000, R5 + BLO two_byte_offset_match_nolit_encodeBlockAsm4MB + CMPW $0x40, R9 + BLS four_bytes_remain_match_nolit_encodeBlockAsm4MB + MOVD $0xff, R16 + MOVB R16, (R1) + MOVW R5, 1(R1) + SUB $64, R9, R9 + MOVWU R9, R9 + ADD $0x05, R1, R1 + CMPW $0x04, R9 + BLO four_bytes_remain_match_nolit_encodeBlockAsm4MB + + // emitRepeat + MOVWU R9, R6 + SUB $4, R9, R9 + MOVWU R9, R9 + CMPW $0x08, R6 + BLS repeat_two_match_nolit_encodeBlockAsm4MB_emit_copy + CMPW $0x0c, R6 + BHS cant_repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy + CMPW $0x00000800, R5 + BLO repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy + +cant_repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy: + CMPW $0x00000104, R9 + BLO repeat_three_match_nolit_encodeBlockAsm4MB_emit_copy + CMPW $0x00010100, R9 + BLO repeat_four_match_nolit_encodeBlockAsm4MB_emit_copy + SUB $65536, R9, R9 + MOVWU R9, R9 + MOVWU R9, R5 + MOVD $0x001d, R16 + MOVH R16, (R1) + MOVH R9, 2(R1) + ASRW $0x10, R5, R5 + MOVB R5, 4(R1) + ADD $0x05, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm4MB + +repeat_four_match_nolit_encodeBlockAsm4MB_emit_copy: + SUB $256, R9, R9 + MOVWU R9, R9 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R9, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm4MB + +repeat_three_match_nolit_encodeBlockAsm4MB_emit_copy: + SUB $4, R9, R9 + MOVWU R9, R9 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R9, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm4MB + +repeat_two_match_nolit_encodeBlockAsm4MB_emit_copy: + LSLW $0x02, R9, R9 + ORRW $0x01, R9, R9 + MOVH R9, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm4MB + +repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy: + MOVD $0, R6 + ADD R9<<2, R6, R9 + ADD $1, R9, R9 + MOVWU R9, R9 + MOVB R5, 1(R1) + ASRW $0x08, R5, R5 + LSLW $0x05, R5, R5 + ORRW R5, R9, R9 + MOVB R9, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm4MB + +four_bytes_remain_match_nolit_encodeBlockAsm4MB: + TSTW R9, R9 + BEQ match_nolit_emitcopy_end_encodeBlockAsm4MB + MOVD $0, R6 + ADD R9<<2, R6, R9 + SUB $1, R9, R9 + MOVWU R9, R9 + MOVB R9, (R1) + MOVW R5, 1(R1) + ADD $0x05, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm4MB + +two_byte_offset_match_nolit_encodeBlockAsm4MB: + CMPW $0x40, R9 + BLS two_byte_offset_short_match_nolit_encodeBlockAsm4MB + CMPW $0x00000800, R5 + BHS long_offset_short_match_nolit_encodeBlockAsm4MB + MOVD $0x00000001, R6 + ADD $16, R6, R6 + MOVWU R6, R6 + MOVB R5, 1(R1) + LSRW $0x08, R5, R5 + LSLW $0x05, R5, R5 + ORRW R5, R6, R6 + MOVB R6, (R1) + ADD $0x02, R1, R1 + SUBW $0x08, R9, R9 + + // emitRepeat + SUB $4, R9, R9 + MOVWU R9, R9 + JMP cant_repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b + MOVWU R9, R6 + SUB $4, R9, R9 + MOVWU R9, R9 + CMPW $0x08, R6 + BLS repeat_two_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b + CMPW $0x0c, R6 + BHS cant_repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b + CMPW $0x00000800, R5 + BLO repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b + +cant_repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b: + CMPW $0x00000104, R9 + BLO repeat_three_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b + CMPW $0x00010100, R9 + BLO repeat_four_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b + SUB $65536, R9, R9 + MOVWU R9, R9 + MOVWU R9, R5 + MOVD $0x001d, R16 + MOVH R16, (R1) + MOVH R9, 2(R1) + ASRW $0x10, R5, R5 + MOVB R5, 4(R1) + ADD $0x05, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm4MB + +repeat_four_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b: + SUB $256, R9, R9 + MOVWU R9, R9 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R9, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm4MB + +repeat_three_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b: + SUB $4, R9, R9 + MOVWU R9, R9 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R9, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm4MB + +repeat_two_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b: + LSLW $0x02, R9, R9 + ORRW $0x01, R9, R9 + MOVH R9, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm4MB + +repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b: + MOVD $0, R6 + ADD R9<<2, R6, R9 + ADD $1, R9, R9 + MOVWU R9, R9 + MOVB R5, 1(R1) + ASRW $0x08, R5, R5 + LSLW $0x05, R5, R5 + ORRW R5, R9, R9 + MOVB R9, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm4MB + +long_offset_short_match_nolit_encodeBlockAsm4MB: + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + SUB $60, R9, R9 + MOVWU R9, R9 + ADD $0x03, R1, R1 + + // emitRepeat + MOVWU R9, R6 + SUB $4, R9, R9 + MOVWU R9, R9 + CMPW $0x08, R6 + BLS repeat_two_match_nolit_encodeBlockAsm4MB_emit_copy_short + CMPW $0x0c, R6 + BHS cant_repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short + CMPW $0x00000800, R5 + BLO repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short + +cant_repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short: + CMPW $0x00000104, R9 + BLO repeat_three_match_nolit_encodeBlockAsm4MB_emit_copy_short + CMPW $0x00010100, R9 + BLO repeat_four_match_nolit_encodeBlockAsm4MB_emit_copy_short + SUB $65536, R9, R9 + MOVWU R9, R9 + MOVWU R9, R5 + MOVD $0x001d, R16 + MOVH R16, (R1) + MOVH R9, 2(R1) + ASRW $0x10, R5, R5 + MOVB R5, 4(R1) + ADD $0x05, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm4MB + +repeat_four_match_nolit_encodeBlockAsm4MB_emit_copy_short: + SUB $256, R9, R9 + MOVWU R9, R9 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R9, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm4MB + +repeat_three_match_nolit_encodeBlockAsm4MB_emit_copy_short: + SUB $4, R9, R9 + MOVWU R9, R9 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R9, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm4MB + +repeat_two_match_nolit_encodeBlockAsm4MB_emit_copy_short: + LSLW $0x02, R9, R9 + ORRW $0x01, R9, R9 + MOVH R9, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm4MB + +repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short: + MOVD $0, R6 + ADD R9<<2, R6, R9 + ADD $1, R9, R9 + MOVWU R9, R9 + MOVB R5, 1(R1) + ASRW $0x08, R5, R5 + LSLW $0x05, R5, R5 + ORRW R5, R9, R9 + MOVB R9, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm4MB + +two_byte_offset_short_match_nolit_encodeBlockAsm4MB: + MOVWU R9, R6 + LSLW $0x02, R6, R6 + CMPW $0x0c, R9 + BHS emit_copy_three_match_nolit_encodeBlockAsm4MB + CMPW $0x00000800, R5 + BHS emit_copy_three_match_nolit_encodeBlockAsm4MB + SUB $15, R6, R6 + MOVWU R6, R6 + MOVB R5, 1(R1) + LSRW $0x08, R5, R5 + LSLW $0x05, R5, R5 + ORRW R5, R6, R6 + MOVB R6, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm4MB + +emit_copy_three_match_nolit_encodeBlockAsm4MB: + SUB $2, R6, R6 + MOVWU R6, R6 + MOVB R6, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + +match_nolit_emitcopy_end_encodeBlockAsm4MB: + MOVWU 16(RSP), R16 + CMPW R16, R2 + BHS emit_remainder_encodeBlockAsm4MB + ADD R2, R3, R15 + MOVD -2(R15), R6 + MOVD 8(RSP), R16 + CMP R16, R1 + BLO match_nolit_dst_ok_encodeBlockAsm4MB + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_nolit_dst_ok_encodeBlockAsm4MB: + MOVD $0x0000cf1bbcdcbf9b, R8 + MOVD R6, R7 + LSR $0x10, R6, R6 + MOVD R6, R5 + LSL $0x10, R7, R7 + MUL R8, R7, R7 + LSR $0x32, R7, R7 + LSL $0x10, R5, R5 + MUL R8, R5, R5 + LSR $0x32, R5, R5 + SUB $2, R2, R8 + MOVWU R8, R8 + ADD R5<<2, R0, R9 + MOVWU (R9), R5 + MOVW R8, (R0)(R7<<2) + MOVW R2, (R9) + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ match_nolit_loop_encodeBlockAsm4MB + ADDW $1, R2, R2 + JMP search_loop_encodeBlockAsm4MB + +emit_remainder_encodeBlockAsm4MB: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R16 + SUBW R16, R0, R0 + ADD R0, R1, R0 + ADD $4, R0, R0 + MOVD 8(RSP), R16 + CMP R16, R0 + BLO emit_remainder_ok_encodeBlockAsm4MB + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +emit_remainder_ok_encodeBlockAsm4MB: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R2 + CMPW R0, R2 + BEQ emit_literal_done_emit_remainder_encodeBlockAsm4MB + MOVWU R0, R5 + MOVW R0, 20(RSP) + ADD R2, R3, R0 + SUBW R2, R5, R5 + SUB $1, R5, R2 + MOVWU R2, R2 + CMPW $0x3c, R2 + BLO one_byte_emit_remainder_encodeBlockAsm4MB + CMPW $0x00000100, R2 + BLO two_bytes_emit_remainder_encodeBlockAsm4MB + CMPW $0x00010000, R2 + BLO three_bytes_emit_remainder_encodeBlockAsm4MB + MOVWU R2, R3 + LSRW $0x10, R3, R3 + MOVD $0xf8, R16 + MOVB R16, (R1) + MOVH R2, 1(R1) + MOVB R3, 3(R1) + ADD $0x04, R1, R1 + JMP memmove_long_emit_remainder_encodeBlockAsm4MB + +three_bytes_emit_remainder_encodeBlockAsm4MB: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R2, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_emit_remainder_encodeBlockAsm4MB + +two_bytes_emit_remainder_encodeBlockAsm4MB: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R2, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R2 + BLO memmove_emit_remainder_encodeBlockAsm4MB + JMP memmove_long_emit_remainder_encodeBlockAsm4MB + +one_byte_emit_remainder_encodeBlockAsm4MB: + LSLW $0x02, R2, R16 + BFI $0, R16, $8, R2 + MOVB R2, (R1) + ADD $0x01, R1, R1 + +memmove_emit_remainder_encodeBlockAsm4MB: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveShort + CMP $0x03, R3 + BLO emit_lit_memmove_emit_remainder_encodeBlockAsm4MB_memmove_move_1or2 + BEQ emit_lit_memmove_emit_remainder_encodeBlockAsm4MB_memmove_move_3 + CMP $0x08, R3 + BLO emit_lit_memmove_emit_remainder_encodeBlockAsm4MB_memmove_move_4through7 + CMP $0x10, R3 + BLS emit_lit_memmove_emit_remainder_encodeBlockAsm4MB_memmove_move_8through16 + CMP $0x20, R3 + BLS emit_lit_memmove_emit_remainder_encodeBlockAsm4MB_memmove_move_17through32 + JMP emit_lit_memmove_emit_remainder_encodeBlockAsm4MB_memmove_move_33through64 + +emit_lit_memmove_emit_remainder_encodeBlockAsm4MB_memmove_move_1or2: + MOVBU (R0), R16 + BFI $0, R16, $8, R5 + ADD R3, R0, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R0 + MOVB R5, (R1) + ADD R3, R1, R15 + MOVB R0, -1(R15) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm4MB + +emit_lit_memmove_emit_remainder_encodeBlockAsm4MB_memmove_move_3: + MOVHU (R0), R16 + BFI $0, R16, $16, R5 + MOVBU 2(R0), R16 + BFI $0, R16, $8, R0 + MOVH R5, (R1) + MOVB R0, 2(R1) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm4MB + +emit_lit_memmove_emit_remainder_encodeBlockAsm4MB_memmove_move_4through7: + MOVWU (R0), R5 + ADD R3, R0, R15 + MOVWU -4(R15), R0 + MOVW R5, (R1) + ADD R3, R1, R15 + MOVW R0, -4(R15) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm4MB + +emit_lit_memmove_emit_remainder_encodeBlockAsm4MB_memmove_move_8through16: + MOVD (R0), R5 + ADD R3, R0, R15 + MOVD -8(R15), R0 + MOVD R5, (R1) + ADD R3, R1, R15 + MOVD R0, -8(R15) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm4MB + +emit_lit_memmove_emit_remainder_encodeBlockAsm4MB_memmove_move_17through32: + FMOVQ (R0), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm4MB + +emit_lit_memmove_emit_remainder_encodeBlockAsm4MB_memmove_move_33through64: + FMOVQ (R0), F0 + FMOVQ 16(R0), F1 + ADD R3, R0, R15 + FMOVQ -32(R15), F2 + ADD R3, R0, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R3, R1, R15 + FMOVQ F2, -32(R15) + ADD R3, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_emit_remainder_encodeBlockAsm4MB: + MOVD R2, R1 + JMP emit_literal_done_emit_remainder_encodeBlockAsm4MB + +memmove_long_emit_remainder_encodeBlockAsm4MB: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveLong + MOVD R0, R5 + MOVD R1, R6 + MOVD R3, R7 + +emit_lit_memmove_long_emit_remainder_encodeBlockAsm4MBlarge_big_loop_back: + FMOVQ (R5), F0 + FMOVQ 16(R5), F1 + FMOVQ F0, (R6) + FMOVQ F1, 16(R6) + ADD $0x20, R5, R5 + ADD $0x20, R6, R6 + SUB $0x20, R7, R7 + CMP $0x20, R7 + BHS emit_lit_memmove_long_emit_remainder_encodeBlockAsm4MBlarge_big_loop_back + ADD R3, R0, R15 + FMOVQ -32(R15), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + ADD R3, R1, R15 + FMOVQ F0, -32(R15) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + MOVD R2, R1 + +emit_literal_done_emit_remainder_encodeBlockAsm4MB: + MOVD dst_base+0(FP), R0 + SUB R0, R1, R1 + MOVD R1, ret+56(FP) + RET + +// func encodeBlockAsm12B(dst []byte, src []byte, tmp *[16384]byte) int +// Requires: BMI, SSE2 +TEXT ·encodeBlockAsm12B(SB), $24-64 + MOVD tmp+48(FP), R0 + MOVD dst_base+0(FP), R1 + MOVD $0x00000080, R2 + MOVD R0, R3 + VEOR V0.B16, V0.B16, V0.B16 + +zero_loop_encodeBlockAsm12B: + FMOVQ F0, (R3) + FMOVQ F0, 16(R3) + FMOVQ F0, 32(R3) + FMOVQ F0, 48(R3) + FMOVQ F0, 64(R3) + FMOVQ F0, 80(R3) + FMOVQ F0, 96(R3) + FMOVQ F0, 112(R3) + ADD $0x80, R3, R3 + SUBS $1, R2, R2 + BNE zero_loop_encodeBlockAsm12B + MOVD $0x00000000, R16 + MOVW R16, 20(RSP) + MOVD src_len+32(FP), R2 + SUB $9, R2, R3 + SUB $8, R2, R5 + MOVW R5, 16(RSP) + LSR $0x05, R2, R2 + SUBW R2, R3, R3 + ADD R3, R1, R3 + MOVD R3, 8(RSP) + MOVD $0x00000001, R2 + MOVW R2, 24(RSP) + MOVD src_base+24(FP), R3 + +search_loop_encodeBlockAsm12B: + MOVWU R2, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + LSRW $0x05, R5, R5 + ADD R5, R2, R5 + ADD $4, R5, R5 + MOVWU R5, R5 + MOVWU 16(RSP), R16 + CMPW R16, R5 + BHS emit_remainder_encodeBlockAsm12B + MOVD (R3)(R2), R6 + MOVW R5, 28(RSP) + MOVD $0x000000cf1bbcdcbb, R8 + MOVD R6, R9 + MOVD R6, R10 + LSR $0x08, R10, R10 + LSL $0x18, R9, R9 + MUL R8, R9, R9 + LSR $0x34, R9, R9 + LSL $0x18, R10, R10 + MUL R8, R10, R10 + LSR $0x34, R10, R10 + MOVWU (R0)(R9<<2), R5 + MOVWU (R0)(R10<<2), R7 + MOVW R2, (R0)(R9<<2) + ADD $1, R2, R9 + MOVWU R9, R9 + MOVW R9, (R0)(R10<<2) + MOVD R6, R9 + LSR $0x10, R9, R9 + LSL $0x18, R9, R9 + MUL R8, R9, R9 + LSR $0x34, R9, R9 + MOVWU R2, R8 + MOVWU 24(RSP), R16 + SUBW R16, R8, R8 + ADD R8, R3, R15 + MOVWU 1(R15), R10 + MOVD R6, R8 + LSR $0x08, R8, R8 + CMPW R10, R8 + BNE no_repeat_found_encodeBlockAsm12B + ADD $1, R2, R6 + MOVWU R6, R6 + MOVWU 20(RSP), R7 + MOVWU R6, R5 + MOVWU 24(RSP), R16 + SUBSW R16, R5, R5 + BEQ repeat_extend_back_end_encodeBlockAsm12B + +repeat_extend_back_loop_encodeBlockAsm12B: + CMPW R7, R6 + BLS repeat_extend_back_end_encodeBlockAsm12B + ADD R5, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + ADD R6, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R9 + AND $0xff, R9, R16 + AND $0xff, R8, R15 + CMP R16, R15 + BNE repeat_extend_back_end_encodeBlockAsm12B + SUB $1, R6, R6 + MOVWU R6, R6 + SUBSW $1, R5, R5 + BNE repeat_extend_back_loop_encodeBlockAsm12B + +repeat_extend_back_end_encodeBlockAsm12B: + MOVWU R6, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + ADD R5, R1, R5 + ADD $3, R5, R5 + MOVD 8(RSP), R16 + CMP R16, R5 + BLO repeat_dst_size_check_encodeBlockAsm12B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +repeat_dst_size_check_encodeBlockAsm12B: + MOVWU 20(RSP), R5 + CMPW R6, R5 + BEQ emit_literal_done_repeat_emit_encodeBlockAsm12B + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R5, R3, R9 + SUBW R5, R8, R8 + SUB $1, R8, R5 + MOVWU R5, R5 + CMPW $0x3c, R5 + BLO one_byte_repeat_emit_encodeBlockAsm12B + CMPW $0x00000100, R5 + BLO two_bytes_repeat_emit_encodeBlockAsm12B + BLO three_bytes_repeat_emit_encodeBlockAsm12B + +three_bytes_repeat_emit_encodeBlockAsm12B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_repeat_emit_encodeBlockAsm12B + +two_bytes_repeat_emit_encodeBlockAsm12B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R5, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R5 + BLO memmove_repeat_emit_encodeBlockAsm12B + JMP memmove_long_repeat_emit_encodeBlockAsm12B + +one_byte_repeat_emit_encodeBlockAsm12B: + LSLW $0x02, R5, R16 + BFI $0, R16, $8, R5 + MOVB R5, (R1) + ADD $0x01, R1, R1 + +memmove_repeat_emit_encodeBlockAsm12B: + ADD R8, R1, R5 + + // genMemMoveShort + CMP $0x08, R8 + BLS emit_lit_memmove_repeat_emit_encodeBlockAsm12B_memmove_move_8 + CMP $0x10, R8 + BLS emit_lit_memmove_repeat_emit_encodeBlockAsm12B_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_repeat_emit_encodeBlockAsm12B_memmove_move_17through32 + JMP emit_lit_memmove_repeat_emit_encodeBlockAsm12B_memmove_move_33through64 + +emit_lit_memmove_repeat_emit_encodeBlockAsm12B_memmove_move_8: + MOVD (R9), R10 + MOVD R10, (R1) + JMP memmove_end_copy_repeat_emit_encodeBlockAsm12B + +emit_lit_memmove_repeat_emit_encodeBlockAsm12B_memmove_move_8through16: + MOVD (R9), R10 + ADD R8, R9, R15 + MOVD -8(R15), R9 + MOVD R10, (R1) + ADD R8, R1, R15 + MOVD R9, -8(R15) + JMP memmove_end_copy_repeat_emit_encodeBlockAsm12B + +emit_lit_memmove_repeat_emit_encodeBlockAsm12B_memmove_move_17through32: + FMOVQ (R9), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_repeat_emit_encodeBlockAsm12B + +emit_lit_memmove_repeat_emit_encodeBlockAsm12B_memmove_move_33through64: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + ADD R8, R9, R15 + FMOVQ -32(R15), F2 + ADD R8, R9, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_repeat_emit_encodeBlockAsm12B: + MOVD R5, R1 + JMP emit_literal_done_repeat_emit_encodeBlockAsm12B + +memmove_long_repeat_emit_encodeBlockAsm12B: + ADD R8, R1, R5 + + // genMemMoveLong + MOVD R9, R10 + MOVD R1, R11 + MOVD R8, R12 + +emit_lit_memmove_long_repeat_emit_encodeBlockAsm12Blarge_big_loop_back: + FMOVQ (R10), F0 + FMOVQ 16(R10), F1 + FMOVQ F0, (R11) + FMOVQ F1, 16(R11) + ADD $0x20, R10, R10 + ADD $0x20, R11, R11 + SUB $0x20, R12, R12 + CMP $0x20, R12 + BHS emit_lit_memmove_long_repeat_emit_encodeBlockAsm12Blarge_big_loop_back + ADD R8, R9, R15 + FMOVQ -32(R15), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R5, R1 + +emit_literal_done_repeat_emit_encodeBlockAsm12B: + ADDW $0x05, R2, R2 + MOVWU R2, R5 + MOVWU 24(RSP), R16 + SUBW R16, R5, R5 + MOVD src_len+32(FP), R8 + SUBW R2, R8, R8 + ADD R2, R3, R9 + ADD R5, R3, R5 + + // matchLen + MOVD $0, R11 + +matchlen_loopback_16_repeat_extend_encodeBlockAsm12B: + CMPW $0x10, R8 + BLO matchlen_match8_repeat_extend_encodeBlockAsm12B + MOVD (R9)(R11), R10 + ADD R11, R9, R15 + MOVD 8(R15), R12 + MOVD (R5)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_repeat_extend_encodeBlockAsm12B + ADD R11, R5, R15 + MOVD 8(R15), R16 + EOR R16, R12, R12 + TST R12, R12 + BNE matchlen_bsf_16repeat_extend_encodeBlockAsm12B + SUB $16, R8, R8 + MOVWU R8, R8 + ADD $16, R11, R11 + MOVWU R11, R11 + JMP matchlen_loopback_16_repeat_extend_encodeBlockAsm12B + +matchlen_bsf_16repeat_extend_encodeBlockAsm12B: + RBIT R12, R12 + CLZ R12, R12 + ASR $0x03, R12, R12 + ADD R12, R11, R11 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP repeat_extend_forward_end_encodeBlockAsm12B + +matchlen_match8_repeat_extend_encodeBlockAsm12B: + CMPW $0x08, R8 + BLO matchlen_match4_repeat_extend_encodeBlockAsm12B + MOVD (R9)(R11), R10 + MOVD (R5)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_repeat_extend_encodeBlockAsm12B + SUB $8, R8, R8 + MOVWU R8, R8 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP matchlen_match4_repeat_extend_encodeBlockAsm12B + +matchlen_bsf_8_repeat_extend_encodeBlockAsm12B: + RBIT R10, R10 + CLZ R10, R10 + ASR $0x03, R10, R10 + ADD R10, R11, R11 + MOVWU R11, R11 + JMP repeat_extend_forward_end_encodeBlockAsm12B + +matchlen_match4_repeat_extend_encodeBlockAsm12B: + CMPW $0x04, R8 + BLO matchlen_match2_repeat_extend_encodeBlockAsm12B + MOVWU (R9)(R11), R10 + MOVWU (R5)(R11), R16 + CMPW R10, R16 + BNE matchlen_match2_repeat_extend_encodeBlockAsm12B + SUB $4, R8, R8 + MOVWU R8, R8 + ADD $4, R11, R11 + MOVWU R11, R11 + +matchlen_match2_repeat_extend_encodeBlockAsm12B: + CMPW $0x01, R8 + BEQ matchlen_match1_repeat_extend_encodeBlockAsm12B + BLO repeat_extend_forward_end_encodeBlockAsm12B + MOVHU (R9)(R11), R16 + BFI $0, R16, $16, R10 + ADD R11, R5, R15 + MOVHU (R15), R15 + AND $0xffff, R10, R16 + CMP R16, R15 + BNE matchlen_match1_repeat_extend_encodeBlockAsm12B + ADD $2, R11, R11 + MOVWU R11, R11 + SUBSW $0x02, R8, R8 + BEQ repeat_extend_forward_end_encodeBlockAsm12B + +matchlen_match1_repeat_extend_encodeBlockAsm12B: + MOVBU (R9)(R11), R16 + BFI $0, R16, $8, R10 + ADD R11, R5, R15 + MOVBU (R15), R15 + AND $0xff, R10, R16 + CMP R16, R15 + BNE repeat_extend_forward_end_encodeBlockAsm12B + ADD $1, R11, R11 + MOVWU R11, R11 + +repeat_extend_forward_end_encodeBlockAsm12B: + ADDW R11, R2, R2 + MOVWU R2, R5 + SUBW R6, R5, R5 + MOVWU 24(RSP), R6 + TSTW R7, R7 + BEQ repeat_as_copy_encodeBlockAsm12B + + // emitRepeat + MOVWU R5, R7 + SUB $4, R5, R5 + MOVWU R5, R5 + CMPW $0x08, R7 + BLS repeat_two_match_repeat_encodeBlockAsm12B + CMPW $0x0c, R7 + BHS cant_repeat_two_offset_match_repeat_encodeBlockAsm12B + CMPW $0x00000800, R6 + BLO repeat_two_offset_match_repeat_encodeBlockAsm12B + +cant_repeat_two_offset_match_repeat_encodeBlockAsm12B: + CMPW $0x00000104, R5 + BLO repeat_three_match_repeat_encodeBlockAsm12B + SUB $256, R5, R5 + MOVWU R5, R5 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R5, 2(R1) + ADD $0x04, R1, R1 + JMP repeat_end_emit_encodeBlockAsm12B + +repeat_three_match_repeat_encodeBlockAsm12B: + SUB $4, R5, R5 + MOVWU R5, R5 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R5, 2(R1) + ADD $0x03, R1, R1 + JMP repeat_end_emit_encodeBlockAsm12B + +repeat_two_match_repeat_encodeBlockAsm12B: + LSLW $0x02, R5, R5 + ORRW $0x01, R5, R5 + MOVH R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm12B + +repeat_two_offset_match_repeat_encodeBlockAsm12B: + MOVD $0, R7 + ADD R5<<2, R7, R5 + ADD $1, R5, R5 + MOVWU R5, R5 + MOVB R6, 1(R1) + ASRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm12B + +repeat_as_copy_encodeBlockAsm12B: + // emitCopy + CMPW $0x40, R5 + BLS two_byte_offset_short_repeat_as_copy_encodeBlockAsm12B + CMPW $0x00000800, R6 + BHS long_offset_short_repeat_as_copy_encodeBlockAsm12B + MOVD $0x00000001, R7 + ADD $16, R7, R7 + MOVWU R7, R7 + MOVB R6, 1(R1) + LSRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R7, R7 + MOVB R7, (R1) + ADD $0x02, R1, R1 + SUBW $0x08, R5, R5 + + // emitRepeat + SUB $4, R5, R5 + MOVWU R5, R5 + JMP cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm12B_emit_copy_short_2b + MOVWU R5, R7 + SUB $4, R5, R5 + MOVWU R5, R5 + CMPW $0x08, R7 + BLS repeat_two_repeat_as_copy_encodeBlockAsm12B_emit_copy_short_2b + CMPW $0x0c, R7 + BHS cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm12B_emit_copy_short_2b + CMPW $0x00000800, R6 + BLO repeat_two_offset_repeat_as_copy_encodeBlockAsm12B_emit_copy_short_2b + +cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm12B_emit_copy_short_2b: + CMPW $0x00000104, R5 + BLO repeat_three_repeat_as_copy_encodeBlockAsm12B_emit_copy_short_2b + SUB $256, R5, R5 + MOVWU R5, R5 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R5, 2(R1) + ADD $0x04, R1, R1 + JMP repeat_end_emit_encodeBlockAsm12B + +repeat_three_repeat_as_copy_encodeBlockAsm12B_emit_copy_short_2b: + SUB $4, R5, R5 + MOVWU R5, R5 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R5, 2(R1) + ADD $0x03, R1, R1 + JMP repeat_end_emit_encodeBlockAsm12B + +repeat_two_repeat_as_copy_encodeBlockAsm12B_emit_copy_short_2b: + LSLW $0x02, R5, R5 + ORRW $0x01, R5, R5 + MOVH R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm12B + +repeat_two_offset_repeat_as_copy_encodeBlockAsm12B_emit_copy_short_2b: + MOVD $0, R7 + ADD R5<<2, R7, R5 + ADD $1, R5, R5 + MOVWU R5, R5 + MOVB R6, 1(R1) + ASRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm12B + +long_offset_short_repeat_as_copy_encodeBlockAsm12B: + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R6, 1(R1) + SUB $60, R5, R5 + MOVWU R5, R5 + ADD $0x03, R1, R1 + + // emitRepeat + MOVWU R5, R7 + SUB $4, R5, R5 + MOVWU R5, R5 + CMPW $0x08, R7 + BLS repeat_two_repeat_as_copy_encodeBlockAsm12B_emit_copy_short + CMPW $0x0c, R7 + BHS cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm12B_emit_copy_short + CMPW $0x00000800, R6 + BLO repeat_two_offset_repeat_as_copy_encodeBlockAsm12B_emit_copy_short + +cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm12B_emit_copy_short: + CMPW $0x00000104, R5 + BLO repeat_three_repeat_as_copy_encodeBlockAsm12B_emit_copy_short + SUB $256, R5, R5 + MOVWU R5, R5 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R5, 2(R1) + ADD $0x04, R1, R1 + JMP repeat_end_emit_encodeBlockAsm12B + +repeat_three_repeat_as_copy_encodeBlockAsm12B_emit_copy_short: + SUB $4, R5, R5 + MOVWU R5, R5 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R5, 2(R1) + ADD $0x03, R1, R1 + JMP repeat_end_emit_encodeBlockAsm12B + +repeat_two_repeat_as_copy_encodeBlockAsm12B_emit_copy_short: + LSLW $0x02, R5, R5 + ORRW $0x01, R5, R5 + MOVH R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm12B + +repeat_two_offset_repeat_as_copy_encodeBlockAsm12B_emit_copy_short: + MOVD $0, R7 + ADD R5<<2, R7, R5 + ADD $1, R5, R5 + MOVWU R5, R5 + MOVB R6, 1(R1) + ASRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm12B + +two_byte_offset_short_repeat_as_copy_encodeBlockAsm12B: + MOVWU R5, R7 + LSLW $0x02, R7, R7 + CMPW $0x0c, R5 + BHS emit_copy_three_repeat_as_copy_encodeBlockAsm12B + CMPW $0x00000800, R6 + BHS emit_copy_three_repeat_as_copy_encodeBlockAsm12B + SUB $15, R7, R7 + MOVWU R7, R7 + MOVB R6, 1(R1) + LSRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R7, R7 + MOVB R7, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm12B + +emit_copy_three_repeat_as_copy_encodeBlockAsm12B: + SUB $2, R7, R7 + MOVWU R7, R7 + MOVB R7, (R1) + MOVH R6, 1(R1) + ADD $0x03, R1, R1 + +repeat_end_emit_encodeBlockAsm12B: + MOVW R2, 20(RSP) + JMP search_loop_encodeBlockAsm12B + +no_repeat_found_encodeBlockAsm12B: + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate_match_encodeBlockAsm12B + LSR $0x08, R6, R6 + MOVWU (R0)(R9<<2), R5 + ADD $2, R2, R8 + MOVWU R8, R8 + MOVWU (R3)(R7), R16 + CMPW R6, R16 + BEQ candidate2_match_encodeBlockAsm12B + MOVW R8, (R0)(R9<<2) + LSR $0x08, R6, R6 + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate3_match_encodeBlockAsm12B + MOVWU 28(RSP), R2 + JMP search_loop_encodeBlockAsm12B + +candidate3_match_encodeBlockAsm12B: + ADDW $0x02, R2, R2 + JMP candidate_match_encodeBlockAsm12B + +candidate2_match_encodeBlockAsm12B: + MOVW R8, (R0)(R9<<2) + ADDW $1, R2, R2 + MOVWU R7, R5 + +candidate_match_encodeBlockAsm12B: + MOVWU 20(RSP), R6 + TSTW R5, R5 + BEQ match_extend_back_end_encodeBlockAsm12B + +match_extend_back_loop_encodeBlockAsm12B: + CMPW R6, R2 + BLS match_extend_back_end_encodeBlockAsm12B + ADD R5, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R7 + ADD R2, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + AND $0xff, R8, R16 + AND $0xff, R7, R15 + CMP R16, R15 + BNE match_extend_back_end_encodeBlockAsm12B + SUB $1, R2, R2 + MOVWU R2, R2 + SUBSW $1, R5, R5 + BEQ match_extend_back_end_encodeBlockAsm12B + JMP match_extend_back_loop_encodeBlockAsm12B + +match_extend_back_end_encodeBlockAsm12B: + MOVWU R2, R6 + MOVWU 20(RSP), R16 + SUBW R16, R6, R6 + ADD R6, R1, R6 + ADD $3, R6, R6 + MOVD 8(RSP), R16 + CMP R16, R6 + BLO match_dst_size_check_encodeBlockAsm12B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_dst_size_check_encodeBlockAsm12B: + MOVWU R2, R6 + MOVWU 20(RSP), R7 + CMPW R6, R7 + BEQ emit_literal_done_match_emit_encodeBlockAsm12B + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R7, R3, R6 + SUBW R7, R8, R8 + SUB $1, R8, R7 + MOVWU R7, R7 + CMPW $0x3c, R7 + BLO one_byte_match_emit_encodeBlockAsm12B + CMPW $0x00000100, R7 + BLO two_bytes_match_emit_encodeBlockAsm12B + BLO three_bytes_match_emit_encodeBlockAsm12B + +three_bytes_match_emit_encodeBlockAsm12B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R7, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_match_emit_encodeBlockAsm12B + +two_bytes_match_emit_encodeBlockAsm12B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R7, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R7 + BLO memmove_match_emit_encodeBlockAsm12B + JMP memmove_long_match_emit_encodeBlockAsm12B + +one_byte_match_emit_encodeBlockAsm12B: + LSLW $0x02, R7, R16 + BFI $0, R16, $8, R7 + MOVB R7, (R1) + ADD $0x01, R1, R1 + +memmove_match_emit_encodeBlockAsm12B: + ADD R8, R1, R7 + + // genMemMoveShort + CMP $0x08, R8 + BLS emit_lit_memmove_match_emit_encodeBlockAsm12B_memmove_move_8 + CMP $0x10, R8 + BLS emit_lit_memmove_match_emit_encodeBlockAsm12B_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_match_emit_encodeBlockAsm12B_memmove_move_17through32 + JMP emit_lit_memmove_match_emit_encodeBlockAsm12B_memmove_move_33through64 + +emit_lit_memmove_match_emit_encodeBlockAsm12B_memmove_move_8: + MOVD (R6), R9 + MOVD R9, (R1) + JMP memmove_end_copy_match_emit_encodeBlockAsm12B + +emit_lit_memmove_match_emit_encodeBlockAsm12B_memmove_move_8through16: + MOVD (R6), R9 + ADD R8, R6, R15 + MOVD -8(R15), R6 + MOVD R9, (R1) + ADD R8, R1, R15 + MOVD R6, -8(R15) + JMP memmove_end_copy_match_emit_encodeBlockAsm12B + +emit_lit_memmove_match_emit_encodeBlockAsm12B_memmove_move_17through32: + FMOVQ (R6), F0 + ADD R8, R6, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_match_emit_encodeBlockAsm12B + +emit_lit_memmove_match_emit_encodeBlockAsm12B_memmove_move_33through64: + FMOVQ (R6), F0 + FMOVQ 16(R6), F1 + ADD R8, R6, R15 + FMOVQ -32(R15), F2 + ADD R8, R6, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_match_emit_encodeBlockAsm12B: + MOVD R7, R1 + JMP emit_literal_done_match_emit_encodeBlockAsm12B + +memmove_long_match_emit_encodeBlockAsm12B: + ADD R8, R1, R7 + + // genMemMoveLong + MOVD R6, R9 + MOVD R1, R10 + MOVD R8, R11 + +emit_lit_memmove_long_match_emit_encodeBlockAsm12Blarge_big_loop_back: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + FMOVQ F0, (R10) + FMOVQ F1, 16(R10) + ADD $0x20, R9, R9 + ADD $0x20, R10, R10 + SUB $0x20, R11, R11 + CMP $0x20, R11 + BHS emit_lit_memmove_long_match_emit_encodeBlockAsm12Blarge_big_loop_back + ADD R8, R6, R15 + FMOVQ -32(R15), F0 + ADD R8, R6, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R7, R1 + +emit_literal_done_match_emit_encodeBlockAsm12B: +match_nolit_loop_encodeBlockAsm12B: + MOVWU R2, R6 + SUBW R5, R6, R6 + MOVW R6, 24(RSP) + ADDW $0x04, R2, R2 + ADDW $0x04, R5, R5 + MOVD src_len+32(FP), R6 + SUBW R2, R6, R6 + ADD R2, R3, R7 + ADD R5, R3, R5 + + // matchLen + MOVD $0, R9 + +matchlen_loopback_16_match_nolit_encodeBlockAsm12B: + CMPW $0x10, R6 + BLO matchlen_match8_match_nolit_encodeBlockAsm12B + MOVD (R7)(R9), R8 + ADD R9, R7, R15 + MOVD 8(R15), R10 + MOVD (R5)(R9), R16 + EOR R16, R8, R8 + TST R8, R8 + BNE matchlen_bsf_8_match_nolit_encodeBlockAsm12B + ADD R9, R5, R15 + MOVD 8(R15), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_16match_nolit_encodeBlockAsm12B + SUB $16, R6, R6 + MOVWU R6, R6 + ADD $16, R9, R9 + MOVWU R9, R9 + JMP matchlen_loopback_16_match_nolit_encodeBlockAsm12B + +matchlen_bsf_16match_nolit_encodeBlockAsm12B: + RBIT R10, R10 + CLZ R10, R10 + ASR $0x03, R10, R10 + ADD R10, R9, R9 + ADD $8, R9, R9 + MOVWU R9, R9 + JMP match_nolit_end_encodeBlockAsm12B + +matchlen_match8_match_nolit_encodeBlockAsm12B: + CMPW $0x08, R6 + BLO matchlen_match4_match_nolit_encodeBlockAsm12B + MOVD (R7)(R9), R8 + MOVD (R5)(R9), R16 + EOR R16, R8, R8 + TST R8, R8 + BNE matchlen_bsf_8_match_nolit_encodeBlockAsm12B + SUB $8, R6, R6 + MOVWU R6, R6 + ADD $8, R9, R9 + MOVWU R9, R9 + JMP matchlen_match4_match_nolit_encodeBlockAsm12B + +matchlen_bsf_8_match_nolit_encodeBlockAsm12B: + RBIT R8, R8 + CLZ R8, R8 + ASR $0x03, R8, R8 + ADD R8, R9, R9 + MOVWU R9, R9 + JMP match_nolit_end_encodeBlockAsm12B + +matchlen_match4_match_nolit_encodeBlockAsm12B: + CMPW $0x04, R6 + BLO matchlen_match2_match_nolit_encodeBlockAsm12B + MOVWU (R7)(R9), R8 + MOVWU (R5)(R9), R16 + CMPW R8, R16 + BNE matchlen_match2_match_nolit_encodeBlockAsm12B + SUB $4, R6, R6 + MOVWU R6, R6 + ADD $4, R9, R9 + MOVWU R9, R9 + +matchlen_match2_match_nolit_encodeBlockAsm12B: + CMPW $0x01, R6 + BEQ matchlen_match1_match_nolit_encodeBlockAsm12B + BLO match_nolit_end_encodeBlockAsm12B + MOVHU (R7)(R9), R16 + BFI $0, R16, $16, R8 + ADD R9, R5, R15 + MOVHU (R15), R15 + AND $0xffff, R8, R16 + CMP R16, R15 + BNE matchlen_match1_match_nolit_encodeBlockAsm12B + ADD $2, R9, R9 + MOVWU R9, R9 + SUBSW $0x02, R6, R6 + BEQ match_nolit_end_encodeBlockAsm12B + +matchlen_match1_match_nolit_encodeBlockAsm12B: + MOVBU (R7)(R9), R16 + BFI $0, R16, $8, R8 + ADD R9, R5, R15 + MOVBU (R15), R15 + AND $0xff, R8, R16 + CMP R16, R15 + BNE match_nolit_end_encodeBlockAsm12B + ADD $1, R9, R9 + MOVWU R9, R9 + +match_nolit_end_encodeBlockAsm12B: + ADDW R9, R2, R2 + MOVWU 24(RSP), R5 + ADDW $0x04, R9, R9 + MOVW R2, 20(RSP) + + // emitCopy + CMPW $0x40, R9 + BLS two_byte_offset_short_match_nolit_encodeBlockAsm12B + CMPW $0x00000800, R5 + BHS long_offset_short_match_nolit_encodeBlockAsm12B + MOVD $0x00000001, R6 + ADD $16, R6, R6 + MOVWU R6, R6 + MOVB R5, 1(R1) + LSRW $0x08, R5, R5 + LSLW $0x05, R5, R5 + ORRW R5, R6, R6 + MOVB R6, (R1) + ADD $0x02, R1, R1 + SUBW $0x08, R9, R9 + + // emitRepeat + SUB $4, R9, R9 + MOVWU R9, R9 + JMP cant_repeat_two_offset_match_nolit_encodeBlockAsm12B_emit_copy_short_2b + MOVWU R9, R6 + SUB $4, R9, R9 + MOVWU R9, R9 + CMPW $0x08, R6 + BLS repeat_two_match_nolit_encodeBlockAsm12B_emit_copy_short_2b + CMPW $0x0c, R6 + BHS cant_repeat_two_offset_match_nolit_encodeBlockAsm12B_emit_copy_short_2b + CMPW $0x00000800, R5 + BLO repeat_two_offset_match_nolit_encodeBlockAsm12B_emit_copy_short_2b + +cant_repeat_two_offset_match_nolit_encodeBlockAsm12B_emit_copy_short_2b: + CMPW $0x00000104, R9 + BLO repeat_three_match_nolit_encodeBlockAsm12B_emit_copy_short_2b + SUB $256, R9, R9 + MOVWU R9, R9 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R9, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm12B + +repeat_three_match_nolit_encodeBlockAsm12B_emit_copy_short_2b: + SUB $4, R9, R9 + MOVWU R9, R9 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R9, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm12B + +repeat_two_match_nolit_encodeBlockAsm12B_emit_copy_short_2b: + LSLW $0x02, R9, R9 + ORRW $0x01, R9, R9 + MOVH R9, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm12B + +repeat_two_offset_match_nolit_encodeBlockAsm12B_emit_copy_short_2b: + MOVD $0, R6 + ADD R9<<2, R6, R9 + ADD $1, R9, R9 + MOVWU R9, R9 + MOVB R5, 1(R1) + ASRW $0x08, R5, R5 + LSLW $0x05, R5, R5 + ORRW R5, R9, R9 + MOVB R9, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm12B + +long_offset_short_match_nolit_encodeBlockAsm12B: + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + SUB $60, R9, R9 + MOVWU R9, R9 + ADD $0x03, R1, R1 + + // emitRepeat + MOVWU R9, R6 + SUB $4, R9, R9 + MOVWU R9, R9 + CMPW $0x08, R6 + BLS repeat_two_match_nolit_encodeBlockAsm12B_emit_copy_short + CMPW $0x0c, R6 + BHS cant_repeat_two_offset_match_nolit_encodeBlockAsm12B_emit_copy_short + CMPW $0x00000800, R5 + BLO repeat_two_offset_match_nolit_encodeBlockAsm12B_emit_copy_short + +cant_repeat_two_offset_match_nolit_encodeBlockAsm12B_emit_copy_short: + CMPW $0x00000104, R9 + BLO repeat_three_match_nolit_encodeBlockAsm12B_emit_copy_short + SUB $256, R9, R9 + MOVWU R9, R9 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R9, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm12B + +repeat_three_match_nolit_encodeBlockAsm12B_emit_copy_short: + SUB $4, R9, R9 + MOVWU R9, R9 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R9, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm12B + +repeat_two_match_nolit_encodeBlockAsm12B_emit_copy_short: + LSLW $0x02, R9, R9 + ORRW $0x01, R9, R9 + MOVH R9, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm12B + +repeat_two_offset_match_nolit_encodeBlockAsm12B_emit_copy_short: + MOVD $0, R6 + ADD R9<<2, R6, R9 + ADD $1, R9, R9 + MOVWU R9, R9 + MOVB R5, 1(R1) + ASRW $0x08, R5, R5 + LSLW $0x05, R5, R5 + ORRW R5, R9, R9 + MOVB R9, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm12B + +two_byte_offset_short_match_nolit_encodeBlockAsm12B: + MOVWU R9, R6 + LSLW $0x02, R6, R6 + CMPW $0x0c, R9 + BHS emit_copy_three_match_nolit_encodeBlockAsm12B + CMPW $0x00000800, R5 + BHS emit_copy_three_match_nolit_encodeBlockAsm12B + SUB $15, R6, R6 + MOVWU R6, R6 + MOVB R5, 1(R1) + LSRW $0x08, R5, R5 + LSLW $0x05, R5, R5 + ORRW R5, R6, R6 + MOVB R6, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm12B + +emit_copy_three_match_nolit_encodeBlockAsm12B: + SUB $2, R6, R6 + MOVWU R6, R6 + MOVB R6, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + +match_nolit_emitcopy_end_encodeBlockAsm12B: + MOVWU 16(RSP), R16 + CMPW R16, R2 + BHS emit_remainder_encodeBlockAsm12B + ADD R2, R3, R15 + MOVD -2(R15), R6 + MOVD 8(RSP), R16 + CMP R16, R1 + BLO match_nolit_dst_ok_encodeBlockAsm12B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_nolit_dst_ok_encodeBlockAsm12B: + MOVD $0x000000cf1bbcdcbb, R8 + MOVD R6, R7 + LSR $0x10, R6, R6 + MOVD R6, R5 + LSL $0x18, R7, R7 + MUL R8, R7, R7 + LSR $0x34, R7, R7 + LSL $0x18, R5, R5 + MUL R8, R5, R5 + LSR $0x34, R5, R5 + SUB $2, R2, R8 + MOVWU R8, R8 + ADD R5<<2, R0, R9 + MOVWU (R9), R5 + MOVW R8, (R0)(R7<<2) + MOVW R2, (R9) + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ match_nolit_loop_encodeBlockAsm12B + ADDW $1, R2, R2 + JMP search_loop_encodeBlockAsm12B + +emit_remainder_encodeBlockAsm12B: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R16 + SUBW R16, R0, R0 + ADD R0, R1, R0 + ADD $3, R0, R0 + MOVD 8(RSP), R16 + CMP R16, R0 + BLO emit_remainder_ok_encodeBlockAsm12B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +emit_remainder_ok_encodeBlockAsm12B: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R2 + CMPW R0, R2 + BEQ emit_literal_done_emit_remainder_encodeBlockAsm12B + MOVWU R0, R5 + MOVW R0, 20(RSP) + ADD R2, R3, R0 + SUBW R2, R5, R5 + SUB $1, R5, R2 + MOVWU R2, R2 + CMPW $0x3c, R2 + BLO one_byte_emit_remainder_encodeBlockAsm12B + CMPW $0x00000100, R2 + BLO two_bytes_emit_remainder_encodeBlockAsm12B + BLO three_bytes_emit_remainder_encodeBlockAsm12B + +three_bytes_emit_remainder_encodeBlockAsm12B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R2, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_emit_remainder_encodeBlockAsm12B + +two_bytes_emit_remainder_encodeBlockAsm12B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R2, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R2 + BLO memmove_emit_remainder_encodeBlockAsm12B + JMP memmove_long_emit_remainder_encodeBlockAsm12B + +one_byte_emit_remainder_encodeBlockAsm12B: + LSLW $0x02, R2, R16 + BFI $0, R16, $8, R2 + MOVB R2, (R1) + ADD $0x01, R1, R1 + +memmove_emit_remainder_encodeBlockAsm12B: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveShort + CMP $0x03, R3 + BLO emit_lit_memmove_emit_remainder_encodeBlockAsm12B_memmove_move_1or2 + BEQ emit_lit_memmove_emit_remainder_encodeBlockAsm12B_memmove_move_3 + CMP $0x08, R3 + BLO emit_lit_memmove_emit_remainder_encodeBlockAsm12B_memmove_move_4through7 + CMP $0x10, R3 + BLS emit_lit_memmove_emit_remainder_encodeBlockAsm12B_memmove_move_8through16 + CMP $0x20, R3 + BLS emit_lit_memmove_emit_remainder_encodeBlockAsm12B_memmove_move_17through32 + JMP emit_lit_memmove_emit_remainder_encodeBlockAsm12B_memmove_move_33through64 + +emit_lit_memmove_emit_remainder_encodeBlockAsm12B_memmove_move_1or2: + MOVBU (R0), R16 + BFI $0, R16, $8, R5 + ADD R3, R0, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R0 + MOVB R5, (R1) + ADD R3, R1, R15 + MOVB R0, -1(R15) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm12B + +emit_lit_memmove_emit_remainder_encodeBlockAsm12B_memmove_move_3: + MOVHU (R0), R16 + BFI $0, R16, $16, R5 + MOVBU 2(R0), R16 + BFI $0, R16, $8, R0 + MOVH R5, (R1) + MOVB R0, 2(R1) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm12B + +emit_lit_memmove_emit_remainder_encodeBlockAsm12B_memmove_move_4through7: + MOVWU (R0), R5 + ADD R3, R0, R15 + MOVWU -4(R15), R0 + MOVW R5, (R1) + ADD R3, R1, R15 + MOVW R0, -4(R15) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm12B + +emit_lit_memmove_emit_remainder_encodeBlockAsm12B_memmove_move_8through16: + MOVD (R0), R5 + ADD R3, R0, R15 + MOVD -8(R15), R0 + MOVD R5, (R1) + ADD R3, R1, R15 + MOVD R0, -8(R15) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm12B + +emit_lit_memmove_emit_remainder_encodeBlockAsm12B_memmove_move_17through32: + FMOVQ (R0), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm12B + +emit_lit_memmove_emit_remainder_encodeBlockAsm12B_memmove_move_33through64: + FMOVQ (R0), F0 + FMOVQ 16(R0), F1 + ADD R3, R0, R15 + FMOVQ -32(R15), F2 + ADD R3, R0, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R3, R1, R15 + FMOVQ F2, -32(R15) + ADD R3, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_emit_remainder_encodeBlockAsm12B: + MOVD R2, R1 + JMP emit_literal_done_emit_remainder_encodeBlockAsm12B + +memmove_long_emit_remainder_encodeBlockAsm12B: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveLong + MOVD R0, R5 + MOVD R1, R6 + MOVD R3, R7 + +emit_lit_memmove_long_emit_remainder_encodeBlockAsm12Blarge_big_loop_back: + FMOVQ (R5), F0 + FMOVQ 16(R5), F1 + FMOVQ F0, (R6) + FMOVQ F1, 16(R6) + ADD $0x20, R5, R5 + ADD $0x20, R6, R6 + SUB $0x20, R7, R7 + CMP $0x20, R7 + BHS emit_lit_memmove_long_emit_remainder_encodeBlockAsm12Blarge_big_loop_back + ADD R3, R0, R15 + FMOVQ -32(R15), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + ADD R3, R1, R15 + FMOVQ F0, -32(R15) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + MOVD R2, R1 + +emit_literal_done_emit_remainder_encodeBlockAsm12B: + MOVD dst_base+0(FP), R0 + SUB R0, R1, R1 + MOVD R1, ret+56(FP) + RET + +// func encodeBlockAsm10B(dst []byte, src []byte, tmp *[4096]byte) int +// Requires: BMI, SSE2 +TEXT ·encodeBlockAsm10B(SB), $24-64 + MOVD tmp+48(FP), R0 + MOVD dst_base+0(FP), R1 + MOVD $0x00000020, R2 + MOVD R0, R3 + VEOR V0.B16, V0.B16, V0.B16 + +zero_loop_encodeBlockAsm10B: + FMOVQ F0, (R3) + FMOVQ F0, 16(R3) + FMOVQ F0, 32(R3) + FMOVQ F0, 48(R3) + FMOVQ F0, 64(R3) + FMOVQ F0, 80(R3) + FMOVQ F0, 96(R3) + FMOVQ F0, 112(R3) + ADD $0x80, R3, R3 + SUBS $1, R2, R2 + BNE zero_loop_encodeBlockAsm10B + MOVD $0x00000000, R16 + MOVW R16, 20(RSP) + MOVD src_len+32(FP), R2 + SUB $9, R2, R3 + SUB $8, R2, R5 + MOVW R5, 16(RSP) + LSR $0x05, R2, R2 + SUBW R2, R3, R3 + ADD R3, R1, R3 + MOVD R3, 8(RSP) + MOVD $0x00000001, R2 + MOVW R2, 24(RSP) + MOVD src_base+24(FP), R3 + +search_loop_encodeBlockAsm10B: + MOVWU R2, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + LSRW $0x05, R5, R5 + ADD R5, R2, R5 + ADD $4, R5, R5 + MOVWU R5, R5 + MOVWU 16(RSP), R16 + CMPW R16, R5 + BHS emit_remainder_encodeBlockAsm10B + MOVD (R3)(R2), R6 + MOVW R5, 28(RSP) + MOVD $0x9e3779b1, R8 + MOVD R6, R9 + MOVD R6, R10 + LSR $0x08, R10, R10 + LSL $0x20, R9, R9 + MUL R8, R9, R9 + LSR $0x36, R9, R9 + LSL $0x20, R10, R10 + MUL R8, R10, R10 + LSR $0x36, R10, R10 + MOVWU (R0)(R9<<2), R5 + MOVWU (R0)(R10<<2), R7 + MOVW R2, (R0)(R9<<2) + ADD $1, R2, R9 + MOVWU R9, R9 + MOVW R9, (R0)(R10<<2) + MOVD R6, R9 + LSR $0x10, R9, R9 + LSL $0x20, R9, R9 + MUL R8, R9, R9 + LSR $0x36, R9, R9 + MOVWU R2, R8 + MOVWU 24(RSP), R16 + SUBW R16, R8, R8 + ADD R8, R3, R15 + MOVWU 1(R15), R10 + MOVD R6, R8 + LSR $0x08, R8, R8 + CMPW R10, R8 + BNE no_repeat_found_encodeBlockAsm10B + ADD $1, R2, R6 + MOVWU R6, R6 + MOVWU 20(RSP), R7 + MOVWU R6, R5 + MOVWU 24(RSP), R16 + SUBSW R16, R5, R5 + BEQ repeat_extend_back_end_encodeBlockAsm10B + +repeat_extend_back_loop_encodeBlockAsm10B: + CMPW R7, R6 + BLS repeat_extend_back_end_encodeBlockAsm10B + ADD R5, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + ADD R6, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R9 + AND $0xff, R9, R16 + AND $0xff, R8, R15 + CMP R16, R15 + BNE repeat_extend_back_end_encodeBlockAsm10B + SUB $1, R6, R6 + MOVWU R6, R6 + SUBSW $1, R5, R5 + BNE repeat_extend_back_loop_encodeBlockAsm10B + +repeat_extend_back_end_encodeBlockAsm10B: + MOVWU R6, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + ADD R5, R1, R5 + ADD $3, R5, R5 + MOVD 8(RSP), R16 + CMP R16, R5 + BLO repeat_dst_size_check_encodeBlockAsm10B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +repeat_dst_size_check_encodeBlockAsm10B: + MOVWU 20(RSP), R5 + CMPW R6, R5 + BEQ emit_literal_done_repeat_emit_encodeBlockAsm10B + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R5, R3, R9 + SUBW R5, R8, R8 + SUB $1, R8, R5 + MOVWU R5, R5 + CMPW $0x3c, R5 + BLO one_byte_repeat_emit_encodeBlockAsm10B + CMPW $0x00000100, R5 + BLO two_bytes_repeat_emit_encodeBlockAsm10B + BLO three_bytes_repeat_emit_encodeBlockAsm10B + +three_bytes_repeat_emit_encodeBlockAsm10B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_repeat_emit_encodeBlockAsm10B + +two_bytes_repeat_emit_encodeBlockAsm10B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R5, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R5 + BLO memmove_repeat_emit_encodeBlockAsm10B + JMP memmove_long_repeat_emit_encodeBlockAsm10B + +one_byte_repeat_emit_encodeBlockAsm10B: + LSLW $0x02, R5, R16 + BFI $0, R16, $8, R5 + MOVB R5, (R1) + ADD $0x01, R1, R1 + +memmove_repeat_emit_encodeBlockAsm10B: + ADD R8, R1, R5 + + // genMemMoveShort + CMP $0x08, R8 + BLS emit_lit_memmove_repeat_emit_encodeBlockAsm10B_memmove_move_8 + CMP $0x10, R8 + BLS emit_lit_memmove_repeat_emit_encodeBlockAsm10B_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_repeat_emit_encodeBlockAsm10B_memmove_move_17through32 + JMP emit_lit_memmove_repeat_emit_encodeBlockAsm10B_memmove_move_33through64 + +emit_lit_memmove_repeat_emit_encodeBlockAsm10B_memmove_move_8: + MOVD (R9), R10 + MOVD R10, (R1) + JMP memmove_end_copy_repeat_emit_encodeBlockAsm10B + +emit_lit_memmove_repeat_emit_encodeBlockAsm10B_memmove_move_8through16: + MOVD (R9), R10 + ADD R8, R9, R15 + MOVD -8(R15), R9 + MOVD R10, (R1) + ADD R8, R1, R15 + MOVD R9, -8(R15) + JMP memmove_end_copy_repeat_emit_encodeBlockAsm10B + +emit_lit_memmove_repeat_emit_encodeBlockAsm10B_memmove_move_17through32: + FMOVQ (R9), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_repeat_emit_encodeBlockAsm10B + +emit_lit_memmove_repeat_emit_encodeBlockAsm10B_memmove_move_33through64: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + ADD R8, R9, R15 + FMOVQ -32(R15), F2 + ADD R8, R9, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_repeat_emit_encodeBlockAsm10B: + MOVD R5, R1 + JMP emit_literal_done_repeat_emit_encodeBlockAsm10B + +memmove_long_repeat_emit_encodeBlockAsm10B: + ADD R8, R1, R5 + + // genMemMoveLong + MOVD R9, R10 + MOVD R1, R11 + MOVD R8, R12 + +emit_lit_memmove_long_repeat_emit_encodeBlockAsm10Blarge_big_loop_back: + FMOVQ (R10), F0 + FMOVQ 16(R10), F1 + FMOVQ F0, (R11) + FMOVQ F1, 16(R11) + ADD $0x20, R10, R10 + ADD $0x20, R11, R11 + SUB $0x20, R12, R12 + CMP $0x20, R12 + BHS emit_lit_memmove_long_repeat_emit_encodeBlockAsm10Blarge_big_loop_back + ADD R8, R9, R15 + FMOVQ -32(R15), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R5, R1 + +emit_literal_done_repeat_emit_encodeBlockAsm10B: + ADDW $0x05, R2, R2 + MOVWU R2, R5 + MOVWU 24(RSP), R16 + SUBW R16, R5, R5 + MOVD src_len+32(FP), R8 + SUBW R2, R8, R8 + ADD R2, R3, R9 + ADD R5, R3, R5 + + // matchLen + MOVD $0, R11 + +matchlen_loopback_16_repeat_extend_encodeBlockAsm10B: + CMPW $0x10, R8 + BLO matchlen_match8_repeat_extend_encodeBlockAsm10B + MOVD (R9)(R11), R10 + ADD R11, R9, R15 + MOVD 8(R15), R12 + MOVD (R5)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_repeat_extend_encodeBlockAsm10B + ADD R11, R5, R15 + MOVD 8(R15), R16 + EOR R16, R12, R12 + TST R12, R12 + BNE matchlen_bsf_16repeat_extend_encodeBlockAsm10B + SUB $16, R8, R8 + MOVWU R8, R8 + ADD $16, R11, R11 + MOVWU R11, R11 + JMP matchlen_loopback_16_repeat_extend_encodeBlockAsm10B + +matchlen_bsf_16repeat_extend_encodeBlockAsm10B: + RBIT R12, R12 + CLZ R12, R12 + ASR $0x03, R12, R12 + ADD R12, R11, R11 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP repeat_extend_forward_end_encodeBlockAsm10B + +matchlen_match8_repeat_extend_encodeBlockAsm10B: + CMPW $0x08, R8 + BLO matchlen_match4_repeat_extend_encodeBlockAsm10B + MOVD (R9)(R11), R10 + MOVD (R5)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_repeat_extend_encodeBlockAsm10B + SUB $8, R8, R8 + MOVWU R8, R8 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP matchlen_match4_repeat_extend_encodeBlockAsm10B + +matchlen_bsf_8_repeat_extend_encodeBlockAsm10B: + RBIT R10, R10 + CLZ R10, R10 + ASR $0x03, R10, R10 + ADD R10, R11, R11 + MOVWU R11, R11 + JMP repeat_extend_forward_end_encodeBlockAsm10B + +matchlen_match4_repeat_extend_encodeBlockAsm10B: + CMPW $0x04, R8 + BLO matchlen_match2_repeat_extend_encodeBlockAsm10B + MOVWU (R9)(R11), R10 + MOVWU (R5)(R11), R16 + CMPW R10, R16 + BNE matchlen_match2_repeat_extend_encodeBlockAsm10B + SUB $4, R8, R8 + MOVWU R8, R8 + ADD $4, R11, R11 + MOVWU R11, R11 + +matchlen_match2_repeat_extend_encodeBlockAsm10B: + CMPW $0x01, R8 + BEQ matchlen_match1_repeat_extend_encodeBlockAsm10B + BLO repeat_extend_forward_end_encodeBlockAsm10B + MOVHU (R9)(R11), R16 + BFI $0, R16, $16, R10 + ADD R11, R5, R15 + MOVHU (R15), R15 + AND $0xffff, R10, R16 + CMP R16, R15 + BNE matchlen_match1_repeat_extend_encodeBlockAsm10B + ADD $2, R11, R11 + MOVWU R11, R11 + SUBSW $0x02, R8, R8 + BEQ repeat_extend_forward_end_encodeBlockAsm10B + +matchlen_match1_repeat_extend_encodeBlockAsm10B: + MOVBU (R9)(R11), R16 + BFI $0, R16, $8, R10 + ADD R11, R5, R15 + MOVBU (R15), R15 + AND $0xff, R10, R16 + CMP R16, R15 + BNE repeat_extend_forward_end_encodeBlockAsm10B + ADD $1, R11, R11 + MOVWU R11, R11 + +repeat_extend_forward_end_encodeBlockAsm10B: + ADDW R11, R2, R2 + MOVWU R2, R5 + SUBW R6, R5, R5 + MOVWU 24(RSP), R6 + TSTW R7, R7 + BEQ repeat_as_copy_encodeBlockAsm10B + + // emitRepeat + MOVWU R5, R7 + SUB $4, R5, R5 + MOVWU R5, R5 + CMPW $0x08, R7 + BLS repeat_two_match_repeat_encodeBlockAsm10B + CMPW $0x0c, R7 + BHS cant_repeat_two_offset_match_repeat_encodeBlockAsm10B + CMPW $0x00000800, R6 + BLO repeat_two_offset_match_repeat_encodeBlockAsm10B + +cant_repeat_two_offset_match_repeat_encodeBlockAsm10B: + CMPW $0x00000104, R5 + BLO repeat_three_match_repeat_encodeBlockAsm10B + SUB $256, R5, R5 + MOVWU R5, R5 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R5, 2(R1) + ADD $0x04, R1, R1 + JMP repeat_end_emit_encodeBlockAsm10B + +repeat_three_match_repeat_encodeBlockAsm10B: + SUB $4, R5, R5 + MOVWU R5, R5 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R5, 2(R1) + ADD $0x03, R1, R1 + JMP repeat_end_emit_encodeBlockAsm10B + +repeat_two_match_repeat_encodeBlockAsm10B: + LSLW $0x02, R5, R5 + ORRW $0x01, R5, R5 + MOVH R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm10B + +repeat_two_offset_match_repeat_encodeBlockAsm10B: + MOVD $0, R7 + ADD R5<<2, R7, R5 + ADD $1, R5, R5 + MOVWU R5, R5 + MOVB R6, 1(R1) + ASRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm10B + +repeat_as_copy_encodeBlockAsm10B: + // emitCopy + CMPW $0x40, R5 + BLS two_byte_offset_short_repeat_as_copy_encodeBlockAsm10B + CMPW $0x00000800, R6 + BHS long_offset_short_repeat_as_copy_encodeBlockAsm10B + MOVD $0x00000001, R7 + ADD $16, R7, R7 + MOVWU R7, R7 + MOVB R6, 1(R1) + LSRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R7, R7 + MOVB R7, (R1) + ADD $0x02, R1, R1 + SUBW $0x08, R5, R5 + + // emitRepeat + SUB $4, R5, R5 + MOVWU R5, R5 + JMP cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm10B_emit_copy_short_2b + MOVWU R5, R7 + SUB $4, R5, R5 + MOVWU R5, R5 + CMPW $0x08, R7 + BLS repeat_two_repeat_as_copy_encodeBlockAsm10B_emit_copy_short_2b + CMPW $0x0c, R7 + BHS cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm10B_emit_copy_short_2b + CMPW $0x00000800, R6 + BLO repeat_two_offset_repeat_as_copy_encodeBlockAsm10B_emit_copy_short_2b + +cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm10B_emit_copy_short_2b: + CMPW $0x00000104, R5 + BLO repeat_three_repeat_as_copy_encodeBlockAsm10B_emit_copy_short_2b + SUB $256, R5, R5 + MOVWU R5, R5 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R5, 2(R1) + ADD $0x04, R1, R1 + JMP repeat_end_emit_encodeBlockAsm10B + +repeat_three_repeat_as_copy_encodeBlockAsm10B_emit_copy_short_2b: + SUB $4, R5, R5 + MOVWU R5, R5 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R5, 2(R1) + ADD $0x03, R1, R1 + JMP repeat_end_emit_encodeBlockAsm10B + +repeat_two_repeat_as_copy_encodeBlockAsm10B_emit_copy_short_2b: + LSLW $0x02, R5, R5 + ORRW $0x01, R5, R5 + MOVH R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm10B + +repeat_two_offset_repeat_as_copy_encodeBlockAsm10B_emit_copy_short_2b: + MOVD $0, R7 + ADD R5<<2, R7, R5 + ADD $1, R5, R5 + MOVWU R5, R5 + MOVB R6, 1(R1) + ASRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm10B + +long_offset_short_repeat_as_copy_encodeBlockAsm10B: + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R6, 1(R1) + SUB $60, R5, R5 + MOVWU R5, R5 + ADD $0x03, R1, R1 + + // emitRepeat + MOVWU R5, R7 + SUB $4, R5, R5 + MOVWU R5, R5 + CMPW $0x08, R7 + BLS repeat_two_repeat_as_copy_encodeBlockAsm10B_emit_copy_short + CMPW $0x0c, R7 + BHS cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm10B_emit_copy_short + CMPW $0x00000800, R6 + BLO repeat_two_offset_repeat_as_copy_encodeBlockAsm10B_emit_copy_short + +cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm10B_emit_copy_short: + CMPW $0x00000104, R5 + BLO repeat_three_repeat_as_copy_encodeBlockAsm10B_emit_copy_short + SUB $256, R5, R5 + MOVWU R5, R5 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R5, 2(R1) + ADD $0x04, R1, R1 + JMP repeat_end_emit_encodeBlockAsm10B + +repeat_three_repeat_as_copy_encodeBlockAsm10B_emit_copy_short: + SUB $4, R5, R5 + MOVWU R5, R5 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R5, 2(R1) + ADD $0x03, R1, R1 + JMP repeat_end_emit_encodeBlockAsm10B + +repeat_two_repeat_as_copy_encodeBlockAsm10B_emit_copy_short: + LSLW $0x02, R5, R5 + ORRW $0x01, R5, R5 + MOVH R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm10B + +repeat_two_offset_repeat_as_copy_encodeBlockAsm10B_emit_copy_short: + MOVD $0, R7 + ADD R5<<2, R7, R5 + ADD $1, R5, R5 + MOVWU R5, R5 + MOVB R6, 1(R1) + ASRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm10B + +two_byte_offset_short_repeat_as_copy_encodeBlockAsm10B: + MOVWU R5, R7 + LSLW $0x02, R7, R7 + CMPW $0x0c, R5 + BHS emit_copy_three_repeat_as_copy_encodeBlockAsm10B + CMPW $0x00000800, R6 + BHS emit_copy_three_repeat_as_copy_encodeBlockAsm10B + SUB $15, R7, R7 + MOVWU R7, R7 + MOVB R6, 1(R1) + LSRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R7, R7 + MOVB R7, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm10B + +emit_copy_three_repeat_as_copy_encodeBlockAsm10B: + SUB $2, R7, R7 + MOVWU R7, R7 + MOVB R7, (R1) + MOVH R6, 1(R1) + ADD $0x03, R1, R1 + +repeat_end_emit_encodeBlockAsm10B: + MOVW R2, 20(RSP) + JMP search_loop_encodeBlockAsm10B + +no_repeat_found_encodeBlockAsm10B: + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate_match_encodeBlockAsm10B + LSR $0x08, R6, R6 + MOVWU (R0)(R9<<2), R5 + ADD $2, R2, R8 + MOVWU R8, R8 + MOVWU (R3)(R7), R16 + CMPW R6, R16 + BEQ candidate2_match_encodeBlockAsm10B + MOVW R8, (R0)(R9<<2) + LSR $0x08, R6, R6 + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate3_match_encodeBlockAsm10B + MOVWU 28(RSP), R2 + JMP search_loop_encodeBlockAsm10B + +candidate3_match_encodeBlockAsm10B: + ADDW $0x02, R2, R2 + JMP candidate_match_encodeBlockAsm10B + +candidate2_match_encodeBlockAsm10B: + MOVW R8, (R0)(R9<<2) + ADDW $1, R2, R2 + MOVWU R7, R5 + +candidate_match_encodeBlockAsm10B: + MOVWU 20(RSP), R6 + TSTW R5, R5 + BEQ match_extend_back_end_encodeBlockAsm10B + +match_extend_back_loop_encodeBlockAsm10B: + CMPW R6, R2 + BLS match_extend_back_end_encodeBlockAsm10B + ADD R5, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R7 + ADD R2, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + AND $0xff, R8, R16 + AND $0xff, R7, R15 + CMP R16, R15 + BNE match_extend_back_end_encodeBlockAsm10B + SUB $1, R2, R2 + MOVWU R2, R2 + SUBSW $1, R5, R5 + BEQ match_extend_back_end_encodeBlockAsm10B + JMP match_extend_back_loop_encodeBlockAsm10B + +match_extend_back_end_encodeBlockAsm10B: + MOVWU R2, R6 + MOVWU 20(RSP), R16 + SUBW R16, R6, R6 + ADD R6, R1, R6 + ADD $3, R6, R6 + MOVD 8(RSP), R16 + CMP R16, R6 + BLO match_dst_size_check_encodeBlockAsm10B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_dst_size_check_encodeBlockAsm10B: + MOVWU R2, R6 + MOVWU 20(RSP), R7 + CMPW R6, R7 + BEQ emit_literal_done_match_emit_encodeBlockAsm10B + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R7, R3, R6 + SUBW R7, R8, R8 + SUB $1, R8, R7 + MOVWU R7, R7 + CMPW $0x3c, R7 + BLO one_byte_match_emit_encodeBlockAsm10B + CMPW $0x00000100, R7 + BLO two_bytes_match_emit_encodeBlockAsm10B + BLO three_bytes_match_emit_encodeBlockAsm10B + +three_bytes_match_emit_encodeBlockAsm10B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R7, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_match_emit_encodeBlockAsm10B + +two_bytes_match_emit_encodeBlockAsm10B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R7, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R7 + BLO memmove_match_emit_encodeBlockAsm10B + JMP memmove_long_match_emit_encodeBlockAsm10B + +one_byte_match_emit_encodeBlockAsm10B: + LSLW $0x02, R7, R16 + BFI $0, R16, $8, R7 + MOVB R7, (R1) + ADD $0x01, R1, R1 + +memmove_match_emit_encodeBlockAsm10B: + ADD R8, R1, R7 + + // genMemMoveShort + CMP $0x08, R8 + BLS emit_lit_memmove_match_emit_encodeBlockAsm10B_memmove_move_8 + CMP $0x10, R8 + BLS emit_lit_memmove_match_emit_encodeBlockAsm10B_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_match_emit_encodeBlockAsm10B_memmove_move_17through32 + JMP emit_lit_memmove_match_emit_encodeBlockAsm10B_memmove_move_33through64 + +emit_lit_memmove_match_emit_encodeBlockAsm10B_memmove_move_8: + MOVD (R6), R9 + MOVD R9, (R1) + JMP memmove_end_copy_match_emit_encodeBlockAsm10B + +emit_lit_memmove_match_emit_encodeBlockAsm10B_memmove_move_8through16: + MOVD (R6), R9 + ADD R8, R6, R15 + MOVD -8(R15), R6 + MOVD R9, (R1) + ADD R8, R1, R15 + MOVD R6, -8(R15) + JMP memmove_end_copy_match_emit_encodeBlockAsm10B + +emit_lit_memmove_match_emit_encodeBlockAsm10B_memmove_move_17through32: + FMOVQ (R6), F0 + ADD R8, R6, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_match_emit_encodeBlockAsm10B + +emit_lit_memmove_match_emit_encodeBlockAsm10B_memmove_move_33through64: + FMOVQ (R6), F0 + FMOVQ 16(R6), F1 + ADD R8, R6, R15 + FMOVQ -32(R15), F2 + ADD R8, R6, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_match_emit_encodeBlockAsm10B: + MOVD R7, R1 + JMP emit_literal_done_match_emit_encodeBlockAsm10B + +memmove_long_match_emit_encodeBlockAsm10B: + ADD R8, R1, R7 + + // genMemMoveLong + MOVD R6, R9 + MOVD R1, R10 + MOVD R8, R11 + +emit_lit_memmove_long_match_emit_encodeBlockAsm10Blarge_big_loop_back: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + FMOVQ F0, (R10) + FMOVQ F1, 16(R10) + ADD $0x20, R9, R9 + ADD $0x20, R10, R10 + SUB $0x20, R11, R11 + CMP $0x20, R11 + BHS emit_lit_memmove_long_match_emit_encodeBlockAsm10Blarge_big_loop_back + ADD R8, R6, R15 + FMOVQ -32(R15), F0 + ADD R8, R6, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R7, R1 + +emit_literal_done_match_emit_encodeBlockAsm10B: +match_nolit_loop_encodeBlockAsm10B: + MOVWU R2, R6 + SUBW R5, R6, R6 + MOVW R6, 24(RSP) + ADDW $0x04, R2, R2 + ADDW $0x04, R5, R5 + MOVD src_len+32(FP), R6 + SUBW R2, R6, R6 + ADD R2, R3, R7 + ADD R5, R3, R5 + + // matchLen + MOVD $0, R9 + +matchlen_loopback_16_match_nolit_encodeBlockAsm10B: + CMPW $0x10, R6 + BLO matchlen_match8_match_nolit_encodeBlockAsm10B + MOVD (R7)(R9), R8 + ADD R9, R7, R15 + MOVD 8(R15), R10 + MOVD (R5)(R9), R16 + EOR R16, R8, R8 + TST R8, R8 + BNE matchlen_bsf_8_match_nolit_encodeBlockAsm10B + ADD R9, R5, R15 + MOVD 8(R15), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_16match_nolit_encodeBlockAsm10B + SUB $16, R6, R6 + MOVWU R6, R6 + ADD $16, R9, R9 + MOVWU R9, R9 + JMP matchlen_loopback_16_match_nolit_encodeBlockAsm10B + +matchlen_bsf_16match_nolit_encodeBlockAsm10B: + RBIT R10, R10 + CLZ R10, R10 + ASR $0x03, R10, R10 + ADD R10, R9, R9 + ADD $8, R9, R9 + MOVWU R9, R9 + JMP match_nolit_end_encodeBlockAsm10B + +matchlen_match8_match_nolit_encodeBlockAsm10B: + CMPW $0x08, R6 + BLO matchlen_match4_match_nolit_encodeBlockAsm10B + MOVD (R7)(R9), R8 + MOVD (R5)(R9), R16 + EOR R16, R8, R8 + TST R8, R8 + BNE matchlen_bsf_8_match_nolit_encodeBlockAsm10B + SUB $8, R6, R6 + MOVWU R6, R6 + ADD $8, R9, R9 + MOVWU R9, R9 + JMP matchlen_match4_match_nolit_encodeBlockAsm10B + +matchlen_bsf_8_match_nolit_encodeBlockAsm10B: + RBIT R8, R8 + CLZ R8, R8 + ASR $0x03, R8, R8 + ADD R8, R9, R9 + MOVWU R9, R9 + JMP match_nolit_end_encodeBlockAsm10B + +matchlen_match4_match_nolit_encodeBlockAsm10B: + CMPW $0x04, R6 + BLO matchlen_match2_match_nolit_encodeBlockAsm10B + MOVWU (R7)(R9), R8 + MOVWU (R5)(R9), R16 + CMPW R8, R16 + BNE matchlen_match2_match_nolit_encodeBlockAsm10B + SUB $4, R6, R6 + MOVWU R6, R6 + ADD $4, R9, R9 + MOVWU R9, R9 + +matchlen_match2_match_nolit_encodeBlockAsm10B: + CMPW $0x01, R6 + BEQ matchlen_match1_match_nolit_encodeBlockAsm10B + BLO match_nolit_end_encodeBlockAsm10B + MOVHU (R7)(R9), R16 + BFI $0, R16, $16, R8 + ADD R9, R5, R15 + MOVHU (R15), R15 + AND $0xffff, R8, R16 + CMP R16, R15 + BNE matchlen_match1_match_nolit_encodeBlockAsm10B + ADD $2, R9, R9 + MOVWU R9, R9 + SUBSW $0x02, R6, R6 + BEQ match_nolit_end_encodeBlockAsm10B + +matchlen_match1_match_nolit_encodeBlockAsm10B: + MOVBU (R7)(R9), R16 + BFI $0, R16, $8, R8 + ADD R9, R5, R15 + MOVBU (R15), R15 + AND $0xff, R8, R16 + CMP R16, R15 + BNE match_nolit_end_encodeBlockAsm10B + ADD $1, R9, R9 + MOVWU R9, R9 + +match_nolit_end_encodeBlockAsm10B: + ADDW R9, R2, R2 + MOVWU 24(RSP), R5 + ADDW $0x04, R9, R9 + MOVW R2, 20(RSP) + + // emitCopy + CMPW $0x40, R9 + BLS two_byte_offset_short_match_nolit_encodeBlockAsm10B + CMPW $0x00000800, R5 + BHS long_offset_short_match_nolit_encodeBlockAsm10B + MOVD $0x00000001, R6 + ADD $16, R6, R6 + MOVWU R6, R6 + MOVB R5, 1(R1) + LSRW $0x08, R5, R5 + LSLW $0x05, R5, R5 + ORRW R5, R6, R6 + MOVB R6, (R1) + ADD $0x02, R1, R1 + SUBW $0x08, R9, R9 + + // emitRepeat + SUB $4, R9, R9 + MOVWU R9, R9 + JMP cant_repeat_two_offset_match_nolit_encodeBlockAsm10B_emit_copy_short_2b + MOVWU R9, R6 + SUB $4, R9, R9 + MOVWU R9, R9 + CMPW $0x08, R6 + BLS repeat_two_match_nolit_encodeBlockAsm10B_emit_copy_short_2b + CMPW $0x0c, R6 + BHS cant_repeat_two_offset_match_nolit_encodeBlockAsm10B_emit_copy_short_2b + CMPW $0x00000800, R5 + BLO repeat_two_offset_match_nolit_encodeBlockAsm10B_emit_copy_short_2b + +cant_repeat_two_offset_match_nolit_encodeBlockAsm10B_emit_copy_short_2b: + CMPW $0x00000104, R9 + BLO repeat_three_match_nolit_encodeBlockAsm10B_emit_copy_short_2b + SUB $256, R9, R9 + MOVWU R9, R9 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R9, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm10B + +repeat_three_match_nolit_encodeBlockAsm10B_emit_copy_short_2b: + SUB $4, R9, R9 + MOVWU R9, R9 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R9, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm10B + +repeat_two_match_nolit_encodeBlockAsm10B_emit_copy_short_2b: + LSLW $0x02, R9, R9 + ORRW $0x01, R9, R9 + MOVH R9, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm10B + +repeat_two_offset_match_nolit_encodeBlockAsm10B_emit_copy_short_2b: + MOVD $0, R6 + ADD R9<<2, R6, R9 + ADD $1, R9, R9 + MOVWU R9, R9 + MOVB R5, 1(R1) + ASRW $0x08, R5, R5 + LSLW $0x05, R5, R5 + ORRW R5, R9, R9 + MOVB R9, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm10B + +long_offset_short_match_nolit_encodeBlockAsm10B: + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + SUB $60, R9, R9 + MOVWU R9, R9 + ADD $0x03, R1, R1 + + // emitRepeat + MOVWU R9, R6 + SUB $4, R9, R9 + MOVWU R9, R9 + CMPW $0x08, R6 + BLS repeat_two_match_nolit_encodeBlockAsm10B_emit_copy_short + CMPW $0x0c, R6 + BHS cant_repeat_two_offset_match_nolit_encodeBlockAsm10B_emit_copy_short + CMPW $0x00000800, R5 + BLO repeat_two_offset_match_nolit_encodeBlockAsm10B_emit_copy_short + +cant_repeat_two_offset_match_nolit_encodeBlockAsm10B_emit_copy_short: + CMPW $0x00000104, R9 + BLO repeat_three_match_nolit_encodeBlockAsm10B_emit_copy_short + SUB $256, R9, R9 + MOVWU R9, R9 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R9, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm10B + +repeat_three_match_nolit_encodeBlockAsm10B_emit_copy_short: + SUB $4, R9, R9 + MOVWU R9, R9 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R9, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm10B + +repeat_two_match_nolit_encodeBlockAsm10B_emit_copy_short: + LSLW $0x02, R9, R9 + ORRW $0x01, R9, R9 + MOVH R9, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm10B + +repeat_two_offset_match_nolit_encodeBlockAsm10B_emit_copy_short: + MOVD $0, R6 + ADD R9<<2, R6, R9 + ADD $1, R9, R9 + MOVWU R9, R9 + MOVB R5, 1(R1) + ASRW $0x08, R5, R5 + LSLW $0x05, R5, R5 + ORRW R5, R9, R9 + MOVB R9, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm10B + +two_byte_offset_short_match_nolit_encodeBlockAsm10B: + MOVWU R9, R6 + LSLW $0x02, R6, R6 + CMPW $0x0c, R9 + BHS emit_copy_three_match_nolit_encodeBlockAsm10B + CMPW $0x00000800, R5 + BHS emit_copy_three_match_nolit_encodeBlockAsm10B + SUB $15, R6, R6 + MOVWU R6, R6 + MOVB R5, 1(R1) + LSRW $0x08, R5, R5 + LSLW $0x05, R5, R5 + ORRW R5, R6, R6 + MOVB R6, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm10B + +emit_copy_three_match_nolit_encodeBlockAsm10B: + SUB $2, R6, R6 + MOVWU R6, R6 + MOVB R6, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + +match_nolit_emitcopy_end_encodeBlockAsm10B: + MOVWU 16(RSP), R16 + CMPW R16, R2 + BHS emit_remainder_encodeBlockAsm10B + ADD R2, R3, R15 + MOVD -2(R15), R6 + MOVD 8(RSP), R16 + CMP R16, R1 + BLO match_nolit_dst_ok_encodeBlockAsm10B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_nolit_dst_ok_encodeBlockAsm10B: + MOVD $0x9e3779b1, R8 + MOVD R6, R7 + LSR $0x10, R6, R6 + MOVD R6, R5 + LSL $0x20, R7, R7 + MUL R8, R7, R7 + LSR $0x36, R7, R7 + LSL $0x20, R5, R5 + MUL R8, R5, R5 + LSR $0x36, R5, R5 + SUB $2, R2, R8 + MOVWU R8, R8 + ADD R5<<2, R0, R9 + MOVWU (R9), R5 + MOVW R8, (R0)(R7<<2) + MOVW R2, (R9) + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ match_nolit_loop_encodeBlockAsm10B + ADDW $1, R2, R2 + JMP search_loop_encodeBlockAsm10B + +emit_remainder_encodeBlockAsm10B: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R16 + SUBW R16, R0, R0 + ADD R0, R1, R0 + ADD $3, R0, R0 + MOVD 8(RSP), R16 + CMP R16, R0 + BLO emit_remainder_ok_encodeBlockAsm10B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +emit_remainder_ok_encodeBlockAsm10B: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R2 + CMPW R0, R2 + BEQ emit_literal_done_emit_remainder_encodeBlockAsm10B + MOVWU R0, R5 + MOVW R0, 20(RSP) + ADD R2, R3, R0 + SUBW R2, R5, R5 + SUB $1, R5, R2 + MOVWU R2, R2 + CMPW $0x3c, R2 + BLO one_byte_emit_remainder_encodeBlockAsm10B + CMPW $0x00000100, R2 + BLO two_bytes_emit_remainder_encodeBlockAsm10B + BLO three_bytes_emit_remainder_encodeBlockAsm10B + +three_bytes_emit_remainder_encodeBlockAsm10B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R2, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_emit_remainder_encodeBlockAsm10B + +two_bytes_emit_remainder_encodeBlockAsm10B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R2, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R2 + BLO memmove_emit_remainder_encodeBlockAsm10B + JMP memmove_long_emit_remainder_encodeBlockAsm10B + +one_byte_emit_remainder_encodeBlockAsm10B: + LSLW $0x02, R2, R16 + BFI $0, R16, $8, R2 + MOVB R2, (R1) + ADD $0x01, R1, R1 + +memmove_emit_remainder_encodeBlockAsm10B: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveShort + CMP $0x03, R3 + BLO emit_lit_memmove_emit_remainder_encodeBlockAsm10B_memmove_move_1or2 + BEQ emit_lit_memmove_emit_remainder_encodeBlockAsm10B_memmove_move_3 + CMP $0x08, R3 + BLO emit_lit_memmove_emit_remainder_encodeBlockAsm10B_memmove_move_4through7 + CMP $0x10, R3 + BLS emit_lit_memmove_emit_remainder_encodeBlockAsm10B_memmove_move_8through16 + CMP $0x20, R3 + BLS emit_lit_memmove_emit_remainder_encodeBlockAsm10B_memmove_move_17through32 + JMP emit_lit_memmove_emit_remainder_encodeBlockAsm10B_memmove_move_33through64 + +emit_lit_memmove_emit_remainder_encodeBlockAsm10B_memmove_move_1or2: + MOVBU (R0), R16 + BFI $0, R16, $8, R5 + ADD R3, R0, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R0 + MOVB R5, (R1) + ADD R3, R1, R15 + MOVB R0, -1(R15) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm10B + +emit_lit_memmove_emit_remainder_encodeBlockAsm10B_memmove_move_3: + MOVHU (R0), R16 + BFI $0, R16, $16, R5 + MOVBU 2(R0), R16 + BFI $0, R16, $8, R0 + MOVH R5, (R1) + MOVB R0, 2(R1) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm10B + +emit_lit_memmove_emit_remainder_encodeBlockAsm10B_memmove_move_4through7: + MOVWU (R0), R5 + ADD R3, R0, R15 + MOVWU -4(R15), R0 + MOVW R5, (R1) + ADD R3, R1, R15 + MOVW R0, -4(R15) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm10B + +emit_lit_memmove_emit_remainder_encodeBlockAsm10B_memmove_move_8through16: + MOVD (R0), R5 + ADD R3, R0, R15 + MOVD -8(R15), R0 + MOVD R5, (R1) + ADD R3, R1, R15 + MOVD R0, -8(R15) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm10B + +emit_lit_memmove_emit_remainder_encodeBlockAsm10B_memmove_move_17through32: + FMOVQ (R0), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm10B + +emit_lit_memmove_emit_remainder_encodeBlockAsm10B_memmove_move_33through64: + FMOVQ (R0), F0 + FMOVQ 16(R0), F1 + ADD R3, R0, R15 + FMOVQ -32(R15), F2 + ADD R3, R0, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R3, R1, R15 + FMOVQ F2, -32(R15) + ADD R3, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_emit_remainder_encodeBlockAsm10B: + MOVD R2, R1 + JMP emit_literal_done_emit_remainder_encodeBlockAsm10B + +memmove_long_emit_remainder_encodeBlockAsm10B: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveLong + MOVD R0, R5 + MOVD R1, R6 + MOVD R3, R7 + +emit_lit_memmove_long_emit_remainder_encodeBlockAsm10Blarge_big_loop_back: + FMOVQ (R5), F0 + FMOVQ 16(R5), F1 + FMOVQ F0, (R6) + FMOVQ F1, 16(R6) + ADD $0x20, R5, R5 + ADD $0x20, R6, R6 + SUB $0x20, R7, R7 + CMP $0x20, R7 + BHS emit_lit_memmove_long_emit_remainder_encodeBlockAsm10Blarge_big_loop_back + ADD R3, R0, R15 + FMOVQ -32(R15), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + ADD R3, R1, R15 + FMOVQ F0, -32(R15) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + MOVD R2, R1 + +emit_literal_done_emit_remainder_encodeBlockAsm10B: + MOVD dst_base+0(FP), R0 + SUB R0, R1, R1 + MOVD R1, ret+56(FP) + RET + +// func encodeBlockAsm8B(dst []byte, src []byte, tmp *[1024]byte) int +// Requires: BMI, SSE2 +TEXT ·encodeBlockAsm8B(SB), $24-64 + MOVD tmp+48(FP), R0 + MOVD dst_base+0(FP), R1 + MOVD $0x00000008, R2 + MOVD R0, R3 + VEOR V0.B16, V0.B16, V0.B16 + +zero_loop_encodeBlockAsm8B: + FMOVQ F0, (R3) + FMOVQ F0, 16(R3) + FMOVQ F0, 32(R3) + FMOVQ F0, 48(R3) + FMOVQ F0, 64(R3) + FMOVQ F0, 80(R3) + FMOVQ F0, 96(R3) + FMOVQ F0, 112(R3) + ADD $0x80, R3, R3 + SUBS $1, R2, R2 + BNE zero_loop_encodeBlockAsm8B + MOVD $0x00000000, R16 + MOVW R16, 20(RSP) + MOVD src_len+32(FP), R2 + SUB $9, R2, R3 + SUB $8, R2, R5 + MOVW R5, 16(RSP) + LSR $0x05, R2, R2 + SUBW R2, R3, R3 + ADD R3, R1, R3 + MOVD R3, 8(RSP) + MOVD $0x00000001, R2 + MOVW R2, 24(RSP) + MOVD src_base+24(FP), R3 + +search_loop_encodeBlockAsm8B: + MOVWU R2, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + LSRW $0x04, R5, R5 + ADD R5, R2, R5 + ADD $4, R5, R5 + MOVWU R5, R5 + MOVWU 16(RSP), R16 + CMPW R16, R5 + BHS emit_remainder_encodeBlockAsm8B + MOVD (R3)(R2), R6 + MOVW R5, 28(RSP) + MOVD $0x9e3779b1, R8 + MOVD R6, R9 + MOVD R6, R10 + LSR $0x08, R10, R10 + LSL $0x20, R9, R9 + MUL R8, R9, R9 + LSR $0x38, R9, R9 + LSL $0x20, R10, R10 + MUL R8, R10, R10 + LSR $0x38, R10, R10 + MOVWU (R0)(R9<<2), R5 + MOVWU (R0)(R10<<2), R7 + MOVW R2, (R0)(R9<<2) + ADD $1, R2, R9 + MOVWU R9, R9 + MOVW R9, (R0)(R10<<2) + MOVD R6, R9 + LSR $0x10, R9, R9 + LSL $0x20, R9, R9 + MUL R8, R9, R9 + LSR $0x38, R9, R9 + MOVWU R2, R8 + MOVWU 24(RSP), R16 + SUBW R16, R8, R8 + ADD R8, R3, R15 + MOVWU 1(R15), R10 + MOVD R6, R8 + LSR $0x08, R8, R8 + CMPW R10, R8 + BNE no_repeat_found_encodeBlockAsm8B + ADD $1, R2, R6 + MOVWU R6, R6 + MOVWU 20(RSP), R7 + MOVWU R6, R5 + MOVWU 24(RSP), R16 + SUBSW R16, R5, R5 + BEQ repeat_extend_back_end_encodeBlockAsm8B + +repeat_extend_back_loop_encodeBlockAsm8B: + CMPW R7, R6 + BLS repeat_extend_back_end_encodeBlockAsm8B + ADD R5, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + ADD R6, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R9 + AND $0xff, R9, R16 + AND $0xff, R8, R15 + CMP R16, R15 + BNE repeat_extend_back_end_encodeBlockAsm8B + SUB $1, R6, R6 + MOVWU R6, R6 + SUBSW $1, R5, R5 + BNE repeat_extend_back_loop_encodeBlockAsm8B + +repeat_extend_back_end_encodeBlockAsm8B: + MOVWU R6, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + ADD R5, R1, R5 + ADD $3, R5, R5 + MOVD 8(RSP), R16 + CMP R16, R5 + BLO repeat_dst_size_check_encodeBlockAsm8B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +repeat_dst_size_check_encodeBlockAsm8B: + MOVWU 20(RSP), R5 + CMPW R6, R5 + BEQ emit_literal_done_repeat_emit_encodeBlockAsm8B + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R5, R3, R9 + SUBW R5, R8, R8 + SUB $1, R8, R5 + MOVWU R5, R5 + CMPW $0x3c, R5 + BLO one_byte_repeat_emit_encodeBlockAsm8B + CMPW $0x00000100, R5 + BLO two_bytes_repeat_emit_encodeBlockAsm8B + BLO three_bytes_repeat_emit_encodeBlockAsm8B + +three_bytes_repeat_emit_encodeBlockAsm8B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_repeat_emit_encodeBlockAsm8B + +two_bytes_repeat_emit_encodeBlockAsm8B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R5, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R5 + BLO memmove_repeat_emit_encodeBlockAsm8B + JMP memmove_long_repeat_emit_encodeBlockAsm8B + +one_byte_repeat_emit_encodeBlockAsm8B: + LSLW $0x02, R5, R16 + BFI $0, R16, $8, R5 + MOVB R5, (R1) + ADD $0x01, R1, R1 + +memmove_repeat_emit_encodeBlockAsm8B: + ADD R8, R1, R5 + + // genMemMoveShort + CMP $0x08, R8 + BLS emit_lit_memmove_repeat_emit_encodeBlockAsm8B_memmove_move_8 + CMP $0x10, R8 + BLS emit_lit_memmove_repeat_emit_encodeBlockAsm8B_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_repeat_emit_encodeBlockAsm8B_memmove_move_17through32 + JMP emit_lit_memmove_repeat_emit_encodeBlockAsm8B_memmove_move_33through64 + +emit_lit_memmove_repeat_emit_encodeBlockAsm8B_memmove_move_8: + MOVD (R9), R10 + MOVD R10, (R1) + JMP memmove_end_copy_repeat_emit_encodeBlockAsm8B + +emit_lit_memmove_repeat_emit_encodeBlockAsm8B_memmove_move_8through16: + MOVD (R9), R10 + ADD R8, R9, R15 + MOVD -8(R15), R9 + MOVD R10, (R1) + ADD R8, R1, R15 + MOVD R9, -8(R15) + JMP memmove_end_copy_repeat_emit_encodeBlockAsm8B + +emit_lit_memmove_repeat_emit_encodeBlockAsm8B_memmove_move_17through32: + FMOVQ (R9), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_repeat_emit_encodeBlockAsm8B + +emit_lit_memmove_repeat_emit_encodeBlockAsm8B_memmove_move_33through64: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + ADD R8, R9, R15 + FMOVQ -32(R15), F2 + ADD R8, R9, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_repeat_emit_encodeBlockAsm8B: + MOVD R5, R1 + JMP emit_literal_done_repeat_emit_encodeBlockAsm8B + +memmove_long_repeat_emit_encodeBlockAsm8B: + ADD R8, R1, R5 + + // genMemMoveLong + MOVD R9, R10 + MOVD R1, R11 + MOVD R8, R12 + +emit_lit_memmove_long_repeat_emit_encodeBlockAsm8Blarge_big_loop_back: + FMOVQ (R10), F0 + FMOVQ 16(R10), F1 + FMOVQ F0, (R11) + FMOVQ F1, 16(R11) + ADD $0x20, R10, R10 + ADD $0x20, R11, R11 + SUB $0x20, R12, R12 + CMP $0x20, R12 + BHS emit_lit_memmove_long_repeat_emit_encodeBlockAsm8Blarge_big_loop_back + ADD R8, R9, R15 + FMOVQ -32(R15), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R5, R1 + +emit_literal_done_repeat_emit_encodeBlockAsm8B: + ADDW $0x05, R2, R2 + MOVWU R2, R5 + MOVWU 24(RSP), R16 + SUBW R16, R5, R5 + MOVD src_len+32(FP), R8 + SUBW R2, R8, R8 + ADD R2, R3, R9 + ADD R5, R3, R5 + + // matchLen + MOVD $0, R11 + +matchlen_loopback_16_repeat_extend_encodeBlockAsm8B: + CMPW $0x10, R8 + BLO matchlen_match8_repeat_extend_encodeBlockAsm8B + MOVD (R9)(R11), R10 + ADD R11, R9, R15 + MOVD 8(R15), R12 + MOVD (R5)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_repeat_extend_encodeBlockAsm8B + ADD R11, R5, R15 + MOVD 8(R15), R16 + EOR R16, R12, R12 + TST R12, R12 + BNE matchlen_bsf_16repeat_extend_encodeBlockAsm8B + SUB $16, R8, R8 + MOVWU R8, R8 + ADD $16, R11, R11 + MOVWU R11, R11 + JMP matchlen_loopback_16_repeat_extend_encodeBlockAsm8B + +matchlen_bsf_16repeat_extend_encodeBlockAsm8B: + RBIT R12, R12 + CLZ R12, R12 + ASR $0x03, R12, R12 + ADD R12, R11, R11 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP repeat_extend_forward_end_encodeBlockAsm8B + +matchlen_match8_repeat_extend_encodeBlockAsm8B: + CMPW $0x08, R8 + BLO matchlen_match4_repeat_extend_encodeBlockAsm8B + MOVD (R9)(R11), R10 + MOVD (R5)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_repeat_extend_encodeBlockAsm8B + SUB $8, R8, R8 + MOVWU R8, R8 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP matchlen_match4_repeat_extend_encodeBlockAsm8B + +matchlen_bsf_8_repeat_extend_encodeBlockAsm8B: + RBIT R10, R10 + CLZ R10, R10 + ASR $0x03, R10, R10 + ADD R10, R11, R11 + MOVWU R11, R11 + JMP repeat_extend_forward_end_encodeBlockAsm8B + +matchlen_match4_repeat_extend_encodeBlockAsm8B: + CMPW $0x04, R8 + BLO matchlen_match2_repeat_extend_encodeBlockAsm8B + MOVWU (R9)(R11), R10 + MOVWU (R5)(R11), R16 + CMPW R10, R16 + BNE matchlen_match2_repeat_extend_encodeBlockAsm8B + SUB $4, R8, R8 + MOVWU R8, R8 + ADD $4, R11, R11 + MOVWU R11, R11 + +matchlen_match2_repeat_extend_encodeBlockAsm8B: + CMPW $0x01, R8 + BEQ matchlen_match1_repeat_extend_encodeBlockAsm8B + BLO repeat_extend_forward_end_encodeBlockAsm8B + MOVHU (R9)(R11), R16 + BFI $0, R16, $16, R10 + ADD R11, R5, R15 + MOVHU (R15), R15 + AND $0xffff, R10, R16 + CMP R16, R15 + BNE matchlen_match1_repeat_extend_encodeBlockAsm8B + ADD $2, R11, R11 + MOVWU R11, R11 + SUBSW $0x02, R8, R8 + BEQ repeat_extend_forward_end_encodeBlockAsm8B + +matchlen_match1_repeat_extend_encodeBlockAsm8B: + MOVBU (R9)(R11), R16 + BFI $0, R16, $8, R10 + ADD R11, R5, R15 + MOVBU (R15), R15 + AND $0xff, R10, R16 + CMP R16, R15 + BNE repeat_extend_forward_end_encodeBlockAsm8B + ADD $1, R11, R11 + MOVWU R11, R11 + +repeat_extend_forward_end_encodeBlockAsm8B: + ADDW R11, R2, R2 + MOVWU R2, R5 + SUBW R6, R5, R5 + MOVWU 24(RSP), R6 + TSTW R7, R7 + BEQ repeat_as_copy_encodeBlockAsm8B + + // emitRepeat + MOVWU R5, R6 + SUB $4, R5, R5 + MOVWU R5, R5 + CMPW $0x08, R6 + BLS repeat_two_match_repeat_encodeBlockAsm8B + CMPW $0x0c, R6 + BHS cant_repeat_two_offset_match_repeat_encodeBlockAsm8B + +cant_repeat_two_offset_match_repeat_encodeBlockAsm8B: + CMPW $0x00000104, R5 + BLO repeat_three_match_repeat_encodeBlockAsm8B + SUB $256, R5, R5 + MOVWU R5, R5 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R5, 2(R1) + ADD $0x04, R1, R1 + JMP repeat_end_emit_encodeBlockAsm8B + +repeat_three_match_repeat_encodeBlockAsm8B: + SUB $4, R5, R5 + MOVWU R5, R5 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R5, 2(R1) + ADD $0x03, R1, R1 + JMP repeat_end_emit_encodeBlockAsm8B + +repeat_two_match_repeat_encodeBlockAsm8B: + LSLW $0x02, R5, R5 + ORRW $0x01, R5, R5 + MOVH R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm8B + MOVD $0, R7 + ADD R5<<2, R7, R5 + ADD $1, R5, R5 + MOVWU R5, R5 + MOVB R6, 1(R1) + ASRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm8B + +repeat_as_copy_encodeBlockAsm8B: + // emitCopy + CMPW $0x40, R5 + BLS two_byte_offset_short_repeat_as_copy_encodeBlockAsm8B + CMPW $0x00000800, R6 + BHS long_offset_short_repeat_as_copy_encodeBlockAsm8B + MOVD $0x00000001, R7 + ADD $16, R7, R7 + MOVWU R7, R7 + MOVB R6, 1(R1) + LSRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R7, R7 + MOVB R7, (R1) + ADD $0x02, R1, R1 + SUBW $0x08, R5, R5 + + // emitRepeat + SUB $4, R5, R5 + MOVWU R5, R5 + JMP cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm8B_emit_copy_short_2b + MOVWU R5, R6 + SUB $4, R5, R5 + MOVWU R5, R5 + CMPW $0x08, R6 + BLS repeat_two_repeat_as_copy_encodeBlockAsm8B_emit_copy_short_2b + CMPW $0x0c, R6 + BHS cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm8B_emit_copy_short_2b + +cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm8B_emit_copy_short_2b: + CMPW $0x00000104, R5 + BLO repeat_three_repeat_as_copy_encodeBlockAsm8B_emit_copy_short_2b + SUB $256, R5, R5 + MOVWU R5, R5 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R5, 2(R1) + ADD $0x04, R1, R1 + JMP repeat_end_emit_encodeBlockAsm8B + +repeat_three_repeat_as_copy_encodeBlockAsm8B_emit_copy_short_2b: + SUB $4, R5, R5 + MOVWU R5, R5 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R5, 2(R1) + ADD $0x03, R1, R1 + JMP repeat_end_emit_encodeBlockAsm8B + +repeat_two_repeat_as_copy_encodeBlockAsm8B_emit_copy_short_2b: + LSLW $0x02, R5, R5 + ORRW $0x01, R5, R5 + MOVH R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm8B + MOVD $0, R7 + ADD R5<<2, R7, R5 + ADD $1, R5, R5 + MOVWU R5, R5 + MOVB R6, 1(R1) + ASRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm8B + +long_offset_short_repeat_as_copy_encodeBlockAsm8B: + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R6, 1(R1) + SUB $60, R5, R5 + MOVWU R5, R5 + ADD $0x03, R1, R1 + + // emitRepeat + MOVWU R5, R6 + SUB $4, R5, R5 + MOVWU R5, R5 + CMPW $0x08, R6 + BLS repeat_two_repeat_as_copy_encodeBlockAsm8B_emit_copy_short + CMPW $0x0c, R6 + BHS cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm8B_emit_copy_short + +cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm8B_emit_copy_short: + CMPW $0x00000104, R5 + BLO repeat_three_repeat_as_copy_encodeBlockAsm8B_emit_copy_short + SUB $256, R5, R5 + MOVWU R5, R5 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R5, 2(R1) + ADD $0x04, R1, R1 + JMP repeat_end_emit_encodeBlockAsm8B + +repeat_three_repeat_as_copy_encodeBlockAsm8B_emit_copy_short: + SUB $4, R5, R5 + MOVWU R5, R5 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R5, 2(R1) + ADD $0x03, R1, R1 + JMP repeat_end_emit_encodeBlockAsm8B + +repeat_two_repeat_as_copy_encodeBlockAsm8B_emit_copy_short: + LSLW $0x02, R5, R5 + ORRW $0x01, R5, R5 + MOVH R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm8B + MOVD $0, R7 + ADD R5<<2, R7, R5 + ADD $1, R5, R5 + MOVWU R5, R5 + MOVB R6, 1(R1) + ASRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm8B + +two_byte_offset_short_repeat_as_copy_encodeBlockAsm8B: + MOVWU R5, R7 + LSLW $0x02, R7, R7 + CMPW $0x0c, R5 + BHS emit_copy_three_repeat_as_copy_encodeBlockAsm8B + SUB $15, R7, R7 + MOVWU R7, R7 + MOVB R6, 1(R1) + LSRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R7, R7 + MOVB R7, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeBlockAsm8B + +emit_copy_three_repeat_as_copy_encodeBlockAsm8B: + SUB $2, R7, R7 + MOVWU R7, R7 + MOVB R7, (R1) + MOVH R6, 1(R1) + ADD $0x03, R1, R1 + +repeat_end_emit_encodeBlockAsm8B: + MOVW R2, 20(RSP) + JMP search_loop_encodeBlockAsm8B + +no_repeat_found_encodeBlockAsm8B: + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate_match_encodeBlockAsm8B + LSR $0x08, R6, R6 + MOVWU (R0)(R9<<2), R5 + ADD $2, R2, R8 + MOVWU R8, R8 + MOVWU (R3)(R7), R16 + CMPW R6, R16 + BEQ candidate2_match_encodeBlockAsm8B + MOVW R8, (R0)(R9<<2) + LSR $0x08, R6, R6 + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate3_match_encodeBlockAsm8B + MOVWU 28(RSP), R2 + JMP search_loop_encodeBlockAsm8B + +candidate3_match_encodeBlockAsm8B: + ADDW $0x02, R2, R2 + JMP candidate_match_encodeBlockAsm8B + +candidate2_match_encodeBlockAsm8B: + MOVW R8, (R0)(R9<<2) + ADDW $1, R2, R2 + MOVWU R7, R5 + +candidate_match_encodeBlockAsm8B: + MOVWU 20(RSP), R6 + TSTW R5, R5 + BEQ match_extend_back_end_encodeBlockAsm8B + +match_extend_back_loop_encodeBlockAsm8B: + CMPW R6, R2 + BLS match_extend_back_end_encodeBlockAsm8B + ADD R5, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R7 + ADD R2, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + AND $0xff, R8, R16 + AND $0xff, R7, R15 + CMP R16, R15 + BNE match_extend_back_end_encodeBlockAsm8B + SUB $1, R2, R2 + MOVWU R2, R2 + SUBSW $1, R5, R5 + BEQ match_extend_back_end_encodeBlockAsm8B + JMP match_extend_back_loop_encodeBlockAsm8B + +match_extend_back_end_encodeBlockAsm8B: + MOVWU R2, R6 + MOVWU 20(RSP), R16 + SUBW R16, R6, R6 + ADD R6, R1, R6 + ADD $3, R6, R6 + MOVD 8(RSP), R16 + CMP R16, R6 + BLO match_dst_size_check_encodeBlockAsm8B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_dst_size_check_encodeBlockAsm8B: + MOVWU R2, R6 + MOVWU 20(RSP), R7 + CMPW R6, R7 + BEQ emit_literal_done_match_emit_encodeBlockAsm8B + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R7, R3, R6 + SUBW R7, R8, R8 + SUB $1, R8, R7 + MOVWU R7, R7 + CMPW $0x3c, R7 + BLO one_byte_match_emit_encodeBlockAsm8B + CMPW $0x00000100, R7 + BLO two_bytes_match_emit_encodeBlockAsm8B + BLO three_bytes_match_emit_encodeBlockAsm8B + +three_bytes_match_emit_encodeBlockAsm8B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R7, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_match_emit_encodeBlockAsm8B + +two_bytes_match_emit_encodeBlockAsm8B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R7, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R7 + BLO memmove_match_emit_encodeBlockAsm8B + JMP memmove_long_match_emit_encodeBlockAsm8B + +one_byte_match_emit_encodeBlockAsm8B: + LSLW $0x02, R7, R16 + BFI $0, R16, $8, R7 + MOVB R7, (R1) + ADD $0x01, R1, R1 + +memmove_match_emit_encodeBlockAsm8B: + ADD R8, R1, R7 + + // genMemMoveShort + CMP $0x08, R8 + BLS emit_lit_memmove_match_emit_encodeBlockAsm8B_memmove_move_8 + CMP $0x10, R8 + BLS emit_lit_memmove_match_emit_encodeBlockAsm8B_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_match_emit_encodeBlockAsm8B_memmove_move_17through32 + JMP emit_lit_memmove_match_emit_encodeBlockAsm8B_memmove_move_33through64 + +emit_lit_memmove_match_emit_encodeBlockAsm8B_memmove_move_8: + MOVD (R6), R9 + MOVD R9, (R1) + JMP memmove_end_copy_match_emit_encodeBlockAsm8B + +emit_lit_memmove_match_emit_encodeBlockAsm8B_memmove_move_8through16: + MOVD (R6), R9 + ADD R8, R6, R15 + MOVD -8(R15), R6 + MOVD R9, (R1) + ADD R8, R1, R15 + MOVD R6, -8(R15) + JMP memmove_end_copy_match_emit_encodeBlockAsm8B + +emit_lit_memmove_match_emit_encodeBlockAsm8B_memmove_move_17through32: + FMOVQ (R6), F0 + ADD R8, R6, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_match_emit_encodeBlockAsm8B + +emit_lit_memmove_match_emit_encodeBlockAsm8B_memmove_move_33through64: + FMOVQ (R6), F0 + FMOVQ 16(R6), F1 + ADD R8, R6, R15 + FMOVQ -32(R15), F2 + ADD R8, R6, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_match_emit_encodeBlockAsm8B: + MOVD R7, R1 + JMP emit_literal_done_match_emit_encodeBlockAsm8B + +memmove_long_match_emit_encodeBlockAsm8B: + ADD R8, R1, R7 + + // genMemMoveLong + MOVD R6, R9 + MOVD R1, R10 + MOVD R8, R11 + +emit_lit_memmove_long_match_emit_encodeBlockAsm8Blarge_big_loop_back: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + FMOVQ F0, (R10) + FMOVQ F1, 16(R10) + ADD $0x20, R9, R9 + ADD $0x20, R10, R10 + SUB $0x20, R11, R11 + CMP $0x20, R11 + BHS emit_lit_memmove_long_match_emit_encodeBlockAsm8Blarge_big_loop_back + ADD R8, R6, R15 + FMOVQ -32(R15), F0 + ADD R8, R6, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R7, R1 + +emit_literal_done_match_emit_encodeBlockAsm8B: +match_nolit_loop_encodeBlockAsm8B: + MOVWU R2, R6 + SUBW R5, R6, R6 + MOVW R6, 24(RSP) + ADDW $0x04, R2, R2 + ADDW $0x04, R5, R5 + MOVD src_len+32(FP), R6 + SUBW R2, R6, R6 + ADD R2, R3, R7 + ADD R5, R3, R5 + + // matchLen + MOVD $0, R9 + +matchlen_loopback_16_match_nolit_encodeBlockAsm8B: + CMPW $0x10, R6 + BLO matchlen_match8_match_nolit_encodeBlockAsm8B + MOVD (R7)(R9), R8 + ADD R9, R7, R15 + MOVD 8(R15), R10 + MOVD (R5)(R9), R16 + EOR R16, R8, R8 + TST R8, R8 + BNE matchlen_bsf_8_match_nolit_encodeBlockAsm8B + ADD R9, R5, R15 + MOVD 8(R15), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_16match_nolit_encodeBlockAsm8B + SUB $16, R6, R6 + MOVWU R6, R6 + ADD $16, R9, R9 + MOVWU R9, R9 + JMP matchlen_loopback_16_match_nolit_encodeBlockAsm8B + +matchlen_bsf_16match_nolit_encodeBlockAsm8B: + RBIT R10, R10 + CLZ R10, R10 + ASR $0x03, R10, R10 + ADD R10, R9, R9 + ADD $8, R9, R9 + MOVWU R9, R9 + JMP match_nolit_end_encodeBlockAsm8B + +matchlen_match8_match_nolit_encodeBlockAsm8B: + CMPW $0x08, R6 + BLO matchlen_match4_match_nolit_encodeBlockAsm8B + MOVD (R7)(R9), R8 + MOVD (R5)(R9), R16 + EOR R16, R8, R8 + TST R8, R8 + BNE matchlen_bsf_8_match_nolit_encodeBlockAsm8B + SUB $8, R6, R6 + MOVWU R6, R6 + ADD $8, R9, R9 + MOVWU R9, R9 + JMP matchlen_match4_match_nolit_encodeBlockAsm8B + +matchlen_bsf_8_match_nolit_encodeBlockAsm8B: + RBIT R8, R8 + CLZ R8, R8 + ASR $0x03, R8, R8 + ADD R8, R9, R9 + MOVWU R9, R9 + JMP match_nolit_end_encodeBlockAsm8B + +matchlen_match4_match_nolit_encodeBlockAsm8B: + CMPW $0x04, R6 + BLO matchlen_match2_match_nolit_encodeBlockAsm8B + MOVWU (R7)(R9), R8 + MOVWU (R5)(R9), R16 + CMPW R8, R16 + BNE matchlen_match2_match_nolit_encodeBlockAsm8B + SUB $4, R6, R6 + MOVWU R6, R6 + ADD $4, R9, R9 + MOVWU R9, R9 + +matchlen_match2_match_nolit_encodeBlockAsm8B: + CMPW $0x01, R6 + BEQ matchlen_match1_match_nolit_encodeBlockAsm8B + BLO match_nolit_end_encodeBlockAsm8B + MOVHU (R7)(R9), R16 + BFI $0, R16, $16, R8 + ADD R9, R5, R15 + MOVHU (R15), R15 + AND $0xffff, R8, R16 + CMP R16, R15 + BNE matchlen_match1_match_nolit_encodeBlockAsm8B + ADD $2, R9, R9 + MOVWU R9, R9 + SUBSW $0x02, R6, R6 + BEQ match_nolit_end_encodeBlockAsm8B + +matchlen_match1_match_nolit_encodeBlockAsm8B: + MOVBU (R7)(R9), R16 + BFI $0, R16, $8, R8 + ADD R9, R5, R15 + MOVBU (R15), R15 + AND $0xff, R8, R16 + CMP R16, R15 + BNE match_nolit_end_encodeBlockAsm8B + ADD $1, R9, R9 + MOVWU R9, R9 + +match_nolit_end_encodeBlockAsm8B: + ADDW R9, R2, R2 + MOVWU 24(RSP), R5 + ADDW $0x04, R9, R9 + MOVW R2, 20(RSP) + + // emitCopy + CMPW $0x40, R9 + BLS two_byte_offset_short_match_nolit_encodeBlockAsm8B + CMPW $0x00000800, R5 + BHS long_offset_short_match_nolit_encodeBlockAsm8B + MOVD $0x00000001, R6 + ADD $16, R6, R6 + MOVWU R6, R6 + MOVB R5, 1(R1) + LSRW $0x08, R5, R5 + LSLW $0x05, R5, R5 + ORRW R5, R6, R6 + MOVB R6, (R1) + ADD $0x02, R1, R1 + SUBW $0x08, R9, R9 + + // emitRepeat + SUB $4, R9, R9 + MOVWU R9, R9 + JMP cant_repeat_two_offset_match_nolit_encodeBlockAsm8B_emit_copy_short_2b + MOVWU R9, R5 + SUB $4, R9, R9 + MOVWU R9, R9 + CMPW $0x08, R5 + BLS repeat_two_match_nolit_encodeBlockAsm8B_emit_copy_short_2b + CMPW $0x0c, R5 + BHS cant_repeat_two_offset_match_nolit_encodeBlockAsm8B_emit_copy_short_2b + +cant_repeat_two_offset_match_nolit_encodeBlockAsm8B_emit_copy_short_2b: + CMPW $0x00000104, R9 + BLO repeat_three_match_nolit_encodeBlockAsm8B_emit_copy_short_2b + SUB $256, R9, R9 + MOVWU R9, R9 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R9, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm8B + +repeat_three_match_nolit_encodeBlockAsm8B_emit_copy_short_2b: + SUB $4, R9, R9 + MOVWU R9, R9 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R9, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm8B + +repeat_two_match_nolit_encodeBlockAsm8B_emit_copy_short_2b: + LSLW $0x02, R9, R9 + ORRW $0x01, R9, R9 + MOVH R9, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm8B + MOVD $0, R6 + ADD R9<<2, R6, R9 + ADD $1, R9, R9 + MOVWU R9, R9 + MOVB R5, 1(R1) + ASRW $0x08, R5, R5 + LSLW $0x05, R5, R5 + ORRW R5, R9, R9 + MOVB R9, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm8B + +long_offset_short_match_nolit_encodeBlockAsm8B: + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + SUB $60, R9, R9 + MOVWU R9, R9 + ADD $0x03, R1, R1 + + // emitRepeat + MOVWU R9, R5 + SUB $4, R9, R9 + MOVWU R9, R9 + CMPW $0x08, R5 + BLS repeat_two_match_nolit_encodeBlockAsm8B_emit_copy_short + CMPW $0x0c, R5 + BHS cant_repeat_two_offset_match_nolit_encodeBlockAsm8B_emit_copy_short + +cant_repeat_two_offset_match_nolit_encodeBlockAsm8B_emit_copy_short: + CMPW $0x00000104, R9 + BLO repeat_three_match_nolit_encodeBlockAsm8B_emit_copy_short + SUB $256, R9, R9 + MOVWU R9, R9 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R9, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm8B + +repeat_three_match_nolit_encodeBlockAsm8B_emit_copy_short: + SUB $4, R9, R9 + MOVWU R9, R9 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R9, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm8B + +repeat_two_match_nolit_encodeBlockAsm8B_emit_copy_short: + LSLW $0x02, R9, R9 + ORRW $0x01, R9, R9 + MOVH R9, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm8B + MOVD $0, R6 + ADD R9<<2, R6, R9 + ADD $1, R9, R9 + MOVWU R9, R9 + MOVB R5, 1(R1) + ASRW $0x08, R5, R5 + LSLW $0x05, R5, R5 + ORRW R5, R9, R9 + MOVB R9, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm8B + +two_byte_offset_short_match_nolit_encodeBlockAsm8B: + MOVWU R9, R6 + LSLW $0x02, R6, R6 + CMPW $0x0c, R9 + BHS emit_copy_three_match_nolit_encodeBlockAsm8B + SUB $15, R6, R6 + MOVWU R6, R6 + MOVB R5, 1(R1) + LSRW $0x08, R5, R5 + LSLW $0x05, R5, R5 + ORRW R5, R6, R6 + MOVB R6, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBlockAsm8B + +emit_copy_three_match_nolit_encodeBlockAsm8B: + SUB $2, R6, R6 + MOVWU R6, R6 + MOVB R6, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + +match_nolit_emitcopy_end_encodeBlockAsm8B: + MOVWU 16(RSP), R16 + CMPW R16, R2 + BHS emit_remainder_encodeBlockAsm8B + ADD R2, R3, R15 + MOVD -2(R15), R6 + MOVD 8(RSP), R16 + CMP R16, R1 + BLO match_nolit_dst_ok_encodeBlockAsm8B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_nolit_dst_ok_encodeBlockAsm8B: + MOVD $0x9e3779b1, R8 + MOVD R6, R7 + LSR $0x10, R6, R6 + MOVD R6, R5 + LSL $0x20, R7, R7 + MUL R8, R7, R7 + LSR $0x38, R7, R7 + LSL $0x20, R5, R5 + MUL R8, R5, R5 + LSR $0x38, R5, R5 + SUB $2, R2, R8 + MOVWU R8, R8 + ADD R5<<2, R0, R9 + MOVWU (R9), R5 + MOVW R8, (R0)(R7<<2) + MOVW R2, (R9) + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ match_nolit_loop_encodeBlockAsm8B + ADDW $1, R2, R2 + JMP search_loop_encodeBlockAsm8B + +emit_remainder_encodeBlockAsm8B: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R16 + SUBW R16, R0, R0 + ADD R0, R1, R0 + ADD $3, R0, R0 + MOVD 8(RSP), R16 + CMP R16, R0 + BLO emit_remainder_ok_encodeBlockAsm8B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +emit_remainder_ok_encodeBlockAsm8B: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R2 + CMPW R0, R2 + BEQ emit_literal_done_emit_remainder_encodeBlockAsm8B + MOVWU R0, R5 + MOVW R0, 20(RSP) + ADD R2, R3, R0 + SUBW R2, R5, R5 + SUB $1, R5, R2 + MOVWU R2, R2 + CMPW $0x3c, R2 + BLO one_byte_emit_remainder_encodeBlockAsm8B + CMPW $0x00000100, R2 + BLO two_bytes_emit_remainder_encodeBlockAsm8B + BLO three_bytes_emit_remainder_encodeBlockAsm8B + +three_bytes_emit_remainder_encodeBlockAsm8B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R2, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_emit_remainder_encodeBlockAsm8B + +two_bytes_emit_remainder_encodeBlockAsm8B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R2, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R2 + BLO memmove_emit_remainder_encodeBlockAsm8B + JMP memmove_long_emit_remainder_encodeBlockAsm8B + +one_byte_emit_remainder_encodeBlockAsm8B: + LSLW $0x02, R2, R16 + BFI $0, R16, $8, R2 + MOVB R2, (R1) + ADD $0x01, R1, R1 + +memmove_emit_remainder_encodeBlockAsm8B: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveShort + CMP $0x03, R3 + BLO emit_lit_memmove_emit_remainder_encodeBlockAsm8B_memmove_move_1or2 + BEQ emit_lit_memmove_emit_remainder_encodeBlockAsm8B_memmove_move_3 + CMP $0x08, R3 + BLO emit_lit_memmove_emit_remainder_encodeBlockAsm8B_memmove_move_4through7 + CMP $0x10, R3 + BLS emit_lit_memmove_emit_remainder_encodeBlockAsm8B_memmove_move_8through16 + CMP $0x20, R3 + BLS emit_lit_memmove_emit_remainder_encodeBlockAsm8B_memmove_move_17through32 + JMP emit_lit_memmove_emit_remainder_encodeBlockAsm8B_memmove_move_33through64 + +emit_lit_memmove_emit_remainder_encodeBlockAsm8B_memmove_move_1or2: + MOVBU (R0), R16 + BFI $0, R16, $8, R5 + ADD R3, R0, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R0 + MOVB R5, (R1) + ADD R3, R1, R15 + MOVB R0, -1(R15) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm8B + +emit_lit_memmove_emit_remainder_encodeBlockAsm8B_memmove_move_3: + MOVHU (R0), R16 + BFI $0, R16, $16, R5 + MOVBU 2(R0), R16 + BFI $0, R16, $8, R0 + MOVH R5, (R1) + MOVB R0, 2(R1) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm8B + +emit_lit_memmove_emit_remainder_encodeBlockAsm8B_memmove_move_4through7: + MOVWU (R0), R5 + ADD R3, R0, R15 + MOVWU -4(R15), R0 + MOVW R5, (R1) + ADD R3, R1, R15 + MOVW R0, -4(R15) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm8B + +emit_lit_memmove_emit_remainder_encodeBlockAsm8B_memmove_move_8through16: + MOVD (R0), R5 + ADD R3, R0, R15 + MOVD -8(R15), R0 + MOVD R5, (R1) + ADD R3, R1, R15 + MOVD R0, -8(R15) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm8B + +emit_lit_memmove_emit_remainder_encodeBlockAsm8B_memmove_move_17through32: + FMOVQ (R0), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_emit_remainder_encodeBlockAsm8B + +emit_lit_memmove_emit_remainder_encodeBlockAsm8B_memmove_move_33through64: + FMOVQ (R0), F0 + FMOVQ 16(R0), F1 + ADD R3, R0, R15 + FMOVQ -32(R15), F2 + ADD R3, R0, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R3, R1, R15 + FMOVQ F2, -32(R15) + ADD R3, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_emit_remainder_encodeBlockAsm8B: + MOVD R2, R1 + JMP emit_literal_done_emit_remainder_encodeBlockAsm8B + +memmove_long_emit_remainder_encodeBlockAsm8B: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveLong + MOVD R0, R5 + MOVD R1, R6 + MOVD R3, R7 + +emit_lit_memmove_long_emit_remainder_encodeBlockAsm8Blarge_big_loop_back: + FMOVQ (R5), F0 + FMOVQ 16(R5), F1 + FMOVQ F0, (R6) + FMOVQ F1, 16(R6) + ADD $0x20, R5, R5 + ADD $0x20, R6, R6 + SUB $0x20, R7, R7 + CMP $0x20, R7 + BHS emit_lit_memmove_long_emit_remainder_encodeBlockAsm8Blarge_big_loop_back + ADD R3, R0, R15 + FMOVQ -32(R15), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + ADD R3, R1, R15 + FMOVQ F0, -32(R15) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + MOVD R2, R1 + +emit_literal_done_emit_remainder_encodeBlockAsm8B: + MOVD dst_base+0(FP), R0 + SUB R0, R1, R1 + MOVD R1, ret+56(FP) + RET + +// func encodeBetterBlockAsm(dst []byte, src []byte, tmp *[589824]byte) int +// Requires: BMI, SSE2 +TEXT ·encodeBetterBlockAsm(SB), $24-64 + MOVD tmp+48(FP), R0 + MOVD dst_base+0(FP), R1 + MOVD $0x00001200, R2 + MOVD R0, R3 + VEOR V0.B16, V0.B16, V0.B16 + +zero_loop_encodeBetterBlockAsm: + FMOVQ F0, (R3) + FMOVQ F0, 16(R3) + FMOVQ F0, 32(R3) + FMOVQ F0, 48(R3) + FMOVQ F0, 64(R3) + FMOVQ F0, 80(R3) + FMOVQ F0, 96(R3) + FMOVQ F0, 112(R3) + ADD $0x80, R3, R3 + SUBS $1, R2, R2 + BNE zero_loop_encodeBetterBlockAsm + MOVD $0x00000000, R16 + MOVW R16, 20(RSP) + MOVD src_len+32(FP), R2 + SUB $6, R2, R3 + SUB $8, R2, R5 + MOVW R5, 16(RSP) + LSR $0x05, R2, R2 + SUBW R2, R3, R3 + ADD R3, R1, R3 + MOVD R3, 8(RSP) + MOVD $0x00000001, R2 + MOVD $0x00000000, R16 + MOVW R16, 24(RSP) + MOVD src_base+24(FP), R3 + +search_loop_encodeBetterBlockAsm: + MOVWU R2, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + LSRW $0x07, R5, R5 + CMPW $0x63, R5 + BLS check_maxskip_ok_encodeBetterBlockAsm + ADD $100, R2, R5 + MOVWU R5, R5 + JMP check_maxskip_cont_encodeBetterBlockAsm + +check_maxskip_ok_encodeBetterBlockAsm: + ADD R5, R2, R5 + ADD $1, R5, R5 + MOVWU R5, R5 + +check_maxskip_cont_encodeBetterBlockAsm: + MOVWU 16(RSP), R16 + CMPW R16, R5 + BHS emit_remainder_encodeBetterBlockAsm + MOVD (R3)(R2), R6 + MOVW R5, 28(RSP) + MOVD $0x00cf1bbcdcbfa563, R8 + MOVD $0x9e3779b1, R5 + MOVD R6, R9 + MOVD R6, R10 + LSL $0x08, R9, R9 + MUL R8, R9, R9 + LSR $0x2f, R9, R9 + LSL $0x20, R10, R10 + MUL R5, R10, R10 + LSR $0x32, R10, R10 + MOVWU (R0)(R9<<2), R5 + ADD R10<<2, R0, R15 + MOVWU 524288(R15), R7 + MOVW R2, (R0)(R9<<2) + ADD R10<<2, R0, R15 + MOVW R2, 524288(R15) + MOVD (R3)(R5), R9 + MOVD (R3)(R7), R10 + CMP R6, R9 + BEQ candidate_match_encodeBetterBlockAsm + CMP R6, R10 + BNE no_short_found_encodeBetterBlockAsm + MOVWU R7, R5 + JMP candidate_match_encodeBetterBlockAsm + +no_short_found_encodeBetterBlockAsm: + CMPW R6, R9 + BEQ candidate_match_encodeBetterBlockAsm + CMPW R6, R10 + BEQ candidateS_match_encodeBetterBlockAsm + MOVWU 28(RSP), R2 + JMP search_loop_encodeBetterBlockAsm + +candidateS_match_encodeBetterBlockAsm: + LSR $0x08, R6, R6 + MOVD R6, R9 + LSL $0x08, R9, R9 + MUL R8, R9, R9 + LSR $0x2f, R9, R9 + MOVWU (R0)(R9<<2), R5 + ADDW $1, R2, R2 + MOVW R2, (R0)(R9<<2) + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate_match_encodeBetterBlockAsm + SUBW $1, R2, R2 + MOVWU R7, R5 + +candidate_match_encodeBetterBlockAsm: + MOVWU 20(RSP), R6 + TSTW R5, R5 + BEQ match_extend_back_end_encodeBetterBlockAsm + +match_extend_back_loop_encodeBetterBlockAsm: + CMPW R6, R2 + BLS match_extend_back_end_encodeBetterBlockAsm + ADD R5, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R7 + ADD R2, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + AND $0xff, R8, R16 + AND $0xff, R7, R15 + CMP R16, R15 + BNE match_extend_back_end_encodeBetterBlockAsm + SUB $1, R2, R2 + MOVWU R2, R2 + SUBSW $1, R5, R5 + BEQ match_extend_back_end_encodeBetterBlockAsm + JMP match_extend_back_loop_encodeBetterBlockAsm + +match_extend_back_end_encodeBetterBlockAsm: + MOVWU R2, R6 + MOVWU 20(RSP), R16 + SUBW R16, R6, R6 + ADD R6, R1, R6 + ADD $5, R6, R6 + MOVD 8(RSP), R16 + CMP R16, R6 + BLO match_dst_size_check_encodeBetterBlockAsm + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_dst_size_check_encodeBetterBlockAsm: + MOVWU R2, R6 + ADDW $0x04, R2, R2 + ADDW $0x04, R5, R5 + MOVD src_len+32(FP), R7 + SUBW R2, R7, R7 + ADD R2, R3, R8 + ADD R5, R3, R9 + + // matchLen + MOVD $0, R11 + +matchlen_loopback_16_match_nolit_encodeBetterBlockAsm: + CMPW $0x10, R7 + BLO matchlen_match8_match_nolit_encodeBetterBlockAsm + MOVD (R8)(R11), R10 + ADD R11, R8, R15 + MOVD 8(R15), R12 + MOVD (R9)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_match_nolit_encodeBetterBlockAsm + ADD R11, R9, R15 + MOVD 8(R15), R16 + EOR R16, R12, R12 + TST R12, R12 + BNE matchlen_bsf_16match_nolit_encodeBetterBlockAsm + SUB $16, R7, R7 + MOVWU R7, R7 + ADD $16, R11, R11 + MOVWU R11, R11 + JMP matchlen_loopback_16_match_nolit_encodeBetterBlockAsm + +matchlen_bsf_16match_nolit_encodeBetterBlockAsm: + RBIT R12, R12 + CLZ R12, R12 + ASR $0x03, R12, R12 + ADD R12, R11, R11 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP match_nolit_end_encodeBetterBlockAsm + +matchlen_match8_match_nolit_encodeBetterBlockAsm: + CMPW $0x08, R7 + BLO matchlen_match4_match_nolit_encodeBetterBlockAsm + MOVD (R8)(R11), R10 + MOVD (R9)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_match_nolit_encodeBetterBlockAsm + SUB $8, R7, R7 + MOVWU R7, R7 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP matchlen_match4_match_nolit_encodeBetterBlockAsm + +matchlen_bsf_8_match_nolit_encodeBetterBlockAsm: + RBIT R10, R10 + CLZ R10, R10 + ASR $0x03, R10, R10 + ADD R10, R11, R11 + MOVWU R11, R11 + JMP match_nolit_end_encodeBetterBlockAsm + +matchlen_match4_match_nolit_encodeBetterBlockAsm: + CMPW $0x04, R7 + BLO matchlen_match2_match_nolit_encodeBetterBlockAsm + MOVWU (R8)(R11), R10 + MOVWU (R9)(R11), R16 + CMPW R10, R16 + BNE matchlen_match2_match_nolit_encodeBetterBlockAsm + SUB $4, R7, R7 + MOVWU R7, R7 + ADD $4, R11, R11 + MOVWU R11, R11 + +matchlen_match2_match_nolit_encodeBetterBlockAsm: + CMPW $0x01, R7 + BEQ matchlen_match1_match_nolit_encodeBetterBlockAsm + BLO match_nolit_end_encodeBetterBlockAsm + MOVHU (R8)(R11), R16 + BFI $0, R16, $16, R10 + ADD R11, R9, R15 + MOVHU (R15), R15 + AND $0xffff, R10, R16 + CMP R16, R15 + BNE matchlen_match1_match_nolit_encodeBetterBlockAsm + ADD $2, R11, R11 + MOVWU R11, R11 + SUBSW $0x02, R7, R7 + BEQ match_nolit_end_encodeBetterBlockAsm + +matchlen_match1_match_nolit_encodeBetterBlockAsm: + MOVBU (R8)(R11), R16 + BFI $0, R16, $8, R10 + ADD R11, R9, R15 + MOVBU (R15), R15 + AND $0xff, R10, R16 + CMP R16, R15 + BNE match_nolit_end_encodeBetterBlockAsm + ADD $1, R11, R11 + MOVWU R11, R11 + +match_nolit_end_encodeBetterBlockAsm: + MOVWU R2, R7 + SUBW R5, R7, R7 + + // Check if repeat + MOVWU 24(RSP), R16 + CMPW R7, R16 + BEQ match_is_repeat_encodeBetterBlockAsm + CMPW $0x01, R11 + BHI match_length_ok_encodeBetterBlockAsm + CMPW $0x0000ffff, R7 + BLS match_length_ok_encodeBetterBlockAsm + MOVWU 28(RSP), R2 + ADDW $1, R2, R2 + JMP search_loop_encodeBetterBlockAsm + +match_length_ok_encodeBetterBlockAsm: + MOVW R7, 24(RSP) + MOVWU 20(RSP), R5 + CMPW R6, R5 + BEQ emit_literal_done_match_emit_encodeBetterBlockAsm + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R5, R3, R9 + SUBW R5, R8, R8 + SUB $1, R8, R5 + MOVWU R5, R5 + CMPW $0x3c, R5 + BLO one_byte_match_emit_encodeBetterBlockAsm + CMPW $0x00000100, R5 + BLO two_bytes_match_emit_encodeBetterBlockAsm + CMPW $0x00010000, R5 + BLO three_bytes_match_emit_encodeBetterBlockAsm + CMPW $0x01000000, R5 + BLO four_bytes_match_emit_encodeBetterBlockAsm + MOVD $0xfc, R16 + MOVB R16, (R1) + MOVW R5, 1(R1) + ADD $0x05, R1, R1 + JMP memmove_long_match_emit_encodeBetterBlockAsm + +four_bytes_match_emit_encodeBetterBlockAsm: + MOVWU R5, R10 + LSRW $0x10, R10, R10 + MOVD $0xf8, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + MOVB R10, 3(R1) + ADD $0x04, R1, R1 + JMP memmove_long_match_emit_encodeBetterBlockAsm + +three_bytes_match_emit_encodeBetterBlockAsm: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_match_emit_encodeBetterBlockAsm + +two_bytes_match_emit_encodeBetterBlockAsm: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R5, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R5 + BLO memmove_match_emit_encodeBetterBlockAsm + JMP memmove_long_match_emit_encodeBetterBlockAsm + +one_byte_match_emit_encodeBetterBlockAsm: + LSLW $0x02, R5, R16 + BFI $0, R16, $8, R5 + MOVB R5, (R1) + ADD $0x01, R1, R1 + +memmove_match_emit_encodeBetterBlockAsm: + ADD R8, R1, R5 + + // genMemMoveShort + CMP $0x04, R8 + BLS emit_lit_memmove_match_emit_encodeBetterBlockAsm_memmove_move_4 + CMP $0x08, R8 + BLO emit_lit_memmove_match_emit_encodeBetterBlockAsm_memmove_move_4through7 + CMP $0x10, R8 + BLS emit_lit_memmove_match_emit_encodeBetterBlockAsm_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_match_emit_encodeBetterBlockAsm_memmove_move_17through32 + JMP emit_lit_memmove_match_emit_encodeBetterBlockAsm_memmove_move_33through64 + +emit_lit_memmove_match_emit_encodeBetterBlockAsm_memmove_move_4: + MOVWU (R9), R10 + MOVW R10, (R1) + JMP memmove_end_copy_match_emit_encodeBetterBlockAsm + +emit_lit_memmove_match_emit_encodeBetterBlockAsm_memmove_move_4through7: + MOVWU (R9), R10 + ADD R8, R9, R15 + MOVWU -4(R15), R9 + MOVW R10, (R1) + ADD R8, R1, R15 + MOVW R9, -4(R15) + JMP memmove_end_copy_match_emit_encodeBetterBlockAsm + +emit_lit_memmove_match_emit_encodeBetterBlockAsm_memmove_move_8through16: + MOVD (R9), R10 + ADD R8, R9, R15 + MOVD -8(R15), R9 + MOVD R10, (R1) + ADD R8, R1, R15 + MOVD R9, -8(R15) + JMP memmove_end_copy_match_emit_encodeBetterBlockAsm + +emit_lit_memmove_match_emit_encodeBetterBlockAsm_memmove_move_17through32: + FMOVQ (R9), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_match_emit_encodeBetterBlockAsm + +emit_lit_memmove_match_emit_encodeBetterBlockAsm_memmove_move_33through64: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + ADD R8, R9, R15 + FMOVQ -32(R15), F2 + ADD R8, R9, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_match_emit_encodeBetterBlockAsm: + MOVD R5, R1 + JMP emit_literal_done_match_emit_encodeBetterBlockAsm + +memmove_long_match_emit_encodeBetterBlockAsm: + ADD R8, R1, R5 + + // genMemMoveLong + MOVD R9, R10 + MOVD R1, R12 + MOVD R8, R13 + +emit_lit_memmove_long_match_emit_encodeBetterBlockAsmlarge_big_loop_back: + FMOVQ (R10), F0 + FMOVQ 16(R10), F1 + FMOVQ F0, (R12) + FMOVQ F1, 16(R12) + ADD $0x20, R10, R10 + ADD $0x20, R12, R12 + SUB $0x20, R13, R13 + CMP $0x20, R13 + BHS emit_lit_memmove_long_match_emit_encodeBetterBlockAsmlarge_big_loop_back + ADD R8, R9, R15 + FMOVQ -32(R15), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R5, R1 + +emit_literal_done_match_emit_encodeBetterBlockAsm: + ADDW R11, R2, R2 + ADDW $0x04, R11, R11 + MOVW R2, 20(RSP) + + // emitCopy + CMPW $0x00010000, R7 + BLO two_byte_offset_match_nolit_encodeBetterBlockAsm + CMPW $0x40, R11 + BLS four_bytes_remain_match_nolit_encodeBetterBlockAsm + MOVD $0xff, R16 + MOVB R16, (R1) + MOVW R7, 1(R1) + SUB $64, R11, R11 + MOVWU R11, R11 + ADD $0x05, R1, R1 + CMPW $0x04, R11 + BLO four_bytes_remain_match_nolit_encodeBetterBlockAsm + + // emitRepeat +emit_repeat_again_match_nolit_encodeBetterBlockAsm_emit_copy: + MOVWU R11, R5 + SUB $4, R11, R11 + MOVWU R11, R11 + CMPW $0x08, R5 + BLS repeat_two_match_nolit_encodeBetterBlockAsm_emit_copy + CMPW $0x0c, R5 + BHS cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy + CMPW $0x00000800, R7 + BLO repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy + +cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy: + CMPW $0x00000104, R11 + BLO repeat_three_match_nolit_encodeBetterBlockAsm_emit_copy + CMPW $0x00010100, R11 + BLO repeat_four_match_nolit_encodeBetterBlockAsm_emit_copy + CMPW $0x0100ffff, R11 + BLO repeat_five_match_nolit_encodeBetterBlockAsm_emit_copy + SUB $16842747, R11, R11 + MOVWU R11, R11 + MOVD $0xfffb001d, R16 + MOVW R16, (R1) + MOVD $0xff, R16 + MOVB R16, 4(R1) + ADD $0x05, R1, R1 + JMP emit_repeat_again_match_nolit_encodeBetterBlockAsm_emit_copy + +repeat_five_match_nolit_encodeBetterBlockAsm_emit_copy: + SUB $65536, R11, R11 + MOVWU R11, R11 + MOVWU R11, R7 + MOVD $0x001d, R16 + MOVH R16, (R1) + MOVH R11, 2(R1) + ASRW $0x10, R7, R7 + MOVB R7, 4(R1) + ADD $0x05, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm + +repeat_four_match_nolit_encodeBetterBlockAsm_emit_copy: + SUB $256, R11, R11 + MOVWU R11, R11 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R11, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm + +repeat_three_match_nolit_encodeBetterBlockAsm_emit_copy: + SUB $4, R11, R11 + MOVWU R11, R11 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R11, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm + +repeat_two_match_nolit_encodeBetterBlockAsm_emit_copy: + LSLW $0x02, R11, R11 + ORRW $0x01, R11, R11 + MOVH R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm + +repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy: + MOVD $0, R5 + ADD R11<<2, R5, R11 + ADD $1, R11, R11 + MOVWU R11, R11 + MOVB R7, 1(R1) + ASRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R11, R11 + MOVB R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm + +four_bytes_remain_match_nolit_encodeBetterBlockAsm: + TSTW R11, R11 + BEQ match_nolit_emitcopy_end_encodeBetterBlockAsm + MOVD $0, R5 + ADD R11<<2, R5, R11 + SUB $1, R11, R11 + MOVWU R11, R11 + MOVB R11, (R1) + MOVW R7, 1(R1) + ADD $0x05, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm + +two_byte_offset_match_nolit_encodeBetterBlockAsm: + CMPW $0x40, R11 + BLS two_byte_offset_short_match_nolit_encodeBetterBlockAsm + CMPW $0x00000800, R7 + BHS long_offset_short_match_nolit_encodeBetterBlockAsm + MOVD $0x00000001, R5 + ADD $16, R5, R5 + MOVWU R5, R5 + MOVB R7, 1(R1) + MOVWU R7, R8 + LSRW $0x08, R8, R8 + LSLW $0x05, R8, R8 + ORRW R8, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + SUBW $0x08, R11, R11 + + // emitRepeat + SUB $4, R11, R11 + MOVWU R11, R11 + JMP cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b + +emit_repeat_again_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b: + MOVWU R11, R5 + SUB $4, R11, R11 + MOVWU R11, R11 + CMPW $0x08, R5 + BLS repeat_two_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b + CMPW $0x0c, R5 + BHS cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b + CMPW $0x00000800, R7 + BLO repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b + +cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b: + CMPW $0x00000104, R11 + BLO repeat_three_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b + CMPW $0x00010100, R11 + BLO repeat_four_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b + CMPW $0x0100ffff, R11 + BLO repeat_five_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b + SUB $16842747, R11, R11 + MOVWU R11, R11 + MOVD $0xfffb001d, R16 + MOVW R16, (R1) + MOVD $0xff, R16 + MOVB R16, 4(R1) + ADD $0x05, R1, R1 + JMP emit_repeat_again_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b + +repeat_five_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b: + SUB $65536, R11, R11 + MOVWU R11, R11 + MOVWU R11, R7 + MOVD $0x001d, R16 + MOVH R16, (R1) + MOVH R11, 2(R1) + ASRW $0x10, R7, R7 + MOVB R7, 4(R1) + ADD $0x05, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm + +repeat_four_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b: + SUB $256, R11, R11 + MOVWU R11, R11 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R11, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm + +repeat_three_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b: + SUB $4, R11, R11 + MOVWU R11, R11 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R11, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm + +repeat_two_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b: + LSLW $0x02, R11, R11 + ORRW $0x01, R11, R11 + MOVH R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm + +repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b: + MOVD $0, R5 + ADD R11<<2, R5, R11 + ADD $1, R11, R11 + MOVWU R11, R11 + MOVB R7, 1(R1) + ASRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R11, R11 + MOVB R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm + +long_offset_short_match_nolit_encodeBetterBlockAsm: + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R7, 1(R1) + SUB $60, R11, R11 + MOVWU R11, R11 + ADD $0x03, R1, R1 + + // emitRepeat +emit_repeat_again_match_nolit_encodeBetterBlockAsm_emit_copy_short: + MOVWU R11, R5 + SUB $4, R11, R11 + MOVWU R11, R11 + CMPW $0x08, R5 + BLS repeat_two_match_nolit_encodeBetterBlockAsm_emit_copy_short + CMPW $0x0c, R5 + BHS cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy_short + CMPW $0x00000800, R7 + BLO repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy_short + +cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy_short: + CMPW $0x00000104, R11 + BLO repeat_three_match_nolit_encodeBetterBlockAsm_emit_copy_short + CMPW $0x00010100, R11 + BLO repeat_four_match_nolit_encodeBetterBlockAsm_emit_copy_short + CMPW $0x0100ffff, R11 + BLO repeat_five_match_nolit_encodeBetterBlockAsm_emit_copy_short + SUB $16842747, R11, R11 + MOVWU R11, R11 + MOVD $0xfffb001d, R16 + MOVW R16, (R1) + MOVD $0xff, R16 + MOVB R16, 4(R1) + ADD $0x05, R1, R1 + JMP emit_repeat_again_match_nolit_encodeBetterBlockAsm_emit_copy_short + +repeat_five_match_nolit_encodeBetterBlockAsm_emit_copy_short: + SUB $65536, R11, R11 + MOVWU R11, R11 + MOVWU R11, R7 + MOVD $0x001d, R16 + MOVH R16, (R1) + MOVH R11, 2(R1) + ASRW $0x10, R7, R7 + MOVB R7, 4(R1) + ADD $0x05, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm + +repeat_four_match_nolit_encodeBetterBlockAsm_emit_copy_short: + SUB $256, R11, R11 + MOVWU R11, R11 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R11, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm + +repeat_three_match_nolit_encodeBetterBlockAsm_emit_copy_short: + SUB $4, R11, R11 + MOVWU R11, R11 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R11, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm + +repeat_two_match_nolit_encodeBetterBlockAsm_emit_copy_short: + LSLW $0x02, R11, R11 + ORRW $0x01, R11, R11 + MOVH R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm + +repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy_short: + MOVD $0, R5 + ADD R11<<2, R5, R11 + ADD $1, R11, R11 + MOVWU R11, R11 + MOVB R7, 1(R1) + ASRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R11, R11 + MOVB R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm + +two_byte_offset_short_match_nolit_encodeBetterBlockAsm: + MOVWU R11, R5 + LSLW $0x02, R5, R5 + CMPW $0x0c, R11 + BHS emit_copy_three_match_nolit_encodeBetterBlockAsm + CMPW $0x00000800, R7 + BHS emit_copy_three_match_nolit_encodeBetterBlockAsm + SUB $15, R5, R5 + MOVWU R5, R5 + MOVB R7, 1(R1) + LSRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm + +emit_copy_three_match_nolit_encodeBetterBlockAsm: + SUB $2, R5, R5 + MOVWU R5, R5 + MOVB R5, (R1) + MOVH R7, 1(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm + +match_is_repeat_encodeBetterBlockAsm: + MOVWU 20(RSP), R5 + CMPW R6, R5 + BEQ emit_literal_done_match_emit_repeat_encodeBetterBlockAsm + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R5, R3, R9 + SUBW R5, R8, R8 + SUB $1, R8, R5 + MOVWU R5, R5 + CMPW $0x3c, R5 + BLO one_byte_match_emit_repeat_encodeBetterBlockAsm + CMPW $0x00000100, R5 + BLO two_bytes_match_emit_repeat_encodeBetterBlockAsm + CMPW $0x00010000, R5 + BLO three_bytes_match_emit_repeat_encodeBetterBlockAsm + CMPW $0x01000000, R5 + BLO four_bytes_match_emit_repeat_encodeBetterBlockAsm + MOVD $0xfc, R16 + MOVB R16, (R1) + MOVW R5, 1(R1) + ADD $0x05, R1, R1 + JMP memmove_long_match_emit_repeat_encodeBetterBlockAsm + +four_bytes_match_emit_repeat_encodeBetterBlockAsm: + MOVWU R5, R10 + LSRW $0x10, R10, R10 + MOVD $0xf8, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + MOVB R10, 3(R1) + ADD $0x04, R1, R1 + JMP memmove_long_match_emit_repeat_encodeBetterBlockAsm + +three_bytes_match_emit_repeat_encodeBetterBlockAsm: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_match_emit_repeat_encodeBetterBlockAsm + +two_bytes_match_emit_repeat_encodeBetterBlockAsm: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R5, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R5 + BLO memmove_match_emit_repeat_encodeBetterBlockAsm + JMP memmove_long_match_emit_repeat_encodeBetterBlockAsm + +one_byte_match_emit_repeat_encodeBetterBlockAsm: + LSLW $0x02, R5, R16 + BFI $0, R16, $8, R5 + MOVB R5, (R1) + ADD $0x01, R1, R1 + +memmove_match_emit_repeat_encodeBetterBlockAsm: + ADD R8, R1, R5 + + // genMemMoveShort + CMP $0x04, R8 + BLS emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm_memmove_move_4 + CMP $0x08, R8 + BLO emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm_memmove_move_4through7 + CMP $0x10, R8 + BLS emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm_memmove_move_17through32 + JMP emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm_memmove_move_33through64 + +emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm_memmove_move_4: + MOVWU (R9), R10 + MOVW R10, (R1) + JMP memmove_end_copy_match_emit_repeat_encodeBetterBlockAsm + +emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm_memmove_move_4through7: + MOVWU (R9), R10 + ADD R8, R9, R15 + MOVWU -4(R15), R9 + MOVW R10, (R1) + ADD R8, R1, R15 + MOVW R9, -4(R15) + JMP memmove_end_copy_match_emit_repeat_encodeBetterBlockAsm + +emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm_memmove_move_8through16: + MOVD (R9), R10 + ADD R8, R9, R15 + MOVD -8(R15), R9 + MOVD R10, (R1) + ADD R8, R1, R15 + MOVD R9, -8(R15) + JMP memmove_end_copy_match_emit_repeat_encodeBetterBlockAsm + +emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm_memmove_move_17through32: + FMOVQ (R9), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_match_emit_repeat_encodeBetterBlockAsm + +emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm_memmove_move_33through64: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + ADD R8, R9, R15 + FMOVQ -32(R15), F2 + ADD R8, R9, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_match_emit_repeat_encodeBetterBlockAsm: + MOVD R5, R1 + JMP emit_literal_done_match_emit_repeat_encodeBetterBlockAsm + +memmove_long_match_emit_repeat_encodeBetterBlockAsm: + ADD R8, R1, R5 + + // genMemMoveLong + MOVD R9, R10 + MOVD R1, R12 + MOVD R8, R13 + +emit_lit_memmove_long_match_emit_repeat_encodeBetterBlockAsmlarge_big_loop_back: + FMOVQ (R10), F0 + FMOVQ 16(R10), F1 + FMOVQ F0, (R12) + FMOVQ F1, 16(R12) + ADD $0x20, R10, R10 + ADD $0x20, R12, R12 + SUB $0x20, R13, R13 + CMP $0x20, R13 + BHS emit_lit_memmove_long_match_emit_repeat_encodeBetterBlockAsmlarge_big_loop_back + ADD R8, R9, R15 + FMOVQ -32(R15), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R5, R1 + +emit_literal_done_match_emit_repeat_encodeBetterBlockAsm: + ADDW R11, R2, R2 + ADDW $0x04, R11, R11 + MOVW R2, 20(RSP) + + // emitRepeat +emit_repeat_again_match_nolit_repeat_encodeBetterBlockAsm: + MOVWU R11, R5 + SUB $4, R11, R11 + MOVWU R11, R11 + CMPW $0x08, R5 + BLS repeat_two_match_nolit_repeat_encodeBetterBlockAsm + CMPW $0x0c, R5 + BHS cant_repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm + CMPW $0x00000800, R7 + BLO repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm + +cant_repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm: + CMPW $0x00000104, R11 + BLO repeat_three_match_nolit_repeat_encodeBetterBlockAsm + CMPW $0x00010100, R11 + BLO repeat_four_match_nolit_repeat_encodeBetterBlockAsm + CMPW $0x0100ffff, R11 + BLO repeat_five_match_nolit_repeat_encodeBetterBlockAsm + SUB $16842747, R11, R11 + MOVWU R11, R11 + MOVD $0xfffb001d, R16 + MOVW R16, (R1) + MOVD $0xff, R16 + MOVB R16, 4(R1) + ADD $0x05, R1, R1 + JMP emit_repeat_again_match_nolit_repeat_encodeBetterBlockAsm + +repeat_five_match_nolit_repeat_encodeBetterBlockAsm: + SUB $65536, R11, R11 + MOVWU R11, R11 + MOVWU R11, R7 + MOVD $0x001d, R16 + MOVH R16, (R1) + MOVH R11, 2(R1) + ASRW $0x10, R7, R7 + MOVB R7, 4(R1) + ADD $0x05, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm + +repeat_four_match_nolit_repeat_encodeBetterBlockAsm: + SUB $256, R11, R11 + MOVWU R11, R11 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R11, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm + +repeat_three_match_nolit_repeat_encodeBetterBlockAsm: + SUB $4, R11, R11 + MOVWU R11, R11 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R11, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm + +repeat_two_match_nolit_repeat_encodeBetterBlockAsm: + LSLW $0x02, R11, R11 + ORRW $0x01, R11, R11 + MOVH R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm + +repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm: + MOVD $0, R5 + ADD R11<<2, R5, R11 + ADD $1, R11, R11 + MOVWU R11, R11 + MOVB R7, 1(R1) + ASRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R11, R11 + MOVB R11, (R1) + ADD $0x02, R1, R1 + +match_nolit_emitcopy_end_encodeBetterBlockAsm: + MOVWU 16(RSP), R16 + CMPW R16, R2 + BHS emit_remainder_encodeBetterBlockAsm + MOVD 8(RSP), R16 + CMP R16, R1 + BLO match_nolit_dst_ok_encodeBetterBlockAsm + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_nolit_dst_ok_encodeBetterBlockAsm: + MOVD $0x00cf1bbcdcbfa563, R5 + MOVD $0x9e3779b1, R7 + ADD $1, R6, R6 + SUB $2, R2, R8 + MOVD (R3)(R6), R9 + ADD R6, R3, R15 + MOVD 1(R15), R10 + MOVD (R3)(R8), R11 + ADD R8, R3, R15 + MOVD 1(R15), R12 + LSL $0x08, R9, R9 + MUL R5, R9, R9 + LSR $0x2f, R9, R9 + LSL $0x20, R10, R10 + MUL R7, R10, R10 + LSR $0x32, R10, R10 + LSL $0x08, R11, R11 + MUL R5, R11, R11 + LSR $0x2f, R11, R11 + LSL $0x20, R12, R12 + MUL R7, R12, R12 + LSR $0x32, R12, R12 + ADD $1, R6, R7 + ADD $1, R8, R13 + MOVW R6, (R0)(R9<<2) + MOVW R8, (R0)(R11<<2) + ADD R10<<2, R0, R15 + MOVW R7, 524288(R15) + ADD R12<<2, R0, R15 + MOVW R13, 524288(R15) + ADD R6, R8, R7 + ADD $1, R7, R7 + LSR $0x01, R7, R7 + ADD $0x01, R6, R6 + SUB $0x01, R8, R8 + +index_loop_encodeBetterBlockAsm: + CMP R8, R7 + BHS search_loop_encodeBetterBlockAsm + MOVD (R3)(R6), R9 + MOVD (R3)(R7), R10 + LSL $0x08, R9, R9 + MUL R5, R9, R9 + LSR $0x2f, R9, R9 + LSL $0x08, R10, R10 + MUL R5, R10, R10 + LSR $0x2f, R10, R10 + MOVW R6, (R0)(R9<<2) + MOVW R7, (R0)(R10<<2) + ADD $0x02, R6, R6 + ADD $0x02, R7, R7 + JMP index_loop_encodeBetterBlockAsm + +emit_remainder_encodeBetterBlockAsm: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R16 + SUBW R16, R0, R0 + ADD R0, R1, R0 + ADD $5, R0, R0 + MOVD 8(RSP), R16 + CMP R16, R0 + BLO emit_remainder_ok_encodeBetterBlockAsm + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +emit_remainder_ok_encodeBetterBlockAsm: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R2 + CMPW R0, R2 + BEQ emit_literal_done_emit_remainder_encodeBetterBlockAsm + MOVWU R0, R5 + MOVW R0, 20(RSP) + ADD R2, R3, R0 + SUBW R2, R5, R5 + SUB $1, R5, R2 + MOVWU R2, R2 + CMPW $0x3c, R2 + BLO one_byte_emit_remainder_encodeBetterBlockAsm + CMPW $0x00000100, R2 + BLO two_bytes_emit_remainder_encodeBetterBlockAsm + CMPW $0x00010000, R2 + BLO three_bytes_emit_remainder_encodeBetterBlockAsm + CMPW $0x01000000, R2 + BLO four_bytes_emit_remainder_encodeBetterBlockAsm + MOVD $0xfc, R16 + MOVB R16, (R1) + MOVW R2, 1(R1) + ADD $0x05, R1, R1 + JMP memmove_long_emit_remainder_encodeBetterBlockAsm + +four_bytes_emit_remainder_encodeBetterBlockAsm: + MOVWU R2, R3 + LSRW $0x10, R3, R3 + MOVD $0xf8, R16 + MOVB R16, (R1) + MOVH R2, 1(R1) + MOVB R3, 3(R1) + ADD $0x04, R1, R1 + JMP memmove_long_emit_remainder_encodeBetterBlockAsm + +three_bytes_emit_remainder_encodeBetterBlockAsm: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R2, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_emit_remainder_encodeBetterBlockAsm + +two_bytes_emit_remainder_encodeBetterBlockAsm: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R2, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R2 + BLO memmove_emit_remainder_encodeBetterBlockAsm + JMP memmove_long_emit_remainder_encodeBetterBlockAsm + +one_byte_emit_remainder_encodeBetterBlockAsm: + LSLW $0x02, R2, R16 + BFI $0, R16, $8, R2 + MOVB R2, (R1) + ADD $0x01, R1, R1 + +memmove_emit_remainder_encodeBetterBlockAsm: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveShort + CMP $0x03, R3 + BLO emit_lit_memmove_emit_remainder_encodeBetterBlockAsm_memmove_move_1or2 + BEQ emit_lit_memmove_emit_remainder_encodeBetterBlockAsm_memmove_move_3 + CMP $0x08, R3 + BLO emit_lit_memmove_emit_remainder_encodeBetterBlockAsm_memmove_move_4through7 + CMP $0x10, R3 + BLS emit_lit_memmove_emit_remainder_encodeBetterBlockAsm_memmove_move_8through16 + CMP $0x20, R3 + BLS emit_lit_memmove_emit_remainder_encodeBetterBlockAsm_memmove_move_17through32 + JMP emit_lit_memmove_emit_remainder_encodeBetterBlockAsm_memmove_move_33through64 + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm_memmove_move_1or2: + MOVBU (R0), R16 + BFI $0, R16, $8, R5 + ADD R3, R0, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R0 + MOVB R5, (R1) + ADD R3, R1, R15 + MOVB R0, -1(R15) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm_memmove_move_3: + MOVHU (R0), R16 + BFI $0, R16, $16, R5 + MOVBU 2(R0), R16 + BFI $0, R16, $8, R0 + MOVH R5, (R1) + MOVB R0, 2(R1) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm_memmove_move_4through7: + MOVWU (R0), R5 + ADD R3, R0, R15 + MOVWU -4(R15), R0 + MOVW R5, (R1) + ADD R3, R1, R15 + MOVW R0, -4(R15) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm_memmove_move_8through16: + MOVD (R0), R5 + ADD R3, R0, R15 + MOVD -8(R15), R0 + MOVD R5, (R1) + ADD R3, R1, R15 + MOVD R0, -8(R15) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm_memmove_move_17through32: + FMOVQ (R0), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm_memmove_move_33through64: + FMOVQ (R0), F0 + FMOVQ 16(R0), F1 + ADD R3, R0, R15 + FMOVQ -32(R15), F2 + ADD R3, R0, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R3, R1, R15 + FMOVQ F2, -32(R15) + ADD R3, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_emit_remainder_encodeBetterBlockAsm: + MOVD R2, R1 + JMP emit_literal_done_emit_remainder_encodeBetterBlockAsm + +memmove_long_emit_remainder_encodeBetterBlockAsm: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveLong + MOVD R0, R5 + MOVD R1, R6 + MOVD R3, R7 + +emit_lit_memmove_long_emit_remainder_encodeBetterBlockAsmlarge_big_loop_back: + FMOVQ (R5), F0 + FMOVQ 16(R5), F1 + FMOVQ F0, (R6) + FMOVQ F1, 16(R6) + ADD $0x20, R5, R5 + ADD $0x20, R6, R6 + SUB $0x20, R7, R7 + CMP $0x20, R7 + BHS emit_lit_memmove_long_emit_remainder_encodeBetterBlockAsmlarge_big_loop_back + ADD R3, R0, R15 + FMOVQ -32(R15), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + ADD R3, R1, R15 + FMOVQ F0, -32(R15) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + MOVD R2, R1 + +emit_literal_done_emit_remainder_encodeBetterBlockAsm: + MOVD dst_base+0(FP), R0 + SUB R0, R1, R1 + MOVD R1, ret+56(FP) + RET + +// func encodeBetterBlockAsm4MB(dst []byte, src []byte, tmp *[589824]byte) int +// Requires: BMI, SSE2 +TEXT ·encodeBetterBlockAsm4MB(SB), $24-64 + MOVD tmp+48(FP), R0 + MOVD dst_base+0(FP), R1 + MOVD $0x00001200, R2 + MOVD R0, R3 + VEOR V0.B16, V0.B16, V0.B16 + +zero_loop_encodeBetterBlockAsm4MB: + FMOVQ F0, (R3) + FMOVQ F0, 16(R3) + FMOVQ F0, 32(R3) + FMOVQ F0, 48(R3) + FMOVQ F0, 64(R3) + FMOVQ F0, 80(R3) + FMOVQ F0, 96(R3) + FMOVQ F0, 112(R3) + ADD $0x80, R3, R3 + SUBS $1, R2, R2 + BNE zero_loop_encodeBetterBlockAsm4MB + MOVD $0x00000000, R16 + MOVW R16, 20(RSP) + MOVD src_len+32(FP), R2 + SUB $6, R2, R3 + SUB $8, R2, R5 + MOVW R5, 16(RSP) + LSR $0x05, R2, R2 + SUBW R2, R3, R3 + ADD R3, R1, R3 + MOVD R3, 8(RSP) + MOVD $0x00000001, R2 + MOVD $0x00000000, R16 + MOVW R16, 24(RSP) + MOVD src_base+24(FP), R3 + +search_loop_encodeBetterBlockAsm4MB: + MOVWU R2, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + LSRW $0x07, R5, R5 + CMPW $0x63, R5 + BLS check_maxskip_ok_encodeBetterBlockAsm4MB + ADD $100, R2, R5 + MOVWU R5, R5 + JMP check_maxskip_cont_encodeBetterBlockAsm4MB + +check_maxskip_ok_encodeBetterBlockAsm4MB: + ADD R5, R2, R5 + ADD $1, R5, R5 + MOVWU R5, R5 + +check_maxskip_cont_encodeBetterBlockAsm4MB: + MOVWU 16(RSP), R16 + CMPW R16, R5 + BHS emit_remainder_encodeBetterBlockAsm4MB + MOVD (R3)(R2), R6 + MOVW R5, 28(RSP) + MOVD $0x00cf1bbcdcbfa563, R8 + MOVD $0x9e3779b1, R5 + MOVD R6, R9 + MOVD R6, R10 + LSL $0x08, R9, R9 + MUL R8, R9, R9 + LSR $0x2f, R9, R9 + LSL $0x20, R10, R10 + MUL R5, R10, R10 + LSR $0x32, R10, R10 + MOVWU (R0)(R9<<2), R5 + ADD R10<<2, R0, R15 + MOVWU 524288(R15), R7 + MOVW R2, (R0)(R9<<2) + ADD R10<<2, R0, R15 + MOVW R2, 524288(R15) + MOVD (R3)(R5), R9 + MOVD (R3)(R7), R10 + CMP R6, R9 + BEQ candidate_match_encodeBetterBlockAsm4MB + CMP R6, R10 + BNE no_short_found_encodeBetterBlockAsm4MB + MOVWU R7, R5 + JMP candidate_match_encodeBetterBlockAsm4MB + +no_short_found_encodeBetterBlockAsm4MB: + CMPW R6, R9 + BEQ candidate_match_encodeBetterBlockAsm4MB + CMPW R6, R10 + BEQ candidateS_match_encodeBetterBlockAsm4MB + MOVWU 28(RSP), R2 + JMP search_loop_encodeBetterBlockAsm4MB + +candidateS_match_encodeBetterBlockAsm4MB: + LSR $0x08, R6, R6 + MOVD R6, R9 + LSL $0x08, R9, R9 + MUL R8, R9, R9 + LSR $0x2f, R9, R9 + MOVWU (R0)(R9<<2), R5 + ADDW $1, R2, R2 + MOVW R2, (R0)(R9<<2) + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate_match_encodeBetterBlockAsm4MB + SUBW $1, R2, R2 + MOVWU R7, R5 + +candidate_match_encodeBetterBlockAsm4MB: + MOVWU 20(RSP), R6 + TSTW R5, R5 + BEQ match_extend_back_end_encodeBetterBlockAsm4MB + +match_extend_back_loop_encodeBetterBlockAsm4MB: + CMPW R6, R2 + BLS match_extend_back_end_encodeBetterBlockAsm4MB + ADD R5, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R7 + ADD R2, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + AND $0xff, R8, R16 + AND $0xff, R7, R15 + CMP R16, R15 + BNE match_extend_back_end_encodeBetterBlockAsm4MB + SUB $1, R2, R2 + MOVWU R2, R2 + SUBSW $1, R5, R5 + BEQ match_extend_back_end_encodeBetterBlockAsm4MB + JMP match_extend_back_loop_encodeBetterBlockAsm4MB + +match_extend_back_end_encodeBetterBlockAsm4MB: + MOVWU R2, R6 + MOVWU 20(RSP), R16 + SUBW R16, R6, R6 + ADD R6, R1, R6 + ADD $4, R6, R6 + MOVD 8(RSP), R16 + CMP R16, R6 + BLO match_dst_size_check_encodeBetterBlockAsm4MB + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_dst_size_check_encodeBetterBlockAsm4MB: + MOVWU R2, R6 + ADDW $0x04, R2, R2 + ADDW $0x04, R5, R5 + MOVD src_len+32(FP), R7 + SUBW R2, R7, R7 + ADD R2, R3, R8 + ADD R5, R3, R9 + + // matchLen + MOVD $0, R11 + +matchlen_loopback_16_match_nolit_encodeBetterBlockAsm4MB: + CMPW $0x10, R7 + BLO matchlen_match8_match_nolit_encodeBetterBlockAsm4MB + MOVD (R8)(R11), R10 + ADD R11, R8, R15 + MOVD 8(R15), R12 + MOVD (R9)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_match_nolit_encodeBetterBlockAsm4MB + ADD R11, R9, R15 + MOVD 8(R15), R16 + EOR R16, R12, R12 + TST R12, R12 + BNE matchlen_bsf_16match_nolit_encodeBetterBlockAsm4MB + SUB $16, R7, R7 + MOVWU R7, R7 + ADD $16, R11, R11 + MOVWU R11, R11 + JMP matchlen_loopback_16_match_nolit_encodeBetterBlockAsm4MB + +matchlen_bsf_16match_nolit_encodeBetterBlockAsm4MB: + RBIT R12, R12 + CLZ R12, R12 + ASR $0x03, R12, R12 + ADD R12, R11, R11 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP match_nolit_end_encodeBetterBlockAsm4MB + +matchlen_match8_match_nolit_encodeBetterBlockAsm4MB: + CMPW $0x08, R7 + BLO matchlen_match4_match_nolit_encodeBetterBlockAsm4MB + MOVD (R8)(R11), R10 + MOVD (R9)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_match_nolit_encodeBetterBlockAsm4MB + SUB $8, R7, R7 + MOVWU R7, R7 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP matchlen_match4_match_nolit_encodeBetterBlockAsm4MB + +matchlen_bsf_8_match_nolit_encodeBetterBlockAsm4MB: + RBIT R10, R10 + CLZ R10, R10 + ASR $0x03, R10, R10 + ADD R10, R11, R11 + MOVWU R11, R11 + JMP match_nolit_end_encodeBetterBlockAsm4MB + +matchlen_match4_match_nolit_encodeBetterBlockAsm4MB: + CMPW $0x04, R7 + BLO matchlen_match2_match_nolit_encodeBetterBlockAsm4MB + MOVWU (R8)(R11), R10 + MOVWU (R9)(R11), R16 + CMPW R10, R16 + BNE matchlen_match2_match_nolit_encodeBetterBlockAsm4MB + SUB $4, R7, R7 + MOVWU R7, R7 + ADD $4, R11, R11 + MOVWU R11, R11 + +matchlen_match2_match_nolit_encodeBetterBlockAsm4MB: + CMPW $0x01, R7 + BEQ matchlen_match1_match_nolit_encodeBetterBlockAsm4MB + BLO match_nolit_end_encodeBetterBlockAsm4MB + MOVHU (R8)(R11), R16 + BFI $0, R16, $16, R10 + ADD R11, R9, R15 + MOVHU (R15), R15 + AND $0xffff, R10, R16 + CMP R16, R15 + BNE matchlen_match1_match_nolit_encodeBetterBlockAsm4MB + ADD $2, R11, R11 + MOVWU R11, R11 + SUBSW $0x02, R7, R7 + BEQ match_nolit_end_encodeBetterBlockAsm4MB + +matchlen_match1_match_nolit_encodeBetterBlockAsm4MB: + MOVBU (R8)(R11), R16 + BFI $0, R16, $8, R10 + ADD R11, R9, R15 + MOVBU (R15), R15 + AND $0xff, R10, R16 + CMP R16, R15 + BNE match_nolit_end_encodeBetterBlockAsm4MB + ADD $1, R11, R11 + MOVWU R11, R11 + +match_nolit_end_encodeBetterBlockAsm4MB: + MOVWU R2, R7 + SUBW R5, R7, R7 + + // Check if repeat + MOVWU 24(RSP), R16 + CMPW R7, R16 + BEQ match_is_repeat_encodeBetterBlockAsm4MB + CMPW $0x01, R11 + BHI match_length_ok_encodeBetterBlockAsm4MB + CMPW $0x0000ffff, R7 + BLS match_length_ok_encodeBetterBlockAsm4MB + MOVWU 28(RSP), R2 + ADDW $1, R2, R2 + JMP search_loop_encodeBetterBlockAsm4MB + +match_length_ok_encodeBetterBlockAsm4MB: + MOVW R7, 24(RSP) + MOVWU 20(RSP), R5 + CMPW R6, R5 + BEQ emit_literal_done_match_emit_encodeBetterBlockAsm4MB + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R5, R3, R9 + SUBW R5, R8, R8 + SUB $1, R8, R5 + MOVWU R5, R5 + CMPW $0x3c, R5 + BLO one_byte_match_emit_encodeBetterBlockAsm4MB + CMPW $0x00000100, R5 + BLO two_bytes_match_emit_encodeBetterBlockAsm4MB + CMPW $0x00010000, R5 + BLO three_bytes_match_emit_encodeBetterBlockAsm4MB + MOVWU R5, R10 + LSRW $0x10, R10, R10 + MOVD $0xf8, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + MOVB R10, 3(R1) + ADD $0x04, R1, R1 + JMP memmove_long_match_emit_encodeBetterBlockAsm4MB + +three_bytes_match_emit_encodeBetterBlockAsm4MB: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_match_emit_encodeBetterBlockAsm4MB + +two_bytes_match_emit_encodeBetterBlockAsm4MB: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R5, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R5 + BLO memmove_match_emit_encodeBetterBlockAsm4MB + JMP memmove_long_match_emit_encodeBetterBlockAsm4MB + +one_byte_match_emit_encodeBetterBlockAsm4MB: + LSLW $0x02, R5, R16 + BFI $0, R16, $8, R5 + MOVB R5, (R1) + ADD $0x01, R1, R1 + +memmove_match_emit_encodeBetterBlockAsm4MB: + ADD R8, R1, R5 + + // genMemMoveShort + CMP $0x04, R8 + BLS emit_lit_memmove_match_emit_encodeBetterBlockAsm4MB_memmove_move_4 + CMP $0x08, R8 + BLO emit_lit_memmove_match_emit_encodeBetterBlockAsm4MB_memmove_move_4through7 + CMP $0x10, R8 + BLS emit_lit_memmove_match_emit_encodeBetterBlockAsm4MB_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_match_emit_encodeBetterBlockAsm4MB_memmove_move_17through32 + JMP emit_lit_memmove_match_emit_encodeBetterBlockAsm4MB_memmove_move_33through64 + +emit_lit_memmove_match_emit_encodeBetterBlockAsm4MB_memmove_move_4: + MOVWU (R9), R10 + MOVW R10, (R1) + JMP memmove_end_copy_match_emit_encodeBetterBlockAsm4MB + +emit_lit_memmove_match_emit_encodeBetterBlockAsm4MB_memmove_move_4through7: + MOVWU (R9), R10 + ADD R8, R9, R15 + MOVWU -4(R15), R9 + MOVW R10, (R1) + ADD R8, R1, R15 + MOVW R9, -4(R15) + JMP memmove_end_copy_match_emit_encodeBetterBlockAsm4MB + +emit_lit_memmove_match_emit_encodeBetterBlockAsm4MB_memmove_move_8through16: + MOVD (R9), R10 + ADD R8, R9, R15 + MOVD -8(R15), R9 + MOVD R10, (R1) + ADD R8, R1, R15 + MOVD R9, -8(R15) + JMP memmove_end_copy_match_emit_encodeBetterBlockAsm4MB + +emit_lit_memmove_match_emit_encodeBetterBlockAsm4MB_memmove_move_17through32: + FMOVQ (R9), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_match_emit_encodeBetterBlockAsm4MB + +emit_lit_memmove_match_emit_encodeBetterBlockAsm4MB_memmove_move_33through64: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + ADD R8, R9, R15 + FMOVQ -32(R15), F2 + ADD R8, R9, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_match_emit_encodeBetterBlockAsm4MB: + MOVD R5, R1 + JMP emit_literal_done_match_emit_encodeBetterBlockAsm4MB + +memmove_long_match_emit_encodeBetterBlockAsm4MB: + ADD R8, R1, R5 + + // genMemMoveLong + MOVD R9, R10 + MOVD R1, R12 + MOVD R8, R13 + +emit_lit_memmove_long_match_emit_encodeBetterBlockAsm4MBlarge_big_loop_back: + FMOVQ (R10), F0 + FMOVQ 16(R10), F1 + FMOVQ F0, (R12) + FMOVQ F1, 16(R12) + ADD $0x20, R10, R10 + ADD $0x20, R12, R12 + SUB $0x20, R13, R13 + CMP $0x20, R13 + BHS emit_lit_memmove_long_match_emit_encodeBetterBlockAsm4MBlarge_big_loop_back + ADD R8, R9, R15 + FMOVQ -32(R15), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R5, R1 + +emit_literal_done_match_emit_encodeBetterBlockAsm4MB: + ADDW R11, R2, R2 + ADDW $0x04, R11, R11 + MOVW R2, 20(RSP) + + // emitCopy + CMPW $0x00010000, R7 + BLO two_byte_offset_match_nolit_encodeBetterBlockAsm4MB + CMPW $0x40, R11 + BLS four_bytes_remain_match_nolit_encodeBetterBlockAsm4MB + MOVD $0xff, R16 + MOVB R16, (R1) + MOVW R7, 1(R1) + SUB $64, R11, R11 + MOVWU R11, R11 + ADD $0x05, R1, R1 + CMPW $0x04, R11 + BLO four_bytes_remain_match_nolit_encodeBetterBlockAsm4MB + + // emitRepeat + MOVWU R11, R5 + SUB $4, R11, R11 + MOVWU R11, R11 + CMPW $0x08, R5 + BLS repeat_two_match_nolit_encodeBetterBlockAsm4MB_emit_copy + CMPW $0x0c, R5 + BHS cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy + CMPW $0x00000800, R7 + BLO repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy + +cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy: + CMPW $0x00000104, R11 + BLO repeat_three_match_nolit_encodeBetterBlockAsm4MB_emit_copy + CMPW $0x00010100, R11 + BLO repeat_four_match_nolit_encodeBetterBlockAsm4MB_emit_copy + SUB $65536, R11, R11 + MOVWU R11, R11 + MOVWU R11, R7 + MOVD $0x001d, R16 + MOVH R16, (R1) + MOVH R11, 2(R1) + ASRW $0x10, R7, R7 + MOVB R7, 4(R1) + ADD $0x05, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm4MB + +repeat_four_match_nolit_encodeBetterBlockAsm4MB_emit_copy: + SUB $256, R11, R11 + MOVWU R11, R11 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R11, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm4MB + +repeat_three_match_nolit_encodeBetterBlockAsm4MB_emit_copy: + SUB $4, R11, R11 + MOVWU R11, R11 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R11, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm4MB + +repeat_two_match_nolit_encodeBetterBlockAsm4MB_emit_copy: + LSLW $0x02, R11, R11 + ORRW $0x01, R11, R11 + MOVH R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm4MB + +repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy: + MOVD $0, R5 + ADD R11<<2, R5, R11 + ADD $1, R11, R11 + MOVWU R11, R11 + MOVB R7, 1(R1) + ASRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R11, R11 + MOVB R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm4MB + +four_bytes_remain_match_nolit_encodeBetterBlockAsm4MB: + TSTW R11, R11 + BEQ match_nolit_emitcopy_end_encodeBetterBlockAsm4MB + MOVD $0, R5 + ADD R11<<2, R5, R11 + SUB $1, R11, R11 + MOVWU R11, R11 + MOVB R11, (R1) + MOVW R7, 1(R1) + ADD $0x05, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm4MB + +two_byte_offset_match_nolit_encodeBetterBlockAsm4MB: + CMPW $0x40, R11 + BLS two_byte_offset_short_match_nolit_encodeBetterBlockAsm4MB + CMPW $0x00000800, R7 + BHS long_offset_short_match_nolit_encodeBetterBlockAsm4MB + MOVD $0x00000001, R5 + ADD $16, R5, R5 + MOVWU R5, R5 + MOVB R7, 1(R1) + LSRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + SUBW $0x08, R11, R11 + + // emitRepeat + SUB $4, R11, R11 + MOVWU R11, R11 + JMP cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b + MOVWU R11, R5 + SUB $4, R11, R11 + MOVWU R11, R11 + CMPW $0x08, R5 + BLS repeat_two_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b + CMPW $0x0c, R5 + BHS cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b + CMPW $0x00000800, R7 + BLO repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b + +cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b: + CMPW $0x00000104, R11 + BLO repeat_three_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b + CMPW $0x00010100, R11 + BLO repeat_four_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b + SUB $65536, R11, R11 + MOVWU R11, R11 + MOVWU R11, R7 + MOVD $0x001d, R16 + MOVH R16, (R1) + MOVH R11, 2(R1) + ASRW $0x10, R7, R7 + MOVB R7, 4(R1) + ADD $0x05, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm4MB + +repeat_four_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b: + SUB $256, R11, R11 + MOVWU R11, R11 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R11, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm4MB + +repeat_three_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b: + SUB $4, R11, R11 + MOVWU R11, R11 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R11, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm4MB + +repeat_two_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b: + LSLW $0x02, R11, R11 + ORRW $0x01, R11, R11 + MOVH R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm4MB + +repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b: + MOVD $0, R5 + ADD R11<<2, R5, R11 + ADD $1, R11, R11 + MOVWU R11, R11 + MOVB R7, 1(R1) + ASRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R11, R11 + MOVB R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm4MB + +long_offset_short_match_nolit_encodeBetterBlockAsm4MB: + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R7, 1(R1) + SUB $60, R11, R11 + MOVWU R11, R11 + ADD $0x03, R1, R1 + + // emitRepeat + MOVWU R11, R5 + SUB $4, R11, R11 + MOVWU R11, R11 + CMPW $0x08, R5 + BLS repeat_two_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short + CMPW $0x0c, R5 + BHS cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short + CMPW $0x00000800, R7 + BLO repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short + +cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short: + CMPW $0x00000104, R11 + BLO repeat_three_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short + CMPW $0x00010100, R11 + BLO repeat_four_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short + SUB $65536, R11, R11 + MOVWU R11, R11 + MOVWU R11, R7 + MOVD $0x001d, R16 + MOVH R16, (R1) + MOVH R11, 2(R1) + ASRW $0x10, R7, R7 + MOVB R7, 4(R1) + ADD $0x05, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm4MB + +repeat_four_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short: + SUB $256, R11, R11 + MOVWU R11, R11 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R11, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm4MB + +repeat_three_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short: + SUB $4, R11, R11 + MOVWU R11, R11 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R11, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm4MB + +repeat_two_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short: + LSLW $0x02, R11, R11 + ORRW $0x01, R11, R11 + MOVH R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm4MB + +repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short: + MOVD $0, R5 + ADD R11<<2, R5, R11 + ADD $1, R11, R11 + MOVWU R11, R11 + MOVB R7, 1(R1) + ASRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R11, R11 + MOVB R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm4MB + +two_byte_offset_short_match_nolit_encodeBetterBlockAsm4MB: + MOVWU R11, R5 + LSLW $0x02, R5, R5 + CMPW $0x0c, R11 + BHS emit_copy_three_match_nolit_encodeBetterBlockAsm4MB + CMPW $0x00000800, R7 + BHS emit_copy_three_match_nolit_encodeBetterBlockAsm4MB + SUB $15, R5, R5 + MOVWU R5, R5 + MOVB R7, 1(R1) + LSRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm4MB + +emit_copy_three_match_nolit_encodeBetterBlockAsm4MB: + SUB $2, R5, R5 + MOVWU R5, R5 + MOVB R5, (R1) + MOVH R7, 1(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm4MB + +match_is_repeat_encodeBetterBlockAsm4MB: + MOVWU 20(RSP), R5 + CMPW R6, R5 + BEQ emit_literal_done_match_emit_repeat_encodeBetterBlockAsm4MB + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R5, R3, R9 + SUBW R5, R8, R8 + SUB $1, R8, R5 + MOVWU R5, R5 + CMPW $0x3c, R5 + BLO one_byte_match_emit_repeat_encodeBetterBlockAsm4MB + CMPW $0x00000100, R5 + BLO two_bytes_match_emit_repeat_encodeBetterBlockAsm4MB + CMPW $0x00010000, R5 + BLO three_bytes_match_emit_repeat_encodeBetterBlockAsm4MB + MOVWU R5, R10 + LSRW $0x10, R10, R10 + MOVD $0xf8, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + MOVB R10, 3(R1) + ADD $0x04, R1, R1 + JMP memmove_long_match_emit_repeat_encodeBetterBlockAsm4MB + +three_bytes_match_emit_repeat_encodeBetterBlockAsm4MB: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_match_emit_repeat_encodeBetterBlockAsm4MB + +two_bytes_match_emit_repeat_encodeBetterBlockAsm4MB: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R5, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R5 + BLO memmove_match_emit_repeat_encodeBetterBlockAsm4MB + JMP memmove_long_match_emit_repeat_encodeBetterBlockAsm4MB + +one_byte_match_emit_repeat_encodeBetterBlockAsm4MB: + LSLW $0x02, R5, R16 + BFI $0, R16, $8, R5 + MOVB R5, (R1) + ADD $0x01, R1, R1 + +memmove_match_emit_repeat_encodeBetterBlockAsm4MB: + ADD R8, R1, R5 + + // genMemMoveShort + CMP $0x04, R8 + BLS emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm4MB_memmove_move_4 + CMP $0x08, R8 + BLO emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm4MB_memmove_move_4through7 + CMP $0x10, R8 + BLS emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm4MB_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm4MB_memmove_move_17through32 + JMP emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm4MB_memmove_move_33through64 + +emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm4MB_memmove_move_4: + MOVWU (R9), R10 + MOVW R10, (R1) + JMP memmove_end_copy_match_emit_repeat_encodeBetterBlockAsm4MB + +emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm4MB_memmove_move_4through7: + MOVWU (R9), R10 + ADD R8, R9, R15 + MOVWU -4(R15), R9 + MOVW R10, (R1) + ADD R8, R1, R15 + MOVW R9, -4(R15) + JMP memmove_end_copy_match_emit_repeat_encodeBetterBlockAsm4MB + +emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm4MB_memmove_move_8through16: + MOVD (R9), R10 + ADD R8, R9, R15 + MOVD -8(R15), R9 + MOVD R10, (R1) + ADD R8, R1, R15 + MOVD R9, -8(R15) + JMP memmove_end_copy_match_emit_repeat_encodeBetterBlockAsm4MB + +emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm4MB_memmove_move_17through32: + FMOVQ (R9), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_match_emit_repeat_encodeBetterBlockAsm4MB + +emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm4MB_memmove_move_33through64: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + ADD R8, R9, R15 + FMOVQ -32(R15), F2 + ADD R8, R9, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_match_emit_repeat_encodeBetterBlockAsm4MB: + MOVD R5, R1 + JMP emit_literal_done_match_emit_repeat_encodeBetterBlockAsm4MB + +memmove_long_match_emit_repeat_encodeBetterBlockAsm4MB: + ADD R8, R1, R5 + + // genMemMoveLong + MOVD R9, R10 + MOVD R1, R12 + MOVD R8, R13 + +emit_lit_memmove_long_match_emit_repeat_encodeBetterBlockAsm4MBlarge_big_loop_back: + FMOVQ (R10), F0 + FMOVQ 16(R10), F1 + FMOVQ F0, (R12) + FMOVQ F1, 16(R12) + ADD $0x20, R10, R10 + ADD $0x20, R12, R12 + SUB $0x20, R13, R13 + CMP $0x20, R13 + BHS emit_lit_memmove_long_match_emit_repeat_encodeBetterBlockAsm4MBlarge_big_loop_back + ADD R8, R9, R15 + FMOVQ -32(R15), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R5, R1 + +emit_literal_done_match_emit_repeat_encodeBetterBlockAsm4MB: + ADDW R11, R2, R2 + ADDW $0x04, R11, R11 + MOVW R2, 20(RSP) + + // emitRepeat + MOVWU R11, R5 + SUB $4, R11, R11 + MOVWU R11, R11 + CMPW $0x08, R5 + BLS repeat_two_match_nolit_repeat_encodeBetterBlockAsm4MB + CMPW $0x0c, R5 + BHS cant_repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm4MB + CMPW $0x00000800, R7 + BLO repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm4MB + +cant_repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm4MB: + CMPW $0x00000104, R11 + BLO repeat_three_match_nolit_repeat_encodeBetterBlockAsm4MB + CMPW $0x00010100, R11 + BLO repeat_four_match_nolit_repeat_encodeBetterBlockAsm4MB + SUB $65536, R11, R11 + MOVWU R11, R11 + MOVWU R11, R7 + MOVD $0x001d, R16 + MOVH R16, (R1) + MOVH R11, 2(R1) + ASRW $0x10, R7, R7 + MOVB R7, 4(R1) + ADD $0x05, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm4MB + +repeat_four_match_nolit_repeat_encodeBetterBlockAsm4MB: + SUB $256, R11, R11 + MOVWU R11, R11 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R11, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm4MB + +repeat_three_match_nolit_repeat_encodeBetterBlockAsm4MB: + SUB $4, R11, R11 + MOVWU R11, R11 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R11, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm4MB + +repeat_two_match_nolit_repeat_encodeBetterBlockAsm4MB: + LSLW $0x02, R11, R11 + ORRW $0x01, R11, R11 + MOVH R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm4MB + +repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm4MB: + MOVD $0, R5 + ADD R11<<2, R5, R11 + ADD $1, R11, R11 + MOVWU R11, R11 + MOVB R7, 1(R1) + ASRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R11, R11 + MOVB R11, (R1) + ADD $0x02, R1, R1 + +match_nolit_emitcopy_end_encodeBetterBlockAsm4MB: + MOVWU 16(RSP), R16 + CMPW R16, R2 + BHS emit_remainder_encodeBetterBlockAsm4MB + MOVD 8(RSP), R16 + CMP R16, R1 + BLO match_nolit_dst_ok_encodeBetterBlockAsm4MB + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_nolit_dst_ok_encodeBetterBlockAsm4MB: + MOVD $0x00cf1bbcdcbfa563, R5 + MOVD $0x9e3779b1, R7 + ADD $1, R6, R6 + SUB $2, R2, R8 + MOVD (R3)(R6), R9 + ADD R6, R3, R15 + MOVD 1(R15), R10 + MOVD (R3)(R8), R11 + ADD R8, R3, R15 + MOVD 1(R15), R12 + LSL $0x08, R9, R9 + MUL R5, R9, R9 + LSR $0x2f, R9, R9 + LSL $0x20, R10, R10 + MUL R7, R10, R10 + LSR $0x32, R10, R10 + LSL $0x08, R11, R11 + MUL R5, R11, R11 + LSR $0x2f, R11, R11 + LSL $0x20, R12, R12 + MUL R7, R12, R12 + LSR $0x32, R12, R12 + ADD $1, R6, R7 + ADD $1, R8, R13 + MOVW R6, (R0)(R9<<2) + MOVW R8, (R0)(R11<<2) + ADD R10<<2, R0, R15 + MOVW R7, 524288(R15) + ADD R12<<2, R0, R15 + MOVW R13, 524288(R15) + ADD R6, R8, R7 + ADD $1, R7, R7 + LSR $0x01, R7, R7 + ADD $0x01, R6, R6 + SUB $0x01, R8, R8 + +index_loop_encodeBetterBlockAsm4MB: + CMP R8, R7 + BHS search_loop_encodeBetterBlockAsm4MB + MOVD (R3)(R6), R9 + MOVD (R3)(R7), R10 + LSL $0x08, R9, R9 + MUL R5, R9, R9 + LSR $0x2f, R9, R9 + LSL $0x08, R10, R10 + MUL R5, R10, R10 + LSR $0x2f, R10, R10 + MOVW R6, (R0)(R9<<2) + MOVW R7, (R0)(R10<<2) + ADD $0x02, R6, R6 + ADD $0x02, R7, R7 + JMP index_loop_encodeBetterBlockAsm4MB + +emit_remainder_encodeBetterBlockAsm4MB: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R16 + SUBW R16, R0, R0 + ADD R0, R1, R0 + ADD $4, R0, R0 + MOVD 8(RSP), R16 + CMP R16, R0 + BLO emit_remainder_ok_encodeBetterBlockAsm4MB + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +emit_remainder_ok_encodeBetterBlockAsm4MB: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R2 + CMPW R0, R2 + BEQ emit_literal_done_emit_remainder_encodeBetterBlockAsm4MB + MOVWU R0, R5 + MOVW R0, 20(RSP) + ADD R2, R3, R0 + SUBW R2, R5, R5 + SUB $1, R5, R2 + MOVWU R2, R2 + CMPW $0x3c, R2 + BLO one_byte_emit_remainder_encodeBetterBlockAsm4MB + CMPW $0x00000100, R2 + BLO two_bytes_emit_remainder_encodeBetterBlockAsm4MB + CMPW $0x00010000, R2 + BLO three_bytes_emit_remainder_encodeBetterBlockAsm4MB + MOVWU R2, R3 + LSRW $0x10, R3, R3 + MOVD $0xf8, R16 + MOVB R16, (R1) + MOVH R2, 1(R1) + MOVB R3, 3(R1) + ADD $0x04, R1, R1 + JMP memmove_long_emit_remainder_encodeBetterBlockAsm4MB + +three_bytes_emit_remainder_encodeBetterBlockAsm4MB: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R2, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_emit_remainder_encodeBetterBlockAsm4MB + +two_bytes_emit_remainder_encodeBetterBlockAsm4MB: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R2, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R2 + BLO memmove_emit_remainder_encodeBetterBlockAsm4MB + JMP memmove_long_emit_remainder_encodeBetterBlockAsm4MB + +one_byte_emit_remainder_encodeBetterBlockAsm4MB: + LSLW $0x02, R2, R16 + BFI $0, R16, $8, R2 + MOVB R2, (R1) + ADD $0x01, R1, R1 + +memmove_emit_remainder_encodeBetterBlockAsm4MB: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveShort + CMP $0x03, R3 + BLO emit_lit_memmove_emit_remainder_encodeBetterBlockAsm4MB_memmove_move_1or2 + BEQ emit_lit_memmove_emit_remainder_encodeBetterBlockAsm4MB_memmove_move_3 + CMP $0x08, R3 + BLO emit_lit_memmove_emit_remainder_encodeBetterBlockAsm4MB_memmove_move_4through7 + CMP $0x10, R3 + BLS emit_lit_memmove_emit_remainder_encodeBetterBlockAsm4MB_memmove_move_8through16 + CMP $0x20, R3 + BLS emit_lit_memmove_emit_remainder_encodeBetterBlockAsm4MB_memmove_move_17through32 + JMP emit_lit_memmove_emit_remainder_encodeBetterBlockAsm4MB_memmove_move_33through64 + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm4MB_memmove_move_1or2: + MOVBU (R0), R16 + BFI $0, R16, $8, R5 + ADD R3, R0, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R0 + MOVB R5, (R1) + ADD R3, R1, R15 + MOVB R0, -1(R15) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm4MB + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm4MB_memmove_move_3: + MOVHU (R0), R16 + BFI $0, R16, $16, R5 + MOVBU 2(R0), R16 + BFI $0, R16, $8, R0 + MOVH R5, (R1) + MOVB R0, 2(R1) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm4MB + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm4MB_memmove_move_4through7: + MOVWU (R0), R5 + ADD R3, R0, R15 + MOVWU -4(R15), R0 + MOVW R5, (R1) + ADD R3, R1, R15 + MOVW R0, -4(R15) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm4MB + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm4MB_memmove_move_8through16: + MOVD (R0), R5 + ADD R3, R0, R15 + MOVD -8(R15), R0 + MOVD R5, (R1) + ADD R3, R1, R15 + MOVD R0, -8(R15) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm4MB + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm4MB_memmove_move_17through32: + FMOVQ (R0), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm4MB + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm4MB_memmove_move_33through64: + FMOVQ (R0), F0 + FMOVQ 16(R0), F1 + ADD R3, R0, R15 + FMOVQ -32(R15), F2 + ADD R3, R0, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R3, R1, R15 + FMOVQ F2, -32(R15) + ADD R3, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_emit_remainder_encodeBetterBlockAsm4MB: + MOVD R2, R1 + JMP emit_literal_done_emit_remainder_encodeBetterBlockAsm4MB + +memmove_long_emit_remainder_encodeBetterBlockAsm4MB: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveLong + MOVD R0, R5 + MOVD R1, R6 + MOVD R3, R7 + +emit_lit_memmove_long_emit_remainder_encodeBetterBlockAsm4MBlarge_big_loop_back: + FMOVQ (R5), F0 + FMOVQ 16(R5), F1 + FMOVQ F0, (R6) + FMOVQ F1, 16(R6) + ADD $0x20, R5, R5 + ADD $0x20, R6, R6 + SUB $0x20, R7, R7 + CMP $0x20, R7 + BHS emit_lit_memmove_long_emit_remainder_encodeBetterBlockAsm4MBlarge_big_loop_back + ADD R3, R0, R15 + FMOVQ -32(R15), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + ADD R3, R1, R15 + FMOVQ F0, -32(R15) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + MOVD R2, R1 + +emit_literal_done_emit_remainder_encodeBetterBlockAsm4MB: + MOVD dst_base+0(FP), R0 + SUB R0, R1, R1 + MOVD R1, ret+56(FP) + RET + +// func encodeBetterBlockAsm12B(dst []byte, src []byte, tmp *[81920]byte) int +// Requires: BMI, SSE2 +TEXT ·encodeBetterBlockAsm12B(SB), $24-64 + MOVD tmp+48(FP), R0 + MOVD dst_base+0(FP), R1 + MOVD $0x00000280, R2 + MOVD R0, R3 + VEOR V0.B16, V0.B16, V0.B16 + +zero_loop_encodeBetterBlockAsm12B: + FMOVQ F0, (R3) + FMOVQ F0, 16(R3) + FMOVQ F0, 32(R3) + FMOVQ F0, 48(R3) + FMOVQ F0, 64(R3) + FMOVQ F0, 80(R3) + FMOVQ F0, 96(R3) + FMOVQ F0, 112(R3) + ADD $0x80, R3, R3 + SUBS $1, R2, R2 + BNE zero_loop_encodeBetterBlockAsm12B + MOVD $0x00000000, R16 + MOVW R16, 20(RSP) + MOVD src_len+32(FP), R2 + SUB $6, R2, R3 + SUB $8, R2, R5 + MOVW R5, 16(RSP) + LSR $0x05, R2, R2 + SUBW R2, R3, R3 + ADD R3, R1, R3 + MOVD R3, 8(RSP) + MOVD $0x00000001, R2 + MOVD $0x00000000, R16 + MOVW R16, 24(RSP) + MOVD src_base+24(FP), R3 + +search_loop_encodeBetterBlockAsm12B: + MOVWU R2, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + LSRW $0x06, R5, R5 + ADD R5, R2, R5 + ADD $1, R5, R5 + MOVWU R5, R5 + MOVWU 16(RSP), R16 + CMPW R16, R5 + BHS emit_remainder_encodeBetterBlockAsm12B + MOVD (R3)(R2), R6 + MOVW R5, 28(RSP) + MOVD $0x0000cf1bbcdcbf9b, R8 + MOVD $0x9e3779b1, R5 + MOVD R6, R9 + MOVD R6, R10 + LSL $0x10, R9, R9 + MUL R8, R9, R9 + LSR $0x32, R9, R9 + LSL $0x20, R10, R10 + MUL R5, R10, R10 + LSR $0x34, R10, R10 + MOVWU (R0)(R9<<2), R5 + ADD R10<<2, R0, R15 + MOVWU 65536(R15), R7 + MOVW R2, (R0)(R9<<2) + ADD R10<<2, R0, R15 + MOVW R2, 65536(R15) + MOVD (R3)(R5), R9 + MOVD (R3)(R7), R10 + CMP R6, R9 + BEQ candidate_match_encodeBetterBlockAsm12B + CMP R6, R10 + BNE no_short_found_encodeBetterBlockAsm12B + MOVWU R7, R5 + JMP candidate_match_encodeBetterBlockAsm12B + +no_short_found_encodeBetterBlockAsm12B: + CMPW R6, R9 + BEQ candidate_match_encodeBetterBlockAsm12B + CMPW R6, R10 + BEQ candidateS_match_encodeBetterBlockAsm12B + MOVWU 28(RSP), R2 + JMP search_loop_encodeBetterBlockAsm12B + +candidateS_match_encodeBetterBlockAsm12B: + LSR $0x08, R6, R6 + MOVD R6, R9 + LSL $0x10, R9, R9 + MUL R8, R9, R9 + LSR $0x32, R9, R9 + MOVWU (R0)(R9<<2), R5 + ADDW $1, R2, R2 + MOVW R2, (R0)(R9<<2) + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate_match_encodeBetterBlockAsm12B + SUBW $1, R2, R2 + MOVWU R7, R5 + +candidate_match_encodeBetterBlockAsm12B: + MOVWU 20(RSP), R6 + TSTW R5, R5 + BEQ match_extend_back_end_encodeBetterBlockAsm12B + +match_extend_back_loop_encodeBetterBlockAsm12B: + CMPW R6, R2 + BLS match_extend_back_end_encodeBetterBlockAsm12B + ADD R5, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R7 + ADD R2, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + AND $0xff, R8, R16 + AND $0xff, R7, R15 + CMP R16, R15 + BNE match_extend_back_end_encodeBetterBlockAsm12B + SUB $1, R2, R2 + MOVWU R2, R2 + SUBSW $1, R5, R5 + BEQ match_extend_back_end_encodeBetterBlockAsm12B + JMP match_extend_back_loop_encodeBetterBlockAsm12B + +match_extend_back_end_encodeBetterBlockAsm12B: + MOVWU R2, R6 + MOVWU 20(RSP), R16 + SUBW R16, R6, R6 + ADD R6, R1, R6 + ADD $3, R6, R6 + MOVD 8(RSP), R16 + CMP R16, R6 + BLO match_dst_size_check_encodeBetterBlockAsm12B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_dst_size_check_encodeBetterBlockAsm12B: + MOVWU R2, R6 + ADDW $0x04, R2, R2 + ADDW $0x04, R5, R5 + MOVD src_len+32(FP), R7 + SUBW R2, R7, R7 + ADD R2, R3, R8 + ADD R5, R3, R9 + + // matchLen + MOVD $0, R11 + +matchlen_loopback_16_match_nolit_encodeBetterBlockAsm12B: + CMPW $0x10, R7 + BLO matchlen_match8_match_nolit_encodeBetterBlockAsm12B + MOVD (R8)(R11), R10 + ADD R11, R8, R15 + MOVD 8(R15), R12 + MOVD (R9)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_match_nolit_encodeBetterBlockAsm12B + ADD R11, R9, R15 + MOVD 8(R15), R16 + EOR R16, R12, R12 + TST R12, R12 + BNE matchlen_bsf_16match_nolit_encodeBetterBlockAsm12B + SUB $16, R7, R7 + MOVWU R7, R7 + ADD $16, R11, R11 + MOVWU R11, R11 + JMP matchlen_loopback_16_match_nolit_encodeBetterBlockAsm12B + +matchlen_bsf_16match_nolit_encodeBetterBlockAsm12B: + RBIT R12, R12 + CLZ R12, R12 + ASR $0x03, R12, R12 + ADD R12, R11, R11 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP match_nolit_end_encodeBetterBlockAsm12B + +matchlen_match8_match_nolit_encodeBetterBlockAsm12B: + CMPW $0x08, R7 + BLO matchlen_match4_match_nolit_encodeBetterBlockAsm12B + MOVD (R8)(R11), R10 + MOVD (R9)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_match_nolit_encodeBetterBlockAsm12B + SUB $8, R7, R7 + MOVWU R7, R7 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP matchlen_match4_match_nolit_encodeBetterBlockAsm12B + +matchlen_bsf_8_match_nolit_encodeBetterBlockAsm12B: + RBIT R10, R10 + CLZ R10, R10 + ASR $0x03, R10, R10 + ADD R10, R11, R11 + MOVWU R11, R11 + JMP match_nolit_end_encodeBetterBlockAsm12B + +matchlen_match4_match_nolit_encodeBetterBlockAsm12B: + CMPW $0x04, R7 + BLO matchlen_match2_match_nolit_encodeBetterBlockAsm12B + MOVWU (R8)(R11), R10 + MOVWU (R9)(R11), R16 + CMPW R10, R16 + BNE matchlen_match2_match_nolit_encodeBetterBlockAsm12B + SUB $4, R7, R7 + MOVWU R7, R7 + ADD $4, R11, R11 + MOVWU R11, R11 + +matchlen_match2_match_nolit_encodeBetterBlockAsm12B: + CMPW $0x01, R7 + BEQ matchlen_match1_match_nolit_encodeBetterBlockAsm12B + BLO match_nolit_end_encodeBetterBlockAsm12B + MOVHU (R8)(R11), R16 + BFI $0, R16, $16, R10 + ADD R11, R9, R15 + MOVHU (R15), R15 + AND $0xffff, R10, R16 + CMP R16, R15 + BNE matchlen_match1_match_nolit_encodeBetterBlockAsm12B + ADD $2, R11, R11 + MOVWU R11, R11 + SUBSW $0x02, R7, R7 + BEQ match_nolit_end_encodeBetterBlockAsm12B + +matchlen_match1_match_nolit_encodeBetterBlockAsm12B: + MOVBU (R8)(R11), R16 + BFI $0, R16, $8, R10 + ADD R11, R9, R15 + MOVBU (R15), R15 + AND $0xff, R10, R16 + CMP R16, R15 + BNE match_nolit_end_encodeBetterBlockAsm12B + ADD $1, R11, R11 + MOVWU R11, R11 + +match_nolit_end_encodeBetterBlockAsm12B: + MOVWU R2, R7 + SUBW R5, R7, R7 + + // Check if repeat + MOVWU 24(RSP), R16 + CMPW R7, R16 + BEQ match_is_repeat_encodeBetterBlockAsm12B + MOVW R7, 24(RSP) + MOVWU 20(RSP), R5 + CMPW R6, R5 + BEQ emit_literal_done_match_emit_encodeBetterBlockAsm12B + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R5, R3, R9 + SUBW R5, R8, R8 + SUB $1, R8, R5 + MOVWU R5, R5 + CMPW $0x3c, R5 + BLO one_byte_match_emit_encodeBetterBlockAsm12B + CMPW $0x00000100, R5 + BLO two_bytes_match_emit_encodeBetterBlockAsm12B + BLO three_bytes_match_emit_encodeBetterBlockAsm12B + +three_bytes_match_emit_encodeBetterBlockAsm12B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_match_emit_encodeBetterBlockAsm12B + +two_bytes_match_emit_encodeBetterBlockAsm12B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R5, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R5 + BLO memmove_match_emit_encodeBetterBlockAsm12B + JMP memmove_long_match_emit_encodeBetterBlockAsm12B + +one_byte_match_emit_encodeBetterBlockAsm12B: + LSLW $0x02, R5, R16 + BFI $0, R16, $8, R5 + MOVB R5, (R1) + ADD $0x01, R1, R1 + +memmove_match_emit_encodeBetterBlockAsm12B: + ADD R8, R1, R5 + + // genMemMoveShort + CMP $0x04, R8 + BLS emit_lit_memmove_match_emit_encodeBetterBlockAsm12B_memmove_move_4 + CMP $0x08, R8 + BLO emit_lit_memmove_match_emit_encodeBetterBlockAsm12B_memmove_move_4through7 + CMP $0x10, R8 + BLS emit_lit_memmove_match_emit_encodeBetterBlockAsm12B_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_match_emit_encodeBetterBlockAsm12B_memmove_move_17through32 + JMP emit_lit_memmove_match_emit_encodeBetterBlockAsm12B_memmove_move_33through64 + +emit_lit_memmove_match_emit_encodeBetterBlockAsm12B_memmove_move_4: + MOVWU (R9), R10 + MOVW R10, (R1) + JMP memmove_end_copy_match_emit_encodeBetterBlockAsm12B + +emit_lit_memmove_match_emit_encodeBetterBlockAsm12B_memmove_move_4through7: + MOVWU (R9), R10 + ADD R8, R9, R15 + MOVWU -4(R15), R9 + MOVW R10, (R1) + ADD R8, R1, R15 + MOVW R9, -4(R15) + JMP memmove_end_copy_match_emit_encodeBetterBlockAsm12B + +emit_lit_memmove_match_emit_encodeBetterBlockAsm12B_memmove_move_8through16: + MOVD (R9), R10 + ADD R8, R9, R15 + MOVD -8(R15), R9 + MOVD R10, (R1) + ADD R8, R1, R15 + MOVD R9, -8(R15) + JMP memmove_end_copy_match_emit_encodeBetterBlockAsm12B + +emit_lit_memmove_match_emit_encodeBetterBlockAsm12B_memmove_move_17through32: + FMOVQ (R9), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_match_emit_encodeBetterBlockAsm12B + +emit_lit_memmove_match_emit_encodeBetterBlockAsm12B_memmove_move_33through64: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + ADD R8, R9, R15 + FMOVQ -32(R15), F2 + ADD R8, R9, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_match_emit_encodeBetterBlockAsm12B: + MOVD R5, R1 + JMP emit_literal_done_match_emit_encodeBetterBlockAsm12B + +memmove_long_match_emit_encodeBetterBlockAsm12B: + ADD R8, R1, R5 + + // genMemMoveLong + MOVD R9, R10 + MOVD R1, R12 + MOVD R8, R13 + +emit_lit_memmove_long_match_emit_encodeBetterBlockAsm12Blarge_big_loop_back: + FMOVQ (R10), F0 + FMOVQ 16(R10), F1 + FMOVQ F0, (R12) + FMOVQ F1, 16(R12) + ADD $0x20, R10, R10 + ADD $0x20, R12, R12 + SUB $0x20, R13, R13 + CMP $0x20, R13 + BHS emit_lit_memmove_long_match_emit_encodeBetterBlockAsm12Blarge_big_loop_back + ADD R8, R9, R15 + FMOVQ -32(R15), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R5, R1 + +emit_literal_done_match_emit_encodeBetterBlockAsm12B: + ADDW R11, R2, R2 + ADDW $0x04, R11, R11 + MOVW R2, 20(RSP) + + // emitCopy + CMPW $0x40, R11 + BLS two_byte_offset_short_match_nolit_encodeBetterBlockAsm12B + CMPW $0x00000800, R7 + BHS long_offset_short_match_nolit_encodeBetterBlockAsm12B + MOVD $0x00000001, R5 + ADD $16, R5, R5 + MOVWU R5, R5 + MOVB R7, 1(R1) + LSRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + SUBW $0x08, R11, R11 + + // emitRepeat + SUB $4, R11, R11 + MOVWU R11, R11 + JMP cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm12B_emit_copy_short_2b + MOVWU R11, R5 + SUB $4, R11, R11 + MOVWU R11, R11 + CMPW $0x08, R5 + BLS repeat_two_match_nolit_encodeBetterBlockAsm12B_emit_copy_short_2b + CMPW $0x0c, R5 + BHS cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm12B_emit_copy_short_2b + CMPW $0x00000800, R7 + BLO repeat_two_offset_match_nolit_encodeBetterBlockAsm12B_emit_copy_short_2b + +cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm12B_emit_copy_short_2b: + CMPW $0x00000104, R11 + BLO repeat_three_match_nolit_encodeBetterBlockAsm12B_emit_copy_short_2b + SUB $256, R11, R11 + MOVWU R11, R11 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R11, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm12B + +repeat_three_match_nolit_encodeBetterBlockAsm12B_emit_copy_short_2b: + SUB $4, R11, R11 + MOVWU R11, R11 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R11, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm12B + +repeat_two_match_nolit_encodeBetterBlockAsm12B_emit_copy_short_2b: + LSLW $0x02, R11, R11 + ORRW $0x01, R11, R11 + MOVH R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm12B + +repeat_two_offset_match_nolit_encodeBetterBlockAsm12B_emit_copy_short_2b: + MOVD $0, R5 + ADD R11<<2, R5, R11 + ADD $1, R11, R11 + MOVWU R11, R11 + MOVB R7, 1(R1) + ASRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R11, R11 + MOVB R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm12B + +long_offset_short_match_nolit_encodeBetterBlockAsm12B: + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R7, 1(R1) + SUB $60, R11, R11 + MOVWU R11, R11 + ADD $0x03, R1, R1 + + // emitRepeat + MOVWU R11, R5 + SUB $4, R11, R11 + MOVWU R11, R11 + CMPW $0x08, R5 + BLS repeat_two_match_nolit_encodeBetterBlockAsm12B_emit_copy_short + CMPW $0x0c, R5 + BHS cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm12B_emit_copy_short + CMPW $0x00000800, R7 + BLO repeat_two_offset_match_nolit_encodeBetterBlockAsm12B_emit_copy_short + +cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm12B_emit_copy_short: + CMPW $0x00000104, R11 + BLO repeat_three_match_nolit_encodeBetterBlockAsm12B_emit_copy_short + SUB $256, R11, R11 + MOVWU R11, R11 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R11, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm12B + +repeat_three_match_nolit_encodeBetterBlockAsm12B_emit_copy_short: + SUB $4, R11, R11 + MOVWU R11, R11 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R11, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm12B + +repeat_two_match_nolit_encodeBetterBlockAsm12B_emit_copy_short: + LSLW $0x02, R11, R11 + ORRW $0x01, R11, R11 + MOVH R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm12B + +repeat_two_offset_match_nolit_encodeBetterBlockAsm12B_emit_copy_short: + MOVD $0, R5 + ADD R11<<2, R5, R11 + ADD $1, R11, R11 + MOVWU R11, R11 + MOVB R7, 1(R1) + ASRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R11, R11 + MOVB R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm12B + +two_byte_offset_short_match_nolit_encodeBetterBlockAsm12B: + MOVWU R11, R5 + LSLW $0x02, R5, R5 + CMPW $0x0c, R11 + BHS emit_copy_three_match_nolit_encodeBetterBlockAsm12B + CMPW $0x00000800, R7 + BHS emit_copy_three_match_nolit_encodeBetterBlockAsm12B + SUB $15, R5, R5 + MOVWU R5, R5 + MOVB R7, 1(R1) + LSRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm12B + +emit_copy_three_match_nolit_encodeBetterBlockAsm12B: + SUB $2, R5, R5 + MOVWU R5, R5 + MOVB R5, (R1) + MOVH R7, 1(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm12B + +match_is_repeat_encodeBetterBlockAsm12B: + MOVWU 20(RSP), R5 + CMPW R6, R5 + BEQ emit_literal_done_match_emit_repeat_encodeBetterBlockAsm12B + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R5, R3, R9 + SUBW R5, R8, R8 + SUB $1, R8, R5 + MOVWU R5, R5 + CMPW $0x3c, R5 + BLO one_byte_match_emit_repeat_encodeBetterBlockAsm12B + CMPW $0x00000100, R5 + BLO two_bytes_match_emit_repeat_encodeBetterBlockAsm12B + BLO three_bytes_match_emit_repeat_encodeBetterBlockAsm12B + +three_bytes_match_emit_repeat_encodeBetterBlockAsm12B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_match_emit_repeat_encodeBetterBlockAsm12B + +two_bytes_match_emit_repeat_encodeBetterBlockAsm12B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R5, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R5 + BLO memmove_match_emit_repeat_encodeBetterBlockAsm12B + JMP memmove_long_match_emit_repeat_encodeBetterBlockAsm12B + +one_byte_match_emit_repeat_encodeBetterBlockAsm12B: + LSLW $0x02, R5, R16 + BFI $0, R16, $8, R5 + MOVB R5, (R1) + ADD $0x01, R1, R1 + +memmove_match_emit_repeat_encodeBetterBlockAsm12B: + ADD R8, R1, R5 + + // genMemMoveShort + CMP $0x04, R8 + BLS emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm12B_memmove_move_4 + CMP $0x08, R8 + BLO emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm12B_memmove_move_4through7 + CMP $0x10, R8 + BLS emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm12B_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm12B_memmove_move_17through32 + JMP emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm12B_memmove_move_33through64 + +emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm12B_memmove_move_4: + MOVWU (R9), R10 + MOVW R10, (R1) + JMP memmove_end_copy_match_emit_repeat_encodeBetterBlockAsm12B + +emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm12B_memmove_move_4through7: + MOVWU (R9), R10 + ADD R8, R9, R15 + MOVWU -4(R15), R9 + MOVW R10, (R1) + ADD R8, R1, R15 + MOVW R9, -4(R15) + JMP memmove_end_copy_match_emit_repeat_encodeBetterBlockAsm12B + +emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm12B_memmove_move_8through16: + MOVD (R9), R10 + ADD R8, R9, R15 + MOVD -8(R15), R9 + MOVD R10, (R1) + ADD R8, R1, R15 + MOVD R9, -8(R15) + JMP memmove_end_copy_match_emit_repeat_encodeBetterBlockAsm12B + +emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm12B_memmove_move_17through32: + FMOVQ (R9), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_match_emit_repeat_encodeBetterBlockAsm12B + +emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm12B_memmove_move_33through64: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + ADD R8, R9, R15 + FMOVQ -32(R15), F2 + ADD R8, R9, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_match_emit_repeat_encodeBetterBlockAsm12B: + MOVD R5, R1 + JMP emit_literal_done_match_emit_repeat_encodeBetterBlockAsm12B + +memmove_long_match_emit_repeat_encodeBetterBlockAsm12B: + ADD R8, R1, R5 + + // genMemMoveLong + MOVD R9, R10 + MOVD R1, R12 + MOVD R8, R13 + +emit_lit_memmove_long_match_emit_repeat_encodeBetterBlockAsm12Blarge_big_loop_back: + FMOVQ (R10), F0 + FMOVQ 16(R10), F1 + FMOVQ F0, (R12) + FMOVQ F1, 16(R12) + ADD $0x20, R10, R10 + ADD $0x20, R12, R12 + SUB $0x20, R13, R13 + CMP $0x20, R13 + BHS emit_lit_memmove_long_match_emit_repeat_encodeBetterBlockAsm12Blarge_big_loop_back + ADD R8, R9, R15 + FMOVQ -32(R15), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R5, R1 + +emit_literal_done_match_emit_repeat_encodeBetterBlockAsm12B: + ADDW R11, R2, R2 + ADDW $0x04, R11, R11 + MOVW R2, 20(RSP) + + // emitRepeat + MOVWU R11, R5 + SUB $4, R11, R11 + MOVWU R11, R11 + CMPW $0x08, R5 + BLS repeat_two_match_nolit_repeat_encodeBetterBlockAsm12B + CMPW $0x0c, R5 + BHS cant_repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm12B + CMPW $0x00000800, R7 + BLO repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm12B + +cant_repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm12B: + CMPW $0x00000104, R11 + BLO repeat_three_match_nolit_repeat_encodeBetterBlockAsm12B + SUB $256, R11, R11 + MOVWU R11, R11 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R11, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm12B + +repeat_three_match_nolit_repeat_encodeBetterBlockAsm12B: + SUB $4, R11, R11 + MOVWU R11, R11 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R11, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm12B + +repeat_two_match_nolit_repeat_encodeBetterBlockAsm12B: + LSLW $0x02, R11, R11 + ORRW $0x01, R11, R11 + MOVH R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm12B + +repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm12B: + MOVD $0, R5 + ADD R11<<2, R5, R11 + ADD $1, R11, R11 + MOVWU R11, R11 + MOVB R7, 1(R1) + ASRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R11, R11 + MOVB R11, (R1) + ADD $0x02, R1, R1 + +match_nolit_emitcopy_end_encodeBetterBlockAsm12B: + MOVWU 16(RSP), R16 + CMPW R16, R2 + BHS emit_remainder_encodeBetterBlockAsm12B + MOVD 8(RSP), R16 + CMP R16, R1 + BLO match_nolit_dst_ok_encodeBetterBlockAsm12B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_nolit_dst_ok_encodeBetterBlockAsm12B: + MOVD $0x0000cf1bbcdcbf9b, R5 + MOVD $0x9e3779b1, R7 + ADD $1, R6, R6 + SUB $2, R2, R8 + MOVD (R3)(R6), R9 + ADD R6, R3, R15 + MOVD 1(R15), R10 + MOVD (R3)(R8), R11 + ADD R8, R3, R15 + MOVD 1(R15), R12 + LSL $0x10, R9, R9 + MUL R5, R9, R9 + LSR $0x32, R9, R9 + LSL $0x20, R10, R10 + MUL R7, R10, R10 + LSR $0x34, R10, R10 + LSL $0x10, R11, R11 + MUL R5, R11, R11 + LSR $0x32, R11, R11 + LSL $0x20, R12, R12 + MUL R7, R12, R12 + LSR $0x34, R12, R12 + ADD $1, R6, R7 + ADD $1, R8, R13 + MOVW R6, (R0)(R9<<2) + MOVW R8, (R0)(R11<<2) + ADD R10<<2, R0, R15 + MOVW R7, 65536(R15) + ADD R12<<2, R0, R15 + MOVW R13, 65536(R15) + ADD R6, R8, R7 + ADD $1, R7, R7 + LSR $0x01, R7, R7 + ADD $0x01, R6, R6 + SUB $0x01, R8, R8 + +index_loop_encodeBetterBlockAsm12B: + CMP R8, R7 + BHS search_loop_encodeBetterBlockAsm12B + MOVD (R3)(R6), R9 + MOVD (R3)(R7), R10 + LSL $0x10, R9, R9 + MUL R5, R9, R9 + LSR $0x32, R9, R9 + LSL $0x10, R10, R10 + MUL R5, R10, R10 + LSR $0x32, R10, R10 + MOVW R6, (R0)(R9<<2) + MOVW R7, (R0)(R10<<2) + ADD $0x02, R6, R6 + ADD $0x02, R7, R7 + JMP index_loop_encodeBetterBlockAsm12B + +emit_remainder_encodeBetterBlockAsm12B: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R16 + SUBW R16, R0, R0 + ADD R0, R1, R0 + ADD $3, R0, R0 + MOVD 8(RSP), R16 + CMP R16, R0 + BLO emit_remainder_ok_encodeBetterBlockAsm12B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +emit_remainder_ok_encodeBetterBlockAsm12B: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R2 + CMPW R0, R2 + BEQ emit_literal_done_emit_remainder_encodeBetterBlockAsm12B + MOVWU R0, R5 + MOVW R0, 20(RSP) + ADD R2, R3, R0 + SUBW R2, R5, R5 + SUB $1, R5, R2 + MOVWU R2, R2 + CMPW $0x3c, R2 + BLO one_byte_emit_remainder_encodeBetterBlockAsm12B + CMPW $0x00000100, R2 + BLO two_bytes_emit_remainder_encodeBetterBlockAsm12B + BLO three_bytes_emit_remainder_encodeBetterBlockAsm12B + +three_bytes_emit_remainder_encodeBetterBlockAsm12B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R2, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_emit_remainder_encodeBetterBlockAsm12B + +two_bytes_emit_remainder_encodeBetterBlockAsm12B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R2, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R2 + BLO memmove_emit_remainder_encodeBetterBlockAsm12B + JMP memmove_long_emit_remainder_encodeBetterBlockAsm12B + +one_byte_emit_remainder_encodeBetterBlockAsm12B: + LSLW $0x02, R2, R16 + BFI $0, R16, $8, R2 + MOVB R2, (R1) + ADD $0x01, R1, R1 + +memmove_emit_remainder_encodeBetterBlockAsm12B: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveShort + CMP $0x03, R3 + BLO emit_lit_memmove_emit_remainder_encodeBetterBlockAsm12B_memmove_move_1or2 + BEQ emit_lit_memmove_emit_remainder_encodeBetterBlockAsm12B_memmove_move_3 + CMP $0x08, R3 + BLO emit_lit_memmove_emit_remainder_encodeBetterBlockAsm12B_memmove_move_4through7 + CMP $0x10, R3 + BLS emit_lit_memmove_emit_remainder_encodeBetterBlockAsm12B_memmove_move_8through16 + CMP $0x20, R3 + BLS emit_lit_memmove_emit_remainder_encodeBetterBlockAsm12B_memmove_move_17through32 + JMP emit_lit_memmove_emit_remainder_encodeBetterBlockAsm12B_memmove_move_33through64 + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm12B_memmove_move_1or2: + MOVBU (R0), R16 + BFI $0, R16, $8, R5 + ADD R3, R0, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R0 + MOVB R5, (R1) + ADD R3, R1, R15 + MOVB R0, -1(R15) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm12B + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm12B_memmove_move_3: + MOVHU (R0), R16 + BFI $0, R16, $16, R5 + MOVBU 2(R0), R16 + BFI $0, R16, $8, R0 + MOVH R5, (R1) + MOVB R0, 2(R1) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm12B + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm12B_memmove_move_4through7: + MOVWU (R0), R5 + ADD R3, R0, R15 + MOVWU -4(R15), R0 + MOVW R5, (R1) + ADD R3, R1, R15 + MOVW R0, -4(R15) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm12B + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm12B_memmove_move_8through16: + MOVD (R0), R5 + ADD R3, R0, R15 + MOVD -8(R15), R0 + MOVD R5, (R1) + ADD R3, R1, R15 + MOVD R0, -8(R15) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm12B + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm12B_memmove_move_17through32: + FMOVQ (R0), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm12B + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm12B_memmove_move_33through64: + FMOVQ (R0), F0 + FMOVQ 16(R0), F1 + ADD R3, R0, R15 + FMOVQ -32(R15), F2 + ADD R3, R0, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R3, R1, R15 + FMOVQ F2, -32(R15) + ADD R3, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_emit_remainder_encodeBetterBlockAsm12B: + MOVD R2, R1 + JMP emit_literal_done_emit_remainder_encodeBetterBlockAsm12B + +memmove_long_emit_remainder_encodeBetterBlockAsm12B: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveLong + MOVD R0, R5 + MOVD R1, R6 + MOVD R3, R7 + +emit_lit_memmove_long_emit_remainder_encodeBetterBlockAsm12Blarge_big_loop_back: + FMOVQ (R5), F0 + FMOVQ 16(R5), F1 + FMOVQ F0, (R6) + FMOVQ F1, 16(R6) + ADD $0x20, R5, R5 + ADD $0x20, R6, R6 + SUB $0x20, R7, R7 + CMP $0x20, R7 + BHS emit_lit_memmove_long_emit_remainder_encodeBetterBlockAsm12Blarge_big_loop_back + ADD R3, R0, R15 + FMOVQ -32(R15), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + ADD R3, R1, R15 + FMOVQ F0, -32(R15) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + MOVD R2, R1 + +emit_literal_done_emit_remainder_encodeBetterBlockAsm12B: + MOVD dst_base+0(FP), R0 + SUB R0, R1, R1 + MOVD R1, ret+56(FP) + RET + +// func encodeBetterBlockAsm10B(dst []byte, src []byte, tmp *[20480]byte) int +// Requires: BMI, SSE2 +TEXT ·encodeBetterBlockAsm10B(SB), $24-64 + MOVD tmp+48(FP), R0 + MOVD dst_base+0(FP), R1 + MOVD $0x000000a0, R2 + MOVD R0, R3 + VEOR V0.B16, V0.B16, V0.B16 + +zero_loop_encodeBetterBlockAsm10B: + FMOVQ F0, (R3) + FMOVQ F0, 16(R3) + FMOVQ F0, 32(R3) + FMOVQ F0, 48(R3) + FMOVQ F0, 64(R3) + FMOVQ F0, 80(R3) + FMOVQ F0, 96(R3) + FMOVQ F0, 112(R3) + ADD $0x80, R3, R3 + SUBS $1, R2, R2 + BNE zero_loop_encodeBetterBlockAsm10B + MOVD $0x00000000, R16 + MOVW R16, 20(RSP) + MOVD src_len+32(FP), R2 + SUB $6, R2, R3 + SUB $8, R2, R5 + MOVW R5, 16(RSP) + LSR $0x05, R2, R2 + SUBW R2, R3, R3 + ADD R3, R1, R3 + MOVD R3, 8(RSP) + MOVD $0x00000001, R2 + MOVD $0x00000000, R16 + MOVW R16, 24(RSP) + MOVD src_base+24(FP), R3 + +search_loop_encodeBetterBlockAsm10B: + MOVWU R2, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + LSRW $0x05, R5, R5 + ADD R5, R2, R5 + ADD $1, R5, R5 + MOVWU R5, R5 + MOVWU 16(RSP), R16 + CMPW R16, R5 + BHS emit_remainder_encodeBetterBlockAsm10B + MOVD (R3)(R2), R6 + MOVW R5, 28(RSP) + MOVD $0x0000cf1bbcdcbf9b, R8 + MOVD $0x9e3779b1, R5 + MOVD R6, R9 + MOVD R6, R10 + LSL $0x10, R9, R9 + MUL R8, R9, R9 + LSR $0x34, R9, R9 + LSL $0x20, R10, R10 + MUL R5, R10, R10 + LSR $0x36, R10, R10 + MOVWU (R0)(R9<<2), R5 + ADD R10<<2, R0, R15 + MOVWU 16384(R15), R7 + MOVW R2, (R0)(R9<<2) + ADD R10<<2, R0, R15 + MOVW R2, 16384(R15) + MOVD (R3)(R5), R9 + MOVD (R3)(R7), R10 + CMP R6, R9 + BEQ candidate_match_encodeBetterBlockAsm10B + CMP R6, R10 + BNE no_short_found_encodeBetterBlockAsm10B + MOVWU R7, R5 + JMP candidate_match_encodeBetterBlockAsm10B + +no_short_found_encodeBetterBlockAsm10B: + CMPW R6, R9 + BEQ candidate_match_encodeBetterBlockAsm10B + CMPW R6, R10 + BEQ candidateS_match_encodeBetterBlockAsm10B + MOVWU 28(RSP), R2 + JMP search_loop_encodeBetterBlockAsm10B + +candidateS_match_encodeBetterBlockAsm10B: + LSR $0x08, R6, R6 + MOVD R6, R9 + LSL $0x10, R9, R9 + MUL R8, R9, R9 + LSR $0x34, R9, R9 + MOVWU (R0)(R9<<2), R5 + ADDW $1, R2, R2 + MOVW R2, (R0)(R9<<2) + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate_match_encodeBetterBlockAsm10B + SUBW $1, R2, R2 + MOVWU R7, R5 + +candidate_match_encodeBetterBlockAsm10B: + MOVWU 20(RSP), R6 + TSTW R5, R5 + BEQ match_extend_back_end_encodeBetterBlockAsm10B + +match_extend_back_loop_encodeBetterBlockAsm10B: + CMPW R6, R2 + BLS match_extend_back_end_encodeBetterBlockAsm10B + ADD R5, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R7 + ADD R2, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + AND $0xff, R8, R16 + AND $0xff, R7, R15 + CMP R16, R15 + BNE match_extend_back_end_encodeBetterBlockAsm10B + SUB $1, R2, R2 + MOVWU R2, R2 + SUBSW $1, R5, R5 + BEQ match_extend_back_end_encodeBetterBlockAsm10B + JMP match_extend_back_loop_encodeBetterBlockAsm10B + +match_extend_back_end_encodeBetterBlockAsm10B: + MOVWU R2, R6 + MOVWU 20(RSP), R16 + SUBW R16, R6, R6 + ADD R6, R1, R6 + ADD $3, R6, R6 + MOVD 8(RSP), R16 + CMP R16, R6 + BLO match_dst_size_check_encodeBetterBlockAsm10B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_dst_size_check_encodeBetterBlockAsm10B: + MOVWU R2, R6 + ADDW $0x04, R2, R2 + ADDW $0x04, R5, R5 + MOVD src_len+32(FP), R7 + SUBW R2, R7, R7 + ADD R2, R3, R8 + ADD R5, R3, R9 + + // matchLen + MOVD $0, R11 + +matchlen_loopback_16_match_nolit_encodeBetterBlockAsm10B: + CMPW $0x10, R7 + BLO matchlen_match8_match_nolit_encodeBetterBlockAsm10B + MOVD (R8)(R11), R10 + ADD R11, R8, R15 + MOVD 8(R15), R12 + MOVD (R9)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_match_nolit_encodeBetterBlockAsm10B + ADD R11, R9, R15 + MOVD 8(R15), R16 + EOR R16, R12, R12 + TST R12, R12 + BNE matchlen_bsf_16match_nolit_encodeBetterBlockAsm10B + SUB $16, R7, R7 + MOVWU R7, R7 + ADD $16, R11, R11 + MOVWU R11, R11 + JMP matchlen_loopback_16_match_nolit_encodeBetterBlockAsm10B + +matchlen_bsf_16match_nolit_encodeBetterBlockAsm10B: + RBIT R12, R12 + CLZ R12, R12 + ASR $0x03, R12, R12 + ADD R12, R11, R11 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP match_nolit_end_encodeBetterBlockAsm10B + +matchlen_match8_match_nolit_encodeBetterBlockAsm10B: + CMPW $0x08, R7 + BLO matchlen_match4_match_nolit_encodeBetterBlockAsm10B + MOVD (R8)(R11), R10 + MOVD (R9)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_match_nolit_encodeBetterBlockAsm10B + SUB $8, R7, R7 + MOVWU R7, R7 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP matchlen_match4_match_nolit_encodeBetterBlockAsm10B + +matchlen_bsf_8_match_nolit_encodeBetterBlockAsm10B: + RBIT R10, R10 + CLZ R10, R10 + ASR $0x03, R10, R10 + ADD R10, R11, R11 + MOVWU R11, R11 + JMP match_nolit_end_encodeBetterBlockAsm10B + +matchlen_match4_match_nolit_encodeBetterBlockAsm10B: + CMPW $0x04, R7 + BLO matchlen_match2_match_nolit_encodeBetterBlockAsm10B + MOVWU (R8)(R11), R10 + MOVWU (R9)(R11), R16 + CMPW R10, R16 + BNE matchlen_match2_match_nolit_encodeBetterBlockAsm10B + SUB $4, R7, R7 + MOVWU R7, R7 + ADD $4, R11, R11 + MOVWU R11, R11 + +matchlen_match2_match_nolit_encodeBetterBlockAsm10B: + CMPW $0x01, R7 + BEQ matchlen_match1_match_nolit_encodeBetterBlockAsm10B + BLO match_nolit_end_encodeBetterBlockAsm10B + MOVHU (R8)(R11), R16 + BFI $0, R16, $16, R10 + ADD R11, R9, R15 + MOVHU (R15), R15 + AND $0xffff, R10, R16 + CMP R16, R15 + BNE matchlen_match1_match_nolit_encodeBetterBlockAsm10B + ADD $2, R11, R11 + MOVWU R11, R11 + SUBSW $0x02, R7, R7 + BEQ match_nolit_end_encodeBetterBlockAsm10B + +matchlen_match1_match_nolit_encodeBetterBlockAsm10B: + MOVBU (R8)(R11), R16 + BFI $0, R16, $8, R10 + ADD R11, R9, R15 + MOVBU (R15), R15 + AND $0xff, R10, R16 + CMP R16, R15 + BNE match_nolit_end_encodeBetterBlockAsm10B + ADD $1, R11, R11 + MOVWU R11, R11 + +match_nolit_end_encodeBetterBlockAsm10B: + MOVWU R2, R7 + SUBW R5, R7, R7 + + // Check if repeat + MOVWU 24(RSP), R16 + CMPW R7, R16 + BEQ match_is_repeat_encodeBetterBlockAsm10B + MOVW R7, 24(RSP) + MOVWU 20(RSP), R5 + CMPW R6, R5 + BEQ emit_literal_done_match_emit_encodeBetterBlockAsm10B + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R5, R3, R9 + SUBW R5, R8, R8 + SUB $1, R8, R5 + MOVWU R5, R5 + CMPW $0x3c, R5 + BLO one_byte_match_emit_encodeBetterBlockAsm10B + CMPW $0x00000100, R5 + BLO two_bytes_match_emit_encodeBetterBlockAsm10B + BLO three_bytes_match_emit_encodeBetterBlockAsm10B + +three_bytes_match_emit_encodeBetterBlockAsm10B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_match_emit_encodeBetterBlockAsm10B + +two_bytes_match_emit_encodeBetterBlockAsm10B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R5, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R5 + BLO memmove_match_emit_encodeBetterBlockAsm10B + JMP memmove_long_match_emit_encodeBetterBlockAsm10B + +one_byte_match_emit_encodeBetterBlockAsm10B: + LSLW $0x02, R5, R16 + BFI $0, R16, $8, R5 + MOVB R5, (R1) + ADD $0x01, R1, R1 + +memmove_match_emit_encodeBetterBlockAsm10B: + ADD R8, R1, R5 + + // genMemMoveShort + CMP $0x04, R8 + BLS emit_lit_memmove_match_emit_encodeBetterBlockAsm10B_memmove_move_4 + CMP $0x08, R8 + BLO emit_lit_memmove_match_emit_encodeBetterBlockAsm10B_memmove_move_4through7 + CMP $0x10, R8 + BLS emit_lit_memmove_match_emit_encodeBetterBlockAsm10B_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_match_emit_encodeBetterBlockAsm10B_memmove_move_17through32 + JMP emit_lit_memmove_match_emit_encodeBetterBlockAsm10B_memmove_move_33through64 + +emit_lit_memmove_match_emit_encodeBetterBlockAsm10B_memmove_move_4: + MOVWU (R9), R10 + MOVW R10, (R1) + JMP memmove_end_copy_match_emit_encodeBetterBlockAsm10B + +emit_lit_memmove_match_emit_encodeBetterBlockAsm10B_memmove_move_4through7: + MOVWU (R9), R10 + ADD R8, R9, R15 + MOVWU -4(R15), R9 + MOVW R10, (R1) + ADD R8, R1, R15 + MOVW R9, -4(R15) + JMP memmove_end_copy_match_emit_encodeBetterBlockAsm10B + +emit_lit_memmove_match_emit_encodeBetterBlockAsm10B_memmove_move_8through16: + MOVD (R9), R10 + ADD R8, R9, R15 + MOVD -8(R15), R9 + MOVD R10, (R1) + ADD R8, R1, R15 + MOVD R9, -8(R15) + JMP memmove_end_copy_match_emit_encodeBetterBlockAsm10B + +emit_lit_memmove_match_emit_encodeBetterBlockAsm10B_memmove_move_17through32: + FMOVQ (R9), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_match_emit_encodeBetterBlockAsm10B + +emit_lit_memmove_match_emit_encodeBetterBlockAsm10B_memmove_move_33through64: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + ADD R8, R9, R15 + FMOVQ -32(R15), F2 + ADD R8, R9, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_match_emit_encodeBetterBlockAsm10B: + MOVD R5, R1 + JMP emit_literal_done_match_emit_encodeBetterBlockAsm10B + +memmove_long_match_emit_encodeBetterBlockAsm10B: + ADD R8, R1, R5 + + // genMemMoveLong + MOVD R9, R10 + MOVD R1, R12 + MOVD R8, R13 + +emit_lit_memmove_long_match_emit_encodeBetterBlockAsm10Blarge_big_loop_back: + FMOVQ (R10), F0 + FMOVQ 16(R10), F1 + FMOVQ F0, (R12) + FMOVQ F1, 16(R12) + ADD $0x20, R10, R10 + ADD $0x20, R12, R12 + SUB $0x20, R13, R13 + CMP $0x20, R13 + BHS emit_lit_memmove_long_match_emit_encodeBetterBlockAsm10Blarge_big_loop_back + ADD R8, R9, R15 + FMOVQ -32(R15), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R5, R1 + +emit_literal_done_match_emit_encodeBetterBlockAsm10B: + ADDW R11, R2, R2 + ADDW $0x04, R11, R11 + MOVW R2, 20(RSP) + + // emitCopy + CMPW $0x40, R11 + BLS two_byte_offset_short_match_nolit_encodeBetterBlockAsm10B + CMPW $0x00000800, R7 + BHS long_offset_short_match_nolit_encodeBetterBlockAsm10B + MOVD $0x00000001, R5 + ADD $16, R5, R5 + MOVWU R5, R5 + MOVB R7, 1(R1) + LSRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + SUBW $0x08, R11, R11 + + // emitRepeat + SUB $4, R11, R11 + MOVWU R11, R11 + JMP cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm10B_emit_copy_short_2b + MOVWU R11, R5 + SUB $4, R11, R11 + MOVWU R11, R11 + CMPW $0x08, R5 + BLS repeat_two_match_nolit_encodeBetterBlockAsm10B_emit_copy_short_2b + CMPW $0x0c, R5 + BHS cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm10B_emit_copy_short_2b + CMPW $0x00000800, R7 + BLO repeat_two_offset_match_nolit_encodeBetterBlockAsm10B_emit_copy_short_2b + +cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm10B_emit_copy_short_2b: + CMPW $0x00000104, R11 + BLO repeat_three_match_nolit_encodeBetterBlockAsm10B_emit_copy_short_2b + SUB $256, R11, R11 + MOVWU R11, R11 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R11, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm10B + +repeat_three_match_nolit_encodeBetterBlockAsm10B_emit_copy_short_2b: + SUB $4, R11, R11 + MOVWU R11, R11 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R11, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm10B + +repeat_two_match_nolit_encodeBetterBlockAsm10B_emit_copy_short_2b: + LSLW $0x02, R11, R11 + ORRW $0x01, R11, R11 + MOVH R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm10B + +repeat_two_offset_match_nolit_encodeBetterBlockAsm10B_emit_copy_short_2b: + MOVD $0, R5 + ADD R11<<2, R5, R11 + ADD $1, R11, R11 + MOVWU R11, R11 + MOVB R7, 1(R1) + ASRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R11, R11 + MOVB R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm10B + +long_offset_short_match_nolit_encodeBetterBlockAsm10B: + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R7, 1(R1) + SUB $60, R11, R11 + MOVWU R11, R11 + ADD $0x03, R1, R1 + + // emitRepeat + MOVWU R11, R5 + SUB $4, R11, R11 + MOVWU R11, R11 + CMPW $0x08, R5 + BLS repeat_two_match_nolit_encodeBetterBlockAsm10B_emit_copy_short + CMPW $0x0c, R5 + BHS cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm10B_emit_copy_short + CMPW $0x00000800, R7 + BLO repeat_two_offset_match_nolit_encodeBetterBlockAsm10B_emit_copy_short + +cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm10B_emit_copy_short: + CMPW $0x00000104, R11 + BLO repeat_three_match_nolit_encodeBetterBlockAsm10B_emit_copy_short + SUB $256, R11, R11 + MOVWU R11, R11 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R11, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm10B + +repeat_three_match_nolit_encodeBetterBlockAsm10B_emit_copy_short: + SUB $4, R11, R11 + MOVWU R11, R11 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R11, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm10B + +repeat_two_match_nolit_encodeBetterBlockAsm10B_emit_copy_short: + LSLW $0x02, R11, R11 + ORRW $0x01, R11, R11 + MOVH R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm10B + +repeat_two_offset_match_nolit_encodeBetterBlockAsm10B_emit_copy_short: + MOVD $0, R5 + ADD R11<<2, R5, R11 + ADD $1, R11, R11 + MOVWU R11, R11 + MOVB R7, 1(R1) + ASRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R11, R11 + MOVB R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm10B + +two_byte_offset_short_match_nolit_encodeBetterBlockAsm10B: + MOVWU R11, R5 + LSLW $0x02, R5, R5 + CMPW $0x0c, R11 + BHS emit_copy_three_match_nolit_encodeBetterBlockAsm10B + CMPW $0x00000800, R7 + BHS emit_copy_three_match_nolit_encodeBetterBlockAsm10B + SUB $15, R5, R5 + MOVWU R5, R5 + MOVB R7, 1(R1) + LSRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm10B + +emit_copy_three_match_nolit_encodeBetterBlockAsm10B: + SUB $2, R5, R5 + MOVWU R5, R5 + MOVB R5, (R1) + MOVH R7, 1(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm10B + +match_is_repeat_encodeBetterBlockAsm10B: + MOVWU 20(RSP), R5 + CMPW R6, R5 + BEQ emit_literal_done_match_emit_repeat_encodeBetterBlockAsm10B + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R5, R3, R9 + SUBW R5, R8, R8 + SUB $1, R8, R5 + MOVWU R5, R5 + CMPW $0x3c, R5 + BLO one_byte_match_emit_repeat_encodeBetterBlockAsm10B + CMPW $0x00000100, R5 + BLO two_bytes_match_emit_repeat_encodeBetterBlockAsm10B + BLO three_bytes_match_emit_repeat_encodeBetterBlockAsm10B + +three_bytes_match_emit_repeat_encodeBetterBlockAsm10B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_match_emit_repeat_encodeBetterBlockAsm10B + +two_bytes_match_emit_repeat_encodeBetterBlockAsm10B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R5, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R5 + BLO memmove_match_emit_repeat_encodeBetterBlockAsm10B + JMP memmove_long_match_emit_repeat_encodeBetterBlockAsm10B + +one_byte_match_emit_repeat_encodeBetterBlockAsm10B: + LSLW $0x02, R5, R16 + BFI $0, R16, $8, R5 + MOVB R5, (R1) + ADD $0x01, R1, R1 + +memmove_match_emit_repeat_encodeBetterBlockAsm10B: + ADD R8, R1, R5 + + // genMemMoveShort + CMP $0x04, R8 + BLS emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm10B_memmove_move_4 + CMP $0x08, R8 + BLO emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm10B_memmove_move_4through7 + CMP $0x10, R8 + BLS emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm10B_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm10B_memmove_move_17through32 + JMP emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm10B_memmove_move_33through64 + +emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm10B_memmove_move_4: + MOVWU (R9), R10 + MOVW R10, (R1) + JMP memmove_end_copy_match_emit_repeat_encodeBetterBlockAsm10B + +emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm10B_memmove_move_4through7: + MOVWU (R9), R10 + ADD R8, R9, R15 + MOVWU -4(R15), R9 + MOVW R10, (R1) + ADD R8, R1, R15 + MOVW R9, -4(R15) + JMP memmove_end_copy_match_emit_repeat_encodeBetterBlockAsm10B + +emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm10B_memmove_move_8through16: + MOVD (R9), R10 + ADD R8, R9, R15 + MOVD -8(R15), R9 + MOVD R10, (R1) + ADD R8, R1, R15 + MOVD R9, -8(R15) + JMP memmove_end_copy_match_emit_repeat_encodeBetterBlockAsm10B + +emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm10B_memmove_move_17through32: + FMOVQ (R9), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_match_emit_repeat_encodeBetterBlockAsm10B + +emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm10B_memmove_move_33through64: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + ADD R8, R9, R15 + FMOVQ -32(R15), F2 + ADD R8, R9, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_match_emit_repeat_encodeBetterBlockAsm10B: + MOVD R5, R1 + JMP emit_literal_done_match_emit_repeat_encodeBetterBlockAsm10B + +memmove_long_match_emit_repeat_encodeBetterBlockAsm10B: + ADD R8, R1, R5 + + // genMemMoveLong + MOVD R9, R10 + MOVD R1, R12 + MOVD R8, R13 + +emit_lit_memmove_long_match_emit_repeat_encodeBetterBlockAsm10Blarge_big_loop_back: + FMOVQ (R10), F0 + FMOVQ 16(R10), F1 + FMOVQ F0, (R12) + FMOVQ F1, 16(R12) + ADD $0x20, R10, R10 + ADD $0x20, R12, R12 + SUB $0x20, R13, R13 + CMP $0x20, R13 + BHS emit_lit_memmove_long_match_emit_repeat_encodeBetterBlockAsm10Blarge_big_loop_back + ADD R8, R9, R15 + FMOVQ -32(R15), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R5, R1 + +emit_literal_done_match_emit_repeat_encodeBetterBlockAsm10B: + ADDW R11, R2, R2 + ADDW $0x04, R11, R11 + MOVW R2, 20(RSP) + + // emitRepeat + MOVWU R11, R5 + SUB $4, R11, R11 + MOVWU R11, R11 + CMPW $0x08, R5 + BLS repeat_two_match_nolit_repeat_encodeBetterBlockAsm10B + CMPW $0x0c, R5 + BHS cant_repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm10B + CMPW $0x00000800, R7 + BLO repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm10B + +cant_repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm10B: + CMPW $0x00000104, R11 + BLO repeat_three_match_nolit_repeat_encodeBetterBlockAsm10B + SUB $256, R11, R11 + MOVWU R11, R11 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R11, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm10B + +repeat_three_match_nolit_repeat_encodeBetterBlockAsm10B: + SUB $4, R11, R11 + MOVWU R11, R11 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R11, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm10B + +repeat_two_match_nolit_repeat_encodeBetterBlockAsm10B: + LSLW $0x02, R11, R11 + ORRW $0x01, R11, R11 + MOVH R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm10B + +repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm10B: + MOVD $0, R5 + ADD R11<<2, R5, R11 + ADD $1, R11, R11 + MOVWU R11, R11 + MOVB R7, 1(R1) + ASRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R11, R11 + MOVB R11, (R1) + ADD $0x02, R1, R1 + +match_nolit_emitcopy_end_encodeBetterBlockAsm10B: + MOVWU 16(RSP), R16 + CMPW R16, R2 + BHS emit_remainder_encodeBetterBlockAsm10B + MOVD 8(RSP), R16 + CMP R16, R1 + BLO match_nolit_dst_ok_encodeBetterBlockAsm10B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_nolit_dst_ok_encodeBetterBlockAsm10B: + MOVD $0x0000cf1bbcdcbf9b, R5 + MOVD $0x9e3779b1, R7 + ADD $1, R6, R6 + SUB $2, R2, R8 + MOVD (R3)(R6), R9 + ADD R6, R3, R15 + MOVD 1(R15), R10 + MOVD (R3)(R8), R11 + ADD R8, R3, R15 + MOVD 1(R15), R12 + LSL $0x10, R9, R9 + MUL R5, R9, R9 + LSR $0x34, R9, R9 + LSL $0x20, R10, R10 + MUL R7, R10, R10 + LSR $0x36, R10, R10 + LSL $0x10, R11, R11 + MUL R5, R11, R11 + LSR $0x34, R11, R11 + LSL $0x20, R12, R12 + MUL R7, R12, R12 + LSR $0x36, R12, R12 + ADD $1, R6, R7 + ADD $1, R8, R13 + MOVW R6, (R0)(R9<<2) + MOVW R8, (R0)(R11<<2) + ADD R10<<2, R0, R15 + MOVW R7, 16384(R15) + ADD R12<<2, R0, R15 + MOVW R13, 16384(R15) + ADD R6, R8, R7 + ADD $1, R7, R7 + LSR $0x01, R7, R7 + ADD $0x01, R6, R6 + SUB $0x01, R8, R8 + +index_loop_encodeBetterBlockAsm10B: + CMP R8, R7 + BHS search_loop_encodeBetterBlockAsm10B + MOVD (R3)(R6), R9 + MOVD (R3)(R7), R10 + LSL $0x10, R9, R9 + MUL R5, R9, R9 + LSR $0x34, R9, R9 + LSL $0x10, R10, R10 + MUL R5, R10, R10 + LSR $0x34, R10, R10 + MOVW R6, (R0)(R9<<2) + MOVW R7, (R0)(R10<<2) + ADD $0x02, R6, R6 + ADD $0x02, R7, R7 + JMP index_loop_encodeBetterBlockAsm10B + +emit_remainder_encodeBetterBlockAsm10B: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R16 + SUBW R16, R0, R0 + ADD R0, R1, R0 + ADD $3, R0, R0 + MOVD 8(RSP), R16 + CMP R16, R0 + BLO emit_remainder_ok_encodeBetterBlockAsm10B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +emit_remainder_ok_encodeBetterBlockAsm10B: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R2 + CMPW R0, R2 + BEQ emit_literal_done_emit_remainder_encodeBetterBlockAsm10B + MOVWU R0, R5 + MOVW R0, 20(RSP) + ADD R2, R3, R0 + SUBW R2, R5, R5 + SUB $1, R5, R2 + MOVWU R2, R2 + CMPW $0x3c, R2 + BLO one_byte_emit_remainder_encodeBetterBlockAsm10B + CMPW $0x00000100, R2 + BLO two_bytes_emit_remainder_encodeBetterBlockAsm10B + BLO three_bytes_emit_remainder_encodeBetterBlockAsm10B + +three_bytes_emit_remainder_encodeBetterBlockAsm10B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R2, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_emit_remainder_encodeBetterBlockAsm10B + +two_bytes_emit_remainder_encodeBetterBlockAsm10B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R2, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R2 + BLO memmove_emit_remainder_encodeBetterBlockAsm10B + JMP memmove_long_emit_remainder_encodeBetterBlockAsm10B + +one_byte_emit_remainder_encodeBetterBlockAsm10B: + LSLW $0x02, R2, R16 + BFI $0, R16, $8, R2 + MOVB R2, (R1) + ADD $0x01, R1, R1 + +memmove_emit_remainder_encodeBetterBlockAsm10B: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveShort + CMP $0x03, R3 + BLO emit_lit_memmove_emit_remainder_encodeBetterBlockAsm10B_memmove_move_1or2 + BEQ emit_lit_memmove_emit_remainder_encodeBetterBlockAsm10B_memmove_move_3 + CMP $0x08, R3 + BLO emit_lit_memmove_emit_remainder_encodeBetterBlockAsm10B_memmove_move_4through7 + CMP $0x10, R3 + BLS emit_lit_memmove_emit_remainder_encodeBetterBlockAsm10B_memmove_move_8through16 + CMP $0x20, R3 + BLS emit_lit_memmove_emit_remainder_encodeBetterBlockAsm10B_memmove_move_17through32 + JMP emit_lit_memmove_emit_remainder_encodeBetterBlockAsm10B_memmove_move_33through64 + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm10B_memmove_move_1or2: + MOVBU (R0), R16 + BFI $0, R16, $8, R5 + ADD R3, R0, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R0 + MOVB R5, (R1) + ADD R3, R1, R15 + MOVB R0, -1(R15) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm10B + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm10B_memmove_move_3: + MOVHU (R0), R16 + BFI $0, R16, $16, R5 + MOVBU 2(R0), R16 + BFI $0, R16, $8, R0 + MOVH R5, (R1) + MOVB R0, 2(R1) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm10B + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm10B_memmove_move_4through7: + MOVWU (R0), R5 + ADD R3, R0, R15 + MOVWU -4(R15), R0 + MOVW R5, (R1) + ADD R3, R1, R15 + MOVW R0, -4(R15) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm10B + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm10B_memmove_move_8through16: + MOVD (R0), R5 + ADD R3, R0, R15 + MOVD -8(R15), R0 + MOVD R5, (R1) + ADD R3, R1, R15 + MOVD R0, -8(R15) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm10B + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm10B_memmove_move_17through32: + FMOVQ (R0), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm10B + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm10B_memmove_move_33through64: + FMOVQ (R0), F0 + FMOVQ 16(R0), F1 + ADD R3, R0, R15 + FMOVQ -32(R15), F2 + ADD R3, R0, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R3, R1, R15 + FMOVQ F2, -32(R15) + ADD R3, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_emit_remainder_encodeBetterBlockAsm10B: + MOVD R2, R1 + JMP emit_literal_done_emit_remainder_encodeBetterBlockAsm10B + +memmove_long_emit_remainder_encodeBetterBlockAsm10B: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveLong + MOVD R0, R5 + MOVD R1, R6 + MOVD R3, R7 + +emit_lit_memmove_long_emit_remainder_encodeBetterBlockAsm10Blarge_big_loop_back: + FMOVQ (R5), F0 + FMOVQ 16(R5), F1 + FMOVQ F0, (R6) + FMOVQ F1, 16(R6) + ADD $0x20, R5, R5 + ADD $0x20, R6, R6 + SUB $0x20, R7, R7 + CMP $0x20, R7 + BHS emit_lit_memmove_long_emit_remainder_encodeBetterBlockAsm10Blarge_big_loop_back + ADD R3, R0, R15 + FMOVQ -32(R15), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + ADD R3, R1, R15 + FMOVQ F0, -32(R15) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + MOVD R2, R1 + +emit_literal_done_emit_remainder_encodeBetterBlockAsm10B: + MOVD dst_base+0(FP), R0 + SUB R0, R1, R1 + MOVD R1, ret+56(FP) + RET + +// func encodeBetterBlockAsm8B(dst []byte, src []byte, tmp *[5120]byte) int +// Requires: BMI, SSE2 +TEXT ·encodeBetterBlockAsm8B(SB), $24-64 + MOVD tmp+48(FP), R0 + MOVD dst_base+0(FP), R1 + MOVD $0x00000028, R2 + MOVD R0, R3 + VEOR V0.B16, V0.B16, V0.B16 + +zero_loop_encodeBetterBlockAsm8B: + FMOVQ F0, (R3) + FMOVQ F0, 16(R3) + FMOVQ F0, 32(R3) + FMOVQ F0, 48(R3) + FMOVQ F0, 64(R3) + FMOVQ F0, 80(R3) + FMOVQ F0, 96(R3) + FMOVQ F0, 112(R3) + ADD $0x80, R3, R3 + SUBS $1, R2, R2 + BNE zero_loop_encodeBetterBlockAsm8B + MOVD $0x00000000, R16 + MOVW R16, 20(RSP) + MOVD src_len+32(FP), R2 + SUB $6, R2, R3 + SUB $8, R2, R5 + MOVW R5, 16(RSP) + LSR $0x05, R2, R2 + SUBW R2, R3, R3 + ADD R3, R1, R3 + MOVD R3, 8(RSP) + MOVD $0x00000001, R2 + MOVD $0x00000000, R16 + MOVW R16, 24(RSP) + MOVD src_base+24(FP), R3 + +search_loop_encodeBetterBlockAsm8B: + MOVWU R2, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + LSRW $0x04, R5, R5 + ADD R5, R2, R5 + ADD $1, R5, R5 + MOVWU R5, R5 + MOVWU 16(RSP), R16 + CMPW R16, R5 + BHS emit_remainder_encodeBetterBlockAsm8B + MOVD (R3)(R2), R6 + MOVW R5, 28(RSP) + MOVD $0x0000cf1bbcdcbf9b, R8 + MOVD $0x9e3779b1, R5 + MOVD R6, R9 + MOVD R6, R10 + LSL $0x10, R9, R9 + MUL R8, R9, R9 + LSR $0x36, R9, R9 + LSL $0x20, R10, R10 + MUL R5, R10, R10 + LSR $0x38, R10, R10 + MOVWU (R0)(R9<<2), R5 + ADD R10<<2, R0, R15 + MOVWU 4096(R15), R7 + MOVW R2, (R0)(R9<<2) + ADD R10<<2, R0, R15 + MOVW R2, 4096(R15) + MOVD (R3)(R5), R9 + MOVD (R3)(R7), R10 + CMP R6, R9 + BEQ candidate_match_encodeBetterBlockAsm8B + CMP R6, R10 + BNE no_short_found_encodeBetterBlockAsm8B + MOVWU R7, R5 + JMP candidate_match_encodeBetterBlockAsm8B + +no_short_found_encodeBetterBlockAsm8B: + CMPW R6, R9 + BEQ candidate_match_encodeBetterBlockAsm8B + CMPW R6, R10 + BEQ candidateS_match_encodeBetterBlockAsm8B + MOVWU 28(RSP), R2 + JMP search_loop_encodeBetterBlockAsm8B + +candidateS_match_encodeBetterBlockAsm8B: + LSR $0x08, R6, R6 + MOVD R6, R9 + LSL $0x10, R9, R9 + MUL R8, R9, R9 + LSR $0x36, R9, R9 + MOVWU (R0)(R9<<2), R5 + ADDW $1, R2, R2 + MOVW R2, (R0)(R9<<2) + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate_match_encodeBetterBlockAsm8B + SUBW $1, R2, R2 + MOVWU R7, R5 + +candidate_match_encodeBetterBlockAsm8B: + MOVWU 20(RSP), R6 + TSTW R5, R5 + BEQ match_extend_back_end_encodeBetterBlockAsm8B + +match_extend_back_loop_encodeBetterBlockAsm8B: + CMPW R6, R2 + BLS match_extend_back_end_encodeBetterBlockAsm8B + ADD R5, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R7 + ADD R2, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + AND $0xff, R8, R16 + AND $0xff, R7, R15 + CMP R16, R15 + BNE match_extend_back_end_encodeBetterBlockAsm8B + SUB $1, R2, R2 + MOVWU R2, R2 + SUBSW $1, R5, R5 + BEQ match_extend_back_end_encodeBetterBlockAsm8B + JMP match_extend_back_loop_encodeBetterBlockAsm8B + +match_extend_back_end_encodeBetterBlockAsm8B: + MOVWU R2, R6 + MOVWU 20(RSP), R16 + SUBW R16, R6, R6 + ADD R6, R1, R6 + ADD $3, R6, R6 + MOVD 8(RSP), R16 + CMP R16, R6 + BLO match_dst_size_check_encodeBetterBlockAsm8B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_dst_size_check_encodeBetterBlockAsm8B: + MOVWU R2, R6 + ADDW $0x04, R2, R2 + ADDW $0x04, R5, R5 + MOVD src_len+32(FP), R7 + SUBW R2, R7, R7 + ADD R2, R3, R8 + ADD R5, R3, R9 + + // matchLen + MOVD $0, R11 + +matchlen_loopback_16_match_nolit_encodeBetterBlockAsm8B: + CMPW $0x10, R7 + BLO matchlen_match8_match_nolit_encodeBetterBlockAsm8B + MOVD (R8)(R11), R10 + ADD R11, R8, R15 + MOVD 8(R15), R12 + MOVD (R9)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_match_nolit_encodeBetterBlockAsm8B + ADD R11, R9, R15 + MOVD 8(R15), R16 + EOR R16, R12, R12 + TST R12, R12 + BNE matchlen_bsf_16match_nolit_encodeBetterBlockAsm8B + SUB $16, R7, R7 + MOVWU R7, R7 + ADD $16, R11, R11 + MOVWU R11, R11 + JMP matchlen_loopback_16_match_nolit_encodeBetterBlockAsm8B + +matchlen_bsf_16match_nolit_encodeBetterBlockAsm8B: + RBIT R12, R12 + CLZ R12, R12 + ASR $0x03, R12, R12 + ADD R12, R11, R11 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP match_nolit_end_encodeBetterBlockAsm8B + +matchlen_match8_match_nolit_encodeBetterBlockAsm8B: + CMPW $0x08, R7 + BLO matchlen_match4_match_nolit_encodeBetterBlockAsm8B + MOVD (R8)(R11), R10 + MOVD (R9)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_match_nolit_encodeBetterBlockAsm8B + SUB $8, R7, R7 + MOVWU R7, R7 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP matchlen_match4_match_nolit_encodeBetterBlockAsm8B + +matchlen_bsf_8_match_nolit_encodeBetterBlockAsm8B: + RBIT R10, R10 + CLZ R10, R10 + ASR $0x03, R10, R10 + ADD R10, R11, R11 + MOVWU R11, R11 + JMP match_nolit_end_encodeBetterBlockAsm8B + +matchlen_match4_match_nolit_encodeBetterBlockAsm8B: + CMPW $0x04, R7 + BLO matchlen_match2_match_nolit_encodeBetterBlockAsm8B + MOVWU (R8)(R11), R10 + MOVWU (R9)(R11), R16 + CMPW R10, R16 + BNE matchlen_match2_match_nolit_encodeBetterBlockAsm8B + SUB $4, R7, R7 + MOVWU R7, R7 + ADD $4, R11, R11 + MOVWU R11, R11 + +matchlen_match2_match_nolit_encodeBetterBlockAsm8B: + CMPW $0x01, R7 + BEQ matchlen_match1_match_nolit_encodeBetterBlockAsm8B + BLO match_nolit_end_encodeBetterBlockAsm8B + MOVHU (R8)(R11), R16 + BFI $0, R16, $16, R10 + ADD R11, R9, R15 + MOVHU (R15), R15 + AND $0xffff, R10, R16 + CMP R16, R15 + BNE matchlen_match1_match_nolit_encodeBetterBlockAsm8B + ADD $2, R11, R11 + MOVWU R11, R11 + SUBSW $0x02, R7, R7 + BEQ match_nolit_end_encodeBetterBlockAsm8B + +matchlen_match1_match_nolit_encodeBetterBlockAsm8B: + MOVBU (R8)(R11), R16 + BFI $0, R16, $8, R10 + ADD R11, R9, R15 + MOVBU (R15), R15 + AND $0xff, R10, R16 + CMP R16, R15 + BNE match_nolit_end_encodeBetterBlockAsm8B + ADD $1, R11, R11 + MOVWU R11, R11 + +match_nolit_end_encodeBetterBlockAsm8B: + MOVWU R2, R7 + SUBW R5, R7, R7 + + // Check if repeat + MOVWU 24(RSP), R16 + CMPW R7, R16 + BEQ match_is_repeat_encodeBetterBlockAsm8B + MOVW R7, 24(RSP) + MOVWU 20(RSP), R5 + CMPW R6, R5 + BEQ emit_literal_done_match_emit_encodeBetterBlockAsm8B + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R5, R3, R9 + SUBW R5, R8, R8 + SUB $1, R8, R5 + MOVWU R5, R5 + CMPW $0x3c, R5 + BLO one_byte_match_emit_encodeBetterBlockAsm8B + CMPW $0x00000100, R5 + BLO two_bytes_match_emit_encodeBetterBlockAsm8B + BLO three_bytes_match_emit_encodeBetterBlockAsm8B + +three_bytes_match_emit_encodeBetterBlockAsm8B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_match_emit_encodeBetterBlockAsm8B + +two_bytes_match_emit_encodeBetterBlockAsm8B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R5, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R5 + BLO memmove_match_emit_encodeBetterBlockAsm8B + JMP memmove_long_match_emit_encodeBetterBlockAsm8B + +one_byte_match_emit_encodeBetterBlockAsm8B: + LSLW $0x02, R5, R16 + BFI $0, R16, $8, R5 + MOVB R5, (R1) + ADD $0x01, R1, R1 + +memmove_match_emit_encodeBetterBlockAsm8B: + ADD R8, R1, R5 + + // genMemMoveShort + CMP $0x04, R8 + BLS emit_lit_memmove_match_emit_encodeBetterBlockAsm8B_memmove_move_4 + CMP $0x08, R8 + BLO emit_lit_memmove_match_emit_encodeBetterBlockAsm8B_memmove_move_4through7 + CMP $0x10, R8 + BLS emit_lit_memmove_match_emit_encodeBetterBlockAsm8B_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_match_emit_encodeBetterBlockAsm8B_memmove_move_17through32 + JMP emit_lit_memmove_match_emit_encodeBetterBlockAsm8B_memmove_move_33through64 + +emit_lit_memmove_match_emit_encodeBetterBlockAsm8B_memmove_move_4: + MOVWU (R9), R10 + MOVW R10, (R1) + JMP memmove_end_copy_match_emit_encodeBetterBlockAsm8B + +emit_lit_memmove_match_emit_encodeBetterBlockAsm8B_memmove_move_4through7: + MOVWU (R9), R10 + ADD R8, R9, R15 + MOVWU -4(R15), R9 + MOVW R10, (R1) + ADD R8, R1, R15 + MOVW R9, -4(R15) + JMP memmove_end_copy_match_emit_encodeBetterBlockAsm8B + +emit_lit_memmove_match_emit_encodeBetterBlockAsm8B_memmove_move_8through16: + MOVD (R9), R10 + ADD R8, R9, R15 + MOVD -8(R15), R9 + MOVD R10, (R1) + ADD R8, R1, R15 + MOVD R9, -8(R15) + JMP memmove_end_copy_match_emit_encodeBetterBlockAsm8B + +emit_lit_memmove_match_emit_encodeBetterBlockAsm8B_memmove_move_17through32: + FMOVQ (R9), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_match_emit_encodeBetterBlockAsm8B + +emit_lit_memmove_match_emit_encodeBetterBlockAsm8B_memmove_move_33through64: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + ADD R8, R9, R15 + FMOVQ -32(R15), F2 + ADD R8, R9, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_match_emit_encodeBetterBlockAsm8B: + MOVD R5, R1 + JMP emit_literal_done_match_emit_encodeBetterBlockAsm8B + +memmove_long_match_emit_encodeBetterBlockAsm8B: + ADD R8, R1, R5 + + // genMemMoveLong + MOVD R9, R10 + MOVD R1, R12 + MOVD R8, R13 + +emit_lit_memmove_long_match_emit_encodeBetterBlockAsm8Blarge_big_loop_back: + FMOVQ (R10), F0 + FMOVQ 16(R10), F1 + FMOVQ F0, (R12) + FMOVQ F1, 16(R12) + ADD $0x20, R10, R10 + ADD $0x20, R12, R12 + SUB $0x20, R13, R13 + CMP $0x20, R13 + BHS emit_lit_memmove_long_match_emit_encodeBetterBlockAsm8Blarge_big_loop_back + ADD R8, R9, R15 + FMOVQ -32(R15), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R5, R1 + +emit_literal_done_match_emit_encodeBetterBlockAsm8B: + ADDW R11, R2, R2 + ADDW $0x04, R11, R11 + MOVW R2, 20(RSP) + + // emitCopy + CMPW $0x40, R11 + BLS two_byte_offset_short_match_nolit_encodeBetterBlockAsm8B + CMPW $0x00000800, R7 + BHS long_offset_short_match_nolit_encodeBetterBlockAsm8B + MOVD $0x00000001, R5 + ADD $16, R5, R5 + MOVWU R5, R5 + MOVB R7, 1(R1) + LSRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + SUBW $0x08, R11, R11 + + // emitRepeat + SUB $4, R11, R11 + MOVWU R11, R11 + JMP cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm8B_emit_copy_short_2b + MOVWU R11, R5 + SUB $4, R11, R11 + MOVWU R11, R11 + CMPW $0x08, R5 + BLS repeat_two_match_nolit_encodeBetterBlockAsm8B_emit_copy_short_2b + CMPW $0x0c, R5 + BHS cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm8B_emit_copy_short_2b + +cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm8B_emit_copy_short_2b: + CMPW $0x00000104, R11 + BLO repeat_three_match_nolit_encodeBetterBlockAsm8B_emit_copy_short_2b + SUB $256, R11, R11 + MOVWU R11, R11 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R11, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm8B + +repeat_three_match_nolit_encodeBetterBlockAsm8B_emit_copy_short_2b: + SUB $4, R11, R11 + MOVWU R11, R11 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R11, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm8B + +repeat_two_match_nolit_encodeBetterBlockAsm8B_emit_copy_short_2b: + LSLW $0x02, R11, R11 + ORRW $0x01, R11, R11 + MOVH R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm8B + MOVD $0, R5 + ADD R11<<2, R5, R11 + ADD $1, R11, R11 + MOVWU R11, R11 + MOVB R7, 1(R1) + ASRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R11, R11 + MOVB R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm8B + +long_offset_short_match_nolit_encodeBetterBlockAsm8B: + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R7, 1(R1) + SUB $60, R11, R11 + MOVWU R11, R11 + ADD $0x03, R1, R1 + + // emitRepeat + MOVWU R11, R5 + SUB $4, R11, R11 + MOVWU R11, R11 + CMPW $0x08, R5 + BLS repeat_two_match_nolit_encodeBetterBlockAsm8B_emit_copy_short + CMPW $0x0c, R5 + BHS cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm8B_emit_copy_short + +cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm8B_emit_copy_short: + CMPW $0x00000104, R11 + BLO repeat_three_match_nolit_encodeBetterBlockAsm8B_emit_copy_short + SUB $256, R11, R11 + MOVWU R11, R11 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R11, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm8B + +repeat_three_match_nolit_encodeBetterBlockAsm8B_emit_copy_short: + SUB $4, R11, R11 + MOVWU R11, R11 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R11, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm8B + +repeat_two_match_nolit_encodeBetterBlockAsm8B_emit_copy_short: + LSLW $0x02, R11, R11 + ORRW $0x01, R11, R11 + MOVH R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm8B + MOVD $0, R5 + ADD R11<<2, R5, R11 + ADD $1, R11, R11 + MOVWU R11, R11 + MOVB R7, 1(R1) + ASRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R11, R11 + MOVB R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm8B + +two_byte_offset_short_match_nolit_encodeBetterBlockAsm8B: + MOVWU R11, R5 + LSLW $0x02, R5, R5 + CMPW $0x0c, R11 + BHS emit_copy_three_match_nolit_encodeBetterBlockAsm8B + SUB $15, R5, R5 + MOVWU R5, R5 + MOVB R7, 1(R1) + LSRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm8B + +emit_copy_three_match_nolit_encodeBetterBlockAsm8B: + SUB $2, R5, R5 + MOVWU R5, R5 + MOVB R5, (R1) + MOVH R7, 1(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm8B + +match_is_repeat_encodeBetterBlockAsm8B: + MOVWU 20(RSP), R5 + CMPW R6, R5 + BEQ emit_literal_done_match_emit_repeat_encodeBetterBlockAsm8B + MOVWU R6, R7 + MOVW R6, 20(RSP) + ADD R5, R3, R8 + SUBW R5, R7, R7 + SUB $1, R7, R5 + MOVWU R5, R5 + CMPW $0x3c, R5 + BLO one_byte_match_emit_repeat_encodeBetterBlockAsm8B + CMPW $0x00000100, R5 + BLO two_bytes_match_emit_repeat_encodeBetterBlockAsm8B + BLO three_bytes_match_emit_repeat_encodeBetterBlockAsm8B + +three_bytes_match_emit_repeat_encodeBetterBlockAsm8B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_match_emit_repeat_encodeBetterBlockAsm8B + +two_bytes_match_emit_repeat_encodeBetterBlockAsm8B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R5, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R5 + BLO memmove_match_emit_repeat_encodeBetterBlockAsm8B + JMP memmove_long_match_emit_repeat_encodeBetterBlockAsm8B + +one_byte_match_emit_repeat_encodeBetterBlockAsm8B: + LSLW $0x02, R5, R16 + BFI $0, R16, $8, R5 + MOVB R5, (R1) + ADD $0x01, R1, R1 + +memmove_match_emit_repeat_encodeBetterBlockAsm8B: + ADD R7, R1, R5 + + // genMemMoveShort + CMP $0x04, R7 + BLS emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm8B_memmove_move_4 + CMP $0x08, R7 + BLO emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm8B_memmove_move_4through7 + CMP $0x10, R7 + BLS emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm8B_memmove_move_8through16 + CMP $0x20, R7 + BLS emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm8B_memmove_move_17through32 + JMP emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm8B_memmove_move_33through64 + +emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm8B_memmove_move_4: + MOVWU (R8), R9 + MOVW R9, (R1) + JMP memmove_end_copy_match_emit_repeat_encodeBetterBlockAsm8B + +emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm8B_memmove_move_4through7: + MOVWU (R8), R9 + ADD R7, R8, R15 + MOVWU -4(R15), R8 + MOVW R9, (R1) + ADD R7, R1, R15 + MOVW R8, -4(R15) + JMP memmove_end_copy_match_emit_repeat_encodeBetterBlockAsm8B + +emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm8B_memmove_move_8through16: + MOVD (R8), R9 + ADD R7, R8, R15 + MOVD -8(R15), R8 + MOVD R9, (R1) + ADD R7, R1, R15 + MOVD R8, -8(R15) + JMP memmove_end_copy_match_emit_repeat_encodeBetterBlockAsm8B + +emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm8B_memmove_move_17through32: + FMOVQ (R8), F0 + ADD R7, R8, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R7, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_match_emit_repeat_encodeBetterBlockAsm8B + +emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm8B_memmove_move_33through64: + FMOVQ (R8), F0 + FMOVQ 16(R8), F1 + ADD R7, R8, R15 + FMOVQ -32(R15), F2 + ADD R7, R8, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R7, R1, R15 + FMOVQ F2, -32(R15) + ADD R7, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_match_emit_repeat_encodeBetterBlockAsm8B: + MOVD R5, R1 + JMP emit_literal_done_match_emit_repeat_encodeBetterBlockAsm8B + +memmove_long_match_emit_repeat_encodeBetterBlockAsm8B: + ADD R7, R1, R5 + + // genMemMoveLong + MOVD R8, R9 + MOVD R1, R10 + MOVD R7, R12 + +emit_lit_memmove_long_match_emit_repeat_encodeBetterBlockAsm8Blarge_big_loop_back: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + FMOVQ F0, (R10) + FMOVQ F1, 16(R10) + ADD $0x20, R9, R9 + ADD $0x20, R10, R10 + SUB $0x20, R12, R12 + CMP $0x20, R12 + BHS emit_lit_memmove_long_match_emit_repeat_encodeBetterBlockAsm8Blarge_big_loop_back + ADD R7, R8, R15 + FMOVQ -32(R15), F0 + ADD R7, R8, R15 + FMOVQ -16(R15), F1 + ADD R7, R1, R15 + FMOVQ F0, -32(R15) + ADD R7, R1, R15 + FMOVQ F1, -16(R15) + MOVD R5, R1 + +emit_literal_done_match_emit_repeat_encodeBetterBlockAsm8B: + ADDW R11, R2, R2 + ADDW $0x04, R11, R11 + MOVW R2, 20(RSP) + + // emitRepeat + MOVWU R11, R5 + SUB $4, R11, R11 + MOVWU R11, R11 + CMPW $0x08, R5 + BLS repeat_two_match_nolit_repeat_encodeBetterBlockAsm8B + CMPW $0x0c, R5 + BHS cant_repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm8B + +cant_repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm8B: + CMPW $0x00000104, R11 + BLO repeat_three_match_nolit_repeat_encodeBetterBlockAsm8B + SUB $256, R11, R11 + MOVWU R11, R11 + MOVD $0x0019, R16 + MOVH R16, (R1) + MOVH R11, 2(R1) + ADD $0x04, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm8B + +repeat_three_match_nolit_repeat_encodeBetterBlockAsm8B: + SUB $4, R11, R11 + MOVWU R11, R11 + MOVD $0x0015, R16 + MOVH R16, (R1) + MOVB R11, 2(R1) + ADD $0x03, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm8B + +repeat_two_match_nolit_repeat_encodeBetterBlockAsm8B: + LSLW $0x02, R11, R11 + ORRW $0x01, R11, R11 + MOVH R11, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeBetterBlockAsm8B + MOVD $0, R5 + ADD R11<<2, R5, R11 + ADD $1, R11, R11 + MOVWU R11, R11 + MOVB R7, 1(R1) + ASRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R11, R11 + MOVB R11, (R1) + ADD $0x02, R1, R1 + +match_nolit_emitcopy_end_encodeBetterBlockAsm8B: + MOVWU 16(RSP), R16 + CMPW R16, R2 + BHS emit_remainder_encodeBetterBlockAsm8B + MOVD 8(RSP), R16 + CMP R16, R1 + BLO match_nolit_dst_ok_encodeBetterBlockAsm8B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_nolit_dst_ok_encodeBetterBlockAsm8B: + MOVD $0x0000cf1bbcdcbf9b, R5 + MOVD $0x9e3779b1, R7 + ADD $1, R6, R6 + SUB $2, R2, R8 + MOVD (R3)(R6), R9 + ADD R6, R3, R15 + MOVD 1(R15), R10 + MOVD (R3)(R8), R11 + ADD R8, R3, R15 + MOVD 1(R15), R12 + LSL $0x10, R9, R9 + MUL R5, R9, R9 + LSR $0x36, R9, R9 + LSL $0x20, R10, R10 + MUL R7, R10, R10 + LSR $0x38, R10, R10 + LSL $0x10, R11, R11 + MUL R5, R11, R11 + LSR $0x36, R11, R11 + LSL $0x20, R12, R12 + MUL R7, R12, R12 + LSR $0x38, R12, R12 + ADD $1, R6, R7 + ADD $1, R8, R13 + MOVW R6, (R0)(R9<<2) + MOVW R8, (R0)(R11<<2) + ADD R10<<2, R0, R15 + MOVW R7, 4096(R15) + ADD R12<<2, R0, R15 + MOVW R13, 4096(R15) + ADD R6, R8, R7 + ADD $1, R7, R7 + LSR $0x01, R7, R7 + ADD $0x01, R6, R6 + SUB $0x01, R8, R8 + +index_loop_encodeBetterBlockAsm8B: + CMP R8, R7 + BHS search_loop_encodeBetterBlockAsm8B + MOVD (R3)(R6), R9 + MOVD (R3)(R7), R10 + LSL $0x10, R9, R9 + MUL R5, R9, R9 + LSR $0x36, R9, R9 + LSL $0x10, R10, R10 + MUL R5, R10, R10 + LSR $0x36, R10, R10 + MOVW R6, (R0)(R9<<2) + MOVW R7, (R0)(R10<<2) + ADD $0x02, R6, R6 + ADD $0x02, R7, R7 + JMP index_loop_encodeBetterBlockAsm8B + +emit_remainder_encodeBetterBlockAsm8B: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R16 + SUBW R16, R0, R0 + ADD R0, R1, R0 + ADD $3, R0, R0 + MOVD 8(RSP), R16 + CMP R16, R0 + BLO emit_remainder_ok_encodeBetterBlockAsm8B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +emit_remainder_ok_encodeBetterBlockAsm8B: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R2 + CMPW R0, R2 + BEQ emit_literal_done_emit_remainder_encodeBetterBlockAsm8B + MOVWU R0, R5 + MOVW R0, 20(RSP) + ADD R2, R3, R0 + SUBW R2, R5, R5 + SUB $1, R5, R2 + MOVWU R2, R2 + CMPW $0x3c, R2 + BLO one_byte_emit_remainder_encodeBetterBlockAsm8B + CMPW $0x00000100, R2 + BLO two_bytes_emit_remainder_encodeBetterBlockAsm8B + BLO three_bytes_emit_remainder_encodeBetterBlockAsm8B + +three_bytes_emit_remainder_encodeBetterBlockAsm8B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R2, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_emit_remainder_encodeBetterBlockAsm8B + +two_bytes_emit_remainder_encodeBetterBlockAsm8B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R2, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R2 + BLO memmove_emit_remainder_encodeBetterBlockAsm8B + JMP memmove_long_emit_remainder_encodeBetterBlockAsm8B + +one_byte_emit_remainder_encodeBetterBlockAsm8B: + LSLW $0x02, R2, R16 + BFI $0, R16, $8, R2 + MOVB R2, (R1) + ADD $0x01, R1, R1 + +memmove_emit_remainder_encodeBetterBlockAsm8B: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveShort + CMP $0x03, R3 + BLO emit_lit_memmove_emit_remainder_encodeBetterBlockAsm8B_memmove_move_1or2 + BEQ emit_lit_memmove_emit_remainder_encodeBetterBlockAsm8B_memmove_move_3 + CMP $0x08, R3 + BLO emit_lit_memmove_emit_remainder_encodeBetterBlockAsm8B_memmove_move_4through7 + CMP $0x10, R3 + BLS emit_lit_memmove_emit_remainder_encodeBetterBlockAsm8B_memmove_move_8through16 + CMP $0x20, R3 + BLS emit_lit_memmove_emit_remainder_encodeBetterBlockAsm8B_memmove_move_17through32 + JMP emit_lit_memmove_emit_remainder_encodeBetterBlockAsm8B_memmove_move_33through64 + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm8B_memmove_move_1or2: + MOVBU (R0), R16 + BFI $0, R16, $8, R5 + ADD R3, R0, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R0 + MOVB R5, (R1) + ADD R3, R1, R15 + MOVB R0, -1(R15) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm8B + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm8B_memmove_move_3: + MOVHU (R0), R16 + BFI $0, R16, $16, R5 + MOVBU 2(R0), R16 + BFI $0, R16, $8, R0 + MOVH R5, (R1) + MOVB R0, 2(R1) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm8B + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm8B_memmove_move_4through7: + MOVWU (R0), R5 + ADD R3, R0, R15 + MOVWU -4(R15), R0 + MOVW R5, (R1) + ADD R3, R1, R15 + MOVW R0, -4(R15) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm8B + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm8B_memmove_move_8through16: + MOVD (R0), R5 + ADD R3, R0, R15 + MOVD -8(R15), R0 + MOVD R5, (R1) + ADD R3, R1, R15 + MOVD R0, -8(R15) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm8B + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm8B_memmove_move_17through32: + FMOVQ (R0), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_emit_remainder_encodeBetterBlockAsm8B + +emit_lit_memmove_emit_remainder_encodeBetterBlockAsm8B_memmove_move_33through64: + FMOVQ (R0), F0 + FMOVQ 16(R0), F1 + ADD R3, R0, R15 + FMOVQ -32(R15), F2 + ADD R3, R0, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R3, R1, R15 + FMOVQ F2, -32(R15) + ADD R3, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_emit_remainder_encodeBetterBlockAsm8B: + MOVD R2, R1 + JMP emit_literal_done_emit_remainder_encodeBetterBlockAsm8B + +memmove_long_emit_remainder_encodeBetterBlockAsm8B: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveLong + MOVD R0, R5 + MOVD R1, R6 + MOVD R3, R7 + +emit_lit_memmove_long_emit_remainder_encodeBetterBlockAsm8Blarge_big_loop_back: + FMOVQ (R5), F0 + FMOVQ 16(R5), F1 + FMOVQ F0, (R6) + FMOVQ F1, 16(R6) + ADD $0x20, R5, R5 + ADD $0x20, R6, R6 + SUB $0x20, R7, R7 + CMP $0x20, R7 + BHS emit_lit_memmove_long_emit_remainder_encodeBetterBlockAsm8Blarge_big_loop_back + ADD R3, R0, R15 + FMOVQ -32(R15), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + ADD R3, R1, R15 + FMOVQ F0, -32(R15) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + MOVD R2, R1 + +emit_literal_done_emit_remainder_encodeBetterBlockAsm8B: + MOVD dst_base+0(FP), R0 + SUB R0, R1, R1 + MOVD R1, ret+56(FP) + RET + +// func encodeSnappyBlockAsm(dst []byte, src []byte, tmp *[65536]byte) int +// Requires: BMI, SSE2 +TEXT ·encodeSnappyBlockAsm(SB), $24-64 + MOVD tmp+48(FP), R0 + MOVD dst_base+0(FP), R1 + MOVD $0x00000200, R2 + MOVD R0, R3 + VEOR V0.B16, V0.B16, V0.B16 + +zero_loop_encodeSnappyBlockAsm: + FMOVQ F0, (R3) + FMOVQ F0, 16(R3) + FMOVQ F0, 32(R3) + FMOVQ F0, 48(R3) + FMOVQ F0, 64(R3) + FMOVQ F0, 80(R3) + FMOVQ F0, 96(R3) + FMOVQ F0, 112(R3) + ADD $0x80, R3, R3 + SUBS $1, R2, R2 + BNE zero_loop_encodeSnappyBlockAsm + MOVD $0x00000000, R16 + MOVW R16, 20(RSP) + MOVD src_len+32(FP), R2 + SUB $9, R2, R3 + SUB $8, R2, R5 + MOVW R5, 16(RSP) + LSR $0x05, R2, R2 + SUBW R2, R3, R3 + ADD R3, R1, R3 + MOVD R3, 8(RSP) + MOVD $0x00000001, R2 + MOVW R2, 24(RSP) + MOVD src_base+24(FP), R3 + +search_loop_encodeSnappyBlockAsm: + MOVWU R2, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + LSRW $0x06, R5, R5 + ADD R5, R2, R5 + ADD $4, R5, R5 + MOVWU R5, R5 + MOVWU 16(RSP), R16 + CMPW R16, R5 + BHS emit_remainder_encodeSnappyBlockAsm + MOVD (R3)(R2), R6 + MOVW R5, 28(RSP) + MOVD $0x0000cf1bbcdcbf9b, R8 + MOVD R6, R9 + MOVD R6, R10 + LSR $0x08, R10, R10 + LSL $0x10, R9, R9 + MUL R8, R9, R9 + LSR $0x32, R9, R9 + LSL $0x10, R10, R10 + MUL R8, R10, R10 + LSR $0x32, R10, R10 + MOVWU (R0)(R9<<2), R5 + MOVWU (R0)(R10<<2), R7 + MOVW R2, (R0)(R9<<2) + ADD $1, R2, R9 + MOVWU R9, R9 + MOVW R9, (R0)(R10<<2) + MOVD R6, R9 + LSR $0x10, R9, R9 + LSL $0x10, R9, R9 + MUL R8, R9, R9 + LSR $0x32, R9, R9 + MOVWU R2, R8 + MOVWU 24(RSP), R16 + SUBW R16, R8, R8 + ADD R8, R3, R15 + MOVWU 1(R15), R10 + MOVD R6, R8 + LSR $0x08, R8, R8 + CMPW R10, R8 + BNE no_repeat_found_encodeSnappyBlockAsm + ADD $1, R2, R6 + MOVWU R6, R6 + MOVWU 20(RSP), R5 + MOVWU R6, R7 + MOVWU 24(RSP), R16 + SUBSW R16, R7, R7 + BEQ repeat_extend_back_end_encodeSnappyBlockAsm + +repeat_extend_back_loop_encodeSnappyBlockAsm: + CMPW R5, R6 + BLS repeat_extend_back_end_encodeSnappyBlockAsm + ADD R7, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + ADD R6, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R9 + AND $0xff, R9, R16 + AND $0xff, R8, R15 + CMP R16, R15 + BNE repeat_extend_back_end_encodeSnappyBlockAsm + SUB $1, R6, R6 + MOVWU R6, R6 + SUBSW $1, R7, R7 + BNE repeat_extend_back_loop_encodeSnappyBlockAsm + +repeat_extend_back_end_encodeSnappyBlockAsm: + MOVWU R6, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + ADD R5, R1, R5 + ADD $5, R5, R5 + MOVD 8(RSP), R16 + CMP R16, R5 + BLO repeat_dst_size_check_encodeSnappyBlockAsm + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +repeat_dst_size_check_encodeSnappyBlockAsm: + MOVWU 20(RSP), R5 + CMPW R6, R5 + BEQ emit_literal_done_repeat_emit_encodeSnappyBlockAsm + MOVWU R6, R7 + MOVW R6, 20(RSP) + ADD R5, R3, R8 + SUBW R5, R7, R7 + SUB $1, R7, R5 + MOVWU R5, R5 + CMPW $0x3c, R5 + BLO one_byte_repeat_emit_encodeSnappyBlockAsm + CMPW $0x00000100, R5 + BLO two_bytes_repeat_emit_encodeSnappyBlockAsm + CMPW $0x00010000, R5 + BLO three_bytes_repeat_emit_encodeSnappyBlockAsm + CMPW $0x01000000, R5 + BLO four_bytes_repeat_emit_encodeSnappyBlockAsm + MOVD $0xfc, R16 + MOVB R16, (R1) + MOVW R5, 1(R1) + ADD $0x05, R1, R1 + JMP memmove_long_repeat_emit_encodeSnappyBlockAsm + +four_bytes_repeat_emit_encodeSnappyBlockAsm: + MOVWU R5, R9 + LSRW $0x10, R9, R9 + MOVD $0xf8, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + MOVB R9, 3(R1) + ADD $0x04, R1, R1 + JMP memmove_long_repeat_emit_encodeSnappyBlockAsm + +three_bytes_repeat_emit_encodeSnappyBlockAsm: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_repeat_emit_encodeSnappyBlockAsm + +two_bytes_repeat_emit_encodeSnappyBlockAsm: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R5, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R5 + BLO memmove_repeat_emit_encodeSnappyBlockAsm + JMP memmove_long_repeat_emit_encodeSnappyBlockAsm + +one_byte_repeat_emit_encodeSnappyBlockAsm: + LSLW $0x02, R5, R16 + BFI $0, R16, $8, R5 + MOVB R5, (R1) + ADD $0x01, R1, R1 + +memmove_repeat_emit_encodeSnappyBlockAsm: + ADD R7, R1, R5 + + // genMemMoveShort + CMP $0x08, R7 + BLS emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm_memmove_move_8 + CMP $0x10, R7 + BLS emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm_memmove_move_8through16 + CMP $0x20, R7 + BLS emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm_memmove_move_17through32 + JMP emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm_memmove_move_33through64 + +emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm_memmove_move_8: + MOVD (R8), R9 + MOVD R9, (R1) + JMP memmove_end_copy_repeat_emit_encodeSnappyBlockAsm + +emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm_memmove_move_8through16: + MOVD (R8), R9 + ADD R7, R8, R15 + MOVD -8(R15), R8 + MOVD R9, (R1) + ADD R7, R1, R15 + MOVD R8, -8(R15) + JMP memmove_end_copy_repeat_emit_encodeSnappyBlockAsm + +emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm_memmove_move_17through32: + FMOVQ (R8), F0 + ADD R7, R8, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R7, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_repeat_emit_encodeSnappyBlockAsm + +emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm_memmove_move_33through64: + FMOVQ (R8), F0 + FMOVQ 16(R8), F1 + ADD R7, R8, R15 + FMOVQ -32(R15), F2 + ADD R7, R8, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R7, R1, R15 + FMOVQ F2, -32(R15) + ADD R7, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_repeat_emit_encodeSnappyBlockAsm: + MOVD R5, R1 + JMP emit_literal_done_repeat_emit_encodeSnappyBlockAsm + +memmove_long_repeat_emit_encodeSnappyBlockAsm: + ADD R7, R1, R5 + + // genMemMoveLong + MOVD R8, R9 + MOVD R1, R10 + MOVD R7, R11 + +emit_lit_memmove_long_repeat_emit_encodeSnappyBlockAsmlarge_big_loop_back: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + FMOVQ F0, (R10) + FMOVQ F1, 16(R10) + ADD $0x20, R9, R9 + ADD $0x20, R10, R10 + SUB $0x20, R11, R11 + CMP $0x20, R11 + BHS emit_lit_memmove_long_repeat_emit_encodeSnappyBlockAsmlarge_big_loop_back + ADD R7, R8, R15 + FMOVQ -32(R15), F0 + ADD R7, R8, R15 + FMOVQ -16(R15), F1 + ADD R7, R1, R15 + FMOVQ F0, -32(R15) + ADD R7, R1, R15 + FMOVQ F1, -16(R15) + MOVD R5, R1 + +emit_literal_done_repeat_emit_encodeSnappyBlockAsm: + ADDW $0x05, R2, R2 + MOVWU R2, R5 + MOVWU 24(RSP), R16 + SUBW R16, R5, R5 + MOVD src_len+32(FP), R7 + SUBW R2, R7, R7 + ADD R2, R3, R8 + ADD R5, R3, R5 + + // matchLen + MOVD $0, R10 + +matchlen_loopback_16_repeat_extend_encodeSnappyBlockAsm: + CMPW $0x10, R7 + BLO matchlen_match8_repeat_extend_encodeSnappyBlockAsm + MOVD (R8)(R10), R9 + ADD R10, R8, R15 + MOVD 8(R15), R11 + MOVD (R5)(R10), R16 + EOR R16, R9, R9 + TST R9, R9 + BNE matchlen_bsf_8_repeat_extend_encodeSnappyBlockAsm + ADD R10, R5, R15 + MOVD 8(R15), R16 + EOR R16, R11, R11 + TST R11, R11 + BNE matchlen_bsf_16repeat_extend_encodeSnappyBlockAsm + SUB $16, R7, R7 + MOVWU R7, R7 + ADD $16, R10, R10 + MOVWU R10, R10 + JMP matchlen_loopback_16_repeat_extend_encodeSnappyBlockAsm + +matchlen_bsf_16repeat_extend_encodeSnappyBlockAsm: + RBIT R11, R11 + CLZ R11, R11 + ASR $0x03, R11, R11 + ADD R11, R10, R10 + ADD $8, R10, R10 + MOVWU R10, R10 + JMP repeat_extend_forward_end_encodeSnappyBlockAsm + +matchlen_match8_repeat_extend_encodeSnappyBlockAsm: + CMPW $0x08, R7 + BLO matchlen_match4_repeat_extend_encodeSnappyBlockAsm + MOVD (R8)(R10), R9 + MOVD (R5)(R10), R16 + EOR R16, R9, R9 + TST R9, R9 + BNE matchlen_bsf_8_repeat_extend_encodeSnappyBlockAsm + SUB $8, R7, R7 + MOVWU R7, R7 + ADD $8, R10, R10 + MOVWU R10, R10 + JMP matchlen_match4_repeat_extend_encodeSnappyBlockAsm + +matchlen_bsf_8_repeat_extend_encodeSnappyBlockAsm: + RBIT R9, R9 + CLZ R9, R9 + ASR $0x03, R9, R9 + ADD R9, R10, R10 + MOVWU R10, R10 + JMP repeat_extend_forward_end_encodeSnappyBlockAsm + +matchlen_match4_repeat_extend_encodeSnappyBlockAsm: + CMPW $0x04, R7 + BLO matchlen_match2_repeat_extend_encodeSnappyBlockAsm + MOVWU (R8)(R10), R9 + MOVWU (R5)(R10), R16 + CMPW R9, R16 + BNE matchlen_match2_repeat_extend_encodeSnappyBlockAsm + SUB $4, R7, R7 + MOVWU R7, R7 + ADD $4, R10, R10 + MOVWU R10, R10 + +matchlen_match2_repeat_extend_encodeSnappyBlockAsm: + CMPW $0x01, R7 + BEQ matchlen_match1_repeat_extend_encodeSnappyBlockAsm + BLO repeat_extend_forward_end_encodeSnappyBlockAsm + MOVHU (R8)(R10), R16 + BFI $0, R16, $16, R9 + ADD R10, R5, R15 + MOVHU (R15), R15 + AND $0xffff, R9, R16 + CMP R16, R15 + BNE matchlen_match1_repeat_extend_encodeSnappyBlockAsm + ADD $2, R10, R10 + MOVWU R10, R10 + SUBSW $0x02, R7, R7 + BEQ repeat_extend_forward_end_encodeSnappyBlockAsm + +matchlen_match1_repeat_extend_encodeSnappyBlockAsm: + MOVBU (R8)(R10), R16 + BFI $0, R16, $8, R9 + ADD R10, R5, R15 + MOVBU (R15), R15 + AND $0xff, R9, R16 + CMP R16, R15 + BNE repeat_extend_forward_end_encodeSnappyBlockAsm + ADD $1, R10, R10 + MOVWU R10, R10 + +repeat_extend_forward_end_encodeSnappyBlockAsm: + ADDW R10, R2, R2 + MOVWU R2, R5 + SUBW R6, R5, R5 + MOVWU 24(RSP), R6 + + // emitCopy + CMPW $0x00010000, R6 + BLO two_byte_offset_repeat_as_copy_encodeSnappyBlockAsm + +four_bytes_loop_back_repeat_as_copy_encodeSnappyBlockAsm: + CMPW $0x40, R5 + BLS four_bytes_remain_repeat_as_copy_encodeSnappyBlockAsm + MOVD $0xff, R16 + MOVB R16, (R1) + MOVW R6, 1(R1) + SUB $64, R5, R5 + MOVWU R5, R5 + ADD $0x05, R1, R1 + CMPW $0x04, R5 + BLO four_bytes_remain_repeat_as_copy_encodeSnappyBlockAsm + JMP four_bytes_loop_back_repeat_as_copy_encodeSnappyBlockAsm + +four_bytes_remain_repeat_as_copy_encodeSnappyBlockAsm: + TSTW R5, R5 + BEQ repeat_end_emit_encodeSnappyBlockAsm + MOVD $0, R7 + ADD R5<<2, R7, R5 + SUB $1, R5, R5 + MOVWU R5, R5 + MOVB R5, (R1) + MOVW R6, 1(R1) + ADD $0x05, R1, R1 + JMP repeat_end_emit_encodeSnappyBlockAsm + +two_byte_offset_repeat_as_copy_encodeSnappyBlockAsm: + CMPW $0x40, R5 + BLS two_byte_offset_short_repeat_as_copy_encodeSnappyBlockAsm + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R6, 1(R1) + SUB $60, R5, R5 + MOVWU R5, R5 + ADD $0x03, R1, R1 + JMP two_byte_offset_repeat_as_copy_encodeSnappyBlockAsm + +two_byte_offset_short_repeat_as_copy_encodeSnappyBlockAsm: + MOVWU R5, R7 + LSLW $0x02, R7, R7 + CMPW $0x0c, R5 + BHS emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm + CMPW $0x00000800, R6 + BHS emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm + SUB $15, R7, R7 + MOVWU R7, R7 + MOVB R6, 1(R1) + LSRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R7, R7 + MOVB R7, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeSnappyBlockAsm + +emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm: + SUB $2, R7, R7 + MOVWU R7, R7 + MOVB R7, (R1) + MOVH R6, 1(R1) + ADD $0x03, R1, R1 + +repeat_end_emit_encodeSnappyBlockAsm: + MOVW R2, 20(RSP) + JMP search_loop_encodeSnappyBlockAsm + +no_repeat_found_encodeSnappyBlockAsm: + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate_match_encodeSnappyBlockAsm + LSR $0x08, R6, R6 + MOVWU (R0)(R9<<2), R5 + ADD $2, R2, R8 + MOVWU R8, R8 + MOVWU (R3)(R7), R16 + CMPW R6, R16 + BEQ candidate2_match_encodeSnappyBlockAsm + MOVW R8, (R0)(R9<<2) + LSR $0x08, R6, R6 + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate3_match_encodeSnappyBlockAsm + MOVWU 28(RSP), R2 + JMP search_loop_encodeSnappyBlockAsm + +candidate3_match_encodeSnappyBlockAsm: + ADDW $0x02, R2, R2 + JMP candidate_match_encodeSnappyBlockAsm + +candidate2_match_encodeSnappyBlockAsm: + MOVW R8, (R0)(R9<<2) + ADDW $1, R2, R2 + MOVWU R7, R5 + +candidate_match_encodeSnappyBlockAsm: + MOVWU 20(RSP), R6 + TSTW R5, R5 + BEQ match_extend_back_end_encodeSnappyBlockAsm + +match_extend_back_loop_encodeSnappyBlockAsm: + CMPW R6, R2 + BLS match_extend_back_end_encodeSnappyBlockAsm + ADD R5, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R7 + ADD R2, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + AND $0xff, R8, R16 + AND $0xff, R7, R15 + CMP R16, R15 + BNE match_extend_back_end_encodeSnappyBlockAsm + SUB $1, R2, R2 + MOVWU R2, R2 + SUBSW $1, R5, R5 + BEQ match_extend_back_end_encodeSnappyBlockAsm + JMP match_extend_back_loop_encodeSnappyBlockAsm + +match_extend_back_end_encodeSnappyBlockAsm: + MOVWU R2, R6 + MOVWU 20(RSP), R16 + SUBW R16, R6, R6 + ADD R6, R1, R6 + ADD $5, R6, R6 + MOVD 8(RSP), R16 + CMP R16, R6 + BLO match_dst_size_check_encodeSnappyBlockAsm + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_dst_size_check_encodeSnappyBlockAsm: + MOVWU R2, R6 + MOVWU 20(RSP), R7 + CMPW R6, R7 + BEQ emit_literal_done_match_emit_encodeSnappyBlockAsm + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R7, R3, R6 + SUBW R7, R8, R8 + SUB $1, R8, R7 + MOVWU R7, R7 + CMPW $0x3c, R7 + BLO one_byte_match_emit_encodeSnappyBlockAsm + CMPW $0x00000100, R7 + BLO two_bytes_match_emit_encodeSnappyBlockAsm + CMPW $0x00010000, R7 + BLO three_bytes_match_emit_encodeSnappyBlockAsm + CMPW $0x01000000, R7 + BLO four_bytes_match_emit_encodeSnappyBlockAsm + MOVD $0xfc, R16 + MOVB R16, (R1) + MOVW R7, 1(R1) + ADD $0x05, R1, R1 + JMP memmove_long_match_emit_encodeSnappyBlockAsm + +four_bytes_match_emit_encodeSnappyBlockAsm: + MOVWU R7, R9 + LSRW $0x10, R9, R9 + MOVD $0xf8, R16 + MOVB R16, (R1) + MOVH R7, 1(R1) + MOVB R9, 3(R1) + ADD $0x04, R1, R1 + JMP memmove_long_match_emit_encodeSnappyBlockAsm + +three_bytes_match_emit_encodeSnappyBlockAsm: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R7, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_match_emit_encodeSnappyBlockAsm + +two_bytes_match_emit_encodeSnappyBlockAsm: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R7, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R7 + BLO memmove_match_emit_encodeSnappyBlockAsm + JMP memmove_long_match_emit_encodeSnappyBlockAsm + +one_byte_match_emit_encodeSnappyBlockAsm: + LSLW $0x02, R7, R16 + BFI $0, R16, $8, R7 + MOVB R7, (R1) + ADD $0x01, R1, R1 + +memmove_match_emit_encodeSnappyBlockAsm: + ADD R8, R1, R7 + + // genMemMoveShort + CMP $0x08, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBlockAsm_memmove_move_8 + CMP $0x10, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBlockAsm_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBlockAsm_memmove_move_17through32 + JMP emit_lit_memmove_match_emit_encodeSnappyBlockAsm_memmove_move_33through64 + +emit_lit_memmove_match_emit_encodeSnappyBlockAsm_memmove_move_8: + MOVD (R6), R9 + MOVD R9, (R1) + JMP memmove_end_copy_match_emit_encodeSnappyBlockAsm + +emit_lit_memmove_match_emit_encodeSnappyBlockAsm_memmove_move_8through16: + MOVD (R6), R9 + ADD R8, R6, R15 + MOVD -8(R15), R6 + MOVD R9, (R1) + ADD R8, R1, R15 + MOVD R6, -8(R15) + JMP memmove_end_copy_match_emit_encodeSnappyBlockAsm + +emit_lit_memmove_match_emit_encodeSnappyBlockAsm_memmove_move_17through32: + FMOVQ (R6), F0 + ADD R8, R6, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_match_emit_encodeSnappyBlockAsm + +emit_lit_memmove_match_emit_encodeSnappyBlockAsm_memmove_move_33through64: + FMOVQ (R6), F0 + FMOVQ 16(R6), F1 + ADD R8, R6, R15 + FMOVQ -32(R15), F2 + ADD R8, R6, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_match_emit_encodeSnappyBlockAsm: + MOVD R7, R1 + JMP emit_literal_done_match_emit_encodeSnappyBlockAsm + +memmove_long_match_emit_encodeSnappyBlockAsm: + ADD R8, R1, R7 + + // genMemMoveLong + MOVD R6, R9 + MOVD R1, R10 + MOVD R8, R11 + +emit_lit_memmove_long_match_emit_encodeSnappyBlockAsmlarge_big_loop_back: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + FMOVQ F0, (R10) + FMOVQ F1, 16(R10) + ADD $0x20, R9, R9 + ADD $0x20, R10, R10 + SUB $0x20, R11, R11 + CMP $0x20, R11 + BHS emit_lit_memmove_long_match_emit_encodeSnappyBlockAsmlarge_big_loop_back + ADD R8, R6, R15 + FMOVQ -32(R15), F0 + ADD R8, R6, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R7, R1 + +emit_literal_done_match_emit_encodeSnappyBlockAsm: +match_nolit_loop_encodeSnappyBlockAsm: + MOVWU R2, R6 + SUBW R5, R6, R6 + MOVW R6, 24(RSP) + ADDW $0x04, R2, R2 + ADDW $0x04, R5, R5 + MOVD src_len+32(FP), R6 + SUBW R2, R6, R6 + ADD R2, R3, R7 + ADD R5, R3, R5 + + // matchLen + MOVD $0, R9 + +matchlen_loopback_16_match_nolit_encodeSnappyBlockAsm: + CMPW $0x10, R6 + BLO matchlen_match8_match_nolit_encodeSnappyBlockAsm + MOVD (R7)(R9), R8 + ADD R9, R7, R15 + MOVD 8(R15), R10 + MOVD (R5)(R9), R16 + EOR R16, R8, R8 + TST R8, R8 + BNE matchlen_bsf_8_match_nolit_encodeSnappyBlockAsm + ADD R9, R5, R15 + MOVD 8(R15), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_16match_nolit_encodeSnappyBlockAsm + SUB $16, R6, R6 + MOVWU R6, R6 + ADD $16, R9, R9 + MOVWU R9, R9 + JMP matchlen_loopback_16_match_nolit_encodeSnappyBlockAsm + +matchlen_bsf_16match_nolit_encodeSnappyBlockAsm: + RBIT R10, R10 + CLZ R10, R10 + ASR $0x03, R10, R10 + ADD R10, R9, R9 + ADD $8, R9, R9 + MOVWU R9, R9 + JMP match_nolit_end_encodeSnappyBlockAsm + +matchlen_match8_match_nolit_encodeSnappyBlockAsm: + CMPW $0x08, R6 + BLO matchlen_match4_match_nolit_encodeSnappyBlockAsm + MOVD (R7)(R9), R8 + MOVD (R5)(R9), R16 + EOR R16, R8, R8 + TST R8, R8 + BNE matchlen_bsf_8_match_nolit_encodeSnappyBlockAsm + SUB $8, R6, R6 + MOVWU R6, R6 + ADD $8, R9, R9 + MOVWU R9, R9 + JMP matchlen_match4_match_nolit_encodeSnappyBlockAsm + +matchlen_bsf_8_match_nolit_encodeSnappyBlockAsm: + RBIT R8, R8 + CLZ R8, R8 + ASR $0x03, R8, R8 + ADD R8, R9, R9 + MOVWU R9, R9 + JMP match_nolit_end_encodeSnappyBlockAsm + +matchlen_match4_match_nolit_encodeSnappyBlockAsm: + CMPW $0x04, R6 + BLO matchlen_match2_match_nolit_encodeSnappyBlockAsm + MOVWU (R7)(R9), R8 + MOVWU (R5)(R9), R16 + CMPW R8, R16 + BNE matchlen_match2_match_nolit_encodeSnappyBlockAsm + SUB $4, R6, R6 + MOVWU R6, R6 + ADD $4, R9, R9 + MOVWU R9, R9 + +matchlen_match2_match_nolit_encodeSnappyBlockAsm: + CMPW $0x01, R6 + BEQ matchlen_match1_match_nolit_encodeSnappyBlockAsm + BLO match_nolit_end_encodeSnappyBlockAsm + MOVHU (R7)(R9), R16 + BFI $0, R16, $16, R8 + ADD R9, R5, R15 + MOVHU (R15), R15 + AND $0xffff, R8, R16 + CMP R16, R15 + BNE matchlen_match1_match_nolit_encodeSnappyBlockAsm + ADD $2, R9, R9 + MOVWU R9, R9 + SUBSW $0x02, R6, R6 + BEQ match_nolit_end_encodeSnappyBlockAsm + +matchlen_match1_match_nolit_encodeSnappyBlockAsm: + MOVBU (R7)(R9), R16 + BFI $0, R16, $8, R8 + ADD R9, R5, R15 + MOVBU (R15), R15 + AND $0xff, R8, R16 + CMP R16, R15 + BNE match_nolit_end_encodeSnappyBlockAsm + ADD $1, R9, R9 + MOVWU R9, R9 + +match_nolit_end_encodeSnappyBlockAsm: + ADDW R9, R2, R2 + MOVWU 24(RSP), R5 + ADDW $0x04, R9, R9 + MOVW R2, 20(RSP) + + // emitCopy + CMPW $0x00010000, R5 + BLO two_byte_offset_match_nolit_encodeSnappyBlockAsm + +four_bytes_loop_back_match_nolit_encodeSnappyBlockAsm: + CMPW $0x40, R9 + BLS four_bytes_remain_match_nolit_encodeSnappyBlockAsm + MOVD $0xff, R16 + MOVB R16, (R1) + MOVW R5, 1(R1) + SUB $64, R9, R9 + MOVWU R9, R9 + ADD $0x05, R1, R1 + CMPW $0x04, R9 + BLO four_bytes_remain_match_nolit_encodeSnappyBlockAsm + JMP four_bytes_loop_back_match_nolit_encodeSnappyBlockAsm + +four_bytes_remain_match_nolit_encodeSnappyBlockAsm: + TSTW R9, R9 + BEQ match_nolit_emitcopy_end_encodeSnappyBlockAsm + MOVD $0, R6 + ADD R9<<2, R6, R9 + SUB $1, R9, R9 + MOVWU R9, R9 + MOVB R9, (R1) + MOVW R5, 1(R1) + ADD $0x05, R1, R1 + JMP match_nolit_emitcopy_end_encodeSnappyBlockAsm + +two_byte_offset_match_nolit_encodeSnappyBlockAsm: + CMPW $0x40, R9 + BLS two_byte_offset_short_match_nolit_encodeSnappyBlockAsm + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + SUB $60, R9, R9 + MOVWU R9, R9 + ADD $0x03, R1, R1 + JMP two_byte_offset_match_nolit_encodeSnappyBlockAsm + +two_byte_offset_short_match_nolit_encodeSnappyBlockAsm: + MOVWU R9, R6 + LSLW $0x02, R6, R6 + CMPW $0x0c, R9 + BHS emit_copy_three_match_nolit_encodeSnappyBlockAsm + CMPW $0x00000800, R5 + BHS emit_copy_three_match_nolit_encodeSnappyBlockAsm + SUB $15, R6, R6 + MOVWU R6, R6 + MOVB R5, 1(R1) + LSRW $0x08, R5, R5 + LSLW $0x05, R5, R5 + ORRW R5, R6, R6 + MOVB R6, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeSnappyBlockAsm + +emit_copy_three_match_nolit_encodeSnappyBlockAsm: + SUB $2, R6, R6 + MOVWU R6, R6 + MOVB R6, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + +match_nolit_emitcopy_end_encodeSnappyBlockAsm: + MOVWU 16(RSP), R16 + CMPW R16, R2 + BHS emit_remainder_encodeSnappyBlockAsm + ADD R2, R3, R15 + MOVD -2(R15), R6 + MOVD 8(RSP), R16 + CMP R16, R1 + BLO match_nolit_dst_ok_encodeSnappyBlockAsm + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_nolit_dst_ok_encodeSnappyBlockAsm: + MOVD $0x0000cf1bbcdcbf9b, R8 + MOVD R6, R7 + LSR $0x10, R6, R6 + MOVD R6, R5 + LSL $0x10, R7, R7 + MUL R8, R7, R7 + LSR $0x32, R7, R7 + LSL $0x10, R5, R5 + MUL R8, R5, R5 + LSR $0x32, R5, R5 + SUB $2, R2, R8 + MOVWU R8, R8 + ADD R5<<2, R0, R9 + MOVWU (R9), R5 + MOVW R8, (R0)(R7<<2) + MOVW R2, (R9) + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ match_nolit_loop_encodeSnappyBlockAsm + ADDW $1, R2, R2 + JMP search_loop_encodeSnappyBlockAsm + +emit_remainder_encodeSnappyBlockAsm: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R16 + SUBW R16, R0, R0 + ADD R0, R1, R0 + ADD $5, R0, R0 + MOVD 8(RSP), R16 + CMP R16, R0 + BLO emit_remainder_ok_encodeSnappyBlockAsm + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +emit_remainder_ok_encodeSnappyBlockAsm: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R2 + CMPW R0, R2 + BEQ emit_literal_done_emit_remainder_encodeSnappyBlockAsm + MOVWU R0, R5 + MOVW R0, 20(RSP) + ADD R2, R3, R0 + SUBW R2, R5, R5 + SUB $1, R5, R2 + MOVWU R2, R2 + CMPW $0x3c, R2 + BLO one_byte_emit_remainder_encodeSnappyBlockAsm + CMPW $0x00000100, R2 + BLO two_bytes_emit_remainder_encodeSnappyBlockAsm + CMPW $0x00010000, R2 + BLO three_bytes_emit_remainder_encodeSnappyBlockAsm + CMPW $0x01000000, R2 + BLO four_bytes_emit_remainder_encodeSnappyBlockAsm + MOVD $0xfc, R16 + MOVB R16, (R1) + MOVW R2, 1(R1) + ADD $0x05, R1, R1 + JMP memmove_long_emit_remainder_encodeSnappyBlockAsm + +four_bytes_emit_remainder_encodeSnappyBlockAsm: + MOVWU R2, R3 + LSRW $0x10, R3, R3 + MOVD $0xf8, R16 + MOVB R16, (R1) + MOVH R2, 1(R1) + MOVB R3, 3(R1) + ADD $0x04, R1, R1 + JMP memmove_long_emit_remainder_encodeSnappyBlockAsm + +three_bytes_emit_remainder_encodeSnappyBlockAsm: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R2, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_emit_remainder_encodeSnappyBlockAsm + +two_bytes_emit_remainder_encodeSnappyBlockAsm: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R2, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R2 + BLO memmove_emit_remainder_encodeSnappyBlockAsm + JMP memmove_long_emit_remainder_encodeSnappyBlockAsm + +one_byte_emit_remainder_encodeSnappyBlockAsm: + LSLW $0x02, R2, R16 + BFI $0, R16, $8, R2 + MOVB R2, (R1) + ADD $0x01, R1, R1 + +memmove_emit_remainder_encodeSnappyBlockAsm: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveShort + CMP $0x03, R3 + BLO emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm_memmove_move_1or2 + BEQ emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm_memmove_move_3 + CMP $0x08, R3 + BLO emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm_memmove_move_4through7 + CMP $0x10, R3 + BLS emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm_memmove_move_8through16 + CMP $0x20, R3 + BLS emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm_memmove_move_17through32 + JMP emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm_memmove_move_33through64 + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm_memmove_move_1or2: + MOVBU (R0), R16 + BFI $0, R16, $8, R5 + ADD R3, R0, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R0 + MOVB R5, (R1) + ADD R3, R1, R15 + MOVB R0, -1(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm_memmove_move_3: + MOVHU (R0), R16 + BFI $0, R16, $16, R5 + MOVBU 2(R0), R16 + BFI $0, R16, $8, R0 + MOVH R5, (R1) + MOVB R0, 2(R1) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm_memmove_move_4through7: + MOVWU (R0), R5 + ADD R3, R0, R15 + MOVWU -4(R15), R0 + MOVW R5, (R1) + ADD R3, R1, R15 + MOVW R0, -4(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm_memmove_move_8through16: + MOVD (R0), R5 + ADD R3, R0, R15 + MOVD -8(R15), R0 + MOVD R5, (R1) + ADD R3, R1, R15 + MOVD R0, -8(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm_memmove_move_17through32: + FMOVQ (R0), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm_memmove_move_33through64: + FMOVQ (R0), F0 + FMOVQ 16(R0), F1 + ADD R3, R0, R15 + FMOVQ -32(R15), F2 + ADD R3, R0, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R3, R1, R15 + FMOVQ F2, -32(R15) + ADD R3, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_emit_remainder_encodeSnappyBlockAsm: + MOVD R2, R1 + JMP emit_literal_done_emit_remainder_encodeSnappyBlockAsm + +memmove_long_emit_remainder_encodeSnappyBlockAsm: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveLong + MOVD R0, R5 + MOVD R1, R6 + MOVD R3, R7 + +emit_lit_memmove_long_emit_remainder_encodeSnappyBlockAsmlarge_big_loop_back: + FMOVQ (R5), F0 + FMOVQ 16(R5), F1 + FMOVQ F0, (R6) + FMOVQ F1, 16(R6) + ADD $0x20, R5, R5 + ADD $0x20, R6, R6 + SUB $0x20, R7, R7 + CMP $0x20, R7 + BHS emit_lit_memmove_long_emit_remainder_encodeSnappyBlockAsmlarge_big_loop_back + ADD R3, R0, R15 + FMOVQ -32(R15), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + ADD R3, R1, R15 + FMOVQ F0, -32(R15) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + MOVD R2, R1 + +emit_literal_done_emit_remainder_encodeSnappyBlockAsm: + MOVD dst_base+0(FP), R0 + SUB R0, R1, R1 + MOVD R1, ret+56(FP) + RET + +// func encodeSnappyBlockAsm64K(dst []byte, src []byte, tmp *[65536]byte) int +// Requires: BMI, SSE2 +TEXT ·encodeSnappyBlockAsm64K(SB), $24-64 + MOVD tmp+48(FP), R0 + MOVD dst_base+0(FP), R1 + MOVD $0x00000200, R2 + MOVD R0, R3 + VEOR V0.B16, V0.B16, V0.B16 + +zero_loop_encodeSnappyBlockAsm64K: + FMOVQ F0, (R3) + FMOVQ F0, 16(R3) + FMOVQ F0, 32(R3) + FMOVQ F0, 48(R3) + FMOVQ F0, 64(R3) + FMOVQ F0, 80(R3) + FMOVQ F0, 96(R3) + FMOVQ F0, 112(R3) + ADD $0x80, R3, R3 + SUBS $1, R2, R2 + BNE zero_loop_encodeSnappyBlockAsm64K + MOVD $0x00000000, R16 + MOVW R16, 20(RSP) + MOVD src_len+32(FP), R2 + SUB $9, R2, R3 + SUB $8, R2, R5 + MOVW R5, 16(RSP) + LSR $0x05, R2, R2 + SUBW R2, R3, R3 + ADD R3, R1, R3 + MOVD R3, 8(RSP) + MOVD $0x00000001, R2 + MOVW R2, 24(RSP) + MOVD src_base+24(FP), R3 + +search_loop_encodeSnappyBlockAsm64K: + MOVWU R2, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + LSRW $0x06, R5, R5 + ADD R5, R2, R5 + ADD $4, R5, R5 + MOVWU R5, R5 + MOVWU 16(RSP), R16 + CMPW R16, R5 + BHS emit_remainder_encodeSnappyBlockAsm64K + MOVD (R3)(R2), R6 + MOVW R5, 28(RSP) + MOVD $0x0000cf1bbcdcbf9b, R8 + MOVD R6, R9 + MOVD R6, R10 + LSR $0x08, R10, R10 + LSL $0x10, R9, R9 + MUL R8, R9, R9 + LSR $0x32, R9, R9 + LSL $0x10, R10, R10 + MUL R8, R10, R10 + LSR $0x32, R10, R10 + MOVWU (R0)(R9<<2), R5 + MOVWU (R0)(R10<<2), R7 + MOVW R2, (R0)(R9<<2) + ADD $1, R2, R9 + MOVWU R9, R9 + MOVW R9, (R0)(R10<<2) + MOVD R6, R9 + LSR $0x10, R9, R9 + LSL $0x10, R9, R9 + MUL R8, R9, R9 + LSR $0x32, R9, R9 + MOVWU R2, R8 + MOVWU 24(RSP), R16 + SUBW R16, R8, R8 + ADD R8, R3, R15 + MOVWU 1(R15), R10 + MOVD R6, R8 + LSR $0x08, R8, R8 + CMPW R10, R8 + BNE no_repeat_found_encodeSnappyBlockAsm64K + ADD $1, R2, R6 + MOVWU R6, R6 + MOVWU 20(RSP), R5 + MOVWU R6, R7 + MOVWU 24(RSP), R16 + SUBSW R16, R7, R7 + BEQ repeat_extend_back_end_encodeSnappyBlockAsm64K + +repeat_extend_back_loop_encodeSnappyBlockAsm64K: + CMPW R5, R6 + BLS repeat_extend_back_end_encodeSnappyBlockAsm64K + ADD R7, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + ADD R6, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R9 + AND $0xff, R9, R16 + AND $0xff, R8, R15 + CMP R16, R15 + BNE repeat_extend_back_end_encodeSnappyBlockAsm64K + SUB $1, R6, R6 + MOVWU R6, R6 + SUBSW $1, R7, R7 + BNE repeat_extend_back_loop_encodeSnappyBlockAsm64K + +repeat_extend_back_end_encodeSnappyBlockAsm64K: + MOVWU R6, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + ADD R5, R1, R5 + ADD $3, R5, R5 + MOVD 8(RSP), R16 + CMP R16, R5 + BLO repeat_dst_size_check_encodeSnappyBlockAsm64K + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +repeat_dst_size_check_encodeSnappyBlockAsm64K: + MOVWU 20(RSP), R5 + CMPW R6, R5 + BEQ emit_literal_done_repeat_emit_encodeSnappyBlockAsm64K + MOVWU R6, R7 + MOVW R6, 20(RSP) + ADD R5, R3, R8 + SUBW R5, R7, R7 + SUB $1, R7, R5 + MOVWU R5, R5 + CMPW $0x3c, R5 + BLO one_byte_repeat_emit_encodeSnappyBlockAsm64K + CMPW $0x00000100, R5 + BLO two_bytes_repeat_emit_encodeSnappyBlockAsm64K + BLO three_bytes_repeat_emit_encodeSnappyBlockAsm64K + +three_bytes_repeat_emit_encodeSnappyBlockAsm64K: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_repeat_emit_encodeSnappyBlockAsm64K + +two_bytes_repeat_emit_encodeSnappyBlockAsm64K: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R5, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R5 + BLO memmove_repeat_emit_encodeSnappyBlockAsm64K + JMP memmove_long_repeat_emit_encodeSnappyBlockAsm64K + +one_byte_repeat_emit_encodeSnappyBlockAsm64K: + LSLW $0x02, R5, R16 + BFI $0, R16, $8, R5 + MOVB R5, (R1) + ADD $0x01, R1, R1 + +memmove_repeat_emit_encodeSnappyBlockAsm64K: + ADD R7, R1, R5 + + // genMemMoveShort + CMP $0x08, R7 + BLS emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm64K_memmove_move_8 + CMP $0x10, R7 + BLS emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm64K_memmove_move_8through16 + CMP $0x20, R7 + BLS emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm64K_memmove_move_17through32 + JMP emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm64K_memmove_move_33through64 + +emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm64K_memmove_move_8: + MOVD (R8), R9 + MOVD R9, (R1) + JMP memmove_end_copy_repeat_emit_encodeSnappyBlockAsm64K + +emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm64K_memmove_move_8through16: + MOVD (R8), R9 + ADD R7, R8, R15 + MOVD -8(R15), R8 + MOVD R9, (R1) + ADD R7, R1, R15 + MOVD R8, -8(R15) + JMP memmove_end_copy_repeat_emit_encodeSnappyBlockAsm64K + +emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm64K_memmove_move_17through32: + FMOVQ (R8), F0 + ADD R7, R8, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R7, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_repeat_emit_encodeSnappyBlockAsm64K + +emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm64K_memmove_move_33through64: + FMOVQ (R8), F0 + FMOVQ 16(R8), F1 + ADD R7, R8, R15 + FMOVQ -32(R15), F2 + ADD R7, R8, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R7, R1, R15 + FMOVQ F2, -32(R15) + ADD R7, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_repeat_emit_encodeSnappyBlockAsm64K: + MOVD R5, R1 + JMP emit_literal_done_repeat_emit_encodeSnappyBlockAsm64K + +memmove_long_repeat_emit_encodeSnappyBlockAsm64K: + ADD R7, R1, R5 + + // genMemMoveLong + MOVD R8, R9 + MOVD R1, R10 + MOVD R7, R11 + +emit_lit_memmove_long_repeat_emit_encodeSnappyBlockAsm64Klarge_big_loop_back: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + FMOVQ F0, (R10) + FMOVQ F1, 16(R10) + ADD $0x20, R9, R9 + ADD $0x20, R10, R10 + SUB $0x20, R11, R11 + CMP $0x20, R11 + BHS emit_lit_memmove_long_repeat_emit_encodeSnappyBlockAsm64Klarge_big_loop_back + ADD R7, R8, R15 + FMOVQ -32(R15), F0 + ADD R7, R8, R15 + FMOVQ -16(R15), F1 + ADD R7, R1, R15 + FMOVQ F0, -32(R15) + ADD R7, R1, R15 + FMOVQ F1, -16(R15) + MOVD R5, R1 + +emit_literal_done_repeat_emit_encodeSnappyBlockAsm64K: + ADDW $0x05, R2, R2 + MOVWU R2, R5 + MOVWU 24(RSP), R16 + SUBW R16, R5, R5 + MOVD src_len+32(FP), R7 + SUBW R2, R7, R7 + ADD R2, R3, R8 + ADD R5, R3, R5 + + // matchLen + MOVD $0, R10 + +matchlen_loopback_16_repeat_extend_encodeSnappyBlockAsm64K: + CMPW $0x10, R7 + BLO matchlen_match8_repeat_extend_encodeSnappyBlockAsm64K + MOVD (R8)(R10), R9 + ADD R10, R8, R15 + MOVD 8(R15), R11 + MOVD (R5)(R10), R16 + EOR R16, R9, R9 + TST R9, R9 + BNE matchlen_bsf_8_repeat_extend_encodeSnappyBlockAsm64K + ADD R10, R5, R15 + MOVD 8(R15), R16 + EOR R16, R11, R11 + TST R11, R11 + BNE matchlen_bsf_16repeat_extend_encodeSnappyBlockAsm64K + SUB $16, R7, R7 + MOVWU R7, R7 + ADD $16, R10, R10 + MOVWU R10, R10 + JMP matchlen_loopback_16_repeat_extend_encodeSnappyBlockAsm64K + +matchlen_bsf_16repeat_extend_encodeSnappyBlockAsm64K: + RBIT R11, R11 + CLZ R11, R11 + ASR $0x03, R11, R11 + ADD R11, R10, R10 + ADD $8, R10, R10 + MOVWU R10, R10 + JMP repeat_extend_forward_end_encodeSnappyBlockAsm64K + +matchlen_match8_repeat_extend_encodeSnappyBlockAsm64K: + CMPW $0x08, R7 + BLO matchlen_match4_repeat_extend_encodeSnappyBlockAsm64K + MOVD (R8)(R10), R9 + MOVD (R5)(R10), R16 + EOR R16, R9, R9 + TST R9, R9 + BNE matchlen_bsf_8_repeat_extend_encodeSnappyBlockAsm64K + SUB $8, R7, R7 + MOVWU R7, R7 + ADD $8, R10, R10 + MOVWU R10, R10 + JMP matchlen_match4_repeat_extend_encodeSnappyBlockAsm64K + +matchlen_bsf_8_repeat_extend_encodeSnappyBlockAsm64K: + RBIT R9, R9 + CLZ R9, R9 + ASR $0x03, R9, R9 + ADD R9, R10, R10 + MOVWU R10, R10 + JMP repeat_extend_forward_end_encodeSnappyBlockAsm64K + +matchlen_match4_repeat_extend_encodeSnappyBlockAsm64K: + CMPW $0x04, R7 + BLO matchlen_match2_repeat_extend_encodeSnappyBlockAsm64K + MOVWU (R8)(R10), R9 + MOVWU (R5)(R10), R16 + CMPW R9, R16 + BNE matchlen_match2_repeat_extend_encodeSnappyBlockAsm64K + SUB $4, R7, R7 + MOVWU R7, R7 + ADD $4, R10, R10 + MOVWU R10, R10 + +matchlen_match2_repeat_extend_encodeSnappyBlockAsm64K: + CMPW $0x01, R7 + BEQ matchlen_match1_repeat_extend_encodeSnappyBlockAsm64K + BLO repeat_extend_forward_end_encodeSnappyBlockAsm64K + MOVHU (R8)(R10), R16 + BFI $0, R16, $16, R9 + ADD R10, R5, R15 + MOVHU (R15), R15 + AND $0xffff, R9, R16 + CMP R16, R15 + BNE matchlen_match1_repeat_extend_encodeSnappyBlockAsm64K + ADD $2, R10, R10 + MOVWU R10, R10 + SUBSW $0x02, R7, R7 + BEQ repeat_extend_forward_end_encodeSnappyBlockAsm64K + +matchlen_match1_repeat_extend_encodeSnappyBlockAsm64K: + MOVBU (R8)(R10), R16 + BFI $0, R16, $8, R9 + ADD R10, R5, R15 + MOVBU (R15), R15 + AND $0xff, R9, R16 + CMP R16, R15 + BNE repeat_extend_forward_end_encodeSnappyBlockAsm64K + ADD $1, R10, R10 + MOVWU R10, R10 + +repeat_extend_forward_end_encodeSnappyBlockAsm64K: + ADDW R10, R2, R2 + MOVWU R2, R5 + SUBW R6, R5, R5 + MOVWU 24(RSP), R6 + + // emitCopy +two_byte_offset_repeat_as_copy_encodeSnappyBlockAsm64K: + CMPW $0x40, R5 + BLS two_byte_offset_short_repeat_as_copy_encodeSnappyBlockAsm64K + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R6, 1(R1) + SUB $60, R5, R5 + MOVWU R5, R5 + ADD $0x03, R1, R1 + JMP two_byte_offset_repeat_as_copy_encodeSnappyBlockAsm64K + +two_byte_offset_short_repeat_as_copy_encodeSnappyBlockAsm64K: + MOVWU R5, R7 + LSLW $0x02, R7, R7 + CMPW $0x0c, R5 + BHS emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm64K + CMPW $0x00000800, R6 + BHS emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm64K + SUB $15, R7, R7 + MOVWU R7, R7 + MOVB R6, 1(R1) + LSRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R7, R7 + MOVB R7, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeSnappyBlockAsm64K + +emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm64K: + SUB $2, R7, R7 + MOVWU R7, R7 + MOVB R7, (R1) + MOVH R6, 1(R1) + ADD $0x03, R1, R1 + +repeat_end_emit_encodeSnappyBlockAsm64K: + MOVW R2, 20(RSP) + JMP search_loop_encodeSnappyBlockAsm64K + +no_repeat_found_encodeSnappyBlockAsm64K: + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate_match_encodeSnappyBlockAsm64K + LSR $0x08, R6, R6 + MOVWU (R0)(R9<<2), R5 + ADD $2, R2, R8 + MOVWU R8, R8 + MOVWU (R3)(R7), R16 + CMPW R6, R16 + BEQ candidate2_match_encodeSnappyBlockAsm64K + MOVW R8, (R0)(R9<<2) + LSR $0x08, R6, R6 + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate3_match_encodeSnappyBlockAsm64K + MOVWU 28(RSP), R2 + JMP search_loop_encodeSnappyBlockAsm64K + +candidate3_match_encodeSnappyBlockAsm64K: + ADDW $0x02, R2, R2 + JMP candidate_match_encodeSnappyBlockAsm64K + +candidate2_match_encodeSnappyBlockAsm64K: + MOVW R8, (R0)(R9<<2) + ADDW $1, R2, R2 + MOVWU R7, R5 + +candidate_match_encodeSnappyBlockAsm64K: + MOVWU 20(RSP), R6 + TSTW R5, R5 + BEQ match_extend_back_end_encodeSnappyBlockAsm64K + +match_extend_back_loop_encodeSnappyBlockAsm64K: + CMPW R6, R2 + BLS match_extend_back_end_encodeSnappyBlockAsm64K + ADD R5, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R7 + ADD R2, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + AND $0xff, R8, R16 + AND $0xff, R7, R15 + CMP R16, R15 + BNE match_extend_back_end_encodeSnappyBlockAsm64K + SUB $1, R2, R2 + MOVWU R2, R2 + SUBSW $1, R5, R5 + BEQ match_extend_back_end_encodeSnappyBlockAsm64K + JMP match_extend_back_loop_encodeSnappyBlockAsm64K + +match_extend_back_end_encodeSnappyBlockAsm64K: + MOVWU R2, R6 + MOVWU 20(RSP), R16 + SUBW R16, R6, R6 + ADD R6, R1, R6 + ADD $3, R6, R6 + MOVD 8(RSP), R16 + CMP R16, R6 + BLO match_dst_size_check_encodeSnappyBlockAsm64K + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_dst_size_check_encodeSnappyBlockAsm64K: + MOVWU R2, R6 + MOVWU 20(RSP), R7 + CMPW R6, R7 + BEQ emit_literal_done_match_emit_encodeSnappyBlockAsm64K + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R7, R3, R6 + SUBW R7, R8, R8 + SUB $1, R8, R7 + MOVWU R7, R7 + CMPW $0x3c, R7 + BLO one_byte_match_emit_encodeSnappyBlockAsm64K + CMPW $0x00000100, R7 + BLO two_bytes_match_emit_encodeSnappyBlockAsm64K + BLO three_bytes_match_emit_encodeSnappyBlockAsm64K + +three_bytes_match_emit_encodeSnappyBlockAsm64K: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R7, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_match_emit_encodeSnappyBlockAsm64K + +two_bytes_match_emit_encodeSnappyBlockAsm64K: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R7, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R7 + BLO memmove_match_emit_encodeSnappyBlockAsm64K + JMP memmove_long_match_emit_encodeSnappyBlockAsm64K + +one_byte_match_emit_encodeSnappyBlockAsm64K: + LSLW $0x02, R7, R16 + BFI $0, R16, $8, R7 + MOVB R7, (R1) + ADD $0x01, R1, R1 + +memmove_match_emit_encodeSnappyBlockAsm64K: + ADD R8, R1, R7 + + // genMemMoveShort + CMP $0x08, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBlockAsm64K_memmove_move_8 + CMP $0x10, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBlockAsm64K_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBlockAsm64K_memmove_move_17through32 + JMP emit_lit_memmove_match_emit_encodeSnappyBlockAsm64K_memmove_move_33through64 + +emit_lit_memmove_match_emit_encodeSnappyBlockAsm64K_memmove_move_8: + MOVD (R6), R9 + MOVD R9, (R1) + JMP memmove_end_copy_match_emit_encodeSnappyBlockAsm64K + +emit_lit_memmove_match_emit_encodeSnappyBlockAsm64K_memmove_move_8through16: + MOVD (R6), R9 + ADD R8, R6, R15 + MOVD -8(R15), R6 + MOVD R9, (R1) + ADD R8, R1, R15 + MOVD R6, -8(R15) + JMP memmove_end_copy_match_emit_encodeSnappyBlockAsm64K + +emit_lit_memmove_match_emit_encodeSnappyBlockAsm64K_memmove_move_17through32: + FMOVQ (R6), F0 + ADD R8, R6, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_match_emit_encodeSnappyBlockAsm64K + +emit_lit_memmove_match_emit_encodeSnappyBlockAsm64K_memmove_move_33through64: + FMOVQ (R6), F0 + FMOVQ 16(R6), F1 + ADD R8, R6, R15 + FMOVQ -32(R15), F2 + ADD R8, R6, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_match_emit_encodeSnappyBlockAsm64K: + MOVD R7, R1 + JMP emit_literal_done_match_emit_encodeSnappyBlockAsm64K + +memmove_long_match_emit_encodeSnappyBlockAsm64K: + ADD R8, R1, R7 + + // genMemMoveLong + MOVD R6, R9 + MOVD R1, R10 + MOVD R8, R11 + +emit_lit_memmove_long_match_emit_encodeSnappyBlockAsm64Klarge_big_loop_back: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + FMOVQ F0, (R10) + FMOVQ F1, 16(R10) + ADD $0x20, R9, R9 + ADD $0x20, R10, R10 + SUB $0x20, R11, R11 + CMP $0x20, R11 + BHS emit_lit_memmove_long_match_emit_encodeSnappyBlockAsm64Klarge_big_loop_back + ADD R8, R6, R15 + FMOVQ -32(R15), F0 + ADD R8, R6, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R7, R1 + +emit_literal_done_match_emit_encodeSnappyBlockAsm64K: +match_nolit_loop_encodeSnappyBlockAsm64K: + MOVWU R2, R6 + SUBW R5, R6, R6 + MOVW R6, 24(RSP) + ADDW $0x04, R2, R2 + ADDW $0x04, R5, R5 + MOVD src_len+32(FP), R6 + SUBW R2, R6, R6 + ADD R2, R3, R7 + ADD R5, R3, R5 + + // matchLen + MOVD $0, R9 + +matchlen_loopback_16_match_nolit_encodeSnappyBlockAsm64K: + CMPW $0x10, R6 + BLO matchlen_match8_match_nolit_encodeSnappyBlockAsm64K + MOVD (R7)(R9), R8 + ADD R9, R7, R15 + MOVD 8(R15), R10 + MOVD (R5)(R9), R16 + EOR R16, R8, R8 + TST R8, R8 + BNE matchlen_bsf_8_match_nolit_encodeSnappyBlockAsm64K + ADD R9, R5, R15 + MOVD 8(R15), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_16match_nolit_encodeSnappyBlockAsm64K + SUB $16, R6, R6 + MOVWU R6, R6 + ADD $16, R9, R9 + MOVWU R9, R9 + JMP matchlen_loopback_16_match_nolit_encodeSnappyBlockAsm64K + +matchlen_bsf_16match_nolit_encodeSnappyBlockAsm64K: + RBIT R10, R10 + CLZ R10, R10 + ASR $0x03, R10, R10 + ADD R10, R9, R9 + ADD $8, R9, R9 + MOVWU R9, R9 + JMP match_nolit_end_encodeSnappyBlockAsm64K + +matchlen_match8_match_nolit_encodeSnappyBlockAsm64K: + CMPW $0x08, R6 + BLO matchlen_match4_match_nolit_encodeSnappyBlockAsm64K + MOVD (R7)(R9), R8 + MOVD (R5)(R9), R16 + EOR R16, R8, R8 + TST R8, R8 + BNE matchlen_bsf_8_match_nolit_encodeSnappyBlockAsm64K + SUB $8, R6, R6 + MOVWU R6, R6 + ADD $8, R9, R9 + MOVWU R9, R9 + JMP matchlen_match4_match_nolit_encodeSnappyBlockAsm64K + +matchlen_bsf_8_match_nolit_encodeSnappyBlockAsm64K: + RBIT R8, R8 + CLZ R8, R8 + ASR $0x03, R8, R8 + ADD R8, R9, R9 + MOVWU R9, R9 + JMP match_nolit_end_encodeSnappyBlockAsm64K + +matchlen_match4_match_nolit_encodeSnappyBlockAsm64K: + CMPW $0x04, R6 + BLO matchlen_match2_match_nolit_encodeSnappyBlockAsm64K + MOVWU (R7)(R9), R8 + MOVWU (R5)(R9), R16 + CMPW R8, R16 + BNE matchlen_match2_match_nolit_encodeSnappyBlockAsm64K + SUB $4, R6, R6 + MOVWU R6, R6 + ADD $4, R9, R9 + MOVWU R9, R9 + +matchlen_match2_match_nolit_encodeSnappyBlockAsm64K: + CMPW $0x01, R6 + BEQ matchlen_match1_match_nolit_encodeSnappyBlockAsm64K + BLO match_nolit_end_encodeSnappyBlockAsm64K + MOVHU (R7)(R9), R16 + BFI $0, R16, $16, R8 + ADD R9, R5, R15 + MOVHU (R15), R15 + AND $0xffff, R8, R16 + CMP R16, R15 + BNE matchlen_match1_match_nolit_encodeSnappyBlockAsm64K + ADD $2, R9, R9 + MOVWU R9, R9 + SUBSW $0x02, R6, R6 + BEQ match_nolit_end_encodeSnappyBlockAsm64K + +matchlen_match1_match_nolit_encodeSnappyBlockAsm64K: + MOVBU (R7)(R9), R16 + BFI $0, R16, $8, R8 + ADD R9, R5, R15 + MOVBU (R15), R15 + AND $0xff, R8, R16 + CMP R16, R15 + BNE match_nolit_end_encodeSnappyBlockAsm64K + ADD $1, R9, R9 + MOVWU R9, R9 + +match_nolit_end_encodeSnappyBlockAsm64K: + ADDW R9, R2, R2 + MOVWU 24(RSP), R5 + ADDW $0x04, R9, R9 + MOVW R2, 20(RSP) + + // emitCopy +two_byte_offset_match_nolit_encodeSnappyBlockAsm64K: + CMPW $0x40, R9 + BLS two_byte_offset_short_match_nolit_encodeSnappyBlockAsm64K + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + SUB $60, R9, R9 + MOVWU R9, R9 + ADD $0x03, R1, R1 + JMP two_byte_offset_match_nolit_encodeSnappyBlockAsm64K + +two_byte_offset_short_match_nolit_encodeSnappyBlockAsm64K: + MOVWU R9, R6 + LSLW $0x02, R6, R6 + CMPW $0x0c, R9 + BHS emit_copy_three_match_nolit_encodeSnappyBlockAsm64K + CMPW $0x00000800, R5 + BHS emit_copy_three_match_nolit_encodeSnappyBlockAsm64K + SUB $15, R6, R6 + MOVWU R6, R6 + MOVB R5, 1(R1) + LSRW $0x08, R5, R5 + LSLW $0x05, R5, R5 + ORRW R5, R6, R6 + MOVB R6, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeSnappyBlockAsm64K + +emit_copy_three_match_nolit_encodeSnappyBlockAsm64K: + SUB $2, R6, R6 + MOVWU R6, R6 + MOVB R6, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + +match_nolit_emitcopy_end_encodeSnappyBlockAsm64K: + MOVWU 16(RSP), R16 + CMPW R16, R2 + BHS emit_remainder_encodeSnappyBlockAsm64K + ADD R2, R3, R15 + MOVD -2(R15), R6 + MOVD 8(RSP), R16 + CMP R16, R1 + BLO match_nolit_dst_ok_encodeSnappyBlockAsm64K + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_nolit_dst_ok_encodeSnappyBlockAsm64K: + MOVD $0x0000cf1bbcdcbf9b, R8 + MOVD R6, R7 + LSR $0x10, R6, R6 + MOVD R6, R5 + LSL $0x10, R7, R7 + MUL R8, R7, R7 + LSR $0x32, R7, R7 + LSL $0x10, R5, R5 + MUL R8, R5, R5 + LSR $0x32, R5, R5 + SUB $2, R2, R8 + MOVWU R8, R8 + ADD R5<<2, R0, R9 + MOVWU (R9), R5 + MOVW R8, (R0)(R7<<2) + MOVW R2, (R9) + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ match_nolit_loop_encodeSnappyBlockAsm64K + ADDW $1, R2, R2 + JMP search_loop_encodeSnappyBlockAsm64K + +emit_remainder_encodeSnappyBlockAsm64K: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R16 + SUBW R16, R0, R0 + ADD R0, R1, R0 + ADD $3, R0, R0 + MOVD 8(RSP), R16 + CMP R16, R0 + BLO emit_remainder_ok_encodeSnappyBlockAsm64K + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +emit_remainder_ok_encodeSnappyBlockAsm64K: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R2 + CMPW R0, R2 + BEQ emit_literal_done_emit_remainder_encodeSnappyBlockAsm64K + MOVWU R0, R5 + MOVW R0, 20(RSP) + ADD R2, R3, R0 + SUBW R2, R5, R5 + SUB $1, R5, R2 + MOVWU R2, R2 + CMPW $0x3c, R2 + BLO one_byte_emit_remainder_encodeSnappyBlockAsm64K + CMPW $0x00000100, R2 + BLO two_bytes_emit_remainder_encodeSnappyBlockAsm64K + BLO three_bytes_emit_remainder_encodeSnappyBlockAsm64K + +three_bytes_emit_remainder_encodeSnappyBlockAsm64K: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R2, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_emit_remainder_encodeSnappyBlockAsm64K + +two_bytes_emit_remainder_encodeSnappyBlockAsm64K: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R2, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R2 + BLO memmove_emit_remainder_encodeSnappyBlockAsm64K + JMP memmove_long_emit_remainder_encodeSnappyBlockAsm64K + +one_byte_emit_remainder_encodeSnappyBlockAsm64K: + LSLW $0x02, R2, R16 + BFI $0, R16, $8, R2 + MOVB R2, (R1) + ADD $0x01, R1, R1 + +memmove_emit_remainder_encodeSnappyBlockAsm64K: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveShort + CMP $0x03, R3 + BLO emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm64K_memmove_move_1or2 + BEQ emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm64K_memmove_move_3 + CMP $0x08, R3 + BLO emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm64K_memmove_move_4through7 + CMP $0x10, R3 + BLS emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm64K_memmove_move_8through16 + CMP $0x20, R3 + BLS emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm64K_memmove_move_17through32 + JMP emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm64K_memmove_move_33through64 + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm64K_memmove_move_1or2: + MOVBU (R0), R16 + BFI $0, R16, $8, R5 + ADD R3, R0, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R0 + MOVB R5, (R1) + ADD R3, R1, R15 + MOVB R0, -1(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm64K + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm64K_memmove_move_3: + MOVHU (R0), R16 + BFI $0, R16, $16, R5 + MOVBU 2(R0), R16 + BFI $0, R16, $8, R0 + MOVH R5, (R1) + MOVB R0, 2(R1) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm64K + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm64K_memmove_move_4through7: + MOVWU (R0), R5 + ADD R3, R0, R15 + MOVWU -4(R15), R0 + MOVW R5, (R1) + ADD R3, R1, R15 + MOVW R0, -4(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm64K + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm64K_memmove_move_8through16: + MOVD (R0), R5 + ADD R3, R0, R15 + MOVD -8(R15), R0 + MOVD R5, (R1) + ADD R3, R1, R15 + MOVD R0, -8(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm64K + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm64K_memmove_move_17through32: + FMOVQ (R0), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm64K + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm64K_memmove_move_33through64: + FMOVQ (R0), F0 + FMOVQ 16(R0), F1 + ADD R3, R0, R15 + FMOVQ -32(R15), F2 + ADD R3, R0, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R3, R1, R15 + FMOVQ F2, -32(R15) + ADD R3, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_emit_remainder_encodeSnappyBlockAsm64K: + MOVD R2, R1 + JMP emit_literal_done_emit_remainder_encodeSnappyBlockAsm64K + +memmove_long_emit_remainder_encodeSnappyBlockAsm64K: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveLong + MOVD R0, R5 + MOVD R1, R6 + MOVD R3, R7 + +emit_lit_memmove_long_emit_remainder_encodeSnappyBlockAsm64Klarge_big_loop_back: + FMOVQ (R5), F0 + FMOVQ 16(R5), F1 + FMOVQ F0, (R6) + FMOVQ F1, 16(R6) + ADD $0x20, R5, R5 + ADD $0x20, R6, R6 + SUB $0x20, R7, R7 + CMP $0x20, R7 + BHS emit_lit_memmove_long_emit_remainder_encodeSnappyBlockAsm64Klarge_big_loop_back + ADD R3, R0, R15 + FMOVQ -32(R15), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + ADD R3, R1, R15 + FMOVQ F0, -32(R15) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + MOVD R2, R1 + +emit_literal_done_emit_remainder_encodeSnappyBlockAsm64K: + MOVD dst_base+0(FP), R0 + SUB R0, R1, R1 + MOVD R1, ret+56(FP) + RET + +// func encodeSnappyBlockAsm12B(dst []byte, src []byte, tmp *[16384]byte) int +// Requires: BMI, SSE2 +TEXT ·encodeSnappyBlockAsm12B(SB), $24-64 + MOVD tmp+48(FP), R0 + MOVD dst_base+0(FP), R1 + MOVD $0x00000080, R2 + MOVD R0, R3 + VEOR V0.B16, V0.B16, V0.B16 + +zero_loop_encodeSnappyBlockAsm12B: + FMOVQ F0, (R3) + FMOVQ F0, 16(R3) + FMOVQ F0, 32(R3) + FMOVQ F0, 48(R3) + FMOVQ F0, 64(R3) + FMOVQ F0, 80(R3) + FMOVQ F0, 96(R3) + FMOVQ F0, 112(R3) + ADD $0x80, R3, R3 + SUBS $1, R2, R2 + BNE zero_loop_encodeSnappyBlockAsm12B + MOVD $0x00000000, R16 + MOVW R16, 20(RSP) + MOVD src_len+32(FP), R2 + SUB $9, R2, R3 + SUB $8, R2, R5 + MOVW R5, 16(RSP) + LSR $0x05, R2, R2 + SUBW R2, R3, R3 + ADD R3, R1, R3 + MOVD R3, 8(RSP) + MOVD $0x00000001, R2 + MOVW R2, 24(RSP) + MOVD src_base+24(FP), R3 + +search_loop_encodeSnappyBlockAsm12B: + MOVWU R2, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + LSRW $0x05, R5, R5 + ADD R5, R2, R5 + ADD $4, R5, R5 + MOVWU R5, R5 + MOVWU 16(RSP), R16 + CMPW R16, R5 + BHS emit_remainder_encodeSnappyBlockAsm12B + MOVD (R3)(R2), R6 + MOVW R5, 28(RSP) + MOVD $0x000000cf1bbcdcbb, R8 + MOVD R6, R9 + MOVD R6, R10 + LSR $0x08, R10, R10 + LSL $0x18, R9, R9 + MUL R8, R9, R9 + LSR $0x34, R9, R9 + LSL $0x18, R10, R10 + MUL R8, R10, R10 + LSR $0x34, R10, R10 + MOVWU (R0)(R9<<2), R5 + MOVWU (R0)(R10<<2), R7 + MOVW R2, (R0)(R9<<2) + ADD $1, R2, R9 + MOVWU R9, R9 + MOVW R9, (R0)(R10<<2) + MOVD R6, R9 + LSR $0x10, R9, R9 + LSL $0x18, R9, R9 + MUL R8, R9, R9 + LSR $0x34, R9, R9 + MOVWU R2, R8 + MOVWU 24(RSP), R16 + SUBW R16, R8, R8 + ADD R8, R3, R15 + MOVWU 1(R15), R10 + MOVD R6, R8 + LSR $0x08, R8, R8 + CMPW R10, R8 + BNE no_repeat_found_encodeSnappyBlockAsm12B + ADD $1, R2, R6 + MOVWU R6, R6 + MOVWU 20(RSP), R5 + MOVWU R6, R7 + MOVWU 24(RSP), R16 + SUBSW R16, R7, R7 + BEQ repeat_extend_back_end_encodeSnappyBlockAsm12B + +repeat_extend_back_loop_encodeSnappyBlockAsm12B: + CMPW R5, R6 + BLS repeat_extend_back_end_encodeSnappyBlockAsm12B + ADD R7, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + ADD R6, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R9 + AND $0xff, R9, R16 + AND $0xff, R8, R15 + CMP R16, R15 + BNE repeat_extend_back_end_encodeSnappyBlockAsm12B + SUB $1, R6, R6 + MOVWU R6, R6 + SUBSW $1, R7, R7 + BNE repeat_extend_back_loop_encodeSnappyBlockAsm12B + +repeat_extend_back_end_encodeSnappyBlockAsm12B: + MOVWU R6, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + ADD R5, R1, R5 + ADD $3, R5, R5 + MOVD 8(RSP), R16 + CMP R16, R5 + BLO repeat_dst_size_check_encodeSnappyBlockAsm12B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +repeat_dst_size_check_encodeSnappyBlockAsm12B: + MOVWU 20(RSP), R5 + CMPW R6, R5 + BEQ emit_literal_done_repeat_emit_encodeSnappyBlockAsm12B + MOVWU R6, R7 + MOVW R6, 20(RSP) + ADD R5, R3, R8 + SUBW R5, R7, R7 + SUB $1, R7, R5 + MOVWU R5, R5 + CMPW $0x3c, R5 + BLO one_byte_repeat_emit_encodeSnappyBlockAsm12B + CMPW $0x00000100, R5 + BLO two_bytes_repeat_emit_encodeSnappyBlockAsm12B + BLO three_bytes_repeat_emit_encodeSnappyBlockAsm12B + +three_bytes_repeat_emit_encodeSnappyBlockAsm12B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_repeat_emit_encodeSnappyBlockAsm12B + +two_bytes_repeat_emit_encodeSnappyBlockAsm12B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R5, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R5 + BLO memmove_repeat_emit_encodeSnappyBlockAsm12B + JMP memmove_long_repeat_emit_encodeSnappyBlockAsm12B + +one_byte_repeat_emit_encodeSnappyBlockAsm12B: + LSLW $0x02, R5, R16 + BFI $0, R16, $8, R5 + MOVB R5, (R1) + ADD $0x01, R1, R1 + +memmove_repeat_emit_encodeSnappyBlockAsm12B: + ADD R7, R1, R5 + + // genMemMoveShort + CMP $0x08, R7 + BLS emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm12B_memmove_move_8 + CMP $0x10, R7 + BLS emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm12B_memmove_move_8through16 + CMP $0x20, R7 + BLS emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm12B_memmove_move_17through32 + JMP emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm12B_memmove_move_33through64 + +emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm12B_memmove_move_8: + MOVD (R8), R9 + MOVD R9, (R1) + JMP memmove_end_copy_repeat_emit_encodeSnappyBlockAsm12B + +emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm12B_memmove_move_8through16: + MOVD (R8), R9 + ADD R7, R8, R15 + MOVD -8(R15), R8 + MOVD R9, (R1) + ADD R7, R1, R15 + MOVD R8, -8(R15) + JMP memmove_end_copy_repeat_emit_encodeSnappyBlockAsm12B + +emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm12B_memmove_move_17through32: + FMOVQ (R8), F0 + ADD R7, R8, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R7, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_repeat_emit_encodeSnappyBlockAsm12B + +emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm12B_memmove_move_33through64: + FMOVQ (R8), F0 + FMOVQ 16(R8), F1 + ADD R7, R8, R15 + FMOVQ -32(R15), F2 + ADD R7, R8, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R7, R1, R15 + FMOVQ F2, -32(R15) + ADD R7, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_repeat_emit_encodeSnappyBlockAsm12B: + MOVD R5, R1 + JMP emit_literal_done_repeat_emit_encodeSnappyBlockAsm12B + +memmove_long_repeat_emit_encodeSnappyBlockAsm12B: + ADD R7, R1, R5 + + // genMemMoveLong + MOVD R8, R9 + MOVD R1, R10 + MOVD R7, R11 + +emit_lit_memmove_long_repeat_emit_encodeSnappyBlockAsm12Blarge_big_loop_back: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + FMOVQ F0, (R10) + FMOVQ F1, 16(R10) + ADD $0x20, R9, R9 + ADD $0x20, R10, R10 + SUB $0x20, R11, R11 + CMP $0x20, R11 + BHS emit_lit_memmove_long_repeat_emit_encodeSnappyBlockAsm12Blarge_big_loop_back + ADD R7, R8, R15 + FMOVQ -32(R15), F0 + ADD R7, R8, R15 + FMOVQ -16(R15), F1 + ADD R7, R1, R15 + FMOVQ F0, -32(R15) + ADD R7, R1, R15 + FMOVQ F1, -16(R15) + MOVD R5, R1 + +emit_literal_done_repeat_emit_encodeSnappyBlockAsm12B: + ADDW $0x05, R2, R2 + MOVWU R2, R5 + MOVWU 24(RSP), R16 + SUBW R16, R5, R5 + MOVD src_len+32(FP), R7 + SUBW R2, R7, R7 + ADD R2, R3, R8 + ADD R5, R3, R5 + + // matchLen + MOVD $0, R10 + +matchlen_loopback_16_repeat_extend_encodeSnappyBlockAsm12B: + CMPW $0x10, R7 + BLO matchlen_match8_repeat_extend_encodeSnappyBlockAsm12B + MOVD (R8)(R10), R9 + ADD R10, R8, R15 + MOVD 8(R15), R11 + MOVD (R5)(R10), R16 + EOR R16, R9, R9 + TST R9, R9 + BNE matchlen_bsf_8_repeat_extend_encodeSnappyBlockAsm12B + ADD R10, R5, R15 + MOVD 8(R15), R16 + EOR R16, R11, R11 + TST R11, R11 + BNE matchlen_bsf_16repeat_extend_encodeSnappyBlockAsm12B + SUB $16, R7, R7 + MOVWU R7, R7 + ADD $16, R10, R10 + MOVWU R10, R10 + JMP matchlen_loopback_16_repeat_extend_encodeSnappyBlockAsm12B + +matchlen_bsf_16repeat_extend_encodeSnappyBlockAsm12B: + RBIT R11, R11 + CLZ R11, R11 + ASR $0x03, R11, R11 + ADD R11, R10, R10 + ADD $8, R10, R10 + MOVWU R10, R10 + JMP repeat_extend_forward_end_encodeSnappyBlockAsm12B + +matchlen_match8_repeat_extend_encodeSnappyBlockAsm12B: + CMPW $0x08, R7 + BLO matchlen_match4_repeat_extend_encodeSnappyBlockAsm12B + MOVD (R8)(R10), R9 + MOVD (R5)(R10), R16 + EOR R16, R9, R9 + TST R9, R9 + BNE matchlen_bsf_8_repeat_extend_encodeSnappyBlockAsm12B + SUB $8, R7, R7 + MOVWU R7, R7 + ADD $8, R10, R10 + MOVWU R10, R10 + JMP matchlen_match4_repeat_extend_encodeSnappyBlockAsm12B + +matchlen_bsf_8_repeat_extend_encodeSnappyBlockAsm12B: + RBIT R9, R9 + CLZ R9, R9 + ASR $0x03, R9, R9 + ADD R9, R10, R10 + MOVWU R10, R10 + JMP repeat_extend_forward_end_encodeSnappyBlockAsm12B + +matchlen_match4_repeat_extend_encodeSnappyBlockAsm12B: + CMPW $0x04, R7 + BLO matchlen_match2_repeat_extend_encodeSnappyBlockAsm12B + MOVWU (R8)(R10), R9 + MOVWU (R5)(R10), R16 + CMPW R9, R16 + BNE matchlen_match2_repeat_extend_encodeSnappyBlockAsm12B + SUB $4, R7, R7 + MOVWU R7, R7 + ADD $4, R10, R10 + MOVWU R10, R10 + +matchlen_match2_repeat_extend_encodeSnappyBlockAsm12B: + CMPW $0x01, R7 + BEQ matchlen_match1_repeat_extend_encodeSnappyBlockAsm12B + BLO repeat_extend_forward_end_encodeSnappyBlockAsm12B + MOVHU (R8)(R10), R16 + BFI $0, R16, $16, R9 + ADD R10, R5, R15 + MOVHU (R15), R15 + AND $0xffff, R9, R16 + CMP R16, R15 + BNE matchlen_match1_repeat_extend_encodeSnappyBlockAsm12B + ADD $2, R10, R10 + MOVWU R10, R10 + SUBSW $0x02, R7, R7 + BEQ repeat_extend_forward_end_encodeSnappyBlockAsm12B + +matchlen_match1_repeat_extend_encodeSnappyBlockAsm12B: + MOVBU (R8)(R10), R16 + BFI $0, R16, $8, R9 + ADD R10, R5, R15 + MOVBU (R15), R15 + AND $0xff, R9, R16 + CMP R16, R15 + BNE repeat_extend_forward_end_encodeSnappyBlockAsm12B + ADD $1, R10, R10 + MOVWU R10, R10 + +repeat_extend_forward_end_encodeSnappyBlockAsm12B: + ADDW R10, R2, R2 + MOVWU R2, R5 + SUBW R6, R5, R5 + MOVWU 24(RSP), R6 + + // emitCopy +two_byte_offset_repeat_as_copy_encodeSnappyBlockAsm12B: + CMPW $0x40, R5 + BLS two_byte_offset_short_repeat_as_copy_encodeSnappyBlockAsm12B + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R6, 1(R1) + SUB $60, R5, R5 + MOVWU R5, R5 + ADD $0x03, R1, R1 + JMP two_byte_offset_repeat_as_copy_encodeSnappyBlockAsm12B + +two_byte_offset_short_repeat_as_copy_encodeSnappyBlockAsm12B: + MOVWU R5, R7 + LSLW $0x02, R7, R7 + CMPW $0x0c, R5 + BHS emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm12B + CMPW $0x00000800, R6 + BHS emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm12B + SUB $15, R7, R7 + MOVWU R7, R7 + MOVB R6, 1(R1) + LSRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R7, R7 + MOVB R7, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeSnappyBlockAsm12B + +emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm12B: + SUB $2, R7, R7 + MOVWU R7, R7 + MOVB R7, (R1) + MOVH R6, 1(R1) + ADD $0x03, R1, R1 + +repeat_end_emit_encodeSnappyBlockAsm12B: + MOVW R2, 20(RSP) + JMP search_loop_encodeSnappyBlockAsm12B + +no_repeat_found_encodeSnappyBlockAsm12B: + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate_match_encodeSnappyBlockAsm12B + LSR $0x08, R6, R6 + MOVWU (R0)(R9<<2), R5 + ADD $2, R2, R8 + MOVWU R8, R8 + MOVWU (R3)(R7), R16 + CMPW R6, R16 + BEQ candidate2_match_encodeSnappyBlockAsm12B + MOVW R8, (R0)(R9<<2) + LSR $0x08, R6, R6 + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate3_match_encodeSnappyBlockAsm12B + MOVWU 28(RSP), R2 + JMP search_loop_encodeSnappyBlockAsm12B + +candidate3_match_encodeSnappyBlockAsm12B: + ADDW $0x02, R2, R2 + JMP candidate_match_encodeSnappyBlockAsm12B + +candidate2_match_encodeSnappyBlockAsm12B: + MOVW R8, (R0)(R9<<2) + ADDW $1, R2, R2 + MOVWU R7, R5 + +candidate_match_encodeSnappyBlockAsm12B: + MOVWU 20(RSP), R6 + TSTW R5, R5 + BEQ match_extend_back_end_encodeSnappyBlockAsm12B + +match_extend_back_loop_encodeSnappyBlockAsm12B: + CMPW R6, R2 + BLS match_extend_back_end_encodeSnappyBlockAsm12B + ADD R5, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R7 + ADD R2, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + AND $0xff, R8, R16 + AND $0xff, R7, R15 + CMP R16, R15 + BNE match_extend_back_end_encodeSnappyBlockAsm12B + SUB $1, R2, R2 + MOVWU R2, R2 + SUBSW $1, R5, R5 + BEQ match_extend_back_end_encodeSnappyBlockAsm12B + JMP match_extend_back_loop_encodeSnappyBlockAsm12B + +match_extend_back_end_encodeSnappyBlockAsm12B: + MOVWU R2, R6 + MOVWU 20(RSP), R16 + SUBW R16, R6, R6 + ADD R6, R1, R6 + ADD $3, R6, R6 + MOVD 8(RSP), R16 + CMP R16, R6 + BLO match_dst_size_check_encodeSnappyBlockAsm12B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_dst_size_check_encodeSnappyBlockAsm12B: + MOVWU R2, R6 + MOVWU 20(RSP), R7 + CMPW R6, R7 + BEQ emit_literal_done_match_emit_encodeSnappyBlockAsm12B + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R7, R3, R6 + SUBW R7, R8, R8 + SUB $1, R8, R7 + MOVWU R7, R7 + CMPW $0x3c, R7 + BLO one_byte_match_emit_encodeSnappyBlockAsm12B + CMPW $0x00000100, R7 + BLO two_bytes_match_emit_encodeSnappyBlockAsm12B + BLO three_bytes_match_emit_encodeSnappyBlockAsm12B + +three_bytes_match_emit_encodeSnappyBlockAsm12B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R7, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_match_emit_encodeSnappyBlockAsm12B + +two_bytes_match_emit_encodeSnappyBlockAsm12B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R7, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R7 + BLO memmove_match_emit_encodeSnappyBlockAsm12B + JMP memmove_long_match_emit_encodeSnappyBlockAsm12B + +one_byte_match_emit_encodeSnappyBlockAsm12B: + LSLW $0x02, R7, R16 + BFI $0, R16, $8, R7 + MOVB R7, (R1) + ADD $0x01, R1, R1 + +memmove_match_emit_encodeSnappyBlockAsm12B: + ADD R8, R1, R7 + + // genMemMoveShort + CMP $0x08, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBlockAsm12B_memmove_move_8 + CMP $0x10, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBlockAsm12B_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBlockAsm12B_memmove_move_17through32 + JMP emit_lit_memmove_match_emit_encodeSnappyBlockAsm12B_memmove_move_33through64 + +emit_lit_memmove_match_emit_encodeSnappyBlockAsm12B_memmove_move_8: + MOVD (R6), R9 + MOVD R9, (R1) + JMP memmove_end_copy_match_emit_encodeSnappyBlockAsm12B + +emit_lit_memmove_match_emit_encodeSnappyBlockAsm12B_memmove_move_8through16: + MOVD (R6), R9 + ADD R8, R6, R15 + MOVD -8(R15), R6 + MOVD R9, (R1) + ADD R8, R1, R15 + MOVD R6, -8(R15) + JMP memmove_end_copy_match_emit_encodeSnappyBlockAsm12B + +emit_lit_memmove_match_emit_encodeSnappyBlockAsm12B_memmove_move_17through32: + FMOVQ (R6), F0 + ADD R8, R6, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_match_emit_encodeSnappyBlockAsm12B + +emit_lit_memmove_match_emit_encodeSnappyBlockAsm12B_memmove_move_33through64: + FMOVQ (R6), F0 + FMOVQ 16(R6), F1 + ADD R8, R6, R15 + FMOVQ -32(R15), F2 + ADD R8, R6, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_match_emit_encodeSnappyBlockAsm12B: + MOVD R7, R1 + JMP emit_literal_done_match_emit_encodeSnappyBlockAsm12B + +memmove_long_match_emit_encodeSnappyBlockAsm12B: + ADD R8, R1, R7 + + // genMemMoveLong + MOVD R6, R9 + MOVD R1, R10 + MOVD R8, R11 + +emit_lit_memmove_long_match_emit_encodeSnappyBlockAsm12Blarge_big_loop_back: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + FMOVQ F0, (R10) + FMOVQ F1, 16(R10) + ADD $0x20, R9, R9 + ADD $0x20, R10, R10 + SUB $0x20, R11, R11 + CMP $0x20, R11 + BHS emit_lit_memmove_long_match_emit_encodeSnappyBlockAsm12Blarge_big_loop_back + ADD R8, R6, R15 + FMOVQ -32(R15), F0 + ADD R8, R6, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R7, R1 + +emit_literal_done_match_emit_encodeSnappyBlockAsm12B: +match_nolit_loop_encodeSnappyBlockAsm12B: + MOVWU R2, R6 + SUBW R5, R6, R6 + MOVW R6, 24(RSP) + ADDW $0x04, R2, R2 + ADDW $0x04, R5, R5 + MOVD src_len+32(FP), R6 + SUBW R2, R6, R6 + ADD R2, R3, R7 + ADD R5, R3, R5 + + // matchLen + MOVD $0, R9 + +matchlen_loopback_16_match_nolit_encodeSnappyBlockAsm12B: + CMPW $0x10, R6 + BLO matchlen_match8_match_nolit_encodeSnappyBlockAsm12B + MOVD (R7)(R9), R8 + ADD R9, R7, R15 + MOVD 8(R15), R10 + MOVD (R5)(R9), R16 + EOR R16, R8, R8 + TST R8, R8 + BNE matchlen_bsf_8_match_nolit_encodeSnappyBlockAsm12B + ADD R9, R5, R15 + MOVD 8(R15), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_16match_nolit_encodeSnappyBlockAsm12B + SUB $16, R6, R6 + MOVWU R6, R6 + ADD $16, R9, R9 + MOVWU R9, R9 + JMP matchlen_loopback_16_match_nolit_encodeSnappyBlockAsm12B + +matchlen_bsf_16match_nolit_encodeSnappyBlockAsm12B: + RBIT R10, R10 + CLZ R10, R10 + ASR $0x03, R10, R10 + ADD R10, R9, R9 + ADD $8, R9, R9 + MOVWU R9, R9 + JMP match_nolit_end_encodeSnappyBlockAsm12B + +matchlen_match8_match_nolit_encodeSnappyBlockAsm12B: + CMPW $0x08, R6 + BLO matchlen_match4_match_nolit_encodeSnappyBlockAsm12B + MOVD (R7)(R9), R8 + MOVD (R5)(R9), R16 + EOR R16, R8, R8 + TST R8, R8 + BNE matchlen_bsf_8_match_nolit_encodeSnappyBlockAsm12B + SUB $8, R6, R6 + MOVWU R6, R6 + ADD $8, R9, R9 + MOVWU R9, R9 + JMP matchlen_match4_match_nolit_encodeSnappyBlockAsm12B + +matchlen_bsf_8_match_nolit_encodeSnappyBlockAsm12B: + RBIT R8, R8 + CLZ R8, R8 + ASR $0x03, R8, R8 + ADD R8, R9, R9 + MOVWU R9, R9 + JMP match_nolit_end_encodeSnappyBlockAsm12B + +matchlen_match4_match_nolit_encodeSnappyBlockAsm12B: + CMPW $0x04, R6 + BLO matchlen_match2_match_nolit_encodeSnappyBlockAsm12B + MOVWU (R7)(R9), R8 + MOVWU (R5)(R9), R16 + CMPW R8, R16 + BNE matchlen_match2_match_nolit_encodeSnappyBlockAsm12B + SUB $4, R6, R6 + MOVWU R6, R6 + ADD $4, R9, R9 + MOVWU R9, R9 + +matchlen_match2_match_nolit_encodeSnappyBlockAsm12B: + CMPW $0x01, R6 + BEQ matchlen_match1_match_nolit_encodeSnappyBlockAsm12B + BLO match_nolit_end_encodeSnappyBlockAsm12B + MOVHU (R7)(R9), R16 + BFI $0, R16, $16, R8 + ADD R9, R5, R15 + MOVHU (R15), R15 + AND $0xffff, R8, R16 + CMP R16, R15 + BNE matchlen_match1_match_nolit_encodeSnappyBlockAsm12B + ADD $2, R9, R9 + MOVWU R9, R9 + SUBSW $0x02, R6, R6 + BEQ match_nolit_end_encodeSnappyBlockAsm12B + +matchlen_match1_match_nolit_encodeSnappyBlockAsm12B: + MOVBU (R7)(R9), R16 + BFI $0, R16, $8, R8 + ADD R9, R5, R15 + MOVBU (R15), R15 + AND $0xff, R8, R16 + CMP R16, R15 + BNE match_nolit_end_encodeSnappyBlockAsm12B + ADD $1, R9, R9 + MOVWU R9, R9 + +match_nolit_end_encodeSnappyBlockAsm12B: + ADDW R9, R2, R2 + MOVWU 24(RSP), R5 + ADDW $0x04, R9, R9 + MOVW R2, 20(RSP) + + // emitCopy +two_byte_offset_match_nolit_encodeSnappyBlockAsm12B: + CMPW $0x40, R9 + BLS two_byte_offset_short_match_nolit_encodeSnappyBlockAsm12B + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + SUB $60, R9, R9 + MOVWU R9, R9 + ADD $0x03, R1, R1 + JMP two_byte_offset_match_nolit_encodeSnappyBlockAsm12B + +two_byte_offset_short_match_nolit_encodeSnappyBlockAsm12B: + MOVWU R9, R6 + LSLW $0x02, R6, R6 + CMPW $0x0c, R9 + BHS emit_copy_three_match_nolit_encodeSnappyBlockAsm12B + CMPW $0x00000800, R5 + BHS emit_copy_three_match_nolit_encodeSnappyBlockAsm12B + SUB $15, R6, R6 + MOVWU R6, R6 + MOVB R5, 1(R1) + LSRW $0x08, R5, R5 + LSLW $0x05, R5, R5 + ORRW R5, R6, R6 + MOVB R6, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeSnappyBlockAsm12B + +emit_copy_three_match_nolit_encodeSnappyBlockAsm12B: + SUB $2, R6, R6 + MOVWU R6, R6 + MOVB R6, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + +match_nolit_emitcopy_end_encodeSnappyBlockAsm12B: + MOVWU 16(RSP), R16 + CMPW R16, R2 + BHS emit_remainder_encodeSnappyBlockAsm12B + ADD R2, R3, R15 + MOVD -2(R15), R6 + MOVD 8(RSP), R16 + CMP R16, R1 + BLO match_nolit_dst_ok_encodeSnappyBlockAsm12B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_nolit_dst_ok_encodeSnappyBlockAsm12B: + MOVD $0x000000cf1bbcdcbb, R8 + MOVD R6, R7 + LSR $0x10, R6, R6 + MOVD R6, R5 + LSL $0x18, R7, R7 + MUL R8, R7, R7 + LSR $0x34, R7, R7 + LSL $0x18, R5, R5 + MUL R8, R5, R5 + LSR $0x34, R5, R5 + SUB $2, R2, R8 + MOVWU R8, R8 + ADD R5<<2, R0, R9 + MOVWU (R9), R5 + MOVW R8, (R0)(R7<<2) + MOVW R2, (R9) + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ match_nolit_loop_encodeSnappyBlockAsm12B + ADDW $1, R2, R2 + JMP search_loop_encodeSnappyBlockAsm12B + +emit_remainder_encodeSnappyBlockAsm12B: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R16 + SUBW R16, R0, R0 + ADD R0, R1, R0 + ADD $3, R0, R0 + MOVD 8(RSP), R16 + CMP R16, R0 + BLO emit_remainder_ok_encodeSnappyBlockAsm12B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +emit_remainder_ok_encodeSnappyBlockAsm12B: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R2 + CMPW R0, R2 + BEQ emit_literal_done_emit_remainder_encodeSnappyBlockAsm12B + MOVWU R0, R5 + MOVW R0, 20(RSP) + ADD R2, R3, R0 + SUBW R2, R5, R5 + SUB $1, R5, R2 + MOVWU R2, R2 + CMPW $0x3c, R2 + BLO one_byte_emit_remainder_encodeSnappyBlockAsm12B + CMPW $0x00000100, R2 + BLO two_bytes_emit_remainder_encodeSnappyBlockAsm12B + BLO three_bytes_emit_remainder_encodeSnappyBlockAsm12B + +three_bytes_emit_remainder_encodeSnappyBlockAsm12B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R2, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_emit_remainder_encodeSnappyBlockAsm12B + +two_bytes_emit_remainder_encodeSnappyBlockAsm12B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R2, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R2 + BLO memmove_emit_remainder_encodeSnappyBlockAsm12B + JMP memmove_long_emit_remainder_encodeSnappyBlockAsm12B + +one_byte_emit_remainder_encodeSnappyBlockAsm12B: + LSLW $0x02, R2, R16 + BFI $0, R16, $8, R2 + MOVB R2, (R1) + ADD $0x01, R1, R1 + +memmove_emit_remainder_encodeSnappyBlockAsm12B: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveShort + CMP $0x03, R3 + BLO emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm12B_memmove_move_1or2 + BEQ emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm12B_memmove_move_3 + CMP $0x08, R3 + BLO emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm12B_memmove_move_4through7 + CMP $0x10, R3 + BLS emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm12B_memmove_move_8through16 + CMP $0x20, R3 + BLS emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm12B_memmove_move_17through32 + JMP emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm12B_memmove_move_33through64 + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm12B_memmove_move_1or2: + MOVBU (R0), R16 + BFI $0, R16, $8, R5 + ADD R3, R0, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R0 + MOVB R5, (R1) + ADD R3, R1, R15 + MOVB R0, -1(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm12B + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm12B_memmove_move_3: + MOVHU (R0), R16 + BFI $0, R16, $16, R5 + MOVBU 2(R0), R16 + BFI $0, R16, $8, R0 + MOVH R5, (R1) + MOVB R0, 2(R1) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm12B + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm12B_memmove_move_4through7: + MOVWU (R0), R5 + ADD R3, R0, R15 + MOVWU -4(R15), R0 + MOVW R5, (R1) + ADD R3, R1, R15 + MOVW R0, -4(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm12B + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm12B_memmove_move_8through16: + MOVD (R0), R5 + ADD R3, R0, R15 + MOVD -8(R15), R0 + MOVD R5, (R1) + ADD R3, R1, R15 + MOVD R0, -8(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm12B + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm12B_memmove_move_17through32: + FMOVQ (R0), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm12B + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm12B_memmove_move_33through64: + FMOVQ (R0), F0 + FMOVQ 16(R0), F1 + ADD R3, R0, R15 + FMOVQ -32(R15), F2 + ADD R3, R0, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R3, R1, R15 + FMOVQ F2, -32(R15) + ADD R3, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_emit_remainder_encodeSnappyBlockAsm12B: + MOVD R2, R1 + JMP emit_literal_done_emit_remainder_encodeSnappyBlockAsm12B + +memmove_long_emit_remainder_encodeSnappyBlockAsm12B: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveLong + MOVD R0, R5 + MOVD R1, R6 + MOVD R3, R7 + +emit_lit_memmove_long_emit_remainder_encodeSnappyBlockAsm12Blarge_big_loop_back: + FMOVQ (R5), F0 + FMOVQ 16(R5), F1 + FMOVQ F0, (R6) + FMOVQ F1, 16(R6) + ADD $0x20, R5, R5 + ADD $0x20, R6, R6 + SUB $0x20, R7, R7 + CMP $0x20, R7 + BHS emit_lit_memmove_long_emit_remainder_encodeSnappyBlockAsm12Blarge_big_loop_back + ADD R3, R0, R15 + FMOVQ -32(R15), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + ADD R3, R1, R15 + FMOVQ F0, -32(R15) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + MOVD R2, R1 + +emit_literal_done_emit_remainder_encodeSnappyBlockAsm12B: + MOVD dst_base+0(FP), R0 + SUB R0, R1, R1 + MOVD R1, ret+56(FP) + RET + +// func encodeSnappyBlockAsm10B(dst []byte, src []byte, tmp *[4096]byte) int +// Requires: BMI, SSE2 +TEXT ·encodeSnappyBlockAsm10B(SB), $24-64 + MOVD tmp+48(FP), R0 + MOVD dst_base+0(FP), R1 + MOVD $0x00000020, R2 + MOVD R0, R3 + VEOR V0.B16, V0.B16, V0.B16 + +zero_loop_encodeSnappyBlockAsm10B: + FMOVQ F0, (R3) + FMOVQ F0, 16(R3) + FMOVQ F0, 32(R3) + FMOVQ F0, 48(R3) + FMOVQ F0, 64(R3) + FMOVQ F0, 80(R3) + FMOVQ F0, 96(R3) + FMOVQ F0, 112(R3) + ADD $0x80, R3, R3 + SUBS $1, R2, R2 + BNE zero_loop_encodeSnappyBlockAsm10B + MOVD $0x00000000, R16 + MOVW R16, 20(RSP) + MOVD src_len+32(FP), R2 + SUB $9, R2, R3 + SUB $8, R2, R5 + MOVW R5, 16(RSP) + LSR $0x05, R2, R2 + SUBW R2, R3, R3 + ADD R3, R1, R3 + MOVD R3, 8(RSP) + MOVD $0x00000001, R2 + MOVW R2, 24(RSP) + MOVD src_base+24(FP), R3 + +search_loop_encodeSnappyBlockAsm10B: + MOVWU R2, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + LSRW $0x05, R5, R5 + ADD R5, R2, R5 + ADD $4, R5, R5 + MOVWU R5, R5 + MOVWU 16(RSP), R16 + CMPW R16, R5 + BHS emit_remainder_encodeSnappyBlockAsm10B + MOVD (R3)(R2), R6 + MOVW R5, 28(RSP) + MOVD $0x9e3779b1, R8 + MOVD R6, R9 + MOVD R6, R10 + LSR $0x08, R10, R10 + LSL $0x20, R9, R9 + MUL R8, R9, R9 + LSR $0x36, R9, R9 + LSL $0x20, R10, R10 + MUL R8, R10, R10 + LSR $0x36, R10, R10 + MOVWU (R0)(R9<<2), R5 + MOVWU (R0)(R10<<2), R7 + MOVW R2, (R0)(R9<<2) + ADD $1, R2, R9 + MOVWU R9, R9 + MOVW R9, (R0)(R10<<2) + MOVD R6, R9 + LSR $0x10, R9, R9 + LSL $0x20, R9, R9 + MUL R8, R9, R9 + LSR $0x36, R9, R9 + MOVWU R2, R8 + MOVWU 24(RSP), R16 + SUBW R16, R8, R8 + ADD R8, R3, R15 + MOVWU 1(R15), R10 + MOVD R6, R8 + LSR $0x08, R8, R8 + CMPW R10, R8 + BNE no_repeat_found_encodeSnappyBlockAsm10B + ADD $1, R2, R6 + MOVWU R6, R6 + MOVWU 20(RSP), R5 + MOVWU R6, R7 + MOVWU 24(RSP), R16 + SUBSW R16, R7, R7 + BEQ repeat_extend_back_end_encodeSnappyBlockAsm10B + +repeat_extend_back_loop_encodeSnappyBlockAsm10B: + CMPW R5, R6 + BLS repeat_extend_back_end_encodeSnappyBlockAsm10B + ADD R7, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + ADD R6, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R9 + AND $0xff, R9, R16 + AND $0xff, R8, R15 + CMP R16, R15 + BNE repeat_extend_back_end_encodeSnappyBlockAsm10B + SUB $1, R6, R6 + MOVWU R6, R6 + SUBSW $1, R7, R7 + BNE repeat_extend_back_loop_encodeSnappyBlockAsm10B + +repeat_extend_back_end_encodeSnappyBlockAsm10B: + MOVWU R6, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + ADD R5, R1, R5 + ADD $3, R5, R5 + MOVD 8(RSP), R16 + CMP R16, R5 + BLO repeat_dst_size_check_encodeSnappyBlockAsm10B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +repeat_dst_size_check_encodeSnappyBlockAsm10B: + MOVWU 20(RSP), R5 + CMPW R6, R5 + BEQ emit_literal_done_repeat_emit_encodeSnappyBlockAsm10B + MOVWU R6, R7 + MOVW R6, 20(RSP) + ADD R5, R3, R8 + SUBW R5, R7, R7 + SUB $1, R7, R5 + MOVWU R5, R5 + CMPW $0x3c, R5 + BLO one_byte_repeat_emit_encodeSnappyBlockAsm10B + CMPW $0x00000100, R5 + BLO two_bytes_repeat_emit_encodeSnappyBlockAsm10B + BLO three_bytes_repeat_emit_encodeSnappyBlockAsm10B + +three_bytes_repeat_emit_encodeSnappyBlockAsm10B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_repeat_emit_encodeSnappyBlockAsm10B + +two_bytes_repeat_emit_encodeSnappyBlockAsm10B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R5, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R5 + BLO memmove_repeat_emit_encodeSnappyBlockAsm10B + JMP memmove_long_repeat_emit_encodeSnappyBlockAsm10B + +one_byte_repeat_emit_encodeSnappyBlockAsm10B: + LSLW $0x02, R5, R16 + BFI $0, R16, $8, R5 + MOVB R5, (R1) + ADD $0x01, R1, R1 + +memmove_repeat_emit_encodeSnappyBlockAsm10B: + ADD R7, R1, R5 + + // genMemMoveShort + CMP $0x08, R7 + BLS emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm10B_memmove_move_8 + CMP $0x10, R7 + BLS emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm10B_memmove_move_8through16 + CMP $0x20, R7 + BLS emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm10B_memmove_move_17through32 + JMP emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm10B_memmove_move_33through64 + +emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm10B_memmove_move_8: + MOVD (R8), R9 + MOVD R9, (R1) + JMP memmove_end_copy_repeat_emit_encodeSnappyBlockAsm10B + +emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm10B_memmove_move_8through16: + MOVD (R8), R9 + ADD R7, R8, R15 + MOVD -8(R15), R8 + MOVD R9, (R1) + ADD R7, R1, R15 + MOVD R8, -8(R15) + JMP memmove_end_copy_repeat_emit_encodeSnappyBlockAsm10B + +emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm10B_memmove_move_17through32: + FMOVQ (R8), F0 + ADD R7, R8, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R7, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_repeat_emit_encodeSnappyBlockAsm10B + +emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm10B_memmove_move_33through64: + FMOVQ (R8), F0 + FMOVQ 16(R8), F1 + ADD R7, R8, R15 + FMOVQ -32(R15), F2 + ADD R7, R8, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R7, R1, R15 + FMOVQ F2, -32(R15) + ADD R7, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_repeat_emit_encodeSnappyBlockAsm10B: + MOVD R5, R1 + JMP emit_literal_done_repeat_emit_encodeSnappyBlockAsm10B + +memmove_long_repeat_emit_encodeSnappyBlockAsm10B: + ADD R7, R1, R5 + + // genMemMoveLong + MOVD R8, R9 + MOVD R1, R10 + MOVD R7, R11 + +emit_lit_memmove_long_repeat_emit_encodeSnappyBlockAsm10Blarge_big_loop_back: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + FMOVQ F0, (R10) + FMOVQ F1, 16(R10) + ADD $0x20, R9, R9 + ADD $0x20, R10, R10 + SUB $0x20, R11, R11 + CMP $0x20, R11 + BHS emit_lit_memmove_long_repeat_emit_encodeSnappyBlockAsm10Blarge_big_loop_back + ADD R7, R8, R15 + FMOVQ -32(R15), F0 + ADD R7, R8, R15 + FMOVQ -16(R15), F1 + ADD R7, R1, R15 + FMOVQ F0, -32(R15) + ADD R7, R1, R15 + FMOVQ F1, -16(R15) + MOVD R5, R1 + +emit_literal_done_repeat_emit_encodeSnappyBlockAsm10B: + ADDW $0x05, R2, R2 + MOVWU R2, R5 + MOVWU 24(RSP), R16 + SUBW R16, R5, R5 + MOVD src_len+32(FP), R7 + SUBW R2, R7, R7 + ADD R2, R3, R8 + ADD R5, R3, R5 + + // matchLen + MOVD $0, R10 + +matchlen_loopback_16_repeat_extend_encodeSnappyBlockAsm10B: + CMPW $0x10, R7 + BLO matchlen_match8_repeat_extend_encodeSnappyBlockAsm10B + MOVD (R8)(R10), R9 + ADD R10, R8, R15 + MOVD 8(R15), R11 + MOVD (R5)(R10), R16 + EOR R16, R9, R9 + TST R9, R9 + BNE matchlen_bsf_8_repeat_extend_encodeSnappyBlockAsm10B + ADD R10, R5, R15 + MOVD 8(R15), R16 + EOR R16, R11, R11 + TST R11, R11 + BNE matchlen_bsf_16repeat_extend_encodeSnappyBlockAsm10B + SUB $16, R7, R7 + MOVWU R7, R7 + ADD $16, R10, R10 + MOVWU R10, R10 + JMP matchlen_loopback_16_repeat_extend_encodeSnappyBlockAsm10B + +matchlen_bsf_16repeat_extend_encodeSnappyBlockAsm10B: + RBIT R11, R11 + CLZ R11, R11 + ASR $0x03, R11, R11 + ADD R11, R10, R10 + ADD $8, R10, R10 + MOVWU R10, R10 + JMP repeat_extend_forward_end_encodeSnappyBlockAsm10B + +matchlen_match8_repeat_extend_encodeSnappyBlockAsm10B: + CMPW $0x08, R7 + BLO matchlen_match4_repeat_extend_encodeSnappyBlockAsm10B + MOVD (R8)(R10), R9 + MOVD (R5)(R10), R16 + EOR R16, R9, R9 + TST R9, R9 + BNE matchlen_bsf_8_repeat_extend_encodeSnappyBlockAsm10B + SUB $8, R7, R7 + MOVWU R7, R7 + ADD $8, R10, R10 + MOVWU R10, R10 + JMP matchlen_match4_repeat_extend_encodeSnappyBlockAsm10B + +matchlen_bsf_8_repeat_extend_encodeSnappyBlockAsm10B: + RBIT R9, R9 + CLZ R9, R9 + ASR $0x03, R9, R9 + ADD R9, R10, R10 + MOVWU R10, R10 + JMP repeat_extend_forward_end_encodeSnappyBlockAsm10B + +matchlen_match4_repeat_extend_encodeSnappyBlockAsm10B: + CMPW $0x04, R7 + BLO matchlen_match2_repeat_extend_encodeSnappyBlockAsm10B + MOVWU (R8)(R10), R9 + MOVWU (R5)(R10), R16 + CMPW R9, R16 + BNE matchlen_match2_repeat_extend_encodeSnappyBlockAsm10B + SUB $4, R7, R7 + MOVWU R7, R7 + ADD $4, R10, R10 + MOVWU R10, R10 + +matchlen_match2_repeat_extend_encodeSnappyBlockAsm10B: + CMPW $0x01, R7 + BEQ matchlen_match1_repeat_extend_encodeSnappyBlockAsm10B + BLO repeat_extend_forward_end_encodeSnappyBlockAsm10B + MOVHU (R8)(R10), R16 + BFI $0, R16, $16, R9 + ADD R10, R5, R15 + MOVHU (R15), R15 + AND $0xffff, R9, R16 + CMP R16, R15 + BNE matchlen_match1_repeat_extend_encodeSnappyBlockAsm10B + ADD $2, R10, R10 + MOVWU R10, R10 + SUBSW $0x02, R7, R7 + BEQ repeat_extend_forward_end_encodeSnappyBlockAsm10B + +matchlen_match1_repeat_extend_encodeSnappyBlockAsm10B: + MOVBU (R8)(R10), R16 + BFI $0, R16, $8, R9 + ADD R10, R5, R15 + MOVBU (R15), R15 + AND $0xff, R9, R16 + CMP R16, R15 + BNE repeat_extend_forward_end_encodeSnappyBlockAsm10B + ADD $1, R10, R10 + MOVWU R10, R10 + +repeat_extend_forward_end_encodeSnappyBlockAsm10B: + ADDW R10, R2, R2 + MOVWU R2, R5 + SUBW R6, R5, R5 + MOVWU 24(RSP), R6 + + // emitCopy +two_byte_offset_repeat_as_copy_encodeSnappyBlockAsm10B: + CMPW $0x40, R5 + BLS two_byte_offset_short_repeat_as_copy_encodeSnappyBlockAsm10B + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R6, 1(R1) + SUB $60, R5, R5 + MOVWU R5, R5 + ADD $0x03, R1, R1 + JMP two_byte_offset_repeat_as_copy_encodeSnappyBlockAsm10B + +two_byte_offset_short_repeat_as_copy_encodeSnappyBlockAsm10B: + MOVWU R5, R7 + LSLW $0x02, R7, R7 + CMPW $0x0c, R5 + BHS emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm10B + CMPW $0x00000800, R6 + BHS emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm10B + SUB $15, R7, R7 + MOVWU R7, R7 + MOVB R6, 1(R1) + LSRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R7, R7 + MOVB R7, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeSnappyBlockAsm10B + +emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm10B: + SUB $2, R7, R7 + MOVWU R7, R7 + MOVB R7, (R1) + MOVH R6, 1(R1) + ADD $0x03, R1, R1 + +repeat_end_emit_encodeSnappyBlockAsm10B: + MOVW R2, 20(RSP) + JMP search_loop_encodeSnappyBlockAsm10B + +no_repeat_found_encodeSnappyBlockAsm10B: + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate_match_encodeSnappyBlockAsm10B + LSR $0x08, R6, R6 + MOVWU (R0)(R9<<2), R5 + ADD $2, R2, R8 + MOVWU R8, R8 + MOVWU (R3)(R7), R16 + CMPW R6, R16 + BEQ candidate2_match_encodeSnappyBlockAsm10B + MOVW R8, (R0)(R9<<2) + LSR $0x08, R6, R6 + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate3_match_encodeSnappyBlockAsm10B + MOVWU 28(RSP), R2 + JMP search_loop_encodeSnappyBlockAsm10B + +candidate3_match_encodeSnappyBlockAsm10B: + ADDW $0x02, R2, R2 + JMP candidate_match_encodeSnappyBlockAsm10B + +candidate2_match_encodeSnappyBlockAsm10B: + MOVW R8, (R0)(R9<<2) + ADDW $1, R2, R2 + MOVWU R7, R5 + +candidate_match_encodeSnappyBlockAsm10B: + MOVWU 20(RSP), R6 + TSTW R5, R5 + BEQ match_extend_back_end_encodeSnappyBlockAsm10B + +match_extend_back_loop_encodeSnappyBlockAsm10B: + CMPW R6, R2 + BLS match_extend_back_end_encodeSnappyBlockAsm10B + ADD R5, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R7 + ADD R2, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + AND $0xff, R8, R16 + AND $0xff, R7, R15 + CMP R16, R15 + BNE match_extend_back_end_encodeSnappyBlockAsm10B + SUB $1, R2, R2 + MOVWU R2, R2 + SUBSW $1, R5, R5 + BEQ match_extend_back_end_encodeSnappyBlockAsm10B + JMP match_extend_back_loop_encodeSnappyBlockAsm10B + +match_extend_back_end_encodeSnappyBlockAsm10B: + MOVWU R2, R6 + MOVWU 20(RSP), R16 + SUBW R16, R6, R6 + ADD R6, R1, R6 + ADD $3, R6, R6 + MOVD 8(RSP), R16 + CMP R16, R6 + BLO match_dst_size_check_encodeSnappyBlockAsm10B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_dst_size_check_encodeSnappyBlockAsm10B: + MOVWU R2, R6 + MOVWU 20(RSP), R7 + CMPW R6, R7 + BEQ emit_literal_done_match_emit_encodeSnappyBlockAsm10B + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R7, R3, R6 + SUBW R7, R8, R8 + SUB $1, R8, R7 + MOVWU R7, R7 + CMPW $0x3c, R7 + BLO one_byte_match_emit_encodeSnappyBlockAsm10B + CMPW $0x00000100, R7 + BLO two_bytes_match_emit_encodeSnappyBlockAsm10B + BLO three_bytes_match_emit_encodeSnappyBlockAsm10B + +three_bytes_match_emit_encodeSnappyBlockAsm10B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R7, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_match_emit_encodeSnappyBlockAsm10B + +two_bytes_match_emit_encodeSnappyBlockAsm10B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R7, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R7 + BLO memmove_match_emit_encodeSnappyBlockAsm10B + JMP memmove_long_match_emit_encodeSnappyBlockAsm10B + +one_byte_match_emit_encodeSnappyBlockAsm10B: + LSLW $0x02, R7, R16 + BFI $0, R16, $8, R7 + MOVB R7, (R1) + ADD $0x01, R1, R1 + +memmove_match_emit_encodeSnappyBlockAsm10B: + ADD R8, R1, R7 + + // genMemMoveShort + CMP $0x08, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBlockAsm10B_memmove_move_8 + CMP $0x10, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBlockAsm10B_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBlockAsm10B_memmove_move_17through32 + JMP emit_lit_memmove_match_emit_encodeSnappyBlockAsm10B_memmove_move_33through64 + +emit_lit_memmove_match_emit_encodeSnappyBlockAsm10B_memmove_move_8: + MOVD (R6), R9 + MOVD R9, (R1) + JMP memmove_end_copy_match_emit_encodeSnappyBlockAsm10B + +emit_lit_memmove_match_emit_encodeSnappyBlockAsm10B_memmove_move_8through16: + MOVD (R6), R9 + ADD R8, R6, R15 + MOVD -8(R15), R6 + MOVD R9, (R1) + ADD R8, R1, R15 + MOVD R6, -8(R15) + JMP memmove_end_copy_match_emit_encodeSnappyBlockAsm10B + +emit_lit_memmove_match_emit_encodeSnappyBlockAsm10B_memmove_move_17through32: + FMOVQ (R6), F0 + ADD R8, R6, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_match_emit_encodeSnappyBlockAsm10B + +emit_lit_memmove_match_emit_encodeSnappyBlockAsm10B_memmove_move_33through64: + FMOVQ (R6), F0 + FMOVQ 16(R6), F1 + ADD R8, R6, R15 + FMOVQ -32(R15), F2 + ADD R8, R6, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_match_emit_encodeSnappyBlockAsm10B: + MOVD R7, R1 + JMP emit_literal_done_match_emit_encodeSnappyBlockAsm10B + +memmove_long_match_emit_encodeSnappyBlockAsm10B: + ADD R8, R1, R7 + + // genMemMoveLong + MOVD R6, R9 + MOVD R1, R10 + MOVD R8, R11 + +emit_lit_memmove_long_match_emit_encodeSnappyBlockAsm10Blarge_big_loop_back: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + FMOVQ F0, (R10) + FMOVQ F1, 16(R10) + ADD $0x20, R9, R9 + ADD $0x20, R10, R10 + SUB $0x20, R11, R11 + CMP $0x20, R11 + BHS emit_lit_memmove_long_match_emit_encodeSnappyBlockAsm10Blarge_big_loop_back + ADD R8, R6, R15 + FMOVQ -32(R15), F0 + ADD R8, R6, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R7, R1 + +emit_literal_done_match_emit_encodeSnappyBlockAsm10B: +match_nolit_loop_encodeSnappyBlockAsm10B: + MOVWU R2, R6 + SUBW R5, R6, R6 + MOVW R6, 24(RSP) + ADDW $0x04, R2, R2 + ADDW $0x04, R5, R5 + MOVD src_len+32(FP), R6 + SUBW R2, R6, R6 + ADD R2, R3, R7 + ADD R5, R3, R5 + + // matchLen + MOVD $0, R9 + +matchlen_loopback_16_match_nolit_encodeSnappyBlockAsm10B: + CMPW $0x10, R6 + BLO matchlen_match8_match_nolit_encodeSnappyBlockAsm10B + MOVD (R7)(R9), R8 + ADD R9, R7, R15 + MOVD 8(R15), R10 + MOVD (R5)(R9), R16 + EOR R16, R8, R8 + TST R8, R8 + BNE matchlen_bsf_8_match_nolit_encodeSnappyBlockAsm10B + ADD R9, R5, R15 + MOVD 8(R15), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_16match_nolit_encodeSnappyBlockAsm10B + SUB $16, R6, R6 + MOVWU R6, R6 + ADD $16, R9, R9 + MOVWU R9, R9 + JMP matchlen_loopback_16_match_nolit_encodeSnappyBlockAsm10B + +matchlen_bsf_16match_nolit_encodeSnappyBlockAsm10B: + RBIT R10, R10 + CLZ R10, R10 + ASR $0x03, R10, R10 + ADD R10, R9, R9 + ADD $8, R9, R9 + MOVWU R9, R9 + JMP match_nolit_end_encodeSnappyBlockAsm10B + +matchlen_match8_match_nolit_encodeSnappyBlockAsm10B: + CMPW $0x08, R6 + BLO matchlen_match4_match_nolit_encodeSnappyBlockAsm10B + MOVD (R7)(R9), R8 + MOVD (R5)(R9), R16 + EOR R16, R8, R8 + TST R8, R8 + BNE matchlen_bsf_8_match_nolit_encodeSnappyBlockAsm10B + SUB $8, R6, R6 + MOVWU R6, R6 + ADD $8, R9, R9 + MOVWU R9, R9 + JMP matchlen_match4_match_nolit_encodeSnappyBlockAsm10B + +matchlen_bsf_8_match_nolit_encodeSnappyBlockAsm10B: + RBIT R8, R8 + CLZ R8, R8 + ASR $0x03, R8, R8 + ADD R8, R9, R9 + MOVWU R9, R9 + JMP match_nolit_end_encodeSnappyBlockAsm10B + +matchlen_match4_match_nolit_encodeSnappyBlockAsm10B: + CMPW $0x04, R6 + BLO matchlen_match2_match_nolit_encodeSnappyBlockAsm10B + MOVWU (R7)(R9), R8 + MOVWU (R5)(R9), R16 + CMPW R8, R16 + BNE matchlen_match2_match_nolit_encodeSnappyBlockAsm10B + SUB $4, R6, R6 + MOVWU R6, R6 + ADD $4, R9, R9 + MOVWU R9, R9 + +matchlen_match2_match_nolit_encodeSnappyBlockAsm10B: + CMPW $0x01, R6 + BEQ matchlen_match1_match_nolit_encodeSnappyBlockAsm10B + BLO match_nolit_end_encodeSnappyBlockAsm10B + MOVHU (R7)(R9), R16 + BFI $0, R16, $16, R8 + ADD R9, R5, R15 + MOVHU (R15), R15 + AND $0xffff, R8, R16 + CMP R16, R15 + BNE matchlen_match1_match_nolit_encodeSnappyBlockAsm10B + ADD $2, R9, R9 + MOVWU R9, R9 + SUBSW $0x02, R6, R6 + BEQ match_nolit_end_encodeSnappyBlockAsm10B + +matchlen_match1_match_nolit_encodeSnappyBlockAsm10B: + MOVBU (R7)(R9), R16 + BFI $0, R16, $8, R8 + ADD R9, R5, R15 + MOVBU (R15), R15 + AND $0xff, R8, R16 + CMP R16, R15 + BNE match_nolit_end_encodeSnappyBlockAsm10B + ADD $1, R9, R9 + MOVWU R9, R9 + +match_nolit_end_encodeSnappyBlockAsm10B: + ADDW R9, R2, R2 + MOVWU 24(RSP), R5 + ADDW $0x04, R9, R9 + MOVW R2, 20(RSP) + + // emitCopy +two_byte_offset_match_nolit_encodeSnappyBlockAsm10B: + CMPW $0x40, R9 + BLS two_byte_offset_short_match_nolit_encodeSnappyBlockAsm10B + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + SUB $60, R9, R9 + MOVWU R9, R9 + ADD $0x03, R1, R1 + JMP two_byte_offset_match_nolit_encodeSnappyBlockAsm10B + +two_byte_offset_short_match_nolit_encodeSnappyBlockAsm10B: + MOVWU R9, R6 + LSLW $0x02, R6, R6 + CMPW $0x0c, R9 + BHS emit_copy_three_match_nolit_encodeSnappyBlockAsm10B + CMPW $0x00000800, R5 + BHS emit_copy_three_match_nolit_encodeSnappyBlockAsm10B + SUB $15, R6, R6 + MOVWU R6, R6 + MOVB R5, 1(R1) + LSRW $0x08, R5, R5 + LSLW $0x05, R5, R5 + ORRW R5, R6, R6 + MOVB R6, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeSnappyBlockAsm10B + +emit_copy_three_match_nolit_encodeSnappyBlockAsm10B: + SUB $2, R6, R6 + MOVWU R6, R6 + MOVB R6, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + +match_nolit_emitcopy_end_encodeSnappyBlockAsm10B: + MOVWU 16(RSP), R16 + CMPW R16, R2 + BHS emit_remainder_encodeSnappyBlockAsm10B + ADD R2, R3, R15 + MOVD -2(R15), R6 + MOVD 8(RSP), R16 + CMP R16, R1 + BLO match_nolit_dst_ok_encodeSnappyBlockAsm10B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_nolit_dst_ok_encodeSnappyBlockAsm10B: + MOVD $0x9e3779b1, R8 + MOVD R6, R7 + LSR $0x10, R6, R6 + MOVD R6, R5 + LSL $0x20, R7, R7 + MUL R8, R7, R7 + LSR $0x36, R7, R7 + LSL $0x20, R5, R5 + MUL R8, R5, R5 + LSR $0x36, R5, R5 + SUB $2, R2, R8 + MOVWU R8, R8 + ADD R5<<2, R0, R9 + MOVWU (R9), R5 + MOVW R8, (R0)(R7<<2) + MOVW R2, (R9) + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ match_nolit_loop_encodeSnappyBlockAsm10B + ADDW $1, R2, R2 + JMP search_loop_encodeSnappyBlockAsm10B + +emit_remainder_encodeSnappyBlockAsm10B: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R16 + SUBW R16, R0, R0 + ADD R0, R1, R0 + ADD $3, R0, R0 + MOVD 8(RSP), R16 + CMP R16, R0 + BLO emit_remainder_ok_encodeSnappyBlockAsm10B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +emit_remainder_ok_encodeSnappyBlockAsm10B: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R2 + CMPW R0, R2 + BEQ emit_literal_done_emit_remainder_encodeSnappyBlockAsm10B + MOVWU R0, R5 + MOVW R0, 20(RSP) + ADD R2, R3, R0 + SUBW R2, R5, R5 + SUB $1, R5, R2 + MOVWU R2, R2 + CMPW $0x3c, R2 + BLO one_byte_emit_remainder_encodeSnappyBlockAsm10B + CMPW $0x00000100, R2 + BLO two_bytes_emit_remainder_encodeSnappyBlockAsm10B + BLO three_bytes_emit_remainder_encodeSnappyBlockAsm10B + +three_bytes_emit_remainder_encodeSnappyBlockAsm10B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R2, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_emit_remainder_encodeSnappyBlockAsm10B + +two_bytes_emit_remainder_encodeSnappyBlockAsm10B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R2, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R2 + BLO memmove_emit_remainder_encodeSnappyBlockAsm10B + JMP memmove_long_emit_remainder_encodeSnappyBlockAsm10B + +one_byte_emit_remainder_encodeSnappyBlockAsm10B: + LSLW $0x02, R2, R16 + BFI $0, R16, $8, R2 + MOVB R2, (R1) + ADD $0x01, R1, R1 + +memmove_emit_remainder_encodeSnappyBlockAsm10B: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveShort + CMP $0x03, R3 + BLO emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm10B_memmove_move_1or2 + BEQ emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm10B_memmove_move_3 + CMP $0x08, R3 + BLO emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm10B_memmove_move_4through7 + CMP $0x10, R3 + BLS emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm10B_memmove_move_8through16 + CMP $0x20, R3 + BLS emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm10B_memmove_move_17through32 + JMP emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm10B_memmove_move_33through64 + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm10B_memmove_move_1or2: + MOVBU (R0), R16 + BFI $0, R16, $8, R5 + ADD R3, R0, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R0 + MOVB R5, (R1) + ADD R3, R1, R15 + MOVB R0, -1(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm10B + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm10B_memmove_move_3: + MOVHU (R0), R16 + BFI $0, R16, $16, R5 + MOVBU 2(R0), R16 + BFI $0, R16, $8, R0 + MOVH R5, (R1) + MOVB R0, 2(R1) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm10B + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm10B_memmove_move_4through7: + MOVWU (R0), R5 + ADD R3, R0, R15 + MOVWU -4(R15), R0 + MOVW R5, (R1) + ADD R3, R1, R15 + MOVW R0, -4(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm10B + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm10B_memmove_move_8through16: + MOVD (R0), R5 + ADD R3, R0, R15 + MOVD -8(R15), R0 + MOVD R5, (R1) + ADD R3, R1, R15 + MOVD R0, -8(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm10B + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm10B_memmove_move_17through32: + FMOVQ (R0), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm10B + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm10B_memmove_move_33through64: + FMOVQ (R0), F0 + FMOVQ 16(R0), F1 + ADD R3, R0, R15 + FMOVQ -32(R15), F2 + ADD R3, R0, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R3, R1, R15 + FMOVQ F2, -32(R15) + ADD R3, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_emit_remainder_encodeSnappyBlockAsm10B: + MOVD R2, R1 + JMP emit_literal_done_emit_remainder_encodeSnappyBlockAsm10B + +memmove_long_emit_remainder_encodeSnappyBlockAsm10B: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveLong + MOVD R0, R5 + MOVD R1, R6 + MOVD R3, R7 + +emit_lit_memmove_long_emit_remainder_encodeSnappyBlockAsm10Blarge_big_loop_back: + FMOVQ (R5), F0 + FMOVQ 16(R5), F1 + FMOVQ F0, (R6) + FMOVQ F1, 16(R6) + ADD $0x20, R5, R5 + ADD $0x20, R6, R6 + SUB $0x20, R7, R7 + CMP $0x20, R7 + BHS emit_lit_memmove_long_emit_remainder_encodeSnappyBlockAsm10Blarge_big_loop_back + ADD R3, R0, R15 + FMOVQ -32(R15), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + ADD R3, R1, R15 + FMOVQ F0, -32(R15) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + MOVD R2, R1 + +emit_literal_done_emit_remainder_encodeSnappyBlockAsm10B: + MOVD dst_base+0(FP), R0 + SUB R0, R1, R1 + MOVD R1, ret+56(FP) + RET + +// func encodeSnappyBlockAsm8B(dst []byte, src []byte, tmp *[1024]byte) int +// Requires: BMI, SSE2 +TEXT ·encodeSnappyBlockAsm8B(SB), $24-64 + MOVD tmp+48(FP), R0 + MOVD dst_base+0(FP), R1 + MOVD $0x00000008, R2 + MOVD R0, R3 + VEOR V0.B16, V0.B16, V0.B16 + +zero_loop_encodeSnappyBlockAsm8B: + FMOVQ F0, (R3) + FMOVQ F0, 16(R3) + FMOVQ F0, 32(R3) + FMOVQ F0, 48(R3) + FMOVQ F0, 64(R3) + FMOVQ F0, 80(R3) + FMOVQ F0, 96(R3) + FMOVQ F0, 112(R3) + ADD $0x80, R3, R3 + SUBS $1, R2, R2 + BNE zero_loop_encodeSnappyBlockAsm8B + MOVD $0x00000000, R16 + MOVW R16, 20(RSP) + MOVD src_len+32(FP), R2 + SUB $9, R2, R3 + SUB $8, R2, R5 + MOVW R5, 16(RSP) + LSR $0x05, R2, R2 + SUBW R2, R3, R3 + ADD R3, R1, R3 + MOVD R3, 8(RSP) + MOVD $0x00000001, R2 + MOVW R2, 24(RSP) + MOVD src_base+24(FP), R3 + +search_loop_encodeSnappyBlockAsm8B: + MOVWU R2, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + LSRW $0x04, R5, R5 + ADD R5, R2, R5 + ADD $4, R5, R5 + MOVWU R5, R5 + MOVWU 16(RSP), R16 + CMPW R16, R5 + BHS emit_remainder_encodeSnappyBlockAsm8B + MOVD (R3)(R2), R6 + MOVW R5, 28(RSP) + MOVD $0x9e3779b1, R8 + MOVD R6, R9 + MOVD R6, R10 + LSR $0x08, R10, R10 + LSL $0x20, R9, R9 + MUL R8, R9, R9 + LSR $0x38, R9, R9 + LSL $0x20, R10, R10 + MUL R8, R10, R10 + LSR $0x38, R10, R10 + MOVWU (R0)(R9<<2), R5 + MOVWU (R0)(R10<<2), R7 + MOVW R2, (R0)(R9<<2) + ADD $1, R2, R9 + MOVWU R9, R9 + MOVW R9, (R0)(R10<<2) + MOVD R6, R9 + LSR $0x10, R9, R9 + LSL $0x20, R9, R9 + MUL R8, R9, R9 + LSR $0x38, R9, R9 + MOVWU R2, R8 + MOVWU 24(RSP), R16 + SUBW R16, R8, R8 + ADD R8, R3, R15 + MOVWU 1(R15), R10 + MOVD R6, R8 + LSR $0x08, R8, R8 + CMPW R10, R8 + BNE no_repeat_found_encodeSnappyBlockAsm8B + ADD $1, R2, R6 + MOVWU R6, R6 + MOVWU 20(RSP), R5 + MOVWU R6, R7 + MOVWU 24(RSP), R16 + SUBSW R16, R7, R7 + BEQ repeat_extend_back_end_encodeSnappyBlockAsm8B + +repeat_extend_back_loop_encodeSnappyBlockAsm8B: + CMPW R5, R6 + BLS repeat_extend_back_end_encodeSnappyBlockAsm8B + ADD R7, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + ADD R6, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R9 + AND $0xff, R9, R16 + AND $0xff, R8, R15 + CMP R16, R15 + BNE repeat_extend_back_end_encodeSnappyBlockAsm8B + SUB $1, R6, R6 + MOVWU R6, R6 + SUBSW $1, R7, R7 + BNE repeat_extend_back_loop_encodeSnappyBlockAsm8B + +repeat_extend_back_end_encodeSnappyBlockAsm8B: + MOVWU R6, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + ADD R5, R1, R5 + ADD $3, R5, R5 + MOVD 8(RSP), R16 + CMP R16, R5 + BLO repeat_dst_size_check_encodeSnappyBlockAsm8B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +repeat_dst_size_check_encodeSnappyBlockAsm8B: + MOVWU 20(RSP), R5 + CMPW R6, R5 + BEQ emit_literal_done_repeat_emit_encodeSnappyBlockAsm8B + MOVWU R6, R7 + MOVW R6, 20(RSP) + ADD R5, R3, R8 + SUBW R5, R7, R7 + SUB $1, R7, R5 + MOVWU R5, R5 + CMPW $0x3c, R5 + BLO one_byte_repeat_emit_encodeSnappyBlockAsm8B + CMPW $0x00000100, R5 + BLO two_bytes_repeat_emit_encodeSnappyBlockAsm8B + BLO three_bytes_repeat_emit_encodeSnappyBlockAsm8B + +three_bytes_repeat_emit_encodeSnappyBlockAsm8B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_repeat_emit_encodeSnappyBlockAsm8B + +two_bytes_repeat_emit_encodeSnappyBlockAsm8B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R5, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R5 + BLO memmove_repeat_emit_encodeSnappyBlockAsm8B + JMP memmove_long_repeat_emit_encodeSnappyBlockAsm8B + +one_byte_repeat_emit_encodeSnappyBlockAsm8B: + LSLW $0x02, R5, R16 + BFI $0, R16, $8, R5 + MOVB R5, (R1) + ADD $0x01, R1, R1 + +memmove_repeat_emit_encodeSnappyBlockAsm8B: + ADD R7, R1, R5 + + // genMemMoveShort + CMP $0x08, R7 + BLS emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm8B_memmove_move_8 + CMP $0x10, R7 + BLS emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm8B_memmove_move_8through16 + CMP $0x20, R7 + BLS emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm8B_memmove_move_17through32 + JMP emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm8B_memmove_move_33through64 + +emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm8B_memmove_move_8: + MOVD (R8), R9 + MOVD R9, (R1) + JMP memmove_end_copy_repeat_emit_encodeSnappyBlockAsm8B + +emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm8B_memmove_move_8through16: + MOVD (R8), R9 + ADD R7, R8, R15 + MOVD -8(R15), R8 + MOVD R9, (R1) + ADD R7, R1, R15 + MOVD R8, -8(R15) + JMP memmove_end_copy_repeat_emit_encodeSnappyBlockAsm8B + +emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm8B_memmove_move_17through32: + FMOVQ (R8), F0 + ADD R7, R8, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R7, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_repeat_emit_encodeSnappyBlockAsm8B + +emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm8B_memmove_move_33through64: + FMOVQ (R8), F0 + FMOVQ 16(R8), F1 + ADD R7, R8, R15 + FMOVQ -32(R15), F2 + ADD R7, R8, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R7, R1, R15 + FMOVQ F2, -32(R15) + ADD R7, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_repeat_emit_encodeSnappyBlockAsm8B: + MOVD R5, R1 + JMP emit_literal_done_repeat_emit_encodeSnappyBlockAsm8B + +memmove_long_repeat_emit_encodeSnappyBlockAsm8B: + ADD R7, R1, R5 + + // genMemMoveLong + MOVD R8, R9 + MOVD R1, R10 + MOVD R7, R11 + +emit_lit_memmove_long_repeat_emit_encodeSnappyBlockAsm8Blarge_big_loop_back: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + FMOVQ F0, (R10) + FMOVQ F1, 16(R10) + ADD $0x20, R9, R9 + ADD $0x20, R10, R10 + SUB $0x20, R11, R11 + CMP $0x20, R11 + BHS emit_lit_memmove_long_repeat_emit_encodeSnappyBlockAsm8Blarge_big_loop_back + ADD R7, R8, R15 + FMOVQ -32(R15), F0 + ADD R7, R8, R15 + FMOVQ -16(R15), F1 + ADD R7, R1, R15 + FMOVQ F0, -32(R15) + ADD R7, R1, R15 + FMOVQ F1, -16(R15) + MOVD R5, R1 + +emit_literal_done_repeat_emit_encodeSnappyBlockAsm8B: + ADDW $0x05, R2, R2 + MOVWU R2, R5 + MOVWU 24(RSP), R16 + SUBW R16, R5, R5 + MOVD src_len+32(FP), R7 + SUBW R2, R7, R7 + ADD R2, R3, R8 + ADD R5, R3, R5 + + // matchLen + MOVD $0, R10 + +matchlen_loopback_16_repeat_extend_encodeSnappyBlockAsm8B: + CMPW $0x10, R7 + BLO matchlen_match8_repeat_extend_encodeSnappyBlockAsm8B + MOVD (R8)(R10), R9 + ADD R10, R8, R15 + MOVD 8(R15), R11 + MOVD (R5)(R10), R16 + EOR R16, R9, R9 + TST R9, R9 + BNE matchlen_bsf_8_repeat_extend_encodeSnappyBlockAsm8B + ADD R10, R5, R15 + MOVD 8(R15), R16 + EOR R16, R11, R11 + TST R11, R11 + BNE matchlen_bsf_16repeat_extend_encodeSnappyBlockAsm8B + SUB $16, R7, R7 + MOVWU R7, R7 + ADD $16, R10, R10 + MOVWU R10, R10 + JMP matchlen_loopback_16_repeat_extend_encodeSnappyBlockAsm8B + +matchlen_bsf_16repeat_extend_encodeSnappyBlockAsm8B: + RBIT R11, R11 + CLZ R11, R11 + ASR $0x03, R11, R11 + ADD R11, R10, R10 + ADD $8, R10, R10 + MOVWU R10, R10 + JMP repeat_extend_forward_end_encodeSnappyBlockAsm8B + +matchlen_match8_repeat_extend_encodeSnappyBlockAsm8B: + CMPW $0x08, R7 + BLO matchlen_match4_repeat_extend_encodeSnappyBlockAsm8B + MOVD (R8)(R10), R9 + MOVD (R5)(R10), R16 + EOR R16, R9, R9 + TST R9, R9 + BNE matchlen_bsf_8_repeat_extend_encodeSnappyBlockAsm8B + SUB $8, R7, R7 + MOVWU R7, R7 + ADD $8, R10, R10 + MOVWU R10, R10 + JMP matchlen_match4_repeat_extend_encodeSnappyBlockAsm8B + +matchlen_bsf_8_repeat_extend_encodeSnappyBlockAsm8B: + RBIT R9, R9 + CLZ R9, R9 + ASR $0x03, R9, R9 + ADD R9, R10, R10 + MOVWU R10, R10 + JMP repeat_extend_forward_end_encodeSnappyBlockAsm8B + +matchlen_match4_repeat_extend_encodeSnappyBlockAsm8B: + CMPW $0x04, R7 + BLO matchlen_match2_repeat_extend_encodeSnappyBlockAsm8B + MOVWU (R8)(R10), R9 + MOVWU (R5)(R10), R16 + CMPW R9, R16 + BNE matchlen_match2_repeat_extend_encodeSnappyBlockAsm8B + SUB $4, R7, R7 + MOVWU R7, R7 + ADD $4, R10, R10 + MOVWU R10, R10 + +matchlen_match2_repeat_extend_encodeSnappyBlockAsm8B: + CMPW $0x01, R7 + BEQ matchlen_match1_repeat_extend_encodeSnappyBlockAsm8B + BLO repeat_extend_forward_end_encodeSnappyBlockAsm8B + MOVHU (R8)(R10), R16 + BFI $0, R16, $16, R9 + ADD R10, R5, R15 + MOVHU (R15), R15 + AND $0xffff, R9, R16 + CMP R16, R15 + BNE matchlen_match1_repeat_extend_encodeSnappyBlockAsm8B + ADD $2, R10, R10 + MOVWU R10, R10 + SUBSW $0x02, R7, R7 + BEQ repeat_extend_forward_end_encodeSnappyBlockAsm8B + +matchlen_match1_repeat_extend_encodeSnappyBlockAsm8B: + MOVBU (R8)(R10), R16 + BFI $0, R16, $8, R9 + ADD R10, R5, R15 + MOVBU (R15), R15 + AND $0xff, R9, R16 + CMP R16, R15 + BNE repeat_extend_forward_end_encodeSnappyBlockAsm8B + ADD $1, R10, R10 + MOVWU R10, R10 + +repeat_extend_forward_end_encodeSnappyBlockAsm8B: + ADDW R10, R2, R2 + MOVWU R2, R5 + SUBW R6, R5, R5 + MOVWU 24(RSP), R6 + + // emitCopy +two_byte_offset_repeat_as_copy_encodeSnappyBlockAsm8B: + CMPW $0x40, R5 + BLS two_byte_offset_short_repeat_as_copy_encodeSnappyBlockAsm8B + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R6, 1(R1) + SUB $60, R5, R5 + MOVWU R5, R5 + ADD $0x03, R1, R1 + JMP two_byte_offset_repeat_as_copy_encodeSnappyBlockAsm8B + +two_byte_offset_short_repeat_as_copy_encodeSnappyBlockAsm8B: + MOVWU R5, R7 + LSLW $0x02, R7, R7 + CMPW $0x0c, R5 + BHS emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm8B + SUB $15, R7, R7 + MOVWU R7, R7 + MOVB R6, 1(R1) + LSRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R7, R7 + MOVB R7, (R1) + ADD $0x02, R1, R1 + JMP repeat_end_emit_encodeSnappyBlockAsm8B + +emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm8B: + SUB $2, R7, R7 + MOVWU R7, R7 + MOVB R7, (R1) + MOVH R6, 1(R1) + ADD $0x03, R1, R1 + +repeat_end_emit_encodeSnappyBlockAsm8B: + MOVW R2, 20(RSP) + JMP search_loop_encodeSnappyBlockAsm8B + +no_repeat_found_encodeSnappyBlockAsm8B: + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate_match_encodeSnappyBlockAsm8B + LSR $0x08, R6, R6 + MOVWU (R0)(R9<<2), R5 + ADD $2, R2, R8 + MOVWU R8, R8 + MOVWU (R3)(R7), R16 + CMPW R6, R16 + BEQ candidate2_match_encodeSnappyBlockAsm8B + MOVW R8, (R0)(R9<<2) + LSR $0x08, R6, R6 + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate3_match_encodeSnappyBlockAsm8B + MOVWU 28(RSP), R2 + JMP search_loop_encodeSnappyBlockAsm8B + +candidate3_match_encodeSnappyBlockAsm8B: + ADDW $0x02, R2, R2 + JMP candidate_match_encodeSnappyBlockAsm8B + +candidate2_match_encodeSnappyBlockAsm8B: + MOVW R8, (R0)(R9<<2) + ADDW $1, R2, R2 + MOVWU R7, R5 + +candidate_match_encodeSnappyBlockAsm8B: + MOVWU 20(RSP), R6 + TSTW R5, R5 + BEQ match_extend_back_end_encodeSnappyBlockAsm8B + +match_extend_back_loop_encodeSnappyBlockAsm8B: + CMPW R6, R2 + BLS match_extend_back_end_encodeSnappyBlockAsm8B + ADD R5, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R7 + ADD R2, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + AND $0xff, R8, R16 + AND $0xff, R7, R15 + CMP R16, R15 + BNE match_extend_back_end_encodeSnappyBlockAsm8B + SUB $1, R2, R2 + MOVWU R2, R2 + SUBSW $1, R5, R5 + BEQ match_extend_back_end_encodeSnappyBlockAsm8B + JMP match_extend_back_loop_encodeSnappyBlockAsm8B + +match_extend_back_end_encodeSnappyBlockAsm8B: + MOVWU R2, R6 + MOVWU 20(RSP), R16 + SUBW R16, R6, R6 + ADD R6, R1, R6 + ADD $3, R6, R6 + MOVD 8(RSP), R16 + CMP R16, R6 + BLO match_dst_size_check_encodeSnappyBlockAsm8B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_dst_size_check_encodeSnappyBlockAsm8B: + MOVWU R2, R6 + MOVWU 20(RSP), R7 + CMPW R6, R7 + BEQ emit_literal_done_match_emit_encodeSnappyBlockAsm8B + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R7, R3, R6 + SUBW R7, R8, R8 + SUB $1, R8, R7 + MOVWU R7, R7 + CMPW $0x3c, R7 + BLO one_byte_match_emit_encodeSnappyBlockAsm8B + CMPW $0x00000100, R7 + BLO two_bytes_match_emit_encodeSnappyBlockAsm8B + BLO three_bytes_match_emit_encodeSnappyBlockAsm8B + +three_bytes_match_emit_encodeSnappyBlockAsm8B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R7, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_match_emit_encodeSnappyBlockAsm8B + +two_bytes_match_emit_encodeSnappyBlockAsm8B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R7, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R7 + BLO memmove_match_emit_encodeSnappyBlockAsm8B + JMP memmove_long_match_emit_encodeSnappyBlockAsm8B + +one_byte_match_emit_encodeSnappyBlockAsm8B: + LSLW $0x02, R7, R16 + BFI $0, R16, $8, R7 + MOVB R7, (R1) + ADD $0x01, R1, R1 + +memmove_match_emit_encodeSnappyBlockAsm8B: + ADD R8, R1, R7 + + // genMemMoveShort + CMP $0x08, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBlockAsm8B_memmove_move_8 + CMP $0x10, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBlockAsm8B_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBlockAsm8B_memmove_move_17through32 + JMP emit_lit_memmove_match_emit_encodeSnappyBlockAsm8B_memmove_move_33through64 + +emit_lit_memmove_match_emit_encodeSnappyBlockAsm8B_memmove_move_8: + MOVD (R6), R9 + MOVD R9, (R1) + JMP memmove_end_copy_match_emit_encodeSnappyBlockAsm8B + +emit_lit_memmove_match_emit_encodeSnappyBlockAsm8B_memmove_move_8through16: + MOVD (R6), R9 + ADD R8, R6, R15 + MOVD -8(R15), R6 + MOVD R9, (R1) + ADD R8, R1, R15 + MOVD R6, -8(R15) + JMP memmove_end_copy_match_emit_encodeSnappyBlockAsm8B + +emit_lit_memmove_match_emit_encodeSnappyBlockAsm8B_memmove_move_17through32: + FMOVQ (R6), F0 + ADD R8, R6, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_match_emit_encodeSnappyBlockAsm8B + +emit_lit_memmove_match_emit_encodeSnappyBlockAsm8B_memmove_move_33through64: + FMOVQ (R6), F0 + FMOVQ 16(R6), F1 + ADD R8, R6, R15 + FMOVQ -32(R15), F2 + ADD R8, R6, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_match_emit_encodeSnappyBlockAsm8B: + MOVD R7, R1 + JMP emit_literal_done_match_emit_encodeSnappyBlockAsm8B + +memmove_long_match_emit_encodeSnappyBlockAsm8B: + ADD R8, R1, R7 + + // genMemMoveLong + MOVD R6, R9 + MOVD R1, R10 + MOVD R8, R11 + +emit_lit_memmove_long_match_emit_encodeSnappyBlockAsm8Blarge_big_loop_back: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + FMOVQ F0, (R10) + FMOVQ F1, 16(R10) + ADD $0x20, R9, R9 + ADD $0x20, R10, R10 + SUB $0x20, R11, R11 + CMP $0x20, R11 + BHS emit_lit_memmove_long_match_emit_encodeSnappyBlockAsm8Blarge_big_loop_back + ADD R8, R6, R15 + FMOVQ -32(R15), F0 + ADD R8, R6, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R7, R1 + +emit_literal_done_match_emit_encodeSnappyBlockAsm8B: +match_nolit_loop_encodeSnappyBlockAsm8B: + MOVWU R2, R6 + SUBW R5, R6, R6 + MOVW R6, 24(RSP) + ADDW $0x04, R2, R2 + ADDW $0x04, R5, R5 + MOVD src_len+32(FP), R6 + SUBW R2, R6, R6 + ADD R2, R3, R7 + ADD R5, R3, R5 + + // matchLen + MOVD $0, R9 + +matchlen_loopback_16_match_nolit_encodeSnappyBlockAsm8B: + CMPW $0x10, R6 + BLO matchlen_match8_match_nolit_encodeSnappyBlockAsm8B + MOVD (R7)(R9), R8 + ADD R9, R7, R15 + MOVD 8(R15), R10 + MOVD (R5)(R9), R16 + EOR R16, R8, R8 + TST R8, R8 + BNE matchlen_bsf_8_match_nolit_encodeSnappyBlockAsm8B + ADD R9, R5, R15 + MOVD 8(R15), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_16match_nolit_encodeSnappyBlockAsm8B + SUB $16, R6, R6 + MOVWU R6, R6 + ADD $16, R9, R9 + MOVWU R9, R9 + JMP matchlen_loopback_16_match_nolit_encodeSnappyBlockAsm8B + +matchlen_bsf_16match_nolit_encodeSnappyBlockAsm8B: + RBIT R10, R10 + CLZ R10, R10 + ASR $0x03, R10, R10 + ADD R10, R9, R9 + ADD $8, R9, R9 + MOVWU R9, R9 + JMP match_nolit_end_encodeSnappyBlockAsm8B + +matchlen_match8_match_nolit_encodeSnappyBlockAsm8B: + CMPW $0x08, R6 + BLO matchlen_match4_match_nolit_encodeSnappyBlockAsm8B + MOVD (R7)(R9), R8 + MOVD (R5)(R9), R16 + EOR R16, R8, R8 + TST R8, R8 + BNE matchlen_bsf_8_match_nolit_encodeSnappyBlockAsm8B + SUB $8, R6, R6 + MOVWU R6, R6 + ADD $8, R9, R9 + MOVWU R9, R9 + JMP matchlen_match4_match_nolit_encodeSnappyBlockAsm8B + +matchlen_bsf_8_match_nolit_encodeSnappyBlockAsm8B: + RBIT R8, R8 + CLZ R8, R8 + ASR $0x03, R8, R8 + ADD R8, R9, R9 + MOVWU R9, R9 + JMP match_nolit_end_encodeSnappyBlockAsm8B + +matchlen_match4_match_nolit_encodeSnappyBlockAsm8B: + CMPW $0x04, R6 + BLO matchlen_match2_match_nolit_encodeSnappyBlockAsm8B + MOVWU (R7)(R9), R8 + MOVWU (R5)(R9), R16 + CMPW R8, R16 + BNE matchlen_match2_match_nolit_encodeSnappyBlockAsm8B + SUB $4, R6, R6 + MOVWU R6, R6 + ADD $4, R9, R9 + MOVWU R9, R9 + +matchlen_match2_match_nolit_encodeSnappyBlockAsm8B: + CMPW $0x01, R6 + BEQ matchlen_match1_match_nolit_encodeSnappyBlockAsm8B + BLO match_nolit_end_encodeSnappyBlockAsm8B + MOVHU (R7)(R9), R16 + BFI $0, R16, $16, R8 + ADD R9, R5, R15 + MOVHU (R15), R15 + AND $0xffff, R8, R16 + CMP R16, R15 + BNE matchlen_match1_match_nolit_encodeSnappyBlockAsm8B + ADD $2, R9, R9 + MOVWU R9, R9 + SUBSW $0x02, R6, R6 + BEQ match_nolit_end_encodeSnappyBlockAsm8B + +matchlen_match1_match_nolit_encodeSnappyBlockAsm8B: + MOVBU (R7)(R9), R16 + BFI $0, R16, $8, R8 + ADD R9, R5, R15 + MOVBU (R15), R15 + AND $0xff, R8, R16 + CMP R16, R15 + BNE match_nolit_end_encodeSnappyBlockAsm8B + ADD $1, R9, R9 + MOVWU R9, R9 + +match_nolit_end_encodeSnappyBlockAsm8B: + ADDW R9, R2, R2 + MOVWU 24(RSP), R5 + ADDW $0x04, R9, R9 + MOVW R2, 20(RSP) + + // emitCopy +two_byte_offset_match_nolit_encodeSnappyBlockAsm8B: + CMPW $0x40, R9 + BLS two_byte_offset_short_match_nolit_encodeSnappyBlockAsm8B + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + SUB $60, R9, R9 + MOVWU R9, R9 + ADD $0x03, R1, R1 + JMP two_byte_offset_match_nolit_encodeSnappyBlockAsm8B + +two_byte_offset_short_match_nolit_encodeSnappyBlockAsm8B: + MOVWU R9, R6 + LSLW $0x02, R6, R6 + CMPW $0x0c, R9 + BHS emit_copy_three_match_nolit_encodeSnappyBlockAsm8B + SUB $15, R6, R6 + MOVWU R6, R6 + MOVB R5, 1(R1) + LSRW $0x08, R5, R5 + LSLW $0x05, R5, R5 + ORRW R5, R6, R6 + MOVB R6, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeSnappyBlockAsm8B + +emit_copy_three_match_nolit_encodeSnappyBlockAsm8B: + SUB $2, R6, R6 + MOVWU R6, R6 + MOVB R6, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + +match_nolit_emitcopy_end_encodeSnappyBlockAsm8B: + MOVWU 16(RSP), R16 + CMPW R16, R2 + BHS emit_remainder_encodeSnappyBlockAsm8B + ADD R2, R3, R15 + MOVD -2(R15), R6 + MOVD 8(RSP), R16 + CMP R16, R1 + BLO match_nolit_dst_ok_encodeSnappyBlockAsm8B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_nolit_dst_ok_encodeSnappyBlockAsm8B: + MOVD $0x9e3779b1, R8 + MOVD R6, R7 + LSR $0x10, R6, R6 + MOVD R6, R5 + LSL $0x20, R7, R7 + MUL R8, R7, R7 + LSR $0x38, R7, R7 + LSL $0x20, R5, R5 + MUL R8, R5, R5 + LSR $0x38, R5, R5 + SUB $2, R2, R8 + MOVWU R8, R8 + ADD R5<<2, R0, R9 + MOVWU (R9), R5 + MOVW R8, (R0)(R7<<2) + MOVW R2, (R9) + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ match_nolit_loop_encodeSnappyBlockAsm8B + ADDW $1, R2, R2 + JMP search_loop_encodeSnappyBlockAsm8B + +emit_remainder_encodeSnappyBlockAsm8B: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R16 + SUBW R16, R0, R0 + ADD R0, R1, R0 + ADD $3, R0, R0 + MOVD 8(RSP), R16 + CMP R16, R0 + BLO emit_remainder_ok_encodeSnappyBlockAsm8B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +emit_remainder_ok_encodeSnappyBlockAsm8B: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R2 + CMPW R0, R2 + BEQ emit_literal_done_emit_remainder_encodeSnappyBlockAsm8B + MOVWU R0, R5 + MOVW R0, 20(RSP) + ADD R2, R3, R0 + SUBW R2, R5, R5 + SUB $1, R5, R2 + MOVWU R2, R2 + CMPW $0x3c, R2 + BLO one_byte_emit_remainder_encodeSnappyBlockAsm8B + CMPW $0x00000100, R2 + BLO two_bytes_emit_remainder_encodeSnappyBlockAsm8B + BLO three_bytes_emit_remainder_encodeSnappyBlockAsm8B + +three_bytes_emit_remainder_encodeSnappyBlockAsm8B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R2, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_emit_remainder_encodeSnappyBlockAsm8B + +two_bytes_emit_remainder_encodeSnappyBlockAsm8B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R2, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R2 + BLO memmove_emit_remainder_encodeSnappyBlockAsm8B + JMP memmove_long_emit_remainder_encodeSnappyBlockAsm8B + +one_byte_emit_remainder_encodeSnappyBlockAsm8B: + LSLW $0x02, R2, R16 + BFI $0, R16, $8, R2 + MOVB R2, (R1) + ADD $0x01, R1, R1 + +memmove_emit_remainder_encodeSnappyBlockAsm8B: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveShort + CMP $0x03, R3 + BLO emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm8B_memmove_move_1or2 + BEQ emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm8B_memmove_move_3 + CMP $0x08, R3 + BLO emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm8B_memmove_move_4through7 + CMP $0x10, R3 + BLS emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm8B_memmove_move_8through16 + CMP $0x20, R3 + BLS emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm8B_memmove_move_17through32 + JMP emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm8B_memmove_move_33through64 + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm8B_memmove_move_1or2: + MOVBU (R0), R16 + BFI $0, R16, $8, R5 + ADD R3, R0, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R0 + MOVB R5, (R1) + ADD R3, R1, R15 + MOVB R0, -1(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm8B + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm8B_memmove_move_3: + MOVHU (R0), R16 + BFI $0, R16, $16, R5 + MOVBU 2(R0), R16 + BFI $0, R16, $8, R0 + MOVH R5, (R1) + MOVB R0, 2(R1) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm8B + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm8B_memmove_move_4through7: + MOVWU (R0), R5 + ADD R3, R0, R15 + MOVWU -4(R15), R0 + MOVW R5, (R1) + ADD R3, R1, R15 + MOVW R0, -4(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm8B + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm8B_memmove_move_8through16: + MOVD (R0), R5 + ADD R3, R0, R15 + MOVD -8(R15), R0 + MOVD R5, (R1) + ADD R3, R1, R15 + MOVD R0, -8(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm8B + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm8B_memmove_move_17through32: + FMOVQ (R0), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBlockAsm8B + +emit_lit_memmove_emit_remainder_encodeSnappyBlockAsm8B_memmove_move_33through64: + FMOVQ (R0), F0 + FMOVQ 16(R0), F1 + ADD R3, R0, R15 + FMOVQ -32(R15), F2 + ADD R3, R0, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R3, R1, R15 + FMOVQ F2, -32(R15) + ADD R3, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_emit_remainder_encodeSnappyBlockAsm8B: + MOVD R2, R1 + JMP emit_literal_done_emit_remainder_encodeSnappyBlockAsm8B + +memmove_long_emit_remainder_encodeSnappyBlockAsm8B: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveLong + MOVD R0, R5 + MOVD R1, R6 + MOVD R3, R7 + +emit_lit_memmove_long_emit_remainder_encodeSnappyBlockAsm8Blarge_big_loop_back: + FMOVQ (R5), F0 + FMOVQ 16(R5), F1 + FMOVQ F0, (R6) + FMOVQ F1, 16(R6) + ADD $0x20, R5, R5 + ADD $0x20, R6, R6 + SUB $0x20, R7, R7 + CMP $0x20, R7 + BHS emit_lit_memmove_long_emit_remainder_encodeSnappyBlockAsm8Blarge_big_loop_back + ADD R3, R0, R15 + FMOVQ -32(R15), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + ADD R3, R1, R15 + FMOVQ F0, -32(R15) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + MOVD R2, R1 + +emit_literal_done_emit_remainder_encodeSnappyBlockAsm8B: + MOVD dst_base+0(FP), R0 + SUB R0, R1, R1 + MOVD R1, ret+56(FP) + RET + +// func encodeSnappyBetterBlockAsm(dst []byte, src []byte, tmp *[589824]byte) int +// Requires: BMI, SSE2 +TEXT ·encodeSnappyBetterBlockAsm(SB), $24-64 + MOVD tmp+48(FP), R0 + MOVD dst_base+0(FP), R1 + MOVD $0x00001200, R2 + MOVD R0, R3 + VEOR V0.B16, V0.B16, V0.B16 + +zero_loop_encodeSnappyBetterBlockAsm: + FMOVQ F0, (R3) + FMOVQ F0, 16(R3) + FMOVQ F0, 32(R3) + FMOVQ F0, 48(R3) + FMOVQ F0, 64(R3) + FMOVQ F0, 80(R3) + FMOVQ F0, 96(R3) + FMOVQ F0, 112(R3) + ADD $0x80, R3, R3 + SUBS $1, R2, R2 + BNE zero_loop_encodeSnappyBetterBlockAsm + MOVD $0x00000000, R16 + MOVW R16, 20(RSP) + MOVD src_len+32(FP), R2 + SUB $9, R2, R3 + SUB $8, R2, R5 + MOVW R5, 16(RSP) + LSR $0x05, R2, R2 + SUBW R2, R3, R3 + ADD R3, R1, R3 + MOVD R3, 8(RSP) + MOVD $0x00000001, R2 + MOVD $0x00000000, R16 + MOVW R16, 24(RSP) + MOVD src_base+24(FP), R3 + +search_loop_encodeSnappyBetterBlockAsm: + MOVWU R2, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + LSRW $0x07, R5, R5 + CMPW $0x63, R5 + BLS check_maxskip_ok_encodeSnappyBetterBlockAsm + ADD $100, R2, R5 + MOVWU R5, R5 + JMP check_maxskip_cont_encodeSnappyBetterBlockAsm + +check_maxskip_ok_encodeSnappyBetterBlockAsm: + ADD R5, R2, R5 + ADD $1, R5, R5 + MOVWU R5, R5 + +check_maxskip_cont_encodeSnappyBetterBlockAsm: + MOVWU 16(RSP), R16 + CMPW R16, R5 + BHS emit_remainder_encodeSnappyBetterBlockAsm + MOVD (R3)(R2), R6 + MOVW R5, 28(RSP) + MOVD $0x00cf1bbcdcbfa563, R8 + MOVD $0x9e3779b1, R5 + MOVD R6, R9 + MOVD R6, R10 + LSL $0x08, R9, R9 + MUL R8, R9, R9 + LSR $0x2f, R9, R9 + LSL $0x20, R10, R10 + MUL R5, R10, R10 + LSR $0x32, R10, R10 + MOVWU (R0)(R9<<2), R5 + ADD R10<<2, R0, R15 + MOVWU 524288(R15), R7 + MOVW R2, (R0)(R9<<2) + ADD R10<<2, R0, R15 + MOVW R2, 524288(R15) + MOVD (R3)(R5), R9 + MOVD (R3)(R7), R10 + CMP R6, R9 + BEQ candidate_match_encodeSnappyBetterBlockAsm + CMP R6, R10 + BNE no_short_found_encodeSnappyBetterBlockAsm + MOVWU R7, R5 + JMP candidate_match_encodeSnappyBetterBlockAsm + +no_short_found_encodeSnappyBetterBlockAsm: + CMPW R6, R9 + BEQ candidate_match_encodeSnappyBetterBlockAsm + CMPW R6, R10 + BEQ candidateS_match_encodeSnappyBetterBlockAsm + MOVWU 28(RSP), R2 + JMP search_loop_encodeSnappyBetterBlockAsm + +candidateS_match_encodeSnappyBetterBlockAsm: + LSR $0x08, R6, R6 + MOVD R6, R9 + LSL $0x08, R9, R9 + MUL R8, R9, R9 + LSR $0x2f, R9, R9 + MOVWU (R0)(R9<<2), R5 + ADDW $1, R2, R2 + MOVW R2, (R0)(R9<<2) + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate_match_encodeSnappyBetterBlockAsm + SUBW $1, R2, R2 + MOVWU R7, R5 + +candidate_match_encodeSnappyBetterBlockAsm: + MOVWU 20(RSP), R6 + TSTW R5, R5 + BEQ match_extend_back_end_encodeSnappyBetterBlockAsm + +match_extend_back_loop_encodeSnappyBetterBlockAsm: + CMPW R6, R2 + BLS match_extend_back_end_encodeSnappyBetterBlockAsm + ADD R5, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R7 + ADD R2, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + AND $0xff, R8, R16 + AND $0xff, R7, R15 + CMP R16, R15 + BNE match_extend_back_end_encodeSnappyBetterBlockAsm + SUB $1, R2, R2 + MOVWU R2, R2 + SUBSW $1, R5, R5 + BEQ match_extend_back_end_encodeSnappyBetterBlockAsm + JMP match_extend_back_loop_encodeSnappyBetterBlockAsm + +match_extend_back_end_encodeSnappyBetterBlockAsm: + MOVWU R2, R6 + MOVWU 20(RSP), R16 + SUBW R16, R6, R6 + ADD R6, R1, R6 + ADD $5, R6, R6 + MOVD 8(RSP), R16 + CMP R16, R6 + BLO match_dst_size_check_encodeSnappyBetterBlockAsm + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_dst_size_check_encodeSnappyBetterBlockAsm: + MOVWU R2, R6 + ADDW $0x04, R2, R2 + ADDW $0x04, R5, R5 + MOVD src_len+32(FP), R7 + SUBW R2, R7, R7 + ADD R2, R3, R8 + ADD R5, R3, R9 + + // matchLen + MOVD $0, R11 + +matchlen_loopback_16_match_nolit_encodeSnappyBetterBlockAsm: + CMPW $0x10, R7 + BLO matchlen_match8_match_nolit_encodeSnappyBetterBlockAsm + MOVD (R8)(R11), R10 + ADD R11, R8, R15 + MOVD 8(R15), R12 + MOVD (R9)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_match_nolit_encodeSnappyBetterBlockAsm + ADD R11, R9, R15 + MOVD 8(R15), R16 + EOR R16, R12, R12 + TST R12, R12 + BNE matchlen_bsf_16match_nolit_encodeSnappyBetterBlockAsm + SUB $16, R7, R7 + MOVWU R7, R7 + ADD $16, R11, R11 + MOVWU R11, R11 + JMP matchlen_loopback_16_match_nolit_encodeSnappyBetterBlockAsm + +matchlen_bsf_16match_nolit_encodeSnappyBetterBlockAsm: + RBIT R12, R12 + CLZ R12, R12 + ASR $0x03, R12, R12 + ADD R12, R11, R11 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP match_nolit_end_encodeSnappyBetterBlockAsm + +matchlen_match8_match_nolit_encodeSnappyBetterBlockAsm: + CMPW $0x08, R7 + BLO matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm + MOVD (R8)(R11), R10 + MOVD (R9)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_match_nolit_encodeSnappyBetterBlockAsm + SUB $8, R7, R7 + MOVWU R7, R7 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm + +matchlen_bsf_8_match_nolit_encodeSnappyBetterBlockAsm: + RBIT R10, R10 + CLZ R10, R10 + ASR $0x03, R10, R10 + ADD R10, R11, R11 + MOVWU R11, R11 + JMP match_nolit_end_encodeSnappyBetterBlockAsm + +matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm: + CMPW $0x04, R7 + BLO matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm + MOVWU (R8)(R11), R10 + MOVWU (R9)(R11), R16 + CMPW R10, R16 + BNE matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm + SUB $4, R7, R7 + MOVWU R7, R7 + ADD $4, R11, R11 + MOVWU R11, R11 + +matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm: + CMPW $0x01, R7 + BEQ matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm + BLO match_nolit_end_encodeSnappyBetterBlockAsm + MOVHU (R8)(R11), R16 + BFI $0, R16, $16, R10 + ADD R11, R9, R15 + MOVHU (R15), R15 + AND $0xffff, R10, R16 + CMP R16, R15 + BNE matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm + ADD $2, R11, R11 + MOVWU R11, R11 + SUBSW $0x02, R7, R7 + BEQ match_nolit_end_encodeSnappyBetterBlockAsm + +matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm: + MOVBU (R8)(R11), R16 + BFI $0, R16, $8, R10 + ADD R11, R9, R15 + MOVBU (R15), R15 + AND $0xff, R10, R16 + CMP R16, R15 + BNE match_nolit_end_encodeSnappyBetterBlockAsm + ADD $1, R11, R11 + MOVWU R11, R11 + +match_nolit_end_encodeSnappyBetterBlockAsm: + MOVWU R2, R7 + SUBW R5, R7, R7 + + // Check if repeat + CMPW $0x01, R11 + BHI match_length_ok_encodeSnappyBetterBlockAsm + CMPW $0x0000ffff, R7 + BLS match_length_ok_encodeSnappyBetterBlockAsm + MOVWU 28(RSP), R2 + ADDW $1, R2, R2 + JMP search_loop_encodeSnappyBetterBlockAsm + +match_length_ok_encodeSnappyBetterBlockAsm: + MOVW R7, 24(RSP) + MOVWU 20(RSP), R5 + CMPW R6, R5 + BEQ emit_literal_done_match_emit_encodeSnappyBetterBlockAsm + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R5, R3, R9 + SUBW R5, R8, R8 + SUB $1, R8, R5 + MOVWU R5, R5 + CMPW $0x3c, R5 + BLO one_byte_match_emit_encodeSnappyBetterBlockAsm + CMPW $0x00000100, R5 + BLO two_bytes_match_emit_encodeSnappyBetterBlockAsm + CMPW $0x00010000, R5 + BLO three_bytes_match_emit_encodeSnappyBetterBlockAsm + CMPW $0x01000000, R5 + BLO four_bytes_match_emit_encodeSnappyBetterBlockAsm + MOVD $0xfc, R16 + MOVB R16, (R1) + MOVW R5, 1(R1) + ADD $0x05, R1, R1 + JMP memmove_long_match_emit_encodeSnappyBetterBlockAsm + +four_bytes_match_emit_encodeSnappyBetterBlockAsm: + MOVWU R5, R10 + LSRW $0x10, R10, R10 + MOVD $0xf8, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + MOVB R10, 3(R1) + ADD $0x04, R1, R1 + JMP memmove_long_match_emit_encodeSnappyBetterBlockAsm + +three_bytes_match_emit_encodeSnappyBetterBlockAsm: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_match_emit_encodeSnappyBetterBlockAsm + +two_bytes_match_emit_encodeSnappyBetterBlockAsm: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R5, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R5 + BLO memmove_match_emit_encodeSnappyBetterBlockAsm + JMP memmove_long_match_emit_encodeSnappyBetterBlockAsm + +one_byte_match_emit_encodeSnappyBetterBlockAsm: + LSLW $0x02, R5, R16 + BFI $0, R16, $8, R5 + MOVB R5, (R1) + ADD $0x01, R1, R1 + +memmove_match_emit_encodeSnappyBetterBlockAsm: + ADD R8, R1, R5 + + // genMemMoveShort + CMP $0x08, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm_memmove_move_8 + CMP $0x10, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm_memmove_move_17through32 + JMP emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm_memmove_move_33through64 + +emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm_memmove_move_8: + MOVD (R9), R10 + MOVD R10, (R1) + JMP memmove_end_copy_match_emit_encodeSnappyBetterBlockAsm + +emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm_memmove_move_8through16: + MOVD (R9), R10 + ADD R8, R9, R15 + MOVD -8(R15), R9 + MOVD R10, (R1) + ADD R8, R1, R15 + MOVD R9, -8(R15) + JMP memmove_end_copy_match_emit_encodeSnappyBetterBlockAsm + +emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm_memmove_move_17through32: + FMOVQ (R9), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_match_emit_encodeSnappyBetterBlockAsm + +emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm_memmove_move_33through64: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + ADD R8, R9, R15 + FMOVQ -32(R15), F2 + ADD R8, R9, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_match_emit_encodeSnappyBetterBlockAsm: + MOVD R5, R1 + JMP emit_literal_done_match_emit_encodeSnappyBetterBlockAsm + +memmove_long_match_emit_encodeSnappyBetterBlockAsm: + ADD R8, R1, R5 + + // genMemMoveLong + MOVD R9, R10 + MOVD R1, R12 + MOVD R8, R13 + +emit_lit_memmove_long_match_emit_encodeSnappyBetterBlockAsmlarge_big_loop_back: + FMOVQ (R10), F0 + FMOVQ 16(R10), F1 + FMOVQ F0, (R12) + FMOVQ F1, 16(R12) + ADD $0x20, R10, R10 + ADD $0x20, R12, R12 + SUB $0x20, R13, R13 + CMP $0x20, R13 + BHS emit_lit_memmove_long_match_emit_encodeSnappyBetterBlockAsmlarge_big_loop_back + ADD R8, R9, R15 + FMOVQ -32(R15), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R5, R1 + +emit_literal_done_match_emit_encodeSnappyBetterBlockAsm: + ADDW R11, R2, R2 + ADDW $0x04, R11, R11 + MOVW R2, 20(RSP) + + // emitCopy + CMPW $0x00010000, R7 + BLO two_byte_offset_match_nolit_encodeSnappyBetterBlockAsm + +four_bytes_loop_back_match_nolit_encodeSnappyBetterBlockAsm: + CMPW $0x40, R11 + BLS four_bytes_remain_match_nolit_encodeSnappyBetterBlockAsm + MOVD $0xff, R16 + MOVB R16, (R1) + MOVW R7, 1(R1) + SUB $64, R11, R11 + MOVWU R11, R11 + ADD $0x05, R1, R1 + CMPW $0x04, R11 + BLO four_bytes_remain_match_nolit_encodeSnappyBetterBlockAsm + JMP four_bytes_loop_back_match_nolit_encodeSnappyBetterBlockAsm + +four_bytes_remain_match_nolit_encodeSnappyBetterBlockAsm: + TSTW R11, R11 + BEQ match_nolit_emitcopy_end_encodeSnappyBetterBlockAsm + MOVD $0, R5 + ADD R11<<2, R5, R11 + SUB $1, R11, R11 + MOVWU R11, R11 + MOVB R11, (R1) + MOVW R7, 1(R1) + ADD $0x05, R1, R1 + JMP match_nolit_emitcopy_end_encodeSnappyBetterBlockAsm + +two_byte_offset_match_nolit_encodeSnappyBetterBlockAsm: + CMPW $0x40, R11 + BLS two_byte_offset_short_match_nolit_encodeSnappyBetterBlockAsm + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R7, 1(R1) + SUB $60, R11, R11 + MOVWU R11, R11 + ADD $0x03, R1, R1 + JMP two_byte_offset_match_nolit_encodeSnappyBetterBlockAsm + +two_byte_offset_short_match_nolit_encodeSnappyBetterBlockAsm: + MOVWU R11, R5 + LSLW $0x02, R5, R5 + CMPW $0x0c, R11 + BHS emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm + CMPW $0x00000800, R7 + BHS emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm + SUB $15, R5, R5 + MOVWU R5, R5 + MOVB R7, 1(R1) + LSRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeSnappyBetterBlockAsm + +emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm: + SUB $2, R5, R5 + MOVWU R5, R5 + MOVB R5, (R1) + MOVH R7, 1(R1) + ADD $0x03, R1, R1 + +match_nolit_emitcopy_end_encodeSnappyBetterBlockAsm: + MOVWU 16(RSP), R16 + CMPW R16, R2 + BHS emit_remainder_encodeSnappyBetterBlockAsm + MOVD 8(RSP), R16 + CMP R16, R1 + BLO match_nolit_dst_ok_encodeSnappyBetterBlockAsm + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_nolit_dst_ok_encodeSnappyBetterBlockAsm: + MOVD $0x00cf1bbcdcbfa563, R5 + MOVD $0x9e3779b1, R7 + ADD $1, R6, R6 + SUB $2, R2, R8 + MOVD (R3)(R6), R9 + ADD R6, R3, R15 + MOVD 1(R15), R10 + MOVD (R3)(R8), R11 + ADD R8, R3, R15 + MOVD 1(R15), R12 + LSL $0x08, R9, R9 + MUL R5, R9, R9 + LSR $0x2f, R9, R9 + LSL $0x20, R10, R10 + MUL R7, R10, R10 + LSR $0x32, R10, R10 + LSL $0x08, R11, R11 + MUL R5, R11, R11 + LSR $0x2f, R11, R11 + LSL $0x20, R12, R12 + MUL R7, R12, R12 + LSR $0x32, R12, R12 + ADD $1, R6, R7 + ADD $1, R8, R13 + MOVW R6, (R0)(R9<<2) + MOVW R8, (R0)(R11<<2) + ADD R10<<2, R0, R15 + MOVW R7, 524288(R15) + ADD R12<<2, R0, R15 + MOVW R13, 524288(R15) + ADD R6, R8, R7 + ADD $1, R7, R7 + LSR $0x01, R7, R7 + ADD $0x01, R6, R6 + SUB $0x01, R8, R8 + +index_loop_encodeSnappyBetterBlockAsm: + CMP R8, R7 + BHS search_loop_encodeSnappyBetterBlockAsm + MOVD (R3)(R6), R9 + MOVD (R3)(R7), R10 + LSL $0x08, R9, R9 + MUL R5, R9, R9 + LSR $0x2f, R9, R9 + LSL $0x08, R10, R10 + MUL R5, R10, R10 + LSR $0x2f, R10, R10 + MOVW R6, (R0)(R9<<2) + MOVW R7, (R0)(R10<<2) + ADD $0x02, R6, R6 + ADD $0x02, R7, R7 + JMP index_loop_encodeSnappyBetterBlockAsm + +emit_remainder_encodeSnappyBetterBlockAsm: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R16 + SUBW R16, R0, R0 + ADD R0, R1, R0 + ADD $5, R0, R0 + MOVD 8(RSP), R16 + CMP R16, R0 + BLO emit_remainder_ok_encodeSnappyBetterBlockAsm + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +emit_remainder_ok_encodeSnappyBetterBlockAsm: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R2 + CMPW R0, R2 + BEQ emit_literal_done_emit_remainder_encodeSnappyBetterBlockAsm + MOVWU R0, R5 + MOVW R0, 20(RSP) + ADD R2, R3, R0 + SUBW R2, R5, R5 + SUB $1, R5, R2 + MOVWU R2, R2 + CMPW $0x3c, R2 + BLO one_byte_emit_remainder_encodeSnappyBetterBlockAsm + CMPW $0x00000100, R2 + BLO two_bytes_emit_remainder_encodeSnappyBetterBlockAsm + CMPW $0x00010000, R2 + BLO three_bytes_emit_remainder_encodeSnappyBetterBlockAsm + CMPW $0x01000000, R2 + BLO four_bytes_emit_remainder_encodeSnappyBetterBlockAsm + MOVD $0xfc, R16 + MOVB R16, (R1) + MOVW R2, 1(R1) + ADD $0x05, R1, R1 + JMP memmove_long_emit_remainder_encodeSnappyBetterBlockAsm + +four_bytes_emit_remainder_encodeSnappyBetterBlockAsm: + MOVWU R2, R3 + LSRW $0x10, R3, R3 + MOVD $0xf8, R16 + MOVB R16, (R1) + MOVH R2, 1(R1) + MOVB R3, 3(R1) + ADD $0x04, R1, R1 + JMP memmove_long_emit_remainder_encodeSnappyBetterBlockAsm + +three_bytes_emit_remainder_encodeSnappyBetterBlockAsm: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R2, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_emit_remainder_encodeSnappyBetterBlockAsm + +two_bytes_emit_remainder_encodeSnappyBetterBlockAsm: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R2, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R2 + BLO memmove_emit_remainder_encodeSnappyBetterBlockAsm + JMP memmove_long_emit_remainder_encodeSnappyBetterBlockAsm + +one_byte_emit_remainder_encodeSnappyBetterBlockAsm: + LSLW $0x02, R2, R16 + BFI $0, R16, $8, R2 + MOVB R2, (R1) + ADD $0x01, R1, R1 + +memmove_emit_remainder_encodeSnappyBetterBlockAsm: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveShort + CMP $0x03, R3 + BLO emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm_memmove_move_1or2 + BEQ emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm_memmove_move_3 + CMP $0x08, R3 + BLO emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm_memmove_move_4through7 + CMP $0x10, R3 + BLS emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm_memmove_move_8through16 + CMP $0x20, R3 + BLS emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm_memmove_move_17through32 + JMP emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm_memmove_move_33through64 + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm_memmove_move_1or2: + MOVBU (R0), R16 + BFI $0, R16, $8, R5 + ADD R3, R0, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R0 + MOVB R5, (R1) + ADD R3, R1, R15 + MOVB R0, -1(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm_memmove_move_3: + MOVHU (R0), R16 + BFI $0, R16, $16, R5 + MOVBU 2(R0), R16 + BFI $0, R16, $8, R0 + MOVH R5, (R1) + MOVB R0, 2(R1) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm_memmove_move_4through7: + MOVWU (R0), R5 + ADD R3, R0, R15 + MOVWU -4(R15), R0 + MOVW R5, (R1) + ADD R3, R1, R15 + MOVW R0, -4(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm_memmove_move_8through16: + MOVD (R0), R5 + ADD R3, R0, R15 + MOVD -8(R15), R0 + MOVD R5, (R1) + ADD R3, R1, R15 + MOVD R0, -8(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm_memmove_move_17through32: + FMOVQ (R0), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm_memmove_move_33through64: + FMOVQ (R0), F0 + FMOVQ 16(R0), F1 + ADD R3, R0, R15 + FMOVQ -32(R15), F2 + ADD R3, R0, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R3, R1, R15 + FMOVQ F2, -32(R15) + ADD R3, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm: + MOVD R2, R1 + JMP emit_literal_done_emit_remainder_encodeSnappyBetterBlockAsm + +memmove_long_emit_remainder_encodeSnappyBetterBlockAsm: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveLong + MOVD R0, R5 + MOVD R1, R6 + MOVD R3, R7 + +emit_lit_memmove_long_emit_remainder_encodeSnappyBetterBlockAsmlarge_big_loop_back: + FMOVQ (R5), F0 + FMOVQ 16(R5), F1 + FMOVQ F0, (R6) + FMOVQ F1, 16(R6) + ADD $0x20, R5, R5 + ADD $0x20, R6, R6 + SUB $0x20, R7, R7 + CMP $0x20, R7 + BHS emit_lit_memmove_long_emit_remainder_encodeSnappyBetterBlockAsmlarge_big_loop_back + ADD R3, R0, R15 + FMOVQ -32(R15), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + ADD R3, R1, R15 + FMOVQ F0, -32(R15) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + MOVD R2, R1 + +emit_literal_done_emit_remainder_encodeSnappyBetterBlockAsm: + MOVD dst_base+0(FP), R0 + SUB R0, R1, R1 + MOVD R1, ret+56(FP) + RET + +// func encodeSnappyBetterBlockAsm64K(dst []byte, src []byte, tmp *[294912]byte) int +// Requires: BMI, SSE2 +TEXT ·encodeSnappyBetterBlockAsm64K(SB), $24-64 + MOVD tmp+48(FP), R0 + MOVD dst_base+0(FP), R1 + MOVD $0x00000900, R2 + MOVD R0, R3 + VEOR V0.B16, V0.B16, V0.B16 + +zero_loop_encodeSnappyBetterBlockAsm64K: + FMOVQ F0, (R3) + FMOVQ F0, 16(R3) + FMOVQ F0, 32(R3) + FMOVQ F0, 48(R3) + FMOVQ F0, 64(R3) + FMOVQ F0, 80(R3) + FMOVQ F0, 96(R3) + FMOVQ F0, 112(R3) + ADD $0x80, R3, R3 + SUBS $1, R2, R2 + BNE zero_loop_encodeSnappyBetterBlockAsm64K + MOVD $0x00000000, R16 + MOVW R16, 20(RSP) + MOVD src_len+32(FP), R2 + SUB $9, R2, R3 + SUB $8, R2, R5 + MOVW R5, 16(RSP) + LSR $0x05, R2, R2 + SUBW R2, R3, R3 + ADD R3, R1, R3 + MOVD R3, 8(RSP) + MOVD $0x00000001, R2 + MOVD $0x00000000, R16 + MOVW R16, 24(RSP) + MOVD src_base+24(FP), R3 + +search_loop_encodeSnappyBetterBlockAsm64K: + MOVWU R2, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + LSRW $0x07, R5, R5 + ADD R5, R2, R5 + ADD $1, R5, R5 + MOVWU R5, R5 + MOVWU 16(RSP), R16 + CMPW R16, R5 + BHS emit_remainder_encodeSnappyBetterBlockAsm64K + MOVD (R3)(R2), R6 + MOVW R5, 28(RSP) + MOVD $0x00cf1bbcdcbfa563, R8 + MOVD $0x9e3779b1, R5 + MOVD R6, R9 + MOVD R6, R10 + LSL $0x08, R9, R9 + MUL R8, R9, R9 + LSR $0x30, R9, R9 + LSL $0x20, R10, R10 + MUL R5, R10, R10 + LSR $0x33, R10, R10 + MOVWU (R0)(R9<<2), R5 + ADD R10<<2, R0, R15 + MOVWU 262144(R15), R7 + MOVW R2, (R0)(R9<<2) + ADD R10<<2, R0, R15 + MOVW R2, 262144(R15) + MOVD (R3)(R5), R9 + MOVD (R3)(R7), R10 + CMP R6, R9 + BEQ candidate_match_encodeSnappyBetterBlockAsm64K + CMP R6, R10 + BNE no_short_found_encodeSnappyBetterBlockAsm64K + MOVWU R7, R5 + JMP candidate_match_encodeSnappyBetterBlockAsm64K + +no_short_found_encodeSnappyBetterBlockAsm64K: + CMPW R6, R9 + BEQ candidate_match_encodeSnappyBetterBlockAsm64K + CMPW R6, R10 + BEQ candidateS_match_encodeSnappyBetterBlockAsm64K + MOVWU 28(RSP), R2 + JMP search_loop_encodeSnappyBetterBlockAsm64K + +candidateS_match_encodeSnappyBetterBlockAsm64K: + LSR $0x08, R6, R6 + MOVD R6, R9 + LSL $0x08, R9, R9 + MUL R8, R9, R9 + LSR $0x30, R9, R9 + MOVWU (R0)(R9<<2), R5 + ADDW $1, R2, R2 + MOVW R2, (R0)(R9<<2) + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate_match_encodeSnappyBetterBlockAsm64K + SUBW $1, R2, R2 + MOVWU R7, R5 + +candidate_match_encodeSnappyBetterBlockAsm64K: + MOVWU 20(RSP), R6 + TSTW R5, R5 + BEQ match_extend_back_end_encodeSnappyBetterBlockAsm64K + +match_extend_back_loop_encodeSnappyBetterBlockAsm64K: + CMPW R6, R2 + BLS match_extend_back_end_encodeSnappyBetterBlockAsm64K + ADD R5, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R7 + ADD R2, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + AND $0xff, R8, R16 + AND $0xff, R7, R15 + CMP R16, R15 + BNE match_extend_back_end_encodeSnappyBetterBlockAsm64K + SUB $1, R2, R2 + MOVWU R2, R2 + SUBSW $1, R5, R5 + BEQ match_extend_back_end_encodeSnappyBetterBlockAsm64K + JMP match_extend_back_loop_encodeSnappyBetterBlockAsm64K + +match_extend_back_end_encodeSnappyBetterBlockAsm64K: + MOVWU R2, R6 + MOVWU 20(RSP), R16 + SUBW R16, R6, R6 + ADD R6, R1, R6 + ADD $3, R6, R6 + MOVD 8(RSP), R16 + CMP R16, R6 + BLO match_dst_size_check_encodeSnappyBetterBlockAsm64K + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_dst_size_check_encodeSnappyBetterBlockAsm64K: + MOVWU R2, R6 + ADDW $0x04, R2, R2 + ADDW $0x04, R5, R5 + MOVD src_len+32(FP), R7 + SUBW R2, R7, R7 + ADD R2, R3, R8 + ADD R5, R3, R9 + + // matchLen + MOVD $0, R11 + +matchlen_loopback_16_match_nolit_encodeSnappyBetterBlockAsm64K: + CMPW $0x10, R7 + BLO matchlen_match8_match_nolit_encodeSnappyBetterBlockAsm64K + MOVD (R8)(R11), R10 + ADD R11, R8, R15 + MOVD 8(R15), R12 + MOVD (R9)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_match_nolit_encodeSnappyBetterBlockAsm64K + ADD R11, R9, R15 + MOVD 8(R15), R16 + EOR R16, R12, R12 + TST R12, R12 + BNE matchlen_bsf_16match_nolit_encodeSnappyBetterBlockAsm64K + SUB $16, R7, R7 + MOVWU R7, R7 + ADD $16, R11, R11 + MOVWU R11, R11 + JMP matchlen_loopback_16_match_nolit_encodeSnappyBetterBlockAsm64K + +matchlen_bsf_16match_nolit_encodeSnappyBetterBlockAsm64K: + RBIT R12, R12 + CLZ R12, R12 + ASR $0x03, R12, R12 + ADD R12, R11, R11 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP match_nolit_end_encodeSnappyBetterBlockAsm64K + +matchlen_match8_match_nolit_encodeSnappyBetterBlockAsm64K: + CMPW $0x08, R7 + BLO matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm64K + MOVD (R8)(R11), R10 + MOVD (R9)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_match_nolit_encodeSnappyBetterBlockAsm64K + SUB $8, R7, R7 + MOVWU R7, R7 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm64K + +matchlen_bsf_8_match_nolit_encodeSnappyBetterBlockAsm64K: + RBIT R10, R10 + CLZ R10, R10 + ASR $0x03, R10, R10 + ADD R10, R11, R11 + MOVWU R11, R11 + JMP match_nolit_end_encodeSnappyBetterBlockAsm64K + +matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm64K: + CMPW $0x04, R7 + BLO matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm64K + MOVWU (R8)(R11), R10 + MOVWU (R9)(R11), R16 + CMPW R10, R16 + BNE matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm64K + SUB $4, R7, R7 + MOVWU R7, R7 + ADD $4, R11, R11 + MOVWU R11, R11 + +matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm64K: + CMPW $0x01, R7 + BEQ matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm64K + BLO match_nolit_end_encodeSnappyBetterBlockAsm64K + MOVHU (R8)(R11), R16 + BFI $0, R16, $16, R10 + ADD R11, R9, R15 + MOVHU (R15), R15 + AND $0xffff, R10, R16 + CMP R16, R15 + BNE matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm64K + ADD $2, R11, R11 + MOVWU R11, R11 + SUBSW $0x02, R7, R7 + BEQ match_nolit_end_encodeSnappyBetterBlockAsm64K + +matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm64K: + MOVBU (R8)(R11), R16 + BFI $0, R16, $8, R10 + ADD R11, R9, R15 + MOVBU (R15), R15 + AND $0xff, R10, R16 + CMP R16, R15 + BNE match_nolit_end_encodeSnappyBetterBlockAsm64K + ADD $1, R11, R11 + MOVWU R11, R11 + +match_nolit_end_encodeSnappyBetterBlockAsm64K: + MOVWU R2, R7 + SUBW R5, R7, R7 + + // Check if repeat + MOVW R7, 24(RSP) + MOVWU 20(RSP), R5 + CMPW R6, R5 + BEQ emit_literal_done_match_emit_encodeSnappyBetterBlockAsm64K + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R5, R3, R9 + SUBW R5, R8, R8 + SUB $1, R8, R5 + MOVWU R5, R5 + CMPW $0x3c, R5 + BLO one_byte_match_emit_encodeSnappyBetterBlockAsm64K + CMPW $0x00000100, R5 + BLO two_bytes_match_emit_encodeSnappyBetterBlockAsm64K + BLO three_bytes_match_emit_encodeSnappyBetterBlockAsm64K + +three_bytes_match_emit_encodeSnappyBetterBlockAsm64K: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_match_emit_encodeSnappyBetterBlockAsm64K + +two_bytes_match_emit_encodeSnappyBetterBlockAsm64K: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R5, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R5 + BLO memmove_match_emit_encodeSnappyBetterBlockAsm64K + JMP memmove_long_match_emit_encodeSnappyBetterBlockAsm64K + +one_byte_match_emit_encodeSnappyBetterBlockAsm64K: + LSLW $0x02, R5, R16 + BFI $0, R16, $8, R5 + MOVB R5, (R1) + ADD $0x01, R1, R1 + +memmove_match_emit_encodeSnappyBetterBlockAsm64K: + ADD R8, R1, R5 + + // genMemMoveShort + CMP $0x08, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm64K_memmove_move_8 + CMP $0x10, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm64K_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm64K_memmove_move_17through32 + JMP emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm64K_memmove_move_33through64 + +emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm64K_memmove_move_8: + MOVD (R9), R10 + MOVD R10, (R1) + JMP memmove_end_copy_match_emit_encodeSnappyBetterBlockAsm64K + +emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm64K_memmove_move_8through16: + MOVD (R9), R10 + ADD R8, R9, R15 + MOVD -8(R15), R9 + MOVD R10, (R1) + ADD R8, R1, R15 + MOVD R9, -8(R15) + JMP memmove_end_copy_match_emit_encodeSnappyBetterBlockAsm64K + +emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm64K_memmove_move_17through32: + FMOVQ (R9), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_match_emit_encodeSnappyBetterBlockAsm64K + +emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm64K_memmove_move_33through64: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + ADD R8, R9, R15 + FMOVQ -32(R15), F2 + ADD R8, R9, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_match_emit_encodeSnappyBetterBlockAsm64K: + MOVD R5, R1 + JMP emit_literal_done_match_emit_encodeSnappyBetterBlockAsm64K + +memmove_long_match_emit_encodeSnappyBetterBlockAsm64K: + ADD R8, R1, R5 + + // genMemMoveLong + MOVD R9, R10 + MOVD R1, R12 + MOVD R8, R13 + +emit_lit_memmove_long_match_emit_encodeSnappyBetterBlockAsm64Klarge_big_loop_back: + FMOVQ (R10), F0 + FMOVQ 16(R10), F1 + FMOVQ F0, (R12) + FMOVQ F1, 16(R12) + ADD $0x20, R10, R10 + ADD $0x20, R12, R12 + SUB $0x20, R13, R13 + CMP $0x20, R13 + BHS emit_lit_memmove_long_match_emit_encodeSnappyBetterBlockAsm64Klarge_big_loop_back + ADD R8, R9, R15 + FMOVQ -32(R15), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R5, R1 + +emit_literal_done_match_emit_encodeSnappyBetterBlockAsm64K: + ADDW R11, R2, R2 + ADDW $0x04, R11, R11 + MOVW R2, 20(RSP) + + // emitCopy +two_byte_offset_match_nolit_encodeSnappyBetterBlockAsm64K: + CMPW $0x40, R11 + BLS two_byte_offset_short_match_nolit_encodeSnappyBetterBlockAsm64K + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R7, 1(R1) + SUB $60, R11, R11 + MOVWU R11, R11 + ADD $0x03, R1, R1 + JMP two_byte_offset_match_nolit_encodeSnappyBetterBlockAsm64K + +two_byte_offset_short_match_nolit_encodeSnappyBetterBlockAsm64K: + MOVWU R11, R5 + LSLW $0x02, R5, R5 + CMPW $0x0c, R11 + BHS emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm64K + CMPW $0x00000800, R7 + BHS emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm64K + SUB $15, R5, R5 + MOVWU R5, R5 + MOVB R7, 1(R1) + LSRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeSnappyBetterBlockAsm64K + +emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm64K: + SUB $2, R5, R5 + MOVWU R5, R5 + MOVB R5, (R1) + MOVH R7, 1(R1) + ADD $0x03, R1, R1 + +match_nolit_emitcopy_end_encodeSnappyBetterBlockAsm64K: + MOVWU 16(RSP), R16 + CMPW R16, R2 + BHS emit_remainder_encodeSnappyBetterBlockAsm64K + MOVD 8(RSP), R16 + CMP R16, R1 + BLO match_nolit_dst_ok_encodeSnappyBetterBlockAsm64K + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_nolit_dst_ok_encodeSnappyBetterBlockAsm64K: + MOVD $0x00cf1bbcdcbfa563, R5 + MOVD $0x9e3779b1, R7 + ADD $1, R6, R6 + SUB $2, R2, R8 + MOVD (R3)(R6), R9 + ADD R6, R3, R15 + MOVD 1(R15), R10 + MOVD (R3)(R8), R11 + ADD R8, R3, R15 + MOVD 1(R15), R12 + LSL $0x08, R9, R9 + MUL R5, R9, R9 + LSR $0x30, R9, R9 + LSL $0x20, R10, R10 + MUL R7, R10, R10 + LSR $0x33, R10, R10 + LSL $0x08, R11, R11 + MUL R5, R11, R11 + LSR $0x30, R11, R11 + LSL $0x20, R12, R12 + MUL R7, R12, R12 + LSR $0x33, R12, R12 + ADD $1, R6, R7 + ADD $1, R8, R13 + MOVW R6, (R0)(R9<<2) + MOVW R8, (R0)(R11<<2) + ADD R10<<2, R0, R15 + MOVW R7, 262144(R15) + ADD R12<<2, R0, R15 + MOVW R13, 262144(R15) + ADD R6, R8, R7 + ADD $1, R7, R7 + LSR $0x01, R7, R7 + ADD $0x01, R6, R6 + SUB $0x01, R8, R8 + +index_loop_encodeSnappyBetterBlockAsm64K: + CMP R8, R7 + BHS search_loop_encodeSnappyBetterBlockAsm64K + MOVD (R3)(R6), R9 + MOVD (R3)(R7), R10 + LSL $0x08, R9, R9 + MUL R5, R9, R9 + LSR $0x30, R9, R9 + LSL $0x08, R10, R10 + MUL R5, R10, R10 + LSR $0x30, R10, R10 + MOVW R6, (R0)(R9<<2) + MOVW R7, (R0)(R10<<2) + ADD $0x02, R6, R6 + ADD $0x02, R7, R7 + JMP index_loop_encodeSnappyBetterBlockAsm64K + +emit_remainder_encodeSnappyBetterBlockAsm64K: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R16 + SUBW R16, R0, R0 + ADD R0, R1, R0 + ADD $3, R0, R0 + MOVD 8(RSP), R16 + CMP R16, R0 + BLO emit_remainder_ok_encodeSnappyBetterBlockAsm64K + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +emit_remainder_ok_encodeSnappyBetterBlockAsm64K: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R2 + CMPW R0, R2 + BEQ emit_literal_done_emit_remainder_encodeSnappyBetterBlockAsm64K + MOVWU R0, R5 + MOVW R0, 20(RSP) + ADD R2, R3, R0 + SUBW R2, R5, R5 + SUB $1, R5, R2 + MOVWU R2, R2 + CMPW $0x3c, R2 + BLO one_byte_emit_remainder_encodeSnappyBetterBlockAsm64K + CMPW $0x00000100, R2 + BLO two_bytes_emit_remainder_encodeSnappyBetterBlockAsm64K + BLO three_bytes_emit_remainder_encodeSnappyBetterBlockAsm64K + +three_bytes_emit_remainder_encodeSnappyBetterBlockAsm64K: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R2, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_emit_remainder_encodeSnappyBetterBlockAsm64K + +two_bytes_emit_remainder_encodeSnappyBetterBlockAsm64K: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R2, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R2 + BLO memmove_emit_remainder_encodeSnappyBetterBlockAsm64K + JMP memmove_long_emit_remainder_encodeSnappyBetterBlockAsm64K + +one_byte_emit_remainder_encodeSnappyBetterBlockAsm64K: + LSLW $0x02, R2, R16 + BFI $0, R16, $8, R2 + MOVB R2, (R1) + ADD $0x01, R1, R1 + +memmove_emit_remainder_encodeSnappyBetterBlockAsm64K: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveShort + CMP $0x03, R3 + BLO emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm64K_memmove_move_1or2 + BEQ emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm64K_memmove_move_3 + CMP $0x08, R3 + BLO emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm64K_memmove_move_4through7 + CMP $0x10, R3 + BLS emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm64K_memmove_move_8through16 + CMP $0x20, R3 + BLS emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm64K_memmove_move_17through32 + JMP emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm64K_memmove_move_33through64 + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm64K_memmove_move_1or2: + MOVBU (R0), R16 + BFI $0, R16, $8, R5 + ADD R3, R0, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R0 + MOVB R5, (R1) + ADD R3, R1, R15 + MOVB R0, -1(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm64K + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm64K_memmove_move_3: + MOVHU (R0), R16 + BFI $0, R16, $16, R5 + MOVBU 2(R0), R16 + BFI $0, R16, $8, R0 + MOVH R5, (R1) + MOVB R0, 2(R1) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm64K + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm64K_memmove_move_4through7: + MOVWU (R0), R5 + ADD R3, R0, R15 + MOVWU -4(R15), R0 + MOVW R5, (R1) + ADD R3, R1, R15 + MOVW R0, -4(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm64K + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm64K_memmove_move_8through16: + MOVD (R0), R5 + ADD R3, R0, R15 + MOVD -8(R15), R0 + MOVD R5, (R1) + ADD R3, R1, R15 + MOVD R0, -8(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm64K + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm64K_memmove_move_17through32: + FMOVQ (R0), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm64K + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm64K_memmove_move_33through64: + FMOVQ (R0), F0 + FMOVQ 16(R0), F1 + ADD R3, R0, R15 + FMOVQ -32(R15), F2 + ADD R3, R0, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R3, R1, R15 + FMOVQ F2, -32(R15) + ADD R3, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm64K: + MOVD R2, R1 + JMP emit_literal_done_emit_remainder_encodeSnappyBetterBlockAsm64K + +memmove_long_emit_remainder_encodeSnappyBetterBlockAsm64K: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveLong + MOVD R0, R5 + MOVD R1, R6 + MOVD R3, R7 + +emit_lit_memmove_long_emit_remainder_encodeSnappyBetterBlockAsm64Klarge_big_loop_back: + FMOVQ (R5), F0 + FMOVQ 16(R5), F1 + FMOVQ F0, (R6) + FMOVQ F1, 16(R6) + ADD $0x20, R5, R5 + ADD $0x20, R6, R6 + SUB $0x20, R7, R7 + CMP $0x20, R7 + BHS emit_lit_memmove_long_emit_remainder_encodeSnappyBetterBlockAsm64Klarge_big_loop_back + ADD R3, R0, R15 + FMOVQ -32(R15), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + ADD R3, R1, R15 + FMOVQ F0, -32(R15) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + MOVD R2, R1 + +emit_literal_done_emit_remainder_encodeSnappyBetterBlockAsm64K: + MOVD dst_base+0(FP), R0 + SUB R0, R1, R1 + MOVD R1, ret+56(FP) + RET + +// func encodeSnappyBetterBlockAsm12B(dst []byte, src []byte, tmp *[81920]byte) int +// Requires: BMI, SSE2 +TEXT ·encodeSnappyBetterBlockAsm12B(SB), $24-64 + MOVD tmp+48(FP), R0 + MOVD dst_base+0(FP), R1 + MOVD $0x00000280, R2 + MOVD R0, R3 + VEOR V0.B16, V0.B16, V0.B16 + +zero_loop_encodeSnappyBetterBlockAsm12B: + FMOVQ F0, (R3) + FMOVQ F0, 16(R3) + FMOVQ F0, 32(R3) + FMOVQ F0, 48(R3) + FMOVQ F0, 64(R3) + FMOVQ F0, 80(R3) + FMOVQ F0, 96(R3) + FMOVQ F0, 112(R3) + ADD $0x80, R3, R3 + SUBS $1, R2, R2 + BNE zero_loop_encodeSnappyBetterBlockAsm12B + MOVD $0x00000000, R16 + MOVW R16, 20(RSP) + MOVD src_len+32(FP), R2 + SUB $9, R2, R3 + SUB $8, R2, R5 + MOVW R5, 16(RSP) + LSR $0x05, R2, R2 + SUBW R2, R3, R3 + ADD R3, R1, R3 + MOVD R3, 8(RSP) + MOVD $0x00000001, R2 + MOVD $0x00000000, R16 + MOVW R16, 24(RSP) + MOVD src_base+24(FP), R3 + +search_loop_encodeSnappyBetterBlockAsm12B: + MOVWU R2, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + LSRW $0x06, R5, R5 + ADD R5, R2, R5 + ADD $1, R5, R5 + MOVWU R5, R5 + MOVWU 16(RSP), R16 + CMPW R16, R5 + BHS emit_remainder_encodeSnappyBetterBlockAsm12B + MOVD (R3)(R2), R6 + MOVW R5, 28(RSP) + MOVD $0x0000cf1bbcdcbf9b, R8 + MOVD $0x9e3779b1, R5 + MOVD R6, R9 + MOVD R6, R10 + LSL $0x10, R9, R9 + MUL R8, R9, R9 + LSR $0x32, R9, R9 + LSL $0x20, R10, R10 + MUL R5, R10, R10 + LSR $0x34, R10, R10 + MOVWU (R0)(R9<<2), R5 + ADD R10<<2, R0, R15 + MOVWU 65536(R15), R7 + MOVW R2, (R0)(R9<<2) + ADD R10<<2, R0, R15 + MOVW R2, 65536(R15) + MOVD (R3)(R5), R9 + MOVD (R3)(R7), R10 + CMP R6, R9 + BEQ candidate_match_encodeSnappyBetterBlockAsm12B + CMP R6, R10 + BNE no_short_found_encodeSnappyBetterBlockAsm12B + MOVWU R7, R5 + JMP candidate_match_encodeSnappyBetterBlockAsm12B + +no_short_found_encodeSnappyBetterBlockAsm12B: + CMPW R6, R9 + BEQ candidate_match_encodeSnappyBetterBlockAsm12B + CMPW R6, R10 + BEQ candidateS_match_encodeSnappyBetterBlockAsm12B + MOVWU 28(RSP), R2 + JMP search_loop_encodeSnappyBetterBlockAsm12B + +candidateS_match_encodeSnappyBetterBlockAsm12B: + LSR $0x08, R6, R6 + MOVD R6, R9 + LSL $0x10, R9, R9 + MUL R8, R9, R9 + LSR $0x32, R9, R9 + MOVWU (R0)(R9<<2), R5 + ADDW $1, R2, R2 + MOVW R2, (R0)(R9<<2) + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate_match_encodeSnappyBetterBlockAsm12B + SUBW $1, R2, R2 + MOVWU R7, R5 + +candidate_match_encodeSnappyBetterBlockAsm12B: + MOVWU 20(RSP), R6 + TSTW R5, R5 + BEQ match_extend_back_end_encodeSnappyBetterBlockAsm12B + +match_extend_back_loop_encodeSnappyBetterBlockAsm12B: + CMPW R6, R2 + BLS match_extend_back_end_encodeSnappyBetterBlockAsm12B + ADD R5, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R7 + ADD R2, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + AND $0xff, R8, R16 + AND $0xff, R7, R15 + CMP R16, R15 + BNE match_extend_back_end_encodeSnappyBetterBlockAsm12B + SUB $1, R2, R2 + MOVWU R2, R2 + SUBSW $1, R5, R5 + BEQ match_extend_back_end_encodeSnappyBetterBlockAsm12B + JMP match_extend_back_loop_encodeSnappyBetterBlockAsm12B + +match_extend_back_end_encodeSnappyBetterBlockAsm12B: + MOVWU R2, R6 + MOVWU 20(RSP), R16 + SUBW R16, R6, R6 + ADD R6, R1, R6 + ADD $3, R6, R6 + MOVD 8(RSP), R16 + CMP R16, R6 + BLO match_dst_size_check_encodeSnappyBetterBlockAsm12B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_dst_size_check_encodeSnappyBetterBlockAsm12B: + MOVWU R2, R6 + ADDW $0x04, R2, R2 + ADDW $0x04, R5, R5 + MOVD src_len+32(FP), R7 + SUBW R2, R7, R7 + ADD R2, R3, R8 + ADD R5, R3, R9 + + // matchLen + MOVD $0, R11 + +matchlen_loopback_16_match_nolit_encodeSnappyBetterBlockAsm12B: + CMPW $0x10, R7 + BLO matchlen_match8_match_nolit_encodeSnappyBetterBlockAsm12B + MOVD (R8)(R11), R10 + ADD R11, R8, R15 + MOVD 8(R15), R12 + MOVD (R9)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_match_nolit_encodeSnappyBetterBlockAsm12B + ADD R11, R9, R15 + MOVD 8(R15), R16 + EOR R16, R12, R12 + TST R12, R12 + BNE matchlen_bsf_16match_nolit_encodeSnappyBetterBlockAsm12B + SUB $16, R7, R7 + MOVWU R7, R7 + ADD $16, R11, R11 + MOVWU R11, R11 + JMP matchlen_loopback_16_match_nolit_encodeSnappyBetterBlockAsm12B + +matchlen_bsf_16match_nolit_encodeSnappyBetterBlockAsm12B: + RBIT R12, R12 + CLZ R12, R12 + ASR $0x03, R12, R12 + ADD R12, R11, R11 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP match_nolit_end_encodeSnappyBetterBlockAsm12B + +matchlen_match8_match_nolit_encodeSnappyBetterBlockAsm12B: + CMPW $0x08, R7 + BLO matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm12B + MOVD (R8)(R11), R10 + MOVD (R9)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_match_nolit_encodeSnappyBetterBlockAsm12B + SUB $8, R7, R7 + MOVWU R7, R7 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm12B + +matchlen_bsf_8_match_nolit_encodeSnappyBetterBlockAsm12B: + RBIT R10, R10 + CLZ R10, R10 + ASR $0x03, R10, R10 + ADD R10, R11, R11 + MOVWU R11, R11 + JMP match_nolit_end_encodeSnappyBetterBlockAsm12B + +matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm12B: + CMPW $0x04, R7 + BLO matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm12B + MOVWU (R8)(R11), R10 + MOVWU (R9)(R11), R16 + CMPW R10, R16 + BNE matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm12B + SUB $4, R7, R7 + MOVWU R7, R7 + ADD $4, R11, R11 + MOVWU R11, R11 + +matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm12B: + CMPW $0x01, R7 + BEQ matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm12B + BLO match_nolit_end_encodeSnappyBetterBlockAsm12B + MOVHU (R8)(R11), R16 + BFI $0, R16, $16, R10 + ADD R11, R9, R15 + MOVHU (R15), R15 + AND $0xffff, R10, R16 + CMP R16, R15 + BNE matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm12B + ADD $2, R11, R11 + MOVWU R11, R11 + SUBSW $0x02, R7, R7 + BEQ match_nolit_end_encodeSnappyBetterBlockAsm12B + +matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm12B: + MOVBU (R8)(R11), R16 + BFI $0, R16, $8, R10 + ADD R11, R9, R15 + MOVBU (R15), R15 + AND $0xff, R10, R16 + CMP R16, R15 + BNE match_nolit_end_encodeSnappyBetterBlockAsm12B + ADD $1, R11, R11 + MOVWU R11, R11 + +match_nolit_end_encodeSnappyBetterBlockAsm12B: + MOVWU R2, R7 + SUBW R5, R7, R7 + + // Check if repeat + MOVW R7, 24(RSP) + MOVWU 20(RSP), R5 + CMPW R6, R5 + BEQ emit_literal_done_match_emit_encodeSnappyBetterBlockAsm12B + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R5, R3, R9 + SUBW R5, R8, R8 + SUB $1, R8, R5 + MOVWU R5, R5 + CMPW $0x3c, R5 + BLO one_byte_match_emit_encodeSnappyBetterBlockAsm12B + CMPW $0x00000100, R5 + BLO two_bytes_match_emit_encodeSnappyBetterBlockAsm12B + BLO three_bytes_match_emit_encodeSnappyBetterBlockAsm12B + +three_bytes_match_emit_encodeSnappyBetterBlockAsm12B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_match_emit_encodeSnappyBetterBlockAsm12B + +two_bytes_match_emit_encodeSnappyBetterBlockAsm12B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R5, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R5 + BLO memmove_match_emit_encodeSnappyBetterBlockAsm12B + JMP memmove_long_match_emit_encodeSnappyBetterBlockAsm12B + +one_byte_match_emit_encodeSnappyBetterBlockAsm12B: + LSLW $0x02, R5, R16 + BFI $0, R16, $8, R5 + MOVB R5, (R1) + ADD $0x01, R1, R1 + +memmove_match_emit_encodeSnappyBetterBlockAsm12B: + ADD R8, R1, R5 + + // genMemMoveShort + CMP $0x08, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm12B_memmove_move_8 + CMP $0x10, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm12B_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm12B_memmove_move_17through32 + JMP emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm12B_memmove_move_33through64 + +emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm12B_memmove_move_8: + MOVD (R9), R10 + MOVD R10, (R1) + JMP memmove_end_copy_match_emit_encodeSnappyBetterBlockAsm12B + +emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm12B_memmove_move_8through16: + MOVD (R9), R10 + ADD R8, R9, R15 + MOVD -8(R15), R9 + MOVD R10, (R1) + ADD R8, R1, R15 + MOVD R9, -8(R15) + JMP memmove_end_copy_match_emit_encodeSnappyBetterBlockAsm12B + +emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm12B_memmove_move_17through32: + FMOVQ (R9), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_match_emit_encodeSnappyBetterBlockAsm12B + +emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm12B_memmove_move_33through64: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + ADD R8, R9, R15 + FMOVQ -32(R15), F2 + ADD R8, R9, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_match_emit_encodeSnappyBetterBlockAsm12B: + MOVD R5, R1 + JMP emit_literal_done_match_emit_encodeSnappyBetterBlockAsm12B + +memmove_long_match_emit_encodeSnappyBetterBlockAsm12B: + ADD R8, R1, R5 + + // genMemMoveLong + MOVD R9, R10 + MOVD R1, R12 + MOVD R8, R13 + +emit_lit_memmove_long_match_emit_encodeSnappyBetterBlockAsm12Blarge_big_loop_back: + FMOVQ (R10), F0 + FMOVQ 16(R10), F1 + FMOVQ F0, (R12) + FMOVQ F1, 16(R12) + ADD $0x20, R10, R10 + ADD $0x20, R12, R12 + SUB $0x20, R13, R13 + CMP $0x20, R13 + BHS emit_lit_memmove_long_match_emit_encodeSnappyBetterBlockAsm12Blarge_big_loop_back + ADD R8, R9, R15 + FMOVQ -32(R15), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R5, R1 + +emit_literal_done_match_emit_encodeSnappyBetterBlockAsm12B: + ADDW R11, R2, R2 + ADDW $0x04, R11, R11 + MOVW R2, 20(RSP) + + // emitCopy +two_byte_offset_match_nolit_encodeSnappyBetterBlockAsm12B: + CMPW $0x40, R11 + BLS two_byte_offset_short_match_nolit_encodeSnappyBetterBlockAsm12B + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R7, 1(R1) + SUB $60, R11, R11 + MOVWU R11, R11 + ADD $0x03, R1, R1 + JMP two_byte_offset_match_nolit_encodeSnappyBetterBlockAsm12B + +two_byte_offset_short_match_nolit_encodeSnappyBetterBlockAsm12B: + MOVWU R11, R5 + LSLW $0x02, R5, R5 + CMPW $0x0c, R11 + BHS emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm12B + CMPW $0x00000800, R7 + BHS emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm12B + SUB $15, R5, R5 + MOVWU R5, R5 + MOVB R7, 1(R1) + LSRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeSnappyBetterBlockAsm12B + +emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm12B: + SUB $2, R5, R5 + MOVWU R5, R5 + MOVB R5, (R1) + MOVH R7, 1(R1) + ADD $0x03, R1, R1 + +match_nolit_emitcopy_end_encodeSnappyBetterBlockAsm12B: + MOVWU 16(RSP), R16 + CMPW R16, R2 + BHS emit_remainder_encodeSnappyBetterBlockAsm12B + MOVD 8(RSP), R16 + CMP R16, R1 + BLO match_nolit_dst_ok_encodeSnappyBetterBlockAsm12B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_nolit_dst_ok_encodeSnappyBetterBlockAsm12B: + MOVD $0x0000cf1bbcdcbf9b, R5 + MOVD $0x9e3779b1, R7 + ADD $1, R6, R6 + SUB $2, R2, R8 + MOVD (R3)(R6), R9 + ADD R6, R3, R15 + MOVD 1(R15), R10 + MOVD (R3)(R8), R11 + ADD R8, R3, R15 + MOVD 1(R15), R12 + LSL $0x10, R9, R9 + MUL R5, R9, R9 + LSR $0x32, R9, R9 + LSL $0x20, R10, R10 + MUL R7, R10, R10 + LSR $0x34, R10, R10 + LSL $0x10, R11, R11 + MUL R5, R11, R11 + LSR $0x32, R11, R11 + LSL $0x20, R12, R12 + MUL R7, R12, R12 + LSR $0x34, R12, R12 + ADD $1, R6, R7 + ADD $1, R8, R13 + MOVW R6, (R0)(R9<<2) + MOVW R8, (R0)(R11<<2) + ADD R10<<2, R0, R15 + MOVW R7, 65536(R15) + ADD R12<<2, R0, R15 + MOVW R13, 65536(R15) + ADD R6, R8, R7 + ADD $1, R7, R7 + LSR $0x01, R7, R7 + ADD $0x01, R6, R6 + SUB $0x01, R8, R8 + +index_loop_encodeSnappyBetterBlockAsm12B: + CMP R8, R7 + BHS search_loop_encodeSnappyBetterBlockAsm12B + MOVD (R3)(R6), R9 + MOVD (R3)(R7), R10 + LSL $0x10, R9, R9 + MUL R5, R9, R9 + LSR $0x32, R9, R9 + LSL $0x10, R10, R10 + MUL R5, R10, R10 + LSR $0x32, R10, R10 + MOVW R6, (R0)(R9<<2) + MOVW R7, (R0)(R10<<2) + ADD $0x02, R6, R6 + ADD $0x02, R7, R7 + JMP index_loop_encodeSnappyBetterBlockAsm12B + +emit_remainder_encodeSnappyBetterBlockAsm12B: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R16 + SUBW R16, R0, R0 + ADD R0, R1, R0 + ADD $3, R0, R0 + MOVD 8(RSP), R16 + CMP R16, R0 + BLO emit_remainder_ok_encodeSnappyBetterBlockAsm12B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +emit_remainder_ok_encodeSnappyBetterBlockAsm12B: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R2 + CMPW R0, R2 + BEQ emit_literal_done_emit_remainder_encodeSnappyBetterBlockAsm12B + MOVWU R0, R5 + MOVW R0, 20(RSP) + ADD R2, R3, R0 + SUBW R2, R5, R5 + SUB $1, R5, R2 + MOVWU R2, R2 + CMPW $0x3c, R2 + BLO one_byte_emit_remainder_encodeSnappyBetterBlockAsm12B + CMPW $0x00000100, R2 + BLO two_bytes_emit_remainder_encodeSnappyBetterBlockAsm12B + BLO three_bytes_emit_remainder_encodeSnappyBetterBlockAsm12B + +three_bytes_emit_remainder_encodeSnappyBetterBlockAsm12B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R2, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_emit_remainder_encodeSnappyBetterBlockAsm12B + +two_bytes_emit_remainder_encodeSnappyBetterBlockAsm12B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R2, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R2 + BLO memmove_emit_remainder_encodeSnappyBetterBlockAsm12B + JMP memmove_long_emit_remainder_encodeSnappyBetterBlockAsm12B + +one_byte_emit_remainder_encodeSnappyBetterBlockAsm12B: + LSLW $0x02, R2, R16 + BFI $0, R16, $8, R2 + MOVB R2, (R1) + ADD $0x01, R1, R1 + +memmove_emit_remainder_encodeSnappyBetterBlockAsm12B: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveShort + CMP $0x03, R3 + BLO emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm12B_memmove_move_1or2 + BEQ emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm12B_memmove_move_3 + CMP $0x08, R3 + BLO emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm12B_memmove_move_4through7 + CMP $0x10, R3 + BLS emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm12B_memmove_move_8through16 + CMP $0x20, R3 + BLS emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm12B_memmove_move_17through32 + JMP emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm12B_memmove_move_33through64 + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm12B_memmove_move_1or2: + MOVBU (R0), R16 + BFI $0, R16, $8, R5 + ADD R3, R0, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R0 + MOVB R5, (R1) + ADD R3, R1, R15 + MOVB R0, -1(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm12B + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm12B_memmove_move_3: + MOVHU (R0), R16 + BFI $0, R16, $16, R5 + MOVBU 2(R0), R16 + BFI $0, R16, $8, R0 + MOVH R5, (R1) + MOVB R0, 2(R1) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm12B + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm12B_memmove_move_4through7: + MOVWU (R0), R5 + ADD R3, R0, R15 + MOVWU -4(R15), R0 + MOVW R5, (R1) + ADD R3, R1, R15 + MOVW R0, -4(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm12B + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm12B_memmove_move_8through16: + MOVD (R0), R5 + ADD R3, R0, R15 + MOVD -8(R15), R0 + MOVD R5, (R1) + ADD R3, R1, R15 + MOVD R0, -8(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm12B + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm12B_memmove_move_17through32: + FMOVQ (R0), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm12B + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm12B_memmove_move_33through64: + FMOVQ (R0), F0 + FMOVQ 16(R0), F1 + ADD R3, R0, R15 + FMOVQ -32(R15), F2 + ADD R3, R0, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R3, R1, R15 + FMOVQ F2, -32(R15) + ADD R3, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm12B: + MOVD R2, R1 + JMP emit_literal_done_emit_remainder_encodeSnappyBetterBlockAsm12B + +memmove_long_emit_remainder_encodeSnappyBetterBlockAsm12B: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveLong + MOVD R0, R5 + MOVD R1, R6 + MOVD R3, R7 + +emit_lit_memmove_long_emit_remainder_encodeSnappyBetterBlockAsm12Blarge_big_loop_back: + FMOVQ (R5), F0 + FMOVQ 16(R5), F1 + FMOVQ F0, (R6) + FMOVQ F1, 16(R6) + ADD $0x20, R5, R5 + ADD $0x20, R6, R6 + SUB $0x20, R7, R7 + CMP $0x20, R7 + BHS emit_lit_memmove_long_emit_remainder_encodeSnappyBetterBlockAsm12Blarge_big_loop_back + ADD R3, R0, R15 + FMOVQ -32(R15), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + ADD R3, R1, R15 + FMOVQ F0, -32(R15) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + MOVD R2, R1 + +emit_literal_done_emit_remainder_encodeSnappyBetterBlockAsm12B: + MOVD dst_base+0(FP), R0 + SUB R0, R1, R1 + MOVD R1, ret+56(FP) + RET + +// func encodeSnappyBetterBlockAsm10B(dst []byte, src []byte, tmp *[20480]byte) int +// Requires: BMI, SSE2 +TEXT ·encodeSnappyBetterBlockAsm10B(SB), $24-64 + MOVD tmp+48(FP), R0 + MOVD dst_base+0(FP), R1 + MOVD $0x000000a0, R2 + MOVD R0, R3 + VEOR V0.B16, V0.B16, V0.B16 + +zero_loop_encodeSnappyBetterBlockAsm10B: + FMOVQ F0, (R3) + FMOVQ F0, 16(R3) + FMOVQ F0, 32(R3) + FMOVQ F0, 48(R3) + FMOVQ F0, 64(R3) + FMOVQ F0, 80(R3) + FMOVQ F0, 96(R3) + FMOVQ F0, 112(R3) + ADD $0x80, R3, R3 + SUBS $1, R2, R2 + BNE zero_loop_encodeSnappyBetterBlockAsm10B + MOVD $0x00000000, R16 + MOVW R16, 20(RSP) + MOVD src_len+32(FP), R2 + SUB $9, R2, R3 + SUB $8, R2, R5 + MOVW R5, 16(RSP) + LSR $0x05, R2, R2 + SUBW R2, R3, R3 + ADD R3, R1, R3 + MOVD R3, 8(RSP) + MOVD $0x00000001, R2 + MOVD $0x00000000, R16 + MOVW R16, 24(RSP) + MOVD src_base+24(FP), R3 + +search_loop_encodeSnappyBetterBlockAsm10B: + MOVWU R2, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + LSRW $0x05, R5, R5 + ADD R5, R2, R5 + ADD $1, R5, R5 + MOVWU R5, R5 + MOVWU 16(RSP), R16 + CMPW R16, R5 + BHS emit_remainder_encodeSnappyBetterBlockAsm10B + MOVD (R3)(R2), R6 + MOVW R5, 28(RSP) + MOVD $0x0000cf1bbcdcbf9b, R8 + MOVD $0x9e3779b1, R5 + MOVD R6, R9 + MOVD R6, R10 + LSL $0x10, R9, R9 + MUL R8, R9, R9 + LSR $0x34, R9, R9 + LSL $0x20, R10, R10 + MUL R5, R10, R10 + LSR $0x36, R10, R10 + MOVWU (R0)(R9<<2), R5 + ADD R10<<2, R0, R15 + MOVWU 16384(R15), R7 + MOVW R2, (R0)(R9<<2) + ADD R10<<2, R0, R15 + MOVW R2, 16384(R15) + MOVD (R3)(R5), R9 + MOVD (R3)(R7), R10 + CMP R6, R9 + BEQ candidate_match_encodeSnappyBetterBlockAsm10B + CMP R6, R10 + BNE no_short_found_encodeSnappyBetterBlockAsm10B + MOVWU R7, R5 + JMP candidate_match_encodeSnappyBetterBlockAsm10B + +no_short_found_encodeSnappyBetterBlockAsm10B: + CMPW R6, R9 + BEQ candidate_match_encodeSnappyBetterBlockAsm10B + CMPW R6, R10 + BEQ candidateS_match_encodeSnappyBetterBlockAsm10B + MOVWU 28(RSP), R2 + JMP search_loop_encodeSnappyBetterBlockAsm10B + +candidateS_match_encodeSnappyBetterBlockAsm10B: + LSR $0x08, R6, R6 + MOVD R6, R9 + LSL $0x10, R9, R9 + MUL R8, R9, R9 + LSR $0x34, R9, R9 + MOVWU (R0)(R9<<2), R5 + ADDW $1, R2, R2 + MOVW R2, (R0)(R9<<2) + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate_match_encodeSnappyBetterBlockAsm10B + SUBW $1, R2, R2 + MOVWU R7, R5 + +candidate_match_encodeSnappyBetterBlockAsm10B: + MOVWU 20(RSP), R6 + TSTW R5, R5 + BEQ match_extend_back_end_encodeSnappyBetterBlockAsm10B + +match_extend_back_loop_encodeSnappyBetterBlockAsm10B: + CMPW R6, R2 + BLS match_extend_back_end_encodeSnappyBetterBlockAsm10B + ADD R5, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R7 + ADD R2, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + AND $0xff, R8, R16 + AND $0xff, R7, R15 + CMP R16, R15 + BNE match_extend_back_end_encodeSnappyBetterBlockAsm10B + SUB $1, R2, R2 + MOVWU R2, R2 + SUBSW $1, R5, R5 + BEQ match_extend_back_end_encodeSnappyBetterBlockAsm10B + JMP match_extend_back_loop_encodeSnappyBetterBlockAsm10B + +match_extend_back_end_encodeSnappyBetterBlockAsm10B: + MOVWU R2, R6 + MOVWU 20(RSP), R16 + SUBW R16, R6, R6 + ADD R6, R1, R6 + ADD $3, R6, R6 + MOVD 8(RSP), R16 + CMP R16, R6 + BLO match_dst_size_check_encodeSnappyBetterBlockAsm10B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_dst_size_check_encodeSnappyBetterBlockAsm10B: + MOVWU R2, R6 + ADDW $0x04, R2, R2 + ADDW $0x04, R5, R5 + MOVD src_len+32(FP), R7 + SUBW R2, R7, R7 + ADD R2, R3, R8 + ADD R5, R3, R9 + + // matchLen + MOVD $0, R11 + +matchlen_loopback_16_match_nolit_encodeSnappyBetterBlockAsm10B: + CMPW $0x10, R7 + BLO matchlen_match8_match_nolit_encodeSnappyBetterBlockAsm10B + MOVD (R8)(R11), R10 + ADD R11, R8, R15 + MOVD 8(R15), R12 + MOVD (R9)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_match_nolit_encodeSnappyBetterBlockAsm10B + ADD R11, R9, R15 + MOVD 8(R15), R16 + EOR R16, R12, R12 + TST R12, R12 + BNE matchlen_bsf_16match_nolit_encodeSnappyBetterBlockAsm10B + SUB $16, R7, R7 + MOVWU R7, R7 + ADD $16, R11, R11 + MOVWU R11, R11 + JMP matchlen_loopback_16_match_nolit_encodeSnappyBetterBlockAsm10B + +matchlen_bsf_16match_nolit_encodeSnappyBetterBlockAsm10B: + RBIT R12, R12 + CLZ R12, R12 + ASR $0x03, R12, R12 + ADD R12, R11, R11 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP match_nolit_end_encodeSnappyBetterBlockAsm10B + +matchlen_match8_match_nolit_encodeSnappyBetterBlockAsm10B: + CMPW $0x08, R7 + BLO matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm10B + MOVD (R8)(R11), R10 + MOVD (R9)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_match_nolit_encodeSnappyBetterBlockAsm10B + SUB $8, R7, R7 + MOVWU R7, R7 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm10B + +matchlen_bsf_8_match_nolit_encodeSnappyBetterBlockAsm10B: + RBIT R10, R10 + CLZ R10, R10 + ASR $0x03, R10, R10 + ADD R10, R11, R11 + MOVWU R11, R11 + JMP match_nolit_end_encodeSnappyBetterBlockAsm10B + +matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm10B: + CMPW $0x04, R7 + BLO matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm10B + MOVWU (R8)(R11), R10 + MOVWU (R9)(R11), R16 + CMPW R10, R16 + BNE matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm10B + SUB $4, R7, R7 + MOVWU R7, R7 + ADD $4, R11, R11 + MOVWU R11, R11 + +matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm10B: + CMPW $0x01, R7 + BEQ matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm10B + BLO match_nolit_end_encodeSnappyBetterBlockAsm10B + MOVHU (R8)(R11), R16 + BFI $0, R16, $16, R10 + ADD R11, R9, R15 + MOVHU (R15), R15 + AND $0xffff, R10, R16 + CMP R16, R15 + BNE matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm10B + ADD $2, R11, R11 + MOVWU R11, R11 + SUBSW $0x02, R7, R7 + BEQ match_nolit_end_encodeSnappyBetterBlockAsm10B + +matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm10B: + MOVBU (R8)(R11), R16 + BFI $0, R16, $8, R10 + ADD R11, R9, R15 + MOVBU (R15), R15 + AND $0xff, R10, R16 + CMP R16, R15 + BNE match_nolit_end_encodeSnappyBetterBlockAsm10B + ADD $1, R11, R11 + MOVWU R11, R11 + +match_nolit_end_encodeSnappyBetterBlockAsm10B: + MOVWU R2, R7 + SUBW R5, R7, R7 + + // Check if repeat + MOVW R7, 24(RSP) + MOVWU 20(RSP), R5 + CMPW R6, R5 + BEQ emit_literal_done_match_emit_encodeSnappyBetterBlockAsm10B + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R5, R3, R9 + SUBW R5, R8, R8 + SUB $1, R8, R5 + MOVWU R5, R5 + CMPW $0x3c, R5 + BLO one_byte_match_emit_encodeSnappyBetterBlockAsm10B + CMPW $0x00000100, R5 + BLO two_bytes_match_emit_encodeSnappyBetterBlockAsm10B + BLO three_bytes_match_emit_encodeSnappyBetterBlockAsm10B + +three_bytes_match_emit_encodeSnappyBetterBlockAsm10B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_match_emit_encodeSnappyBetterBlockAsm10B + +two_bytes_match_emit_encodeSnappyBetterBlockAsm10B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R5, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R5 + BLO memmove_match_emit_encodeSnappyBetterBlockAsm10B + JMP memmove_long_match_emit_encodeSnappyBetterBlockAsm10B + +one_byte_match_emit_encodeSnappyBetterBlockAsm10B: + LSLW $0x02, R5, R16 + BFI $0, R16, $8, R5 + MOVB R5, (R1) + ADD $0x01, R1, R1 + +memmove_match_emit_encodeSnappyBetterBlockAsm10B: + ADD R8, R1, R5 + + // genMemMoveShort + CMP $0x08, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm10B_memmove_move_8 + CMP $0x10, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm10B_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm10B_memmove_move_17through32 + JMP emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm10B_memmove_move_33through64 + +emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm10B_memmove_move_8: + MOVD (R9), R10 + MOVD R10, (R1) + JMP memmove_end_copy_match_emit_encodeSnappyBetterBlockAsm10B + +emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm10B_memmove_move_8through16: + MOVD (R9), R10 + ADD R8, R9, R15 + MOVD -8(R15), R9 + MOVD R10, (R1) + ADD R8, R1, R15 + MOVD R9, -8(R15) + JMP memmove_end_copy_match_emit_encodeSnappyBetterBlockAsm10B + +emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm10B_memmove_move_17through32: + FMOVQ (R9), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_match_emit_encodeSnappyBetterBlockAsm10B + +emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm10B_memmove_move_33through64: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + ADD R8, R9, R15 + FMOVQ -32(R15), F2 + ADD R8, R9, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_match_emit_encodeSnappyBetterBlockAsm10B: + MOVD R5, R1 + JMP emit_literal_done_match_emit_encodeSnappyBetterBlockAsm10B + +memmove_long_match_emit_encodeSnappyBetterBlockAsm10B: + ADD R8, R1, R5 + + // genMemMoveLong + MOVD R9, R10 + MOVD R1, R12 + MOVD R8, R13 + +emit_lit_memmove_long_match_emit_encodeSnappyBetterBlockAsm10Blarge_big_loop_back: + FMOVQ (R10), F0 + FMOVQ 16(R10), F1 + FMOVQ F0, (R12) + FMOVQ F1, 16(R12) + ADD $0x20, R10, R10 + ADD $0x20, R12, R12 + SUB $0x20, R13, R13 + CMP $0x20, R13 + BHS emit_lit_memmove_long_match_emit_encodeSnappyBetterBlockAsm10Blarge_big_loop_back + ADD R8, R9, R15 + FMOVQ -32(R15), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R5, R1 + +emit_literal_done_match_emit_encodeSnappyBetterBlockAsm10B: + ADDW R11, R2, R2 + ADDW $0x04, R11, R11 + MOVW R2, 20(RSP) + + // emitCopy +two_byte_offset_match_nolit_encodeSnappyBetterBlockAsm10B: + CMPW $0x40, R11 + BLS two_byte_offset_short_match_nolit_encodeSnappyBetterBlockAsm10B + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R7, 1(R1) + SUB $60, R11, R11 + MOVWU R11, R11 + ADD $0x03, R1, R1 + JMP two_byte_offset_match_nolit_encodeSnappyBetterBlockAsm10B + +two_byte_offset_short_match_nolit_encodeSnappyBetterBlockAsm10B: + MOVWU R11, R5 + LSLW $0x02, R5, R5 + CMPW $0x0c, R11 + BHS emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm10B + CMPW $0x00000800, R7 + BHS emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm10B + SUB $15, R5, R5 + MOVWU R5, R5 + MOVB R7, 1(R1) + LSRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeSnappyBetterBlockAsm10B + +emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm10B: + SUB $2, R5, R5 + MOVWU R5, R5 + MOVB R5, (R1) + MOVH R7, 1(R1) + ADD $0x03, R1, R1 + +match_nolit_emitcopy_end_encodeSnappyBetterBlockAsm10B: + MOVWU 16(RSP), R16 + CMPW R16, R2 + BHS emit_remainder_encodeSnappyBetterBlockAsm10B + MOVD 8(RSP), R16 + CMP R16, R1 + BLO match_nolit_dst_ok_encodeSnappyBetterBlockAsm10B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_nolit_dst_ok_encodeSnappyBetterBlockAsm10B: + MOVD $0x0000cf1bbcdcbf9b, R5 + MOVD $0x9e3779b1, R7 + ADD $1, R6, R6 + SUB $2, R2, R8 + MOVD (R3)(R6), R9 + ADD R6, R3, R15 + MOVD 1(R15), R10 + MOVD (R3)(R8), R11 + ADD R8, R3, R15 + MOVD 1(R15), R12 + LSL $0x10, R9, R9 + MUL R5, R9, R9 + LSR $0x34, R9, R9 + LSL $0x20, R10, R10 + MUL R7, R10, R10 + LSR $0x36, R10, R10 + LSL $0x10, R11, R11 + MUL R5, R11, R11 + LSR $0x34, R11, R11 + LSL $0x20, R12, R12 + MUL R7, R12, R12 + LSR $0x36, R12, R12 + ADD $1, R6, R7 + ADD $1, R8, R13 + MOVW R6, (R0)(R9<<2) + MOVW R8, (R0)(R11<<2) + ADD R10<<2, R0, R15 + MOVW R7, 16384(R15) + ADD R12<<2, R0, R15 + MOVW R13, 16384(R15) + ADD R6, R8, R7 + ADD $1, R7, R7 + LSR $0x01, R7, R7 + ADD $0x01, R6, R6 + SUB $0x01, R8, R8 + +index_loop_encodeSnappyBetterBlockAsm10B: + CMP R8, R7 + BHS search_loop_encodeSnappyBetterBlockAsm10B + MOVD (R3)(R6), R9 + MOVD (R3)(R7), R10 + LSL $0x10, R9, R9 + MUL R5, R9, R9 + LSR $0x34, R9, R9 + LSL $0x10, R10, R10 + MUL R5, R10, R10 + LSR $0x34, R10, R10 + MOVW R6, (R0)(R9<<2) + MOVW R7, (R0)(R10<<2) + ADD $0x02, R6, R6 + ADD $0x02, R7, R7 + JMP index_loop_encodeSnappyBetterBlockAsm10B + +emit_remainder_encodeSnappyBetterBlockAsm10B: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R16 + SUBW R16, R0, R0 + ADD R0, R1, R0 + ADD $3, R0, R0 + MOVD 8(RSP), R16 + CMP R16, R0 + BLO emit_remainder_ok_encodeSnappyBetterBlockAsm10B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +emit_remainder_ok_encodeSnappyBetterBlockAsm10B: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R2 + CMPW R0, R2 + BEQ emit_literal_done_emit_remainder_encodeSnappyBetterBlockAsm10B + MOVWU R0, R5 + MOVW R0, 20(RSP) + ADD R2, R3, R0 + SUBW R2, R5, R5 + SUB $1, R5, R2 + MOVWU R2, R2 + CMPW $0x3c, R2 + BLO one_byte_emit_remainder_encodeSnappyBetterBlockAsm10B + CMPW $0x00000100, R2 + BLO two_bytes_emit_remainder_encodeSnappyBetterBlockAsm10B + BLO three_bytes_emit_remainder_encodeSnappyBetterBlockAsm10B + +three_bytes_emit_remainder_encodeSnappyBetterBlockAsm10B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R2, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_emit_remainder_encodeSnappyBetterBlockAsm10B + +two_bytes_emit_remainder_encodeSnappyBetterBlockAsm10B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R2, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R2 + BLO memmove_emit_remainder_encodeSnappyBetterBlockAsm10B + JMP memmove_long_emit_remainder_encodeSnappyBetterBlockAsm10B + +one_byte_emit_remainder_encodeSnappyBetterBlockAsm10B: + LSLW $0x02, R2, R16 + BFI $0, R16, $8, R2 + MOVB R2, (R1) + ADD $0x01, R1, R1 + +memmove_emit_remainder_encodeSnappyBetterBlockAsm10B: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveShort + CMP $0x03, R3 + BLO emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm10B_memmove_move_1or2 + BEQ emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm10B_memmove_move_3 + CMP $0x08, R3 + BLO emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm10B_memmove_move_4through7 + CMP $0x10, R3 + BLS emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm10B_memmove_move_8through16 + CMP $0x20, R3 + BLS emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm10B_memmove_move_17through32 + JMP emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm10B_memmove_move_33through64 + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm10B_memmove_move_1or2: + MOVBU (R0), R16 + BFI $0, R16, $8, R5 + ADD R3, R0, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R0 + MOVB R5, (R1) + ADD R3, R1, R15 + MOVB R0, -1(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm10B + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm10B_memmove_move_3: + MOVHU (R0), R16 + BFI $0, R16, $16, R5 + MOVBU 2(R0), R16 + BFI $0, R16, $8, R0 + MOVH R5, (R1) + MOVB R0, 2(R1) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm10B + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm10B_memmove_move_4through7: + MOVWU (R0), R5 + ADD R3, R0, R15 + MOVWU -4(R15), R0 + MOVW R5, (R1) + ADD R3, R1, R15 + MOVW R0, -4(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm10B + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm10B_memmove_move_8through16: + MOVD (R0), R5 + ADD R3, R0, R15 + MOVD -8(R15), R0 + MOVD R5, (R1) + ADD R3, R1, R15 + MOVD R0, -8(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm10B + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm10B_memmove_move_17through32: + FMOVQ (R0), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm10B + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm10B_memmove_move_33through64: + FMOVQ (R0), F0 + FMOVQ 16(R0), F1 + ADD R3, R0, R15 + FMOVQ -32(R15), F2 + ADD R3, R0, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R3, R1, R15 + FMOVQ F2, -32(R15) + ADD R3, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm10B: + MOVD R2, R1 + JMP emit_literal_done_emit_remainder_encodeSnappyBetterBlockAsm10B + +memmove_long_emit_remainder_encodeSnappyBetterBlockAsm10B: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveLong + MOVD R0, R5 + MOVD R1, R6 + MOVD R3, R7 + +emit_lit_memmove_long_emit_remainder_encodeSnappyBetterBlockAsm10Blarge_big_loop_back: + FMOVQ (R5), F0 + FMOVQ 16(R5), F1 + FMOVQ F0, (R6) + FMOVQ F1, 16(R6) + ADD $0x20, R5, R5 + ADD $0x20, R6, R6 + SUB $0x20, R7, R7 + CMP $0x20, R7 + BHS emit_lit_memmove_long_emit_remainder_encodeSnappyBetterBlockAsm10Blarge_big_loop_back + ADD R3, R0, R15 + FMOVQ -32(R15), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + ADD R3, R1, R15 + FMOVQ F0, -32(R15) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + MOVD R2, R1 + +emit_literal_done_emit_remainder_encodeSnappyBetterBlockAsm10B: + MOVD dst_base+0(FP), R0 + SUB R0, R1, R1 + MOVD R1, ret+56(FP) + RET + +// func encodeSnappyBetterBlockAsm8B(dst []byte, src []byte, tmp *[5120]byte) int +// Requires: BMI, SSE2 +TEXT ·encodeSnappyBetterBlockAsm8B(SB), $24-64 + MOVD tmp+48(FP), R0 + MOVD dst_base+0(FP), R1 + MOVD $0x00000028, R2 + MOVD R0, R3 + VEOR V0.B16, V0.B16, V0.B16 + +zero_loop_encodeSnappyBetterBlockAsm8B: + FMOVQ F0, (R3) + FMOVQ F0, 16(R3) + FMOVQ F0, 32(R3) + FMOVQ F0, 48(R3) + FMOVQ F0, 64(R3) + FMOVQ F0, 80(R3) + FMOVQ F0, 96(R3) + FMOVQ F0, 112(R3) + ADD $0x80, R3, R3 + SUBS $1, R2, R2 + BNE zero_loop_encodeSnappyBetterBlockAsm8B + MOVD $0x00000000, R16 + MOVW R16, 20(RSP) + MOVD src_len+32(FP), R2 + SUB $9, R2, R3 + SUB $8, R2, R5 + MOVW R5, 16(RSP) + LSR $0x05, R2, R2 + SUBW R2, R3, R3 + ADD R3, R1, R3 + MOVD R3, 8(RSP) + MOVD $0x00000001, R2 + MOVD $0x00000000, R16 + MOVW R16, 24(RSP) + MOVD src_base+24(FP), R3 + +search_loop_encodeSnappyBetterBlockAsm8B: + MOVWU R2, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + LSRW $0x04, R5, R5 + ADD R5, R2, R5 + ADD $1, R5, R5 + MOVWU R5, R5 + MOVWU 16(RSP), R16 + CMPW R16, R5 + BHS emit_remainder_encodeSnappyBetterBlockAsm8B + MOVD (R3)(R2), R6 + MOVW R5, 28(RSP) + MOVD $0x0000cf1bbcdcbf9b, R8 + MOVD $0x9e3779b1, R5 + MOVD R6, R9 + MOVD R6, R10 + LSL $0x10, R9, R9 + MUL R8, R9, R9 + LSR $0x36, R9, R9 + LSL $0x20, R10, R10 + MUL R5, R10, R10 + LSR $0x38, R10, R10 + MOVWU (R0)(R9<<2), R5 + ADD R10<<2, R0, R15 + MOVWU 4096(R15), R7 + MOVW R2, (R0)(R9<<2) + ADD R10<<2, R0, R15 + MOVW R2, 4096(R15) + MOVD (R3)(R5), R9 + MOVD (R3)(R7), R10 + CMP R6, R9 + BEQ candidate_match_encodeSnappyBetterBlockAsm8B + CMP R6, R10 + BNE no_short_found_encodeSnappyBetterBlockAsm8B + MOVWU R7, R5 + JMP candidate_match_encodeSnappyBetterBlockAsm8B + +no_short_found_encodeSnappyBetterBlockAsm8B: + CMPW R6, R9 + BEQ candidate_match_encodeSnappyBetterBlockAsm8B + CMPW R6, R10 + BEQ candidateS_match_encodeSnappyBetterBlockAsm8B + MOVWU 28(RSP), R2 + JMP search_loop_encodeSnappyBetterBlockAsm8B + +candidateS_match_encodeSnappyBetterBlockAsm8B: + LSR $0x08, R6, R6 + MOVD R6, R9 + LSL $0x10, R9, R9 + MUL R8, R9, R9 + LSR $0x36, R9, R9 + MOVWU (R0)(R9<<2), R5 + ADDW $1, R2, R2 + MOVW R2, (R0)(R9<<2) + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate_match_encodeSnappyBetterBlockAsm8B + SUBW $1, R2, R2 + MOVWU R7, R5 + +candidate_match_encodeSnappyBetterBlockAsm8B: + MOVWU 20(RSP), R6 + TSTW R5, R5 + BEQ match_extend_back_end_encodeSnappyBetterBlockAsm8B + +match_extend_back_loop_encodeSnappyBetterBlockAsm8B: + CMPW R6, R2 + BLS match_extend_back_end_encodeSnappyBetterBlockAsm8B + ADD R5, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R7 + ADD R2, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + AND $0xff, R8, R16 + AND $0xff, R7, R15 + CMP R16, R15 + BNE match_extend_back_end_encodeSnappyBetterBlockAsm8B + SUB $1, R2, R2 + MOVWU R2, R2 + SUBSW $1, R5, R5 + BEQ match_extend_back_end_encodeSnappyBetterBlockAsm8B + JMP match_extend_back_loop_encodeSnappyBetterBlockAsm8B + +match_extend_back_end_encodeSnappyBetterBlockAsm8B: + MOVWU R2, R6 + MOVWU 20(RSP), R16 + SUBW R16, R6, R6 + ADD R6, R1, R6 + ADD $3, R6, R6 + MOVD 8(RSP), R16 + CMP R16, R6 + BLO match_dst_size_check_encodeSnappyBetterBlockAsm8B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_dst_size_check_encodeSnappyBetterBlockAsm8B: + MOVWU R2, R6 + ADDW $0x04, R2, R2 + ADDW $0x04, R5, R5 + MOVD src_len+32(FP), R7 + SUBW R2, R7, R7 + ADD R2, R3, R8 + ADD R5, R3, R9 + + // matchLen + MOVD $0, R11 + +matchlen_loopback_16_match_nolit_encodeSnappyBetterBlockAsm8B: + CMPW $0x10, R7 + BLO matchlen_match8_match_nolit_encodeSnappyBetterBlockAsm8B + MOVD (R8)(R11), R10 + ADD R11, R8, R15 + MOVD 8(R15), R12 + MOVD (R9)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_match_nolit_encodeSnappyBetterBlockAsm8B + ADD R11, R9, R15 + MOVD 8(R15), R16 + EOR R16, R12, R12 + TST R12, R12 + BNE matchlen_bsf_16match_nolit_encodeSnappyBetterBlockAsm8B + SUB $16, R7, R7 + MOVWU R7, R7 + ADD $16, R11, R11 + MOVWU R11, R11 + JMP matchlen_loopback_16_match_nolit_encodeSnappyBetterBlockAsm8B + +matchlen_bsf_16match_nolit_encodeSnappyBetterBlockAsm8B: + RBIT R12, R12 + CLZ R12, R12 + ASR $0x03, R12, R12 + ADD R12, R11, R11 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP match_nolit_end_encodeSnappyBetterBlockAsm8B + +matchlen_match8_match_nolit_encodeSnappyBetterBlockAsm8B: + CMPW $0x08, R7 + BLO matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm8B + MOVD (R8)(R11), R10 + MOVD (R9)(R11), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_8_match_nolit_encodeSnappyBetterBlockAsm8B + SUB $8, R7, R7 + MOVWU R7, R7 + ADD $8, R11, R11 + MOVWU R11, R11 + JMP matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm8B + +matchlen_bsf_8_match_nolit_encodeSnappyBetterBlockAsm8B: + RBIT R10, R10 + CLZ R10, R10 + ASR $0x03, R10, R10 + ADD R10, R11, R11 + MOVWU R11, R11 + JMP match_nolit_end_encodeSnappyBetterBlockAsm8B + +matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm8B: + CMPW $0x04, R7 + BLO matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm8B + MOVWU (R8)(R11), R10 + MOVWU (R9)(R11), R16 + CMPW R10, R16 + BNE matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm8B + SUB $4, R7, R7 + MOVWU R7, R7 + ADD $4, R11, R11 + MOVWU R11, R11 + +matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm8B: + CMPW $0x01, R7 + BEQ matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm8B + BLO match_nolit_end_encodeSnappyBetterBlockAsm8B + MOVHU (R8)(R11), R16 + BFI $0, R16, $16, R10 + ADD R11, R9, R15 + MOVHU (R15), R15 + AND $0xffff, R10, R16 + CMP R16, R15 + BNE matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm8B + ADD $2, R11, R11 + MOVWU R11, R11 + SUBSW $0x02, R7, R7 + BEQ match_nolit_end_encodeSnappyBetterBlockAsm8B + +matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm8B: + MOVBU (R8)(R11), R16 + BFI $0, R16, $8, R10 + ADD R11, R9, R15 + MOVBU (R15), R15 + AND $0xff, R10, R16 + CMP R16, R15 + BNE match_nolit_end_encodeSnappyBetterBlockAsm8B + ADD $1, R11, R11 + MOVWU R11, R11 + +match_nolit_end_encodeSnappyBetterBlockAsm8B: + MOVWU R2, R7 + SUBW R5, R7, R7 + + // Check if repeat + MOVW R7, 24(RSP) + MOVWU 20(RSP), R5 + CMPW R6, R5 + BEQ emit_literal_done_match_emit_encodeSnappyBetterBlockAsm8B + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R5, R3, R9 + SUBW R5, R8, R8 + SUB $1, R8, R5 + MOVWU R5, R5 + CMPW $0x3c, R5 + BLO one_byte_match_emit_encodeSnappyBetterBlockAsm8B + CMPW $0x00000100, R5 + BLO two_bytes_match_emit_encodeSnappyBetterBlockAsm8B + BLO three_bytes_match_emit_encodeSnappyBetterBlockAsm8B + +three_bytes_match_emit_encodeSnappyBetterBlockAsm8B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R5, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_match_emit_encodeSnappyBetterBlockAsm8B + +two_bytes_match_emit_encodeSnappyBetterBlockAsm8B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R5, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R5 + BLO memmove_match_emit_encodeSnappyBetterBlockAsm8B + JMP memmove_long_match_emit_encodeSnappyBetterBlockAsm8B + +one_byte_match_emit_encodeSnappyBetterBlockAsm8B: + LSLW $0x02, R5, R16 + BFI $0, R16, $8, R5 + MOVB R5, (R1) + ADD $0x01, R1, R1 + +memmove_match_emit_encodeSnappyBetterBlockAsm8B: + ADD R8, R1, R5 + + // genMemMoveShort + CMP $0x08, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm8B_memmove_move_8 + CMP $0x10, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm8B_memmove_move_8through16 + CMP $0x20, R8 + BLS emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm8B_memmove_move_17through32 + JMP emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm8B_memmove_move_33through64 + +emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm8B_memmove_move_8: + MOVD (R9), R10 + MOVD R10, (R1) + JMP memmove_end_copy_match_emit_encodeSnappyBetterBlockAsm8B + +emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm8B_memmove_move_8through16: + MOVD (R9), R10 + ADD R8, R9, R15 + MOVD -8(R15), R9 + MOVD R10, (R1) + ADD R8, R1, R15 + MOVD R9, -8(R15) + JMP memmove_end_copy_match_emit_encodeSnappyBetterBlockAsm8B + +emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm8B_memmove_move_17through32: + FMOVQ (R9), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_match_emit_encodeSnappyBetterBlockAsm8B + +emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm8B_memmove_move_33through64: + FMOVQ (R9), F0 + FMOVQ 16(R9), F1 + ADD R8, R9, R15 + FMOVQ -32(R15), F2 + ADD R8, R9, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R8, R1, R15 + FMOVQ F2, -32(R15) + ADD R8, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_match_emit_encodeSnappyBetterBlockAsm8B: + MOVD R5, R1 + JMP emit_literal_done_match_emit_encodeSnappyBetterBlockAsm8B + +memmove_long_match_emit_encodeSnappyBetterBlockAsm8B: + ADD R8, R1, R5 + + // genMemMoveLong + MOVD R9, R10 + MOVD R1, R12 + MOVD R8, R13 + +emit_lit_memmove_long_match_emit_encodeSnappyBetterBlockAsm8Blarge_big_loop_back: + FMOVQ (R10), F0 + FMOVQ 16(R10), F1 + FMOVQ F0, (R12) + FMOVQ F1, 16(R12) + ADD $0x20, R10, R10 + ADD $0x20, R12, R12 + SUB $0x20, R13, R13 + CMP $0x20, R13 + BHS emit_lit_memmove_long_match_emit_encodeSnappyBetterBlockAsm8Blarge_big_loop_back + ADD R8, R9, R15 + FMOVQ -32(R15), F0 + ADD R8, R9, R15 + FMOVQ -16(R15), F1 + ADD R8, R1, R15 + FMOVQ F0, -32(R15) + ADD R8, R1, R15 + FMOVQ F1, -16(R15) + MOVD R5, R1 + +emit_literal_done_match_emit_encodeSnappyBetterBlockAsm8B: + ADDW R11, R2, R2 + ADDW $0x04, R11, R11 + MOVW R2, 20(RSP) + + // emitCopy +two_byte_offset_match_nolit_encodeSnappyBetterBlockAsm8B: + CMPW $0x40, R11 + BLS two_byte_offset_short_match_nolit_encodeSnappyBetterBlockAsm8B + MOVD $0xee, R16 + MOVB R16, (R1) + MOVH R7, 1(R1) + SUB $60, R11, R11 + MOVWU R11, R11 + ADD $0x03, R1, R1 + JMP two_byte_offset_match_nolit_encodeSnappyBetterBlockAsm8B + +two_byte_offset_short_match_nolit_encodeSnappyBetterBlockAsm8B: + MOVWU R11, R5 + LSLW $0x02, R5, R5 + CMPW $0x0c, R11 + BHS emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm8B + SUB $15, R5, R5 + MOVWU R5, R5 + MOVB R7, 1(R1) + LSRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R5, R5 + MOVB R5, (R1) + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_encodeSnappyBetterBlockAsm8B + +emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm8B: + SUB $2, R5, R5 + MOVWU R5, R5 + MOVB R5, (R1) + MOVH R7, 1(R1) + ADD $0x03, R1, R1 + +match_nolit_emitcopy_end_encodeSnappyBetterBlockAsm8B: + MOVWU 16(RSP), R16 + CMPW R16, R2 + BHS emit_remainder_encodeSnappyBetterBlockAsm8B + MOVD 8(RSP), R16 + CMP R16, R1 + BLO match_nolit_dst_ok_encodeSnappyBetterBlockAsm8B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +match_nolit_dst_ok_encodeSnappyBetterBlockAsm8B: + MOVD $0x0000cf1bbcdcbf9b, R5 + MOVD $0x9e3779b1, R7 + ADD $1, R6, R6 + SUB $2, R2, R8 + MOVD (R3)(R6), R9 + ADD R6, R3, R15 + MOVD 1(R15), R10 + MOVD (R3)(R8), R11 + ADD R8, R3, R15 + MOVD 1(R15), R12 + LSL $0x10, R9, R9 + MUL R5, R9, R9 + LSR $0x36, R9, R9 + LSL $0x20, R10, R10 + MUL R7, R10, R10 + LSR $0x38, R10, R10 + LSL $0x10, R11, R11 + MUL R5, R11, R11 + LSR $0x36, R11, R11 + LSL $0x20, R12, R12 + MUL R7, R12, R12 + LSR $0x38, R12, R12 + ADD $1, R6, R7 + ADD $1, R8, R13 + MOVW R6, (R0)(R9<<2) + MOVW R8, (R0)(R11<<2) + ADD R10<<2, R0, R15 + MOVW R7, 4096(R15) + ADD R12<<2, R0, R15 + MOVW R13, 4096(R15) + ADD R6, R8, R7 + ADD $1, R7, R7 + LSR $0x01, R7, R7 + ADD $0x01, R6, R6 + SUB $0x01, R8, R8 + +index_loop_encodeSnappyBetterBlockAsm8B: + CMP R8, R7 + BHS search_loop_encodeSnappyBetterBlockAsm8B + MOVD (R3)(R6), R9 + MOVD (R3)(R7), R10 + LSL $0x10, R9, R9 + MUL R5, R9, R9 + LSR $0x36, R9, R9 + LSL $0x10, R10, R10 + MUL R5, R10, R10 + LSR $0x36, R10, R10 + MOVW R6, (R0)(R9<<2) + MOVW R7, (R0)(R10<<2) + ADD $0x02, R6, R6 + ADD $0x02, R7, R7 + JMP index_loop_encodeSnappyBetterBlockAsm8B + +emit_remainder_encodeSnappyBetterBlockAsm8B: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R16 + SUBW R16, R0, R0 + ADD R0, R1, R0 + ADD $3, R0, R0 + MOVD 8(RSP), R16 + CMP R16, R0 + BLO emit_remainder_ok_encodeSnappyBetterBlockAsm8B + MOVD $0x00000000, R16 + MOVD R16, ret+56(FP) + RET + +emit_remainder_ok_encodeSnappyBetterBlockAsm8B: + MOVD src_len+32(FP), R0 + MOVWU 20(RSP), R2 + CMPW R0, R2 + BEQ emit_literal_done_emit_remainder_encodeSnappyBetterBlockAsm8B + MOVWU R0, R5 + MOVW R0, 20(RSP) + ADD R2, R3, R0 + SUBW R2, R5, R5 + SUB $1, R5, R2 + MOVWU R2, R2 + CMPW $0x3c, R2 + BLO one_byte_emit_remainder_encodeSnappyBetterBlockAsm8B + CMPW $0x00000100, R2 + BLO two_bytes_emit_remainder_encodeSnappyBetterBlockAsm8B + BLO three_bytes_emit_remainder_encodeSnappyBetterBlockAsm8B + +three_bytes_emit_remainder_encodeSnappyBetterBlockAsm8B: + MOVD $0xf4, R16 + MOVB R16, (R1) + MOVH R2, 1(R1) + ADD $0x03, R1, R1 + JMP memmove_long_emit_remainder_encodeSnappyBetterBlockAsm8B + +two_bytes_emit_remainder_encodeSnappyBetterBlockAsm8B: + MOVD $0xf0, R16 + MOVB R16, (R1) + MOVB R2, 1(R1) + ADD $0x02, R1, R1 + CMPW $0x40, R2 + BLO memmove_emit_remainder_encodeSnappyBetterBlockAsm8B + JMP memmove_long_emit_remainder_encodeSnappyBetterBlockAsm8B + +one_byte_emit_remainder_encodeSnappyBetterBlockAsm8B: + LSLW $0x02, R2, R16 + BFI $0, R16, $8, R2 + MOVB R2, (R1) + ADD $0x01, R1, R1 + +memmove_emit_remainder_encodeSnappyBetterBlockAsm8B: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveShort + CMP $0x03, R3 + BLO emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm8B_memmove_move_1or2 + BEQ emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm8B_memmove_move_3 + CMP $0x08, R3 + BLO emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm8B_memmove_move_4through7 + CMP $0x10, R3 + BLS emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm8B_memmove_move_8through16 + CMP $0x20, R3 + BLS emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm8B_memmove_move_17through32 + JMP emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm8B_memmove_move_33through64 + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm8B_memmove_move_1or2: + MOVBU (R0), R16 + BFI $0, R16, $8, R5 + ADD R3, R0, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R0 + MOVB R5, (R1) + ADD R3, R1, R15 + MOVB R0, -1(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm8B + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm8B_memmove_move_3: + MOVHU (R0), R16 + BFI $0, R16, $16, R5 + MOVBU 2(R0), R16 + BFI $0, R16, $8, R0 + MOVH R5, (R1) + MOVB R0, 2(R1) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm8B + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm8B_memmove_move_4through7: + MOVWU (R0), R5 + ADD R3, R0, R15 + MOVWU -4(R15), R0 + MOVW R5, (R1) + ADD R3, R1, R15 + MOVW R0, -4(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm8B + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm8B_memmove_move_8through16: + MOVD (R0), R5 + ADD R3, R0, R15 + MOVD -8(R15), R0 + MOVD R5, (R1) + ADD R3, R1, R15 + MOVD R0, -8(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm8B + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm8B_memmove_move_17through32: + FMOVQ (R0), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R1) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm8B + +emit_lit_memmove_emit_remainder_encodeSnappyBetterBlockAsm8B_memmove_move_33through64: + FMOVQ (R0), F0 + FMOVQ 16(R0), F1 + ADD R3, R0, R15 + FMOVQ -32(R15), F2 + ADD R3, R0, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R1) + FMOVQ F1, 16(R1) + ADD R3, R1, R15 + FMOVQ F2, -32(R15) + ADD R3, R1, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_emit_remainder_encodeSnappyBetterBlockAsm8B: + MOVD R2, R1 + JMP emit_literal_done_emit_remainder_encodeSnappyBetterBlockAsm8B + +memmove_long_emit_remainder_encodeSnappyBetterBlockAsm8B: + ADD R5, R1, R2 + MOVWU R5, R3 + + // genMemMoveLong + MOVD R0, R5 + MOVD R1, R6 + MOVD R3, R7 + +emit_lit_memmove_long_emit_remainder_encodeSnappyBetterBlockAsm8Blarge_big_loop_back: + FMOVQ (R5), F0 + FMOVQ 16(R5), F1 + FMOVQ F0, (R6) + FMOVQ F1, 16(R6) + ADD $0x20, R5, R5 + ADD $0x20, R6, R6 + SUB $0x20, R7, R7 + CMP $0x20, R7 + BHS emit_lit_memmove_long_emit_remainder_encodeSnappyBetterBlockAsm8Blarge_big_loop_back + ADD R3, R0, R15 + FMOVQ -32(R15), F0 + ADD R3, R0, R15 + FMOVQ -16(R15), F1 + ADD R3, R1, R15 + FMOVQ F0, -32(R15) + ADD R3, R1, R15 + FMOVQ F1, -16(R15) + MOVD R2, R1 + +emit_literal_done_emit_remainder_encodeSnappyBetterBlockAsm8B: + MOVD dst_base+0(FP), R0 + SUB R0, R1, R1 + MOVD R1, ret+56(FP) + RET + +// func calcBlockSize(src []byte, tmp *[32768]byte) int +// Requires: BMI, SSE2 +TEXT ·calcBlockSize(SB), $24-40 + MOVD tmp+24(FP), R0 + MOVD $0, R1 + MOVD $0x00000100, R2 + MOVD R0, R3 + VEOR V0.B16, V0.B16, V0.B16 + +zero_loop_calcBlockSize: + FMOVQ F0, (R3) + FMOVQ F0, 16(R3) + FMOVQ F0, 32(R3) + FMOVQ F0, 48(R3) + FMOVQ F0, 64(R3) + FMOVQ F0, 80(R3) + FMOVQ F0, 96(R3) + FMOVQ F0, 112(R3) + ADD $0x80, R3, R3 + SUBS $1, R2, R2 + BNE zero_loop_calcBlockSize + MOVD $0x00000000, R16 + MOVW R16, 20(RSP) + MOVD src_len+8(FP), R2 + SUB $9, R2, R3 + SUB $8, R2, R5 + MOVW R5, 16(RSP) + LSR $0x05, R2, R2 + SUBW R2, R3, R3 + ADD R3, R1, R3 + MOVD R3, 8(RSP) + MOVD $0x00000001, R2 + MOVW R2, 24(RSP) + MOVD src_base+0(FP), R3 + +search_loop_calcBlockSize: + MOVWU R2, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + LSRW $0x05, R5, R5 + ADD R5, R2, R5 + ADD $4, R5, R5 + MOVWU R5, R5 + MOVWU 16(RSP), R16 + CMPW R16, R5 + BHS emit_remainder_calcBlockSize + MOVD (R3)(R2), R6 + MOVW R5, 28(RSP) + MOVD $0x0000cf1bbcdcbf9b, R8 + MOVD R6, R9 + MOVD R6, R10 + LSR $0x08, R10, R10 + LSL $0x10, R9, R9 + MUL R8, R9, R9 + LSR $0x33, R9, R9 + LSL $0x10, R10, R10 + MUL R8, R10, R10 + LSR $0x33, R10, R10 + MOVWU (R0)(R9<<2), R5 + MOVWU (R0)(R10<<2), R7 + MOVW R2, (R0)(R9<<2) + ADD $1, R2, R9 + MOVWU R9, R9 + MOVW R9, (R0)(R10<<2) + MOVD R6, R9 + LSR $0x10, R9, R9 + LSL $0x10, R9, R9 + MUL R8, R9, R9 + LSR $0x33, R9, R9 + MOVWU R2, R8 + MOVWU 24(RSP), R16 + SUBW R16, R8, R8 + ADD R8, R3, R15 + MOVWU 1(R15), R10 + MOVD R6, R8 + LSR $0x08, R8, R8 + CMPW R10, R8 + BNE no_repeat_found_calcBlockSize + ADD $1, R2, R6 + MOVWU R6, R6 + MOVWU 20(RSP), R5 + MOVWU R6, R7 + MOVWU 24(RSP), R16 + SUBSW R16, R7, R7 + BEQ repeat_extend_back_end_calcBlockSize + +repeat_extend_back_loop_calcBlockSize: + CMPW R5, R6 + BLS repeat_extend_back_end_calcBlockSize + ADD R7, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + ADD R6, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R9 + AND $0xff, R9, R16 + AND $0xff, R8, R15 + CMP R16, R15 + BNE repeat_extend_back_end_calcBlockSize + SUB $1, R6, R6 + MOVWU R6, R6 + SUBSW $1, R7, R7 + BNE repeat_extend_back_loop_calcBlockSize + +repeat_extend_back_end_calcBlockSize: + MOVWU R6, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + ADD R5, R1, R5 + ADD $5, R5, R5 + MOVD 8(RSP), R16 + CMP R16, R5 + BLO repeat_dst_size_check_calcBlockSize + MOVD $0x00000000, R16 + MOVD R16, ret+32(FP) + RET + +repeat_dst_size_check_calcBlockSize: + MOVWU 20(RSP), R5 + CMPW R6, R5 + BEQ emit_literal_done_repeat_emit_calcBlockSize + MOVWU R6, R7 + MOVW R6, 20(RSP) + ADD R5, R3, R8 + SUBW R5, R7, R7 + SUB $1, R7, R5 + MOVWU R5, R5 + CMPW $0x3c, R5 + BLO one_byte_repeat_emit_calcBlockSize + CMPW $0x00000100, R5 + BLO two_bytes_repeat_emit_calcBlockSize + CMPW $0x00010000, R5 + BLO three_bytes_repeat_emit_calcBlockSize + CMPW $0x01000000, R5 + BLO four_bytes_repeat_emit_calcBlockSize + ADD $0x05, R1, R1 + JMP memmove_long_repeat_emit_calcBlockSize + +four_bytes_repeat_emit_calcBlockSize: + ADD $0x04, R1, R1 + JMP memmove_long_repeat_emit_calcBlockSize + +three_bytes_repeat_emit_calcBlockSize: + ADD $0x03, R1, R1 + JMP memmove_long_repeat_emit_calcBlockSize + +two_bytes_repeat_emit_calcBlockSize: + ADD $0x02, R1, R1 + CMPW $0x40, R5 + BLO memmove_repeat_emit_calcBlockSize + JMP memmove_long_repeat_emit_calcBlockSize + +one_byte_repeat_emit_calcBlockSize: + ADD $0x01, R1, R1 + +memmove_repeat_emit_calcBlockSize: + ADD R7, R1, R1 + JMP emit_literal_done_repeat_emit_calcBlockSize + +memmove_long_repeat_emit_calcBlockSize: + ADD R7, R1, R1 + +emit_literal_done_repeat_emit_calcBlockSize: + ADDW $0x05, R2, R2 + MOVWU R2, R5 + MOVWU 24(RSP), R16 + SUBW R16, R5, R5 + MOVD src_len+8(FP), R7 + SUBW R2, R7, R7 + ADD R2, R3, R8 + ADD R5, R3, R5 + + // matchLen + MOVD $0, R10 + +matchlen_loopback_16_repeat_extend_calcBlockSize: + CMPW $0x10, R7 + BLO matchlen_match8_repeat_extend_calcBlockSize + MOVD (R8)(R10), R9 + ADD R10, R8, R15 + MOVD 8(R15), R11 + MOVD (R5)(R10), R16 + EOR R16, R9, R9 + TST R9, R9 + BNE matchlen_bsf_8_repeat_extend_calcBlockSize + ADD R10, R5, R15 + MOVD 8(R15), R16 + EOR R16, R11, R11 + TST R11, R11 + BNE matchlen_bsf_16repeat_extend_calcBlockSize + SUB $16, R7, R7 + MOVWU R7, R7 + ADD $16, R10, R10 + MOVWU R10, R10 + JMP matchlen_loopback_16_repeat_extend_calcBlockSize + +matchlen_bsf_16repeat_extend_calcBlockSize: + RBIT R11, R11 + CLZ R11, R11 + ASR $0x03, R11, R11 + ADD R11, R10, R10 + ADD $8, R10, R10 + MOVWU R10, R10 + JMP repeat_extend_forward_end_calcBlockSize + +matchlen_match8_repeat_extend_calcBlockSize: + CMPW $0x08, R7 + BLO matchlen_match4_repeat_extend_calcBlockSize + MOVD (R8)(R10), R9 + MOVD (R5)(R10), R16 + EOR R16, R9, R9 + TST R9, R9 + BNE matchlen_bsf_8_repeat_extend_calcBlockSize + SUB $8, R7, R7 + MOVWU R7, R7 + ADD $8, R10, R10 + MOVWU R10, R10 + JMP matchlen_match4_repeat_extend_calcBlockSize + +matchlen_bsf_8_repeat_extend_calcBlockSize: + RBIT R9, R9 + CLZ R9, R9 + ASR $0x03, R9, R9 + ADD R9, R10, R10 + MOVWU R10, R10 + JMP repeat_extend_forward_end_calcBlockSize + +matchlen_match4_repeat_extend_calcBlockSize: + CMPW $0x04, R7 + BLO matchlen_match2_repeat_extend_calcBlockSize + MOVWU (R8)(R10), R9 + MOVWU (R5)(R10), R16 + CMPW R9, R16 + BNE matchlen_match2_repeat_extend_calcBlockSize + SUB $4, R7, R7 + MOVWU R7, R7 + ADD $4, R10, R10 + MOVWU R10, R10 + +matchlen_match2_repeat_extend_calcBlockSize: + CMPW $0x01, R7 + BEQ matchlen_match1_repeat_extend_calcBlockSize + BLO repeat_extend_forward_end_calcBlockSize + MOVHU (R8)(R10), R16 + BFI $0, R16, $16, R9 + ADD R10, R5, R15 + MOVHU (R15), R15 + AND $0xffff, R9, R16 + CMP R16, R15 + BNE matchlen_match1_repeat_extend_calcBlockSize + ADD $2, R10, R10 + MOVWU R10, R10 + SUBSW $0x02, R7, R7 + BEQ repeat_extend_forward_end_calcBlockSize + +matchlen_match1_repeat_extend_calcBlockSize: + MOVBU (R8)(R10), R16 + BFI $0, R16, $8, R9 + ADD R10, R5, R15 + MOVBU (R15), R15 + AND $0xff, R9, R16 + CMP R16, R15 + BNE repeat_extend_forward_end_calcBlockSize + ADD $1, R10, R10 + MOVWU R10, R10 + +repeat_extend_forward_end_calcBlockSize: + ADDW R10, R2, R2 + MOVWU R2, R5 + SUBW R6, R5, R5 + MOVWU 24(RSP), R6 + + // emitCopy + CMPW $0x00010000, R6 + BLO two_byte_offset_repeat_as_copy_calcBlockSize + +four_bytes_loop_back_repeat_as_copy_calcBlockSize: + CMPW $0x40, R5 + BLS four_bytes_remain_repeat_as_copy_calcBlockSize + SUB $64, R5, R5 + MOVWU R5, R5 + ADD $0x05, R1, R1 + CMPW $0x04, R5 + BLO four_bytes_remain_repeat_as_copy_calcBlockSize + JMP four_bytes_loop_back_repeat_as_copy_calcBlockSize + +four_bytes_remain_repeat_as_copy_calcBlockSize: + TSTW R5, R5 + BEQ repeat_end_emit_calcBlockSize + MOVD $0, R5 + ADD $0x05, R1, R1 + JMP repeat_end_emit_calcBlockSize + +two_byte_offset_repeat_as_copy_calcBlockSize: + CMPW $0x40, R5 + BLS two_byte_offset_short_repeat_as_copy_calcBlockSize + SUB $60, R5, R5 + MOVWU R5, R5 + ADD $0x03, R1, R1 + JMP two_byte_offset_repeat_as_copy_calcBlockSize + +two_byte_offset_short_repeat_as_copy_calcBlockSize: + MOVWU R5, R7 + LSLW $0x02, R7, R7 + CMPW $0x0c, R5 + BHS emit_copy_three_repeat_as_copy_calcBlockSize + CMPW $0x00000800, R6 + BHS emit_copy_three_repeat_as_copy_calcBlockSize + ADD $0x02, R1, R1 + JMP repeat_end_emit_calcBlockSize + +emit_copy_three_repeat_as_copy_calcBlockSize: + ADD $0x03, R1, R1 + +repeat_end_emit_calcBlockSize: + MOVW R2, 20(RSP) + JMP search_loop_calcBlockSize + +no_repeat_found_calcBlockSize: + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate_match_calcBlockSize + LSR $0x08, R6, R6 + MOVWU (R0)(R9<<2), R5 + ADD $2, R2, R8 + MOVWU R8, R8 + MOVWU (R3)(R7), R16 + CMPW R6, R16 + BEQ candidate2_match_calcBlockSize + MOVW R8, (R0)(R9<<2) + LSR $0x08, R6, R6 + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate3_match_calcBlockSize + MOVWU 28(RSP), R2 + JMP search_loop_calcBlockSize + +candidate3_match_calcBlockSize: + ADDW $0x02, R2, R2 + JMP candidate_match_calcBlockSize + +candidate2_match_calcBlockSize: + MOVW R8, (R0)(R9<<2) + ADDW $1, R2, R2 + MOVWU R7, R5 + +candidate_match_calcBlockSize: + MOVWU 20(RSP), R6 + TSTW R5, R5 + BEQ match_extend_back_end_calcBlockSize + +match_extend_back_loop_calcBlockSize: + CMPW R6, R2 + BLS match_extend_back_end_calcBlockSize + ADD R5, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R7 + ADD R2, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + AND $0xff, R8, R16 + AND $0xff, R7, R15 + CMP R16, R15 + BNE match_extend_back_end_calcBlockSize + SUB $1, R2, R2 + MOVWU R2, R2 + SUBSW $1, R5, R5 + BEQ match_extend_back_end_calcBlockSize + JMP match_extend_back_loop_calcBlockSize + +match_extend_back_end_calcBlockSize: + MOVWU R2, R6 + MOVWU 20(RSP), R16 + SUBW R16, R6, R6 + ADD R6, R1, R6 + ADD $5, R6, R6 + MOVD 8(RSP), R16 + CMP R16, R6 + BLO match_dst_size_check_calcBlockSize + MOVD $0x00000000, R16 + MOVD R16, ret+32(FP) + RET + +match_dst_size_check_calcBlockSize: + MOVWU R2, R6 + MOVWU 20(RSP), R7 + CMPW R6, R7 + BEQ emit_literal_done_match_emit_calcBlockSize + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R7, R3, R6 + SUBW R7, R8, R8 + SUB $1, R8, R6 + MOVWU R6, R6 + CMPW $0x3c, R6 + BLO one_byte_match_emit_calcBlockSize + CMPW $0x00000100, R6 + BLO two_bytes_match_emit_calcBlockSize + CMPW $0x00010000, R6 + BLO three_bytes_match_emit_calcBlockSize + CMPW $0x01000000, R6 + BLO four_bytes_match_emit_calcBlockSize + ADD $0x05, R1, R1 + JMP memmove_long_match_emit_calcBlockSize + +four_bytes_match_emit_calcBlockSize: + ADD $0x04, R1, R1 + JMP memmove_long_match_emit_calcBlockSize + +three_bytes_match_emit_calcBlockSize: + ADD $0x03, R1, R1 + JMP memmove_long_match_emit_calcBlockSize + +two_bytes_match_emit_calcBlockSize: + ADD $0x02, R1, R1 + CMPW $0x40, R6 + BLO memmove_match_emit_calcBlockSize + JMP memmove_long_match_emit_calcBlockSize + +one_byte_match_emit_calcBlockSize: + ADD $0x01, R1, R1 + +memmove_match_emit_calcBlockSize: + ADD R8, R1, R1 + JMP emit_literal_done_match_emit_calcBlockSize + +memmove_long_match_emit_calcBlockSize: + ADD R8, R1, R1 + +emit_literal_done_match_emit_calcBlockSize: +match_nolit_loop_calcBlockSize: + MOVWU R2, R6 + SUBW R5, R6, R6 + MOVW R6, 24(RSP) + ADDW $0x04, R2, R2 + ADDW $0x04, R5, R5 + MOVD src_len+8(FP), R6 + SUBW R2, R6, R6 + ADD R2, R3, R7 + ADD R5, R3, R5 + + // matchLen + MOVD $0, R9 + +matchlen_loopback_16_match_nolit_calcBlockSize: + CMPW $0x10, R6 + BLO matchlen_match8_match_nolit_calcBlockSize + MOVD (R7)(R9), R8 + ADD R9, R7, R15 + MOVD 8(R15), R10 + MOVD (R5)(R9), R16 + EOR R16, R8, R8 + TST R8, R8 + BNE matchlen_bsf_8_match_nolit_calcBlockSize + ADD R9, R5, R15 + MOVD 8(R15), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_16match_nolit_calcBlockSize + SUB $16, R6, R6 + MOVWU R6, R6 + ADD $16, R9, R9 + MOVWU R9, R9 + JMP matchlen_loopback_16_match_nolit_calcBlockSize + +matchlen_bsf_16match_nolit_calcBlockSize: + RBIT R10, R10 + CLZ R10, R10 + ASR $0x03, R10, R10 + ADD R10, R9, R9 + ADD $8, R9, R9 + MOVWU R9, R9 + JMP match_nolit_end_calcBlockSize + +matchlen_match8_match_nolit_calcBlockSize: + CMPW $0x08, R6 + BLO matchlen_match4_match_nolit_calcBlockSize + MOVD (R7)(R9), R8 + MOVD (R5)(R9), R16 + EOR R16, R8, R8 + TST R8, R8 + BNE matchlen_bsf_8_match_nolit_calcBlockSize + SUB $8, R6, R6 + MOVWU R6, R6 + ADD $8, R9, R9 + MOVWU R9, R9 + JMP matchlen_match4_match_nolit_calcBlockSize + +matchlen_bsf_8_match_nolit_calcBlockSize: + RBIT R8, R8 + CLZ R8, R8 + ASR $0x03, R8, R8 + ADD R8, R9, R9 + MOVWU R9, R9 + JMP match_nolit_end_calcBlockSize + +matchlen_match4_match_nolit_calcBlockSize: + CMPW $0x04, R6 + BLO matchlen_match2_match_nolit_calcBlockSize + MOVWU (R7)(R9), R8 + MOVWU (R5)(R9), R16 + CMPW R8, R16 + BNE matchlen_match2_match_nolit_calcBlockSize + SUB $4, R6, R6 + MOVWU R6, R6 + ADD $4, R9, R9 + MOVWU R9, R9 + +matchlen_match2_match_nolit_calcBlockSize: + CMPW $0x01, R6 + BEQ matchlen_match1_match_nolit_calcBlockSize + BLO match_nolit_end_calcBlockSize + MOVHU (R7)(R9), R16 + BFI $0, R16, $16, R8 + ADD R9, R5, R15 + MOVHU (R15), R15 + AND $0xffff, R8, R16 + CMP R16, R15 + BNE matchlen_match1_match_nolit_calcBlockSize + ADD $2, R9, R9 + MOVWU R9, R9 + SUBSW $0x02, R6, R6 + BEQ match_nolit_end_calcBlockSize + +matchlen_match1_match_nolit_calcBlockSize: + MOVBU (R7)(R9), R16 + BFI $0, R16, $8, R8 + ADD R9, R5, R15 + MOVBU (R15), R15 + AND $0xff, R8, R16 + CMP R16, R15 + BNE match_nolit_end_calcBlockSize + ADD $1, R9, R9 + MOVWU R9, R9 + +match_nolit_end_calcBlockSize: + ADDW R9, R2, R2 + MOVWU 24(RSP), R5 + ADDW $0x04, R9, R9 + MOVW R2, 20(RSP) + + // emitCopy + CMPW $0x00010000, R5 + BLO two_byte_offset_match_nolit_calcBlockSize + +four_bytes_loop_back_match_nolit_calcBlockSize: + CMPW $0x40, R9 + BLS four_bytes_remain_match_nolit_calcBlockSize + SUB $64, R9, R9 + MOVWU R9, R9 + ADD $0x05, R1, R1 + CMPW $0x04, R9 + BLO four_bytes_remain_match_nolit_calcBlockSize + JMP four_bytes_loop_back_match_nolit_calcBlockSize + +four_bytes_remain_match_nolit_calcBlockSize: + TSTW R9, R9 + BEQ match_nolit_emitcopy_end_calcBlockSize + MOVD $0, R5 + ADD $0x05, R1, R1 + JMP match_nolit_emitcopy_end_calcBlockSize + +two_byte_offset_match_nolit_calcBlockSize: + CMPW $0x40, R9 + BLS two_byte_offset_short_match_nolit_calcBlockSize + SUB $60, R9, R9 + MOVWU R9, R9 + ADD $0x03, R1, R1 + JMP two_byte_offset_match_nolit_calcBlockSize + +two_byte_offset_short_match_nolit_calcBlockSize: + MOVWU R9, R6 + LSLW $0x02, R6, R6 + CMPW $0x0c, R9 + BHS emit_copy_three_match_nolit_calcBlockSize + CMPW $0x00000800, R5 + BHS emit_copy_three_match_nolit_calcBlockSize + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_calcBlockSize + +emit_copy_three_match_nolit_calcBlockSize: + ADD $0x03, R1, R1 + +match_nolit_emitcopy_end_calcBlockSize: + MOVWU 16(RSP), R16 + CMPW R16, R2 + BHS emit_remainder_calcBlockSize + ADD R2, R3, R15 + MOVD -2(R15), R6 + MOVD 8(RSP), R16 + CMP R16, R1 + BLO match_nolit_dst_ok_calcBlockSize + MOVD $0x00000000, R16 + MOVD R16, ret+32(FP) + RET + +match_nolit_dst_ok_calcBlockSize: + MOVD $0x0000cf1bbcdcbf9b, R8 + MOVD R6, R7 + LSR $0x10, R6, R6 + MOVD R6, R5 + LSL $0x10, R7, R7 + MUL R8, R7, R7 + LSR $0x33, R7, R7 + LSL $0x10, R5, R5 + MUL R8, R5, R5 + LSR $0x33, R5, R5 + SUB $2, R2, R8 + MOVWU R8, R8 + ADD R5<<2, R0, R9 + MOVWU (R9), R5 + MOVW R8, (R0)(R7<<2) + MOVW R2, (R9) + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ match_nolit_loop_calcBlockSize + ADDW $1, R2, R2 + JMP search_loop_calcBlockSize + +emit_remainder_calcBlockSize: + MOVD src_len+8(FP), R0 + MOVWU 20(RSP), R16 + SUBW R16, R0, R0 + ADD R0, R1, R0 + ADD $5, R0, R0 + MOVD 8(RSP), R16 + CMP R16, R0 + BLO emit_remainder_ok_calcBlockSize + MOVD $0x00000000, R16 + MOVD R16, ret+32(FP) + RET + +emit_remainder_ok_calcBlockSize: + MOVD src_len+8(FP), R0 + MOVWU 20(RSP), R2 + CMPW R0, R2 + BEQ emit_literal_done_emit_remainder_calcBlockSize + MOVWU R0, R5 + MOVW R0, 20(RSP) + ADD R2, R3, R0 + SUBW R2, R5, R5 + SUB $1, R5, R0 + MOVWU R0, R0 + CMPW $0x3c, R0 + BLO one_byte_emit_remainder_calcBlockSize + CMPW $0x00000100, R0 + BLO two_bytes_emit_remainder_calcBlockSize + CMPW $0x00010000, R0 + BLO three_bytes_emit_remainder_calcBlockSize + CMPW $0x01000000, R0 + BLO four_bytes_emit_remainder_calcBlockSize + ADD $0x05, R1, R1 + JMP memmove_long_emit_remainder_calcBlockSize + +four_bytes_emit_remainder_calcBlockSize: + ADD $0x04, R1, R1 + JMP memmove_long_emit_remainder_calcBlockSize + +three_bytes_emit_remainder_calcBlockSize: + ADD $0x03, R1, R1 + JMP memmove_long_emit_remainder_calcBlockSize + +two_bytes_emit_remainder_calcBlockSize: + ADD $0x02, R1, R1 + CMPW $0x40, R0 + BLO memmove_emit_remainder_calcBlockSize + JMP memmove_long_emit_remainder_calcBlockSize + +one_byte_emit_remainder_calcBlockSize: + ADD $0x01, R1, R1 + +memmove_emit_remainder_calcBlockSize: + ADD R5, R1, R0 + MOVD R0, R1 + JMP emit_literal_done_emit_remainder_calcBlockSize + +memmove_long_emit_remainder_calcBlockSize: + ADD R5, R1, R0 + MOVD R0, R1 + +emit_literal_done_emit_remainder_calcBlockSize: + MOVD R1, ret+32(FP) + RET + +// func calcBlockSizeSmall(src []byte, tmp *[2048]byte) int +// Requires: BMI, SSE2 +TEXT ·calcBlockSizeSmall(SB), $24-40 + MOVD tmp+24(FP), R0 + MOVD $0, R1 + MOVD $0x00000010, R2 + MOVD R0, R3 + VEOR V0.B16, V0.B16, V0.B16 + +zero_loop_calcBlockSizeSmall: + FMOVQ F0, (R3) + FMOVQ F0, 16(R3) + FMOVQ F0, 32(R3) + FMOVQ F0, 48(R3) + FMOVQ F0, 64(R3) + FMOVQ F0, 80(R3) + FMOVQ F0, 96(R3) + FMOVQ F0, 112(R3) + ADD $0x80, R3, R3 + SUBS $1, R2, R2 + BNE zero_loop_calcBlockSizeSmall + MOVD $0x00000000, R16 + MOVW R16, 20(RSP) + MOVD src_len+8(FP), R2 + SUB $9, R2, R3 + SUB $8, R2, R5 + MOVW R5, 16(RSP) + LSR $0x05, R2, R2 + SUBW R2, R3, R3 + ADD R3, R1, R3 + MOVD R3, 8(RSP) + MOVD $0x00000001, R2 + MOVW R2, 24(RSP) + MOVD src_base+0(FP), R3 + +search_loop_calcBlockSizeSmall: + MOVWU R2, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + LSRW $0x04, R5, R5 + ADD R5, R2, R5 + ADD $4, R5, R5 + MOVWU R5, R5 + MOVWU 16(RSP), R16 + CMPW R16, R5 + BHS emit_remainder_calcBlockSizeSmall + MOVD (R3)(R2), R6 + MOVW R5, 28(RSP) + MOVD $0x9e3779b1, R8 + MOVD R6, R9 + MOVD R6, R10 + LSR $0x08, R10, R10 + LSL $0x20, R9, R9 + MUL R8, R9, R9 + LSR $0x37, R9, R9 + LSL $0x20, R10, R10 + MUL R8, R10, R10 + LSR $0x37, R10, R10 + MOVWU (R0)(R9<<2), R5 + MOVWU (R0)(R10<<2), R7 + MOVW R2, (R0)(R9<<2) + ADD $1, R2, R9 + MOVWU R9, R9 + MOVW R9, (R0)(R10<<2) + MOVD R6, R9 + LSR $0x10, R9, R9 + LSL $0x20, R9, R9 + MUL R8, R9, R9 + LSR $0x37, R9, R9 + MOVWU R2, R8 + MOVWU 24(RSP), R16 + SUBW R16, R8, R8 + ADD R8, R3, R15 + MOVWU 1(R15), R10 + MOVD R6, R8 + LSR $0x08, R8, R8 + CMPW R10, R8 + BNE no_repeat_found_calcBlockSizeSmall + ADD $1, R2, R6 + MOVWU R6, R6 + MOVWU 20(RSP), R5 + MOVWU R6, R7 + MOVWU 24(RSP), R16 + SUBSW R16, R7, R7 + BEQ repeat_extend_back_end_calcBlockSizeSmall + +repeat_extend_back_loop_calcBlockSizeSmall: + CMPW R5, R6 + BLS repeat_extend_back_end_calcBlockSizeSmall + ADD R7, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + ADD R6, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R9 + AND $0xff, R9, R16 + AND $0xff, R8, R15 + CMP R16, R15 + BNE repeat_extend_back_end_calcBlockSizeSmall + SUB $1, R6, R6 + MOVWU R6, R6 + SUBSW $1, R7, R7 + BNE repeat_extend_back_loop_calcBlockSizeSmall + +repeat_extend_back_end_calcBlockSizeSmall: + MOVWU R6, R5 + MOVWU 20(RSP), R16 + SUBW R16, R5, R5 + ADD R5, R1, R5 + ADD $3, R5, R5 + MOVD 8(RSP), R16 + CMP R16, R5 + BLO repeat_dst_size_check_calcBlockSizeSmall + MOVD $0x00000000, R16 + MOVD R16, ret+32(FP) + RET + +repeat_dst_size_check_calcBlockSizeSmall: + MOVWU 20(RSP), R5 + CMPW R6, R5 + BEQ emit_literal_done_repeat_emit_calcBlockSizeSmall + MOVWU R6, R7 + MOVW R6, 20(RSP) + ADD R5, R3, R8 + SUBW R5, R7, R7 + SUB $1, R7, R5 + MOVWU R5, R5 + CMPW $0x3c, R5 + BLO one_byte_repeat_emit_calcBlockSizeSmall + CMPW $0x00000100, R5 + BLO two_bytes_repeat_emit_calcBlockSizeSmall + BLO three_bytes_repeat_emit_calcBlockSizeSmall + +three_bytes_repeat_emit_calcBlockSizeSmall: + ADD $0x03, R1, R1 + JMP memmove_long_repeat_emit_calcBlockSizeSmall + +two_bytes_repeat_emit_calcBlockSizeSmall: + ADD $0x02, R1, R1 + CMPW $0x40, R5 + BLO memmove_repeat_emit_calcBlockSizeSmall + JMP memmove_long_repeat_emit_calcBlockSizeSmall + +one_byte_repeat_emit_calcBlockSizeSmall: + ADD $0x01, R1, R1 + +memmove_repeat_emit_calcBlockSizeSmall: + ADD R7, R1, R1 + JMP emit_literal_done_repeat_emit_calcBlockSizeSmall + +memmove_long_repeat_emit_calcBlockSizeSmall: + ADD R7, R1, R1 + +emit_literal_done_repeat_emit_calcBlockSizeSmall: + ADDW $0x05, R2, R2 + MOVWU R2, R5 + MOVWU 24(RSP), R16 + SUBW R16, R5, R5 + MOVD src_len+8(FP), R7 + SUBW R2, R7, R7 + ADD R2, R3, R8 + ADD R5, R3, R5 + + // matchLen + MOVD $0, R10 + +matchlen_loopback_16_repeat_extend_calcBlockSizeSmall: + CMPW $0x10, R7 + BLO matchlen_match8_repeat_extend_calcBlockSizeSmall + MOVD (R8)(R10), R9 + ADD R10, R8, R15 + MOVD 8(R15), R11 + MOVD (R5)(R10), R16 + EOR R16, R9, R9 + TST R9, R9 + BNE matchlen_bsf_8_repeat_extend_calcBlockSizeSmall + ADD R10, R5, R15 + MOVD 8(R15), R16 + EOR R16, R11, R11 + TST R11, R11 + BNE matchlen_bsf_16repeat_extend_calcBlockSizeSmall + SUB $16, R7, R7 + MOVWU R7, R7 + ADD $16, R10, R10 + MOVWU R10, R10 + JMP matchlen_loopback_16_repeat_extend_calcBlockSizeSmall + +matchlen_bsf_16repeat_extend_calcBlockSizeSmall: + RBIT R11, R11 + CLZ R11, R11 + ASR $0x03, R11, R11 + ADD R11, R10, R10 + ADD $8, R10, R10 + MOVWU R10, R10 + JMP repeat_extend_forward_end_calcBlockSizeSmall + +matchlen_match8_repeat_extend_calcBlockSizeSmall: + CMPW $0x08, R7 + BLO matchlen_match4_repeat_extend_calcBlockSizeSmall + MOVD (R8)(R10), R9 + MOVD (R5)(R10), R16 + EOR R16, R9, R9 + TST R9, R9 + BNE matchlen_bsf_8_repeat_extend_calcBlockSizeSmall + SUB $8, R7, R7 + MOVWU R7, R7 + ADD $8, R10, R10 + MOVWU R10, R10 + JMP matchlen_match4_repeat_extend_calcBlockSizeSmall + +matchlen_bsf_8_repeat_extend_calcBlockSizeSmall: + RBIT R9, R9 + CLZ R9, R9 + ASR $0x03, R9, R9 + ADD R9, R10, R10 + MOVWU R10, R10 + JMP repeat_extend_forward_end_calcBlockSizeSmall + +matchlen_match4_repeat_extend_calcBlockSizeSmall: + CMPW $0x04, R7 + BLO matchlen_match2_repeat_extend_calcBlockSizeSmall + MOVWU (R8)(R10), R9 + MOVWU (R5)(R10), R16 + CMPW R9, R16 + BNE matchlen_match2_repeat_extend_calcBlockSizeSmall + SUB $4, R7, R7 + MOVWU R7, R7 + ADD $4, R10, R10 + MOVWU R10, R10 + +matchlen_match2_repeat_extend_calcBlockSizeSmall: + CMPW $0x01, R7 + BEQ matchlen_match1_repeat_extend_calcBlockSizeSmall + BLO repeat_extend_forward_end_calcBlockSizeSmall + MOVHU (R8)(R10), R16 + BFI $0, R16, $16, R9 + ADD R10, R5, R15 + MOVHU (R15), R15 + AND $0xffff, R9, R16 + CMP R16, R15 + BNE matchlen_match1_repeat_extend_calcBlockSizeSmall + ADD $2, R10, R10 + MOVWU R10, R10 + SUBSW $0x02, R7, R7 + BEQ repeat_extend_forward_end_calcBlockSizeSmall + +matchlen_match1_repeat_extend_calcBlockSizeSmall: + MOVBU (R8)(R10), R16 + BFI $0, R16, $8, R9 + ADD R10, R5, R15 + MOVBU (R15), R15 + AND $0xff, R9, R16 + CMP R16, R15 + BNE repeat_extend_forward_end_calcBlockSizeSmall + ADD $1, R10, R10 + MOVWU R10, R10 + +repeat_extend_forward_end_calcBlockSizeSmall: + ADDW R10, R2, R2 + MOVWU R2, R5 + SUBW R6, R5, R5 + MOVWU 24(RSP), R6 + + // emitCopy +two_byte_offset_repeat_as_copy_calcBlockSizeSmall: + CMPW $0x40, R5 + BLS two_byte_offset_short_repeat_as_copy_calcBlockSizeSmall + SUB $60, R5, R5 + MOVWU R5, R5 + ADD $0x03, R1, R1 + JMP two_byte_offset_repeat_as_copy_calcBlockSizeSmall + +two_byte_offset_short_repeat_as_copy_calcBlockSizeSmall: + MOVWU R5, R6 + LSLW $0x02, R6, R6 + CMPW $0x0c, R5 + BHS emit_copy_three_repeat_as_copy_calcBlockSizeSmall + ADD $0x02, R1, R1 + JMP repeat_end_emit_calcBlockSizeSmall + +emit_copy_three_repeat_as_copy_calcBlockSizeSmall: + ADD $0x03, R1, R1 + +repeat_end_emit_calcBlockSizeSmall: + MOVW R2, 20(RSP) + JMP search_loop_calcBlockSizeSmall + +no_repeat_found_calcBlockSizeSmall: + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate_match_calcBlockSizeSmall + LSR $0x08, R6, R6 + MOVWU (R0)(R9<<2), R5 + ADD $2, R2, R8 + MOVWU R8, R8 + MOVWU (R3)(R7), R16 + CMPW R6, R16 + BEQ candidate2_match_calcBlockSizeSmall + MOVW R8, (R0)(R9<<2) + LSR $0x08, R6, R6 + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ candidate3_match_calcBlockSizeSmall + MOVWU 28(RSP), R2 + JMP search_loop_calcBlockSizeSmall + +candidate3_match_calcBlockSizeSmall: + ADDW $0x02, R2, R2 + JMP candidate_match_calcBlockSizeSmall + +candidate2_match_calcBlockSizeSmall: + MOVW R8, (R0)(R9<<2) + ADDW $1, R2, R2 + MOVWU R7, R5 + +candidate_match_calcBlockSizeSmall: + MOVWU 20(RSP), R6 + TSTW R5, R5 + BEQ match_extend_back_end_calcBlockSizeSmall + +match_extend_back_loop_calcBlockSizeSmall: + CMPW R6, R2 + BLS match_extend_back_end_calcBlockSizeSmall + ADD R5, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R7 + ADD R2, R3, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R8 + AND $0xff, R8, R16 + AND $0xff, R7, R15 + CMP R16, R15 + BNE match_extend_back_end_calcBlockSizeSmall + SUB $1, R2, R2 + MOVWU R2, R2 + SUBSW $1, R5, R5 + BEQ match_extend_back_end_calcBlockSizeSmall + JMP match_extend_back_loop_calcBlockSizeSmall + +match_extend_back_end_calcBlockSizeSmall: + MOVWU R2, R6 + MOVWU 20(RSP), R16 + SUBW R16, R6, R6 + ADD R6, R1, R6 + ADD $3, R6, R6 + MOVD 8(RSP), R16 + CMP R16, R6 + BLO match_dst_size_check_calcBlockSizeSmall + MOVD $0x00000000, R16 + MOVD R16, ret+32(FP) + RET + +match_dst_size_check_calcBlockSizeSmall: + MOVWU R2, R6 + MOVWU 20(RSP), R7 + CMPW R6, R7 + BEQ emit_literal_done_match_emit_calcBlockSizeSmall + MOVWU R6, R8 + MOVW R6, 20(RSP) + ADD R7, R3, R6 + SUBW R7, R8, R8 + SUB $1, R8, R6 + MOVWU R6, R6 + CMPW $0x3c, R6 + BLO one_byte_match_emit_calcBlockSizeSmall + CMPW $0x00000100, R6 + BLO two_bytes_match_emit_calcBlockSizeSmall + BLO three_bytes_match_emit_calcBlockSizeSmall + +three_bytes_match_emit_calcBlockSizeSmall: + ADD $0x03, R1, R1 + JMP memmove_long_match_emit_calcBlockSizeSmall + +two_bytes_match_emit_calcBlockSizeSmall: + ADD $0x02, R1, R1 + CMPW $0x40, R6 + BLO memmove_match_emit_calcBlockSizeSmall + JMP memmove_long_match_emit_calcBlockSizeSmall + +one_byte_match_emit_calcBlockSizeSmall: + ADD $0x01, R1, R1 + +memmove_match_emit_calcBlockSizeSmall: + ADD R8, R1, R1 + JMP emit_literal_done_match_emit_calcBlockSizeSmall + +memmove_long_match_emit_calcBlockSizeSmall: + ADD R8, R1, R1 + +emit_literal_done_match_emit_calcBlockSizeSmall: +match_nolit_loop_calcBlockSizeSmall: + MOVWU R2, R6 + SUBW R5, R6, R6 + MOVW R6, 24(RSP) + ADDW $0x04, R2, R2 + ADDW $0x04, R5, R5 + MOVD src_len+8(FP), R6 + SUBW R2, R6, R6 + ADD R2, R3, R7 + ADD R5, R3, R5 + + // matchLen + MOVD $0, R9 + +matchlen_loopback_16_match_nolit_calcBlockSizeSmall: + CMPW $0x10, R6 + BLO matchlen_match8_match_nolit_calcBlockSizeSmall + MOVD (R7)(R9), R8 + ADD R9, R7, R15 + MOVD 8(R15), R10 + MOVD (R5)(R9), R16 + EOR R16, R8, R8 + TST R8, R8 + BNE matchlen_bsf_8_match_nolit_calcBlockSizeSmall + ADD R9, R5, R15 + MOVD 8(R15), R16 + EOR R16, R10, R10 + TST R10, R10 + BNE matchlen_bsf_16match_nolit_calcBlockSizeSmall + SUB $16, R6, R6 + MOVWU R6, R6 + ADD $16, R9, R9 + MOVWU R9, R9 + JMP matchlen_loopback_16_match_nolit_calcBlockSizeSmall + +matchlen_bsf_16match_nolit_calcBlockSizeSmall: + RBIT R10, R10 + CLZ R10, R10 + ASR $0x03, R10, R10 + ADD R10, R9, R9 + ADD $8, R9, R9 + MOVWU R9, R9 + JMP match_nolit_end_calcBlockSizeSmall + +matchlen_match8_match_nolit_calcBlockSizeSmall: + CMPW $0x08, R6 + BLO matchlen_match4_match_nolit_calcBlockSizeSmall + MOVD (R7)(R9), R8 + MOVD (R5)(R9), R16 + EOR R16, R8, R8 + TST R8, R8 + BNE matchlen_bsf_8_match_nolit_calcBlockSizeSmall + SUB $8, R6, R6 + MOVWU R6, R6 + ADD $8, R9, R9 + MOVWU R9, R9 + JMP matchlen_match4_match_nolit_calcBlockSizeSmall + +matchlen_bsf_8_match_nolit_calcBlockSizeSmall: + RBIT R8, R8 + CLZ R8, R8 + ASR $0x03, R8, R8 + ADD R8, R9, R9 + MOVWU R9, R9 + JMP match_nolit_end_calcBlockSizeSmall + +matchlen_match4_match_nolit_calcBlockSizeSmall: + CMPW $0x04, R6 + BLO matchlen_match2_match_nolit_calcBlockSizeSmall + MOVWU (R7)(R9), R8 + MOVWU (R5)(R9), R16 + CMPW R8, R16 + BNE matchlen_match2_match_nolit_calcBlockSizeSmall + SUB $4, R6, R6 + MOVWU R6, R6 + ADD $4, R9, R9 + MOVWU R9, R9 + +matchlen_match2_match_nolit_calcBlockSizeSmall: + CMPW $0x01, R6 + BEQ matchlen_match1_match_nolit_calcBlockSizeSmall + BLO match_nolit_end_calcBlockSizeSmall + MOVHU (R7)(R9), R16 + BFI $0, R16, $16, R8 + ADD R9, R5, R15 + MOVHU (R15), R15 + AND $0xffff, R8, R16 + CMP R16, R15 + BNE matchlen_match1_match_nolit_calcBlockSizeSmall + ADD $2, R9, R9 + MOVWU R9, R9 + SUBSW $0x02, R6, R6 + BEQ match_nolit_end_calcBlockSizeSmall + +matchlen_match1_match_nolit_calcBlockSizeSmall: + MOVBU (R7)(R9), R16 + BFI $0, R16, $8, R8 + ADD R9, R5, R15 + MOVBU (R15), R15 + AND $0xff, R8, R16 + CMP R16, R15 + BNE match_nolit_end_calcBlockSizeSmall + ADD $1, R9, R9 + MOVWU R9, R9 + +match_nolit_end_calcBlockSizeSmall: + ADDW R9, R2, R2 + MOVWU 24(RSP), R5 + ADDW $0x04, R9, R9 + MOVW R2, 20(RSP) + + // emitCopy +two_byte_offset_match_nolit_calcBlockSizeSmall: + CMPW $0x40, R9 + BLS two_byte_offset_short_match_nolit_calcBlockSizeSmall + SUB $60, R9, R9 + MOVWU R9, R9 + ADD $0x03, R1, R1 + JMP two_byte_offset_match_nolit_calcBlockSizeSmall + +two_byte_offset_short_match_nolit_calcBlockSizeSmall: + MOVWU R9, R5 + LSLW $0x02, R5, R5 + CMPW $0x0c, R9 + BHS emit_copy_three_match_nolit_calcBlockSizeSmall + ADD $0x02, R1, R1 + JMP match_nolit_emitcopy_end_calcBlockSizeSmall + +emit_copy_three_match_nolit_calcBlockSizeSmall: + ADD $0x03, R1, R1 + +match_nolit_emitcopy_end_calcBlockSizeSmall: + MOVWU 16(RSP), R16 + CMPW R16, R2 + BHS emit_remainder_calcBlockSizeSmall + ADD R2, R3, R15 + MOVD -2(R15), R6 + MOVD 8(RSP), R16 + CMP R16, R1 + BLO match_nolit_dst_ok_calcBlockSizeSmall + MOVD $0x00000000, R16 + MOVD R16, ret+32(FP) + RET + +match_nolit_dst_ok_calcBlockSizeSmall: + MOVD $0x9e3779b1, R8 + MOVD R6, R7 + LSR $0x10, R6, R6 + MOVD R6, R5 + LSL $0x20, R7, R7 + MUL R8, R7, R7 + LSR $0x37, R7, R7 + LSL $0x20, R5, R5 + MUL R8, R5, R5 + LSR $0x37, R5, R5 + SUB $2, R2, R8 + MOVWU R8, R8 + ADD R5<<2, R0, R9 + MOVWU (R9), R5 + MOVW R8, (R0)(R7<<2) + MOVW R2, (R9) + MOVWU (R3)(R5), R16 + CMPW R6, R16 + BEQ match_nolit_loop_calcBlockSizeSmall + ADDW $1, R2, R2 + JMP search_loop_calcBlockSizeSmall + +emit_remainder_calcBlockSizeSmall: + MOVD src_len+8(FP), R0 + MOVWU 20(RSP), R16 + SUBW R16, R0, R0 + ADD R0, R1, R0 + ADD $3, R0, R0 + MOVD 8(RSP), R16 + CMP R16, R0 + BLO emit_remainder_ok_calcBlockSizeSmall + MOVD $0x00000000, R16 + MOVD R16, ret+32(FP) + RET + +emit_remainder_ok_calcBlockSizeSmall: + MOVD src_len+8(FP), R0 + MOVWU 20(RSP), R2 + CMPW R0, R2 + BEQ emit_literal_done_emit_remainder_calcBlockSizeSmall + MOVWU R0, R5 + MOVW R0, 20(RSP) + ADD R2, R3, R0 + SUBW R2, R5, R5 + SUB $1, R5, R0 + MOVWU R0, R0 + CMPW $0x3c, R0 + BLO one_byte_emit_remainder_calcBlockSizeSmall + CMPW $0x00000100, R0 + BLO two_bytes_emit_remainder_calcBlockSizeSmall + BLO three_bytes_emit_remainder_calcBlockSizeSmall + +three_bytes_emit_remainder_calcBlockSizeSmall: + ADD $0x03, R1, R1 + JMP memmove_long_emit_remainder_calcBlockSizeSmall + +two_bytes_emit_remainder_calcBlockSizeSmall: + ADD $0x02, R1, R1 + CMPW $0x40, R0 + BLO memmove_emit_remainder_calcBlockSizeSmall + JMP memmove_long_emit_remainder_calcBlockSizeSmall + +one_byte_emit_remainder_calcBlockSizeSmall: + ADD $0x01, R1, R1 + +memmove_emit_remainder_calcBlockSizeSmall: + ADD R5, R1, R0 + MOVD R0, R1 + JMP emit_literal_done_emit_remainder_calcBlockSizeSmall + +memmove_long_emit_remainder_calcBlockSizeSmall: + ADD R5, R1, R0 + MOVD R0, R1 + +emit_literal_done_emit_remainder_calcBlockSizeSmall: + MOVD R1, ret+32(FP) + RET + +// func emitLiteral(dst []byte, lit []byte) int +// Requires: SSE2 +TEXT ·emitLiteral(SB), NOSPLIT, $0-56 + MOVD lit_len+32(FP), R2 + MOVD dst_base+0(FP), R0 + MOVD lit_base+24(FP), R1 + TST R2, R2 + BEQ emit_literal_end_standalone_skip + MOVWU R2, R3 + SUB $1, R2, R5 + MOVWU R5, R5 + CMPW $0x3c, R5 + BLO one_byte_standalone + CMPW $0x00000100, R5 + BLO two_bytes_standalone + CMPW $0x00010000, R5 + BLO three_bytes_standalone + CMPW $0x01000000, R5 + BLO four_bytes_standalone + MOVD $0xfc, R16 + MOVB R16, (R0) + MOVW R5, 1(R0) + ADD $0x05, R3, R3 + ADD $0x05, R0, R0 + JMP memmove_long_standalone + +four_bytes_standalone: + MOVWU R5, R6 + LSRW $0x10, R6, R6 + MOVD $0xf8, R16 + MOVB R16, (R0) + MOVH R5, 1(R0) + MOVB R6, 3(R0) + ADD $0x04, R3, R3 + ADD $0x04, R0, R0 + JMP memmove_long_standalone + +three_bytes_standalone: + MOVD $0xf4, R16 + MOVB R16, (R0) + MOVH R5, 1(R0) + ADD $0x03, R3, R3 + ADD $0x03, R0, R0 + JMP memmove_long_standalone + +two_bytes_standalone: + MOVD $0xf0, R16 + MOVB R16, (R0) + MOVB R5, 1(R0) + ADD $0x02, R3, R3 + ADD $0x02, R0, R0 + CMPW $0x40, R5 + BLO memmove_standalone + JMP memmove_long_standalone + +one_byte_standalone: + LSLW $0x02, R5, R16 + BFI $0, R16, $8, R5 + MOVB R5, (R0) + ADD $0x01, R3, R3 + ADD $0x01, R0, R0 + +memmove_standalone: + // genMemMoveShort + CMP $0x03, R2 + BLO emit_lit_memmove_standalone_memmove_move_1or2 + BEQ emit_lit_memmove_standalone_memmove_move_3 + CMP $0x08, R2 + BLO emit_lit_memmove_standalone_memmove_move_4through7 + CMP $0x10, R2 + BLS emit_lit_memmove_standalone_memmove_move_8through16 + CMP $0x20, R2 + BLS emit_lit_memmove_standalone_memmove_move_17through32 + JMP emit_lit_memmove_standalone_memmove_move_33through64 + +emit_lit_memmove_standalone_memmove_move_1or2: + MOVBU (R1), R16 + BFI $0, R16, $8, R5 + ADD R2, R1, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R1 + MOVB R5, (R0) + ADD R2, R0, R15 + MOVB R1, -1(R15) + JMP emit_literal_end_standalone + +emit_lit_memmove_standalone_memmove_move_3: + MOVHU (R1), R16 + BFI $0, R16, $16, R5 + MOVBU 2(R1), R16 + BFI $0, R16, $8, R1 + MOVH R5, (R0) + MOVB R1, 2(R0) + JMP emit_literal_end_standalone + +emit_lit_memmove_standalone_memmove_move_4through7: + MOVWU (R1), R5 + ADD R2, R1, R15 + MOVWU -4(R15), R1 + MOVW R5, (R0) + ADD R2, R0, R15 + MOVW R1, -4(R15) + JMP emit_literal_end_standalone + +emit_lit_memmove_standalone_memmove_move_8through16: + MOVD (R1), R5 + ADD R2, R1, R15 + MOVD -8(R15), R1 + MOVD R5, (R0) + ADD R2, R0, R15 + MOVD R1, -8(R15) + JMP emit_literal_end_standalone + +emit_lit_memmove_standalone_memmove_move_17through32: + FMOVQ (R1), F0 + ADD R2, R1, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R0) + ADD R2, R0, R15 + FMOVQ F1, -16(R15) + JMP emit_literal_end_standalone + +emit_lit_memmove_standalone_memmove_move_33through64: + FMOVQ (R1), F0 + FMOVQ 16(R1), F1 + ADD R2, R1, R15 + FMOVQ -32(R15), F2 + ADD R2, R1, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R0) + FMOVQ F1, 16(R0) + ADD R2, R0, R15 + FMOVQ F2, -32(R15) + ADD R2, R0, R15 + FMOVQ F3, -16(R15) + JMP emit_literal_end_standalone + JMP emit_literal_end_standalone + +memmove_long_standalone: + // genMemMoveLong + MOVD R1, R5 + MOVD R0, R6 + MOVD R2, R7 + +emit_lit_memmove_long_standalonelarge_big_loop_back: + FMOVQ (R5), F0 + FMOVQ 16(R5), F1 + FMOVQ F0, (R6) + FMOVQ F1, 16(R6) + ADD $0x20, R5, R5 + ADD $0x20, R6, R6 + SUB $0x20, R7, R7 + CMP $0x20, R7 + BHS emit_lit_memmove_long_standalonelarge_big_loop_back + ADD R2, R1, R15 + FMOVQ -32(R15), F0 + ADD R2, R1, R15 + FMOVQ -16(R15), F1 + ADD R2, R0, R15 + FMOVQ F0, -32(R15) + ADD R2, R0, R15 + FMOVQ F1, -16(R15) + JMP emit_literal_end_standalone + JMP emit_literal_end_standalone + +emit_literal_end_standalone_skip: + MOVD $0, R3 + +emit_literal_end_standalone: + MOVD R3, ret+48(FP) + RET + +// func emitRepeat(dst []byte, offset int, length int) int +TEXT ·emitRepeat(SB), NOSPLIT, $0-48 + MOVD $0, R3 + MOVD dst_base+0(FP), R0 + MOVD offset+24(FP), R1 + MOVD length+32(FP), R2 + + // emitRepeat +emit_repeat_again_standalone: + MOVWU R2, R5 + SUB $4, R2, R2 + MOVWU R2, R2 + CMPW $0x08, R5 + BLS repeat_two_standalone + CMPW $0x0c, R5 + BHS cant_repeat_two_offset_standalone + CMPW $0x00000800, R1 + BLO repeat_two_offset_standalone + +cant_repeat_two_offset_standalone: + CMPW $0x00000104, R2 + BLO repeat_three_standalone + CMPW $0x00010100, R2 + BLO repeat_four_standalone + CMPW $0x0100ffff, R2 + BLO repeat_five_standalone + SUB $16842747, R2, R2 + MOVWU R2, R2 + MOVD $0xfffb001d, R16 + MOVW R16, (R0) + MOVD $0xff, R16 + MOVB R16, 4(R0) + ADD $0x05, R0, R0 + ADD $0x05, R3, R3 + JMP emit_repeat_again_standalone + +repeat_five_standalone: + SUB $65536, R2, R2 + MOVWU R2, R2 + MOVWU R2, R1 + MOVD $0x001d, R16 + MOVH R16, (R0) + MOVH R2, 2(R0) + ASRW $0x10, R1, R1 + MOVB R1, 4(R0) + ADD $0x05, R3, R3 + ADD $0x05, R0, R0 + JMP gen_emit_repeat_end + +repeat_four_standalone: + SUB $256, R2, R2 + MOVWU R2, R2 + MOVD $0x0019, R16 + MOVH R16, (R0) + MOVH R2, 2(R0) + ADD $0x04, R3, R3 + ADD $0x04, R0, R0 + JMP gen_emit_repeat_end + +repeat_three_standalone: + SUB $4, R2, R2 + MOVWU R2, R2 + MOVD $0x0015, R16 + MOVH R16, (R0) + MOVB R2, 2(R0) + ADD $0x03, R3, R3 + ADD $0x03, R0, R0 + JMP gen_emit_repeat_end + +repeat_two_standalone: + LSLW $0x02, R2, R2 + ORRW $0x01, R2, R2 + MOVH R2, (R0) + ADD $0x02, R3, R3 + ADD $0x02, R0, R0 + JMP gen_emit_repeat_end + +repeat_two_offset_standalone: + MOVD $0, R5 + ADD R2<<2, R5, R2 + ADD $1, R2, R2 + MOVWU R2, R2 + MOVB R1, 1(R0) + ASRW $0x08, R1, R1 + LSLW $0x05, R1, R1 + ORRW R1, R2, R2 + MOVB R2, (R0) + ADD $0x02, R3, R3 + ADD $0x02, R0, R0 + +gen_emit_repeat_end: + MOVD R3, ret+40(FP) + RET + +// func emitCopy(dst []byte, offset int, length int) int +TEXT ·emitCopy(SB), NOSPLIT, $0-48 + MOVD $0, R3 + MOVD dst_base+0(FP), R0 + MOVD offset+24(FP), R1 + MOVD length+32(FP), R2 + + // emitCopy + CMPW $0x00010000, R1 + BLO two_byte_offset_standalone + CMPW $0x40, R2 + BLS four_bytes_remain_standalone + MOVD $0xff, R16 + MOVB R16, (R0) + MOVW R1, 1(R0) + SUB $64, R2, R2 + MOVWU R2, R2 + ADD $0x05, R3, R3 + ADD $0x05, R0, R0 + CMPW $0x04, R2 + BLO four_bytes_remain_standalone + + // emitRepeat +emit_repeat_again_standalone_emit_copy: + MOVWU R2, R5 + SUB $4, R2, R2 + MOVWU R2, R2 + CMPW $0x08, R5 + BLS repeat_two_standalone_emit_copy + CMPW $0x0c, R5 + BHS cant_repeat_two_offset_standalone_emit_copy + CMPW $0x00000800, R1 + BLO repeat_two_offset_standalone_emit_copy + +cant_repeat_two_offset_standalone_emit_copy: + CMPW $0x00000104, R2 + BLO repeat_three_standalone_emit_copy + CMPW $0x00010100, R2 + BLO repeat_four_standalone_emit_copy + CMPW $0x0100ffff, R2 + BLO repeat_five_standalone_emit_copy + SUB $16842747, R2, R2 + MOVWU R2, R2 + MOVD $0xfffb001d, R16 + MOVW R16, (R0) + MOVD $0xff, R16 + MOVB R16, 4(R0) + ADD $0x05, R0, R0 + ADD $0x05, R3, R3 + JMP emit_repeat_again_standalone_emit_copy + +repeat_five_standalone_emit_copy: + SUB $65536, R2, R2 + MOVWU R2, R2 + MOVWU R2, R1 + MOVD $0x001d, R16 + MOVH R16, (R0) + MOVH R2, 2(R0) + ASRW $0x10, R1, R1 + MOVB R1, 4(R0) + ADD $0x05, R3, R3 + ADD $0x05, R0, R0 + JMP gen_emit_copy_end + +repeat_four_standalone_emit_copy: + SUB $256, R2, R2 + MOVWU R2, R2 + MOVD $0x0019, R16 + MOVH R16, (R0) + MOVH R2, 2(R0) + ADD $0x04, R3, R3 + ADD $0x04, R0, R0 + JMP gen_emit_copy_end + +repeat_three_standalone_emit_copy: + SUB $4, R2, R2 + MOVWU R2, R2 + MOVD $0x0015, R16 + MOVH R16, (R0) + MOVB R2, 2(R0) + ADD $0x03, R3, R3 + ADD $0x03, R0, R0 + JMP gen_emit_copy_end + +repeat_two_standalone_emit_copy: + LSLW $0x02, R2, R2 + ORRW $0x01, R2, R2 + MOVH R2, (R0) + ADD $0x02, R3, R3 + ADD $0x02, R0, R0 + JMP gen_emit_copy_end + +repeat_two_offset_standalone_emit_copy: + MOVD $0, R5 + ADD R2<<2, R5, R2 + ADD $1, R2, R2 + MOVWU R2, R2 + MOVB R1, 1(R0) + ASRW $0x08, R1, R1 + LSLW $0x05, R1, R1 + ORRW R1, R2, R2 + MOVB R2, (R0) + ADD $0x02, R3, R3 + ADD $0x02, R0, R0 + JMP gen_emit_copy_end + +four_bytes_remain_standalone: + TSTW R2, R2 + BEQ gen_emit_copy_end + MOVD $0, R5 + ADD R2<<2, R5, R2 + SUB $1, R2, R2 + MOVWU R2, R2 + MOVB R2, (R0) + MOVW R1, 1(R0) + ADD $0x05, R3, R3 + ADD $0x05, R0, R0 + JMP gen_emit_copy_end + +two_byte_offset_standalone: + CMPW $0x40, R2 + BLS two_byte_offset_short_standalone + CMPW $0x00000800, R1 + BHS long_offset_short_standalone + MOVD $0x00000001, R5 + ADD $16, R5, R5 + MOVWU R5, R5 + MOVB R1, 1(R0) + MOVWU R1, R6 + LSRW $0x08, R6, R6 + LSLW $0x05, R6, R6 + ORRW R6, R5, R5 + MOVB R5, (R0) + ADD $0x02, R3, R3 + ADD $0x02, R0, R0 + SUBW $0x08, R2, R2 + + // emitRepeat + SUB $4, R2, R2 + MOVWU R2, R2 + JMP cant_repeat_two_offset_standalone_emit_copy_short_2b + +emit_repeat_again_standalone_emit_copy_short_2b: + MOVWU R2, R5 + SUB $4, R2, R2 + MOVWU R2, R2 + CMPW $0x08, R5 + BLS repeat_two_standalone_emit_copy_short_2b + CMPW $0x0c, R5 + BHS cant_repeat_two_offset_standalone_emit_copy_short_2b + CMPW $0x00000800, R1 + BLO repeat_two_offset_standalone_emit_copy_short_2b + +cant_repeat_two_offset_standalone_emit_copy_short_2b: + CMPW $0x00000104, R2 + BLO repeat_three_standalone_emit_copy_short_2b + CMPW $0x00010100, R2 + BLO repeat_four_standalone_emit_copy_short_2b + CMPW $0x0100ffff, R2 + BLO repeat_five_standalone_emit_copy_short_2b + SUB $16842747, R2, R2 + MOVWU R2, R2 + MOVD $0xfffb001d, R16 + MOVW R16, (R0) + MOVD $0xff, R16 + MOVB R16, 4(R0) + ADD $0x05, R0, R0 + ADD $0x05, R3, R3 + JMP emit_repeat_again_standalone_emit_copy_short_2b + +repeat_five_standalone_emit_copy_short_2b: + SUB $65536, R2, R2 + MOVWU R2, R2 + MOVWU R2, R1 + MOVD $0x001d, R16 + MOVH R16, (R0) + MOVH R2, 2(R0) + ASRW $0x10, R1, R1 + MOVB R1, 4(R0) + ADD $0x05, R3, R3 + ADD $0x05, R0, R0 + JMP gen_emit_copy_end + +repeat_four_standalone_emit_copy_short_2b: + SUB $256, R2, R2 + MOVWU R2, R2 + MOVD $0x0019, R16 + MOVH R16, (R0) + MOVH R2, 2(R0) + ADD $0x04, R3, R3 + ADD $0x04, R0, R0 + JMP gen_emit_copy_end + +repeat_three_standalone_emit_copy_short_2b: + SUB $4, R2, R2 + MOVWU R2, R2 + MOVD $0x0015, R16 + MOVH R16, (R0) + MOVB R2, 2(R0) + ADD $0x03, R3, R3 + ADD $0x03, R0, R0 + JMP gen_emit_copy_end + +repeat_two_standalone_emit_copy_short_2b: + LSLW $0x02, R2, R2 + ORRW $0x01, R2, R2 + MOVH R2, (R0) + ADD $0x02, R3, R3 + ADD $0x02, R0, R0 + JMP gen_emit_copy_end + +repeat_two_offset_standalone_emit_copy_short_2b: + MOVD $0, R5 + ADD R2<<2, R5, R2 + ADD $1, R2, R2 + MOVWU R2, R2 + MOVB R1, 1(R0) + ASRW $0x08, R1, R1 + LSLW $0x05, R1, R1 + ORRW R1, R2, R2 + MOVB R2, (R0) + ADD $0x02, R3, R3 + ADD $0x02, R0, R0 + JMP gen_emit_copy_end + +long_offset_short_standalone: + MOVD $0xee, R16 + MOVB R16, (R0) + MOVH R1, 1(R0) + SUB $60, R2, R2 + MOVWU R2, R2 + ADD $0x03, R0, R0 + ADD $0x03, R3, R3 + + // emitRepeat +emit_repeat_again_standalone_emit_copy_short: + MOVWU R2, R5 + SUB $4, R2, R2 + MOVWU R2, R2 + CMPW $0x08, R5 + BLS repeat_two_standalone_emit_copy_short + CMPW $0x0c, R5 + BHS cant_repeat_two_offset_standalone_emit_copy_short + CMPW $0x00000800, R1 + BLO repeat_two_offset_standalone_emit_copy_short + +cant_repeat_two_offset_standalone_emit_copy_short: + CMPW $0x00000104, R2 + BLO repeat_three_standalone_emit_copy_short + CMPW $0x00010100, R2 + BLO repeat_four_standalone_emit_copy_short + CMPW $0x0100ffff, R2 + BLO repeat_five_standalone_emit_copy_short + SUB $16842747, R2, R2 + MOVWU R2, R2 + MOVD $0xfffb001d, R16 + MOVW R16, (R0) + MOVD $0xff, R16 + MOVB R16, 4(R0) + ADD $0x05, R0, R0 + ADD $0x05, R3, R3 + JMP emit_repeat_again_standalone_emit_copy_short + +repeat_five_standalone_emit_copy_short: + SUB $65536, R2, R2 + MOVWU R2, R2 + MOVWU R2, R1 + MOVD $0x001d, R16 + MOVH R16, (R0) + MOVH R2, 2(R0) + ASRW $0x10, R1, R1 + MOVB R1, 4(R0) + ADD $0x05, R3, R3 + ADD $0x05, R0, R0 + JMP gen_emit_copy_end + +repeat_four_standalone_emit_copy_short: + SUB $256, R2, R2 + MOVWU R2, R2 + MOVD $0x0019, R16 + MOVH R16, (R0) + MOVH R2, 2(R0) + ADD $0x04, R3, R3 + ADD $0x04, R0, R0 + JMP gen_emit_copy_end + +repeat_three_standalone_emit_copy_short: + SUB $4, R2, R2 + MOVWU R2, R2 + MOVD $0x0015, R16 + MOVH R16, (R0) + MOVB R2, 2(R0) + ADD $0x03, R3, R3 + ADD $0x03, R0, R0 + JMP gen_emit_copy_end + +repeat_two_standalone_emit_copy_short: + LSLW $0x02, R2, R2 + ORRW $0x01, R2, R2 + MOVH R2, (R0) + ADD $0x02, R3, R3 + ADD $0x02, R0, R0 + JMP gen_emit_copy_end + +repeat_two_offset_standalone_emit_copy_short: + MOVD $0, R5 + ADD R2<<2, R5, R2 + ADD $1, R2, R2 + MOVWU R2, R2 + MOVB R1, 1(R0) + ASRW $0x08, R1, R1 + LSLW $0x05, R1, R1 + ORRW R1, R2, R2 + MOVB R2, (R0) + ADD $0x02, R3, R3 + ADD $0x02, R0, R0 + JMP gen_emit_copy_end + +two_byte_offset_short_standalone: + MOVWU R2, R5 + LSLW $0x02, R5, R5 + CMPW $0x0c, R2 + BHS emit_copy_three_standalone + CMPW $0x00000800, R1 + BHS emit_copy_three_standalone + SUB $15, R5, R5 + MOVWU R5, R5 + MOVB R1, 1(R0) + LSRW $0x08, R1, R1 + LSLW $0x05, R1, R1 + ORRW R1, R5, R5 + MOVB R5, (R0) + ADD $0x02, R3, R3 + ADD $0x02, R0, R0 + JMP gen_emit_copy_end + +emit_copy_three_standalone: + SUB $2, R5, R5 + MOVWU R5, R5 + MOVB R5, (R0) + MOVH R1, 1(R0) + ADD $0x03, R3, R3 + ADD $0x03, R0, R0 + +gen_emit_copy_end: + MOVD R3, ret+40(FP) + RET + +// func emitCopyNoRepeat(dst []byte, offset int, length int) int +TEXT ·emitCopyNoRepeat(SB), NOSPLIT, $0-48 + MOVD $0, R3 + MOVD dst_base+0(FP), R0 + MOVD offset+24(FP), R1 + MOVD length+32(FP), R2 + + // emitCopy + CMPW $0x00010000, R1 + BLO two_byte_offset_standalone_snappy + +four_bytes_loop_back_standalone_snappy: + CMPW $0x40, R2 + BLS four_bytes_remain_standalone_snappy + MOVD $0xff, R16 + MOVB R16, (R0) + MOVW R1, 1(R0) + SUB $64, R2, R2 + MOVWU R2, R2 + ADD $0x05, R3, R3 + ADD $0x05, R0, R0 + CMPW $0x04, R2 + BLO four_bytes_remain_standalone_snappy + JMP four_bytes_loop_back_standalone_snappy + +four_bytes_remain_standalone_snappy: + TSTW R2, R2 + BEQ gen_emit_copy_end_snappy + MOVD $0, R5 + ADD R2<<2, R5, R2 + SUB $1, R2, R2 + MOVWU R2, R2 + MOVB R2, (R0) + MOVW R1, 1(R0) + ADD $0x05, R3, R3 + ADD $0x05, R0, R0 + JMP gen_emit_copy_end_snappy + +two_byte_offset_standalone_snappy: + CMPW $0x40, R2 + BLS two_byte_offset_short_standalone_snappy + MOVD $0xee, R16 + MOVB R16, (R0) + MOVH R1, 1(R0) + SUB $60, R2, R2 + MOVWU R2, R2 + ADD $0x03, R0, R0 + ADD $0x03, R3, R3 + JMP two_byte_offset_standalone_snappy + +two_byte_offset_short_standalone_snappy: + MOVWU R2, R5 + LSLW $0x02, R5, R5 + CMPW $0x0c, R2 + BHS emit_copy_three_standalone_snappy + CMPW $0x00000800, R1 + BHS emit_copy_three_standalone_snappy + SUB $15, R5, R5 + MOVWU R5, R5 + MOVB R1, 1(R0) + LSRW $0x08, R1, R1 + LSLW $0x05, R1, R1 + ORRW R1, R5, R5 + MOVB R5, (R0) + ADD $0x02, R3, R3 + ADD $0x02, R0, R0 + JMP gen_emit_copy_end_snappy + +emit_copy_three_standalone_snappy: + SUB $2, R5, R5 + MOVWU R5, R5 + MOVB R5, (R0) + MOVH R1, 1(R0) + ADD $0x03, R3, R3 + ADD $0x03, R0, R0 + +gen_emit_copy_end_snappy: + MOVD R3, ret+40(FP) + RET + +// func matchLen(a []byte, b []byte) int +// Requires: BMI +TEXT ·matchLen(SB), NOSPLIT, $0-56 + MOVD a_base+0(FP), R0 + MOVD b_base+24(FP), R1 + MOVD a_len+8(FP), R2 + + // matchLen + MOVD $0, R5 + +matchlen_loopback_16_standalone: + CMPW $0x10, R2 + BLO matchlen_match8_standalone + MOVD (R0)(R5), R3 + ADD R5, R0, R15 + MOVD 8(R15), R6 + MOVD (R1)(R5), R16 + EOR R16, R3, R3 + TST R3, R3 + BNE matchlen_bsf_8_standalone + ADD R5, R1, R15 + MOVD 8(R15), R16 + EOR R16, R6, R6 + TST R6, R6 + BNE matchlen_bsf_16standalone + SUB $16, R2, R2 + MOVWU R2, R2 + ADD $16, R5, R5 + MOVWU R5, R5 + JMP matchlen_loopback_16_standalone + +matchlen_bsf_16standalone: + RBIT R6, R6 + CLZ R6, R6 + ASR $0x03, R6, R6 + ADD R6, R5, R5 + ADD $8, R5, R5 + MOVWU R5, R5 + JMP gen_match_len_end + +matchlen_match8_standalone: + CMPW $0x08, R2 + BLO matchlen_match4_standalone + MOVD (R0)(R5), R3 + MOVD (R1)(R5), R16 + EOR R16, R3, R3 + TST R3, R3 + BNE matchlen_bsf_8_standalone + SUB $8, R2, R2 + MOVWU R2, R2 + ADD $8, R5, R5 + MOVWU R5, R5 + JMP matchlen_match4_standalone + +matchlen_bsf_8_standalone: + RBIT R3, R3 + CLZ R3, R3 + ASR $0x03, R3, R3 + ADD R3, R5, R5 + MOVWU R5, R5 + JMP gen_match_len_end + +matchlen_match4_standalone: + CMPW $0x04, R2 + BLO matchlen_match2_standalone + MOVWU (R0)(R5), R3 + MOVWU (R1)(R5), R16 + CMPW R3, R16 + BNE matchlen_match2_standalone + SUB $4, R2, R2 + MOVWU R2, R2 + ADD $4, R5, R5 + MOVWU R5, R5 + +matchlen_match2_standalone: + CMPW $0x01, R2 + BEQ matchlen_match1_standalone + BLO gen_match_len_end + MOVHU (R0)(R5), R16 + BFI $0, R16, $16, R3 + ADD R5, R1, R15 + MOVHU (R15), R15 + AND $0xffff, R3, R16 + CMP R16, R15 + BNE matchlen_match1_standalone + ADD $2, R5, R5 + MOVWU R5, R5 + SUBSW $0x02, R2, R2 + BEQ gen_match_len_end + +matchlen_match1_standalone: + MOVBU (R0)(R5), R16 + BFI $0, R16, $8, R3 + ADD R5, R1, R15 + MOVBU (R15), R15 + AND $0xff, R3, R16 + CMP R16, R15 + BNE gen_match_len_end + ADD $1, R5, R5 + MOVWU R5, R5 + +gen_match_len_end: + MOVD R5, ret+48(FP) + RET + +// func cvtLZ4BlockAsm(dst []byte, src []byte) (uncompressed int, dstUsed int) +// Requires: SSE2 +TEXT ·cvtLZ4BlockAsm(SB), NOSPLIT, $0-64 + MOVD $0, R5 + MOVD dst_base+0(FP), R0 + MOVD dst_len+8(FP), R1 + MOVD src_base+24(FP), R2 + MOVD src_len+32(FP), R3 + ADD R3, R2, R3 + ADD R1, R0, R1 + SUB $8, R1, R1 + SUB $4, R1, R6 + MOVD $0, R7 + +lz4_s2_loop: + CMP R3, R2 + BHS lz4_s2_corrupt + CMP R1, R0 + BHS lz4_s2_dstfull + MOVBU (R2), R8 + MOVD R8, R9 + MOVD R8, R10 + LSR $0x04, R9, R9 + AND $0x0f, R10, R10 + CMP $0xf0, R8 + BLO lz4_s2_ll_end + +lz4_s2_ll_loop: + ADD $1, R2, R2 + CMP R3, R2 + BHS lz4_s2_corrupt + MOVBU (R2), R8 + ADD R8, R9, R9 + CMP $0xff, R8 + BEQ lz4_s2_ll_loop + +lz4_s2_ll_end: + ADD R9, R2, R8 + ADD $0x04, R10, R10 + CMP R3, R8 + BHS lz4_s2_corrupt + ADD $1, R2, R2 + ADD $1, R8, R8 + TST R9, R9 + BEQ lz4_s2_lits_done + ADD R9, R0, R11 + CMP R6, R11 + BHS lz4_s2_dstfull + ADD R9, R5, R5 + SUB $1, R9, R11 + MOVWU R11, R11 + CMPW $0x3c, R11 + BLO one_byte_lz4_s2 + CMPW $0x00000100, R11 + BLO two_bytes_lz4_s2 + CMPW $0x00010000, R11 + BLO three_bytes_lz4_s2 + CMPW $0x01000000, R11 + BLO four_bytes_lz4_s2 + MOVD $0xfc, R16 + MOVB R16, (R0) + MOVW R11, 1(R0) + ADD $0x05, R0, R0 + JMP memmove_long_lz4_s2 + +four_bytes_lz4_s2: + MOVWU R11, R12 + LSRW $0x10, R12, R12 + MOVD $0xf8, R16 + MOVB R16, (R0) + MOVH R11, 1(R0) + MOVB R12, 3(R0) + ADD $0x04, R0, R0 + JMP memmove_long_lz4_s2 + +three_bytes_lz4_s2: + MOVD $0xf4, R16 + MOVB R16, (R0) + MOVH R11, 1(R0) + ADD $0x03, R0, R0 + JMP memmove_long_lz4_s2 + +two_bytes_lz4_s2: + MOVD $0xf0, R16 + MOVB R16, (R0) + MOVB R11, 1(R0) + ADD $0x02, R0, R0 + CMPW $0x40, R11 + BLO memmove_lz4_s2 + JMP memmove_long_lz4_s2 + +one_byte_lz4_s2: + LSLW $0x02, R11, R16 + BFI $0, R16, $8, R11 + MOVB R11, (R0) + ADD $0x01, R0, R0 + +memmove_lz4_s2: + ADD R9, R0, R11 + + // genMemMoveShort + CMP $0x08, R9 + BLS emit_lit_memmove_lz4_s2_memmove_move_8 + CMP $0x10, R9 + BLS emit_lit_memmove_lz4_s2_memmove_move_8through16 + CMP $0x20, R9 + BLS emit_lit_memmove_lz4_s2_memmove_move_17through32 + JMP emit_lit_memmove_lz4_s2_memmove_move_33through64 + +emit_lit_memmove_lz4_s2_memmove_move_8: + MOVD (R2), R12 + MOVD R12, (R0) + JMP memmove_end_copy_lz4_s2 + +emit_lit_memmove_lz4_s2_memmove_move_8through16: + MOVD (R2), R12 + ADD R9, R2, R15 + MOVD -8(R15), R2 + MOVD R12, (R0) + ADD R9, R0, R15 + MOVD R2, -8(R15) + JMP memmove_end_copy_lz4_s2 + +emit_lit_memmove_lz4_s2_memmove_move_17through32: + FMOVQ (R2), F0 + ADD R9, R2, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R0) + ADD R9, R0, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_lz4_s2 + +emit_lit_memmove_lz4_s2_memmove_move_33through64: + FMOVQ (R2), F0 + FMOVQ 16(R2), F1 + ADD R9, R2, R15 + FMOVQ -32(R15), F2 + ADD R9, R2, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R0) + FMOVQ F1, 16(R0) + ADD R9, R0, R15 + FMOVQ F2, -32(R15) + ADD R9, R0, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_lz4_s2: + MOVD R11, R0 + JMP lz4_s2_lits_emit_done + +memmove_long_lz4_s2: + ADD R9, R0, R11 + + // genMemMoveLong + MOVD R2, R12 + MOVD R0, R13 + MOVD R9, R14 + +emit_lit_memmove_long_lz4_s2large_big_loop_back: + FMOVQ (R12), F0 + FMOVQ 16(R12), F1 + FMOVQ F0, (R13) + FMOVQ F1, 16(R13) + ADD $0x20, R12, R12 + ADD $0x20, R13, R13 + SUB $0x20, R14, R14 + CMP $0x20, R14 + BHS emit_lit_memmove_long_lz4_s2large_big_loop_back + ADD R9, R2, R15 + FMOVQ -32(R15), F0 + ADD R9, R2, R15 + FMOVQ -16(R15), F1 + ADD R9, R0, R15 + FMOVQ F0, -32(R15) + ADD R9, R0, R15 + FMOVQ F1, -16(R15) + MOVD R11, R0 + +lz4_s2_lits_emit_done: + MOVD R8, R2 + +lz4_s2_lits_done: + CMP R3, R2 + BNE lz4_s2_match + CMP $0x04, R10 + BEQ lz4_s2_done + JMP lz4_s2_corrupt + +lz4_s2_match: + ADD $2, R2, R8 + CMP R3, R8 + BHS lz4_s2_corrupt + MOVHU (R2), R9 + MOVD R8, R2 + TST R9, R9 + BEQ lz4_s2_corrupt + CMP R5, R9 + BHI lz4_s2_corrupt + CMP $0x13, R10 + BNE lz4_s2_ml_done + +lz4_s2_ml_loop: + MOVBU (R2), R8 + ADD $1, R2, R2 + ADD R8, R10, R10 + CMP R3, R2 + BHS lz4_s2_corrupt + CMP $0xff, R8 + BEQ lz4_s2_ml_loop + +lz4_s2_ml_done: + ADD R10, R5, R5 + CMP R7, R9 + BNE lz4_s2_docopy + + // emitRepeat +emit_repeat_again_lz4_s2: + MOVWU R10, R8 + SUB $4, R10, R10 + MOVWU R10, R10 + CMPW $0x08, R8 + BLS repeat_two_lz4_s2 + CMPW $0x0c, R8 + BHS cant_repeat_two_offset_lz4_s2 + CMPW $0x00000800, R9 + BLO repeat_two_offset_lz4_s2 + +cant_repeat_two_offset_lz4_s2: + CMPW $0x00000104, R10 + BLO repeat_three_lz4_s2 + CMPW $0x00010100, R10 + BLO repeat_four_lz4_s2 + CMPW $0x0100ffff, R10 + BLO repeat_five_lz4_s2 + SUB $16842747, R10, R10 + MOVWU R10, R10 + MOVD $0xfffb001d, R16 + MOVW R16, (R0) + MOVD $0xff, R16 + MOVB R16, 4(R0) + ADD $0x05, R0, R0 + CMP R1, R0 + BHS lz4_s2_loop + JMP emit_repeat_again_lz4_s2 + +repeat_five_lz4_s2: + SUB $65536, R10, R10 + MOVWU R10, R10 + MOVWU R10, R9 + MOVD $0x001d, R16 + MOVH R16, (R0) + MOVH R10, 2(R0) + ASRW $0x10, R9, R9 + MOVB R9, 4(R0) + ADD $0x05, R0, R0 + JMP lz4_s2_loop + +repeat_four_lz4_s2: + SUB $256, R10, R10 + MOVWU R10, R10 + MOVD $0x0019, R16 + MOVH R16, (R0) + MOVH R10, 2(R0) + ADD $0x04, R0, R0 + JMP lz4_s2_loop + +repeat_three_lz4_s2: + SUB $4, R10, R10 + MOVWU R10, R10 + MOVD $0x0015, R16 + MOVH R16, (R0) + MOVB R10, 2(R0) + ADD $0x03, R0, R0 + JMP lz4_s2_loop + +repeat_two_lz4_s2: + LSLW $0x02, R10, R10 + ORRW $0x01, R10, R10 + MOVH R10, (R0) + ADD $0x02, R0, R0 + JMP lz4_s2_loop + +repeat_two_offset_lz4_s2: + MOVD $0, R8 + ADD R10<<2, R8, R10 + ADD $1, R10, R10 + MOVWU R10, R10 + MOVB R9, 1(R0) + ASRW $0x08, R9, R9 + LSLW $0x05, R9, R9 + ORRW R9, R10, R10 + MOVB R10, (R0) + ADD $0x02, R0, R0 + JMP lz4_s2_loop + +lz4_s2_docopy: + MOVD R9, R7 + + // emitCopy + CMPW $0x40, R10 + BLS two_byte_offset_short_lz4_s2 + CMPW $0x00000800, R9 + BHS long_offset_short_lz4_s2 + MOVD $0x00000001, R8 + ADD $16, R8, R8 + MOVWU R8, R8 + MOVB R9, 1(R0) + MOVWU R9, R11 + LSRW $0x08, R11, R11 + LSLW $0x05, R11, R11 + ORRW R11, R8, R8 + MOVB R8, (R0) + ADD $0x02, R0, R0 + SUBW $0x08, R10, R10 + + // emitRepeat + SUB $4, R10, R10 + MOVWU R10, R10 + JMP cant_repeat_two_offset_lz4_s2_emit_copy_short_2b + +emit_repeat_again_lz4_s2_emit_copy_short_2b: + MOVWU R10, R8 + SUB $4, R10, R10 + MOVWU R10, R10 + CMPW $0x08, R8 + BLS repeat_two_lz4_s2_emit_copy_short_2b + CMPW $0x0c, R8 + BHS cant_repeat_two_offset_lz4_s2_emit_copy_short_2b + CMPW $0x00000800, R9 + BLO repeat_two_offset_lz4_s2_emit_copy_short_2b + +cant_repeat_two_offset_lz4_s2_emit_copy_short_2b: + CMPW $0x00000104, R10 + BLO repeat_three_lz4_s2_emit_copy_short_2b + CMPW $0x00010100, R10 + BLO repeat_four_lz4_s2_emit_copy_short_2b + CMPW $0x0100ffff, R10 + BLO repeat_five_lz4_s2_emit_copy_short_2b + SUB $16842747, R10, R10 + MOVWU R10, R10 + MOVD $0xfffb001d, R16 + MOVW R16, (R0) + MOVD $0xff, R16 + MOVB R16, 4(R0) + ADD $0x05, R0, R0 + CMP R1, R0 + BHS lz4_s2_loop + JMP emit_repeat_again_lz4_s2_emit_copy_short_2b + +repeat_five_lz4_s2_emit_copy_short_2b: + SUB $65536, R10, R10 + MOVWU R10, R10 + MOVWU R10, R9 + MOVD $0x001d, R16 + MOVH R16, (R0) + MOVH R10, 2(R0) + ASRW $0x10, R9, R9 + MOVB R9, 4(R0) + ADD $0x05, R0, R0 + JMP lz4_s2_loop + +repeat_four_lz4_s2_emit_copy_short_2b: + SUB $256, R10, R10 + MOVWU R10, R10 + MOVD $0x0019, R16 + MOVH R16, (R0) + MOVH R10, 2(R0) + ADD $0x04, R0, R0 + JMP lz4_s2_loop + +repeat_three_lz4_s2_emit_copy_short_2b: + SUB $4, R10, R10 + MOVWU R10, R10 + MOVD $0x0015, R16 + MOVH R16, (R0) + MOVB R10, 2(R0) + ADD $0x03, R0, R0 + JMP lz4_s2_loop + +repeat_two_lz4_s2_emit_copy_short_2b: + LSLW $0x02, R10, R10 + ORRW $0x01, R10, R10 + MOVH R10, (R0) + ADD $0x02, R0, R0 + JMP lz4_s2_loop + +repeat_two_offset_lz4_s2_emit_copy_short_2b: + MOVD $0, R8 + ADD R10<<2, R8, R10 + ADD $1, R10, R10 + MOVWU R10, R10 + MOVB R9, 1(R0) + ASRW $0x08, R9, R9 + LSLW $0x05, R9, R9 + ORRW R9, R10, R10 + MOVB R10, (R0) + ADD $0x02, R0, R0 + JMP lz4_s2_loop + +long_offset_short_lz4_s2: + MOVD $0xee, R16 + MOVB R16, (R0) + MOVH R9, 1(R0) + SUB $60, R10, R10 + MOVWU R10, R10 + ADD $0x03, R0, R0 + + // emitRepeat +emit_repeat_again_lz4_s2_emit_copy_short: + MOVWU R10, R8 + SUB $4, R10, R10 + MOVWU R10, R10 + CMPW $0x08, R8 + BLS repeat_two_lz4_s2_emit_copy_short + CMPW $0x0c, R8 + BHS cant_repeat_two_offset_lz4_s2_emit_copy_short + CMPW $0x00000800, R9 + BLO repeat_two_offset_lz4_s2_emit_copy_short + +cant_repeat_two_offset_lz4_s2_emit_copy_short: + CMPW $0x00000104, R10 + BLO repeat_three_lz4_s2_emit_copy_short + CMPW $0x00010100, R10 + BLO repeat_four_lz4_s2_emit_copy_short + CMPW $0x0100ffff, R10 + BLO repeat_five_lz4_s2_emit_copy_short + SUB $16842747, R10, R10 + MOVWU R10, R10 + MOVD $0xfffb001d, R16 + MOVW R16, (R0) + MOVD $0xff, R16 + MOVB R16, 4(R0) + ADD $0x05, R0, R0 + CMP R1, R0 + BHS lz4_s2_loop + JMP emit_repeat_again_lz4_s2_emit_copy_short + +repeat_five_lz4_s2_emit_copy_short: + SUB $65536, R10, R10 + MOVWU R10, R10 + MOVWU R10, R9 + MOVD $0x001d, R16 + MOVH R16, (R0) + MOVH R10, 2(R0) + ASRW $0x10, R9, R9 + MOVB R9, 4(R0) + ADD $0x05, R0, R0 + JMP lz4_s2_loop + +repeat_four_lz4_s2_emit_copy_short: + SUB $256, R10, R10 + MOVWU R10, R10 + MOVD $0x0019, R16 + MOVH R16, (R0) + MOVH R10, 2(R0) + ADD $0x04, R0, R0 + JMP lz4_s2_loop + +repeat_three_lz4_s2_emit_copy_short: + SUB $4, R10, R10 + MOVWU R10, R10 + MOVD $0x0015, R16 + MOVH R16, (R0) + MOVB R10, 2(R0) + ADD $0x03, R0, R0 + JMP lz4_s2_loop + +repeat_two_lz4_s2_emit_copy_short: + LSLW $0x02, R10, R10 + ORRW $0x01, R10, R10 + MOVH R10, (R0) + ADD $0x02, R0, R0 + JMP lz4_s2_loop + +repeat_two_offset_lz4_s2_emit_copy_short: + MOVD $0, R8 + ADD R10<<2, R8, R10 + ADD $1, R10, R10 + MOVWU R10, R10 + MOVB R9, 1(R0) + ASRW $0x08, R9, R9 + LSLW $0x05, R9, R9 + ORRW R9, R10, R10 + MOVB R10, (R0) + ADD $0x02, R0, R0 + JMP lz4_s2_loop + +two_byte_offset_short_lz4_s2: + MOVWU R10, R8 + LSLW $0x02, R8, R8 + CMPW $0x0c, R10 + BHS emit_copy_three_lz4_s2 + CMPW $0x00000800, R9 + BHS emit_copy_three_lz4_s2 + SUB $15, R8, R8 + MOVWU R8, R8 + MOVB R9, 1(R0) + LSRW $0x08, R9, R9 + LSLW $0x05, R9, R9 + ORRW R9, R8, R8 + MOVB R8, (R0) + ADD $0x02, R0, R0 + JMP lz4_s2_loop + +emit_copy_three_lz4_s2: + SUB $2, R8, R8 + MOVWU R8, R8 + MOVB R8, (R0) + MOVH R9, 1(R0) + ADD $0x03, R0, R0 + JMP lz4_s2_loop + +lz4_s2_done: + MOVD dst_base+0(FP), R1 + SUB R1, R0, R0 + MOVD R5, uncompressed+48(FP) + MOVD R0, dstUsed+56(FP) + RET + +lz4_s2_corrupt: + MOVD $0, R0 + SUB $1, R0, R5 + MOVD R5, uncompressed+48(FP) + RET + +lz4_s2_dstfull: + MOVD $0, R0 + SUB $2, R0, R5 + MOVD R5, uncompressed+48(FP) + RET + +// func cvtLZ4sBlockAsm(dst []byte, src []byte) (uncompressed int, dstUsed int) +// Requires: SSE2 +TEXT ·cvtLZ4sBlockAsm(SB), NOSPLIT, $0-64 + MOVD $0, R5 + MOVD dst_base+0(FP), R0 + MOVD dst_len+8(FP), R1 + MOVD src_base+24(FP), R2 + MOVD src_len+32(FP), R3 + ADD R3, R2, R3 + ADD R1, R0, R1 + SUB $8, R1, R1 + SUB $4, R1, R6 + MOVD $0, R7 + +lz4s_s2_loop: + CMP R3, R2 + BHS lz4s_s2_corrupt + CMP R1, R0 + BHS lz4s_s2_dstfull + MOVBU (R2), R8 + MOVD R8, R9 + MOVD R8, R10 + LSR $0x04, R9, R9 + AND $0x0f, R10, R10 + CMP $0xf0, R8 + BLO lz4s_s2_ll_end + +lz4s_s2_ll_loop: + ADD $1, R2, R2 + CMP R3, R2 + BHS lz4s_s2_corrupt + MOVBU (R2), R8 + ADD R8, R9, R9 + CMP $0xff, R8 + BEQ lz4s_s2_ll_loop + +lz4s_s2_ll_end: + ADD R9, R2, R8 + ADD $0x03, R10, R10 + CMP R3, R8 + BHS lz4s_s2_corrupt + ADD $1, R2, R2 + ADD $1, R8, R8 + TST R9, R9 + BEQ lz4s_s2_lits_done + ADD R9, R0, R11 + CMP R6, R11 + BHS lz4s_s2_dstfull + ADD R9, R5, R5 + SUB $1, R9, R11 + MOVWU R11, R11 + CMPW $0x3c, R11 + BLO one_byte_lz4s_s2 + CMPW $0x00000100, R11 + BLO two_bytes_lz4s_s2 + CMPW $0x00010000, R11 + BLO three_bytes_lz4s_s2 + CMPW $0x01000000, R11 + BLO four_bytes_lz4s_s2 + MOVD $0xfc, R16 + MOVB R16, (R0) + MOVW R11, 1(R0) + ADD $0x05, R0, R0 + JMP memmove_long_lz4s_s2 + +four_bytes_lz4s_s2: + MOVWU R11, R12 + LSRW $0x10, R12, R12 + MOVD $0xf8, R16 + MOVB R16, (R0) + MOVH R11, 1(R0) + MOVB R12, 3(R0) + ADD $0x04, R0, R0 + JMP memmove_long_lz4s_s2 + +three_bytes_lz4s_s2: + MOVD $0xf4, R16 + MOVB R16, (R0) + MOVH R11, 1(R0) + ADD $0x03, R0, R0 + JMP memmove_long_lz4s_s2 + +two_bytes_lz4s_s2: + MOVD $0xf0, R16 + MOVB R16, (R0) + MOVB R11, 1(R0) + ADD $0x02, R0, R0 + CMPW $0x40, R11 + BLO memmove_lz4s_s2 + JMP memmove_long_lz4s_s2 + +one_byte_lz4s_s2: + LSLW $0x02, R11, R16 + BFI $0, R16, $8, R11 + MOVB R11, (R0) + ADD $0x01, R0, R0 + +memmove_lz4s_s2: + ADD R9, R0, R11 + + // genMemMoveShort + CMP $0x08, R9 + BLS emit_lit_memmove_lz4s_s2_memmove_move_8 + CMP $0x10, R9 + BLS emit_lit_memmove_lz4s_s2_memmove_move_8through16 + CMP $0x20, R9 + BLS emit_lit_memmove_lz4s_s2_memmove_move_17through32 + JMP emit_lit_memmove_lz4s_s2_memmove_move_33through64 + +emit_lit_memmove_lz4s_s2_memmove_move_8: + MOVD (R2), R12 + MOVD R12, (R0) + JMP memmove_end_copy_lz4s_s2 + +emit_lit_memmove_lz4s_s2_memmove_move_8through16: + MOVD (R2), R12 + ADD R9, R2, R15 + MOVD -8(R15), R2 + MOVD R12, (R0) + ADD R9, R0, R15 + MOVD R2, -8(R15) + JMP memmove_end_copy_lz4s_s2 + +emit_lit_memmove_lz4s_s2_memmove_move_17through32: + FMOVQ (R2), F0 + ADD R9, R2, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R0) + ADD R9, R0, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_lz4s_s2 + +emit_lit_memmove_lz4s_s2_memmove_move_33through64: + FMOVQ (R2), F0 + FMOVQ 16(R2), F1 + ADD R9, R2, R15 + FMOVQ -32(R15), F2 + ADD R9, R2, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R0) + FMOVQ F1, 16(R0) + ADD R9, R0, R15 + FMOVQ F2, -32(R15) + ADD R9, R0, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_lz4s_s2: + MOVD R11, R0 + JMP lz4s_s2_lits_emit_done + +memmove_long_lz4s_s2: + ADD R9, R0, R11 + + // genMemMoveLong + MOVD R2, R12 + MOVD R0, R13 + MOVD R9, R14 + +emit_lit_memmove_long_lz4s_s2large_big_loop_back: + FMOVQ (R12), F0 + FMOVQ 16(R12), F1 + FMOVQ F0, (R13) + FMOVQ F1, 16(R13) + ADD $0x20, R12, R12 + ADD $0x20, R13, R13 + SUB $0x20, R14, R14 + CMP $0x20, R14 + BHS emit_lit_memmove_long_lz4s_s2large_big_loop_back + ADD R9, R2, R15 + FMOVQ -32(R15), F0 + ADD R9, R2, R15 + FMOVQ -16(R15), F1 + ADD R9, R0, R15 + FMOVQ F0, -32(R15) + ADD R9, R0, R15 + FMOVQ F1, -16(R15) + MOVD R11, R0 + +lz4s_s2_lits_emit_done: + MOVD R8, R2 + +lz4s_s2_lits_done: + CMP R3, R2 + BNE lz4s_s2_match + CMP $0x03, R10 + BEQ lz4s_s2_done + JMP lz4s_s2_corrupt + +lz4s_s2_match: + CMP $0x03, R10 + BEQ lz4s_s2_loop + ADD $2, R2, R8 + CMP R3, R8 + BHS lz4s_s2_corrupt + MOVHU (R2), R9 + MOVD R8, R2 + TST R9, R9 + BEQ lz4s_s2_corrupt + CMP R5, R9 + BHI lz4s_s2_corrupt + CMP $0x12, R10 + BNE lz4s_s2_ml_done + +lz4s_s2_ml_loop: + MOVBU (R2), R8 + ADD $1, R2, R2 + ADD R8, R10, R10 + CMP R3, R2 + BHS lz4s_s2_corrupt + CMP $0xff, R8 + BEQ lz4s_s2_ml_loop + +lz4s_s2_ml_done: + ADD R10, R5, R5 + CMP R7, R9 + BNE lz4s_s2_docopy + + // emitRepeat +emit_repeat_again_lz4_s2: + MOVWU R10, R8 + SUB $4, R10, R10 + MOVWU R10, R10 + CMPW $0x08, R8 + BLS repeat_two_lz4_s2 + CMPW $0x0c, R8 + BHS cant_repeat_two_offset_lz4_s2 + CMPW $0x00000800, R9 + BLO repeat_two_offset_lz4_s2 + +cant_repeat_two_offset_lz4_s2: + CMPW $0x00000104, R10 + BLO repeat_three_lz4_s2 + CMPW $0x00010100, R10 + BLO repeat_four_lz4_s2 + CMPW $0x0100ffff, R10 + BLO repeat_five_lz4_s2 + SUB $16842747, R10, R10 + MOVWU R10, R10 + MOVD $0xfffb001d, R16 + MOVW R16, (R0) + MOVD $0xff, R16 + MOVB R16, 4(R0) + ADD $0x05, R0, R0 + CMP R1, R0 + BHS lz4s_s2_loop + JMP emit_repeat_again_lz4_s2 + +repeat_five_lz4_s2: + SUB $65536, R10, R10 + MOVWU R10, R10 + MOVWU R10, R9 + MOVD $0x001d, R16 + MOVH R16, (R0) + MOVH R10, 2(R0) + ASRW $0x10, R9, R9 + MOVB R9, 4(R0) + ADD $0x05, R0, R0 + JMP lz4s_s2_loop + +repeat_four_lz4_s2: + SUB $256, R10, R10 + MOVWU R10, R10 + MOVD $0x0019, R16 + MOVH R16, (R0) + MOVH R10, 2(R0) + ADD $0x04, R0, R0 + JMP lz4s_s2_loop + +repeat_three_lz4_s2: + SUB $4, R10, R10 + MOVWU R10, R10 + MOVD $0x0015, R16 + MOVH R16, (R0) + MOVB R10, 2(R0) + ADD $0x03, R0, R0 + JMP lz4s_s2_loop + +repeat_two_lz4_s2: + LSLW $0x02, R10, R10 + ORRW $0x01, R10, R10 + MOVH R10, (R0) + ADD $0x02, R0, R0 + JMP lz4s_s2_loop + +repeat_two_offset_lz4_s2: + MOVD $0, R8 + ADD R10<<2, R8, R10 + ADD $1, R10, R10 + MOVWU R10, R10 + MOVB R9, 1(R0) + ASRW $0x08, R9, R9 + LSLW $0x05, R9, R9 + ORRW R9, R10, R10 + MOVB R10, (R0) + ADD $0x02, R0, R0 + JMP lz4s_s2_loop + +lz4s_s2_docopy: + MOVD R9, R7 + + // emitCopy + CMPW $0x40, R10 + BLS two_byte_offset_short_lz4_s2 + CMPW $0x00000800, R9 + BHS long_offset_short_lz4_s2 + MOVD $0x00000001, R8 + ADD $16, R8, R8 + MOVWU R8, R8 + MOVB R9, 1(R0) + MOVWU R9, R11 + LSRW $0x08, R11, R11 + LSLW $0x05, R11, R11 + ORRW R11, R8, R8 + MOVB R8, (R0) + ADD $0x02, R0, R0 + SUBW $0x08, R10, R10 + + // emitRepeat + SUB $4, R10, R10 + MOVWU R10, R10 + JMP cant_repeat_two_offset_lz4_s2_emit_copy_short_2b + +emit_repeat_again_lz4_s2_emit_copy_short_2b: + MOVWU R10, R8 + SUB $4, R10, R10 + MOVWU R10, R10 + CMPW $0x08, R8 + BLS repeat_two_lz4_s2_emit_copy_short_2b + CMPW $0x0c, R8 + BHS cant_repeat_two_offset_lz4_s2_emit_copy_short_2b + CMPW $0x00000800, R9 + BLO repeat_two_offset_lz4_s2_emit_copy_short_2b + +cant_repeat_two_offset_lz4_s2_emit_copy_short_2b: + CMPW $0x00000104, R10 + BLO repeat_three_lz4_s2_emit_copy_short_2b + CMPW $0x00010100, R10 + BLO repeat_four_lz4_s2_emit_copy_short_2b + CMPW $0x0100ffff, R10 + BLO repeat_five_lz4_s2_emit_copy_short_2b + SUB $16842747, R10, R10 + MOVWU R10, R10 + MOVD $0xfffb001d, R16 + MOVW R16, (R0) + MOVD $0xff, R16 + MOVB R16, 4(R0) + ADD $0x05, R0, R0 + CMP R1, R0 + BHS lz4s_s2_loop + JMP emit_repeat_again_lz4_s2_emit_copy_short_2b + +repeat_five_lz4_s2_emit_copy_short_2b: + SUB $65536, R10, R10 + MOVWU R10, R10 + MOVWU R10, R9 + MOVD $0x001d, R16 + MOVH R16, (R0) + MOVH R10, 2(R0) + ASRW $0x10, R9, R9 + MOVB R9, 4(R0) + ADD $0x05, R0, R0 + JMP lz4s_s2_loop + +repeat_four_lz4_s2_emit_copy_short_2b: + SUB $256, R10, R10 + MOVWU R10, R10 + MOVD $0x0019, R16 + MOVH R16, (R0) + MOVH R10, 2(R0) + ADD $0x04, R0, R0 + JMP lz4s_s2_loop + +repeat_three_lz4_s2_emit_copy_short_2b: + SUB $4, R10, R10 + MOVWU R10, R10 + MOVD $0x0015, R16 + MOVH R16, (R0) + MOVB R10, 2(R0) + ADD $0x03, R0, R0 + JMP lz4s_s2_loop + +repeat_two_lz4_s2_emit_copy_short_2b: + LSLW $0x02, R10, R10 + ORRW $0x01, R10, R10 + MOVH R10, (R0) + ADD $0x02, R0, R0 + JMP lz4s_s2_loop + +repeat_two_offset_lz4_s2_emit_copy_short_2b: + MOVD $0, R8 + ADD R10<<2, R8, R10 + ADD $1, R10, R10 + MOVWU R10, R10 + MOVB R9, 1(R0) + ASRW $0x08, R9, R9 + LSLW $0x05, R9, R9 + ORRW R9, R10, R10 + MOVB R10, (R0) + ADD $0x02, R0, R0 + JMP lz4s_s2_loop + +long_offset_short_lz4_s2: + MOVD $0xee, R16 + MOVB R16, (R0) + MOVH R9, 1(R0) + SUB $60, R10, R10 + MOVWU R10, R10 + ADD $0x03, R0, R0 + + // emitRepeat +emit_repeat_again_lz4_s2_emit_copy_short: + MOVWU R10, R8 + SUB $4, R10, R10 + MOVWU R10, R10 + CMPW $0x08, R8 + BLS repeat_two_lz4_s2_emit_copy_short + CMPW $0x0c, R8 + BHS cant_repeat_two_offset_lz4_s2_emit_copy_short + CMPW $0x00000800, R9 + BLO repeat_two_offset_lz4_s2_emit_copy_short + +cant_repeat_two_offset_lz4_s2_emit_copy_short: + CMPW $0x00000104, R10 + BLO repeat_three_lz4_s2_emit_copy_short + CMPW $0x00010100, R10 + BLO repeat_four_lz4_s2_emit_copy_short + CMPW $0x0100ffff, R10 + BLO repeat_five_lz4_s2_emit_copy_short + SUB $16842747, R10, R10 + MOVWU R10, R10 + MOVD $0xfffb001d, R16 + MOVW R16, (R0) + MOVD $0xff, R16 + MOVB R16, 4(R0) + ADD $0x05, R0, R0 + CMP R1, R0 + BHS lz4s_s2_loop + JMP emit_repeat_again_lz4_s2_emit_copy_short + +repeat_five_lz4_s2_emit_copy_short: + SUB $65536, R10, R10 + MOVWU R10, R10 + MOVWU R10, R9 + MOVD $0x001d, R16 + MOVH R16, (R0) + MOVH R10, 2(R0) + ASRW $0x10, R9, R9 + MOVB R9, 4(R0) + ADD $0x05, R0, R0 + JMP lz4s_s2_loop + +repeat_four_lz4_s2_emit_copy_short: + SUB $256, R10, R10 + MOVWU R10, R10 + MOVD $0x0019, R16 + MOVH R16, (R0) + MOVH R10, 2(R0) + ADD $0x04, R0, R0 + JMP lz4s_s2_loop + +repeat_three_lz4_s2_emit_copy_short: + SUB $4, R10, R10 + MOVWU R10, R10 + MOVD $0x0015, R16 + MOVH R16, (R0) + MOVB R10, 2(R0) + ADD $0x03, R0, R0 + JMP lz4s_s2_loop + +repeat_two_lz4_s2_emit_copy_short: + LSLW $0x02, R10, R10 + ORRW $0x01, R10, R10 + MOVH R10, (R0) + ADD $0x02, R0, R0 + JMP lz4s_s2_loop + +repeat_two_offset_lz4_s2_emit_copy_short: + MOVD $0, R8 + ADD R10<<2, R8, R10 + ADD $1, R10, R10 + MOVWU R10, R10 + MOVB R9, 1(R0) + ASRW $0x08, R9, R9 + LSLW $0x05, R9, R9 + ORRW R9, R10, R10 + MOVB R10, (R0) + ADD $0x02, R0, R0 + JMP lz4s_s2_loop + +two_byte_offset_short_lz4_s2: + MOVWU R10, R8 + LSLW $0x02, R8, R8 + CMPW $0x0c, R10 + BHS emit_copy_three_lz4_s2 + CMPW $0x00000800, R9 + BHS emit_copy_three_lz4_s2 + SUB $15, R8, R8 + MOVWU R8, R8 + MOVB R9, 1(R0) + LSRW $0x08, R9, R9 + LSLW $0x05, R9, R9 + ORRW R9, R8, R8 + MOVB R8, (R0) + ADD $0x02, R0, R0 + JMP lz4s_s2_loop + +emit_copy_three_lz4_s2: + SUB $2, R8, R8 + MOVWU R8, R8 + MOVB R8, (R0) + MOVH R9, 1(R0) + ADD $0x03, R0, R0 + JMP lz4s_s2_loop + +lz4s_s2_done: + MOVD dst_base+0(FP), R1 + SUB R1, R0, R0 + MOVD R5, uncompressed+48(FP) + MOVD R0, dstUsed+56(FP) + RET + +lz4s_s2_corrupt: + MOVD $0, R0 + SUB $1, R0, R5 + MOVD R5, uncompressed+48(FP) + RET + +lz4s_s2_dstfull: + MOVD $0, R0 + SUB $2, R0, R5 + MOVD R5, uncompressed+48(FP) + RET + +// func cvtLZ4BlockSnappyAsm(dst []byte, src []byte) (uncompressed int, dstUsed int) +// Requires: SSE2 +TEXT ·cvtLZ4BlockSnappyAsm(SB), NOSPLIT, $0-64 + MOVD $0, R5 + MOVD dst_base+0(FP), R0 + MOVD dst_len+8(FP), R1 + MOVD src_base+24(FP), R2 + MOVD src_len+32(FP), R3 + ADD R3, R2, R3 + ADD R1, R0, R1 + SUB $8, R1, R1 + +lz4_snappy_loop: + CMP R3, R2 + BHS lz4_snappy_corrupt + CMP R1, R0 + BHS lz4_snappy_dstfull + MOVBU (R2), R6 + MOVD R6, R7 + MOVD R6, R8 + LSR $0x04, R7, R7 + AND $0x0f, R8, R8 + CMP $0xf0, R6 + BLO lz4_snappy_ll_end + +lz4_snappy_ll_loop: + ADD $1, R2, R2 + CMP R3, R2 + BHS lz4_snappy_corrupt + MOVBU (R2), R6 + ADD R6, R7, R7 + CMP $0xff, R6 + BEQ lz4_snappy_ll_loop + +lz4_snappy_ll_end: + ADD R7, R2, R6 + ADD $0x04, R8, R8 + CMP R3, R6 + BHS lz4_snappy_corrupt + ADD $1, R2, R2 + ADD $1, R6, R6 + TST R7, R7 + BEQ lz4_snappy_lits_done + ADD R7, R0, R9 + CMP R1, R9 + BHS lz4_snappy_dstfull + ADD R7, R5, R5 + SUB $1, R7, R9 + MOVWU R9, R9 + CMPW $0x3c, R9 + BLO one_byte_lz4_snappy + CMPW $0x00000100, R9 + BLO two_bytes_lz4_snappy + CMPW $0x00010000, R9 + BLO three_bytes_lz4_snappy + CMPW $0x01000000, R9 + BLO four_bytes_lz4_snappy + MOVD $0xfc, R16 + MOVB R16, (R0) + MOVW R9, 1(R0) + ADD $0x05, R0, R0 + JMP memmove_long_lz4_snappy + +four_bytes_lz4_snappy: + MOVWU R9, R10 + LSRW $0x10, R10, R10 + MOVD $0xf8, R16 + MOVB R16, (R0) + MOVH R9, 1(R0) + MOVB R10, 3(R0) + ADD $0x04, R0, R0 + JMP memmove_long_lz4_snappy + +three_bytes_lz4_snappy: + MOVD $0xf4, R16 + MOVB R16, (R0) + MOVH R9, 1(R0) + ADD $0x03, R0, R0 + JMP memmove_long_lz4_snappy + +two_bytes_lz4_snappy: + MOVD $0xf0, R16 + MOVB R16, (R0) + MOVB R9, 1(R0) + ADD $0x02, R0, R0 + CMPW $0x40, R9 + BLO memmove_lz4_snappy + JMP memmove_long_lz4_snappy + +one_byte_lz4_snappy: + LSLW $0x02, R9, R16 + BFI $0, R16, $8, R9 + MOVB R9, (R0) + ADD $0x01, R0, R0 + +memmove_lz4_snappy: + ADD R7, R0, R9 + + // genMemMoveShort + CMP $0x08, R7 + BLS emit_lit_memmove_lz4_snappy_memmove_move_8 + CMP $0x10, R7 + BLS emit_lit_memmove_lz4_snappy_memmove_move_8through16 + CMP $0x20, R7 + BLS emit_lit_memmove_lz4_snappy_memmove_move_17through32 + JMP emit_lit_memmove_lz4_snappy_memmove_move_33through64 + +emit_lit_memmove_lz4_snappy_memmove_move_8: + MOVD (R2), R10 + MOVD R10, (R0) + JMP memmove_end_copy_lz4_snappy + +emit_lit_memmove_lz4_snappy_memmove_move_8through16: + MOVD (R2), R10 + ADD R7, R2, R15 + MOVD -8(R15), R2 + MOVD R10, (R0) + ADD R7, R0, R15 + MOVD R2, -8(R15) + JMP memmove_end_copy_lz4_snappy + +emit_lit_memmove_lz4_snappy_memmove_move_17through32: + FMOVQ (R2), F0 + ADD R7, R2, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R0) + ADD R7, R0, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_lz4_snappy + +emit_lit_memmove_lz4_snappy_memmove_move_33through64: + FMOVQ (R2), F0 + FMOVQ 16(R2), F1 + ADD R7, R2, R15 + FMOVQ -32(R15), F2 + ADD R7, R2, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R0) + FMOVQ F1, 16(R0) + ADD R7, R0, R15 + FMOVQ F2, -32(R15) + ADD R7, R0, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_lz4_snappy: + MOVD R9, R0 + JMP lz4_snappy_lits_emit_done + +memmove_long_lz4_snappy: + ADD R7, R0, R9 + + // genMemMoveLong + MOVD R2, R10 + MOVD R0, R11 + MOVD R7, R12 + +emit_lit_memmove_long_lz4_snappylarge_big_loop_back: + FMOVQ (R10), F0 + FMOVQ 16(R10), F1 + FMOVQ F0, (R11) + FMOVQ F1, 16(R11) + ADD $0x20, R10, R10 + ADD $0x20, R11, R11 + SUB $0x20, R12, R12 + CMP $0x20, R12 + BHS emit_lit_memmove_long_lz4_snappylarge_big_loop_back + ADD R7, R2, R15 + FMOVQ -32(R15), F0 + ADD R7, R2, R15 + FMOVQ -16(R15), F1 + ADD R7, R0, R15 + FMOVQ F0, -32(R15) + ADD R7, R0, R15 + FMOVQ F1, -16(R15) + MOVD R9, R0 + +lz4_snappy_lits_emit_done: + MOVD R6, R2 + +lz4_snappy_lits_done: + CMP R3, R2 + BNE lz4_snappy_match + CMP $0x04, R8 + BEQ lz4_snappy_done + JMP lz4_snappy_corrupt + +lz4_snappy_match: + ADD $2, R2, R6 + CMP R3, R6 + BHS lz4_snappy_corrupt + MOVHU (R2), R7 + MOVD R6, R2 + TST R7, R7 + BEQ lz4_snappy_corrupt + CMP R5, R7 + BHI lz4_snappy_corrupt + CMP $0x13, R8 + BNE lz4_snappy_ml_done + +lz4_snappy_ml_loop: + MOVBU (R2), R6 + ADD $1, R2, R2 + ADD R6, R8, R8 + CMP R3, R2 + BHS lz4_snappy_corrupt + CMP $0xff, R6 + BEQ lz4_snappy_ml_loop + +lz4_snappy_ml_done: + ADD R8, R5, R5 + + // emitCopy +two_byte_offset_lz4_s2: + CMPW $0x40, R8 + BLS two_byte_offset_short_lz4_s2 + MOVD $0xee, R16 + MOVB R16, (R0) + MOVH R7, 1(R0) + SUB $60, R8, R8 + MOVWU R8, R8 + ADD $0x03, R0, R0 + CMP R1, R0 + BHS lz4_snappy_loop + JMP two_byte_offset_lz4_s2 + +two_byte_offset_short_lz4_s2: + MOVWU R8, R6 + LSLW $0x02, R6, R6 + CMPW $0x0c, R8 + BHS emit_copy_three_lz4_s2 + CMPW $0x00000800, R7 + BHS emit_copy_three_lz4_s2 + SUB $15, R6, R6 + MOVWU R6, R6 + MOVB R7, 1(R0) + LSRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R6, R6 + MOVB R6, (R0) + ADD $0x02, R0, R0 + JMP lz4_snappy_loop + +emit_copy_three_lz4_s2: + SUB $2, R6, R6 + MOVWU R6, R6 + MOVB R6, (R0) + MOVH R7, 1(R0) + ADD $0x03, R0, R0 + JMP lz4_snappy_loop + +lz4_snappy_done: + MOVD dst_base+0(FP), R1 + SUB R1, R0, R0 + MOVD R5, uncompressed+48(FP) + MOVD R0, dstUsed+56(FP) + RET + +lz4_snappy_corrupt: + MOVD $0, R0 + SUB $1, R0, R5 + MOVD R5, uncompressed+48(FP) + RET + +lz4_snappy_dstfull: + MOVD $0, R0 + SUB $2, R0, R5 + MOVD R5, uncompressed+48(FP) + RET + +// func cvtLZ4sBlockSnappyAsm(dst []byte, src []byte) (uncompressed int, dstUsed int) +// Requires: SSE2 +TEXT ·cvtLZ4sBlockSnappyAsm(SB), NOSPLIT, $0-64 + MOVD $0, R5 + MOVD dst_base+0(FP), R0 + MOVD dst_len+8(FP), R1 + MOVD src_base+24(FP), R2 + MOVD src_len+32(FP), R3 + ADD R3, R2, R3 + ADD R1, R0, R1 + SUB $8, R1, R1 + +lz4s_snappy_loop: + CMP R3, R2 + BHS lz4s_snappy_corrupt + CMP R1, R0 + BHS lz4s_snappy_dstfull + MOVBU (R2), R6 + MOVD R6, R7 + MOVD R6, R8 + LSR $0x04, R7, R7 + AND $0x0f, R8, R8 + CMP $0xf0, R6 + BLO lz4s_snappy_ll_end + +lz4s_snappy_ll_loop: + ADD $1, R2, R2 + CMP R3, R2 + BHS lz4s_snappy_corrupt + MOVBU (R2), R6 + ADD R6, R7, R7 + CMP $0xff, R6 + BEQ lz4s_snappy_ll_loop + +lz4s_snappy_ll_end: + ADD R7, R2, R6 + ADD $0x03, R8, R8 + CMP R3, R6 + BHS lz4s_snappy_corrupt + ADD $1, R2, R2 + ADD $1, R6, R6 + TST R7, R7 + BEQ lz4s_snappy_lits_done + ADD R7, R0, R9 + CMP R1, R9 + BHS lz4s_snappy_dstfull + ADD R7, R5, R5 + SUB $1, R7, R9 + MOVWU R9, R9 + CMPW $0x3c, R9 + BLO one_byte_lz4s_snappy + CMPW $0x00000100, R9 + BLO two_bytes_lz4s_snappy + CMPW $0x00010000, R9 + BLO three_bytes_lz4s_snappy + CMPW $0x01000000, R9 + BLO four_bytes_lz4s_snappy + MOVD $0xfc, R16 + MOVB R16, (R0) + MOVW R9, 1(R0) + ADD $0x05, R0, R0 + JMP memmove_long_lz4s_snappy + +four_bytes_lz4s_snappy: + MOVWU R9, R10 + LSRW $0x10, R10, R10 + MOVD $0xf8, R16 + MOVB R16, (R0) + MOVH R9, 1(R0) + MOVB R10, 3(R0) + ADD $0x04, R0, R0 + JMP memmove_long_lz4s_snappy + +three_bytes_lz4s_snappy: + MOVD $0xf4, R16 + MOVB R16, (R0) + MOVH R9, 1(R0) + ADD $0x03, R0, R0 + JMP memmove_long_lz4s_snappy + +two_bytes_lz4s_snappy: + MOVD $0xf0, R16 + MOVB R16, (R0) + MOVB R9, 1(R0) + ADD $0x02, R0, R0 + CMPW $0x40, R9 + BLO memmove_lz4s_snappy + JMP memmove_long_lz4s_snappy + +one_byte_lz4s_snappy: + LSLW $0x02, R9, R16 + BFI $0, R16, $8, R9 + MOVB R9, (R0) + ADD $0x01, R0, R0 + +memmove_lz4s_snappy: + ADD R7, R0, R9 + + // genMemMoveShort + CMP $0x08, R7 + BLS emit_lit_memmove_lz4s_snappy_memmove_move_8 + CMP $0x10, R7 + BLS emit_lit_memmove_lz4s_snappy_memmove_move_8through16 + CMP $0x20, R7 + BLS emit_lit_memmove_lz4s_snappy_memmove_move_17through32 + JMP emit_lit_memmove_lz4s_snappy_memmove_move_33through64 + +emit_lit_memmove_lz4s_snappy_memmove_move_8: + MOVD (R2), R10 + MOVD R10, (R0) + JMP memmove_end_copy_lz4s_snappy + +emit_lit_memmove_lz4s_snappy_memmove_move_8through16: + MOVD (R2), R10 + ADD R7, R2, R15 + MOVD -8(R15), R2 + MOVD R10, (R0) + ADD R7, R0, R15 + MOVD R2, -8(R15) + JMP memmove_end_copy_lz4s_snappy + +emit_lit_memmove_lz4s_snappy_memmove_move_17through32: + FMOVQ (R2), F0 + ADD R7, R2, R15 + FMOVQ -16(R15), F1 + FMOVQ F0, (R0) + ADD R7, R0, R15 + FMOVQ F1, -16(R15) + JMP memmove_end_copy_lz4s_snappy + +emit_lit_memmove_lz4s_snappy_memmove_move_33through64: + FMOVQ (R2), F0 + FMOVQ 16(R2), F1 + ADD R7, R2, R15 + FMOVQ -32(R15), F2 + ADD R7, R2, R15 + FMOVQ -16(R15), F3 + FMOVQ F0, (R0) + FMOVQ F1, 16(R0) + ADD R7, R0, R15 + FMOVQ F2, -32(R15) + ADD R7, R0, R15 + FMOVQ F3, -16(R15) + +memmove_end_copy_lz4s_snappy: + MOVD R9, R0 + JMP lz4s_snappy_lits_emit_done + +memmove_long_lz4s_snappy: + ADD R7, R0, R9 + + // genMemMoveLong + MOVD R2, R10 + MOVD R0, R11 + MOVD R7, R12 + +emit_lit_memmove_long_lz4s_snappylarge_big_loop_back: + FMOVQ (R10), F0 + FMOVQ 16(R10), F1 + FMOVQ F0, (R11) + FMOVQ F1, 16(R11) + ADD $0x20, R10, R10 + ADD $0x20, R11, R11 + SUB $0x20, R12, R12 + CMP $0x20, R12 + BHS emit_lit_memmove_long_lz4s_snappylarge_big_loop_back + ADD R7, R2, R15 + FMOVQ -32(R15), F0 + ADD R7, R2, R15 + FMOVQ -16(R15), F1 + ADD R7, R0, R15 + FMOVQ F0, -32(R15) + ADD R7, R0, R15 + FMOVQ F1, -16(R15) + MOVD R9, R0 + +lz4s_snappy_lits_emit_done: + MOVD R6, R2 + +lz4s_snappy_lits_done: + CMP R3, R2 + BNE lz4s_snappy_match + CMP $0x03, R8 + BEQ lz4s_snappy_done + JMP lz4s_snappy_corrupt + +lz4s_snappy_match: + CMP $0x03, R8 + BEQ lz4s_snappy_loop + ADD $2, R2, R6 + CMP R3, R6 + BHS lz4s_snappy_corrupt + MOVHU (R2), R7 + MOVD R6, R2 + TST R7, R7 + BEQ lz4s_snappy_corrupt + CMP R5, R7 + BHI lz4s_snappy_corrupt + CMP $0x12, R8 + BNE lz4s_snappy_ml_done + +lz4s_snappy_ml_loop: + MOVBU (R2), R6 + ADD $1, R2, R2 + ADD R6, R8, R8 + CMP R3, R2 + BHS lz4s_snappy_corrupt + CMP $0xff, R6 + BEQ lz4s_snappy_ml_loop + +lz4s_snappy_ml_done: + ADD R8, R5, R5 + + // emitCopy +two_byte_offset_lz4_s2: + CMPW $0x40, R8 + BLS two_byte_offset_short_lz4_s2 + MOVD $0xee, R16 + MOVB R16, (R0) + MOVH R7, 1(R0) + SUB $60, R8, R8 + MOVWU R8, R8 + ADD $0x03, R0, R0 + CMP R1, R0 + BHS lz4s_snappy_loop + JMP two_byte_offset_lz4_s2 + +two_byte_offset_short_lz4_s2: + MOVWU R8, R6 + LSLW $0x02, R6, R6 + CMPW $0x0c, R8 + BHS emit_copy_three_lz4_s2 + CMPW $0x00000800, R7 + BHS emit_copy_three_lz4_s2 + SUB $15, R6, R6 + MOVWU R6, R6 + MOVB R7, 1(R0) + LSRW $0x08, R7, R7 + LSLW $0x05, R7, R7 + ORRW R7, R6, R6 + MOVB R6, (R0) + ADD $0x02, R0, R0 + JMP lz4s_snappy_loop + +emit_copy_three_lz4_s2: + SUB $2, R6, R6 + MOVWU R6, R6 + MOVB R6, (R0) + MOVH R7, 1(R0) + ADD $0x03, R0, R0 + JMP lz4s_snappy_loop + +lz4s_snappy_done: + MOVD dst_base+0(FP), R1 + SUB R1, R0, R0 + MOVD R5, uncompressed+48(FP) + MOVD R0, dstUsed+56(FP) + RET + +lz4s_snappy_corrupt: + MOVD $0, R0 + SUB $1, R0, R5 + MOVD R5, uncompressed+48(FP) + RET + +lz4s_snappy_dstfull: + MOVD $0, R0 + SUB $2, R0, R5 + MOVD R5, uncompressed+48(FP) + RET diff --git a/vendor/github.com/klauspost/compress/s2/encodeblock_asm.go b/vendor/github.com/klauspost/compress/s2/encodeblock_asm.go new file mode 100644 index 00000000000..392350cd1f3 --- /dev/null +++ b/vendor/github.com/klauspost/compress/s2/encodeblock_asm.go @@ -0,0 +1,228 @@ +// Code generated by command: go run gen.go -out ../encodeblock_amd64.s -stubs ../encodeblock_asm.go -pkg=s2. DO NOT EDIT. + +//go:build !noasm && gc && (amd64 || arm64) + +package s2 + +func _dummy_() + +// encodeBlockAsm encodes a non-empty src to a guaranteed-large-enough dst. +// Maximum input 4294967295 bytes. +// It assumes that the varint-encoded length of the decompressed bytes has already been written. +// +//go:noescape +func encodeBlockAsm(dst []byte, src []byte, tmp *[65536]byte) int + +// encodeBlockAsm4MB encodes a non-empty src to a guaranteed-large-enough dst. +// Maximum input 4194304 bytes. +// It assumes that the varint-encoded length of the decompressed bytes has already been written. +// +//go:noescape +func encodeBlockAsm4MB(dst []byte, src []byte, tmp *[65536]byte) int + +// encodeBlockAsm12B encodes a non-empty src to a guaranteed-large-enough dst. +// Maximum input 16383 bytes. +// It assumes that the varint-encoded length of the decompressed bytes has already been written. +// +//go:noescape +func encodeBlockAsm12B(dst []byte, src []byte, tmp *[16384]byte) int + +// encodeBlockAsm10B encodes a non-empty src to a guaranteed-large-enough dst. +// Maximum input 4095 bytes. +// It assumes that the varint-encoded length of the decompressed bytes has already been written. +// +//go:noescape +func encodeBlockAsm10B(dst []byte, src []byte, tmp *[4096]byte) int + +// encodeBlockAsm8B encodes a non-empty src to a guaranteed-large-enough dst. +// Maximum input 511 bytes. +// It assumes that the varint-encoded length of the decompressed bytes has already been written. +// +//go:noescape +func encodeBlockAsm8B(dst []byte, src []byte, tmp *[1024]byte) int + +// encodeBetterBlockAsm encodes a non-empty src to a guaranteed-large-enough dst. +// Maximum input 4294967295 bytes. +// It assumes that the varint-encoded length of the decompressed bytes has already been written. +// +//go:noescape +func encodeBetterBlockAsm(dst []byte, src []byte, tmp *[589824]byte) int + +// encodeBetterBlockAsm4MB encodes a non-empty src to a guaranteed-large-enough dst. +// Maximum input 4194304 bytes. +// It assumes that the varint-encoded length of the decompressed bytes has already been written. +// +//go:noescape +func encodeBetterBlockAsm4MB(dst []byte, src []byte, tmp *[589824]byte) int + +// encodeBetterBlockAsm12B encodes a non-empty src to a guaranteed-large-enough dst. +// Maximum input 16383 bytes. +// It assumes that the varint-encoded length of the decompressed bytes has already been written. +// +//go:noescape +func encodeBetterBlockAsm12B(dst []byte, src []byte, tmp *[81920]byte) int + +// encodeBetterBlockAsm10B encodes a non-empty src to a guaranteed-large-enough dst. +// Maximum input 4095 bytes. +// It assumes that the varint-encoded length of the decompressed bytes has already been written. +// +//go:noescape +func encodeBetterBlockAsm10B(dst []byte, src []byte, tmp *[20480]byte) int + +// encodeBetterBlockAsm8B encodes a non-empty src to a guaranteed-large-enough dst. +// Maximum input 511 bytes. +// It assumes that the varint-encoded length of the decompressed bytes has already been written. +// +//go:noescape +func encodeBetterBlockAsm8B(dst []byte, src []byte, tmp *[5120]byte) int + +// encodeSnappyBlockAsm encodes a non-empty src to a guaranteed-large-enough dst. +// Maximum input 4294967295 bytes. +// It assumes that the varint-encoded length of the decompressed bytes has already been written. +// +//go:noescape +func encodeSnappyBlockAsm(dst []byte, src []byte, tmp *[65536]byte) int + +// encodeSnappyBlockAsm64K encodes a non-empty src to a guaranteed-large-enough dst. +// Maximum input 65535 bytes. +// It assumes that the varint-encoded length of the decompressed bytes has already been written. +// +//go:noescape +func encodeSnappyBlockAsm64K(dst []byte, src []byte, tmp *[65536]byte) int + +// encodeSnappyBlockAsm12B encodes a non-empty src to a guaranteed-large-enough dst. +// Maximum input 16383 bytes. +// It assumes that the varint-encoded length of the decompressed bytes has already been written. +// +//go:noescape +func encodeSnappyBlockAsm12B(dst []byte, src []byte, tmp *[16384]byte) int + +// encodeSnappyBlockAsm10B encodes a non-empty src to a guaranteed-large-enough dst. +// Maximum input 4095 bytes. +// It assumes that the varint-encoded length of the decompressed bytes has already been written. +// +//go:noescape +func encodeSnappyBlockAsm10B(dst []byte, src []byte, tmp *[4096]byte) int + +// encodeSnappyBlockAsm8B encodes a non-empty src to a guaranteed-large-enough dst. +// Maximum input 511 bytes. +// It assumes that the varint-encoded length of the decompressed bytes has already been written. +// +//go:noescape +func encodeSnappyBlockAsm8B(dst []byte, src []byte, tmp *[1024]byte) int + +// encodeSnappyBetterBlockAsm encodes a non-empty src to a guaranteed-large-enough dst. +// Maximum input 4294967295 bytes. +// It assumes that the varint-encoded length of the decompressed bytes has already been written. +// +//go:noescape +func encodeSnappyBetterBlockAsm(dst []byte, src []byte, tmp *[589824]byte) int + +// encodeSnappyBetterBlockAsm64K encodes a non-empty src to a guaranteed-large-enough dst. +// Maximum input 65535 bytes. +// It assumes that the varint-encoded length of the decompressed bytes has already been written. +// +//go:noescape +func encodeSnappyBetterBlockAsm64K(dst []byte, src []byte, tmp *[294912]byte) int + +// encodeSnappyBetterBlockAsm12B encodes a non-empty src to a guaranteed-large-enough dst. +// Maximum input 16383 bytes. +// It assumes that the varint-encoded length of the decompressed bytes has already been written. +// +//go:noescape +func encodeSnappyBetterBlockAsm12B(dst []byte, src []byte, tmp *[81920]byte) int + +// encodeSnappyBetterBlockAsm10B encodes a non-empty src to a guaranteed-large-enough dst. +// Maximum input 4095 bytes. +// It assumes that the varint-encoded length of the decompressed bytes has already been written. +// +//go:noescape +func encodeSnappyBetterBlockAsm10B(dst []byte, src []byte, tmp *[20480]byte) int + +// encodeSnappyBetterBlockAsm8B encodes a non-empty src to a guaranteed-large-enough dst. +// Maximum input 511 bytes. +// It assumes that the varint-encoded length of the decompressed bytes has already been written. +// +//go:noescape +func encodeSnappyBetterBlockAsm8B(dst []byte, src []byte, tmp *[5120]byte) int + +// calcBlockSize encodes a non-empty src to a guaranteed-large-enough dst. +// Maximum input 4294967295 bytes. +// It assumes that the varint-encoded length of the decompressed bytes has already been written. +// +//go:noescape +func calcBlockSize(src []byte, tmp *[32768]byte) int + +// calcBlockSizeSmall encodes a non-empty src to a guaranteed-large-enough dst. +// Maximum input 1024 bytes. +// It assumes that the varint-encoded length of the decompressed bytes has already been written. +// +//go:noescape +func calcBlockSizeSmall(src []byte, tmp *[2048]byte) int + +// emitLiteral writes a literal chunk and returns the number of bytes written. +// +// It assumes that: +// +// dst is long enough to hold the encoded bytes with margin of 0 bytes +// 0 <= len(lit) && len(lit) <= math.MaxUint32 +// +//go:noescape +func emitLiteral(dst []byte, lit []byte) int + +// emitRepeat writes a repeat chunk and returns the number of bytes written. +// Length must be at least 4 and < 1<<32 +// +//go:noescape +func emitRepeat(dst []byte, offset int, length int) int + +// emitCopy writes a copy chunk and returns the number of bytes written. +// +// It assumes that: +// +// dst is long enough to hold the encoded bytes +// 1 <= offset && offset <= math.MaxUint32 +// 4 <= length && length <= 1 << 24 +// +//go:noescape +func emitCopy(dst []byte, offset int, length int) int + +// emitCopyNoRepeat writes a copy chunk and returns the number of bytes written. +// +// It assumes that: +// +// dst is long enough to hold the encoded bytes +// 1 <= offset && offset <= math.MaxUint32 +// 4 <= length && length <= 1 << 24 +// +//go:noescape +func emitCopyNoRepeat(dst []byte, offset int, length int) int + +// matchLen returns how many bytes match in a and b +// +// It assumes that: +// +// len(a) <= len(b) +// +//go:noescape +func matchLen(a []byte, b []byte) int + +// cvtLZ4Block converts an LZ4 block to S2 +// +//go:noescape +func cvtLZ4BlockAsm(dst []byte, src []byte) (uncompressed int, dstUsed int) + +// cvtLZ4sBlock converts an LZ4s block to S2 +// +//go:noescape +func cvtLZ4sBlockAsm(dst []byte, src []byte) (uncompressed int, dstUsed int) + +// cvtLZ4Block converts an LZ4 block to Snappy +// +//go:noescape +func cvtLZ4BlockSnappyAsm(dst []byte, src []byte) (uncompressed int, dstUsed int) + +// cvtLZ4sBlock converts an LZ4s block to Snappy +// +//go:noescape +func cvtLZ4sBlockSnappyAsm(dst []byte, src []byte) (uncompressed int, dstUsed int) diff --git a/vendor/github.com/klauspost/compress/s2/index.go b/vendor/github.com/klauspost/compress/s2/index.go index fb7db25315a..3630fa7bd12 100644 --- a/vendor/github.com/klauspost/compress/s2/index.go +++ b/vendor/github.com/klauspost/compress/s2/index.go @@ -151,7 +151,7 @@ func (i *Index) reduce() { i.estBlockUncomp += i.estBlockUncomp * int64(removeN) } -func (i *Index) appendTo(b []byte, uncompTotal, compTotal int64) []byte { +func (i *Index) appendTo(b []byte, compTotal, uncompTotal int64) []byte { i.reduce() var tmp [binary.MaxVarintLen64]byte @@ -425,7 +425,7 @@ func IndexStream(r io.Reader) ([]byte, error) { _, err := io.ReadFull(r, buf[:4]) if err != nil { if err == io.EOF { - return i.appendTo(nil, i.TotalUncompressed, i.TotalCompressed), nil + return i.appendTo(nil, i.TotalCompressed, i.TotalUncompressed), nil } return nil, err } @@ -545,7 +545,9 @@ func (i *Index) JSON() []byte { // Returns nil if headers contains errors. // The returned slice references the provided slice. func RemoveIndexHeaders(b []byte) []byte { - const save = 4 + len(S2IndexHeader) + len(S2IndexTrailer) + 4 + // Chunk content that is trimmed off below. + const minChunkLen = len(S2IndexHeader) + len(S2IndexTrailer) + 4 + const save = skippableFrameHeader + minChunkLen if len(b) <= save { return nil } @@ -555,8 +557,9 @@ func RemoveIndexHeaders(b []byte) []byte { chunkLen := int(b[1]) | int(b[2])<<8 | int(b[3])<<16 b = b[4:] - // Validate we have enough... - if len(b) < chunkLen { + // Validate we have enough, and that the chunk itself is long enough + // to hold what is trimmed off below. + if len(b) < chunkLen || chunkLen < minChunkLen { return nil } b = b[:chunkLen] diff --git a/vendor/github.com/klauspost/compress/s2/lz4convert.go b/vendor/github.com/klauspost/compress/s2/lz4convert.go index 46ed908e3c0..23bbc77e27d 100644 --- a/vendor/github.com/klauspost/compress/s2/lz4convert.go +++ b/vendor/github.com/klauspost/compress/s2/lz4convert.go @@ -13,6 +13,7 @@ import ( // LZ4Converter provides conversion from LZ4 blocks as defined here: // https://github.com/lz4/lz4/blob/dev/doc/lz4_Block_format.md type LZ4Converter struct { + noAsm bool } // ErrDstTooSmall is returned when provided destination is too small. @@ -32,7 +33,7 @@ func (l *LZ4Converter) ConvertBlock(dst, src []byte) ([]byte, int, error) { s, d := 0, len(dst) dst = dst[:cap(dst)] - if !debug && hasAmd64Asm { + if !debug && hasAsm && !l.noAsm { res, sz := cvtLZ4BlockAsm(dst[d:], src) if res < 0 { const ( @@ -96,7 +97,8 @@ func (l *LZ4Converter) ConvertBlock(dst, src []byte) ([]byte, int, error) { } s++ if ll > 0 { - if d+ll > dLimit { + // Leave room for a 5-byte literal header and an 8-byte copy. + if d+ll > len(dst)-13 { return nil, 0, ErrDstTooSmall } if debug { @@ -209,11 +211,13 @@ func (l *LZ4Converter) ConvertBlock(dst, src []byte) ([]byte, int, error) { dst[2] = uint8(length >> 0) dst[1] = 0 dst[0] = 7<<2 | tagCopy1 + d += 5 if left > 0 { - d += 5 + emitRepeat16(dst[5:], offset, left) - break + // The loop condition checks room for the next chunk. + dst = dst[5:] + length = left + continue } - d += 5 break } } @@ -288,7 +292,7 @@ func (l *LZ4Converter) ConvertBlockSnappy(dst, src []byte) ([]byte, int, error) s, d := 0, len(dst) dst = dst[:cap(dst)] // Use assembly when possible - if !debug && hasAmd64Asm { + if !debug && hasAsm && !l.noAsm { res, sz := cvtLZ4BlockSnappyAsm(dst[d:], src) if res < 0 { const ( @@ -488,6 +492,11 @@ func emitRepeat16(dst []byte, offset uint16, length int) int { length -= 1 << 16 left := 0 if length > maxRepeat { + if len(dst) < 10 { + // No room for this and the next chunk. + // Report more than len(dst) so the caller sees dst is full. + return len(dst) + 1 + } left = length - maxRepeat + 4 length = maxRepeat - 4 } diff --git a/vendor/github.com/klauspost/compress/s2/lz4sconvert.go b/vendor/github.com/klauspost/compress/s2/lz4sconvert.go index 000f39719c5..ca01a2c2b77 100644 --- a/vendor/github.com/klauspost/compress/s2/lz4sconvert.go +++ b/vendor/github.com/klauspost/compress/s2/lz4sconvert.go @@ -21,6 +21,7 @@ import ( // For Min Match of 4 bytes, Copy length value 1-15 means length 4-18 with 18 bytes adding an extra byte. // ONLY "Min match of 4 bytes" is supported. type LZ4sConverter struct { + noAsm bool } // ConvertBlock will convert an LZ4s block and append it as an S2 @@ -37,7 +38,7 @@ func (l *LZ4sConverter) ConvertBlock(dst, src []byte) ([]byte, int, error) { s, d := 0, len(dst) dst = dst[:cap(dst)] - if !debug && hasAmd64Asm { + if !debug && hasAsm && !l.noAsm { res, sz := cvtLZ4sBlockAsm(dst[d:], src) if res < 0 { const ( @@ -101,7 +102,8 @@ func (l *LZ4sConverter) ConvertBlock(dst, src []byte) ([]byte, int, error) { } s++ if ll > 0 { - if d+ll > dLimit { + // Leave room for a 5-byte literal header and an 8-byte copy. + if d+ll > len(dst)-13 { return nil, 0, ErrDstTooSmall } if debug { @@ -218,11 +220,13 @@ func (l *LZ4sConverter) ConvertBlock(dst, src []byte) ([]byte, int, error) { dst[2] = uint8(length >> 0) dst[1] = 0 dst[0] = 7<<2 | tagCopy1 + d += 5 if left > 0 { - d += 5 + emitRepeat16(dst[5:], offset, left) - break + // The loop condition checks room for the next chunk. + dst = dst[5:] + length = left + continue } - d += 5 break } } @@ -297,7 +301,7 @@ func (l *LZ4sConverter) ConvertBlockSnappy(dst, src []byte) ([]byte, int, error) s, d := 0, len(dst) dst = dst[:cap(dst)] // Use assembly when possible - if !debug && hasAmd64Asm { + if !debug && hasAsm && !l.noAsm { res, sz := cvtLZ4sBlockSnappyAsm(dst[d:], src) if res < 0 { const ( diff --git a/vendor/github.com/klauspost/compress/s2/reader.go b/vendor/github.com/klauspost/compress/s2/reader.go index 17443e2c146..d3b89b499f1 100644 --- a/vendor/github.com/klauspost/compress/s2/reader.go +++ b/vendor/github.com/klauspost/compress/s2/reader.go @@ -9,7 +9,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "math" "runtime" "sync" @@ -212,7 +211,7 @@ func (r *Reader) skippable(tmp []byte, n int, allowEOF bool, id uint8) (ok bool) if r.err != nil { return false } - _, r.err = io.CopyBuffer(ioutil.Discard, rd, tmp) + _, r.err = io.CopyBuffer(io.Discard, rd, tmp) return r.err == nil } if rs, ok := r.r.(io.ReadSeeker); ok { @@ -451,9 +450,7 @@ func (r *Reader) DecodeConcurrent(w io.Writer, concurrent int) (written int64, e } // Writer var wg sync.WaitGroup - wg.Add(1) - go func() { - defer wg.Done() + wg.Go(func() { for toWrite := range queue { entry := <-toWrite reUse <- toWrite @@ -480,7 +477,7 @@ func (r *Reader) DecodeConcurrent(w io.Writer, concurrent int) (written int64, e } aWritten += int64(n) } - }() + }) defer func() { if r.err != nil { diff --git a/vendor/github.com/klauspost/compress/s2/writer.go b/vendor/github.com/klauspost/compress/s2/writer.go index 09f1cff3a96..8077f2f6887 100644 --- a/vendor/github.com/klauspost/compress/s2/writer.go +++ b/vendor/github.com/klauspost/compress/s2/writer.go @@ -139,11 +139,9 @@ func (w *Writer) Reset(writer io.Writer) { toWrite := make(chan chan result, w.concurrency) w.output = toWrite - w.writerWg.Add(1) // Start a writer goroutine that will write all output in order. - go func() { - defer w.writerWg.Done() + w.writerWg.Go(func() { // Get a queued write. for write := range toWrite { @@ -175,7 +173,7 @@ func (w *Writer) Reset(writer io.Writer) { // This can be used for synchronizing flushes. close(write) } - }() + }) } // Write satisfies the io.Writer interface. @@ -811,7 +809,7 @@ func (w *Writer) closeIndex(idx bool) ([]byte, error) { if w.pad <= 1 { compSize = w.written } - index = w.index.appendTo(w.ibuf[:0], w.uncompWritten, compSize) + index = w.index.appendTo(w.ibuf[:0], compSize, w.uncompWritten) // Count as written for padding. if w.appendIndex { w.written += int64(len(index)) diff --git a/vendor/github.com/klauspost/compress/zstd/bitwriter.go b/vendor/github.com/klauspost/compress/zstd/bitwriter.go index b22b297e62a..668ac261085 100644 --- a/vendor/github.com/klauspost/compress/zstd/bitwriter.go +++ b/vendor/github.com/klauspost/compress/zstd/bitwriter.go @@ -5,6 +5,45 @@ package zstd +import ( + "github.com/klauspost/compress/internal/le" + "github.com/klauspost/compress/internal/regmask" +) + +// bitState is a bit writer that stays in registers when passed and +// returned by value. It writes into a buffer owned by the caller. +type bitState struct { + c uint64 + nb uint + pos int +} + +// flush writes the whole bytes with one 8-byte store at pos, leaving +// at most 7 bits. buf must have 8 bytes of room at pos. +func (s bitState) flush(buf []byte) bitState { + le.Store64(buf, s.pos, s.c) + s.pos += int(s.nb >> 3) + s.c >>= (s.nb &^ 7) & regmask.Shift64ByUint + s.nb &= 7 + return s +} + +// add adds n bits from v, which must have no bits set above them. +// There must be room for them. +func (s bitState) add(v uint64, n uint) bitState { + s.c |= v << (s.nb & regmask.Shift64ByUint) + s.nb += n + return s +} + +// addState adds the bits that FSE-encode tt from state, and returns +// the next state from tab. +func (s bitState) addState(state uint16, tab []uint16, tt symbolTransform) (bitState, uint16) { + nbBitsOut := (uint32(state) + tt.deltaNbBits) >> 16 + s = s.add(uint64(state&bitMask16[nbBitsOut&31]), uint(nbBitsOut)) + return s, tab[int32(state>>(nbBitsOut®mask.Shift16ByUint32))+int32(tt.deltaFindState)] +} + // bitWriter will write bits. // First bit will be LSB of the first byte of output. type bitWriter struct { diff --git a/vendor/github.com/klauspost/compress/zstd/blockdec.go b/vendor/github.com/klauspost/compress/zstd/blockdec.go index 2329e996f86..74fc5570194 100644 --- a/vendor/github.com/klauspost/compress/zstd/blockdec.go +++ b/vendor/github.com/klauspost/compress/zstd/blockdec.go @@ -240,9 +240,11 @@ func (b *blockDec) decodeBuf(hist *history) error { b.dst[i] = v } hist.appendKeep(b.dst) + hist.decoders.consumeSyncLen(len(b.dst)) return nil case blockTypeRaw: hist.appendKeep(b.data) + hist.decoders.consumeSyncLen(len(b.data)) return nil case blockTypeCompressed: saved := b.dst @@ -400,8 +402,9 @@ func (b *blockDec) decodeLiterals(in []byte, hist *history) (remain []byte, err } } var err error - // Use our out buffer. - huff.MaxDecodedSize = litRegenSize + // Decoder.Decompress* uses cap(dst) for the size limit. Do not write + // MaxDecodedSize on hist.huffTree: with a trained dictionary that + // pointer aliases the shared dict.litEnc and concurrent DecodeAll races. if fourStreams { literals, err = huff.Decoder().Decompress4X(b.literalBuf[:0:litRegenSize], literals) } else { @@ -415,6 +418,8 @@ func (b *blockDec) decodeLiterals(in []byte, hist *history) (remain []byte, err if len(literals) != litRegenSize { return in, fmt.Errorf("literal output size mismatch want %d, got %d", litRegenSize, len(literals)) } + // Re-cap to get extra size. + literals = b.literalBuf[:len(literals)] case literalsBlockCompressed: if len(in) < litCompSize { @@ -486,10 +491,24 @@ func (b *blockDec) decodeCompressed(hist *history) error { } if hist.decoders.nSeqs == 0 { b.dst = append(b.dst, hist.decoders.literals...) + hist.decoders.consumeSyncLen(len(hist.decoders.literals)) return nil } before := len(hist.decoders.out) - err = hist.decoders.decodeSync(hist.b[hist.ignoreBuffer:]) + h := hist.b[hist.ignoreBuffer:] + if hist.ext != nil { + h = hist.ext + } + if hist.dict == nil && hist.decoders.useTwoPass() { + // Two passes, as the concurrent decoder does: knowing the offsets + // up front lets executeSimple prefetch match sources. + if err := b.decodeSequences(hist); err != nil { + return err + } + err = hist.decoders.executeSimple(b.sequence, h) + } else { + err = hist.decoders.decodeSync(h) + } if err != nil { return err } @@ -600,16 +619,11 @@ func (b *blockDec) prepareSequences(in []byte, hist *history) (err error) { if seq.fse == nil || seq.fse.preDefined { seq.fse = fseDecoderPool.Get().(*fseDecoder) } - err := seq.fse.readNCount(&br, uint16(maxTableSymbol[i])) + err := seq.fse.readNCount(&br, tableIndex(i)) if err != nil { println("Read table error:", err) return err } - err = seq.fse.transform(symbolTableX[i]) - if err != nil { - println("Transform table error:", err) - return err - } if debugDecoder { println("Read table ok", "symbolLen:", seq.fse.symbolLen) } @@ -669,42 +683,41 @@ func (b *blockDec) decodeSequences(hist *history) error { return err } +// executeSequences executes the block's sequences straight into the history +// ring, as decodeCompressed does, and copies the result to b.dst for output. func (b *blockDec) executeSequences(hist *history) error { - hbytes := hist.b - if len(hbytes) > hist.windowSize { - hbytes = hbytes[len(hbytes)-hist.windowSize:] - // We do not need history anymore. - if hist.dict != nil { - hist.dict.content = nil - } - } + hist.ensureBlockRing() + start := len(hist.b) hist.decoders.windowSize = hist.windowSize - hist.decoders.out = b.dst[:0] - err := hist.decoders.execute(b.sequence, hbytes) + hist.decoders.out = hist.b + err := hist.decoders.execute(b.sequence, hist.ext) if err != nil { return err } - return b.updateHistory(hist) + return b.updateHistory(hist, start) } -func (b *blockDec) updateHistory(hist *history) error { +// updateHistory copies the block's output, which starts at out[start], to +// b.dst and keeps it as history. +func (b *blockDec) updateHistory(hist *history, start int) error { if len(b.data) > maxCompressedBlockSize { return fmt.Errorf("compressed block size too large (%d)", len(b.data)) } - // Set output and release references. - b.dst = hist.decoders.out + out := hist.decoders.out + b.dst = append(b.dst[:0], out[start:]...) hist.recentOffsets = hist.decoders.prevOffset if b.Last { // if last block we don't care about history. - println("Last block, no history returned") - hist.b = hist.b[:0] - return nil - } else { - hist.append(b.dst) if debugDecoder { - println("Finished block with ", len(b.sequence), "sequences. Added", len(b.dst), "to history, now length", len(hist.b)) + println("Last block, no history returned") } + hist.b = hist.b[:0] + return nil + } + hist.b = out + if debugDecoder { + println("Finished block with ", len(b.sequence), "sequences. Added", len(b.dst), "to history, now length", len(hist.b)) } hist.decoders.out, hist.decoders.literals = nil, nil diff --git a/vendor/github.com/klauspost/compress/zstd/blockenc.go b/vendor/github.com/klauspost/compress/zstd/blockenc.go index 0e33aea4422..697e91f0815 100644 --- a/vendor/github.com/klauspost/compress/zstd/blockenc.go +++ b/vendor/github.com/klauspost/compress/zstd/blockenc.go @@ -628,38 +628,6 @@ func (b *blockEnc) encode(org []byte, raw, rawAllLits bool) error { return err } - // Choose the best compression mode for each type. - // Will evaluate the new vs predefined and previous. - chooseComp := func(cur, prev, preDef *fseEncoder) (*fseEncoder, seqCompMode) { - // See if predefined/previous is better - hist := cur.count[:cur.symbolLen] - nSize := cur.approxSize(hist) + cur.maxHeaderSize() - predefSize := preDef.approxSize(hist) - prevSize := prev.approxSize(hist) - - // Add a small penalty for new encoders. - // Don't bother with extremely small (<2 byte gains). - nSize = nSize + (nSize+2*8*16)>>4 - switch { - case predefSize <= prevSize && predefSize <= nSize || forcePreDef: - if debugEncoder { - println("Using predefined", predefSize>>3, "<=", nSize>>3) - } - return preDef, compModePredefined - case prevSize <= nSize: - if debugEncoder { - println("Using previous", prevSize>>3, "<=", nSize>>3) - } - return prev, compModeRepeat - default: - if debugEncoder { - println("Using new, predef", predefSize>>3, ". previous:", prevSize>>3, ">", nSize>>3, "header max:", cur.maxHeaderSize()>>3, "bytes") - println("tl:", cur.actualTableLog, "symbolLen:", cur.symbolLen, "norm:", cur.norm[:cur.symbolLen], "hist", cur.count[:cur.symbolLen]) - } - return cur, compModeFSE - } - } - // Write compression mode var mode uint8 if llEnc.useRLE { @@ -670,7 +638,7 @@ func (b *blockEnc) encode(org []byte, raw, rawAllLits bool) error { } } else { var m seqCompMode - llEnc, m = chooseComp(llEnc, b.coders.llPrev, &fsePredefEnc[tableLiteralLengths]) + llEnc, m = b.chooseComp(llEnc, b.coders.llPrev, &fsePredefEnc[tableLiteralLengths]) mode |= uint8(m) << 6 } if ofEnc.useRLE { @@ -681,7 +649,7 @@ func (b *blockEnc) encode(org []byte, raw, rawAllLits bool) error { } } else { var m seqCompMode - ofEnc, m = chooseComp(ofEnc, b.coders.ofPrev, &fsePredefEnc[tableOffsets]) + ofEnc, m = b.chooseComp(ofEnc, b.coders.ofPrev, &fsePredefEnc[tableOffsets]) mode |= uint8(m) << 4 } @@ -693,7 +661,7 @@ func (b *blockEnc) encode(org []byte, raw, rawAllLits bool) error { } } else { var m seqCompMode - mlEnc, m = chooseComp(mlEnc, b.coders.mlPrev, &fsePredefEnc[tableMatchLengths]) + mlEnc, m = b.chooseComp(mlEnc, b.coders.mlPrev, &fsePredefEnc[tableMatchLengths]) mode |= uint8(m) << 2 } b.output = append(b.output, mode) @@ -753,54 +721,57 @@ func (b *blockEnc) encode(org []byte, raw, rawAllLits bool) error { println("Encoded seq", seq, s, "codes:", s.llCode, s.mlCode, s.ofCode, "states:", ll.state, ml.state, of.state, "bits:", llB, mlB, ofB) } seq-- - // Store sequences in reverse... - for seq >= 0 { - s = b.sequences[seq] - - ofB := ofTT[s.ofCode] - wr.flush32() // tablelog max is below 8 for each, so it will fill max 24 bits. - //of.encode(ofB) - nbBitsOut := (uint32(of.state) + ofB.deltaNbBits) >> 16 - dstState := int32(of.state>>(nbBitsOut&15)) + int32(ofB.deltaFindState) - wr.addBits16NC(of.state, uint8(nbBitsOut)) - of.state = of.stateTable[dstState] - - // Accumulate extra bits. - outBits := ofB.outBits & 31 - extraBits := uint64(s.offset & bitMask32[outBits]) - extraBitsN := outBits - - mlB := mlTT[s.mlCode] - //ml.encode(mlB) - nbBitsOut = (uint32(ml.state) + mlB.deltaNbBits) >> 16 - dstState = int32(ml.state>>(nbBitsOut&15)) + int32(mlB.deltaFindState) - wr.addBits16NC(ml.state, uint8(nbBitsOut)) - ml.state = ml.stateTable[dstState] - - outBits = mlB.outBits & 31 - extraBits = extraBits<> 16 - dstState = int32(ll.state>>(nbBitsOut&15)) + int32(llB.deltaFindState) - wr.addBits16NC(ll.state, uint8(nbBitsOut)) - ll.state = ll.stateTable[dstState] - - outBits = llB.outBits & 31 - extraBits = extraBits<= 0 { + n := (len(buf) - w.pos - 16) / seqMaxBytes + if n <= 0 { + buf = slices.Grow(buf[:w.pos], (seq+1)*seqMaxBytes+16) + buf = buf[:cap(buf)] + continue + } + for stop := max(seq-n, -1); seq > stop; seq-- { + s := seqs[seq] + ofB, mlB, llB := ofTT[s.ofCode], mlTT[s.mlCode], llTT[s.llCode] + + // w.nb <= 37 here, and the states add at most 26 bits. + w, ofState = w.addState(ofState, ofTab, ofB) + w, mlState = w.addState(mlState, mlTab, mlB) + w, llState = w.addState(llState, llTab, llB) + + ofBits, mlBits, llBits := ofB.outBits&31, mlB.outBits&31, llB.outBits&31 + extra := uint64(s.offset&bitMask32[ofBits])<<(mlBits+llBits) | + uint64(s.matchLen&bitMask32[mlBits])< 63 { + w = w.flush(buf) + if extraN > 56 { + // Only offsets over 24 bits get here. + low := uint(mlBits + llBits) + w = w.add(extra&(1<>= low + extraN -= low + } + } + w = w.add(extra, extraN).flush(buf) - if debugSequences { - println("Encoded seq", seq, s) + if debugSequences { + println("Encoded seq", seq, s) + } } - - seq-- } + wr.bitContainer, wr.nBits, wr.out = w.c, uint8(w.nb), buf[:w.pos] + of.state, ml.state, ll.state = ofState, mlState, llState ml.flush(mlEnc.actualTableLog) of.flush(ofEnc.actualTableLog) ll.flush(llEnc.actualTableLog) @@ -826,6 +797,54 @@ func (b *blockEnc) encode(org []byte, raw, rawAllLits bool) error { return nil } +// chooseComp chooses the cheapest of the new, predefined and previous table. +func (b *blockEnc) chooseComp(cur, prev, preDef *fseEncoder) (*fseEncoder, seqCompMode) { + hist := cur.count[:cur.symbolLen] + nSize := cur.approxSize(hist) + cur.maxHeaderSize() + predefSize := preDef.approxSize(hist) + prevSize := prev.approxSize(hist) + + // Add a small penalty for new encoders. + // Don't bother with extremely small (<2 byte gains). + nSize = nSize + (nSize+2*8*16)>>4 + // The previous table may come from a dictionary and fit poorly, + // so it is compared against the exact header size, without penalty. + nSizePrev := nSize + if prevSize != math.MaxUint32 { + // Written to spare capacity; the real header goes there later. + if hdr, err := cur.writeCount(b.output[len(b.output):]); err == nil { + nSizePrev = cur.approxSize(hist) + uint32(len(hdr))*8 + } + } + // Each stream ends with a flush of tableLog bits. + nSize += uint32(cur.actualTableLog) + nSizePrev += uint32(cur.actualTableLog) + if predefSize != math.MaxUint32 { + predefSize += uint32(preDef.actualTableLog) + } + if prevSize != math.MaxUint32 { + prevSize += uint32(prev.actualTableLog) + } + switch { + case predefSize <= prevSize && predefSize <= nSize || forcePreDef: + if debugEncoder { + println("Using predefined", predefSize>>3, "<=", nSize>>3) + } + return preDef, compModePredefined + case prevSize <= nSizePrev: + if debugEncoder { + println("Using previous", prevSize>>3, "<=", nSizePrev>>3) + } + return prev, compModeRepeat + default: + if debugEncoder { + println("Using new, predef", predefSize>>3, ". previous:", prevSize>>3, ">", nSize>>3, "header max:", cur.maxHeaderSize()>>3, "bytes") + println("tl:", cur.actualTableLog, "symbolLen:", cur.symbolLen, "norm:", cur.norm[:cur.symbolLen], "hist", cur.count[:cur.symbolLen]) + } + return cur, compModeFSE + } +} + var errIncompressible = errors.New("incompressible") func (b *blockEnc) genCodes() { diff --git a/vendor/github.com/klauspost/compress/zstd/decoder.go b/vendor/github.com/klauspost/compress/zstd/decoder.go index c7e500f02a9..3aec681d6ad 100644 --- a/vendor/github.com/klauspost/compress/zstd/decoder.go +++ b/vendor/github.com/klauspost/compress/zstd/decoder.go @@ -7,8 +7,11 @@ package zstd import ( "context" "encoding/binary" + "errors" "io" + "maps" "sync" + "sync/atomic" "github.com/klauspost/compress/zstd/internal/xxhash" ) @@ -20,7 +23,8 @@ import ( // A decoder can safely be re-used even if the previous stream failed. // To release the resources, you must call the Close() function on a decoder. type Decoder struct { - o decoderOptions + // publishedOptions contains the current immutable decoder options. + publishedOptions atomic.Pointer[decoderOptions] // Unreferenced decoders, ready for use. decoders chan *blockDec @@ -84,9 +88,10 @@ var ( func NewReader(r io.Reader, opts ...DOption) (*Decoder, error) { initPredefined() var d Decoder - d.o.setDefault() - for _, o := range opts { - err := o(&d.o) + var o decoderOptions + o.setDefault() + for _, opt := range opts { + err := opt(&o) if err != nil { return nil, err } @@ -99,17 +104,19 @@ func NewReader(r io.Reader, opts ...DOption) (*Decoder, error) { } // Initialize dict map if needed. - if d.o.dicts == nil { - d.o.dicts = make(map[uint32]*dict) + if o.dicts == nil { + o.dicts = make(map[uint32]*dict) } // Create decoders - d.decoders = make(chan *blockDec, d.o.concurrent) - for i := 0; i < d.o.concurrent; i++ { - dec := newBlockDec(d.o.lowMem) - dec.localFrame = newFrameDec(d.o) + d.decoders = make(chan *blockDec, o.concurrent) + for i := 0; i < o.concurrent; i++ { + dec := newBlockDec(o.lowMem) + dec.localFrame = newFrameDec(o) + dec.localFrame.o.dicts = nil d.decoders <- dec } + d.publishedOptions.Store(&o) if r == nil { return &d, nil @@ -171,6 +178,9 @@ func (d *Decoder) Reset(r io.Reader) error { d.drainOutput() d.syncStream.br.r = nil + if d.frame != nil { + d.frame.o.dicts = nil + } if r == nil { d.current.err = ErrDecoderNilInput if len(d.current.b) > 0 { @@ -180,8 +190,10 @@ func (d *Decoder) Reset(r io.Reader) error { return nil } + o := *d.publishedOptions.Load() + // If bytes buffer and < 5MB, do sync decoding anyway. - if bb, ok := r.(byter); ok && bb.Len() < d.o.decodeBufsBelow && !d.o.limitToCap { + if bb, ok := r.(byter); ok && bb.Len() < o.decodeBufsBelow && !o.limitToCap { bb2 := bb if debugDecoder { println("*bytes.Buffer detected, doing sync decode, len:", bb.Len()) @@ -193,18 +205,30 @@ func (d *Decoder) Reset(r io.Reader) error { } dst, err := d.DecodeAll(b, dst) - if err == nil { - err = io.EOF + if !errors.Is(err, ErrDecoderSizeExceeded) { + if err == nil { + err = io.EOF + } + // Save output buffer + d.syncStream.dstBuf = dst + d.current.b = dst + d.current.err = err + d.current.flushed = true + if debugDecoder { + println("sync decode to", len(dst), "bytes, err:", err) + } + return nil } - // Save output buffer - d.syncStream.dstBuf = dst - d.current.b = dst - d.current.err = err - d.current.flushed = true + // The output does not fit WithDecoderMaxMemory, which caps the total + // decoded size when decoding in memory. A Reader follows the + // streaming contract, where the option caps the window instead, so + // decode this input as a stream after all; the shortcut has not + // consumed the reader. Drop the oversized buffer rather than keep it + // for reuse. if debugDecoder { - println("sync decode to", len(dst), "bytes, err:", err) + println("sync decode exceeded max memory after", len(dst), "bytes; streaming instead") } - return nil + d.syncStream.dstBuf = nil } // Remove current block. d.stashDecoder() @@ -217,14 +241,16 @@ func (d *Decoder) Reset(r io.Reader) error { // Ensure no-one else is still running... d.streamWg.Wait() if d.frame == nil { - d.frame = newFrameDec(d.o) + d.frame = newFrameDec(o) + } else { + d.frame.setOptions(o) } - if d.o.concurrent == 1 { + if o.concurrent == 1 { return d.startSyncDecoder(r) } - d.current.output = make(chan decodeOutput, d.o.concurrent) + d.current.output = make(chan decodeOutput, o.concurrent) ctx, cancel := context.WithCancel(context.Background()) d.current.cancel = cancel d.streamWg.Add(1) @@ -238,13 +264,21 @@ func (d *Decoder) Reset(r io.Reader) error { // Options are applied on top of the existing options. // Some options cannot be changed on reset and will return an error. func (d *Decoder) ResetWithOptions(r io.Reader, opts ...DOption) error { - d.o.resetOpt = true - defer func() { d.o.resetOpt = false }() + if d.current.err == ErrDecoderClosed { + return d.current.err + } + next := *d.publishedOptions.Load() + next.dicts = maps.Clone(next.dicts) + next.resetOpt = true for _, o := range opts { - if err := o(&d.o); err != nil { + if err := o(&next); err != nil { + next.resetOpt = false + d.publishedOptions.Store(&next) return err } } + next.resetOpt = false + d.publishedOptions.Store(&next) return d.Reset(r) } @@ -324,6 +358,8 @@ func (d *Decoder) DecodeAll(input, dst []byte) ([]byte, error) { // Grab a block decoder and frame decoder. block := <-d.decoders frame := block.localFrame + o := *d.publishedOptions.Load() + frame.setOptions(o) initialSize := len(dst) defer func() { if debugDecoder { @@ -335,6 +371,7 @@ func (d *Decoder) DecodeAll(input, dst []byte) ([]byte, error) { frame.history.decoders.br.in = nil frame.history.decoders.br.cursor = 0 } + frame.o.dicts = nil d.decoders <- block }() frame.bBuf = input @@ -354,20 +391,20 @@ func (d *Decoder) DecodeAll(input, dst []byte) ([]byte, error) { if err = d.setDict(frame); err != nil { return nil, err } - if frame.WindowSize > d.o.maxWindowSize { + if frame.WindowSize > frame.o.maxWindowSize { if debugDecoder { - println("window size exceeded:", frame.WindowSize, ">", d.o.maxWindowSize) + println("window size exceeded:", frame.WindowSize, ">", frame.o.maxWindowSize) } return dst, ErrWindowSizeExceeded } if frame.FrameContentSize != fcsUnknown { - if frame.FrameContentSize > d.o.maxDecodedSize-uint64(len(dst)-initialSize) { + if frame.FrameContentSize > frame.o.maxDecodedSize-uint64(len(dst)-initialSize) { if debugDecoder { - println("decoder size exceeded; fcs:", frame.FrameContentSize, "> mcs:", d.o.maxDecodedSize-uint64(len(dst)-initialSize), "len:", len(dst)) + println("decoder size exceeded; fcs:", frame.FrameContentSize, "> mcs:", frame.o.maxDecodedSize-uint64(len(dst)-initialSize), "len:", len(dst)) } return dst, ErrDecoderSizeExceeded } - if d.o.limitToCap && frame.FrameContentSize > uint64(cap(dst)-len(dst)) { + if frame.o.limitToCap && frame.FrameContentSize > uint64(cap(dst)-len(dst)) { if debugDecoder { println("decoder size exceeded; fcs:", frame.FrameContentSize, "> (cap-len)", cap(dst)-len(dst)) } @@ -380,14 +417,14 @@ func (d *Decoder) DecodeAll(input, dst []byte) ([]byte, error) { } } - if cap(dst) == 0 && !d.o.limitToCap { + if cap(dst) == 0 && !frame.o.limitToCap { // Allocate len(input) * 2 by default if nothing is provided // and we didn't get frame content size. size := min( // Cap to 1 MB. len(input)*2, 1<<20) - if uint64(size) > d.o.maxDecodedSize { - size = int(d.o.maxDecodedSize) + if uint64(size) > frame.o.maxDecodedSize { + size = int(frame.o.maxDecodedSize) } dst = make([]byte, 0, size) } @@ -396,7 +433,7 @@ func (d *Decoder) DecodeAll(input, dst []byte) ([]byte, error) { if err != nil { return dst, err } - if uint64(len(dst)-initialSize) > d.o.maxDecodedSize { + if uint64(len(dst)-initialSize) > frame.o.maxDecodedSize { return dst, ErrDecoderSizeExceeded } if len(frame.bBuf) == 0 { @@ -459,7 +496,7 @@ func (d *Decoder) nextBlock(blocking bool) (ok bool) { println("got", len(d.current.b), "bytes, error:", d.current.err, "data crc:", tmp) } - if d.o.ignoreChecksum { + if d.frame.o.ignoreChecksum { return true } @@ -497,7 +534,7 @@ func (d *Decoder) nextBlockSync() (ok bool) { if d.current.err != nil { return false } - if d.frame.WindowSize > d.o.maxDecodedSize || d.frame.WindowSize > d.o.maxWindowSize { + if d.frame.WindowSize > d.frame.o.maxDecodedSize || d.frame.WindowSize > d.frame.o.maxWindowSize { d.current.err = ErrDecoderSizeExceeded return false } @@ -509,7 +546,7 @@ func (d *Decoder) nextBlockSync() (ok bool) { if d.current.err != nil { return false } - d.frame.history.ensureBlock() + d.frame.history.ensureBlockRing() if debugDecoder { println("History trimmed:", len(d.frame.history.b), "decoded already:", d.syncStream.decodedFrame) } @@ -546,11 +583,11 @@ func (d *Decoder) nextBlockSync() (ok bool) { // Update/Check CRC if d.frame.HasCheckSum { - if !d.o.ignoreChecksum { + if !d.frame.o.ignoreChecksum { d.frame.crc.Write(d.current.b) } if d.current.d.Last { - if !d.o.ignoreChecksum { + if !d.frame.o.ignoreChecksum { d.current.err = d.frame.checkCRC() } else { d.current.err = d.frame.consumeCRC() @@ -656,8 +693,8 @@ func (d *Decoder) startStreamDecoder(ctx context.Context, r io.Reader, output ch defer d.streamWg.Done() br := readerWrapper{r: r} - var seqDecode = make(chan *blockDec, d.o.concurrent) - var seqExecute = make(chan *blockDec, d.o.concurrent) + var seqDecode = make(chan *blockDec, d.frame.o.concurrent) + var seqExecute = make(chan *blockDec, d.frame.o.concurrent) // Async 1: Decode sequences... go func() { @@ -714,7 +751,8 @@ func (d *Decoder) startStreamDecoder(ctx context.Context, r io.Reader, output ch wg.Add(1) // Async 3: Execute sequences... - frameHistCache := d.frame.history.b + // Reuse the history ring across streams. + frameRing := d.frame.history.ring go func() { var hist history var decodedFrame uint64 @@ -733,20 +771,12 @@ func (d *Decoder) startStreamDecoder(ctx context.Context, r io.Reader, output ch } hist.reset() hist.windowSize = block.async.newHist.windowSize - hist.allocFrameBuffer = block.async.newHist.allocFrameBuffer if block.async.newHist.dict != nil { hist.setDict(block.async.newHist.dict) } - - if cap(hist.b) < hist.allocFrameBuffer { - if cap(frameHistCache) >= hist.allocFrameBuffer { - hist.b = frameHistCache - } else { - hist.b = make([]byte, 0, hist.allocFrameBuffer) - println("Alloc history sized", hist.allocFrameBuffer) - } + if hist.ring == nil { + hist.ring = frameRing } - hist.b = hist.b[:0] fcs = block.async.fcs decodedFrame = 0 } @@ -769,13 +799,15 @@ func (d *Decoder) startStreamDecoder(ctx context.Context, r io.Reader, output ch for i := range block.dst { block.dst[i] = v } - hist.append(block.dst) + hist.ensureBlockRing() + hist.appendKeep(block.dst) do.b = block.dst case blockTypeRaw: if debugDecoder { println("add raw block length:", len(block.data)) } - hist.append(block.data) + hist.ensureBlockRing() + hist.appendKeep(block.data) do.b = block.data case blockTypeCompressed: if debugDecoder { @@ -808,7 +840,7 @@ func (d *Decoder) startStreamDecoder(ctx context.Context, r io.Reader, output ch output <- do } close(output) - frameHistCache = hist.b + frameRing = hist.ring wg.Done() if debugDecoder { println("decoder goroutines finished") @@ -858,9 +890,9 @@ decodeStream: if err == nil { err = d.setDict(frame) } - if err == nil && d.frame.WindowSize > d.o.maxWindowSize { + if err == nil && d.frame.WindowSize > d.frame.o.maxWindowSize { if debugDecoder { - println("decoder size exceeded, fws:", d.frame.WindowSize, "> mws:", d.o.maxWindowSize) + println("decoder size exceeded, fws:", d.frame.WindowSize, "> mws:", d.frame.o.maxWindowSize) } err = ErrDecoderSizeExceeded @@ -887,9 +919,6 @@ decodeStream: err := frame.next(dec) if !historySent { h := frame.history - if debugDecoder { - println("Alloc History:", h.allocFrameBuffer) - } hist.reset() if h.dict != nil { hist.setDict(h.dict) @@ -936,11 +965,11 @@ decodeStream: close(seqDecode) wg.Wait() hist.reset() - d.frame.history.b = frameHistCache + d.frame.history.ring = frameRing } func (d *Decoder) setDict(frame *frameDec) (err error) { - dict, ok := d.o.dicts[frame.DictionaryID] + dict, ok := frame.o.dicts[frame.DictionaryID] if ok { if debugDecoder { println("setting dict", frame.DictionaryID) diff --git a/vendor/github.com/klauspost/compress/zstd/dict.go b/vendor/github.com/klauspost/compress/zstd/dict.go index 4f1c4938cd3..7fbdedfff1e 100644 --- a/vendor/github.com/klauspost/compress/zstd/dict.go +++ b/vendor/github.com/klauspost/compress/zstd/dict.go @@ -17,6 +17,7 @@ type dict struct { litEnc *huff0.Scratch llDec, ofDec, mlDec sequenceDec + llEnc, ofEnc, mlEnc *fseEncoder offsets [3]int content []byte } @@ -99,17 +100,12 @@ func loadDict(b []byte) (*dict, error) { off: 0, } readDec := func(i tableIndex, dec *fseDecoder) error { - if err := dec.readNCount(&br, uint16(maxTableSymbol[i])); err != nil { + if err := dec.readNCount(&br, i); err != nil { return err } if br.overread() { return io.ErrUnexpectedEOF } - err = dec.transform(symbolTableX[i]) - if err != nil { - println("Transform table error:", err) - return err - } if debugDecoder || debugEncoder { println("Read table ok", "symbolLen:", dec.symbolLen) } @@ -145,6 +141,9 @@ func loadDict(b []byte) (*dict, error) { if d.offsets[0] > len(d.content) || d.offsets[1] > len(d.content) || d.offsets[2] > len(d.content) { return nil, fmt.Errorf("initial offset bigger than dictionary content size %d, offsets: %v", len(d.content), d.offsets) } + d.llEnc = newDictSeqEncoder(d.llDec.fse, tableLiteralLengths) + d.ofEnc = newDictSeqEncoder(d.ofDec.fse, tableOffsets) + d.mlEnc = newDictSeqEncoder(d.mlDec.fse, tableMatchLengths) return &d, nil } @@ -219,6 +218,9 @@ func BuildDict(o BuildDictOptions) ([]byte, error) { if len(contents) == 0 { return nil, errors.New("no content provided") } + if o.Level < speedNotSet || o.Level >= speedLast { + return nil, fmt.Errorf("unknown encoder level %d", o.Level) + } d := dict{ id: o.ID, litEnc: nil, @@ -296,40 +298,81 @@ func BuildDict(o BuildDictOptions) ([]byte, error) { if offset > 3 { newOffsets[offset-3]++ } else { - newOffsets[uint32(o.Offsets[offset-1])]++ + // Repeat codes reference the training Offsets. Skip unset + // (zero) entries so they are not ranked as real offsets. + prev := o.Offsets[offset-1] + if prev > 0 { + newOffsets[uint32(prev)]++ + } } } } // Find most used offsets. var sortedOffsets []uint32 for k := range newOffsets { + if k == 0 { + continue + } sortedOffsets = append(sortedOffsets, k) } sort.Slice(sortedOffsets, func(i, j int) bool { a, b := sortedOffsets[i], sortedOffsets[j] - if a == b { + ca, cb := newOffsets[a], newOffsets[b] + if ca == cb { // Prefer the longer offset - return sortedOffsets[i] > sortedOffsets[j] + return a > b } - return newOffsets[sortedOffsets[i]] > newOffsets[sortedOffsets[j]] + return ca > cb }) - if len(sortedOffsets) > 3 { - if debug { - print("Offsets:") - for i, v := range sortedOffsets { - if i > 20 { - break - } - printf("[%d: %d],", v, newOffsets[v]) + if debug { + print("Offsets:") + for i, v := range sortedOffsets { + if i > 20 { + break } - println("") + printf("[%d: %d],", v, newOffsets[v]) + } + println("") + } + // Dictionary recent-offsets must be three positive values within the + // history. Ranked matches may be fewer (or empty when only unset + // repeat codes were seen), so fill remaining slots with defaults. + used := make(map[int]bool, 3) + var finalOffsets [3]int + nOff := 0 + for _, v := range sortedOffsets { + iv := int(v) + if iv <= 0 || iv > len(hist) || used[iv] { + continue + } + finalOffsets[nOff] = iv + used[iv] = true + nOff++ + if nOff == 3 { + break } - - sortedOffsets = sortedOffsets[:3] } - for i, v := range sortedOffsets { - o.Offsets[i] = int(v) + for _, def := range []int{1, 4, 8} { + if nOff == 3 { + break + } + if def <= len(hist) && !used[def] { + finalOffsets[nOff] = def + used[def] = true + nOff++ + } + } + for def := 1; nOff < 3 && def <= len(hist); def++ { + if !used[def] { + finalOffsets[nOff] = def + used[def] = true + nOff++ + } } + if nOff < 3 { + return nil, fmt.Errorf("could not determine 3 valid dictionary offsets (history size %d)", len(hist)) + } + o.Offsets = finalOffsets if debug { println("New repeat offsets", o.Offsets) } @@ -337,6 +380,9 @@ func BuildDict(o BuildDictOptions) ([]byte, error) { if nUsed == 0 || seqs == 0 { return nil, fmt.Errorf("%d blocks, %d sequences found", nUsed, seqs) } + if litTotal == 0 { + return nil, errors.New("0 literals found") + } if debug { println("Sequences:", seqs, "Blocks:", nUsed, "Literals:", litTotal) } @@ -517,11 +563,10 @@ func BuildDict(o BuildDictOptions) ([]byte, error) { out.Write(binary.LittleEndian.AppendUint32(nil, uint32(o.Offsets[1]))) out.Write(binary.LittleEndian.AppendUint32(nil, uint32(o.Offsets[2]))) out.Write(hist) + if _, err := loadDict(out.Bytes()); err != nil { + return nil, fmt.Errorf("built dictionary failed validation: %w", err) + } if debug { - _, err := loadDict(out.Bytes()) - if err != nil { - panic(err) - } i, err := InspectDictionary(out.Bytes()) if err != nil { panic(err) diff --git a/vendor/github.com/klauspost/compress/zstd/enc_base.go b/vendor/github.com/klauspost/compress/zstd/enc_base.go index c4fea575d6b..40505ce65d5 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_base.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_base.go @@ -194,6 +194,7 @@ func (e *fastBase) resetBase(d *dict, singleBlock bool) { } // Transfer litenc. e.blk.dictLitEnc = d.litEnc + e.blk.coders.seedPrevFromDict(d) e.hist = append(e.hist, d.content...) } } diff --git a/vendor/github.com/klauspost/compress/zstd/enc_better.go b/vendor/github.com/klauspost/compress/zstd/enc_better.go index 523d57f3ad6..42b46a38c49 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_better.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_better.go @@ -26,6 +26,16 @@ const ( betterShortTableShardSize = betterShortTableSize / betterShortTableShardCnt // Size of an individual shard ) +// betterHashL is hashLen(u, betterLongTableBits, betterLongLen) with prime = prime8bytes. +func betterHashL(u, prime uint64) uint32 { + return uint32((u * prime) >> (64 - betterLongTableBits)) +} + +// betterHashS is hashLen(u, betterShortTableBits, betterShortLen) with prime = prime5bytes. +func betterHashS(u, prime uint64) uint32 { + return uint32(((u << (64 - 40)) * prime) >> (64 - betterShortTableBits)) +} + type prevEntry struct { offset int32 prev int32 @@ -126,6 +136,7 @@ func (e *betterFastEncoder) Encode(blk *blockEnc, src []byte) { // Override src src = e.hist sLimit := int32(len(src)) - inputMargin + primeL, primeS := hashPrimes8and5() // stepSize is the number of bytes to skip on every main loop iteration. // It should be >= 1. const stepSize = 1 @@ -163,8 +174,8 @@ encodeLoop: panic("offset0 was 0") } - nextHashL := hashLen(cv, betterLongTableBits, betterLongLen) - nextHashS := hashLen(cv, betterShortTableBits, betterShortLen) + nextHashL := betterHashL(cv, primeL) + nextHashS := betterHashS(cv, primeS) candidateL := e.longTable[nextHashL] candidateS := e.table[nextHashS] @@ -218,14 +229,13 @@ encodeLoop: break encodeLoop } // Index skipped... - for index0 < s-1 { + for end := s - 1; index0 < end; index0 += 2 { cv0 := load6432(src, index0) cv1 := cv0 >> 8 - h0 := hashLen(cv0, betterLongTableBits, betterLongLen) + h0 := betterHashL(cv0, primeL) off := index0 + e.cur + e.table[betterHashS(cv1, primeS)] = tableEntry{offset: off + 1, val: uint32(cv1)} e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} - e.table[hashLen(cv1, betterShortTableBits, betterShortLen)] = tableEntry{offset: off + 1, val: uint32(cv1)} - index0 += 2 } cv = load6432(src, s) continue @@ -275,14 +285,13 @@ encodeLoop: } // Index skipped... - for index0 < s-1 { + for end := s - 1; index0 < end; index0 += 2 { cv0 := load6432(src, index0) cv1 := cv0 >> 8 - h0 := hashLen(cv0, betterLongTableBits, betterLongLen) + h0 := betterHashL(cv0, primeL) off := index0 + e.cur + e.table[betterHashS(cv1, primeS)] = tableEntry{offset: off + 1, val: uint32(cv1)} e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} - e.table[hashLen(cv1, betterShortTableBits, betterShortLen)] = tableEntry{offset: off + 1, val: uint32(cv1)} - index0 += 2 } cv = load6432(src, s) // Swap offsets @@ -356,7 +365,7 @@ encodeLoop: // See if we can find a long match at s+1 const checkAt = 1 cv := load6432(src, s+checkAt) - nextHashL = hashLen(cv, betterLongTableBits, betterLongLen) + nextHashL = betterHashL(cv, primeL) candidateL = e.longTable[nextHashL] coffsetL = candidateL.offset - e.cur @@ -423,7 +432,7 @@ encodeLoop: // and still picked up as part of the match if they do. const skipBeginning = 3 - nextHashL := hashLen(load6432(src, s+matched), betterLongTableBits, betterLongLen) + nextHashL := betterHashL(load6432(src, s+matched), primeL) s2 := s + skipBeginning cv := load3232(src, s2) candidateL := e.longTable[nextHashL] @@ -501,13 +510,12 @@ encodeLoop: // Index match start+1 (long) -> s - 1 off := index0 + e.cur - for index0 < s-1 { + for end := s - 1; index0 < end; index0 += 2 { cv0 := load6432(src, index0) cv1 := cv0 >> 8 - h0 := hashLen(cv0, betterLongTableBits, betterLongLen) + e.table[betterHashS(cv1, primeS)] = tableEntry{offset: off + 1, val: uint32(cv1)} + h0 := betterHashL(cv0, primeL) e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} - e.table[hashLen(cv1, betterShortTableBits, betterShortLen)] = tableEntry{offset: off + 1, val: uint32(cv1)} - index0 += 2 off += 2 } @@ -525,8 +533,8 @@ encodeLoop: } // Store this, since we have it. - nextHashL := hashLen(cv, betterLongTableBits, betterLongLen) - nextHashS := hashLen(cv, betterShortTableBits, betterShortLen) + nextHashL := betterHashL(cv, primeL) + nextHashS := betterHashS(cv, primeS) // We have at least 4 byte match. // No need to check backwards. We come straight from a match @@ -644,6 +652,7 @@ func (e *betterFastEncoderDict) Encode(blk *blockEnc, src []byte) { // Override src src = e.hist sLimit := int32(len(src)) - inputMargin + primeL, primeS := hashPrimes8and5() // stepSize is the number of bytes to skip on every main loop iteration. // It should be >= 1. const stepSize = 1 @@ -681,8 +690,8 @@ encodeLoop: panic("offset0 was 0") } - nextHashL := hashLen(cv, betterLongTableBits, betterLongLen) - nextHashS := hashLen(cv, betterShortTableBits, betterShortLen) + nextHashL := betterHashL(cv, primeL) + nextHashS := betterHashS(cv, primeS) candidateL := e.longTable[nextHashL] candidateS := e.table[nextHashS] @@ -737,17 +746,16 @@ encodeLoop: break encodeLoop } // Index skipped... - for index0 < s-1 { + for end := s - 1; index0 < end; index0 += 2 { cv0 := load6432(src, index0) cv1 := cv0 >> 8 - h0 := hashLen(cv0, betterLongTableBits, betterLongLen) + h0 := betterHashL(cv0, primeL) off := index0 + e.cur - e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} - e.markLongShardDirty(h0) - h1 := hashLen(cv1, betterShortTableBits, betterShortLen) + h1 := betterHashS(cv1, primeS) e.table[h1] = tableEntry{offset: off + 1, val: uint32(cv1)} e.markShortShardDirty(h1) - index0 += 2 + e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} + e.markLongShardDirty(h0) } cv = load6432(src, s) continue @@ -797,17 +805,16 @@ encodeLoop: } // Index skipped... - for index0 < s-1 { + for end := s - 1; index0 < end; index0 += 2 { cv0 := load6432(src, index0) cv1 := cv0 >> 8 - h0 := hashLen(cv0, betterLongTableBits, betterLongLen) + h0 := betterHashL(cv0, primeL) off := index0 + e.cur - e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} - e.markLongShardDirty(h0) - h1 := hashLen(cv1, betterShortTableBits, betterShortLen) + h1 := betterHashS(cv1, primeS) e.table[h1] = tableEntry{offset: off + 1, val: uint32(cv1)} e.markShortShardDirty(h1) - index0 += 2 + e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} + e.markLongShardDirty(h0) } cv = load6432(src, s) // Swap offsets @@ -881,7 +888,7 @@ encodeLoop: // See if we can find a long match at s+1 const checkAt = 1 cv := load6432(src, s+checkAt) - nextHashL = hashLen(cv, betterLongTableBits, betterLongLen) + nextHashL = betterHashL(cv, primeL) candidateL = e.longTable[nextHashL] coffsetL = candidateL.offset - e.cur @@ -942,7 +949,7 @@ encodeLoop: } // Try to find a better match by searching for a long match at the end of the current best match if s+matched < sLimit { - nextHashL := hashLen(load6432(src, s+matched), betterLongTableBits, betterLongLen) + nextHashL := betterHashL(load6432(src, s+matched), primeL) cv := load3232(src, s) candidateL := e.longTable[nextHashL] coffsetL := candidateL.offset - e.cur - matched @@ -1017,16 +1024,15 @@ encodeLoop: // Index match start+1 (long) -> s - 1 off := index0 + e.cur - for index0 < s-1 { + for end := s - 1; index0 < end; index0 += 2 { cv0 := load6432(src, index0) cv1 := cv0 >> 8 - h0 := hashLen(cv0, betterLongTableBits, betterLongLen) - e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} - e.markLongShardDirty(h0) - h1 := hashLen(cv1, betterShortTableBits, betterShortLen) + h1 := betterHashS(cv1, primeS) e.table[h1] = tableEntry{offset: off + 1, val: uint32(cv1)} e.markShortShardDirty(h1) - index0 += 2 + h0 := betterHashL(cv0, primeL) + e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} + e.markLongShardDirty(h0) off += 2 } @@ -1044,8 +1050,8 @@ encodeLoop: } // Store this, since we have it. - nextHashL := hashLen(cv, betterLongTableBits, betterLongLen) - nextHashS := hashLen(cv, betterShortTableBits, betterShortLen) + nextHashL := betterHashL(cv, primeL) + nextHashS := betterHashS(cv, primeS) // We have at least 4 byte match. // No need to check backwards. We come straight from a match diff --git a/vendor/github.com/klauspost/compress/zstd/enc_dfast.go b/vendor/github.com/klauspost/compress/zstd/enc_dfast.go index 712ba7ab582..aae59862aab 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_dfast.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_dfast.go @@ -22,6 +22,16 @@ const ( ) +// dFastHashL is hashLen(u, dFastLongTableBits, dFastLongLen) with prime = prime8bytes. +func dFastHashL(u, prime uint64) uint32 { + return uint32((u * prime) >> (64 - dFastLongTableBits)) +} + +// dFastHashS is hashLen(u, dFastShortTableBits, dFastShortLen) with prime = prime5bytes. +func dFastHashS(u, prime uint64) uint32 { + return uint32(((u << (64 - 40)) * prime) >> (64 - dFastShortTableBits)) +} + type doubleFastEncoder struct { fastEncoder longTable [dFastLongTableSize]tableEntry @@ -87,6 +97,7 @@ func (e *doubleFastEncoder) Encode(blk *blockEnc, src []byte) { // Override src src = e.hist sLimit := int32(len(src)) - inputMargin + primeL, primeS := hashPrimes8and5() // stepSize is the number of bytes to skip on every main loop iteration. // It should be >= 1. const stepSize = 1 @@ -123,8 +134,8 @@ encodeLoop: panic("offset0 was 0") } - nextHashL := hashLen(cv, dFastLongTableBits, dFastLongLen) - nextHashS := hashLen(cv, dFastShortTableBits, dFastShortLen) + nextHashL := dFastHashL(cv, primeL) + nextHashS := dFastHashS(cv, primeS) candidateL := e.longTable[nextHashL] candidateS := e.table[nextHashS] @@ -204,7 +215,7 @@ encodeLoop: // See if we can find a long match at s+1 const checkAt = 1 cv := load6432(src, s+checkAt) - nextHashL = hashLen(cv, dFastLongTableBits, dFastLongLen) + nextHashL = dFastHashL(cv, primeL) candidateL = e.longTable[nextHashL] coffsetL = s - (candidateL.offset - e.cur) + checkAt @@ -297,16 +308,16 @@ encodeLoop: cv1 := load6432(src, index1) te0 := tableEntry{offset: index0 + e.cur, val: uint32(cv0)} te1 := tableEntry{offset: index1 + e.cur, val: uint32(cv1)} - e.longTable[hashLen(cv0, dFastLongTableBits, dFastLongLen)] = te0 - e.longTable[hashLen(cv1, dFastLongTableBits, dFastLongLen)] = te1 + e.longTable[dFastHashL(cv0, primeL)] = te0 + e.longTable[dFastHashL(cv1, primeL)] = te1 cv0 >>= 8 cv1 >>= 8 te0.offset++ te1.offset++ te0.val = uint32(cv0) te1.val = uint32(cv1) - e.table[hashLen(cv0, dFastShortTableBits, dFastShortLen)] = te0 - e.table[hashLen(cv1, dFastShortTableBits, dFastShortLen)] = te1 + e.table[dFastHashS(cv0, primeS)] = te0 + e.table[dFastHashS(cv1, primeS)] = te1 cv = load6432(src, s) @@ -323,8 +334,8 @@ encodeLoop: } // Store this, since we have it. - nextHashS := hashLen(cv, dFastShortTableBits, dFastShortLen) - nextHashL := hashLen(cv, dFastLongTableBits, dFastLongLen) + nextHashS := dFastHashS(cv, primeS) + nextHashL := dFastHashL(cv, primeL) // We have at least 4 byte match. // No need to check backwards. We come straight from a match @@ -399,6 +410,7 @@ func (e *doubleFastEncoder) EncodeNoHist(blk *blockEnc, src []byte) { // Override src sLimit := int32(len(src)) - inputMargin + primeL, primeS := hashPrimes8and5() // stepSize is the number of bytes to skip on every main loop iteration. // It should be >= 1. const stepSize = 1 @@ -429,8 +441,8 @@ encodeLoop: var t int32 for { - nextHashL := hashLen(cv, dFastLongTableBits, dFastLongLen) - nextHashS := hashLen(cv, dFastShortTableBits, dFastShortLen) + nextHashL := dFastHashL(cv, primeL) + nextHashS := dFastHashS(cv, primeS) candidateL := e.longTable[nextHashL] candidateS := e.table[nextHashS] @@ -511,7 +523,7 @@ encodeLoop: // See if we can find a long match at s+1 const checkAt = 1 cv := load6432(src, s+checkAt) - nextHashL = hashLen(cv, dFastLongTableBits, dFastLongLen) + nextHashL = dFastHashL(cv, primeL) candidateL = e.longTable[nextHashL] coffsetL = s - (candidateL.offset - e.cur) + checkAt @@ -601,16 +613,16 @@ encodeLoop: cv1 := load6432(src, index1) te0 := tableEntry{offset: index0 + e.cur, val: uint32(cv0)} te1 := tableEntry{offset: index1 + e.cur, val: uint32(cv1)} - e.longTable[hashLen(cv0, dFastLongTableBits, dFastLongLen)] = te0 - e.longTable[hashLen(cv1, dFastLongTableBits, dFastLongLen)] = te1 + e.longTable[dFastHashL(cv0, primeL)] = te0 + e.longTable[dFastHashL(cv1, primeL)] = te1 cv0 >>= 8 cv1 >>= 8 te0.offset++ te1.offset++ te0.val = uint32(cv0) te1.val = uint32(cv1) - e.table[hashLen(cv0, dFastShortTableBits, dFastShortLen)] = te0 - e.table[hashLen(cv1, dFastShortTableBits, dFastShortLen)] = te1 + e.table[dFastHashS(cv0, primeS)] = te0 + e.table[dFastHashS(cv1, primeS)] = te1 cv = load6432(src, s) @@ -627,8 +639,8 @@ encodeLoop: } // Store this, since we have it. - nextHashS := hashLen(cv1>>8, dFastShortTableBits, dFastShortLen) - nextHashL := hashLen(cv, dFastLongTableBits, dFastLongLen) + nextHashS := dFastHashS(cv1>>8, primeS) + nextHashL := dFastHashL(cv, primeL) // We have at least 4 byte match. // No need to check backwards. We come straight from a match @@ -733,6 +745,7 @@ func (e *doubleFastEncoderDict) Encode(blk *blockEnc, src []byte) { // Override src src = e.hist sLimit := int32(len(src)) - inputMargin + primeL, primeS := hashPrimes8and5() // stepSize is the number of bytes to skip on every main loop iteration. // It should be >= 1. const stepSize = 1 @@ -769,8 +782,8 @@ encodeLoop: panic("offset0 was 0") } - nextHashL := hashLen(cv, dFastLongTableBits, dFastLongLen) - nextHashS := hashLen(cv, dFastShortTableBits, dFastShortLen) + nextHashL := dFastHashL(cv, primeL) + nextHashS := dFastHashS(cv, primeS) candidateL := e.longTable[nextHashL] candidateS := e.table[nextHashS] @@ -852,7 +865,7 @@ encodeLoop: // See if we can find a long match at s+1 const checkAt = 1 cv := load6432(src, s+checkAt) - nextHashL = hashLen(cv, dFastLongTableBits, dFastLongLen) + nextHashL = dFastHashL(cv, primeL) candidateL = e.longTable[nextHashL] coffsetL = s - (candidateL.offset - e.cur) + checkAt @@ -946,8 +959,8 @@ encodeLoop: cv1 := load6432(src, index1) te0 := tableEntry{offset: index0 + e.cur, val: uint32(cv0)} te1 := tableEntry{offset: index1 + e.cur, val: uint32(cv1)} - longHash1 := hashLen(cv0, dFastLongTableBits, dFastLongLen) - longHash2 := hashLen(cv1, dFastLongTableBits, dFastLongLen) + longHash1 := dFastHashL(cv0, primeL) + longHash2 := dFastHashL(cv1, primeL) e.longTable[longHash1] = te0 e.longTable[longHash2] = te1 e.markLongShardDirty(longHash1) @@ -958,8 +971,8 @@ encodeLoop: te1.offset++ te0.val = uint32(cv0) te1.val = uint32(cv1) - hashVal1 := hashLen(cv0, dFastShortTableBits, dFastShortLen) - hashVal2 := hashLen(cv1, dFastShortTableBits, dFastShortLen) + hashVal1 := dFastHashS(cv0, primeS) + hashVal2 := dFastHashS(cv1, primeS) e.table[hashVal1] = te0 e.markShardDirty(hashVal1) e.table[hashVal2] = te1 @@ -980,8 +993,8 @@ encodeLoop: } // Store this, since we have it. - nextHashL := hashLen(cv, dFastLongTableBits, dFastLongLen) - nextHashS := hashLen(cv, dFastShortTableBits, dFastShortLen) + nextHashL := dFastHashL(cv, primeL) + nextHashS := dFastHashS(cv, primeS) // We have at least 4 byte match. // No need to check backwards. We come straight from a match diff --git a/vendor/github.com/klauspost/compress/zstd/framedec.go b/vendor/github.com/klauspost/compress/zstd/framedec.go index d88f067e5c2..fb836c412e3 100644 --- a/vendor/github.com/klauspost/compress/zstd/framedec.go +++ b/vendor/github.com/klauspost/compress/zstd/framedec.go @@ -49,13 +49,16 @@ const ( ) func newFrameDec(o decoderOptions) *frameDec { + d := frameDec{} + d.setOptions(o) + return &d +} + +func (d *frameDec) setOptions(o decoderOptions) { if o.maxWindowSize > o.maxDecodedSize { o.maxWindowSize = o.maxDecodedSize } - d := frameDec{ - o: o, - } - return &d + d.o = o } // reset will read the frame header and prepare for block decoding. @@ -255,18 +258,6 @@ func (d *frameDec) reset(br byteBuffer) error { return ErrWindowSizeTooSmall } d.history.windowSize = int(d.WindowSize) - if !d.o.lowMem || d.history.windowSize < maxBlockSize { - // Alloc 2x window size if not low-mem, or window size below 2MB. - d.history.allocFrameBuffer = d.history.windowSize * 2 - } else { - if d.o.lowMem { - // Alloc with 1MB extra. - d.history.allocFrameBuffer = d.history.windowSize + maxBlockSize/2 - } else { - // Alloc with 2MB extra. - d.history.allocFrameBuffer = d.history.windowSize + maxBlockSize - } - } if debugDecoder { println("Frame: Dict:", d.DictionaryID, "FrameContentSize:", d.FrameContentSize, "singleseg:", d.SingleSegment, "window:", d.WindowSize, "crc:", d.HasCheckSum) @@ -352,14 +343,12 @@ func (d *frameDec) runDecoder(dst []byte, dec *blockDec) ([]byte, error) { if debugDecoder { println("maxSyncLen:", d.history.decoders.maxSyncLen) } - if !d.o.limitToCap && uint64(cap(dst)) < d.history.decoders.maxSyncLen { - // Alloc for output - dst2 := make([]byte, len(dst), d.history.decoders.maxSyncLen+compressedBlockOverAlloc) - copy(dst2, dst) - dst = dst2 - } } var err error + // Hash each block while it is still in cache rather than the whole + // frame at the end. + hashCRC := d.HasCheckSum && !d.o.ignoreChecksum + crcDone := crcStart for { err = dec.reset(d.rawInput, d.WindowSize) if err != nil { @@ -372,6 +361,10 @@ func (d *frameDec) runDecoder(dst []byte, dec *blockDec) ([]byte, error) { if err != nil { break } + if hashCRC { + d.crc.Write(d.history.b[crcDone:]) + crcDone = len(d.history.b) + } if uint64(len(d.history.b)-crcStart) > d.o.maxDecodedSize { println("runDecoder: maxDecodedSize exceeded", uint64(len(d.history.b)-crcStart), ">", d.o.maxDecodedSize) err = ErrDecoderSizeExceeded @@ -402,7 +395,6 @@ func (d *frameDec) runDecoder(dst []byte, dec *blockDec) ([]byte, error) { if d.o.ignoreChecksum { err = d.consumeCRC() } else { - d.crc.Write(dst[crcStart:]) err = d.checkCRC() } } diff --git a/vendor/github.com/klauspost/compress/zstd/fse_decoder.go b/vendor/github.com/klauspost/compress/zstd/fse_decoder.go index 2f8860a722b..12ac2b54974 100644 --- a/vendor/github.com/klauspost/compress/zstd/fse_decoder.go +++ b/vendor/github.com/klauspost/compress/zstd/fse_decoder.go @@ -43,13 +43,36 @@ type fseDecoder struct { preDefined bool } +// codeShare returns, in 1/256ths, the table's probability mass on symbols +// minCode and above: for a table read from the block, the share of its +// sequences with those codes. The predefined tables describe the format's +// defaults, not the block, and RLE tables have no distribution; both +// report -1. +func (s *fseDecoder) codeShare(minCode int) int { + if s == nil || s.preDefined || s.actualTableLog == 0 { + return -1 + } + n := 0 + for c := minCode; c < int(s.symbolLen); c++ { + switch v := int(s.norm[c]); { + case v > 0: + n += v + case v < 0: + n++ // -1 marks a probability below one slot; it occupies one + } + } + return n * 256 >> s.actualTableLog +} + // tableStep returns the next table index. func tableStep(tableSize uint32) uint32 { return (tableSize >> 1) + (tableSize >> 3) + 3 } -// readNCount will read the symbol distribution so decoding tables can be constructed. -func (s *fseDecoder) readNCount(b *byteReader, maxSymbol uint16) error { +// readNCount will read the symbol distribution for table t and build its +// decoding table. +func (s *fseDecoder) readNCount(b *byteReader, t tableIndex) error { + maxSymbol := uint16(maxTableSymbol[t]) var ( charnum uint16 previous0 bool @@ -167,7 +190,8 @@ func (s *fseDecoder) readNCount(b *byteReader, maxSymbol uint16) error { if s.symbolLen <= 1 { return fmt.Errorf("symbolLen (%d) too small", s.symbolLen) } - if s.symbolLen > maxSymbolValue+1 { + // A run of zero counts can step past maxSymbol, so check the total. + if s.symbolLen > maxSymbol+1 { return fmt.Errorf("symbolLen (%d) too big", s.symbolLen) } if remaining != 1 { @@ -180,7 +204,30 @@ func (s *fseDecoder) readNCount(b *byteReader, maxSymbol uint16) error { return fmt.Errorf("corruption detected (total %d != %d)", gotTotal, 1<> 3) - return s.buildDtable() + return s.buildDtable(&symbolExtX[t]) +} + +// symbolExt holds, per symbol, a decSymbol with only addBits and baseline set. +type symbolExt [maxMatchLengthSymbol + 1]decSymbol + +// buildDtable builds the decoding table, taking each state's addBits and +// baseline from its symbol's entry in ext. +func (s *fseDecoder) buildDtable(ext *symbolExt) error { + if int(s.symbolLen) > len(ext) { + return fmt.Errorf("symbolLen (%d) too big", s.symbolLen) + } + if err := s.fillDtable(ext); err != nil { + return err + } + // addBits never decreases with the symbol (checked in initPredefined), + // so the last symbol has the most. It may exceed the table's actual + // maximum only if the last symbol has no states, which just costs an + // extra bitreader fill. + s.maxBits = 0 + if s.symbolLen > 0 { + s.maxBits = ext[s.symbolLen-1].addBits() + } + return nil } func (s *fseDecoder) mustReadFrom(r io.Reader) { @@ -268,27 +315,6 @@ func (s *fseDecoder) setRLE(symbol decSymbol) { s.dt[0] = symbol } -// transform will transform the decoder table into a table usable for -// decoding without having to apply the transformation while decoding. -// The state will contain the base value and the number of bits to read. -func (s *fseDecoder) transform(t []baseOffset) error { - tableSize := uint16(1 << s.actualTableLog) - s.maxBits = 0 - for i, v := range s.dt[:tableSize] { - add := v.addBits() - if int(add) >= len(t) { - return fmt.Errorf("invalid decoding table entry %d, symbol %d >= max (%d)", i, v.addBits(), len(t)) - } - lu := t[add] - if lu.addBits > s.maxBits { - s.maxBits = lu.addBits - } - v.setExt(lu.addBits, lu.baseLine) - s.dt[i] = v - } - return nil -} - type fseState struct { dt []decSymbol state decSymbol diff --git a/vendor/github.com/klauspost/compress/zstd/fse_decoder_amd64.s b/vendor/github.com/klauspost/compress/zstd/fse_decoder_amd64.s index deeadc49eb0..87f05503ce4 100644 --- a/vendor/github.com/klauspost/compress/zstd/fse_decoder_amd64.s +++ b/vendor/github.com/klauspost/compress/zstd/fse_decoder_amd64.s @@ -1,126 +1,132 @@ // Code generated by command: go run gen_fse.go -out ../fse_decoder.s -arch amd64,arm64 -pkg=zstd. DO NOT EDIT. -//go:build !appengine && !noasm && gc && !noasm +//go:build !noasm && gc // func buildDtable_asm(s *fseDecoder, ctx *buildDtableAsmContext) int TEXT ·buildDtable_asm(SB), $0-24 MOVQ ctx+8(FP), CX - MOVQ s+0(FP), DI + MOVQ s+0(FP), R8 // Load values - MOVBQZX 4098(DI), DX + MOVBQZX 4098(R8), DX XORQ AX, AX BTSQ DX, AX MOVQ (CX), BX MOVQ 16(CX), SI - LEAQ -1(AX), R8 + MOVQ 24(CX), DI + LEAQ -1(AX), R9 MOVQ 8(CX), CX - MOVWQZX 4096(DI), DI + MOVWQZX 4096(R8), R8 // End load values // Init, lay down lowprob symbols - XORQ R9, R9 + XORQ R10, R10 JMP init_main_loop_condition init_main_loop: - MOVWQSX (CX)(R9*2), R10 - CMPW R10, $-1 + MOVWQSX (CX)(R10*2), R11 + CMPW R11, $-1 JNE do_not_update_high_threshold - MOVB R9, 1(SI)(R8*8) - DECQ R8 - MOVQ $0x0000000000000001, R10 + MOVB R10, 1(SI)(R9*8) + DECQ R9 + MOVQ $0x0000000000000001, R11 do_not_update_high_threshold: - MOVW R10, (BX)(R9*2) - INCQ R9 + MOVW R11, (BX)(R10*2) + INCQ R10 init_main_loop_condition: - CMPQ R9, DI + CMPQ R10, R8 JL init_main_loop // Spread symbols // Calculate table step - MOVQ AX, R9 - SHRQ $0x01, R9 MOVQ AX, R10 - SHRQ $0x03, R10 - LEAQ 3(R9)(R10*1), R9 + SHRQ $0x01, R10 + MOVQ AX, R11 + SHRQ $0x03, R11 + LEAQ 3(R10)(R11*1), R10 // Fill add bits values - LEAQ -1(AX), R10 - XORQ R11, R11 + LEAQ -1(AX), R11 XORQ R12, R12 + XORQ R13, R13 JMP spread_main_loop_condition spread_main_loop: - XORQ R13, R13 - MOVWQSX (CX)(R12*2), R14 + XORQ R14, R14 + MOVWQSX (CX)(R13*2), R15 JMP spread_inner_loop_condition spread_inner_loop: - MOVB R12, 1(SI)(R11*8) + MOVB R13, 1(SI)(R12*8) adjust_position: - ADDQ R9, R11 - ANDQ R10, R11 - CMPQ R11, R8 + ADDQ R10, R12 + ANDQ R11, R12 + CMPQ R12, R9 JG adjust_position - INCQ R13 + INCQ R14 spread_inner_loop_condition: - CMPQ R13, R14 + CMPQ R14, R15 JL spread_inner_loop - INCQ R12 + INCQ R13 spread_main_loop_condition: - CMPQ R12, DI + CMPQ R13, R8 JL spread_main_loop - TESTQ R11, R11 + TESTQ R12, R12 JZ spread_check_ok MOVQ ctx+8(FP), AX - MOVQ R11, 24(AX) + MOVQ R12, 32(AX) MOVQ $+1, ret+16(FP) RET spread_check_ok: // Build Decoding table - XORQ DI, DI + XORQ R8, R8 build_table_main_table: - MOVBQZX 1(SI)(DI*8), CX - MOVWQZX (BX)(CX*2), R8 - LEAQ 1(R8), R9 - MOVW R9, (BX)(CX*2) - MOVQ R8, R9 - BSRQ R9, R9 + MOVBQZX 1(SI)(R8*8), R9 + MOVWQZX (BX)(R9*2), R10 + LEAQ 1(R10), CX + MOVW CX, (BX)(R9*2) + MOVQ R10, R11 + BSRQ R11, R11 MOVQ DX, CX - SUBQ R9, CX - SHLQ CL, R8 - SUBQ AX, R8 - MOVB CL, (SI)(DI*8) - MOVW R8, 2(SI)(DI*8) - CMPQ R8, AX + SUBQ R11, CX + SHLQ CL, R10 + SUBQ AX, R10 + MOVQ (DI)(R9*8), R9 + ORQ CX, R9 + MOVQ R10, R11 + ANDQ $0x0000ffff, R11 + SHLQ $0x10, R11 + ORQ R11, R9 + MOVQ R9, (SI)(R8*8) + CMPQ R10, AX JLE build_table_check1_ok MOVQ ctx+8(FP), CX - MOVQ R8, 24(CX) - MOVQ AX, 32(CX) + MOVQ R10, 32(CX) + MOVQ AX, 40(CX) MOVQ $+2, ret+16(FP) RET build_table_check1_ok: TESTB CL, CL JNZ build_table_check2_ok - CMPW R8, DI + CMPW R10, R8 JNE build_table_check2_ok MOVQ ctx+8(FP), AX - MOVQ R8, 24(AX) - MOVQ DI, 32(AX) + MOVQ R10, 32(AX) + MOVQ R8, 40(AX) MOVQ $+3, ret+16(FP) RET build_table_check2_ok: - INCQ DI - CMPQ DI, AX + INCQ R8 + CMPQ R8, AX JL build_table_main_table MOVQ $+0, ret+16(FP) RET diff --git a/vendor/github.com/klauspost/compress/zstd/fse_decoder_arm64.s b/vendor/github.com/klauspost/compress/zstd/fse_decoder_arm64.s index 77ee3913f05..f83b76b3203 100644 --- a/vendor/github.com/klauspost/compress/zstd/fse_decoder_arm64.s +++ b/vendor/github.com/klauspost/compress/zstd/fse_decoder_arm64.s @@ -1,152 +1,147 @@ // Code generated by command: go run gen_fse.go -out ../fse_decoder.s -arch amd64,arm64 -pkg=zstd. DO NOT EDIT. // EXPERIMENTAL arm64 output lowered from an amd64 avo program. -//go:build arm64 && !appengine && !noasm && gc && !noasm +//go:build arm64 && (!noasm && gc) // func buildDtable_asm(s *fseDecoder, ctx *buildDtableAsmContext) int TEXT ·buildDtable_asm(SB), $0-24 MOVD ctx+8(FP), R1 - MOVD s+0(FP), R6 + MOVD s+0(FP), R7 // Load values - MOVBU 4098(R6), R2 + MOVBU 4098(R7), R2 MOVD $0, R0 MOVD $1, R16 LSL R2, R16, R16 ORR R16, R0, R0 MOVD (R1), R3 MOVD 16(R1), R5 - SUB $1, R0, R7 + MOVD 24(R1), R6 + SUB $1, R0, R8 MOVD 8(R1), R1 - MOVHU 4096(R6), R6 + MOVHU 4096(R7), R7 // End load values // Init, lay down lowprob symbols - MOVD $0, R8 + MOVD $0, R9 JMP init_main_loop_condition init_main_loop: - ADD R8<<1, R1, R15 - MOVH (R15), R9 - AND $0xffff, R9, R15 + MOVH (R1)(R9<<1), R10 MOVD $-1, R16 AND $0xffff, R16, R16 + AND $0xffff, R10, R15 CMP R16, R15 BNE do_not_update_high_threshold - ADD R7<<3, R5, R15 - MOVB R8, 1(R15) - SUB $1, R7, R7 - MOVD $0x0000000000000001, R9 + ADD R8<<3, R5, R15 + MOVB R9, 1(R15) + SUB $1, R8, R8 + MOVD $0x0000000000000001, R10 do_not_update_high_threshold: - ADD R8<<1, R3, R15 - MOVH R9, (R15) - ADD $1, R8, R8 + MOVH R10, (R3)(R9<<1) + ADD $1, R9, R9 init_main_loop_condition: - CMP R6, R8 + CMP R7, R9 BLT init_main_loop // Spread symbols // Calculate table step - MOVD R0, R8 - LSR $0x01, R8, R8 - MOVD R0, R9 - LSR $0x03, R9, R9 - ADD R9, R8, R8 - ADD $3, R8, R8 + LSR $0x01, R0, R9 + LSR $0x03, R0, R10 + ADD R10, R9, R9 + ADD $3, R9, R9 // Fill add bits values - SUB $1, R0, R9 - MOVD $0, R10 + SUB $1, R0, R10 MOVD $0, R11 + MOVD $0, R12 JMP spread_main_loop_condition spread_main_loop: - MOVD $0, R12 - ADD R11<<1, R1, R15 - MOVH (R15), R13 + MOVD $0, R13 + MOVH (R1)(R12<<1), R14 JMP spread_inner_loop_condition spread_inner_loop: - ADD R10<<3, R5, R15 - MOVB R11, 1(R15) + ADD R11<<3, R5, R15 + MOVB R12, 1(R15) adjust_position: - ADD R8, R10, R10 - AND R9, R10, R10 - CMP R7, R10 + ADD R9, R11, R11 + AND R10, R11, R11 + CMP R8, R11 BGT adjust_position - ADD $1, R12, R12 + ADD $1, R13, R13 spread_inner_loop_condition: - CMP R13, R12 + CMP R14, R13 BLT spread_inner_loop - ADD $1, R11, R11 + ADD $1, R12, R12 spread_main_loop_condition: - CMP R6, R11 + CMP R7, R12 BLT spread_main_loop - TST R10, R10 + TST R11, R11 BEQ spread_check_ok MOVD ctx+8(FP), R0 - MOVD R10, 24(R0) + MOVD R11, 32(R0) MOVD $+1, R16 MOVD R16, ret+16(FP) RET spread_check_ok: // Build Decoding table - MOVD $0, R6 + MOVD $0, R7 build_table_main_table: - ADD R6<<3, R5, R15 - MOVBU 1(R15), R1 - ADD R1<<1, R3, R15 - MOVHU (R15), R7 - ADD $1, R7, R8 - ADD R1<<1, R3, R15 - MOVH R8, (R15) - MOVD R7, R8 - CLZ R8, R16 - MOVD $63, R8 - SUB R16, R8, R8 + ADD R7<<3, R5, R15 + MOVBU 1(R15), R8 + MOVHU (R3)(R8<<1), R9 + ADD $1, R9, R1 + MOVH R1, (R3)(R8<<1) + MOVD R9, R10 + CLZ R10, R16 + MOVD $63, R10 + SUB R16, R10, R10 MOVD R2, R1 - SUB R8, R1, R1 - LSL R1, R7, R7 - SUB R0, R7, R7 - ADD R6<<3, R5, R15 - MOVB R1, (R15) - ADD R6<<3, R5, R15 - MOVH R7, 2(R15) - CMP R0, R7 + SUB R10, R1, R1 + LSL R1, R9, R9 + SUB R0, R9, R9 + MOVD (R6)(R8<<3), R8 + ORR R1, R8, R8 + MOVD R9, R10 + AND $0x0000ffff, R10, R10 + LSL $0x10, R10, R10 + ORR R10, R8, R8 + MOVD R8, (R5)(R7<<3) + CMP R0, R9 BLE build_table_check1_ok MOVD ctx+8(FP), R1 - MOVD R7, 24(R1) - MOVD R0, 32(R1) + MOVD R9, 32(R1) + MOVD R0, 40(R1) MOVD $+2, R16 MOVD R16, ret+16(FP) RET build_table_check1_ok: - AND $0xff, R1, R15 - AND $0xff, R1, R16 - TST R16, R15 + TST $0xff, R1 BNE build_table_check2_ok - AND $0xffff, R7, R15 - AND $0xffff, R6, R16 + AND $0xffff, R7, R16 + AND $0xffff, R9, R15 CMP R16, R15 BNE build_table_check2_ok MOVD ctx+8(FP), R0 - MOVD R7, 24(R0) - MOVD R6, 32(R0) + MOVD R9, 32(R0) + MOVD R7, 40(R0) MOVD $+3, R16 MOVD R16, ret+16(FP) RET build_table_check2_ok: - ADD $1, R6, R6 - CMP R0, R6 + ADD $1, R7, R7 + CMP R0, R7 BLT build_table_main_table MOVD $+0, R16 MOVD R16, ret+16(FP) diff --git a/vendor/github.com/klauspost/compress/zstd/fse_decoder_asm.go b/vendor/github.com/klauspost/compress/zstd/fse_decoder_asm.go index 4ffc7e3c9fd..7394eefb424 100644 --- a/vendor/github.com/klauspost/compress/zstd/fse_decoder_asm.go +++ b/vendor/github.com/klauspost/compress/zstd/fse_decoder_asm.go @@ -1,4 +1,4 @@ -//go:build (amd64 || arm64) && !appengine && !noasm && gc +//go:build (amd64 || arm64) && !noasm && gc package zstd @@ -15,6 +15,7 @@ type buildDtableAsmContext struct { stateTable *uint16 norm *int16 dt *uint64 + ext *uint64 // outputs --- set by the procedure in the case of error; // for interpretation please see the error handling part below @@ -35,12 +36,13 @@ const ( errorNewStateNoBits = 3 ) -// buildDtable will build the decoding table. -func (s *fseDecoder) buildDtable() error { +// fillDtable fills the decoding table; see buildDtable. +func (s *fseDecoder) fillDtable(ext *symbolExt) error { ctx := buildDtableAsmContext{ stateTable: &s.stateTable[0], norm: &s.norm[0], dt: (*uint64)(&s.dt[0]), + ext: (*uint64)(&ext[0]), } code := buildDtable_asm(s, &ctx) diff --git a/vendor/github.com/klauspost/compress/zstd/fse_decoder_generic.go b/vendor/github.com/klauspost/compress/zstd/fse_decoder_generic.go index 38fd2ccb2a9..f40353bb39e 100644 --- a/vendor/github.com/klauspost/compress/zstd/fse_decoder_generic.go +++ b/vendor/github.com/klauspost/compress/zstd/fse_decoder_generic.go @@ -1,4 +1,4 @@ -//go:build (!amd64 && !arm64) || appengine || !gc || noasm +//go:build (!amd64 && !arm64) || !gc || noasm package zstd @@ -7,8 +7,8 @@ import ( "fmt" ) -// buildDtable will build the decoding table. -func (s *fseDecoder) buildDtable() error { +// fillDtable fills the decoding table; see buildDtable. +func (s *fseDecoder) fillDtable(ext *symbolExt) error { tableSize := uint32(1 << s.actualTableLog) highThreshold := tableSize - 1 symbolNext := s.stateTable[:256] @@ -56,7 +56,6 @@ func (s *fseDecoder) buildDtable() error { nextState := symbolNext[symbol] symbolNext[symbol] = nextState + 1 nBits := s.actualTableLog - byte(highBits(uint32(nextState))) - s.dt[u&maxTableMask].setNBits(nBits) newState := (nextState << nBits) - tableSize if newState > tableSize { return fmt.Errorf("newState (%d) outside table size (%d)", newState, tableSize) @@ -65,7 +64,7 @@ func (s *fseDecoder) buildDtable() error { // Seems weird that this is possible with nbits > 0. return fmt.Errorf("newState (%d) == oldState (%d) and no bits", newState, u) } - s.dt[u&maxTableMask].setNewState(newState) + s.dt[u&maxTableMask] = ext[symbol] | decSymbol(nBits) | decSymbol(newState)<<16 } } return nil diff --git a/vendor/github.com/klauspost/compress/zstd/fse_predefined.go b/vendor/github.com/klauspost/compress/zstd/fse_predefined.go index 474cb77d2b9..7880b6fdfe0 100644 --- a/vendor/github.com/klauspost/compress/zstd/fse_predefined.go +++ b/vendor/github.com/klauspost/compress/zstd/fse_predefined.go @@ -25,6 +25,10 @@ var ( // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#the-codes-for-literals-lengths-match-lengths-and-offsets symbolTableX [3][]baseOffset + // symbolExtX holds symbolTableX as decSymbols carrying only addBits and + // baseline, which buildDtable merges into each state. + symbolExtX [3]symbolExt + // maxTableSymbol is the biggest supported symbol for each table type // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#the-codes-for-literals-lengths-match-lengths-and-offsets maxTableSymbol = [3]uint8{tableLiteralLengths: maxLiteralLengthSymbol, tableOffsets: maxOffsetLengthSymbol, tableMatchLengths: maxMatchLengthSymbol} @@ -105,6 +109,15 @@ func initPredefined() { } fillBase(tmp[2:], 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30) symbolTableX[tableOffsets] = tmp + for i, t := range symbolTableX { + for j, lu := range t { + // fseDecoder.buildDtable takes maxBits from the last symbol. + if j > 0 && lu.addBits < t[j-1].addBits { + panic(fmt.Sprintf("table %v: addBits decreases at symbol %d", tableIndex(i), j)) + } + symbolExtX[i][j] = newDecSymbol(0, lu.addBits, 0, lu.baseLine) + } + } // Fill predefined tables and transform them. // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#default-distributions @@ -135,10 +148,7 @@ func initPredefined() { -1, -1, -1, -1, -1}) f.symbolLen = 53 } - if err := f.buildDtable(); err != nil { - panic(fmt.Errorf("building table %v: %v", tableIndex(i), err)) - } - if err := f.transform(symbolTableX[i]); err != nil { + if err := f.buildDtable(&symbolExtX[i]); err != nil { panic(fmt.Errorf("building table %v: %v", tableIndex(i), err)) } f.preDefined = true diff --git a/vendor/github.com/klauspost/compress/zstd/hash.go b/vendor/github.com/klauspost/compress/zstd/hash.go index 5d73c21ebdd..2b606a3b351 100644 --- a/vendor/github.com/klauspost/compress/zstd/hash.go +++ b/vendor/github.com/klauspost/compress/zstd/hash.go @@ -4,6 +4,8 @@ package zstd +import "runtime" + const ( prime3bytes = 506832829 prime4bytes = 2654435761 @@ -13,6 +15,12 @@ const ( prime8bytes = 0xcf1bbcdcb7a56463 ) +// hashPrimesInRegs reports whether encoders should keep the 64-bit hash primes +// in registers rather than as constants. The compiler rebuilds a constant at +// every use: one instruction on amd64, but up to 4 on arm64, which also has +// the registers to spare. See hashPrimes8and5. +const hashPrimesInRegs = runtime.GOARCH == "arm64" + // hashLen returns a hash of the lowest mls bytes of with length output bits. // mls must be >=3 and <=8. Any other value will return hash for 4 bytes. // length should always be < 32. @@ -33,3 +41,17 @@ func hashLen(u uint64, length, mls uint8) uint32 { return (uint32(u) * prime4bytes) >> (32 - length) } } + +// hashPrimes85 is a var so arm64 keeps the primes in registers instead of +// rebuilding each 64-bit prime with up to 4 instructions per use. +var hashPrimes85 = [2]uint64{prime8bytes, prime5bytes} + +// hashPrimes8and5 returns prime8bytes and prime5bytes for encoders that hash +// 8 and 5 bytes. Where registers are too scarce to hold them, it returns the +// constants. +func hashPrimes8and5() (prime8, prime5 uint64) { + if hashPrimesInRegs { + return hashPrimes85[0], hashPrimes85[1] + } + return prime8bytes, prime5bytes +} diff --git a/vendor/github.com/klauspost/compress/zstd/history.go b/vendor/github.com/klauspost/compress/zstd/history.go index 09164856d22..76e4c30f8d9 100644 --- a/vendor/github.com/klauspost/compress/zstd/history.go +++ b/vendor/github.com/klauspost/compress/zstd/history.go @@ -24,16 +24,26 @@ type history struct { // when checking for matches in history ignoreBuffer int - windowSize int - allocFrameBuffer int // needed? - error bool - dict *dict + windowSize int + error bool + dict *dict + + // ring backs b when streaming (see ensureBlockRing). + // ext holds the part of the previous lap of ring still in the window, + // which precedes b[0] in the stream; nil when b holds all history. + // The previous lap is ring[extStart:extEnd]. + ring []byte + ext []byte + extStart int + extEnd int } // reset will reset the history to initial state of a frame. // The history must already have been initialized to the desired size. func (h *history) reset() { h.b = h.b[:0] + h.ext = nil + h.extStart, h.extEnd = 0, 0 h.ignoreBuffer = 0 h.error = false h.recentOffsets = [3]int{1, 4, 8} @@ -67,47 +77,40 @@ func (h *history) setDict(dict *dict) { h.huffTree = dict.litEnc } -// append bytes to history. -// This function will make sure there is space for it, -// if the buffer has been allocated with enough extra space. -func (h *history) append(b []byte) { - if len(b) >= h.windowSize { - // Discard all history by simply overwriting - h.b = h.b[:h.windowSize] - copy(h.b, b[len(b)-h.windowSize:]) - return - } - - // If there is space, append it. - if len(b) < cap(h.b)-len(h.b) { - h.b = append(h.b, b...) - return - } - - // Move data down so we only have window size left. - // We know we have less than window size in b at this point. - discard := len(b) + len(h.b) - h.windowSize - copy(h.b, h.b[discard:]) - h.b = h.b[:h.windowSize] - copy(h.b[h.windowSize-len(b):], b) -} - -// ensureBlock will ensure there is space for at least one block... -func (h *history) ensureBlock() { - if cap(h.b) < h.allocFrameBuffer { - h.b = make([]byte, 0, h.allocFrameBuffer) - return +// ensureBlockRing makes room for the next block without moving history, +// as the reference decoder does. b is a prefix of ring capped to one block +// of space. When a block no longer fits, the data written so far becomes +// ext and writing restarts at the front of ring. ext is trimmed so the +// block space ahead of b never overlaps it; with ring sized to window plus +// two blocks of space, b and ext together always hold a full window. +func (h *history) ensureBlockRing() { + // Room for the largest block plus the overrun of the fast copies. + ringBlockSpace := min(h.windowSize, maxCompressedBlockSize) + compressedBlockOverAlloc + size := h.windowSize + 2*ringBlockSpace + pos := len(h.b) + if cap(h.ring) < size || (pos > 0 && &h.b[0] != &h.ring[0]) { + // No ring yet, or b no longer lives in it: start one, keeping up + // to a window of what was decoded so far as the previous lap. + keep := min(pos, h.windowSize) + if cap(h.ring) < size { + h.ring = make([]byte, size) + } + h.ring = h.ring[:size] + copy(h.ring[size-keep:], h.b[pos-keep:]) + h.extStart, h.extEnd = size-keep, size + pos = 0 + } else if pos+ringBlockSpace > size { + // Wrap: everything written this lap becomes the previous lap. + h.extStart, h.extEnd = 0, pos + pos = 0 } - - avail := cap(h.b) - len(h.b) - if avail >= h.windowSize || avail > maxCompressedBlockSize { - return + h.ring = h.ring[:size] + end := pos + ringBlockSpace + h.b = h.ring[:pos:end] + h.ext = nil + if start := max(end, h.extStart); start < h.extEnd { + h.ext = h.ring[start:h.extEnd] } - // Move data down so we only have window size left. - // We know we have less than window size in b at this point. - discard := len(h.b) - h.windowSize - copy(h.b, h.b[discard:]) - h.b = h.b[:h.windowSize] } // append bytes to history without ever discarding anything. diff --git a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash.go b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash.go index fc40c820016..9c0cbc1681d 100644 --- a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash.go +++ b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash.go @@ -52,6 +52,11 @@ func (d *Digest) Reset() { d.n = 0 } +// maxAsmSize bounds the input handed to a single writeBlocks call. Assembly is +// never preemptible, so an unbounded call holds every P in stop-the-world for +// its duration. Whole 32-byte blocks, so Write can feed it in pieces. +const maxAsmSize = 128 << 10 // 4096 whole 32-byte blocks + // Size always returns 8 bytes. func (d *Digest) Size() int { return 8 } @@ -83,6 +88,13 @@ func (d *Digest) Write(b []byte) (n int, err error) { d.n = 0 } + for len(b) >= maxAsmSize { + // Assembly is not preemptible, so hashing a large buffer in one call + // blocks every stop-the-world for the whole call. Feed it in chunks. + writeBlocks(d, b[:maxAsmSize]) + b = b[maxAsmSize:] + } + if len(b) >= 32 { // One or more full blocks left. nw := writeBlocks(d, b) diff --git a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.s b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.s index ddb63aa91b1..95d79807860 100644 --- a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.s +++ b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.s @@ -1,8 +1,4 @@ -//go:build !appengine && gc && !purego && !noasm -// +build !appengine -// +build gc -// +build !purego -// +build !noasm +//go:build gc && !purego && !noasm #include "textflag.h" @@ -175,7 +171,11 @@ finalize: RET // func writeBlocks(d *Digest, b []byte) int -TEXT ·writeBlocks(SB), NOSPLIT|NOFRAME, $0-40 +// +// Deliberately not NOSPLIT: the stack check is the preemption point that lets a +// stop-the-world proceed between chunks. The frame must be >= abi.StackSmall +// (128), or the assembler marks this leaf NOSPLIT anyway and drops that check. +TEXT ·writeBlocks(SB), $128-40 // Load fixed primes needed for round. MOVQ ·primes+0(SB), prime1 MOVQ ·primes+8(SB), prime2 diff --git a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_arm64.s b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_arm64.s index ae7d4d3295a..a09d43bd9f9 100644 --- a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_arm64.s +++ b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_arm64.s @@ -1,8 +1,4 @@ -//go:build !appengine && gc && !purego && !noasm -// +build !appengine -// +build gc -// +build !purego -// +build !noasm +//go:build gc && !purego && !noasm #include "textflag.h" @@ -163,7 +159,11 @@ finalize: RET // func writeBlocks(s *Digest, b []byte) int -TEXT ·writeBlocks(SB), NOSPLIT|NOFRAME, $0-40 +// +// Deliberately not NOSPLIT: the stack check is the preemption point that lets a +// stop-the-world proceed between chunks. The frame must be >= abi.StackSmall +// (128), or the assembler marks this leaf NOSPLIT anyway and drops that check. +TEXT ·writeBlocks(SB), $128-40 LDP ·primes+0(SB), (prime1, prime2) // Load state. Assume v[1-4] are stored contiguously. diff --git a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_asm.go b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_asm.go index d4221edf4fd..8a0170dffae 100644 --- a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_asm.go +++ b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_asm.go @@ -1,9 +1,4 @@ -//go:build (amd64 || arm64) && !appengine && gc && !purego && !noasm -// +build amd64 arm64 -// +build !appengine -// +build gc -// +build !purego -// +build !noasm +//go:build (amd64 || arm64) && gc && !purego && !noasm package xxhash diff --git a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_other.go b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_other.go index 9576426e686..83fd719123a 100644 --- a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_other.go +++ b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_other.go @@ -1,4 +1,4 @@ -//go:build (!amd64 && !arm64) || appengine || !gc || purego || noasm +//go:build (!amd64 && !arm64) || !gc || purego || noasm package xxhash diff --git a/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.go b/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.go index 1ed18927f95..1d89a6008e6 100644 --- a/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.go +++ b/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.go @@ -1,4 +1,4 @@ -//go:build amd64 && !appengine && !noasm && gc +//go:build amd64 && !noasm && gc // Copyright 2019+ Klaus Post. All rights reserved. // License information can be found in the LICENSE file. diff --git a/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.s b/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.s index 0782b86e3d1..760046f0d82 100644 --- a/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.s +++ b/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.s @@ -1,6 +1,6 @@ // Copied from S2 implementation. -//go:build !appengine && !noasm && gc && !noasm +//go:build !noasm && gc #include "textflag.h" diff --git a/vendor/github.com/klauspost/compress/zstd/matchlen_generic.go b/vendor/github.com/klauspost/compress/zstd/matchlen_generic.go index 379746c96ca..ec47656cb21 100644 --- a/vendor/github.com/klauspost/compress/zstd/matchlen_generic.go +++ b/vendor/github.com/klauspost/compress/zstd/matchlen_generic.go @@ -1,4 +1,4 @@ -//go:build !amd64 || appengine || !gc || noasm +//go:build !amd64 || !gc || noasm // Copyright 2019+ Klaus Post. All rights reserved. // License information can be found in the LICENSE file. diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec.go b/vendor/github.com/klauspost/compress/zstd/seqdec.go index 0bfb0e43c7b..4b488e0cc6e 100644 --- a/vendor/github.com/klauspost/compress/zstd/seqdec.go +++ b/vendor/github.com/klauspost/compress/zstd/seqdec.go @@ -76,6 +76,31 @@ type sequenceDecs struct { maxSyncLen uint64 } +// twoPassFarCode is the offset code from which a match counts as far: 20 is +// 1 MiB, the distance every measured arm64 core gains from. A Neoverse N1 +// (Graviton2, Ampere Altra) gains from 128 KiB too, but that needs a +// per-core threshold override; not worth the CPU-specific special case for +// a core class already being phased out of the fleet. +const twoPassFarCode = 20 + +// useTwoPass reports whether the block is decoded in two passes with the +// match-source prefetch (seqdec_arm64.go): a window of at least +// decodeTwoPassMinWindow and, unless the offset table is predefined or +// RLE, a share of at least twoPassMinFarShare of codes twoPassFarCode+. +func (s *sequenceDecs) useTwoPass() bool { + if s.windowSize < decodeTwoPassMinWindow { + return false + } + fse := s.offsets.fse + if fse != nil && !fse.preDefined && fse.actualTableLog != 0 && int(fse.symbolLen) <= twoPassFarCode { + // No symbol reaches twoPassFarCode, so codeShare can only return 0: + // skip finding it. + return false + } + share := fse.codeShare(twoPassFarCode) + return share < 0 || share >= twoPassMinFarShare +} + // initialize all 3 decoders from the stream input. func (s *sequenceDecs) initialize(br *bitReader, hist *history, out []byte) error { if err := s.litLengths.init(br); err != nil { @@ -99,6 +124,29 @@ func (s *sequenceDecs) initialize(br *bitReader, hist *history, out []byte) erro return nil } +// consumeSyncLen accounts for n bytes of frame output produced outside +// decodeSync. maxSyncLen bounds how much the frame may still produce and +// decodeSyncSimple compares it with the output buffer's slack to decide +// whether the extended 16-byte copies are safe. Blocks with sequences +// subtracted their output; raw blocks, RLE blocks and compressed blocks +// holding only literals did not, so a frame that opened with a raw block +// overstated its remaining size for every block after it and ran the +// bounds-exact copies for the rest of the frame. +// +// Zero means "no bound" and selects the conservative paths, so a block that +// meets or exceeds the bound lands there; the frame-size checks in +// runDecoder reject the excess afterwards. +func (s *sequenceDecs) consumeSyncLen(n int) { + if s.maxSyncLen == 0 { + return + } + if uint64(n) >= s.maxSyncLen { + s.maxSyncLen = 0 + return + } + s.maxSyncLen -= uint64(n) +} + func (s *sequenceDecs) freeDecoders() { if f := s.litLengths.fse; f != nil && !f.preDefined { fseDecoderPool.Put(f) @@ -217,11 +265,17 @@ func (s *sequenceDecs) execute(seqs []seqVals, hist []byte) error { return nil } +// decodeSyncGoOnly makes decodeSync skip the assembly decoder, so tests can +// compare it with the Go one in the same binary. +var decodeSyncGoOnly bool + // decode sequences from the stream with the provided history. func (s *sequenceDecs) decodeSync(hist []byte) error { - supported, err := s.decodeSyncSimple(hist) - if supported { - return err + if !decodeSyncGoOnly { + supported, err := s.decodeSyncSimple(hist) + if supported { + return err + } } br := s.br @@ -344,13 +398,13 @@ func (s *sequenceDecs) decodeSync(hist []byte) error { if mo > len(out)+len(hist) || mo > s.windowSize { if len(s.dict) == 0 { - return fmt.Errorf("match offset (%d) bigger than current history (%d)", mo, len(out)+len(hist)-startSize) + return fmt.Errorf("match offset (%d) bigger than current history (%d)", mo, len(out)-startSize) } // we may be in dictionary. dictO := len(s.dict) - (mo - (len(out) + len(hist))) if dictO < 0 || dictO >= len(s.dict) { - return fmt.Errorf("match offset (%d) bigger than current history (%d)", mo, len(out)+len(hist)-startSize) + return fmt.Errorf("match offset (%d) bigger than current history (%d)", mo, len(out)-startSize) } end := dictO + ml if end > len(s.dict) { diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.go b/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.go index 1281da885c5..968f5b6a5ea 100644 --- a/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.go +++ b/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.go @@ -1,8 +1,10 @@ -//go:build amd64 && !appengine && !noasm && gc +//go:build amd64 && !noasm && gc package zstd import ( + "math" + "github.com/klauspost/compress/internal/cpuinfo" ) @@ -10,6 +12,14 @@ import ( // in seqdec_asm.go; this file only declares the amd64 asm routines and the // dispatch helpers that pick the BMI2 / non-BMI2 (and 56-bit / safe) variant. +// See seqdec_arm64.go. Disabled here: on Sapphire Rapids, Granite Rapids +// and Zen 4 the two-pass decode costs 7-12% on real data; their caches +// already cover the offsets involved. +var ( + twoPassMinFarShare = 257 // never: the share is at most 256 + decodeTwoPassMinWindow = math.MaxInt +) + // sequenceDecs_decode implements the main loop of sequenceDecs in x86 asm. // // Please refer to seqdec_generic.go for the reference implementation. diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s b/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s index 3fc381c7a7b..6895ec59d98 100644 --- a/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s +++ b/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s @@ -1,10 +1,10 @@ // Code generated by command: go run gen.go -out ../seqdec.s -arch amd64,arm64 -pkg=zstd. DO NOT EDIT. -//go:build !appengine && !noasm && gc && !noasm +//go:build !noasm && gc // func sequenceDecs_decode_amd64(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int // Requires: CMOV -TEXT ·sequenceDecs_decode_amd64(SB), $8-32 +TEXT ·sequenceDecs_decode_amd64(SB), $40-32 MOVQ br+8(FP), CX MOVQ 24(CX), DX MOVBQZX 40(CX), BX @@ -16,11 +16,20 @@ TEXT ·sequenceDecs_decode_amd64(SB), $8-32 MOVQ 72(AX), DI MOVQ 80(AX), R8 MOVQ 88(AX), R9 + MOVQ (AX), CX + MOVQ CX, 8(SP) + MOVQ 24(AX), CX + MOVQ CX, 16(SP) + MOVQ 48(AX), CX + MOVQ CX, 24(SP) + MOVQ 96(AX), CX + MOVQ CX, 32(SP) MOVQ 104(AX), R10 MOVQ s+0(FP), AX MOVQ 144(AX), R11 MOVQ 152(AX), R12 MOVQ 160(AX), R13 + PCALIGN $0x40 sequenceDecs_decode_amd64_main_loop: MOVQ (SP), R14 @@ -55,46 +64,32 @@ sequenceDecs_decode_amd64_fill_check_overread: sequenceDecs_decode_amd64_fill_end: // Update offset - MOVQ R9, AX - MOVQ BX, CX - MOVQ DX, R15 - SHLQ CL, R15 - MOVB AH, CL - SHRQ $0x20, AX - TESTQ CX, CX - JZ sequenceDecs_decode_amd64_of_update_zero - ADDQ CX, BX - CMPQ BX, $0x40 - JA sequenceDecs_decode_amd64_of_update_zero - CMPQ CX, $0x40 - JAE sequenceDecs_decode_amd64_of_update_zero - NEGQ CX - SHRQ CL, R15 - ADDQ R15, AX - -sequenceDecs_decode_amd64_of_update_zero: - MOVQ AX, 16(R10) + MOVQ R9, AX + MOVQ BX, CX + MOVQ DX, R15 + SHLQ CL, R15 + SHRQ $0x01, R15 + MOVBLZX AH, CX + SHRQ $0x20, AX + ADDQ CX, BX + XORQ $0x3f, CX + SHRQ CL, R15 + ADDQ R15, AX + MOVQ AX, 16(R10) // Update match length - MOVQ R8, AX - MOVQ BX, CX - MOVQ DX, R15 - SHLQ CL, R15 - MOVB AH, CL - SHRQ $0x20, AX - TESTQ CX, CX - JZ sequenceDecs_decode_amd64_ml_update_zero - ADDQ CX, BX - CMPQ BX, $0x40 - JA sequenceDecs_decode_amd64_ml_update_zero - CMPQ CX, $0x40 - JAE sequenceDecs_decode_amd64_ml_update_zero - NEGQ CX - SHRQ CL, R15 - ADDQ R15, AX - -sequenceDecs_decode_amd64_ml_update_zero: - MOVQ AX, 8(R10) + MOVQ R8, AX + MOVQ BX, CX + MOVQ DX, R15 + SHLQ CL, R15 + SHRQ $0x01, R15 + MOVBLZX AH, CX + SHRQ $0x20, AX + ADDQ CX, BX + XORQ $0x3f, CX + SHRQ CL, R15 + ADDQ R15, AX + MOVQ AX, 8(R10) // Fill bitreader to have enough for the remaining CMPQ SI, $0x08 @@ -126,90 +121,76 @@ sequenceDecs_decode_amd64_fill_2_check_overread: sequenceDecs_decode_amd64_fill_2_end: // Update literal length - MOVQ DI, AX - MOVQ BX, CX - MOVQ DX, R15 - SHLQ CL, R15 - MOVB AH, CL - SHRQ $0x20, AX - TESTQ CX, CX - JZ sequenceDecs_decode_amd64_ll_update_zero - ADDQ CX, BX - CMPQ BX, $0x40 - JA sequenceDecs_decode_amd64_ll_update_zero - CMPQ CX, $0x40 - JAE sequenceDecs_decode_amd64_ll_update_zero - NEGQ CX - SHRQ CL, R15 - ADDQ R15, AX - -sequenceDecs_decode_amd64_ll_update_zero: - MOVQ AX, (R10) + MOVQ DI, AX + MOVQ BX, CX + MOVQ DX, R15 + SHLQ CL, R15 + SHRQ $0x01, R15 + MOVBLZX AH, CX + SHRQ $0x20, AX + ADDQ CX, BX + XORQ $0x3f, CX + SHRQ CL, R15 + ADDQ R15, AX + MOVQ AX, (R10) // Fill bitreader for state updates MOVQ R14, (SP) MOVQ R9, AX SHRQ $0x08, AX MOVBQZX AL, AX - MOVQ ctx+16(FP), CX - CMPQ 96(CX), $0x00 + CMPQ 32(SP), $0x00 JZ sequenceDecs_decode_amd64_skip_update // Update Literal Length State MOVBQZX DI, R14 SHRL $0x10, DI - LEAQ (BX)(R14*1), CX + MOVQ BX, CX MOVQ DX, R15 - MOVQ CX, BX - ROLQ CL, R15 - MOVL $0x00000001, BP - MOVB R14, CL - SHLL CL, BP - DECL BP - ANDQ BP, R15 + SHLQ CL, R15 + SHRQ $0x01, R15 + ADDQ R14, BX + XORQ $0x3f, R14 + MOVQ R14, CX + SHRQ CL, R15 ADDQ R15, DI // Load ctx.llTable - MOVQ ctx+16(FP), CX - MOVQ (CX), CX + MOVQ 8(SP), CX MOVQ (CX)(DI*8), DI // Update Match Length State MOVBQZX R8, R14 SHRL $0x10, R8 - LEAQ (BX)(R14*1), CX + MOVQ BX, CX MOVQ DX, R15 - MOVQ CX, BX - ROLQ CL, R15 - MOVL $0x00000001, BP - MOVB R14, CL - SHLL CL, BP - DECL BP - ANDQ BP, R15 + SHLQ CL, R15 + SHRQ $0x01, R15 + ADDQ R14, BX + XORQ $0x3f, R14 + MOVQ R14, CX + SHRQ CL, R15 ADDQ R15, R8 // Load ctx.mlTable - MOVQ ctx+16(FP), CX - MOVQ 24(CX), CX + MOVQ 16(SP), CX MOVQ (CX)(R8*8), R8 // Update Offset State MOVBQZX R9, R14 SHRL $0x10, R9 - LEAQ (BX)(R14*1), CX + MOVQ BX, CX MOVQ DX, R15 - MOVQ CX, BX - ROLQ CL, R15 - MOVL $0x00000001, BP - MOVB R14, CL - SHLL CL, BP - DECL BP - ANDQ BP, R15 + SHLQ CL, R15 + SHRQ $0x01, R15 + ADDQ R14, BX + XORQ $0x3f, R14 + MOVQ R14, CX + SHRQ CL, R15 ADDQ R15, R9 // Load ctx.ofTable - MOVQ ctx+16(FP), CX - MOVQ 48(CX), CX + MOVQ 24(SP), CX MOVQ (CX)(R9*8), R9 sequenceDecs_decode_amd64_skip_update: @@ -290,8 +271,7 @@ sequenceDecs_decode_amd64_after_adjust: sequenceDecs_decode_amd64_match_len_ofs_ok: ADDQ $0x18, R10 - MOVQ ctx+16(FP), AX - DECQ 96(AX) + DECQ 32(SP) JNS sequenceDecs_decode_amd64_main_loop MOVQ s+0(FP), AX MOVQ R11, 144(AX) @@ -303,36 +283,54 @@ sequenceDecs_decode_amd64_match_len_ofs_ok: MOVQ SI, 32(AX) // Return success + MOVQ 32(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 96(CX) MOVQ $0x00000000, ret+24(FP) RET // Return with match length error sequenceDecs_decode_amd64_error_match_len_ofs_mismatch: + MOVQ 32(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 96(CX) MOVQ $0x00000001, ret+24(FP) RET // Return with match too long error sequenceDecs_decode_amd64_error_match_len_too_big: + MOVQ 32(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 96(CX) MOVQ $0x00000002, ret+24(FP) RET // Return with match offset too long error + MOVQ 32(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 96(CX) MOVQ $0x00000003, ret+24(FP) RET // Return with not enough literals error error_not_enough_literals: + MOVQ 32(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 96(CX) MOVQ $0x00000004, ret+24(FP) RET // Return with overread error error_overread: + MOVQ 32(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 96(CX) MOVQ $0x00000006, ret+24(FP) RET // func sequenceDecs_decode_56_amd64(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int // Requires: CMOV -TEXT ·sequenceDecs_decode_56_amd64(SB), $8-32 +TEXT ·sequenceDecs_decode_56_amd64(SB), $40-32 MOVQ br+8(FP), CX MOVQ 24(CX), DX MOVBQZX 40(CX), BX @@ -344,11 +342,20 @@ TEXT ·sequenceDecs_decode_56_amd64(SB), $8-32 MOVQ 72(AX), DI MOVQ 80(AX), R8 MOVQ 88(AX), R9 + MOVQ (AX), CX + MOVQ CX, 8(SP) + MOVQ 24(AX), CX + MOVQ CX, 16(SP) + MOVQ 48(AX), CX + MOVQ CX, 24(SP) + MOVQ 96(AX), CX + MOVQ CX, 32(SP) MOVQ 104(AX), R10 MOVQ s+0(FP), AX MOVQ 144(AX), R11 MOVQ 152(AX), R12 MOVQ 160(AX), R13 + PCALIGN $0x40 sequenceDecs_decode_56_amd64_main_loop: MOVQ (SP), R14 @@ -383,132 +390,104 @@ sequenceDecs_decode_56_amd64_fill_check_overread: sequenceDecs_decode_56_amd64_fill_end: // Update offset - MOVQ R9, AX - MOVQ BX, CX - MOVQ DX, R15 - SHLQ CL, R15 - MOVB AH, CL - SHRQ $0x20, AX - TESTQ CX, CX - JZ sequenceDecs_decode_56_amd64_of_update_zero - ADDQ CX, BX - CMPQ BX, $0x40 - JA sequenceDecs_decode_56_amd64_of_update_zero - CMPQ CX, $0x40 - JAE sequenceDecs_decode_56_amd64_of_update_zero - NEGQ CX - SHRQ CL, R15 - ADDQ R15, AX - -sequenceDecs_decode_56_amd64_of_update_zero: - MOVQ AX, 16(R10) + MOVQ R9, AX + MOVQ BX, CX + MOVQ DX, R15 + SHLQ CL, R15 + SHRQ $0x01, R15 + MOVBLZX AH, CX + SHRQ $0x20, AX + ADDQ CX, BX + XORQ $0x3f, CX + SHRQ CL, R15 + ADDQ R15, AX + MOVQ AX, 16(R10) // Update match length - MOVQ R8, AX - MOVQ BX, CX - MOVQ DX, R15 - SHLQ CL, R15 - MOVB AH, CL - SHRQ $0x20, AX - TESTQ CX, CX - JZ sequenceDecs_decode_56_amd64_ml_update_zero - ADDQ CX, BX - CMPQ BX, $0x40 - JA sequenceDecs_decode_56_amd64_ml_update_zero - CMPQ CX, $0x40 - JAE sequenceDecs_decode_56_amd64_ml_update_zero - NEGQ CX - SHRQ CL, R15 - ADDQ R15, AX - -sequenceDecs_decode_56_amd64_ml_update_zero: - MOVQ AX, 8(R10) + MOVQ R8, AX + MOVQ BX, CX + MOVQ DX, R15 + SHLQ CL, R15 + SHRQ $0x01, R15 + MOVBLZX AH, CX + SHRQ $0x20, AX + ADDQ CX, BX + XORQ $0x3f, CX + SHRQ CL, R15 + ADDQ R15, AX + MOVQ AX, 8(R10) // Update literal length - MOVQ DI, AX - MOVQ BX, CX - MOVQ DX, R15 - SHLQ CL, R15 - MOVB AH, CL - SHRQ $0x20, AX - TESTQ CX, CX - JZ sequenceDecs_decode_56_amd64_ll_update_zero - ADDQ CX, BX - CMPQ BX, $0x40 - JA sequenceDecs_decode_56_amd64_ll_update_zero - CMPQ CX, $0x40 - JAE sequenceDecs_decode_56_amd64_ll_update_zero - NEGQ CX - SHRQ CL, R15 - ADDQ R15, AX - -sequenceDecs_decode_56_amd64_ll_update_zero: - MOVQ AX, (R10) + MOVQ DI, AX + MOVQ BX, CX + MOVQ DX, R15 + SHLQ CL, R15 + SHRQ $0x01, R15 + MOVBLZX AH, CX + SHRQ $0x20, AX + ADDQ CX, BX + XORQ $0x3f, CX + SHRQ CL, R15 + ADDQ R15, AX + MOVQ AX, (R10) // Fill bitreader for state updates MOVQ R14, (SP) MOVQ R9, AX SHRQ $0x08, AX MOVBQZX AL, AX - MOVQ ctx+16(FP), CX - CMPQ 96(CX), $0x00 + CMPQ 32(SP), $0x00 JZ sequenceDecs_decode_56_amd64_skip_update // Update Literal Length State MOVBQZX DI, R14 SHRL $0x10, DI - LEAQ (BX)(R14*1), CX + MOVQ BX, CX MOVQ DX, R15 - MOVQ CX, BX - ROLQ CL, R15 - MOVL $0x00000001, BP - MOVB R14, CL - SHLL CL, BP - DECL BP - ANDQ BP, R15 + SHLQ CL, R15 + SHRQ $0x01, R15 + ADDQ R14, BX + XORQ $0x3f, R14 + MOVQ R14, CX + SHRQ CL, R15 ADDQ R15, DI // Load ctx.llTable - MOVQ ctx+16(FP), CX - MOVQ (CX), CX + MOVQ 8(SP), CX MOVQ (CX)(DI*8), DI // Update Match Length State MOVBQZX R8, R14 SHRL $0x10, R8 - LEAQ (BX)(R14*1), CX + MOVQ BX, CX MOVQ DX, R15 - MOVQ CX, BX - ROLQ CL, R15 - MOVL $0x00000001, BP - MOVB R14, CL - SHLL CL, BP - DECL BP - ANDQ BP, R15 + SHLQ CL, R15 + SHRQ $0x01, R15 + ADDQ R14, BX + XORQ $0x3f, R14 + MOVQ R14, CX + SHRQ CL, R15 ADDQ R15, R8 // Load ctx.mlTable - MOVQ ctx+16(FP), CX - MOVQ 24(CX), CX + MOVQ 16(SP), CX MOVQ (CX)(R8*8), R8 // Update Offset State MOVBQZX R9, R14 SHRL $0x10, R9 - LEAQ (BX)(R14*1), CX + MOVQ BX, CX MOVQ DX, R15 - MOVQ CX, BX - ROLQ CL, R15 - MOVL $0x00000001, BP - MOVB R14, CL - SHLL CL, BP - DECL BP - ANDQ BP, R15 + SHLQ CL, R15 + SHRQ $0x01, R15 + ADDQ R14, BX + XORQ $0x3f, R14 + MOVQ R14, CX + SHRQ CL, R15 ADDQ R15, R9 // Load ctx.ofTable - MOVQ ctx+16(FP), CX - MOVQ 48(CX), CX + MOVQ 24(SP), CX MOVQ (CX)(R9*8), R9 sequenceDecs_decode_56_amd64_skip_update: @@ -589,8 +568,7 @@ sequenceDecs_decode_56_amd64_after_adjust: sequenceDecs_decode_56_amd64_match_len_ofs_ok: ADDQ $0x18, R10 - MOVQ ctx+16(FP), AX - DECQ 96(AX) + DECQ 32(SP) JNS sequenceDecs_decode_56_amd64_main_loop MOVQ s+0(FP), AX MOVQ R11, 144(AX) @@ -602,36 +580,54 @@ sequenceDecs_decode_56_amd64_match_len_ofs_ok: MOVQ SI, 32(AX) // Return success + MOVQ 32(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 96(CX) MOVQ $0x00000000, ret+24(FP) RET // Return with match length error sequenceDecs_decode_56_amd64_error_match_len_ofs_mismatch: + MOVQ 32(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 96(CX) MOVQ $0x00000001, ret+24(FP) RET // Return with match too long error sequenceDecs_decode_56_amd64_error_match_len_too_big: + MOVQ 32(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 96(CX) MOVQ $0x00000002, ret+24(FP) RET // Return with match offset too long error + MOVQ 32(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 96(CX) MOVQ $0x00000003, ret+24(FP) RET // Return with not enough literals error error_not_enough_literals: + MOVQ 32(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 96(CX) MOVQ $0x00000004, ret+24(FP) RET // Return with overread error error_overread: + MOVQ 32(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 96(CX) MOVQ $0x00000006, ret+24(FP) RET // func sequenceDecs_decode_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int // Requires: BMI, BMI2, CMOV -TEXT ·sequenceDecs_decode_bmi2(SB), $8-32 +TEXT ·sequenceDecs_decode_bmi2(SB), $40-32 MOVQ br+8(FP), BX MOVQ 24(BX), AX MOVBQZX 40(BX), DX @@ -643,11 +639,20 @@ TEXT ·sequenceDecs_decode_bmi2(SB), $8-32 MOVQ 72(CX), SI MOVQ 80(CX), DI MOVQ 88(CX), R8 + MOVQ (CX), R9 + MOVQ R9, 8(SP) + MOVQ 24(CX), R9 + MOVQ R9, 16(SP) + MOVQ 48(CX), R9 + MOVQ R9, 24(SP) + MOVQ 96(CX), R9 + MOVQ R9, 32(SP) MOVQ 104(CX), R9 MOVQ s+0(FP), CX MOVQ 144(CX), R10 MOVQ 152(CX), R11 MOVQ 160(CX), R12 + PCALIGN $0x40 sequenceDecs_decode_bmi2_main_loop: MOVQ (SP), R13 @@ -753,8 +758,7 @@ sequenceDecs_decode_bmi2_fill_2_end: MOVQ R13, (SP) MOVQ $0x00000808, CX BEXTRQ CX, R8, R13 - MOVQ ctx+16(FP), CX - CMPQ 96(CX), $0x00 + CMPQ 32(SP), $0x00 JZ sequenceDecs_decode_bmi2_skip_update LEAQ (SI)(DI*1), R14 ADDQ R8, R14 @@ -772,8 +776,7 @@ sequenceDecs_decode_bmi2_fill_2_end: ADDQ CX, R8 // Load ctx.ofTable - MOVQ ctx+16(FP), CX - MOVQ 48(CX), CX + MOVQ 24(SP), CX MOVQ (CX)(R8*8), R8 // Update Match Length State @@ -783,8 +786,7 @@ sequenceDecs_decode_bmi2_fill_2_end: ADDQ CX, DI // Load ctx.mlTable - MOVQ ctx+16(FP), CX - MOVQ 24(CX), CX + MOVQ 16(SP), CX MOVQ (CX)(DI*8), DI // Update Literal Length State @@ -793,8 +795,7 @@ sequenceDecs_decode_bmi2_fill_2_end: ADDQ CX, SI // Load ctx.llTable - MOVQ ctx+16(FP), CX - MOVQ (CX), CX + MOVQ 8(SP), CX MOVQ (CX)(SI*8), SI sequenceDecs_decode_bmi2_skip_update: @@ -875,8 +876,7 @@ sequenceDecs_decode_bmi2_after_adjust: sequenceDecs_decode_bmi2_match_len_ofs_ok: ADDQ $0x18, R9 - MOVQ ctx+16(FP), CX - DECQ 96(CX) + DECQ 32(SP) JNS sequenceDecs_decode_bmi2_main_loop MOVQ s+0(FP), CX MOVQ R10, 144(CX) @@ -888,36 +888,54 @@ sequenceDecs_decode_bmi2_match_len_ofs_ok: MOVQ BX, 32(CX) // Return success + MOVQ 32(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 96(CX) MOVQ $0x00000000, ret+24(FP) RET // Return with match length error sequenceDecs_decode_bmi2_error_match_len_ofs_mismatch: + MOVQ 32(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 96(CX) MOVQ $0x00000001, ret+24(FP) RET // Return with match too long error sequenceDecs_decode_bmi2_error_match_len_too_big: + MOVQ 32(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 96(CX) MOVQ $0x00000002, ret+24(FP) RET // Return with match offset too long error + MOVQ 32(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 96(CX) MOVQ $0x00000003, ret+24(FP) RET // Return with not enough literals error error_not_enough_literals: + MOVQ 32(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 96(CX) MOVQ $0x00000004, ret+24(FP) RET // Return with overread error error_overread: + MOVQ 32(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 96(CX) MOVQ $0x00000006, ret+24(FP) RET // func sequenceDecs_decode_56_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int // Requires: BMI, BMI2, CMOV -TEXT ·sequenceDecs_decode_56_bmi2(SB), $8-32 +TEXT ·sequenceDecs_decode_56_bmi2(SB), $40-32 MOVQ br+8(FP), BX MOVQ 24(BX), AX MOVBQZX 40(BX), DX @@ -929,11 +947,20 @@ TEXT ·sequenceDecs_decode_56_bmi2(SB), $8-32 MOVQ 72(CX), SI MOVQ 80(CX), DI MOVQ 88(CX), R8 + MOVQ (CX), R9 + MOVQ R9, 8(SP) + MOVQ 24(CX), R9 + MOVQ R9, 16(SP) + MOVQ 48(CX), R9 + MOVQ R9, 24(SP) + MOVQ 96(CX), R9 + MOVQ R9, 32(SP) MOVQ 104(CX), R9 MOVQ s+0(FP), CX MOVQ 144(CX), R10 MOVQ 152(CX), R11 MOVQ 160(CX), R12 + PCALIGN $0x40 sequenceDecs_decode_56_bmi2_main_loop: MOVQ (SP), R13 @@ -1010,8 +1037,7 @@ sequenceDecs_decode_56_bmi2_fill_end: MOVQ R13, (SP) MOVQ $0x00000808, CX BEXTRQ CX, R8, R13 - MOVQ ctx+16(FP), CX - CMPQ 96(CX), $0x00 + CMPQ 32(SP), $0x00 JZ sequenceDecs_decode_56_bmi2_skip_update LEAQ (SI)(DI*1), R14 ADDQ R8, R14 @@ -1029,8 +1055,7 @@ sequenceDecs_decode_56_bmi2_fill_end: ADDQ CX, R8 // Load ctx.ofTable - MOVQ ctx+16(FP), CX - MOVQ 48(CX), CX + MOVQ 24(SP), CX MOVQ (CX)(R8*8), R8 // Update Match Length State @@ -1040,8 +1065,7 @@ sequenceDecs_decode_56_bmi2_fill_end: ADDQ CX, DI // Load ctx.mlTable - MOVQ ctx+16(FP), CX - MOVQ 24(CX), CX + MOVQ 16(SP), CX MOVQ (CX)(DI*8), DI // Update Literal Length State @@ -1050,8 +1074,7 @@ sequenceDecs_decode_56_bmi2_fill_end: ADDQ CX, SI // Load ctx.llTable - MOVQ ctx+16(FP), CX - MOVQ (CX), CX + MOVQ 8(SP), CX MOVQ (CX)(SI*8), SI sequenceDecs_decode_56_bmi2_skip_update: @@ -1132,8 +1155,7 @@ sequenceDecs_decode_56_bmi2_after_adjust: sequenceDecs_decode_56_bmi2_match_len_ofs_ok: ADDQ $0x18, R9 - MOVQ ctx+16(FP), CX - DECQ 96(CX) + DECQ 32(SP) JNS sequenceDecs_decode_56_bmi2_main_loop MOVQ s+0(FP), CX MOVQ R10, 144(CX) @@ -1145,49 +1167,79 @@ sequenceDecs_decode_56_bmi2_match_len_ofs_ok: MOVQ BX, 32(CX) // Return success + MOVQ 32(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 96(CX) MOVQ $0x00000000, ret+24(FP) RET // Return with match length error sequenceDecs_decode_56_bmi2_error_match_len_ofs_mismatch: + MOVQ 32(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 96(CX) MOVQ $0x00000001, ret+24(FP) RET // Return with match too long error sequenceDecs_decode_56_bmi2_error_match_len_too_big: + MOVQ 32(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 96(CX) MOVQ $0x00000002, ret+24(FP) RET // Return with match offset too long error + MOVQ 32(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 96(CX) MOVQ $0x00000003, ret+24(FP) RET // Return with not enough literals error error_not_enough_literals: + MOVQ 32(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 96(CX) MOVQ $0x00000004, ret+24(FP) RET // Return with overread error error_overread: + MOVQ 32(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 96(CX) MOVQ $0x00000006, ret+24(FP) RET // func sequenceDecs_executeSimple_amd64(ctx *executeAsmContext) bool -// Requires: SSE -TEXT ·sequenceDecs_executeSimple_amd64(SB), $8-9 +// Requires: MMX+, SSE +TEXT ·sequenceDecs_executeSimple_amd64(SB), $32-9 MOVQ ctx+0(FP), R10 MOVQ 8(R10), CX TESTQ CX, CX JZ empty_seqs MOVQ (R10), AX - MOVQ 24(R10), DX - MOVQ 32(R10), BX - MOVQ 80(R10), SI - MOVQ 104(R10), DI - MOVQ 120(R10), R8 - MOVQ 56(R10), R9 - MOVQ 64(R10), R10 - ADDQ R10, R9 + + // seqsEnd = seqsBase + 24 * len(seqs) if ctx.prefetch, else seqsBase (prefetch off) + MOVQ AX, DX + MOVBQZX 128(R10), R11 + TESTQ R11, R11 + JZ prefetch_off + LEAQ (CX)(CX*2), DX + SHLQ $0x03, DX + ADDQ AX, DX + +prefetch_off: + MOVQ DX, (SP) + MOVQ 24(R10), DX + MOVQ 32(R10), BX + MOVQ 80(R10), SI + MOVQ 104(R10), DI + MOVQ 120(R10), R8 + MOVQ 56(R10), R9 + MOVQ 64(R10), R10 + ADDQ R10, R9 // seqsBase += 24 * seqIndex LEAQ (DX)(DX*2), R11 @@ -1196,16 +1248,243 @@ TEXT ·sequenceDecs_executeSimple_amd64(SB), $8-9 // outBase += outPosition ADDQ DI, BX - + MOVQ BX, 8(SP) + MOVQ BX, R11 + SUBQ DI, R11 + MOVQ R11, 16(SP) + NEGQ R11 + ADDQ R9, R11 + MOVQ R11, 24(SP) + + // Prime the prefetch window + MOVQ (SP), R11 + LEAQ (AX), R12 + CMPQ R12, R11 + JAE prefetch_skip_0 + MOVQ 8(SP), R12 + MOVQ (AX), R11 + ADDQ R11, R12 + MOVQ R12, R13 + MOVQ 16(AX), R11 + SUBQ R11, R13 + MOVQ 16(SP), R11 + CMPQ R13, R11 + JAE prefetch_in_out_0 + MOVQ 24(SP), R11 + ADDQ R11, R13 + +prefetch_in_out_0: + PREFETCHT0 (R13) + PREFETCHT0 64(R13) + MOVQ 8(AX), R11 + ADDQ R11, R12 + MOVQ R12, 8(SP) + +prefetch_skip_0: + MOVQ (SP), R11 + LEAQ 24(AX), R12 + CMPQ R12, R11 + JAE prefetch_skip_1 + MOVQ 8(SP), R12 + MOVQ 24(AX), R11 + ADDQ R11, R12 + MOVQ R12, R13 + MOVQ 40(AX), R11 + SUBQ R11, R13 + MOVQ 16(SP), R11 + CMPQ R13, R11 + JAE prefetch_in_out_1 + MOVQ 24(SP), R11 + ADDQ R11, R13 + +prefetch_in_out_1: + PREFETCHT0 (R13) + PREFETCHT0 64(R13) + MOVQ 32(AX), R11 + ADDQ R11, R12 + MOVQ R12, 8(SP) + +prefetch_skip_1: + MOVQ (SP), R11 + LEAQ 48(AX), R12 + CMPQ R12, R11 + JAE prefetch_skip_2 + MOVQ 8(SP), R12 + MOVQ 48(AX), R11 + ADDQ R11, R12 + MOVQ R12, R13 + MOVQ 64(AX), R11 + SUBQ R11, R13 + MOVQ 16(SP), R11 + CMPQ R13, R11 + JAE prefetch_in_out_2 + MOVQ 24(SP), R11 + ADDQ R11, R13 + +prefetch_in_out_2: + PREFETCHT0 (R13) + PREFETCHT0 64(R13) + MOVQ 56(AX), R11 + ADDQ R11, R12 + MOVQ R12, 8(SP) + +prefetch_skip_2: + MOVQ (SP), R11 + LEAQ 72(AX), R12 + CMPQ R12, R11 + JAE prefetch_skip_3 + MOVQ 8(SP), R12 + MOVQ 72(AX), R11 + ADDQ R11, R12 + MOVQ R12, R13 + MOVQ 88(AX), R11 + SUBQ R11, R13 + MOVQ 16(SP), R11 + CMPQ R13, R11 + JAE prefetch_in_out_3 + MOVQ 24(SP), R11 + ADDQ R11, R13 + +prefetch_in_out_3: + PREFETCHT0 (R13) + PREFETCHT0 64(R13) + MOVQ 80(AX), R11 + ADDQ R11, R12 + MOVQ R12, 8(SP) + +prefetch_skip_3: + MOVQ (SP), R11 + LEAQ 96(AX), R12 + CMPQ R12, R11 + JAE prefetch_skip_4 + MOVQ 8(SP), R12 + MOVQ 96(AX), R11 + ADDQ R11, R12 + MOVQ R12, R13 + MOVQ 112(AX), R11 + SUBQ R11, R13 + MOVQ 16(SP), R11 + CMPQ R13, R11 + JAE prefetch_in_out_4 + MOVQ 24(SP), R11 + ADDQ R11, R13 + +prefetch_in_out_4: + PREFETCHT0 (R13) + PREFETCHT0 64(R13) + MOVQ 104(AX), R11 + ADDQ R11, R12 + MOVQ R12, 8(SP) + +prefetch_skip_4: + MOVQ (SP), R11 + LEAQ 120(AX), R12 + CMPQ R12, R11 + JAE prefetch_skip_5 + MOVQ 8(SP), R12 + MOVQ 120(AX), R11 + ADDQ R11, R12 + MOVQ R12, R13 + MOVQ 136(AX), R11 + SUBQ R11, R13 + MOVQ 16(SP), R11 + CMPQ R13, R11 + JAE prefetch_in_out_5 + MOVQ 24(SP), R11 + ADDQ R11, R13 + +prefetch_in_out_5: + PREFETCHT0 (R13) + PREFETCHT0 64(R13) + MOVQ 128(AX), R11 + ADDQ R11, R12 + MOVQ R12, 8(SP) + +prefetch_skip_5: + MOVQ (SP), R11 + LEAQ 144(AX), R12 + CMPQ R12, R11 + JAE prefetch_skip_6 + MOVQ 8(SP), R12 + MOVQ 144(AX), R11 + ADDQ R11, R12 + MOVQ R12, R13 + MOVQ 160(AX), R11 + SUBQ R11, R13 + MOVQ 16(SP), R11 + CMPQ R13, R11 + JAE prefetch_in_out_6 + MOVQ 24(SP), R11 + ADDQ R11, R13 + +prefetch_in_out_6: + PREFETCHT0 (R13) + PREFETCHT0 64(R13) + MOVQ 152(AX), R11 + ADDQ R11, R12 + MOVQ R12, 8(SP) + +prefetch_skip_6: + MOVQ (SP), R11 + LEAQ 168(AX), R12 + CMPQ R12, R11 + JAE prefetch_skip_7 + MOVQ 8(SP), R12 + MOVQ 168(AX), R11 + ADDQ R11, R12 + MOVQ R12, R13 + MOVQ 184(AX), R11 + SUBQ R11, R13 + MOVQ 16(SP), R11 + CMPQ R13, R11 + JAE prefetch_in_out_7 + MOVQ 24(SP), R11 + ADDQ R11, R13 + +prefetch_in_out_7: + PREFETCHT0 (R13) + PREFETCHT0 64(R13) + MOVQ 176(AX), R11 + ADDQ R11, R12 + MOVQ R12, 8(SP) + PCALIGN $0x40 + +prefetch_skip_7: main_loop: + MOVQ (SP), R11 + LEAQ 192(AX), R12 + CMPQ R12, R11 + JAE prefetch_skip_8 + MOVQ 8(SP), R12 + MOVQ 192(AX), R11 + ADDQ R11, R12 + MOVQ R12, R13 + MOVQ 208(AX), R11 + SUBQ R11, R13 + MOVQ 16(SP), R11 + CMPQ R13, R11 + JAE prefetch_in_out_8 + MOVQ 24(SP), R11 + ADDQ R11, R13 + +prefetch_in_out_8: + PREFETCHT0 (R13) + PREFETCHT0 64(R13) + MOVQ 200(AX), R11 + ADDQ R11, R12 + MOVQ R12, 8(SP) + +prefetch_skip_8: MOVQ (AX), R11 MOVQ 16(AX), R12 MOVQ 8(AX), R13 // Copy literals - TESTQ R11, R11 - JZ check_offset - XORQ R14, R14 + MOVUPS (SI), X0 + MOVUPS X0, (BX) + CMPQ R11, $0x10 + JBE copy_1_end + MOVQ $0x00000010, R14 copy_1: MOVUPS (SI)(R14*1), X0 @@ -1213,12 +1492,13 @@ copy_1: ADDQ $0x10, R14 CMPQ R14, R11 JB copy_1 - ADDQ R11, SI - ADDQ R11, BX - ADDQ R11, DI + +copy_1_end: + ADDQ R11, SI + ADDQ R11, BX + ADDQ R11, DI // Malformed input if seq.mo > t+len(hist) || seq.mo > s.windowSize) -check_offset: LEAQ (DI)(R10*1), R11 CMPQ R12, R11 JG error_match_off_too_big @@ -1258,13 +1538,13 @@ copy_4_small: JMP copy_4_move_8through16 copy_4_move_3: - MOVW (R14), R11 - MOVB 2(R14), R12 - MOVW R11, (BX) - MOVB R12, 2(BX) - ADDQ R13, R14 - ADDQ R13, BX - JMP copy_4_end + MOVWQZX (R14), R11 + MOVB 2(R14), R12 + MOVW R11, (BX) + MOVB R12, 2(BX) + ADDQ R13, R14 + ADDQ R13, BX + JMP copy_4_end copy_4_move_4through7: MOVL (R14), R11 @@ -1327,13 +1607,13 @@ copy_5_move_1or2: JMP copy_5_end copy_5_move_3: - MOVW (R14), R15 - MOVB 2(R14), BP - MOVW R15, (BX) - MOVB BP, 2(BX) - ADDQ R11, R14 - ADDQ R11, BX - JMP copy_5_end + MOVWQZX (R14), R15 + MOVB 2(R14), BP + MOVW R15, (BX) + MOVB BP, 2(BX) + ADDQ R11, R14 + ADDQ R11, BX + JMP copy_5_end copy_5_move_4through7: MOVL (R14), R15 @@ -1366,9 +1646,19 @@ copy_match: JA copy_overlapping_match // Copy non-overlapping match - ADDQ R13, DI - MOVQ BX, R12 + ADDQ R13, DI + MOVUPS (R11), X0 + MOVUPS X0, (BX) + CMPQ R13, $0x10 + JA copy_2_long + ADDQ R13, BX + JMP handle_loop + +copy_2_long: + LEAQ 16(BX), R12 ADDQ R13, BX + ADDQ $0x10, R11 + SUBQ $0x10, R13 copy_2: MOVUPS (R11), X0 @@ -1382,14 +1672,27 @@ copy_2: // Copy overlapping match copy_overlapping_match: ADDQ R13, DI + CMPQ R12, $0x10 + JB copy_slow_3 + MOVQ BX, R12 + ADDQ R13, BX + +copy_3: + MOVUPS (R11), X0 + MOVUPS X0, (R12) + ADDQ $0x10, R11 + ADDQ $0x10, R12 + SUBQ $0x10, R13 + JHI copy_3 + JMP handle_loop copy_slow_3: - MOVB (R11), R12 - MOVB R12, (BX) - INCQ R11 - INCQ BX - DECQ R13 - JNZ copy_slow_3 + MOVBQZX (R11), R12 + MOVB R12, (BX) + INCQ R11 + INCQ BX + DECQ R13 + JNZ copy_slow_3 handle_loop: ADDQ $0x18, AX @@ -1427,21 +1730,33 @@ empty_seqs: RET // func sequenceDecs_executeSimple_safe_amd64(ctx *executeAsmContext) bool -// Requires: SSE -TEXT ·sequenceDecs_executeSimple_safe_amd64(SB), $8-9 +// Requires: MMX+, SSE +TEXT ·sequenceDecs_executeSimple_safe_amd64(SB), $32-9 MOVQ ctx+0(FP), R10 MOVQ 8(R10), CX TESTQ CX, CX JZ empty_seqs MOVQ (R10), AX - MOVQ 24(R10), DX - MOVQ 32(R10), BX - MOVQ 80(R10), SI - MOVQ 104(R10), DI - MOVQ 120(R10), R8 - MOVQ 56(R10), R9 - MOVQ 64(R10), R10 - ADDQ R10, R9 + + // seqsEnd = seqsBase + 24 * len(seqs) if ctx.prefetch, else seqsBase (prefetch off) + MOVQ AX, DX + MOVBQZX 128(R10), R11 + TESTQ R11, R11 + JZ prefetch_off + LEAQ (CX)(CX*2), DX + SHLQ $0x03, DX + ADDQ AX, DX + +prefetch_off: + MOVQ DX, (SP) + MOVQ 24(R10), DX + MOVQ 32(R10), BX + MOVQ 80(R10), SI + MOVQ 104(R10), DI + MOVQ 120(R10), R8 + MOVQ 56(R10), R9 + MOVQ 64(R10), R10 + ADDQ R10, R9 // seqsBase += 24 * seqIndex LEAQ (DX)(DX*2), R11 @@ -1450,8 +1765,233 @@ TEXT ·sequenceDecs_executeSimple_safe_amd64(SB), $8-9 // outBase += outPosition ADDQ DI, BX - + MOVQ BX, 8(SP) + MOVQ BX, R11 + SUBQ DI, R11 + MOVQ R11, 16(SP) + NEGQ R11 + ADDQ R9, R11 + MOVQ R11, 24(SP) + + // Prime the prefetch window + MOVQ (SP), R11 + LEAQ (AX), R12 + CMPQ R12, R11 + JAE prefetch_skip_0 + MOVQ 8(SP), R12 + MOVQ (AX), R11 + ADDQ R11, R12 + MOVQ R12, R13 + MOVQ 16(AX), R11 + SUBQ R11, R13 + MOVQ 16(SP), R11 + CMPQ R13, R11 + JAE prefetch_in_out_0 + MOVQ 24(SP), R11 + ADDQ R11, R13 + +prefetch_in_out_0: + PREFETCHT0 (R13) + PREFETCHT0 64(R13) + MOVQ 8(AX), R11 + ADDQ R11, R12 + MOVQ R12, 8(SP) + +prefetch_skip_0: + MOVQ (SP), R11 + LEAQ 24(AX), R12 + CMPQ R12, R11 + JAE prefetch_skip_1 + MOVQ 8(SP), R12 + MOVQ 24(AX), R11 + ADDQ R11, R12 + MOVQ R12, R13 + MOVQ 40(AX), R11 + SUBQ R11, R13 + MOVQ 16(SP), R11 + CMPQ R13, R11 + JAE prefetch_in_out_1 + MOVQ 24(SP), R11 + ADDQ R11, R13 + +prefetch_in_out_1: + PREFETCHT0 (R13) + PREFETCHT0 64(R13) + MOVQ 32(AX), R11 + ADDQ R11, R12 + MOVQ R12, 8(SP) + +prefetch_skip_1: + MOVQ (SP), R11 + LEAQ 48(AX), R12 + CMPQ R12, R11 + JAE prefetch_skip_2 + MOVQ 8(SP), R12 + MOVQ 48(AX), R11 + ADDQ R11, R12 + MOVQ R12, R13 + MOVQ 64(AX), R11 + SUBQ R11, R13 + MOVQ 16(SP), R11 + CMPQ R13, R11 + JAE prefetch_in_out_2 + MOVQ 24(SP), R11 + ADDQ R11, R13 + +prefetch_in_out_2: + PREFETCHT0 (R13) + PREFETCHT0 64(R13) + MOVQ 56(AX), R11 + ADDQ R11, R12 + MOVQ R12, 8(SP) + +prefetch_skip_2: + MOVQ (SP), R11 + LEAQ 72(AX), R12 + CMPQ R12, R11 + JAE prefetch_skip_3 + MOVQ 8(SP), R12 + MOVQ 72(AX), R11 + ADDQ R11, R12 + MOVQ R12, R13 + MOVQ 88(AX), R11 + SUBQ R11, R13 + MOVQ 16(SP), R11 + CMPQ R13, R11 + JAE prefetch_in_out_3 + MOVQ 24(SP), R11 + ADDQ R11, R13 + +prefetch_in_out_3: + PREFETCHT0 (R13) + PREFETCHT0 64(R13) + MOVQ 80(AX), R11 + ADDQ R11, R12 + MOVQ R12, 8(SP) + +prefetch_skip_3: + MOVQ (SP), R11 + LEAQ 96(AX), R12 + CMPQ R12, R11 + JAE prefetch_skip_4 + MOVQ 8(SP), R12 + MOVQ 96(AX), R11 + ADDQ R11, R12 + MOVQ R12, R13 + MOVQ 112(AX), R11 + SUBQ R11, R13 + MOVQ 16(SP), R11 + CMPQ R13, R11 + JAE prefetch_in_out_4 + MOVQ 24(SP), R11 + ADDQ R11, R13 + +prefetch_in_out_4: + PREFETCHT0 (R13) + PREFETCHT0 64(R13) + MOVQ 104(AX), R11 + ADDQ R11, R12 + MOVQ R12, 8(SP) + +prefetch_skip_4: + MOVQ (SP), R11 + LEAQ 120(AX), R12 + CMPQ R12, R11 + JAE prefetch_skip_5 + MOVQ 8(SP), R12 + MOVQ 120(AX), R11 + ADDQ R11, R12 + MOVQ R12, R13 + MOVQ 136(AX), R11 + SUBQ R11, R13 + MOVQ 16(SP), R11 + CMPQ R13, R11 + JAE prefetch_in_out_5 + MOVQ 24(SP), R11 + ADDQ R11, R13 + +prefetch_in_out_5: + PREFETCHT0 (R13) + PREFETCHT0 64(R13) + MOVQ 128(AX), R11 + ADDQ R11, R12 + MOVQ R12, 8(SP) + +prefetch_skip_5: + MOVQ (SP), R11 + LEAQ 144(AX), R12 + CMPQ R12, R11 + JAE prefetch_skip_6 + MOVQ 8(SP), R12 + MOVQ 144(AX), R11 + ADDQ R11, R12 + MOVQ R12, R13 + MOVQ 160(AX), R11 + SUBQ R11, R13 + MOVQ 16(SP), R11 + CMPQ R13, R11 + JAE prefetch_in_out_6 + MOVQ 24(SP), R11 + ADDQ R11, R13 + +prefetch_in_out_6: + PREFETCHT0 (R13) + PREFETCHT0 64(R13) + MOVQ 152(AX), R11 + ADDQ R11, R12 + MOVQ R12, 8(SP) + +prefetch_skip_6: + MOVQ (SP), R11 + LEAQ 168(AX), R12 + CMPQ R12, R11 + JAE prefetch_skip_7 + MOVQ 8(SP), R12 + MOVQ 168(AX), R11 + ADDQ R11, R12 + MOVQ R12, R13 + MOVQ 184(AX), R11 + SUBQ R11, R13 + MOVQ 16(SP), R11 + CMPQ R13, R11 + JAE prefetch_in_out_7 + MOVQ 24(SP), R11 + ADDQ R11, R13 + +prefetch_in_out_7: + PREFETCHT0 (R13) + PREFETCHT0 64(R13) + MOVQ 176(AX), R11 + ADDQ R11, R12 + MOVQ R12, 8(SP) + PCALIGN $0x40 + +prefetch_skip_7: main_loop: + MOVQ (SP), R11 + LEAQ 192(AX), R12 + CMPQ R12, R11 + JAE prefetch_skip_8 + MOVQ 8(SP), R12 + MOVQ 192(AX), R11 + ADDQ R11, R12 + MOVQ R12, R13 + MOVQ 208(AX), R11 + SUBQ R11, R13 + MOVQ 16(SP), R11 + CMPQ R13, R11 + JAE prefetch_in_out_8 + MOVQ 24(SP), R11 + ADDQ R11, R13 + +prefetch_in_out_8: + PREFETCHT0 (R13) + PREFETCHT0 64(R13) + MOVQ 200(AX), R11 + ADDQ R11, R12 + MOVQ R12, 8(SP) + +prefetch_skip_8: MOVQ (AX), R11 MOVQ 16(AX), R12 MOVQ 8(AX), R13 @@ -1494,13 +2034,13 @@ copy_1_move_1or2: JMP copy_1_end copy_1_move_3: - MOVW (SI), R14 - MOVB 2(SI), R15 - MOVW R14, (BX) - MOVB R15, 2(BX) - ADDQ R11, SI - ADDQ R11, BX - JMP copy_1_end + MOVWQZX (SI), R14 + MOVB 2(SI), R15 + MOVW R14, (BX) + MOVB R15, 2(BX) + ADDQ R11, SI + ADDQ R11, BX + JMP copy_1_end copy_1_move_4through7: MOVL (SI), R14 @@ -1563,13 +2103,13 @@ copy_4_small: JMP copy_4_move_8through16 copy_4_move_3: - MOVW (R14), R11 - MOVB 2(R14), R12 - MOVW R11, (BX) - MOVB R12, 2(BX) - ADDQ R13, R14 - ADDQ R13, BX - JMP copy_4_end + MOVWQZX (R14), R11 + MOVB 2(R14), R12 + MOVW R11, (BX) + MOVB R12, 2(BX) + ADDQ R13, R14 + ADDQ R13, BX + JMP copy_4_end copy_4_move_4through7: MOVL (R14), R11 @@ -1632,13 +2172,13 @@ copy_5_move_1or2: JMP copy_5_end copy_5_move_3: - MOVW (R14), R15 - MOVB 2(R14), BP - MOVW R15, (BX) - MOVB BP, 2(BX) - ADDQ R11, R14 - ADDQ R11, BX - JMP copy_5_end + MOVWQZX (R14), R15 + MOVB 2(R14), BP + MOVW R15, (BX) + MOVB BP, 2(BX) + ADDQ R11, R14 + ADDQ R11, BX + JMP copy_5_end copy_5_move_4through7: MOVL (R14), R15 @@ -1707,13 +2247,13 @@ copy_2_move_1or2: JMP copy_2_end copy_2_move_3: - MOVW (R11), R12 - MOVB 2(R11), R14 - MOVW R12, (BX) - MOVB R14, 2(BX) - ADDQ R13, R11 - ADDQ R13, BX - JMP copy_2_end + MOVWQZX (R11), R12 + MOVB 2(R11), R14 + MOVW R12, (BX) + MOVB R14, 2(BX) + ADDQ R13, R11 + ADDQ R13, BX + JMP copy_2_end copy_2_move_4through7: MOVL (R11), R12 @@ -1738,14 +2278,27 @@ copy_2_end: // Copy overlapping match copy_overlapping_match: ADDQ R13, DI + CMPQ R12, $0x10 + JB copy_slow_3 + +copy_3_blocks: + MOVUPS (R11), X0 + MOVUPS X0, (BX) + ADDQ $0x10, R11 + ADDQ $0x10, BX + SUBQ $0x10, R13 + CMPQ R13, $0x10 + JAE copy_3_blocks + TESTQ R13, R13 + JZ handle_loop copy_slow_3: - MOVB (R11), R12 - MOVB R12, (BX) - INCQ R11 - INCQ BX - DECQ R13 - JNZ copy_slow_3 + MOVBQZX (R11), R12 + MOVB R12, (BX) + INCQ R11 + INCQ BX + DECQ R13 + JNZ copy_slow_3 handle_loop: ADDQ $0x18, AX @@ -1784,7 +2337,7 @@ empty_seqs: // func sequenceDecs_decodeSync_amd64(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int // Requires: CMOV, SSE -TEXT ·sequenceDecs_decodeSync_amd64(SB), $64-32 +TEXT ·sequenceDecs_decodeSync_amd64(SB), $96-32 MOVQ br+8(FP), CX MOVQ 24(CX), DX MOVBQZX 40(CX), BX @@ -1796,29 +2349,38 @@ TEXT ·sequenceDecs_decodeSync_amd64(SB), $64-32 MOVQ 72(AX), DI MOVQ 80(AX), R8 MOVQ 88(AX), R9 - XORQ CX, CX + MOVQ (AX), CX MOVQ CX, 8(SP) + MOVQ 24(AX), CX MOVQ CX, 16(SP) + MOVQ 48(AX), CX MOVQ CX, 24(SP) + MOVQ 96(AX), CX + MOVQ CX, 32(SP) + XORQ CX, CX + MOVQ CX, 40(SP) + MOVQ CX, 48(SP) + MOVQ CX, 56(SP) MOVQ 112(AX), R10 MOVQ 128(AX), CX - MOVQ CX, 32(SP) + MOVQ CX, 64(SP) MOVQ 144(AX), R11 MOVQ 136(AX), R12 MOVQ 200(AX), CX - MOVQ CX, 56(SP) + MOVQ CX, 88(SP) MOVQ 176(AX), CX - MOVQ CX, 48(SP) + MOVQ CX, 80(SP) MOVQ 184(AX), AX - MOVQ AX, 40(SP) - MOVQ 40(SP), AX - ADDQ AX, 48(SP) + MOVQ AX, 72(SP) + MOVQ 72(SP), AX + ADDQ AX, 80(SP) // Calculate pointer to s.out[cap(s.out)] (a past-end pointer) - ADDQ R10, 32(SP) + ADDQ R10, 64(SP) // outBase += outPosition - ADDQ R12, R10 + ADDQ R12, R10 + PCALIGN $0x40 sequenceDecs_decodeSync_amd64_main_loop: MOVQ (SP), R13 @@ -1853,46 +2415,32 @@ sequenceDecs_decodeSync_amd64_fill_check_overread: sequenceDecs_decodeSync_amd64_fill_end: // Update offset - MOVQ R9, AX - MOVQ BX, CX - MOVQ DX, R14 - SHLQ CL, R14 - MOVB AH, CL - SHRQ $0x20, AX - TESTQ CX, CX - JZ sequenceDecs_decodeSync_amd64_of_update_zero - ADDQ CX, BX - CMPQ BX, $0x40 - JA sequenceDecs_decodeSync_amd64_of_update_zero - CMPQ CX, $0x40 - JAE sequenceDecs_decodeSync_amd64_of_update_zero - NEGQ CX - SHRQ CL, R14 - ADDQ R14, AX - -sequenceDecs_decodeSync_amd64_of_update_zero: - MOVQ AX, 8(SP) - + MOVQ R9, AX + MOVQ BX, CX + MOVQ DX, R14 + SHLQ CL, R14 + SHRQ $0x01, R14 + MOVBLZX AH, CX + SHRQ $0x20, AX + ADDQ CX, BX + XORQ $0x3f, CX + SHRQ CL, R14 + ADDQ R14, AX + MOVQ AX, 40(SP) + // Update match length - MOVQ R8, AX - MOVQ BX, CX - MOVQ DX, R14 - SHLQ CL, R14 - MOVB AH, CL - SHRQ $0x20, AX - TESTQ CX, CX - JZ sequenceDecs_decodeSync_amd64_ml_update_zero - ADDQ CX, BX - CMPQ BX, $0x40 - JA sequenceDecs_decodeSync_amd64_ml_update_zero - CMPQ CX, $0x40 - JAE sequenceDecs_decodeSync_amd64_ml_update_zero - NEGQ CX - SHRQ CL, R14 - ADDQ R14, AX - -sequenceDecs_decodeSync_amd64_ml_update_zero: - MOVQ AX, 16(SP) + MOVQ R8, AX + MOVQ BX, CX + MOVQ DX, R14 + SHLQ CL, R14 + SHRQ $0x01, R14 + MOVBLZX AH, CX + SHRQ $0x20, AX + ADDQ CX, BX + XORQ $0x3f, CX + SHRQ CL, R14 + ADDQ R14, AX + MOVQ AX, 48(SP) // Fill bitreader to have enough for the remaining CMPQ SI, $0x08 @@ -1924,96 +2472,82 @@ sequenceDecs_decodeSync_amd64_fill_2_check_overread: sequenceDecs_decodeSync_amd64_fill_2_end: // Update literal length - MOVQ DI, AX - MOVQ BX, CX - MOVQ DX, R14 - SHLQ CL, R14 - MOVB AH, CL - SHRQ $0x20, AX - TESTQ CX, CX - JZ sequenceDecs_decodeSync_amd64_ll_update_zero - ADDQ CX, BX - CMPQ BX, $0x40 - JA sequenceDecs_decodeSync_amd64_ll_update_zero - CMPQ CX, $0x40 - JAE sequenceDecs_decodeSync_amd64_ll_update_zero - NEGQ CX - SHRQ CL, R14 - ADDQ R14, AX - -sequenceDecs_decodeSync_amd64_ll_update_zero: - MOVQ AX, 24(SP) + MOVQ DI, AX + MOVQ BX, CX + MOVQ DX, R14 + SHLQ CL, R14 + SHRQ $0x01, R14 + MOVBLZX AH, CX + SHRQ $0x20, AX + ADDQ CX, BX + XORQ $0x3f, CX + SHRQ CL, R14 + ADDQ R14, AX + MOVQ AX, 56(SP) // Fill bitreader for state updates MOVQ R13, (SP) MOVQ R9, AX SHRQ $0x08, AX MOVBQZX AL, AX - MOVQ ctx+16(FP), CX - CMPQ 96(CX), $0x00 + CMPQ 32(SP), $0x00 JZ sequenceDecs_decodeSync_amd64_skip_update // Update Literal Length State MOVBQZX DI, R13 SHRL $0x10, DI - LEAQ (BX)(R13*1), CX + MOVQ BX, CX MOVQ DX, R14 - MOVQ CX, BX - ROLQ CL, R14 - MOVL $0x00000001, R15 - MOVB R13, CL - SHLL CL, R15 - DECL R15 - ANDQ R15, R14 + SHLQ CL, R14 + SHRQ $0x01, R14 + ADDQ R13, BX + XORQ $0x3f, R13 + MOVQ R13, CX + SHRQ CL, R14 ADDQ R14, DI // Load ctx.llTable - MOVQ ctx+16(FP), CX - MOVQ (CX), CX + MOVQ 8(SP), CX MOVQ (CX)(DI*8), DI // Update Match Length State MOVBQZX R8, R13 SHRL $0x10, R8 - LEAQ (BX)(R13*1), CX + MOVQ BX, CX MOVQ DX, R14 - MOVQ CX, BX - ROLQ CL, R14 - MOVL $0x00000001, R15 - MOVB R13, CL - SHLL CL, R15 - DECL R15 - ANDQ R15, R14 + SHLQ CL, R14 + SHRQ $0x01, R14 + ADDQ R13, BX + XORQ $0x3f, R13 + MOVQ R13, CX + SHRQ CL, R14 ADDQ R14, R8 // Load ctx.mlTable - MOVQ ctx+16(FP), CX - MOVQ 24(CX), CX + MOVQ 16(SP), CX MOVQ (CX)(R8*8), R8 // Update Offset State MOVBQZX R9, R13 SHRL $0x10, R9 - LEAQ (BX)(R13*1), CX + MOVQ BX, CX MOVQ DX, R14 - MOVQ CX, BX - ROLQ CL, R14 - MOVL $0x00000001, R15 - MOVB R13, CL - SHLL CL, R15 - DECL R15 - ANDQ R15, R14 + SHLQ CL, R14 + SHRQ $0x01, R14 + ADDQ R13, BX + XORQ $0x3f, R13 + MOVQ R13, CX + SHRQ CL, R14 ADDQ R14, R9 // Load ctx.ofTable - MOVQ ctx+16(FP), CX - MOVQ 48(CX), CX + MOVQ 24(SP), CX MOVQ (CX)(R9*8), R9 sequenceDecs_decodeSync_amd64_skip_update: // Adjust offset MOVQ s+0(FP), CX - MOVQ 8(SP), R13 + MOVQ 40(SP), R13 CMPQ AX, $0x01 JBE sequenceDecs_decodeSync_amd64_adjust_offsetB_1_or_0 MOVUPS 144(CX), X0 @@ -2022,7 +2556,7 @@ sequenceDecs_decodeSync_amd64_skip_update: JMP sequenceDecs_decodeSync_amd64_after_adjust sequenceDecs_decodeSync_amd64_adjust_offsetB_1_or_0: - CMPQ 24(SP), $0x00000000 + CMPQ 56(SP), $0x00000000 JNE sequenceDecs_decodeSync_amd64_adjust_offset_maybezero INCQ R13 JMP sequenceDecs_decodeSync_amd64_adjust_offset_nonzero @@ -2057,14 +2591,11 @@ sequenceDecs_decodeSync_amd64_adjust_skip: MOVQ R14, R13 sequenceDecs_decodeSync_amd64_after_adjust: - MOVQ R13, 8(SP) + MOVQ R13, 40(SP) // Check values - MOVQ 16(SP), AX - MOVQ 24(SP), CX - LEAQ (AX)(CX*1), R14 - MOVQ s+0(FP), R15 - ADDQ R14, 256(R15) + MOVQ 48(SP), AX + MOVQ 56(SP), CX MOVQ ctx+16(FP), R14 SUBQ CX, 104(R14) JS error_not_enough_literals @@ -2076,50 +2607,49 @@ sequenceDecs_decodeSync_amd64_after_adjust: JNZ sequenceDecs_decodeSync_amd64_error_match_len_ofs_mismatch sequenceDecs_decodeSync_amd64_match_len_ofs_ok: - MOVQ 24(SP), AX - MOVQ 8(SP), CX - MOVQ 16(SP), R13 - // Check if we have enough space in s.out - LEAQ (AX)(R13*1), R14 + LEAQ 16(CX)(AX*1), R14 ADDQ R10, R14 - CMPQ R14, 32(SP) + CMPQ R14, 64(SP) JA error_not_enough_space // Copy literals - TESTQ AX, AX - JZ check_offset - XORQ R14, R14 + MOVUPS (R11), X0 + MOVUPS X0, (R10) + CMPQ CX, $0x10 + JBE copy_1_end + MOVQ $0x00000010, R14 copy_1: MOVUPS (R11)(R14*1), X0 MOVUPS X0, (R10)(R14*1) ADDQ $0x10, R14 - CMPQ R14, AX + CMPQ R14, CX JB copy_1 - ADDQ AX, R11 - ADDQ AX, R10 - ADDQ AX, R12 + +copy_1_end: + ADDQ CX, R11 + ADDQ CX, R10 + ADDQ CX, R12 // Malformed input if seq.mo > t+len(hist) || seq.mo > s.windowSize) -check_offset: - MOVQ R12, AX - ADDQ 40(SP), AX - CMPQ CX, AX + MOVQ R12, CX + ADDQ 72(SP), CX + CMPQ R13, CX JG error_match_off_too_big - CMPQ CX, 56(SP) + CMPQ R13, 88(SP) JG error_match_off_too_big // Copy match from history - MOVQ CX, AX - SUBQ R12, AX + MOVQ R13, CX + SUBQ R12, CX JLS copy_match - MOVQ 48(SP), R14 - SUBQ AX, R14 - CMPQ R13, AX + MOVQ 80(SP), R14 + SUBQ CX, R14 + CMPQ AX, CX JG copy_all_from_history - MOVQ R13, AX - SUBQ $0x10, AX + MOVQ AX, CX + SUBQ $0x10, CX JB copy_4_small copy_4_loop: @@ -2127,54 +2657,54 @@ copy_4_loop: MOVUPS X0, (R10) ADDQ $0x10, R14 ADDQ $0x10, R10 - SUBQ $0x10, AX + SUBQ $0x10, CX JAE copy_4_loop - LEAQ 16(R14)(AX*1), R14 - LEAQ 16(R10)(AX*1), R10 + LEAQ 16(R14)(CX*1), R14 + LEAQ 16(R10)(CX*1), R10 MOVUPS -16(R14), X0 MOVUPS X0, -16(R10) JMP copy_4_end copy_4_small: - CMPQ R13, $0x03 + CMPQ AX, $0x03 JE copy_4_move_3 - CMPQ R13, $0x08 + CMPQ AX, $0x08 JB copy_4_move_4through7 JMP copy_4_move_8through16 copy_4_move_3: - MOVW (R14), AX - MOVB 2(R14), CL - MOVW AX, (R10) - MOVB CL, 2(R10) - ADDQ R13, R14 - ADDQ R13, R10 - JMP copy_4_end + MOVWQZX (R14), CX + MOVB 2(R14), R13 + MOVW CX, (R10) + MOVB R13, 2(R10) + ADDQ AX, R14 + ADDQ AX, R10 + JMP copy_4_end copy_4_move_4through7: - MOVL (R14), AX - MOVL -4(R14)(R13*1), CX - MOVL AX, (R10) - MOVL CX, -4(R10)(R13*1) - ADDQ R13, R14 - ADDQ R13, R10 + MOVL (R14), CX + MOVL -4(R14)(AX*1), R13 + MOVL CX, (R10) + MOVL R13, -4(R10)(AX*1) + ADDQ AX, R14 + ADDQ AX, R10 JMP copy_4_end copy_4_move_8through16: - MOVQ (R14), AX - MOVQ -8(R14)(R13*1), CX - MOVQ AX, (R10) - MOVQ CX, -8(R10)(R13*1) - ADDQ R13, R14 - ADDQ R13, R10 + MOVQ (R14), CX + MOVQ -8(R14)(AX*1), R13 + MOVQ CX, (R10) + MOVQ R13, -8(R10)(AX*1) + ADDQ AX, R14 + ADDQ AX, R10 copy_4_end: - ADDQ R13, R12 + ADDQ AX, R12 JMP handle_loop JMP loop_finished copy_all_from_history: - MOVQ AX, R15 + MOVQ CX, R15 SUBQ $0x10, R15 JB copy_5_small @@ -2192,90 +2722,112 @@ copy_5_loop: JMP copy_5_end copy_5_small: - CMPQ AX, $0x03 + CMPQ CX, $0x03 JE copy_5_move_3 JB copy_5_move_1or2 - CMPQ AX, $0x08 + CMPQ CX, $0x08 JB copy_5_move_4through7 JMP copy_5_move_8through16 copy_5_move_1or2: MOVB (R14), R15 - MOVB -1(R14)(AX*1), BP + MOVB -1(R14)(CX*1), BP MOVB R15, (R10) - MOVB BP, -1(R10)(AX*1) - ADDQ AX, R14 - ADDQ AX, R10 + MOVB BP, -1(R10)(CX*1) + ADDQ CX, R14 + ADDQ CX, R10 JMP copy_5_end copy_5_move_3: - MOVW (R14), R15 - MOVB 2(R14), BP - MOVW R15, (R10) - MOVB BP, 2(R10) - ADDQ AX, R14 - ADDQ AX, R10 - JMP copy_5_end + MOVWQZX (R14), R15 + MOVB 2(R14), BP + MOVW R15, (R10) + MOVB BP, 2(R10) + ADDQ CX, R14 + ADDQ CX, R10 + JMP copy_5_end copy_5_move_4through7: MOVL (R14), R15 - MOVL -4(R14)(AX*1), BP + MOVL -4(R14)(CX*1), BP MOVL R15, (R10) - MOVL BP, -4(R10)(AX*1) - ADDQ AX, R14 - ADDQ AX, R10 + MOVL BP, -4(R10)(CX*1) + ADDQ CX, R14 + ADDQ CX, R10 JMP copy_5_end copy_5_move_8through16: MOVQ (R14), R15 - MOVQ -8(R14)(AX*1), BP + MOVQ -8(R14)(CX*1), BP MOVQ R15, (R10) - MOVQ BP, -8(R10)(AX*1) - ADDQ AX, R14 - ADDQ AX, R10 + MOVQ BP, -8(R10)(CX*1) + ADDQ CX, R14 + ADDQ CX, R10 copy_5_end: - ADDQ AX, R12 - SUBQ AX, R13 + ADDQ CX, R12 + SUBQ CX, AX // Copy match from the current buffer copy_match: - MOVQ R10, AX - SUBQ CX, AX + MOVQ R10, CX + SUBQ R13, CX // ml <= mo - CMPQ R13, CX + CMPQ AX, R13 JA copy_overlapping_match // Copy non-overlapping match - ADDQ R13, R12 - MOVQ R10, CX - ADDQ R13, R10 + ADDQ AX, R12 + MOVUPS (CX), X0 + MOVUPS X0, (R10) + CMPQ AX, $0x10 + JA copy_2_long + ADDQ AX, R10 + JMP handle_loop + +copy_2_long: + LEAQ 16(R10), R13 + ADDQ AX, R10 + ADDQ $0x10, CX + SUBQ $0x10, AX copy_2: - MOVUPS (AX), X0 - MOVUPS X0, (CX) - ADDQ $0x10, AX + MOVUPS (CX), X0 + MOVUPS X0, (R13) ADDQ $0x10, CX - SUBQ $0x10, R13 + ADDQ $0x10, R13 + SUBQ $0x10, AX JHI copy_2 JMP handle_loop // Copy overlapping match copy_overlapping_match: - ADDQ R13, R12 + ADDQ AX, R12 + CMPQ R13, $0x10 + JB copy_slow_3 + MOVQ R10, R13 + ADDQ AX, R10 + +copy_3: + MOVUPS (CX), X0 + MOVUPS X0, (R13) + ADDQ $0x10, CX + ADDQ $0x10, R13 + SUBQ $0x10, AX + JHI copy_3 + JMP handle_loop copy_slow_3: - MOVB (AX), CL - MOVB CL, (R10) - INCQ AX - INCQ R10 - DECQ R13 - JNZ copy_slow_3 + MOVBQZX (CX), R13 + MOVB R13, (R10) + INCQ CX + INCQ R10 + DECQ AX + JNZ copy_slow_3 handle_loop: - MOVQ ctx+16(FP), AX - DECQ 96(AX) + DECQ 32(SP) JNS sequenceDecs_decodeSync_amd64_main_loop loop_finished: @@ -2284,6 +2836,13 @@ loop_finished: MOVB BL, 40(AX) MOVQ SI, 32(AX) + // s.seqSize += outPosition - ctx.outPosition + MOVQ ctx+16(FP), AX + MOVQ s+0(FP), CX + MOVQ R12, DX + SUBQ 136(AX), DX + ADDQ DX, 256(CX) + // Update the context MOVQ ctx+16(FP), AX MOVQ R12, 136(AX) @@ -2297,7 +2856,7 @@ loop_finished: // Return with match length error sequenceDecs_decodeSync_amd64_error_match_len_ofs_mismatch: - MOVQ 16(SP), AX + MOVQ 48(SP), AX MOVQ ctx+16(FP), CX MOVQ AX, 216(CX) MOVQ $0x00000001, ret+24(FP) @@ -2306,7 +2865,7 @@ sequenceDecs_decodeSync_amd64_error_match_len_ofs_mismatch: // Return with match too long error sequenceDecs_decodeSync_amd64_error_match_len_too_big: MOVQ ctx+16(FP), AX - MOVQ 16(SP), CX + MOVQ 48(SP), CX MOVQ CX, 216(AX) MOVQ $0x00000002, ret+24(FP) RET @@ -2314,7 +2873,7 @@ sequenceDecs_decodeSync_amd64_error_match_len_too_big: // Return with match offset too long error error_match_off_too_big: MOVQ ctx+16(FP), AX - MOVQ 8(SP), CX + MOVQ 40(SP), CX MOVQ CX, 224(AX) MOVQ R12, 136(AX) MOVQ $0x00000003, ret+24(FP) @@ -2323,7 +2882,7 @@ error_match_off_too_big: // Return with not enough literals error error_not_enough_literals: MOVQ ctx+16(FP), AX - MOVQ 24(SP), CX + MOVQ 56(SP), CX MOVQ CX, 208(AX) MOVQ $0x00000004, ret+24(FP) RET @@ -2336,9 +2895,9 @@ error_overread: // Return with not enough output space error error_not_enough_space: MOVQ ctx+16(FP), AX - MOVQ 24(SP), CX + MOVQ 56(SP), CX MOVQ CX, 208(AX) - MOVQ 16(SP), CX + MOVQ 48(SP), CX MOVQ CX, 216(AX) MOVQ R12, 136(AX) MOVQ $0x00000005, ret+24(FP) @@ -2346,7 +2905,7 @@ error_not_enough_space: // func sequenceDecs_decodeSync_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int // Requires: BMI, BMI2, CMOV, SSE -TEXT ·sequenceDecs_decodeSync_bmi2(SB), $64-32 +TEXT ·sequenceDecs_decodeSync_bmi2(SB), $96-32 MOVQ br+8(FP), BX MOVQ 24(BX), AX MOVBQZX 40(BX), DX @@ -2358,29 +2917,38 @@ TEXT ·sequenceDecs_decodeSync_bmi2(SB), $64-32 MOVQ 72(CX), SI MOVQ 80(CX), DI MOVQ 88(CX), R8 - XORQ R9, R9 + MOVQ (CX), R9 MOVQ R9, 8(SP) + MOVQ 24(CX), R9 MOVQ R9, 16(SP) + MOVQ 48(CX), R9 MOVQ R9, 24(SP) + MOVQ 96(CX), R9 + MOVQ R9, 32(SP) + XORQ R9, R9 + MOVQ R9, 40(SP) + MOVQ R9, 48(SP) + MOVQ R9, 56(SP) MOVQ 112(CX), R9 MOVQ 128(CX), R10 - MOVQ R10, 32(SP) + MOVQ R10, 64(SP) MOVQ 144(CX), R10 MOVQ 136(CX), R11 MOVQ 200(CX), R12 - MOVQ R12, 56(SP) + MOVQ R12, 88(SP) MOVQ 176(CX), R12 - MOVQ R12, 48(SP) + MOVQ R12, 80(SP) MOVQ 184(CX), CX - MOVQ CX, 40(SP) - MOVQ 40(SP), CX - ADDQ CX, 48(SP) + MOVQ CX, 72(SP) + MOVQ 72(SP), CX + ADDQ CX, 80(SP) // Calculate pointer to s.out[cap(s.out)] (a past-end pointer) - ADDQ R9, 32(SP) + ADDQ R9, 64(SP) // outBase += outPosition - ADDQ R11, R9 + ADDQ R11, R9 + PCALIGN $0x40 sequenceDecs_decodeSync_bmi2_main_loop: MOVQ (SP), R12 @@ -2425,7 +2993,7 @@ sequenceDecs_decodeSync_bmi2_fill_end: MOVQ R8, CX SHRQ $0x20, CX ADDQ R14, CX - MOVQ CX, 8(SP) + MOVQ CX, 40(SP) // Update match length MOVQ $0x00000808, CX @@ -2438,7 +3006,7 @@ sequenceDecs_decodeSync_bmi2_fill_end: MOVQ DI, CX SHRQ $0x20, CX ADDQ R14, CX - MOVQ CX, 16(SP) + MOVQ CX, 48(SP) // Fill bitreader to have enough for the remaining CMPQ BX, $0x08 @@ -2480,14 +3048,13 @@ sequenceDecs_decodeSync_bmi2_fill_2_end: MOVQ SI, CX SHRQ $0x20, CX ADDQ R14, CX - MOVQ CX, 24(SP) + MOVQ CX, 56(SP) // Fill bitreader for state updates MOVQ R12, (SP) MOVQ $0x00000808, CX BEXTRQ CX, R8, R12 - MOVQ ctx+16(FP), CX - CMPQ 96(CX), $0x00 + CMPQ 32(SP), $0x00 JZ sequenceDecs_decodeSync_bmi2_skip_update LEAQ (SI)(DI*1), R13 ADDQ R8, R13 @@ -2505,8 +3072,7 @@ sequenceDecs_decodeSync_bmi2_fill_2_end: ADDQ CX, R8 // Load ctx.ofTable - MOVQ ctx+16(FP), CX - MOVQ 48(CX), CX + MOVQ 24(SP), CX MOVQ (CX)(R8*8), R8 // Update Match Length State @@ -2516,8 +3082,7 @@ sequenceDecs_decodeSync_bmi2_fill_2_end: ADDQ CX, DI // Load ctx.mlTable - MOVQ ctx+16(FP), CX - MOVQ 24(CX), CX + MOVQ 16(SP), CX MOVQ (CX)(DI*8), DI // Update Literal Length State @@ -2526,14 +3091,13 @@ sequenceDecs_decodeSync_bmi2_fill_2_end: ADDQ CX, SI // Load ctx.llTable - MOVQ ctx+16(FP), CX - MOVQ (CX), CX + MOVQ 8(SP), CX MOVQ (CX)(SI*8), SI sequenceDecs_decodeSync_bmi2_skip_update: // Adjust offset MOVQ s+0(FP), CX - MOVQ 8(SP), R13 + MOVQ 40(SP), R13 CMPQ R12, $0x01 JBE sequenceDecs_decodeSync_bmi2_adjust_offsetB_1_or_0 MOVUPS 144(CX), X0 @@ -2542,7 +3106,7 @@ sequenceDecs_decodeSync_bmi2_skip_update: JMP sequenceDecs_decodeSync_bmi2_after_adjust sequenceDecs_decodeSync_bmi2_adjust_offsetB_1_or_0: - CMPQ 24(SP), $0x00000000 + CMPQ 56(SP), $0x00000000 JNE sequenceDecs_decodeSync_bmi2_adjust_offset_maybezero INCQ R13 JMP sequenceDecs_decodeSync_bmi2_adjust_offset_nonzero @@ -2577,14 +3141,11 @@ sequenceDecs_decodeSync_bmi2_adjust_skip: MOVQ R14, R13 sequenceDecs_decodeSync_bmi2_after_adjust: - MOVQ R13, 8(SP) + MOVQ R13, 40(SP) // Check values - MOVQ 16(SP), CX - MOVQ 24(SP), R12 - LEAQ (CX)(R12*1), R14 - MOVQ s+0(FP), R15 - ADDQ R14, 256(R15) + MOVQ 48(SP), CX + MOVQ 56(SP), R12 MOVQ ctx+16(FP), R14 SUBQ R12, 104(R14) JS error_not_enough_literals @@ -2596,50 +3157,49 @@ sequenceDecs_decodeSync_bmi2_after_adjust: JNZ sequenceDecs_decodeSync_bmi2_error_match_len_ofs_mismatch sequenceDecs_decodeSync_bmi2_match_len_ofs_ok: - MOVQ 24(SP), CX - MOVQ 8(SP), R12 - MOVQ 16(SP), R13 - // Check if we have enough space in s.out - LEAQ (CX)(R13*1), R14 + LEAQ 16(R12)(CX*1), R14 ADDQ R9, R14 - CMPQ R14, 32(SP) + CMPQ R14, 64(SP) JA error_not_enough_space // Copy literals - TESTQ CX, CX - JZ check_offset - XORQ R14, R14 + MOVUPS (R10), X0 + MOVUPS X0, (R9) + CMPQ R12, $0x10 + JBE copy_1_end + MOVQ $0x00000010, R14 copy_1: MOVUPS (R10)(R14*1), X0 MOVUPS X0, (R9)(R14*1) ADDQ $0x10, R14 - CMPQ R14, CX + CMPQ R14, R12 JB copy_1 - ADDQ CX, R10 - ADDQ CX, R9 - ADDQ CX, R11 + +copy_1_end: + ADDQ R12, R10 + ADDQ R12, R9 + ADDQ R12, R11 // Malformed input if seq.mo > t+len(hist) || seq.mo > s.windowSize) -check_offset: - MOVQ R11, CX - ADDQ 40(SP), CX - CMPQ R12, CX + MOVQ R11, R12 + ADDQ 72(SP), R12 + CMPQ R13, R12 JG error_match_off_too_big - CMPQ R12, 56(SP) + CMPQ R13, 88(SP) JG error_match_off_too_big // Copy match from history - MOVQ R12, CX - SUBQ R11, CX + MOVQ R13, R12 + SUBQ R11, R12 JLS copy_match - MOVQ 48(SP), R14 - SUBQ CX, R14 - CMPQ R13, CX + MOVQ 80(SP), R14 + SUBQ R12, R14 + CMPQ CX, R12 JG copy_all_from_history - MOVQ R13, CX - SUBQ $0x10, CX + MOVQ CX, R12 + SUBQ $0x10, R12 JB copy_4_small copy_4_loop: @@ -2647,54 +3207,54 @@ copy_4_loop: MOVUPS X0, (R9) ADDQ $0x10, R14 ADDQ $0x10, R9 - SUBQ $0x10, CX + SUBQ $0x10, R12 JAE copy_4_loop - LEAQ 16(R14)(CX*1), R14 - LEAQ 16(R9)(CX*1), R9 + LEAQ 16(R14)(R12*1), R14 + LEAQ 16(R9)(R12*1), R9 MOVUPS -16(R14), X0 MOVUPS X0, -16(R9) JMP copy_4_end copy_4_small: - CMPQ R13, $0x03 + CMPQ CX, $0x03 JE copy_4_move_3 - CMPQ R13, $0x08 + CMPQ CX, $0x08 JB copy_4_move_4through7 JMP copy_4_move_8through16 copy_4_move_3: - MOVW (R14), CX - MOVB 2(R14), R12 - MOVW CX, (R9) - MOVB R12, 2(R9) - ADDQ R13, R14 - ADDQ R13, R9 - JMP copy_4_end + MOVWQZX (R14), R12 + MOVB 2(R14), R13 + MOVW R12, (R9) + MOVB R13, 2(R9) + ADDQ CX, R14 + ADDQ CX, R9 + JMP copy_4_end copy_4_move_4through7: - MOVL (R14), CX - MOVL -4(R14)(R13*1), R12 - MOVL CX, (R9) - MOVL R12, -4(R9)(R13*1) - ADDQ R13, R14 - ADDQ R13, R9 + MOVL (R14), R12 + MOVL -4(R14)(CX*1), R13 + MOVL R12, (R9) + MOVL R13, -4(R9)(CX*1) + ADDQ CX, R14 + ADDQ CX, R9 JMP copy_4_end copy_4_move_8through16: - MOVQ (R14), CX - MOVQ -8(R14)(R13*1), R12 - MOVQ CX, (R9) - MOVQ R12, -8(R9)(R13*1) - ADDQ R13, R14 - ADDQ R13, R9 + MOVQ (R14), R12 + MOVQ -8(R14)(CX*1), R13 + MOVQ R12, (R9) + MOVQ R13, -8(R9)(CX*1) + ADDQ CX, R14 + ADDQ CX, R9 copy_4_end: - ADDQ R13, R11 + ADDQ CX, R11 JMP handle_loop JMP loop_finished copy_all_from_history: - MOVQ CX, R15 + MOVQ R12, R15 SUBQ $0x10, R15 JB copy_5_small @@ -2712,90 +3272,112 @@ copy_5_loop: JMP copy_5_end copy_5_small: - CMPQ CX, $0x03 + CMPQ R12, $0x03 JE copy_5_move_3 JB copy_5_move_1or2 - CMPQ CX, $0x08 + CMPQ R12, $0x08 JB copy_5_move_4through7 JMP copy_5_move_8through16 copy_5_move_1or2: MOVB (R14), R15 - MOVB -1(R14)(CX*1), BP + MOVB -1(R14)(R12*1), BP MOVB R15, (R9) - MOVB BP, -1(R9)(CX*1) - ADDQ CX, R14 - ADDQ CX, R9 + MOVB BP, -1(R9)(R12*1) + ADDQ R12, R14 + ADDQ R12, R9 JMP copy_5_end copy_5_move_3: - MOVW (R14), R15 - MOVB 2(R14), BP - MOVW R15, (R9) - MOVB BP, 2(R9) - ADDQ CX, R14 - ADDQ CX, R9 - JMP copy_5_end + MOVWQZX (R14), R15 + MOVB 2(R14), BP + MOVW R15, (R9) + MOVB BP, 2(R9) + ADDQ R12, R14 + ADDQ R12, R9 + JMP copy_5_end copy_5_move_4through7: MOVL (R14), R15 - MOVL -4(R14)(CX*1), BP + MOVL -4(R14)(R12*1), BP MOVL R15, (R9) - MOVL BP, -4(R9)(CX*1) - ADDQ CX, R14 - ADDQ CX, R9 + MOVL BP, -4(R9)(R12*1) + ADDQ R12, R14 + ADDQ R12, R9 JMP copy_5_end copy_5_move_8through16: MOVQ (R14), R15 - MOVQ -8(R14)(CX*1), BP + MOVQ -8(R14)(R12*1), BP MOVQ R15, (R9) - MOVQ BP, -8(R9)(CX*1) - ADDQ CX, R14 - ADDQ CX, R9 + MOVQ BP, -8(R9)(R12*1) + ADDQ R12, R14 + ADDQ R12, R9 copy_5_end: - ADDQ CX, R11 - SUBQ CX, R13 + ADDQ R12, R11 + SUBQ R12, CX // Copy match from the current buffer copy_match: - MOVQ R9, CX - SUBQ R12, CX + MOVQ R9, R12 + SUBQ R13, R12 // ml <= mo - CMPQ R13, R12 + CMPQ CX, R13 JA copy_overlapping_match // Copy non-overlapping match - ADDQ R13, R11 - MOVQ R9, R12 - ADDQ R13, R9 + ADDQ CX, R11 + MOVUPS (R12), X0 + MOVUPS X0, (R9) + CMPQ CX, $0x10 + JA copy_2_long + ADDQ CX, R9 + JMP handle_loop + +copy_2_long: + LEAQ 16(R9), R13 + ADDQ CX, R9 + ADDQ $0x10, R12 + SUBQ $0x10, CX copy_2: - MOVUPS (CX), X0 - MOVUPS X0, (R12) - ADDQ $0x10, CX + MOVUPS (R12), X0 + MOVUPS X0, (R13) ADDQ $0x10, R12 - SUBQ $0x10, R13 + ADDQ $0x10, R13 + SUBQ $0x10, CX JHI copy_2 JMP handle_loop // Copy overlapping match copy_overlapping_match: - ADDQ R13, R11 + ADDQ CX, R11 + CMPQ R13, $0x10 + JB copy_slow_3 + MOVQ R9, R13 + ADDQ CX, R9 + +copy_3: + MOVUPS (R12), X0 + MOVUPS X0, (R13) + ADDQ $0x10, R12 + ADDQ $0x10, R13 + SUBQ $0x10, CX + JHI copy_3 + JMP handle_loop copy_slow_3: - MOVB (CX), R12 - MOVB R12, (R9) - INCQ CX - INCQ R9 - DECQ R13 - JNZ copy_slow_3 + MOVBQZX (R12), R13 + MOVB R13, (R9) + INCQ R12 + INCQ R9 + DECQ CX + JNZ copy_slow_3 handle_loop: - MOVQ ctx+16(FP), CX - DECQ 96(CX) + DECQ 32(SP) JNS sequenceDecs_decodeSync_bmi2_main_loop loop_finished: @@ -2804,6 +3386,13 @@ loop_finished: MOVB DL, 40(CX) MOVQ BX, 32(CX) + // s.seqSize += outPosition - ctx.outPosition + MOVQ ctx+16(FP), AX + MOVQ s+0(FP), CX + MOVQ R11, DX + SUBQ 136(AX), DX + ADDQ DX, 256(CX) + // Update the context MOVQ ctx+16(FP), AX MOVQ R11, 136(AX) @@ -2817,7 +3406,7 @@ loop_finished: // Return with match length error sequenceDecs_decodeSync_bmi2_error_match_len_ofs_mismatch: - MOVQ 16(SP), AX + MOVQ 48(SP), AX MOVQ ctx+16(FP), CX MOVQ AX, 216(CX) MOVQ $0x00000001, ret+24(FP) @@ -2826,7 +3415,7 @@ sequenceDecs_decodeSync_bmi2_error_match_len_ofs_mismatch: // Return with match too long error sequenceDecs_decodeSync_bmi2_error_match_len_too_big: MOVQ ctx+16(FP), AX - MOVQ 16(SP), CX + MOVQ 48(SP), CX MOVQ CX, 216(AX) MOVQ $0x00000002, ret+24(FP) RET @@ -2834,7 +3423,7 @@ sequenceDecs_decodeSync_bmi2_error_match_len_too_big: // Return with match offset too long error error_match_off_too_big: MOVQ ctx+16(FP), AX - MOVQ 8(SP), CX + MOVQ 40(SP), CX MOVQ CX, 224(AX) MOVQ R11, 136(AX) MOVQ $0x00000003, ret+24(FP) @@ -2843,7 +3432,7 @@ error_match_off_too_big: // Return with not enough literals error error_not_enough_literals: MOVQ ctx+16(FP), AX - MOVQ 24(SP), CX + MOVQ 56(SP), CX MOVQ CX, 208(AX) MOVQ $0x00000004, ret+24(FP) RET @@ -2856,9 +3445,9 @@ error_overread: // Return with not enough output space error error_not_enough_space: MOVQ ctx+16(FP), AX - MOVQ 24(SP), CX + MOVQ 56(SP), CX MOVQ CX, 208(AX) - MOVQ 16(SP), CX + MOVQ 48(SP), CX MOVQ CX, 216(AX) MOVQ R11, 136(AX) MOVQ $0x00000005, ret+24(FP) @@ -2866,7 +3455,7 @@ error_not_enough_space: // func sequenceDecs_decodeSync_safe_amd64(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int // Requires: CMOV, SSE -TEXT ·sequenceDecs_decodeSync_safe_amd64(SB), $64-32 +TEXT ·sequenceDecs_decodeSync_safe_amd64(SB), $96-32 MOVQ br+8(FP), CX MOVQ 24(CX), DX MOVBQZX 40(CX), BX @@ -2878,29 +3467,38 @@ TEXT ·sequenceDecs_decodeSync_safe_amd64(SB), $64-32 MOVQ 72(AX), DI MOVQ 80(AX), R8 MOVQ 88(AX), R9 - XORQ CX, CX + MOVQ (AX), CX MOVQ CX, 8(SP) + MOVQ 24(AX), CX MOVQ CX, 16(SP) + MOVQ 48(AX), CX MOVQ CX, 24(SP) + MOVQ 96(AX), CX + MOVQ CX, 32(SP) + XORQ CX, CX + MOVQ CX, 40(SP) + MOVQ CX, 48(SP) + MOVQ CX, 56(SP) MOVQ 112(AX), R10 MOVQ 128(AX), CX - MOVQ CX, 32(SP) + MOVQ CX, 64(SP) MOVQ 144(AX), R11 MOVQ 136(AX), R12 MOVQ 200(AX), CX - MOVQ CX, 56(SP) + MOVQ CX, 88(SP) MOVQ 176(AX), CX - MOVQ CX, 48(SP) + MOVQ CX, 80(SP) MOVQ 184(AX), AX - MOVQ AX, 40(SP) - MOVQ 40(SP), AX - ADDQ AX, 48(SP) + MOVQ AX, 72(SP) + MOVQ 72(SP), AX + ADDQ AX, 80(SP) // Calculate pointer to s.out[cap(s.out)] (a past-end pointer) - ADDQ R10, 32(SP) + ADDQ R10, 64(SP) // outBase += outPosition - ADDQ R12, R10 + ADDQ R12, R10 + PCALIGN $0x40 sequenceDecs_decodeSync_safe_amd64_main_loop: MOVQ (SP), R13 @@ -2935,46 +3533,32 @@ sequenceDecs_decodeSync_safe_amd64_fill_check_overread: sequenceDecs_decodeSync_safe_amd64_fill_end: // Update offset - MOVQ R9, AX - MOVQ BX, CX - MOVQ DX, R14 - SHLQ CL, R14 - MOVB AH, CL - SHRQ $0x20, AX - TESTQ CX, CX - JZ sequenceDecs_decodeSync_safe_amd64_of_update_zero - ADDQ CX, BX - CMPQ BX, $0x40 - JA sequenceDecs_decodeSync_safe_amd64_of_update_zero - CMPQ CX, $0x40 - JAE sequenceDecs_decodeSync_safe_amd64_of_update_zero - NEGQ CX - SHRQ CL, R14 - ADDQ R14, AX - -sequenceDecs_decodeSync_safe_amd64_of_update_zero: - MOVQ AX, 8(SP) + MOVQ R9, AX + MOVQ BX, CX + MOVQ DX, R14 + SHLQ CL, R14 + SHRQ $0x01, R14 + MOVBLZX AH, CX + SHRQ $0x20, AX + ADDQ CX, BX + XORQ $0x3f, CX + SHRQ CL, R14 + ADDQ R14, AX + MOVQ AX, 40(SP) // Update match length - MOVQ R8, AX - MOVQ BX, CX - MOVQ DX, R14 - SHLQ CL, R14 - MOVB AH, CL - SHRQ $0x20, AX - TESTQ CX, CX - JZ sequenceDecs_decodeSync_safe_amd64_ml_update_zero - ADDQ CX, BX - CMPQ BX, $0x40 - JA sequenceDecs_decodeSync_safe_amd64_ml_update_zero - CMPQ CX, $0x40 - JAE sequenceDecs_decodeSync_safe_amd64_ml_update_zero - NEGQ CX - SHRQ CL, R14 - ADDQ R14, AX - -sequenceDecs_decodeSync_safe_amd64_ml_update_zero: - MOVQ AX, 16(SP) + MOVQ R8, AX + MOVQ BX, CX + MOVQ DX, R14 + SHLQ CL, R14 + SHRQ $0x01, R14 + MOVBLZX AH, CX + SHRQ $0x20, AX + ADDQ CX, BX + XORQ $0x3f, CX + SHRQ CL, R14 + ADDQ R14, AX + MOVQ AX, 48(SP) // Fill bitreader to have enough for the remaining CMPQ SI, $0x08 @@ -3006,96 +3590,82 @@ sequenceDecs_decodeSync_safe_amd64_fill_2_check_overread: sequenceDecs_decodeSync_safe_amd64_fill_2_end: // Update literal length - MOVQ DI, AX - MOVQ BX, CX - MOVQ DX, R14 - SHLQ CL, R14 - MOVB AH, CL - SHRQ $0x20, AX - TESTQ CX, CX - JZ sequenceDecs_decodeSync_safe_amd64_ll_update_zero - ADDQ CX, BX - CMPQ BX, $0x40 - JA sequenceDecs_decodeSync_safe_amd64_ll_update_zero - CMPQ CX, $0x40 - JAE sequenceDecs_decodeSync_safe_amd64_ll_update_zero - NEGQ CX - SHRQ CL, R14 - ADDQ R14, AX - -sequenceDecs_decodeSync_safe_amd64_ll_update_zero: - MOVQ AX, 24(SP) + MOVQ DI, AX + MOVQ BX, CX + MOVQ DX, R14 + SHLQ CL, R14 + SHRQ $0x01, R14 + MOVBLZX AH, CX + SHRQ $0x20, AX + ADDQ CX, BX + XORQ $0x3f, CX + SHRQ CL, R14 + ADDQ R14, AX + MOVQ AX, 56(SP) // Fill bitreader for state updates MOVQ R13, (SP) MOVQ R9, AX SHRQ $0x08, AX MOVBQZX AL, AX - MOVQ ctx+16(FP), CX - CMPQ 96(CX), $0x00 + CMPQ 32(SP), $0x00 JZ sequenceDecs_decodeSync_safe_amd64_skip_update // Update Literal Length State MOVBQZX DI, R13 SHRL $0x10, DI - LEAQ (BX)(R13*1), CX + MOVQ BX, CX MOVQ DX, R14 - MOVQ CX, BX - ROLQ CL, R14 - MOVL $0x00000001, R15 - MOVB R13, CL - SHLL CL, R15 - DECL R15 - ANDQ R15, R14 + SHLQ CL, R14 + SHRQ $0x01, R14 + ADDQ R13, BX + XORQ $0x3f, R13 + MOVQ R13, CX + SHRQ CL, R14 ADDQ R14, DI // Load ctx.llTable - MOVQ ctx+16(FP), CX - MOVQ (CX), CX + MOVQ 8(SP), CX MOVQ (CX)(DI*8), DI // Update Match Length State MOVBQZX R8, R13 SHRL $0x10, R8 - LEAQ (BX)(R13*1), CX + MOVQ BX, CX MOVQ DX, R14 - MOVQ CX, BX - ROLQ CL, R14 - MOVL $0x00000001, R15 - MOVB R13, CL - SHLL CL, R15 - DECL R15 - ANDQ R15, R14 + SHLQ CL, R14 + SHRQ $0x01, R14 + ADDQ R13, BX + XORQ $0x3f, R13 + MOVQ R13, CX + SHRQ CL, R14 ADDQ R14, R8 // Load ctx.mlTable - MOVQ ctx+16(FP), CX - MOVQ 24(CX), CX + MOVQ 16(SP), CX MOVQ (CX)(R8*8), R8 // Update Offset State MOVBQZX R9, R13 SHRL $0x10, R9 - LEAQ (BX)(R13*1), CX + MOVQ BX, CX MOVQ DX, R14 - MOVQ CX, BX - ROLQ CL, R14 - MOVL $0x00000001, R15 - MOVB R13, CL - SHLL CL, R15 - DECL R15 - ANDQ R15, R14 + SHLQ CL, R14 + SHRQ $0x01, R14 + ADDQ R13, BX + XORQ $0x3f, R13 + MOVQ R13, CX + SHRQ CL, R14 ADDQ R14, R9 // Load ctx.ofTable - MOVQ ctx+16(FP), CX - MOVQ 48(CX), CX + MOVQ 24(SP), CX MOVQ (CX)(R9*8), R9 sequenceDecs_decodeSync_safe_amd64_skip_update: // Adjust offset MOVQ s+0(FP), CX - MOVQ 8(SP), R13 + MOVQ 40(SP), R13 CMPQ AX, $0x01 JBE sequenceDecs_decodeSync_safe_amd64_adjust_offsetB_1_or_0 MOVUPS 144(CX), X0 @@ -3104,7 +3674,7 @@ sequenceDecs_decodeSync_safe_amd64_skip_update: JMP sequenceDecs_decodeSync_safe_amd64_after_adjust sequenceDecs_decodeSync_safe_amd64_adjust_offsetB_1_or_0: - CMPQ 24(SP), $0x00000000 + CMPQ 56(SP), $0x00000000 JNE sequenceDecs_decodeSync_safe_amd64_adjust_offset_maybezero INCQ R13 JMP sequenceDecs_decodeSync_safe_amd64_adjust_offset_nonzero @@ -3139,14 +3709,11 @@ sequenceDecs_decodeSync_safe_amd64_adjust_skip: MOVQ R14, R13 sequenceDecs_decodeSync_safe_amd64_after_adjust: - MOVQ R13, 8(SP) + MOVQ R13, 40(SP) // Check values - MOVQ 16(SP), AX - MOVQ 24(SP), CX - LEAQ (AX)(CX*1), R14 - MOVQ s+0(FP), R15 - ADDQ R14, 256(R15) + MOVQ 48(SP), AX + MOVQ 56(SP), CX MOVQ ctx+16(FP), R14 SUBQ CX, 104(R14) JS error_not_enough_literals @@ -3158,20 +3725,16 @@ sequenceDecs_decodeSync_safe_amd64_after_adjust: JNZ sequenceDecs_decodeSync_safe_amd64_error_match_len_ofs_mismatch sequenceDecs_decodeSync_safe_amd64_match_len_ofs_ok: - MOVQ 24(SP), AX - MOVQ 8(SP), CX - MOVQ 16(SP), R13 - // Check if we have enough space in s.out - LEAQ (AX)(R13*1), R14 + LEAQ (CX)(AX*1), R14 ADDQ R10, R14 - CMPQ R14, 32(SP) + CMPQ R14, 64(SP) JA error_not_enough_space // Copy literals - TESTQ AX, AX + TESTQ CX, CX JZ check_offset - MOVQ AX, R14 + MOVQ CX, R14 SUBQ $0x10, R14 JB copy_1_small @@ -3189,70 +3752,70 @@ copy_1_loop: JMP copy_1_end copy_1_small: - CMPQ AX, $0x03 + CMPQ CX, $0x03 JE copy_1_move_3 JB copy_1_move_1or2 - CMPQ AX, $0x08 + CMPQ CX, $0x08 JB copy_1_move_4through7 JMP copy_1_move_8through16 copy_1_move_1or2: MOVB (R11), R14 - MOVB -1(R11)(AX*1), R15 + MOVB -1(R11)(CX*1), R15 MOVB R14, (R10) - MOVB R15, -1(R10)(AX*1) - ADDQ AX, R11 - ADDQ AX, R10 + MOVB R15, -1(R10)(CX*1) + ADDQ CX, R11 + ADDQ CX, R10 JMP copy_1_end copy_1_move_3: - MOVW (R11), R14 - MOVB 2(R11), R15 - MOVW R14, (R10) - MOVB R15, 2(R10) - ADDQ AX, R11 - ADDQ AX, R10 - JMP copy_1_end + MOVWQZX (R11), R14 + MOVB 2(R11), R15 + MOVW R14, (R10) + MOVB R15, 2(R10) + ADDQ CX, R11 + ADDQ CX, R10 + JMP copy_1_end copy_1_move_4through7: MOVL (R11), R14 - MOVL -4(R11)(AX*1), R15 + MOVL -4(R11)(CX*1), R15 MOVL R14, (R10) - MOVL R15, -4(R10)(AX*1) - ADDQ AX, R11 - ADDQ AX, R10 + MOVL R15, -4(R10)(CX*1) + ADDQ CX, R11 + ADDQ CX, R10 JMP copy_1_end copy_1_move_8through16: MOVQ (R11), R14 - MOVQ -8(R11)(AX*1), R15 + MOVQ -8(R11)(CX*1), R15 MOVQ R14, (R10) - MOVQ R15, -8(R10)(AX*1) - ADDQ AX, R11 - ADDQ AX, R10 + MOVQ R15, -8(R10)(CX*1) + ADDQ CX, R11 + ADDQ CX, R10 copy_1_end: - ADDQ AX, R12 + ADDQ CX, R12 // Malformed input if seq.mo > t+len(hist) || seq.mo > s.windowSize) check_offset: - MOVQ R12, AX - ADDQ 40(SP), AX - CMPQ CX, AX + MOVQ R12, CX + ADDQ 72(SP), CX + CMPQ R13, CX JG error_match_off_too_big - CMPQ CX, 56(SP) + CMPQ R13, 88(SP) JG error_match_off_too_big // Copy match from history - MOVQ CX, AX - SUBQ R12, AX + MOVQ R13, CX + SUBQ R12, CX JLS copy_match - MOVQ 48(SP), R14 - SUBQ AX, R14 - CMPQ R13, AX + MOVQ 80(SP), R14 + SUBQ CX, R14 + CMPQ AX, CX JG copy_all_from_history - MOVQ R13, AX - SUBQ $0x10, AX + MOVQ AX, CX + SUBQ $0x10, CX JB copy_4_small copy_4_loop: @@ -3260,54 +3823,54 @@ copy_4_loop: MOVUPS X0, (R10) ADDQ $0x10, R14 ADDQ $0x10, R10 - SUBQ $0x10, AX + SUBQ $0x10, CX JAE copy_4_loop - LEAQ 16(R14)(AX*1), R14 - LEAQ 16(R10)(AX*1), R10 + LEAQ 16(R14)(CX*1), R14 + LEAQ 16(R10)(CX*1), R10 MOVUPS -16(R14), X0 MOVUPS X0, -16(R10) JMP copy_4_end copy_4_small: - CMPQ R13, $0x03 + CMPQ AX, $0x03 JE copy_4_move_3 - CMPQ R13, $0x08 + CMPQ AX, $0x08 JB copy_4_move_4through7 JMP copy_4_move_8through16 copy_4_move_3: - MOVW (R14), AX - MOVB 2(R14), CL - MOVW AX, (R10) - MOVB CL, 2(R10) - ADDQ R13, R14 - ADDQ R13, R10 - JMP copy_4_end + MOVWQZX (R14), CX + MOVB 2(R14), R13 + MOVW CX, (R10) + MOVB R13, 2(R10) + ADDQ AX, R14 + ADDQ AX, R10 + JMP copy_4_end copy_4_move_4through7: - MOVL (R14), AX - MOVL -4(R14)(R13*1), CX - MOVL AX, (R10) - MOVL CX, -4(R10)(R13*1) - ADDQ R13, R14 - ADDQ R13, R10 + MOVL (R14), CX + MOVL -4(R14)(AX*1), R13 + MOVL CX, (R10) + MOVL R13, -4(R10)(AX*1) + ADDQ AX, R14 + ADDQ AX, R10 JMP copy_4_end copy_4_move_8through16: - MOVQ (R14), AX - MOVQ -8(R14)(R13*1), CX - MOVQ AX, (R10) - MOVQ CX, -8(R10)(R13*1) - ADDQ R13, R14 - ADDQ R13, R10 + MOVQ (R14), CX + MOVQ -8(R14)(AX*1), R13 + MOVQ CX, (R10) + MOVQ R13, -8(R10)(AX*1) + ADDQ AX, R14 + ADDQ AX, R10 copy_4_end: - ADDQ R13, R12 + ADDQ AX, R12 JMP handle_loop JMP loop_finished copy_all_from_history: - MOVQ AX, R15 + MOVQ CX, R15 SUBQ $0x10, R15 JB copy_5_small @@ -3325,141 +3888,153 @@ copy_5_loop: JMP copy_5_end copy_5_small: - CMPQ AX, $0x03 + CMPQ CX, $0x03 JE copy_5_move_3 JB copy_5_move_1or2 - CMPQ AX, $0x08 + CMPQ CX, $0x08 JB copy_5_move_4through7 JMP copy_5_move_8through16 copy_5_move_1or2: MOVB (R14), R15 - MOVB -1(R14)(AX*1), BP + MOVB -1(R14)(CX*1), BP MOVB R15, (R10) - MOVB BP, -1(R10)(AX*1) - ADDQ AX, R14 - ADDQ AX, R10 + MOVB BP, -1(R10)(CX*1) + ADDQ CX, R14 + ADDQ CX, R10 JMP copy_5_end copy_5_move_3: - MOVW (R14), R15 - MOVB 2(R14), BP - MOVW R15, (R10) - MOVB BP, 2(R10) - ADDQ AX, R14 - ADDQ AX, R10 - JMP copy_5_end + MOVWQZX (R14), R15 + MOVB 2(R14), BP + MOVW R15, (R10) + MOVB BP, 2(R10) + ADDQ CX, R14 + ADDQ CX, R10 + JMP copy_5_end copy_5_move_4through7: MOVL (R14), R15 - MOVL -4(R14)(AX*1), BP + MOVL -4(R14)(CX*1), BP MOVL R15, (R10) - MOVL BP, -4(R10)(AX*1) - ADDQ AX, R14 - ADDQ AX, R10 + MOVL BP, -4(R10)(CX*1) + ADDQ CX, R14 + ADDQ CX, R10 JMP copy_5_end copy_5_move_8through16: MOVQ (R14), R15 - MOVQ -8(R14)(AX*1), BP + MOVQ -8(R14)(CX*1), BP MOVQ R15, (R10) - MOVQ BP, -8(R10)(AX*1) - ADDQ AX, R14 - ADDQ AX, R10 + MOVQ BP, -8(R10)(CX*1) + ADDQ CX, R14 + ADDQ CX, R10 copy_5_end: - ADDQ AX, R12 - SUBQ AX, R13 + ADDQ CX, R12 + SUBQ CX, AX // Copy match from the current buffer copy_match: - MOVQ R10, AX - SUBQ CX, AX + MOVQ R10, CX + SUBQ R13, CX // ml <= mo - CMPQ R13, CX + CMPQ AX, R13 JA copy_overlapping_match // Copy non-overlapping match - ADDQ R13, R12 - MOVQ R13, CX - SUBQ $0x10, CX + ADDQ AX, R12 + MOVQ AX, R13 + SUBQ $0x10, R13 JB copy_2_small copy_2_loop: - MOVUPS (AX), X0 + MOVUPS (CX), X0 MOVUPS X0, (R10) - ADDQ $0x10, AX + ADDQ $0x10, CX ADDQ $0x10, R10 - SUBQ $0x10, CX + SUBQ $0x10, R13 JAE copy_2_loop - LEAQ 16(AX)(CX*1), AX - LEAQ 16(R10)(CX*1), R10 - MOVUPS -16(AX), X0 + LEAQ 16(CX)(R13*1), CX + LEAQ 16(R10)(R13*1), R10 + MOVUPS -16(CX), X0 MOVUPS X0, -16(R10) JMP copy_2_end copy_2_small: - CMPQ R13, $0x03 + CMPQ AX, $0x03 JE copy_2_move_3 JB copy_2_move_1or2 - CMPQ R13, $0x08 + CMPQ AX, $0x08 JB copy_2_move_4through7 JMP copy_2_move_8through16 copy_2_move_1or2: - MOVB (AX), CL - MOVB -1(AX)(R13*1), R14 - MOVB CL, (R10) - MOVB R14, -1(R10)(R13*1) - ADDQ R13, AX - ADDQ R13, R10 + MOVB (CX), R13 + MOVB -1(CX)(AX*1), R14 + MOVB R13, (R10) + MOVB R14, -1(R10)(AX*1) + ADDQ AX, CX + ADDQ AX, R10 JMP copy_2_end copy_2_move_3: - MOVW (AX), CX - MOVB 2(AX), R14 - MOVW CX, (R10) - MOVB R14, 2(R10) - ADDQ R13, AX - ADDQ R13, R10 - JMP copy_2_end + MOVWQZX (CX), R13 + MOVB 2(CX), R14 + MOVW R13, (R10) + MOVB R14, 2(R10) + ADDQ AX, CX + ADDQ AX, R10 + JMP copy_2_end copy_2_move_4through7: - MOVL (AX), CX - MOVL -4(AX)(R13*1), R14 - MOVL CX, (R10) - MOVL R14, -4(R10)(R13*1) - ADDQ R13, AX - ADDQ R13, R10 + MOVL (CX), R13 + MOVL -4(CX)(AX*1), R14 + MOVL R13, (R10) + MOVL R14, -4(R10)(AX*1) + ADDQ AX, CX + ADDQ AX, R10 JMP copy_2_end copy_2_move_8through16: - MOVQ (AX), CX - MOVQ -8(AX)(R13*1), R14 - MOVQ CX, (R10) - MOVQ R14, -8(R10)(R13*1) - ADDQ R13, AX - ADDQ R13, R10 + MOVQ (CX), R13 + MOVQ -8(CX)(AX*1), R14 + MOVQ R13, (R10) + MOVQ R14, -8(R10)(AX*1) + ADDQ AX, CX + ADDQ AX, R10 copy_2_end: JMP handle_loop // Copy overlapping match copy_overlapping_match: - ADDQ R13, R12 + ADDQ AX, R12 + CMPQ R13, $0x10 + JB copy_slow_3 + +copy_3_blocks: + MOVUPS (CX), X0 + MOVUPS X0, (R10) + ADDQ $0x10, CX + ADDQ $0x10, R10 + SUBQ $0x10, AX + CMPQ AX, $0x10 + JAE copy_3_blocks + TESTQ AX, AX + JZ handle_loop copy_slow_3: - MOVB (AX), CL - MOVB CL, (R10) - INCQ AX - INCQ R10 - DECQ R13 - JNZ copy_slow_3 + MOVBQZX (CX), R13 + MOVB R13, (R10) + INCQ CX + INCQ R10 + DECQ AX + JNZ copy_slow_3 handle_loop: - MOVQ ctx+16(FP), AX - DECQ 96(AX) + DECQ 32(SP) JNS sequenceDecs_decodeSync_safe_amd64_main_loop loop_finished: @@ -3468,6 +4043,13 @@ loop_finished: MOVB BL, 40(AX) MOVQ SI, 32(AX) + // s.seqSize += outPosition - ctx.outPosition + MOVQ ctx+16(FP), AX + MOVQ s+0(FP), CX + MOVQ R12, DX + SUBQ 136(AX), DX + ADDQ DX, 256(CX) + // Update the context MOVQ ctx+16(FP), AX MOVQ R12, 136(AX) @@ -3481,7 +4063,7 @@ loop_finished: // Return with match length error sequenceDecs_decodeSync_safe_amd64_error_match_len_ofs_mismatch: - MOVQ 16(SP), AX + MOVQ 48(SP), AX MOVQ ctx+16(FP), CX MOVQ AX, 216(CX) MOVQ $0x00000001, ret+24(FP) @@ -3490,7 +4072,7 @@ sequenceDecs_decodeSync_safe_amd64_error_match_len_ofs_mismatch: // Return with match too long error sequenceDecs_decodeSync_safe_amd64_error_match_len_too_big: MOVQ ctx+16(FP), AX - MOVQ 16(SP), CX + MOVQ 48(SP), CX MOVQ CX, 216(AX) MOVQ $0x00000002, ret+24(FP) RET @@ -3498,7 +4080,7 @@ sequenceDecs_decodeSync_safe_amd64_error_match_len_too_big: // Return with match offset too long error error_match_off_too_big: MOVQ ctx+16(FP), AX - MOVQ 8(SP), CX + MOVQ 40(SP), CX MOVQ CX, 224(AX) MOVQ R12, 136(AX) MOVQ $0x00000003, ret+24(FP) @@ -3507,7 +4089,7 @@ error_match_off_too_big: // Return with not enough literals error error_not_enough_literals: MOVQ ctx+16(FP), AX - MOVQ 24(SP), CX + MOVQ 56(SP), CX MOVQ CX, 208(AX) MOVQ $0x00000004, ret+24(FP) RET @@ -3520,9 +4102,9 @@ error_overread: // Return with not enough output space error error_not_enough_space: MOVQ ctx+16(FP), AX - MOVQ 24(SP), CX + MOVQ 56(SP), CX MOVQ CX, 208(AX) - MOVQ 16(SP), CX + MOVQ 48(SP), CX MOVQ CX, 216(AX) MOVQ R12, 136(AX) MOVQ $0x00000005, ret+24(FP) @@ -3530,7 +4112,7 @@ error_not_enough_space: // func sequenceDecs_decodeSync_safe_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int // Requires: BMI, BMI2, CMOV, SSE -TEXT ·sequenceDecs_decodeSync_safe_bmi2(SB), $64-32 +TEXT ·sequenceDecs_decodeSync_safe_bmi2(SB), $96-32 MOVQ br+8(FP), BX MOVQ 24(BX), AX MOVBQZX 40(BX), DX @@ -3542,29 +4124,38 @@ TEXT ·sequenceDecs_decodeSync_safe_bmi2(SB), $64-32 MOVQ 72(CX), SI MOVQ 80(CX), DI MOVQ 88(CX), R8 - XORQ R9, R9 + MOVQ (CX), R9 MOVQ R9, 8(SP) + MOVQ 24(CX), R9 MOVQ R9, 16(SP) + MOVQ 48(CX), R9 MOVQ R9, 24(SP) + MOVQ 96(CX), R9 + MOVQ R9, 32(SP) + XORQ R9, R9 + MOVQ R9, 40(SP) + MOVQ R9, 48(SP) + MOVQ R9, 56(SP) MOVQ 112(CX), R9 MOVQ 128(CX), R10 - MOVQ R10, 32(SP) + MOVQ R10, 64(SP) MOVQ 144(CX), R10 MOVQ 136(CX), R11 MOVQ 200(CX), R12 - MOVQ R12, 56(SP) + MOVQ R12, 88(SP) MOVQ 176(CX), R12 - MOVQ R12, 48(SP) + MOVQ R12, 80(SP) MOVQ 184(CX), CX - MOVQ CX, 40(SP) - MOVQ 40(SP), CX - ADDQ CX, 48(SP) + MOVQ CX, 72(SP) + MOVQ 72(SP), CX + ADDQ CX, 80(SP) // Calculate pointer to s.out[cap(s.out)] (a past-end pointer) - ADDQ R9, 32(SP) + ADDQ R9, 64(SP) // outBase += outPosition - ADDQ R11, R9 + ADDQ R11, R9 + PCALIGN $0x40 sequenceDecs_decodeSync_safe_bmi2_main_loop: MOVQ (SP), R12 @@ -3609,7 +4200,7 @@ sequenceDecs_decodeSync_safe_bmi2_fill_end: MOVQ R8, CX SHRQ $0x20, CX ADDQ R14, CX - MOVQ CX, 8(SP) + MOVQ CX, 40(SP) // Update match length MOVQ $0x00000808, CX @@ -3622,7 +4213,7 @@ sequenceDecs_decodeSync_safe_bmi2_fill_end: MOVQ DI, CX SHRQ $0x20, CX ADDQ R14, CX - MOVQ CX, 16(SP) + MOVQ CX, 48(SP) // Fill bitreader to have enough for the remaining CMPQ BX, $0x08 @@ -3664,14 +4255,13 @@ sequenceDecs_decodeSync_safe_bmi2_fill_2_end: MOVQ SI, CX SHRQ $0x20, CX ADDQ R14, CX - MOVQ CX, 24(SP) + MOVQ CX, 56(SP) // Fill bitreader for state updates MOVQ R12, (SP) MOVQ $0x00000808, CX BEXTRQ CX, R8, R12 - MOVQ ctx+16(FP), CX - CMPQ 96(CX), $0x00 + CMPQ 32(SP), $0x00 JZ sequenceDecs_decodeSync_safe_bmi2_skip_update LEAQ (SI)(DI*1), R13 ADDQ R8, R13 @@ -3689,8 +4279,7 @@ sequenceDecs_decodeSync_safe_bmi2_fill_2_end: ADDQ CX, R8 // Load ctx.ofTable - MOVQ ctx+16(FP), CX - MOVQ 48(CX), CX + MOVQ 24(SP), CX MOVQ (CX)(R8*8), R8 // Update Match Length State @@ -3700,8 +4289,7 @@ sequenceDecs_decodeSync_safe_bmi2_fill_2_end: ADDQ CX, DI // Load ctx.mlTable - MOVQ ctx+16(FP), CX - MOVQ 24(CX), CX + MOVQ 16(SP), CX MOVQ (CX)(DI*8), DI // Update Literal Length State @@ -3710,14 +4298,13 @@ sequenceDecs_decodeSync_safe_bmi2_fill_2_end: ADDQ CX, SI // Load ctx.llTable - MOVQ ctx+16(FP), CX - MOVQ (CX), CX + MOVQ 8(SP), CX MOVQ (CX)(SI*8), SI sequenceDecs_decodeSync_safe_bmi2_skip_update: // Adjust offset MOVQ s+0(FP), CX - MOVQ 8(SP), R13 + MOVQ 40(SP), R13 CMPQ R12, $0x01 JBE sequenceDecs_decodeSync_safe_bmi2_adjust_offsetB_1_or_0 MOVUPS 144(CX), X0 @@ -3726,7 +4313,7 @@ sequenceDecs_decodeSync_safe_bmi2_skip_update: JMP sequenceDecs_decodeSync_safe_bmi2_after_adjust sequenceDecs_decodeSync_safe_bmi2_adjust_offsetB_1_or_0: - CMPQ 24(SP), $0x00000000 + CMPQ 56(SP), $0x00000000 JNE sequenceDecs_decodeSync_safe_bmi2_adjust_offset_maybezero INCQ R13 JMP sequenceDecs_decodeSync_safe_bmi2_adjust_offset_nonzero @@ -3761,14 +4348,11 @@ sequenceDecs_decodeSync_safe_bmi2_adjust_skip: MOVQ R14, R13 sequenceDecs_decodeSync_safe_bmi2_after_adjust: - MOVQ R13, 8(SP) + MOVQ R13, 40(SP) // Check values - MOVQ 16(SP), CX - MOVQ 24(SP), R12 - LEAQ (CX)(R12*1), R14 - MOVQ s+0(FP), R15 - ADDQ R14, 256(R15) + MOVQ 48(SP), CX + MOVQ 56(SP), R12 MOVQ ctx+16(FP), R14 SUBQ R12, 104(R14) JS error_not_enough_literals @@ -3780,20 +4364,16 @@ sequenceDecs_decodeSync_safe_bmi2_after_adjust: JNZ sequenceDecs_decodeSync_safe_bmi2_error_match_len_ofs_mismatch sequenceDecs_decodeSync_safe_bmi2_match_len_ofs_ok: - MOVQ 24(SP), CX - MOVQ 8(SP), R12 - MOVQ 16(SP), R13 - // Check if we have enough space in s.out - LEAQ (CX)(R13*1), R14 + LEAQ (R12)(CX*1), R14 ADDQ R9, R14 - CMPQ R14, 32(SP) + CMPQ R14, 64(SP) JA error_not_enough_space // Copy literals - TESTQ CX, CX + TESTQ R12, R12 JZ check_offset - MOVQ CX, R14 + MOVQ R12, R14 SUBQ $0x10, R14 JB copy_1_small @@ -3811,70 +4391,70 @@ copy_1_loop: JMP copy_1_end copy_1_small: - CMPQ CX, $0x03 + CMPQ R12, $0x03 JE copy_1_move_3 JB copy_1_move_1or2 - CMPQ CX, $0x08 + CMPQ R12, $0x08 JB copy_1_move_4through7 JMP copy_1_move_8through16 copy_1_move_1or2: MOVB (R10), R14 - MOVB -1(R10)(CX*1), R15 + MOVB -1(R10)(R12*1), R15 MOVB R14, (R9) - MOVB R15, -1(R9)(CX*1) - ADDQ CX, R10 - ADDQ CX, R9 + MOVB R15, -1(R9)(R12*1) + ADDQ R12, R10 + ADDQ R12, R9 JMP copy_1_end copy_1_move_3: - MOVW (R10), R14 - MOVB 2(R10), R15 - MOVW R14, (R9) - MOVB R15, 2(R9) - ADDQ CX, R10 - ADDQ CX, R9 - JMP copy_1_end + MOVWQZX (R10), R14 + MOVB 2(R10), R15 + MOVW R14, (R9) + MOVB R15, 2(R9) + ADDQ R12, R10 + ADDQ R12, R9 + JMP copy_1_end copy_1_move_4through7: MOVL (R10), R14 - MOVL -4(R10)(CX*1), R15 + MOVL -4(R10)(R12*1), R15 MOVL R14, (R9) - MOVL R15, -4(R9)(CX*1) - ADDQ CX, R10 - ADDQ CX, R9 + MOVL R15, -4(R9)(R12*1) + ADDQ R12, R10 + ADDQ R12, R9 JMP copy_1_end copy_1_move_8through16: MOVQ (R10), R14 - MOVQ -8(R10)(CX*1), R15 + MOVQ -8(R10)(R12*1), R15 MOVQ R14, (R9) - MOVQ R15, -8(R9)(CX*1) - ADDQ CX, R10 - ADDQ CX, R9 + MOVQ R15, -8(R9)(R12*1) + ADDQ R12, R10 + ADDQ R12, R9 copy_1_end: - ADDQ CX, R11 + ADDQ R12, R11 // Malformed input if seq.mo > t+len(hist) || seq.mo > s.windowSize) check_offset: - MOVQ R11, CX - ADDQ 40(SP), CX - CMPQ R12, CX + MOVQ R11, R12 + ADDQ 72(SP), R12 + CMPQ R13, R12 JG error_match_off_too_big - CMPQ R12, 56(SP) + CMPQ R13, 88(SP) JG error_match_off_too_big // Copy match from history - MOVQ R12, CX - SUBQ R11, CX + MOVQ R13, R12 + SUBQ R11, R12 JLS copy_match - MOVQ 48(SP), R14 - SUBQ CX, R14 - CMPQ R13, CX + MOVQ 80(SP), R14 + SUBQ R12, R14 + CMPQ CX, R12 JG copy_all_from_history - MOVQ R13, CX - SUBQ $0x10, CX + MOVQ CX, R12 + SUBQ $0x10, R12 JB copy_4_small copy_4_loop: @@ -3882,54 +4462,54 @@ copy_4_loop: MOVUPS X0, (R9) ADDQ $0x10, R14 ADDQ $0x10, R9 - SUBQ $0x10, CX + SUBQ $0x10, R12 JAE copy_4_loop - LEAQ 16(R14)(CX*1), R14 - LEAQ 16(R9)(CX*1), R9 + LEAQ 16(R14)(R12*1), R14 + LEAQ 16(R9)(R12*1), R9 MOVUPS -16(R14), X0 MOVUPS X0, -16(R9) JMP copy_4_end copy_4_small: - CMPQ R13, $0x03 + CMPQ CX, $0x03 JE copy_4_move_3 - CMPQ R13, $0x08 + CMPQ CX, $0x08 JB copy_4_move_4through7 JMP copy_4_move_8through16 copy_4_move_3: - MOVW (R14), CX - MOVB 2(R14), R12 - MOVW CX, (R9) - MOVB R12, 2(R9) - ADDQ R13, R14 - ADDQ R13, R9 - JMP copy_4_end + MOVWQZX (R14), R12 + MOVB 2(R14), R13 + MOVW R12, (R9) + MOVB R13, 2(R9) + ADDQ CX, R14 + ADDQ CX, R9 + JMP copy_4_end copy_4_move_4through7: - MOVL (R14), CX - MOVL -4(R14)(R13*1), R12 - MOVL CX, (R9) - MOVL R12, -4(R9)(R13*1) - ADDQ R13, R14 - ADDQ R13, R9 + MOVL (R14), R12 + MOVL -4(R14)(CX*1), R13 + MOVL R12, (R9) + MOVL R13, -4(R9)(CX*1) + ADDQ CX, R14 + ADDQ CX, R9 JMP copy_4_end copy_4_move_8through16: - MOVQ (R14), CX - MOVQ -8(R14)(R13*1), R12 - MOVQ CX, (R9) - MOVQ R12, -8(R9)(R13*1) - ADDQ R13, R14 - ADDQ R13, R9 + MOVQ (R14), R12 + MOVQ -8(R14)(CX*1), R13 + MOVQ R12, (R9) + MOVQ R13, -8(R9)(CX*1) + ADDQ CX, R14 + ADDQ CX, R9 copy_4_end: - ADDQ R13, R11 + ADDQ CX, R11 JMP handle_loop JMP loop_finished copy_all_from_history: - MOVQ CX, R15 + MOVQ R12, R15 SUBQ $0x10, R15 JB copy_5_small @@ -3947,141 +4527,153 @@ copy_5_loop: JMP copy_5_end copy_5_small: - CMPQ CX, $0x03 + CMPQ R12, $0x03 JE copy_5_move_3 JB copy_5_move_1or2 - CMPQ CX, $0x08 + CMPQ R12, $0x08 JB copy_5_move_4through7 JMP copy_5_move_8through16 copy_5_move_1or2: MOVB (R14), R15 - MOVB -1(R14)(CX*1), BP + MOVB -1(R14)(R12*1), BP MOVB R15, (R9) - MOVB BP, -1(R9)(CX*1) - ADDQ CX, R14 - ADDQ CX, R9 + MOVB BP, -1(R9)(R12*1) + ADDQ R12, R14 + ADDQ R12, R9 JMP copy_5_end copy_5_move_3: - MOVW (R14), R15 - MOVB 2(R14), BP - MOVW R15, (R9) - MOVB BP, 2(R9) - ADDQ CX, R14 - ADDQ CX, R9 - JMP copy_5_end + MOVWQZX (R14), R15 + MOVB 2(R14), BP + MOVW R15, (R9) + MOVB BP, 2(R9) + ADDQ R12, R14 + ADDQ R12, R9 + JMP copy_5_end copy_5_move_4through7: MOVL (R14), R15 - MOVL -4(R14)(CX*1), BP + MOVL -4(R14)(R12*1), BP MOVL R15, (R9) - MOVL BP, -4(R9)(CX*1) - ADDQ CX, R14 - ADDQ CX, R9 + MOVL BP, -4(R9)(R12*1) + ADDQ R12, R14 + ADDQ R12, R9 JMP copy_5_end copy_5_move_8through16: MOVQ (R14), R15 - MOVQ -8(R14)(CX*1), BP + MOVQ -8(R14)(R12*1), BP MOVQ R15, (R9) - MOVQ BP, -8(R9)(CX*1) - ADDQ CX, R14 - ADDQ CX, R9 + MOVQ BP, -8(R9)(R12*1) + ADDQ R12, R14 + ADDQ R12, R9 copy_5_end: - ADDQ CX, R11 - SUBQ CX, R13 + ADDQ R12, R11 + SUBQ R12, CX // Copy match from the current buffer copy_match: - MOVQ R9, CX - SUBQ R12, CX + MOVQ R9, R12 + SUBQ R13, R12 // ml <= mo - CMPQ R13, R12 + CMPQ CX, R13 JA copy_overlapping_match // Copy non-overlapping match - ADDQ R13, R11 - MOVQ R13, R12 - SUBQ $0x10, R12 + ADDQ CX, R11 + MOVQ CX, R13 + SUBQ $0x10, R13 JB copy_2_small copy_2_loop: - MOVUPS (CX), X0 + MOVUPS (R12), X0 MOVUPS X0, (R9) - ADDQ $0x10, CX + ADDQ $0x10, R12 ADDQ $0x10, R9 - SUBQ $0x10, R12 + SUBQ $0x10, R13 JAE copy_2_loop - LEAQ 16(CX)(R12*1), CX - LEAQ 16(R9)(R12*1), R9 - MOVUPS -16(CX), X0 + LEAQ 16(R12)(R13*1), R12 + LEAQ 16(R9)(R13*1), R9 + MOVUPS -16(R12), X0 MOVUPS X0, -16(R9) JMP copy_2_end copy_2_small: - CMPQ R13, $0x03 + CMPQ CX, $0x03 JE copy_2_move_3 JB copy_2_move_1or2 - CMPQ R13, $0x08 + CMPQ CX, $0x08 JB copy_2_move_4through7 JMP copy_2_move_8through16 copy_2_move_1or2: - MOVB (CX), R12 - MOVB -1(CX)(R13*1), R14 - MOVB R12, (R9) - MOVB R14, -1(R9)(R13*1) - ADDQ R13, CX - ADDQ R13, R9 + MOVB (R12), R13 + MOVB -1(R12)(CX*1), R14 + MOVB R13, (R9) + MOVB R14, -1(R9)(CX*1) + ADDQ CX, R12 + ADDQ CX, R9 JMP copy_2_end copy_2_move_3: - MOVW (CX), R12 - MOVB 2(CX), R14 - MOVW R12, (R9) - MOVB R14, 2(R9) - ADDQ R13, CX - ADDQ R13, R9 - JMP copy_2_end + MOVWQZX (R12), R13 + MOVB 2(R12), R14 + MOVW R13, (R9) + MOVB R14, 2(R9) + ADDQ CX, R12 + ADDQ CX, R9 + JMP copy_2_end copy_2_move_4through7: - MOVL (CX), R12 - MOVL -4(CX)(R13*1), R14 - MOVL R12, (R9) - MOVL R14, -4(R9)(R13*1) - ADDQ R13, CX - ADDQ R13, R9 + MOVL (R12), R13 + MOVL -4(R12)(CX*1), R14 + MOVL R13, (R9) + MOVL R14, -4(R9)(CX*1) + ADDQ CX, R12 + ADDQ CX, R9 JMP copy_2_end copy_2_move_8through16: - MOVQ (CX), R12 - MOVQ -8(CX)(R13*1), R14 - MOVQ R12, (R9) - MOVQ R14, -8(R9)(R13*1) - ADDQ R13, CX - ADDQ R13, R9 + MOVQ (R12), R13 + MOVQ -8(R12)(CX*1), R14 + MOVQ R13, (R9) + MOVQ R14, -8(R9)(CX*1) + ADDQ CX, R12 + ADDQ CX, R9 copy_2_end: JMP handle_loop // Copy overlapping match copy_overlapping_match: - ADDQ R13, R11 + ADDQ CX, R11 + CMPQ R13, $0x10 + JB copy_slow_3 + +copy_3_blocks: + MOVUPS (R12), X0 + MOVUPS X0, (R9) + ADDQ $0x10, R12 + ADDQ $0x10, R9 + SUBQ $0x10, CX + CMPQ CX, $0x10 + JAE copy_3_blocks + TESTQ CX, CX + JZ handle_loop copy_slow_3: - MOVB (CX), R12 - MOVB R12, (R9) - INCQ CX - INCQ R9 - DECQ R13 - JNZ copy_slow_3 + MOVBQZX (R12), R13 + MOVB R13, (R9) + INCQ R12 + INCQ R9 + DECQ CX + JNZ copy_slow_3 handle_loop: - MOVQ ctx+16(FP), CX - DECQ 96(CX) + DECQ 32(SP) JNS sequenceDecs_decodeSync_safe_bmi2_main_loop loop_finished: @@ -4090,6 +4682,13 @@ loop_finished: MOVB DL, 40(CX) MOVQ BX, 32(CX) + // s.seqSize += outPosition - ctx.outPosition + MOVQ ctx+16(FP), AX + MOVQ s+0(FP), CX + MOVQ R11, DX + SUBQ 136(AX), DX + ADDQ DX, 256(CX) + // Update the context MOVQ ctx+16(FP), AX MOVQ R11, 136(AX) @@ -4103,7 +4702,7 @@ loop_finished: // Return with match length error sequenceDecs_decodeSync_safe_bmi2_error_match_len_ofs_mismatch: - MOVQ 16(SP), AX + MOVQ 48(SP), AX MOVQ ctx+16(FP), CX MOVQ AX, 216(CX) MOVQ $0x00000001, ret+24(FP) @@ -4112,7 +4711,7 @@ sequenceDecs_decodeSync_safe_bmi2_error_match_len_ofs_mismatch: // Return with match too long error sequenceDecs_decodeSync_safe_bmi2_error_match_len_too_big: MOVQ ctx+16(FP), AX - MOVQ 16(SP), CX + MOVQ 48(SP), CX MOVQ CX, 216(AX) MOVQ $0x00000002, ret+24(FP) RET @@ -4120,7 +4719,7 @@ sequenceDecs_decodeSync_safe_bmi2_error_match_len_too_big: // Return with match offset too long error error_match_off_too_big: MOVQ ctx+16(FP), AX - MOVQ 8(SP), CX + MOVQ 40(SP), CX MOVQ CX, 224(AX) MOVQ R11, 136(AX) MOVQ $0x00000003, ret+24(FP) @@ -4129,7 +4728,7 @@ error_match_off_too_big: // Return with not enough literals error error_not_enough_literals: MOVQ ctx+16(FP), AX - MOVQ 24(SP), CX + MOVQ 56(SP), CX MOVQ CX, 208(AX) MOVQ $0x00000004, ret+24(FP) RET @@ -4142,9 +4741,9 @@ error_overread: // Return with not enough output space error error_not_enough_space: MOVQ ctx+16(FP), AX - MOVQ 24(SP), CX + MOVQ 56(SP), CX MOVQ CX, 208(AX) - MOVQ 16(SP), CX + MOVQ 48(SP), CX MOVQ CX, 216(AX) MOVQ R11, 136(AX) MOVQ $0x00000005, ret+24(FP) diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec_arm64.go b/vendor/github.com/klauspost/compress/zstd/seqdec_arm64.go index 5ad262acff0..5b911ab57ef 100644 --- a/vendor/github.com/klauspost/compress/zstd/seqdec_arm64.go +++ b/vendor/github.com/klauspost/compress/zstd/seqdec_arm64.go @@ -1,4 +1,4 @@ -//go:build arm64 && !appengine && !noasm && gc +//go:build arm64 && !noasm && gc package zstd @@ -7,6 +7,17 @@ package zstd // by the avo arm64 lowering printer) and the dispatch helpers. arm64 has no // BMI2, so each helper selects only between the 56-bit / safe variants. +// The synchronous decoder takes the two-pass path, and executeSimple +// prefetches, when the window is at least decodeTwoPassMinWindow and the +// block's offset table puts at least twoPassMinFarShare/256 of its +// sequences 128 KiB or more back (sequenceDecs.useTwoPass). Thresholds +// from the per-file N1 measurement in #1212; variables so tests can force +// either path. +var ( + twoPassMinFarShare = 46 + decodeTwoPassMinWindow = 1 << 20 +) + // sequenceDecs_decode_arm64 implements the main loop of sequenceDecs in arm64 asm. // // Please refer to seqdec_generic.go for the reference implementation. diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec_arm64.s b/vendor/github.com/klauspost/compress/zstd/seqdec_arm64.s index a468e5fc2ca..d1d16588c44 100644 --- a/vendor/github.com/klauspost/compress/zstd/seqdec_arm64.s +++ b/vendor/github.com/klauspost/compress/zstd/seqdec_arm64.s @@ -1,36 +1,44 @@ // Code generated by command: go run gen.go -out ../seqdec.s -arch amd64,arm64 -pkg=zstd. DO NOT EDIT. // EXPERIMENTAL arm64 output lowered from an amd64 avo program. -//go:build arm64 && !appengine && !noasm && gc && !noasm +//go:build arm64 && (!noasm && gc) // func sequenceDecs_decode_amd64(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int // Requires: CMOV -TEXT ·sequenceDecs_decode_arm64(SB), $8-32 - MOVD br+8(FP), R1 - MOVD 24(R1), R2 - MOVBU 40(R1), R3 - MOVD (R1), R0 - MOVD 32(R1), R5 - ADD R5, R0, R0 - MOVD R0, (RSP) - MOVD ctx+16(FP), R0 - MOVD 72(R0), R6 - MOVD 80(R0), R7 - MOVD 88(R0), R8 - MOVD 104(R0), R9 - MOVD s+0(FP), R0 - MOVD 144(R0), R10 - MOVD 152(R0), R11 - MOVD 160(R0), R12 +TEXT ·sequenceDecs_decode_arm64(SB), $40-32 + MOVD br+8(FP), R1 + MOVD 24(R1), R2 + MOVBU 40(R1), R3 + MOVD (R1), R0 + MOVD 32(R1), R5 + ADD R5, R0, R0 + MOVD R0, 8(RSP) + MOVD ctx+16(FP), R0 + MOVD 72(R0), R6 + MOVD 80(R0), R7 + MOVD 88(R0), R8 + MOVD (R0), R1 + MOVD R1, 16(RSP) + MOVD 24(R0), R1 + MOVD R1, 24(RSP) + MOVD 48(R0), R1 + MOVD R1, 32(RSP) + MOVD 96(R0), R1 + MOVD R1, 40(RSP) + MOVD 104(R0), R9 + MOVD s+0(FP), R0 + MOVD 144(R0), R10 + MOVD 152(R0), R11 + MOVD 160(R0), R12 + PCALIGN $0x40 sequenceDecs_decode_amd64_main_loop: - MOVD (RSP), R13 + MOVD 8(RSP), R13 // Fill bitreader to have enough for the offset and match length. CMP $0x08, R5 BLT sequenceDecs_decode_amd64_fill_byte_by_byte - MOVD R3, R0 - LSR $0x03, R0, R0 + LSR $0x03, R3, R0 SUB R0, R13, R13 MOVD (R13), R2 SUB R0, R5, R5 @@ -57,51 +65,32 @@ sequenceDecs_decode_amd64_fill_check_overread: sequenceDecs_decode_amd64_fill_end: // Update offset MOVD R8, R0 - MOVD R3, R1 - MOVD R2, R14 - LSL R1, R14, R14 + LSL R3, R2, R14 + LSR $0x01, R14, R14 UBFX $8, R0, $8, R1 LSR $0x20, R0, R0 - TST R1, R1 - BEQ sequenceDecs_decode_amd64_of_update_zero ADD R1, R3, R3 - CMP $0x40, R3 - BHI sequenceDecs_decode_amd64_of_update_zero - CMP $0x40, R1 - BHS sequenceDecs_decode_amd64_of_update_zero - NEG R1, R1 + EOR $0x3f, R1, R1 LSR R1, R14, R14 ADD R14, R0, R0 - -sequenceDecs_decode_amd64_of_update_zero: MOVD R0, 16(R9) // Update match length MOVD R7, R0 - MOVD R3, R1 - MOVD R2, R14 - LSL R1, R14, R14 + LSL R3, R2, R14 + LSR $0x01, R14, R14 UBFX $8, R0, $8, R1 LSR $0x20, R0, R0 - TST R1, R1 - BEQ sequenceDecs_decode_amd64_ml_update_zero ADD R1, R3, R3 - CMP $0x40, R3 - BHI sequenceDecs_decode_amd64_ml_update_zero - CMP $0x40, R1 - BHS sequenceDecs_decode_amd64_ml_update_zero - NEG R1, R1 + EOR $0x3f, R1, R1 LSR R1, R14, R14 ADD R14, R0, R0 - -sequenceDecs_decode_amd64_ml_update_zero: MOVD R0, 8(R9) // Fill bitreader to have enough for the remaining CMP $0x08, R5 BLT sequenceDecs_decode_amd64_fill_2_byte_by_byte - MOVD R3, R0 - LSR $0x03, R0, R0 + LSR $0x03, R3, R0 SUB R0, R13, R13 MOVD (R13), R2 SUB R0, R5, R5 @@ -128,97 +117,64 @@ sequenceDecs_decode_amd64_fill_2_check_overread: sequenceDecs_decode_amd64_fill_2_end: // Update literal length MOVD R6, R0 - MOVD R3, R1 - MOVD R2, R14 - LSL R1, R14, R14 + LSL R3, R2, R14 + LSR $0x01, R14, R14 UBFX $8, R0, $8, R1 LSR $0x20, R0, R0 - TST R1, R1 - BEQ sequenceDecs_decode_amd64_ll_update_zero ADD R1, R3, R3 - CMP $0x40, R3 - BHI sequenceDecs_decode_amd64_ll_update_zero - CMP $0x40, R1 - BHS sequenceDecs_decode_amd64_ll_update_zero - NEG R1, R1 + EOR $0x3f, R1, R1 LSR R1, R14, R14 ADD R14, R0, R0 - -sequenceDecs_decode_amd64_ll_update_zero: MOVD R0, (R9) // Fill bitreader for state updates - MOVD R13, (RSP) - MOVD R8, R0 - LSR $0x08, R0, R0 - MOVBU R0, R0 - MOVD ctx+16(FP), R1 - MOVD 96(R1), R16 - CMP $0x00, R16 - BEQ sequenceDecs_decode_amd64_skip_update + MOVD R13, 8(RSP) + UBFX $8, R8, $8, R0 + MOVD 40(RSP), R16 + CMP $0x00, R16 + BEQ sequenceDecs_decode_amd64_skip_update // Update Literal Length State MOVBU R6, R13 LSRW $0x10, R6, R6 - ADD R13, R3, R1 - MOVD R2, R14 - MOVD R1, R3 - NEG R1, R16 - ROR R16, R14, R14 - MOVD $0x00000001, R4 - MOVB R13, R1 - LSLW R1, R4, R4 - SUBW $1, R4, R4 - AND R4, R14, R14 + LSL R3, R2, R14 + LSR $0x01, R14, R14 + ADD R13, R3, R3 + EOR $0x3f, R13, R13 + LSR R13, R14, R14 ADD R14, R6, R6 // Load ctx.llTable - MOVD ctx+16(FP), R1 - MOVD (R1), R1 - ADD R6<<3, R1, R15 - MOVD (R15), R6 + MOVD 16(RSP), R1 + MOVD (R1)(R6<<3), R6 // Update Match Length State MOVBU R7, R13 LSRW $0x10, R7, R7 - ADD R13, R3, R1 - MOVD R2, R14 - MOVD R1, R3 - NEG R1, R16 - ROR R16, R14, R14 - MOVD $0x00000001, R4 - MOVB R13, R1 - LSLW R1, R4, R4 - SUBW $1, R4, R4 - AND R4, R14, R14 + LSL R3, R2, R14 + LSR $0x01, R14, R14 + ADD R13, R3, R3 + EOR $0x3f, R13, R13 + LSR R13, R14, R14 ADD R14, R7, R7 // Load ctx.mlTable - MOVD ctx+16(FP), R1 - MOVD 24(R1), R1 - ADD R7<<3, R1, R15 - MOVD (R15), R7 + MOVD 24(RSP), R1 + MOVD (R1)(R7<<3), R7 // Update Offset State MOVBU R8, R13 LSRW $0x10, R8, R8 - ADD R13, R3, R1 - MOVD R2, R14 - MOVD R1, R3 - NEG R1, R16 - ROR R16, R14, R14 - MOVD $0x00000001, R4 - MOVB R13, R1 - LSLW R1, R4, R4 - SUBW $1, R4, R4 - AND R4, R14, R14 + LSL R3, R2, R14 + LSR $0x01, R14, R14 + ADD R13, R3, R3 + EOR $0x3f, R13, R13 + LSR R13, R14, R14 ADD R14, R8, R8 // Load ctx.ofTable - MOVD ctx+16(FP), R1 - MOVD 48(R1), R1 - ADD R8<<3, R1, R15 - MOVD (R15), R8 + MOVD 32(RSP), R1 + MOVD (R1)(R8<<3), R8 sequenceDecs_decode_amd64_skip_update: // Adjust offset @@ -303,10 +259,9 @@ sequenceDecs_decode_amd64_after_adjust: sequenceDecs_decode_amd64_match_len_ofs_ok: ADD $0x18, R9, R9 - MOVD ctx+16(FP), R0 - MOVD 96(R0), R16 + MOVD 40(RSP), R16 SUBS $1, R16, R16 - MOVD R16, 96(R0) + MOVD R16, 40(RSP) BPL sequenceDecs_decode_amd64_main_loop MOVD s+0(FP), R0 MOVD R10, 144(R0) @@ -318,67 +273,93 @@ sequenceDecs_decode_amd64_match_len_ofs_ok: MOVD R5, 32(R0) // Return success + MOVD 40(RSP), R0 + MOVD ctx+16(FP), R1 + MOVD R0, 96(R1) MOVD $0x00000000, R16 MOVD R16, ret+24(FP) RET // Return with match length error sequenceDecs_decode_amd64_error_match_len_ofs_mismatch: + MOVD 40(RSP), R0 + MOVD ctx+16(FP), R1 + MOVD R0, 96(R1) MOVD $0x00000001, R16 MOVD R16, ret+24(FP) RET // Return with match too long error sequenceDecs_decode_amd64_error_match_len_too_big: + MOVD 40(RSP), R0 + MOVD ctx+16(FP), R1 + MOVD R0, 96(R1) MOVD $0x00000002, R16 MOVD R16, ret+24(FP) RET // Return with match offset too long error + MOVD 40(RSP), R0 + MOVD ctx+16(FP), R1 + MOVD R0, 96(R1) MOVD $0x00000003, R16 MOVD R16, ret+24(FP) RET // Return with not enough literals error error_not_enough_literals: + MOVD 40(RSP), R0 + MOVD ctx+16(FP), R1 + MOVD R0, 96(R1) MOVD $0x00000004, R16 MOVD R16, ret+24(FP) RET // Return with overread error error_overread: + MOVD 40(RSP), R0 + MOVD ctx+16(FP), R1 + MOVD R0, 96(R1) MOVD $0x00000006, R16 MOVD R16, ret+24(FP) RET // func sequenceDecs_decode_56_amd64(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int // Requires: CMOV -TEXT ·sequenceDecs_decode_56_arm64(SB), $8-32 - MOVD br+8(FP), R1 - MOVD 24(R1), R2 - MOVBU 40(R1), R3 - MOVD (R1), R0 - MOVD 32(R1), R5 - ADD R5, R0, R0 - MOVD R0, (RSP) - MOVD ctx+16(FP), R0 - MOVD 72(R0), R6 - MOVD 80(R0), R7 - MOVD 88(R0), R8 - MOVD 104(R0), R9 - MOVD s+0(FP), R0 - MOVD 144(R0), R10 - MOVD 152(R0), R11 - MOVD 160(R0), R12 +TEXT ·sequenceDecs_decode_56_arm64(SB), $40-32 + MOVD br+8(FP), R1 + MOVD 24(R1), R2 + MOVBU 40(R1), R3 + MOVD (R1), R0 + MOVD 32(R1), R5 + ADD R5, R0, R0 + MOVD R0, 8(RSP) + MOVD ctx+16(FP), R0 + MOVD 72(R0), R6 + MOVD 80(R0), R7 + MOVD 88(R0), R8 + MOVD (R0), R1 + MOVD R1, 16(RSP) + MOVD 24(R0), R1 + MOVD R1, 24(RSP) + MOVD 48(R0), R1 + MOVD R1, 32(RSP) + MOVD 96(R0), R1 + MOVD R1, 40(RSP) + MOVD 104(R0), R9 + MOVD s+0(FP), R0 + MOVD 144(R0), R10 + MOVD 152(R0), R11 + MOVD 160(R0), R12 + PCALIGN $0x40 sequenceDecs_decode_56_amd64_main_loop: - MOVD (RSP), R13 + MOVD 8(RSP), R13 // Fill bitreader to have enough for the offset and match length. CMP $0x08, R5 BLT sequenceDecs_decode_56_amd64_fill_byte_by_byte - MOVD R3, R0 - LSR $0x03, R0, R0 + LSR $0x03, R3, R0 SUB R0, R13, R13 MOVD (R13), R2 SUB R0, R5, R5 @@ -405,139 +386,88 @@ sequenceDecs_decode_56_amd64_fill_check_overread: sequenceDecs_decode_56_amd64_fill_end: // Update offset MOVD R8, R0 - MOVD R3, R1 - MOVD R2, R14 - LSL R1, R14, R14 + LSL R3, R2, R14 + LSR $0x01, R14, R14 UBFX $8, R0, $8, R1 LSR $0x20, R0, R0 - TST R1, R1 - BEQ sequenceDecs_decode_56_amd64_of_update_zero ADD R1, R3, R3 - CMP $0x40, R3 - BHI sequenceDecs_decode_56_amd64_of_update_zero - CMP $0x40, R1 - BHS sequenceDecs_decode_56_amd64_of_update_zero - NEG R1, R1 + EOR $0x3f, R1, R1 LSR R1, R14, R14 ADD R14, R0, R0 - -sequenceDecs_decode_56_amd64_of_update_zero: MOVD R0, 16(R9) // Update match length MOVD R7, R0 - MOVD R3, R1 - MOVD R2, R14 - LSL R1, R14, R14 + LSL R3, R2, R14 + LSR $0x01, R14, R14 UBFX $8, R0, $8, R1 LSR $0x20, R0, R0 - TST R1, R1 - BEQ sequenceDecs_decode_56_amd64_ml_update_zero ADD R1, R3, R3 - CMP $0x40, R3 - BHI sequenceDecs_decode_56_amd64_ml_update_zero - CMP $0x40, R1 - BHS sequenceDecs_decode_56_amd64_ml_update_zero - NEG R1, R1 + EOR $0x3f, R1, R1 LSR R1, R14, R14 ADD R14, R0, R0 - -sequenceDecs_decode_56_amd64_ml_update_zero: MOVD R0, 8(R9) // Update literal length MOVD R6, R0 - MOVD R3, R1 - MOVD R2, R14 - LSL R1, R14, R14 + LSL R3, R2, R14 + LSR $0x01, R14, R14 UBFX $8, R0, $8, R1 LSR $0x20, R0, R0 - TST R1, R1 - BEQ sequenceDecs_decode_56_amd64_ll_update_zero ADD R1, R3, R3 - CMP $0x40, R3 - BHI sequenceDecs_decode_56_amd64_ll_update_zero - CMP $0x40, R1 - BHS sequenceDecs_decode_56_amd64_ll_update_zero - NEG R1, R1 + EOR $0x3f, R1, R1 LSR R1, R14, R14 ADD R14, R0, R0 - -sequenceDecs_decode_56_amd64_ll_update_zero: MOVD R0, (R9) // Fill bitreader for state updates - MOVD R13, (RSP) - MOVD R8, R0 - LSR $0x08, R0, R0 - MOVBU R0, R0 - MOVD ctx+16(FP), R1 - MOVD 96(R1), R16 - CMP $0x00, R16 - BEQ sequenceDecs_decode_56_amd64_skip_update + MOVD R13, 8(RSP) + UBFX $8, R8, $8, R0 + MOVD 40(RSP), R16 + CMP $0x00, R16 + BEQ sequenceDecs_decode_56_amd64_skip_update // Update Literal Length State MOVBU R6, R13 LSRW $0x10, R6, R6 - ADD R13, R3, R1 - MOVD R2, R14 - MOVD R1, R3 - NEG R1, R16 - ROR R16, R14, R14 - MOVD $0x00000001, R4 - MOVB R13, R1 - LSLW R1, R4, R4 - SUBW $1, R4, R4 - AND R4, R14, R14 + LSL R3, R2, R14 + LSR $0x01, R14, R14 + ADD R13, R3, R3 + EOR $0x3f, R13, R13 + LSR R13, R14, R14 ADD R14, R6, R6 // Load ctx.llTable - MOVD ctx+16(FP), R1 - MOVD (R1), R1 - ADD R6<<3, R1, R15 - MOVD (R15), R6 + MOVD 16(RSP), R1 + MOVD (R1)(R6<<3), R6 // Update Match Length State MOVBU R7, R13 LSRW $0x10, R7, R7 - ADD R13, R3, R1 - MOVD R2, R14 - MOVD R1, R3 - NEG R1, R16 - ROR R16, R14, R14 - MOVD $0x00000001, R4 - MOVB R13, R1 - LSLW R1, R4, R4 - SUBW $1, R4, R4 - AND R4, R14, R14 + LSL R3, R2, R14 + LSR $0x01, R14, R14 + ADD R13, R3, R3 + EOR $0x3f, R13, R13 + LSR R13, R14, R14 ADD R14, R7, R7 // Load ctx.mlTable - MOVD ctx+16(FP), R1 - MOVD 24(R1), R1 - ADD R7<<3, R1, R15 - MOVD (R15), R7 + MOVD 24(RSP), R1 + MOVD (R1)(R7<<3), R7 // Update Offset State MOVBU R8, R13 LSRW $0x10, R8, R8 - ADD R13, R3, R1 - MOVD R2, R14 - MOVD R1, R3 - NEG R1, R16 - ROR R16, R14, R14 - MOVD $0x00000001, R4 - MOVB R13, R1 - LSLW R1, R4, R4 - SUBW $1, R4, R4 - AND R4, R14, R14 + LSL R3, R2, R14 + LSR $0x01, R14, R14 + ADD R13, R3, R3 + EOR $0x3f, R13, R13 + LSR R13, R14, R14 ADD R14, R8, R8 // Load ctx.ofTable - MOVD ctx+16(FP), R1 - MOVD 48(R1), R1 - ADD R8<<3, R1, R15 - MOVD (R15), R8 + MOVD 32(RSP), R1 + MOVD (R1)(R8<<3), R8 sequenceDecs_decode_56_amd64_skip_update: // Adjust offset @@ -622,10 +552,9 @@ sequenceDecs_decode_56_amd64_after_adjust: sequenceDecs_decode_56_amd64_match_len_ofs_ok: ADD $0x18, R9, R9 - MOVD ctx+16(FP), R0 - MOVD 96(R0), R16 + MOVD 40(RSP), R16 SUBS $1, R16, R16 - MOVD R16, 96(R0) + MOVD R16, 40(RSP) BPL sequenceDecs_decode_56_amd64_main_loop MOVD s+0(FP), R0 MOVD R10, 144(R0) @@ -637,35 +566,53 @@ sequenceDecs_decode_56_amd64_match_len_ofs_ok: MOVD R5, 32(R0) // Return success + MOVD 40(RSP), R0 + MOVD ctx+16(FP), R1 + MOVD R0, 96(R1) MOVD $0x00000000, R16 MOVD R16, ret+24(FP) RET // Return with match length error sequenceDecs_decode_56_amd64_error_match_len_ofs_mismatch: + MOVD 40(RSP), R0 + MOVD ctx+16(FP), R1 + MOVD R0, 96(R1) MOVD $0x00000001, R16 MOVD R16, ret+24(FP) RET // Return with match too long error sequenceDecs_decode_56_amd64_error_match_len_too_big: + MOVD 40(RSP), R0 + MOVD ctx+16(FP), R1 + MOVD R0, 96(R1) MOVD $0x00000002, R16 MOVD R16, ret+24(FP) RET // Return with match offset too long error + MOVD 40(RSP), R0 + MOVD ctx+16(FP), R1 + MOVD R0, 96(R1) MOVD $0x00000003, R16 MOVD R16, ret+24(FP) RET // Return with not enough literals error error_not_enough_literals: + MOVD 40(RSP), R0 + MOVD ctx+16(FP), R1 + MOVD R0, 96(R1) MOVD $0x00000004, R16 MOVD R16, ret+24(FP) RET // Return with overread error error_overread: + MOVD 40(RSP), R0 + MOVD ctx+16(FP), R1 + MOVD R0, 96(R1) MOVD $0x00000006, R16 MOVD R16, ret+24(FP) RET @@ -675,13 +622,25 @@ error_overread: // skipped sequenceDecs_decode_56_bmi2 (generic twin preferred on arm64) // func sequenceDecs_executeSimple_amd64(ctx *executeAsmContext) bool -// Requires: SSE -TEXT ·sequenceDecs_executeSimple_arm64(SB), $8-9 +// Requires: MMX+, SSE +TEXT ·sequenceDecs_executeSimple_arm64(SB), $32-9 MOVD ctx+0(FP), R9 MOVD 8(R9), R1 TST R1, R1 BEQ empty_seqs MOVD (R9), R0 + + // seqsEnd = seqsBase + 24 * len(seqs) if ctx.prefetch, else seqsBase (prefetch off) + MOVD R0, R2 + MOVBU 128(R9), R10 + TST R10, R10 + BEQ prefetch_off + ADD R1<<1, R1, R2 + LSL $0x03, R2, R2 + ADD R0, R2, R2 + +prefetch_off: + MOVD R2, 8(RSP) MOVD 24(R9), R2 MOVD 32(R9), R3 MOVD 80(R9), R5 @@ -697,32 +656,260 @@ TEXT ·sequenceDecs_executeSimple_arm64(SB), $8-9 ADD R10, R0, R0 // outBase += outPosition - ADD R6, R3, R3 - + ADD R6, R3, R3 + MOVD R3, 16(RSP) + MOVD R3, R10 + SUB R6, R10, R10 + MOVD R10, 24(RSP) + NEG R10, R10 + ADD R8, R10, R10 + MOVD R10, 32(RSP) + + // Prime the prefetch window + MOVD 8(RSP), R10 + MOVD R0, R11 + CMP R10, R11 + BHS prefetch_skip_0 + MOVD 16(RSP), R11 + MOVD (R0), R10 + ADD R10, R11, R11 + MOVD R11, R12 + MOVD 16(R0), R10 + SUB R10, R12, R12 + MOVD 24(RSP), R10 + CMP R10, R12 + BHS prefetch_in_out_0 + MOVD 32(RSP), R10 + ADD R10, R12, R12 + +prefetch_in_out_0: + PRFM (R12), PLDL1KEEP + PRFM 64(R12), PLDL1KEEP + MOVD 8(R0), R10 + ADD R10, R11, R11 + MOVD R11, 16(RSP) + +prefetch_skip_0: + MOVD 8(RSP), R10 + ADD $24, R0, R11 + CMP R10, R11 + BHS prefetch_skip_1 + MOVD 16(RSP), R11 + MOVD 24(R0), R10 + ADD R10, R11, R11 + MOVD R11, R12 + MOVD 40(R0), R10 + SUB R10, R12, R12 + MOVD 24(RSP), R10 + CMP R10, R12 + BHS prefetch_in_out_1 + MOVD 32(RSP), R10 + ADD R10, R12, R12 + +prefetch_in_out_1: + PRFM (R12), PLDL1KEEP + PRFM 64(R12), PLDL1KEEP + MOVD 32(R0), R10 + ADD R10, R11, R11 + MOVD R11, 16(RSP) + +prefetch_skip_1: + MOVD 8(RSP), R10 + ADD $48, R0, R11 + CMP R10, R11 + BHS prefetch_skip_2 + MOVD 16(RSP), R11 + MOVD 48(R0), R10 + ADD R10, R11, R11 + MOVD R11, R12 + MOVD 64(R0), R10 + SUB R10, R12, R12 + MOVD 24(RSP), R10 + CMP R10, R12 + BHS prefetch_in_out_2 + MOVD 32(RSP), R10 + ADD R10, R12, R12 + +prefetch_in_out_2: + PRFM (R12), PLDL1KEEP + PRFM 64(R12), PLDL1KEEP + MOVD 56(R0), R10 + ADD R10, R11, R11 + MOVD R11, 16(RSP) + +prefetch_skip_2: + MOVD 8(RSP), R10 + ADD $72, R0, R11 + CMP R10, R11 + BHS prefetch_skip_3 + MOVD 16(RSP), R11 + MOVD 72(R0), R10 + ADD R10, R11, R11 + MOVD R11, R12 + MOVD 88(R0), R10 + SUB R10, R12, R12 + MOVD 24(RSP), R10 + CMP R10, R12 + BHS prefetch_in_out_3 + MOVD 32(RSP), R10 + ADD R10, R12, R12 + +prefetch_in_out_3: + PRFM (R12), PLDL1KEEP + PRFM 64(R12), PLDL1KEEP + MOVD 80(R0), R10 + ADD R10, R11, R11 + MOVD R11, 16(RSP) + +prefetch_skip_3: + MOVD 8(RSP), R10 + ADD $96, R0, R11 + CMP R10, R11 + BHS prefetch_skip_4 + MOVD 16(RSP), R11 + MOVD 96(R0), R10 + ADD R10, R11, R11 + MOVD R11, R12 + MOVD 112(R0), R10 + SUB R10, R12, R12 + MOVD 24(RSP), R10 + CMP R10, R12 + BHS prefetch_in_out_4 + MOVD 32(RSP), R10 + ADD R10, R12, R12 + +prefetch_in_out_4: + PRFM (R12), PLDL1KEEP + PRFM 64(R12), PLDL1KEEP + MOVD 104(R0), R10 + ADD R10, R11, R11 + MOVD R11, 16(RSP) + +prefetch_skip_4: + MOVD 8(RSP), R10 + ADD $120, R0, R11 + CMP R10, R11 + BHS prefetch_skip_5 + MOVD 16(RSP), R11 + MOVD 120(R0), R10 + ADD R10, R11, R11 + MOVD R11, R12 + MOVD 136(R0), R10 + SUB R10, R12, R12 + MOVD 24(RSP), R10 + CMP R10, R12 + BHS prefetch_in_out_5 + MOVD 32(RSP), R10 + ADD R10, R12, R12 + +prefetch_in_out_5: + PRFM (R12), PLDL1KEEP + PRFM 64(R12), PLDL1KEEP + MOVD 128(R0), R10 + ADD R10, R11, R11 + MOVD R11, 16(RSP) + +prefetch_skip_5: + MOVD 8(RSP), R10 + ADD $144, R0, R11 + CMP R10, R11 + BHS prefetch_skip_6 + MOVD 16(RSP), R11 + MOVD 144(R0), R10 + ADD R10, R11, R11 + MOVD R11, R12 + MOVD 160(R0), R10 + SUB R10, R12, R12 + MOVD 24(RSP), R10 + CMP R10, R12 + BHS prefetch_in_out_6 + MOVD 32(RSP), R10 + ADD R10, R12, R12 + +prefetch_in_out_6: + PRFM (R12), PLDL1KEEP + PRFM 64(R12), PLDL1KEEP + MOVD 152(R0), R10 + ADD R10, R11, R11 + MOVD R11, 16(RSP) + +prefetch_skip_6: + MOVD 8(RSP), R10 + ADD $168, R0, R11 + CMP R10, R11 + BHS prefetch_skip_7 + MOVD 16(RSP), R11 + MOVD 168(R0), R10 + ADD R10, R11, R11 + MOVD R11, R12 + MOVD 184(R0), R10 + SUB R10, R12, R12 + MOVD 24(RSP), R10 + CMP R10, R12 + BHS prefetch_in_out_7 + MOVD 32(RSP), R10 + ADD R10, R12, R12 + +prefetch_in_out_7: + PRFM (R12), PLDL1KEEP + PRFM 64(R12), PLDL1KEEP + MOVD 176(R0), R10 + ADD R10, R11, R11 + MOVD R11, 16(RSP) + PCALIGN $0x40 + +prefetch_skip_7: main_loop: + MOVD 8(RSP), R10 + ADD $192, R0, R11 + CMP R10, R11 + BHS prefetch_skip_8 + MOVD 16(RSP), R11 + MOVD 192(R0), R10 + ADD R10, R11, R11 + MOVD R11, R12 + MOVD 208(R0), R10 + SUB R10, R12, R12 + MOVD 24(RSP), R10 + CMP R10, R12 + BHS prefetch_in_out_8 + MOVD 32(RSP), R10 + ADD R10, R12, R12 + +prefetch_in_out_8: + PRFM (R12), PLDL1KEEP + PRFM 64(R12), PLDL1KEEP + MOVD 200(R0), R10 + ADD R10, R11, R11 + MOVD R11, 16(RSP) + +prefetch_skip_8: MOVD (R0), R10 MOVD 16(R0), R11 MOVD 8(R0), R12 // Copy literals - TST R10, R10 - BEQ check_offset - MOVD $0, R13 + FMOVQ (R5), F0 + FMOVQ F0, (R3) + CMP $0x10, R10 + BLS copy_1_end + MOVD $0x00000010, R13 copy_1: - ADD R13, R5, R15 - VLD1 (R15), [V0.B16] - ADD R13, R3, R15 - VST1 [V0.B16], (R15) - ADD $0x10, R13, R13 - CMP R10, R13 - BLO copy_1 - ADD R10, R5, R5 - ADD R10, R3, R3 - ADD R10, R6, R6 + ADD R13, R5, R15 + FMOVQ (R15), F0 + ADD R13, R3, R15 + FMOVQ F0, (R15) + ADD $0x10, R13, R13 + CMP R10, R13 + BLO copy_1 + +copy_1_end: + ADD R10, R5, R5 + ADD R10, R3, R3 + ADD R10, R6, R6 // Malformed input if seq.mo > t+len(hist) || seq.mo > s.windowSize) -check_offset: ADD R9, R6, R10 CMP R10, R11 BGT error_match_off_too_big @@ -742,21 +929,19 @@ check_offset: BLO copy_4_small copy_4_loop: - VLD1 (R13), [V0.B16] - VST1 [V0.B16], (R3) - ADD $0x10, R13, R13 - ADD $0x10, R3, R3 - SUBS $0x10, R10, R10 - BHS copy_4_loop - ADD R10, R13, R13 - ADD $16, R13, R13 - ADD R10, R3, R3 - ADD $16, R3, R3 - ADD $-16, R13, R15 - VLD1 (R15), [V0.B16] - ADD $-16, R3, R15 - VST1 [V0.B16], (R15) - JMP copy_4_end + FMOVQ (R13), F0 + FMOVQ F0, (R3) + ADD $0x10, R13, R13 + ADD $0x10, R3, R3 + SUBS $0x10, R10, R10 + BHS copy_4_loop + ADD R10, R13, R13 + ADD $16, R13, R13 + ADD R10, R3, R3 + ADD $16, R3, R3 + FMOVQ -16(R13), F0 + FMOVQ F0, -16(R3) + JMP copy_4_end copy_4_small: CMP $0x03, R12 @@ -766,13 +951,14 @@ copy_4_small: JMP copy_4_move_8through16 copy_4_move_3: - MOVH (R13), R10 - MOVB 2(R13), R11 - MOVH R10, (R3) - MOVB R11, 2(R3) - ADD R12, R13, R13 - ADD R12, R3, R3 - JMP copy_4_end + MOVHU (R13), R10 + MOVBU 2(R13), R16 + BFI $0, R16, $8, R11 + MOVH R10, (R3) + MOVB R11, 2(R3) + ADD R12, R13, R13 + ADD R12, R3, R3 + JMP copy_4_end copy_4_move_4through7: MOVWU (R13), R10 @@ -809,21 +995,19 @@ copy_all_from_history: BLO copy_5_small copy_5_loop: - VLD1 (R13), [V0.B16] - VST1 [V0.B16], (R3) - ADD $0x10, R13, R13 - ADD $0x10, R3, R3 - SUBS $0x10, R14, R14 - BHS copy_5_loop - ADD R14, R13, R13 - ADD $16, R13, R13 - ADD R14, R3, R3 - ADD $16, R3, R3 - ADD $-16, R13, R15 - VLD1 (R15), [V0.B16] - ADD $-16, R3, R15 - VST1 [V0.B16], (R15) - JMP copy_5_end + FMOVQ (R13), F0 + FMOVQ F0, (R3) + ADD $0x10, R13, R13 + ADD $0x10, R3, R3 + SUBS $0x10, R14, R14 + BHS copy_5_loop + ADD R14, R13, R13 + ADD $16, R13, R13 + ADD R14, R3, R3 + ADD $16, R3, R3 + FMOVQ -16(R13), F0 + FMOVQ F0, -16(R3) + JMP copy_5_end copy_5_small: CMP $0x03, R10 @@ -834,24 +1018,27 @@ copy_5_small: JMP copy_5_move_8through16 copy_5_move_1or2: - MOVB (R13), R14 - ADD R10, R13, R15 - MOVB -1(R15), R4 - MOVB R14, (R3) - ADD R10, R3, R15 - MOVB R4, -1(R15) - ADD R10, R13, R13 - ADD R10, R3, R3 - JMP copy_5_end + MOVBU (R13), R16 + BFI $0, R16, $8, R14 + ADD R10, R13, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R4 + MOVB R14, (R3) + ADD R10, R3, R15 + MOVB R4, -1(R15) + ADD R10, R13, R13 + ADD R10, R3, R3 + JMP copy_5_end copy_5_move_3: - MOVH (R13), R14 - MOVB 2(R13), R4 - MOVH R14, (R3) - MOVB R4, 2(R3) - ADD R10, R13, R13 - ADD R10, R3, R3 - JMP copy_5_end + MOVHU (R13), R14 + MOVBU 2(R13), R16 + BFI $0, R16, $8, R4 + MOVH R14, (R3) + MOVB R4, 2(R3) + ADD R10, R13, R13 + ADD R10, R3, R3 + JMP copy_5_end copy_5_move_4through7: MOVWU (R13), R14 @@ -888,30 +1075,53 @@ copy_match: BHI copy_overlapping_match // Copy non-overlapping match - ADD R12, R6, R6 - MOVD R3, R11 - ADD R12, R3, R3 + ADD R12, R6, R6 + FMOVQ (R10), F0 + FMOVQ F0, (R3) + CMP $0x10, R12 + BHI copy_2_long + ADD R12, R3, R3 + JMP handle_loop + +copy_2_long: + ADD $16, R3, R11 + ADD R12, R3, R3 + ADD $0x10, R10, R10 + SUB $0x10, R12, R12 copy_2: - VLD1 (R10), [V0.B16] - VST1 [V0.B16], (R11) - ADD $0x10, R10, R10 - ADD $0x10, R11, R11 - SUBS $0x10, R12, R12 - BHI copy_2 - JMP handle_loop + FMOVQ (R10), F0 + FMOVQ F0, (R11) + ADD $0x10, R10, R10 + ADD $0x10, R11, R11 + SUBS $0x10, R12, R12 + BHI copy_2 + JMP handle_loop // Copy overlapping match copy_overlapping_match: - ADD R12, R6, R6 + ADD R12, R6, R6 + CMP $0x10, R11 + BLO copy_slow_3 + MOVD R3, R11 + ADD R12, R3, R3 + +copy_3: + FMOVQ (R10), F0 + FMOVQ F0, (R11) + ADD $0x10, R10, R10 + ADD $0x10, R11, R11 + SUBS $0x10, R12, R12 + BHI copy_3 + JMP handle_loop copy_slow_3: - MOVB (R10), R11 - MOVB R11, (R3) - ADD $1, R10, R10 - ADD $1, R3, R3 - SUBS $1, R12, R12 - BNE copy_slow_3 + MOVBU (R10), R11 + MOVB R11, (R3) + ADD $1, R10, R10 + ADD $1, R3, R3 + SUBS $1, R12, R12 + BNE copy_slow_3 handle_loop: ADD $0x18, R0, R0 @@ -954,13 +1164,25 @@ empty_seqs: RET // func sequenceDecs_executeSimple_safe_amd64(ctx *executeAsmContext) bool -// Requires: SSE -TEXT ·sequenceDecs_executeSimple_safe_arm64(SB), $8-9 +// Requires: MMX+, SSE +TEXT ·sequenceDecs_executeSimple_safe_arm64(SB), $32-9 MOVD ctx+0(FP), R9 MOVD 8(R9), R1 TST R1, R1 BEQ empty_seqs MOVD (R9), R0 + + // seqsEnd = seqsBase + 24 * len(seqs) if ctx.prefetch, else seqsBase (prefetch off) + MOVD R0, R2 + MOVBU 128(R9), R10 + TST R10, R10 + BEQ prefetch_off + ADD R1<<1, R1, R2 + LSL $0x03, R2, R2 + ADD R0, R2, R2 + +prefetch_off: + MOVD R2, 8(RSP) MOVD 24(R9), R2 MOVD 32(R9), R3 MOVD 80(R9), R5 @@ -976,9 +1198,234 @@ TEXT ·sequenceDecs_executeSimple_safe_arm64(SB), $8-9 ADD R10, R0, R0 // outBase += outPosition - ADD R6, R3, R3 - + ADD R6, R3, R3 + MOVD R3, 16(RSP) + MOVD R3, R10 + SUB R6, R10, R10 + MOVD R10, 24(RSP) + NEG R10, R10 + ADD R8, R10, R10 + MOVD R10, 32(RSP) + + // Prime the prefetch window + MOVD 8(RSP), R10 + MOVD R0, R11 + CMP R10, R11 + BHS prefetch_skip_0 + MOVD 16(RSP), R11 + MOVD (R0), R10 + ADD R10, R11, R11 + MOVD R11, R12 + MOVD 16(R0), R10 + SUB R10, R12, R12 + MOVD 24(RSP), R10 + CMP R10, R12 + BHS prefetch_in_out_0 + MOVD 32(RSP), R10 + ADD R10, R12, R12 + +prefetch_in_out_0: + PRFM (R12), PLDL1KEEP + PRFM 64(R12), PLDL1KEEP + MOVD 8(R0), R10 + ADD R10, R11, R11 + MOVD R11, 16(RSP) + +prefetch_skip_0: + MOVD 8(RSP), R10 + ADD $24, R0, R11 + CMP R10, R11 + BHS prefetch_skip_1 + MOVD 16(RSP), R11 + MOVD 24(R0), R10 + ADD R10, R11, R11 + MOVD R11, R12 + MOVD 40(R0), R10 + SUB R10, R12, R12 + MOVD 24(RSP), R10 + CMP R10, R12 + BHS prefetch_in_out_1 + MOVD 32(RSP), R10 + ADD R10, R12, R12 + +prefetch_in_out_1: + PRFM (R12), PLDL1KEEP + PRFM 64(R12), PLDL1KEEP + MOVD 32(R0), R10 + ADD R10, R11, R11 + MOVD R11, 16(RSP) + +prefetch_skip_1: + MOVD 8(RSP), R10 + ADD $48, R0, R11 + CMP R10, R11 + BHS prefetch_skip_2 + MOVD 16(RSP), R11 + MOVD 48(R0), R10 + ADD R10, R11, R11 + MOVD R11, R12 + MOVD 64(R0), R10 + SUB R10, R12, R12 + MOVD 24(RSP), R10 + CMP R10, R12 + BHS prefetch_in_out_2 + MOVD 32(RSP), R10 + ADD R10, R12, R12 + +prefetch_in_out_2: + PRFM (R12), PLDL1KEEP + PRFM 64(R12), PLDL1KEEP + MOVD 56(R0), R10 + ADD R10, R11, R11 + MOVD R11, 16(RSP) + +prefetch_skip_2: + MOVD 8(RSP), R10 + ADD $72, R0, R11 + CMP R10, R11 + BHS prefetch_skip_3 + MOVD 16(RSP), R11 + MOVD 72(R0), R10 + ADD R10, R11, R11 + MOVD R11, R12 + MOVD 88(R0), R10 + SUB R10, R12, R12 + MOVD 24(RSP), R10 + CMP R10, R12 + BHS prefetch_in_out_3 + MOVD 32(RSP), R10 + ADD R10, R12, R12 + +prefetch_in_out_3: + PRFM (R12), PLDL1KEEP + PRFM 64(R12), PLDL1KEEP + MOVD 80(R0), R10 + ADD R10, R11, R11 + MOVD R11, 16(RSP) + +prefetch_skip_3: + MOVD 8(RSP), R10 + ADD $96, R0, R11 + CMP R10, R11 + BHS prefetch_skip_4 + MOVD 16(RSP), R11 + MOVD 96(R0), R10 + ADD R10, R11, R11 + MOVD R11, R12 + MOVD 112(R0), R10 + SUB R10, R12, R12 + MOVD 24(RSP), R10 + CMP R10, R12 + BHS prefetch_in_out_4 + MOVD 32(RSP), R10 + ADD R10, R12, R12 + +prefetch_in_out_4: + PRFM (R12), PLDL1KEEP + PRFM 64(R12), PLDL1KEEP + MOVD 104(R0), R10 + ADD R10, R11, R11 + MOVD R11, 16(RSP) + +prefetch_skip_4: + MOVD 8(RSP), R10 + ADD $120, R0, R11 + CMP R10, R11 + BHS prefetch_skip_5 + MOVD 16(RSP), R11 + MOVD 120(R0), R10 + ADD R10, R11, R11 + MOVD R11, R12 + MOVD 136(R0), R10 + SUB R10, R12, R12 + MOVD 24(RSP), R10 + CMP R10, R12 + BHS prefetch_in_out_5 + MOVD 32(RSP), R10 + ADD R10, R12, R12 + +prefetch_in_out_5: + PRFM (R12), PLDL1KEEP + PRFM 64(R12), PLDL1KEEP + MOVD 128(R0), R10 + ADD R10, R11, R11 + MOVD R11, 16(RSP) + +prefetch_skip_5: + MOVD 8(RSP), R10 + ADD $144, R0, R11 + CMP R10, R11 + BHS prefetch_skip_6 + MOVD 16(RSP), R11 + MOVD 144(R0), R10 + ADD R10, R11, R11 + MOVD R11, R12 + MOVD 160(R0), R10 + SUB R10, R12, R12 + MOVD 24(RSP), R10 + CMP R10, R12 + BHS prefetch_in_out_6 + MOVD 32(RSP), R10 + ADD R10, R12, R12 + +prefetch_in_out_6: + PRFM (R12), PLDL1KEEP + PRFM 64(R12), PLDL1KEEP + MOVD 152(R0), R10 + ADD R10, R11, R11 + MOVD R11, 16(RSP) + +prefetch_skip_6: + MOVD 8(RSP), R10 + ADD $168, R0, R11 + CMP R10, R11 + BHS prefetch_skip_7 + MOVD 16(RSP), R11 + MOVD 168(R0), R10 + ADD R10, R11, R11 + MOVD R11, R12 + MOVD 184(R0), R10 + SUB R10, R12, R12 + MOVD 24(RSP), R10 + CMP R10, R12 + BHS prefetch_in_out_7 + MOVD 32(RSP), R10 + ADD R10, R12, R12 + +prefetch_in_out_7: + PRFM (R12), PLDL1KEEP + PRFM 64(R12), PLDL1KEEP + MOVD 176(R0), R10 + ADD R10, R11, R11 + MOVD R11, 16(RSP) + PCALIGN $0x40 + +prefetch_skip_7: main_loop: + MOVD 8(RSP), R10 + ADD $192, R0, R11 + CMP R10, R11 + BHS prefetch_skip_8 + MOVD 16(RSP), R11 + MOVD 192(R0), R10 + ADD R10, R11, R11 + MOVD R11, R12 + MOVD 208(R0), R10 + SUB R10, R12, R12 + MOVD 24(RSP), R10 + CMP R10, R12 + BHS prefetch_in_out_8 + MOVD 32(RSP), R10 + ADD R10, R12, R12 + +prefetch_in_out_8: + PRFM (R12), PLDL1KEEP + PRFM 64(R12), PLDL1KEEP + MOVD 200(R0), R10 + ADD R10, R11, R11 + MOVD R11, 16(RSP) + +prefetch_skip_8: MOVD (R0), R10 MOVD 16(R0), R11 MOVD 8(R0), R12 @@ -991,21 +1438,19 @@ main_loop: BLO copy_1_small copy_1_loop: - VLD1 (R5), [V0.B16] - VST1 [V0.B16], (R3) - ADD $0x10, R5, R5 - ADD $0x10, R3, R3 - SUBS $0x10, R13, R13 - BHS copy_1_loop - ADD R13, R5, R5 - ADD $16, R5, R5 - ADD R13, R3, R3 - ADD $16, R3, R3 - ADD $-16, R5, R15 - VLD1 (R15), [V0.B16] - ADD $-16, R3, R15 - VST1 [V0.B16], (R15) - JMP copy_1_end + FMOVQ (R5), F0 + FMOVQ F0, (R3) + ADD $0x10, R5, R5 + ADD $0x10, R3, R3 + SUBS $0x10, R13, R13 + BHS copy_1_loop + ADD R13, R5, R5 + ADD $16, R5, R5 + ADD R13, R3, R3 + ADD $16, R3, R3 + FMOVQ -16(R5), F0 + FMOVQ F0, -16(R3) + JMP copy_1_end copy_1_small: CMP $0x03, R10 @@ -1016,24 +1461,27 @@ copy_1_small: JMP copy_1_move_8through16 copy_1_move_1or2: - MOVB (R5), R13 - ADD R10, R5, R15 - MOVB -1(R15), R14 - MOVB R13, (R3) - ADD R10, R3, R15 - MOVB R14, -1(R15) - ADD R10, R5, R5 - ADD R10, R3, R3 - JMP copy_1_end + MOVBU (R5), R16 + BFI $0, R16, $8, R13 + ADD R10, R5, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R14 + MOVB R13, (R3) + ADD R10, R3, R15 + MOVB R14, -1(R15) + ADD R10, R5, R5 + ADD R10, R3, R3 + JMP copy_1_end copy_1_move_3: - MOVH (R5), R13 - MOVB 2(R5), R14 - MOVH R13, (R3) - MOVB R14, 2(R3) - ADD R10, R5, R5 - ADD R10, R3, R3 - JMP copy_1_end + MOVHU (R5), R13 + MOVBU 2(R5), R16 + BFI $0, R16, $8, R14 + MOVH R13, (R3) + MOVB R14, 2(R3) + ADD R10, R5, R5 + ADD R10, R3, R3 + JMP copy_1_end copy_1_move_4through7: MOVWU (R5), R13 @@ -1080,21 +1528,19 @@ check_offset: BLO copy_4_small copy_4_loop: - VLD1 (R13), [V0.B16] - VST1 [V0.B16], (R3) - ADD $0x10, R13, R13 - ADD $0x10, R3, R3 - SUBS $0x10, R10, R10 - BHS copy_4_loop - ADD R10, R13, R13 - ADD $16, R13, R13 - ADD R10, R3, R3 - ADD $16, R3, R3 - ADD $-16, R13, R15 - VLD1 (R15), [V0.B16] - ADD $-16, R3, R15 - VST1 [V0.B16], (R15) - JMP copy_4_end + FMOVQ (R13), F0 + FMOVQ F0, (R3) + ADD $0x10, R13, R13 + ADD $0x10, R3, R3 + SUBS $0x10, R10, R10 + BHS copy_4_loop + ADD R10, R13, R13 + ADD $16, R13, R13 + ADD R10, R3, R3 + ADD $16, R3, R3 + FMOVQ -16(R13), F0 + FMOVQ F0, -16(R3) + JMP copy_4_end copy_4_small: CMP $0x03, R12 @@ -1104,13 +1550,14 @@ copy_4_small: JMP copy_4_move_8through16 copy_4_move_3: - MOVH (R13), R10 - MOVB 2(R13), R11 - MOVH R10, (R3) - MOVB R11, 2(R3) - ADD R12, R13, R13 - ADD R12, R3, R3 - JMP copy_4_end + MOVHU (R13), R10 + MOVBU 2(R13), R16 + BFI $0, R16, $8, R11 + MOVH R10, (R3) + MOVB R11, 2(R3) + ADD R12, R13, R13 + ADD R12, R3, R3 + JMP copy_4_end copy_4_move_4through7: MOVWU (R13), R10 @@ -1147,21 +1594,19 @@ copy_all_from_history: BLO copy_5_small copy_5_loop: - VLD1 (R13), [V0.B16] - VST1 [V0.B16], (R3) - ADD $0x10, R13, R13 - ADD $0x10, R3, R3 - SUBS $0x10, R14, R14 - BHS copy_5_loop - ADD R14, R13, R13 - ADD $16, R13, R13 - ADD R14, R3, R3 - ADD $16, R3, R3 - ADD $-16, R13, R15 - VLD1 (R15), [V0.B16] - ADD $-16, R3, R15 - VST1 [V0.B16], (R15) - JMP copy_5_end + FMOVQ (R13), F0 + FMOVQ F0, (R3) + ADD $0x10, R13, R13 + ADD $0x10, R3, R3 + SUBS $0x10, R14, R14 + BHS copy_5_loop + ADD R14, R13, R13 + ADD $16, R13, R13 + ADD R14, R3, R3 + ADD $16, R3, R3 + FMOVQ -16(R13), F0 + FMOVQ F0, -16(R3) + JMP copy_5_end copy_5_small: CMP $0x03, R10 @@ -1172,24 +1617,27 @@ copy_5_small: JMP copy_5_move_8through16 copy_5_move_1or2: - MOVB (R13), R14 - ADD R10, R13, R15 - MOVB -1(R15), R4 - MOVB R14, (R3) - ADD R10, R3, R15 - MOVB R4, -1(R15) - ADD R10, R13, R13 - ADD R10, R3, R3 - JMP copy_5_end + MOVBU (R13), R16 + BFI $0, R16, $8, R14 + ADD R10, R13, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R4 + MOVB R14, (R3) + ADD R10, R3, R15 + MOVB R4, -1(R15) + ADD R10, R13, R13 + ADD R10, R3, R3 + JMP copy_5_end copy_5_move_3: - MOVH (R13), R14 - MOVB 2(R13), R4 - MOVH R14, (R3) - MOVB R4, 2(R3) - ADD R10, R13, R13 - ADD R10, R3, R3 - JMP copy_5_end + MOVHU (R13), R14 + MOVBU 2(R13), R16 + BFI $0, R16, $8, R4 + MOVH R14, (R3) + MOVB R4, 2(R3) + ADD R10, R13, R13 + ADD R10, R3, R3 + JMP copy_5_end copy_5_move_4through7: MOVWU (R13), R14 @@ -1232,21 +1680,19 @@ copy_match: BLO copy_2_small copy_2_loop: - VLD1 (R10), [V0.B16] - VST1 [V0.B16], (R3) - ADD $0x10, R10, R10 - ADD $0x10, R3, R3 - SUBS $0x10, R11, R11 - BHS copy_2_loop - ADD R11, R10, R10 - ADD $16, R10, R10 - ADD R11, R3, R3 - ADD $16, R3, R3 - ADD $-16, R10, R15 - VLD1 (R15), [V0.B16] - ADD $-16, R3, R15 - VST1 [V0.B16], (R15) - JMP copy_2_end + FMOVQ (R10), F0 + FMOVQ F0, (R3) + ADD $0x10, R10, R10 + ADD $0x10, R3, R3 + SUBS $0x10, R11, R11 + BHS copy_2_loop + ADD R11, R10, R10 + ADD $16, R10, R10 + ADD R11, R3, R3 + ADD $16, R3, R3 + FMOVQ -16(R10), F0 + FMOVQ F0, -16(R3) + JMP copy_2_end copy_2_small: CMP $0x03, R12 @@ -1257,24 +1703,27 @@ copy_2_small: JMP copy_2_move_8through16 copy_2_move_1or2: - MOVB (R10), R11 - ADD R12, R10, R15 - MOVB -1(R15), R13 - MOVB R11, (R3) - ADD R12, R3, R15 - MOVB R13, -1(R15) - ADD R12, R10, R10 - ADD R12, R3, R3 - JMP copy_2_end + MOVBU (R10), R16 + BFI $0, R16, $8, R11 + ADD R12, R10, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R13 + MOVB R11, (R3) + ADD R12, R3, R15 + MOVB R13, -1(R15) + ADD R12, R10, R10 + ADD R12, R3, R3 + JMP copy_2_end copy_2_move_3: - MOVH (R10), R11 - MOVB 2(R10), R13 - MOVH R11, (R3) - MOVB R13, 2(R3) - ADD R12, R10, R10 - ADD R12, R3, R3 - JMP copy_2_end + MOVHU (R10), R11 + MOVBU 2(R10), R16 + BFI $0, R16, $8, R13 + MOVH R11, (R3) + MOVB R13, 2(R3) + ADD R12, R10, R10 + ADD R12, R3, R3 + JMP copy_2_end copy_2_move_4through7: MOVWU (R10), R11 @@ -1303,14 +1752,27 @@ copy_2_end: // Copy overlapping match copy_overlapping_match: ADD R12, R6, R6 + CMP $0x10, R11 + BLO copy_slow_3 + +copy_3_blocks: + FMOVQ (R10), F0 + FMOVQ F0, (R3) + ADD $0x10, R10, R10 + ADD $0x10, R3, R3 + SUB $0x10, R12, R12 + CMP $0x10, R12 + BHS copy_3_blocks + TST R12, R12 + BEQ handle_loop copy_slow_3: - MOVB (R10), R11 - MOVB R11, (R3) - ADD $1, R10, R10 - ADD $1, R3, R3 - SUBS $1, R12, R12 - BNE copy_slow_3 + MOVBU (R10), R11 + MOVB R11, (R3) + ADD $1, R10, R10 + ADD $1, R3, R3 + SUBS $1, R12, R12 + BNE copy_slow_3 handle_loop: ADD $0x18, R0, R0 @@ -1354,54 +1816,62 @@ empty_seqs: // func sequenceDecs_decodeSync_amd64(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int // Requires: CMOV, SSE -TEXT ·sequenceDecs_decodeSync_arm64(SB), $64-32 +TEXT ·sequenceDecs_decodeSync_arm64(SB), $96-32 MOVD br+8(FP), R1 MOVD 24(R1), R2 MOVBU 40(R1), R3 MOVD (R1), R0 MOVD 32(R1), R5 ADD R5, R0, R0 - MOVD R0, (RSP) + MOVD R0, 8(RSP) MOVD ctx+16(FP), R0 MOVD 72(R0), R6 MOVD 80(R0), R7 MOVD 88(R0), R8 - MOVD $0, R1 - MOVD R1, 8(RSP) + MOVD (R0), R1 MOVD R1, 16(RSP) + MOVD 24(R0), R1 MOVD R1, 24(RSP) + MOVD 48(R0), R1 + MOVD R1, 32(RSP) + MOVD 96(R0), R1 + MOVD R1, 40(RSP) + MOVD $0, R1 + MOVD R1, 48(RSP) + MOVD R1, 56(RSP) + MOVD R1, 64(RSP) MOVD 112(R0), R9 MOVD 128(R0), R1 - MOVD R1, 32(RSP) + MOVD R1, 72(RSP) MOVD 144(R0), R10 MOVD 136(R0), R11 MOVD 200(R0), R1 - MOVD R1, 56(RSP) + MOVD R1, 96(RSP) MOVD 176(R0), R1 - MOVD R1, 48(RSP) + MOVD R1, 88(RSP) MOVD 184(R0), R0 - MOVD R0, 40(RSP) - MOVD 40(RSP), R0 - MOVD 48(RSP), R16 + MOVD R0, 80(RSP) + MOVD 80(RSP), R0 + MOVD 88(RSP), R16 ADD R0, R16, R16 - MOVD R16, 48(RSP) + MOVD R16, 88(RSP) // Calculate pointer to s.out[cap(s.out)] (a past-end pointer) - MOVD 32(RSP), R16 + MOVD 72(RSP), R16 ADD R9, R16, R16 - MOVD R16, 32(RSP) + MOVD R16, 72(RSP) // outBase += outPosition - ADD R11, R9, R9 + ADD R11, R9, R9 + PCALIGN $0x40 sequenceDecs_decodeSync_amd64_main_loop: - MOVD (RSP), R12 + MOVD 8(RSP), R12 // Fill bitreader to have enough for the offset and match length. CMP $0x08, R5 BLT sequenceDecs_decodeSync_amd64_fill_byte_by_byte - MOVD R3, R0 - LSR $0x03, R0, R0 + LSR $0x03, R3, R0 SUB R0, R12, R12 MOVD (R12), R2 SUB R0, R5, R5 @@ -1428,51 +1898,32 @@ sequenceDecs_decodeSync_amd64_fill_check_overread: sequenceDecs_decodeSync_amd64_fill_end: // Update offset MOVD R8, R0 - MOVD R3, R1 - MOVD R2, R13 - LSL R1, R13, R13 + LSL R3, R2, R13 + LSR $0x01, R13, R13 UBFX $8, R0, $8, R1 LSR $0x20, R0, R0 - TST R1, R1 - BEQ sequenceDecs_decodeSync_amd64_of_update_zero ADD R1, R3, R3 - CMP $0x40, R3 - BHI sequenceDecs_decodeSync_amd64_of_update_zero - CMP $0x40, R1 - BHS sequenceDecs_decodeSync_amd64_of_update_zero - NEG R1, R1 + EOR $0x3f, R1, R1 LSR R1, R13, R13 ADD R13, R0, R0 - -sequenceDecs_decodeSync_amd64_of_update_zero: - MOVD R0, 8(RSP) + MOVD R0, 48(RSP) // Update match length MOVD R7, R0 - MOVD R3, R1 - MOVD R2, R13 - LSL R1, R13, R13 + LSL R3, R2, R13 + LSR $0x01, R13, R13 UBFX $8, R0, $8, R1 LSR $0x20, R0, R0 - TST R1, R1 - BEQ sequenceDecs_decodeSync_amd64_ml_update_zero ADD R1, R3, R3 - CMP $0x40, R3 - BHI sequenceDecs_decodeSync_amd64_ml_update_zero - CMP $0x40, R1 - BHS sequenceDecs_decodeSync_amd64_ml_update_zero - NEG R1, R1 + EOR $0x3f, R1, R1 LSR R1, R13, R13 ADD R13, R0, R0 - -sequenceDecs_decodeSync_amd64_ml_update_zero: - MOVD R0, 16(RSP) + MOVD R0, 56(RSP) // Fill bitreader to have enough for the remaining CMP $0x08, R5 BLT sequenceDecs_decodeSync_amd64_fill_2_byte_by_byte - MOVD R3, R0 - LSR $0x03, R0, R0 + LSR $0x03, R3, R0 SUB R0, R12, R12 MOVD (R12), R2 SUB R0, R5, R5 @@ -1499,113 +1950,78 @@ sequenceDecs_decodeSync_amd64_fill_2_check_overread: sequenceDecs_decodeSync_amd64_fill_2_end: // Update literal length MOVD R6, R0 - MOVD R3, R1 - MOVD R2, R13 - LSL R1, R13, R13 + LSL R3, R2, R13 + LSR $0x01, R13, R13 UBFX $8, R0, $8, R1 LSR $0x20, R0, R0 - TST R1, R1 - BEQ sequenceDecs_decodeSync_amd64_ll_update_zero ADD R1, R3, R3 - CMP $0x40, R3 - BHI sequenceDecs_decodeSync_amd64_ll_update_zero - CMP $0x40, R1 - BHS sequenceDecs_decodeSync_amd64_ll_update_zero - NEG R1, R1 + EOR $0x3f, R1, R1 LSR R1, R13, R13 ADD R13, R0, R0 - -sequenceDecs_decodeSync_amd64_ll_update_zero: - MOVD R0, 24(RSP) + MOVD R0, 64(RSP) // Fill bitreader for state updates - MOVD R12, (RSP) - MOVD R8, R0 - LSR $0x08, R0, R0 - MOVBU R0, R0 - MOVD ctx+16(FP), R1 - MOVD 96(R1), R16 - CMP $0x00, R16 - BEQ sequenceDecs_decodeSync_amd64_skip_update + MOVD R12, 8(RSP) + UBFX $8, R8, $8, R0 + MOVD 40(RSP), R16 + CMP $0x00, R16 + BEQ sequenceDecs_decodeSync_amd64_skip_update // Update Literal Length State MOVBU R6, R12 LSRW $0x10, R6, R6 - ADD R12, R3, R1 - MOVD R2, R13 - MOVD R1, R3 - NEG R1, R16 - ROR R16, R13, R13 - MOVD $0x00000001, R14 - MOVB R12, R1 - LSLW R1, R14, R14 - SUBW $1, R14, R14 - AND R14, R13, R13 + LSL R3, R2, R13 + LSR $0x01, R13, R13 + ADD R12, R3, R3 + EOR $0x3f, R12, R12 + LSR R12, R13, R13 ADD R13, R6, R6 // Load ctx.llTable - MOVD ctx+16(FP), R1 - MOVD (R1), R1 - ADD R6<<3, R1, R15 - MOVD (R15), R6 + MOVD 16(RSP), R1 + MOVD (R1)(R6<<3), R6 // Update Match Length State MOVBU R7, R12 LSRW $0x10, R7, R7 - ADD R12, R3, R1 - MOVD R2, R13 - MOVD R1, R3 - NEG R1, R16 - ROR R16, R13, R13 - MOVD $0x00000001, R14 - MOVB R12, R1 - LSLW R1, R14, R14 - SUBW $1, R14, R14 - AND R14, R13, R13 + LSL R3, R2, R13 + LSR $0x01, R13, R13 + ADD R12, R3, R3 + EOR $0x3f, R12, R12 + LSR R12, R13, R13 ADD R13, R7, R7 // Load ctx.mlTable - MOVD ctx+16(FP), R1 - MOVD 24(R1), R1 - ADD R7<<3, R1, R15 - MOVD (R15), R7 + MOVD 24(RSP), R1 + MOVD (R1)(R7<<3), R7 // Update Offset State MOVBU R8, R12 LSRW $0x10, R8, R8 - ADD R12, R3, R1 - MOVD R2, R13 - MOVD R1, R3 - NEG R1, R16 - ROR R16, R13, R13 - MOVD $0x00000001, R14 - MOVB R12, R1 - LSLW R1, R14, R14 - SUBW $1, R14, R14 - AND R14, R13, R13 + LSL R3, R2, R13 + LSR $0x01, R13, R13 + ADD R12, R3, R3 + EOR $0x3f, R12, R12 + LSR R12, R13, R13 ADD R13, R8, R8 // Load ctx.ofTable - MOVD ctx+16(FP), R1 - MOVD 48(R1), R1 - ADD R8<<3, R1, R15 - MOVD (R15), R8 + MOVD 32(RSP), R1 + MOVD (R1)(R8<<3), R8 sequenceDecs_decodeSync_amd64_skip_update: // Adjust offset - MOVD s+0(FP), R1 - MOVD 8(RSP), R12 - CMP $0x01, R0 - BLS sequenceDecs_decodeSync_amd64_adjust_offsetB_1_or_0 - ADD $144, R1, R15 - VLD1 (R15), [V0.B16] - MOVD R12, 144(R1) - ADD $152, R1, R15 - VST1 [V0.B16], (R15) - JMP sequenceDecs_decodeSync_amd64_after_adjust + MOVD s+0(FP), R1 + MOVD 48(RSP), R12 + CMP $0x01, R0 + BLS sequenceDecs_decodeSync_amd64_adjust_offsetB_1_or_0 + FMOVQ 144(R1), F0 + MOVD R12, 144(R1) + FMOVQ F0, 152(R1) + JMP sequenceDecs_decodeSync_amd64_after_adjust sequenceDecs_decodeSync_amd64_adjust_offsetB_1_or_0: - MOVD 24(RSP), R16 + MOVD 64(RSP), R16 CMP $0x00000000, R16 BNE sequenceDecs_decodeSync_amd64_adjust_offset_maybezero ADD $1, R12, R12 @@ -1643,16 +2059,11 @@ sequenceDecs_decodeSync_amd64_adjust_skip: MOVD R13, R12 sequenceDecs_decodeSync_amd64_after_adjust: - MOVD R12, 8(RSP) + MOVD R12, 48(RSP) // Check values - MOVD 16(RSP), R0 - MOVD 24(RSP), R1 - ADD R1, R0, R13 - MOVD s+0(FP), R14 - MOVD 256(R14), R16 - ADD R13, R16, R16 - MOVD R16, 256(R14) + MOVD 56(RSP), R0 + MOVD 64(RSP), R1 MOVD ctx+16(FP), R13 MOVD 104(R13), R16 SUBS R1, R16, R16 @@ -1666,231 +2077,253 @@ sequenceDecs_decodeSync_amd64_after_adjust: BNE sequenceDecs_decodeSync_amd64_error_match_len_ofs_mismatch sequenceDecs_decodeSync_amd64_match_len_ofs_ok: - MOVD 24(RSP), R0 - MOVD 8(RSP), R1 - MOVD 16(RSP), R12 - // Check if we have enough space in s.out - ADD R12, R0, R13 + ADD R0, R1, R13 + ADD $16, R13, R13 ADD R9, R13, R13 - MOVD 32(RSP), R16 + MOVD 72(RSP), R16 CMP R16, R13 BHI error_not_enough_space // Copy literals - TST R0, R0 - BEQ check_offset - MOVD $0, R13 + FMOVQ (R10), F0 + FMOVQ F0, (R9) + CMP $0x10, R1 + BLS copy_1_end + MOVD $0x00000010, R13 copy_1: - ADD R13, R10, R15 - VLD1 (R15), [V0.B16] - ADD R13, R9, R15 - VST1 [V0.B16], (R15) - ADD $0x10, R13, R13 - CMP R0, R13 - BLO copy_1 - ADD R0, R10, R10 - ADD R0, R9, R9 - ADD R0, R11, R11 + ADD R13, R10, R15 + FMOVQ (R15), F0 + ADD R13, R9, R15 + FMOVQ F0, (R15) + ADD $0x10, R13, R13 + CMP R1, R13 + BLO copy_1 + +copy_1_end: + ADD R1, R10, R10 + ADD R1, R9, R9 + ADD R1, R11, R11 // Malformed input if seq.mo > t+len(hist) || seq.mo > s.windowSize) -check_offset: - MOVD R11, R0 - MOVD 40(RSP), R16 - ADD R16, R0, R0 - CMP R0, R1 + MOVD R11, R1 + MOVD 80(RSP), R16 + ADD R16, R1, R1 + CMP R1, R12 BGT error_match_off_too_big - MOVD 56(RSP), R16 - CMP R16, R1 + MOVD 96(RSP), R16 + CMP R16, R12 BGT error_match_off_too_big // Copy match from history - MOVD R1, R0 - SUBS R11, R0, R0 + MOVD R12, R1 + SUBS R11, R1, R1 BLS copy_match - MOVD 48(RSP), R13 - SUB R0, R13, R13 - CMP R0, R12 + MOVD 88(RSP), R13 + SUB R1, R13, R13 + CMP R1, R0 BGT copy_all_from_history - MOVD R12, R0 - SUBS $0x10, R0, R0 + MOVD R0, R1 + SUBS $0x10, R1, R1 BLO copy_4_small copy_4_loop: - VLD1 (R13), [V0.B16] - VST1 [V0.B16], (R9) - ADD $0x10, R13, R13 - ADD $0x10, R9, R9 - SUBS $0x10, R0, R0 - BHS copy_4_loop - ADD R0, R13, R13 - ADD $16, R13, R13 - ADD R0, R9, R9 - ADD $16, R9, R9 - ADD $-16, R13, R15 - VLD1 (R15), [V0.B16] - ADD $-16, R9, R15 - VST1 [V0.B16], (R15) - JMP copy_4_end + FMOVQ (R13), F0 + FMOVQ F0, (R9) + ADD $0x10, R13, R13 + ADD $0x10, R9, R9 + SUBS $0x10, R1, R1 + BHS copy_4_loop + ADD R1, R13, R13 + ADD $16, R13, R13 + ADD R1, R9, R9 + ADD $16, R9, R9 + FMOVQ -16(R13), F0 + FMOVQ F0, -16(R9) + JMP copy_4_end copy_4_small: - CMP $0x03, R12 + CMP $0x03, R0 BEQ copy_4_move_3 - CMP $0x08, R12 + CMP $0x08, R0 BLO copy_4_move_4through7 JMP copy_4_move_8through16 copy_4_move_3: - MOVH (R13), R0 - MOVB 2(R13), R1 - MOVH R0, (R9) - MOVB R1, 2(R9) - ADD R12, R13, R13 - ADD R12, R9, R9 - JMP copy_4_end + MOVHU (R13), R1 + MOVBU 2(R13), R16 + BFI $0, R16, $8, R12 + MOVH R1, (R9) + MOVB R12, 2(R9) + ADD R0, R13, R13 + ADD R0, R9, R9 + JMP copy_4_end copy_4_move_4through7: - MOVWU (R13), R0 - ADD R12, R13, R15 - MOVWU -4(R15), R1 - MOVW R0, (R9) - ADD R12, R9, R15 - MOVW R1, -4(R15) - ADD R12, R13, R13 - ADD R12, R9, R9 + MOVWU (R13), R1 + ADD R0, R13, R15 + MOVWU -4(R15), R12 + MOVW R1, (R9) + ADD R0, R9, R15 + MOVW R12, -4(R15) + ADD R0, R13, R13 + ADD R0, R9, R9 JMP copy_4_end copy_4_move_8through16: - MOVD (R13), R0 - ADD R12, R13, R15 - MOVD -8(R15), R1 - MOVD R0, (R9) - ADD R12, R9, R15 - MOVD R1, -8(R15) - ADD R12, R13, R13 - ADD R12, R9, R9 + MOVD (R13), R1 + ADD R0, R13, R15 + MOVD -8(R15), R12 + MOVD R1, (R9) + ADD R0, R9, R15 + MOVD R12, -8(R15) + ADD R0, R13, R13 + ADD R0, R9, R9 copy_4_end: - ADD R12, R11, R11 + ADD R0, R11, R11 JMP handle_loop JMP loop_finished copy_all_from_history: - MOVD R0, R14 + MOVD R1, R14 SUBS $0x10, R14, R14 BLO copy_5_small copy_5_loop: - VLD1 (R13), [V0.B16] - VST1 [V0.B16], (R9) - ADD $0x10, R13, R13 - ADD $0x10, R9, R9 - SUBS $0x10, R14, R14 - BHS copy_5_loop - ADD R14, R13, R13 - ADD $16, R13, R13 - ADD R14, R9, R9 - ADD $16, R9, R9 - ADD $-16, R13, R15 - VLD1 (R15), [V0.B16] - ADD $-16, R9, R15 - VST1 [V0.B16], (R15) - JMP copy_5_end + FMOVQ (R13), F0 + FMOVQ F0, (R9) + ADD $0x10, R13, R13 + ADD $0x10, R9, R9 + SUBS $0x10, R14, R14 + BHS copy_5_loop + ADD R14, R13, R13 + ADD $16, R13, R13 + ADD R14, R9, R9 + ADD $16, R9, R9 + FMOVQ -16(R13), F0 + FMOVQ F0, -16(R9) + JMP copy_5_end copy_5_small: - CMP $0x03, R0 + CMP $0x03, R1 BEQ copy_5_move_3 BLO copy_5_move_1or2 - CMP $0x08, R0 + CMP $0x08, R1 BLO copy_5_move_4through7 JMP copy_5_move_8through16 copy_5_move_1or2: - MOVB (R13), R14 - ADD R0, R13, R15 - MOVB -1(R15), R4 - MOVB R14, (R9) - ADD R0, R9, R15 - MOVB R4, -1(R15) - ADD R0, R13, R13 - ADD R0, R9, R9 - JMP copy_5_end + MOVBU (R13), R16 + BFI $0, R16, $8, R14 + ADD R1, R13, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R4 + MOVB R14, (R9) + ADD R1, R9, R15 + MOVB R4, -1(R15) + ADD R1, R13, R13 + ADD R1, R9, R9 + JMP copy_5_end copy_5_move_3: - MOVH (R13), R14 - MOVB 2(R13), R4 - MOVH R14, (R9) - MOVB R4, 2(R9) - ADD R0, R13, R13 - ADD R0, R9, R9 - JMP copy_5_end + MOVHU (R13), R14 + MOVBU 2(R13), R16 + BFI $0, R16, $8, R4 + MOVH R14, (R9) + MOVB R4, 2(R9) + ADD R1, R13, R13 + ADD R1, R9, R9 + JMP copy_5_end copy_5_move_4through7: MOVWU (R13), R14 - ADD R0, R13, R15 + ADD R1, R13, R15 MOVWU -4(R15), R4 MOVW R14, (R9) - ADD R0, R9, R15 + ADD R1, R9, R15 MOVW R4, -4(R15) - ADD R0, R13, R13 - ADD R0, R9, R9 + ADD R1, R13, R13 + ADD R1, R9, R9 JMP copy_5_end copy_5_move_8through16: MOVD (R13), R14 - ADD R0, R13, R15 + ADD R1, R13, R15 MOVD -8(R15), R4 MOVD R14, (R9) - ADD R0, R9, R15 + ADD R1, R9, R15 MOVD R4, -8(R15) - ADD R0, R13, R13 - ADD R0, R9, R9 + ADD R1, R13, R13 + ADD R1, R9, R9 copy_5_end: - ADD R0, R11, R11 - SUB R0, R12, R12 + ADD R1, R11, R11 + SUB R1, R0, R0 // Copy match from the current buffer copy_match: - MOVD R9, R0 - SUB R1, R0, R0 + MOVD R9, R1 + SUB R12, R1, R1 // ml <= mo - CMP R1, R12 + CMP R12, R0 BHI copy_overlapping_match // Copy non-overlapping match - ADD R12, R11, R11 - MOVD R9, R1 - ADD R12, R9, R9 + ADD R0, R11, R11 + FMOVQ (R1), F0 + FMOVQ F0, (R9) + CMP $0x10, R0 + BHI copy_2_long + ADD R0, R9, R9 + JMP handle_loop + +copy_2_long: + ADD $16, R9, R12 + ADD R0, R9, R9 + ADD $0x10, R1, R1 + SUB $0x10, R0, R0 copy_2: - VLD1 (R0), [V0.B16] - VST1 [V0.B16], (R1) - ADD $0x10, R0, R0 - ADD $0x10, R1, R1 - SUBS $0x10, R12, R12 - BHI copy_2 - JMP handle_loop + FMOVQ (R1), F0 + FMOVQ F0, (R12) + ADD $0x10, R1, R1 + ADD $0x10, R12, R12 + SUBS $0x10, R0, R0 + BHI copy_2 + JMP handle_loop // Copy overlapping match copy_overlapping_match: - ADD R12, R11, R11 + ADD R0, R11, R11 + CMP $0x10, R12 + BLO copy_slow_3 + MOVD R9, R12 + ADD R0, R9, R9 + +copy_3: + FMOVQ (R1), F0 + FMOVQ F0, (R12) + ADD $0x10, R1, R1 + ADD $0x10, R12, R12 + SUBS $0x10, R0, R0 + BHI copy_3 + JMP handle_loop copy_slow_3: - MOVB (R0), R1 - MOVB R1, (R9) - ADD $1, R0, R0 - ADD $1, R9, R9 - SUBS $1, R12, R12 - BNE copy_slow_3 + MOVBU (R1), R12 + MOVB R12, (R9) + ADD $1, R1, R1 + ADD $1, R9, R9 + SUBS $1, R0, R0 + BNE copy_slow_3 handle_loop: - MOVD ctx+16(FP), R0 - MOVD 96(R0), R16 + MOVD 40(RSP), R16 SUBS $1, R16, R16 - MOVD R16, 96(R0) + MOVD R16, 40(RSP) BPL sequenceDecs_decodeSync_amd64_main_loop loop_finished: @@ -1899,6 +2332,16 @@ loop_finished: MOVB R3, 40(R0) MOVD R5, 32(R0) + // s.seqSize += outPosition - ctx.outPosition + MOVD ctx+16(FP), R0 + MOVD s+0(FP), R1 + MOVD R11, R2 + MOVD 136(R0), R16 + SUB R16, R2, R2 + MOVD 256(R1), R16 + ADD R2, R16, R16 + MOVD R16, 256(R1) + // Update the context MOVD ctx+16(FP), R0 MOVD R11, 136(R0) @@ -1913,7 +2356,7 @@ loop_finished: // Return with match length error sequenceDecs_decodeSync_amd64_error_match_len_ofs_mismatch: - MOVD 16(RSP), R0 + MOVD 56(RSP), R0 MOVD ctx+16(FP), R1 MOVD R0, 216(R1) MOVD $0x00000001, R16 @@ -1923,7 +2366,7 @@ sequenceDecs_decodeSync_amd64_error_match_len_ofs_mismatch: // Return with match too long error sequenceDecs_decodeSync_amd64_error_match_len_too_big: MOVD ctx+16(FP), R0 - MOVD 16(RSP), R1 + MOVD 56(RSP), R1 MOVD R1, 216(R0) MOVD $0x00000002, R16 MOVD R16, ret+24(FP) @@ -1932,7 +2375,7 @@ sequenceDecs_decodeSync_amd64_error_match_len_too_big: // Return with match offset too long error error_match_off_too_big: MOVD ctx+16(FP), R0 - MOVD 8(RSP), R1 + MOVD 48(RSP), R1 MOVD R1, 224(R0) MOVD R11, 136(R0) MOVD $0x00000003, R16 @@ -1942,7 +2385,7 @@ error_match_off_too_big: // Return with not enough literals error error_not_enough_literals: MOVD ctx+16(FP), R0 - MOVD 24(RSP), R1 + MOVD 64(RSP), R1 MOVD R1, 208(R0) MOVD $0x00000004, R16 MOVD R16, ret+24(FP) @@ -1957,9 +2400,9 @@ error_overread: // Return with not enough output space error error_not_enough_space: MOVD ctx+16(FP), R0 - MOVD 24(RSP), R1 + MOVD 64(RSP), R1 MOVD R1, 208(R0) - MOVD 16(RSP), R1 + MOVD 56(RSP), R1 MOVD R1, 216(R0) MOVD R11, 136(R0) MOVD $0x00000005, R16 @@ -1970,54 +2413,62 @@ error_not_enough_space: // func sequenceDecs_decodeSync_safe_amd64(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int // Requires: CMOV, SSE -TEXT ·sequenceDecs_decodeSync_safe_arm64(SB), $64-32 +TEXT ·sequenceDecs_decodeSync_safe_arm64(SB), $96-32 MOVD br+8(FP), R1 MOVD 24(R1), R2 MOVBU 40(R1), R3 MOVD (R1), R0 MOVD 32(R1), R5 ADD R5, R0, R0 - MOVD R0, (RSP) + MOVD R0, 8(RSP) MOVD ctx+16(FP), R0 MOVD 72(R0), R6 MOVD 80(R0), R7 MOVD 88(R0), R8 - MOVD $0, R1 - MOVD R1, 8(RSP) + MOVD (R0), R1 MOVD R1, 16(RSP) + MOVD 24(R0), R1 MOVD R1, 24(RSP) + MOVD 48(R0), R1 + MOVD R1, 32(RSP) + MOVD 96(R0), R1 + MOVD R1, 40(RSP) + MOVD $0, R1 + MOVD R1, 48(RSP) + MOVD R1, 56(RSP) + MOVD R1, 64(RSP) MOVD 112(R0), R9 MOVD 128(R0), R1 - MOVD R1, 32(RSP) + MOVD R1, 72(RSP) MOVD 144(R0), R10 MOVD 136(R0), R11 MOVD 200(R0), R1 - MOVD R1, 56(RSP) + MOVD R1, 96(RSP) MOVD 176(R0), R1 - MOVD R1, 48(RSP) + MOVD R1, 88(RSP) MOVD 184(R0), R0 - MOVD R0, 40(RSP) - MOVD 40(RSP), R0 - MOVD 48(RSP), R16 + MOVD R0, 80(RSP) + MOVD 80(RSP), R0 + MOVD 88(RSP), R16 ADD R0, R16, R16 - MOVD R16, 48(RSP) + MOVD R16, 88(RSP) // Calculate pointer to s.out[cap(s.out)] (a past-end pointer) - MOVD 32(RSP), R16 + MOVD 72(RSP), R16 ADD R9, R16, R16 - MOVD R16, 32(RSP) + MOVD R16, 72(RSP) // outBase += outPosition - ADD R11, R9, R9 + ADD R11, R9, R9 + PCALIGN $0x40 sequenceDecs_decodeSync_safe_amd64_main_loop: - MOVD (RSP), R12 + MOVD 8(RSP), R12 // Fill bitreader to have enough for the offset and match length. CMP $0x08, R5 BLT sequenceDecs_decodeSync_safe_amd64_fill_byte_by_byte - MOVD R3, R0 - LSR $0x03, R0, R0 + LSR $0x03, R3, R0 SUB R0, R12, R12 MOVD (R12), R2 SUB R0, R5, R5 @@ -2044,51 +2495,32 @@ sequenceDecs_decodeSync_safe_amd64_fill_check_overread: sequenceDecs_decodeSync_safe_amd64_fill_end: // Update offset MOVD R8, R0 - MOVD R3, R1 - MOVD R2, R13 - LSL R1, R13, R13 + LSL R3, R2, R13 + LSR $0x01, R13, R13 UBFX $8, R0, $8, R1 LSR $0x20, R0, R0 - TST R1, R1 - BEQ sequenceDecs_decodeSync_safe_amd64_of_update_zero ADD R1, R3, R3 - CMP $0x40, R3 - BHI sequenceDecs_decodeSync_safe_amd64_of_update_zero - CMP $0x40, R1 - BHS sequenceDecs_decodeSync_safe_amd64_of_update_zero - NEG R1, R1 + EOR $0x3f, R1, R1 LSR R1, R13, R13 ADD R13, R0, R0 - -sequenceDecs_decodeSync_safe_amd64_of_update_zero: - MOVD R0, 8(RSP) + MOVD R0, 48(RSP) // Update match length MOVD R7, R0 - MOVD R3, R1 - MOVD R2, R13 - LSL R1, R13, R13 + LSL R3, R2, R13 + LSR $0x01, R13, R13 UBFX $8, R0, $8, R1 LSR $0x20, R0, R0 - TST R1, R1 - BEQ sequenceDecs_decodeSync_safe_amd64_ml_update_zero ADD R1, R3, R3 - CMP $0x40, R3 - BHI sequenceDecs_decodeSync_safe_amd64_ml_update_zero - CMP $0x40, R1 - BHS sequenceDecs_decodeSync_safe_amd64_ml_update_zero - NEG R1, R1 + EOR $0x3f, R1, R1 LSR R1, R13, R13 ADD R13, R0, R0 - -sequenceDecs_decodeSync_safe_amd64_ml_update_zero: - MOVD R0, 16(RSP) + MOVD R0, 56(RSP) // Fill bitreader to have enough for the remaining CMP $0x08, R5 BLT sequenceDecs_decodeSync_safe_amd64_fill_2_byte_by_byte - MOVD R3, R0 - LSR $0x03, R0, R0 + LSR $0x03, R3, R0 SUB R0, R12, R12 MOVD (R12), R2 SUB R0, R5, R5 @@ -2115,113 +2547,78 @@ sequenceDecs_decodeSync_safe_amd64_fill_2_check_overread: sequenceDecs_decodeSync_safe_amd64_fill_2_end: // Update literal length MOVD R6, R0 - MOVD R3, R1 - MOVD R2, R13 - LSL R1, R13, R13 + LSL R3, R2, R13 + LSR $0x01, R13, R13 UBFX $8, R0, $8, R1 LSR $0x20, R0, R0 - TST R1, R1 - BEQ sequenceDecs_decodeSync_safe_amd64_ll_update_zero ADD R1, R3, R3 - CMP $0x40, R3 - BHI sequenceDecs_decodeSync_safe_amd64_ll_update_zero - CMP $0x40, R1 - BHS sequenceDecs_decodeSync_safe_amd64_ll_update_zero - NEG R1, R1 + EOR $0x3f, R1, R1 LSR R1, R13, R13 ADD R13, R0, R0 - -sequenceDecs_decodeSync_safe_amd64_ll_update_zero: - MOVD R0, 24(RSP) + MOVD R0, 64(RSP) // Fill bitreader for state updates - MOVD R12, (RSP) - MOVD R8, R0 - LSR $0x08, R0, R0 - MOVBU R0, R0 - MOVD ctx+16(FP), R1 - MOVD 96(R1), R16 - CMP $0x00, R16 - BEQ sequenceDecs_decodeSync_safe_amd64_skip_update + MOVD R12, 8(RSP) + UBFX $8, R8, $8, R0 + MOVD 40(RSP), R16 + CMP $0x00, R16 + BEQ sequenceDecs_decodeSync_safe_amd64_skip_update // Update Literal Length State MOVBU R6, R12 LSRW $0x10, R6, R6 - ADD R12, R3, R1 - MOVD R2, R13 - MOVD R1, R3 - NEG R1, R16 - ROR R16, R13, R13 - MOVD $0x00000001, R14 - MOVB R12, R1 - LSLW R1, R14, R14 - SUBW $1, R14, R14 - AND R14, R13, R13 + LSL R3, R2, R13 + LSR $0x01, R13, R13 + ADD R12, R3, R3 + EOR $0x3f, R12, R12 + LSR R12, R13, R13 ADD R13, R6, R6 // Load ctx.llTable - MOVD ctx+16(FP), R1 - MOVD (R1), R1 - ADD R6<<3, R1, R15 - MOVD (R15), R6 + MOVD 16(RSP), R1 + MOVD (R1)(R6<<3), R6 // Update Match Length State MOVBU R7, R12 LSRW $0x10, R7, R7 - ADD R12, R3, R1 - MOVD R2, R13 - MOVD R1, R3 - NEG R1, R16 - ROR R16, R13, R13 - MOVD $0x00000001, R14 - MOVB R12, R1 - LSLW R1, R14, R14 - SUBW $1, R14, R14 - AND R14, R13, R13 + LSL R3, R2, R13 + LSR $0x01, R13, R13 + ADD R12, R3, R3 + EOR $0x3f, R12, R12 + LSR R12, R13, R13 ADD R13, R7, R7 // Load ctx.mlTable - MOVD ctx+16(FP), R1 - MOVD 24(R1), R1 - ADD R7<<3, R1, R15 - MOVD (R15), R7 + MOVD 24(RSP), R1 + MOVD (R1)(R7<<3), R7 // Update Offset State MOVBU R8, R12 LSRW $0x10, R8, R8 - ADD R12, R3, R1 - MOVD R2, R13 - MOVD R1, R3 - NEG R1, R16 - ROR R16, R13, R13 - MOVD $0x00000001, R14 - MOVB R12, R1 - LSLW R1, R14, R14 - SUBW $1, R14, R14 - AND R14, R13, R13 + LSL R3, R2, R13 + LSR $0x01, R13, R13 + ADD R12, R3, R3 + EOR $0x3f, R12, R12 + LSR R12, R13, R13 ADD R13, R8, R8 // Load ctx.ofTable - MOVD ctx+16(FP), R1 - MOVD 48(R1), R1 - ADD R8<<3, R1, R15 - MOVD (R15), R8 + MOVD 32(RSP), R1 + MOVD (R1)(R8<<3), R8 sequenceDecs_decodeSync_safe_amd64_skip_update: // Adjust offset - MOVD s+0(FP), R1 - MOVD 8(RSP), R12 - CMP $0x01, R0 - BLS sequenceDecs_decodeSync_safe_amd64_adjust_offsetB_1_or_0 - ADD $144, R1, R15 - VLD1 (R15), [V0.B16] - MOVD R12, 144(R1) - ADD $152, R1, R15 - VST1 [V0.B16], (R15) - JMP sequenceDecs_decodeSync_safe_amd64_after_adjust + MOVD s+0(FP), R1 + MOVD 48(RSP), R12 + CMP $0x01, R0 + BLS sequenceDecs_decodeSync_safe_amd64_adjust_offsetB_1_or_0 + FMOVQ 144(R1), F0 + MOVD R12, 144(R1) + FMOVQ F0, 152(R1) + JMP sequenceDecs_decodeSync_safe_amd64_after_adjust sequenceDecs_decodeSync_safe_amd64_adjust_offsetB_1_or_0: - MOVD 24(RSP), R16 + MOVD 64(RSP), R16 CMP $0x00000000, R16 BNE sequenceDecs_decodeSync_safe_amd64_adjust_offset_maybezero ADD $1, R12, R12 @@ -2259,16 +2656,11 @@ sequenceDecs_decodeSync_safe_amd64_adjust_skip: MOVD R13, R12 sequenceDecs_decodeSync_safe_amd64_after_adjust: - MOVD R12, 8(RSP) + MOVD R12, 48(RSP) // Check values - MOVD 16(RSP), R0 - MOVD 24(RSP), R1 - ADD R1, R0, R13 - MOVD s+0(FP), R14 - MOVD 256(R14), R16 - ADD R13, R16, R16 - MOVD R16, 256(R14) + MOVD 56(RSP), R0 + MOVD 64(RSP), R1 MOVD ctx+16(FP), R13 MOVD 104(R13), R16 SUBS R1, R16, R16 @@ -2282,351 +2674,361 @@ sequenceDecs_decodeSync_safe_amd64_after_adjust: BNE sequenceDecs_decodeSync_safe_amd64_error_match_len_ofs_mismatch sequenceDecs_decodeSync_safe_amd64_match_len_ofs_ok: - MOVD 24(RSP), R0 - MOVD 8(RSP), R1 - MOVD 16(RSP), R12 - // Check if we have enough space in s.out - ADD R12, R0, R13 + ADD R0, R1, R13 ADD R9, R13, R13 - MOVD 32(RSP), R16 + MOVD 72(RSP), R16 CMP R16, R13 BHI error_not_enough_space // Copy literals - TST R0, R0 + TST R1, R1 BEQ check_offset - MOVD R0, R13 + MOVD R1, R13 SUBS $0x10, R13, R13 BLO copy_1_small copy_1_loop: - VLD1 (R10), [V0.B16] - VST1 [V0.B16], (R9) - ADD $0x10, R10, R10 - ADD $0x10, R9, R9 - SUBS $0x10, R13, R13 - BHS copy_1_loop - ADD R13, R10, R10 - ADD $16, R10, R10 - ADD R13, R9, R9 - ADD $16, R9, R9 - ADD $-16, R10, R15 - VLD1 (R15), [V0.B16] - ADD $-16, R9, R15 - VST1 [V0.B16], (R15) - JMP copy_1_end + FMOVQ (R10), F0 + FMOVQ F0, (R9) + ADD $0x10, R10, R10 + ADD $0x10, R9, R9 + SUBS $0x10, R13, R13 + BHS copy_1_loop + ADD R13, R10, R10 + ADD $16, R10, R10 + ADD R13, R9, R9 + ADD $16, R9, R9 + FMOVQ -16(R10), F0 + FMOVQ F0, -16(R9) + JMP copy_1_end copy_1_small: - CMP $0x03, R0 + CMP $0x03, R1 BEQ copy_1_move_3 BLO copy_1_move_1or2 - CMP $0x08, R0 + CMP $0x08, R1 BLO copy_1_move_4through7 JMP copy_1_move_8through16 copy_1_move_1or2: - MOVB (R10), R13 - ADD R0, R10, R15 - MOVB -1(R15), R14 - MOVB R13, (R9) - ADD R0, R9, R15 - MOVB R14, -1(R15) - ADD R0, R10, R10 - ADD R0, R9, R9 - JMP copy_1_end + MOVBU (R10), R16 + BFI $0, R16, $8, R13 + ADD R1, R10, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R14 + MOVB R13, (R9) + ADD R1, R9, R15 + MOVB R14, -1(R15) + ADD R1, R10, R10 + ADD R1, R9, R9 + JMP copy_1_end copy_1_move_3: - MOVH (R10), R13 - MOVB 2(R10), R14 - MOVH R13, (R9) - MOVB R14, 2(R9) - ADD R0, R10, R10 - ADD R0, R9, R9 - JMP copy_1_end + MOVHU (R10), R13 + MOVBU 2(R10), R16 + BFI $0, R16, $8, R14 + MOVH R13, (R9) + MOVB R14, 2(R9) + ADD R1, R10, R10 + ADD R1, R9, R9 + JMP copy_1_end copy_1_move_4through7: MOVWU (R10), R13 - ADD R0, R10, R15 + ADD R1, R10, R15 MOVWU -4(R15), R14 MOVW R13, (R9) - ADD R0, R9, R15 + ADD R1, R9, R15 MOVW R14, -4(R15) - ADD R0, R10, R10 - ADD R0, R9, R9 + ADD R1, R10, R10 + ADD R1, R9, R9 JMP copy_1_end copy_1_move_8through16: MOVD (R10), R13 - ADD R0, R10, R15 + ADD R1, R10, R15 MOVD -8(R15), R14 MOVD R13, (R9) - ADD R0, R9, R15 + ADD R1, R9, R15 MOVD R14, -8(R15) - ADD R0, R10, R10 - ADD R0, R9, R9 + ADD R1, R10, R10 + ADD R1, R9, R9 copy_1_end: - ADD R0, R11, R11 + ADD R1, R11, R11 // Malformed input if seq.mo > t+len(hist) || seq.mo > s.windowSize) check_offset: - MOVD R11, R0 - MOVD 40(RSP), R16 - ADD R16, R0, R0 - CMP R0, R1 + MOVD R11, R1 + MOVD 80(RSP), R16 + ADD R16, R1, R1 + CMP R1, R12 BGT error_match_off_too_big - MOVD 56(RSP), R16 - CMP R16, R1 + MOVD 96(RSP), R16 + CMP R16, R12 BGT error_match_off_too_big // Copy match from history - MOVD R1, R0 - SUBS R11, R0, R0 + MOVD R12, R1 + SUBS R11, R1, R1 BLS copy_match - MOVD 48(RSP), R13 - SUB R0, R13, R13 - CMP R0, R12 + MOVD 88(RSP), R13 + SUB R1, R13, R13 + CMP R1, R0 BGT copy_all_from_history - MOVD R12, R0 - SUBS $0x10, R0, R0 + MOVD R0, R1 + SUBS $0x10, R1, R1 BLO copy_4_small copy_4_loop: - VLD1 (R13), [V0.B16] - VST1 [V0.B16], (R9) - ADD $0x10, R13, R13 - ADD $0x10, R9, R9 - SUBS $0x10, R0, R0 - BHS copy_4_loop - ADD R0, R13, R13 - ADD $16, R13, R13 - ADD R0, R9, R9 - ADD $16, R9, R9 - ADD $-16, R13, R15 - VLD1 (R15), [V0.B16] - ADD $-16, R9, R15 - VST1 [V0.B16], (R15) - JMP copy_4_end + FMOVQ (R13), F0 + FMOVQ F0, (R9) + ADD $0x10, R13, R13 + ADD $0x10, R9, R9 + SUBS $0x10, R1, R1 + BHS copy_4_loop + ADD R1, R13, R13 + ADD $16, R13, R13 + ADD R1, R9, R9 + ADD $16, R9, R9 + FMOVQ -16(R13), F0 + FMOVQ F0, -16(R9) + JMP copy_4_end copy_4_small: - CMP $0x03, R12 + CMP $0x03, R0 BEQ copy_4_move_3 - CMP $0x08, R12 + CMP $0x08, R0 BLO copy_4_move_4through7 JMP copy_4_move_8through16 copy_4_move_3: - MOVH (R13), R0 - MOVB 2(R13), R1 - MOVH R0, (R9) - MOVB R1, 2(R9) - ADD R12, R13, R13 - ADD R12, R9, R9 - JMP copy_4_end + MOVHU (R13), R1 + MOVBU 2(R13), R16 + BFI $0, R16, $8, R12 + MOVH R1, (R9) + MOVB R12, 2(R9) + ADD R0, R13, R13 + ADD R0, R9, R9 + JMP copy_4_end copy_4_move_4through7: - MOVWU (R13), R0 - ADD R12, R13, R15 - MOVWU -4(R15), R1 - MOVW R0, (R9) - ADD R12, R9, R15 - MOVW R1, -4(R15) - ADD R12, R13, R13 - ADD R12, R9, R9 + MOVWU (R13), R1 + ADD R0, R13, R15 + MOVWU -4(R15), R12 + MOVW R1, (R9) + ADD R0, R9, R15 + MOVW R12, -4(R15) + ADD R0, R13, R13 + ADD R0, R9, R9 JMP copy_4_end copy_4_move_8through16: - MOVD (R13), R0 - ADD R12, R13, R15 - MOVD -8(R15), R1 - MOVD R0, (R9) - ADD R12, R9, R15 - MOVD R1, -8(R15) - ADD R12, R13, R13 - ADD R12, R9, R9 + MOVD (R13), R1 + ADD R0, R13, R15 + MOVD -8(R15), R12 + MOVD R1, (R9) + ADD R0, R9, R15 + MOVD R12, -8(R15) + ADD R0, R13, R13 + ADD R0, R9, R9 copy_4_end: - ADD R12, R11, R11 + ADD R0, R11, R11 JMP handle_loop JMP loop_finished copy_all_from_history: - MOVD R0, R14 + MOVD R1, R14 SUBS $0x10, R14, R14 BLO copy_5_small copy_5_loop: - VLD1 (R13), [V0.B16] - VST1 [V0.B16], (R9) - ADD $0x10, R13, R13 - ADD $0x10, R9, R9 - SUBS $0x10, R14, R14 - BHS copy_5_loop - ADD R14, R13, R13 - ADD $16, R13, R13 - ADD R14, R9, R9 - ADD $16, R9, R9 - ADD $-16, R13, R15 - VLD1 (R15), [V0.B16] - ADD $-16, R9, R15 - VST1 [V0.B16], (R15) - JMP copy_5_end + FMOVQ (R13), F0 + FMOVQ F0, (R9) + ADD $0x10, R13, R13 + ADD $0x10, R9, R9 + SUBS $0x10, R14, R14 + BHS copy_5_loop + ADD R14, R13, R13 + ADD $16, R13, R13 + ADD R14, R9, R9 + ADD $16, R9, R9 + FMOVQ -16(R13), F0 + FMOVQ F0, -16(R9) + JMP copy_5_end copy_5_small: - CMP $0x03, R0 + CMP $0x03, R1 BEQ copy_5_move_3 BLO copy_5_move_1or2 - CMP $0x08, R0 + CMP $0x08, R1 BLO copy_5_move_4through7 JMP copy_5_move_8through16 copy_5_move_1or2: - MOVB (R13), R14 - ADD R0, R13, R15 - MOVB -1(R15), R4 - MOVB R14, (R9) - ADD R0, R9, R15 - MOVB R4, -1(R15) - ADD R0, R13, R13 - ADD R0, R9, R9 - JMP copy_5_end + MOVBU (R13), R16 + BFI $0, R16, $8, R14 + ADD R1, R13, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R4 + MOVB R14, (R9) + ADD R1, R9, R15 + MOVB R4, -1(R15) + ADD R1, R13, R13 + ADD R1, R9, R9 + JMP copy_5_end copy_5_move_3: - MOVH (R13), R14 - MOVB 2(R13), R4 - MOVH R14, (R9) - MOVB R4, 2(R9) - ADD R0, R13, R13 - ADD R0, R9, R9 - JMP copy_5_end + MOVHU (R13), R14 + MOVBU 2(R13), R16 + BFI $0, R16, $8, R4 + MOVH R14, (R9) + MOVB R4, 2(R9) + ADD R1, R13, R13 + ADD R1, R9, R9 + JMP copy_5_end copy_5_move_4through7: MOVWU (R13), R14 - ADD R0, R13, R15 + ADD R1, R13, R15 MOVWU -4(R15), R4 MOVW R14, (R9) - ADD R0, R9, R15 + ADD R1, R9, R15 MOVW R4, -4(R15) - ADD R0, R13, R13 - ADD R0, R9, R9 + ADD R1, R13, R13 + ADD R1, R9, R9 JMP copy_5_end copy_5_move_8through16: MOVD (R13), R14 - ADD R0, R13, R15 + ADD R1, R13, R15 MOVD -8(R15), R4 MOVD R14, (R9) - ADD R0, R9, R15 + ADD R1, R9, R15 MOVD R4, -8(R15) - ADD R0, R13, R13 - ADD R0, R9, R9 + ADD R1, R13, R13 + ADD R1, R9, R9 copy_5_end: - ADD R0, R11, R11 - SUB R0, R12, R12 + ADD R1, R11, R11 + SUB R1, R0, R0 // Copy match from the current buffer copy_match: - MOVD R9, R0 - SUB R1, R0, R0 + MOVD R9, R1 + SUB R12, R1, R1 // ml <= mo - CMP R1, R12 + CMP R12, R0 BHI copy_overlapping_match // Copy non-overlapping match - ADD R12, R11, R11 - MOVD R12, R1 - SUBS $0x10, R1, R1 + ADD R0, R11, R11 + MOVD R0, R12 + SUBS $0x10, R12, R12 BLO copy_2_small copy_2_loop: - VLD1 (R0), [V0.B16] - VST1 [V0.B16], (R9) - ADD $0x10, R0, R0 - ADD $0x10, R9, R9 - SUBS $0x10, R1, R1 - BHS copy_2_loop - ADD R1, R0, R0 - ADD $16, R0, R0 - ADD R1, R9, R9 - ADD $16, R9, R9 - ADD $-16, R0, R15 - VLD1 (R15), [V0.B16] - ADD $-16, R9, R15 - VST1 [V0.B16], (R15) - JMP copy_2_end + FMOVQ (R1), F0 + FMOVQ F0, (R9) + ADD $0x10, R1, R1 + ADD $0x10, R9, R9 + SUBS $0x10, R12, R12 + BHS copy_2_loop + ADD R12, R1, R1 + ADD $16, R1, R1 + ADD R12, R9, R9 + ADD $16, R9, R9 + FMOVQ -16(R1), F0 + FMOVQ F0, -16(R9) + JMP copy_2_end copy_2_small: - CMP $0x03, R12 + CMP $0x03, R0 BEQ copy_2_move_3 BLO copy_2_move_1or2 - CMP $0x08, R12 + CMP $0x08, R0 BLO copy_2_move_4through7 JMP copy_2_move_8through16 copy_2_move_1or2: - MOVB (R0), R1 - ADD R12, R0, R15 - MOVB -1(R15), R13 - MOVB R1, (R9) - ADD R12, R9, R15 - MOVB R13, -1(R15) - ADD R12, R0, R0 - ADD R12, R9, R9 - JMP copy_2_end + MOVBU (R1), R16 + BFI $0, R16, $8, R12 + ADD R0, R1, R15 + MOVBU -1(R15), R16 + BFI $0, R16, $8, R13 + MOVB R12, (R9) + ADD R0, R9, R15 + MOVB R13, -1(R15) + ADD R0, R1, R1 + ADD R0, R9, R9 + JMP copy_2_end copy_2_move_3: - MOVH (R0), R1 - MOVB 2(R0), R13 - MOVH R1, (R9) - MOVB R13, 2(R9) - ADD R12, R0, R0 - ADD R12, R9, R9 - JMP copy_2_end + MOVHU (R1), R12 + MOVBU 2(R1), R16 + BFI $0, R16, $8, R13 + MOVH R12, (R9) + MOVB R13, 2(R9) + ADD R0, R1, R1 + ADD R0, R9, R9 + JMP copy_2_end copy_2_move_4through7: - MOVWU (R0), R1 - ADD R12, R0, R15 + MOVWU (R1), R12 + ADD R0, R1, R15 MOVWU -4(R15), R13 - MOVW R1, (R9) - ADD R12, R9, R15 + MOVW R12, (R9) + ADD R0, R9, R15 MOVW R13, -4(R15) - ADD R12, R0, R0 - ADD R12, R9, R9 + ADD R0, R1, R1 + ADD R0, R9, R9 JMP copy_2_end copy_2_move_8through16: - MOVD (R0), R1 - ADD R12, R0, R15 + MOVD (R1), R12 + ADD R0, R1, R15 MOVD -8(R15), R13 - MOVD R1, (R9) - ADD R12, R9, R15 + MOVD R12, (R9) + ADD R0, R9, R15 MOVD R13, -8(R15) - ADD R12, R0, R0 - ADD R12, R9, R9 + ADD R0, R1, R1 + ADD R0, R9, R9 copy_2_end: JMP handle_loop // Copy overlapping match copy_overlapping_match: - ADD R12, R11, R11 + ADD R0, R11, R11 + CMP $0x10, R12 + BLO copy_slow_3 + +copy_3_blocks: + FMOVQ (R1), F0 + FMOVQ F0, (R9) + ADD $0x10, R1, R1 + ADD $0x10, R9, R9 + SUB $0x10, R0, R0 + CMP $0x10, R0 + BHS copy_3_blocks + TST R0, R0 + BEQ handle_loop copy_slow_3: - MOVB (R0), R1 - MOVB R1, (R9) - ADD $1, R0, R0 - ADD $1, R9, R9 - SUBS $1, R12, R12 - BNE copy_slow_3 + MOVBU (R1), R12 + MOVB R12, (R9) + ADD $1, R1, R1 + ADD $1, R9, R9 + SUBS $1, R0, R0 + BNE copy_slow_3 handle_loop: - MOVD ctx+16(FP), R0 - MOVD 96(R0), R16 + MOVD 40(RSP), R16 SUBS $1, R16, R16 - MOVD R16, 96(R0) + MOVD R16, 40(RSP) BPL sequenceDecs_decodeSync_safe_amd64_main_loop loop_finished: @@ -2635,6 +3037,16 @@ loop_finished: MOVB R3, 40(R0) MOVD R5, 32(R0) + // s.seqSize += outPosition - ctx.outPosition + MOVD ctx+16(FP), R0 + MOVD s+0(FP), R1 + MOVD R11, R2 + MOVD 136(R0), R16 + SUB R16, R2, R2 + MOVD 256(R1), R16 + ADD R2, R16, R16 + MOVD R16, 256(R1) + // Update the context MOVD ctx+16(FP), R0 MOVD R11, 136(R0) @@ -2649,7 +3061,7 @@ loop_finished: // Return with match length error sequenceDecs_decodeSync_safe_amd64_error_match_len_ofs_mismatch: - MOVD 16(RSP), R0 + MOVD 56(RSP), R0 MOVD ctx+16(FP), R1 MOVD R0, 216(R1) MOVD $0x00000001, R16 @@ -2659,7 +3071,7 @@ sequenceDecs_decodeSync_safe_amd64_error_match_len_ofs_mismatch: // Return with match too long error sequenceDecs_decodeSync_safe_amd64_error_match_len_too_big: MOVD ctx+16(FP), R0 - MOVD 16(RSP), R1 + MOVD 56(RSP), R1 MOVD R1, 216(R0) MOVD $0x00000002, R16 MOVD R16, ret+24(FP) @@ -2668,7 +3080,7 @@ sequenceDecs_decodeSync_safe_amd64_error_match_len_too_big: // Return with match offset too long error error_match_off_too_big: MOVD ctx+16(FP), R0 - MOVD 8(RSP), R1 + MOVD 48(RSP), R1 MOVD R1, 224(R0) MOVD R11, 136(R0) MOVD $0x00000003, R16 @@ -2678,7 +3090,7 @@ error_match_off_too_big: // Return with not enough literals error error_not_enough_literals: MOVD ctx+16(FP), R0 - MOVD 24(RSP), R1 + MOVD 64(RSP), R1 MOVD R1, 208(R0) MOVD $0x00000004, R16 MOVD R16, ret+24(FP) @@ -2693,9 +3105,9 @@ error_overread: // Return with not enough output space error error_not_enough_space: MOVD ctx+16(FP), R0 - MOVD 24(RSP), R1 + MOVD 64(RSP), R1 MOVD R1, 208(R0) - MOVD 16(RSP), R1 + MOVD 56(RSP), R1 MOVD R1, 216(R0) MOVD R11, 136(R0) MOVD $0x00000005, R16 diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec_asm.go b/vendor/github.com/klauspost/compress/zstd/seqdec_asm.go index 55405f3914d..543c49074b8 100644 --- a/vendor/github.com/klauspost/compress/zstd/seqdec_asm.go +++ b/vendor/github.com/klauspost/compress/zstd/seqdec_asm.go @@ -1,4 +1,4 @@ -//go:build (amd64 || arm64) && !appengine && !noasm && gc +//go:build (amd64 || arm64) && !noasm && gc package zstd @@ -55,6 +55,9 @@ type executeAsmContext struct { outPosition int litPosition int windowSize int + // prefetch enables the match-source prefetch in the execute loop; see + // sequenceDecs.useTwoPass. + prefetch bool } const noError = 0 @@ -77,23 +80,55 @@ const errorNotEnoughSpace = 5 // error reported when bits are overread. const errorOverread = 6 +// useSafeDecodeSync reports whether decodeSyncSimple must use the bounds-exact +// ("safe") copy variants for the current buffer geometry. +// +// When the output and literal buffers have compressedBlockOverAlloc (16) +// bytes of slack past their logical use, the assembly may use extended +// memory copies that read and write in 16-byte blocks, overrunning the end +// of a literal run or match by up to 15 bytes; an empty literal run still +// copies one block, reading and writing the full 16 bytes of slack past +// its position. Otherwise it must use the bounds-exact ("safe") copies. +// This mirrors the analogous, always-dynamic selection in executeSimple below. +// +// The unsafe copies were disabled in #644 (2022) as a mitigation for a +// crash, but that crash's root cause — an unguarded bitReader overread that +// produced out-of-range match offsets/lengths — was fixed three days later +// in #645, which also added the fuzz corpus that has guarded this path since. +// See #1168. An asan-instrumented fuzz job (see .github/workflows/go.yml) +// covers the extended-copy path, which -race and plain fuzzing cannot. +func (s *sequenceDecs) useSafeDecodeSync() bool { + // A block never produces more than maxBlockSize bytes. + maxBlockSize := min(s.windowSize, maxCompressedBlockSize) + if s.maxSyncLen == 0 && cap(s.out)-len(s.out) < maxBlockSize+compressedBlockOverAlloc { + return true + } + // The block, not the rest of the frame, must fit with the slack: a + // buffer sized exactly to the frame needs the safe copies only for the + // final block(s). + if s.maxSyncLen > 0 && cap(s.out)-len(s.out)-compressedBlockOverAlloc < min(int(s.maxSyncLen), maxBlockSize) { + return true + } + if cap(s.literals) < len(s.literals)+compressedBlockOverAlloc { + return true + } + return false +} + // decode sequences from the stream with the provided history but without a dictionary. func (s *sequenceDecs) decodeSyncSimple(hist []byte) (bool, error) { if len(s.dict) > 0 { return false, nil } - if s.maxSyncLen == 0 && cap(s.out)-len(s.out) < maxCompressedBlockSize { + maxBlockSize := min(s.windowSize, maxCompressedBlockSize) + if s.maxSyncLen == 0 && cap(s.out)-len(s.out) < maxBlockSize { return false, nil } - // FIXME: Using unsafe memory copies leads to rare, random crashes - // with fuzz testing. It is therefore disabled for now. - const useSafe = true + useSafe := s.useSafeDecodeSync() br := s.br - maxBlockSize := min(s.windowSize, maxCompressedBlockSize) - ctx := decodeSyncAsmContext{ llTable: s.litLengths.fse.dt[:maxTablesize], mlTable: s.matchLengths.fse.dt[:maxTablesize], @@ -126,7 +161,7 @@ func (s *sequenceDecs) decodeSyncSimple(hist []byte) (bool, error) { case errorMatchOffTooBig: return true, fmt.Errorf("match offset (%d) bigger than current history (%d)", - ctx.mo, ctx.outPosition+len(hist)-startSize) + ctx.mo, ctx.outPosition-startSize) case errorNotEnoughLiterals: return true, fmt.Errorf("unexpected literal count, want %d bytes, but only %d is available", @@ -239,8 +274,10 @@ func (s *sequenceDecs) decode(seqs []seqVals) error { // executeSimple handles cases when dictionary is not used. func (s *sequenceDecs) executeSimple(seqs []seqVals, hist []byte) error { - // Ensure we have enough output size... - if len(s.out)+s.seqSize+compressedBlockOverAlloc > cap(s.out) { + // Grow only if the block does not fit. Lacking just the slack is + // handled by the safe copies below, so a buffer sized exactly to the + // frame is not reallocated and copied on its last block. + if len(s.out)+s.seqSize > cap(s.out) { addBytes := s.seqSize + len(s.out) + compressedBlockOverAlloc s.out = append(s.out, make([]byte, addBytes)...) s.out = s.out[:len(s.out)-addBytes] @@ -262,10 +299,12 @@ func (s *sequenceDecs) executeSimple(seqs []seqVals, hist []byte) error { litPosition: 0, literals: s.literals, windowSize: s.windowSize, + prefetch: s.useTwoPass(), } - // useSafe avoids overwriting the output buffer when the literals slice has - // not been allocated with the required over-allocation slack. - useSafe := cap(s.literals) < len(s.literals)+compressedBlockOverAlloc + // useSafe avoids writing past either buffer when the literals or the + // output lack the extended copies' over-allocation slack. + useSafe := cap(s.literals) < len(s.literals)+compressedBlockOverAlloc || + cap(out) < len(out)+compressedBlockOverAlloc ok := executeSimpleAsm(&ctx, useSafe) if !ok { diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec_generic.go b/vendor/github.com/klauspost/compress/zstd/seqdec_generic.go index 8a3db6ba22f..efeed96185a 100644 --- a/vendor/github.com/klauspost/compress/zstd/seqdec_generic.go +++ b/vendor/github.com/klauspost/compress/zstd/seqdec_generic.go @@ -1,10 +1,17 @@ -//go:build (!amd64 && !arm64) || appengine || !gc || noasm +//go:build (!amd64 && !arm64) || !gc || noasm package zstd import ( "fmt" "io" + "math" +) + +// See seqdec_arm64.go; the pure Go decoder has neither path. +var ( + twoPassMinFarShare = 257 // never: the share is at most 256 + decodeTwoPassMinWindow = math.MaxInt ) // decode sequences from the stream with the provided history but without dictionary. diff --git a/vendor/github.com/klauspost/compress/zstd/seqenc.go b/vendor/github.com/klauspost/compress/zstd/seqenc.go index 65045eabdde..6fb8885992e 100644 --- a/vendor/github.com/klauspost/compress/zstd/seqenc.go +++ b/vendor/github.com/klauspost/compress/zstd/seqenc.go @@ -110,3 +110,50 @@ func ofCode(offset uint32) uint8 { // A valid offset will always be > 0. return uint8(bits.Len32(offset) - 1) } + +// newDictSeqEncoder builds an encoder for a dictionary sequence table. +// Returns nil if the table is missing or unusable. +func newDictSeqEncoder(src *fseDecoder, t tableIndex) *fseEncoder { + if src == nil || src.symbolLen == 0 { + return nil + } + var e fseEncoder + e.norm = src.norm + e.symbolLen = src.symbolLen + e.actualTableLog = src.actualTableLog + if e.buildCTable() != nil { + return nil + } + e.setBits(bitTables[t]) + return &e +} + +// seedPrevFromDict loads the dictionary sequence tables as the "previous" +// encoders, so the first block can use repeat mode. +func (s *seqCoders) seedPrevFromDict(d *dict) { + seed := func(dst, src *fseEncoder) { + if src == nil { + return + } + ct := dst.ct + dst.symbolLen = src.symbolLen + dst.actualTableLog = src.actualTableLog + dst.maxBits = src.maxBits + dst.zeroBits = src.zeroBits + dst.useRLE = false + dst.preDefined = false + dst.reUsed = true + dst.norm = src.norm + // tableSymbol is only used while building, so it is not copied. + ct.stateTable = append(ct.stateTable[:0], src.ct.stateTable...) + if cap(ct.symbolTT) < len(src.ct.symbolTT) { + ct.symbolTT = make([]symbolTransform, len(src.ct.symbolTT)) + } + ct.symbolTT = ct.symbolTT[:len(src.ct.symbolTT)] + copy(ct.symbolTT, src.ct.symbolTT[:src.symbolLen]) + dst.ct = ct + } + seed(s.llPrev, d.llEnc) + seed(s.mlPrev, d.mlEnc) + seed(s.ofPrev, d.ofEnc) +} diff --git a/vendor/github.com/klauspost/compress/zstd/simple.go b/vendor/github.com/klauspost/compress/zstd/simple.go new file mode 100644 index 00000000000..9b6c39ac005 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/simple.go @@ -0,0 +1,54 @@ +// Copyright 2025+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. + +package zstd + +import ( + "errors" + "runtime" + "sync" + "weak" +) + +var weakMu sync.Mutex +var simpleEnc weak.Pointer[Encoder] +var simpleDec weak.Pointer[Decoder] + +// EncodeTo appends the encoded data from src to dst. +func EncodeTo(dst []byte, src []byte) []byte { + weakMu.Lock() + enc := simpleEnc.Value() + if enc == nil { + var err error + enc, err = NewWriter(nil, WithEncoderConcurrency(runtime.NumCPU()), WithWindowSize(1<<20), WithLowerEncoderMem(true), WithZeroFrames(true)) + if err != nil { + panic("failed to create simple encoder: " + err.Error()) + } + simpleEnc = weak.Make(enc) + } + weakMu.Unlock() + + return enc.EncodeAll(src, dst) +} + +// DecodeTo appends the decoded data from src to dst. +// The maximum decoded size is 1GiB, +// not including what may already be in dst. +func DecodeTo(dst []byte, src []byte) ([]byte, error) { + weakMu.Lock() + dec := simpleDec.Value() + if dec == nil { + var err error + dec, err = NewReader(nil, WithDecoderConcurrency(runtime.NumCPU()), WithDecoderLowmem(true), WithDecoderMaxMemory(1<<30)) + if err != nil { + weakMu.Unlock() + return nil, errors.New("failed to create simple decoder: " + err.Error()) + } + runtime.SetFinalizer(dec, func(d *Decoder) { + d.Close() + }) + simpleDec = weak.Make(dec) + } + weakMu.Unlock() + return dec.DecodeAll(src, dst) +} diff --git a/vendor/github.com/klauspost/compress/zstd/snappy.go b/vendor/github.com/klauspost/compress/zstd/snappy.go index 36c56f36d77..06ed593ea41 100644 --- a/vendor/github.com/klauspost/compress/zstd/snappy.go +++ b/vendor/github.com/klauspost/compress/zstd/snappy.go @@ -69,6 +69,10 @@ var ( // No CRC value is being generated and not all CRC values of the Snappy stream are checked. // However, it provides really fast recompression of Snappy streams. // The converter can be reused to avoid allocations, even after errors. +// +// Deprecated: Decode the stream with s2.NewReader, which reads Snappy streams, +// and compress the output with an Encoder. This validates the input and +// compresses much better. type SnappyConverter struct { r io.Reader err error @@ -373,6 +377,14 @@ func decodeSnappy(blk *blockEnc, src []byte) error { offset = uint32(src[s-4]) | uint32(src[s-3])<<8 | uint32(src[s-2])<<16 | uint32(src[s-1])<<24 } + // A zstd match is at least zstdMinMatch bytes. A shorter copy + // cannot be represented as a sequence and would underflow the + // matchLen computation below, producing an out-of-range match + // length code. + if length < zstdMinMatch { + return ErrSnappyCorrupt + } + if offset <= 0 || blk.size+lits < int(offset) /*|| length > len(blk)-d */ { println("offset <= 0 || blk.size+lits < int(offset)", offset, blk.size+lits, int(offset), blk.size, lits) diff --git a/vendor/github.com/klauspost/cpuid/v2/.goreleaser.yml b/vendor/github.com/klauspost/cpuid/v2/.goreleaser.yml index 1b695b62c35..14712fe0dda 100644 --- a/vendor/github.com/klauspost/cpuid/v2/.goreleaser.yml +++ b/vendor/github.com/klauspost/cpuid/v2/.goreleaser.yml @@ -29,7 +29,7 @@ archives: name_template: "cpuid-{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" format_overrides: - goos: windows - format: zip + formats: [ 'zip' ] files: - LICENSE checksum: diff --git a/vendor/github.com/klauspost/cpuid/v2/README.md b/vendor/github.com/klauspost/cpuid/v2/README.md index 7b1d5992116..a99bbdba361 100644 --- a/vendor/github.com/klauspost/cpuid/v2/README.md +++ b/vendor/github.com/klauspost/cpuid/v2/README.md @@ -2,7 +2,7 @@ Package cpuid provides information about the CPU running the current program. CPU features are detected on startup, and kept for fast access through the life of the application. -Currently x86 / x64 (AMD64/i386) and ARM (ARM64) is supported, and no external C (cgo) code is used, which should make the library very easy to use. +Currently x86 / x64 (AMD64/i386), ARM (ARM64), and RISC-V (RV64) are supported, and no external C (cgo) code is used, which should make the library very easy to use. You can access the CPU information by accessing the shared CPU variable of the cpuid library. @@ -281,7 +281,7 @@ Exit Code 1 | AMXBF16 | Tile computational operations on BFLOAT16 numbers | | AMXINT8 | Tile computational operations on 8-bit integers | | AMXFP16 | Tile computational operations on FP16 numbers | -| AMXFP8 | Tile computational operations on FP8 numbers | +| AMXFP8 | Tile computational operations on FP8 numbers | | AMXCOMPLEX | Tile computational operations on complex numbers | | AMXTILE | Tile architecture | | AMXTF32 | Matrix Multiplication of TF32 Tiles into Packed Single Precision Tile | @@ -418,6 +418,7 @@ Exit Code 1 | SEV_SNP | AMD SEV Secure Nested Paging supported | | SGX | Software Guard Extensions | | SGXLC | Software Guard Extensions Launch Control | +| SGXPQC | Software Guard Extensions 256-bit Encryption | | SHA | Intel SHA Extensions | | SME | AMD Secure Memory Encryption supported | | SME_COHERENT | AMD Hardware cache coherency across encryption domains enforced | @@ -450,6 +451,9 @@ Exit Code 1 | TLB_FLUSH_NESTED | AMD: Flushing includes all the nested translations for guest translations | | TME | Intel Total Memory Encryption. The following MSRs are supported: IA32_TME_CAPABILITY, IA32_TME_ACTIVATE, IA32_TME_EXCLUDE_MASK, and IA32_TME_EXCLUDE_BASE. | | TOPEXT | TopologyExtensions: topology extensions support. Indicates support for CPUID Fn8000_001D_EAX_x[N:0]-CPUID Fn8000_001E_EDX. | +| TSA_L1_NO | AMD only: Not vulnerable to TSA-L1 | +| TSA_SQ_NO | AMD only: Not vulnerable to TSA-SQ | +| TSA_VERW_CLEAR | AMD: If set, the memory form of the VERW instruction may be used to help mitigate TSA | | TSCRATEMSR | MSR based TSC rate control. Indicates support for MSR TSC ratio MSRC000_0104 | | TSXLDTRK | Intel TSX Suspend Load Address Tracking | | VAES | Vector AES. AVX(512) versions requires additional checks. | @@ -502,6 +506,74 @@ Exit Code 1 | SM3 | SM3 instructions | | SM4 | SM4 instructions | | SVE | Scalable Vector Extension | +| SVE2 | Scalable Vector Extension 2 | +| SB | Speculation barrier (SB instruction) | +| SSBS | Speculative Store Bypass Safe (PSTATE.SSBS) | +| BTI | Branch Target Identification | +| FLAGM2 | Condition flag manipulation version 2 (AXFLAG, XAFLAG) | +| FRINTTS | Floating-point to integer rounding (FRINT32Z, FRINT64Z, etc) | +| DCPODP | Data cache clean to Point of Deep Persistence (DC CVADP) | +| BF16 | BFloat16 instructions (BFDOT, BFMMLA, etc) | +| I8MM | Int8 matrix multiplication (SMMLA, UMMLA, USMMLA) | +| WFXT | WFE/WFI with timeout (WFET, WFIT) | +| MOPS | Memory copy and set instructions (CPYF, SETP, etc) | +| HBC | Hinted conditional branches (BC.cond) | +| CSSC | Common short sequence compression (ABS, SMAX, UMAX, etc) | + +## riscv64 feature detection + +On `riscv64/linux`, CPU features are detected using the `riscv_hwprobe` syscall (Linux 6.4+). +For older kernels, detection falls back to parsing `/proc/cpuinfo` for the ISA string. + +Cache line size is detected via `riscv_hwprobe` (Zicbom block size) or sysfs fallback. +Other cache and topology information is not yet available. + +# RISC-V features: + +| Feature Flag | Description | +|----------------|----------------------------------------------------| +| RV_IMA | IMA base (Integer, Multiply, Atomic) | +| RV_C | Compressed instructions | +| RV_F | Single-precision FP | +| RV_D | Double-precision FP | +| RV_V | Vector extension (V) | +| RV_ZBA | Address generation | +| RV_ZBB | Basic bit manipulation | +| RV_ZBC | Carry-less multiplication | +| RV_ZBS | Single-bit manipulation | +| RV_ZICOND | Integer conditional operations | +| RV_ZIHINTPAUSE | Pause hint | +| RV_ZICBOM | Cache block management operations | +| RV_ZICBOZ | Cache block zero | +| RV_ZICBOP | Cache block prefetch | +| RV_ZFA | Additional floating-point | +| RV_ZFH | Half-precision FP | +| RV_ZFHMIN | Minimal half-precision FP | +| RV_ZTSO | Total store ordering | +| RV_ZACAS | Atomic CAS | +| RV_ZBKB | Bit-manipulation for crypto | +| RV_ZBKC | Carry-less multiply for crypto | +| RV_ZBKX | Crossbar permutations | +| RV_ZKND | NIST Suite: AES decrypt | +| RV_ZKNE | NIST Suite: AES encrypt | +| RV_ZKNH | NIST Suite: SHA-2 (SHA-256/SHA-512) | +| RV_ZKSED | ShangMi Suite: SM4 block cipher | +| RV_ZKSH | ShangMi Suite: SM3 hash | +| RV_ZKT | Data-independent execution latency (Crypto) | +| RV_ZKN | NIST Algorithm Suite (combined from individual) | +| RV_ZKS | ShangMi Algorithm Suite (combined from individual) | +| RV_ZVBB | Vector Basic Bit-manipulation | +| RV_ZVBC | Vector Carry-less multiply | +| RV_ZVKB | Vector Bit-manipulation for crypto | +| RV_ZVKG | Vector GCM/GMAC | +| RV_ZVKNED | NIST Suite: Vector AES encrypt+decrypt | +| RV_ZVKNHA | NIST Suite: Vector SHA-2 (SHA-256) | +| RV_ZVKNHB | NIST Suite: Vector SHA-2 (SHA-512) | +| RV_ZVKSED | ShangMi Suite: Vector SM4 | +| RV_ZVKSH | ShangMi Suite: Vector SM3 hash | +| RV_ZVKT | Vector Data-independent execution latency | +| RV_ZVKNG | NIST Suite with GCM (combined from individual) | +| RV_ZVKSG | ShangMi Suite with GCM (combined from individual) | # license diff --git a/vendor/github.com/klauspost/cpuid/v2/cpuid.go b/vendor/github.com/klauspost/cpuid/v2/cpuid.go index 248439a9a57..db903f46a47 100644 --- a/vendor/github.com/klauspost/cpuid/v2/cpuid.go +++ b/vendor/github.com/klauspost/cpuid/v2/cpuid.go @@ -3,7 +3,7 @@ // Package cpuid provides information about the CPU running the current program. // // CPU features are detected on startup, and kept for fast access through the life of the application. -// Currently x86 / x64 (AMD64) as well as arm64 is supported. +// Currently x86 / x64 (AMD64), arm64, and riscv64 are supported. // // You can access the CPU information by accessing the shared CPU variable of the cpuid library. // @@ -17,6 +17,7 @@ import ( "math/bits" "os" "runtime" + "slices" "strings" ) @@ -61,6 +62,13 @@ const ( SRE Apple + // RISC-V vendors + SiFive + StarFive + THead + Andes + SpacemiT + lastVendor ) @@ -95,6 +103,7 @@ const ( AVX2 // AVX2 functions AVX512BF16 // AVX-512 BFLOAT16 Instructions AVX512BITALG // AVX-512 Bit Algorithms + AVX512BMM // AVX-512 Bit Manipulation Instructions AVX512BW // AVX-512 Byte and Word Instructions AVX512CD // AVX-512 Conflict Detection Instructions AVX512DQ // AVX-512 Doubleword and Quadword Instructions @@ -139,6 +148,7 @@ const ( FMA4 // Bulldozer FMA4 functions FP128 // AMD: When set, the internal FP/SIMD execution datapath is no more than 128-bits wide FP256 // AMD: When set, the internal FP/SIMD execution datapath is no more than 256-bits wide + FRED // Flexible Return and Event Delivery FSRM // Fast Short Rep Mov FXSR // FXSAVE, FXRESTOR instructions, CR4 bit 9 FXSROPT // FXSAVE/FXRSTOR optimizations @@ -220,6 +230,7 @@ const ( SEV_SNP // AMD SEV Secure Nested Paging supported SGX // Software Guard Extensions SGXLC // Software Guard Extensions Launch Control + SGXPQC // Software Guard Extensions 256-bit Encryption SHA // Intel SHA Extensions SME // AMD Secure Memory Encryption supported SME_COHERENT // AMD Hardware cache coherency across encryption domains enforced @@ -255,6 +266,9 @@ const ( TLB_FLUSH_NESTED // AMD: Flushing includes all the nested translations for guest translations TME // Intel Total Memory Encryption. The following MSRs are supported: IA32_TME_CAPABILITY, IA32_TME_ACTIVATE, IA32_TME_EXCLUDE_MASK, and IA32_TME_EXCLUDE_BASE. TOPEXT // TopologyExtensions: topology extensions support. Indicates support for CPUID Fn8000_001D_EAX_x[N:0]-CPUID Fn8000_001E_EDX. + TSA_L1_NO // AMD only: Not vulnerable to TSA-L1 + TSA_SQ_NO // AM onlyD: Not vulnerable to TSA-SQ + TSA_VERW_CLEAR // If set, the memory form of the VERW instruction may be used to help mitigate TSA TSCRATEMSR // MSR based TSC rate control. Indicates support for MSR TSC ratio MSRC000_0104 TSXLDTRK // Intel TSX Suspend Load Address Tracking VAES // Vector AES. AVX(512) versions requires additional checks. @@ -304,6 +318,77 @@ const ( SM3 // SM3 instructions SM4 // SM4 instructions SVE // Scalable Vector Extension + SVE2 // Scalable Vector Extension 2 + SB // Speculation barrier (SB instruction) + SSBS // Speculative Store Bypass Safe (PSTATE.SSBS) + BTI // Branch Target Identification + FLAGM2 // Condition flag manipulation version 2 (AXFLAG, XAFLAG) + FRINTTS // Floating-point to integer rounding (FRINT32Z, FRINT64Z, etc) + DCPODP // Data cache clean to Point of Deep Persistence (DC CVADP) + BF16 // BFloat16 instructions (BFDOT, BFMMLA, etc) + I8MM // Int8 matrix multiplication (SMMLA, UMMLA, USMMLA) + WFXT // WFE/WFI with timeout (WFET, WFIT) + MOPS // Memory copy and set instructions (CPYF, SETP, etc) + HBC // Hinted conditional branches (BC.cond) + CSSC // Common short sequence compression (ABS, SMAX, UMAX, etc) + + // PMU + PMU_FIXEDCOUNTER_CYCLES + PMU_FIXEDCOUNTER_REFCYCLES + PMU_FIXEDCOUNTER_INSTRUCTIONS + PMU_FIXEDCOUNTER_TOPDOWN_SLOTS + + // RISC-V features + RV_IMA // IMA base (Integer, Multiply, Atomic) + RV_C // Compressed instructions + RV_F // Single-precision FP + RV_D // Double-precision FP + RV_V // Vector extension (V) + RV_ZBA // Address generation + RV_ZBB // Basic bit manipulation + RV_ZBC // Carry-less multiplication + RV_ZBS // Single-bit manipulation + RV_ZICOND // Integer conditional operations + RV_ZIHINTPAUSE // Pause hint + RV_ZICBOM // Cache block management operations + RV_ZICBOZ // Cache block zero + RV_ZICBOP // Cache block prefetch + RV_ZFA // Additional floating-point + RV_ZFH // Half-precision FP + RV_ZFHMIN // Minimal half-precision FP + RV_ZTSO // Total store ordering + RV_ZACAS // Atomic CAS + // Scalar cryptography + RV_ZBKB // Bit-manipulation for crypto + RV_ZBKC // Carry-less multiply for crypto + RV_ZBKX // Crossbar permutations + RV_ZKND // NIST Suite: AES decrypt + RV_ZKNE // NIST Suite: AES encrypt + RV_ZKNH // NIST Suite: SHA-2 (SHA-256/SHA-512) + RV_ZKSED // ShangMi Suite: SM4 block cipher + RV_ZKSH // ShangMi Suite: SM3 hash + RV_ZKT // Data-independent execution latency (Crypto) + + // Scalar crypto suites (combined from individual extensions) + RV_ZKN // NIST Algorithm Suite (Zknd+Zkne+Zknh+Zbkb+Zbkc+Zbkx+Zkt) + RV_ZKS // ShangMi Algorithm Suite (Zksed+Zksh+Zbkb+Zbkc+Zbkx+Zkt) + + // Vector cryptography + RV_ZVBB // Vector Basic Bit-manipulation + RV_ZVBC // Vector Carry-less multiply + RV_ZVKB // Vector Bit-manipulation for crypto + RV_ZVKG // Vector GCM/GMAC + RV_ZVKNED // NIST Suite: Vector AES encrypt+decrypt + RV_ZVKNHA // NIST Suite: Vector SHA-2 (SHA-256) + RV_ZVKNHB // NIST Suite: Vector SHA-2 (SHA-512) + RV_ZVKSED // ShangMi Suite: Vector SM4 + RV_ZVKSH // ShangMi Suite: Vector SM3 hash + RV_ZVKT // Vector Data-independent execution latency + + // Vector crypto suites (combined from individual extensions) + RV_ZVKNG // NIST Suite with GCM (Zvkned+Zvknhb+Zvkg+Zvkb+Zvkt) + RV_ZVKSG // ShangMi Suite with GCM (Zvksed+Zvksh+Zvkg+Zvkb+Zvkt) + // Keep it last. It automatically defines the size of []flagSet lastID @@ -336,11 +421,36 @@ type CPUInfo struct { SGX SGXSupport AMDMemEncryption AMDMemEncryptionSupport AVX10Level uint8 + PMU PerformanceMonitoringInfo // holds information about the PMU maxFunc uint32 maxExFunc uint32 } +// PerformanceMonitoringInfo holds information about CPU performance monitoring capabilities. +// This is primarily populated from CPUID leaf 0xAh on x86 +type PerformanceMonitoringInfo struct { + // VersionID (x86 only): Version ID of architectural performance monitoring. + // A value of 0 means architectural performance monitoring is not supported or information is unavailable. + VersionID uint8 + // NumGPPMC: Number of General-Purpose Performance Monitoring Counters per logical processor. + // On ARM, this is derived from PMCR_EL0.N (number of event counters). + NumGPCounters uint8 + // GPPMCWidth: Bit width of General-Purpose Performance Monitoring Counters. + // On ARM, typically 64 for PMU event counters. + GPPMCWidth uint8 + // NumFixedPMC: Number of Fixed-Function Performance Counters. + // Valid on x86 if VersionID > 1. On ARM, this typically includes at least the cycle counter (PMCCNTR_EL0). + NumFixedPMC uint8 + // FixedPMCWidth: Bit width of Fixed-Function Performance Counters. + // Valid on x86 if VersionID > 1. On ARM, the cycle counter (PMCCNTR_EL0) is 64-bit. + FixedPMCWidth uint8 + // Raw register output from CPUID leaf 0xAh. + RawEBX uint32 + RawEAX uint32 + RawEDX uint32 +} + var cpuid func(op uint32) (eax, ebx, ecx, edx uint32) var cpuidex func(op, op2 uint32) (eax, ebx, ecx, edx uint32) var xgetbv func(index uint32) (eax, edx uint32) @@ -383,8 +493,8 @@ func Detect() { os.Exit(1) } if disableFlag != nil { - s := strings.Split(*disableFlag, ",") - for _, feat := range s { + s := strings.SplitSeq(*disableFlag, ",") + for feat := range s { feat := ParseFeature(strings.TrimSpace(feat)) if feat != UNKNOWN { CPU.featureSet.unset(feat) @@ -435,12 +545,7 @@ func (c *CPUInfo) Has(id FeatureID) bool { // AnyOf returns whether the CPU supports one or more of the requested features. func (c CPUInfo) AnyOf(ids ...FeatureID) bool { - for _, id := range ids { - if c.featureSet.inSet(id) { - return true - } - } - return false + return slices.ContainsFunc(ids, c.featureSet.inSet) } // Features contains several features combined for a fast check using @@ -460,6 +565,11 @@ func (c *CPUInfo) HasAll(f Features) bool { return c.featureSet.hasSetP(f) } +// HasOneOf returns whether the CPU supports one or more of the requested features. +func (c *CPUInfo) HasOneOf(f Features) bool { + return c.featureSet.hasOneOf(f) +} + // https://en.wikipedia.org/wiki/X86-64#Microarchitecture_levels var oneOfLevel = CombineFeatures(SYSEE, SYSCALL) var level1Features = CombineFeatures(CMOV, CMPXCHG8, X87, FXSR, MMX, SSE, SSE2) @@ -467,6 +577,56 @@ var level2Features = CombineFeatures(CMOV, CMPXCHG8, X87, FXSR, MMX, SSE, SSE2, var level3Features = CombineFeatures(CMOV, CMPXCHG8, X87, FXSR, MMX, SSE, SSE2, CX16, LAHF, POPCNT, SSE3, SSE4, SSE42, SSSE3, AVX, AVX2, BMI1, BMI2, F16C, FMA3, LZCNT, MOVBE, OSXSAVE) var level4Features = CombineFeatures(CMOV, CMPXCHG8, X87, FXSR, MMX, SSE, SSE2, CX16, LAHF, POPCNT, SSE3, SSE4, SSE42, SSSE3, AVX, AVX2, BMI1, BMI2, F16C, FMA3, LZCNT, MOVBE, OSXSAVE, AVX512F, AVX512BW, AVX512CD, AVX512DQ, AVX512VL) +// RV_CRYPTO_FEATS contains all RISC-V scalar cryptography instruction extensions (excludes Zkt since it is a timing guarantee, not a computational instruction). +var RV_CRYPTO_FEATS = CombineFeatures(RV_ZBKB, RV_ZBKC, RV_ZBKX, RV_ZKND, RV_ZKNE, RV_ZKNH, RV_ZKSED, RV_ZKSH) + +// RV_VECTOR_CRYPTO_FEATS contains all RISC-V vector cryptography extensions. +var RV_VECTOR_CRYPTO_FEATS = CombineFeatures(RV_ZVBB, RV_ZVBC, RV_ZVKB, RV_ZVKG, RV_ZVKNED, RV_ZVKNHA, RV_ZVKNHB, RV_ZVKSED, RV_ZVKSH) + +// RISC-V application profile feature sets. +// https://github.com/riscv/riscv-profiles +var rvProfile20Features = CombineFeatures(RV_IMA, RV_C, RV_F, RV_D) +var rvProfile22Features = CombineFeatures(RV_IMA, RV_C, RV_F, RV_D, RV_ZBA, RV_ZBB, RV_ZBS, RV_ZFHMIN, RV_ZICBOM, RV_ZICBOP, RV_ZICBOZ, RV_ZIHINTPAUSE) +var rvProfile23Features = CombineFeatures(RV_IMA, RV_C, RV_F, RV_D, RV_ZBA, RV_ZBB, RV_ZBS, RV_ZFHMIN, RV_ZICBOM, RV_ZICBOP, RV_ZICBOZ, RV_ZIHINTPAUSE, RV_V, RV_ZFA, RV_ZICOND, RV_ZVBB, RV_ZVKB) + +// RISC-V crypto suites — combined from individual extensions. +var rvZKNFeatures = CombineFeatures(RV_ZKND, RV_ZKNE, RV_ZKNH, RV_ZBKB, RV_ZBKC, RV_ZBKX, RV_ZKT) +var rvZKSFeatures = CombineFeatures(RV_ZKSED, RV_ZKSH, RV_ZBKB, RV_ZBKC, RV_ZBKX, RV_ZKT) +var rvZVKNFeatures = CombineFeatures(RV_ZVKNED, RV_ZVKNHB, RV_ZVKG, RV_ZVKB, RV_ZVKT) +var rvZVKSFeatures = CombineFeatures(RV_ZVKSED, RV_ZVKSH, RV_ZVKG, RV_ZVKB, RV_ZVKT) + +// ARM64 architecture levels. armV8Levels[m] is the cumulative set of mandatory +// user-space instruction features added up to and including ARMv8.m that this +// package can detect. EL1/system-only features (PAN, VHE, CSV2/CSV3, ECV, ...) +// are excluded since they are irrelevant to user-space code generation, exactly +// as X64Level ignores non-instruction features. +// +// FEAT_SSBS and FEAT_BTI, although mandatory from ARMv8.5, are intentionally NOT +// required. Both are OS-policy-gated security features (speculative store bypass +// safety and branch-target identification) that Go code generation never depends +// on: their HWCAP/sysctl bits are set only when the OS or hypervisor enables the +// protection, not purely from CPU capability, so they are routinely hidden even +// on capable silicon (neither a Neoverse N2 Linux guest nor Apple Silicon reports +// them). Requiring them would cap such CPUs at v8.4. Both are still detected and +// reported through FeatureSet when present. +// https://go.dev/wiki/MinimumRequirements#arm64 +var armV8Levels = [...]Features{ + CombineFeatures(FP, ASIMD), // v8.0 + CombineFeatures(FP, ASIMD, ATOMICS, CRC32, ASIMDRDM), // v8.1 + CombineFeatures(FP, ASIMD, ATOMICS, CRC32, ASIMDRDM, DCPOP), // v8.2 + CombineFeatures(FP, ASIMD, ATOMICS, CRC32, ASIMDRDM, DCPOP, JSCVT, FCMA, LRCPC), // v8.3 + CombineFeatures(FP, ASIMD, ATOMICS, CRC32, ASIMDRDM, DCPOP, JSCVT, FCMA, LRCPC, TS), // v8.4 + CombineFeatures(FP, ASIMD, ATOMICS, CRC32, ASIMDRDM, DCPOP, JSCVT, FCMA, LRCPC, TS, SB, FRINTTS, FLAGM2, DCPODP), // v8.5 + CombineFeatures(FP, ASIMD, ATOMICS, CRC32, ASIMDRDM, DCPOP, JSCVT, FCMA, LRCPC, TS, SB, FRINTTS, FLAGM2, DCPODP, BF16, I8MM), // v8.6 + CombineFeatures(FP, ASIMD, ATOMICS, CRC32, ASIMDRDM, DCPOP, JSCVT, FCMA, LRCPC, TS, SB, FRINTTS, FLAGM2, DCPODP, BF16, I8MM, WFXT), // v8.7 + CombineFeatures(FP, ASIMD, ATOMICS, CRC32, ASIMDRDM, DCPOP, JSCVT, FCMA, LRCPC, TS, SB, FRINTTS, FLAGM2, DCPODP, BF16, I8MM, WFXT, MOPS, HBC), // v8.8 + CombineFeatures(FP, ASIMD, ATOMICS, CRC32, ASIMDRDM, DCPOP, JSCVT, FCMA, LRCPC, TS, SB, FRINTTS, FLAGM2, DCPODP, BF16, I8MM, WFXT, MOPS, HBC, CSSC), // v8.9 +} + +// armCrypto matches the GOARM64 ",crypto" option: FEAT_AES, FEAT_PMULL, +// FEAT_SHA1 and FEAT_SHA256. +var armCrypto = CombineFeatures(AESARM, PMULL, SHA1, SHA2) + // X64Level returns the microarchitecture level detected on the CPU. // If features are lacking or non x64 mode, 0 is returned. // See https://en.wikipedia.org/wiki/X86-64#Microarchitecture_levels @@ -489,6 +649,67 @@ func (c CPUInfo) X64Level() int { return 0 } +// RVProfile returns the RISC-V application profile level. +// 0 = unknown / base ISA only, 20 = RVA20, 22 = RVA22, 23 = RVA23. +// Returns 0 on non-RISC-V architectures or if not detected. +// https://github.com/riscv/riscv-profiles +func (c CPUInfo) RVProfile() int { + switch { + case c.featureSet.hasSetP(rvProfile23Features): + return 23 + case c.featureSet.hasSetP(rvProfile22Features): + return 22 + case c.featureSet.hasSetP(rvProfile20Features): + return 20 + default: + return 0 + } +} + +// ARM64Level returns the ARMv8/ARMv9 architecture version supported by the CPU +// as (major, minor), e.g. 8, 4 for ARMv8.4-A or 9, 0 for ARMv9.0-A. +// Only mandatory user-space instruction features are considered, so the result +// is the highest level whose required instructions are all present. +// Returns 0, 0 on non-arm64 CPUs or when feature detection was unavailable. +func (c CPUInfo) ARM64Level() (major, minor int) { + if !c.featureSet.hasSetP(armV8Levels[0]) { + return 0, 0 + } + m8 := 0 + for m := len(armV8Levels) - 1; m >= 1; m-- { + if c.featureSet.hasSetP(armV8Levels[m]) { + m8 = m + break + } + } + // ARMv9.x mandates everything in ARMv8.(x+5) plus SVE2. + if m8 >= 5 && c.featureSet.inSet(SVE2) { + return 9, m8 - 5 + } + return 8, m8 +} + +// GOARM64 returns a value usable as the GOARM64 build setting for the detected +// CPU, e.g. "v8.4" or "v9.0,crypto". The ",crypto" suffix is appended when AES, +// PMULL, SHA1 and SHA256 are all present; the ",lse" suffix is appended in the +// rare case LSE is present without the rest of the ARMv8.1 feature set. +// Returns "" on non-arm64 CPUs or when feature detection was unavailable. +// See https://go.dev/wiki/MinimumRequirements#arm64 +func (c CPUInfo) GOARM64() string { + major, minor := c.ARM64Level() + if major == 0 { + return "" + } + v := fmt.Sprintf("v%d.%d", major, minor) + if major == 8 && minor == 0 && c.featureSet.inSet(ATOMICS) { + v += ",lse" + } + if c.featureSet.hasSetP(armCrypto) { + v += ",crypto" + } + return v +} + // Disable will disable one or several features. func (c *CPUInfo) Disable(ids ...FeatureID) bool { for _, id := range ids { @@ -735,7 +956,7 @@ func flagSetWith(feat ...FeatureID) flagSet { // Will return UNKNOWN if not found. func ParseFeature(s string) FeatureID { s = strings.ToUpper(s) - for i := firstID; i < lastID; i++ { + for i := range lastID { if i.String() == s { return i } @@ -749,7 +970,7 @@ func (s flagSet) Strings() []string { return []string{""} } r := make([]string, 0) - for i := firstID; i < lastID; i++ { + for i := range lastID { if s.inSet(i) { r = append(r, i.String()) } @@ -770,7 +991,7 @@ func maxFunctionID() uint32 { func brandName() string { if maxExtendedFunction() >= 0x80000004 { v := make([]uint32, 0, 48) - for i := uint32(0); i < 3; i++ { + for i := range uint32(3) { a, b, c, d := cpuid(0x80000002 + i) v = append(v, a, b, c, d) } @@ -1039,7 +1260,7 @@ func (c *CPUInfo) cacheSize() { // Hack: When we encounter the same entry 100 times we break. nSame := 0 var last uint32 - for i := uint32(0); i < math.MaxUint32; i++ { + for i := range uint32(math.MaxUint32) { eax, ebx, ecx, _ := cpuidex(0x8000001D, i) level := (eax >> 5) & 7 @@ -1293,6 +1514,7 @@ func support() flagSet { fs.setIf(eax1&(1<<10) != 0, MOVSB_ZL) fs.setIf(eax1&(1<<11) != 0, STOSB_SHORT) fs.setIf(eax1&(1<<12) != 0, CMPSB_SCADBS_SHORT) + fs.setIf(eax1&(1<<17) != 0, FRED) fs.setIf(eax1&(1<<22) != 0, HRESET) fs.setIf(eax1&(1<<23) != 0, AVXIFMA) fs.setIf(eax1&(1<<26) != 0, LAM) @@ -1358,6 +1580,11 @@ func support() flagSet { fs.setIf(edx&(1<<4) != 0, BHI_CTRL) fs.setIf(edx&(1<<5) != 0, MCDT_NO) + if fs.inSet(SGX) { + eax, _, _, _ := cpuidex(0x12, 0) + fs.setIf(eax&(1<<12) != 0, SGXPQC) + } + // Add keylocker features. if fs.inSet(KEYLOCKER) && mfi >= 0x19 { _, ebx, _, _ := cpuidex(0x19, 0) @@ -1371,6 +1598,7 @@ func support() flagSet { fs.setIf(ebx&(1<<17) != 0, AVX10_256) fs.setIf(ebx&(1<<18) != 0, AVX10_512) } + } // Processor Extended State Enumeration Sub-leaf (EAX = 0DH, ECX = 1) @@ -1514,12 +1742,29 @@ func support() flagSet { } if maxExtendedFunction() >= 0x80000021 && vend == AMD { - a, _, _, _ := cpuid(0x80000021) + a, _, c, _ := cpuid(0x80000021) fs.setIf((a>>31)&1 == 1, SRSO_MSR_FIX) fs.setIf((a>>30)&1 == 1, SRSO_USER_KERNEL_NO) fs.setIf((a>>29)&1 == 1, SRSO_NO) fs.setIf((a>>28)&1 == 1, IBPB_BRTYPE) fs.setIf((a>>27)&1 == 1, SBPB) + fs.setIf((a>>23)&1 == 1, AVX512BMM) + fs.setIf((c>>1)&1 == 1, TSA_L1_NO) + fs.setIf((c>>2)&1 == 1, TSA_SQ_NO) + fs.setIf((a>>5)&1 == 1, TSA_VERW_CLEAR) + } + if vend == AMD { + if family < 0x19 { + // AMD CPUs that are older than Family 19h are not vulnerable to TSA but do not set TSA_L1_NO or TSA_SQ_NO. + // Source: https://www.amd.com/content/dam/amd/en/documents/resources/bulletin/technical-guidance-for-mitigating-transient-scheduler-attacks.pdf + fs.set(TSA_L1_NO) + fs.set(TSA_SQ_NO) + } else if family == 0x1a { + // AMD Family 1Ah models 00h-4Fh and 60h-7Fh are also not vulnerable to TSA but do not set TSA_L1_NO or TSA_SQ_NO. + // Future AMD CPUs will set these CPUID bits if appropriate. CPUs will be designed to set these CPUID bits if appropriate. + notVuln := model <= 0x4f || (model >= 0x60 && model <= 0x7f) + fs.setIf(notVuln, TSA_L1_NO, TSA_SQ_NO) + } } if mfi >= 0x20 { @@ -1575,3 +1820,47 @@ func valAsString(values ...uint32) []byte { } return r } + +func parseLeaf0AH(c *CPUInfo, eax, ebx, edx uint32) (info PerformanceMonitoringInfo) { + info.VersionID = uint8(eax & 0xFF) + info.NumGPCounters = uint8((eax >> 8) & 0xFF) + info.GPPMCWidth = uint8((eax >> 16) & 0xFF) + + info.RawEBX = ebx + info.RawEAX = eax + info.RawEDX = edx + + if info.VersionID > 1 { // This information is only valid if VersionID > 1 + info.NumFixedPMC = uint8(edx & 0x1F) // Bits 4:0 + info.FixedPMCWidth = uint8((edx >> 5) & 0xFF) // Bits 12:5 + } + if info.VersionID > 0 { + // first 4 fixed events are always instructions retired, cycles, ref cycles and topdown slots + if ebx == 0x0 && info.NumFixedPMC == 3 { + c.featureSet.set(PMU_FIXEDCOUNTER_INSTRUCTIONS) + c.featureSet.set(PMU_FIXEDCOUNTER_CYCLES) + c.featureSet.set(PMU_FIXEDCOUNTER_REFCYCLES) + } + if ebx == 0x0 && info.NumFixedPMC == 4 { + c.featureSet.set(PMU_FIXEDCOUNTER_INSTRUCTIONS) + c.featureSet.set(PMU_FIXEDCOUNTER_CYCLES) + c.featureSet.set(PMU_FIXEDCOUNTER_REFCYCLES) + c.featureSet.set(PMU_FIXEDCOUNTER_TOPDOWN_SLOTS) + } + if ebx != 0x0 { + if ((ebx >> 0) & 1) == 0 { + c.featureSet.set(PMU_FIXEDCOUNTER_INSTRUCTIONS) + } + if ((ebx >> 1) & 1) == 0 { + c.featureSet.set(PMU_FIXEDCOUNTER_CYCLES) + } + if ((ebx >> 2) & 1) == 0 { + c.featureSet.set(PMU_FIXEDCOUNTER_REFCYCLES) + } + if ((ebx >> 3) & 1) == 0 { + c.featureSet.set(PMU_FIXEDCOUNTER_TOPDOWN_SLOTS) + } + } + } + return info +} diff --git a/vendor/github.com/klauspost/cpuid/v2/detect_arm64.go b/vendor/github.com/klauspost/cpuid/v2/detect_arm64.go index 9ae32d607dc..e615b10be7d 100644 --- a/vendor/github.com/klauspost/cpuid/v2/detect_arm64.go +++ b/vendor/github.com/klauspost/cpuid/v2/detect_arm64.go @@ -1,7 +1,6 @@ // Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. //go:build arm64 && !gccgo && !noasm && !appengine -// +build arm64,!gccgo,!noasm,!appengine package cpuid @@ -189,6 +188,7 @@ func addInfo(c *CPUInfo, safe bool) { f.setIf(instAttrReg0&(0xf<<60) != 0, RNDR) f.setIf(instAttrReg0&(0xf<<56) != 0, TLB) f.setIf(instAttrReg0&(0xf<<52) != 0, TS) + f.setIf(instAttrReg0&(0xf<<52) == 2<<52, FLAGM2) // TS == 0b0010 (FEAT_FlagM2) f.setIf(instAttrReg0&(0xf<<48) != 0, FHM) f.setIf(instAttrReg0&(0xf<<44) != 0, ASIMDDP) f.setIf(instAttrReg0&(0xf<<40) != 0, SM4) @@ -244,6 +244,13 @@ func addInfo(c *CPUInfo, safe bool) { // fmt.Println("APA") // } f.setIf(instAttrReg1&(0xf<<0) != 0, DCPOP) + f.setIf(instAttrReg1&(0xf<<0) == 2<<0, DCPODP) // DPB == 0b0010 (FEAT_DPB2) + + // Upper ID_AA64ISAR1_EL1 fields, not in the table above. + f.setIf(instAttrReg1&(0xf<<32) != 0, FRINTTS) // bits [35:32] + f.setIf(instAttrReg1&(0xf<<36) != 0, SB) // bits [39:36] + f.setIf(instAttrReg1&(0xf<<44) != 0, BF16) // bits [47:44] + f.setIf(instAttrReg1&(0xf<<52) != 0, I8MM) // bits [55:52] // Store c.featureSet.or(f) diff --git a/vendor/github.com/klauspost/cpuid/v2/detect_ref.go b/vendor/github.com/klauspost/cpuid/v2/detect_ref.go index 574f9389c07..38699f4d78a 100644 --- a/vendor/github.com/klauspost/cpuid/v2/detect_ref.go +++ b/vendor/github.com/klauspost/cpuid/v2/detect_ref.go @@ -1,7 +1,6 @@ // Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. -//go:build (!amd64 && !386 && !arm64) || gccgo || noasm || appengine -// +build !amd64,!386,!arm64 gccgo noasm appengine +//go:build (!amd64 && !386 && !arm64 && !riscv64) || ((amd64 || 386) && (gccgo || noasm || appengine)) package cpuid diff --git a/vendor/github.com/klauspost/cpuid/v2/detect_ref_arm64.go b/vendor/github.com/klauspost/cpuid/v2/detect_ref_arm64.go new file mode 100644 index 00000000000..d2ea76ba823 --- /dev/null +++ b/vendor/github.com/klauspost/cpuid/v2/detect_ref_arm64.go @@ -0,0 +1,19 @@ +// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. + +//go:build arm64 && (gccgo || noasm || appengine) + +package cpuid + +func initCPU() { + cpuid = func(uint32) (a, b, c, d uint32) { return 0, 0, 0, 0 } + cpuidex = func(x, y uint32) (a, b, c, d uint32) { return 0, 0, 0, 0 } + xgetbv = func(uint32) (a, b uint32) { return 0, 0 } + rdtscpAsm = func() (a, b, c, d uint32) { return 0, 0, 0, 0 } +} + +func addInfo(c *CPUInfo, safe bool) { + c.CacheLine = 64 + detectOS(c) +} + +func getVectorLength() (vl, pl uint64) { return 0, 0 } diff --git a/vendor/github.com/klauspost/cpuid/v2/detect_riscv64.go b/vendor/github.com/klauspost/cpuid/v2/detect_riscv64.go new file mode 100644 index 00000000000..25381f08982 --- /dev/null +++ b/vendor/github.com/klauspost/cpuid/v2/detect_riscv64.go @@ -0,0 +1,16 @@ +// Copyright (c) 2026 Klaus Post, released under MIT License. See LICENSE file. + +package cpuid + +func getVectorLength() (vl, pl uint64) { return 0, 0 } + +func initCPU() { + cpuid = func(uint32) (a, b, c, d uint32) { return 0, 0, 0, 0 } + cpuidex = func(x, y uint32) (a, b, c, d uint32) { return 0, 0, 0, 0 } + xgetbv = func(uint32) (a, b uint32) { return 0, 0 } + rdtscpAsm = func() (a, b, c, d uint32) { return 0, 0, 0, 0 } +} + +func addInfo(c *CPUInfo, safe bool) { + detectOS(c) +} diff --git a/vendor/github.com/klauspost/cpuid/v2/detect_x86.go b/vendor/github.com/klauspost/cpuid/v2/detect_x86.go index f924c9d8399..22819ce4a91 100644 --- a/vendor/github.com/klauspost/cpuid/v2/detect_x86.go +++ b/vendor/github.com/klauspost/cpuid/v2/detect_x86.go @@ -1,7 +1,6 @@ // Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. //go:build (386 && !gccgo && !noasm && !appengine) || (amd64 && !gccgo && !noasm && !appengine) -// +build 386,!gccgo,!noasm,!appengine amd64,!gccgo,!noasm,!appengine package cpuid @@ -36,6 +35,10 @@ func addInfo(c *CPUInfo, safe bool) { c.AVX10Level = c.supportAVX10() c.cacheSize() c.frequencies() + if c.maxFunc >= 0x0A { + eax, ebx, _, edx := cpuid(0x0A) + c.PMU = parseLeaf0AH(c, eax, ebx, edx) + } } func getVectorLength() (vl, pl uint64) { return 0, 0 } diff --git a/vendor/github.com/klauspost/cpuid/v2/featureid_string.go b/vendor/github.com/klauspost/cpuid/v2/featureid_string.go index 07704351faf..f88ead13080 100644 --- a/vendor/github.com/klauspost/cpuid/v2/featureid_string.go +++ b/vendor/github.com/klauspost/cpuid/v2/featureid_string.go @@ -29,226 +29,292 @@ func _() { _ = x[AVX2-19] _ = x[AVX512BF16-20] _ = x[AVX512BITALG-21] - _ = x[AVX512BW-22] - _ = x[AVX512CD-23] - _ = x[AVX512DQ-24] - _ = x[AVX512ER-25] - _ = x[AVX512F-26] - _ = x[AVX512FP16-27] - _ = x[AVX512IFMA-28] - _ = x[AVX512PF-29] - _ = x[AVX512VBMI-30] - _ = x[AVX512VBMI2-31] - _ = x[AVX512VL-32] - _ = x[AVX512VNNI-33] - _ = x[AVX512VP2INTERSECT-34] - _ = x[AVX512VPOPCNTDQ-35] - _ = x[AVXIFMA-36] - _ = x[AVXNECONVERT-37] - _ = x[AVXSLOW-38] - _ = x[AVXVNNI-39] - _ = x[AVXVNNIINT8-40] - _ = x[AVXVNNIINT16-41] - _ = x[BHI_CTRL-42] - _ = x[BMI1-43] - _ = x[BMI2-44] - _ = x[CETIBT-45] - _ = x[CETSS-46] - _ = x[CLDEMOTE-47] - _ = x[CLMUL-48] - _ = x[CLZERO-49] - _ = x[CMOV-50] - _ = x[CMPCCXADD-51] - _ = x[CMPSB_SCADBS_SHORT-52] - _ = x[CMPXCHG8-53] - _ = x[CPBOOST-54] - _ = x[CPPC-55] - _ = x[CX16-56] - _ = x[EFER_LMSLE_UNS-57] - _ = x[ENQCMD-58] - _ = x[ERMS-59] - _ = x[F16C-60] - _ = x[FLUSH_L1D-61] - _ = x[FMA3-62] - _ = x[FMA4-63] - _ = x[FP128-64] - _ = x[FP256-65] - _ = x[FSRM-66] - _ = x[FXSR-67] - _ = x[FXSROPT-68] - _ = x[GFNI-69] - _ = x[HLE-70] - _ = x[HRESET-71] - _ = x[HTT-72] - _ = x[HWA-73] - _ = x[HYBRID_CPU-74] - _ = x[HYPERVISOR-75] - _ = x[IA32_ARCH_CAP-76] - _ = x[IA32_CORE_CAP-77] - _ = x[IBPB-78] - _ = x[IBPB_BRTYPE-79] - _ = x[IBRS-80] - _ = x[IBRS_PREFERRED-81] - _ = x[IBRS_PROVIDES_SMP-82] - _ = x[IBS-83] - _ = x[IBSBRNTRGT-84] - _ = x[IBSFETCHSAM-85] - _ = x[IBSFFV-86] - _ = x[IBSOPCNT-87] - _ = x[IBSOPCNTEXT-88] - _ = x[IBSOPSAM-89] - _ = x[IBSRDWROPCNT-90] - _ = x[IBSRIPINVALIDCHK-91] - _ = x[IBS_FETCH_CTLX-92] - _ = x[IBS_OPDATA4-93] - _ = x[IBS_OPFUSE-94] - _ = x[IBS_PREVENTHOST-95] - _ = x[IBS_ZEN4-96] - _ = x[IDPRED_CTRL-97] - _ = x[INT_WBINVD-98] - _ = x[INVLPGB-99] - _ = x[KEYLOCKER-100] - _ = x[KEYLOCKERW-101] - _ = x[LAHF-102] - _ = x[LAM-103] - _ = x[LBRVIRT-104] - _ = x[LZCNT-105] - _ = x[MCAOVERFLOW-106] - _ = x[MCDT_NO-107] - _ = x[MCOMMIT-108] - _ = x[MD_CLEAR-109] - _ = x[MMX-110] - _ = x[MMXEXT-111] - _ = x[MOVBE-112] - _ = x[MOVDIR64B-113] - _ = x[MOVDIRI-114] - _ = x[MOVSB_ZL-115] - _ = x[MOVU-116] - _ = x[MPX-117] - _ = x[MSRIRC-118] - _ = x[MSRLIST-119] - _ = x[MSR_PAGEFLUSH-120] - _ = x[NRIPS-121] - _ = x[NX-122] - _ = x[OSXSAVE-123] - _ = x[PCONFIG-124] - _ = x[POPCNT-125] - _ = x[PPIN-126] - _ = x[PREFETCHI-127] - _ = x[PSFD-128] - _ = x[RDPRU-129] - _ = x[RDRAND-130] - _ = x[RDSEED-131] - _ = x[RDTSCP-132] - _ = x[RRSBA_CTRL-133] - _ = x[RTM-134] - _ = x[RTM_ALWAYS_ABORT-135] - _ = x[SBPB-136] - _ = x[SERIALIZE-137] - _ = x[SEV-138] - _ = x[SEV_64BIT-139] - _ = x[SEV_ALTERNATIVE-140] - _ = x[SEV_DEBUGSWAP-141] - _ = x[SEV_ES-142] - _ = x[SEV_RESTRICTED-143] - _ = x[SEV_SNP-144] - _ = x[SGX-145] - _ = x[SGXLC-146] - _ = x[SHA-147] - _ = x[SME-148] - _ = x[SME_COHERENT-149] - _ = x[SM3_X86-150] - _ = x[SM4_X86-151] - _ = x[SPEC_CTRL_SSBD-152] - _ = x[SRBDS_CTRL-153] - _ = x[SRSO_MSR_FIX-154] - _ = x[SRSO_NO-155] - _ = x[SRSO_USER_KERNEL_NO-156] - _ = x[SSE-157] - _ = x[SSE2-158] - _ = x[SSE3-159] - _ = x[SSE4-160] - _ = x[SSE42-161] - _ = x[SSE4A-162] - _ = x[SSSE3-163] - _ = x[STIBP-164] - _ = x[STIBP_ALWAYSON-165] - _ = x[STOSB_SHORT-166] - _ = x[SUCCOR-167] - _ = x[SVM-168] - _ = x[SVMDA-169] - _ = x[SVMFBASID-170] - _ = x[SVML-171] - _ = x[SVMNP-172] - _ = x[SVMPF-173] - _ = x[SVMPFT-174] - _ = x[SYSCALL-175] - _ = x[SYSEE-176] - _ = x[TBM-177] - _ = x[TDX_GUEST-178] - _ = x[TLB_FLUSH_NESTED-179] - _ = x[TME-180] - _ = x[TOPEXT-181] - _ = x[TSCRATEMSR-182] - _ = x[TSXLDTRK-183] - _ = x[VAES-184] - _ = x[VMCBCLEAN-185] - _ = x[VMPL-186] - _ = x[VMSA_REGPROT-187] - _ = x[VMX-188] - _ = x[VPCLMULQDQ-189] - _ = x[VTE-190] - _ = x[WAITPKG-191] - _ = x[WBNOINVD-192] - _ = x[WRMSRNS-193] - _ = x[X87-194] - _ = x[XGETBV1-195] - _ = x[XOP-196] - _ = x[XSAVE-197] - _ = x[XSAVEC-198] - _ = x[XSAVEOPT-199] - _ = x[XSAVES-200] - _ = x[AESARM-201] - _ = x[ARMCPUID-202] - _ = x[ASIMD-203] - _ = x[ASIMDDP-204] - _ = x[ASIMDHP-205] - _ = x[ASIMDRDM-206] - _ = x[ATOMICS-207] - _ = x[CRC32-208] - _ = x[DCPOP-209] - _ = x[EVTSTRM-210] - _ = x[FCMA-211] - _ = x[FHM-212] - _ = x[FP-213] - _ = x[FPHP-214] - _ = x[GPA-215] - _ = x[JSCVT-216] - _ = x[LRCPC-217] - _ = x[PMULL-218] - _ = x[RNDR-219] - _ = x[TLB-220] - _ = x[TS-221] - _ = x[SHA1-222] - _ = x[SHA2-223] - _ = x[SHA3-224] - _ = x[SHA512-225] - _ = x[SM3-226] - _ = x[SM4-227] - _ = x[SVE-228] - _ = x[lastID-229] + _ = x[AVX512BMM-22] + _ = x[AVX512BW-23] + _ = x[AVX512CD-24] + _ = x[AVX512DQ-25] + _ = x[AVX512ER-26] + _ = x[AVX512F-27] + _ = x[AVX512FP16-28] + _ = x[AVX512IFMA-29] + _ = x[AVX512PF-30] + _ = x[AVX512VBMI-31] + _ = x[AVX512VBMI2-32] + _ = x[AVX512VL-33] + _ = x[AVX512VNNI-34] + _ = x[AVX512VP2INTERSECT-35] + _ = x[AVX512VPOPCNTDQ-36] + _ = x[AVXIFMA-37] + _ = x[AVXNECONVERT-38] + _ = x[AVXSLOW-39] + _ = x[AVXVNNI-40] + _ = x[AVXVNNIINT8-41] + _ = x[AVXVNNIINT16-42] + _ = x[BHI_CTRL-43] + _ = x[BMI1-44] + _ = x[BMI2-45] + _ = x[CETIBT-46] + _ = x[CETSS-47] + _ = x[CLDEMOTE-48] + _ = x[CLMUL-49] + _ = x[CLZERO-50] + _ = x[CMOV-51] + _ = x[CMPCCXADD-52] + _ = x[CMPSB_SCADBS_SHORT-53] + _ = x[CMPXCHG8-54] + _ = x[CPBOOST-55] + _ = x[CPPC-56] + _ = x[CX16-57] + _ = x[EFER_LMSLE_UNS-58] + _ = x[ENQCMD-59] + _ = x[ERMS-60] + _ = x[F16C-61] + _ = x[FLUSH_L1D-62] + _ = x[FMA3-63] + _ = x[FMA4-64] + _ = x[FP128-65] + _ = x[FP256-66] + _ = x[FRED-67] + _ = x[FSRM-68] + _ = x[FXSR-69] + _ = x[FXSROPT-70] + _ = x[GFNI-71] + _ = x[HLE-72] + _ = x[HRESET-73] + _ = x[HTT-74] + _ = x[HWA-75] + _ = x[HYBRID_CPU-76] + _ = x[HYPERVISOR-77] + _ = x[IA32_ARCH_CAP-78] + _ = x[IA32_CORE_CAP-79] + _ = x[IBPB-80] + _ = x[IBPB_BRTYPE-81] + _ = x[IBRS-82] + _ = x[IBRS_PREFERRED-83] + _ = x[IBRS_PROVIDES_SMP-84] + _ = x[IBS-85] + _ = x[IBSBRNTRGT-86] + _ = x[IBSFETCHSAM-87] + _ = x[IBSFFV-88] + _ = x[IBSOPCNT-89] + _ = x[IBSOPCNTEXT-90] + _ = x[IBSOPSAM-91] + _ = x[IBSRDWROPCNT-92] + _ = x[IBSRIPINVALIDCHK-93] + _ = x[IBS_FETCH_CTLX-94] + _ = x[IBS_OPDATA4-95] + _ = x[IBS_OPFUSE-96] + _ = x[IBS_PREVENTHOST-97] + _ = x[IBS_ZEN4-98] + _ = x[IDPRED_CTRL-99] + _ = x[INT_WBINVD-100] + _ = x[INVLPGB-101] + _ = x[KEYLOCKER-102] + _ = x[KEYLOCKERW-103] + _ = x[LAHF-104] + _ = x[LAM-105] + _ = x[LBRVIRT-106] + _ = x[LZCNT-107] + _ = x[MCAOVERFLOW-108] + _ = x[MCDT_NO-109] + _ = x[MCOMMIT-110] + _ = x[MD_CLEAR-111] + _ = x[MMX-112] + _ = x[MMXEXT-113] + _ = x[MOVBE-114] + _ = x[MOVDIR64B-115] + _ = x[MOVDIRI-116] + _ = x[MOVSB_ZL-117] + _ = x[MOVU-118] + _ = x[MPX-119] + _ = x[MSRIRC-120] + _ = x[MSRLIST-121] + _ = x[MSR_PAGEFLUSH-122] + _ = x[NRIPS-123] + _ = x[NX-124] + _ = x[OSXSAVE-125] + _ = x[PCONFIG-126] + _ = x[POPCNT-127] + _ = x[PPIN-128] + _ = x[PREFETCHI-129] + _ = x[PSFD-130] + _ = x[RDPRU-131] + _ = x[RDRAND-132] + _ = x[RDSEED-133] + _ = x[RDTSCP-134] + _ = x[RRSBA_CTRL-135] + _ = x[RTM-136] + _ = x[RTM_ALWAYS_ABORT-137] + _ = x[SBPB-138] + _ = x[SERIALIZE-139] + _ = x[SEV-140] + _ = x[SEV_64BIT-141] + _ = x[SEV_ALTERNATIVE-142] + _ = x[SEV_DEBUGSWAP-143] + _ = x[SEV_ES-144] + _ = x[SEV_RESTRICTED-145] + _ = x[SEV_SNP-146] + _ = x[SGX-147] + _ = x[SGXLC-148] + _ = x[SGXPQC-149] + _ = x[SHA-150] + _ = x[SME-151] + _ = x[SME_COHERENT-152] + _ = x[SM3_X86-153] + _ = x[SM4_X86-154] + _ = x[SPEC_CTRL_SSBD-155] + _ = x[SRBDS_CTRL-156] + _ = x[SRSO_MSR_FIX-157] + _ = x[SRSO_NO-158] + _ = x[SRSO_USER_KERNEL_NO-159] + _ = x[SSE-160] + _ = x[SSE2-161] + _ = x[SSE3-162] + _ = x[SSE4-163] + _ = x[SSE42-164] + _ = x[SSE4A-165] + _ = x[SSSE3-166] + _ = x[STIBP-167] + _ = x[STIBP_ALWAYSON-168] + _ = x[STOSB_SHORT-169] + _ = x[SUCCOR-170] + _ = x[SVM-171] + _ = x[SVMDA-172] + _ = x[SVMFBASID-173] + _ = x[SVML-174] + _ = x[SVMNP-175] + _ = x[SVMPF-176] + _ = x[SVMPFT-177] + _ = x[SYSCALL-178] + _ = x[SYSEE-179] + _ = x[TBM-180] + _ = x[TDX_GUEST-181] + _ = x[TLB_FLUSH_NESTED-182] + _ = x[TME-183] + _ = x[TOPEXT-184] + _ = x[TSA_L1_NO-185] + _ = x[TSA_SQ_NO-186] + _ = x[TSA_VERW_CLEAR-187] + _ = x[TSCRATEMSR-188] + _ = x[TSXLDTRK-189] + _ = x[VAES-190] + _ = x[VMCBCLEAN-191] + _ = x[VMPL-192] + _ = x[VMSA_REGPROT-193] + _ = x[VMX-194] + _ = x[VPCLMULQDQ-195] + _ = x[VTE-196] + _ = x[WAITPKG-197] + _ = x[WBNOINVD-198] + _ = x[WRMSRNS-199] + _ = x[X87-200] + _ = x[XGETBV1-201] + _ = x[XOP-202] + _ = x[XSAVE-203] + _ = x[XSAVEC-204] + _ = x[XSAVEOPT-205] + _ = x[XSAVES-206] + _ = x[AESARM-207] + _ = x[ARMCPUID-208] + _ = x[ASIMD-209] + _ = x[ASIMDDP-210] + _ = x[ASIMDHP-211] + _ = x[ASIMDRDM-212] + _ = x[ATOMICS-213] + _ = x[CRC32-214] + _ = x[DCPOP-215] + _ = x[EVTSTRM-216] + _ = x[FCMA-217] + _ = x[FHM-218] + _ = x[FP-219] + _ = x[FPHP-220] + _ = x[GPA-221] + _ = x[JSCVT-222] + _ = x[LRCPC-223] + _ = x[PMULL-224] + _ = x[RNDR-225] + _ = x[TLB-226] + _ = x[TS-227] + _ = x[SHA1-228] + _ = x[SHA2-229] + _ = x[SHA3-230] + _ = x[SHA512-231] + _ = x[SM3-232] + _ = x[SM4-233] + _ = x[SVE-234] + _ = x[SVE2-235] + _ = x[SB-236] + _ = x[SSBS-237] + _ = x[BTI-238] + _ = x[FLAGM2-239] + _ = x[FRINTTS-240] + _ = x[DCPODP-241] + _ = x[BF16-242] + _ = x[I8MM-243] + _ = x[WFXT-244] + _ = x[MOPS-245] + _ = x[HBC-246] + _ = x[CSSC-247] + _ = x[PMU_FIXEDCOUNTER_CYCLES-248] + _ = x[PMU_FIXEDCOUNTER_REFCYCLES-249] + _ = x[PMU_FIXEDCOUNTER_INSTRUCTIONS-250] + _ = x[PMU_FIXEDCOUNTER_TOPDOWN_SLOTS-251] + _ = x[RV_IMA-252] + _ = x[RV_C-253] + _ = x[RV_F-254] + _ = x[RV_D-255] + _ = x[RV_V-256] + _ = x[RV_ZBA-257] + _ = x[RV_ZBB-258] + _ = x[RV_ZBC-259] + _ = x[RV_ZBS-260] + _ = x[RV_ZICOND-261] + _ = x[RV_ZIHINTPAUSE-262] + _ = x[RV_ZICBOM-263] + _ = x[RV_ZICBOZ-264] + _ = x[RV_ZICBOP-265] + _ = x[RV_ZFA-266] + _ = x[RV_ZFH-267] + _ = x[RV_ZFHMIN-268] + _ = x[RV_ZTSO-269] + _ = x[RV_ZACAS-270] + _ = x[RV_ZBKB-271] + _ = x[RV_ZBKC-272] + _ = x[RV_ZBKX-273] + _ = x[RV_ZKND-274] + _ = x[RV_ZKNE-275] + _ = x[RV_ZKNH-276] + _ = x[RV_ZKSED-277] + _ = x[RV_ZKSH-278] + _ = x[RV_ZKT-279] + _ = x[RV_ZKN-280] + _ = x[RV_ZKS-281] + _ = x[RV_ZVBB-282] + _ = x[RV_ZVBC-283] + _ = x[RV_ZVKB-284] + _ = x[RV_ZVKG-285] + _ = x[RV_ZVKNED-286] + _ = x[RV_ZVKNHA-287] + _ = x[RV_ZVKNHB-288] + _ = x[RV_ZVKSED-289] + _ = x[RV_ZVKSH-290] + _ = x[RV_ZVKT-291] + _ = x[RV_ZVKNG-292] + _ = x[RV_ZVKSG-293] + _ = x[lastID-294] _ = x[firstID-0] } -const _FeatureID_name = "firstIDADXAESNIAMD3DNOWAMD3DNOWEXTAMXBF16AMXFP16AMXINT8AMXFP8AMXTILEAMXTF32AMXCOMPLEXAMXTRANSPOSEAPX_FAVXAVX10AVX10_128AVX10_256AVX10_512AVX2AVX512BF16AVX512BITALGAVX512BWAVX512CDAVX512DQAVX512ERAVX512FAVX512FP16AVX512IFMAAVX512PFAVX512VBMIAVX512VBMI2AVX512VLAVX512VNNIAVX512VP2INTERSECTAVX512VPOPCNTDQAVXIFMAAVXNECONVERTAVXSLOWAVXVNNIAVXVNNIINT8AVXVNNIINT16BHI_CTRLBMI1BMI2CETIBTCETSSCLDEMOTECLMULCLZEROCMOVCMPCCXADDCMPSB_SCADBS_SHORTCMPXCHG8CPBOOSTCPPCCX16EFER_LMSLE_UNSENQCMDERMSF16CFLUSH_L1DFMA3FMA4FP128FP256FSRMFXSRFXSROPTGFNIHLEHRESETHTTHWAHYBRID_CPUHYPERVISORIA32_ARCH_CAPIA32_CORE_CAPIBPBIBPB_BRTYPEIBRSIBRS_PREFERREDIBRS_PROVIDES_SMPIBSIBSBRNTRGTIBSFETCHSAMIBSFFVIBSOPCNTIBSOPCNTEXTIBSOPSAMIBSRDWROPCNTIBSRIPINVALIDCHKIBS_FETCH_CTLXIBS_OPDATA4IBS_OPFUSEIBS_PREVENTHOSTIBS_ZEN4IDPRED_CTRLINT_WBINVDINVLPGBKEYLOCKERKEYLOCKERWLAHFLAMLBRVIRTLZCNTMCAOVERFLOWMCDT_NOMCOMMITMD_CLEARMMXMMXEXTMOVBEMOVDIR64BMOVDIRIMOVSB_ZLMOVUMPXMSRIRCMSRLISTMSR_PAGEFLUSHNRIPSNXOSXSAVEPCONFIGPOPCNTPPINPREFETCHIPSFDRDPRURDRANDRDSEEDRDTSCPRRSBA_CTRLRTMRTM_ALWAYS_ABORTSBPBSERIALIZESEVSEV_64BITSEV_ALTERNATIVESEV_DEBUGSWAPSEV_ESSEV_RESTRICTEDSEV_SNPSGXSGXLCSHASMESME_COHERENTSM3_X86SM4_X86SPEC_CTRL_SSBDSRBDS_CTRLSRSO_MSR_FIXSRSO_NOSRSO_USER_KERNEL_NOSSESSE2SSE3SSE4SSE42SSE4ASSSE3STIBPSTIBP_ALWAYSONSTOSB_SHORTSUCCORSVMSVMDASVMFBASIDSVMLSVMNPSVMPFSVMPFTSYSCALLSYSEETBMTDX_GUESTTLB_FLUSH_NESTEDTMETOPEXTTSCRATEMSRTSXLDTRKVAESVMCBCLEANVMPLVMSA_REGPROTVMXVPCLMULQDQVTEWAITPKGWBNOINVDWRMSRNSX87XGETBV1XOPXSAVEXSAVECXSAVEOPTXSAVESAESARMARMCPUIDASIMDASIMDDPASIMDHPASIMDRDMATOMICSCRC32DCPOPEVTSTRMFCMAFHMFPFPHPGPAJSCVTLRCPCPMULLRNDRTLBTSSHA1SHA2SHA3SHA512SM3SM4SVElastID" +const _FeatureID_name = "firstIDADXAESNIAMD3DNOWAMD3DNOWEXTAMXBF16AMXFP16AMXINT8AMXFP8AMXTILEAMXTF32AMXCOMPLEXAMXTRANSPOSEAPX_FAVXAVX10AVX10_128AVX10_256AVX10_512AVX2AVX512BF16AVX512BITALGAVX512BMMAVX512BWAVX512CDAVX512DQAVX512ERAVX512FAVX512FP16AVX512IFMAAVX512PFAVX512VBMIAVX512VBMI2AVX512VLAVX512VNNIAVX512VP2INTERSECTAVX512VPOPCNTDQAVXIFMAAVXNECONVERTAVXSLOWAVXVNNIAVXVNNIINT8AVXVNNIINT16BHI_CTRLBMI1BMI2CETIBTCETSSCLDEMOTECLMULCLZEROCMOVCMPCCXADDCMPSB_SCADBS_SHORTCMPXCHG8CPBOOSTCPPCCX16EFER_LMSLE_UNSENQCMDERMSF16CFLUSH_L1DFMA3FMA4FP128FP256FREDFSRMFXSRFXSROPTGFNIHLEHRESETHTTHWAHYBRID_CPUHYPERVISORIA32_ARCH_CAPIA32_CORE_CAPIBPBIBPB_BRTYPEIBRSIBRS_PREFERREDIBRS_PROVIDES_SMPIBSIBSBRNTRGTIBSFETCHSAMIBSFFVIBSOPCNTIBSOPCNTEXTIBSOPSAMIBSRDWROPCNTIBSRIPINVALIDCHKIBS_FETCH_CTLXIBS_OPDATA4IBS_OPFUSEIBS_PREVENTHOSTIBS_ZEN4IDPRED_CTRLINT_WBINVDINVLPGBKEYLOCKERKEYLOCKERWLAHFLAMLBRVIRTLZCNTMCAOVERFLOWMCDT_NOMCOMMITMD_CLEARMMXMMXEXTMOVBEMOVDIR64BMOVDIRIMOVSB_ZLMOVUMPXMSRIRCMSRLISTMSR_PAGEFLUSHNRIPSNXOSXSAVEPCONFIGPOPCNTPPINPREFETCHIPSFDRDPRURDRANDRDSEEDRDTSCPRRSBA_CTRLRTMRTM_ALWAYS_ABORTSBPBSERIALIZESEVSEV_64BITSEV_ALTERNATIVESEV_DEBUGSWAPSEV_ESSEV_RESTRICTEDSEV_SNPSGXSGXLCSGXPQCSHASMESME_COHERENTSM3_X86SM4_X86SPEC_CTRL_SSBDSRBDS_CTRLSRSO_MSR_FIXSRSO_NOSRSO_USER_KERNEL_NOSSESSE2SSE3SSE4SSE42SSE4ASSSE3STIBPSTIBP_ALWAYSONSTOSB_SHORTSUCCORSVMSVMDASVMFBASIDSVMLSVMNPSVMPFSVMPFTSYSCALLSYSEETBMTDX_GUESTTLB_FLUSH_NESTEDTMETOPEXTTSA_L1_NOTSA_SQ_NOTSA_VERW_CLEARTSCRATEMSRTSXLDTRKVAESVMCBCLEANVMPLVMSA_REGPROTVMXVPCLMULQDQVTEWAITPKGWBNOINVDWRMSRNSX87XGETBV1XOPXSAVEXSAVECXSAVEOPTXSAVESAESARMARMCPUIDASIMDASIMDDPASIMDHPASIMDRDMATOMICSCRC32DCPOPEVTSTRMFCMAFHMFPFPHPGPAJSCVTLRCPCPMULLRNDRTLBTSSHA1SHA2SHA3SHA512SM3SM4SVESVE2SBSSBSBTIFLAGM2FRINTTSDCPODPBF16I8MMWFXTMOPSHBCCSSCPMU_FIXEDCOUNTER_CYCLESPMU_FIXEDCOUNTER_REFCYCLESPMU_FIXEDCOUNTER_INSTRUCTIONSPMU_FIXEDCOUNTER_TOPDOWN_SLOTSRV_IMARV_CRV_FRV_DRV_VRV_ZBARV_ZBBRV_ZBCRV_ZBSRV_ZICONDRV_ZIHINTPAUSERV_ZICBOMRV_ZICBOZRV_ZICBOPRV_ZFARV_ZFHRV_ZFHMINRV_ZTSORV_ZACASRV_ZBKBRV_ZBKCRV_ZBKXRV_ZKNDRV_ZKNERV_ZKNHRV_ZKSEDRV_ZKSHRV_ZKTRV_ZKNRV_ZKSRV_ZVBBRV_ZVBCRV_ZVKBRV_ZVKGRV_ZVKNEDRV_ZVKNHARV_ZVKNHBRV_ZVKSEDRV_ZVKSHRV_ZVKTRV_ZVKNGRV_ZVKSGlastID" -var _FeatureID_index = [...]uint16{0, 7, 10, 15, 23, 34, 41, 48, 55, 61, 68, 75, 85, 97, 102, 105, 110, 119, 128, 137, 141, 151, 163, 171, 179, 187, 195, 202, 212, 222, 230, 240, 251, 259, 269, 287, 302, 309, 321, 328, 335, 346, 358, 366, 370, 374, 380, 385, 393, 398, 404, 408, 417, 435, 443, 450, 454, 458, 472, 478, 482, 486, 495, 499, 503, 508, 513, 517, 521, 528, 532, 535, 541, 544, 547, 557, 567, 580, 593, 597, 608, 612, 626, 643, 646, 656, 667, 673, 681, 692, 700, 712, 728, 742, 753, 763, 778, 786, 797, 807, 814, 823, 833, 837, 840, 847, 852, 863, 870, 877, 885, 888, 894, 899, 908, 915, 923, 927, 930, 936, 943, 956, 961, 963, 970, 977, 983, 987, 996, 1000, 1005, 1011, 1017, 1023, 1033, 1036, 1052, 1056, 1065, 1068, 1077, 1092, 1105, 1111, 1125, 1132, 1135, 1140, 1143, 1146, 1158, 1165, 1172, 1186, 1196, 1208, 1215, 1234, 1237, 1241, 1245, 1249, 1254, 1259, 1264, 1269, 1283, 1294, 1300, 1303, 1308, 1317, 1321, 1326, 1331, 1337, 1344, 1349, 1352, 1361, 1377, 1380, 1386, 1396, 1404, 1408, 1417, 1421, 1433, 1436, 1446, 1449, 1456, 1464, 1471, 1474, 1481, 1484, 1489, 1495, 1503, 1509, 1515, 1523, 1528, 1535, 1542, 1550, 1557, 1562, 1567, 1574, 1578, 1581, 1583, 1587, 1590, 1595, 1600, 1605, 1609, 1612, 1614, 1618, 1622, 1626, 1632, 1635, 1638, 1641, 1647} +var _FeatureID_index = [...]uint16{0, 7, 10, 15, 23, 34, 41, 48, 55, 61, 68, 75, 85, 97, 102, 105, 110, 119, 128, 137, 141, 151, 163, 172, 180, 188, 196, 204, 211, 221, 231, 239, 249, 260, 268, 278, 296, 311, 318, 330, 337, 344, 355, 367, 375, 379, 383, 389, 394, 402, 407, 413, 417, 426, 444, 452, 459, 463, 467, 481, 487, 491, 495, 504, 508, 512, 517, 522, 526, 530, 534, 541, 545, 548, 554, 557, 560, 570, 580, 593, 606, 610, 621, 625, 639, 656, 659, 669, 680, 686, 694, 705, 713, 725, 741, 755, 766, 776, 791, 799, 810, 820, 827, 836, 846, 850, 853, 860, 865, 876, 883, 890, 898, 901, 907, 912, 921, 928, 936, 940, 943, 949, 956, 969, 974, 976, 983, 990, 996, 1000, 1009, 1013, 1018, 1024, 1030, 1036, 1046, 1049, 1065, 1069, 1078, 1081, 1090, 1105, 1118, 1124, 1138, 1145, 1148, 1153, 1159, 1162, 1165, 1177, 1184, 1191, 1205, 1215, 1227, 1234, 1253, 1256, 1260, 1264, 1268, 1273, 1278, 1283, 1288, 1302, 1313, 1319, 1322, 1327, 1336, 1340, 1345, 1350, 1356, 1363, 1368, 1371, 1380, 1396, 1399, 1405, 1414, 1423, 1437, 1447, 1455, 1459, 1468, 1472, 1484, 1487, 1497, 1500, 1507, 1515, 1522, 1525, 1532, 1535, 1540, 1546, 1554, 1560, 1566, 1574, 1579, 1586, 1593, 1601, 1608, 1613, 1618, 1625, 1629, 1632, 1634, 1638, 1641, 1646, 1651, 1656, 1660, 1663, 1665, 1669, 1673, 1677, 1683, 1686, 1689, 1692, 1696, 1698, 1702, 1705, 1711, 1718, 1724, 1728, 1732, 1736, 1740, 1743, 1747, 1770, 1796, 1825, 1855, 1861, 1865, 1869, 1873, 1877, 1883, 1889, 1895, 1901, 1910, 1924, 1933, 1942, 1951, 1957, 1963, 1972, 1979, 1987, 1994, 2001, 2008, 2015, 2022, 2029, 2037, 2044, 2050, 2056, 2062, 2069, 2076, 2083, 2090, 2099, 2108, 2117, 2126, 2134, 2141, 2149, 2157, 2163} func (i FeatureID) String() string { - if i < 0 || i >= FeatureID(len(_FeatureID_index)-1) { + idx := int(i) - 0 + if i < 0 || idx >= len(_FeatureID_index)-1 { return "FeatureID(" + strconv.FormatInt(int64(i), 10) + ")" } - return _FeatureID_name[_FeatureID_index[i]:_FeatureID_index[i+1]] + return _FeatureID_name[_FeatureID_index[idx]:_FeatureID_index[idx+1]] } func _() { // An "invalid array index" compiler error signifies that the constant values have changed. @@ -285,16 +351,22 @@ func _() { _ = x[ACRN-28] _ = x[SRE-29] _ = x[Apple-30] - _ = x[lastVendor-31] + _ = x[SiFive-31] + _ = x[StarFive-32] + _ = x[THead-33] + _ = x[Andes-34] + _ = x[SpacemiT-35] + _ = x[lastVendor-36] } -const _Vendor_name = "VendorUnknownIntelAMDVIATransmetaNSCKVMMSVMVMwareXenHVMBhyveHygonSiSRDCAmpereARMBroadcomCaviumDECFujitsuInfineonMotorolaNVIDIAAMCCQualcommMarvellQEMUQNXACRNSREApplelastVendor" +const _Vendor_name = "VendorUnknownIntelAMDVIATransmetaNSCKVMMSVMVMwareXenHVMBhyveHygonSiSRDCAmpereARMBroadcomCaviumDECFujitsuInfineonMotorolaNVIDIAAMCCQualcommMarvellQEMUQNXACRNSREAppleSiFiveStarFiveTHeadAndesSpacemiTlastVendor" -var _Vendor_index = [...]uint8{0, 13, 18, 21, 24, 33, 36, 39, 43, 49, 55, 60, 65, 68, 71, 77, 80, 88, 94, 97, 104, 112, 120, 126, 130, 138, 145, 149, 152, 156, 159, 164, 174} +var _Vendor_index = [...]uint8{0, 13, 18, 21, 24, 33, 36, 39, 43, 49, 55, 60, 65, 68, 71, 77, 80, 88, 94, 97, 104, 112, 120, 126, 130, 138, 145, 149, 152, 156, 159, 164, 170, 178, 183, 188, 196, 206} func (i Vendor) String() string { - if i < 0 || i >= Vendor(len(_Vendor_index)-1) { + idx := int(i) - 0 + if i < 0 || idx >= len(_Vendor_index)-1 { return "Vendor(" + strconv.FormatInt(int64(i), 10) + ")" } - return _Vendor_name[_Vendor_index[i]:_Vendor_index[i+1]] + return _Vendor_name[_Vendor_index[idx]:_Vendor_index[idx+1]] } diff --git a/vendor/github.com/klauspost/cpuid/v2/os_darwin_arm64.go b/vendor/github.com/klauspost/cpuid/v2/os_darwin_arm64.go index da07522e7cb..addbfc67b8e 100644 --- a/vendor/github.com/klauspost/cpuid/v2/os_darwin_arm64.go +++ b/vendor/github.com/klauspost/cpuid/v2/os_darwin_arm64.go @@ -126,4 +126,17 @@ func tryToFillCPUInfoFomSysctl(c *CPUInfo) { setFeature(c, SM3, "hw.optional.arm.FEAT_SM3") // SM3 instructions setFeature(c, SM4, "hw.optional.arm.FEAT_SM4") // SM4 instructions setFeature(c, SVE, "hw.optional.arm.FEAT_SVE") // Scalable Vector Extension + setFeature(c, SVE2, "hw.optional.arm.FEAT_SVE2") // Scalable Vector Extension 2 + setFeature(c, SB, "hw.optional.arm.FEAT_SB") // Speculation barrier + setFeature(c, SSBS, "hw.optional.arm.FEAT_SSBS") // Speculative Store Bypass Safe + setFeature(c, BTI, "hw.optional.arm.FEAT_BTI") // Branch Target Identification + setFeature(c, FLAGM2, "hw.optional.arm.FEAT_FlagM2") // Condition flag manipulation version 2 + setFeature(c, FRINTTS, "hw.optional.arm.FEAT_FRINTTS") // Floating-point to integer rounding + setFeature(c, DCPODP, "hw.optional.arm.FEAT_DPB2") // Data cache clean to Point of Deep Persistence + setFeature(c, BF16, "hw.optional.arm.FEAT_BF16") // BFloat16 instructions + setFeature(c, I8MM, "hw.optional.arm.FEAT_I8MM") // Int8 matrix multiplication + setFeature(c, WFXT, "hw.optional.arm.FEAT_WFxT") // WFE/WFI with timeout + setFeature(c, MOPS, "hw.optional.arm.FEAT_MOPS") // Memory copy and set instructions + setFeature(c, HBC, "hw.optional.arm.FEAT_HBC") // Hinted conditional branches + setFeature(c, CSSC, "hw.optional.arm.FEAT_CSSC") // Common short sequence compression } diff --git a/vendor/github.com/klauspost/cpuid/v2/os_linux_arm64.go b/vendor/github.com/klauspost/cpuid/v2/os_linux_arm64.go index d96d24438b3..ea9da404c67 100644 --- a/vendor/github.com/klauspost/cpuid/v2/os_linux_arm64.go +++ b/vendor/github.com/klauspost/cpuid/v2/os_linux_arm64.go @@ -115,15 +115,19 @@ const ( hwcap2_POE = 1 << 63 ) +// hwcap2 holds AT_HWCAP2. Unlike hwcap, the arm64 runtime does not expose it +// through internal/cpu, so detectOS reads it from the auxiliary vector. +var hwcap2 uint + func detectOS(c *CPUInfo) bool { // For now assuming no hyperthreading is reasonable. c.LogicalCores = runtime.NumCPU() c.PhysicalCores = c.LogicalCores c.ThreadsPerCore = 1 - if hwcap == 0 { - // We did not get values from the runtime. - // Try reading /proc/self/auxv - + // hwcap is provided by the runtime through the internal/cpu.HWCap linkname, + // but the runtime does not expose HWCAP2 on arm64. Read the auxiliary vector + // directly to obtain hwcap2 (and hwcap when the linkname is unavailable). + if hwcap == 0 || hwcap2 == 0 { // From https://github.com/golang/sys const ( _AT_HWCAP = 16 @@ -132,37 +136,34 @@ func detectOS(c *CPUInfo) bool { uintSize = int(32 << (^uint(0) >> 63)) ) - buf, err := ioutil.ReadFile("/proc/self/auxv") - if err != nil { - // e.g. on android /proc/self/auxv is not accessible, so silently - // ignore the error and leave Initialized = false. On some - // architectures (e.g. arm64) doinit() implements a fallback - // readout and will set Initialized = true again. - return false - } - bo := binary.LittleEndian - for len(buf) >= 2*(uintSize/8) { - var tag, val uint - switch uintSize { - case 32: - tag = uint(bo.Uint32(buf[0:])) - val = uint(bo.Uint32(buf[4:])) - buf = buf[8:] - case 64: - tag = uint(bo.Uint64(buf[0:])) - val = uint(bo.Uint64(buf[8:])) - buf = buf[16:] - } - switch tag { - case _AT_HWCAP: - hwcap = val - case _AT_HWCAP2: - // Not used + // e.g. on android /proc/self/auxv is not accessible, so silently ignore + // the error and fall back to whatever the runtime provided. + if buf, err := ioutil.ReadFile("/proc/self/auxv"); err == nil { + bo := binary.LittleEndian + for len(buf) >= 2*(uintSize/8) { + var tag, val uint + switch uintSize { + case 32: + tag = uint(bo.Uint32(buf[0:])) + val = uint(bo.Uint32(buf[4:])) + buf = buf[8:] + case 64: + tag = uint(bo.Uint64(buf[0:])) + val = uint(bo.Uint64(buf[8:])) + buf = buf[16:] + } + switch tag { + case _AT_HWCAP: + hwcap = val + case _AT_HWCAP2: + hwcap2 = val + } } } - if hwcap == 0 { - return false - } + } + if hwcap == 0 { + // Nothing detected, e.g. on android or a restricted environment. + return false } // HWCap was populated by the runtime from the auxiliary vector. @@ -184,9 +185,9 @@ func detectOS(c *CPUInfo) bool { c.featureSet.setIf(isSet(hwcap, hwcap_JSCVT), JSCVT) c.featureSet.setIf(isSet(hwcap, hwcap_LRCPC), LRCPC) c.featureSet.setIf(isSet(hwcap, hwcap_PMULL), PMULL) - c.featureSet.setIf(isSet(hwcap, hwcap2_RNG), RNDR) - // c.featureSet.setIf(isSet(hwcap, hwcap_), TLB) - // c.featureSet.setIf(isSet(hwcap, hwcap_), TS) + c.featureSet.setIf(isSet(hwcap2, hwcap2_RNG), RNDR) + // TLB (FEAT_TLBIOS/TLBIRANGE) has no HWCAP bit; only detectable via ID registers. + c.featureSet.setIf(isSet(hwcap, hwcap_FLAGM), TS) c.featureSet.setIf(isSet(hwcap, hwcap_SHA1), SHA1) c.featureSet.setIf(isSet(hwcap, hwcap_SHA2), SHA2) c.featureSet.setIf(isSet(hwcap, hwcap_SHA3), SHA3) @@ -194,6 +195,21 @@ func detectOS(c *CPUInfo) bool { c.featureSet.setIf(isSet(hwcap, hwcap_SM3), SM3) c.featureSet.setIf(isSet(hwcap, hwcap_SM4), SM4) c.featureSet.setIf(isSet(hwcap, hwcap_SVE), SVE) + c.featureSet.setIf(isSet(hwcap, hwcap_SB), SB) + c.featureSet.setIf(isSet(hwcap, hwcap_SSBS), SSBS) + + // Features reported through the second hardware capability word (HWCAP2). + c.featureSet.setIf(isSet(hwcap2, hwcap2_SVE2), SVE2) + c.featureSet.setIf(isSet(hwcap2, hwcap2_BTI), BTI) + c.featureSet.setIf(isSet(hwcap2, hwcap2_FLAGM2), FLAGM2) + c.featureSet.setIf(isSet(hwcap2, hwcap2_FRINT), FRINTTS) + c.featureSet.setIf(isSet(hwcap2, hwcap2_DCPODP), DCPODP) + c.featureSet.setIf(isSet(hwcap2, hwcap2_BF16), BF16) + c.featureSet.setIf(isSet(hwcap2, hwcap2_I8MM), I8MM) + c.featureSet.setIf(isSet(hwcap2, hwcap2_WFXT), WFXT) + c.featureSet.setIf(isSet(hwcap2, hwcap2_MOPS), MOPS) + c.featureSet.setIf(isSet(hwcap2, hwcap2_HBC), HBC) + c.featureSet.setIf(isSet(hwcap2, hwcap2_CSSC), CSSC) // The Samsung S9+ kernel reports support for atomics, but not all cores // actually support them, resulting in SIGILL. See issue #28431. diff --git a/vendor/github.com/klauspost/cpuid/v2/os_linux_riscv64.go b/vendor/github.com/klauspost/cpuid/v2/os_linux_riscv64.go new file mode 100644 index 00000000000..71919a49bd6 --- /dev/null +++ b/vendor/github.com/klauspost/cpuid/v2/os_linux_riscv64.go @@ -0,0 +1,225 @@ +// Copyright (c) 2026 Klaus Post, released under MIT License. See LICENSE file. + +package cpuid + +import ( + "bufio" + "os" + "runtime" + "strconv" + "strings" + "unsafe" + + "golang.org/x/sys/unix" +) + +const __NR_riscv_hwprobe = 258 + +type riscvHWProbePair struct { + key int64 + value uint64 +} + +// Keys from linux/include/uapi/asm/hwprobe.h +const ( + riscv_hwprobe_key_mvendorid = 0 + riscv_hwprobe_key_marchid = 1 + riscv_hwprobe_key_mimpid = 2 + riscv_hwprobe_key_base_behavior = 3 + riscv_hwprobe_key_ima_ext_0 = 4 + riscv_hwprobe_key_cpuperf_0 = 5 + riscv_hwprobe_key_zicbom_block_size = 12 +) + +// Bits from linux/arch/riscv/include/uapi/asm/hwprobe.h +const ( + riscv_hwprobe_ima_fd = 1 << 0 + riscv_hwprobe_ima_c = 1 << 1 + riscv_hwprobe_ima_v = 1 << 2 + riscv_hwprobe_ext_zba = 1 << 3 + riscv_hwprobe_ext_zbb = 1 << 4 + riscv_hwprobe_ext_zbs = 1 << 5 + riscv_hwprobe_ext_zicboz = 1 << 6 + riscv_hwprobe_ext_zbc = 1 << 7 + riscv_hwprobe_ext_zbkb = 1 << 8 + riscv_hwprobe_ext_zbkc = 1 << 9 + riscv_hwprobe_ext_zbkx = 1 << 10 + riscv_hwprobe_ext_zknd = 1 << 11 + riscv_hwprobe_ext_zkne = 1 << 12 + riscv_hwprobe_ext_zknh = 1 << 13 + riscv_hwprobe_ext_zksed = 1 << 14 + riscv_hwprobe_ext_zksh = 1 << 15 + riscv_hwprobe_ext_zkt = 1 << 16 + riscv_hwprobe_ext_zvbb = 1 << 17 + riscv_hwprobe_ext_zvbc = 1 << 18 + riscv_hwprobe_ext_zvkb = 1 << 19 + riscv_hwprobe_ext_zvkg = 1 << 20 + riscv_hwprobe_ext_zvkned = 1 << 21 + riscv_hwprobe_ext_zvknha = 1 << 22 + riscv_hwprobe_ext_zvknhb = 1 << 23 + riscv_hwprobe_ext_zvksed = 1 << 24 + riscv_hwprobe_ext_zvksh = 1 << 25 + riscv_hwprobe_ext_zvkt = 1 << 26 + riscv_hwprobe_ext_zfh = 1 << 27 + riscv_hwprobe_ext_zfhmin = 1 << 28 + riscv_hwprobe_ext_zihintntl = 1 << 29 + riscv_hwprobe_ext_zvfh = 1 << 30 + riscv_hwprobe_ext_zvfhmin = 1 << 31 + riscv_hwprobe_ext_zfa = 1 << 32 + riscv_hwprobe_ext_ztso = 1 << 33 + riscv_hwprobe_ext_zacas = 1 << 34 + riscv_hwprobe_ext_zicond = 1 << 35 + riscv_hwprobe_ext_zihintpause = 1 << 36 + riscv_hwprobe_ext_zicbom = 1 << 55 + riscv_hwprobe_ext_zicbop = 1 << 60 +) + +func riscvHWProbe(pairs []riscvHWProbePair) int64 { + if len(pairs) == 0 { + return -1 + } + ret, _, _ := unix.Syscall6(__NR_riscv_hwprobe, + uintptr(unsafe.Pointer(&pairs[0])), + uintptr(len(pairs)), + 0, 0, 0, 0) + return int64(ret) +} + +func detectOS(c *CPUInfo) bool { + c.LogicalCores = runtime.NumCPU() + c.PhysicalCores = c.LogicalCores + c.ThreadsPerCore = 1 + + pairs := []riscvHWProbePair{ + {key: riscv_hwprobe_key_mvendorid}, + {key: riscv_hwprobe_key_marchid}, + {key: riscv_hwprobe_key_mimpid}, + {key: riscv_hwprobe_key_ima_ext_0}, + {key: riscv_hwprobe_key_zicbom_block_size}, + } + ret := riscvHWProbe(pairs) + if ret == 0 && pairs[3].value != ^uint64(0) { + detectFromHWProbe(c, pairs) + if pairs[4].value != ^uint64(0) && pairs[4].value > 0 { + c.CacheLine = int(pairs[4].value) + } + return true + } + + c.CacheLine = detectCacheLine() + return detectFromCPUInfo(c) +} + +func detectFromHWProbe(c *CPUInfo, pairs []riscvHWProbePair) { + if pairs[0].value != ^uint64(0) { + c.VendorID = riscvVendorID(pairs[0].value) + c.VendorString = c.VendorID.String() + } + if pairs[1].value != ^uint64(0) { + c.Model = int(pairs[1].value) + } + if pairs[2].value != ^uint64(0) { + c.Family = int(pairs[2].value) + } + + imaExt := pairs[3].value + + if imaExt&riscv_hwprobe_ima_fd != 0 { + c.featureSet.set(RV_D) + c.featureSet.set(RV_F) + } + c.featureSet.setIf(imaExt&riscv_hwprobe_ima_c != 0, RV_C) + c.featureSet.setIf(imaExt&riscv_hwprobe_ima_v != 0, RV_V) + + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zba != 0, RV_ZBA) + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zbb != 0, RV_ZBB) + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zbc != 0, RV_ZBC) + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zbs != 0, RV_ZBS) + + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zicbom != 0, RV_ZICBOM) + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zicboz != 0, RV_ZICBOZ) + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zicbop != 0, RV_ZICBOP) + + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zicond != 0, RV_ZICOND) + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zihintpause != 0, RV_ZIHINTPAUSE) + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zfa != 0, RV_ZFA) + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zfh != 0, RV_ZFH) + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zfhmin != 0, RV_ZFHMIN) + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_ztso != 0, RV_ZTSO) + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zacas != 0, RV_ZACAS) + + // Scalar cryptography + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zbkb != 0, RV_ZBKB) + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zbkc != 0, RV_ZBKC) + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zbkx != 0, RV_ZBKX) + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zknd != 0, RV_ZKND) + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zkne != 0, RV_ZKNE) + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zknh != 0, RV_ZKNH) + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zksed != 0, RV_ZKSED) + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zksh != 0, RV_ZKSH) + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zkt != 0, RV_ZKT) + + // Vector cryptography + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zvbb != 0, RV_ZVBB) + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zvbc != 0, RV_ZVBC) + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zvkb != 0, RV_ZVKB) + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zvkg != 0, RV_ZVKG) + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zvkned != 0, RV_ZVKNED) + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zvknha != 0, RV_ZVKNHA) + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zvknhb != 0, RV_ZVKNHB) + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zvksed != 0, RV_ZVKSED) + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zvksh != 0, RV_ZVKSH) + c.featureSet.setIf(imaExt&riscv_hwprobe_ext_zvkt != 0, RV_ZVKT) + + // Crypto suites (combined from individual features) + c.featureSet.setIf(c.featureSet.hasSetP(rvZKNFeatures), RV_ZKN) + c.featureSet.setIf(c.featureSet.hasSetP(rvZKSFeatures), RV_ZKS) + c.featureSet.setIf(c.featureSet.hasSetP(rvZVKNFeatures), RV_ZVKNG) + c.featureSet.setIf(c.featureSet.hasSetP(rvZVKSFeatures), RV_ZVKSG) + + // Every Linux-capable riscv64 core has I, M, A base. + c.featureSet.set(RV_IMA) +} + +func detectFromCPUInfo(c *CPUInfo) bool { + f, err := os.Open("/proc/cpuinfo") + if err != nil { + return false + } + defer f.Close() + + scanner := bufio.NewScanner(f) + for scanner.Scan() { + line := scanner.Text() + fields := strings.SplitN(line, ":", 2) + if len(fields) < 2 { + continue + } + key := strings.TrimSpace(fields[0]) + value := strings.TrimSpace(fields[1]) + + switch key { + case "isa": + parseISAString(c, value) + case "mvendorid": + if vid, err := strconv.ParseUint(value, 0, 64); err == nil { + c.VendorID = riscvVendorID(vid) + c.VendorString = c.VendorID.String() + } + case "uarch": + c.BrandName = value + } + } + return scanner.Err() == nil +} + +func detectCacheLine() int { + data, err := os.ReadFile("/sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size") + if err != nil { + return 0 + } + if n, err := strconv.Atoi(strings.TrimSpace(string(data))); err == nil && n > 0 { + return n + } + return 0 +} diff --git a/vendor/github.com/klauspost/cpuid/v2/os_other_arm64.go b/vendor/github.com/klauspost/cpuid/v2/os_other_arm64.go index 8733ba34363..debc123922e 100644 --- a/vendor/github.com/klauspost/cpuid/v2/os_other_arm64.go +++ b/vendor/github.com/klauspost/cpuid/v2/os_other_arm64.go @@ -1,7 +1,6 @@ // Copyright (c) 2020 Klaus Post, released under MIT License. See LICENSE file. //go:build arm64 && !linux && !darwin -// +build arm64,!linux,!darwin package cpuid diff --git a/vendor/github.com/klauspost/cpuid/v2/os_other_riscv64.go b/vendor/github.com/klauspost/cpuid/v2/os_other_riscv64.go new file mode 100644 index 00000000000..fd86f7d0562 --- /dev/null +++ b/vendor/github.com/klauspost/cpuid/v2/os_other_riscv64.go @@ -0,0 +1,14 @@ +// Copyright (c) 2026 Klaus Post, released under MIT License. See LICENSE file. + +//go:build riscv64 && !linux + +package cpuid + +import "runtime" + +func detectOS(c *CPUInfo) bool { + c.PhysicalCores = runtime.NumCPU() + c.ThreadsPerCore = 1 + c.LogicalCores = c.PhysicalCores + return false +} diff --git a/vendor/github.com/klauspost/cpuid/v2/os_safe_linux_arm64.go b/vendor/github.com/klauspost/cpuid/v2/os_safe_linux_arm64.go index f8f201b5f7b..5b4e8a1b3e0 100644 --- a/vendor/github.com/klauspost/cpuid/v2/os_safe_linux_arm64.go +++ b/vendor/github.com/klauspost/cpuid/v2/os_safe_linux_arm64.go @@ -1,7 +1,6 @@ // Copyright (c) 2021 Klaus Post, released under MIT License. See LICENSE file. //go:build nounsafe -// +build nounsafe package cpuid diff --git a/vendor/github.com/klauspost/cpuid/v2/os_unsafe_linux_arm64.go b/vendor/github.com/klauspost/cpuid/v2/os_unsafe_linux_arm64.go index 92af622eb8c..00158c21c39 100644 --- a/vendor/github.com/klauspost/cpuid/v2/os_unsafe_linux_arm64.go +++ b/vendor/github.com/klauspost/cpuid/v2/os_unsafe_linux_arm64.go @@ -1,7 +1,6 @@ // Copyright (c) 2021 Klaus Post, released under MIT License. See LICENSE file. //go:build !nounsafe -// +build !nounsafe package cpuid diff --git a/vendor/github.com/klauspost/cpuid/v2/riscv_isa.go b/vendor/github.com/klauspost/cpuid/v2/riscv_isa.go new file mode 100644 index 00000000000..5a87679bdbd --- /dev/null +++ b/vendor/github.com/klauspost/cpuid/v2/riscv_isa.go @@ -0,0 +1,93 @@ +// Copyright (c) 2026 Klaus Post, released under MIT License. See LICENSE file. + +package cpuid + +import "strings" + +func parseISAString(c *CPUInfo, isa string) { + isa = strings.ToLower(isa) + extMap := make(map[string]bool) + for ext := range strings.SplitSeq(isa, "_") { + ext = strings.TrimSpace(ext) + if strings.HasPrefix(ext, "rv64") { + extMap["i"] = true + for _, ch := range ext[4:] { + extMap[string(ch)] = true + } + } else if ext != "" { + extMap[ext] = true + } + } + + if extMap["g"] { + extMap["i"] = true + extMap["m"] = true + extMap["a"] = true + extMap["f"] = true + extMap["d"] = true + } + + c.featureSet.setIf(extMap["i"] && extMap["m"] && extMap["a"], RV_IMA) + c.featureSet.setIf(extMap["c"], RV_C) + c.featureSet.setIf(extMap["f"], RV_F) + c.featureSet.setIf(extMap["d"], RV_D) + c.featureSet.setIf(extMap["v"], RV_V) + c.featureSet.setIf(extMap["zihintpause"], RV_ZIHINTPAUSE) + c.featureSet.setIf(extMap["zba"], RV_ZBA) + c.featureSet.setIf(extMap["zbb"], RV_ZBB) + c.featureSet.setIf(extMap["zbc"], RV_ZBC) + c.featureSet.setIf(extMap["zbs"], RV_ZBS) + c.featureSet.setIf(extMap["zicond"], RV_ZICOND) + c.featureSet.setIf(extMap["zicbom"], RV_ZICBOM) + c.featureSet.setIf(extMap["zicboz"], RV_ZICBOZ) + c.featureSet.setIf(extMap["zicbop"], RV_ZICBOP) + c.featureSet.setIf(extMap["zfa"], RV_ZFA) + c.featureSet.setIf(extMap["zfh"], RV_ZFH) + c.featureSet.setIf(extMap["zfhmin"], RV_ZFHMIN) + c.featureSet.setIf(extMap["ztso"], RV_ZTSO) + c.featureSet.setIf(extMap["zacas"], RV_ZACAS) + + // Scalar cryptography + c.featureSet.setIf(extMap["zbkb"], RV_ZBKB) + c.featureSet.setIf(extMap["zbkc"], RV_ZBKC) + c.featureSet.setIf(extMap["zbkx"], RV_ZBKX) + c.featureSet.setIf(extMap["zknd"], RV_ZKND) + c.featureSet.setIf(extMap["zkne"], RV_ZKNE) + c.featureSet.setIf(extMap["zknh"], RV_ZKNH) + c.featureSet.setIf(extMap["zksed"], RV_ZKSED) + c.featureSet.setIf(extMap["zksh"], RV_ZKSH) + c.featureSet.setIf(extMap["zkt"], RV_ZKT) + + // Vector cryptography + c.featureSet.setIf(extMap["zvbb"], RV_ZVBB) + c.featureSet.setIf(extMap["zvbc"], RV_ZVBC) + c.featureSet.setIf(extMap["zvkb"], RV_ZVKB) + c.featureSet.setIf(extMap["zvkg"], RV_ZVKG) + c.featureSet.setIf(extMap["zvkned"], RV_ZVKNED) + c.featureSet.setIf(extMap["zvknha"], RV_ZVKNHA) + c.featureSet.setIf(extMap["zvknhb"], RV_ZVKNHB) + c.featureSet.setIf(extMap["zvksed"], RV_ZVKSED) + c.featureSet.setIf(extMap["zvksh"], RV_ZVKSH) + c.featureSet.setIf(extMap["zvkt"], RV_ZVKT) + + // Crypto suites (combined from individual features or bundle tokens) + c.featureSet.setIf(extMap["zkn"] || c.featureSet.hasSetP(rvZKNFeatures), RV_ZKN) + c.featureSet.setIf(extMap["zks"] || c.featureSet.hasSetP(rvZKSFeatures), RV_ZKS) + c.featureSet.setIf(extMap["zvkng"] || c.featureSet.hasSetP(rvZVKNFeatures), RV_ZVKNG) + c.featureSet.setIf(extMap["zvksg"] || c.featureSet.hasSetP(rvZVKSFeatures), RV_ZVKSG) +} + +var riscvVendorMap = map[uint64]Vendor{ + 0x489: SiFive, + 0x5b7: StarFive, + 0x5b1: THead, + 0x31e: Andes, + 0x710: SpacemiT, +} + +func riscvVendorID(mvendorid uint64) Vendor { + if v, ok := riscvVendorMap[mvendorid]; ok { + return v + } + return VendorUnknown +} diff --git a/vendor/github.com/mattn/go-colorable/colorable_windows.go b/vendor/github.com/mattn/go-colorable/colorable_windows.go index 2df7b8598a1..426a409ca41 100644 --- a/vendor/github.com/mattn/go-colorable/colorable_windows.go +++ b/vendor/github.com/mattn/go-colorable/colorable_windows.go @@ -5,13 +5,13 @@ package colorable import ( "bytes" + syscall "golang.org/x/sys/windows" "io" "math" "os" "strconv" "strings" "sync" - syscall "golang.org/x/sys/windows" "unsafe" "github.com/mattn/go-isatty" @@ -93,6 +93,7 @@ type writer struct { handle syscall.Handle althandle syscall.Handle oldattr word + curattr word oldpos coord rest bytes.Buffer mutex sync.Mutex @@ -112,7 +113,7 @@ func NewColorable(file *os.File) io.Writer { var csbi consoleScreenBufferInfo handle := syscall.Handle(file.Fd()) procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi))) - return &writer{out: file, handle: handle, oldattr: csbi.attributes, oldpos: coord{0, 0}} + return &writer{out: file, handle: handle, oldattr: csbi.attributes, curattr: csbi.attributes, oldpos: coord{0, 0}} } return file } @@ -438,7 +439,11 @@ func (w *writer) Write(data []byte) (n int, err error) { w.mutex.Lock() defer w.mutex.Unlock() var csbi consoleScreenBufferInfo - procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) + + if w.rest.Len() == 0 && bytes.IndexByte(data, 0x1b) == -1 { + w.out.Write(data) + return len(data), nil + } handle := w.handle @@ -517,7 +522,7 @@ loop: w.rest.Reset() break } - buf.Write([]byte(string(c))) + buf.WriteByte(c) } if m == 0 { break loop @@ -678,11 +683,11 @@ loop: procFillConsoleOutputCharacter.Call(uintptr(handle), uintptr(' '), uintptr(n), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written))) procFillConsoleOutputAttribute.Call(uintptr(handle), uintptr(csbi.attributes), uintptr(n), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written))) case 'm': - procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi))) - attr := csbi.attributes + attr := w.curattr cs := buf.String() if cs == "" { procSetConsoleTextAttribute.Call(uintptr(handle), uintptr(w.oldattr)) + w.curattr = w.oldattr continue } token := strings.Split(cs, ";") @@ -814,9 +819,12 @@ loop: attr |= backgroundBlue } } - procSetConsoleTextAttribute.Call(uintptr(handle), uintptr(attr)) } } + if attr != w.curattr { + procSetConsoleTextAttribute.Call(uintptr(handle), uintptr(attr)) + w.curattr = attr + } case 'h': var ci consoleCursorInfo cs := buf.String() @@ -834,6 +842,8 @@ loop: w.althandle = syscall.Handle(h) if w.althandle != 0 { handle = w.althandle + procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi))) + w.curattr = csbi.attributes } } } @@ -853,6 +863,8 @@ loop: syscall.CloseHandle(w.althandle) w.althandle = 0 handle = w.handle + procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi))) + w.curattr = csbi.attributes } } case 's': diff --git a/vendor/github.com/mattn/go-isatty/isatty_others.go b/vendor/github.com/mattn/go-isatty/isatty_others.go index 7402e0618aa..b24a2fadc9c 100644 --- a/vendor/github.com/mattn/go-isatty/isatty_others.go +++ b/vendor/github.com/mattn/go-isatty/isatty_others.go @@ -1,5 +1,5 @@ -//go:build (appengine || js || nacl || tinygo || wasm) && !windows -// +build appengine js nacl tinygo wasm +//go:build (appengine || js || nacl || tinygo || wasm || wasip1 || wasip2) && !windows +// +build appengine js nacl tinygo wasm wasip1 wasip2 // +build !windows package isatty diff --git a/vendor/github.com/mattn/go-isatty/isatty_windows.go b/vendor/github.com/mattn/go-isatty/isatty_windows.go index 8e3c99171bf..5f29c11dd25 100644 --- a/vendor/github.com/mattn/go-isatty/isatty_windows.go +++ b/vendor/github.com/mattn/go-isatty/isatty_windows.go @@ -31,6 +31,10 @@ func init() { if procGetFileInformationByHandleEx.Find() != nil { procGetFileInformationByHandleEx = nil } + // Check if NtQueryObject is available. + if procNtQueryObject.Find() != nil { + procNtQueryObject = nil + } } // IsTerminal return true if the file descriptor is terminal. @@ -43,6 +47,7 @@ func IsTerminal(fd uintptr) bool { // Check pipe name is used for cygwin/msys2 pty. // Cygwin/MSYS2 PTY has a name like: // \{cygwin,msys}-XXXXXXXXXXXXXXXX-ptyN-{from,to}-master +// On Windows 7 a trailing suffix (e.g. "-nat") may be appended. func isCygwinPipeName(name string) bool { token := strings.Split(name, "-") if len(token) < 5 { @@ -72,13 +77,19 @@ func isCygwinPipeName(name string) bool { return false } + for _, t := range token[5:] { + if t == "" { + return false + } + } + return true } -// getFileNameByHandle use the undocomented ntdll NtQueryObject to get file full name from file handler +// getFileNameByHandle use the undocumented ntdll NtQueryObject to get file full name from file handler // since GetFileInformationByHandleEx is not available under windows Vista and still some old fashion // guys are using Windows XP, this is a workaround for those guys, it will also work on system from -// Windows vista to 10 +// Windows Vista to 10 // see https://stackoverflow.com/a/18792477 for details func getFileNameByHandle(fd uintptr) (string, error) { if procNtQueryObject == nil { diff --git a/vendor/github.com/minio/minio-go/v7/.gitignore b/vendor/github.com/minio/minio-go/v7/.gitignore index 5bb12e74afb..39f4bee7a61 100644 --- a/vendor/github.com/minio/minio-go/v7/.gitignore +++ b/vendor/github.com/minio/minio-go/v7/.gitignore @@ -5,3 +5,4 @@ golangci-lint functional_tests .idea vendor/ +.branch-validate/ diff --git a/vendor/github.com/minio/minio-go/v7/README.md b/vendor/github.com/minio/minio-go/v7/README.md index ab421650d98..79343d739b1 100644 --- a/vendor/github.com/minio/minio-go/v7/README.md +++ b/vendor/github.com/minio/minio-go/v7/README.md @@ -1,4 +1,4 @@ -MinIO Go Client SDK for Amazon S3 Compatible Cloud Storage [![Slack](https://slack.min.io/slack?type=svg)](https://slack.min.io) [![Sourcegraph](https://sourcegraph.com/github.com/minio/minio-go/-/badge.svg)](https://sourcegraph.com/github.com/minio/minio-go?badge) [![Apache V2 License](https://img.shields.io/badge/license-Apache%20V2-blue.svg)](https://github.com/minio/minio-go/blob/master/LICENSE) +MinIO Go Client SDK for Amazon S3 Compatible Cloud Storage [![Sourcegraph](https://sourcegraph.com/github.com/minio/minio-go/-/badge.svg)](https://sourcegraph.com/github.com/minio/minio-go?badge) [![Apache V2 License](https://img.shields.io/badge/license-Apache%20V2-blue.svg)](https://github.com/minio/minio-go/blob/master/LICENSE) ================================================================================================================================================================================================================================================================================================================================================================================================================== The MinIO Go Client SDK provides straightforward APIs to access any Amazon S3 compatible object storage. diff --git a/vendor/github.com/minio/minio-go/v7/api-append-object.go b/vendor/github.com/minio/minio-go/v7/api-append-object.go index 5b34756eef7..f40287e502e 100644 --- a/vendor/github.com/minio/minio-go/v7/api-append-object.go +++ b/vendor/github.com/minio/minio-go/v7/api-append-object.go @@ -88,7 +88,7 @@ func (opts *AppendObjectOptions) setChecksumParams(info ObjectInfo) { } func (opts AppendObjectOptions) validate(c *Client) (err error) { - if opts.ChunkSize > maxPartSize { + if opts.ChunkSize > uint64(c.limits.maxPartSize()) { return errInvalidArgument("Append chunkSize cannot be larger than max part size allowed") } switch { @@ -212,7 +212,7 @@ func (c *Client) AppendObject(ctx context.Context, bucketName, objectName string if objectSize > 0 { finalObjSize = info.Size + objectSize } - totalPartsCount, partSize, lastPartSize, err := OptimalPartInfo(finalObjSize, opts.ChunkSize) + totalPartsCount, partSize, lastPartSize, err := c.optimalPartInfo(finalObjSize, opts.ChunkSize) if err != nil { return UploadInfo{}, err } diff --git a/vendor/github.com/minio/minio-go/v7/api-bucket-policy.go b/vendor/github.com/minio/minio-go/v7/api-bucket-policy.go index 0e561bdfab2..c4b768cec9f 100644 --- a/vendor/github.com/minio/minio-go/v7/api-bucket-policy.go +++ b/vendor/github.com/minio/minio-go/v7/api-bucket-policy.go @@ -1,6 +1,6 @@ /* * MinIO Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2020 MinIO, Inc. + * Copyright 2026 MinIO, Inc. * 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 @@ -18,14 +18,44 @@ package minio import ( "context" + "encoding/json" + "fmt" "io" "net/http" "net/url" "strings" + "github.com/minio/minio-go/v7/pkg/policy" "github.com/minio/minio-go/v7/pkg/s3utils" ) +// SetCannedBucketPolicy sets a canned (predefined) access policy on a bucket. +// This is a convenience method that translates predefined access levels +// (readonly, writeonly, readwrite) into the corresponding bucket policy. +// If access is empty or results in no policy statements, the existing bucket policy will be removed. +// +// Parameters: +// - ctx: Context for request cancellation and timeout +// - bucketName: Name of the bucket +// - access: Canned access level (policy.BucketPolicyNone, policy.BucketPolicyReadOnly, policy.BucketPolicyWriteOnly, policy.BucketPolicyReadWrite) +// +// Returns an error if the operation fails. +func (c *Client) SetCannedBucketPolicy(ctx context.Context, bucketName string, bucketPolicy policy.BucketPolicy) error { + if !bucketPolicy.IsValidBucketPolicy() { + return fmt.Errorf("invalid bucket policy %q", bucketPolicy) + } + p := policy.BucketAccessPolicy{Version: "2012-10-17"} + p.Statements = policy.SetPolicy(p.Statements, bucketPolicy, bucketName, "") + if len(p.Statements) == 0 { + return c.SetBucketPolicy(ctx, bucketName, "") + } + policyB, e := json.Marshal(p) + if e != nil { + return e + } + return c.SetBucketPolicy(ctx, bucketName, string(policyB)) +} + // SetBucketPolicy sets the access permissions policy on an existing bucket. // The policy should be a valid JSON string that conforms to the IAM policy format. // If policy is an empty string, the existing bucket policy will be removed. diff --git a/vendor/github.com/minio/minio-go/v7/api-compose-object.go b/vendor/github.com/minio/minio-go/v7/api-compose-object.go index 6d91bed433f..3dc5a6ef54a 100644 --- a/vendor/github.com/minio/minio-go/v7/api-compose-object.go +++ b/vendor/github.com/minio/minio-go/v7/api-compose-object.go @@ -23,8 +23,10 @@ import ( "io" "net/http" "net/url" + "sort" "strconv" "strings" + "sync" "time" "github.com/google/uuid" @@ -83,8 +85,13 @@ type CopyDestOptions struct { // Progress of the entire copy operation will be sent here. Progress io.Reader // PartSize specifies the part size for multipart copy operations. - // If not specified, defaults to maxPartSize (5 GiB). + // If not specified, defaults to the client's max part size (5 GiB unless + // overridden via Options.UploadLimits). PartSize uint64 + // NumThreads sets the number of concurrent upload-part-copy requests. + // Defaults to 1, and values above 100 are capped at 100. Ignored when + // the compose collapses to a single server-side copy. + NumThreads uint // AnnotationDirective controls whether the source object's annotations are // copied to the destination. Valid values are CopyAnnotationsDirective @@ -135,7 +142,7 @@ func (opts CopyDestOptions) Marshal(header http.Header) { if opts.Mode != RetentionMode("") && !opts.RetainUntilDate.IsZero() { header.Set(amzLockMode, opts.Mode.String()) - header.Set(amzLockRetainUntil, opts.RetainUntilDate.Format(time.RFC3339)) + header.Set(amzLockRetainUntil, opts.RetainUntilDate.UTC().Format(time.RFC3339)) } if opts.Encryption != nil { @@ -386,6 +393,7 @@ func (c *Client) copyObjectPartDo(ctx context.Context, srcBucket, srcObject, des return p, err } p.PartNumber, p.ETag = partID, cpObjRes.ETag + cpObjRes.setChecksums(&p) return p, nil } @@ -424,6 +432,7 @@ func (c *Client) uploadPartCopy(ctx context.Context, bucket, object, uploadID st return p, err } p.PartNumber, p.ETag = partNumber, cpObjRes.ETag + cpObjRes.setChecksums(&p) return p, nil } @@ -433,8 +442,21 @@ func (c *Client) uploadPartCopy(ctx context.Context, bucket, object, uploadID st // operations. Optionally takes progress reader hook for applications to // look at current progress. func (c *Client) ComposeObject(ctx context.Context, dst CopyDestOptions, srcs ...CopySrcOptions) (UploadInfo, error) { - if len(srcs) < 1 || len(srcs) > maxPartsCount { - return UploadInfo{}, errInvalidArgument("There must be as least one and up to 10000 source objects.") + maxPartsCount := c.limits.maxPartsCount() + maxPartSize := c.limits.maxPartSize() + maxObjectSize := c.limits.maxObjectSize() + + if len(srcs) < 1 || int64(len(srcs)) > maxPartsCount { + return UploadInfo{}, errInvalidArgument(fmt.Sprintf("There must be as least one and up to %d source objects.", maxPartsCount)) + } + + if dst.PartSize > uint64(maxPartSize) { + return UploadInfo{}, errInvalidArgument(fmt.Sprintf( + "CopyDestOptions.PartSize %d is larger than the maximum part size of %d", dst.PartSize, maxPartSize)) + } + partSize := int64(dst.PartSize) + if partSize == 0 { + partSize = maxPartSize } for _, src := range srcs { @@ -473,8 +495,8 @@ func (c *Client) ComposeObject(ctx context.Context, dst CopyDestOptions, srcs .. srcCopySize = src.End - src.Start + 1 } - // Only the last source may be less than `absMinPartSize` - if srcCopySize < absMinPartSize && i < len(srcs)-1 { + // Only the last source may be less than the minimum part size + if srcCopySize < c.limits.minPartSize() && i < len(srcs)-1 { return UploadInfo{}, errInvalidArgument( fmt.Sprintf("CopySrcOptions %d is too small (%d) and it is not the last part", i, srcCopySize)) } @@ -482,14 +504,23 @@ func (c *Client) ComposeObject(ctx context.Context, dst CopyDestOptions, srcs .. // Is data to copy too large? totalSize += srcCopySize if totalSize > maxObjectSize { - return UploadInfo{}, errInvalidArgument(fmt.Sprintf("Cannot compose an object of size %d (> 5GiB * 10000)", totalSize)) + return UploadInfo{}, errInvalidArgument(fmt.Sprintf("Cannot compose an object of size %d (> %d * %d)", totalSize, maxPartSize, maxPartsCount)) } // record source size srcObjectSizes[i] = srcCopySize // calculate parts needed for current source - totalParts += partsRequired(srcCopySize, int64(dst.PartSize)) + reqParts := partsRequired(srcCopySize, partSize) + // A part size close to the minimum can make calculateEvenSplits emit + // ranges below it, which the remote rejects. Only the very last range + // of the last source is allowed to be undersized. + if under := undersizedSplits(srcCopySize, reqParts, c.limits.minPartSize()); under > 1 || (under == 1 && i < len(srcs)-1) { + return UploadInfo{}, errInvalidArgument(fmt.Sprintf( + "CopySrcOptions %d (%d bytes) splits into %d ranges below the minimum part size of %d at a part size of %d", + i, srcCopySize, under, c.limits.minPartSize(), partSize)) + } + totalParts += reqParts // Do we need more parts than we are allowed? if totalParts > maxPartsCount { return UploadInfo{}, errInvalidArgument(fmt.Sprintf( @@ -531,6 +562,19 @@ func (c *Client) ComposeObject(ctx context.Context, dst CopyDestOptions, srcs .. userTags = srcObjectInfos[0].UserTags } + // Set the requested checksum algorithm on the multipart upload. + if dst.ChecksumType.IsSet() { + meta := make(map[string]string, len(userMeta)+2) + for k, v := range userMeta { + meta[k] = v + } + meta[amzChecksumAlgo] = dst.ChecksumType.String() + if dst.ChecksumType.FullObjectRequested() { + meta[amzChecksumMode] = ChecksumFullObjectMode.String() + } + userMeta = meta + } + uploadID, err := c.newUploadID(ctx, dst.Bucket, dst.Object, PutObjectOptions{ ServerSideEncryption: dst.Encryption, UserMetadata: userMeta, @@ -544,8 +588,7 @@ func (c *Client) ComposeObject(ctx context.Context, dst CopyDestOptions, srcs .. } // 3. Perform copy part uploads - objParts := []CompletePart{} - partIndex := 1 + var parts []copyPart for i, src := range srcs { h := make(http.Header) src.Marshal(h) @@ -555,29 +598,21 @@ func (c *Client) ComposeObject(ctx context.Context, dst CopyDestOptions, srcs .. // calculate start/end indices of parts after // splitting. - startIdx, endIdx := calculateEvenSplits(srcObjectSizes[i], src, int64(dst.PartSize)) + startIdx, endIdx := calculateEvenSplits(srcObjectSizes[i], src, partSize) for j, start := range startIdx { end := endIdx[j] - - // Add (or reset) source range header for - // upload part copy request. - h.Set("x-amz-copy-source-range", - fmt.Sprintf("bytes=%d-%d", start, end)) - - // make upload-part-copy request - complPart, err := c.uploadPartCopy(ctx, dst.Bucket, - dst.Object, uploadID, partIndex, h) - if err != nil { - return UploadInfo{}, err - } - if dst.Progress != nil { - io.CopyN(io.Discard, dst.Progress, end-start+1) - } - objParts = append(objParts, complPart) - partIndex++ + ph := h.Clone() + ph.Set("x-amz-copy-source-range", fmt.Sprintf("bytes=%d-%d", start, end)) + parts = append(parts, copyPart{number: len(parts) + 1, header: ph, size: end - start + 1}) } } + objParts, err := c.uploadPartsCopy(ctx, dst, uploadID, parts) + if err != nil { + c.abortFailedUpload(ctx, dst.Bucket, dst.Object, uploadID) + return UploadInfo{}, err + } + // 4. Make final complete-multipart request. uploadInfo, err := c.completeMultipartUpload(ctx, dst.Bucket, dst.Object, uploadID, completeMultipartUpload{Parts: objParts}, PutObjectOptions{ServerSideEncryption: dst.Encryption}) @@ -589,11 +624,88 @@ func (c *Client) ComposeObject(ctx context.Context, dst CopyDestOptions, srcs .. return uploadInfo, nil } +type copyPart struct { + number int + header http.Header + size int64 +} + +func (opts CopyDestOptions) getNumThreads() int { + return int(min(max(opts.NumThreads, 1), 100)) +} + +// uploadPartsCopy runs the upload-part-copy requests on dst.NumThreads +// workers, cancels the remaining parts on the first failure and returns +// the completed parts in ascending part number order. +func (c *Client) uploadPartsCopy(ctx context.Context, dst CopyDestOptions, uploadID string, parts []copyPart) ([]CompletePart, error) { + ctx, cancel := context.WithCancel(ctx) + defer cancel() + + type partResult struct { + part CompletePart + size int64 + err error + } + jobs := make(chan copyPart) + results := make(chan partResult) + + go func() { + defer close(jobs) + for _, p := range parts { + select { + case jobs <- p: + case <-ctx.Done(): + return + } + } + }() + + var wg sync.WaitGroup + for range min(dst.getNumThreads(), len(parts)) { + wg.Go(func() { + for p := range jobs { + part, err := c.uploadPartCopy(ctx, dst.Bucket, dst.Object, uploadID, p.number, p.header) + results <- partResult{part: part, size: p.size, err: err} + } + }) + } + go func() { + wg.Wait() + close(results) + }() + + objParts := make([]CompletePart, 0, len(parts)) + var err error + for res := range results { + if err != nil { + continue + } + if res.err != nil { + err = res.err + cancel() + continue + } + objParts = append(objParts, res.part) + if dst.Progress != nil { + io.CopyN(io.Discard, dst.Progress, res.size) + } + } + if err == nil { + err = ctx.Err() + } + if err != nil { + return nil, err + } + sort.Sort(completedParts(objParts)) + return objParts, nil +} + // partsRequired calculates the number of parts needed for a given size -// using the specified part size. If partSize is 0, defaults to maxPartSize (5 GiB). +// using the specified part size. If partSize is 0, defaults to the default +// max part size (5 GiB); callers with a Client resolve it against its limits. func partsRequired(size int64, partSize int64) int64 { if partSize == 0 { - partSize = maxPartSize + partSize = defaultMaxPartSize } r := size / partSize if size%partSize > 0 { @@ -602,10 +714,28 @@ func partsRequired(size int64, partSize int64) int64 { return r } +// undersizedSplits reports how many of the reqParts ranges calculateEvenSplits +// generates for size fall below minPartSize. It emits the rem larger ranges +// first, so the undersized ones are always at the tail. +func undersizedSplits(size, reqParts, minPartSize int64) int64 { + if reqParts <= 0 { + // An empty source generates no ranges at all. + return 0 + } + quot, rem := size/reqParts, size%reqParts + if quot+1 < minPartSize { + return reqParts + } + if quot < minPartSize { + return reqParts - rem + } + return 0 +} + // calculateEvenSplits - computes splits for a source and returns // start and end index slices. Splits happen evenly to be sure that no // part is less than 5MiB, as that could fail the multipart request if -// it is not the last part. If partSize is 0, defaults to maxPartSize (5 GiB). +// it is not the last part. If partSize is 0, partsRequired's default applies. func calculateEvenSplits(size int64, src CopySrcOptions, partSize int64) (startIndex, endIndex []int64) { if size == 0 { return startIndex, endIndex diff --git a/vendor/github.com/minio/minio-go/v7/api-copy-object.go b/vendor/github.com/minio/minio-go/v7/api-copy-object.go index b6cadc86a92..1fed507df31 100644 --- a/vendor/github.com/minio/minio-go/v7/api-copy-object.go +++ b/vendor/github.com/minio/minio-go/v7/api-copy-object.go @@ -41,6 +41,9 @@ func (c *Client) CopyObject(ctx context.Context, dst CopyDestOptions, src CopySr bucketName: dst.Bucket, objectName: dst.Object, customHeader: header, + // S3 can return a failed copy as 200 OK with an embedded body. + // https://repost.aws/knowledge-center/s3-resolve-200-internalerror + expect200OKWithError: true, }) if err != nil { return UploadInfo{}, err @@ -65,12 +68,23 @@ func (c *Client) CopyObject(ctx context.Context, dst CopyDestOptions, src CopySr expTime, ruleID := amzExpirationToExpiryDateRuleID(resp.Header.Get(amzExpiration)) return UploadInfo{ - Bucket: dst.Bucket, - Key: dst.Object, - LastModified: cpObjRes.LastModified, - ETag: trimEtag(cpObjRes.ETag), - VersionID: resp.Header.Get(amzVersionID), - Expiration: expTime, - ExpirationRuleID: ruleID, + Bucket: dst.Bucket, + Key: dst.Object, + LastModified: cpObjRes.LastModified, + ETag: trimEtag(cpObjRes.ETag), + VersionID: resp.Header.Get(amzVersionID), + Expiration: expTime, + ExpirationRuleID: ruleID, + ChecksumCRC32: cpObjRes.ChecksumCRC32, + ChecksumCRC32C: cpObjRes.ChecksumCRC32C, + ChecksumSHA1: cpObjRes.ChecksumSHA1, + ChecksumSHA256: cpObjRes.ChecksumSHA256, + ChecksumCRC64NVME: cpObjRes.ChecksumCRC64NVME, + ChecksumMD5: cpObjRes.ChecksumMD5, + ChecksumSHA512: cpObjRes.ChecksumSHA512, + ChecksumXXHash64: cpObjRes.ChecksumXXHash64, + ChecksumXXHash3: cpObjRes.ChecksumXXHash3, + ChecksumXXHash128: cpObjRes.ChecksumXXHash128, + ChecksumMode: cpObjRes.ChecksumType, }, nil } diff --git a/vendor/github.com/minio/minio-go/v7/api-datatypes.go b/vendor/github.com/minio/minio-go/v7/api-datatypes.go index f359f29a763..238799edb18 100644 --- a/vendor/github.com/minio/minio-go/v7/api-datatypes.go +++ b/vendor/github.com/minio/minio-go/v7/api-datatypes.go @@ -122,8 +122,8 @@ func stringsCut(s, sep string) (before, after string, found bool) { // Owner name. type Owner struct { XMLName xml.Name `xml:"Owner" json:"owner"` - DisplayName string `xml:"ID" json:"name"` - ID string `xml:"DisplayName" json:"id"` + DisplayName string `xml:"DisplayName" json:"name"` + ID string `xml:"ID" json:"id"` } // UploadInfo contains information about the @@ -161,9 +161,9 @@ type UploadInfo struct { // RestoreInfo contains information of the restore operation of an archived object type RestoreInfo struct { // Is the restoring operation is still ongoing - OngoingRestore bool + OngoingRestore bool `xml:"IsRestoreInProgress"` // When the restored copy of the archived object will be removed - ExpiryTime time.Time + ExpiryTime time.Time `xml:"RestoreExpiryDate"` } // ObjectInfo container for object metadata. @@ -184,10 +184,30 @@ type ObjectInfo struct { // eg: x-amz-meta-*, content-encoding etc. Metadata http.Header `json:"metadata" xml:"-"` - // x-amz-meta-* headers stripped "x-amz-meta-" prefix containing the first value. + // Headers is the unfiltered set of response headers from the + // HEAD or GET request that produced this ObjectInfo, e.g. + // Content-Range for ranged requests. RFC 2047-encoded + // x-amz-meta-*/x-minio-meta-* values appear MIME-decoded, matching + // Metadata. Set only when the object info is parsed from an HTTP + // object response (StatObject, GetObject); nil elsewhere, e.g. in + // ListObjects results, on error paths, or for RDMA-backed GetObject. + // It aliases the response headers and must be treated as read-only. + Headers http.Header `json:"rawHeaders,omitempty" xml:"-"` + + // UserMetadata contains x-amz-meta-* user metadata. + // StatObject and GetObject return it with the "X-Amz-Meta-" prefix + // stripped; list results with WithMetadata keep the exact values stored + // on the object (prefixed keys plus system entries such as content-type). // Only returned by MinIO servers. UserMetadata StringMap `json:"userMetadata,omitempty"` + // UserMetadataStripped is the user metadata from list results in the + // keyed form StatObject and GetObject return in UserMetadata: + // x-amz-meta-* entries with the "X-Amz-Meta-" prefix stripped and + // values passed through verbatim. + // Only populated by MinIO servers when listing with WithMetadata. + UserMetadataStripped StringMap `json:"userMetadataStripped,omitempty" xml:"-"` + // x-amz-tagging values in their k/v values. // Only returned by MinIO servers. UserTags URLMap `json:"userTags,omitempty" xml:"UserTags"` @@ -224,7 +244,10 @@ type ObjectInfo struct { // NumVersions is the number of versions of the object. NumVersions int - Restore *RestoreInfo + // Restore is the restore state of an archived object. Listings only + // report it when asked with ListObjectsOptions.WithRestoreStatus, and + // only for objects that have been restored or are being restored. + Restore *RestoreInfo `xml:"RestoreStatus"` // Checksum values ChecksumCRC32 string @@ -234,9 +257,9 @@ type ObjectInfo struct { ChecksumCRC64NVME string ChecksumMD5 string ChecksumSHA512 string - ChecksumXXHash64 string - ChecksumXXHash3 string - ChecksumXXHash128 string + ChecksumXXHash64 string `xml:"ChecksumXXHASH64"` + ChecksumXXHash3 string `xml:"ChecksumXXHASH3"` + ChecksumXXHash128 string `xml:"ChecksumXXHASH128"` ChecksumAlgorithm string ChecksumMode string `xml:"ChecksumType"` diff --git a/vendor/github.com/minio/minio-go/v7/api-error-response.go b/vendor/github.com/minio/minio-go/v7/api-error-response.go index 03c7e943576..68f7adad2e3 100644 --- a/vendor/github.com/minio/minio-go/v7/api-error-response.go +++ b/vendor/github.com/minio/minio-go/v7/api-error-response.go @@ -216,6 +216,7 @@ func httpRespToErrorResponse(resp *http.Response, bucketName, objectName string) if errResp.HostID == "" { errResp.HostID = resp.Header.Get("x-amz-id-2") } + errResp.Region = strings.TrimSpace(errResp.Region) if errResp.Region == "" { errResp.Region = resp.Header.Get("x-amz-bucket-region") } @@ -249,6 +250,33 @@ func errEntityTooLarge(totalSize, maxObjectSize int64, bucketName, objectName st } } +// errPartTooLarge - Input part size is larger than the maximum allowed part +// size, which is configurable via Options.UploadLimits. +func errPartTooLarge(partSize, maxPartSize int64, bucketName, objectName string) error { + msg := fmt.Sprintf("Your proposed part size ‘%d’ exceeds the maximum allowed part size ‘%d’.", partSize, maxPartSize) + return ErrorResponse{ + StatusCode: http.StatusBadRequest, + Code: EntityTooLarge, + Message: msg, + BucketName: bucketName, + Key: objectName, + } +} + +// errUploadTooLarge - An unknown length reader outlasted the parts the upload +// was laid out for. The object's real size is not known, so only the number of +// bytes that fit is reported; it is not an allowed maximum. +func errUploadTooLarge(uploadedSize, totalPartsCount int64, bucketName, objectName string) error { + msg := fmt.Sprintf("Input stream exceeds the ‘%d’ parts this upload allows; ‘%d’ bytes were uploaded before the limit was reached. Set PutObjectOptions.PartSize to upload a larger object.", totalPartsCount, uploadedSize) + return ErrorResponse{ + StatusCode: http.StatusBadRequest, + Code: EntityTooLarge, + Message: msg, + BucketName: bucketName, + Key: objectName, + } +} + // errEntityTooSmall - Input size is smaller than supported minimum. func errEntityTooSmall(totalSize int64, bucketName, objectName string) error { msg := fmt.Sprintf("Your proposed upload size ‘%d’ is below the minimum allowed object size ‘0B’ for single PUT operation.", totalSize) diff --git a/vendor/github.com/minio/minio-go/v7/api-get-object-file.go b/vendor/github.com/minio/minio-go/v7/api-get-object-file.go index 6ef9c9330ee..dd62b3f7c86 100644 --- a/vendor/github.com/minio/minio-go/v7/api-get-object-file.go +++ b/vendor/github.com/minio/minio-go/v7/api-get-object-file.go @@ -72,7 +72,7 @@ func (c *Client) FGetObject(ctx context.Context, bucketName, objectName, filePat filePartPath := filepath.Join(filepath.Dir(filePath), sum256Hex([]byte(filepath.Base(filePath)+objectStat.ETag))+".part.minio") // If exists, open in append mode. If not create it as a part file. - filePart, err := os.OpenFile(filePartPath, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0o600) + filePart, err := os.OpenFile(filePartPath, os.O_CREATE|os.O_APPEND|os.O_RDWR, 0o600) if err != nil { return err } @@ -98,19 +98,41 @@ func (c *Client) FGetObject(ctx context.Context, bucketName, objectName, filePat // appropriate range offsets to read from. if st.Size() > 0 { opts.SetRange(st.Size(), 0) + if opts.Checksum && objectStat.ChecksumMode == ChecksumFullObjectMode.String() { + if hasherReader := c.newChecksumVerifyingReader(objectStat); hasherReader != nil { + // Read existing file data into hash. + if _, err = io.CopyN(hasherReader.Hash, filePart, st.Size()); err != nil { + _ = hasherReader.Close() + return err + } + opts.checkSumReader = hasherReader + } + } } // Seek to current position for incoming reader. objectReader, objectStat, _, err := c.getObject(ctx, bucketName, objectName, opts) if err != nil { + if opts.checkSumReader != nil { + _ = opts.checkSumReader.Close() + } return err } + defer objectReader.Close() + // Write to the part file. if _, err = io.CopyN(filePart, objectReader, objectStat.Size); err != nil { return err } + // Verify the checksum of the downloaded object before committing the file. + if cr, ok := objectReader.(*checksumVerifyingReader); ok { + if err = cr.VerifyChecksum(); err != nil { + return err + } + } + // Close the file before rename, this is specifically needed for Windows users. closeAndRemove = false if err = filePart.Close(); err != nil { diff --git a/vendor/github.com/minio/minio-go/v7/api-get-object-parallel.go b/vendor/github.com/minio/minio-go/v7/api-get-object-parallel.go new file mode 100644 index 00000000000..f4cff013aad --- /dev/null +++ b/vendor/github.com/minio/minio-go/v7/api-get-object-parallel.go @@ -0,0 +1,139 @@ +/* + * MinIO Go Library for Amazon S3 Compatible Cloud Storage + * Copyright 2026 MinIO, Inc. + * + * 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 minio + +import ( + "context" + "fmt" + "io" + "maps" +) + +func (o GetObjectOptions) parallelGetEnabled() bool { + return o.ParallelWorkers > 1 && o.PartNumber == 0 && !o.Checksum && o.RDMABuffer == nil && o.headers["Range"] == "" +} + +func parallelGetChunkSize(chunkSize, objectSize int64) int64 { + chunkSize = max(chunkSize, minPartSize) + if (objectSize+chunkSize-1)/chunkSize > defaultMaxPartsCount { + chunkSize = (objectSize + defaultMaxPartsCount - 1) / defaultMaxPartsCount + } + return chunkSize +} + +type parallelGetReader struct { + *io.PipeReader + cancel context.CancelFunc +} + +func (r parallelGetReader) Close() error { + r.cancel() + return r.PipeReader.Close() +} + +// getObjectParallel reads the object with concurrent range GETs pinned to +// its ETag, falling back to a single GET when it fits in one chunk or has +// no ETag. +func (c *Client) getObjectParallel(ctx context.Context, bucketName, objectName string, opts GetObjectOptions) (io.ReadCloser, ObjectInfo, error) { + objectInfo, err := c.StatObject(ctx, bucketName, objectName, opts) + if err != nil { + return nil, ObjectInfo{}, err + } + chunkSize := parallelGetChunkSize(opts.ParallelChunkSize, objectInfo.Size) + if objectInfo.Size <= chunkSize || objectInfo.ETag == "" { + body, objectInfo, _, err := c.getObject(ctx, bucketName, objectName, opts) + return body, objectInfo, err + } + + // The caller keeps reusing opts.headers for later requests. + opts.headers = maps.Clone(opts.headers) + opts.SetMatchETag(objectInfo.ETag) + + ctx, cancel := context.WithCancel(ctx) + pr, pw := io.Pipe() + go func() { + pw.CloseWithError(c.parallelGet(ctx, bucketName, objectName, opts, objectInfo.Size, chunkSize, pw)) + }() + return parallelGetReader{PipeReader: pr, cancel: cancel}, objectInfo, nil +} + +// parallelGet writes the object to w in order. At most opts.ParallelWorkers +// chunks are being fetched or held in memory at any time. +func (c *Client) parallelGet(ctx context.Context, bucketName, objectName string, opts GetObjectOptions, size, chunkSize int64, w io.Writer) error { + ctx, cancel := context.WithCancel(ctx) + defer cancel() + + type chunk struct { + data []byte + err error + } + numChunks := (size + chunkSize - 1) / chunkSize + pending := make(chan chan chunk, min(int64(opts.ParallelWorkers), numChunks)-1) + go func() { + defer close(pending) + for start := int64(0); start < size; start += chunkSize { + res := make(chan chunk, 1) + select { + case pending <- res: + case <-ctx.Done(): + return + } + go func() { + data, err := c.getObjectChunk(ctx, bucketName, objectName, opts, start, min(start+chunkSize, size)-1, size) + res <- chunk{data: data, err: err} + }() + } + }() + + for res := range pending { + var r chunk + select { + case r = <-res: + case <-ctx.Done(): + return ctx.Err() + } + if r.err != nil { + return r.err + } + if _, err := w.Write(r.data); err != nil { + return err + } + } + return ctx.Err() +} + +func (c *Client) getObjectChunk(ctx context.Context, bucketName, objectName string, opts GetObjectOptions, start, end, size int64) ([]byte, error) { + opts.headers = maps.Clone(opts.headers) + if err := opts.SetRange(start, end); err != nil { + return nil, err + } + body, _, header, err := c.getObject(ctx, bucketName, objectName, opts) + if err != nil { + return nil, err + } + defer body.Close() + + if cr := header.Get("Content-Range"); cr != fmt.Sprintf("bytes %d-%d/%d", start, end, size) { + return nil, fmt.Errorf("unexpected Content-Range %q for range %d-%d", cr, start, end) + } + data := make([]byte, end-start+1) + if _, err := io.ReadFull(body, data); err != nil { + return nil, err + } + return data, nil +} diff --git a/vendor/github.com/minio/minio-go/v7/api-get-object.go b/vendor/github.com/minio/minio-go/v7/api-get-object.go index ab783551520..a583588906d 100644 --- a/vendor/github.com/minio/minio-go/v7/api-get-object.go +++ b/vendor/github.com/minio/minio-go/v7/api-get-object.go @@ -51,15 +51,7 @@ func (c *Client) GetObject(ctx context.Context, bucketName, objectName string, o if err != nil { return nil, err } - return &Object{ - mutex: &sync.Mutex{}, - isClosed: true, - objectInfo: ObjectInfo{ - Key: objectName, - Size: n, - }, - objectInfoSet: true, - }, nil + return newRDMAObject(objectName, n), nil } gctx, cancel := context.WithCancel(ctx) @@ -81,6 +73,8 @@ func (c *Client) GetObject(ctx context.Context, bucketName, objectName string, o reqCh := make(chan getRequest) // Create response channel. resCh := make(chan getResponse) + // record original range header for stat operation. + originalRangeHeader := opts.Header().Get("Range") // This routine feeds partial object data as and when the caller reads. go func() { @@ -112,9 +106,19 @@ func (c *Client) GetObject(ctx context.Context, bucketName, objectName string, o } else if req.Offset > 0 { opts.SetRange(req.Offset, 0) } - httpReader, objectInfo, _, err = c.getObject(gctx, bucketName, objectName, opts) + if !req.isReadAt && req.Offset == 0 && !snowball && opts.parallelGetEnabled() { + httpReader, objectInfo, err = c.getObjectParallel(gctx, bucketName, objectName, opts) + } else { + httpReader, objectInfo, _, err = c.getObject(gctx, bucketName, objectName, opts) + } if err != nil { resCh <- getResponse{Error: err} + // An unsatisfiable range is recoverable: the caller + // may Seek or ReadAt within bounds next, so keep + // serving requests instead of ending the stream. + if ToErrorResponse(err).Code == InvalidRange { + continue + } return } etag = objectInfo.ETag @@ -141,19 +145,35 @@ func (c *Client) GetObject(ctx context.Context, bucketName, objectName string, o // it to io.EOF - return unexpected EOF. err = io.ErrUnexpectedEOF } + // when doing a readAt, we can't reuse the httpReader for next read action. + if req.isReadAt { + httpReader.Close() + httpReader = nil + } + + objectSize := int64(0) + // case for ReadFull with range request + if !req.isReadAt && req.Offset == 0 { + objectSize = objectInfo.Size + } // Send back the first response. resCh <- getResponse{ + ObjectSize: objectSize, objectInfo: objectInfo, Size: size, Error: err, didRead: true, } } else { - // First request is a Stat or Seek call. - // Only need to run a StatObject until an actual Read or ReadAt request comes through. + if originalRangeHeader == "" { + // First request is a Seek call. + // Only need to run a StatObject until an actual Read request comes through. - // Remove range header if already set, for stat Operations to get original file size. - delete(opts.headers, "Range") + // Remove range header if already set, for stat Operations to get original file size. + delete(opts.headers, "Range") + } else { + opts.headers["Range"] = originalRangeHeader + } objectInfo, err = c.StatObject(gctx, bucketName, objectName, StatObjectOptions(opts)) if err != nil { resCh <- getResponse{ @@ -165,12 +185,17 @@ func (c *Client) GetObject(ctx context.Context, bucketName, objectName string, o etag = objectInfo.ETag // Send back the first response. resCh <- getResponse{ + ObjectSize: objectInfo.Size, objectInfo: objectInfo, } } } else if req.settingObjectInfo { // Request is just to get objectInfo. // Remove range header if already set, for stat Operations to get original file size. - delete(opts.headers, "Range") + if originalRangeHeader == "" { + delete(opts.headers, "Range") + } else { + opts.headers["Range"] = originalRangeHeader + } // Check whether this is snowball // if yes do not use If-Match feature // it doesn't work. @@ -187,16 +212,22 @@ func (c *Client) GetObject(ctx context.Context, bucketName, objectName string, o } // Send back the objectInfo. resCh <- getResponse{ + ObjectSize: objectInfo.Size, objectInfo: objectInfo, } } else { + objectSize := int64(0) + renewReader := false // Offset changes fetch the new object at an Offset. // Because the httpReader may not be set by the first // request if it was a stat or seek it must be checked // if the object has been read or not to only initialize // new ones when they haven't been already. // All readAt requests are new requests. - if req.DidOffsetChange || !req.beenRead { + // A nil httpReader means the previous fetch failed and + // left no stream, so a new one must be established + // regardless of the offset bookkeeping. + if req.DidOffsetChange || !req.beenRead || httpReader == nil { // Check whether this is snowball // if yes do not use If-Match feature // it doesn't work. @@ -214,16 +245,34 @@ func (c *Client) GetObject(ctx context.Context, bucketName, objectName string, o } else if req.Offset > 0 { // Range is set with respect to the offset. opts.SetRange(req.Offset, 0) } else { - // Remove range header if already set - delete(opts.headers, "Range") + if originalRangeHeader == "" { + delete(opts.headers, "Range") + } else { + opts.headers["Range"] = originalRangeHeader + } + } + if !req.isReadAt && req.Offset == 0 && !snowball && opts.parallelGetEnabled() { + httpReader, objectInfo, err = c.getObjectParallel(gctx, bucketName, objectName, opts) + } else { + httpReader, objectInfo, _, err = c.getObject(gctx, bucketName, objectName, opts) } - httpReader, objectInfo, _, err = c.getObject(gctx, bucketName, objectName, opts) if err != nil { resCh <- getResponse{ Error: err, } + // An unsatisfiable range is recoverable: the caller + // may Seek or ReadAt within bounds next, so keep + // serving requests instead of ending the stream. + if ToErrorResponse(err).Code == InvalidRange { + continue + } return } + // case for ReadFull with range request + if !req.isReadAt && req.Offset == 0 { + objectSize = objectInfo.Size + } + renewReader = true totalRead = 0 } @@ -250,9 +299,13 @@ func (c *Client) GetObject(ctx context.Context, bucketName, objectName string, o // it to io.EOF - return unexpected EOF. err = io.ErrUnexpectedEOF } - + if renewReader && req.isReadAt { + httpReader.Close() + httpReader = nil + } // Reply back how much was read. resCh <- getResponse{ + ObjectSize: objectSize, Size: size, Error: err, didRead: true, @@ -281,6 +334,7 @@ type getRequest struct { // get response message container to reply back for the request. type getResponse struct { + ObjectSize int64 Size int Error error didRead bool // Lets subsequent calls know whether or not httpReader has been initiated. @@ -299,6 +353,7 @@ type Object struct { ctx context.Context cancel context.CancelFunc currOffset int64 + totalSize int64 objectInfo ObjectInfo // Ask lower level to initiate data fetching based on currOffset @@ -356,6 +411,10 @@ func (o *Object) doGetRequest(request getRequest) (getResponse, error) { // Data are ready on the wire, no need to reinitiate connection in lower level o.seekData = false + if response.ObjectSize != 0 { + o.totalSize = response.ObjectSize + } + return response, response.Error } @@ -365,7 +424,7 @@ func (o *Object) setOffset(bytesRead int64) error { // Update the currentOffset. o.currOffset += bytesRead - if o.objectInfo.Size > -1 && o.currOffset >= o.objectInfo.Size { + if o.totalSize > -1 && o.currOffset >= o.totalSize { return io.EOF } return nil @@ -387,6 +446,13 @@ func (o *Object) Read(b []byte) (n int, err error) { if o.prevErr != nil || o.isClosed { return 0, o.prevErr } + // If the current offset is at or beyond the known object size, there is + // nothing more to read. Return io.EOF directly instead of issuing a range + // request from EOF (which the server rejects as an unsatisfiable range). + if o.objectInfoSet && o.objectInfo.Size > -1 && o.currOffset >= o.objectInfo.Size { + o.prevErr = io.EOF + return 0, io.EOF + } // Create a new request. readReq := getRequest{ @@ -407,6 +473,14 @@ func (o *Object) Read(b []byte) (n int, err error) { // Send and receive from the first request. response, err := o.doGetRequest(readReq) if err != nil && err != io.EOF { + // An InvalidRange response to a range generated from a non-zero + // read offset means the position is at or past EOF for the object + // as it currently exists. Offset zero sends only a caller-supplied + // range, whose InvalidRange must surface untranslated. + if o.currOffset > 0 && ToErrorResponse(err).Code == InvalidRange { + o.prevErr = io.EOF + return 0, io.EOF + } // Save the error for future calls. o.prevErr = err return response.Size, err @@ -427,7 +501,28 @@ func (o *Object) Read(b []byte) (n int, err error) { return response.Size, err } +// newRDMAObject returns the Object handed back by the RDMA GET path, whose +// payload of n bytes has already been delivered out-of-band into the caller's +// registered buffer. The object is closed on arrival: there is nothing left to +// read from it, only its info to report. totalSize must carry n as well as +// objectInfo.Size, because Stat recomputes Size as totalSize-currOffset for +// any object whose info is already set. +func newRDMAObject(objectName string, n int64) *Object { + return &Object{ + mutex: &sync.Mutex{}, + isClosed: true, + objectInfo: ObjectInfo{ + Key: objectName, + Size: n, + }, + objectInfoSet: true, + totalSize: n, + } +} + // Stat returns the ObjectInfo structure describing Object. +// When requesting a partial object or reading has started, +// the size returned will reflect the remaining size. func (o *Object) Stat() (ObjectInfo, error) { if o == nil { return ObjectInfo{}, errInvalidArgument("Object is nil") @@ -436,7 +531,24 @@ func (o *Object) Stat() (ObjectInfo, error) { o.mutex.Lock() defer o.mutex.Unlock() - if o.prevErr != nil && o.prevErr != io.EOF || o.isClosed { + if o.prevErr != nil && o.prevErr != io.EOF { + return ObjectInfo{}, o.prevErr + } + + // When the object info is already known (e.g. the RDMA GET path, whose + // payload is delivered out-of-band so the object is created closed, or a + // previously completed request) report it, even for a closed object. + if o.objectInfoSet { + if o.currOffset > o.totalSize { + return ObjectInfo{}, io.EOF + } + if o.currOffset <= o.totalSize { + o.objectInfo.Size = o.totalSize - o.currOffset + } + return o.objectInfo, nil + } + + if o.isClosed { return ObjectInfo{}, o.prevErr } @@ -452,7 +564,12 @@ func (o *Object) Stat() (ObjectInfo, error) { return ObjectInfo{}, err } } - + if o.currOffset > o.totalSize { + return ObjectInfo{}, io.EOF + } + if o.currOffset <= o.totalSize { + o.objectInfo.Size = o.totalSize - o.currOffset + } return o.objectInfo, nil } @@ -488,7 +605,7 @@ func (o *Object) ReadAt(b []byte, offset int64) (n int, err error) { if o.objectInfoSet { // If offset is negative than we return io.EOF. // If offset is greater than or equal to object size we return io.EOF. - if (o.objectInfo.Size > -1 && offset >= o.objectInfo.Size) || offset < 0 { + if (o.totalSize > -1 && offset >= o.totalSize) || offset < 0 { return 0, io.EOF } } @@ -511,6 +628,12 @@ func (o *Object) ReadAt(b []byte, offset int64) (n int, err error) { // Send and receive from the first request. response, err := o.doGetRequest(readAtReq) if err != nil && err != io.EOF { + // Reading at an offset at or beyond the object size yields + // InvalidRange from the server: report io.EOF, matching the + // io.ReaderAt contract for reads past the end. + if ToErrorResponse(err).Code == InvalidRange { + return 0, io.EOF + } // Save the error. o.prevErr = err return response.Size, err @@ -541,9 +664,10 @@ func (o *Object) ReadAt(b []byte, offset int64) (n int, err error) { // and 2 means relative to the end. // Seek returns the new offset and an error, if any. // -// Seeking to a negative offset is an error. Seeking to any positive -// offset is legal, subsequent io operations succeed until the -// underlying object is not closed. +// Seeking to a position before the start of the object is an error. +// Seeking to the end of the object is legal; the subsequent Read reports +// io.EOF. When the object size is known, seeking past the end returns +// io.EOF from Seek itself and leaves the offset unchanged. func (o *Object) Seek(offset int64, whence int) (n int64, err error) { if o == nil { return 0, errInvalidArgument("Object is nil") @@ -558,9 +682,11 @@ func (o *Object) Seek(offset int64, whence int) (n int64, err error) { return 0, o.prevErr } - // Negative offset is valid for whence of '2'. - if offset < 0 && whence != 2 { - return 0, errInvalidArgument(fmt.Sprintf("Negative position not allowed for %d", whence)) + // Negative absolute offsets are invalid for SeekStart. Negative offsets + // for SeekCurrent/SeekEnd are valid as long as the computed position is + // not before the start of the object (checked after applying whence). + if offset < 0 && whence == 0 { + return 0, errInvalidArgument("Negative position not allowed for 0") } // This is the first request. So before anything else @@ -588,31 +714,26 @@ func (o *Object) Seek(offset int64, whence int) (n int64, err error) { default: return 0, errInvalidArgument(fmt.Sprintf("Invalid whence %d", whence)) case 0: - if o.objectInfo.Size > -1 && offset > o.objectInfo.Size { - return 0, io.EOF - } newOffset = offset case 1: - if o.objectInfo.Size > -1 && o.currOffset+offset > o.objectInfo.Size { - return 0, io.EOF - } newOffset += offset case 2: // If we don't know the object size return an error for io.SeekEnd - if o.objectInfo.Size < 0 { + if o.totalSize < 0 { return 0, errInvalidArgument("Whence END is not supported when the object size is unknown") } - // Seeking to positive offset is valid for whence '2', but - // since we are backing a Reader we have reached 'EOF' if - // offset is positive. - if offset > 0 { - return 0, io.EOF - } - // Seeking to negative position not allowed for whence. - if o.objectInfo.Size+offset < 0 { - return 0, errInvalidArgument(fmt.Sprintf("Seeking at negative offset not allowed for %d", whence)) - } - newOffset = o.objectInfo.Size + offset + newOffset = o.totalSize + offset + } + // Seeking to a position before the start of the object is not allowed for + // any whence. + if newOffset < 0 { + return 0, errInvalidArgument(fmt.Sprintf("Seeking at negative offset not allowed for %d", whence)) + } + // Seeking past the end of the object is rejected with io.EOF, preserving + // long-standing behavior. Seeking to exactly the end is legal and the + // subsequent Read reports io.EOF. + if o.objectInfo.Size > -1 && newOffset > o.objectInfo.Size { + return 0, io.EOF } // Reset the saved error since we successfully seeked, let the Read // and ReadAt decide. @@ -717,6 +838,19 @@ func (c *Client) getObject(ctx context.Context, bucketName, objectName string, o return nil, ObjectInfo{}, nil, err } + body := resp.Body + if opts.Checksum { + if opts.checkSumReader != nil { + opts.checkSumReader.SetReader(resp.Body) + body = opts.checkSumReader + } else if objectStat.ChecksumMode == ChecksumFullObjectMode.String() && opts.headers["Range"] == "" { + if hasherReader := c.newChecksumVerifyingReader(objectStat); hasherReader != nil { + hasherReader.SetReader(resp.Body) + body = hasherReader + } + } + } + // do not close body here, caller will close - return resp.Body, objectStat, resp.Header, nil + return body, objectStat, resp.Header, nil } diff --git a/vendor/github.com/minio/minio-go/v7/api-get-options.go b/vendor/github.com/minio/minio-go/v7/api-get-options.go index dd82f97a132..7857b2118b3 100644 --- a/vendor/github.com/minio/minio-go/v7/api-get-options.go +++ b/vendor/github.com/minio/minio-go/v7/api-get-options.go @@ -44,10 +44,15 @@ type GetObjectOptions struct { VersionID string PartNumber int - // Include any checksums, if object was uploaded with checksum. // For multipart objects this is a checksum of part checksums. // https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + // When the response advertises a full-object checksum, un-ranged + // downloads are verified against it: reads through *Object fail with a + // checksum mismatch error at EOF, and FGetObject fails before renaming + // the file into place. Reads that stop before EOF are not verified. Checksum bool + // If not nil, continue checksum hash verification on the existing data. + checkSumReader *checksumVerifyingReader // RDMABuffer, when non-nil and Options.EnableRDMA=true, downloads directly // into a contiguous buffer via libminiocpp.so. The returned *Object's @@ -55,6 +60,18 @@ type GetObjectOptions struct { RDMABuffer unsafe.Pointer RDMABufferSize int + // ParallelWorkers, when greater than 1, reads the object with up to + // this many concurrent range GETs, holding at most ParallelWorkers + // chunks in memory. It mostly helps when a single stream runs well + // below the link speed; when one stream already saturates the link it + // is slower. Reads with a Range, PartNumber, Checksum or RDMABuffer, + // and reads that start at a non-zero offset, use a single stream. + ParallelWorkers int + // ParallelChunkSize is the target size of each range GET. Defaults to + // 16 MiB, which is also the minimum; it grows when the object would + // need more than 10000 chunks, and the last range may be shorter. + ParallelChunkSize int64 + // To be not used by external applications Internal AdvancedGetOptions } diff --git a/vendor/github.com/minio/minio-go/v7/api-list.go b/vendor/github.com/minio/minio-go/v7/api-list.go index 5e4a381790d..83280d4c265 100644 --- a/vendor/github.com/minio/minio-go/v7/api-list.go +++ b/vendor/github.com/minio/minio-go/v7/api-list.go @@ -127,6 +127,9 @@ func (c *Client) listObjectsV2(ctx context.Context, bucketName string, opts List // Return object owner information by default fetchOwner := true + if opts.FetchOwner != nil { + fetchOwner = *opts.FetchOwner + } return func(yield func(ObjectInfo) bool) { if contextCanceled(ctx) { @@ -154,7 +157,7 @@ func (c *Client) listObjectsV2(ctx context.Context, bucketName string, opts List // Get list of objects a maximum of 1000 per request. result, err := c.listObjectsV2Query(ctx, bucketName, opts.Prefix, continuationToken, - fetchOwner, opts.WithMetadata, delimiter, opts.StartAfter, opts.MaxKeys, opts.headers) + fetchOwner, opts.WithMetadata, opts.Unsorted, delimiter, opts.StartAfter, opts.MaxKeys, opts.requestHeaders()) if err != nil { yield(ObjectInfo{Err: err}) return @@ -206,10 +209,11 @@ func (c *Client) listObjectsV2(ctx context.Context, bucketName string, opts List // ?prefix - Limits the response to keys that begin with the specified prefix. // ?continuation-token - Used to continue iterating over a set of objects // ?metadata - Specifies if we want metadata for the objects as part of list operation. +// ?unsorted - Specifies that the objects may be returned in any order, MinIO extension. // ?delimiter - A delimiter is a character you use to group keys. // ?start-after - Sets a marker to start listing lexically at this key onwards. // ?max-keys - Sets the maximum number of keys returned in the response body. -func (c *Client) listObjectsV2Query(ctx context.Context, bucketName, objectPrefix, continuationToken string, fetchOwner, metadata bool, delimiter, startAfter string, maxkeys int, headers http.Header) (ListBucketV2Result, error) { +func (c *Client) listObjectsV2Query(ctx context.Context, bucketName, objectPrefix, continuationToken string, fetchOwner, metadata, unsorted bool, delimiter, startAfter string, maxkeys int, headers http.Header) (ListBucketV2Result, error) { // Validate bucket name. if err := s3utils.CheckValidBucketName(bucketName); err != nil { return ListBucketV2Result{}, err @@ -229,6 +233,10 @@ func (c *Client) listObjectsV2Query(ctx context.Context, bucketName, objectPrefi urlValues.Set("metadata", "true") } + if unsorted { + urlValues.Set("unsorted", "true") + } + // Set this conditionally if asked if startAfter != "" { urlValues.Set("start-after", startAfter) @@ -296,6 +304,8 @@ func (c *Client) listObjectsV2Query(ctx context.Context, bucketName, objectPrefi return listBucketResult, err } listBucketResult.Contents[i].LastModified = listBucketResult.Contents[i].LastModified.Truncate(time.Millisecond) + listBucketResult.Contents[i].UserMetadataStripped = stripUserMetadata(obj.UserMetadata) + listBucketResult.Contents[i].setChecksumAlgorithm() } for i, obj := range listBucketResult.CommonPrefixes { @@ -341,7 +351,7 @@ func (c *Client) listObjects(ctx context.Context, bucketName string, opts ListOb } // Get list of objects a maximum of 1000 per request. - result, err := c.listObjectsQuery(ctx, bucketName, opts.Prefix, marker, delimiter, opts.MaxKeys, opts.headers) + result, err := c.listObjectsQuery(ctx, bucketName, opts.Prefix, marker, delimiter, opts.MaxKeys, opts.requestHeaders()) if err != nil { yield(ObjectInfo{Err: err}) return @@ -419,32 +429,35 @@ func (c *Client) listObjectVersions(ctx context.Context, bucketName string, opts } for _, version := range vers { info := ObjectInfo{ - ETag: trimEtag(version.ETag), - Key: version.Key, - LastModified: version.LastModified.Truncate(time.Millisecond), - Size: version.Size, - Owner: version.Owner, - StorageClass: version.StorageClass, - IsLatest: version.IsLatest, - VersionID: version.VersionID, - IsDeleteMarker: version.isDeleteMarker, - UserTags: version.UserTags, - UserMetadata: version.UserMetadata, - Internal: version.Internal, - NumVersions: numVersions, - ChecksumAlgorithm: version.ChecksumAlgorithm, - ChecksumMode: version.ChecksumType, - ChecksumCRC32: version.ChecksumCRC32, - ChecksumCRC32C: version.ChecksumCRC32C, - ChecksumSHA1: version.ChecksumSHA1, - ChecksumSHA256: version.ChecksumSHA256, - ChecksumCRC64NVME: version.ChecksumCRC64NVME, - ChecksumMD5: version.ChecksumMD5, - ChecksumSHA512: version.ChecksumSHA512, - ChecksumXXHash64: version.ChecksumXXHash64, - ChecksumXXHash3: version.ChecksumXXHash3, - ChecksumXXHash128: version.ChecksumXXHash128, + ETag: trimEtag(version.ETag), + Key: version.Key, + LastModified: version.LastModified.Truncate(time.Millisecond), + Size: version.Size, + Owner: version.Owner, + StorageClass: version.StorageClass, + IsLatest: version.IsLatest, + VersionID: version.VersionID, + IsDeleteMarker: version.isDeleteMarker, + UserTags: version.UserTags, + UserMetadata: version.UserMetadata, + UserMetadataStripped: version.UserMetadataStripped, + Internal: version.Internal, + Restore: version.Restore, + NumVersions: numVersions, + ChecksumAlgorithm: version.ChecksumAlgorithm, + ChecksumMode: version.ChecksumType, + ChecksumCRC32: version.ChecksumCRC32, + ChecksumCRC32C: version.ChecksumCRC32C, + ChecksumSHA1: version.ChecksumSHA1, + ChecksumSHA256: version.ChecksumSHA256, + ChecksumCRC64NVME: version.ChecksumCRC64NVME, + ChecksumMD5: version.ChecksumMD5, + ChecksumSHA512: version.ChecksumSHA512, + ChecksumXXHash64: version.ChecksumXXHash64, + ChecksumXXHash3: version.ChecksumXXHash3, + ChecksumXXHash128: version.ChecksumXXHash128, } + info.setChecksumAlgorithm() if !yield(info) { return false } @@ -582,7 +595,7 @@ func (c *Client) listObjectVersionsQuery(ctx context.Context, bucketName string, bucketName: bucketName, queryValues: urlValues, contentSHA256Hex: emptySHA256Hex, - customHeader: opts.headers, + customHeader: opts.requestHeaders(), }) defer closeResponse(resp) if err != nil { @@ -606,6 +619,7 @@ func (c *Client) listObjectVersionsQuery(ctx context.Context, bucketName string, if err != nil { return listObjectVersionsOutput, err } + listObjectVersionsOutput.Versions[i].UserMetadataStripped = stripUserMetadata(obj.UserMetadata) } for i, obj := range listObjectVersionsOutput.CommonPrefixes { @@ -695,6 +709,7 @@ func (c *Client) listObjectsQuery(ctx context.Context, bucketName, objectPrefix, return listBucketResult, err } listBucketResult.Contents[i].LastModified = listBucketResult.Contents[i].LastModified.Truncate(time.Millisecond) + listBucketResult.Contents[i].setChecksumAlgorithm() } for i, obj := range listBucketResult.CommonPrefixes { @@ -722,6 +737,15 @@ type ListObjectsOptions struct { WithVersions bool // Include objects metadata in the listing WithMetadata bool + // Include the restore state of archived objects in the listing, as + // ObjectInfo.Restore. Ignored by servers that do not implement the + // x-amz-optional-object-attributes header. + WithRestoreStatus bool + // Unsorted allows the server to return the objects in any order, only + // honored by ListObjects V2 and incompatible with StartAfter. This is + // a MinIO extension, other S3 providers ignore it and keep returning a + // sorted listing. See ListUnsorted for the full semantics. + Unsorted bool // Only list objects with the prefix Prefix string // Ignore '/' delimiter @@ -738,9 +762,44 @@ type ListObjectsOptions struct { // Use the deprecated list objects V1 API UseV1 bool + // FetchOwner indicates whether to return object owner information. + // It defaults to true when unset. + FetchOwner *bool + headers http.Header } +// checkUnsorted returns an error if the unsorted listing extension cannot be +// honored for these options against a bucket in the given location. It is only +// implemented by ListObjects V2, and its continuation token encodes a position +// rather than a key, so there is nothing for 'StartAfter' to resolve against. +func (o ListObjectsOptions) checkUnsorted(location string) error { + if !o.Unsorted { + return nil + } + if o.UseV1 || o.WithVersions || location == "snowball" { + return errInvalidArgument("unsorted listing is only supported by ListObjects V2") + } + if o.StartAfter != "" { + return errInvalidArgument("unsorted listing does not support StartAfter") + } + return nil +} + +// requestHeaders returns the headers to send with a listing request, the +// caller supplied ones plus the optional attributes the options ask for. +func (o ListObjectsOptions) requestHeaders() http.Header { + if !o.WithRestoreStatus { + return o.headers + } + headers := o.headers.Clone() + if headers == nil { + headers = make(http.Header, 1) + } + headers.Set(amzOptionalObjectAttributes, restoreStatusAttribute) + return headers +} + // Set adds a key value pair to the options. The // key-value pair will be part of the HTTP GET request // headers. @@ -770,6 +829,12 @@ func (c *Client) ListObjects(ctx context.Context, bucketName string, opts ListOb return } + location, _ := c.bucketLocCache.Get(bucketName) + if err := opts.checkUnsorted(location); err != nil { + objectStatCh <- ObjectInfo{Err: err} + return + } + var objIter iter.Seq[ObjectInfo] switch { case opts.WithVersions: @@ -777,7 +842,6 @@ func (c *Client) ListObjects(ctx context.Context, bucketName string, opts ListOb case opts.UseV1: objIter = c.listObjects(ctx, bucketName, opts) default: - location, _ := c.bucketLocCache.Get(bucketName) if location == "snowball" { objIter = c.listObjects(ctx, bucketName, opts) } else { @@ -812,6 +876,13 @@ func (c *Client) ListObjects(ctx context.Context, bucketName string, opts ListOb // Canceling the context the iterator will stop, if you wish to discard the yielding make sure // to cancel the passed context without that you might leak coroutines func (c *Client) ListObjectsIter(ctx context.Context, bucketName string, opts ListObjectsOptions) iter.Seq[ObjectInfo] { + location, _ := c.bucketLocCache.Get(bucketName) + if err := opts.checkUnsorted(location); err != nil { + return func(yield func(ObjectInfo) bool) { + yield(ObjectInfo{Err: err}) + } + } + if opts.WithVersions { return c.listObjectVersions(ctx, bucketName, opts) } @@ -822,15 +893,42 @@ func (c *Client) ListObjectsIter(ctx context.Context, bucketName string, opts Li } // Check whether this is snowball region, if yes ListObjectsV2 doesn't work, fallback to listObjectsV1. - if location, ok := c.bucketLocCache.Get(bucketName); ok { - if location == "snowball" { - return c.listObjects(ctx, bucketName, opts) - } + if location == "snowball" { + return c.listObjects(ctx, bucketName, opts) } return c.listObjectsV2(ctx, bucketName, opts) } +// ListUnsorted returns an object list iterator, the objects are returned in +// the order the server finds them instead of the lexical order mandated by +// S3. Skipping the sort lets the server stream the listing as it is read from +// each erasure set, which is substantially faster on large prefixes. +// +// This is a MinIO extension, S3 implementations that do not support it will +// keep returning a regular lexically sorted listing. Unsorted listing is only +// available on ListObjects V2, so 'UseV1', 'WithVersions' and snowball buckets +// are rejected instead of silently falling back to a sorted listing. +// +// Pagination is positional, the continuation token encodes a position in the +// listing and not a key, therefore 'StartAfter' cannot be honored and is +// rejected as well. +// +// api := client.New(....) +// for object := range api.ListUnsorted(ctx, "mytestbucket", minio.ListObjectsOptions{Prefix: "starthere", Recursive: true}) { +// if object.Err != nil { +// // handle the errors. +// } +// fmt.Println(object) +// } +// +// Canceling the context the iterator will stop, if you wish to discard the yielding make sure +// to cancel the passed context without that you might leak coroutines +func (c *Client) ListUnsorted(ctx context.Context, bucketName string, opts ListObjectsOptions) iter.Seq[ObjectInfo] { + opts.Unsorted = true + return c.ListObjectsIter(ctx, bucketName, opts) +} + // ListIncompleteUploads - List incompletely uploaded multipart objects. // // ListIncompleteUploads lists all incompleted objects matching the diff --git a/vendor/github.com/minio/minio-go/v7/api-object-retention.go b/vendor/github.com/minio/minio-go/v7/api-object-retention.go index 2efb5d89a6a..99a04055536 100644 --- a/vendor/github.com/minio/minio-go/v7/api-object-retention.go +++ b/vendor/github.com/minio/minio-go/v7/api-object-retention.go @@ -42,7 +42,8 @@ func newObjectRetention(mode *RetentionMode, date *time.Time) (*objectRetention, objectRetention := &objectRetention{} if date != nil && !date.IsZero() { - objectRetention.RetainUntilDate = date + utc := date.UTC() + objectRetention.RetainUntilDate = &utc } if mode != nil { if !mode.IsValid() { diff --git a/vendor/github.com/minio/minio-go/v7/api-presigned.go b/vendor/github.com/minio/minio-go/v7/api-presigned.go index 29642200ee1..1591fab32b0 100644 --- a/vendor/github.com/minio/minio-go/v7/api-presigned.go +++ b/vendor/github.com/minio/minio-go/v7/api-presigned.go @@ -140,7 +140,7 @@ func (c *Client) PresignedPostPolicy(ctx context.Context, p *PostPolicy) (u *url } // Get credentials from the configured credentials provider. - credValues, err := c.credsProvider.GetWithContext(c.CredContext()) + credValues, err := c.credsProvider.GetWithContext(c.credContext(ctx)) if err != nil { return nil, nil, err } diff --git a/vendor/github.com/minio/minio-go/v7/api-put-object-common.go b/vendor/github.com/minio/minio-go/v7/api-put-object-common.go index a33e6ba55f1..df7670faca2 100644 --- a/vendor/github.com/minio/minio-go/v7/api-put-object-common.go +++ b/vendor/github.com/minio/minio-go/v7/api-put-object-common.go @@ -19,10 +19,12 @@ package minio import ( "context" + "fmt" "io" "math" "os" + "github.com/dustin/go-humanize" "github.com/minio/minio-go/v7/pkg/s3utils" ) @@ -60,7 +62,7 @@ func isReadAt(reader io.Reader) (ok bool) { } // OptimalPartInfo - calculate the optimal part info for a given -// object size. +// object size, using Amazon S3's upload limits. // // NOTE: Assumption here is that for any object to be uploaded to any S3 compatible // object storage it will have the following parameters as constants. @@ -68,14 +70,31 @@ func isReadAt(reader io.Reader) (ok bool) { // maxPartsCount - 10000 // minPartSize - 16MiB // maxObjectSize - ~48.83TiB (maxPartSize * maxPartsCount) +// +// A Client created with Options.UploadLimits uses its own limits instead of +// these, so its part layout may differ from what this function returns. func OptimalPartInfo(objectSize int64, configuredPartSize uint64) (totalPartsCount int, partSize, lastPartSize int64, err error) { - // When object size is unknown (-1), default to 5TiB to limit memory usage. - // This results in ~537MiB part sizes. For larger objects (up to ~48.83TiB), - // callers should set configuredPartSize explicitly to control memory usage. + return UploadLimits{}.optimalPartInfo(objectSize, configuredPartSize) +} + +func (c *Client) optimalPartInfo(objectSize int64, configuredPartSize uint64) (totalPartsCount int, partSize, lastPartSize int64, err error) { + return c.limits.optimalPartInfo(objectSize, configuredPartSize) +} + +// optimalPartInfo - calculate the optimal part info for a given object size +// within these limits. +func (l UploadLimits) optimalPartInfo(objectSize int64, configuredPartSize uint64) (totalPartsCount int, partSize, lastPartSize int64, err error) { + maxPartsCount := l.maxPartsCount() + maxObjectSize := l.maxObjectSize() + + // When object size is unknown (-1), default to 5TiB (or the maximum object + // size, when lower) to limit memory usage. This results in ~537MiB part + // sizes. For larger objects (up to the maximum object size), callers should + // set configuredPartSize explicitly to control memory usage. var unknownSize bool if objectSize == -1 { unknownSize = true - objectSize = maxMultipartPutObjectSize + objectSize = min(maxMultipartPutObjectSize, maxObjectSize) } // object size is larger than supported maximum. @@ -84,8 +103,21 @@ func OptimalPartInfo(objectSize int64, configuredPartSize uint64) (totalPartsCou return totalPartsCount, partSize, lastPartSize, err } + // An empty object has no parts; the minimum part size below would otherwise + // report a part size and a last part size for a layout with no parts in it. + if objectSize == 0 && configuredPartSize == 0 { + return 0, 0, 0, nil + } + var partSizeFlt float64 if configuredPartSize > 0 { + // Compared unsigned and up front, so the int64 conversions below cannot + // wrap a caller-supplied part size into a negative that slips past them. + if configuredPartSize > uint64(l.maxPartSize()) { + err = errInvalidArgument(fmt.Sprintf("Input part size is bigger than allowed maximum of %s.", humanize.IBytes(uint64(l.maxPartSize())))) + return totalPartsCount, partSize, lastPartSize, err + } + if int64(configuredPartSize) > objectSize { err = errEntityTooLarge(int64(configuredPartSize), objectSize, "", "") return totalPartsCount, partSize, lastPartSize, err @@ -93,33 +125,47 @@ func OptimalPartInfo(objectSize int64, configuredPartSize uint64) (totalPartsCou if !unknownSize { if objectSize > (int64(configuredPartSize) * maxPartsCount) { - err = errInvalidArgument("Part size * max_parts(10000) is lesser than input objectSize.") + err = errInvalidArgument(fmt.Sprintf("Part size * max_parts(%d) is lesser than input objectSize.", maxPartsCount)) return totalPartsCount, partSize, lastPartSize, err } } - if configuredPartSize < absMinPartSize { - err = errInvalidArgument("Input part size is smaller than allowed minimum of 5MiB.") - return totalPartsCount, partSize, lastPartSize, err - } - - if configuredPartSize > maxPartSize { - err = errInvalidArgument("Input part size is bigger than allowed maximum of 5GiB.") + if int64(configuredPartSize) < l.minPartSize() { + err = errInvalidArgument(fmt.Sprintf("Input part size is smaller than allowed minimum of %s.", humanize.IBytes(uint64(l.minPartSize())))) return totalPartsCount, partSize, lastPartSize, err } partSizeFlt = float64(configuredPartSize) if unknownSize { // If input has unknown size and part size is configured - // keep it to maximum allowed as per 10000 parts. + // keep it to maximum allowed as per the max parts count. objectSize = int64(configuredPartSize) * maxPartsCount } } else { - configuredPartSize = minPartSize + // Round to a multiple of the internal threshold, but never below a + // MinPartSize that was raised above it, or the generated non-final + // parts would be rejected by the remote. + configuredPartSize = uint64(max(minPartSize, l.minPartSize())) + // Round the exact ceiling of objectSize/maxPartsCount, not the truncated + // quotient: a truncated quotient that already sits on a + // configuredPartSize multiple stays put and needs maxPartsCount+1 parts. + smallestPartSize := objectSize / maxPartsCount + if objectSize%maxPartsCount != 0 { + smallestPartSize++ + } // Use floats for part size for all calculations to avoid // overflows during float64 to int64 conversions. - partSizeFlt = float64(objectSize / maxPartsCount) - partSizeFlt = math.Ceil(partSizeFlt/float64(configuredPartSize)) * float64(configuredPartSize) + partSizeFlt = math.Ceil(float64(smallestPartSize)/float64(configuredPartSize)) * float64(configuredPartSize) + // An object smaller than maxPartsCount rounds down to a zero part size, + // and a non-final part must never fall below MinPartSize either. + if minPS := float64(l.minPartSize()); partSizeFlt < minPS { + partSizeFlt = minPS + } + // Rounding up to a minPartSize multiple can overshoot a MaxPartSize + // that was lowered below, or is not a multiple of, minPartSize. + if maxPS := float64(l.maxPartSize()); partSizeFlt > maxPS { + partSizeFlt = maxPS + } } // Total parts count. @@ -131,6 +177,30 @@ func OptimalPartInfo(objectSize int64, configuredPartSize uint64) (totalPartsCou return totalPartsCount, partSize, lastPartSize, nil } +// errIfMoreData reports errUploadTooLarge when reader still holds data after +// the last part allowed by the upload limits was consumed. Unknown length +// uploads would otherwise silently complete a truncated object. +// +// This deliberately fails an upload whose bytes were all transferred: the probe +// runs after the final part, so a reader that reports anything other than a +// clean io.EOF — a closed file, a reset connection, a wrapper with its own +// sentinel — aborts the multipart upload instead of completing it. Silently +// storing a possibly truncated object is the worse outcome, but callers should +// expect this error to arrive late and to look like a transport fault. +func errIfMoreData(reader io.Reader, uploadedSize, totalPartsCount int64, bucketName, objectName string) error { + var b [1]byte + n, err := readFull(reader, b[:]) + if n > 0 { + return errUploadTooLarge(uploadedSize, totalPartsCount, bucketName, objectName) + } + // Only a clean EOF proves the reader was drained; anything else has to + // surface rather than complete a possibly truncated object. + if err != nil && err != io.EOF { + return err + } + return nil +} + // getUploadID - fetch upload id if already present for an object name // or initiate a new request to fetch a new upload id. func (c *Client) newUploadID(ctx context.Context, bucketName, objectName string, opts PutObjectOptions) (uploadID string, err error) { diff --git a/vendor/github.com/minio/minio-go/v7/api-put-object-fan-out.go b/vendor/github.com/minio/minio-go/v7/api-put-object-fan-out.go index 3023b949cd4..cba0c069ba0 100644 --- a/vendor/github.com/minio/minio-go/v7/api-put-object-fan-out.go +++ b/vendor/github.com/minio/minio-go/v7/api-put-object-fan-out.go @@ -69,6 +69,8 @@ type PutObjectFanOutResponse struct { // stream multiple objects are written, defined via a list of PutObjectFanOutRequests. Each entry // in PutObjectFanOutRequest carries an object keyname and its relevant metadata if any. `Key` is // mandatory, rest of the other options in PutObjectFanOutRequest are optional. +// +// Deprecated: Use PutObject instead. func (c *Client) PutObjectFanOut(ctx context.Context, bucket string, fanOutData io.Reader, fanOutReq PutObjectFanOutRequest) ([]PutObjectFanOutResponse, error) { if len(fanOutReq.Entries) == 0 { return nil, errInvalidArgument("fan out requests cannot be empty") diff --git a/vendor/github.com/minio/minio-go/v7/api-put-object-multipart.go b/vendor/github.com/minio/minio-go/v7/api-put-object-multipart.go index f25184bc7cd..09c58d01eee 100644 --- a/vendor/github.com/minio/minio-go/v7/api-put-object-multipart.go +++ b/vendor/github.com/minio/minio-go/v7/api-put-object-multipart.go @@ -45,8 +45,8 @@ func (c *Client) putObjectMultipart(ctx context.Context, bucketName, objectName // Verify if multipart functionality is not available, if not // fall back to single PutObject operation. if errResp.Code == AccessDenied && strings.Contains(errResp.Message, "Access Denied") { - // Verify if size of reader is greater than '5GiB'. - if size > maxSinglePutObjectSize { + // Verify if size of reader is greater than the single PUT limit. + if maxSinglePutObjectSize := c.limits.maxSinglePutObjectSize(); size > maxSinglePutObjectSize { return UploadInfo{}, errEntityTooLarge(size, maxSinglePutObjectSize, bucketName, objectName) } // Fall back to uploading as single PutObject operation. @@ -73,7 +73,7 @@ func (c *Client) putObjectMultipartNoStream(ctx context.Context, bucketName, obj var complMultipartUpload completeMultipartUpload // Calculate the optimal parts info for a given size. - totalPartsCount, partSize, _, err := OptimalPartInfo(-1, opts.PartSize) + totalPartsCount, partSize, _, err := c.optimalPartInfo(-1, opts.PartSize) if err != nil { return UploadInfo{}, err } @@ -91,7 +91,7 @@ func (c *Client) putObjectMultipartNoStream(ctx context.Context, bucketName, obj defer func() { if err != nil { - c.abortMultipartUpload(ctx, bucketName, objectName, uploadID) + c.abortFailedUpload(ctx, bucketName, objectName, uploadID) } }() @@ -108,8 +108,10 @@ func (c *Client) putObjectMultipartNoStream(ctx context.Context, bucketName, obj // CRC32C is ~50% faster on AMD64 @ 30GB/s customHeader := make(http.Header) crc := opts.AutoChecksum.Hasher() + var lastErr error for partNumber <= totalPartsCount { length, rErr := readFull(reader, buf) + lastErr = rErr if rErr == io.EOF && partNumber > 1 { break } @@ -175,6 +177,14 @@ func (c *Client) putObjectMultipartNoStream(ctx context.Context, bucketName, obj } } + // A nil read error on the last allowed part means the reader was never + // drained; completing here would store a truncated object. + if lastErr == nil { + if err = errIfMoreData(reader, totalUploadedSize, int64(totalPartsCount), bucketName, objectName); err != nil { + return UploadInfo{}, err + } + } + // Loop over total uploaded parts to save them in // Parts array before completing the multipart request. allParts := make([]ObjectPart, 0, len(partsInfo)) @@ -202,10 +212,7 @@ func (c *Client) putObjectMultipartNoStream(ctx context.Context, bucketName, obj // Sort all completed parts. sort.Sort(completedParts(complMultipartUpload.Parts)) - opts = PutObjectOptions{ - ServerSideEncryption: opts.ServerSideEncryption, - AutoChecksum: opts.AutoChecksum, - } + opts = completeUploadOpts(opts) applyAutoChecksum(&opts, allParts) uploadInfo, err := c.completeMultipartUpload(ctx, bucketName, objectName, uploadID, complMultipartUpload, opts) @@ -294,8 +301,8 @@ func (c *Client) uploadPart(ctx context.Context, p uploadPartParams) (ObjectPart if err := s3utils.CheckValidObjectName(p.objectName); err != nil { return ObjectPart{}, err } - if p.size > maxPartSize { - return ObjectPart{}, errEntityTooLarge(p.size, maxPartSize, p.bucketName, p.objectName) + if maxPartSize := c.limits.maxPartSize(); p.size > maxPartSize { + return ObjectPart{}, errPartTooLarge(p.size, maxPartSize, p.bucketName, p.objectName) } if p.size <= -1 { return ObjectPart{}, errEntityTooSmall(p.size, p.bucketName, p.objectName) @@ -371,6 +378,22 @@ func (c *Client) uploadPart(ctx context.Context, p uploadPartParams) (ObjectPart return objPart, nil } +// completeUploadOpts returns the options to send on CompleteMultipartUpload. +// Everything that applies to the upload as a whole was already sent with +// NewMultipartUpload or with the individual parts, so most of the caller's +// options are deliberately dropped here. Three things must survive: the SSE-C +// key, which has to be repeated on every request touching the object, the +// auto-checksum, which is computed from the completed parts, and opts.Internal, +// because MinIO reads x-minio-source-mtime and +// x-minio-source-replication-request from this request and nowhere else. +func completeUploadOpts(opts PutObjectOptions) PutObjectOptions { + return PutObjectOptions{ + ServerSideEncryption: opts.ServerSideEncryption, + AutoChecksum: opts.AutoChecksum, + Internal: opts.Internal, + } +} + // completeMultipartUpload - Completes a multipart upload by assembling previously uploaded parts. func (c *Client) completeMultipartUpload(ctx context.Context, bucketName, objectName, uploadID string, complete completeMultipartUpload, opts PutObjectOptions, diff --git a/vendor/github.com/minio/minio-go/v7/api-put-object-streaming.go b/vendor/github.com/minio/minio-go/v7/api-put-object-streaming.go index 292954d3019..f621d0b6235 100644 --- a/vendor/github.com/minio/minio-go/v7/api-put-object-streaming.go +++ b/vendor/github.com/minio/minio-go/v7/api-put-object-streaming.go @@ -57,8 +57,8 @@ func (c *Client) putObjectMultipartStream(ctx context.Context, bucketName, objec // Verify if multipart functionality is not available, if not // fall back to single PutObject operation. if errResp.Code == AccessDenied && strings.Contains(errResp.Message, "Access Denied") { - // Verify if size of reader is greater than '5GiB'. - if size > maxSinglePutObjectSize { + // Verify if size of reader is greater than the single PUT limit. + if maxSinglePutObjectSize := c.limits.maxSinglePutObjectSize(); size > maxSinglePutObjectSize { return UploadInfo{}, errEntityTooLarge(size, maxSinglePutObjectSize, bucketName, objectName) } // Fall back to uploading as single PutObject operation. @@ -104,7 +104,7 @@ func (c *Client) putObjectMultipartStreamFromReadAt(ctx context.Context, bucketN } // Calculate the optimal parts info for a given size. - totalPartsCount, partSize, lastPartSize, err := OptimalPartInfo(size, opts.PartSize) + totalPartsCount, partSize, lastPartSize, err := c.optimalPartInfo(size, opts.PartSize) if err != nil { return UploadInfo{}, err } @@ -123,7 +123,7 @@ func (c *Client) putObjectMultipartStreamFromReadAt(ctx context.Context, bucketN // to relinquish storage space. defer func() { if err != nil { - c.abortMultipartUpload(ctx, bucketName, objectName, uploadID) + c.abortFailedUpload(ctx, bucketName, objectName, uploadID) } }() @@ -276,10 +276,7 @@ func (c *Client) putObjectMultipartStreamFromReadAt(ctx context.Context, bucketN // Sort all completed parts. sort.Sort(completedParts(complMultipartUpload.Parts)) - opts = PutObjectOptions{ - ServerSideEncryption: opts.ServerSideEncryption, - AutoChecksum: opts.AutoChecksum, - } + opts = completeUploadOpts(opts) if withChecksum { applyAutoChecksum(&opts, allParts) } @@ -305,7 +302,7 @@ func (c *Client) putObjectMultipartStreamOptionalChecksum(ctx context.Context, b } // Calculate the optimal parts info for a given size. - totalPartsCount, partSize, lastPartSize, err := OptimalPartInfo(size, opts.PartSize) + totalPartsCount, partSize, lastPartSize, err := c.optimalPartInfo(size, opts.PartSize) if err != nil { return UploadInfo{}, err } @@ -321,7 +318,7 @@ func (c *Client) putObjectMultipartStreamOptionalChecksum(ctx context.Context, b // storage space. defer func() { if err != nil { - c.abortMultipartUpload(ctx, bucketName, objectName, uploadID) + c.abortFailedUpload(ctx, bucketName, objectName, uploadID) } }() @@ -357,7 +354,7 @@ func (c *Client) putObjectMultipartStreamOptionalChecksum(ctx context.Context, b break } - if rerr != nil && rerr != io.ErrUnexpectedEOF && err != io.EOF { + if rerr != nil && rerr != io.ErrUnexpectedEOF && rerr != io.EOF { return UploadInfo{}, rerr } @@ -434,10 +431,7 @@ func (c *Client) putObjectMultipartStreamOptionalChecksum(ctx context.Context, b // Sort all completed parts. sort.Sort(completedParts(complMultipartUpload.Parts)) - opts = PutObjectOptions{ - ServerSideEncryption: opts.ServerSideEncryption, - AutoChecksum: opts.AutoChecksum, - } + opts = completeUploadOpts(opts) applyAutoChecksum(&opts, allParts) uploadInfo, err := c.completeMultipartUpload(ctx, bucketName, objectName, uploadID, complMultipartUpload, opts) if err != nil { @@ -467,7 +461,7 @@ func (c *Client) putObjectMultipartStreamParallel(ctx context.Context, bucketNam defer cancel() // Calculate the optimal parts info for a given size. - totalPartsCount, partSize, _, err := OptimalPartInfo(-1, opts.PartSize) + totalPartsCount, partSize, _, err := c.optimalPartInfo(-1, opts.PartSize) if err != nil { return UploadInfo{}, err } @@ -484,14 +478,10 @@ func (c *Client) putObjectMultipartStreamParallel(ctx context.Context, bucketNam // storage space. defer func() { if err != nil { - c.abortMultipartUpload(ctx, bucketName, objectName, uploadID) + c.abortFailedUpload(ctx, bucketName, objectName, uploadID) } }() - // Create checksums - // CRC32C is ~50% faster on AMD64 @ 30GB/s - crc := opts.AutoChecksum.Hasher() - // Total data read and written to server. should be equal to 'size' at the end of the call. var totalUploadedSize int64 @@ -514,6 +504,7 @@ func (c *Client) putObjectMultipartStreamParallel(ctx context.Context, bucketNam // Part number always starts with '1'. var partNumber int + var lastErr error for partNumber = 1; partNumber <= totalPartsCount; partNumber++ { // Proceed to upload the part. var buf []byte @@ -530,6 +521,7 @@ func (c *Client) putObjectMultipartStreamParallel(ctx context.Context, bucketNam } length, rerr := readFull(reader, buf) + lastErr = rerr if rerr == io.EOF && partNumber > 1 { // Done break @@ -546,8 +538,9 @@ func (c *Client) putObjectMultipartStreamParallel(ctx context.Context, bucketNam // Calculate md5sum. customHeader := make(http.Header) if opts.AutoChecksum.IsSet() { - // Add Checksum instead. - crc.Reset() + // Add Checksum instead. Per-goroutine hasher: + // hash.Hash is not safe for concurrent use. + crc := opts.AutoChecksum.Hasher() crc.Write(buf[:length]) cSum := crc.Sum(nil) customHeader.Set(opts.AutoChecksum.Key(), base64.StdEncoding.EncodeToString(cSum)) @@ -607,6 +600,14 @@ func (c *Client) putObjectMultipartStreamParallel(ctx context.Context, bucketNam default: } + // A nil read error on the last allowed part means the reader was never + // drained; completing here would store a truncated object. + if lastErr == nil { + if err = errIfMoreData(reader, totalUploadedSize, int64(totalPartsCount), bucketName, objectName); err != nil { + return UploadInfo{}, err + } + } + // Complete multipart upload. var complMultipartUpload completeMultipartUpload @@ -638,10 +639,7 @@ func (c *Client) putObjectMultipartStreamParallel(ctx context.Context, bucketNam // Sort all completed parts. sort.Sort(completedParts(complMultipartUpload.Parts)) - opts = PutObjectOptions{ - ServerSideEncryption: opts.ServerSideEncryption, - AutoChecksum: opts.AutoChecksum, - } + opts = completeUploadOpts(opts) applyAutoChecksum(&opts, allParts) uploadInfo, err := c.completeMultipartUpload(ctx, bucketName, objectName, uploadID, complMultipartUpload, opts) diff --git a/vendor/github.com/minio/minio-go/v7/api-put-object.go b/vendor/github.com/minio/minio-go/v7/api-put-object.go index c4016f16702..d65f837c850 100644 --- a/vendor/github.com/minio/minio-go/v7/api-put-object.go +++ b/vendor/github.com/minio/minio-go/v7/api-put-object.go @@ -193,7 +193,7 @@ func (opts PutObjectOptions) Header() (header http.Header) { } if !opts.RetainUntilDate.IsZero() { - header.Set("X-Amz-Object-Lock-Retain-Until-Date", opts.RetainUntilDate.Format(time.RFC3339)) + header.Set(amzLockRetainUntil, opts.RetainUntilDate.UTC().Format(time.RFC3339)) } if opts.LegalHold != "" { @@ -322,6 +322,9 @@ func (a completedParts) Less(i, j int) bool { return a[i].PartNumber < a[j].Part // For larger objects (up to ~48.83TiB), set PutObjectOptions.PartSize // to control memory usage and enable uploads beyond 5TiB. // +// The ~48.83TiB ceiling is the product of the client's max part size and +// max parts count, both of which follow Options.UploadLimits. +// // WARNING: Passing down '-1' will use memory and these cannot // be reused for best outcomes for PutObject(), pass the size always. // @@ -330,6 +333,14 @@ func (c *Client) PutObject(ctx context.Context, bucketName, objectName string, r opts PutObjectOptions, ) (info UploadInfo, err error) { if opts.RDMABuffer != nil && c.rdmaEnabled { + // A reader alongside the buffer means stream it: libminiocpp pins one + // part at a time rather than the whole object, so this carries objects + // past the 4 GiB an RDMA descriptor can address and does not ask the + // caller to pin the object's size. Without a reader the buffer already + // holds the object and goes out in a single transfer. + if reader != nil { + return c.putObjectRDMAStream(ctx, bucketName, objectName, reader, size, opts) + } return c.putObjectRDMA(ctx, bucketName, objectName, opts) } if size < 0 && opts.DisableMultipart { @@ -342,7 +353,7 @@ func (c *Client) PutObject(ctx context.Context, bucketName, objectName string, r } // Check for largest object size allowed. - if size > int64(maxObjectSize) { + if maxObjectSize := c.limits.maxObjectSize(); size > maxObjectSize { return UploadInfo{}, errEntityTooLarge(size, maxObjectSize, bucketName, objectName) } @@ -366,6 +377,19 @@ func (c *Client) PutObject(ctx context.Context, bucketName, objectName string, r partSize = minPartSize } + // Only an explicitly configured single PUT limit is enforced here. The 5GiB + // default is Amazon's; MinIO/AIStor and others accept far larger single + // PUTs, and PutObjectsSnowball sets DisableMultipart itself, so applying the + // default would refuse uploads that work today. + if maxSinglePut := c.limits.MaxSinglePutObjectSize; maxSinglePut > 0 && size > maxSinglePut { + if opts.DisableMultipart { + return UploadInfo{}, errEntityTooLarge(size, maxSinglePut, bucketName, objectName) + } + if int64(partSize) > maxSinglePut { + partSize = uint64(maxSinglePut) + } + } + if c.overrideSignerType.IsV2() { if size >= 0 && size < int64(partSize) || opts.DisableMultipart { return c.putObject(ctx, bucketName, objectName, reader, size, opts) @@ -407,7 +431,7 @@ func (c *Client) putObjectMultipartStreamNoLength(ctx context.Context, bucketNam var complMultipartUpload completeMultipartUpload // Calculate the optimal parts info for a given size. - totalPartsCount, partSize, _, err := OptimalPartInfo(-1, opts.PartSize) + totalPartsCount, partSize, _, err := c.optimalPartInfo(-1, opts.PartSize) if err != nil { return UploadInfo{}, err } @@ -420,7 +444,7 @@ func (c *Client) putObjectMultipartStreamNoLength(ctx context.Context, bucketNam defer func() { if err != nil { - c.abortMultipartUpload(ctx, bucketName, objectName, uploadID) + c.abortFailedUpload(ctx, bucketName, objectName, uploadID) } }() @@ -438,8 +462,10 @@ func (c *Client) putObjectMultipartStreamNoLength(ctx context.Context, bucketNam customHeader := make(http.Header) crc := opts.AutoChecksum.Hasher() + var lastErr error for partNumber <= totalPartsCount { length, rerr := readFull(reader, buf) + lastErr = rerr if rerr == io.EOF && partNumber > 1 { break } @@ -495,6 +521,14 @@ func (c *Client) putObjectMultipartStreamNoLength(ctx context.Context, bucketNam } } + // A nil read error on the last allowed part means the reader was never + // drained; completing here would store a truncated object. + if lastErr == nil { + if err = errIfMoreData(reader, totalUploadedSize, int64(totalPartsCount), bucketName, objectName); err != nil { + return UploadInfo{}, err + } + } + // Loop over total uploaded parts to save them in // Parts array before completing the multipart request. allParts := make([]ObjectPart, 0, len(partsInfo)) @@ -523,10 +557,7 @@ func (c *Client) putObjectMultipartStreamNoLength(ctx context.Context, bucketNam // Sort all completed parts. sort.Sort(completedParts(complMultipartUpload.Parts)) - opts = PutObjectOptions{ - ServerSideEncryption: opts.ServerSideEncryption, - AutoChecksum: opts.AutoChecksum, - } + opts = completeUploadOpts(opts) applyAutoChecksum(&opts, allParts) uploadInfo, err := c.completeMultipartUpload(ctx, bucketName, objectName, uploadID, complMultipartUpload, opts) diff --git a/vendor/github.com/minio/minio-go/v7/api-remove.go b/vendor/github.com/minio/minio-go/v7/api-remove.go index 69c5fb491a8..46d038a4b7d 100644 --- a/vendor/github.com/minio/minio-go/v7/api-remove.go +++ b/vendor/github.com/minio/minio-go/v7/api-remove.go @@ -743,6 +743,15 @@ func (c *Client) RemoveIncompleteUpload(ctx context.Context, bucketName, objectN return nil } +// abortFailedUpload aborts the multipart upload of a failed PutObject or +// ComposeObject. It detaches from ctx so the abort is still sent when the +// failure was the caller canceling ctx. +func (c *Client) abortFailedUpload(ctx context.Context, bucketName, objectName, uploadID string) { + ctx, cancel := context.WithTimeout(context.WithoutCancel(ctx), time.Minute) + defer cancel() + c.abortMultipartUpload(ctx, bucketName, objectName, uploadID) +} + // abortMultipartUpload aborts a multipart upload for the given // uploadID, all previously uploaded parts are deleted. func (c *Client) abortMultipartUpload(ctx context.Context, bucketName, objectName, uploadID string) error { diff --git a/vendor/github.com/minio/minio-go/v7/api-s3-datatypes.go b/vendor/github.com/minio/minio-go/v7/api-s3-datatypes.go index fe503fb667d..2c62142519f 100644 --- a/vendor/github.com/minio/minio-go/v7/api-s3-datatypes.go +++ b/vendor/github.com/minio/minio-go/v7/api-s3-datatypes.go @@ -94,10 +94,16 @@ type Version struct { StorageClass string VersionID string `xml:"VersionId"` - // x-amz-meta-* headers stripped "x-amz-meta-" prefix containing the first value. - // Only returned by MinIO servers. + // UserMetadata contains the exact stored object metadata: x-amz-meta-* + // entries with their prefixed keys plus system entries such as + // content-type. Only returned by MinIO servers. UserMetadata StringMap `json:"userMetadata,omitempty"` + // UserMetadataStripped is UserMetadata in the keyed form StatObject and + // GetObject return in ObjectInfo.UserMetadata. See + // ObjectInfo.UserMetadataStripped. + UserMetadataStripped StringMap `json:"userMetadataStripped,omitempty" xml:"-"` + // x-amz-tagging values in their k/v values. // Only returned by MinIO servers. UserTags URLMap `json:"userTags,omitempty" xml:"UserTags"` @@ -107,6 +113,10 @@ type Version struct { M int // Parity blocks } `xml:"Internal"` + // Restore state of an archived version, only returned when the listing + // asked for it with ListObjectsOptions.WithRestoreStatus. + Restore *RestoreInfo `xml:"RestoreStatus"` + // Checksum values. Only returned by AiStor servers. ChecksumCRC32 string `xml:",omitempty"` ChecksumCRC32C string `xml:",omitempty"` @@ -280,6 +290,33 @@ type initiator struct { type copyObjectResult struct { ETag string LastModified time.Time // time string format "2006-01-02T15:04:05.000Z" + + // Checksum values returned in CopyObjectResult / CopyPartResult. + ChecksumCRC32 string `xml:"ChecksumCRC32,omitempty"` + ChecksumCRC32C string `xml:"ChecksumCRC32C,omitempty"` + ChecksumSHA1 string `xml:"ChecksumSHA1,omitempty"` + ChecksumSHA256 string `xml:"ChecksumSHA256,omitempty"` + ChecksumCRC64NVME string `xml:",omitempty"` + ChecksumMD5 string `xml:",omitempty"` + ChecksumSHA512 string `xml:",omitempty"` + ChecksumXXHash64 string `xml:"ChecksumXXHASH64,omitempty"` + ChecksumXXHash3 string `xml:"ChecksumXXHASH3,omitempty"` + ChecksumXXHash128 string `xml:"ChecksumXXHASH128,omitempty"` + ChecksumType string `xml:",omitempty"` +} + +// setChecksums copies the copied part's checksums onto a CompletePart. +func (r *copyObjectResult) setChecksums(p *CompletePart) { + p.ChecksumCRC32 = r.ChecksumCRC32 + p.ChecksumCRC32C = r.ChecksumCRC32C + p.ChecksumSHA1 = r.ChecksumSHA1 + p.ChecksumSHA256 = r.ChecksumSHA256 + p.ChecksumCRC64NVME = r.ChecksumCRC64NVME + p.ChecksumMD5 = r.ChecksumMD5 + p.ChecksumSHA512 = r.ChecksumSHA512 + p.ChecksumXXHash64 = r.ChecksumXXHash64 + p.ChecksumXXHash3 = r.ChecksumXXHash3 + p.ChecksumXXHash128 = r.ChecksumXXHash128 } // ObjectPart container for particular part of an object. diff --git a/vendor/github.com/minio/minio-go/v7/api-stat.go b/vendor/github.com/minio/minio-go/v7/api-stat.go index a4b2af7aefc..ba9afa75c8d 100644 --- a/vendor/github.com/minio/minio-go/v7/api-stat.go +++ b/vendor/github.com/minio/minio-go/v7/api-stat.go @@ -57,7 +57,12 @@ func (c *Client) BucketExists(ctx context.Context, bucketName string) (bool, err } // StatObject verifies if object exists, you have permission to access it -// and returns information about the object. +// and returns information about the object. When the returned error is +// non-nil but a response was received, the ObjectInfo still carries the +// VersionID and IsDeleteMarker values parsed from the response headers, +// plus ReplicationReady on every error path except the versioned +// delete-marker 405 (an asymmetry preserved from the pre-v7.0.93 +// behavior, which populated ReplicationReady on the generic branch only). func (c *Client) StatObject(ctx context.Context, bucketName, objectName string, opts StatObjectOptions) (ObjectInfo, error) { // Input validation. if err := s3utils.CheckValidBucketName(bucketName); err != nil { @@ -92,32 +97,32 @@ func (c *Client) StatObject(ctx context.Context, bucketName, objectName string, }) defer closeResponse(resp) if err != nil { - return ObjectInfo{}, err - } - - if resp != nil { + // executeMethod returns a non-nil error for every non-success + // status. When a response exists, its headers still carry the + // version and delete-marker fields — surface them with the error. + if resp == nil { + return ObjectInfo{}, err + } deleteMarker := resp.Header.Get(amzDeleteMarker) == "true" replicationReady := resp.Header.Get(minioTgtReplicationReady) == "true" - if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusPartialContent { - if resp.StatusCode == http.StatusMethodNotAllowed && opts.VersionID != "" && deleteMarker { - errResp := ErrorResponse{ - StatusCode: resp.StatusCode, - Code: MethodNotAllowed, - Message: s3ErrorResponseMap[MethodNotAllowed], - BucketName: bucketName, - Key: objectName, - } - return ObjectInfo{ - VersionID: resp.Header.Get(amzVersionID), - IsDeleteMarker: deleteMarker, - }, errResp + if resp.StatusCode == http.StatusMethodNotAllowed && opts.VersionID != "" && deleteMarker { + errResp := ErrorResponse{ + StatusCode: resp.StatusCode, + Code: MethodNotAllowed, + Message: s3ErrorResponseMap[MethodNotAllowed], + BucketName: bucketName, + Key: objectName, } return ObjectInfo{ - VersionID: resp.Header.Get(amzVersionID), - IsDeleteMarker: deleteMarker, - ReplicationReady: replicationReady, // whether delete marker can be replicated - }, httpRespToErrorResponse(resp, bucketName, objectName) + VersionID: resp.Header.Get(amzVersionID), + IsDeleteMarker: deleteMarker, + }, errResp } + return ObjectInfo{ + VersionID: resp.Header.Get(amzVersionID), + IsDeleteMarker: deleteMarker, + ReplicationReady: replicationReady, // whether delete marker can be replicated + }, err } return ToObjectInfo(bucketName, objectName, resp.Header) diff --git a/vendor/github.com/minio/minio-go/v7/api.go b/vendor/github.com/minio/minio-go/v7/api.go index dbf639ab1d0..eb72cf8a0e8 100644 --- a/vendor/github.com/minio/minio-go/v7/api.go +++ b/vendor/github.com/minio/minio-go/v7/api.go @@ -110,6 +110,10 @@ type Client struct { trailingHeaderSupport bool maxRetries int + // Upload limits enforced before sending a request. Always read through + // its accessors, which resolve zero fields to the S3 defaults. + limits UploadLimits + // RDMA dispatch state. rdmaEnabled mirrors Options.EnableRDMA; // the rest are only touched by rdma.go (built with -tags=rdma) but // have to live on the struct so the stub and the tagged build share @@ -170,12 +174,17 @@ type Options struct { // when the caller supplies PutObjectOptions.RDMABuffer / GetObjectOptions.RDMABuffer. // No-op unless built with -tags=rdma. EnableRDMA bool + + // UploadLimits overrides the upload limits the client enforces before + // sending a request. Leave nil, or leave individual fields zero, to use + // Amazon S3's limits. + UploadLimits *UploadLimits } // Global constants. const ( libraryName = "minio-go" - libraryVersion = "v7.0.98" + libraryVersion = "v7.4.1" ) // User Agent should always following the below style. @@ -340,6 +349,13 @@ func privateNew(endpoint string, opts *Options) (*Client, error) { clnt.maxRetries = opts.MaxRetries } + if opts.UploadLimits != nil { + if err := opts.UploadLimits.validate(); err != nil { + return nil, err + } + clnt.limits = *opts.UploadLimits + } + // Return. return clnt, nil } @@ -403,7 +419,7 @@ func (c *Client) TraceOff() { // SetS3TransferAccelerate - turns s3 accelerated endpoint on or off for all your // requests. This feature is only specific to S3 for all other endpoints this // function does nothing. To read further details on s3 transfer acceleration -// please vist - +// please visit - // http://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html func (c *Client) SetS3TransferAccelerate(accelerateEndpoint string) { if s3utils.IsAmazonEndpoint(*c.endpointURL) { @@ -554,7 +570,7 @@ type requestMetadata struct { } // dumpHTTP - dump HTTP request and response. -func (c *Client) dumpHTTP(req *http.Request, resp *http.Response) error { +func (c *Client) dumpHTTP(req *http.Request, resp *http.Response, doErr error) error { // Starts http dump. _, err := fmt.Fprintln(c.traceOutput, "---------START-HTTP---------") if err != nil { @@ -568,6 +584,9 @@ func (c *Client) dumpHTTP(req *http.Request, resp *http.Response) error { } // Only display request header. + if req.Body != nil { + req.Body = http.NoBody + } reqTrace, err := httputil.DumpRequestOut(req, false) if err != nil { return err @@ -579,28 +598,36 @@ func (c *Client) dumpHTTP(req *http.Request, resp *http.Response) error { return err } - // Only display response header. - var respTrace []byte + if resp != nil { + // Only display response header. + var respTrace []byte - // For errors we make sure to dump response body as well. - if resp.StatusCode != http.StatusOK && - resp.StatusCode != http.StatusPartialContent && - resp.StatusCode != http.StatusNoContent { - respTrace, err = httputil.DumpResponse(resp, true) - if err != nil { - return err + // For errors we make sure to dump response body as well. + if !successStatus.Contains(resp.StatusCode) { + respTrace, err = httputil.DumpResponse(resp, true) + if err != nil { + return err + } + } else { + respTrace, err = httputil.DumpResponse(resp, false) + if err != nil { + return err + } } - } else { - respTrace, err = httputil.DumpResponse(resp, false) + + // Write response to trace output. + _, err = fmt.Fprint(c.traceOutput, strings.TrimSuffix(string(respTrace), "\r\n")) if err != nil { return err } } - // Write response to trace output. - _, err = fmt.Fprint(c.traceOutput, strings.TrimSuffix(string(respTrace), "\r\n")) - if err != nil { - return err + if doErr != nil { + // Write error to trace output. + _, err = fmt.Fprintln(c.traceOutput, strings.TrimSuffix(string(doErr.Error()), "\r\n")) + if err != nil { + return err + } } // Ends the http dump. @@ -623,6 +650,9 @@ func (c *Client) do(req *http.Request) (resp *http.Response, err error) { resp, err = c.httpClient.Do(req) if err != nil { + if c.isTraceEnabled { + _ = c.dumpHTTP(req, nil, err) + } // Handle this specifically for now until future Golang versions fix this issue properly. if urlErr, ok := err.(*url.Error); ok { if strings.Contains(urlErr.Err.Error(), "EOF") { @@ -643,9 +673,9 @@ func (c *Client) do(req *http.Request) (resp *http.Response, err error) { } // If trace is enabled, dump http request and response, - // except when the traceErrorsOnly enabled and the response's status code is ok - if c.isTraceEnabled && (!c.traceErrorsOnly || resp.StatusCode != http.StatusOK) { - err = c.dumpHTTP(req, resp) + // except when traceErrorsOnly is enabled and the response has a success status code + if c.isTraceEnabled && (!c.traceErrorsOnly || !successStatus.Contains(resp.StatusCode)) { + err = c.dumpHTTP(req, resp, nil) if err != nil { return nil, err } @@ -657,6 +687,7 @@ func (c *Client) do(req *http.Request) (resp *http.Response, err error) { // List of success status. var successStatus = set.CreateIntSet( http.StatusOK, + http.StatusAccepted, http.StatusNoContent, http.StatusPartialContent, ) @@ -833,8 +864,24 @@ func (c *Client) executeMethod(ctx context.Context, method string, metadata requ return res, err } +// credsRetrievalPanic carries a panic value out of the de-duplicated +// credential retrieval goroutine so newRequest can resume it on each +// caller's goroutine. The value is re-raised verbatim, as if the provider +// had panicked on the caller's goroutine; the retrieval goroutine's stack +// is not carried along. +type credsRetrievalPanic struct{ value any } + +func (p credsRetrievalPanic) Error() string { + return fmt.Sprintf("credentials retrieval panicked: %v", p.value) +} + // newRequest - instantiate a new HTTP request for a given method. func (c *Client) newRequest(ctx context.Context, method string, metadata requestMetadata) (req *http.Request, err error) { + if ctx == nil { + // A nil context would be dereferenced below — by the bucket + // location lookup, the waiter select, and context.WithoutCancel. + return nil, errInvalidArgument("context cannot be nil") + } // If no method is supplied default to 'POST'. if method == "" { method = http.MethodPost @@ -867,23 +914,88 @@ func (c *Client) newRequest(ctx context.Context, method string, metadata request return nil, err } - if c.httpTrace != nil { - ctx = httptrace.WithClientTrace(ctx, c.httpTrace) - } - - // make sure to de-dup calls to credential services, this reduces - // the overall load to the endpoint generating credential service. - value, err, _ := c.credsGroup.Do(metadata.bucketName, func() (credentials.Value, error) { - if s3utils.IsS3ExpressBucket(metadata.bucketName) && s3utils.IsAmazonEndpoint(*c.endpointURL) { - return c.CreateSession(ctx, metadata.bucketName, SessionReadWrite) + // Cached, unexpired credentials (or an absent provider — anonymous + // access) are served inline; a retrieval that races expiry runs + // inline too, with the caller's live context, serialized by the + // Credentials mutex. A still-fresh cached S3 Express session is + // served inline as well; actual retrievals go through the de-dup + // group. + express := s3utils.IsS3ExpressBucket(metadata.bucketName) && s3utils.IsAmazonEndpoint(*c.endpointURL) + var value credentials.Value + var served bool + if express { + value, served = c.sessionFromCache(metadata.bucketName) + } else if c.credsProvider == nil || !c.credsProvider.IsExpired() { + value, err = c.credsProvider.GetWithContext(c.credContext(ctx)) + served = true + } + if !served { + // The provider retrieval is detached (context.WithoutCancel) so + // one caller's cancellation cannot fail concurrent waiters; each + // waiter stops waiting when its own context ends, though a + // caller arriving mid-retrieval blocks in IsExpired on the + // Credentials mutex until the retrieval completes. Detachment + // strips the caller's deadline along with its cancellation: on + // this path the caller context governs only the wait, and reaches + // the credential request itself only outside the group — on the + // inline not-expired path above and the direct call sites + // (presign, bucket location, express CreateSession). The S3 + // Express session request keeps the caller context: a full S3 + // operation's retries must stay cancellable, so its waiters + // share the winner's fate, and its trace for the same reason: + // the round trip was traced before this change. + // A retrieval panic resumes on each waiting caller's goroutine + // (credsRetrievalPanic); a runtime.Goexit reaches waiters as a + // terminal error from the de-dup group, since the retrieval + // goroutine cannot return one itself. + retrieveCtx := ctx + if express { + if c.httpTrace != nil { + retrieveCtx = httptrace.WithClientTrace(retrieveCtx, c.httpTrace) + } + } else { + retrieveCtx = context.WithoutCancel(ctx) + } + resCh := c.credsGroup.DoChan(metadata.bucketName, func() (v credentials.Value, rerr error) { + defer func() { + if r := recover(); r != nil { + rerr = credsRetrievalPanic{value: r} + } + }() + if express { + return c.CreateSession(retrieveCtx, metadata.bucketName, SessionReadWrite) + } + // Get credentials from the configured credentials provider. + return c.credsProvider.GetWithContext(c.credContext(retrieveCtx)) + }) + var res singleflight.Result[credentials.Value] + select { + case res = <-resCh: + case <-ctx.Done(): + // A result already delivered when the cancellation fires is + // preferred over the caller's context error. + select { + case res = <-resCh: + default: + return nil, ctx.Err() + } + } + var cp credsRetrievalPanic + if errors.As(res.Err, &cp) { + panic(cp.value) } - // Get credentials from the configured credentials provider. - return c.credsProvider.GetWithContext(c.CredContext()) - }) + value, err = res.Val, res.Err + } if err != nil { return nil, err } + // Attach the trace after retrieval: provider credential requests were + // never traced. The express session request is traced above. + if c.httpTrace != nil { + ctx = httptrace.WithClientTrace(ctx, c.httpTrace) + } + // Initialize a new HTTP request for the method. req, err = http.NewRequestWithContext(ctx, method, targetURL.String(), nil) if err != nil { @@ -1055,12 +1167,8 @@ func (c *Client) makeTargetURL(bucketName, objectName, bucketLocation string, is // Do not change the host if the endpoint URL is a FIPS S3 endpoint or a S3 PrivateLink interface endpoint if !s3utils.IsAmazonFIPSEndpoint(*c.endpointURL) && !s3utils.IsAmazonPrivateLinkEndpoint(*c.endpointURL) { if s3utils.IsAmazonExpressRegionalEndpoint(*c.endpointURL) { - if bucketName == "" { - host = getS3ExpressEndpoint(bucketLocation, false) - } else { - // Fetch new host based on the bucket location. - host = getS3ExpressEndpoint(bucketLocation, s3utils.IsS3ExpressBucket(bucketName)) - } + // Fetch new host based on the bucket location. + host = getS3ExpressEndpoint(bucketLocation, bucketName, c.s3DualstackEnabled) } else { // Fetch new host based on the bucket location. host = getS3Endpoint(bucketLocation, c.s3DualstackEnabled) @@ -1157,6 +1265,14 @@ func (c *Client) CredContext() *credentials.CredContext { } } +// credContext returns the client's CredContext with ctx attached as the +// caller context for credential retrieval. +func (c *Client) credContext(ctx context.Context) *credentials.CredContext { + cc := c.CredContext() + cc.Context = ctx + return cc +} + // GetCreds returns the access creds for the client func (c *Client) GetCreds() (credentials.Value, error) { if c.credsProvider == nil { diff --git a/vendor/github.com/minio/minio-go/v7/bucket-cache.go b/vendor/github.com/minio/minio-go/v7/bucket-cache.go index 7c64972842c..3ee6e6a65fd 100644 --- a/vendor/github.com/minio/minio-go/v7/bucket-cache.go +++ b/vendor/github.com/minio/minio-go/v7/bucket-cache.go @@ -23,6 +23,7 @@ import ( "net/http" "net/url" "path" + "strings" "github.com/minio/minio-go/v7/pkg/credentials" "github.com/minio/minio-go/v7/pkg/s3utils" @@ -76,33 +77,35 @@ func (c *Client) getBucketLocation(ctx context.Context, bucketName string) (stri // processes the getBucketLocation http response from the server. func processBucketLocationResponse(resp *http.Response, bucketName string) (bucketLocation string, err error) { - if resp != nil { - if resp.StatusCode != http.StatusOK { - err = httpRespToErrorResponse(resp, bucketName, "") - errResp := ToErrorResponse(err) - // For access denied error, it could be an anonymous - // request. Move forward and let the top level callers - // succeed if possible based on their policy. - switch errResp.Code { - case NotImplemented: - switch errResp.Server { - case "AmazonSnowball": - return "snowball", nil - case "cloudflare": - return "us-east-1", nil - } - case AuthorizationHeaderMalformed: - fallthrough - case InvalidRegion: - fallthrough - case AccessDenied: - if errResp.Region == "" { - return "us-east-1", nil - } - return errResp.Region, nil + if resp == nil { + return "", errInvalidArgument("Empty http response. " + reportIssue) + } + + if resp.StatusCode != http.StatusOK { + err = httpRespToErrorResponse(resp, bucketName, "") + errResp := ToErrorResponse(err) + // For access denied error, it could be an anonymous + // request. Move forward and let the top level callers + // succeed if possible based on their policy. + switch errResp.Code { + case NotImplemented: + switch errResp.Server { + case "AmazonSnowball": + return "snowball", nil + case "cloudflare": + return "us-east-1", nil } - return "", err + case AuthorizationHeaderMalformed: + fallthrough + case InvalidRegion: + fallthrough + case AccessDenied: + if errResp.Region == "" { + return "us-east-1", nil + } + return errResp.Region, nil } + return "", err } // Extract location. @@ -112,7 +115,7 @@ func processBucketLocationResponse(resp *http.Response, bucketName string) (buck return "", err } - location := locationConstraint + location := strings.TrimSpace(locationConstraint) // Location is empty will be 'us-east-1'. if location == "" { location = "us-east-1" @@ -170,7 +173,7 @@ func (c *Client) getBucketLocationRequest(ctx context.Context, bucketName string c.setUserAgent(req) // Get credentials from the configured credentials provider. - value, err := c.credsProvider.GetWithContext(c.CredContext()) + value, err := c.credsProvider.GetWithContext(c.credContext(ctx)) if err != nil { return nil, err } diff --git a/vendor/github.com/minio/minio-go/v7/checksum.go b/vendor/github.com/minio/minio-go/v7/checksum.go index bb3ce27b185..ac80f4dbd49 100644 --- a/vendor/github.com/minio/minio-go/v7/checksum.go +++ b/vendor/github.com/minio/minio-go/v7/checksum.go @@ -25,6 +25,7 @@ import ( "encoding/base64" "encoding/binary" "errors" + "fmt" "hash" "io" "math/bits" @@ -316,6 +317,135 @@ func (c ChecksumType) String() string { return "" } +// Checksum returns the checksum for the given type. +// Will return the empty string if not set. +func (o ObjectInfo) Checksum(t ChecksumType) string { + switch { + case t.Is(ChecksumCRC32C): + return o.ChecksumCRC32C + case t.Is(ChecksumCRC32): + return o.ChecksumCRC32 + case t.Is(ChecksumSHA1): + return o.ChecksumSHA1 + case t.Is(ChecksumSHA256): + return o.ChecksumSHA256 + case t.Is(ChecksumCRC64NVME): + return o.ChecksumCRC64NVME + case t.Is(ChecksumMD5): + return o.ChecksumMD5 + case t.Is(ChecksumSHA512): + return o.ChecksumSHA512 + case t.Is(ChecksumXXHash64): + return o.ChecksumXXHash64 + case t.Is(ChecksumXXHash3): + return o.ChecksumXXHash3 + case t.Is(ChecksumXXHash128): + return o.ChecksumXXHash128 + } + return "" +} + +// setChecksumAlgorithm fills in ChecksumAlgorithm from the checksum value the +// object carries, when the server did not name the algorithm itself. +// AWS never sends x-amz-checksum-algorithm on HEAD/GET and only reports +// / - never a value - when listing, while +// AiStor reports the values as well, but only when listing with WithMetadata. +// Deriving the name keeps ChecksumAlgorithm populated on every path. +func (o *ObjectInfo) setChecksumAlgorithm() { + if o.ChecksumAlgorithm != "" { + return + } + for _, t := range [...]ChecksumType{ + ChecksumCRC32, ChecksumCRC32C, ChecksumSHA1, ChecksumSHA256, ChecksumCRC64NVME, + ChecksumMD5, ChecksumSHA512, ChecksumXXHash64, ChecksumXXHash3, ChecksumXXHash128, + } { + if o.Checksum(t) != "" { + o.ChecksumAlgorithm = t.String() + return + } + } +} + +// checksumVerifyingReader verifies the checksum of data as it is read. +type checksumVerifyingReader struct { + io.ReadCloser + hash.Hash + expectChecksum string +} + +// newChecksumVerifyingReader returns a checksum-verifying reader for obj, +// wrapping the given response body, or nil if obj carries no usable checksum. +func (c *Client) newChecksumVerifyingReader(obj ObjectInfo) *checksumVerifyingReader { + switch { + case obj.ChecksumCRC32 != "": + return &checksumVerifyingReader{Hash: ChecksumCRC32.Hasher(), expectChecksum: obj.ChecksumCRC32} + case obj.ChecksumCRC32C != "": + return &checksumVerifyingReader{Hash: ChecksumCRC32C.Hasher(), expectChecksum: obj.ChecksumCRC32C} + case obj.ChecksumSHA1 != "": + return &checksumVerifyingReader{Hash: ChecksumSHA1.Hasher(), expectChecksum: obj.ChecksumSHA1} + case obj.ChecksumSHA256 != "": + return &checksumVerifyingReader{Hash: c.sha256Hasher(), expectChecksum: obj.ChecksumSHA256} + case obj.ChecksumCRC64NVME != "": + return &checksumVerifyingReader{Hash: ChecksumCRC64NVME.Hasher(), expectChecksum: obj.ChecksumCRC64NVME} + case obj.ChecksumMD5 != "": + return &checksumVerifyingReader{Hash: c.md5Hasher(), expectChecksum: obj.ChecksumMD5} + case obj.ChecksumSHA512 != "": + return &checksumVerifyingReader{Hash: ChecksumSHA512.Hasher(), expectChecksum: obj.ChecksumSHA512} + case obj.ChecksumXXHash64 != "": + return &checksumVerifyingReader{Hash: ChecksumXXHash64.Hasher(), expectChecksum: obj.ChecksumXXHash64} + case obj.ChecksumXXHash3 != "": + return &checksumVerifyingReader{Hash: ChecksumXXHash3.Hasher(), expectChecksum: obj.ChecksumXXHash3} + case obj.ChecksumXXHash128 != "": + return &checksumVerifyingReader{Hash: ChecksumXXHash128.Hasher(), expectChecksum: obj.ChecksumXXHash128} + default: + return nil + } +} + +func (c *checksumVerifyingReader) SetReader(r io.ReadCloser) { + c.ReadCloser = r +} + +// Close returns any pooled hasher and closes the underlying reader if one is set. +func (c *checksumVerifyingReader) Close() error { + if closer, ok := c.Hash.(interface{ Close() }); ok { + closer.Close() + } + if c.ReadCloser == nil { + return nil + } + return c.ReadCloser.Close() +} + +// Read reads data and hashes it. At EOF the checksum is verified; on +// mismatch the mismatch error is returned in place of io.EOF. +func (c *checksumVerifyingReader) Read(p []byte) (int, error) { + n, err := c.ReadCloser.Read(p) + if n > 0 { + n2, werr := c.Write(p[:n]) + if werr != nil { + return n, werr + } + if n2 != n { + return n, io.ErrShortWrite + } + } + if err == io.EOF { + if verr := c.VerifyChecksum(); verr != nil { + return n, verr + } + } + return n, err +} + +// VerifyChecksum returns an error if the computed checksum does not match. +func (c *checksumVerifyingReader) VerifyChecksum() error { + if got := base64.StdEncoding.EncodeToString(c.Sum(nil)); got != c.expectChecksum { + return fmt.Errorf("checksum mismatch, expected %s, got %s", c.expectChecksum, got) + } + return nil +} + // ChecksumReader reads all of r and returns a checksum of type c. // Returns any error that may have occurred while reading. func (c ChecksumType) ChecksumReader(r io.Reader) (Checksum, error) { diff --git a/vendor/github.com/minio/minio-go/v7/constants.go b/vendor/github.com/minio/minio-go/v7/constants.go index d49efdee5d6..b329da2c9b2 100644 --- a/vendor/github.com/minio/minio-go/v7/constants.go +++ b/vendor/github.com/minio/minio-go/v7/constants.go @@ -18,34 +18,33 @@ package minio // Multipart upload defaults. +// +// The default* values below are Amazon S3's limits. They can be overridden +// per client with Options.UploadLimits; see UploadLimits. -// absMinPartSize - absolute minimum part size (5 MiB) below which +// defaultMinPartSize - absolute minimum part size (5 MiB) below which // a part in a multipart upload may not be uploaded. -const absMinPartSize = 1024 * 1024 * 5 +const defaultMinPartSize = 1024 * 1024 * 5 // minPartSize - minimum part size 16MiB per object after which // putObject behaves internally as multipart. const minPartSize = 1024 * 1024 * 16 -// maxPartsCount - maximum number of parts for a single multipart session. -const maxPartsCount = 10000 +// defaultMaxPartsCount - maximum number of parts for a single multipart session. +const defaultMaxPartsCount = 10000 -// maxPartSize - maximum part size 5GiB for a single multipart upload +// defaultMaxPartSize - maximum part size 5GiB for a single multipart upload // operation. -const maxPartSize = 1024 * 1024 * 1024 * 5 +const defaultMaxPartSize = 1024 * 1024 * 1024 * 5 -// maxSinglePutObjectSize - maximum size 5GiB of object per PUT +// defaultMaxSinglePutObjectSize - maximum size 5GiB of object per PUT // operation. -const maxSinglePutObjectSize = 1024 * 1024 * 1024 * 5 +const defaultMaxSinglePutObjectSize = 1024 * 1024 * 1024 * 5 // maxMultipartPutObjectSize - maximum size 5TiB of object for // Multipart operation. const maxMultipartPutObjectSize = 1024 * 1024 * 1024 * 1024 * 5 -// maxObjectSize - maximum size of an object calculated from -// maxPartSize * maxPartsCount = 5GiB * 10000 = ~48.83TiB -const maxObjectSize = maxPartSize * maxPartsCount - // unsignedPayload - value to be set to X-Amz-Content-Sha256 header when // we don't want to sign the request payload const unsignedPayload = "UNSIGNED-PAYLOAD" @@ -101,6 +100,11 @@ const ( amzReplicationStatus = "X-Amz-Replication-Status" amzDeleteMarker = "X-Amz-Delete-Marker" + // Listing header asking for optional per object fields. + // "RestoreStatus" is its only value. + amzOptionalObjectAttributes = "X-Amz-Optional-Object-Attributes" + restoreStatusAttribute = "RestoreStatus" + // Object legal hold header amzLegalHoldHeader = "X-Amz-Object-Lock-Legal-Hold" diff --git a/vendor/github.com/minio/minio-go/v7/core.go b/vendor/github.com/minio/minio-go/v7/core.go index 99b99db9b87..91716251c83 100644 --- a/vendor/github.com/minio/minio-go/v7/core.go +++ b/vendor/github.com/minio/minio-go/v7/core.go @@ -52,7 +52,7 @@ func (c Core) ListObjects(bucket, prefix, marker, delimiter string, maxKeys int) // ListObjectsV2 - Lists all the objects at a prefix, similar to ListObjects() but uses // continuationToken instead of marker to support iteration over the results. func (c Core) ListObjectsV2(bucketName, objectPrefix, startAfter, continuationToken, delimiter string, maxkeys int) (ListBucketV2Result, error) { - return c.listObjectsV2Query(context.Background(), bucketName, objectPrefix, continuationToken, true, false, delimiter, startAfter, maxkeys, nil) + return c.listObjectsV2Query(context.Background(), bucketName, objectPrefix, continuationToken, true, false, false, delimiter, startAfter, maxkeys, nil) } // CopyObject - copies an object from source object to destination object on server side. diff --git a/vendor/github.com/minio/minio-go/v7/create-session.go b/vendor/github.com/minio/minio-go/v7/create-session.go index d85e79d4b1e..7ebe5910275 100644 --- a/vendor/github.com/minio/minio-go/v7/create-session.go +++ b/vendor/github.com/minio/minio-go/v7/create-session.go @@ -51,19 +51,30 @@ type createSessionResult struct { } `xml:",omitempty"` } +// expressSessionRenewalLeeway is how long before its expiration a cached +// S3 Express session stops being served, leaving room for renewal. +const expressSessionRenewalLeeway = 10 * time.Second + +// sessionFromCache returns the cached S3 Express session credentials for +// bucketName while they remain outside the renewal leeway. +func (c *Client) sessionFromCache(bucketName string) (credentials.Value, bool) { + v, ok := c.bucketSessionCache.Get(bucketName) + if !ok || !v.Expiration.After(time.Now().Add(expressSessionRenewalLeeway)) { + return credentials.Value{}, false + } + return v, true +} + // CreateSession - https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html // the returning credentials may be cached depending on the expiration of the original -// credential, credentials will get renewed 10 secs earlier than when its gonna expire -// allowing for some leeway in the renewal process. +// credential; a cached session stops being served expressSessionRenewalLeeway before +// it expires, allowing for some leeway in the renewal process. func (c *Client) CreateSession(ctx context.Context, bucketName string, sessionMode SessionMode) (cred credentials.Value, err error) { if err := s3utils.CheckValidBucketNameS3Express(bucketName); err != nil { return credentials.Value{}, err } - v, ok := c.bucketSessionCache.Get(bucketName) - if ok && v.Expiration.After(time.Now().Add(10*time.Second)) { - // Verify if the credentials will not expire - // in another 10 seconds, if not we renew it again. + if v, ok := c.sessionFromCache(bucketName); ok { return v, nil } @@ -109,7 +120,7 @@ func (c *Client) createSessionRequest(ctx context.Context, bucketName string, se targetURL := *c.endpointURL // Fetch new host based on the bucket location. - host := getS3ExpressEndpoint(c.region, s3utils.IsS3ExpressBucket(bucketName)) + host := getS3ExpressEndpoint(c.region, bucketName, c.s3DualstackEnabled) // as it works in makeTargetURL method from api.go file if h, p, err := net.SplitHostPort(host); err == nil { @@ -143,7 +154,7 @@ func (c *Client) createSessionRequest(ctx context.Context, bucketName string, se c.setUserAgent(req) // Get credentials from the configured credentials provider. - value, err := c.credsProvider.GetWithContext(c.CredContext()) + value, err := c.credsProvider.GetWithContext(c.credContext(ctx)) if err != nil { return nil, err } diff --git a/vendor/github.com/minio/minio-go/v7/endpoints.go b/vendor/github.com/minio/minio-go/v7/endpoints.go index 0753fa8a4c9..f3e653f8e27 100644 --- a/vendor/github.com/minio/minio-go/v7/endpoints.go +++ b/vendor/github.com/minio/minio-go/v7/endpoints.go @@ -17,69 +17,28 @@ package minio +import ( + "regexp" +) + type awsS3Endpoint struct { endpoint string dualstackEndpoint string } -type awsS3ExpressEndpoint struct { - regionalEndpoint string - zonalEndpoints []string -} - -var awsS3ExpressEndpointMap = map[string]awsS3ExpressEndpoint{ - "us-east-1": { - "s3express-control.us-east-1.amazonaws.com", - []string{ - "s3express-use1-az4.us-east-1.amazonaws.com", - "s3express-use1-az5.us-east-1.amazonaws.com", - "3express-use1-az6.us-east-1.amazonaws.com", - }, - }, - "us-east-2": { - "s3express-control.us-east-2.amazonaws.com", - []string{ - "s3express-use2-az1.us-east-2.amazonaws.com", - "s3express-use2-az2.us-east-2.amazonaws.com", - }, - }, - "us-west-2": { - "s3express-control.us-west-2.amazonaws.com", - []string{ - "s3express-usw2-az1.us-west-2.amazonaws.com", - "s3express-usw2-az3.us-west-2.amazonaws.com", - "s3express-usw2-az4.us-west-2.amazonaws.com", - }, - }, - "ap-south-1": { - "s3express-control.ap-south-1.amazonaws.com", - []string{ - "s3express-aps1-az1.ap-south-1.amazonaws.com", - "s3express-aps1-az3.ap-south-1.amazonaws.com", - }, - }, - "ap-northeast-1": { - "s3express-control.ap-northeast-1.amazonaws.com", - []string{ - "s3express-apne1-az1.ap-northeast-1.amazonaws.com", - "s3express-apne1-az4.ap-northeast-1.amazonaws.com", - }, - }, - "eu-west-1": { - "s3express-control.eu-west-1.amazonaws.com", - []string{ - "s3express-euw1-az1.eu-west-1.amazonaws.com", - "s3express-euw1-az3.eu-west-1.amazonaws.com", - }, - }, - "eu-north-1": { - "s3express-control.eu-north-1.amazonaws.com", - []string{ - "s3express-eun1-az1.eu-north-1.amazonaws.com", - "s3express-eun1-az2.eu-north-1.amazonaws.com", - "s3express-eun1-az3.eu-north-1.amazonaws.com", - }, - }, +// awsS3ExpressEndpointMap Amazon S3 Express regional (control) endpoints per +// region. Zonal endpoints are not listed: they follow the regular pattern +// "s3express-..amazonaws.com" and are derived from the zone +// ID encoded in the S3 Express (directory) bucket name. +var awsS3ExpressEndpointMap = map[string]string{ + "us-east-1": "s3express-control.us-east-1.amazonaws.com", + "us-east-2": "s3express-control.us-east-2.amazonaws.com", + "us-west-2": "s3express-control.us-west-2.amazonaws.com", + "ap-south-1": "s3express-control.ap-south-1.amazonaws.com", + "ap-northeast-1": "s3express-control.ap-northeast-1.amazonaws.com", + "eu-central-1": "s3express-control.eu-central-1.amazonaws.com", + "eu-west-1": "s3express-control.eu-west-1.amazonaws.com", + "eu-north-1": "s3express-control.eu-north-1.amazonaws.com", } // awsS3EndpointMap Amazon S3 endpoint map. @@ -250,17 +209,38 @@ var awsS3EndpointMap = map[string]awsS3Endpoint{ }, } -// getS3ExpressEndpoint get Amazon S3 Express endpoing based on the region -// optionally if zonal is set returns first zonal endpoint. -func getS3ExpressEndpoint(region string, zonal bool) (endpoint string) { - s3ExpEndpoint, ok := awsS3ExpressEndpointMap[region] +// s3ExpressBucketAZID extracts the zone ID from an S3 Express (directory) +// bucket name. Directory buckets live in a single Availability Zone or Local +// Zone, encoded in the trailing "----x-s3" suffix, e.g. "use1-az4" +// from "mybucket--use1-az4--x-s3" or "usw2-lax1-az1" from +// "bucket--usw2-lax1-az1--x-s3". The zone ID is the last "-azN" segment +// before the "--x-s3" suffix, so earlier "--" runs in the base name do not +// confuse the match. +var s3ExpressBucketAZID = regexp.MustCompile(`--([a-z0-9]+(?:-[a-z0-9]+)*-az[0-9]+)--x-s3$`) + +// getS3ExpressEndpoint returns the S3 Express endpoint for the region. +// S3 Express buckets live in a single zone, encoded in the bucket name +// suffix ("----x-s3"); the zonal endpoint is derived from it via +// the regular "s3express-..amazonaws.com" pattern. +// Non-S3 Express buckets (or no bucket) use the regional endpoint. +// Unknown regions return "". dualstack selects the dualstack variants +// (s3express-.dualstack..amazonaws.com and +// s3express-control-dualstack..amazonaws.com). +func getS3ExpressEndpoint(region, bucketName string, dualstack bool) (endpoint string) { + regionalEndpoint, ok := awsS3ExpressEndpointMap[region] if !ok { return "" } - if zonal { - return s3ExpEndpoint.zonalEndpoints[0] + if m := s3ExpressBucketAZID.FindStringSubmatch(bucketName); len(m) == 2 { + if dualstack { + return "s3express-" + m[1] + ".dualstack." + region + ".amazonaws.com" + } + return "s3express-" + m[1] + "." + region + ".amazonaws.com" + } + if dualstack { + return "s3express-control-dualstack." + region + ".amazonaws.com" } - return s3ExpEndpoint.regionalEndpoint + return regionalEndpoint } // getS3Endpoint get Amazon S3 endpoint based on the bucket location. diff --git a/vendor/github.com/minio/minio-go/v7/functional_tests.go b/vendor/github.com/minio/minio-go/v7/functional_tests.go index ef5f2377f1d..7ca6f137628 100644 --- a/vendor/github.com/minio/minio-go/v7/functional_tests.go +++ b/vendor/github.com/minio/minio-go/v7/functional_tests.go @@ -74,8 +74,9 @@ const ( appVersion = "0.1.0" skipCERTValidation = "SKIP_CERT_VALIDATION" - // TODO: remove when server supports the 2026 checksum types. - ignore2026Checksums = true + // TODO: remove when server supports the 2026 checksum types on latest release. + // Linux is fetched from edge, so supports new types. + ignore2026Checksums = runtime.GOOS != "linux" ) func ignore2026ChecksumError(cs minio.ChecksumType, err error) bool { @@ -172,9 +173,12 @@ func logError(testName, function string, args map[string]interface{}, startTime // If server returns NotImplemented we assume it is gateway mode and hence log it as info and move on to next tests // Special case for ComposeObject API as it is implemented on client side and adds specific error details like `Error in upload-part-copy` in // addition to NotImplemented error returned from server - if isErrNotImplemented(err) { + switch { + case isErrNotImplemented(err): logIgnored(testName, function, args, startTime, message) - } else { + case isErrFreeTierLicense(err): + logNotAvailable(testName, function, args, startTime, message) + default: logFailure(testName, function, args, startTime, alert, message, err) if !isRunOnFail() { panic(fmt.Sprintf("Test failed with message: %s, err: %v", message, err)) @@ -206,6 +210,15 @@ func logIgnored(testName, function string, args map[string]interface{}, startTim ).Info("") } +// log not applicable test runs for license-gated features +func logNotAvailable(testName, function string, args map[string]interface{}, startTime time.Time, alert string) { + baseLogger(testName, function, args, startTime). + With( + "status", "NA", + "alert", strings.Split(alert, " ")[0]+" requires a paid-tier license", + ).Info("") +} + // Delete objects in given bucket, recursively func cleanupBucket(bucketName string, c *minio.Client) error { // Create a done channel to control 'ListObjectsV2' go routine. @@ -279,6 +292,11 @@ func isErrNotImplemented(err error) bool { return minio.ToErrorResponse(err).Code == minio.NotImplemented } +// isErrFreeTierLicense reports whether the server rejected the request because it requires a paid-tier license. +func isErrFreeTierLicense(err error) bool { + return minio.ToErrorResponse(err).Code == minio.XMinioPaidTierLicenseRequired +} + func isRunOnFail() bool { return os.Getenv("RUN_ON_FAIL") == "1" } @@ -795,6 +813,125 @@ func testListObjectVersions() { logSuccess(testName, function, args, startTime) } +func testStatObjectResponseHeaders() { + // initialize logging params + startTime := time.Now() + testName := getFuncName() + function := "StatObject(bucketName, objectName, opts)" + args := map[string]interface{}{} + + c, err := NewClient(ClientConfig{}) + if err != nil { + logError(testName, function, args, startTime, "", "MinIO client object creation failed", err) + return + } + + // Generate a new random bucket name. + bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-") + args["bucketName"] = bucketName + + // Make a new bucket. + err = c.MakeBucket(context.Background(), bucketName, minio.MakeBucketOptions{Region: "us-east-1"}) + if err != nil { + logError(testName, function, args, startTime, "", "MakeBucket failed", err) + return + } + + defer cleanupBucket(bucketName, c) + + bufSize := dataFileMap["datafile-33-kB"] + reader := getDataReader("datafile-33-kB") + defer reader.Close() + + objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "") + args["objectName"] = objectName + + _, err = c.PutObject(context.Background(), bucketName, objectName, reader, int64(bufSize), minio.PutObjectOptions{ContentType: "binary/octet-stream"}) + if err != nil { + logError(testName, function, args, startTime, "", "PutObject failed", err) + return + } + + opts := minio.StatObjectOptions{} + err = opts.SetRange(0, 99) + if err != nil { + logError(testName, function, args, startTime, "", "SetRange failed", err) + return + } + args["range"] = "0-99" + + st, err := c.StatObject(context.Background(), bucketName, objectName, opts) + if err != nil { + logError(testName, function, args, startTime, "", "StatObject failed", err) + return + } + + if st.Size != 100 { + logError(testName, function, args, startTime, "", "StatObject ranged size mismatch", fmt.Errorf("got %d, want 100", st.Size)) + return + } + wantContentRange := fmt.Sprintf("bytes 0-99/%d", bufSize) + gotContentRange := st.Headers.Get("Content-Range") + if gotContentRange != wantContentRange { + logError(testName, function, args, startTime, "", "StatObject response headers Content-Range mismatch", fmt.Errorf("got %q, want %q", gotContentRange, wantContentRange)) + return + } + if st.Headers.Get("ETag") == "" { + logError(testName, function, args, startTime, "", "StatObject response headers missing ETag", errors.New("empty ETag header")) + return + } + + gopts := minio.GetObjectOptions{} + err = gopts.SetRange(0, 99) + if err != nil { + logError(testName, function, args, startTime, "", "SetRange failed", err) + return + } + obj, err := c.GetObject(context.Background(), bucketName, objectName, gopts) + if err != nil { + logError(testName, function, args, startTime, "", "GetObject failed", err) + return + } + defer obj.Close() + // Read first: a first-op Stat issues an un-ranged StatObject by design, + // so the ranged GET response headers are observable only after a read. + buf := make([]byte, 100) + if _, err = io.ReadFull(obj, buf); err != nil { + logError(testName, function, args, startTime, "", "GetObject ranged read failed", err) + return + } + gst, err := obj.Stat() + if err != nil { + logError(testName, function, args, startTime, "", "GetObject Stat failed", err) + return + } + if got := gst.Headers.Get("Content-Range"); got != wantContentRange { + logError(testName, function, args, startTime, "", "GetObject response headers Content-Range mismatch", fmt.Errorf("got %q, want %q", got, wantContentRange)) + return + } + + sawObject := false + for listInfo := range c.ListObjects(context.Background(), bucketName, minio.ListObjectsOptions{}) { + if listInfo.Err != nil { + logError(testName, function, args, startTime, "", "ListObjects failed", listInfo.Err) + return + } + if listInfo.Key == objectName { + sawObject = true + } + if listInfo.Headers != nil { + logError(testName, function, args, startTime, "", "ListObjects ObjectInfo.Headers expected nil", fmt.Errorf("got %v", listInfo.Headers)) + return + } + } + if !sawObject { + logError(testName, function, args, startTime, "", "ListObjects did not list the uploaded object", errors.New("uploaded object missing from listing")) + return + } + + logSuccess(testName, function, args, startTime) +} + func testStatObjectWithVersioning() { // initialize logging params startTime := time.Now() @@ -5379,7 +5516,7 @@ func testGetObjectReadSeekFunctional() { } if st.Size != int64(bufSize) { - logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(int64(bufSize))+", got "+string(st.Size), err) + logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+strconv.Itoa(bufSize)+", got "+strconv.FormatInt(st.Size, 10), err) return } @@ -5418,50 +5555,77 @@ func testGetObjectReadSeekFunctional() { {0, 0, 0, nil, true, 0, 0}, // Start from offset 2048, fetch data and compare {2048, 0, 2048, nil, true, 2048, bufSize}, - // Start from offset larger than possible - {int64(bufSize) + 1024, 0, 0, seekErr, false, 0, 0}, + // Start from offset larger than possible: Seek rejects it with io.EOF + // and keeps the offset unchanged. + {int64(bufSize) + 1024, 0, 0, io.EOF, false, 0, 0}, // Move to offset 0 without comparing {0, 0, 0, nil, false, 0, 0}, // Move one step forward and compare {1, 1, 1, nil, true, 1, bufSize}, - // Move larger than possible - {int64(bufSize), 1, 0, seekErr, false, 0, 0}, - // Provide negative offset with CUR_SEEK - {int64(-1), 1, 0, seekErr, false, 0, 0}, - // Test with whence SEEK_END and with positive offset - {1024, 2, int64(bufSize) - 1024, io.EOF, true, 0, 0}, + // Move larger than possible: Seek returns io.EOF. + {int64(bufSize), 1, 0, io.EOF, false, 0, 0}, + // Provide negative offset with CUR_SEEK: valid since the resulting + // absolute position is within the object. + {int64(-1), 1, int64(bufSize) - 1, nil, false, 0, 0}, + // Test with whence SEEK_END and with positive offset: Seek returns + // io.EOF. + {1024, 2, 0, io.EOF, false, 0, 0}, // Test with whence SEEK_END and with negative offset {-1024, 2, int64(bufSize) - 1024, nil, true, bufSize - 1024, bufSize}, // Test with whence SEEK_END and with large negative offset {-int64(bufSize) * 2, 2, 0, seekErr, true, 0, 0}, + // Seek to exactly the object end; the subsequent read reports io.EOF. + {0, 2, int64(bufSize), nil, false, 0, 0}, } for i, testCase := range testCases { + // Snapshot the cursor so rejected seeks can be asserted side-effect + // free. + prevPos, err := r.Seek(0, io.SeekCurrent) + if err != nil { + logError(testName, function, args, startTime, "", fmt.Sprintf("Test %d, reading the current position failed", i+1), err) + return + } // Perform seek operation n, err := r.Seek(testCase.offset, testCase.whence) // We expect an error if testCase.err == seekErr && err == nil { - logError(testName, function, args, startTime, "", "Test "+string(i+1)+", unexpected err value: expected: "+testCase.err.Error()+", found: "+err.Error(), err) + logError(testName, function, args, startTime, "", fmt.Sprintf("Test %d, unexpected err value: expected: %v, found: %v", i+1, testCase.err, err), err) return } // We expect a specific error if testCase.err != seekErr && testCase.err != err { - logError(testName, function, args, startTime, "", "Test "+string(i+1)+", unexpected err value: expected: "+testCase.err.Error()+", found: "+err.Error(), err) + logError(testName, function, args, startTime, "", fmt.Sprintf("Test %d, unexpected err value: expected: %v, found: %v", i+1, testCase.err, err), err) return } // If we expect an error go to the next loop if testCase.err != nil { + // A rejected seek must leave the cursor unchanged. + curPos, cerr := r.Seek(0, io.SeekCurrent) + if cerr != nil || curPos != prevPos { + logError(testName, function, args, startTime, "", fmt.Sprintf("Test %d, cursor after rejected seek: expected %d, got %d", i+1, prevPos, curPos), cerr) + return + } continue } // Check the returned seek pos if n != testCase.pos { - logError(testName, function, args, startTime, "", "Test "+string(i+1)+", number of bytes seeked does not match, expected "+string(testCase.pos)+", got "+string(n), err) + logError(testName, function, args, startTime, "", fmt.Sprintf("Test %d, number of bytes seeked does not match, expected %d, got %d", i+1, testCase.pos, n), err) return } // Compare only if shouldCmp is activated if testCase.shouldCmp { cmpData(r, testCase.start, testCase.end) } + // A successful seek to the object end must defer io.EOF to the + // subsequent read. + if !testCase.shouldCmp && testCase.err == nil && testCase.pos >= int64(bufSize) { + readN, readErr := r.Read(make([]byte, 1)) + if readN != 0 || readErr != io.EOF { + logError(testName, function, args, startTime, "", fmt.Sprintf("Test %d, read after seek to object end expected zero bytes and io.EOF, got %d bytes and %v", i+1, readN, readErr), readErr) + return + } + } } logSuccess(testName, function, args, startTime) } @@ -5569,8 +5733,8 @@ func testGetObjectReadAtFunctional() { return } - if st.Size != int64(bufSize) { - logError(testName, function, args, startTime, "", "Number of bytes in stat does not match, expected "+string(int64(bufSize))+", got "+string(st.Size), err) + if st.Size != (int64(bufSize) - int64(len(bufRead))) { + logError(testName, function, args, startTime, "", "Number of bytes in stat does not match, expected "+strconv.Itoa(bufSize)+", got "+strconv.Itoa(bufSize-len(bufRead)), err) return } @@ -5665,6 +5829,228 @@ func testGetObjectReadAtFunctional() { logSuccess(testName, function, args, startTime) } +// testGetObjectWithRange - get object with range +func testGetObjectWithRange() { + // initialize logging params + startTime := time.Now() + testName := getFuncName() + function := "GetObject(bucketName, objectName)" + args := map[string]interface{}{} + + c, err := NewClient(ClientConfig{}) + if err != nil { + logError(testName, function, args, startTime, "", "MinIO client object creation failed", err) + return + } + + // Generate a new random bucket name. + bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-") + args["bucketName"] = bucketName + + // Make a new bucket. + err = c.MakeBucket(context.Background(), bucketName, minio.MakeBucketOptions{Region: "us-east-1"}) + if err != nil { + logError(testName, function, args, startTime, "", "MakeBucket failed", err) + return + } + + defer cleanupBucket(bucketName, c) + + // Generate 33K of data. + bufSize := dataFileMap["datafile-33-kB"] + reader := getDataReader("datafile-33-kB") + defer reader.Close() + + objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "") + args["objectName"] = objectName + + buf, err := io.ReadAll(reader) + if err != nil { + logError(testName, function, args, startTime, "", "ReadAll failed", err) + return + } + + // Save the data + _, err = c.PutObject(context.Background(), bucketName, objectName, bytes.NewReader(buf), int64(len(buf)), minio.PutObjectOptions{ContentType: "binary/octet-stream"}) + if err != nil { + logError(testName, function, args, startTime, "", "PutObject failed", err) + return + } + + var r *minio.Object + testIndex := 0 + baseSize := 0 + New := func() { + opts := minio.GetObjectOptions{} + switch testIndex { + case 0: + baseSize = bufSize + case 1: + opts.SetRange(100, 1000) + baseSize = 1000 - 100 + 1 + case 2: + opts.SetRange(100, 0) + baseSize = bufSize - 100 + case 3: + opts.SetRange(0, 1000) + baseSize = 1000 + 1 + } + r, err = c.GetObject(context.Background(), bucketName, objectName, opts) + if err != nil { + logError(testName, function, args, startTime, "", "Failed to create MinIO client object", err) + } + } + + Size := func(size int) { + st, err := r.Stat() + if err != nil { + logError(testName, function, args, startTime, "", "Failed to get object stat", err) + } + if int(st.Size) != size { + logError(testName, function, args, startTime, "", "Incorrect size returned", fmt.Errorf("Test index %d Expected size %d, got %d", testIndex, size, int(st.Size))) + } + } + Read := func(size int) { + b := make([]byte, size) + _, err := r.Read(b) + if err != nil { + logError(testName, function, args, startTime, "", "Failed to read from object", err) + } + } + + ReadFull := func(size int) { + b := make([]byte, size) + _, err := r.Read(b) + if err != nil { + logError(testName, function, args, startTime, "", "Failed to read from object", err) + } + } + + ReadAll := func() { + _, err := io.ReadAll(r) + if err != nil { + logError(testName, function, args, startTime, "", "Failed to read from object", err) + } + } + + Seek := func(offset int64, whence int) { + _, err := r.Seek(offset, whence) + if err != nil { + logError(testName, function, args, startTime, "", "Failed to seek in object", err) + } + } + ReadAt := func(offset int64, size int64) { + b := make([]byte, size) + _, err := r.ReadAt(b, offset) + if err != nil { + logError(testName, function, args, startTime, "", "Failed to read from object", err) + } + } + for index := range 4 { + testIndex = index + // case 1: stat first and then read 100 bytes for per read + { + New() + Size(baseSize) + Read(100) + Size(baseSize - 100) + Read(100) + Size(baseSize - 200) + Read(100) + Size(baseSize - 300) + ReadFull(100) + Size(baseSize - 400) + } + // case 2: read 100 bytes for per read + { + New() + Read(100) + Size(baseSize - 100) + Read(100) + Size(baseSize - 200) + Read(100) + Size(baseSize - 300) + ReadFull(100) + Size(baseSize - 400) + } + // case 3: Stat -> Read -> ReadAt -> Read + { + New() + Size(baseSize) + Read(100) + Size(baseSize - 100) + // should not move the offset, so next stat is not changed + ReadAt(100, 100) + Size(baseSize - 100) + Read(100) + Size(baseSize - 200) + } + // case 4: Read -> ReadAt -> Read + { + New() + Read(100) + Size(baseSize - 100) + // should not move the offset, so next stat is not changed + ReadAt(100, 100) + Size(baseSize - 100) + Read(100) + Size(baseSize - 200) + } + // case 5: Stat -> Read -> ReadAt -> Read -> Seek -> Read + { + New() + Size(baseSize) + Read(100) + Size(baseSize - 100) + // should not move the offset, so next stat is not changed + ReadAt(100, 100) + Size(baseSize - 100) + Read(100) + Size(baseSize - 200) + Seek(100, io.SeekCurrent) + Size(baseSize - 300) + Read(100) + Size(baseSize - 400) + } + // case 6: Read -> ReadAt -> Read -> Seek -> Read + { + New() + Read(100) + Size(baseSize - 100) + // should not move the offset, so next stat is not changed + ReadAt(100, 100) + Size(baseSize - 100) + Read(100) + Size(baseSize - 200) + Seek(100, io.SeekCurrent) + Size(baseSize - 300) + Read(100) + Size(baseSize - 400) + } + // case 7: Stat -> ReadAll -> ReadAt + { + New() + Size(baseSize) + ReadAll() + ReadAt(100, 100) + } + // case 8: ReadAll -> ReadAt + { + New() + ReadAll() + ReadAt(100, 100) + } + // case9: Seek first + { + New() + Seek(100, io.SeekCurrent) + Size(baseSize - 100) + Read(100) + Size(baseSize - 200) + } + } +} + // Reproduces issue https://github.com/minio/minio-go/issues/1137 func testGetObjectReadAtWhenEOFWasReached() { // initialize logging params @@ -5746,7 +6132,7 @@ func testGetObjectReadAtWhenEOFWasReached() { return } - if st.Size != int64(bufSize) { + if st.Size != (int64(bufSize) - int64(len(buf1))) { logError(testName, function, args, startTime, "", "Number of bytes in stat does not match, expected "+string(int64(bufSize))+", got "+string(st.Size), err) return } @@ -6527,7 +6913,7 @@ func testSSECEncryptedGetObjectReadSeekFunctional() { } if st.Size != int64(bufSize) { - logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(int64(bufSize))+", got "+string(st.Size), err) + logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+strconv.Itoa(bufSize)+", got "+strconv.FormatInt(st.Size, 10), err) return } @@ -6563,17 +6949,20 @@ func testSSECEncryptedGetObjectReadSeekFunctional() { {0, 0, 0, nil, true, 0, 0}, // Start from offset 2048, fetch data and compare {2048, 0, 2048, nil, true, 2048, bufSize}, - // Start from offset larger than possible + // Start from offset larger than possible: Seek rejects it with io.EOF + // and keeps the offset unchanged. {int64(bufSize) + 1024, 0, 0, io.EOF, false, 0, 0}, // Move to offset 0 without comparing {0, 0, 0, nil, false, 0, 0}, // Move one step forward and compare {1, 1, 1, nil, true, 1, bufSize}, - // Move larger than possible + // Move larger than possible: Seek returns io.EOF. {int64(bufSize), 1, 0, io.EOF, false, 0, 0}, - // Provide negative offset with CUR_SEEK - {int64(-1), 1, 0, fmt.Errorf("Negative position not allowed for 1"), false, 0, 0}, - // Test with whence SEEK_END and with positive offset + // Provide negative offset with CUR_SEEK: valid since the resulting + // absolute position is within the object. + {int64(-1), 1, int64(bufSize) - 1, nil, false, 0, 0}, + // Test with whence SEEK_END and with positive offset: Seek returns + // io.EOF. {1024, 2, 0, io.EOF, false, 0, 0}, // Test with whence SEEK_END and with negative offset {-1024, 2, int64(bufSize) - 1024, nil, true, bufSize - 1024, bufSize}, @@ -6581,9 +6970,18 @@ func testSSECEncryptedGetObjectReadSeekFunctional() { {-int64(bufSize) * 2, 2, 0, fmt.Errorf("Seeking at negative offset not allowed for 2"), false, 0, 0}, // Test with invalid whence {0, 3, 0, fmt.Errorf("Invalid whence 3"), false, 0, 0}, + // Seek to exactly the object end; the subsequent read reports io.EOF. + {0, 2, int64(bufSize), nil, false, 0, 0}, } for i, testCase := range testCases { + // Snapshot the cursor so rejected seeks can be asserted side-effect + // free. + prevPos, err := r.Seek(0, io.SeekCurrent) + if err != nil { + logError(testName, function, args, startTime, "", fmt.Sprintf("Test %d, reading the current position failed", i+1), err) + return + } // Perform seek operation n, err := r.Seek(testCase.offset, testCase.whence) if err != nil && testCase.err == nil { @@ -6605,6 +7003,12 @@ func testSSECEncryptedGetObjectReadSeekFunctional() { fmt.Sprintf("Test %d, unexpected err value: expected: %s, found: %s", i+1, testCase.err, err), err) return } + // A rejected seek must leave the cursor unchanged. + curPos, cerr := r.Seek(0, io.SeekCurrent) + if cerr != nil || curPos != prevPos { + logError(testName, function, args, startTime, "", fmt.Sprintf("Test %d, cursor after rejected seek: expected %d, got %d", i+1, prevPos, curPos), cerr) + return + } } // Check the returned seek pos if n != testCase.pos { @@ -6616,6 +7020,15 @@ func testSSECEncryptedGetObjectReadSeekFunctional() { if testCase.shouldCmp { cmpData(r, testCase.start, testCase.end) } + // A successful seek to the object end must defer io.EOF to the + // subsequent read. + if !testCase.shouldCmp && testCase.err == nil && testCase.pos >= int64(bufSize) { + readN, readErr := r.Read(make([]byte, 1)) + if readN != 0 || readErr != io.EOF { + logError(testName, function, args, startTime, "", fmt.Sprintf("Test %d, read after seek to object end expected zero bytes and io.EOF, got %d bytes and %v", i+1, readN, readErr), readErr) + return + } + } } logSuccess(testName, function, args, startTime) @@ -6693,7 +7106,7 @@ func testSSES3EncryptedGetObjectReadSeekFunctional() { } if st.Size != int64(bufSize) { - logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(int64(bufSize))+", got "+string(st.Size), err) + logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+strconv.Itoa(bufSize)+", got "+strconv.FormatInt(st.Size, 10), err) return } @@ -6729,17 +7142,20 @@ func testSSES3EncryptedGetObjectReadSeekFunctional() { {0, 0, 0, nil, true, 0, 0}, // Start from offset 2048, fetch data and compare {2048, 0, 2048, nil, true, 2048, bufSize}, - // Start from offset larger than possible + // Start from offset larger than possible: Seek rejects it with io.EOF + // and keeps the offset unchanged. {int64(bufSize) + 1024, 0, 0, io.EOF, false, 0, 0}, // Move to offset 0 without comparing {0, 0, 0, nil, false, 0, 0}, // Move one step forward and compare {1, 1, 1, nil, true, 1, bufSize}, - // Move larger than possible + // Move larger than possible: Seek returns io.EOF. {int64(bufSize), 1, 0, io.EOF, false, 0, 0}, - // Provide negative offset with CUR_SEEK - {int64(-1), 1, 0, fmt.Errorf("Negative position not allowed for 1"), false, 0, 0}, - // Test with whence SEEK_END and with positive offset + // Provide negative offset with CUR_SEEK: valid since the resulting + // absolute position is within the object. + {int64(-1), 1, int64(bufSize) - 1, nil, false, 0, 0}, + // Test with whence SEEK_END and with positive offset: Seek returns + // io.EOF. {1024, 2, 0, io.EOF, false, 0, 0}, // Test with whence SEEK_END and with negative offset {-1024, 2, int64(bufSize) - 1024, nil, true, bufSize - 1024, bufSize}, @@ -6747,9 +7163,18 @@ func testSSES3EncryptedGetObjectReadSeekFunctional() { {-int64(bufSize) * 2, 2, 0, fmt.Errorf("Seeking at negative offset not allowed for 2"), false, 0, 0}, // Test with invalid whence {0, 3, 0, fmt.Errorf("Invalid whence 3"), false, 0, 0}, + // Seek to exactly the object end; the subsequent read reports io.EOF. + {0, 2, int64(bufSize), nil, false, 0, 0}, } for i, testCase := range testCases { + // Snapshot the cursor so rejected seeks can be asserted side-effect + // free. + prevPos, err := r.Seek(0, io.SeekCurrent) + if err != nil { + logError(testName, function, args, startTime, "", fmt.Sprintf("Test %d, reading the current position failed", i+1), err) + return + } // Perform seek operation n, err := r.Seek(testCase.offset, testCase.whence) if err != nil && testCase.err == nil { @@ -6771,6 +7196,12 @@ func testSSES3EncryptedGetObjectReadSeekFunctional() { fmt.Sprintf("Test %d, unexpected err value: expected: %s, found: %s", i+1, testCase.err, err), err) return } + // A rejected seek must leave the cursor unchanged. + curPos, cerr := r.Seek(0, io.SeekCurrent) + if cerr != nil || curPos != prevPos { + logError(testName, function, args, startTime, "", fmt.Sprintf("Test %d, cursor after rejected seek: expected %d, got %d", i+1, prevPos, curPos), cerr) + return + } } // Check the returned seek pos if n != testCase.pos { @@ -6782,6 +7213,15 @@ func testSSES3EncryptedGetObjectReadSeekFunctional() { if testCase.shouldCmp { cmpData(r, testCase.start, testCase.end) } + // A successful seek to the object end must defer io.EOF to the + // subsequent read. + if !testCase.shouldCmp && testCase.err == nil && testCase.pos >= int64(bufSize) { + readN, readErr := r.Read(make([]byte, 1)) + if readN != 0 || readErr != io.EOF { + logError(testName, function, args, startTime, "", fmt.Sprintf("Test %d, read after seek to object end expected zero bytes and io.EOF, got %d bytes and %v", i+1, readN, readErr), readErr) + return + } + } } logSuccess(testName, function, args, startTime) @@ -6879,7 +7319,7 @@ func testSSECEncryptedGetObjectReadAtFunctional() { } if st.Size != int64(bufSize) { - logError(testName, function, args, startTime, "", "Number of bytes in stat does not match, expected "+string(int64(bufSize))+", got "+string(st.Size), err) + logError(testName, function, args, startTime, "", "Number of bytes in stat does not match, expected "+strconv.Itoa(bufSize)+", got "+strconv.Itoa(int(st.Size)), err) return } @@ -8856,7 +9296,7 @@ func testGetObjectReadSeekFunctionalV2() { } if st.Size != int64(bufSize) { - logError(testName, function, args, startTime, "", "Number of bytes in stat does not match, expected "+string(int64(bufSize))+" got "+string(st.Size), err) + logError(testName, function, args, startTime, "", "Number of bytes in stat does not match, expected "+strconv.Itoa(bufSize)+" got "+strconv.FormatInt(st.Size, 10), err) return } @@ -8867,7 +9307,7 @@ func testGetObjectReadSeekFunctionalV2() { return } if n != offset { - logError(testName, function, args, startTime, "", "Number of seeked bytes does not match, expected "+string(offset)+" got "+string(n), err) + logError(testName, function, args, startTime, "", "Number of seeked bytes does not match, expected "+strconv.FormatInt(offset, 10)+" got "+strconv.FormatInt(n, 10), err) return } n, err = r.Seek(0, 1) @@ -8876,12 +9316,44 @@ func testGetObjectReadSeekFunctionalV2() { return } if n != offset { - logError(testName, function, args, startTime, "", "Number of seeked bytes does not match, expected "+string(offset)+" got "+string(n), err) + logError(testName, function, args, startTime, "", "Number of seeked bytes does not match, expected "+strconv.FormatInt(offset, 10)+" got "+strconv.FormatInt(n, 10), err) return } - _, err = r.Seek(offset, 2) - if err == nil { - logError(testName, function, args, startTime, "", "Seek on positive offset for whence '2' should error out", err) + // Seeking past the object end with SEEK_END is rejected with io.EOF and + // leaves the offset unchanged. + n, err = r.Seek(offset, 2) + if err != io.EOF { + logError(testName, function, args, startTime, "", "Seek past object end should return io.EOF", err) + return + } + if n != 0 { + logError(testName, function, args, startTime, "", "Seek past object end should return offset 0, got "+strconv.FormatInt(n, 10), err) + return + } + // A rejected seek must leave the cursor unchanged. + n, err = r.Seek(0, 1) + if err != nil { + logError(testName, function, args, startTime, "", "Seek failed", err) + return + } + if n != offset { + logError(testName, function, args, startTime, "", "Cursor moved after rejected seek, expected "+strconv.FormatInt(offset, 10)+" got "+strconv.FormatInt(n, 10), err) + return + } + // Seeking to exactly the object end succeeds; the subsequent read reports + // io.EOF. + n, err = r.Seek(0, 2) + if err != nil { + logError(testName, function, args, startTime, "", "Seek failed", err) + return + } + if n != st.Size { + logError(testName, function, args, startTime, "", "Number of seeked bytes does not match, expected "+strconv.FormatInt(st.Size, 10)+" got "+strconv.FormatInt(n, 10), err) + return + } + readN, readErr := r.Read(make([]byte, 1)) + if readN != 0 || readErr != io.EOF { + logError(testName, function, args, startTime, "", "Read after seeking to object end should return zero bytes and EOF", readErr) return } n, err = r.Seek(-offset, 2) @@ -8890,7 +9362,7 @@ func testGetObjectReadSeekFunctionalV2() { return } if n != st.Size-offset { - logError(testName, function, args, startTime, "", "Number of seeked bytes does not match, expected "+string(st.Size-offset)+" got "+string(n), err) + logError(testName, function, args, startTime, "", "Number of seeked bytes does not match, expected "+strconv.FormatInt(st.Size-offset, 10)+" got "+strconv.FormatInt(n, 10), err) return } @@ -8913,7 +9385,7 @@ func testGetObjectReadSeekFunctionalV2() { return } if n != (offset - 1) { - logError(testName, function, args, startTime, "", "Number of seeked bytes does not match, expected "+string(offset-1)+" got "+string(n), err) + logError(testName, function, args, startTime, "", "Number of seeked bytes does not match, expected "+strconv.FormatInt(offset-1, 10)+" got "+strconv.FormatInt(n, 10), err) return } @@ -13747,6 +14219,288 @@ func testListObjects() { testList(c.ListObjects, bucketName, minio.ListObjectsOptions{Recursive: true, UseV1: true}) testList(c.ListObjects, bucketName, minio.ListObjectsOptions{Recursive: true}) testList(c.ListObjects, bucketName, minio.ListObjectsOptions{Recursive: true, WithMetadata: true}) + // Servers that do not implement x-amz-optional-object-attributes must + // still return a normal listing. + testList(c.ListObjects, bucketName, minio.ListObjectsOptions{Recursive: true, WithRestoreStatus: true}) + + logSuccess(testName, function, args, startTime) +} + +// Tests that listing reports the checksum an object was stored with in the +// same ObjectInfo fields on every list API. S3 returns the algorithm and the +// mode for every object that has a checksum, without a value; AiStor also +// returns the value when listing with WithMetadata. Servers differ in which +// list APIs carry the information, so this only requires that whatever comes +// back is correct and covers the whole listing. +func testListObjectsChecksums() { + // initialize logging params + startTime := time.Now() + testName := getFuncName() + function := "ListObjects(bucketName, opts)" + args := map[string]interface{}{ + "bucketName": "", + "opts": "minio.ListObjectsOptions{}", + } + + if !isFullMode() { + logIgnored(testName, function, args, startTime, "Skipping functional tests for short/quick runs") + return + } + + c, err := NewClient(ClientConfig{TrailingHeaders: true}) + if err != nil { + logError(testName, function, args, startTime, "", "MinIO client object creation failed", err) + return + } + + // Generate a new random bucket name. + bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-") + args["bucketName"] = bucketName + + // Make a new bucket. + err = c.MakeBucket(context.Background(), bucketName, minio.MakeBucketOptions{Region: "us-east-1"}) + if err != nil { + logError(testName, function, args, startTime, "", "Make bucket failed", err) + return + } + + defer cleanupVersionedBucket(bucketName, c) + + err = c.EnableVersioning(context.Background(), bucketName) + if err != nil { + logError(testName, function, args, startTime, "", "Enable versioning failed", err) + return + } + + type expect struct { + cs minio.ChecksumType + mode string + value string // empty when the value is unknown to the test + } + want := map[string]expect{} + + // One single part object per algorithm, all of them full object checksums. + b, err := io.ReadAll(getDataReader("datafile-10-kB")) + if err != nil { + logError(testName, function, args, startTime, "", "Read failed", err) + return + } + for _, cs := range []minio.ChecksumType{ + minio.ChecksumCRC32, minio.ChecksumCRC32C, minio.ChecksumSHA1, minio.ChecksumSHA256, + minio.ChecksumCRC64NVME, minio.ChecksumMD5, minio.ChecksumSHA512, + minio.ChecksumXXHash64, minio.ChecksumXXHash3, minio.ChecksumXXHash128, + } { + if os.Getenv("MINT_NO_FULL_OBJECT") != "" && cs.FullObjectRequested() { + continue + } + objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "") + _, err = c.PutObject(context.Background(), bucketName, objectName, bytes.NewReader(b), int64(len(b)), + minio.PutObjectOptions{DisableMultipart: true, Checksum: cs}) + if err != nil { + if ignore2026ChecksumError(cs, err) { + logIgnored(testName, function, args, startTime, "server does not support "+cs.String()) + continue + } + logError(testName, function, args, startTime, "", "PutObject failed", err) + return + } + want[objectName] = expect{ + cs: cs, + mode: minio.ChecksumFullObjectMode.String(), + value: cs.ChecksumBytes(b).Encoded(), + } + } + + // A multipart upload with a non-CRC algorithm gets a composite checksum, + // the only case where the mode differs from the objects above. + mpBuf, err := io.ReadAll(getDataReader("datafile-11-MB")) + if err != nil { + logError(testName, function, args, startTime, "", "Read failed", err) + return + } + objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "") + mpInfo, err := c.PutObject(context.Background(), bucketName, objectName, bytes.NewReader(mpBuf), int64(len(mpBuf)), + minio.PutObjectOptions{PartSize: 5 * humanize.MiByte, Checksum: minio.ChecksumSHA256}) + if err != nil { + logError(testName, function, args, startTime, "", "PutObject failed", err) + return + } + want[objectName] = expect{ + cs: minio.ChecksumSHA256, + mode: minio.ChecksumCompositeMode.String(), + value: mpInfo.ChecksumSHA256, + } + + for _, opts := range []minio.ListObjectsOptions{ + {Recursive: true}, + {Recursive: true, UseV1: true}, + {Recursive: true, WithVersions: true}, + {Recursive: true, WithMetadata: true}, + } { + args["opts"] = opts + var listed, withAlgorithm, withValue int + for objInfo := range c.ListObjects(context.Background(), bucketName, opts) { + if objInfo.Err != nil { + logError(testName, function, args, startTime, "", "ListObjects failed", objInfo.Err) + return + } + exp, ok := want[objInfo.Key] + if !ok { + logError(testName, function, args, startTime, "", "ListObjects returned an unknown object", fmt.Errorf("key %s", objInfo.Key)) + return + } + listed++ + if objInfo.ChecksumAlgorithm != "" { + withAlgorithm++ + if objInfo.ChecksumAlgorithm != exp.cs.String() { + logError(testName, function, args, startTime, "", "ListObjects returned a wrong checksum algorithm", + fmt.Errorf("%s: want %s, got %s", objInfo.Key, exp.cs, objInfo.ChecksumAlgorithm)) + return + } + } + if objInfo.ChecksumMode != "" && objInfo.ChecksumMode != exp.mode { + logError(testName, function, args, startTime, "", "ListObjects returned a wrong checksum mode", + fmt.Errorf("%s: want %s, got %s", objInfo.Key, exp.mode, objInfo.ChecksumMode)) + return + } + if got := objInfo.Checksum(exp.cs); got != "" { + withValue++ + // A value always names its algorithm, the client derives it + // when the server does not report one. + if objInfo.ChecksumAlgorithm == "" { + logError(testName, function, args, startTime, "", "ListObjects returned a checksum value without an algorithm", + fmt.Errorf("key %s", objInfo.Key)) + return + } + if exp.value != "" && got != exp.value { + logError(testName, function, args, startTime, "", "ListObjects returned a wrong checksum value", + fmt.Errorf("%s: want %s, got %s", objInfo.Key, exp.value, got)) + return + } + } + } + if listed != len(want) { + logError(testName, function, args, startTime, "", "ListObjects returned an unexpected number of objects", + fmt.Errorf("want %d, got %d", len(want), listed)) + return + } + // Not every server reports checksums on every list API, but whatever + // it does report has to cover the whole listing rather than only the + // algorithms it happened to support first. + if withAlgorithm != 0 && withAlgorithm != listed { + logError(testName, function, args, startTime, "", "ListObjects returned checksum algorithms for some objects only", + fmt.Errorf("%d of %d objects carried an algorithm", withAlgorithm, listed)) + return + } + if withValue != 0 && withValue != listed { + logError(testName, function, args, startTime, "", "ListObjects returned checksum values for some objects only", + fmt.Errorf("%d of %d objects carried a value", withValue, listed)) + return + } + } + + logSuccess(testName, function, args, startTime) +} + +// Tests unsorted listing of objects. +func testListUnsorted() { + // initialize logging params + startTime := time.Now() + testName := getFuncName() + function := "ListUnsorted(bucketName, opts)" + args := map[string]interface{}{ + "bucketName": "", + "objectPrefix": "", + "recursive": "true", + } + + c, err := NewClient(ClientConfig{}) + if err != nil { + logError(testName, function, args, startTime, "", "MinIO client v4 object creation failed", err) + return + } + + // Generate a new random bucket name. + bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-") + args["bucketName"] = bucketName + + // Make a new bucket. + err = c.MakeBucket(context.Background(), bucketName, minio.MakeBucketOptions{Region: "us-east-1"}) + if err != nil { + logError(testName, function, args, startTime, "", "MakeBucket failed", err) + return + } + + defer cleanupBucket(bucketName, c) + + expected := make(map[string]struct{}) + for i := 0; i < 10; i++ { + objectName := fmt.Sprintf("unsorted/object-%d", i) + bufSize := dataFileMap["datafile-1-b"] + reader := getDataReader("datafile-1-b") + defer reader.Close() + _, err = c.PutObject(context.Background(), bucketName, objectName, reader, int64(bufSize), + minio.PutObjectOptions{ + ContentType: "binary/octet-stream", + UserMetadata: map[string]string{"Marker": "unsorted"}, + }) + if err != nil { + logError(testName, function, args, startTime, "", fmt.Sprintf("PutObject %d call failed", i+1), err) + return + } + expected[objectName] = struct{}{} + } + + testList := func(opts minio.ListObjectsOptions, wantMetadata bool) { + found := make(map[string]struct{}) + for objInfo := range c.ListUnsorted(context.Background(), bucketName, opts) { + if objInfo.Err != nil { + logError(testName, function, args, startTime, "", "ListUnsorted failed unexpectedly", objInfo.Err) + return + } + if _, ok := expected[objInfo.Key]; !ok { + logError(testName, function, args, startTime, "", "ListUnsorted returned an unexpected object "+objInfo.Key, errors.New("unexpected object")) + return + } + if wantMetadata && objInfo.UserMetadataStripped["Marker"] != "unsorted" { + logError(testName, function, args, startTime, "", "ListUnsorted did not return the user metadata of "+objInfo.Key, errors.New("missing user metadata")) + return + } + found[objInfo.Key] = struct{}{} + } + if len(found) != len(expected) { + logError(testName, function, args, startTime, "", "ListUnsorted returned unexpected number of items", errors.New("missing objects")) + return + } + } + + testList(minio.ListObjectsOptions{Prefix: "unsorted/", Recursive: true}, false) + // MaxKeys smaller than the number of objects exercises the positional + // continuation token of an unsorted listing. + testList(minio.ListObjectsOptions{Prefix: "unsorted/", Recursive: true, MaxKeys: 3}, false) + testList(minio.ListObjectsOptions{Prefix: "unsorted/", Recursive: true, WithMetadata: true}, true) + + // Unsorted listing is only supported on ListObjects V2 and has no key + // ordering to start after. + rejected := []minio.ListObjectsOptions{ + {Recursive: true, UseV1: true}, + {Recursive: true, WithVersions: true}, + {Recursive: true, StartAfter: "unsorted/object-1"}, + } + for _, opts := range rejected { + var gotErr error + for objInfo := range c.ListUnsorted(context.Background(), bucketName, opts) { + if objInfo.Err == nil { + logError(testName, function, args, startTime, "", "ListUnsorted returned an object for an unsupported option", errors.New("expected error")) + return + } + gotErr = objInfo.Err + } + if minio.ToErrorResponse(gotErr).Code != minio.InvalidArgument { + logError(testName, function, args, startTime, "", "ListUnsorted did not reject an unsupported option with InvalidArgument", gotErr) + return + } + } logSuccess(testName, function, args, startTime) } @@ -15084,6 +15838,7 @@ func main() { testMakeBucketError() testMakeBucketRegions() testPutObjectWithMetadata() + testGetObjectWithRange() testPutObjectReadAt() testPutObjectStreaming() testPutObjectPreconditionOnNonExistent() @@ -15119,9 +15874,12 @@ func main() { testStorageClassMetadataCopyObject() testPutObjectWithContentLanguage() testListObjects() + testListObjectsChecksums() + testListUnsorted() testRemoveObjects() testRemoveObjectsIter() testListObjectVersions() + testStatObjectResponseHeaders() testStatObjectWithVersioning() testGetObjectWithVersioning() testCopyObjectWithVersioning() diff --git a/vendor/github.com/minio/minio-go/v7/hook-reader.go b/vendor/github.com/minio/minio-go/v7/hook-reader.go index 06dbbb74d70..0d78e9afff4 100644 --- a/vendor/github.com/minio/minio-go/v7/hook-reader.go +++ b/vendor/github.com/minio/minio-go/v7/hook-reader.go @@ -25,22 +25,31 @@ import ( // hookReader hooks additional reader in the source stream. It is // useful for making progress bars. Second reader is appropriately // notified about the exact number of bytes read from the primary -// source on each Read operation. +// source on each Read operation. It deliberately implements neither +// io.Seeker nor io.Closer: retry logic treats a seekable body as +// rewindable, and executeMethod closes request bodies that implement +// io.Closer — a caller-supplied reader must be shielded from both. type hookReader struct { source io.Reader hook io.Reader } +// hookReadSeeker extends hookReader with seeking support. It is +// constructed only when the source implements io.Seeker, so a wrapped +// reader exposes Seek if and only if it can actually rewind. This lets +// retry logic disable retries for non-seekable bodies instead of +// retrying over a drained reader. +type hookReadSeeker struct { + hookReader + seeker io.Seeker +} + // Seek implements io.Seeker. Seeks source first, and if necessary // seeks hook if Seek method is appropriately found. -func (hr *hookReader) Seek(offset int64, whence int) (n int64, err error) { - // Verify for source has embedded Seeker, use it. - sourceSeeker, ok := hr.source.(io.Seeker) - if ok { - n, err = sourceSeeker.Seek(offset, whence) - if err != nil { - return 0, err - } +func (hr *hookReadSeeker) Seek(offset int64, whence int) (n int64, err error) { + n, err = hr.seeker.Seek(offset, whence) + if err != nil { + return 0, err } if hr.hook != nil { @@ -53,7 +62,7 @@ func (hr *hookReader) Seek(offset int64, whence int) (n int64, err error) { return 0, err } if n != m { - return 0, fmt.Errorf("hook seeker seeked %d bytes, expected source %d bytes", m, n) + return 0, fmt.Errorf("hook seeker sought to offset %d, expected source offset %d", m, n) } } } @@ -80,14 +89,13 @@ func (hr *hookReader) Read(b []byte) (n int, err error) { return n, err } -// newHook returns a io.ReadSeeker which implements hookReader that -// reports the data read from the source to the hook. +// newHook returns an io.Reader that reports the data read from the +// source to the hook. The returned reader implements io.Seeker only +// when the source does. func newHook(source, hook io.Reader) io.Reader { - if hook == nil { - return &hookReader{source: source} - } - return &hookReader{ - source: source, - hook: hook, + hr := hookReader{source: source, hook: hook} + if seeker, ok := source.(io.Seeker); ok { + return &hookReadSeeker{hookReader: hr, seeker: seeker} } + return &hr } diff --git a/vendor/github.com/minio/minio-go/v7/pkg/credentials/assume_role.go b/vendor/github.com/minio/minio-go/v7/pkg/credentials/assume_role.go index 415b0709520..dfff9c120c7 100644 --- a/vendor/github.com/minio/minio-go/v7/pkg/credentials/assume_role.go +++ b/vendor/github.com/minio/minio-go/v7/pkg/credentials/assume_role.go @@ -19,6 +19,7 @@ package credentials import ( "bytes" + "context" "crypto/sha256" "encoding/hex" "encoding/xml" @@ -98,7 +99,7 @@ type STSAssumeRoleOptions struct { Policy string // Optional to assign a policy to the assumed role Location string // Optional commonly needed with AWS STS. - DurationSeconds int // Optional defaults to 1 hour. + DurationSeconds int // Optional, omitted when zero so the server applies its default. // Optional only valid if using with AWS STS RoleARN string @@ -120,8 +121,6 @@ func NewSTSAssumeRole(stsEndpoint string, opts STSAssumeRoleOptions) (*Credentia }), nil } -const defaultDurationSeconds = 3600 - // closeResponse close non nil response with any response Body. // convenient wrapper to drain any remaining data on response body. // @@ -142,7 +141,7 @@ func closeResponse(resp *http.Response) { } } -func getAssumeRoleCredentials(clnt *http.Client, endpoint string, opts STSAssumeRoleOptions) (AssumeRoleResponse, error) { +func getAssumeRoleCredentials(ctx context.Context, clnt *http.Client, endpoint string, opts STSAssumeRoleOptions) (AssumeRoleResponse, error) { v := url.Values{} v.Set("Action", "AssumeRole") v.Set("Version", STSVersion) @@ -152,10 +151,8 @@ func getAssumeRoleCredentials(clnt *http.Client, endpoint string, opts STSAssume if opts.RoleSessionName != "" { v.Set("RoleSessionName", opts.RoleSessionName) } - if opts.DurationSeconds > defaultDurationSeconds { + if opts.DurationSeconds != 0 { v.Set("DurationSeconds", strconv.Itoa(opts.DurationSeconds)) - } else { - v.Set("DurationSeconds", strconv.Itoa(defaultDurationSeconds)) } if opts.Policy != "" { v.Set("Policy", opts.Policy) @@ -180,7 +177,7 @@ func getAssumeRoleCredentials(clnt *http.Client, endpoint string, opts STSAssume } postBody.Seek(0, 0) - req, err := http.NewRequest(http.MethodPost, u.String(), postBody) + req, err := http.NewRequestWithContext(ctx, http.MethodPost, u.String(), postBody) if err != nil { return AssumeRoleResponse{}, err } @@ -245,7 +242,7 @@ func (m *STSAssumeRole) RetrieveWithCredContext(cc *CredContext) (Value, error) return Value{}, errors.New("STS endpoint unknown") } - a, err := getAssumeRoleCredentials(client, stsEndpoint, m.Options) + a, err := getAssumeRoleCredentials(cc.requestContext(), client, stsEndpoint, m.Options) if err != nil { return Value{}, err } diff --git a/vendor/github.com/minio/minio-go/v7/pkg/credentials/credentials-sso.sample b/vendor/github.com/minio/minio-go/v7/pkg/credentials/credentials-sso.sample new file mode 100644 index 00000000000..46af924b30a --- /dev/null +++ b/vendor/github.com/minio/minio-go/v7/pkg/credentials/credentials-sso.sample @@ -0,0 +1,57 @@ +[profile p1] +sso_session = main +sso_account_id = 123456789 +sso_role_name = myrole + +[sso-session main] +sso_region = us-test-2 +sso_start_url = https://testacct.awsapps.com/start + +[profile p2-legacy] +sso_start_url = https://legacy.awsapps.com/start +sso_region = us-test-1 +sso_account_id = 987654321 +sso_role_name = legacyrole + +[profile p3-broken] +sso_account_id = 111111111 +sso_role_name = brokenrole + +[profile p4-noregion] +sso_start_url = https://noregion.awsapps.com/start +sso_account_id = 222222222 +sso_role_name = noregionrole + +[profile p5-ghost-session] +sso_session = ghost +sso_account_id = 333333333 +sso_role_name = ghostrole + +[profile p6-norole] +sso_start_url = https://norole.awsapps.com/start +sso_region = us-test-1 +sso_account_id = 444444444 + +[profile p7-noaccount] +sso_session = main +sso_role_name = noaccountrole + +[profile p8-mixed] +sso_start_url = https://mixed.awsapps.com/start +aws_access_key_id = mixedAccessKey +aws_secret_access_key = mixedSecret + +[profile p9-mixed-complete] +sso_session = main +sso_account_id = 555555555 +sso_role_name = mixedcompleterole +aws_access_key_id = completeAccessKey +aws_secret_access_key = completeSecret + +[profile p10-partial-key] +sso_start_url = https://partial.awsapps.com/start +aws_access_key_id = partialAccessKey + +[profile p11-partial-secret] +sso_session = main +aws_secret_access_key = partialSecret diff --git a/vendor/github.com/minio/minio-go/v7/pkg/credentials/credentials.go b/vendor/github.com/minio/minio-go/v7/pkg/credentials/credentials.go index 52aff9a57f6..dfc25c072a3 100644 --- a/vendor/github.com/minio/minio-go/v7/pkg/credentials/credentials.go +++ b/vendor/github.com/minio/minio-go/v7/pkg/credentials/credentials.go @@ -18,6 +18,7 @@ package credentials import ( + "context" "net/http" "sync" "time" @@ -85,6 +86,21 @@ type CredContext struct { // Endpoint specifies the MinIO endpoint that will be used if no // explicit endpoint is provided. Endpoint string + + // Context is the optional caller context. Cancellation and deadlines + // on it propagate to the HTTP requests the built-in providers make + // to fetch credentials, in addition to any provider-level timeout + // bound. A nil Context means no caller cancellation applies. + Context context.Context +} + +// requestContext returns the caller context carried by cc, or +// context.Background() when no Context is set. +func (cc *CredContext) requestContext() context.Context { + if cc.Context == nil { + return context.Background() + } + return cc.Context } // A Expiry provides shared expiration logic to be used by credentials diff --git a/vendor/github.com/minio/minio-go/v7/pkg/credentials/file_aws_credentials.go b/vendor/github.com/minio/minio-go/v7/pkg/credentials/file_aws_credentials.go index 2d0336f92ec..204bcfa2b1a 100644 --- a/vendor/github.com/minio/minio-go/v7/pkg/credentials/file_aws_credentials.go +++ b/vendor/github.com/minio/minio-go/v7/pkg/credentials/file_aws_credentials.go @@ -18,8 +18,15 @@ package credentials import ( + "context" + "crypto/sha1" + "encoding/hex" "encoding/json" "errors" + "fmt" + "io" + "io/fs" + "net/http" "os" "os/exec" "path/filepath" @@ -29,7 +36,10 @@ import ( "gopkg.in/ini.v1" ) -// A externalProcessCredentials stores the output of a credential_process +// ssoPortalRequestTimeout bounds the AWS SSO portal role-credentials request. +const ssoPortalRequestTimeout = time.Minute + +// An externalProcessCredentials stores the output of a credential_process type externalProcessCredentials struct { Version int SessionToken string @@ -38,6 +48,34 @@ type externalProcessCredentials struct { Expiration time.Time } +// An ssoCredentials stores the response of fetching role credentials for +// an AWS SSO role from the SSO portal. +type ssoCredentials struct { + RoleCredentials ssoRoleCredentials `json:"roleCredentials"` +} + +// An ssoRoleCredentials stores the role-specific credentials portion of +// an SSO role credentials response. Expiration is milliseconds since +// the Unix epoch. +type ssoRoleCredentials struct { + AccessKeyID string `json:"accessKeyId"` + Expiration int64 `json:"expiration"` + SecretAccessKey string `json:"secretAccessKey"` + SessionToken string `json:"sessionToken"` +} + +func (s ssoRoleCredentials) expirationTime() time.Time { + return time.Unix(0, s.Expiration*int64(time.Millisecond)) +} + +// ssoCachedToken is the subset of the cached token file written by +// `aws sso login` under ~/.aws/sso/cache/ that we need. +type ssoCachedToken struct { + AccessToken string `json:"accessToken"` + ExpiresAt time.Time `json:"expiresAt"` + Region string `json:"region"` +} + // A FileAWSCredentials retrieves credentials from the current user's home // directory, and keeps track if those credentials are expired. // @@ -47,10 +85,15 @@ type FileAWSCredentials struct { // Path to the shared credentials file. // - // If empty will look for "AWS_SHARED_CREDENTIALS_FILE" env variable. If the - // env value is empty will default to current user's home directory. - // Linux/OSX: "$HOME/.aws/credentials" - // Windows: "%USERPROFILE%\.aws\credentials" + // If empty, the default AWS files are merged instead: the AWS config + // file ("AWS_CONFIG_FILE" env variable or "$HOME/.aws/config") loaded + // first, then the shared credentials file + // ("AWS_SHARED_CREDENTIALS_FILE" env variable or + // "$HOME/.aws/credentials") overriding matching keys, the same + // resolution the AWS SDK uses. Profiles written by `aws configure sso` + // live in the config file and are discovered this way. + // + // If set, only this one file is read. Filename string // AWS Profile to extract credentials from the shared credentials file. If empty @@ -60,6 +103,14 @@ type FileAWSCredentials struct { // retrieved states if the credentials have been successfully retrieved. retrieved bool + + // overrideSSOCacheDir overrides, for tests, the directory holding the + // cached SSO tokens (defaults to ~/.aws/sso/cache). + overrideSSOCacheDir string + + // overrideSSOPortalURL overrides, for tests, the AWS SSO portal URL + // serving role credentials. + overrideSSOPortalURL string } // NewFileAWSCredentials returns a pointer to a new Credentials object @@ -71,27 +122,27 @@ func NewFileAWSCredentials(filename, profile string) *Credentials { }) } -func (p *FileAWSCredentials) retrieve() (Value, error) { - if p.Filename == "" { - p.Filename = os.Getenv("AWS_SHARED_CREDENTIALS_FILE") - if p.Filename == "" { - homeDir, err := os.UserHomeDir() - if err != nil { - return Value{}, err - } - p.Filename = filepath.Join(homeDir, ".aws", "credentials") - } - } - if p.Profile == "" { - p.Profile = os.Getenv("AWS_PROFILE") - if p.Profile == "" { - p.Profile = "default" +func (p *FileAWSCredentials) retrieve(cc *CredContext) (Value, error) { + profile := p.Profile + if profile == "" { + profile = os.Getenv("AWS_PROFILE") + if profile == "" { + profile = "default" } } p.retrieved = false - iniProfile, err := loadProfile(p.Filename, p.Profile) + var ( + iniConfig *ini.File + iniProfile *ini.Section + err error + ) + if p.Filename != "" { + iniConfig, iniProfile, err = loadProfile(p.Filename, profile) + } else { + iniConfig, iniProfile, err = loadDefaultProfiles(profile) + } if err != nil { return Value{}, err } @@ -103,10 +154,53 @@ func (p *FileAWSCredentials) retrieve() (Value, error) { // Default to empty string if not found. token := iniProfile.Key("aws_session_token") - // If credential_process is defined, obtain credentials by executing - // the external process + // A complete static key pair takes precedence over SSO configuration + // and credential_process in the same profile, matching aws-sdk-go-v2's + // resolution order: static credentials, then SSO, then + // credential_process. + hasStaticKeys := id.String() != "" && secret.String() != "" + + // Exactly one half of a static key pair is never usable and poisons + // downstream consumers — Chain accepts a Value when either field is + // set — so it is rejected before any resolution, matching + // aws-sdk-go-v2's partial-credentials validation. + if !hasStaticKeys && (id.String() != "" || secret.String() != "") { + return Value{}, errors.New("profile has partial static credentials: aws_access_key_id and aws_secret_access_key must both be set") + } + + // If the profile is configured for AWS SSO, obtain credentials from the + // token cached by `aws sso login`. + if !hasStaticKeys && iniProfile.Key("sso_role_name").String() != "" { + ssoCreds, err := p.getSSOCredentials(cc, iniConfig, iniProfile) + if err != nil { + return Value{}, err + } + expiration := ssoCreds.RoleCredentials.expirationTime() + p.retrieved = true + p.SetExpiration(expiration, DefaultExpiryWindow) + return Value{ + AccessKeyID: ssoCreds.RoleCredentials.AccessKeyID, + SecretAccessKey: ssoCreds.RoleCredentials.SecretAccessKey, + SessionToken: ssoCreds.RoleCredentials.SessionToken, + Expiration: expiration, + SignerType: SignatureV4, + }, nil + } + + // A profile carrying SSO configuration without sso_role_name cannot + // engage the SSO flow above; without a complete static key pair the + // values below would be anonymous. + if !hasStaticKeys && + (iniProfile.Key("sso_session").String() != "" || iniProfile.Key("sso_start_url").String() != "" || + iniProfile.Key("sso_account_id").String() != "" || iniProfile.Key("sso_region").String() != "") { + return Value{}, errors.New("profile has SSO configuration but no sso_role_name, and no complete static credentials") + } + + // If credential_process is defined, obtain credentials by executing the + // external process. Static credentials and SSO in the same profile both + // take precedence over it, matching aws-sdk-go-v2. credentialProcess := strings.TrimSpace(iniProfile.Key("credential_process").String()) - if credentialProcess != "" { + if !hasStaticKeys && credentialProcess != "" { args := strings.Fields(credentialProcess) if len(args) <= 1 { return Value{}, errors.New("invalid credential process args") @@ -131,6 +225,7 @@ func (p *FileAWSCredentials) retrieve() (Value, error) { SignerType: SignatureV4, }, nil } + p.retrieved = true return Value{ AccessKeyID: id.String(), @@ -140,28 +235,319 @@ func (p *FileAWSCredentials) retrieve() (Value, error) { }, nil } +// getSSOCredentials fetches role credentials for an SSO-configured profile +// from the AWS SSO portal, using the access token cached by `aws sso login`. +func (p *FileAWSCredentials) getSSOCredentials(cc *CredContext, iniConfig *ini.File, iniProfile *ini.Section) (ssoCredentials, error) { + ssoAccountID := iniProfile.Key("sso_account_id").String() + ssoRoleName := iniProfile.Key("sso_role_name").String() + if ssoAccountID == "" { + return ssoCredentials{}, errors.New("profile defines sso_role_name but no sso_account_id") + } + + // Modern config: the profile references an [sso-session ] section + // and the cached token file is named after the SHA1 of the session name. + // Legacy config: sso_start_url/sso_region live directly on the profile + // and the cached token file is named after the SHA1 of the start URL. + ssoSessionName := iniProfile.Key("sso_session").String() + cacheKey := ssoSessionName + ssoRegion := iniProfile.Key("sso_region").String() + if ssoSessionName != "" { + if sessionSection, err := iniConfig.GetSection("sso-session " + ssoSessionName); err == nil { + // aws-sdk-go-v2 rejects profile sso_region/sso_start_url + // values that contradict the sso-session; guessing between + // the two could silently query the wrong portal. + if region := sessionSection.Key("sso_region").String(); region != "" { + if ssoRegion != "" && ssoRegion != region { + return ssoCredentials{}, fmt.Errorf("sso_region %q in profile must match sso_region %q in sso-session %q", ssoRegion, region, ssoSessionName) + } + ssoRegion = region + } + if sessionStartURL := sessionSection.Key("sso_start_url").String(); sessionStartURL != "" { + if profileStartURL := iniProfile.Key("sso_start_url").String(); profileStartURL != "" && profileStartURL != sessionStartURL { + return ssoCredentials{}, fmt.Errorf("sso_start_url %q in profile must match sso_start_url %q in sso-session %q", profileStartURL, sessionStartURL, ssoSessionName) + } + } + } + } else { + startURL := iniProfile.Key("sso_start_url").String() + if startURL == "" { + return ssoCredentials{}, errors.New("profile defines sso_role_name but neither sso_session nor sso_start_url") + } + cacheKey = startURL + } + + hash := sha1.Sum([]byte(cacheKey)) + cachedTokenFilename := hex.EncodeToString(hash[:]) + ".json" + + cacheDir := p.overrideSSOCacheDir + if cacheDir == "" { + homeDir, err := os.UserHomeDir() + if err != nil { + return ssoCredentials{}, fmt.Errorf("getting home dir: %w", err) + } + cacheDir = filepath.Join(homeDir, ".aws", "sso", "cache") + } + cachedTokenPath := filepath.Join(cacheDir, cachedTokenFilename) + cachedTokenRaw, err := os.ReadFile(cachedTokenPath) + if err != nil { + return ssoCredentials{}, fmt.Errorf("reading cached SSO token %q (try `aws sso login`): %w", cachedTokenPath, err) + } + + var cachedToken ssoCachedToken + if err := json.Unmarshal(cachedTokenRaw, &cachedToken); err != nil { + return ssoCredentials{}, fmt.Errorf("parsing cached SSO token %q: %w", cachedTokenPath, err) + } + now := time.Now + if p.CurrentTime != nil { + now = p.CurrentTime + } + if cachedToken.ExpiresAt.Before(now()) { + return ssoCredentials{}, errors.New("cached SSO token is expired, refresh it with `aws sso login`") + } + + if ssoRegion == "" { + ssoRegion = cachedToken.Region + } + if ssoRegion == "" { + return ssoCredentials{}, errors.New("unable to determine AWS SSO region from profile, sso-session or cached token") + } + + portalURL := p.overrideSSOPortalURL + if portalURL == "" { + portalURL = ssoPortalBaseURL(ssoRegion) + } + if cc == nil { + cc = defaultCredContext + } + ctx, cancel := context.WithTimeout(cc.requestContext(), ssoPortalRequestTimeout) + defer cancel() + req, err := http.NewRequestWithContext(ctx, http.MethodGet, portalURL+"/federation/credentials", nil) + if err != nil { + return ssoCredentials{}, fmt.Errorf("creating SSO role credentials request: %w", err) + } + req.Header.Set("x-amz-sso_bearer_token", cachedToken.AccessToken) + query := req.URL.Query() + query.Add("account_id", ssoAccountID) + query.Add("role_name", ssoRoleName) + req.URL.RawQuery = query.Encode() + + client := cc.Client + if client == nil { + client = defaultCredContext.Client + } + resp, err := client.Do(req) + if err != nil { + return ssoCredentials{}, fmt.Errorf("fetching SSO role credentials: %w", err) + } + defer resp.Body.Close() + if resp.StatusCode != http.StatusOK { + body, _ := io.ReadAll(io.LimitReader(resp.Body, 4<<10)) + return ssoCredentials{}, fmt.Errorf("fetching SSO role credentials: %s: %s", resp.Status, strings.TrimSpace(string(body))) + } + + var ssoCreds ssoCredentials + if err := json.NewDecoder(io.LimitReader(resp.Body, 1<<20)).Decode(&ssoCreds); err != nil { + return ssoCredentials{}, fmt.Errorf("parsing SSO role credentials response: %w", err) + } + if ssoCreds.RoleCredentials.AccessKeyID == "" || ssoCreds.RoleCredentials.SecretAccessKey == "" { + return ssoCredentials{}, errors.New("SSO portal returned empty role credentials") + } + return ssoCreds, nil +} + +// ssoPortalBaseURL returns the AWS SSO portal endpoint for region. The DNS +// suffix follows the region's AWS partition per aws-sdk-go-v2 endpoint +// metadata; regions of unlisted partitions, including aws-us-gov, use the +// standard amazonaws.com suffix. +func ssoPortalBaseURL(region string) string { + suffix := "amazonaws.com" + switch { + case strings.HasPrefix(region, "cn-"): + suffix = "amazonaws.com.cn" + case strings.HasPrefix(region, "us-iso-"): + suffix = "c2s.ic.gov" + case strings.HasPrefix(region, "us-isob-"): + suffix = "sc2s.sgov.gov" + case strings.HasPrefix(region, "eu-isoe-"): + suffix = "cloud.adc-e.uk" + case strings.HasPrefix(region, "us-isof-"): + suffix = "csp.hci.ic.gov" + case strings.HasPrefix(region, "eusc-"): + suffix = "amazonaws.eu" + } + return fmt.Sprintf("https://portal.sso.%s.%s", region, suffix) +} + // Retrieve reads and extracts the shared credentials from the current // users home directory. +// +// Deprecated: Retrieve() exists for historical compatibility and should not +// be used. To get new credentials use the RetrieveWithCredContext function. func (p *FileAWSCredentials) Retrieve() (Value, error) { - return p.retrieve() + return p.retrieve(nil) } -// RetrieveWithCredContext is like Retrieve(), cred context is no-op for File credentials -func (p *FileAWSCredentials) RetrieveWithCredContext(_ *CredContext) (Value, error) { - return p.retrieve() +// RetrieveWithCredContext retrieves credentials from the file like Retrieve, +// using the context's HTTP client for any SSO portal call. +func (p *FileAWSCredentials) RetrieveWithCredContext(cc *CredContext) (Value, error) { + return p.retrieve(cc) } -// loadProfiles loads from the file pointed to by shared credentials filename for profile. +// loadProfile loads from the file pointed to by shared credentials filename for profile. // The credentials retrieved from the profile will be returned or error. Error will be // returned if it fails to read from the file, or the data is invalid. -func loadProfile(filename, profile string) (*ini.Section, error) { +func loadProfile(filename, profile string) (*ini.File, *ini.Section, error) { config, err := ini.Load(filename) if err != nil { - return nil, err + return nil, nil, err } iniProfile, err := config.GetSection(profile) if err != nil { - return nil, err + // AWS config files (~/.aws/config) name non-default profile + // sections "profile ". + var sectionErr error + iniProfile, sectionErr = config.GetSection("profile " + profile) + if sectionErr != nil { + return nil, nil, err + } + } + return config, iniProfile, nil +} + +// loadDefaultProfiles loads profile from the default AWS files, mirroring +// the AWS SDK's shared-config resolution: the config file (AWS_CONFIG_FILE +// or ~/.aws/config) is loaded first and the shared credentials file +// (AWS_SHARED_CREDENTIALS_FILE or ~/.aws/credentials) overrides matching +// keys. A missing file is tolerated as long as the other one loads; a file +// that exists but fails to parse aborts resolution, like aws-sdk-go-v2, +// because silently skipping it could resolve credentials from the wrong +// (lower-precedence) source. +func loadDefaultProfiles(profile string) (*ini.File, *ini.Section, error) { + configFilename := os.Getenv("AWS_CONFIG_FILE") + credsFilename := os.Getenv("AWS_SHARED_CREDENTIALS_FILE") + var loadErrs []error + if configFilename == "" || credsFilename == "" { + // A home-dir failure only rules out the files defaulted under it; + // a file named via env var must still load. + homeDir, err := os.UserHomeDir() + if err != nil { + loadErrs = append(loadErrs, err) + } else { + if configFilename == "" { + configFilename = filepath.Join(homeDir, ".aws", "config") + } + if credsFilename == "" { + credsFilename = filepath.Join(homeDir, ".aws", "credentials") + } + } + } + + merged := ini.Empty() + loaded := false + if configFilename != "" { + config, err := ini.Load(configFilename) + switch { + case err == nil: + loaded = true + mergeAWSConfigSections(merged, config) + case errors.Is(err, fs.ErrNotExist): + loadErrs = append(loadErrs, err) + default: + return nil, nil, err + } + } + if credsFilename != "" { + config, err := ini.Load(credsFilename) + switch { + case err == nil: + loaded = true + mergeAWSCredentialsSections(merged, config) + case errors.Is(err, fs.ErrNotExist): + loadErrs = append(loadErrs, err) + default: + return nil, nil, err + } + } + if !loaded { + // Prefer the home-dir error when there is one (the informative + // failure); otherwise return the last not-exist error bare so the + // legacy os.IsNotExist probe on a missing-files result keeps working. + err := loadErrs[len(loadErrs)-1] + for _, e := range loadErrs { + if !errors.Is(e, fs.ErrNotExist) { + err = e + break + } + } + return nil, nil, err + } + iniProfile, err := merged.GetSection(profile) + if err != nil { + return nil, nil, err + } + return merged, iniProfile, nil +} + +// mergeAWSConfigSections copies the AWS config file's sections into dst +// under the SDK's config-file rules: bare sections other than "default" and +// "sso-session " are invalid profile names and ignored, and a +// "profile " section is renamed to , replacing a bare +// same-named section wholesale rather than merging with it. +func mergeAWSConfigSections(dst, src *ini.File) { + for _, section := range src.Sections() { + name := section.Name() + if name == ini.DefaultSection || strings.HasPrefix(name, "profile ") || + (!strings.EqualFold(name, "default") && !strings.HasPrefix(name, "sso-session ")) { + continue + } + copySectionKeys(dst.Section(name), section) + } + for _, section := range src.Sections() { + name := section.Name() + if !strings.HasPrefix(name, "profile ") { + continue + } + dstSection := dst.Section(strings.TrimPrefix(name, "profile ")) + for _, key := range dstSection.Keys() { + dstSection.DeleteKey(key.Name()) + } + copySectionKeys(dstSection, section) + } +} + +// mergeAWSCredentialsSections copies the shared credentials file's sections +// into dst, overriding matching keys; "profile "-prefixed section names are +// invalid in the credentials file and ignored. When a section overrides an +// existing profile, the static credentials move atomically: +// aws_access_key_id, aws_secret_access_key and aws_session_token are only +// taken from an overriding section carrying the complete key pair, so a +// partial pair cannot clobber half of an existing one. A section new to +// the merge is copied as-is; a partial pair it carries is rejected at +// resolution time, matching aws-sdk-go-v2's partial-credentials error. +func mergeAWSCredentialsSections(dst, src *ini.File) { + for _, section := range src.Sections() { + name := section.Name() + if name == ini.DefaultSection || strings.HasPrefix(name, "profile ") { + continue + } + _, err := dst.GetSection(name) + newSection := err != nil + hasPair := section.HasKey("aws_access_key_id") && section.HasKey("aws_secret_access_key") + dstSection := dst.Section(name) + for _, key := range section.Keys() { + switch key.Name() { + case "aws_access_key_id", "aws_secret_access_key", "aws_session_token": + if !newSection && !hasPair { + continue + } + } + dstSection.Key(key.Name()).SetValue(key.Value()) + } + } +} + +func copySectionKeys(dst, src *ini.Section) { + for _, key := range src.Keys() { + dst.Key(key.Name()).SetValue(key.Value()) } - return iniProfile, nil } diff --git a/vendor/github.com/minio/minio-go/v7/pkg/credentials/iam_aws.go b/vendor/github.com/minio/minio-go/v7/pkg/credentials/iam_aws.go index f4f7c8f7e29..f35d9d6598a 100644 --- a/vendor/github.com/minio/minio-go/v7/pkg/credentials/iam_aws.go +++ b/vendor/github.com/minio/minio-go/v7/pkg/credentials/iam_aws.go @@ -58,6 +58,17 @@ type IAM struct { // Region configurable custom region for STS Region string + // ExpiryWindow configures how long before the actual credential + // expiration the credentials are considered expired and refreshed. + // The zero value keeps the default behavior of refreshing once 80% + // of the credential lifetime has elapsed. A positive value refreshes + // that long before the actual expiration; a value that meets or + // exceeds the credential lifetime places the effective expiration at + // or before the moment of retrieval, so the credentials are refreshed + // on every subsequent retrieval. A negative value behaves like the + // default. + ExpiryWindow time.Duration + // Support for container authorization token https://docs.aws.amazon.com/sdkref/latest/guide/feature-container-credentials.html Container struct { AuthorizationToken string @@ -94,6 +105,15 @@ func NewIAM(endpoint string) *Credentials { }) } +// expiryWindow returns the configured ExpiryWindow, falling back to +// DefaultExpiryWindow when unset or negative. +func (m *IAM) expiryWindow() time.Duration { + if m.ExpiryWindow <= 0 { + return DefaultExpiryWindow + } + return m.ExpiryWindow +} + // RetrieveWithCredContext is like Retrieve with Cred Context func (m *IAM) RetrieveWithCredContext(cc *CredContext) (Value, error) { if cc == nil { @@ -151,6 +171,8 @@ func (m *IAM) RetrieveWithCredContext(cc *CredContext) (Value, error) { client = defaultCredContext.Client } + ctx := cc.requestContext() + endpoint := m.Endpoint switch { @@ -184,7 +206,11 @@ func (m *IAM) RetrieveWithCredContext(cc *CredContext) (Value, error) { stsWebIdentityCreds, err := creds.RetrieveWithCredContext(cc) if err == nil { - m.SetExpiration(creds.Expiration(), DefaultExpiryWindow) + // Use the raw credential expiration, not creds.Expiration(): + // the inner provider has already reduced its own expiration by + // DefaultExpiryWindow, and applying a window to the reduced + // value would compound the two. + m.SetExpiration(stsWebIdentityCreds.Expiration, m.expiryWindow()) } return stsWebIdentityCreds, err @@ -193,11 +219,11 @@ func (m *IAM) RetrieveWithCredContext(cc *CredContext) (Value, error) { endpoint = fmt.Sprintf("%s%s", DefaultECSRoleEndpoint, relativeURI) } - roleCreds, err = getEcsTaskCredentials(client, endpoint, token) + roleCreds, err = getEcsTaskCredentials(ctx, client, endpoint, token) case tokenFile != "" && fullURI != "": endpoint = fullURI - roleCreds, err = getEKSPodIdentityCredentials(client, endpoint, tokenFile) + roleCreds, err = getEKSPodIdentityCredentials(ctx, client, endpoint, tokenFile) case fullURI != "": if len(endpoint) == 0 { @@ -211,17 +237,16 @@ func (m *IAM) RetrieveWithCredContext(cc *CredContext) (Value, error) { } } - roleCreds, err = getEcsTaskCredentials(client, endpoint, token) + roleCreds, err = getEcsTaskCredentials(ctx, client, endpoint, token) default: - roleCreds, err = getCredentials(client, endpoint) + roleCreds, err = getCredentials(ctx, client, endpoint) } if err != nil { return Value{}, err } - // Expiry window is set to 10secs. - m.SetExpiration(roleCreds.Expiration, DefaultExpiryWindow) + m.SetExpiration(roleCreds.Expiration, m.expiryWindow()) return Value{ AccessKeyID: roleCreds.AccessKeyID, @@ -273,8 +298,8 @@ func getIAMRoleURL(endpoint string) (*url.URL, error) { // with the current EC2 service. If there are no credentials, // or there is an error making or receiving the request. // http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html -func listRoleNames(client *http.Client, u *url.URL, token string) ([]string, error) { - req, err := http.NewRequest(http.MethodGet, u.String(), nil) +func listRoleNames(ctx context.Context, client *http.Client, u *url.URL, token string) ([]string, error) { + req, err := http.NewRequestWithContext(ctx, http.MethodGet, u.String(), nil) if err != nil { return nil, err } @@ -303,8 +328,8 @@ func listRoleNames(client *http.Client, u *url.URL, token string) ([]string, err return credsList, nil } -func getEcsTaskCredentials(client *http.Client, endpoint, token string) (ec2RoleCredRespBody, error) { - req, err := http.NewRequest(http.MethodGet, endpoint, nil) +func getEcsTaskCredentials(ctx context.Context, client *http.Client, endpoint, token string) (ec2RoleCredRespBody, error) { + req, err := http.NewRequestWithContext(ctx, http.MethodGet, endpoint, nil) if err != nil { return ec2RoleCredRespBody{}, err } @@ -330,20 +355,20 @@ func getEcsTaskCredentials(client *http.Client, endpoint, token string) (ec2Role return respCreds, nil } -func getEKSPodIdentityCredentials(client *http.Client, endpoint string, tokenFile string) (ec2RoleCredRespBody, error) { +func getEKSPodIdentityCredentials(ctx context.Context, client *http.Client, endpoint string, tokenFile string) (ec2RoleCredRespBody, error) { if tokenFile != "" { bytes, err := os.ReadFile(tokenFile) if err != nil { return ec2RoleCredRespBody{}, fmt.Errorf("getEKSPodIdentityCredentials: failed to read token file:%s", err) } token := string(bytes) - return getEcsTaskCredentials(client, endpoint, token) + return getEcsTaskCredentials(ctx, client, endpoint, token) } return ec2RoleCredRespBody{}, fmt.Errorf("getEKSPodIdentityCredentials: no tokenFile found") } -func fetchIMDSToken(client *http.Client, endpoint string) (string, error) { - ctx, cancel := context.WithTimeout(context.Background(), time.Second) +func fetchIMDSToken(ctx context.Context, client *http.Client, endpoint string) (string, error) { + ctx, cancel := context.WithTimeout(ctx, time.Second) defer cancel() req, err := http.NewRequestWithContext(ctx, http.MethodPut, endpoint+TokenPath, nil) @@ -371,14 +396,18 @@ func fetchIMDSToken(client *http.Client, endpoint string) (string, error) { // // If the credentials cannot be found, or there is an error // reading the response an error will be returned. -func getCredentials(client *http.Client, endpoint string) (ec2RoleCredRespBody, error) { +func getCredentials(ctx context.Context, client *http.Client, endpoint string) (ec2RoleCredRespBody, error) { if endpoint == "" { endpoint = DefaultIAMRoleEndpoint } // https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html - token, err := fetchIMDSToken(client, endpoint) + token, err := fetchIMDSToken(ctx, client, endpoint) if err != nil { + // A dead caller context is not an IMDSv2 availability signal. + if cerr := ctx.Err(); cerr != nil { + return ec2RoleCredRespBody{}, fmt.Errorf("%w (imds token fetch: %v)", cerr, err) + } // Return only errors for valid situations, if the IMDSv2 is not enabled // we will not be able to get the token, in such a situation we have // to rely on IMDSv1 behavior as a fallback, this check ensures that. @@ -395,7 +424,7 @@ func getCredentials(client *http.Client, endpoint string) (ec2RoleCredRespBody, } // http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html - roleNames, err := listRoleNames(client, u, token) + roleNames, err := listRoleNames(ctx, client, u, token) if err != nil { return ec2RoleCredRespBody{}, err } @@ -415,7 +444,7 @@ func getCredentials(client *http.Client, endpoint string) (ec2RoleCredRespBody, // $ curl http://169.254.169.254/latest/meta-data/iam/security-credentials/s3access // u.Path = path.Join(u.Path, roleName) - req, err := http.NewRequest(http.MethodGet, u.String(), nil) + req, err := http.NewRequestWithContext(ctx, http.MethodGet, u.String(), nil) if err != nil { return ec2RoleCredRespBody{}, err } diff --git a/vendor/github.com/minio/minio-go/v7/pkg/credentials/sts_client_grants.go b/vendor/github.com/minio/minio-go/v7/pkg/credentials/sts_client_grants.go index ef6f436b84b..7ab7d68ef94 100644 --- a/vendor/github.com/minio/minio-go/v7/pkg/credentials/sts_client_grants.go +++ b/vendor/github.com/minio/minio-go/v7/pkg/credentials/sts_client_grants.go @@ -19,6 +19,7 @@ package credentials import ( "bytes" + "context" "encoding/xml" "errors" "fmt" @@ -100,7 +101,7 @@ func NewSTSClientGrants(stsEndpoint string, getClientGrantsTokenExpiry func() (* }), nil } -func getClientGrantsCredentials(clnt *http.Client, endpoint string, +func getClientGrantsCredentials(ctx context.Context, clnt *http.Client, endpoint string, getClientGrantsTokenExpiry func() (*ClientGrantsToken, error), ) (AssumeRoleWithClientGrantsResponse, error) { accessToken, err := getClientGrantsTokenExpiry() @@ -119,7 +120,7 @@ func getClientGrantsCredentials(clnt *http.Client, endpoint string, return AssumeRoleWithClientGrantsResponse{}, err } - req, err := http.NewRequest(http.MethodPost, u.String(), strings.NewReader(v.Encode())) + req, err := http.NewRequestWithContext(ctx, http.MethodPost, u.String(), strings.NewReader(v.Encode())) if err != nil { return AssumeRoleWithClientGrantsResponse{}, err } @@ -179,7 +180,7 @@ func (m *STSClientGrants) RetrieveWithCredContext(cc *CredContext) (Value, error return Value{}, errors.New("STS endpoint unknown") } - a, err := getClientGrantsCredentials(client, stsEndpoint, m.GetClientGrantsTokenExpiry) + a, err := getClientGrantsCredentials(cc.requestContext(), client, stsEndpoint, m.GetClientGrantsTokenExpiry) if err != nil { return Value{}, err } diff --git a/vendor/github.com/minio/minio-go/v7/pkg/credentials/sts_custom_identity.go b/vendor/github.com/minio/minio-go/v7/pkg/credentials/sts_custom_identity.go index e9e7a1151f1..b986c175f7e 100644 --- a/vendor/github.com/minio/minio-go/v7/pkg/credentials/sts_custom_identity.go +++ b/vendor/github.com/minio/minio-go/v7/pkg/credentials/sts_custom_identity.go @@ -107,7 +107,7 @@ func (c *CustomTokenIdentity) RetrieveWithCredContext(cc *CredContext) (value Va u.RawQuery = v.Encode() - req, err := http.NewRequest(http.MethodPost, u.String(), nil) + req, err := http.NewRequestWithContext(cc.requestContext(), http.MethodPost, u.String(), nil) if err != nil { return value, err } diff --git a/vendor/github.com/minio/minio-go/v7/pkg/credentials/sts_ldap_identity.go b/vendor/github.com/minio/minio-go/v7/pkg/credentials/sts_ldap_identity.go index 7e80cd6a2ac..648c95d273a 100644 --- a/vendor/github.com/minio/minio-go/v7/pkg/credentials/sts_ldap_identity.go +++ b/vendor/github.com/minio/minio-go/v7/pkg/credentials/sts_ldap_identity.go @@ -172,7 +172,7 @@ func (k *LDAPIdentity) RetrieveWithCredContext(cc *CredContext) (value Value, er v.Set("ConfigName", k.ConfigName) } - req, err := http.NewRequest(http.MethodPost, u.String(), strings.NewReader(v.Encode())) + req, err := http.NewRequestWithContext(cc.requestContext(), http.MethodPost, u.String(), strings.NewReader(v.Encode())) if err != nil { return value, err } diff --git a/vendor/github.com/minio/minio-go/v7/pkg/credentials/sts_tls_identity.go b/vendor/github.com/minio/minio-go/v7/pkg/credentials/sts_tls_identity.go index beab4a6a648..ebaae128066 100644 --- a/vendor/github.com/minio/minio-go/v7/pkg/credentials/sts_tls_identity.go +++ b/vendor/github.com/minio/minio-go/v7/pkg/credentials/sts_tls_identity.go @@ -131,7 +131,7 @@ func (i *STSCertificateIdentity) RetrieveWithCredContext(cc *CredContext) (Value } endpointURL.RawQuery = queryValues.Encode() - req, err := http.NewRequest(http.MethodPost, endpointURL.String(), nil) + req, err := http.NewRequestWithContext(cc.requestContext(), http.MethodPost, endpointURL.String(), nil) if err != nil { return Value{}, err } diff --git a/vendor/github.com/minio/minio-go/v7/pkg/credentials/sts_web_identity.go b/vendor/github.com/minio/minio-go/v7/pkg/credentials/sts_web_identity.go index a9987255ec7..8dd2ca79184 100644 --- a/vendor/github.com/minio/minio-go/v7/pkg/credentials/sts_web_identity.go +++ b/vendor/github.com/minio/minio-go/v7/pkg/credentials/sts_web_identity.go @@ -19,6 +19,7 @@ package credentials import ( "bytes" + "context" "encoding/xml" "errors" "fmt" @@ -114,19 +115,38 @@ func NewSTSWebIdentity(stsEndpoint string, getWebIDTokenExpiry func() (*WebIdent return New(i), nil } +const defaultKubernetesTokenFile = "/var/run/secrets/kubernetes.io/serviceaccount/token" + // NewKubernetesIdentity returns a pointer to a new // Credentials object using the Kubernetes service account +// token at /var/run/secrets/kubernetes.io/serviceaccount/token. +// +// The token audience must match the audience the server +// requires (sts.min.io by default on MinIO AIStor). The default +// service account token carries the API server audience, so +// mount a projected token with the right audience and pass its +// path with WithWebIdentityTokenFile. func NewKubernetesIdentity(stsEndpoint string, opts ...func(*STSWebIdentity)) (*Credentials, error) { - return NewSTSWebIdentity(stsEndpoint, func() (*WebIdentityToken, error) { - token, err := os.ReadFile("/var/run/secrets/kubernetes.io/serviceaccount/token") + return NewSTSWebIdentity(stsEndpoint, readWebIdentityTokenFile(defaultKubernetesTokenFile), opts...) +} + +// WithWebIdentityTokenFile option reads the web identity token +// from the file at path on every credential refresh, replacing +// the token function passed to NewSTSWebIdentity. +func WithWebIdentityTokenFile(path string) func(*STSWebIdentity) { + return func(i *STSWebIdentity) { + i.GetWebIDTokenExpiry = readWebIdentityTokenFile(path) + } +} + +func readWebIdentityTokenFile(path string) func() (*WebIdentityToken, error) { + return func() (*WebIdentityToken, error) { + token, err := os.ReadFile(path) if err != nil { return nil, err } - - return &WebIdentityToken{ - Token: string(token), - }, nil - }, opts...) + return &WebIdentityToken{Token: string(token)}, nil + } } // WithPolicy option will enforce that the returned credentials @@ -137,7 +157,7 @@ func WithPolicy(policy string) func(*STSWebIdentity) { } } -func getWebIdentityCredentials(clnt *http.Client, endpoint, roleARN, roleSessionName string, policy string, +func getWebIdentityCredentials(ctx context.Context, clnt *http.Client, endpoint, roleARN, roleSessionName string, policy string, getWebIDTokenExpiry func() (*WebIdentityToken, error), tokenRevokeType string, ) (AssumeRoleWithWebIdentityResponse, error) { idToken, err := getWebIDTokenExpiry() @@ -180,7 +200,7 @@ func getWebIdentityCredentials(clnt *http.Client, endpoint, roleARN, roleSession return AssumeRoleWithWebIdentityResponse{}, err } - req, err := http.NewRequest(http.MethodPost, u.String(), strings.NewReader(v.Encode())) + req, err := http.NewRequestWithContext(ctx, http.MethodPost, u.String(), strings.NewReader(v.Encode())) if err != nil { return AssumeRoleWithWebIdentityResponse{}, err } @@ -242,7 +262,7 @@ func (m *STSWebIdentity) RetrieveWithCredContext(cc *CredContext) (Value, error) return Value{}, errors.New("STS endpoint unknown") } - a, err := getWebIdentityCredentials(client, stsEndpoint, m.RoleARN, m.roleSessionName, m.Policy, m.GetWebIDTokenExpiry, m.TokenRevokeType) + a, err := getWebIdentityCredentials(cc.requestContext(), client, stsEndpoint, m.RoleARN, m.roleSessionName, m.Policy, m.GetWebIDTokenExpiry, m.TokenRevokeType) if err != nil { return Value{}, err } diff --git a/vendor/github.com/minio/minio-go/v7/pkg/lifecycle/lifecycle.go b/vendor/github.com/minio/minio-go/v7/pkg/lifecycle/lifecycle.go index 01d4e6aa798..2ae38b85a7e 100644 --- a/vendor/github.com/minio/minio-go/v7/pkg/lifecycle/lifecycle.go +++ b/vendor/github.com/minio/minio-go/v7/pkg/lifecycle/lifecycle.go @@ -209,6 +209,58 @@ func (t Transition) MarshalXML(en *xml.Encoder, startElement xml.StartElement) e return en.EncodeElement(transitionWrapper(t), startElement) } +// Compression is a MinIO AIStor extension with no S3 equivalent: it compresses +// matching current object versions in place. Presence of the element enables the +// action, so Rule carries it as a pointer — unlike Transition, there is no +// StorageClass to key presence off and Days: 0 legitimately means "immediately". +// +// HighCompression selects the strongest level the server offers; without it the +// rule writes the level ingest uses and only compresses objects stored +// uncompressed. +// +// Unlike Transition and Expiration there is no absolute Date trigger — a one-off +// sweep is what the compress batch job is for. That also means no custom +// MarshalJSON: with no embedded time.Time to suppress, every field honors +// omitempty, and a zero element still marshals as {} because Rule holds it as a +// pointer and its presence alone enables the action. +type Compression struct { + XMLName xml.Name `xml:"Compression" json:"-"` + Days ExpirationDays `xml:"Days,omitempty" json:"Days,omitempty"` + HighCompression bool `xml:"HighCompression,omitempty" json:"HighCompression,omitempty"` + SkipCompressed bool `xml:"SkipCompressed,omitempty" json:"SkipCompressed,omitempty"` + IncludeEncrypted bool `xml:"IncludeEncrypted,omitempty" json:"IncludeEncrypted,omitempty"` +} + +// IsDaysNull returns true if days field is null +func (c *Compression) IsDaysNull() bool { + return c == nil || c.Days == ExpirationDays(0) +} + +// IsNull returns true if the element is absent. +func (c *Compression) IsNull() bool { + return c == nil +} + +// NoncurrentVersionCompression is the Compression counterpart for noncurrent +// object versions. See Compression for why Rule holds it as a pointer. +type NoncurrentVersionCompression struct { + XMLName xml.Name `xml:"NoncurrentVersionCompression" json:"-"` + NoncurrentDays ExpirationDays `xml:"NoncurrentDays,omitempty" json:"NoncurrentDays,omitempty"` + HighCompression bool `xml:"HighCompression,omitempty" json:"HighCompression,omitempty"` + SkipCompressed bool `xml:"SkipCompressed,omitempty" json:"SkipCompressed,omitempty"` + IncludeEncrypted bool `xml:"IncludeEncrypted,omitempty" json:"IncludeEncrypted,omitempty"` +} + +// IsDaysNull returns true if noncurrent days field is null +func (n *NoncurrentVersionCompression) IsDaysNull() bool { + return n == nil || n.NoncurrentDays == ExpirationDays(0) +} + +// IsNull returns true if the element is absent. +func (n *NoncurrentVersionCompression) IsNull() bool { + return n == nil +} + // And And Rule for LifecycleTag, to be used in LifecycleRuleFilter type And struct { XMLName xml.Name `xml:"And" json:"-"` @@ -265,12 +317,11 @@ func (f Filter) MarshalJSON() ([]byte, error) { } // MarshalXML - produces the xml representation of the Filter struct -// only one of Prefix, And and Tag should be present in the output. +// at most one of Prefix, And, Tag, ObjectSizeGreaterThan and +// ObjectSizeLessThan is present in the output. +// A zero-value Filter marshals as ; +// suppressing the element entirely is the caller's responsibility. func (f Filter) MarshalXML(e *xml.Encoder, start xml.StartElement) error { - if f.IsNull() { - return nil - } - if err := e.EncodeToken(start); err != nil { return err } @@ -473,6 +524,8 @@ func (r Rule) MarshalJSON() ([]byte, error) { Prefix string `json:"Prefix,omitempty"` Status string `json:"Status"` Transition *Transition `json:"Transition,omitempty"` + Compression *Compression `json:"Compression,omitempty"` + NoncurrentVersionCompression *NoncurrentVersionCompression `json:"NoncurrentVersionCompression,omitempty"` } newr := rule{ Prefix: r.Prefix, @@ -504,10 +557,45 @@ func (r Rule) MarshalJSON() ([]byte, error) { if !r.AllVersionsExpiration.IsNull() { newr.AllVersionsExpiration = &r.AllVersionsExpiration } + newr.Compression = r.Compression + newr.NoncurrentVersionCompression = r.NoncurrentVersionCompression return json.Marshal(newr) } +// ruleAlias drops Rule's methods so EncodeElement falls back to the default +// struct-tag encoding. +type ruleAlias Rule + +// ruleWrapper embeds ruleAlias, so it needs no updating when Rule gains a +// field. Its RuleFilter is shallower than the embedded one, and encoding/xml's +// depth-based field shadowing suppresses the deeper field, so is +// emitted only through this pointer: nil omits the element, a set pointer +// emits it (empty) as the last child of . +type ruleWrapper struct { + ruleAlias + RuleFilter *Filter `xml:"Filter,omitempty"` +} + +// MarshalXML customizes XML encoding of Rule: a rule with neither Filter nor +// Prefix set emits an empty as the last +// child of — S3 requires a Filter when no Prefix element is present; +// the empty child is this library's representation of an empty +// filter. A rule with only a top-level Prefix omits the Filter element; a +// non-null Filter marshals through the default encoding in its declared +// field position. MarshalJSON is unaffected and still omits a null Filter. +func (r Rule) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if !r.RuleFilter.IsNull() { + return e.EncodeElement(ruleAlias(r), start) + } + + w := ruleWrapper{ruleAlias: ruleAlias(r)} + if r.Prefix == "" { + w.RuleFilter = &w.ruleAlias.RuleFilter + } + return e.EncodeElement(w, start) +} + // Rule represents a single rule in lifecycle configuration type Rule struct { XMLName xml.Name `xml:"Rule,omitempty" json:"-"` @@ -522,6 +610,8 @@ type Rule struct { Prefix string `xml:"Prefix,omitempty" json:"Prefix,omitempty"` Status string `xml:"Status" json:"Status"` Transition Transition `xml:"Transition,omitempty" json:"Transition,omitempty"` + Compression *Compression `xml:"Compression,omitempty" json:"Compression,omitempty"` + NoncurrentVersionCompression *NoncurrentVersionCompression `xml:"NoncurrentVersionCompression,omitempty" json:"NoncurrentVersionCompression,omitempty"` } // Configuration is a collection of Rule objects. diff --git a/vendor/github.com/minio/minio-go/v7/pkg/policy/bucket-policy-condition.go b/vendor/github.com/minio/minio-go/v7/pkg/policy/bucket-policy-condition.go new file mode 100644 index 00000000000..4d6d85cbc10 --- /dev/null +++ b/vendor/github.com/minio/minio-go/v7/pkg/policy/bucket-policy-condition.go @@ -0,0 +1,114 @@ +/* + * MinIO Go Library for Amazon S3 Compatible Cloud Storage + * Copyright 2015-2017 MinIO, Inc. + * + * 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 policy + +import ( + "github.com/minio/minio-go/v7/pkg/set" +) + +// ConditionKeyMap - map of policy condition key and value. +type ConditionKeyMap map[string]set.StringSet + +// Add - adds key and value. The value is appended If key already exists. +func (ckm ConditionKeyMap) Add(key string, value set.StringSet) { + if v, ok := ckm[key]; ok { + ckm[key] = v.Union(value) + } else { + ckm[key] = set.CopyStringSet(value) + } +} + +// Remove - removes value of given key. If key has empty after removal, the key is also removed. +func (ckm ConditionKeyMap) Remove(key string, value set.StringSet) { + if v, ok := ckm[key]; ok { + if value != nil { + ckm[key] = v.Difference(value) + } + + if ckm[key].IsEmpty() { + delete(ckm, key) + } + } +} + +// RemoveKey - removes key and its value. +func (ckm ConditionKeyMap) RemoveKey(key string) { + delete(ckm, key) +} + +// CopyConditionKeyMap - returns new copy of given ConditionKeyMap. +func CopyConditionKeyMap(condKeyMap ConditionKeyMap) ConditionKeyMap { + out := make(ConditionKeyMap) + + for k, v := range condKeyMap { + out[k] = set.CopyStringSet(v) + } + + return out +} + +// mergeConditionKeyMap - returns a new ConditionKeyMap which contains merged key/value of given two ConditionKeyMap. +func mergeConditionKeyMap(condKeyMap1, condKeyMap2 ConditionKeyMap) ConditionKeyMap { + out := CopyConditionKeyMap(condKeyMap1) + + for k, v := range condKeyMap2 { + if ev, ok := out[k]; ok { + out[k] = ev.Union(v) + } else { + out[k] = set.CopyStringSet(v) + } + } + + return out +} + +// ConditionMap - map of condition and conditional values. +type ConditionMap map[string]ConditionKeyMap + +// Add - adds condition key and condition value. The value is appended if key already exists. +func (cond ConditionMap) Add(condKey string, condKeyMap ConditionKeyMap) { + if v, ok := cond[condKey]; ok { + cond[condKey] = mergeConditionKeyMap(v, condKeyMap) + } else { + cond[condKey] = CopyConditionKeyMap(condKeyMap) + } +} + +// Remove - removes condition key and its value. +func (cond ConditionMap) Remove(condKey string) { + delete(cond, condKey) +} + +// mergeConditionMap - returns new ConditionMap which contains merged key/value of two ConditionMap. +func mergeConditionMap(condMap1, condMap2 ConditionMap) ConditionMap { + out := make(ConditionMap) + + for k, v := range condMap1 { + out[k] = CopyConditionKeyMap(v) + } + + for k, v := range condMap2 { + if ev, ok := out[k]; ok { + out[k] = mergeConditionKeyMap(ev, v) + } else { + out[k] = CopyConditionKeyMap(v) + } + } + + return out +} diff --git a/vendor/github.com/minio/minio-go/v7/pkg/policy/bucket-policy.go b/vendor/github.com/minio/minio-go/v7/pkg/policy/bucket-policy.go new file mode 100644 index 00000000000..762c9015622 --- /dev/null +++ b/vendor/github.com/minio/minio-go/v7/pkg/policy/bucket-policy.go @@ -0,0 +1,680 @@ +/* + * MinIO Go Library for Amazon S3 Compatible Cloud Storage + * Copyright 2015-2017 MinIO, Inc. + * + * 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 policy + +import ( + "encoding/json" + "errors" + "reflect" + "strings" + + "github.com/minio/minio-go/v7/pkg/set" +) + +// BucketPolicy - Bucket level policy. +type BucketPolicy string + +// Different types of Policies currently supported for buckets. +const ( + BucketPolicyNone BucketPolicy = "none" + BucketPolicyReadOnly BucketPolicy = "readonly" + BucketPolicyReadWrite BucketPolicy = "readwrite" + BucketPolicyWriteOnly BucketPolicy = "writeonly" +) + +// IsValidBucketPolicy - returns true if policy is valid and supported, false otherwise. +func (p BucketPolicy) IsValidBucketPolicy() bool { + switch p { + case BucketPolicyNone, BucketPolicyReadOnly, BucketPolicyReadWrite, BucketPolicyWriteOnly: + return true + } + return false +} + +// Resource prefix for all aws resources. +const awsResourcePrefix = "arn:aws:s3:::" + +// Common bucket actions for both read and write policies. +var commonBucketActions = set.CreateStringSet("s3:GetBucketLocation") + +// Read only bucket actions. +var readOnlyBucketActions = set.CreateStringSet("s3:ListBucket") + +// Write only bucket actions. +var writeOnlyBucketActions = set.CreateStringSet("s3:ListBucketMultipartUploads") + +// Read only object actions. +var readOnlyObjectActions = set.CreateStringSet("s3:GetObject") + +// Write only object actions. +var writeOnlyObjectActions = set.CreateStringSet("s3:AbortMultipartUpload", "s3:DeleteObject", "s3:ListMultipartUploadParts", "s3:PutObject") + +// Read and write object actions. +var readWriteObjectActions = readOnlyObjectActions.Union(writeOnlyObjectActions) + +// All valid bucket and object actions. +var validActions = commonBucketActions. + Union(readOnlyBucketActions). + Union(writeOnlyBucketActions). + Union(readOnlyObjectActions). + Union(writeOnlyObjectActions) + +var startsWithFunc = func(resource, resourcePrefix string) bool { + return strings.HasPrefix(resource, resourcePrefix) +} + +// User - canonical users list. +type User struct { + AWS set.StringSet `json:"AWS,omitempty"` + CanonicalUser set.StringSet `json:"CanonicalUser,omitempty"` +} + +// UnmarshalJSON is a custom json unmarshaler for Principal field, +// the reason is that Principal can take a json struct represented by +// User string but it can also take a string. +func (u *User) UnmarshalJSON(data []byte) error { + // Try to unmarshal data in a struct equal to User, + // to avoid infinite recursive call of this function + type AliasUser User + var au AliasUser + err := json.Unmarshal(data, &au) + if err == nil { + *u = User(au) + return nil + } + // Data type is not known, check if it is a json string + // which contains a star, which is permitted in the spec + var str string + err = json.Unmarshal(data, &str) + if err == nil { + if str != "*" { + return errors.New("unrecognized Principal field") + } + *u = User{AWS: set.CreateStringSet("*")} + return nil + } + return err +} + +// Statement - minio policy statement +type Statement struct { + Actions set.StringSet `json:"Action"` + Conditions ConditionMap `json:"Condition,omitempty"` + Effect string + Principal User `json:"Principal"` + Resources set.StringSet `json:"Resource"` + Sid string +} + +// BucketAccessPolicy - minio policy collection +type BucketAccessPolicy struct { + Version string // date in YYYY-MM-DD format + Statements []Statement `json:"Statement"` +} + +// isValidStatement - returns whether given statement is valid to process for given bucket name. +func isValidStatement(statement Statement, bucketName string) bool { + if statement.Actions.Intersection(validActions).IsEmpty() { + return false + } + + if statement.Effect != "Allow" { + return false + } + + if statement.Principal.AWS == nil || !statement.Principal.AWS.Contains("*") { + return false + } + + bucketResource := awsResourcePrefix + bucketName + if statement.Resources.Contains(bucketResource) { + return true + } + + if statement.Resources.FuncMatch(startsWithFunc, bucketResource+"/").IsEmpty() { + return false + } + + return true +} + +// Returns new statements with bucket actions for given policy. +func newBucketStatement(policy BucketPolicy, bucketName, prefix string) (statements []Statement) { + statements = []Statement{} + if policy == BucketPolicyNone || bucketName == "" { + return statements + } + + bucketResource := set.CreateStringSet(awsResourcePrefix + bucketName) + + statement := Statement{ + Actions: commonBucketActions, + Effect: "Allow", + Principal: User{AWS: set.CreateStringSet("*")}, + Resources: bucketResource, + Sid: "", + } + statements = append(statements, statement) + + if policy == BucketPolicyReadOnly || policy == BucketPolicyReadWrite { + statement = Statement{ + Actions: readOnlyBucketActions, + Effect: "Allow", + Principal: User{AWS: set.CreateStringSet("*")}, + Resources: bucketResource, + Sid: "", + } + if prefix != "" { + condKeyMap := make(ConditionKeyMap) + condKeyMap.Add("s3:prefix", set.CreateStringSet(prefix+"*")) + condMap := make(ConditionMap) + condMap.Add("StringLike", condKeyMap) + statement.Conditions = condMap + } + statements = append(statements, statement) + } + + if policy == BucketPolicyWriteOnly || policy == BucketPolicyReadWrite { + statement = Statement{ + Actions: writeOnlyBucketActions, + Effect: "Allow", + Principal: User{AWS: set.CreateStringSet("*")}, + Resources: bucketResource, + Sid: "", + } + statements = append(statements, statement) + } + + return statements +} + +// Returns new statements contains object actions for given policy. +func newObjectStatement(policy BucketPolicy, bucketName, prefix string) (statements []Statement) { + statements = []Statement{} + if policy == BucketPolicyNone || bucketName == "" { + return statements + } + + statement := Statement{ + Effect: "Allow", + Principal: User{AWS: set.CreateStringSet("*")}, + Resources: set.CreateStringSet(awsResourcePrefix + bucketName + "/" + prefix + "*"), + Sid: "", + } + + switch policy { + case BucketPolicyReadOnly: + statement.Actions = readOnlyObjectActions + case BucketPolicyWriteOnly: + statement.Actions = writeOnlyObjectActions + case BucketPolicyReadWrite: + statement.Actions = readWriteObjectActions + } + + statements = append(statements, statement) + return statements +} + +// Returns new statements for given policy, bucket and prefix. +func newStatements(policy BucketPolicy, bucketName, prefix string) (statements []Statement) { + statements = []Statement{} + ns := newBucketStatement(policy, bucketName, prefix) + statements = append(statements, ns...) + + ns = newObjectStatement(policy, bucketName, prefix) + statements = append(statements, ns...) + + return statements +} + +// Returns whether given bucket statements are used by other than given prefix statements. +func getInUsePolicy(statements []Statement, bucketName, prefix string) (readOnlyInUse, writeOnlyInUse bool) { + resourcePrefix := awsResourcePrefix + bucketName + "/" + objectResource := awsResourcePrefix + bucketName + "/" + prefix + "*" + + for _, s := range statements { + if !s.Resources.Contains(objectResource) && !s.Resources.FuncMatch(startsWithFunc, resourcePrefix).IsEmpty() { + if s.Actions.Intersection(readOnlyObjectActions).Equals(readOnlyObjectActions) { + readOnlyInUse = true + } + + if s.Actions.Intersection(writeOnlyObjectActions).Equals(writeOnlyObjectActions) { + writeOnlyInUse = true + } + } + if readOnlyInUse && writeOnlyInUse { + break + } + } + + return readOnlyInUse, writeOnlyInUse +} + +// Removes object actions in given statement. +func removeObjectActions(statement Statement, objectResource string) Statement { + if statement.Conditions == nil { + if len(statement.Resources) > 1 { + statement.Resources.Remove(objectResource) + } else { + statement.Actions = statement.Actions.Difference(readOnlyObjectActions) + statement.Actions = statement.Actions.Difference(writeOnlyObjectActions) + } + } + + return statement +} + +// Removes bucket actions for given policy in given statement. +func removeBucketActions(statement Statement, prefix, bucketResource string, readOnlyInUse, writeOnlyInUse bool) Statement { + removeReadOnly := func() { + if !statement.Actions.Intersection(readOnlyBucketActions).Equals(readOnlyBucketActions) { + return + } + + if statement.Conditions == nil { + statement.Actions = statement.Actions.Difference(readOnlyBucketActions) + return + } + + if prefix != "" { + stringEqualsValue := statement.Conditions["StringEquals"] + values := set.NewStringSet() + if stringEqualsValue != nil { + values = stringEqualsValue["s3:prefix"] + if values == nil { + values = set.NewStringSet() + } + } + + values.Remove(prefix) + + if stringEqualsValue != nil { + if values.IsEmpty() { + delete(stringEqualsValue, "s3:prefix") + } + if len(stringEqualsValue) == 0 { + delete(statement.Conditions, "StringEquals") + } + } + + if len(statement.Conditions) == 0 { + statement.Conditions = nil + statement.Actions = statement.Actions.Difference(readOnlyBucketActions) + } + } + } + + removeWriteOnly := func() { + if statement.Conditions == nil { + statement.Actions = statement.Actions.Difference(writeOnlyBucketActions) + } + } + + if len(statement.Resources) > 1 { + statement.Resources.Remove(bucketResource) + } else { + if !readOnlyInUse { + removeReadOnly() + } + + if !writeOnlyInUse { + removeWriteOnly() + } + } + + return statement +} + +// Returns statements containing removed actions/statements for given +// policy, bucket name and prefix. +func removeStatements(statements []Statement, bucketName, prefix string) []Statement { + bucketResource := awsResourcePrefix + bucketName + objectResource := awsResourcePrefix + bucketName + "/" + prefix + "*" + readOnlyInUse, writeOnlyInUse := getInUsePolicy(statements, bucketName, prefix) + + out := []Statement{} + readOnlyBucketStatements := []Statement{} + s3PrefixValues := set.NewStringSet() + + for _, statement := range statements { + if !isValidStatement(statement, bucketName) { + out = append(out, statement) + continue + } + + if statement.Resources.Contains(bucketResource) { + if statement.Conditions != nil { + statement = removeBucketActions(statement, prefix, bucketResource, false, false) + } else { + statement = removeBucketActions(statement, prefix, bucketResource, readOnlyInUse, writeOnlyInUse) + } + } else if statement.Resources.Contains(objectResource) { + statement = removeObjectActions(statement, objectResource) + } + + if !statement.Actions.IsEmpty() { + if statement.Resources.Contains(bucketResource) && + statement.Actions.Intersection(readOnlyBucketActions).Equals(readOnlyBucketActions) && + statement.Effect == "Allow" && + statement.Principal.AWS.Contains("*") { + if statement.Conditions != nil { + stringEqualsValue := statement.Conditions["StringEquals"] + values := set.NewStringSet() + if stringEqualsValue != nil { + values = stringEqualsValue["s3:prefix"] + if values == nil { + values = set.NewStringSet() + } + } + s3PrefixValues = s3PrefixValues.Union(values.ApplyFunc(func(v string) string { + return bucketResource + "/" + v + "*" + })) + } else if !s3PrefixValues.IsEmpty() { + readOnlyBucketStatements = append(readOnlyBucketStatements, statement) + continue + } + } + out = append(out, statement) + } + } + + skipBucketStatement := true + resourcePrefix := awsResourcePrefix + bucketName + "/" + for _, statement := range out { + if !statement.Resources.FuncMatch(startsWithFunc, resourcePrefix).IsEmpty() && + s3PrefixValues.Intersection(statement.Resources).IsEmpty() { + skipBucketStatement = false + break + } + } + + for _, statement := range readOnlyBucketStatements { + if skipBucketStatement && + statement.Resources.Contains(bucketResource) && + statement.Effect == "Allow" && + statement.Principal.AWS.Contains("*") && + statement.Conditions == nil { + continue + } + + out = append(out, statement) + } + + if len(out) == 1 { + statement := out[0] + if statement.Resources.Contains(bucketResource) && + statement.Actions.Intersection(commonBucketActions).Equals(commonBucketActions) && + statement.Effect == "Allow" && + statement.Principal.AWS.Contains("*") && + statement.Conditions == nil { + out = []Statement{} + } + } + + return out +} + +// Appends given statement into statement list to have unique statements. +// - If statement already exists in statement list, it ignores. +// - If statement exists with different conditions, they are merged. +// - Else the statement is appended to statement list. +func appendStatement(statements []Statement, statement Statement) []Statement { + for i, s := range statements { + if s.Actions.Equals(statement.Actions) && + s.Effect == statement.Effect && + s.Principal.AWS.Equals(statement.Principal.AWS) && + reflect.DeepEqual(s.Conditions, statement.Conditions) { + statements[i].Resources = s.Resources.Union(statement.Resources) + return statements + } else if s.Resources.Equals(statement.Resources) && + s.Effect == statement.Effect && + s.Principal.AWS.Equals(statement.Principal.AWS) && + reflect.DeepEqual(s.Conditions, statement.Conditions) { + statements[i].Actions = s.Actions.Union(statement.Actions) + return statements + } + + if s.Resources.Intersection(statement.Resources).Equals(statement.Resources) && + s.Actions.Intersection(statement.Actions).Equals(statement.Actions) && + s.Effect == statement.Effect && + s.Principal.AWS.Intersection(statement.Principal.AWS).Equals(statement.Principal.AWS) { + if reflect.DeepEqual(s.Conditions, statement.Conditions) { + return statements + } + if s.Conditions != nil && statement.Conditions != nil { + if s.Resources.Equals(statement.Resources) { + statements[i].Conditions = mergeConditionMap(s.Conditions, statement.Conditions) + return statements + } + } + } + } + + if !statement.Actions.IsEmpty() || !statement.Resources.IsEmpty() { + return append(statements, statement) + } + + return statements +} + +// Appends two statement lists. +func appendStatements(statements, appendStatements []Statement) []Statement { + for _, s := range appendStatements { + statements = appendStatement(statements, s) + } + + return statements +} + +// Returns policy of given bucket statement. +func getBucketPolicy(statement Statement, prefix string) (commonFound, readOnly, writeOnly bool) { + if statement.Effect != "Allow" || !statement.Principal.AWS.Contains("*") { + return commonFound, readOnly, writeOnly + } + + if statement.Actions.Intersection(commonBucketActions).Equals(commonBucketActions) && + statement.Conditions == nil { + commonFound = true + } + + if statement.Actions.Intersection(writeOnlyBucketActions).Equals(writeOnlyBucketActions) && + statement.Conditions == nil { + writeOnly = true + } + + if statement.Actions.Intersection(readOnlyBucketActions).Equals(readOnlyBucketActions) { + if prefix != "" && statement.Conditions != nil { + if stringEqualsValue, ok := statement.Conditions["StringEquals"]; ok { + if s3PrefixValues, ok := stringEqualsValue["s3:prefix"]; ok { + if s3PrefixValues.Contains(prefix) { + readOnly = true + } + } + } else if stringNotEqualsValue, ok := statement.Conditions["StringNotEquals"]; ok { + if s3PrefixValues, ok := stringNotEqualsValue["s3:prefix"]; ok { + if !s3PrefixValues.Contains(prefix) { + readOnly = true + } + } + } else if stringLikeValue, ok := statement.Conditions["StringLike"]; ok { + if s3PrefixValues, ok := stringLikeValue["s3:prefix"]; ok { + if s3PrefixValues.Contains(prefix + "*") { + readOnly = true + } + } + } else if stringNotLikeValue, ok := statement.Conditions["StringNotLike"]; ok { + if s3PrefixValues, ok := stringNotLikeValue["s3:prefix"]; ok { + if !s3PrefixValues.Contains(prefix + "*") { + readOnly = true + } + } + } + } else if prefix == "" && statement.Conditions == nil { + readOnly = true + } else if prefix != "" && statement.Conditions == nil { + readOnly = true + } + } + + return commonFound, readOnly, writeOnly +} + +// Returns policy of given object statement. +func getObjectPolicy(statement Statement) (readOnly, writeOnly bool) { + if statement.Effect == "Allow" && + statement.Principal.AWS.Contains("*") && + statement.Conditions == nil { + if statement.Actions.Intersection(readOnlyObjectActions).Equals(readOnlyObjectActions) { + readOnly = true + } + if statement.Actions.Intersection(writeOnlyObjectActions).Equals(writeOnlyObjectActions) { + writeOnly = true + } + } + + return readOnly, writeOnly +} + +// GetPolicy - Returns policy of given bucket name, prefix in given statements. +func GetPolicy(statements []Statement, bucketName, prefix string) BucketPolicy { + bucketResource := awsResourcePrefix + bucketName + objectResource := awsResourcePrefix + bucketName + "/" + prefix + "*" + + bucketCommonFound := false + bucketReadOnly := false + bucketWriteOnly := false + matchedResource := "" + objReadOnly := false + objWriteOnly := false + + for _, s := range statements { + matchedObjResources := set.NewStringSet() + if s.Resources.Contains(objectResource) { + matchedObjResources.Add(objectResource) + } else { + matchedObjResources = s.Resources.FuncMatch(resourceMatch, objectResource) + } + if !matchedObjResources.IsEmpty() { + readOnly, writeOnly := getObjectPolicy(s) + for resource := range matchedObjResources { + if len(matchedResource) < len(resource) { + objReadOnly = readOnly + objWriteOnly = writeOnly + matchedResource = resource + } else if len(matchedResource) == len(resource) { + objReadOnly = objReadOnly || readOnly + objWriteOnly = objWriteOnly || writeOnly + matchedResource = resource + } + } + } + if s.Resources.Contains(bucketResource) { + commonFound, readOnly, writeOnly := getBucketPolicy(s, prefix) + bucketCommonFound = bucketCommonFound || commonFound + bucketReadOnly = bucketReadOnly || readOnly + bucketWriteOnly = bucketWriteOnly || writeOnly + } + } + + policy := BucketPolicyNone + if bucketCommonFound { + if bucketReadOnly && bucketWriteOnly && objReadOnly && objWriteOnly { + policy = BucketPolicyReadWrite + } else if bucketReadOnly && objReadOnly { + policy = BucketPolicyReadOnly + } else if bucketWriteOnly && objWriteOnly { + policy = BucketPolicyWriteOnly + } + } + + return policy +} + +// GetPolicies - returns a map of policies of given bucket name, prefix in given statements. +func GetPolicies(statements []Statement, bucketName, prefix string) map[string]BucketPolicy { + policyRules := map[string]BucketPolicy{} + objResources := set.NewStringSet() + // Search all resources related to objects policy + for _, s := range statements { + for r := range s.Resources { + if strings.HasPrefix(r, awsResourcePrefix+bucketName+"/"+prefix) { + objResources.Add(r) + } + } + } + + // Pretend that policy resource as an actual object and fetch its policy + for r := range objResources { + // Put trailing * if exists in asterisk + asterisk := "" + if strings.HasSuffix(r, "*") { + r = r[:len(r)-1] + asterisk = "*" + } + var objectPath string + if len(r) >= len(awsResourcePrefix+bucketName)+1 { + objectPath = r[len(awsResourcePrefix+bucketName)+1:] + } + p := GetPolicy(statements, bucketName, objectPath) + policyRules[bucketName+"/"+objectPath+asterisk] = p + } + return policyRules +} + +// SetPolicy - Returns new statements containing policy of given bucket name and prefix are appended. +func SetPolicy(statements []Statement, policy BucketPolicy, bucketName, prefix string) []Statement { + out := removeStatements(statements, bucketName, prefix) + // fmt.Println("out = ") + // printstatement(out) + ns := newStatements(policy, bucketName, prefix) + // fmt.Println("ns = ") + // printstatement(ns) + + rv := appendStatements(out, ns) + // fmt.Println("rv = ") + // printstatement(rv) + + return rv +} + +// Match function matches wild cards in 'pattern' for resource. +func resourceMatch(pattern, resource string) bool { + if pattern == "" { + return resource == pattern + } + if pattern == "*" { + return true + } + parts := strings.Split(pattern, "*") + if len(parts) == 1 { + return resource == pattern + } + tGlob := strings.HasSuffix(pattern, "*") + end := len(parts) - 1 + if !strings.HasPrefix(resource, parts[0]) { + return false + } + for i := 1; i < end; i++ { + if !strings.Contains(resource, parts[i]) { + return false + } + idx := strings.Index(resource, parts[i]) + len(parts[i]) + resource = resource[idx:] + } + return tGlob || strings.HasSuffix(resource, parts[end]) +} diff --git a/vendor/github.com/minio/minio-go/v7/pkg/s3utils/utils.go b/vendor/github.com/minio/minio-go/v7/pkg/s3utils/utils.go index f49ff64d488..1e888a5aaf0 100644 --- a/vendor/github.com/minio/minio-go/v7/pkg/s3utils/utils.go +++ b/vendor/github.com/minio/minio-go/v7/pkg/s3utils/utils.go @@ -96,10 +96,13 @@ var amazonS3HostFIPS = regexp.MustCompile(`^s3-fips.(.*?).amazonaws.com$`) var amazonS3HostFIPSDualStack = regexp.MustCompile(`^s3-fips.dualstack.(.*?).amazonaws.com$`) // amazonS3HostExpress - regular expression used to determine if an arg is S3 Express zonal endpoint. -var amazonS3HostExpress = regexp.MustCompile(`^s3express-[a-z0-9]{3,7}-az[1-6]\.([a-z0-9-]+)\.amazonaws\.com$`) +// The zone ID may be an Availability Zone (use1-az4) or a Local Zone (usw2-lax1-az1), +// and the dualstack variant (s3express-.dualstack..amazonaws.com) is matched as well. +var amazonS3HostExpress = regexp.MustCompile(`^s3express-[a-z0-9]+(?:-[a-z0-9]+)*-az[0-9]+(?:\.dualstack)?\.([a-z0-9-]+)\.amazonaws\.com$`) // amazonS3HostExpressControl - regular expression used to determine if an arg is S3 express regional endpoint. -var amazonS3HostExpressControl = regexp.MustCompile(`^s3express-control\.([a-z0-9-]+)\.amazonaws\.com$`) +// The dualstack variant (s3express-control-dualstack..amazonaws.com) is matched as well. +var amazonS3HostExpressControl = regexp.MustCompile(`^s3express-control(?:-dualstack)?\.([a-z0-9-]+)\.amazonaws\.com$`) // amazonS3HostDot - regular expression used to determine if an arg is s3 host in . style. var amazonS3HostDot = regexp.MustCompile(`^s3.(.*?).amazonaws.com$`) @@ -361,15 +364,36 @@ func EncodePath(pathName string) string { var ( validBucketName = regexp.MustCompile(`^[A-Za-z0-9][A-Za-z0-9\.\-\_\:]{1,61}[A-Za-z0-9]$`) validBucketNameStrict = regexp.MustCompile(`^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$`) - validBucketNameS3Express = regexp.MustCompile(`^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]--[a-z0-9]{3,7}-az[1-6]--x-s3$`) + validBucketNameS3Express = regexp.MustCompile(`^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]--[a-z0-9]+(?:-[a-z0-9]+)*-az[0-9]+--x-s3$`) ipAddress = regexp.MustCompile(`^(\d+\.){3}\d+$`) ) +// A bucket name is a single path element, so it can never carry a path +// separator nor be a relative path element. Callers that hand a raw request +// path to CheckValidBucketName/CheckValidBucketNameStrict - because the path +// hid the bucket behind a leading "//" - rely on this: "//bucket", "../", +// "/.." and friends have to be rejected as path-shaped input rather than pass +// on a length or character technicality. +func checkBucketNamePathShaped(bucketName string) error { + if strings.ContainsAny(bucketName, `/\`) { + return errors.New("Bucket name cannot contain path separators") + } + if bucketName == "." || bucketName == ".." { + return errors.New("Bucket name cannot be a relative path element") + } + return nil +} + // Common checker for both stricter and basic validation. func checkBucketNameCommon(bucketName string, strict bool) (err error) { if strings.TrimSpace(bucketName) == "" { return errors.New("Bucket name cannot be empty") } + // Checked ahead of the length limits so that path-shaped input is + // diagnosed as such whatever its length. + if err := checkBucketNamePathShaped(bucketName); err != nil { + return err + } if len(bucketName) < 3 { return errors.New("Bucket name cannot be shorter than 3 characters") } @@ -410,6 +434,10 @@ func CheckValidBucketNameS3Express(bucketName string) (err error) { return errors.New("Bucket name cannot be empty for S3 Express") } + if err := checkBucketNamePathShaped(bucketName); err != nil { + return err + } + if len(bucketName) < 3 { return errors.New("Bucket name cannot be shorter than 3 characters for S3 Express") } diff --git a/vendor/github.com/minio/minio-go/v7/pkg/signer/request-signature-streaming-unsigned-trailer.go b/vendor/github.com/minio/minio-go/v7/pkg/signer/request-signature-streaming-unsigned-trailer.go index e18002b8d53..35c50b0c4d3 100644 --- a/vendor/github.com/minio/minio-go/v7/pkg/signer/request-signature-streaming-unsigned-trailer.go +++ b/vendor/github.com/minio/minio-go/v7/pkg/signer/request-signature-streaming-unsigned-trailer.go @@ -61,10 +61,10 @@ func getUSStreamLength(dataLen, chunkSize int64, trailers http.Header) int64 { return streamLen } -// prepareStreamingRequest - prepares a request with appropriate -// headers before computing the seed signature. +// prepareUSStreamingRequest - prepares a request with the headers +// required for an unsigned aws-chunked streaming upload. func prepareUSStreamingRequest(req *http.Request, sessionToken string, dataLen int64, timestamp time.Time) { - req.TransferEncoding = []string{"aws-chunked"} + setAwsChunkedContentEncoding(req) if sessionToken != "" { req.Header.Set("X-Amz-Security-Token", sessionToken) } diff --git a/vendor/github.com/minio/minio-go/v7/pkg/signer/request-signature-streaming.go b/vendor/github.com/minio/minio-go/v7/pkg/signer/request-signature-streaming.go index 4fe0debf5cb..7b13227f806 100644 --- a/vendor/github.com/minio/minio-go/v7/pkg/signer/request-signature-streaming.go +++ b/vendor/github.com/minio/minio-go/v7/pkg/signer/request-signature-streaming.go @@ -48,10 +48,15 @@ const ( // Request headers to be ignored while calculating seed signature for // a request. +// +// Per AWS SigV4 specification: +// +// "If the Content-Type header is present in the request, you must add it +// to the CanonicalHeaders list." +// https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-create-signed-request.html var ignoredStreamingHeaders = map[string]bool{ "Authorization": true, "User-Agent": true, - "Content-Type": true, } // getSignedChunkLength - calculates the length of chunk metadata @@ -132,8 +137,8 @@ func prepareStreamingRequest(req *http.Request, sessionToken string, dataLen int for k := range req.Trailer { req.Header.Add("X-Amz-Trailer", strings.ToLower(k)) } - req.TransferEncoding = []string{"aws-chunked"} } + setAwsChunkedContentEncoding(req) if sessionToken != "" { req.Header.Set("X-Amz-Security-Token", sessionToken) diff --git a/vendor/github.com/minio/minio-go/v7/pkg/signer/request-signature-v4.go b/vendor/github.com/minio/minio-go/v7/pkg/signer/request-signature-v4.go index 2a060c6e792..0ae2256d306 100644 --- a/vendor/github.com/minio/minio-go/v7/pkg/signer/request-signature-v4.go +++ b/vendor/github.com/minio/minio-go/v7/pkg/signer/request-signature-v4.go @@ -331,7 +331,7 @@ func signV4(req http.Request, accessKeyID, secretAccessKey, sessionToken, locati req.Header.Add("X-Amz-Trailer", strings.ToLower(k)) } - req.Header.Set("Content-Encoding", "aws-chunked") + setAwsChunkedContentEncoding(&req) req.Header.Set("x-amz-decoded-content-length", strconv.FormatInt(req.ContentLength, 10)) } @@ -395,7 +395,7 @@ func UnsignedTrailer(req http.Request, trailer http.Header) *http.Request { req.Header.Add("X-Amz-Trailer", strings.ToLower(k)) } - req.Header.Set("Content-Encoding", "aws-chunked") + setAwsChunkedContentEncoding(&req) req.Header.Set("x-amz-decoded-content-length", strconv.FormatInt(req.ContentLength, 10)) // Use custom chunked encoding. diff --git a/vendor/github.com/minio/minio-go/v7/pkg/signer/utils.go b/vendor/github.com/minio/minio-go/v7/pkg/signer/utils.go index 87c99398913..20172c2fb64 100644 --- a/vendor/github.com/minio/minio-go/v7/pkg/signer/utils.go +++ b/vendor/github.com/minio/minio-go/v7/pkg/signer/utils.go @@ -22,6 +22,8 @@ import ( "crypto/sha256" "net/http" "strings" + + "golang.org/x/net/http/httpguts" ) // unsignedPayload - value to be set to X-Amz-Content-Sha256 header when @@ -60,3 +62,26 @@ func signV4TrimAll(input string) string { // unicode.IsSpace() internally here) to one space and return return strings.Join(strings.Fields(input), " ") } + +// awsChunkedEncoding is the content coding AWS SigV4 streaming uploads +// declare on the Content-Encoding header. +const awsChunkedEncoding = "aws-chunked" + +// setAwsChunkedContentEncoding marks the request payload as aws-chunked +// encoded, keeping any content encoding the caller already set, for example +// "aws-chunked,gzip". AWS SigV4 streaming uploads require this header. +// Assigning "aws-chunked" to http.Request.TransferEncoding never reaches +// the wire — net/http silently drops assigned values other than "chunked" — +// so this header is the only signal that declares the aws-chunked framing. +func setAwsChunkedContentEncoding(req *http.Request) { + encodings := req.Header.Values("Content-Encoding") + if httpguts.HeaderValuesContainsToken(encodings, awsChunkedEncoding) { + return + } + existing := strings.TrimSpace(strings.Join(encodings, ",")) + if existing == "" { + req.Header.Set("Content-Encoding", awsChunkedEncoding) + return + } + req.Header.Set("Content-Encoding", awsChunkedEncoding+","+existing) +} diff --git a/vendor/github.com/minio/minio-go/v7/pkg/singleflight/singleflight.go b/vendor/github.com/minio/minio-go/v7/pkg/singleflight/singleflight.go index 49260327f28..ece42b9e66e 100644 --- a/vendor/github.com/minio/minio-go/v7/pkg/singleflight/singleflight.go +++ b/vendor/github.com/minio/minio-go/v7/pkg/singleflight/singleflight.go @@ -172,10 +172,12 @@ func (g *Group[K, V]) doCall(c *call[V], key K, fn func() (V, error)) { } else { panic(e) } - } else if c.err == errGoexit { - // Already in the process of goexit, no need to call again } else { - // Normal return + // Normal return, and runtime.Goexit, which reaches here with + // c.err set to errGoexit. This goroutine is already being torn + // down and must not call runtime.Goexit again: Do callers + // re-Goexit themselves once they see c.err, but DoChan callers + // hold a channel and have nothing else to wake them. for _, ch := range c.chans { ch <- Result[V]{c.val, c.err, c.dups > 0} } diff --git a/vendor/github.com/minio/minio-go/v7/rdma.go b/vendor/github.com/minio/minio-go/v7/rdma.go index 450c9620e5d..5a335e5db62 100644 --- a/vendor/github.com/minio/minio-go/v7/rdma.go +++ b/vendor/github.com/minio/minio-go/v7/rdma.go @@ -12,7 +12,7 @@ package minio // #cgo CFLAGS: -DMINIO_CPP_RDMA // #cgo CXXFLAGS: --std=c++17 -DMINIO_CPP_RDMA -// #cgo LDFLAGS: -lminiocpp +// #cgo LDFLAGS: -lminio // #include // #include import "C" @@ -26,6 +26,25 @@ import ( var ErrRDMANotConnected = errors.New("RDMA infrastructure not connected") +// maxRDMABufferSize is the largest transfer a single RDMA descriptor can +// describe: the x-amz-rdma-token carries the window size in a 32-bit field. +// libminiocpp itself does not fail on a larger buffer: it skips RDMA and +// transfers it over one ordinary HTTP request. The guards below reject it +// instead, so an oversize buffer does not silently become a much slower HTTP +// transfer on a path the caller explicitly opted into for RDMA. Keep this in +// step with kRDMAMaxMemoryRegSize in minio-cpp -- a value even one byte larger +// lets a buffer through here that libminiocpp then declines. The lower bound +// also stops a negative size from wrapping to a huge C.size_t. +const maxRDMABufferSize int64 = 1<<32 - 1 // 4 GiB - 1 + +// rdmaBufferSizeInRange reports whether a descriptor can name this many bytes. +// Both entry points gate on it before converting to C.size_t, so it is the one +// place the bound is expressed -- and the only part of the guard that can be +// exercised without an RDMA device. +func rdmaBufferSizeInRange(size int) bool { + return size >= 0 && int64(size) <= maxRDMABufferSize +} + type rdmaClientHandle struct { cptr *C.miniocpp_client } @@ -52,8 +71,19 @@ func newRDMAClient(c *Client) (*rdmaClientHandle, error) { useHTTPS = 1 } - cptr := C.miniocpp_client_new(endpoint, region, accessKey, secretKey, - sessionToken, useHTTPS) + // Carry this client's trust decision across to libminiocpp, which makes the + // RDMA path's S3 requests itself and would otherwise verify against the + // system store regardless of what the caller configured here. + var skipCertCheck C.int + if rdmaSkipCertVerify(c.httpClient, c.secure) { + skipCertCheck = 1 + } + + // A CA bundle is left to SSL_CERT_FILE, which libminiocpp reads for every + // request: a *x509.CertPool cannot be turned back into the file path this + // argument wants. + cptr := C.miniocpp_client_new_tls(endpoint, region, accessKey, secretKey, + sessionToken, useHTTPS, skipCertCheck, nil) if cptr == nil { return nil, fmt.Errorf("RDMA: %s", lastRDMAError()) } @@ -63,6 +93,12 @@ func newRDMAClient(c *Client) (*rdmaClientHandle, error) { func (c *Client) putObjectRDMA(_ context.Context, bucketName, objectName string, opts PutObjectOptions, ) (UploadInfo, error) { + if !rdmaBufferSizeInRange(opts.RDMABufferSize) { + return UploadInfo{}, fmt.Errorf( + "RDMA put: buffer size %d must be between 0 and the %d bytes an RDMA descriptor can describe", + opts.RDMABufferSize, maxRDMABufferSize) + } + h, err := c.rdma() if err != nil { return UploadInfo{}, err @@ -93,6 +129,12 @@ func (c *Client) putObjectRDMA(_ context.Context, bucketName, objectName string, func (c *Client) getObjectRDMA(_ context.Context, bucketName, objectName string, opts GetObjectOptions, ) (int64, error) { + if !rdmaBufferSizeInRange(opts.RDMABufferSize) { + return 0, fmt.Errorf( + "RDMA get: buffer size %d must be between 0 and the %d bytes an RDMA descriptor can describe", + opts.RDMABufferSize, maxRDMABufferSize) + } + h, err := c.rdma() if err != nil { return 0, err @@ -136,5 +178,7 @@ func AlignedBuffer(n int) unsafe.Pointer { // FreeAlignedBuffer releases a buffer from AlignedBuffer. func FreeAlignedBuffer(p unsafe.Pointer) { C.miniocpp_free_aligned(p) } -// IsRDMAAvailable reports whether cuObj is connected to a cuObjServer. +// IsRDMAAvailable reports whether this host has a usable RDMA device, so an +// RDMA transfer is worth attempting. Whether the server serves RDMA for a +// given object is answered per request, by x-amz-rdma-reply. func IsRDMAAvailable() bool { return C.miniocpp_rdma_available() != 0 } diff --git a/vendor/github.com/minio/minio-go/v7/rdma_callback.go b/vendor/github.com/minio/minio-go/v7/rdma_callback.go new file mode 100644 index 00000000000..48090c57484 --- /dev/null +++ b/vendor/github.com/minio/minio-go/v7/rdma_callback.go @@ -0,0 +1,101 @@ +//go:build rdma + +/* + * MinIO Go Library for Amazon S3 Compatible Cloud Storage + * Copyright 2024-2026 MinIO, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * SPDX-License-Identifier: Apache-2.0 + */ + +package minio + +// A file carrying //export may hold declarations in its cgo preamble but no +// definitions, so the trampoline that reaches this lives in rdma_stream.go. +// The blank line below matters: only the comment block touching `import "C"` +// is the preamble, and this prose is not C. + +// #include +import "C" + +import ( + "context" + "io" + "runtime/cgo" + "unsafe" +) + +// maxConsecutiveEmptyReads bounds how long the callback waits on a reader +// returning (0, nil). bufio uses the same limit for the same reason: tolerate +// a stall, refuse to spin forever. +const maxConsecutiveEmptyReads = 100 + +// rdmaStreamSource is what the C read callback pulls from. +// +// The read error is kept here rather than returned through C: the callback can +// only say "failed", and losing the reason turns an ordinary error on the +// caller's stream into an opaque upload failure. +type rdmaStreamSource struct { + // ctx is observed per callback. libminiocpp's upload is synchronous with + // no cancellation hook, so this is the only place cancellation can be + // seen; it stops the upload at the next part boundary, not instantly. + ctx context.Context + reader io.Reader + err error +} + +//export minioRDMAReadGo +func minioRDMAReadGo(userdata unsafe.Pointer, buf *C.char, size C.size_t) C.ssize_t { + if userdata == nil { + return -1 + } + src, ok := (*(*cgo.Handle)(userdata)).Value().(*rdmaStreamSource) + if !ok { + return -1 + } + if size == 0 { + return 0 + } + if err := src.ctx.Err(); err != nil { + src.err = err + return -1 + } + + // Alias the C buffer rather than copying: Read then writes straight into + // the part buffer libminiocpp registered for RDMA. + dst := unsafe.Slice((*byte)(unsafe.Pointer(buf)), int(size)) + + // An io.Reader may return fewer bytes than asked for without being at EOF, + // and libminiocpp reads a short return as end-of-part. Filling only + // partially mid-stream would upload a short part and truncate the object + // with no error anywhere, so keep pulling until the buffer is full or the + // stream genuinely ends. + total := 0 + empty := 0 + for total < len(dst) { + n, err := src.reader.Read(dst[total:]) + total += n + if err == io.EOF { + break + } + if err != nil { + src.err = err + return -1 + } + if n > 0 { + empty = 0 + continue + } + // A (0, nil) read is legal and does not mean EOF. Returning here would + // hand back a short part, which libminiocpp reads as end-of-object -- + // the upload then succeeds with the rest of the data missing, which is + // the one outcome this loop exists to prevent. Fail instead, once the + // reader has clearly stalled rather than merely paused. + empty++ + if empty >= maxConsecutiveEmptyReads { + src.err = io.ErrNoProgress + return -1 + } + } + return C.ssize_t(total) +} diff --git a/vendor/github.com/minio/minio-go/v7/rdma_stream.go b/vendor/github.com/minio/minio-go/v7/rdma_stream.go new file mode 100644 index 00000000000..0d711bd7c3a --- /dev/null +++ b/vendor/github.com/minio/minio-go/v7/rdma_stream.go @@ -0,0 +1,108 @@ +//go:build rdma + +/* + * MinIO Go Library for Amazon S3 Compatible Cloud Storage + * Copyright 2024-2026 MinIO, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * SPDX-License-Identifier: Apache-2.0 + */ + +package minio + +// #cgo CFLAGS: -DMINIO_CPP_RDMA +// #include +// #include +// #include +// +// // minioRDMAReadGo is defined by cgo from the //export in rdma_callback.go; +// // the file carrying //export may not hold a definition like the one below, +// // which is why the trampoline lives here. It has external linkage on +// // purpose: Go stores its address, and a static function is not resolvable +// // from where the linker needs it. +// extern ssize_t minioRDMAReadGo(void *userdata, char *buf, size_t size); +// ssize_t minioRDMAReadTrampoline(void *userdata, char *buf, size_t size) { +// return minioRDMAReadGo(userdata, buf, size); +// } +import "C" + +import ( + "context" + "fmt" + "io" + "runtime/cgo" + "unsafe" +) + +// putObjectRDMAStream uploads `reader` over RDMA without staging the whole +// object in pinned memory. +// +// libminiocpp drives it: one page-aligned part buffer, registered once for the +// whole upload, then read-part / RDMA UploadPart / repeat, with the per-part +// CRC64NVME the server requires on that path. Pinned memory is therefore one +// part, not one object, and an object past the 4 GiB an RDMA descriptor can +// address uploads fine. +// +// This is a multipart upload, so the ETag carries the usual `-N` suffix rather +// than being an MD5 of the object. +func (c *Client) putObjectRDMAStream(ctx context.Context, bucketName, objectName string, + reader io.Reader, size int64, _ PutObjectOptions, +) (UploadInfo, error) { + if reader == nil { + return UploadInfo{}, fmt.Errorf("RDMA put: a streaming upload needs a reader") + } + if size < 0 { + return UploadInfo{}, fmt.Errorf( + "RDMA put: a streaming RDMA upload needs a known object size, got %d", size) + } + + h, err := c.rdma() + if err != nil { + return UploadInfo{}, err + } + + src := &rdmaStreamSource{ctx: ctx, reader: reader} + handle := cgo.NewHandle(src) + defer handle.Delete() + + // Hand the handle over in C memory rather than as a Go pointer: a + // cgo.Handle is a uintptr, and converting one straight to unsafe.Pointer + // is the misuse go vet rejects. + ud := C.malloc(C.size_t(unsafe.Sizeof(cgo.Handle(0)))) + if ud == nil { + return UploadInfo{}, fmt.Errorf("RDMA put: cannot allocate callback context") + } + defer C.free(ud) + *(*cgo.Handle)(ud) = handle + + bucketC := C.CString(bucketName) + defer C.free(unsafe.Pointer(bucketC)) + objectC := C.CString(objectName) + defer C.free(unsafe.Pointer(objectC)) + + var etagBuf, checksumBuf [64]C.char + // buf is NULL on purpose: libminiocpp allocates and registers the part + // buffer itself. The caller's RDMABuffer is what selects this path, not + // the staging area -- passing it here would ask for a single-shot + // transfer of one buffer instead of a stream. + n := C.miniocpp_put_object(h.cptr, bucketC, objectC, + nil, C.size_t(size), + C.miniocpp_read_cb(C.minioRDMAReadTrampoline), ud, + &etagBuf[0], &checksumBuf[0]) + if n < 0 { + // A read error on the caller's stream reaches C only as "failed", so + // report the reason we kept rather than libminiocpp's generic message. + if src.err != nil { + return UploadInfo{}, fmt.Errorf("RDMA put: reading source: %w", src.err) + } + return UploadInfo{}, fmt.Errorf("RDMA put: %s", lastRDMAError()) + } + + return UploadInfo{ + Bucket: bucketName, + Key: objectName, + Size: int64(n), + ETag: C.GoString(&etagBuf[0]), + ChecksumCRC64NVME: C.GoString(&checksumBuf[0]), + }, nil +} diff --git a/vendor/github.com/minio/minio-go/v7/rdma_stub.go b/vendor/github.com/minio/minio-go/v7/rdma_stub.go index 4a3b344e517..6d505444e61 100644 --- a/vendor/github.com/minio/minio-go/v7/rdma_stub.go +++ b/vendor/github.com/minio/minio-go/v7/rdma_stub.go @@ -12,6 +12,7 @@ package minio import ( "context" "errors" + "io" "unsafe" ) @@ -28,6 +29,12 @@ func (c *Client) putObjectRDMA(_ context.Context, _, _ string, _ PutObjectOption return UploadInfo{}, ErrRDMANotCompiled } +func (c *Client) putObjectRDMAStream(_ context.Context, _, _ string, _ io.Reader, _ int64, + _ PutObjectOptions, +) (UploadInfo, error) { + return UploadInfo{}, ErrRDMANotCompiled +} + func (c *Client) getObjectRDMA(_ context.Context, _, _ string, _ GetObjectOptions) (int64, error) { return 0, ErrRDMANotCompiled } diff --git a/vendor/github.com/minio/minio-go/v7/rdma_tls.go b/vendor/github.com/minio/minio-go/v7/rdma_tls.go new file mode 100644 index 00000000000..602d64b993a --- /dev/null +++ b/vendor/github.com/minio/minio-go/v7/rdma_tls.go @@ -0,0 +1,37 @@ +/* + * MinIO Go Library for Amazon S3 Compatible Cloud Storage + * Copyright 2024-2026 MinIO, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * SPDX-License-Identifier: Apache-2.0 + */ + +package minio + +import "net/http" + +// rdmaSkipCertVerify reports whether the RDMA control plane should skip server +// certificate verification. +// +// RDMA transfers are driven by libminiocpp, which issues its own S3 requests +// instead of going through this package's http.Client. A TLSClientConfig set +// here therefore governs the HTTP path alone: the C++ client verifies against +// the OpenSSL trust store and cannot see it. Left unbridged, RDMA fails against +// exactly the self-signed and private-CA endpoints where the caller's plain S3 +// path succeeds, and no flag rescues it. +// +// Derived from the transport rather than configured separately, so a caller's +// existing --insecure keeps working with no change at the call site. Only +// *http.Transport can be inspected; a caller that wraps its transport in +// another RoundTripper still gets verification. A private CA is named by +// SSL_CERT_FILE in the environment, which libminiocpp reads per request. +func rdmaSkipCertVerify(hc *http.Client, secure bool) bool { + if !secure || hc == nil { + return false + } + tr, ok := hc.Transport.(*http.Transport) + if !ok || tr.TLSClientConfig == nil { + return false + } + return tr.TLSClientConfig.InsecureSkipVerify +} diff --git a/vendor/github.com/minio/minio-go/v7/s3-error.go b/vendor/github.com/minio/minio-go/v7/s3-error.go index 4bcc47d80a0..4ff34156d61 100644 --- a/vendor/github.com/minio/minio-go/v7/s3-error.go +++ b/vendor/github.com/minio/minio-go/v7/s3-error.go @@ -62,6 +62,7 @@ const ( InvalidDuration = "InvalidDuration" XAmzContentSHA256Mismatch = "XAmzContentSHA256Mismatch" XMinioInvalidObjectName = "XMinioInvalidObjectName" + XMinioPaidTierLicenseRequired = "XMinioPaidTierLicenseRequired" NoSuchCORSConfiguration = "NoSuchCORSConfiguration" BucketAlreadyExists = "BucketAlreadyExists" NoSuchVersion = "NoSuchVersion" diff --git a/vendor/github.com/minio/minio-go/v7/upload-limits.go b/vendor/github.com/minio/minio-go/v7/upload-limits.go new file mode 100644 index 00000000000..a697933914d --- /dev/null +++ b/vendor/github.com/minio/minio-go/v7/upload-limits.go @@ -0,0 +1,145 @@ +/* + * MinIO Go Library for Amazon S3 Compatible Cloud Storage + * Copyright 2015-2025 MinIO, Inc. + * + * 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 minio + +import "math" + +// UploadLimits overrides the upload limits the client enforces before sending +// a request. The defaults are the limits Amazon S3 imposes; only raise them +// when the remote endpoint is known to accept the larger values. +// +// A zero field means "use the default", so the zero UploadLimits behaves +// exactly like Amazon S3 — except for MaxSinglePutObjectSize, whose default is +// deliberately not enforced by PutObject. See that field. +// +// New rejects limits it cannot derive a part layout from. No field may be +// negative; the remaining bounds are noted on each field. +type UploadLimits struct { + // MinPartSize is the smallest size allowed for a part that is not the + // last part of a multipart upload. Defaults to 5 MiB. May not exceed + // MaxPartSize. + MinPartSize int64 + + // MaxPartSize is the largest size allowed for a single part. + // Defaults to 5 GiB. MaxPartSize * MaxPartsCount must fit in an int64. + MaxPartSize int64 + + // MaxPartsCount is the maximum number of parts in a single multipart + // upload. Together with MaxPartSize this caps the object size the client + // is willing to upload. Defaults to 10000, and may not exceed 2^53 + // because the part layout is computed in float64. + MaxPartsCount int64 + + // MaxSinglePutObjectSize is the largest object the remote accepts in a + // single PUT. Defaults to 5 GiB. + // + // Unlike the other fields, the 5 GiB default is not enforced by PutObject: + // MinIO and AIStor accept single PUTs far above Amazon's limit, so gating on + // the default would refuse uploads that work today. Setting it explicitly + // does enforce it — PutObject then rejects a larger object outright when + // PutObjectOptions.DisableMultipart is set, and otherwise sends it as a + // multipart upload. + // + // The resolved value, default included, always bounds the single PUT that + // PutObject falls back to when a multipart upload fails with AccessDenied. + // Core.PutObject never checks it. + MaxSinglePutObjectSize int64 +} + +// UploadLimits returns the upload limits this client enforces, with any +// zero field resolved to its Amazon S3 default. +func (c *Client) UploadLimits() UploadLimits { + return UploadLimits{ + MinPartSize: c.limits.minPartSize(), + MaxPartSize: c.limits.maxPartSize(), + MaxPartsCount: c.limits.maxPartsCount(), + MaxSinglePutObjectSize: c.limits.maxSinglePutObjectSize(), + } +} + +// Accessors resolve zero fields to their defaults, so a Client that was not +// built by New still sees the S3 limits. + +func (l UploadLimits) minPartSize() int64 { + if l.MinPartSize > 0 { + return l.MinPartSize + } + return defaultMinPartSize +} + +func (l UploadLimits) maxPartSize() int64 { + if l.MaxPartSize > 0 { + return l.MaxPartSize + } + return defaultMaxPartSize +} + +func (l UploadLimits) maxPartsCount() int64 { + if l.MaxPartsCount > 0 { + return l.MaxPartsCount + } + return defaultMaxPartsCount +} + +func (l UploadLimits) maxSinglePutObjectSize() int64 { + if l.MaxSinglePutObjectSize > 0 { + return l.MaxSinglePutObjectSize + } + return defaultMaxSinglePutObjectSize +} + +// maxObjectSize is the largest object that can be uploaded as a multipart +// upload, ~48.83TiB with the default limits. +func (l UploadLimits) maxObjectSize() int64 { + return l.maxPartSize() * l.maxPartsCount() +} + +func (l UploadLimits) validate() error { + for _, f := range []struct { + name string + value int64 + }{ + {"MinPartSize", l.MinPartSize}, + {"MaxPartSize", l.MaxPartSize}, + {"MaxPartsCount", l.MaxPartsCount}, + {"MaxSinglePutObjectSize", l.MaxSinglePutObjectSize}, + } { + if f.value < 0 { + return errInvalidArgument("UploadLimits." + f.name + " cannot be negative") + } + } + if l.minPartSize() > l.maxPartSize() { + return errInvalidArgument("UploadLimits.MinPartSize cannot be larger than UploadLimits.MaxPartSize") + } + if l.maxPartSize() > math.MaxInt64/l.maxPartsCount() { + return errInvalidArgument("UploadLimits.MaxPartSize multiplied by UploadLimits.MaxPartsCount overflows int64") + } + // The part layout is computed in float64. A MaxPartSize that rounds to or + // above 2^63 does not convert back into int64, and callers allocate buffers + // of the part size the layout reports. + if float64(l.maxPartSize()) >= math.MaxInt64 { + return errInvalidArgument("UploadLimits.MaxPartSize is too large to compute a part layout") + } + // The parts count is bounded by MaxPartsCount and returned as an int, so + // the same rounding has to survive the trip back. Beyond 2^53 float64 no + // longer holds every integer, and at the int64 ceiling it does not convert. + if l.maxPartsCount() > 1<<53 { + return errInvalidArgument("UploadLimits.MaxPartsCount is too large to compute a part layout") + } + return nil +} diff --git a/vendor/github.com/minio/minio-go/v7/utils.go b/vendor/github.com/minio/minio-go/v7/utils.go index 3361464c5dc..d5cb751267d 100644 --- a/vendor/github.com/minio/minio-go/v7/utils.go +++ b/vendor/github.com/minio/minio-go/v7/utils.go @@ -33,6 +33,7 @@ import ( "mime" "net" "net/http" + "net/textproto" "net/url" "regexp" "strconv" @@ -63,7 +64,7 @@ func amzExpirationToExpiryDateRuleID(expiration string) (time.Time, string) { return time.Time{}, "" } -var restoreRegex = regexp.MustCompile(`ongoing-request="(.*?)"(, expiry-date="(.*?)")?`) +var restoreRegex = regexp.MustCompile(`ongoing-request="(.*?)"(, ?expiry-date="(.*?)")?`) func amzRestoreToStruct(restore string) (ongoing bool, expTime time.Time, err error) { matches := restoreRegex.FindStringSubmatch(restore) @@ -105,8 +106,32 @@ func sumMD5Base64(data []byte) string { return base64.StdEncoding.EncodeToString(hash.Sum(nil)) } -// getEndpointURL - construct a new endpoint. +// getEndpointURL - construct a new endpoint from a host[:port] endpoint +// or an http(s):// URL whose scheme agrees with the secure option. func getEndpointURL(endpoint string, secure bool) (*url.URL, error) { + // An endpoint that already carries a scheme is parsed directly instead + // of prefixing another scheme. It must agree with the secure option + // since signing and transport behavior are derived from that option. + // A "://" preceded by a path, query, or fragment delimiter is endpoint + // data rather than a scheme, so such endpoints keep the scheme-less path. + if i := strings.Index(endpoint, "://"); i == 0 || (i > 0 && !strings.ContainsAny(endpoint[:i], "/?#")) { + scheme := strings.ToLower(endpoint[:i]) + if scheme != "http" && scheme != "https" { + return nil, errInvalidArgument("Endpoint url scheme \"" + scheme + "\" is unsupported; use http or https or omit the scheme.") + } + endpointURL, err := url.Parse(endpoint) + if err != nil { + return nil, err + } + if secure != (endpointURL.Scheme == "https") { + return nil, errInvalidArgument("Endpoint url scheme \"" + endpointURL.Scheme + "\" conflicts with the secure option; remove the scheme from the endpoint or align the secure option.") + } + if err := isValidEndpointURL(*endpointURL); err != nil { + return nil, err + } + return endpointURL, nil + } + // If secure is false, use 'http' scheme. scheme := "https" if !secure { @@ -199,6 +224,9 @@ func isValidExpiry(expires time.Duration) error { return nil } +// amzMetaPrefix is the canonical prefix of S3 user metadata headers. +const amzMetaPrefix = "X-Amz-Meta-" + // Extract only necessary metadata header key/values by // filtering them out with a list of custom header keys. func extractObjMetadata(header http.Header) http.Header { @@ -215,7 +243,7 @@ func extractObjMetadata(header http.Header) http.Header { "X-Amz-Website-Redirect-Location", "X-Amz-Server-Side-Encryption", "X-Amz-Tagging-Count", - "X-Amz-Meta-", + amzMetaPrefix, "X-Minio-Meta-", // Add new headers to be preserved. // if you add new headers here, please extend @@ -230,7 +258,7 @@ func extractObjMetadata(header http.Header) http.Header { continue } found = true - if prefix == "X-Amz-Meta-" || prefix == "X-Minio-Meta-" { + if prefix == amzMetaPrefix || prefix == "X-Minio-Meta-" { for index, val := range v { if strings.HasPrefix(val, "=?") { decoder := mime.WordDecoder{} @@ -249,8 +277,29 @@ func extractObjMetadata(header http.Header) http.Header { return filteredHeader } +// stripUserMetadata converts the raw element of MinIO list +// responses into the keyed form StatObject and GetObject return in +// ObjectInfo.UserMetadata: only "X-Amz-Meta-*" entries are kept, with the +// prefix stripped and values passed through verbatim (list responses carry +// the stored values, so no decoding applies). Returns nil if raw contains +// no user metadata. +func stripUserMetadata(raw StringMap) StringMap { + var stripped StringMap + for k, v := range raw { + k = textproto.CanonicalMIMEHeaderKey(k) + if !strings.HasPrefix(k, amzMetaPrefix) { + continue + } + if stripped == nil { + stripped = make(StringMap, len(raw)) + } + stripped[strings.TrimPrefix(k, amzMetaPrefix)] = v + } + return stripped +} + const ( - // RFC 7231#section-7.1.1.1 timetamp format. e.g Tue, 29 Apr 2014 18:30:38 GMT + // RFC 7231#section-7.1.1.1 timestamp format. e.g Tue, 29 Apr 2014 18:30:38 GMT rfc822TimeFormat = "Mon, 2 Jan 2006 15:04:05 GMT" rfc822TimeFormatSingleDigitDay = "Mon, _2 Jan 2006 15:04:05 GMT" rfc822TimeFormatSingleDigitDayTwoDigitYear = "Mon, _2 Jan 06 15:04:05 GMT" @@ -351,8 +400,8 @@ func ToObjectInfo(bucketName, objectName string, h http.Header) (ObjectInfo, err metadata := extractObjMetadata(h) userMetadata := make(map[string]string) for k, v := range metadata { - if strings.HasPrefix(k, "X-Amz-Meta-") { - userMetadata[strings.TrimPrefix(k, "X-Amz-Meta-")] = v[0] + if strings.HasPrefix(k, amzMetaPrefix) { + userMetadata[strings.TrimPrefix(k, amzMetaPrefix)] = v[0] } } @@ -395,7 +444,7 @@ func ToObjectInfo(bucketName, objectName string, h http.Header) (ObjectInfo, err deleteMarker := h.Get(amzDeleteMarker) == "true" // Save object metadata info. - return ObjectInfo{ + objInfo := ObjectInfo{ ETag: etag, Key: objectName, Size: size, @@ -412,6 +461,7 @@ func ToObjectInfo(bucketName, objectName string, h http.Header) (ObjectInfo, err // following function filters out a list of standard set of keys // which are not part of object metadata. Metadata: metadata, + Headers: h, UserMetadata: userMetadata, UserTags: userTags.ToMap(), UserTagCount: tagCount, @@ -430,7 +480,9 @@ func ToObjectInfo(bucketName, objectName string, h http.Header) (ObjectInfo, err ChecksumXXHash128: h.Get(ChecksumXXHash128.Key()), ChecksumAlgorithm: h.Get(amzChecksumAlgo), ChecksumMode: h.Get(ChecksumFullObjectMode.Key()), - }, nil + } + objInfo.setChecksumAlgorithm() + return objInfo, nil } var readFull = func(r io.Reader, buf []byte) (n int, err error) { @@ -623,7 +675,7 @@ func (m *hashWrapper) Close() { m.Hash = nil } -const letterBytes = "abcdefghijklmnopqrstuvwxyz01234569" +const letterBytes = "abcdefghijklmnopqrstuvwxyz0123456789" const ( letterIdxBits = 6 // 6 bits to represent a letter index letterIdxMask = 1< 0 { + remaining = append(remaining, n.V) + } else { + // A leaf closes itself and any ancestors whose last child it was. + for len(remaining) > 0 { + remaining[len(remaining)-1]-- + if remaining[len(remaining)-1] > 0 { + break + } + remaining = remaining[:len(remaining)-1] + } + } + } + numRowGroups := len(metadata.RowGroups) + + cl.columns = make([]Column, numColumns) + // Every column but the root is a child of exactly one group, and appears + // once in that group's fields. + cl.children = make([]*Column, numColumns-1) + cl.fields = make([]Field, numColumns-1) + cl.paths = make([]string, pathSegments) + + if n := numLeaves * numRowGroups; n > 0 { + cl.chunks = make([]*format.ColumnChunk, n) + if len(columnIndexes) > 0 { + cl.columnIndex = make([]*format.ColumnIndex, n) + } + if len(offsetIndexes) > 0 { + cl.offsetIndex = make([]*format.OffsetIndex, n) + } + } +} + +// allocate cuts the first n elements off the front of the slab and returns them +// with their capacity clamped, so that appending to the result cannot reach into +// the rest of the slab. +// +// The caller must have reserved room for n; a slab shorter than that is a +// programming error and panics. Every slab is sized from the schema, and the +// only value the schema does not bound is a group's NumChildren, which open +// checks against the children slab before allocating from it. +func allocate[T any](slab *[]T, n int) []T { + taken := (*slab)[:n:n] + *slab = (*slab)[n:] + return taken } func (cl *columnLoader) open(file *File, metadata *format.FileMetaData, columnIndexes []format.ColumnIndex, offsetIndexes []format.OffsetIndex, path []string) (*Column, error) { - c := &Column{ - file: file, - schema: &metadata.Schema[cl.schemaIndex], + if cl.schemaIndex >= len(cl.columns) { + return nil, fmt.Errorf("column schema index %d is out of range: %d >= %d", + cl.schemaIndex, cl.schemaIndex, len(cl.columns)) } - c.path = columnPath(path).append(c.schema.Name) + c := &cl.columns[cl.schemaIndex] + c.file = file + c.schema = &metadata.Schema[cl.schemaIndex] + + // A column's path is its parent's path plus its own name, cut from the + // shared slab rather than concatenated into a fresh slice per column. + p := allocate(&cl.paths, len(path)+1) + copy(p, path) + p[len(path)] = c.schema.Name + c.path = columnPath(p) cl.schemaIndex++ numChildren := 0 @@ -309,32 +400,32 @@ func (cl *columnLoader) open(file *File, metadata *format.FileMetaData, columnIn rowGroupColumnIndex := cl.rowGroupColumnIndex cl.rowGroupColumnIndex++ - c.chunks = make([]*format.ColumnChunk, 0, len(rowGroups)) - c.columnIndex = make([]*format.ColumnIndex, 0, len(rowGroups)) - c.offsetIndex = make([]*format.OffsetIndex, 0, len(rowGroups)) + c.chunks = allocate(&cl.chunks, len(rowGroups)) for i, rowGroup := range rowGroups { if rowGroupColumnIndex >= len(rowGroup.Columns) { return nil, fmt.Errorf("row group at index %d does not have enough columns", i) } - c.chunks = append(c.chunks, &rowGroup.Columns[rowGroupColumnIndex]) + c.chunks[i] = &rowGroup.Columns[rowGroupColumnIndex] } if len(columnIndexes) > 0 { + c.columnIndex = allocate(&cl.columnIndex, len(rowGroups)) for i := range rowGroups { if rowGroupColumnIndex >= len(columnIndexes) { return nil, fmt.Errorf("row group at index %d does not have enough column index pages", i) } - c.columnIndex = append(c.columnIndex, &columnIndexes[rowGroupColumnIndex]) + c.columnIndex[i] = &columnIndexes[rowGroupColumnIndex] } } if len(offsetIndexes) > 0 { + c.offsetIndex = allocate(&cl.offsetIndex, len(rowGroups)) for i := range rowGroups { if rowGroupColumnIndex >= len(offsetIndexes) { return nil, fmt.Errorf("row group at index %d does not have enough offset index pages", i) } - c.offsetIndex = append(c.offsetIndex, &offsetIndexes[rowGroupColumnIndex]) + c.offsetIndex[i] = &offsetIndexes[rowGroupColumnIndex] } } @@ -351,6 +442,17 @@ func (cl *columnLoader) open(file *File, metadata *format.FileMetaData, columnIn // the page headers to determine which compression and encodings are // applied. for _, encoding := range c.chunks[0].MetaData.Encoding { + // BIT_PACKED appears in the encodings list when the + // deprecated bit-packed encoding was used for repetition + // or definition levels. Encodings.md: "Note that the + // BIT_PACKED encoding method is only supported for + // encoding repetition and definition levels." It is never + // a data page encoding, so it must not be reported as the + // column encoding (it would make schemas derived from + // this file unwritable). + if encoding == format.BitPacked { + continue + } if c.encoding == nil { c.encoding = LookupEncoding(encoding) } @@ -366,21 +468,37 @@ func (cl *columnLoader) open(file *File, metadata *format.FileMetaData, columnIn } c.typ = &groupType{} - if lt := c.schema.LogicalType; lt.Valid && lt.V.Map != nil { + switch c.schema.LogicalType.Value.(type) { + case *format.MapType: c.typ = &mapType{} - } else if lt.Valid && lt.V.List != nil { + case *format.ListType: c.typ = &listType{} - } else if lt.Valid && lt.V.Variant != nil { + case *format.VariantType: c.typ = &variantType{} - } else if ct := c.schema.ConvertedType; ct.Valid { - switch ct.V { - case deprecated.Map: - c.typ = &mapType{} - case deprecated.List: - c.typ = &listType{} + default: + // Fall back on the deprecated converted type when the schema element + // carries no logical type annotation we recognize. + if ct := c.schema.ConvertedType; ct.Valid { + switch ct.V { + case deprecated.Map: + c.typ = &mapType{} + case deprecated.List: + c.typ = &listType{} + } } } - c.columns = make([]*Column, numChildren) + // Bound NumChildren by what the children slab has left rather than by the + // schema elements that remain. Only the slab bounds the total across every + // group: a schema where each group's claim fits the elements after it can + // still claim more children in total than the schema has to give. + if numChildren > len(cl.children) { + return nil, fmt.Errorf("column %q declares %d children but only %d schema elements are left to be children", + c.schema.Name, numChildren, len(cl.children)) + } + + // Reserve this group's children before recursing, so that a child's own + // children are cut from the slab after ours rather than overlapping them. + c.columns = allocate(&cl.children, numChildren) for i := range c.columns { if cl.schemaIndex >= len(metadata.Schema) { @@ -395,7 +513,7 @@ func (cl *columnLoader) open(file *File, metadata *format.FileMetaData, columnIn } } - c.fields = make([]Field, len(c.columns)) + c.fields = allocate(&cl.fields, len(c.columns)) for i, column := range c.columns { c.fields[i] = column } @@ -414,66 +532,63 @@ func isLeafSchemaElement(element *format.SchemaElement) bool { } func schemaElementTypeOf(s *format.SchemaElement) Type { - if s.LogicalType.Valid { - lt := &s.LogicalType.V - // A logical type exists, the Type interface implementations in this - // package are all based on the logical parquet types declared in the - // format sub-package so we can return them directly via a pointer type - // conversion. - switch { - case lt.UTF8 != nil: - return (*stringType)(lt.UTF8) - case lt.Map != nil: - return (*mapType)(lt.Map) - case lt.List != nil: - return (*listType)(lt.List) - case lt.Enum != nil: - return (*enumType)(lt.Enum) - case lt.Decimal != nil: - // A parquet decimal can be one of several different physical types. - if s.Type.Valid { - var typ Type - switch kind := Kind(s.Type.V); kind { - case Int32: - typ = Int32Type - case Int64: - typ = Int64Type - case ByteArray: - typ = ByteArrayType - case FixedLenByteArray: - if !s.TypeLength.Valid { - panic("DECIMAL using FIXED_LEN_BYTE_ARRAY must specify a length") - } - typ = FixedLenByteArrayType(int(s.TypeLength.V)) - default: - panic("DECIMAL must be of type INT32, INT64, BYTE_ARRAY or FIXED_LEN_BYTE_ARRAY but got " + kind.String()) - } - return &decimalType{ - decimal: *lt.Decimal, - Type: typ, + // A logical type exists, the Type interface implementations in this + // package are all based on the logical parquet types declared in the + // format sub-package so we can return them directly via a pointer type + // conversion. + switch lt := s.LogicalType.Value.(type) { + case *format.StringType: + return (*stringType)(lt) + case *format.MapType: + return (*mapType)(lt) + case *format.ListType: + return (*listType)(lt) + case *format.EnumType: + return (*enumType)(lt) + case *format.DecimalType: + // A parquet decimal can be one of several different physical types. + if s.Type.Valid { + var typ Type + switch kind := Kind(s.Type.V); kind { + case Int32: + typ = Int32Type + case Int64: + typ = Int64Type + case ByteArray: + typ = ByteArrayType + case FixedLenByteArray: + if !s.TypeLength.Valid { + panic("DECIMAL using FIXED_LEN_BYTE_ARRAY must specify a length") } + typ = FixedLenByteArrayType(int(s.TypeLength.V)) + default: + panic("DECIMAL must be of type INT32, INT64, BYTE_ARRAY or FIXED_LEN_BYTE_ARRAY but got " + kind.String()) + } + return &decimalType{ + decimal: *lt, + Type: typ, } - case lt.Date != nil: - return (*dateType)(lt.Date) - case lt.Time != nil: - return (*timeType)(lt.Time) - case lt.Timestamp != nil: - return (*timestampType)(lt.Timestamp) - case lt.Integer != nil: - return (*intType)(lt.Integer) - case lt.Unknown != nil: - return (*nullType)(lt.Unknown) - case lt.Json != nil: - return (*jsonType)(lt.Json) - case lt.Bson != nil: - return (*bsonType)(lt.Bson) - case lt.UUID != nil: - return (*uuidType)(lt.UUID) - case lt.Geometry != nil: - return (*geometryType)(lt.Geometry) - case lt.Geography != nil: - return (*geographyType)(lt.Geography) } + case *format.DateType: + return (*dateType)(lt) + case *format.TimeType: + return canonicalTimeType(lt) + case *format.TimestampType: + return canonicalTimestampType(lt) + case *format.IntType: + return canonicalIntType(lt) + case *format.NullType: + return (*nullType)(lt) + case *format.JsonType: + return (*jsonType)(lt) + case *format.BsonType: + return (*bsonType)(lt) + case *format.UUIDType: + return (*uuidType)(lt) + case *format.GeometryType: + return (*geometryType)(lt) + case *format.GeographyType: + return (*geographyType)(lt) } if s.ConvertedType.Valid { @@ -768,6 +883,12 @@ func (c *Column) decodeDataPage(header DataPageHeader, numValues int, repetition return nil, err } + if !isDictionaryEncoding(pageEncoding) { + if err := checkPageDataCapacity(pageKind, c.Type().Length(), numValues, values); err != nil { + return nil, err + } + } + newPage := pageType.NewPage(c.Index(), numValues, values) switch { case c.maxRepetitionLevel > 0: @@ -865,7 +986,35 @@ func (c *Column) decodeDictionary(header DictionaryPageHeader, page *buffer[byte if err != nil { return nil, err } + if err := checkPageDataCapacity(pageType.Kind(), pageType.Length(), numValues, values); err != nil { + return nil, err + } return pageType.NewDictionary(int(c.index), numValues, values), nil } +// check data buffer has enough capacity for the nubmer of values & value type +func checkPageDataCapacity(kind Kind, typeLength, numValues int, values encoding.Values) error { + n := int64(numValues) + var need int64 + switch kind { + case Boolean: // bit packed + need = (n + 7) / 8 + case Int32, Float: + need = 4 * n + case Int64, Double: + need = 8 * n + case Int96: + need = 12 * n + case FixedLenByteArray: + need = int64(typeLength) * n + default: + return nil + } + data, _ := values.Data() + if int64(cap(data)) < need { + return fmt.Errorf("page header declares %d values requiring %d bytes but decoded buffer holds only %d: %w", numValues, need, cap(data), ErrCorrupted) + } + return nil +} + var _ Node = (*Column)(nil) diff --git a/vendor/github.com/parquet-go/parquet-go/column_buffer_geometry.go b/vendor/github.com/parquet-go/parquet-go/column_buffer_geometry.go index 50d83cd00b9..b86757610f4 100644 --- a/vendor/github.com/parquet-go/parquet-go/column_buffer_geometry.go +++ b/vendor/github.com/parquet-go/parquet-go/column_buffer_geometry.go @@ -3,6 +3,7 @@ package parquet import ( "fmt" + "github.com/parquet-go/parquet-go/format" "github.com/twpayne/go-geom" "github.com/twpayne/go-geom/encoding/wkb" ) @@ -14,9 +15,8 @@ func writeGeometry(col ColumnBuffer, levels columnLevels, value geom.T, node Nod } if logicalType := node.Type().LogicalType(); logicalType != nil { - switch { - case logicalType.Geometry != nil: - case logicalType.Geography != nil: + switch logicalType.Value.(type) { + case *format.GeometryType, *format.GeographyType: // valid default: panic("invalid logical type for value of type geom.T, must be Geometry or Geography") diff --git a/vendor/github.com/parquet-go/parquet-go/column_buffer_json.go b/vendor/github.com/parquet-go/parquet-go/column_buffer_json.go index efea249d312..4f444be3c3d 100644 --- a/vendor/github.com/parquet-go/parquet-go/column_buffer_json.go +++ b/vendor/github.com/parquet-go/parquet-go/column_buffer_json.go @@ -10,6 +10,7 @@ import ( "github.com/parquet-go/bitpack/unsafecast" "github.com/parquet-go/jsonlite" + "github.com/parquet-go/parquet-go/format" ) var jsonNull jsonlite.Value @@ -29,7 +30,7 @@ func jsonParse(data []byte) (*jsonlite.Value, error) { func writeJSONToLeaf(col ColumnBuffer, levels columnLevels, val *jsonlite.Value, node Node) { typ := node.Type() if typ.Kind() == ByteArray { - if logicalType := typ.LogicalType(); logicalType != nil && logicalType.Json != nil { + if logicalType := typ.LogicalType(); logicalTypeIs[*format.JsonType](logicalType) { writeJSONToByteArray(col, levels, val, node) return } @@ -103,8 +104,8 @@ func writeJSONString(col ColumnBuffer, levels columnLevels, str string, node Nod typ := node.Type() if logicalType := typ.LogicalType(); logicalType != nil { - switch { - case logicalType.Timestamp != nil: + switch logicalType.Value.(type) { + case *format.TimestampType: t, err := time.Parse(time.RFC3339, str) if err != nil { panic(fmt.Errorf("cannot parse JSON string %q as timestamp: %w", str, err)) @@ -112,7 +113,7 @@ func writeJSONString(col ColumnBuffer, levels columnLevels, str string, node Nod writeTime(col, levels, t, node) return - case logicalType.Date != nil: + case *format.DateType: t, err := time.Parse("2006-01-02", str) if err != nil { panic(fmt.Errorf("cannot parse JSON string %q as date: %w", str, err)) @@ -120,7 +121,7 @@ func writeJSONString(col ColumnBuffer, levels columnLevels, str string, node Nod writeTime(col, levels, t, node) return - case logicalType.Time != nil: + case *format.TimeType: t, err := time.Parse("15:04:05.000000000", str) if err != nil { panic(fmt.Errorf("cannot parse JSON string %q as time: %w", str, err)) @@ -132,7 +133,7 @@ func writeJSONString(col ColumnBuffer, levels columnLevels, str string, node Nod writeDuration(col, levels, d, node) return - case logicalType.UUID != nil: + case *format.UUIDType: // Only parse UUID strings when writing to binary UUID columns // (FIXED_LEN_BYTE_ARRAY with 16 bytes). If writing to a STRING // column with UUID logical type, write the string as-is. @@ -149,8 +150,8 @@ func writeJSONNumber(col ColumnBuffer, levels columnLevels, num json.Number, nod str := num.String() if logicalType := typ.LogicalType(); logicalType != nil { - switch { - case logicalType.Timestamp != nil: + switch logicalType.Value.(type) { + case *format.TimestampType: // Interpret number as seconds since Unix epoch (with sub-second precision) f, err := num.Float64() if err != nil { @@ -161,7 +162,7 @@ func writeJSONNumber(col ColumnBuffer, levels columnLevels, num json.Number, nod writeTime(col, levels, t, node) return - case logicalType.Date != nil: + case *format.DateType: // Interpret number as seconds since Unix epoch i, err := num.Int64() if err != nil { @@ -171,7 +172,7 @@ func writeJSONNumber(col ColumnBuffer, levels columnLevels, num json.Number, nod writeTime(col, levels, t, node) return - case logicalType.Time != nil: + case *format.TimeType: // Interpret number as seconds since midnight f, err := num.Float64() if err != nil { diff --git a/vendor/github.com/parquet-go/parquet-go/column_buffer_proto.go b/vendor/github.com/parquet-go/parquet-go/column_buffer_proto.go index 31bb7f1147c..abcd5338960 100644 --- a/vendor/github.com/parquet-go/parquet-go/column_buffer_proto.go +++ b/vendor/github.com/parquet-go/parquet-go/column_buffer_proto.go @@ -24,17 +24,17 @@ func writeProtoTimestamp(col ColumnBuffer, levels columnLevels, ts *timestamppb. } var typ = node.Type() var unit format.TimeUnit - if lt := typ.LogicalType(); lt != nil && lt.Timestamp != nil { - unit = lt.Timestamp.Unit + if timestamp, ok := logicalTypeOf[*format.TimestampType](typ.LogicalType()); ok { + unit = timestamp.Unit } else { unit = Nanosecond.TimeUnit() } var t = ts.AsTime() var value int64 - switch { - case unit.Millis != nil: + switch unit.Value.(type) { + case *format.MilliSeconds: value = t.UnixMilli() - case unit.Micros != nil: + case *format.MicroSeconds: value = t.UnixMicro() default: value = t.UnixNano() diff --git a/vendor/github.com/parquet-go/parquet-go/column_buffer_reflect.go b/vendor/github.com/parquet-go/parquet-go/column_buffer_reflect.go index c472f533cba..0eedcda062c 100644 --- a/vendor/github.com/parquet-go/parquet-go/column_buffer_reflect.go +++ b/vendor/github.com/parquet-go/parquet-go/column_buffer_reflect.go @@ -20,6 +20,7 @@ import ( "github.com/google/uuid" "github.com/parquet-go/jsonlite" "github.com/parquet-go/parquet-go/deprecated" + "github.com/parquet-go/parquet-go/format" "github.com/parquet-go/parquet-go/internal/memory" "github.com/parquet-go/parquet-go/sparse" "github.com/twpayne/go-geom" @@ -218,15 +219,15 @@ func writeTime(col ColumnBuffer, levels columnLevels, t time.Time, node Node) { typ := node.Type() if logicalType := typ.LogicalType(); logicalType != nil { - switch { - case logicalType.Timestamp != nil: + switch lt := logicalType.Value.(type) { + case *format.TimestampType: // TIMESTAMP logical type -> write to int64 - unit := logicalType.Timestamp.Unit + unit := lt.Unit var val int64 - switch { - case unit.Millis != nil: + switch unit.Value.(type) { + case *format.MilliSeconds: val = t.UnixMilli() - case unit.Micros != nil: + case *format.MicroSeconds: val = t.UnixMicro() default: val = t.UnixNano() @@ -234,19 +235,19 @@ func writeTime(col ColumnBuffer, levels columnLevels, t time.Time, node Node) { col.writeInt64(levels, val) return - case logicalType.Date != nil: + case *format.DateType: // DATE logical type -> write to int32 col.writeInt32(levels, int32(daysSinceUnixEpoch(t))) return - case logicalType.Time != nil: + case *format.TimeType: // TIME logical type -> write time of day - unit := logicalType.Time.Unit + unit := lt.Unit nanos := timeOfDayNanos(t) - switch { - case unit.Millis != nil: + switch unit.Value.(type) { + case *format.MilliSeconds: col.writeInt32(levels, int32(nanos/1e6)) - case unit.Micros != nil: + case *format.MicroSeconds: col.writeInt64(levels, nanos/1e3) default: col.writeInt64(levels, nanos) @@ -281,13 +282,13 @@ func writeTime(col ColumnBuffer, levels columnLevels, t time.Time, node Node) { func writeDuration(col ColumnBuffer, levels columnLevels, d time.Duration, node Node) { typ := node.Type() - if logicalType := typ.LogicalType(); logicalType != nil && logicalType.Time != nil { + if lt, ok := logicalTypeOf[*format.TimeType](typ.LogicalType()); ok { // TIME logical type - unit := logicalType.Time.Unit - switch { - case unit.Millis != nil: + unit := lt.Unit + switch unit.Value.(type) { + case *format.MilliSeconds: col.writeInt32(levels, int32(d.Milliseconds())) - case unit.Micros != nil: + case *format.MicroSeconds: col.writeInt64(levels, d.Microseconds()) default: col.writeInt64(levels, d.Nanoseconds()) @@ -808,9 +809,8 @@ func writeValueFuncOfLeaf(columnIndex uint16, node Node) (uint16, writeValueFunc case reflect.Float32: typ := node.Type() - logicalType := typ.LogicalType() - if logicalType != nil && logicalType.Decimal != nil { - decimalValue(col, levels, typ, value, logicalType.Decimal.Scale) + if decimal, ok := logicalTypeOf[*format.DecimalType](typ.LogicalType()); ok { + decimalValue(col, levels, typ, value, decimal.Scale) return } col.writeFloat(levels, float32(value.Float())) @@ -818,9 +818,8 @@ func writeValueFuncOfLeaf(columnIndex uint16, node Node) (uint16, writeValueFunc case reflect.Float64: typ := node.Type() - logicalType := typ.LogicalType() - if logicalType != nil && logicalType.Decimal != nil { - decimalValue(col, levels, typ, value, logicalType.Decimal.Scale) + if decimal, ok := logicalTypeOf[*format.DecimalType](typ.LogicalType()); ok { + decimalValue(col, levels, typ, value, decimal.Scale) return } @@ -834,8 +833,7 @@ func writeValueFuncOfLeaf(columnIndex uint16, node Node) (uint16, writeValueFunc writeJSONNumber(col, levels, json.Number(v), node) default: typ := node.Type() - logicalType := typ.LogicalType() - if logicalType != nil && logicalType.UUID != nil { + if logicalTypeIs[*format.UUIDType](typ.LogicalType()) { writeUUID(col, levels, v, typ) return } @@ -972,15 +970,15 @@ func numberToByteArray(data any) []byte { func writeBigFloat(col ColumnBuffer, levels columnLevels, f *big.Float, node Node) { typ := node.Type() - logicalType := typ.LogicalType() - if logicalType == nil || logicalType.Decimal == nil { + decimal, ok := logicalTypeOf[*format.DecimalType](typ.LogicalType()) + if !ok { panic("writeBigFloat requires a decimal logical type") } - scale := int(logicalType.Decimal.Scale) + scale := int(decimal.Scale) // Compute minimum precision needed: decimal precision * log2(10) ≈ precision * 3.32 // We use precision * 4 + 64 for safety margin - minPrec := uint(logicalType.Decimal.Precision)*4 + 64 + minPrec := uint(decimal.Precision)*4 + 64 prec := max(f.Prec(), minPrec) scaleFactor := new(big.Float).SetPrec(prec) scaleFactor.SetInt(new(big.Int).Exp(big.NewInt(10), big.NewInt(int64(scale)), nil)) diff --git a/vendor/github.com/parquet-go/parquet-go/column_buffer_variant.go b/vendor/github.com/parquet-go/parquet-go/column_buffer_variant.go index 2c1b982835e..d611755b952 100644 --- a/vendor/github.com/parquet-go/parquet-go/column_buffer_variant.go +++ b/vendor/github.com/parquet-go/parquet-go/column_buffer_variant.go @@ -7,8 +7,6 @@ import ( "github.com/parquet-go/parquet-go/variant" ) -// writeValueFuncOfVariant handles writing Go values to variant column buffers. -// Dispatches to unshredded or shredded variant handling. func writeValueFuncOfVariant(columnIndex uint16, node Node) (uint16, writeValueFunc) { if isUnshreddedVariant(node) { return writeValueFuncOfUnshreddedVariant(columnIndex, node) @@ -16,7 +14,6 @@ func writeValueFuncOfVariant(columnIndex uint16, node Node) (uint16, writeValueF return writeValueFuncOfShreddedVariant(columnIndex, node) } -// writeValueFuncOfUnshreddedVariant handles the simple 2-column variant. func writeValueFuncOfUnshreddedVariant(columnIndex uint16, node Node) (uint16, writeValueFunc) { metadataColumnIndex := columnIndex valueColumnIndex := columnIndex + 1 @@ -29,127 +26,102 @@ func writeValueFuncOfUnshreddedVariant(columnIndex uint16, node Node) (uint16, w } } -// writeValueFuncOfShreddedVariant handles the 3-field shredded variant. +// writeValueFuncOfShreddedVariant writes Go values into a shredded variant +// group per the Variant Shredding specification. It shares the shredding +// logic with the row-based write path (variant_shredded_write.go) by +// shredding into a scratch column buffer and flushing the resulting values +// with their levels to the column buffers. func writeValueFuncOfShreddedVariant(columnIndex uint16, node Node) (uint16, writeValueFunc) { - // Fields are sorted alphabetically: metadata, typed_value, value - var metadataColumnIndex, valueColumnIndex, typedValueStartColumn uint16 - var typedValueLeafCount uint16 - var typedValueNode Node - - col := columnIndex - for _, f := range node.Fields() { - n := numLeafColumnsOf(f) - switch f.Name() { - case "metadata": - metadataColumnIndex = col - col += n - case "typed_value": - typedValueStartColumn = col - typedValueNode = f - typedValueLeafCount = n - col += n - case "value": - valueColumnIndex = col - col += n + // Schemas that cannot be written to (e.g. missing the metadata column) + // may still be read from; fail when a row is written, not at build time. + group, err := buildShreddedVariantGroup(node, 0, 0, 0) + if err == nil && group.metadataCol < 0 { + err = fmt.Errorf("variant: shredded variant group has no metadata field") + } + if err != nil { + numCols := numLeafColumnsOf(node) + return columnIndex + numCols, func([]ColumnBuffer, columnLevels, reflect.Value) { + panic(fmt.Sprintf("invalid shredded variant schema: %v", err)) } } - nextColumnIndex := col - - typedInner := Required(typedValueNode) - matcher := buildShreddedMatcher(typedInner) + nextColumnIndex := columnIndex + uint16(group.numCols) return nextColumnIndex, func(columns []ColumnBuffer, levels columnLevels, value reflect.Value) { - metadata, val := variantMarshalOrNull(value) - columns[metadataColumnIndex].writeByteArray(levels, metadata) + // An invalid value means an enclosing optional/repeated wrapper is + // null for this row: the whole variant group is null. + if !value.IsValid() { + for col := range group.numCols { + columns[columnIndex+uint16(col)].writeNull(levels) + } + return + } - goVal := extractGoValue(value) - if goVal != nil && matcher.canShred(goVal) { - // Write null to value column - columns[valueColumnIndex].writeNull(levels) - // Write typed value (increment def level for optional wrapper) - typedLevels := levels - typedLevels.definitionLevel++ - writeShredded(columns, typedLevels, typedValueStartColumn, &matcher, goVal) + var v variant.Value + if metaBytes, valBytes, ok := extractRawVariantStruct(value); ok { + m, err := variant.DecodeMetadata(metaBytes) + if err != nil { + panic(fmt.Sprintf("variant metadata: %v", err)) + } + if v, err = variant.Decode(m, valBytes); err != nil { + panic(fmt.Sprintf("variant decode: %v", err)) + } } else { - // Write variant bytes to value column - valueLevels := levels - valueLevels.definitionLevel++ - columns[valueColumnIndex].writeByteArray(valueLevels, val) - // Write null to all typed_value columns - for col := typedValueStartColumn; col < typedValueStartColumn+typedValueLeafCount; col++ { - columns[col].writeNull(levels) + var err error + if v, err = variant.ValueOf(extractGoValue(value)); err != nil { + panic(fmt.Sprintf("variant marshal: %v", err)) } } - } -} -// writeShredded writes a shredded value to the column buffers. -func writeShredded(columns []ColumnBuffer, levels columnLevels, startColumn uint16, m *shreddedMatcher, v any) { - if m.isPrimitive() { - pv := goValueToParquetValue(v, m.kind()) - col := columns[startColumn] - switch m.kind() { - case Boolean: - col.writeBoolean(levels, pv.Boolean()) - case Int32: - col.writeInt32(levels, pv.Int32()) - case Int64: - col.writeInt64(levels, pv.Int64()) - case Float: - col.writeFloat(levels, pv.Float()) - case Double: - col.writeDouble(levels, pv.Double()) - case ByteArray: - col.writeByteArray(levels, pv.ByteArray()) - default: - col.writeByteArray(levels, pv.ByteArray()) - } - return - } - if m.isGroup() { - writeShreddedObject(columns, levels, startColumn, m, v) - } -} + var b variant.MetadataBuilder + addVariantFieldNames(&b, v) -func writeShreddedObject(columns []ColumnBuffer, levels columnLevels, startColumn uint16, m *shreddedMatcher, v any) { - obj, ok := v.(map[string]any) - if !ok { - return - } + // One backing slab gives every scratch column capacity for the + // common one-value-per-column case without a per-column allocation; + // only columns under a repeated list can grow past it. + scratch := make([][]Value, group.numCols) + slab := make([]Value, len(scratch)) + for i := range scratch { + scratch[i] = slab[i : i : i+1] + } + group.write(scratch, 0, &b, v, true, shredLevels{ + baseDef: int(levels.definitionLevel), + baseRep: int(levels.repetitionDepth), + rep: levels.repetitionLevel, + }) - col := startColumn - for _, f := range m.fields { - // Within each field's sub-group, fields are sorted alphabetically: - // typed_value comes before value. - typedValueCol := col - typedCount := f.matcher.leafCount - valueCol := col + typedCount - nextFieldCol := valueCol + 1 + _, metadata := b.Build() + columns[columnIndex+uint16(group.metadataCol)].writeByteArray(levels, metadata) - fieldVal, exists := obj[f.name] - if exists && fieldVal != nil && f.matcher.canShred(fieldVal) { - columns[valueCol].writeNull(levels) - typedLevels := levels - typedLevels.definitionLevel++ - writeShredded(columns, typedLevels, typedValueCol, &f.matcher, fieldVal) - } else if exists && fieldVal != nil { - valueLevels := levels - valueLevels.definitionLevel++ - metadata, val, err := variant.Marshal(fieldVal) - if err != nil { - panic(fmt.Sprintf("variant marshal field %q: %v", f.name, err)) + for col, values := range scratch { + if col == group.metadataCol { + continue } - combined := encodeFieldVariant(metadata, val) - columns[valueCol].writeByteArray(valueLevels, combined) - for c := typedValueCol; c < typedValueCol+typedCount; c++ { - columns[c].writeNull(levels) - } - } else { - for c := typedValueCol; c < nextFieldCol; c++ { - columns[c].writeNull(levels) + buffer := columns[columnIndex+uint16(col)] + for _, val := range values { + valueLevels := columnLevels{ + repetitionDepth: levels.repetitionDepth, + repetitionLevel: val.repetitionLevel, + definitionLevel: val.definitionLevel, + } + if val.IsNull() { + buffer.writeNull(valueLevels) + continue + } + switch val.Kind() { + case Boolean: + buffer.writeBoolean(valueLevels, val.Boolean()) + case Int32: + buffer.writeInt32(valueLevels, val.Int32()) + case Int64: + buffer.writeInt64(valueLevels, val.Int64()) + case Float: + buffer.writeFloat(valueLevels, val.Float()) + case Double: + buffer.writeDouble(valueLevels, val.Double()) + default: + buffer.writeByteArray(valueLevels, val.ByteArray()) + } } } - - col = nextFieldCol } } diff --git a/vendor/github.com/parquet-go/parquet-go/column_buffer_write.go b/vendor/github.com/parquet-go/parquet-go/column_buffer_write.go index dbe1413b458..fcdce3883b8 100644 --- a/vendor/github.com/parquet-go/parquet-go/column_buffer_write.go +++ b/vendor/github.com/parquet-go/parquet-go/column_buffer_write.go @@ -12,6 +12,7 @@ import ( "github.com/parquet-go/jsonlite" "github.com/parquet-go/parquet-go/deprecated" + "github.com/parquet-go/parquet-go/format" "github.com/parquet-go/parquet-go/internal/memory" "github.com/parquet-go/parquet-go/sparse" "google.golang.org/protobuf/types/known/structpb" @@ -34,7 +35,7 @@ type writeRowsFunc func(columns []ColumnBuffer, levels columnLevels, rows sparse func writeRowsFuncOf(t reflect.Type, schema *Schema, path columnPath, tagReplacements []StructTagOption) writeRowsFunc { if leaf, exists := schema.Lookup(path...); exists { logicalType := leaf.Node.Type().LogicalType() - if logicalType != nil && logicalType.Json != nil { + if logicalTypeIs[*format.JsonType](logicalType) { return writeRowsFuncOfJSON(t, schema, path) } } @@ -918,21 +919,21 @@ func writeRowsFuncOfJSON(t reflect.Type, schema *Schema, path columnPath) writeR func writeRowsFuncOfTime(_ reflect.Type, schema *Schema, path columnPath, tagReplacements []StructTagOption) writeRowsFunc { t := reflect.TypeFor[int64]() - elemSize := uintptr(t.Size()) writeRows := writeRowsFuncOf(t, schema, path, tagReplacements) col, _ := schema.Lookup(path...) unit := Nanosecond.TimeUnit() lt := col.Node.Type().LogicalType() - if lt != nil && lt.Timestamp != nil { - unit = lt.Timestamp.Unit + if ts, ok := logicalTypeOf[*format.TimestampType](lt); ok { + unit = ts.Unit } // Check if the column is optional isOptional := col.Node.Optional() return func(columns []ColumnBuffer, levels columnLevels, rows sparse.Array) { - if rows.Len() == 0 { + n := rows.Len() + if n == 0 { writeRows(columns, levels, rows) return } @@ -945,38 +946,53 @@ func writeRowsFuncOfTime(_ reflect.Type, schema *Schema, path columnPath, tagRep // definitionLevel starts at 0. alreadyHandled := isOptional && levels.definitionLevel > 0 - times := rows.TimeArray() - for i := range times.Len() { - t := times.Index(i) + buf := wideIntBufPool.Get( + func() *wideIntBuf { return new(wideIntBuf) }, + func(b *wideIntBuf) { b.values = b.values[:0] }, + ) + buf.values = slices.Grow(buf.values, n)[:n] + defer wideIntBufPool.Put(buf) - // For optional fields, check if the value is zero - // (unless already handled by pointer wrapper). - elemLevels := levels - if isOptional && !alreadyHandled && t.IsZero() { - // Write as NULL (don't increment definition level). - empty := sparse.Array{} - writeRows(columns, elemLevels, empty) - continue + times := rows.TimeArray() + switch unit.Value.(type) { + case *format.MilliSeconds: + for i := range n { + buf.values[i] = times.Index(i).UnixMilli() } - - // For optional non-zero values, increment definition level - // (unless already handled). - if isOptional && !alreadyHandled { - elemLevels.definitionLevel++ + case *format.MicroSeconds: + for i := range n { + buf.values[i] = times.Index(i).UnixMicro() } + default: + for i := range n { + buf.values[i] = times.Index(i).UnixNano() + } + } - var val int64 - switch { - case unit.Millis != nil: - val = t.UnixMilli() - case unit.Micros != nil: - val = t.UnixMicro() - default: - val = t.UnixNano() + if !isOptional || alreadyHandled { + writeRows(columns, levels, sparse.MakeInt64Array(buf.values).UnsafeArray()) + return + } + + i := 0 + empty := sparse.Array{} + for i < n { + j := i + isNull := times.Index(i).IsZero() + for j < n && times.Index(j).IsZero() == isNull { + j++ } - a := makeArray(reflectValueData(reflect.ValueOf(val)), 1, elemSize) - writeRows(columns, elemLevels, a) + if isNull { + for k := i; k < j; k++ { + writeRows(columns, levels, empty) + } + } else { + elemLevels := levels + elemLevels.definitionLevel++ + writeRows(columns, elemLevels, sparse.MakeInt64Array(buf.values[i:j]).UnsafeArray()) + } + i = j } } } diff --git a/vendor/github.com/parquet-go/parquet-go/compare.go b/vendor/github.com/parquet-go/parquet-go/compare.go index c37f2f7e066..49817afbce8 100644 --- a/vendor/github.com/parquet-go/parquet-go/compare.go +++ b/vendor/github.com/parquet-go/parquet-go/compare.go @@ -1,6 +1,7 @@ package parquet import ( + "bytes" "encoding/binary" "github.com/parquet-go/parquet-go/deprecated" @@ -226,12 +227,170 @@ func compareRowsFuncOfIndexColumns(compareFuncs []func(Row, Row) int) func(Row, //go:noinline func compareRowsFuncOfIndexAscending(columnIndex uint16, typ Type) func(Row, Row) int { - return func(row1, row2 Row) int { return typ.Compare(row1[columnIndex], row2[columnIndex]) } + switch t := typ.(type) { + case int32Type: + return func(row1, row2 Row) int { + return compareInt32(row1[columnIndex].int32(), row2[columnIndex].int32()) + } + case uint32Type: + return func(row1, row2 Row) int { + return compareUint32(row1[columnIndex].uint32(), row2[columnIndex].uint32()) + } + case int64Type: + return func(row1, row2 Row) int { + return compareInt64(row1[columnIndex].int64(), row2[columnIndex].int64()) + } + case uint64Type: + return func(row1, row2 Row) int { + return compareUint64(row1[columnIndex].uint64(), row2[columnIndex].uint64()) + } + case floatType: + return func(row1, row2 Row) int { + return compareFloat32(row1[columnIndex].float(), row2[columnIndex].float()) + } + case doubleType: + return func(row1, row2 Row) int { + return compareFloat64(row1[columnIndex].double(), row2[columnIndex].double()) + } + case booleanType: + return func(row1, row2 Row) int { + return compareBool(row1[columnIndex].boolean(), row2[columnIndex].boolean()) + } + case byteArrayType, *stringType, fixedLenByteArrayType, *enumType, *geographyType, *bsonType, *geometryType, *jsonType: + return func(row1, row2 Row) int { + return bytes.Compare(row1[columnIndex].byteArray(), row2[columnIndex].byteArray()) + } + case be128Type, *uuidType: + return func(row1, row2 Row) int { + return compareBE128(row1[columnIndex].be128(), row2[columnIndex].be128()) + } + case *dateType: + return func(row1, row2 Row) int { + return compareInt32(row1[columnIndex].int32(), row2[columnIndex].int32()) + } + case *timestampType: + return func(row1, row2 Row) int { + return compareInt64(row1[columnIndex].int64(), row2[columnIndex].int64()) + } + case *timeType: + if t.useInt32() { + return func(row1, row2 Row) int { + return compareInt32(row1[columnIndex].int32(), row2[columnIndex].int32()) + } + } else { + return func(row1, row2 Row) int { + return compareInt64(row1[columnIndex].int64(), row2[columnIndex].int64()) + } + } + case *intType: + if t.BitWidth == 64 { + if t.IsSigned { + return func(row1, row2 Row) int { + return compareInt64(row1[columnIndex].int64(), row2[columnIndex].int64()) + } + } else { + return func(row1, row2 Row) int { + return compareUint64(row1[columnIndex].uint64(), row2[columnIndex].uint64()) + } + } + } else { + if t.IsSigned { + return func(row1, row2 Row) int { + return compareInt32(row1[columnIndex].int32(), row2[columnIndex].int32()) + } + } else { + return func(row1, row2 Row) int { + return compareUint32(row1[columnIndex].uint32(), row2[columnIndex].uint32()) + } + } + } + default: + return func(row1, row2 Row) int { return typ.Compare(row1[columnIndex], row2[columnIndex]) } + } } //go:noinline func compareRowsFuncOfIndexDescending(columnIndex uint16, typ Type) func(Row, Row) int { - return func(row1, row2 Row) int { return -typ.Compare(row1[columnIndex], row2[columnIndex]) } + switch t := typ.(type) { + case int32Type: + return func(row1, row2 Row) int { + return -compareInt32(row1[columnIndex].int32(), row2[columnIndex].int32()) + } + case uint32Type: + return func(row1, row2 Row) int { + return -compareUint32(row1[columnIndex].uint32(), row2[columnIndex].uint32()) + } + case int64Type: + return func(row1, row2 Row) int { + return -compareInt64(row1[columnIndex].int64(), row2[columnIndex].int64()) + } + case uint64Type: + return func(row1, row2 Row) int { + return -compareUint64(row1[columnIndex].uint64(), row2[columnIndex].uint64()) + } + case floatType: + return func(row1, row2 Row) int { + return -compareFloat32(row1[columnIndex].float(), row2[columnIndex].float()) + } + case doubleType: + return func(row1, row2 Row) int { + return -compareFloat64(row1[columnIndex].double(), row2[columnIndex].double()) + } + case booleanType: + return func(row1, row2 Row) int { + return -compareBool(row1[columnIndex].boolean(), row2[columnIndex].boolean()) + } + case byteArrayType, *stringType, fixedLenByteArrayType, *enumType, *geographyType, *bsonType, *geometryType, *jsonType: + return func(row1, row2 Row) int { + return -bytes.Compare(row1[columnIndex].byteArray(), row2[columnIndex].byteArray()) + } + case be128Type, *uuidType: + return func(row1, row2 Row) int { + return -compareBE128(row1[columnIndex].be128(), row2[columnIndex].be128()) + } + case *dateType: + return func(row1, row2 Row) int { + return -compareInt32(row1[columnIndex].int32(), row2[columnIndex].int32()) + } + case *timestampType: + return func(row1, row2 Row) int { + return -compareInt64(row1[columnIndex].int64(), row2[columnIndex].int64()) + } + case *timeType: + if t.useInt32() { + return func(row1, row2 Row) int { + return -compareInt32(row1[columnIndex].int32(), row2[columnIndex].int32()) + } + } else { + return func(row1, row2 Row) int { + return -compareInt64(row1[columnIndex].int64(), row2[columnIndex].int64()) + } + } + case *intType: + if t.BitWidth == 64 { + if t.IsSigned { + return func(row1, row2 Row) int { + return -compareInt64(row1[columnIndex].int64(), row2[columnIndex].int64()) + } + } else { + return func(row1, row2 Row) int { + return -compareUint64(row1[columnIndex].uint64(), row2[columnIndex].uint64()) + } + } + } else { + if t.IsSigned { + return func(row1, row2 Row) int { + return -compareInt32(row1[columnIndex].int32(), row2[columnIndex].int32()) + } + } else { + return func(row1, row2 Row) int { + return -compareUint32(row1[columnIndex].uint32(), row2[columnIndex].uint32()) + } + } + } + default: + return func(row1, row2 Row) int { return -typ.Compare(row1[columnIndex], row2[columnIndex]) } + } } //go:noinline diff --git a/vendor/github.com/parquet-go/parquet-go/config.go b/vendor/github.com/parquet-go/parquet-go/config.go index 6492d07c798..a21f3ed2fac 100644 --- a/vendor/github.com/parquet-go/parquet-go/config.go +++ b/vendor/github.com/parquet-go/parquet-go/config.go @@ -319,6 +319,7 @@ func (c *WriterConfig) ConfigureWriter(config *WriterConfig) { SkipPageBounds: coalesceSlices(c.SkipPageBounds, config.SkipPageBounds), SkipPageStatistics: coalesceSlices(c.SkipPageStatistics, config.SkipPageStatistics), Encodings: encodings, + DictionaryMaxBytes: cmp.Or(c.DictionaryMaxBytes, config.DictionaryMaxBytes), SchemaConfig: cmp.Or(c.SchemaConfig, config.SchemaConfig), Encryption: cmp.Or(c.Encryption, config.Encryption), } diff --git a/vendor/github.com/parquet-go/parquet-go/convert.go b/vendor/github.com/parquet-go/parquet-go/convert.go index a1d0439945b..93195d04a49 100644 --- a/vendor/github.com/parquet-go/parquet-go/convert.go +++ b/vendor/github.com/parquet-go/parquet-go/convert.go @@ -62,8 +62,11 @@ type Conversion interface { type conversion struct { columns []conversionColumn - schema *Schema - buffers memory.Pool[conversionBuffer] + // Shredded variant columns of the source being reconstructed to + // unshredded variant columns of the target (see convert_variant.go). + variants []variantConversion + schema *Schema + buffers memory.Pool[conversionBuffer] // This field is used to size the column buffers held in the memory.Pool since // they are intended to store the source rows being converted from. numberOfSourceColumns int @@ -71,6 +74,9 @@ type conversion struct { type conversionBuffer struct { columns [][]Value + // Per-variant-conversion scratch space, reused across rows (see + // convert_variant.go). + variants []variantScratch } type conversionColumn struct { @@ -78,6 +84,11 @@ type conversionColumn struct { convertValues conversionFunc targetKind Kind // Target column kind for creating proper null values isOptional bool // Whether the target column is optional (for null handling) + // Index in conversion.variants of the variant conversion producing this + // column, or -1; variantOutput selects its metadata (0) or value (1) + // output column. + variantIndex int + variantOutput int } type conversionFunc func([]Value) error @@ -189,6 +200,17 @@ func convertToLevels(repetitionLevels, definitionLevels []byte) conversionFunc { for i := range column { r := column[i].repetitionLevel d := column[i].definitionLevel + // Source levels that exceed the lookup-table size can be produced + // when maskMissingRowGroupColumns or sibling-fallback synthesizes + // values for schemas where source and target disagree on optionality + // or nesting depth. Without this guard, the convertedRows reader + // panics with "index out of range" inside this hot loop. Treat the + // value as null so downstream Reconstruct skips it instead of + // dereferencing a placeholder's nil byte-array pointer. + if int(r) >= len(repetitionLevels) || int(d) >= len(definitionLevels) { + column[i] = Value{} + continue + } column[i].repetitionLevel = repetitionLevels[r] column[i].definitionLevel = definitionLevels[d] } @@ -218,7 +240,8 @@ func (c *conversion) getBuffer() *conversionBuffer { return c.buffers.Get( func() *conversionBuffer { b := &conversionBuffer{ - columns: make([][]Value, c.numberOfSourceColumns), + columns: make([][]Value, c.numberOfSourceColumns), + variants: make([]variantScratch, len(c.variants)), } values := make([]Value, c.numberOfSourceColumns) for i := range b.columns { @@ -250,7 +273,26 @@ func (c *conversion) Convert(rows []Row) (int, error) { }) row = row[:0] + // Reconstruct shredded variant columns once per row; the column + // loop below picks up the metadata and value outputs. + for k := range c.variants { + if err := c.variants[k].convert(source.columns, &source.variants[k]); err != nil { + return n, err + } + } + for columnIndex, conv := range c.columns { + if conv.variantIndex >= 0 { + // Values already carry final levels and column indexes. + scratch := &source.variants[conv.variantIndex] + if conv.variantOutput == 0 { + row = append(row, scratch.metas...) + } else { + row = append(row, scratch.values...) + } + continue + } + columnOffset := len(row) // Get source values if available @@ -318,6 +360,11 @@ func (id identity) Schema() *Schema { return id.schema } // stripped out of the rows. Extra columns in the target schema will be set to // null or zero values. // +// Variant columns that the target declares unshredded but the source stores +// shredded are reconstructed with the construct_variant algorithm of the +// Variant Shredding specification instead of being mapped column-by-column +// (see convert_variant.go). +// // The returned function is intended to be used to append the converted source // row to the destination buffer. func Convert(to, from Node) (conv Conversion, err error) { @@ -330,6 +377,34 @@ func Convert(to, from Node) (conv Conversion, err error) { return identity{schema}, nil } + // Variant columns that the target declares unshredded but the source + // stores shredded are reconstructed, not mapped column-by-column (see + // convert_variant.go). + variants := findVariantConversions(to, from) + variantColumns := make(map[int]conversionColumn, 2*len(variants)) + for k := range variants { + vc := &variants[k] + metaSource, valueSource := 0, 0 + if vc.group != nil { + metaSource = vc.group.metadataCol + // Shredded groups without a value column are legal; any column + // of the group keeps the source chunk mapping meaningful. + valueSource = max(vc.group.valueCol, 0) + } + variantColumns[vc.targetMetaCol] = conversionColumn{ + sourceIndex: vc.sourceStart + metaSource, + targetKind: ByteArray, + variantIndex: k, + variantOutput: 0, + } + variantColumns[vc.targetValueCol] = conversionColumn{ + sourceIndex: vc.sourceStart + valueSource, + targetKind: ByteArray, + variantIndex: k, + variantOutput: 1, + } + } + targetMapping, targetColumns := columnMappingOf(to) sourceMapping, sourceColumns := columnMappingOf(from) columns := make([]conversionColumn, len(targetColumns)) @@ -352,6 +427,11 @@ func Convert(to, from Node) (conv Conversion, err error) { } for i, path := range targetColumns { + if cc, ok := variantColumns[i]; ok { + columns[i] = cc + continue + } + targetColumn := targetMapping.lookup(path) sourceColumn := sourceMapping.lookup(path) @@ -455,11 +535,13 @@ func Convert(to, from Node) (conv Conversion, err error) { convertValues: multiConversionFunc(conversions), targetKind: targetType.Kind(), // Store target kind for null value creation isOptional: isOptional, + variantIndex: -1, } } c := &conversion{ columns: columns, + variants: variants, schema: schema, numberOfSourceColumns: len(sourceColumns), } @@ -648,6 +730,17 @@ func maskMissingRowGroupColumns(r RowGroup, numColumns int, conv Conversion) Row } } + // Shredded variant reconstruction reads every leaf column of the + // variant group, not just the ones mapped to target columns. + if c, ok := conv.(*conversion); ok { + for k := range c.variants { + vc := &c.variants[k] + for j := vc.sourceStart; j < vc.sourceStart+vc.numCols && j < len(columns); j++ { + columns[j] = rowGroupColumns[j] + } + } + } + return &rowGroup{ schema: r.Schema(), numRows: numRows, @@ -1570,15 +1663,13 @@ func timestamp(v Value, u format.TimeUnit, tz *time.Location) time.Time { return unixEpoch.In(tz).Add(time.Duration(v.int64()) * timeUnitDuration(u)) } +// timeUnitDuration returns the precision of unit, defaulting to nanoseconds +// when the unit is unset (an unknown unit written by a newer implementation). func timeUnitDuration(unit format.TimeUnit) time.Duration { - switch { - case unit.Millis != nil: - return time.Millisecond - case unit.Micros != nil: - return time.Microsecond - default: + if unit.Value == nil { return time.Nanosecond } + return unit.Value.Duration() } func invalidConversion(value Value, from, to string) error { diff --git a/vendor/github.com/parquet-go/parquet-go/convert_variant.go b/vendor/github.com/parquet-go/parquet-go/convert_variant.go new file mode 100644 index 00000000000..48b53afadea --- /dev/null +++ b/vendor/github.com/parquet-go/parquet-go/convert_variant.go @@ -0,0 +1,235 @@ +package parquet + +import ( + "fmt" + + "github.com/parquet-go/parquet-go/variant" +) + +// This file teaches schema conversion to read shredded variant columns. +// When the target schema declares an unshredded variant group (metadata, +// value) and the source schema stores the column shredded (metadata, value, +// typed_value), the conversion reconstructs each value with the +// construct_variant algorithm (see variant_shredded_read.go) and emits the +// re-encoded variant binary. Without this, the generic column mapping would +// silently drop the typed_value columns, losing every shredded value. +// +// Because every read path funnels through Convert when the reader and file +// schemas differ, this single integration point makes shredded files +// readable by any reader that declares a plain variant column. + +// variantConversion reconstructs one shredded variant column during row +// conversion. +type variantConversion struct { + group *shreddedVariantGroup + // A source group that cannot be reconstructed (e.g. an unsupported + // shredded type) fails when rows are read, not when the conversion is + // constructed, matching how readers report other malformed files. + err error + numCols int // leaf columns of the source variant group + sourceStart int // first source leaf column of the variant group + + targetMetaCol int + targetValueCol int + targetDef byte // definition level of the target leaves when present + + sourceGroupDef int // definition level at which the source group is present + sourceGroupRep int // repetition level of the source group + + // Source-to-target level mappings for the path down to the variant + // group, used for occurrences where the group is null because of a + // null enclosing level. + defLevels []byte + repLevels []byte +} + +// findVariantConversions walks the target and source schemas in parallel +// and returns a conversion for every variant column that the target +// declares unshredded and the source stores shredded. +func findVariantConversions(to, from Node) []variantConversion { + var conversions []variantConversion + walkVariantConversions(to, from, 0, 0, 0, 0, 0, 0, []byte{0}, []byte{0}, &conversions) + return conversions +} + +func walkVariantConversions(t, s Node, tCol, sCol int, tRep, tDef, sRep, sDef byte, repLevels, defLevels []byte, conversions *[]variantConversion) { + if isVariant(t) && isVariant(s) && isUnshreddedVariant(t) && !isUnshreddedVariant(s) { + if vc := makeVariantConversion(t, s, tCol, sCol, tDef, sDef, sRep, repLevels, defLevels); vc != nil { + *conversions = append(*conversions, *vc) + } + return + } + if t.Leaf() || s.Leaf() { + return + } + sColOf := make(map[string]int, len(s.Fields())) + sFieldOf := make(map[string]Field, len(s.Fields())) + col := sCol + for _, sf := range s.Fields() { + sColOf[sf.Name()] = col + sFieldOf[sf.Name()] = sf + col += int(numLeafColumnsOf(sf)) + } + for _, tf := range t.Fields() { + if sf, ok := sFieldOf[tf.Name()]; ok { + tr, td := applyFieldRepetitionType(fieldRepetitionTypeOf(tf), tRep, tDef) + sr, sd := applyFieldRepetitionType(fieldRepetitionTypeOf(sf), sRep, sDef) + walkVariantConversions( + tf, sf, + tCol, sColOf[tf.Name()], + tr, td, sr, sd, + setLevelMapping(repLevels, sr, tr), + setLevelMapping(defLevels, sd, td), + conversions, + ) + } + tCol += int(numLeafColumnsOf(tf)) + } +} + +// makeVariantConversion builds the conversion for one variant column. The +// level arguments are those of the variant group nodes themselves. A nil +// result means the target group does not have the expected metadata and +// value leaves and the generic column mapping applies. +func makeVariantConversion(t, s Node, tCol, sCol int, tDef, sDef, sRep byte, repLevels, defLevels []byte) *variantConversion { + vc := &variantConversion{ + numCols: int(numLeafColumnsOf(s)), + sourceStart: sCol, + targetMetaCol: -1, + targetValueCol: -1, + targetDef: tDef, + sourceGroupDef: int(sDef), + sourceGroupRep: int(sRep), + defLevels: defLevels, + repLevels: repLevels, + } + col := tCol + for _, tf := range t.Fields() { + if !tf.Leaf() || tf.Type().Kind() != ByteArray || tf.Optional() { + return nil + } + switch tf.Name() { + case "metadata": + vc.targetMetaCol = col + case "value": + vc.targetValueCol = col + } + col++ + } + if vc.targetMetaCol < 0 || vc.targetValueCol < 0 { + return nil + } + + vc.group, vc.err = buildShreddedVariantGroup(s, 0, 0, 0) + if vc.err == nil && vc.group.metadataCol < 0 { + vc.group, vc.err = nil, fmt.Errorf("variant: shredded variant group has no metadata field") + } + return vc +} + +// setLevelMapping returns a copy of the source-to-target level mapping with +// the entry for the source level set, extending the table when the source +// level is new (each schema step adds at most one level). +func setLevelMapping(levels []byte, source, target byte) []byte { + mapping := make([]byte, max(len(levels), int(source)+1)) + copy(mapping, levels) + mapping[source] = target + return mapping +} + +// variantScratch is the per-row state of one variant conversion, pooled in +// conversionBuffer so converting a row does not allocate it anew. +type variantScratch struct { + pos []int + metas []Value + values []Value +} + +// convert reconstructs every occurrence of the variant column in the +// current row from the source columns, leaving the values of the target +// metadata and value columns in the scratch space. +func (vc *variantConversion) convert(source [][]Value, scratch *variantScratch) error { + if vc.err != nil { + return vc.err + } + columns := source[vc.sourceStart : vc.sourceStart+vc.numCols] + if cap(scratch.pos) < len(columns) { + scratch.pos = make([]int, len(columns)) + } + scratch.pos = scratch.pos[:len(columns)] + clear(scratch.pos) + scratch.metas = scratch.metas[:0] + scratch.values = scratch.values[:0] + reader := variantColumnReader{columns: columns, pos: scratch.pos} + metaIdx := ^uint16(vc.targetMetaCol) + valueIdx := ^uint16(vc.targetValueCol) + + for { + metaVal, ok := reader.peek(vc.group.metadataCol) + if !ok { + break + } + + // The level mapping tables cover the levels the schema can + // produce; corrupt files can carry level bytes beyond them, which + // must surface as a decode error rather than a panic. + if int(metaVal.repetitionLevel) >= len(vc.repLevels) || int(metaVal.definitionLevel) >= len(vc.defLevels) { + return fmt.Errorf("variant: metadata column has levels (r=%d, d=%d) outside the schema's levels", + metaVal.repetitionLevel, metaVal.definitionLevel) + } + + if int(metaVal.definitionLevel) < vc.sourceGroupDef { + // The variant group is null at this occurrence; every leaf + // column of the group carries exactly one value at the + // enclosing level to consume. + rep := vc.repLevels[metaVal.repetitionLevel] + def := vc.defLevels[metaVal.definitionLevel] + scratch.metas = append(scratch.metas, Value{repetitionLevel: rep, definitionLevel: def, columnIndex: metaIdx}) + scratch.values = append(scratch.values, Value{repetitionLevel: rep, definitionLevel: def, columnIndex: valueIdx}) + for col := range columns { + reader.next(col) + } + continue + } + + reader.next(vc.group.metadataCol) + m, err := variant.DecodeMetadata(metaVal.ByteArray()) + if err != nil { + return fmt.Errorf("variant metadata: %w", err) + } + v, present, err := vc.group.read(&reader, m, vc.sourceGroupDef, vc.sourceGroupRep) + if err != nil { + return err + } + if !present { + // value and typed_value both null at the top level is invalid + // per the spec; read it as variant null (matching parquet-java). + v = variant.Null() + } + + var b variant.MetadataBuilder + encoded := variant.Encode(&b, v) + _, metadata := b.Build() + rep := vc.repLevels[metaVal.repetitionLevel] + + metaValue := ByteArrayValue(metadata) + metaValue.repetitionLevel = rep + metaValue.definitionLevel = vc.targetDef + metaValue.columnIndex = metaIdx + + valueValue := ByteArrayValue(encoded) + valueValue.repetitionLevel = rep + valueValue.definitionLevel = vc.targetDef + valueValue.columnIndex = valueIdx + + scratch.metas = append(scratch.metas, metaValue) + scratch.values = append(scratch.values, valueValue) + } + if len(scratch.metas) == 0 { + // No values in the source columns for this row; emit a null pair + // to maintain the one-value-per-column invariant. + scratch.metas = append(scratch.metas, Value{columnIndex: metaIdx}) + scratch.values = append(scratch.values, Value{columnIndex: valueIdx}) + } + return nil +} diff --git a/vendor/github.com/parquet-go/parquet-go/encoding/rle/rle.go b/vendor/github.com/parquet-go/parquet-go/encoding/rle/rle.go index 6aef0ae3286..6d7bda6f694 100644 --- a/vendor/github.com/parquet-go/parquet-go/encoding/rle/rle.go +++ b/vendor/github.com/parquet-go/parquet-go/encoding/rle/rle.go @@ -260,6 +260,9 @@ func decodeBits(dst, src []byte) ([]byte, error) { i += n count, bitpacked := uint(u>>1), (u&1) != 0 + if count == 0 { + continue + } if count > maxSupportedValueCount { return dst, fmt.Errorf("decoded run-length block cannot have more than %d values", maxSupportedValueCount) } @@ -305,6 +308,9 @@ func decodeBytes(dst, src []byte, bitWidth uint) ([]byte, error) { i += n count, bitpacked := uint(u>>1), (u&1) != 0 + if count == 0 { + continue + } if count > maxSupportedValueCount { return dst, fmt.Errorf("decoded run-length block cannot have more than %d values", maxSupportedValueCount) } @@ -361,6 +367,9 @@ func decodeInt32(dst, src []byte, bitWidth uint) ([]byte, error) { i += n count, bitpacked := uint(u>>1), (u&1) != 0 + if count == 0 { + continue + } if count > maxSupportedValueCount { return dst, fmt.Errorf("decoded run-length block cannot have more than %d values", maxSupportedValueCount) } diff --git a/vendor/github.com/parquet-go/parquet-go/encoding/thrift/binary.go b/vendor/github.com/parquet-go/parquet-go/encoding/thrift/binary.go index f9798be5a93..6f96bc0473e 100644 --- a/vendor/github.com/parquet-go/parquet-go/encoding/thrift/binary.go +++ b/vendor/github.com/parquet-go/parquet-go/encoding/thrift/binary.go @@ -18,7 +18,7 @@ type BinaryProtocol struct { NonStrict bool } -func (p *BinaryProtocol) NewReaderFromBytes(b []byte) Reader { +func (p *BinaryProtocol) NewReaderFromBytes(b []byte) BytesReader { return &binaryBytesReader{p: p, data: b} } @@ -400,6 +400,11 @@ type binaryBytesReader struct { offset int } +func (r *binaryBytesReader) ResetBytes(b []byte) { + r.data = b + r.offset = 0 +} + func (r *binaryBytesReader) Protocol() Protocol { return r.p } @@ -408,6 +413,18 @@ func (r *binaryBytesReader) Reader() io.Reader { return bytes.NewReader(r.data[r.offset:]) } +// Discard advances the reader past the next n bytes, reporting how many +// bytes were discarded. Unlike reading through Reader(), it moves the +// reader's own offset, which skip operations rely on. +func (r *binaryBytesReader) Discard(n int) (int, error) { + if remain := len(r.data) - r.offset; remain < n { + r.offset = len(r.data) + return remain, io.ErrUnexpectedEOF + } + r.offset += n + return n, nil +} + func (r *binaryBytesReader) ReadBool() (bool, error) { b, err := r.ReadByte() // Thrift protocol treats both 0 and 2 as false. diff --git a/vendor/github.com/parquet-go/parquet-go/encoding/thrift/compact.go b/vendor/github.com/parquet-go/parquet-go/encoding/thrift/compact.go index 249b3d8b9e8..b17b789c58b 100644 --- a/vendor/github.com/parquet-go/parquet-go/encoding/thrift/compact.go +++ b/vendor/github.com/parquet-go/parquet-go/encoding/thrift/compact.go @@ -16,7 +16,7 @@ import ( // https://github.com/apache/thrift/blob/master/doc/specs/thrift-compact-protocol.md#integer-encoding type CompactProtocol struct{} -func (p *CompactProtocol) NewReaderFromBytes(b []byte) Reader { +func (p *CompactProtocol) NewReaderFromBytes(b []byte) BytesReader { return &compactBytesReader{protocol: p, data: b} } @@ -372,6 +372,11 @@ type compactBytesReader struct { offset int } +func (r *compactBytesReader) ResetBytes(b []byte) { + r.data = b + r.offset = 0 +} + func (r *compactBytesReader) Protocol() Protocol { return r.protocol } @@ -380,6 +385,18 @@ func (r *compactBytesReader) Reader() io.Reader { return bytes.NewReader(r.data[r.offset:]) } +// Discard advances the reader past the next n bytes, reporting how many +// bytes were discarded. Unlike reading through Reader(), it moves the +// reader's own offset, which skip operations rely on. +func (r *compactBytesReader) Discard(n int) (int, error) { + if remain := len(r.data) - r.offset; remain < n { + r.offset = len(r.data) + return remain, io.ErrUnexpectedEOF + } + r.offset += n + return n, nil +} + func (r *compactBytesReader) ReadBool() (bool, error) { b, err := r.ReadByte() // Thrift protocol treats both 0 and 2 as false. diff --git a/vendor/github.com/parquet-go/parquet-go/encoding/thrift/debug.go b/vendor/github.com/parquet-go/parquet-go/encoding/thrift/debug.go index e8bf5763bf7..f3aa32533f1 100644 --- a/vendor/github.com/parquet-go/parquet-go/encoding/thrift/debug.go +++ b/vendor/github.com/parquet-go/parquet-go/encoding/thrift/debug.go @@ -128,6 +128,16 @@ func (d *debugReader) BytesRead() int { return d.r.BytesRead() } +// Discard forwards discards to the wrapped reader. Without it, a +// debug-wrapped bytes-backed reader would fall through to a throwaway +// Reader() view and the discard would not advance the wrapped reader's +// offset, silently desynchronizing the stream. +func (d *debugReader) Discard(n int) (int, error) { + v, err := discard(d.r, n) + d.log("Discard", v, err) + return v, err +} + type debugWriter struct { w Writer l *log.Logger diff --git a/vendor/github.com/parquet-go/parquet-go/encoding/thrift/decode.go b/vendor/github.com/parquet-go/parquet-go/encoding/thrift/decode.go index b1e3189297a..2145b768a15 100644 --- a/vendor/github.com/parquet-go/parquet-go/encoding/thrift/decode.go +++ b/vendor/github.com/parquet-go/parquet-go/encoding/thrift/decode.go @@ -1,7 +1,6 @@ package thrift import ( - "bufio" "fmt" "io" "maps" @@ -18,8 +17,11 @@ import ( // // As an optimization, the value passed in v may be reused across multiple calls // to Unmarshal, allowing the function to reuse objects referenced by pointer -// fields of struct values. When reusing objects, the application is responsible -// for resetting the state of v before calling Unmarshal again. +// fields of struct values: non-nil pointer fields present in the input have +// their pointed-to value zeroed and decoded in place, and pointer fields +// absent from the input are set to nil. When reusing objects, the application +// remains responsible for resetting non-pointer state of v (scalars, strings, +// and slice lengths) before calling Unmarshal again. func Unmarshal(p Protocol, b []byte, v any) error { pr := p.NewReaderFromBytes(slices.Clone(b)) @@ -108,6 +110,10 @@ func DecodeFuncOf(t reflect.Type, seen DecodeFuncCache) DecodeFunc { return f } + if isUnion(t) { + return decodeFuncUnionOf(t, seen) + } + // Check if type implements Value interface first if t.Implements(valueType) { zv := reflect.Zero(t).Interface().(Value) @@ -247,7 +253,7 @@ func decodeFuncSliceOf(t reflect.Type, seen DecodeFuncCache) DecodeFunc { if flags.Have(Strict) { return &TypeMismatch{item: "list item", Expect: typ, Found: l.Type} } - return nil + return skipListItems(r, l) } size := int(l.Size) @@ -302,14 +308,14 @@ func decodeFuncMapOf(t reflect.Type, seen DecodeFuncCache) DecodeFunc { if flags.Have(Strict) { return &TypeMismatch{item: "map key", Expect: keyType, Found: m.Key} } - return nil + return skipMapItems(r, m) } if elemType != m.Value { if flags.Have(Strict) { return &TypeMismatch{item: "map value", Expect: elemType, Found: m.Value} } - return nil + return skipMapItems(r, m) } tmpKey := reflect.New(key).Elem() @@ -363,7 +369,7 @@ func decodeFuncMapAsSetOf(t reflect.Type, seen DecodeFuncCache) DecodeFunc { if flags.Have(Strict) { return &TypeMismatch{item: "list item", Expect: typ, Found: s.Type} } - return nil + return skipSetItems(r, s) } tmp := reflect.New(key).Elem() @@ -383,21 +389,29 @@ func decodeFuncMapAsSetOf(t reflect.Type, seen DecodeFuncCache) DecodeFunc { type structDecoder struct { fields []structDecoderField - union []int minID int16 - zero reflect.Value required []uint64 + // clears contains the indices (into fields) of pointer-typed and + // union-typed fields. Such fields absent from the input are zeroed + // after decoding, so that reusing a previously decoded value as the + // decode target produces the same result as decoding into a fresh + // value. Without this, stale pointers (or stale union members) from a + // previous decode would survive, which is invisible for regular + // optional fields but corrupts values where "which member is non-nil" + // carries meaning. + clears []int } func (dec *structDecoder) decode(r Reader, v reflect.Value, flags Flags) error { flags = flags.Only(decodeFlags) coalesceBool := flags.Have(coalesceBoolFields) - lastField := reflect.Value{} - union := len(dec.union) > 0 - seen := make([]uint64, 1) - if len(dec.required) > len(seen) { - seen = make([]uint64, len(dec.required)) + // seen tracks which of the (sparse, id-indexed) fields were observed + // in the input; required is sized to the same word count. + var seenBuf [4]uint64 + seen := seenBuf[:] + if n := len(dec.required); n > len(seenBuf) { + seen = make([]uint64, n) } // Inlined readStruct loop to avoid closure overhead @@ -424,7 +438,19 @@ decodeFields: } i := int(f.ID) - int(dec.minID) - if i < 0 || i >= len(dec.fields) || dec.fields[i].decode == nil { + var field *structDecoderField + if i >= 0 && i < len(dec.fields) && dec.fields[i].decode != nil { + field = &dec.fields[i] + } + // Unknown fields and (in non-strict mode) type-mismatched fields + // are consumed so the stream stays aligned, and left unseen: they + // were not decoded, so they must not satisfy the required check nor + // protect a stale pointer from the clearUnseen pass below. + // TODO: implement type conversions? + if field == nil || (f.Type != field.typ && !(f.Type == TRUE && field.typ == BOOL)) { + if field != nil && flags.Have(Strict) { + return &TypeMismatch{item: "field value", Expect: field.typ, Found: f.Type} + } if err := skip(r, f.Type); err != nil { return with(dontExpectEOF(err), &decodeErrorField{cause: f}) } @@ -432,19 +458,8 @@ decodeFields: numFields++ continue decodeFields } - field := &dec.fields[i] seen[i/64] |= 1 << (i % 64) - // TODO: implement type conversions? - if f.Type != field.typ && !(f.Type == TRUE && field.typ == BOOL) { - if flags.Have(Strict) { - return &TypeMismatch{item: "field value", Expect: field.typ, Found: f.Type} - } - lastFieldID = f.ID - numFields++ - continue decodeFields - } - x := v for _, i := range field.index { if x.Kind() == reflect.Ptr { @@ -457,12 +472,6 @@ decodeFields: } } - if union { - v.Set(dec.zero) - } - - lastField = x - if coalesceBool && (f.Type == TRUE || f.Type == FALSE) { for x.Kind() == reflect.Ptr { if x.IsNil() { @@ -503,8 +512,26 @@ decodeFields: } } - if union && lastField.IsValid() { - v.FieldByIndex(dec.union).Set(lastField.Addr()) +clearUnseen: + for _, i := range dec.clears { + if seen[i/64]&(1<<(i%64)) != 0 { + continue + } + x := v + for _, j := range dec.fields[i].index { + if x.Kind() == reflect.Ptr { + if x.IsNil() { + continue clearUnseen + } + x = x.Elem() + } + x = x.Field(j) + } + // x is either a pointer field or a union struct; zeroing a union + // nils its member interface, marking the union unset. + if x.Kind() != reflect.Ptr || !x.IsNil() { + x.SetZero() + } } return nil @@ -515,29 +542,25 @@ type structDecoderField struct { id int16 flags Flags typ Type + isPtr bool decode DecodeFunc } func decodeFuncStructOf(t reflect.Type, seen DecodeFuncCache) DecodeFunc { - dec := &structDecoder{ - zero: reflect.Zero(t), - } + dec := &structDecoder{} decode := dec.decode seen[t] = decode fields := make([]structDecoderField, 0, t.NumField()) forEachStructField(t, nil, func(f structField) { - if f.flags.Have(Union) { - dec.union = f.index - } else { - fields = append(fields, structDecoderField{ - index: f.index, - id: f.id, - flags: f.flags, - typ: TypeOf(f.typ), - decode: decodeFuncStructFieldOf(f, seen), - }) - } + fields = append(fields, structDecoderField{ + index: f.index, + id: f.id, + flags: f.flags, + typ: TypeOf(f.typ), + isPtr: f.typ.Kind() == reflect.Ptr, + decode: decodeFuncStructFieldOf(f, seen), + }) }) minID := int16(0) @@ -554,7 +577,7 @@ func decodeFuncStructOf(t reflect.Type, seen DecodeFuncCache) DecodeFunc { dec.fields = make([]structDecoderField, (maxID-minID)+1) dec.minID = minID - dec.required = make([]uint64, len(fields)/64+1) + dec.required = make([]uint64, (len(dec.fields)+63)/64) for _, f := range fields { i := f.id - minID @@ -566,6 +589,9 @@ func decodeFuncStructOf(t reflect.Type, seen DecodeFuncCache) DecodeFunc { if f.flags.Have(Required) { dec.required[i/64] |= 1 << (i % 64) } + if f.isPtr || f.flags.Have(UnionType) { + dec.clears = append(dec.clears, int(i)) + } } return decode @@ -587,6 +613,11 @@ func decodeFuncPtrOf(t reflect.Type, seen DecodeFuncCache) DecodeFunc { return func(r Reader, v reflect.Value, f Flags) error { if v.IsNil() { v.Set(reflect.New(elem)) + } else { + // Reuse the allocation but not the contents: optional fields + // of the pointed-to value that are absent from the input must + // not survive from a previous decode. + v.Elem().SetZero() } return decode(r, v.Elem(), f) } @@ -654,26 +685,34 @@ func skipBinary(r Reader) error { if n == 0 { return nil } - switch x := r.Reader().(type) { - case *bufio.Reader: - _, err = x.Discard(int(n)) - default: - _, err = io.CopyN(io.Discard, x, int64(n)) - } + _, err = discard(r, int(n)) return dontExpectEOF(err) } +type discarder interface{ Discard(int) (int, error) } + +// discard advances r past n bytes. The bytes-backed readers implement +// Discard themselves; their Reader() method returns a throwaway view that +// does not advance the read offset, so discarding through it would silently +// desynchronize the stream. Streaming readers discard through the +// underlying io.Reader when it supports it (*bufio.Reader does). +func discard(r Reader, n int) (int, error) { + if d, ok := r.(discarder); ok { + return d.Discard(n) + } + if d, ok := r.Reader().(discarder); ok { + return d.Discard(n) + } + c, err := io.CopyN(io.Discard, r.Reader(), int64(n)) + return int(c), err +} + func skipList(r Reader) error { l, err := r.ReadList() if err != nil { return err } - for i := range int(l.Size) { - if err := skip(r, l.Type); err != nil { - return with(dontExpectEOF(err), &decodeErrorList{cause: l, index: i}) - } - } - return nil + return skipListItems(r, l) } func skipSet(r Reader) error { @@ -681,12 +720,7 @@ func skipSet(r Reader) error { if err != nil { return err } - for i := range int(s.Size) { - if err := skip(r, s.Type); err != nil { - return with(dontExpectEOF(err), &decodeErrorSet{cause: s, index: i}) - } - } - return nil + return skipSetItems(r, s) } func skipMap(r Reader) error { @@ -694,11 +728,52 @@ func skipMap(r Reader) error { if err != nil { return err } + return skipMapItems(r, m) +} + +// skipItem consumes one container element of the given type. Unlike bool +// fields, whose value compact-protocol encoders coalesce into the field +// type, bool container elements always occupy one byte. +func skipItem(r Reader, t Type) error { + switch t { + case TRUE, FALSE: + _, err := r.ReadBool() + return err + default: + return skip(r, t) + } +} + +// skipListItems, skipSetItems, and skipMapItems consume the elements of a +// container whose header has already been read. They are used both by the +// skip functions above and by the decoders when the elements cannot be +// decoded into the target type: the payload must still be consumed, or the +// reader would desynchronize from the stream. + +func skipListItems(r Reader, l List) error { + for i := range int(l.Size) { + if err := skipItem(r, l.Type); err != nil { + return with(dontExpectEOF(err), &decodeErrorList{cause: l, index: i}) + } + } + return nil +} + +func skipSetItems(r Reader, s Set) error { + for i := range int(s.Size) { + if err := skipItem(r, s.Type); err != nil { + return with(dontExpectEOF(err), &decodeErrorSet{cause: s, index: i}) + } + } + return nil +} + +func skipMapItems(r Reader, m Map) error { for i := range int(m.Size) { - if err := skip(r, m.Key); err != nil { + if err := skipItem(r, m.Key); err != nil { return with(dontExpectEOF(err), &decodeErrorMap{cause: m, index: i}) } - if err := skip(r, m.Value); err != nil { + if err := skipItem(r, m.Value); err != nil { return with(dontExpectEOF(err), &decodeErrorMap{cause: m, index: i}) } } diff --git a/vendor/github.com/parquet-go/parquet-go/encoding/thrift/encode.go b/vendor/github.com/parquet-go/parquet-go/encoding/thrift/encode.go index f9899312b37..b8f4391dc46 100644 --- a/vendor/github.com/parquet-go/parquet-go/encoding/thrift/encode.go +++ b/vendor/github.com/parquet-go/parquet-go/encoding/thrift/encode.go @@ -79,6 +79,10 @@ func EncodeFuncOf(t reflect.Type, seen EncodeFuncCache) EncodeFunc { return f } + if isUnion(t) { + return encodeFuncUnionOf(t, seen) + } + // Check if type implements Value interface first if t.Implements(valueType) { zv := reflect.Zero(t).Interface().(Value) @@ -258,7 +262,6 @@ func encodeFuncMapAsSetOf(t reflect.Type, seen EncodeFuncCache) EncodeFunc { type structEncoder struct { fields []structEncoderField - union bool } func dereference(v reflect.Value) reflect.Value { @@ -347,20 +350,9 @@ encodeFields: return err } - if numFields > 1 && enc.union { - return fmt.Errorf("thrift union had more than one field with a non-zero value (%d)", numFields) - } - return nil } -func (enc *structEncoder) String() string { - if enc.union { - return "union" - } - return "struct" -} - type structEncoderField struct { index []int id int16 @@ -378,18 +370,14 @@ func encodeFuncStructOf(t reflect.Type, seen EncodeFuncCache) EncodeFunc { seen[t] = encode forEachStructField(t, nil, func(f structField) { - if f.flags.Have(Union) { - enc.union = true - } else { - enc.fields = append(enc.fields, structEncoderField{ - index: f.index, - id: f.id, - flags: f.flags, - typ: TypeOf(f.typ), - encode: encodeFuncStructFieldOf(f, seen), - null: nullFuncOf(f), - }) - } + enc.fields = append(enc.fields, structEncoderField{ + index: f.index, + id: f.id, + flags: f.flags, + typ: TypeOf(f.typ), + encode: encodeFuncStructFieldOf(f, seen), + null: nullFuncOf(f), + }) }) slices.SortStableFunc(enc.fields, func(a, b structEncoderField) int { @@ -423,6 +411,10 @@ func nullFuncOf(f structField) NullFunc { if f.flags.Have(Required) { return neverNull } + // Union structs are unset when their member field is nil. + if f.flags.Have(UnionType) { + return unionLayoutOf(f.typ).nullFunc() + } // Value types: use their NullFunc if f.flags.Have(ValueType) { zv := reflect.Zero(f.typ).Interface().(Value) diff --git a/vendor/github.com/parquet-go/parquet-go/encoding/thrift/list.go b/vendor/github.com/parquet-go/parquet-go/encoding/thrift/list.go index 0fb66c02383..1d743d5a3cd 100644 --- a/vendor/github.com/parquet-go/parquet-go/encoding/thrift/list.go +++ b/vendor/github.com/parquet-go/parquet-go/encoding/thrift/list.go @@ -69,7 +69,7 @@ func (l Slice[T]) DecodeFunc(cache DecodeFuncCache) DecodeFunc { if flags.Have(Strict) { return &TypeMismatch{item: "list item", Expect: elemType, Found: listHeader.Type} } - return nil + return skipListItems(r, listHeader) } size := int(listHeader.Size) diff --git a/vendor/github.com/parquet-go/parquet-go/encoding/thrift/protocol.go b/vendor/github.com/parquet-go/parquet-go/encoding/thrift/protocol.go index 1640398a833..99242e74842 100644 --- a/vendor/github.com/parquet-go/parquet-go/encoding/thrift/protocol.go +++ b/vendor/github.com/parquet-go/parquet-go/encoding/thrift/protocol.go @@ -25,7 +25,10 @@ const ( // However, the readers and writer that they instantiates are intended to be // used by a single goroutine. type Protocol interface { - NewReaderFromBytes(b []byte) Reader + // NewReaderFromBytes returns a reader over b. Every reader constructed from + // a byte slice can be repointed at another one, so the concrete BytesReader + // is returned rather than the wider Reader. + NewReaderFromBytes(b []byte) BytesReader NewReader(r io.Reader) Reader NewWriter(w io.Writer) Writer Features() Features @@ -53,6 +56,21 @@ type Reader interface { BytesRead() int } +// BytesReader is a Reader positioned over a fixed byte slice. +// +// ResetBytes repoints the reader at b and rewinds it, so a caller decoding many +// values from a byte buffer can reuse one reader instead of allocating one per +// value. +// +// Values decoded through a BytesReader may alias b: ReadBytes and ReadString +// return sub-slices of it rather than copies. Callers must keep b alive and +// unmodified for as long as the decoded values are used. This is why Unmarshal, +// which makes no such demand of its caller, clones its input. +type BytesReader interface { + Reader + ResetBytes(b []byte) +} + // Writer represents a low-level writer of values encoded according to one of // the thrift protocols. type Writer interface { diff --git a/vendor/github.com/parquet-go/parquet-go/encoding/thrift/struct.go b/vendor/github.com/parquet-go/parquet-go/encoding/thrift/struct.go index 81f0fb2e69e..6b5ec7763d8 100644 --- a/vendor/github.com/parquet-go/parquet-go/encoding/thrift/struct.go +++ b/vendor/github.com/parquet-go/parquet-go/encoding/thrift/struct.go @@ -13,7 +13,7 @@ type Flags int16 // Flag constants for struct field handling. const ( Enum Flags = 1 << 0 - Union Flags = 1 << 1 + UnionType Flags = 1 << 1 // indicates field implements Union interface Required Flags = 1 << 2 Optional Flags = 1 << 3 Strict Flags = 1 << 4 @@ -91,8 +91,6 @@ func forEachStructField(t reflect.Type, index []int, do func(structField)) { switch opt { case "enum": flags = flags.With(Enum) - case "union": - flags = flags.With(Union) case "required": flags = flags.With(Required) case "optional": @@ -108,21 +106,7 @@ func forEachStructField(t reflect.Type, index []int, do func(structField)) { panic(fmt.Errorf("thrift struct field cannot be both optional and required in `thrift:\"%s\"`", tag)) } - if flags.Have(Union) { - if f.Type.Kind() != reflect.Interface { - panic(fmt.Errorf("thrift union tag found on a field which is not an interface type `thrift:\"%s\"`", tag)) - } - - if tags[0] != "" { - panic(fmt.Errorf("invalid thrift field id on union field `thrift:\"%s\"`", tag)) - } - - do(structField{ - typ: f.Type, - index: fieldIndex, - flags: flags, - }) - } else { + { if flags.Have(Enum) { switch f.Type.Kind() { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: @@ -132,8 +116,10 @@ func forEachStructField(t reflect.Type, index []int, do func(structField)) { } } - // Detect types implementing Value interface - if f.Type.Implements(valueType) { + // Detect union structs, then types implementing Value interface. + if isUnion(f.Type) { + flags = flags.With(UnionType) + } else if f.Type.Implements(valueType) { flags = flags.With(ValueType) } diff --git a/vendor/github.com/parquet-go/parquet-go/encoding/thrift/thrift.go b/vendor/github.com/parquet-go/parquet-go/encoding/thrift/thrift.go index 861329efdc6..142d0e79aea 100644 --- a/vendor/github.com/parquet-go/parquet-go/encoding/thrift/thrift.go +++ b/vendor/github.com/parquet-go/parquet-go/encoding/thrift/thrift.go @@ -130,6 +130,10 @@ func (m Map) String() string { } func TypeOf(t reflect.Type) Type { + if isUnion(t) { + return STRUCT + } + // Check if type implements Value interface first if t.Implements(valueType) { zv := reflect.Zero(t).Interface().(Value) diff --git a/vendor/github.com/parquet-go/parquet-go/encoding/thrift/union.go b/vendor/github.com/parquet-go/parquet-go/encoding/thrift/union.go new file mode 100644 index 00000000000..14e29cded6c --- /dev/null +++ b/vendor/github.com/parquet-go/parquet-go/encoding/thrift/union.go @@ -0,0 +1,322 @@ +package thrift + +import ( + "fmt" + "reflect" +) + +// UnionMember is implemented by the concrete member types of a thrift union. +// +// FieldID returns the thrift field id that the member is encoded under. The id +// is intrinsic to the member type, which makes it impossible for a union to +// register the same member under two different ids. +// +// Implementations must declare FieldID on a pointer receiver and must not +// dereference it: unions register their members as typed nil pointers, and the +// codec calls FieldID on those values to build its dispatch table. +type UnionMember interface { + FieldID() int16 +} + +// Union is implemented by structs that encode as a thrift union. +// +// A union struct has exactly one field, of an interface type, holding at most +// one member. A nil field means the union is not set, and the struct is skipped +// when it appears as an optional field of another struct. +// +// UnionMembers returns the members the union may hold, as typed nil pointers: +// +// var logicalTypeMembers = []thrift.UnionMember{ +// (*StringType)(nil), +// (*MapType)(nil), +// } +// +// func (*LogicalType) UnionMembers() []thrift.UnionMember { return logicalTypeMembers } +// +// The returned slice is read once, when the codec for the union is built, so +// implementations should return a package-level value rather than construct it +// on each call. +type Union interface { + UnionMembers() []UnionMember +} + +var unionType = reflect.TypeFor[Union]() + +// isUnion reports whether t is a union struct. +// +// Unlike Value, which is probed on the value type because its implementations +// (Null, Slice) are value wrappers with value receivers, Union is probed on the +// pointer type. Union structs live in packages that declare their methods on +// pointer receivers, and a union only ever appears as an addressable struct +// field, so requiring the value method set would buy nothing and would force +// those packages into a mixed receiver set. +func isUnion(t reflect.Type) bool { + return t.Kind() == reflect.Struct && reflect.PointerTo(t).Implements(unionType) +} + +// unionMember describes one member of a union after validation. +type unionMember struct { + id int16 + // typ is the member struct type, i.e. the element of the registered *T. + typ reflect.Type + // interned holds a shared *T for zero-sized members, which carry no state + // and so can be handed out from every decode without allocating. + interned reflect.Value +} + +// unionLayout is the validated shape of a union struct, independent of whether +// it is being encoded or decoded. +type unionLayout struct { + typ reflect.Type + // field is the index of the interface field holding the member. + field int + members []unionMember + minID int16 + maxID int16 +} + +// unionLayoutOf validates t and describes its shape, panicking on any structural +// problem. Union codecs are built once per type, at the first encode or decode, +// so these panics surface at startup rather than on a hot path. +func unionLayoutOf(t reflect.Type) *unionLayout { + if t.Kind() != reflect.Struct { + panic(fmt.Errorf("thrift union %s is not a struct", t)) + } + if t.NumField() != 1 { + panic(fmt.Errorf("thrift union %s must have exactly one field, found %d", t, t.NumField())) + } + field := t.Field(0) + if field.Type.Kind() != reflect.Interface { + panic(fmt.Errorf("thrift union %s field %s must be an interface, found %s", t, field.Name, field.Type)) + } + + members := reflect.New(t).Interface().(Union).UnionMembers() + if len(members) == 0 { + panic(fmt.Errorf("thrift union %s declares no members", t)) + } + + layout := &unionLayout{typ: t, field: 0} + seen := make(map[int16]reflect.Type, len(members)) + + for _, m := range members { + if m == nil { + panic(fmt.Errorf("thrift union %s declares a nil member", t)) + } + mt := reflect.TypeOf(m) + if mt.Kind() != reflect.Ptr || mt.Elem().Kind() != reflect.Struct { + panic(fmt.Errorf("thrift union %s member %s must be a pointer to a struct", t, mt)) + } + if !mt.AssignableTo(field.Type) { + panic(fmt.Errorf("thrift union %s member %s is not assignable to %s", t, mt, field.Type)) + } + id := m.FieldID() + if id <= 0 { + panic(fmt.Errorf("thrift union %s member %s has an invalid field id %d", t, mt, id)) + } + if prev, ok := seen[id]; ok { + panic(fmt.Errorf("thrift union %s field id %d is present multiple times with types %s and %s", t, id, prev, mt)) + } + seen[id] = mt + + member := unionMember{id: id, typ: mt.Elem()} + if member.typ.Size() == 0 { + member.interned = reflect.New(member.typ) + } + layout.members = append(layout.members, member) + + if layout.minID == 0 || id < layout.minID { + layout.minID = id + } + if id > layout.maxID { + layout.maxID = id + } + } + + return layout +} + +// nullFunc reports the union as unset when its member field is nil. +func (layout *unionLayout) nullFunc() NullFunc { + field := layout.field + return func(v reflect.Value) bool { return v.Field(field).IsNil() } +} + +type unionEncoderMember struct { + id int16 + encode EncodeFunc +} + +type unionEncoder struct { + typ reflect.Type + field int + byType map[reflect.Type]unionEncoderMember +} + +func (enc *unionEncoder) encode(w Writer, v reflect.Value, flags Flags) error { + x := v.Field(enc.field) + + if !x.IsNil() { + p := x.Elem() + + m, ok := enc.byType[p.Type()] + if !ok { + return fmt.Errorf("thrift: %s is not a member of union %s", p.Type(), enc.typ) + } + + field := Field{ID: m.id, Type: STRUCT} + // A union writes a single field, so the previous field id is always + // zero and the delta is the id itself. This mirrors structEncoder so + // that unions and structs produce identical bytes for the same field. + if flags.Have(useDeltaEncoding) && field.ID <= 15 { + field.Delta = true + } + if err := w.WriteField(field); err != nil { + return err + } + + // A typed nil member encodes as an empty struct, matching the way + // encodeFuncPtrOf substitutes the zero value for a nil pointer. + if p.IsNil() { + p = reflect.New(p.Type().Elem()) + } + if err := m.encode(w, p.Elem(), flags); err != nil { + return err + } + } + + return w.WriteField(Field{Type: STOP}) +} + +func encodeFuncUnionOf(t reflect.Type, seen EncodeFuncCache) EncodeFunc { + layout := unionLayoutOf(t) + + enc := &unionEncoder{ + typ: t, + field: layout.field, + byType: make(map[reflect.Type]unionEncoderMember, len(layout.members)), + } + encode := enc.encode + seen[t] = encode + + for _, m := range layout.members { + enc.byType[reflect.PointerTo(m.typ)] = unionEncoderMember{ + id: m.id, + encode: EncodeFuncOf(m.typ, seen), + } + } + + return encode +} + +type unionDecoderMember struct { + // interned is a shared *T for zero-sized members, invalid otherwise. + interned reflect.Value + typ reflect.Type + // ptrTyp is *typ, kept to test whether a previously decoded member can + // be reused as the decode target without allocating. + ptrTyp reflect.Type + decode DecodeFunc +} + +type unionDecoder struct { + field int + minID int16 + members []unionDecoderMember +} + +func (dec *unionDecoder) decode(r Reader, v reflect.Value, flags Flags) error { + flags = flags.Only(decodeFlags) + + // Reset so that decoding into a reused value cannot retain a stale + // member, but remember the previous member: when the input holds a + // member of the same type, its allocation is reused instead of + // allocating a fresh value. + x := v.Field(dec.field) + prev := x.Elem() // invalid when the union was unset + x.SetZero() + + lastFieldID := int16(0) + numFields := 0 + + for { + f, err := r.ReadField() + if err != nil { + if numFields > 0 { + err = dontExpectEOF(err) + } + return err + } + + if f.Type == STOP { + return nil + } + + if f.Delta { + f.ID += lastFieldID + f.Delta = false + } + + i := int(f.ID) - int(dec.minID) + known := i >= 0 && i < len(dec.members) && dec.members[i].decode != nil + + switch { + case !known: + // An id we do not know: a member added by a newer writer. Skip it + // and leave the union unset rather than failing the whole decode. + if err := skip(r, f.Type); err != nil { + return with(dontExpectEOF(err), &decodeErrorField{cause: f}) + } + + case f.Type != STRUCT: + if flags.Have(Strict) { + return &TypeMismatch{item: "union member", Expect: STRUCT, Found: f.Type} + } + if err := skip(r, f.Type); err != nil { + return with(dontExpectEOF(err), &decodeErrorField{cause: f}) + } + + default: + m := &dec.members[i] + + p := m.interned + if !p.IsValid() { + if prev.IsValid() && prev.Type() == m.ptrTyp && !prev.IsNil() { + p = prev + p.Elem().SetZero() + } else { + p = reflect.New(m.typ) + } + } + if err := m.decode(r, p.Elem(), flags); err != nil { + return with(dontExpectEOF(err), &decodeErrorField{cause: f}) + } + x.Set(p) + } + + lastFieldID = f.ID + numFields++ + } +} + +func decodeFuncUnionOf(t reflect.Type, seen DecodeFuncCache) DecodeFunc { + layout := unionLayoutOf(t) + + dec := &unionDecoder{ + field: layout.field, + minID: layout.minID, + members: make([]unionDecoderMember, (layout.maxID-layout.minID)+1), + } + decode := dec.decode + seen[t] = decode + + for _, m := range layout.members { + dec.members[m.id-layout.minID] = unionDecoderMember{ + interned: m.interned, + typ: m.typ, + ptrTyp: reflect.PointerTo(m.typ), + decode: DecodeFuncOf(m.typ, seen), + } + } + + return decode +} diff --git a/vendor/github.com/parquet-go/parquet-go/errors.go b/vendor/github.com/parquet-go/parquet-go/errors.go index 651fe740c88..1d00774673a 100644 --- a/vendor/github.com/parquet-go/parquet-go/errors.go +++ b/vendor/github.com/parquet-go/parquet-go/errors.go @@ -9,7 +9,7 @@ var ( // ErrCorrupted is an error returned by the Err method of ColumnPages // instances when they encountered a mismatch between the CRC checksum // recorded in a page header and the one computed while reading the page - // data. + // data. Also returned on invalid headers / footer decoding. ErrCorrupted = errors.New("corrupted parquet page") // ErrMissingRootColumn is an error returned when opening an invalid parquet diff --git a/vendor/github.com/parquet-go/parquet-go/file.go b/vendor/github.com/parquet-go/parquet-go/file.go index 11c697b0464..d9fab37ff9c 100644 --- a/vendor/github.com/parquet-go/parquet-go/file.go +++ b/vendor/github.com/parquet-go/parquet-go/file.go @@ -142,13 +142,13 @@ func OpenFile(r io.ReaderAt, size int64, options ...FileOption) (*File, error) { // Extract AAD parameters from the encryption algorithm. var fileUnique, aadPrefix []byte - switch { - case cryptoMeta.EncryptionAlgorithm.AesGcmV1 != nil: - fileUnique = cryptoMeta.EncryptionAlgorithm.AesGcmV1.AadFileUnique - aadPrefix = cryptoMeta.EncryptionAlgorithm.AesGcmV1.AadPrefix - case cryptoMeta.EncryptionAlgorithm.AesGcmCtrV1 != nil: - fileUnique = cryptoMeta.EncryptionAlgorithm.AesGcmCtrV1.AadFileUnique - aadPrefix = cryptoMeta.EncryptionAlgorithm.AesGcmCtrV1.AadPrefix + switch algo := cryptoMeta.EncryptionAlgorithm.Value.(type) { + case *format.AesGcmV1: + fileUnique = algo.AadFileUnique + aadPrefix = algo.AadPrefix + case *format.AesGcmCtrV1: + fileUnique = algo.AadFileUnique + aadPrefix = algo.AadPrefix } footerKey, err := c.Decryption.Keys.FooterKey(cryptoMeta.KeyMetadata) @@ -184,15 +184,14 @@ func OpenFile(r io.ReaderAt, size int64, options ...FileOption) (*File, error) { if c.Decryption == nil { return nil, fmt.Errorf("parquet file has a signed footer but no DecryptionConfig was provided") } - algo := &f.metadata.EncryptionAlgorithm var fileUnique, aadPrefix []byte - switch { - case algo.AesGcmV1 != nil: - fileUnique = algo.AesGcmV1.AadFileUnique - aadPrefix = algo.AesGcmV1.AadPrefix - case algo.AesGcmCtrV1 != nil: - fileUnique = algo.AesGcmCtrV1.AadFileUnique - aadPrefix = algo.AesGcmCtrV1.AadPrefix + switch algo := f.metadata.EncryptionAlgorithm.Value.(type) { + case *format.AesGcmV1: + fileUnique = algo.AadFileUnique + aadPrefix = algo.AadPrefix + case *format.AesGcmCtrV1: + fileUnique = algo.AadFileUnique + aadPrefix = algo.AadPrefix } plainFooterBytes := footerData[:pr.BytesRead()] sig := footerData[pr.BytesRead():] @@ -382,7 +381,36 @@ func (f *File) ReadPageIndex() ([]format.ColumnIndex, []format.OffsetIndex, erro columnIndexes := make([]format.ColumnIndex, numColumnChunks) offsetIndexes := make([]format.OffsetIndex, numColumnChunks) - indexBuffer := make([]byte, max(int(columnIndexLength), int(offsetIndexLength))) + + // The column index and the offset index get separate buffers because the + // values decoded below alias them: ColumnIndex.MinValues and MaxValues are + // sub-slices of the bytes they were decoded from. A single shared buffer + // would be overwritten by the offset index read, corrupting the min/max + // statistics of every column. + var columnIndexBuffer, offsetIndexBuffer []byte + if columnIndexOffset > 0 { + columnIndexBuffer = make([]byte, columnIndexLength) + } + if offsetIndexOffset > 0 { + offsetIndexBuffer = make([]byte, offsetIndexLength) + } + + // One reader and one decoder are reused across every column chunk. Decoding + // each chunk with thrift.Unmarshal instead would clone the chunk's bytes and + // allocate a reader for it, twice per column chunk. + reader := f.protocol.NewReaderFromBytes(nil) + decoder := thrift.NewDecoder(reader) + + decode := func(b []byte, v any) error { + reader.ResetBytes(b) + if err := decoder.Decode(v); err != nil { + return err + } + if n := len(b) - reader.BytesRead(); n != 0 { + return fmt.Errorf("unexpected trailing bytes at the end of thrift input: %d", n) + } + return nil + } // pageIndexKey returns the AES key used to decrypt this column's // page-index modules, or nil for plaintext columns. We resolve keys here @@ -392,19 +420,18 @@ func (f *File) ReadPageIndex() ([]format.ColumnIndex, []format.OffsetIndex, erro if f.decryption == nil { return nil, nil } - switch { - case c.CryptoMetadata.EncryptionWithFooterKey != nil: + switch crypto := c.CryptoMetadata.Value.(type) { + case *format.EncryptionWithFooterKey: return f.decryption.Keys.FooterKey(nil) - case c.CryptoMetadata.EncryptionWithColumnKey != nil: - colKey := c.CryptoMetadata.EncryptionWithColumnKey - return f.decryption.Keys.ColumnKey(colKey.PathInSchema, colKey.KeyMetadata) + case *format.EncryptionWithColumnKey: + return f.decryption.Keys.ColumnKey(crypto.PathInSchema, crypto.KeyMetadata) default: return nil, nil } } if columnIndexOffset > 0 { - columnIndexData := indexBuffer[:columnIndexLength] + columnIndexData := columnIndexBuffer if cast, ok := f.reader.(interface{ SetColumnIndexSection(offset, length int64) }); ok { cast.SetColumnIndexSection(columnIndexOffset, columnIndexLength) @@ -437,7 +464,7 @@ func (f *File) ReadPageIndex() ([]format.ColumnIndex, []format.OffsetIndex, erro } buffer = plain } - if err := thrift.Unmarshal(&f.protocol, buffer, &columnIndexes[(i*numColumns)+j]); err != nil { + if err := decode(buffer, &columnIndexes[(i*numColumns)+j]); err != nil { return fmt.Errorf("decoding column index: rowGroup=%d columnChunk=%d/%d: %w", i, j, numColumns, err) } } @@ -449,7 +476,7 @@ func (f *File) ReadPageIndex() ([]format.ColumnIndex, []format.OffsetIndex, erro } if offsetIndexOffset > 0 { - offsetIndexData := indexBuffer[:offsetIndexLength] + offsetIndexData := offsetIndexBuffer if cast, ok := f.reader.(interface{ SetOffsetIndexSection(offset, length int64) }); ok { cast.SetOffsetIndexSection(offsetIndexOffset, offsetIndexLength) @@ -478,7 +505,7 @@ func (f *File) ReadPageIndex() ([]format.ColumnIndex, []format.OffsetIndex, erro } buffer = plain } - if err := thrift.Unmarshal(&f.protocol, buffer, &offsetIndexes[(i*numColumns)+j]); err != nil { + if err := decode(buffer, &offsetIndexes[(i*numColumns)+j]); err != nil { return fmt.Errorf("decoding offset index: rowGroup=%d columnChunk=%d/%d: %w", i, j, numColumns, err) } } @@ -513,17 +540,16 @@ func (f *File) decryptAllColumnMetadata() error { continue } var key []byte - switch { - case chunk.CryptoMetadata.EncryptionWithFooterKey != nil: + switch crypto := chunk.CryptoMetadata.Value.(type) { + case *format.EncryptionWithFooterKey: var err error key, err = f.decryption.Keys.FooterKey(nil) if err != nil { return fmt.Errorf("resolving footer key for column metadata: %w", err) } - case chunk.CryptoMetadata.EncryptionWithColumnKey != nil: - colKey := chunk.CryptoMetadata.EncryptionWithColumnKey + case *format.EncryptionWithColumnKey: var err error - key, err = f.decryption.Keys.ColumnKey(colKey.PathInSchema, colKey.KeyMetadata) + key, err = f.decryption.Keys.ColumnKey(crypto.PathInSchema, crypto.KeyMetadata) if err != nil { // Only treat an explicit ErrKeyNotFound as non-fatal: the // caller intentionally omitted this column's key. Any other @@ -664,16 +690,15 @@ func (g *FileRowGroup) init(file *File, columns []*Column, rowGroup *format.RowG } if file.decryption != nil { chunk := &rowGroup.Columns[i] - switch { - case chunk.CryptoMetadata.EncryptionWithFooterKey != nil: + switch crypto := chunk.CryptoMetadata.Value.(type) { + case *format.EncryptionWithFooterKey: key, err := file.decryption.Keys.FooterKey(nil) if err != nil { return fmt.Errorf("resolving footer key for column %q: %w", columnPathString(columns[i].Path()), err) } fileColumnChunks[i].decryptionKey = key - case chunk.CryptoMetadata.EncryptionWithColumnKey != nil: - colKey := chunk.CryptoMetadata.EncryptionWithColumnKey - key, err := file.decryption.Keys.ColumnKey(colKey.PathInSchema, colKey.KeyMetadata) + case *format.EncryptionWithColumnKey: + key, err := file.decryption.Keys.ColumnKey(crypto.PathInSchema, crypto.KeyMetadata) switch { case err == nil: fileColumnChunks[i].decryptionKey = key @@ -685,7 +710,7 @@ func (g *FileRowGroup) init(file *File, columns []*Column, rowGroup *format.RowG // Real error (KMS failure, bad metadata, …) must surface so // the caller learns the cause instead of seeing later // "decode page header" errors masking the missing key. - return fmt.Errorf("resolving column key for %q: %w", columnPathString(colKey.PathInSchema), err) + return fmt.Errorf("resolving column key for %q: %w", columnPathString(crypto.PathInSchema), err) } } } @@ -739,6 +764,11 @@ func (g *FileRowGroup) Rows() Rows { return NewRowGroupRowReader(rowGroup) } +// chunkTransparentRowGroup marks FileRowGroup as safe for the chunk-level write +// fast paths: its Rows() reads the file column chunks in order with no +// additional semantics. +func (g *FileRowGroup) chunkTransparentRowGroup() {} + type fileSortingColumn struct { column *Column descending bool @@ -1030,9 +1060,10 @@ func (c *FileColumnChunk) readBloomFilter(reader io.ReaderAt) (*FileBloomFilter, if err := decoder.Decode(&header); err != nil { return nil, fmt.Errorf("decoding bloom filter header: %w", err) } - offset, _ = section.Seek(0, io.SeekCurrent) + sectionPos, _ := section.Seek(0, io.SeekCurrent) + dataOffset := offset + sectionPos - int64(rbuf.Buffered()) var err error - filter, err = newBloomFilter(reader, offset, &header) + filter, err = newBloomFilter(reader, dataOffset, &header) if err != nil { return nil, fmt.Errorf("reading bloom filter: %w", err) } @@ -1193,6 +1224,9 @@ func (f *FilePages) ReadPage() (Page, error) { if err = f.decoder.Decode(header); err != nil { return nil, err } + if err = validatePageHeader(header); err != nil { + return nil, err + } // if this is a dictionary page and we've already read and decoded the dictionary we can skip past it. // call f.rbuf.Discard to skip the page data and realign f.rbuf with the next page header @@ -1305,6 +1339,9 @@ func (f *FilePages) readDictionary() error { if err := thrift.NewDecoder(pr).Decode(header); err != nil { return fmt.Errorf("parquet decryption: decoding dict page header: %w", err) } + if err := validatePageHeader(header); err != nil { + return err + } bodyAAD := makeAAD(d.aadPrefix, d.fileUnique, dictPageBodyModule, d.rowGroupOrdinal, d.columnOrdinal, 0) bodyPlain, err := readDecryptedEnvelopeFrom(rbuf, d.key, bodyAAD) if err != nil { @@ -1318,6 +1355,9 @@ func (f *FilePages) readDictionary() error { if err := decoder.Decode(header); err != nil { return err } + if err := validatePageHeader(header); err != nil { + return err + } page = buffers.get(int(header.CompressedPageSize)) page.ref() if _, err := io.ReadFull(rbuf, page.data.Slice()); err != nil { @@ -1368,6 +1408,42 @@ func (f *FilePages) readDataPageV2(header *format.PageHeader, page *buffer[byte] return f.chunk.column.decodeDataPageV2(DataPageHeaderV2{&header.DataPageHeaderV2.V}, page, f.dictionary, header.UncompressedPageSize) } +// validatePageHeader rejects page headers whose size or count fields decoded to +// negative values. Those values end up being trusted by the code later on +// which results in panics if they're off +func validatePageHeader(header *format.PageHeader) error { + reject := func(field string, value int32) error { + return fmt.Errorf("invalid page header: %s=%d: %w", field, value, ErrCorrupted) + } + if header.CompressedPageSize < 0 { + return reject("compressed_page_size", header.CompressedPageSize) + } + if header.UncompressedPageSize < 0 { + return reject("uncompressed_page_size", header.UncompressedPageSize) + } + if h := header.DataPageHeader; h.Valid && h.V.NumValues < 0 { + return reject("data_page_header.num_values", h.V.NumValues) + } + if h := header.DictionaryPageHeader; h.Valid && h.V.NumValues < 0 { + return reject("dictionary_page_header.num_values", h.V.NumValues) + } + if h := header.DataPageHeaderV2; h.Valid { + switch { + case h.V.NumValues < 0: + return reject("data_page_header_v2.num_values", h.V.NumValues) + case h.V.NumNulls < 0: + return reject("data_page_header_v2.num_nulls", h.V.NumNulls) + case h.V.NumRows < 0: + return reject("data_page_header_v2.num_rows", h.V.NumRows) + case h.V.RepetitionLevelsByteLength < 0: + return reject("data_page_header_v2.repetition_levels_byte_length", h.V.RepetitionLevelsByteLength) + case h.V.DefinitionLevelsByteLength < 0: + return reject("data_page_header_v2.definition_levels_byte_length", h.V.DefinitionLevelsByteLength) + } + } + return nil +} + func (f *FilePages) readPage(header *format.PageHeader, reader *bufio.Reader) (*buffer[byte], error) { page := buffers.get(int(header.CompressedPageSize)) defer page.unref() @@ -1448,6 +1524,9 @@ func (f *FilePages) readEncryptedPage() (*format.PageHeader, *buffer[byte], erro if err := thrift.NewDecoder(pr).Decode(header); err != nil { return nil, nil, fmt.Errorf("parquet decryption: decoding page header: %w", err) } + if err := validatePageHeader(header); err != nil { + return nil, nil, err + } bodyAAD := makeAAD(d.aadPrefix, d.fileUnique, bodyModuleType, d.rowGroupOrdinal, d.columnOrdinal, pageOrd) bodyPlain, err := readDecryptedEnvelopeFrom(f.rbuf, d.key, bodyAAD) diff --git a/vendor/github.com/parquet-go/parquet-go/format/footer.go b/vendor/github.com/parquet-go/parquet-go/format/footer.go new file mode 100644 index 00000000000..df439cefe89 --- /dev/null +++ b/vendor/github.com/parquet-go/parquet-go/format/footer.go @@ -0,0 +1,63 @@ +package format + +import ( + "fmt" + + "github.com/parquet-go/parquet-go/encoding/thrift" +) + +// FooterDecoder decodes Parquet file footers (thrift compact protocol) with +// zero steady-state allocations by retaining its input buffer and decoded +// metadata across calls to Decode. +// +// The zero value is ready to use. FooterDecoder values must not be copied +// after first use and are not safe for concurrent use; to amortize +// allocations across goroutines, keep decoders in a sync.Pool. +// +// A decoder never allocates for inputs whose shape fits the capacity +// retained from previous decodes; larger or differently-shaped inputs grow +// the retained state as needed. The retained state never shrinks: one +// unusually large footer sizes the decoder's buffer and metadata tree for +// its remaining lifetime, so long-lived decoders dedicated to a single file +// may prefer to be discarded after use instead of pooled. +type FooterDecoder struct { + buf []byte + meta FileMetaData + reader thrift.BytesReader + decoder *thrift.Decoder +} + +// protocol is stateless and shared by all decoders. +var footerProtocol thrift.CompactProtocol + +// Decode parses the thrift-encoded footer in data and returns the decoded +// metadata along with the number of bytes consumed. Trailing bytes after the +// thrift payload (such as the 28-byte AES-GCM footer signature written by +// encrypted-footer-signing writers) are not an error; callers can detect +// them by comparing the consumed byte count to len(data). +// +// The returned metadata, and all strings and byte slices it references, are +// owned by the decoder and remain valid only until the next call to Decode. +// Callers that need the metadata to outlive the decoder must deep-copy it. +// +// Decode makes a private copy of data; the caller retains ownership of the +// slice and may reuse it immediately. +func (d *FooterDecoder) Decode(data []byte) (*FileMetaData, int, error) { + // The decoded metadata aliases the retained buffer, so the copy below + // would corrupt previously returned values in place. Resetting first + // keeps the "valid until next Decode" contract honest instead of + // leaving values that are subtly wrong. + d.meta.Reset() + d.buf = append(d.buf[:0], data...) + + if d.reader == nil { + d.reader = footerProtocol.NewReaderFromBytes(nil) + d.decoder = thrift.NewDecoder(d.reader) + } + d.reader.ResetBytes(d.buf) + + if err := d.decoder.Decode(&d.meta); err != nil { + return nil, 0, fmt.Errorf("decoding parquet footer: %w", err) + } + return &d.meta, d.reader.BytesRead(), nil +} diff --git a/vendor/github.com/parquet-go/parquet-go/format/parquet.go b/vendor/github.com/parquet-go/parquet-go/format/parquet.go index 26a5de5d2cb..d27f3aa1a50 100644 --- a/vendor/github.com/parquet-go/parquet-go/format/parquet.go +++ b/vendor/github.com/parquet-go/parquet-go/format/parquet.go @@ -3,6 +3,7 @@ package format import ( "fmt" "strings" + "time" "github.com/parquet-go/parquet-go/deprecated" "github.com/parquet-go/parquet-go/encoding/thrift" @@ -103,13 +104,13 @@ type SizeStatistics struct { // // This field may be omitted if max_repetition_level is 0 without loss // of information. - RepetitionLevelHistogram []int64 `thrift:"2,optional"` + RepetitionLevelHistogram thrift.Slice[int64] `thrift:"2,optional"` // Same as repetition_level_histogram except for definition levels. // // This field may be omitted if max_definition_level is 0 or 1 without // loss of information. - DefinitionLevelHistogram []int64 `thrift:"3,optional"` + DefinitionLevelHistogram thrift.Slice[int64] `thrift:"3,optional"` } // Bounding box for GEOMETRY or GEOGRAPHY type in the representation of min/max @@ -130,7 +131,7 @@ type GeospatialStatistics struct { // A bounding box of geospatial instances BBox BoundingBox `thrift:"1,optional"` // Geospatial type codes of all instances, or an empty list if not known - GeoSpatialTypes []int32 `thrift:"2,optional"` + GeoSpatialTypes thrift.Slice[int32] `thrift:"2,optional"` } // Statistics per row group and per page. @@ -181,6 +182,14 @@ func (*EnumType) String() string { return "ENUM" } func (*DateType) String() string { return "DATE" } func (*Float16Type) String() string { return "FLOAT16" } +func (*StringType) FieldID() int16 { return 1 } +func (*MapType) FieldID() int16 { return 2 } +func (*ListType) FieldID() int16 { return 3 } +func (*EnumType) FieldID() int16 { return 4 } +func (*DateType) FieldID() int16 { return 6 } +func (*UUIDType) FieldID() int16 { return 14 } +func (*Float16Type) FieldID() int16 { return 15 } + // Logical type to annotate a column that is always null. // // Sometimes when discovering the schema of existing data, values are always @@ -189,6 +198,7 @@ func (*Float16Type) String() string { return "FLOAT16" } type NullType struct{} func (*NullType) String() string { return "NULL" } +func (*NullType) FieldID() int16 { return 11 } // Decimal logical type annotation // @@ -206,6 +216,8 @@ func (t *DecimalType) String() string { return fmt.Sprintf("DECIMAL(%d,%d)", t.Precision, t.Scale) } +func (*DecimalType) FieldID() int16 { return 5 } + // Time units for logical types. type MilliSeconds struct{} type MicroSeconds struct{} @@ -215,23 +227,44 @@ func (*MilliSeconds) String() string { return "MILLIS" } func (*MicroSeconds) String() string { return "MICROS" } func (*NanoSeconds) String() string { return "NANOS" } +func (*MilliSeconds) FieldID() int16 { return 1 } +func (*MicroSeconds) FieldID() int16 { return 2 } +func (*NanoSeconds) FieldID() int16 { return 3 } + +// Duration returns the precision of the time unit. It is the length of one +// step, so a value stored in this unit is that many of these durations since +// the epoch or midnight. +func (*MilliSeconds) Duration() time.Duration { return time.Millisecond } +func (*MicroSeconds) Duration() time.Duration { return time.Microsecond } +func (*NanoSeconds) Duration() time.Duration { return time.Nanosecond } + +// TimeUnitValue is the set of time units a TimeUnit union may hold. Duration is +// intrinsic to a unit (like its name) and closes the interface: types that are +// not time units, though they satisfy thrift.UnionMember and String, do not +// have a Duration and so cannot be mistaken for a member here. +type TimeUnitValue interface { + thrift.UnionMember + String() string + Duration() time.Duration +} + +var timeUnitMembers = []thrift.UnionMember{ + (*MilliSeconds)(nil), + (*MicroSeconds)(nil), + (*NanoSeconds)(nil), +} + type TimeUnit struct { // union - Millis *MilliSeconds `thrift:"1"` - Micros *MicroSeconds `thrift:"2"` - Nanos *NanoSeconds `thrift:"3"` + Value TimeUnitValue } +func (*TimeUnit) UnionMembers() []thrift.UnionMember { return timeUnitMembers } + func (u *TimeUnit) String() string { - switch { - case u.Millis != nil: - return u.Millis.String() - case u.Micros != nil: - return u.Micros.String() - case u.Nanos != nil: - return u.Nanos.String() - default: + if u.Value == nil { return "" } + return u.Value.String() } // Timestamp logical type annotation @@ -246,6 +279,8 @@ func (t *TimestampType) String() string { return fmt.Sprintf("TIMESTAMP(isAdjustedToUTC=%t,unit=%s)", t.IsAdjustedToUTC, &t.Unit) } +func (*TimestampType) FieldID() int16 { return 8 } + // Time logical type annotation // // Allowed for physical types: INT32 (millis), INT64 (micros, nanos) @@ -258,6 +293,8 @@ func (t *TimeType) String() string { return fmt.Sprintf("TIME(isAdjustedToUTC=%t,unit=%s)", t.IsAdjustedToUTC, &t.Unit) } +func (*TimeType) FieldID() int16 { return 7 } + // Integer logical type annotation // // bitWidth must be 8, 16, 32, or 64. @@ -272,6 +309,8 @@ func (t *IntType) String() string { return fmt.Sprintf("INT(%d,%t)", t.BitWidth, t.IsSigned) } +func (*IntType) FieldID() int16 { return 10 } + // Embedded JSON logical type annotation // // Allowed for physical types: BINARY @@ -279,6 +318,8 @@ type JsonType struct{} func (t *JsonType) String() string { return "JSON" } +func (*JsonType) FieldID() int16 { return 12 } + // Embedded BSON logical type annotation // // Allowed for physical types: BINARY @@ -286,6 +327,8 @@ type BsonType struct{} func (t *BsonType) String() string { return "BSON" } +func (*BsonType) FieldID() int16 { return 13 } + // Embedded Variant logical type annotation // // Allowed for physical types: BYTE_ARRAY (with embedded Variant binary). @@ -306,6 +349,8 @@ type VariantType struct { func (*VariantType) String() string { return "VARIANT" } +func (*VariantType) FieldID() int16 { return 16 } + // Edge interpolation algorithm for Geography logical type type EdgeInterpolationAlgorithm int32 @@ -389,6 +434,8 @@ func (t *GeometryType) String() string { return fmt.Sprintf("GEOMETRY(%q)", crs) } +func (*GeometryType) FieldID() int16 { return 17 } + const GeographyDefaultCRS = defaultCRS // Embedded Geography logical type annotation @@ -419,78 +466,53 @@ func (t *GeographyType) String() string { return fmt.Sprintf("GEOGRAPHY(%q, %s)", crs, t.Algorithm) } +func (*GeographyType) FieldID() int16 { return 18 } + // LogicalType annotations to replace ConvertedType. // // To maintain compatibility, implementations using LogicalType for a // SchemaElement must also set the corresponding ConvertedType (if any) // from the following table. -type LogicalType struct { // union - UTF8 *StringType `thrift:"1"` // use ConvertedType UTF8 - Map *MapType `thrift:"2"` // use ConvertedType Map - List *ListType `thrift:"3"` // use ConvertedType List - Enum *EnumType `thrift:"4"` // use ConvertedType Enum - Decimal *DecimalType `thrift:"5"` // use ConvertedType Decimal + SchemaElement.{Scale, Precision} - Date *DateType `thrift:"6"` // use ConvertedType Date - - // use ConvertedType TimeMicros for Time{IsAdjustedToUTC: *, Unit: Micros} - // use ConvertedType TimeMillis for Time{IsAdjustedToUTC: *, Unit: Millis} - Time *TimeType `thrift:"7"` - - // use ConvertedType TimestampMicros for Timestamp{IsAdjustedToUTC: *, Unit: Micros} - // use ConvertedType TimestampMillis for Timestamp{IsAdjustedToUTC: *, Unit: Millis} - Timestamp *TimestampType `thrift:"8"` +// LogicalTypeValue is the set of annotations a LogicalType union may hold. The +// FieldID method carries each member's thrift field id; see the member list in +// logicalTypeMembers for the full id mapping. +type LogicalTypeValue interface { + thrift.UnionMember + String() string +} +var logicalTypeMembers = []thrift.UnionMember{ + (*StringType)(nil), // 1: use ConvertedType UTF8 + (*MapType)(nil), // 2: use ConvertedType Map + (*ListType)(nil), // 3: use ConvertedType List + (*EnumType)(nil), // 4: use ConvertedType Enum + (*DecimalType)(nil), // 5: use ConvertedType Decimal + SchemaElement.{Scale, Precision} + (*DateType)(nil), // 6: use ConvertedType Date + (*TimeType)(nil), // 7: use ConvertedType TimeMicros or TimeMillis + (*TimestampType)(nil), // 8: use ConvertedType TimestampMicros or TimestampMillis // 9: reserved for Interval - Integer *IntType `thrift:"10"` // use ConvertedType Int* or Uint* - Unknown *NullType `thrift:"11"` // no compatible ConvertedType - Json *JsonType `thrift:"12"` // use ConvertedType JSON - Bson *BsonType `thrift:"13"` // use ConvertedType BSON - UUID *UUIDType `thrift:"14"` // no compatible ConvertedType - Float16 *Float16Type `thrift:"15"` // no compatible ConvertedType - Variant *VariantType `thrift:"16"` // no compatible ConvertedType - Geometry *GeometryType `thrift:"17"` // no compatible ConvertedType - Geography *GeographyType `thrift:"18"` // no compatible ConvertedType + (*IntType)(nil), // 10: use ConvertedType Int* or Uint* + (*NullType)(nil), // 11: no compatible ConvertedType + (*JsonType)(nil), // 12: use ConvertedType JSON + (*BsonType)(nil), // 13: use ConvertedType BSON + (*UUIDType)(nil), // 14: no compatible ConvertedType + (*Float16Type)(nil), // 15: no compatible ConvertedType + (*VariantType)(nil), // 16: no compatible ConvertedType + (*GeometryType)(nil), // 17: no compatible ConvertedType + (*GeographyType)(nil), // 18: no compatible ConvertedType } +type LogicalType struct { // union + Value LogicalTypeValue +} + +func (*LogicalType) UnionMembers() []thrift.UnionMember { return logicalTypeMembers } + func (t *LogicalType) String() string { - switch { - case t.UTF8 != nil: - return t.UTF8.String() - case t.Map != nil: - return t.Map.String() - case t.List != nil: - return t.List.String() - case t.Enum != nil: - return t.Enum.String() - case t.Decimal != nil: - return t.Decimal.String() - case t.Date != nil: - return t.Date.String() - case t.Time != nil: - return t.Time.String() - case t.Timestamp != nil: - return t.Timestamp.String() - case t.Integer != nil: - return t.Integer.String() - case t.Unknown != nil: - return t.Unknown.String() - case t.Json != nil: - return t.Json.String() - case t.Bson != nil: - return t.Bson.String() - case t.UUID != nil: - return t.UUID.String() - case t.Float16 != nil: - return t.Float16.String() - case t.Variant != nil: - return t.Variant.String() - case t.Geometry != nil: - return t.Geometry.String() - case t.Geography != nil: - return t.Geography.String() - default: + if t.Value == nil { return "" } + return t.Value.String() } // Represents a element inside a schema definition. @@ -546,7 +568,7 @@ type SchemaElement struct { // // LogicalType replaces ConvertedType, but ConvertedType is still required // for some logical types to ensure forward-compatibility in format v1. - LogicalType thrift.Null[LogicalType] `thrift:"10,optional"` + LogicalType LogicalType `thrift:"10,optional"` } // Encodings supported by Parquet. Not all encodings are valid for all types. @@ -801,27 +823,75 @@ type DataPageHeaderV2 struct { // Block-based algorithm type annotation. type SplitBlockAlgorithm struct{} +func (*SplitBlockAlgorithm) FieldID() int16 { return 1 } + +// BloomFilterAlgorithmValue is the set of algorithms a BloomFilterAlgorithm +// union may hold. +type BloomFilterAlgorithmValue interface { + thrift.UnionMember +} + +var bloomFilterAlgorithmMembers = []thrift.UnionMember{ + (*SplitBlockAlgorithm)(nil), // 1 +} + // The algorithm used in Bloom filter. type BloomFilterAlgorithm struct { // union - Block *SplitBlockAlgorithm `thrift:"1"` + Value BloomFilterAlgorithmValue +} + +func (*BloomFilterAlgorithm) UnionMembers() []thrift.UnionMember { + return bloomFilterAlgorithmMembers } // Hash strategy type annotation. xxHash is an extremely fast non-cryptographic // hash algorithm. It uses 64 bits version of xxHash. type XxHash struct{} +func (*XxHash) FieldID() int16 { return 1 } + +// BloomFilterHashValue is the set of hash functions a BloomFilterHash union may +// hold. +type BloomFilterHashValue interface { + thrift.UnionMember +} + +var bloomFilterHashMembers = []thrift.UnionMember{ + (*XxHash)(nil), // 1 +} + // The hash function used in Bloom filter. This function takes the hash of a // column value using plain encoding. type BloomFilterHash struct { // union - XxHash *XxHash `thrift:"1"` + Value BloomFilterHashValue } +func (*BloomFilterHash) UnionMembers() []thrift.UnionMember { return bloomFilterHashMembers } + // The compression used in the Bloom filter. type BloomFilterUncompressed struct{} type BloomFilterGzip struct{} + +func (*BloomFilterUncompressed) FieldID() int16 { return 1 } +func (*BloomFilterGzip) FieldID() int16 { return 2 } + +// BloomFilterCompressionValue is the set of compressions a +// BloomFilterCompression union may hold. +type BloomFilterCompressionValue interface { + thrift.UnionMember +} + +var bloomFilterCompressionMembers = []thrift.UnionMember{ + (*BloomFilterUncompressed)(nil), // 1 + (*BloomFilterGzip)(nil), // 2 +} + type BloomFilterCompression struct { // union - Uncompressed *BloomFilterUncompressed `thrift:"1"` - GZip *BloomFilterGzip `thrift:"2"` + Value BloomFilterCompressionValue +} + +func (*BloomFilterCompression) UnionMembers() []thrift.UnionMember { + return bloomFilterCompressionMembers } // Bloom filter header is stored at beginning of Bloom filter data of each column @@ -939,7 +1009,7 @@ type ColumnMetaData struct { TotalCompressedSize int64 `thrift:"7,required"` // Optional key/value metadata. - KeyValueMetadata []KeyValue `thrift:"8,optional"` + KeyValueMetadata thrift.Slice[KeyValue] `thrift:"8,optional"` // Byte offset from beginning of file to first data page. DataPageOffset int64 `thrift:"9,required"` @@ -957,7 +1027,7 @@ type ColumnMetaData struct { // Set of all encodings used for pages in this column chunk. // This information can be used to determine if all data pages are // dictionary encoded for example. - EncodingStats []PageEncodingStats `thrift:"13,optional"` + EncodingStats thrift.Slice[PageEncodingStats] `thrift:"13,optional"` // Byte offset from beginning of file to Bloom filter data. BloomFilterOffset int64 `thrift:"14,optional"` @@ -983,15 +1053,32 @@ type EncryptionWithFooterKey struct{} type EncryptionWithColumnKey struct { // Column path in schema. - PathInSchema []string `thrift:"1,required"` + PathInSchema thrift.Slice[string] `thrift:"1,required"` // Retrieval metadata of column encryption key. KeyMetadata []byte `thrift:"2,optional"` } -type ColumnCryptoMetaData struct { - EncryptionWithFooterKey *EncryptionWithFooterKey `thrift:"1"` - EncryptionWithColumnKey *EncryptionWithColumnKey `thrift:"2"` +func (*EncryptionWithFooterKey) FieldID() int16 { return 1 } +func (*EncryptionWithColumnKey) FieldID() int16 { return 2 } + +// ColumnCryptoMetaDataValue is the set of key references a +// ColumnCryptoMetaData union may hold. +type ColumnCryptoMetaDataValue interface { + thrift.UnionMember +} + +var columnCryptoMetaDataMembers = []thrift.UnionMember{ + (*EncryptionWithFooterKey)(nil), // 1 + (*EncryptionWithColumnKey)(nil), // 2 +} + +type ColumnCryptoMetaData struct { // union + Value ColumnCryptoMetaDataValue +} + +func (*ColumnCryptoMetaData) UnionMembers() []thrift.UnionMember { + return columnCryptoMetaDataMembers } type ColumnChunk struct { @@ -1039,7 +1126,7 @@ type RowGroup struct { // If set, specifies a sort ordering of the rows in this RowGroup. // The sorting columns can be a subset of all the columns. - SortingColumns []SortingColumn `thrift:"4,optional"` + SortingColumns thrift.Slice[SortingColumn] `thrift:"4,optional"` // Byte offset from beginning of file to first page (data or dictionary) // in this row group @@ -1056,20 +1143,38 @@ type RowGroup struct { Ordinal int16 `thrift:"7,optional,writezero"` } +// Reset clears r in place, retaining allocated capacity for reuse. Elements +// of the retained slices are recursively cleared so that values from a +// previous thrift decode cannot leak into the next one (the decoder only +// writes fields present in its input). func (r *RowGroup) Reset() { - r.FileOffset = 0 - r.NumRows = 0 - r.TotalByteSize = 0 - r.SortingColumns = r.SortingColumns[:0] + for i := range r.Columns { + r.Columns[i].Reset() + } r.Columns = r.Columns[:0] - r.Ordinal = 0 r.TotalByteSize = 0 + r.NumRows = 0 + clear(r.SortingColumns) + r.SortingColumns = r.SortingColumns[:0] + r.FileOffset = 0 r.TotalCompressedSize = 0 + r.Ordinal = 0 } // Empty struct to signal the order defined by the physical or logical type. type TypeDefinedOrder struct{} +func (*TypeDefinedOrder) FieldID() int16 { return 1 } + +// ColumnOrderValue is the set of orderings a ColumnOrder union may hold. +type ColumnOrderValue interface { + thrift.UnionMember +} + +var columnOrderMembers = []thrift.UnionMember{ + (*TypeDefinedOrder)(nil), // 1 +} + // Union to specify the order used for the min_value and max_value fields for a // column. This union takes the role of an enhanced enum that allows rich // elements (which will be needed for a collation-based ordering in the future). @@ -1126,9 +1231,11 @@ type ColumnOrder struct { // union // - If the min is +0, the row group may contain -0 values as well. // - If the max is -0, the row group may contain +0 values as well. // - When looking for NaN values, min and max should be ignored. - TypeOrder *TypeDefinedOrder `thrift:"1"` + Value ColumnOrderValue } +func (*ColumnOrder) UnionMembers() []thrift.UnionMember { return columnOrderMembers } + type PageLocation struct { // Offset of the page in the file. Offset int64 `thrift:"1,required"` @@ -1145,13 +1252,13 @@ type PageLocation struct { type OffsetIndex struct { // PageLocations, ordered by increasing PageLocation.offset. It is required // that page_locations[i].first_row_index < page_locations[i+1].first_row_index. - PageLocations []PageLocation `thrift:"1,required"` + PageLocations thrift.Slice[PageLocation] `thrift:"1,required"` // Unencoded/uncompressed size for BYTE_ARRAY types. // // See documention for unencoded_byte_array_data_bytes in SizeStatistics for // more details on this field. - UnencodedByteArrayDataBytes []int64 `thrift:"2,optional"` + UnencodedByteArrayDataBytes thrift.Slice[int64] `thrift:"2,optional"` } func (o *OffsetIndex) Reset() { @@ -1172,7 +1279,7 @@ type ColumnIndex struct { // have to set the corresponding entries in min_values and max_values to // byte[0], so that all lists have the same length. If false, the // corresponding entries in min_values and max_values must be valid. - NullPages []bool `thrift:"1,required"` + NullPages thrift.Slice[bool] `thrift:"1,required"` // Two lists containing lower and upper bounds for the values of each page // determined by the ColumnOrder of the column. These may be the actual @@ -1182,8 +1289,8 @@ type ColumnIndex struct { // Such more compact values must still be valid values within the column's // logical type. Readers must make sure that list entries are populated before // using them by inspecting null_pages. - MinValues [][]byte `thrift:"2,required"` - MaxValues [][]byte `thrift:"3,required"` + MinValues thrift.Slice[[]byte] `thrift:"2,required"` + MaxValues thrift.Slice[[]byte] `thrift:"3,required"` // Stores whether both min_values and max_values are ordered and if so, in // which direction. This allows readers to perform binary searches in both @@ -1195,7 +1302,7 @@ type ColumnIndex struct { // The writezero tag satisfies spec: // "Writers SHOULD always write this field even if no null values are present or the column is not nullable." // https://github.com/apache/parquet-format/blob/apache-parquet-format-2.12.0/src/main/thrift/parquet.thrift#L1197-L1198 - NullCounts []int64 `thrift:"5,optional,writezero"` + NullCounts thrift.Slice[int64] `thrift:"5,optional,writezero"` // Contains repetition level histograms for each page // concatenated together. The repetition_level_histogram field on @@ -1207,10 +1314,10 @@ type ColumnIndex struct { // Element 0 is the first element of the histogram for the first page. // Element (max_repetition_level + 1) is the first element of the histogram // for the second page. - RepetitionLevelHistogram []int64 `thrift:"6,optional"` + RepetitionLevelHistogram thrift.Slice[int64] `thrift:"6,optional"` // Same as repetition_level_histograms except for definitions levels. - DefinitionLevelHistogram []int64 `thrift:"7,optional"` + DefinitionLevelHistogram thrift.Slice[int64] `thrift:"7,optional"` } func (c *ColumnIndex) Reset() { @@ -1253,9 +1360,26 @@ type AesGcmCtrV1 struct { SupplyAadPrefix bool `thrift:"3,optional"` } +func (*AesGcmV1) FieldID() int16 { return 1 } +func (*AesGcmCtrV1) FieldID() int16 { return 2 } + +// EncryptionAlgorithmValue is the set of algorithms an EncryptionAlgorithm +// union may hold. +type EncryptionAlgorithmValue interface { + thrift.UnionMember +} + +var encryptionAlgorithmMembers = []thrift.UnionMember{ + (*AesGcmV1)(nil), // 1 + (*AesGcmCtrV1)(nil), // 2 +} + type EncryptionAlgorithm struct { // union - AesGcmV1 *AesGcmV1 `thrift:"1"` - AesGcmCtrV1 *AesGcmCtrV1 `thrift:"2"` + Value EncryptionAlgorithmValue +} + +func (*EncryptionAlgorithm) UnionMembers() []thrift.UnionMember { + return encryptionAlgorithmMembers } // Description for file metadata. @@ -1278,7 +1402,7 @@ type FileMetaData struct { RowGroups thrift.Slice[RowGroup] `thrift:"4,required"` // Optional key/value metadata. - KeyValueMetadata []KeyValue `thrift:"5,optional"` + KeyValueMetadata thrift.Slice[KeyValue] `thrift:"5,optional"` // String for application that wrote this file. This should be in the format // version (build ). @@ -1299,7 +1423,7 @@ type FileMetaData struct { // // The obsolete min and max fields in the Statistics object are always sorted // by signed comparison regardless of column_orders. - ColumnOrders []ColumnOrder `thrift:"7,optional"` + ColumnOrders thrift.Slice[ColumnOrder] `thrift:"7,optional"` // Encryption algorithm. This field is set only in encrypted files // with plaintext footer. Files with encrypted footer store algorithm id diff --git a/vendor/github.com/parquet-go/parquet-go/format/reset.go b/vendor/github.com/parquet-go/parquet-go/format/reset.go new file mode 100644 index 00000000000..10bbcd4dcfa --- /dev/null +++ b/vendor/github.com/parquet-go/parquet-go/format/reset.go @@ -0,0 +1,124 @@ +package format + +// The Reset methods in this file clear values in place while retaining +// allocated slice capacity, so that a value can be reused as the decode +// target of multiple thrift deserializations without allocating on each +// decode (see FooterDecoder). +// +// Because the thrift decoder only writes fields that are present in the +// input, Reset must recursively clear the elements of retained slices; +// otherwise fields decoded from a previous input would leak into the next +// decoded value. Union fields are the exception: the decoder itself clears +// unions absent from the input and zeroes reused members, so Reset retains +// their member allocations for the next decode to reuse. +// +// Byte slice and string fields decoded from footers alias the input buffer +// (they are replaced, never reused, by the decoder), so Reset sets them to +// nil or empty instead of truncating, releasing references to the previous +// input buffer. This includes the contents of retained union members whose +// fields alias the buffer: the member allocation is kept for the next +// decode to reuse, but its contents are zeroed so no retained member holds +// a reference into a buffer with unrelated data. + +// Reset clears m in place, retaining allocated capacity for reuse in +// subsequent thrift decodes. +// +// Note that after reuse, optional list fields that are absent from the +// decoded input are left empty but non-nil, whereas decoding into a fresh +// FileMetaData leaves them nil. Both states are semantically equivalent +// (zero-length), but programs distinguishing nil from empty slices, or +// re-encoding the value, can observe the difference. +func (m *FileMetaData) Reset() { + m.Version = 0 + for i := range m.Schema { + m.Schema[i].Reset() + } + m.Schema = m.Schema[:0] + m.NumRows = 0 + for i := range m.RowGroups { + m.RowGroups[i].Reset() + } + m.RowGroups = m.RowGroups[:0] + clear(m.KeyValueMetadata) + m.KeyValueMetadata = m.KeyValueMetadata[:0] + m.CreatedBy = "" + m.ColumnOrders = m.ColumnOrders[:0] + // Retained union member; scrub buffer-aliasing contents (see file header). + switch v := m.EncryptionAlgorithm.Value.(type) { + case *AesGcmV1: + *v = AesGcmV1{} + case *AesGcmCtrV1: + *v = AesGcmCtrV1{} + } + m.FooterSigningKeyMetadata = nil +} + +// Reset clears s in place, retaining allocated capacity for reuse in +// subsequent thrift decodes. +func (s *SchemaElement) Reset() { + s.Type.Reset() + s.TypeLength.Reset() + s.RepetitionType.Reset() + s.Name = "" + s.NumChildren.Reset() + s.ConvertedType.Reset() + s.Scale.Reset() + s.Precision.Reset() + s.FieldID = 0 + // Retained union member; scrub the buffer-aliasing CRS strings of the + // Geometry and Geography members (see file header). + switch m := s.LogicalType.Value.(type) { + case *GeometryType: + *m = GeometryType{} + case *GeographyType: + *m = GeographyType{} + } +} + +// Reset clears c in place, retaining allocated capacity for reuse in +// subsequent thrift decodes. +func (c *ColumnChunk) Reset() { + c.FilePath = "" + c.FileOffset = 0 + c.MetaData.Reset() + c.OffsetIndexOffset = 0 + c.OffsetIndexLength = 0 + c.ColumnIndexOffset = 0 + c.ColumnIndexLength = 0 + // Retained union member; scrub buffer-aliasing contents (see file header). + if v, ok := c.CryptoMetadata.Value.(*EncryptionWithColumnKey); ok { + *v = EncryptionWithColumnKey{} + } + c.EncryptedColumnMetadata = nil +} + +// Reset clears c in place, retaining allocated capacity for reuse in +// subsequent thrift decodes. +func (c *ColumnMetaData) Reset() { + c.Type = 0 + c.Encoding = c.Encoding[:0] + clear(c.PathInSchema) + c.PathInSchema = c.PathInSchema[:0] + c.Codec = 0 + c.NumValues = 0 + c.TotalUncompressedSize = 0 + c.TotalCompressedSize = 0 + clear(c.KeyValueMetadata) + c.KeyValueMetadata = c.KeyValueMetadata[:0] + c.DataPageOffset = 0 + c.IndexPageOffset = 0 + c.DictionaryPageOffset = 0 + // Statistics byte slices alias the input buffer (replaced, never + // appended to), so zero the whole struct instead of truncating. + c.Statistics = Statistics{} + clear(c.EncodingStats) + c.EncodingStats = c.EncodingStats[:0] + c.BloomFilterOffset = 0 + c.BloomFilterLength = 0 + // The histograms and geospatial types retain capacity. + c.SizeStatistics.UnencodedByteArrayDataBytes = 0 + c.SizeStatistics.RepetitionLevelHistogram = c.SizeStatistics.RepetitionLevelHistogram[:0] + c.SizeStatistics.DefinitionLevelHistogram = c.SizeStatistics.DefinitionLevelHistogram[:0] + c.GeospatialStatistics.BBox = BoundingBox{} + c.GeospatialStatistics.GeoSpatialTypes = c.GeospatialStatistics.GeoSpatialTypes[:0] +} diff --git a/vendor/github.com/parquet-go/parquet-go/limits.go b/vendor/github.com/parquet-go/parquet-go/limits.go index be1a08ff7d3..9c3104427ba 100644 --- a/vendor/github.com/parquet-go/parquet-go/limits.go +++ b/vendor/github.com/parquet-go/parquet-go/limits.go @@ -33,30 +33,75 @@ const ( estimatedSizeOfByteArrayValues = 20 ) +// The make* functions below use a single unsigned comparison to bounds-check the +// index (uint(i) > max catches both i < 0 and i > max), and delegate the failure +// to a dedicated out-of-line panic helper. This keeps their inline cost low: the +// previous implementation inlined fmt.Errorf on the failure path, which inflated +// every caller (Value.Level cost 192) and prevented inlining. Keeping the error +// construction out of line lets these helpers inline and lets small callers such +// as Value.WithRepetitionLevel dead-code-eliminate the check when the argument is +// provably in range. + func makeRepetitionLevel(i int) byte { - checkIndexRange("repetition level", i, 0, MaxRepetitionLevel) + if uint(i) > MaxRepetitionLevel { + panicRepetitionLevelOutOfRange(i) + } return byte(i) } func makeDefinitionLevel(i int) byte { - checkIndexRange("definition level", i, 0, MaxDefinitionLevel) + if uint(i) > MaxDefinitionLevel { + panicDefinitionLevelOutOfRange(i) + } return byte(i) } func makeColumnIndex(i int) uint16 { - checkIndexRange("column index", i, 0, MaxColumnIndex) + if uint(i) > MaxColumnIndex { + panicColumnIndexOutOfRange(i) + } return uint16(i) } func makeNumValues(i int) int32 { - checkIndexRange("number of values", i, 0, math.MaxInt32) + if uint(i) > math.MaxInt32 { + panicNumValuesOutOfRange(i) + } return int32(i) } -func checkIndexRange(typ string, i, min, max int) { - if i < min || i > max { - panic(errIndexOutOfRange(typ, i, min, max)) +// The panic helpers are kept out of line (along with the error construction) so +// the make* functions above stay cheap to inline. + +func panicRepetitionLevelOutOfRange(i int) { + panic(errIndexOutOfRange("repetition level", i, 0, MaxRepetitionLevel)) +} + +func panicDefinitionLevelOutOfRange(i int) { + panic(errIndexOutOfRange("definition level", i, 0, MaxDefinitionLevel)) +} + +func panicColumnIndexOutOfRange(i int) { + panic(errIndexOutOfRange("column index", i, 0, MaxColumnIndex)) +} + +func panicNumValuesOutOfRange(i int) { + panic(errIndexOutOfRange("number of values", i, 0, math.MaxInt32)) +} + +// panicLevelOutOfRange performs the fine-grained range check for Value.Level's +// combined fast-path test. It is only called when at least one of the three +// arguments is out of range, so it can afford to recompute which one to produce +// a precise error message. Keeping it out of line lets Value.Level reduce its +// hot path to a single combined comparison and stay cheap enough to inline. +func panicLevelOutOfRange(repetitionLevel, definitionLevel, columnIndex int) { + if uint(repetitionLevel) > MaxRepetitionLevel { + panicRepetitionLevelOutOfRange(repetitionLevel) + } + if uint(definitionLevel) > MaxDefinitionLevel { + panicDefinitionLevelOutOfRange(definitionLevel) } + panicColumnIndexOutOfRange(columnIndex) } func errIndexOutOfRange(typ string, i, min, max int) error { diff --git a/vendor/github.com/parquet-go/parquet-go/merge.go b/vendor/github.com/parquet-go/parquet-go/merge.go index 0c47386b35b..ab3d5d19312 100644 --- a/vendor/github.com/parquet-go/parquet-go/merge.go +++ b/vendor/github.com/parquet-go/parquet-go/merge.go @@ -84,18 +84,38 @@ func MergeRowGroups(rowGroups []RowGroup, options ...RowGroupOption) (RowGroup, dropDuplicatedRows := config.Sorting.DropDuplicatedRows // Optimization: detect non-overlapping row groups and create segments + makeMerged := func(rowGroups []RowGroup) RowGroup { + merged := &mergedRowGroup{ + compare: mergedCompare, + dropDuplicatedRows: dropDuplicatedRows, + } + merged.init(schema, mergedSortingColumns, rowGroups) + return merged + } + rowGroupSegments := make([]RowGroup, 0) for segment := range overlappingRowGroups(mergedRowGroups, schema, mergedSortingColumns, mergedCompare) { if len(segment) == 1 { - rowGroupSegments = append(rowGroupSegments, segment[0]) - } else { - merged := &mergedRowGroup{ - compare: mergedCompare, - dropDuplicatedRows: dropDuplicatedRows, + rowGroupSegments = append(rowGroupSegments, segment[0].rowGroup) + continue + } + // Refine partially overlapping segments: stretches of key space + // covered by a single row group are sliced off as row-range views, + // leaving only the truly overlapping stretches for the merge. Not + // applied when dropping duplicated rows: which physical row of an + // equal-key run survives depends on the interleaving of ties across + // row groups, which refinement does not preserve. + if !dropDuplicatedRows && !disableMergeRefinement { + if refined := refineSegment(newRefineTargets(segment, schema, mergedSortingColumns), mergedCompare, makeMerged); refined != nil { + rowGroupSegments = append(rowGroupSegments, refined...) + continue } - merged.init(schema, mergedSortingColumns, segment) - rowGroupSegments = append(rowGroupSegments, merged) } + rowGroups := make([]RowGroup, len(segment)) + for i := range segment { + rowGroups[i] = segment[i].rowGroup + } + rowGroupSegments = append(rowGroupSegments, makeMerged(rowGroups)) } if len(rowGroupSegments) == 1 { @@ -120,18 +140,20 @@ func MergeRowGroups(rowGroups []RowGroup, options ...RowGroupOption) (RowGroup, }, nil } +// rowGroupRange associates a row group with the bounds of its sorting columns +// (nil when the bounds could not be determined). +type rowGroupRange struct { + rowGroup RowGroup + minRow Row + maxRow Row +} + // overlappingRowGroups analyzes row groups to find non-overlapping segments // Returns groups of row groups where each group either: // 1. Contains a single non-overlapping row group (can be concatenated) // 2. Contains multiple overlapping row groups (need to be merged) -func overlappingRowGroups(rowGroups []RowGroup, schema *Schema, sorting []SortingColumn, compare func(Row, Row) int) iter.Seq[[]RowGroup] { - return func(yield func([]RowGroup) bool) { - type rowGroupRange struct { - rowGroup RowGroup - minRow Row - maxRow Row - } - +func overlappingRowGroups(rowGroups []RowGroup, schema *Schema, sorting []SortingColumn, compare func(Row, Row) int) iter.Seq[[]rowGroupRange] { + return func(yield func([]rowGroupRange) bool) { rowGroupRanges := make([]rowGroupRange, 0, len(rowGroups)) for _, rg := range rowGroups { if rg.NumRows() == 0 { @@ -139,7 +161,13 @@ func overlappingRowGroups(rowGroups []RowGroup, schema *Schema, sorting []Sortin } minRow, maxRow, err := rowGroupRangeOfSortedColumns(rg, schema, sorting) if err != nil { - yield(rowGroups) + // Bounds unavailable: yield all row groups as a single segment + // with nil bounds, which the caller merges without refinement. + all := make([]rowGroupRange, len(rowGroups)) + for i, rg := range rowGroups { + all[i] = rowGroupRange{rowGroup: rg} + } + yield(all) return } rowGroupRanges = append(rowGroupRanges, rowGroupRange{ @@ -152,7 +180,7 @@ func overlappingRowGroups(rowGroups []RowGroup, schema *Schema, sorting []Sortin return } if len(rowGroupRanges) == 1 { - yield([]RowGroup{rowGroupRanges[0].rowGroup}) + yield(rowGroupRanges[:1]) return } @@ -162,29 +190,26 @@ func overlappingRowGroups(rowGroups []RowGroup, schema *Schema, sorting []Sortin }) // Detect overlapping segments - currentSegment := []RowGroup{rowGroupRanges[0].rowGroup} + segmentStart := 0 currentMax := rowGroupRanges[0].maxRow - for _, rr := range rowGroupRanges[1:] { + for i, rr := range rowGroupRanges[1:] { if compare(rr.minRow, currentMax) <= 0 { - // Overlapping - add to current segment and extend max if necessary - currentSegment = append(currentSegment, rr.rowGroup) + // Overlapping - extend max if necessary if compare(rr.maxRow, currentMax) > 0 { currentMax = rr.maxRow } } else { // Non-overlapping - yield current segment - if !yield(currentSegment) { + if !yield(rowGroupRanges[segmentStart : i+1]) { return } - currentSegment = []RowGroup{rr.rowGroup} + segmentStart = i + 1 currentMax = rr.maxRow } } - if len(currentSegment) > 0 { - yield(currentSegment) - } + yield(rowGroupRanges[segmentStart:]) } } @@ -222,18 +247,26 @@ func rowGroupRangeOfSortedColumns(rg RowGroup, schema *Schema, sorting []Sorting return nil, nil, fmt.Errorf("column index not available for sorting column %s", sortingColumnPath) } - // Since data is sorted by sorting columns, we can efficiently get min/max: - // - Min value = min of first non-null page - // - Max value = max of last non-null page + // Since data is sorted by sorting columns, we can bound the first and + // last rows of the row group from the first and last non-null pages of + // the column index. The bounds are expressed in sort order: when the + // column is sorted in descending order, the first row holds the + // largest value and the last row holds the smallest one, so the page + // statistics to read are inverted. numPages := columnIndex.NumPages() + descending := sortingColumn.Descending() - // Find first non-null page for min value - var globalMin Value + // Bound the first row in sort order from the first non-null page + var firstValue Value var found bool for pageIdx := range numPages { if !columnIndex.NullPage(pageIdx) { - if minValue := columnIndex.MinValue(pageIdx); !minValue.IsNull() { - globalMin, found = minValue, true + value := columnIndex.MinValue(pageIdx) + if descending { + value = columnIndex.MaxValue(pageIdx) + } + if !value.IsNull() { + firstValue, found = value, true break } } @@ -242,20 +275,24 @@ func rowGroupRangeOfSortedColumns(rg RowGroup, schema *Schema, sorting []Sorting return nil, nil, fmt.Errorf("no valid pages found in column index for column %s", sortingColumnPath) } - // Find last non-null page for max value - var globalMax Value + // Bound the last row in sort order from the last non-null page + var lastValue Value for pageIdx := numPages - 1; pageIdx >= 0; pageIdx-- { if !columnIndex.NullPage(pageIdx) { - if maxValue := columnIndex.MaxValue(pageIdx); !maxValue.IsNull() { - globalMax = maxValue + value := columnIndex.MaxValue(pageIdx) + if descending { + value = columnIndex.MinValue(pageIdx) + } + if !value.IsNull() { + lastValue = value break } } } // Set the min/max values with proper levels - minValues[sortingColumnIndex] = globalMin.Level(0, 1, sortingColumnIndex) - maxValues[sortingColumnIndex] = globalMax.Level(0, 1, sortingColumnIndex) + minValues[sortingColumnIndex] = firstValue.Level(0, 1, sortingColumnIndex) + maxValues[sortingColumnIndex] = lastValue.Level(0, 1, sortingColumnIndex) } minRow = Row(minValues) @@ -278,6 +315,12 @@ type mergedRowGroup struct { dropDuplicatedRows bool } +// rowGroupSegments opts out of segment splitting: a mergedRowGroup interleaves +// rows from overlapping row groups via a heap merge, so its row groups cannot be +// written independently without losing the merged ordering. It overrides the +// method promoted from the embedded multiRowGroup. +func (m *mergedRowGroup) rowGroupSegments() []RowGroup { return nil } + func (m *mergedRowGroup) Rows() Rows { // The row group needs to respect a sorting order; the merged row reader // uses a heap to merge rows from the row groups. @@ -307,6 +350,18 @@ type sortedSegmentRowGroup struct { dropDuplicatedRows bool } +// rowGroupSegments implements orderedRowGroupSegments: the segments are already +// in sorted order and each segment's own Rows() preserves its internal ordering, +// so writing them in sequence preserves the global order. It returns nil when +// dropping duplicates, because deduplication spans segment boundaries and would +// be lost if segments were written independently. +func (s *sortedSegmentRowGroup) rowGroupSegments() []RowGroup { + if s.dropDuplicatedRows { + return nil + } + return s.segments +} + func (s *sortedSegmentRowGroup) Rows() Rows { readers := make([]Rows, len(s.segments)) for i, seg := range s.segments { @@ -489,14 +544,12 @@ func mergeRowReaders[T RowReader](rows []T, compare func(Row, Row) int) RowReade } default: buffers := make([]bufferedRowReader, len(rows)) - readers := make([]*bufferedRowReader, len(rows)) for i, r := range rows { buffers[i].rows = r - readers[i] = &buffers[i] } return &mergedRowReader{ compare: compare, - readers: readers, + buffers: buffers, } } } @@ -507,6 +560,8 @@ type mergedRowReader2 struct { compare func(Row, Row) int readers [2]*bufferedRowReader buffers [2]bufferedRowReader + prev int // <0 if r0 won the previous game, >0 if r1 won, 0 otherwise + streak int32 // consecutive games won by the same reader initialized bool } @@ -584,15 +639,42 @@ func (m *mergedRowReader2) ReadRows(rows []Row) (n int, err error) { for n < len(rows) { switch cmp := m.compare(r0.head(), r1.head()); { case cmp < 0: - rows[n] = append(rows[n][:0], r0.head()...) - n++ - hasNext0 = r0.next() - hasNext1 = true + if m.prev < 0 { + m.streak++ + } else { + m.streak = 0 + } + m.prev = -1 + if m.streak >= runDetectionStreak { + // r0 has been winning: gallop through its buffered rows + // for the run that sorts strictly before r1's head (ties + // are emitted pairwise by the case below) and emit it in + // bulk. Interleaved inputs rarely reach the streak + // threshold and pay only the cost of the counter. + n, hasNext0 = m.emitRun(rows, n, r0, r1.head()) + hasNext1 = true + } else { + rows[n] = append(rows[n][:0], r0.head()...) + n++ + hasNext0 = r0.next() + hasNext1 = true + } case cmp > 0: - rows[n] = append(rows[n][:0], r1.head()...) - n++ - hasNext0 = true - hasNext1 = r1.next() + if m.prev > 0 { + m.streak++ + } else { + m.streak = 0 + } + m.prev = 1 + if m.streak >= runDetectionStreak { + n, hasNext1 = m.emitRun(rows, n, r1, r0.head()) + hasNext0 = true + } else { + rows[n] = append(rows[n][:0], r1.head()...) + n++ + hasNext0 = true + hasNext1 = r1.next() + } default: rows[n] = append(rows[n][:0], r0.head()...) n++ @@ -602,6 +684,8 @@ func (m *mergedRowReader2) ReadRows(rows []Row) (n int, err error) { n++ hasNext1 = r1.next() } + m.prev = 0 + m.streak = 0 } if !hasNext0 || !hasNext1 { break @@ -612,39 +696,83 @@ func (m *mergedRowReader2) ReadRows(rows []Row) (n int, err error) { return n, nil } +// emitRun bulk-emits the run of buffered rows of r that sort strictly before +// bound; the head of r must already be known to. It returns the new number of +// rows produced and whether r has more rows buffered. +func (m *mergedRowReader2) emitRun(rows []Row, n int, r *bufferedRowReader, bound Row) (int, bool) { + window := r.window() + if max := len(rows) - n; len(window) > max { + window = window[:max] + } + run := 1 + if len(window) > 1 { + run += runLength(window[1:], bound, m.compare, -1) + } + for _, row := range window[:run] { + rows[n] = append(rows[n][:0], row...) + n++ + } + return n, r.advance(int32(run)) +} + +// mergedRowReader merges k buffered row readers using a tournament tree of +// losers, which performs ~log2(k) comparisons per row instead of the ~2*log2(k) +// required to sift down a binary min-heap. +// +// The tree is laid out as the first k positions of a 2k binary heap: internal +// node i stores the loser of the game played at that position, identified by +// the index of its buffer, and the leaf for buffer i sits at implicit position +// k+i. The overall winner is kept out of the tree in the winner field, and its +// leaf position in winnerLeaf. Advancing the merge replays the games on the +// path from the winner's leaf to the root, comparing the new head of the +// winner against the losers stored along the way. Exhausted readers are +// represented by a negative value which loses every game it plays. type mergedRowReader struct { compare func(Row, Row) int - readers []*bufferedRowReader + buffers []bufferedRowReader + losers []int32 + count int + winner int32 + winnerLeaf int32 + streak int32 // consecutive games won by the current winner initialized bool } +// runDetectionStreak is the number of consecutive games the same reader must +// win before the merge switches to run mode. When the merged inputs are mostly +// disjoint (e.g. sorted row groups overlapping only at their boundaries), the +// same reader wins long streaks and replaying ~log2(k) games per row is wasted +// work; run mode computes the second-smallest head once and then emits rows +// with a single comparison each. Interleaved inputs never reach the threshold +// and pay only the cost of maintaining the streak counter. +const runDetectionStreak = 3 + func (m *mergedRowReader) initialize() error { - for i, r := range m.readers { - switch err := r.read(); err { + k := len(m.buffers) + m.losers = make([]int32, k) + m.count = k + + leaves := make([]int32, k) + for i := range leaves { + leaves[i] = int32(i) + } + + for i := range m.buffers { + switch err := m.buffers[i].read(); err { case nil: case io.EOF: - m.readers[i] = nil + leaves[i] = -1 + m.count-- default: - m.readers = nil + m.count = 0 return err } } - n := 0 - for _, r := range m.readers { - if r != nil { - m.readers[n] = r - n++ - } + if m.count > 0 { + m.winner = m.playInitialGames(0, leaves) + m.winnerLeaf = int32(k) + m.winner } - - clear := m.readers[n:] - for i := range clear { - clear[i] = nil - } - - m.readers = m.readers[:n] - m.heapInit() return nil } @@ -657,95 +785,182 @@ func (m *mergedRowReader) ReadRows(rows []Row) (n int, err error) { } } - for n < len(rows) && len(m.readers) != 0 { - r := m.readers[0] - if r.empty() { // This readers buffer has been exhausted, repopulate it. - if err := r.read(); err != nil { - if err == io.EOF { - m.heapPop() - continue + for n < len(rows) && m.count != 0 { + c := &m.buffers[m.winner] + + if c.empty() { // This reader's buffer has been exhausted, repopulate it. + switch err := c.read(); err { + case nil: + case io.EOF: + m.winner = -1 + m.count-- + if m.count == 0 { + break } + default: return n, err - } else { - if !m.heapDown(0, len(m.readers)) { // heap.Fix - m.heapUp(0) - } - continue } + // The winner's head changed (or the winner was exhausted), replay + // the games on the path from its leaf to the root to determine the + // new winner. + prev := m.winner + m.replayGames() + if m.winner != prev { + m.streak = 0 + } + continue } - rows[n] = append(rows[n][:0], r.head()...) + rows[n] = append(rows[n][:0], c.head()...) n++ - if !r.next() { + if !c.next() { return n, nil } - if !m.heapDown(0, len(m.readers)) { // heap.Fix - m.heapUp(0) + + if m.streak >= runDetectionStreak { + // The same reader has been winning; emit its run in bulk. The run + // bound is the second-smallest head across all readers, so the + // winner keeps winning as long as its head does not exceed it + // (ties favor the incumbent, matching the strict comparison in + // replayGames). Other readers are not consumed during the run, so + // the bound remains valid until it is crossed. The length of the + // run within the buffered window is found with O(log n) + // comparisons: a single comparison of the last buffered row + // settles the common case where the whole window is part of the + // run. + bound := m.runBound() + for n < len(rows) { + window := c.window() + if max := len(rows) - n; len(window) > max { + window = window[:max] + } + run := len(window) + if bound != nil { + run = runLength(window, bound, m.compare, 0) + } + for _, row := range window[:run] { + rows[n] = append(rows[n][:0], row...) + n++ + } + if !c.advance(int32(run)) { + return n, nil + } + if run < len(window) { + break // the run bound was crossed + } + } + m.streak = 0 + m.replayGames() + continue + } + + prev := m.winner + m.replayGames() + if m.winner == prev { + m.streak++ + } else { + m.streak = 0 } } - if len(m.readers) == 0 { + if m.count == 0 { err = io.EOF } return n, err } -func (m *mergedRowReader) heapInit() { - n := len(m.readers) - for i := n/2 - 1; i >= 0; i-- { - m.heapDown(i, n) +// runBound returns the second-smallest head among the merged readers, i.e. the +// row that the current winner's head must not exceed for the winner to keep +// winning. In a tournament tree of losers the runner-up necessarily lost its +// game directly against the overall winner, so it is stored at one of the +// nodes on the winner's path from leaf to root; the minimum over those players +// is the runner-up. Returns nil when the winner is the only reader left. +func (m *mergedRowReader) runBound() (bound Row) { + for offset := (m.winnerLeaf - 1) / 2; ; offset = (offset - 1) / 2 { + if player := m.losers[offset]; player >= 0 { + if head := m.buffers[player].head(); bound == nil || m.compare(head, bound) < 0 { + bound = head + } + } + if offset == 0 { + return bound + } } } -func (m *mergedRowReader) heapPop() { - n := len(m.readers) - 1 - m.heapSwap(0, n) - m.heapDown(0, n) - m.readers = m.readers[:n] +// playInitialGames recursively plays the tournament rooted at position i, +// storing the loser of each game at the internal node where it was played, +// and returns the winner of the subtree. +func (m *mergedRowReader) playInitialGames(i int32, leaves []int32) int32 { + k := int32(len(m.buffers)) + if i >= k { // leaf or out of bounds + if i -= k; int(i) < len(leaves) { + return leaves[i] + } + return -1 + } + n1 := m.playInitialGames(2*i+1, leaves) + n2 := m.playInitialGames(2*i+2, leaves) + loser, winner := m.playGame(n1, n2) + m.losers[i] = loser + return winner } -func (m *mergedRowReader) heapUp(j int) { - for { - i := (j - 1) / 2 // parent - if i == j || !(m.compare(m.readers[j].head(), m.readers[i].head()) < 0) { - break - } - m.heapSwap(i, j) - j = i +func (m *mergedRowReader) playGame(n1, n2 int32) (loser, winner int32) { + if n1 < 0 { + return n1, n2 + } + if n2 < 0 { + return n2, n1 } + if m.compare(m.buffers[n1].head(), m.buffers[n2].head()) < 0 { + return n2, n1 + } + return n1, n2 } -func (m *mergedRowReader) heapDown(i0, n int) bool { - i := i0 - for { - j1 := 2*i + 1 - if j1 >= n || j1 < 0 { // j1 < 0 after int overflow - break - } - j := j1 // left child - if j2 := j1 + 1; j2 < n && m.compare(m.readers[j2].head(), m.readers[j1].head()) < 0 { - j = j2 // = 2*i + 2 // right child +// replayGames walks the path from the current winner's leaf to the root, +// playing the winner against the losers stored along the way and exchanging +// them when they win, then records the new overall winner. +func (m *mergedRowReader) replayGames() { + winner := m.winner + for offset := (m.winnerLeaf - 1) / 2; ; offset = (offset - 1) / 2 { + player := m.losers[offset] + + if player >= 0 { + if winner < 0 || m.compare(m.buffers[player].head(), m.buffers[winner].head()) < 0 { + m.losers[offset] = winner + winner = player + } } - if !(m.compare(m.readers[j].head(), m.readers[i].head()) < 0) { + + if offset == 0 { break } - m.heapSwap(i, j) - i = j } - return i > i0 + m.winner = winner + m.winnerLeaf = int32(len(m.buffers)) + winner } -func (m *mergedRowReader) heapSwap(i, j int) { - m.readers[i], m.readers[j] = m.readers[j], m.readers[i] -} +// minRowBufferSize is the initial buffer size of a bufferedRowReader, and +// maxRowBufferSize the size it can grow to. Buffers grow exponentially as +// long as the underlying reader keeps filling them completely, so merges of +// small row groups do not pay for full-size buffers while sustained merges +// amortize refills and extend the reach of the bulk run emission paths, +// which are bounded by the buffered window. +const ( + minRowBufferSize = 24 + maxRowBufferSize = 192 +) type bufferedRowReader struct { rows RowReader off int32 end int32 - buf [24]Row + full bool // the last read filled the buffer completely + buf []Row } func (r *bufferedRowReader) empty() bool { @@ -757,7 +972,17 @@ func (r *bufferedRowReader) head() Row { } func (r *bufferedRowReader) next() bool { - r.off++ + return r.advance(1) +} + +// window returns the buffered rows that have not been consumed yet. +func (r *bufferedRowReader) window() []Row { + return r.buf[r.off:r.end] +} + +// advance consumes n buffered rows and reports whether more remain buffered. +func (r *bufferedRowReader) advance(n int32) bool { + r.off += n hasNext := r.off < r.end if !hasNext { // We need to read more rows, however it is unsafe to do so here because we haven't @@ -769,14 +994,55 @@ func (r *bufferedRowReader) next() bool { } func (r *bufferedRowReader) read() error { + if r.buf == nil { + r.buf = make([]Row, minRowBufferSize) + } else if r.full && r.off == 0 && r.end == 0 && len(r.buf) < maxRowBufferSize { + // The reader keeps filling the buffer completely: grow it to amortize + // refills and extend the bulk run emission paths. The previous rows + // are carried over so their backing arrays keep being reused. + buf := make([]Row, min(2*len(r.buf), maxRowBufferSize)) + copy(buf, r.buf) + r.buf = buf + } n, err := r.rows.ReadRows(r.buf[r.end:]) if err != nil && n == 0 { return err } r.end += int32(n) + r.full = r.end == int32(len(r.buf)) return nil } +// runLength returns the number of leading rows of window whose comparison +// against bound is at most max (0 to include ties, -1 to exclude them). The +// window must be sorted by the same comparison function, so the qualifying +// rows form a prefix; the function checks the first and last rows to settle +// empty and complete runs with a single comparison, then gallops with a +// binary search refinement, costing O(log n) comparisons instead of the O(n) +// of a linear scan. +func runLength(window []Row, bound Row, compare func(Row, Row) int, max int) int { + if len(window) == 0 || compare(window[0], bound) > max { + return 0 + } + if compare(window[len(window)-1], bound) <= max { + return len(window) + } + lo, hi := 0, 1 + for hi < len(window) && compare(window[hi], bound) <= max { + lo = hi + hi *= 2 + } + hi = min(hi, len(window)) + for lo+1 < hi { + if mid := int(uint(lo+hi) >> 1); compare(window[mid], bound) <= max { + lo = mid + } else { + hi = mid + } + } + return hi +} + var ( _ RowReaderWithSchema = (*mergedRowGroupRows)(nil) ) @@ -878,12 +1144,12 @@ func mergeTwoNodes(a, b Node) Node { merged = group if logicalType := b.Type().LogicalType(); logicalType != nil { - switch { - case logicalType.List != nil: + switch logicalType.Value.(type) { + case *format.ListType: merged = &listNode{group} - case logicalType.Map != nil: + case *format.MapType: merged = &mapNode{group} - case logicalType.Variant != nil: + case *format.VariantType: merged = &variantNode{group} } } diff --git a/vendor/github.com/parquet-go/parquet-go/merge_refine.go b/vendor/github.com/parquet-go/parquet-go/merge_refine.go new file mode 100644 index 00000000000..9bb1a1b7959 --- /dev/null +++ b/vendor/github.com/parquet-go/parquet-go/merge_refine.go @@ -0,0 +1,365 @@ +package parquet + +import ( + "slices" + "sort" +) + +// This file refines overlapping merge segments: when sorted row groups overlap +// only in part of their key ranges (e.g. time-ordered files overlapping around +// their boundaries), the stretches of key space covered by a single row group +// do not need to be merged row by row — they can be sliced off as row-range +// views (see row_range.go) and read or written through the column-oriented +// paths, leaving only the truly overlapping stretches for the loser-tree merge. +// +// Cuts are only ever applied to the row group that is alone in a stretch of +// key space (a "lone stretch"), and are validated against the exact +// row-group-level min/max keys of the other row groups. This avoids a subtle +// hazard: page-granular cuts of different row groups at a common boundary key +// land at different actual keys, which could reorder rows across regions. +// Cutting only the lone row group — with the rows of its boundary pages pushed +// into the adjacent merged region — guarantees that every row of a region +// compares at most equal to every row of the following regions, so +// concatenating the regions preserves sorted order. Ties across row groups +// always land in merged regions, whose loser-tree resolves them. +// +// The refined plan is equivalent to the full merge as a sorted sequence: the +// same multiset of rows, with each input row group's rows in their original +// relative order. The interleaving of rows with equal sort keys across row +// groups may differ from the unrefined merge (as it already does between merge +// arities), which is why refinement is not applied when dropping duplicated +// rows: which physical row of an equal-key run survives deduplication depends +// on that interleaving. + +// disableMergeRefinement forces overlapping segments through the unrefined +// merge. It exists only so tests and benchmarks can compare refined plans +// against the reference behavior. +var disableMergeRefinement bool + +// minStreamedRegionRows is the minimum number of rows a lone stretch must span +// to be worth slicing out of the merge. Below this, the overhead of an extra +// segment (a seek per column, a row group boundary when writing) outweighs the +// merge work saved, so the stretch stays in the adjacent merged region. +const minStreamedRegionRows = 1024 + +// refineTarget describes one row group of an overlapping segment for the +// planner. minRow and maxRow are the exact bounds of the sorting columns, as +// computed by rowGroupRangeOfSortedColumns. cutAbove and cutBelow are +// conservative page-granular row lookups on the first sorting column; either +// may be nil when the row group does not support them, in which case the row +// group is never sliced. +type refineTarget struct { + rowGroup RowGroup + minRow Row + maxRow Row + numRows int64 + + // cutAbove returns the smallest row index such that every row at or after + // it has a sort key strictly greater than key, rounded down to a page + // boundary of the first sorting column (the rows of the page containing + // key stay below the cut). + cutAbove func(key Row) int64 + + // cutBelow returns the largest row index such that every row before it + // has a sort key strictly less than key, rounded down to a page boundary + // of the first sorting column (the rows of the page containing key stay + // at or above the cut). + cutBelow func(key Row) int64 +} + +// newRefineTargets builds the planner inputs for one overlapping segment. It +// returns nil when the segment cannot be refined at all (bounds unavailable). +// Individual row groups whose page index does not support cut lookups get nil +// cut functions and are never sliced, but still participate in the plan. +func newRefineTargets(segment []rowGroupRange, schema *Schema, sorting []SortingColumn) []refineTarget { + if len(sorting) == 0 { + return nil + } + + // Locate the leaf column of the first sorting column; cuts are computed on + // its page bounds only. (Strict inequality on the first sort column implies + // strict inequality on the full sorting tuple, so cuts remain conservative + // for multi-column sorts.) + sortingColumnIndex := -1 + sortingColumnPath := columnPath(sorting[0].Path()) + for columnIndex, path := range schema.Columns() { + if slices.Equal(path, sortingColumnPath) { + sortingColumnIndex = columnIndex + break + } + } + if sortingColumnIndex < 0 { + return nil + } + descending := sorting[0].Descending() + + targets := make([]refineTarget, len(segment)) + for i, rr := range segment { + if rr.minRow == nil || rr.maxRow == nil { + return nil + } + targets[i] = refineTarget{ + rowGroup: rr.rowGroup, + minRow: rr.minRow, + maxRow: rr.maxRow, + numRows: rr.rowGroup.NumRows(), + } + targets[i].cutAbove, targets[i].cutBelow = newCutLookups(rr.rowGroup, sortingColumnIndex, descending) + } + return targets +} + +// newCutLookups builds the page-granular row cut lookups for the sorting leaf +// column of a row group, or (nil, nil) when the page index does not support +// them (missing column or offset index, or null pages in the sorting column, +// whose position in the sort order is not knowable from the index). +func newCutLookups(rg RowGroup, columnIndex int, descending bool) (cutAbove, cutBelow func(Row) int64) { + chunks := rg.ColumnChunks() + if columnIndex >= len(chunks) { + return nil, nil + } + chunk := chunks[columnIndex] + columnType := chunk.Type() + + ci, err := chunk.ColumnIndex() + if err != nil || ci == nil || ci.NumPages() == 0 { + return nil, nil + } + oi, err := chunk.OffsetIndex() + if err != nil || oi == nil || oi.NumPages() != ci.NumPages() { + return nil, nil + } + numPages := ci.NumPages() + for p := range numPages { + if ci.NullPage(p) { + return nil, nil + } + } + numRows := rg.NumRows() + + // In-order page bounds: the first value of a page in sort order is its + // minimum for ascending sorts and its maximum for descending sorts. + earliest := ci.MinValue + latest := ci.MaxValue + if descending { + earliest, latest = latest, earliest + } + // orderCompare orders values by the sort direction. + orderCompare := func(a, b Value) int { + return compareValues(a, b, columnType, descending) + } + pageEnd := func(p int) int64 { + if p+1 < numPages { + return oi.FirstRowIndex(p + 1) + } + return numRows + } + + // cutAbove: end of the last page whose earliest value is at or before key + // (every row from the cut on belongs to a later page, whose values are all + // strictly after key). + cutAbove = func(key Row) int64 { + kv := key[columnIndex] + if kv.IsNull() { + return numRows // no safe cut: the slice comes out empty + } + p := sort.Search(numPages, func(p int) bool { + return orderCompare(earliest(p), kv) > 0 + }) + if p == 0 { + return 0 + } + return pageEnd(p - 1) + } + + // cutBelow: start of the first page whose latest value is at or after key + // (every row before the cut belongs to an earlier page, whose values are + // all strictly before key). + cutBelow = func(key Row) int64 { + kv := key[columnIndex] + if kv.IsNull() { + return 0 // no safe cut: the slice comes out empty + } + p := sort.Search(numPages, func(p int) bool { + return orderCompare(latest(p), kv) >= 0 + }) + if p == numPages { + return numRows + } + return oi.FirstRowIndex(p) + } + + return cutAbove, cutBelow +} + +// refineSegment plans the refinement of one overlapping segment, returning the +// refined sub-segments: an alternation of merged regions (built with +// makeMerged from two or more participants) and single-source row groups or +// range views. It returns nil when no refinement applies, in which case the +// caller merges the whole segment as usual. +func refineSegment(targets []refineTarget, compare func(Row, Row) int, makeMerged func([]RowGroup) RowGroup) []RowGroup { + if len(targets) < 2 { + return nil + } + + type event struct { + key Row + start bool + index int + } + + events := make([]event, 0, 2*len(targets)) + for i := range targets { + events = append(events, + event{key: targets[i].minRow, start: true, index: i}, + event{key: targets[i].maxRow, start: false, index: i}, + ) + } + slices.SortStableFunc(events, func(a, b event) int { + if c := compare(a.key, b.key); c != 0 { + return c + } + // Starts sort before ends so that touching ranges (a max equal to + // another's min) produce a merged region for the shared key instead + // of being falsely torn apart. + switch { + case a.start && !b.start: + return -1 + case !a.start && b.start: + return +1 + default: + return 0 + } + }) + + // regionPart tracks the target index of each participant so merged + // regions can list participants deterministically in minRow order. + type regionPart struct { + index int + part RowGroup + } + + var ( + plan []RowGroup + region []regionPart // participants of the merged region being built + cursors map[int]int64 // rows of each target consumed by earlier regions + active map[int]struct{} // targets whose key interval covers the sweep position + sliced bool // whether any lone slice was emitted + + // pendingLone is set while the sweep is inside a stretch of key space + // covered by a single target; leftK is the exclusive lower bound of + // the stretch (nil at the start of the segment). + pendingLone = -1 + pendingLeftK Row + ) + cursors = make(map[int]int64, len(targets)) + active = make(map[int]struct{}, len(targets)) + + remainder := func(i int) (RowGroup, bool) { + t := &targets[i] + off := cursors[i] + if off >= t.numRows { + return nil, false + } + cursors[i] = t.numRows + if off == 0 { + return t.rowGroup, true + } + return newRowRangeRowGroup(t.rowGroup, off, t.numRows-off), true + } + + closeRegion := func() { + switch len(region) { + case 0: + case 1: + plan = append(plan, region[0].part) + default: + slices.SortStableFunc(region, func(a, b regionPart) int { return a.index - b.index }) + parts := make([]RowGroup, len(region)) + for i, p := range region { + parts[i] = p.part + } + plan = append(plan, makeMerged(parts)) + } + region = nil + } + + // resolveLone ends the pending lone stretch, bounded above by rightK (nil + // at the end of the segment). When the stretch is sliceable and large + // enough, the region below it is closed and the slice emitted; otherwise + // the stretch simply remains part of the current region. + resolveLone := func(rightK Row) { + i := pendingLone + pendingLone = -1 + t := &targets[i] + if t.cutAbove == nil || t.cutBelow == nil { + return + } + off := int64(0) + if pendingLeftK != nil { + off = t.cutAbove(pendingLeftK) + } + end := t.numRows + if rightK != nil { + end = t.cutBelow(rightK) + } + off = max(off, cursors[i]) + end = min(end, t.numRows) + if end-off < minStreamedRegionRows { + return + } + + // Close the region below the slice: every participant contributes its + // remaining rows (their key intervals ended inside the region), and + // the lone target contributes its rows before the slice. + if off > cursors[i] { + region = append(region, regionPart{index: i, part: newRowRangeRowGroup(t.rowGroup, cursors[i], off-cursors[i])}) + } + closeRegion() + + if off == 0 && end == t.numRows { + plan = append(plan, t.rowGroup) + } else { + plan = append(plan, newRowRangeRowGroup(t.rowGroup, off, end-off)) + } + cursors[i] = end + sliced = true + } + + for _, ev := range events { + if ev.start { + if pendingLone >= 0 { + resolveLone(ev.key) + } + active[ev.index] = struct{}{} + if len(active) == 1 { + // First target of the segment: it is alone until the next + // start event. + pendingLone = ev.index + pendingLeftK = nil + } + } else { + // If the ending target is the pending lone one, its stretch runs + // to the end of its rows: resolve before consuming the remainder. + if ev.index == pendingLone { + resolveLone(nil) + } + delete(active, ev.index) + if r, ok := remainder(ev.index); ok { + region = append(region, regionPart{index: ev.index, part: r}) + } + if len(active) == 1 && pendingLone < 0 { + for lone := range active { + pendingLone = lone + } + pendingLeftK = ev.key + } + } + } + closeRegion() + + if !sliced { + return nil + } + return plan +} diff --git a/vendor/github.com/parquet-go/parquet-go/multi_row_group.go b/vendor/github.com/parquet-go/parquet-go/multi_row_group.go index 65bf920d0dd..084b3d4d160 100644 --- a/vendor/github.com/parquet-go/parquet-go/multi_row_group.go +++ b/vendor/github.com/parquet-go/parquet-go/multi_row_group.go @@ -126,6 +126,11 @@ func (m *multiRowGroup) Schema() *Schema { return m.schema } func (m *multiRowGroup) Rows() Rows { return NewRowGroupRowReader(m) } +// rowGroupSegments implements orderedRowGroupSegments: a multiRowGroup is the +// in-order concatenation of its row groups, so each may be written independently +// while preserving row order. +func (m *multiRowGroup) rowGroupSegments() []RowGroup { return m.rowGroups } + type multiColumnChunk struct { rowGroup *multiRowGroup column int @@ -213,10 +218,20 @@ func (c *multiColumnChunk) OffsetIndex() (OffsetIndex, error) { offsets[i+1] = offsets[i] + index.NumPages() } - // Build cumulative row offsets for each chunk + // Build cumulative row offsets for each chunk. Use rowCounts when + // available (flattened chunks), otherwise fall back to rowGroups; the + // chunk count can exceed len(rowGroups) when merging already-merged + // row groups. + rowCounts := c.rowCounts rowOffsets := make([]int64, len(c.chunks)+1) for i := range c.chunks { - rowOffsets[i+1] = rowOffsets[i] + c.rowGroup.rowGroups[i].NumRows() + var numRows int64 + if i < len(rowCounts) { + numRows = rowCounts[i] + } else { + numRows = c.rowGroup.rowGroups[i].NumRows() + } + rowOffsets[i+1] = rowOffsets[i] + numRows } return &multiOffsetIndex{ diff --git a/vendor/github.com/parquet-go/parquet-go/node.go b/vendor/github.com/parquet-go/parquet-go/node.go index e92489f3e8e..cf2cc79a595 100644 --- a/vendor/github.com/parquet-go/parquet-go/node.go +++ b/vendor/github.com/parquet-go/parquet-go/node.go @@ -475,17 +475,17 @@ func isValidInGoIdent(r rune) bool { func isList(node Node) bool { logicalType := node.Type().LogicalType() - return logicalType != nil && logicalType.List != nil + return logicalTypeIs[*format.ListType](logicalType) } func isMap(node Node) bool { logicalType := node.Type().LogicalType() - return logicalType != nil && logicalType.Map != nil + return logicalTypeIs[*format.MapType](logicalType) } func isVariant(node Node) bool { logicalType := node.Type().LogicalType() - return logicalType != nil && logicalType.Variant != nil + return logicalTypeIs[*format.VariantType](logicalType) } func numLeafColumnsOf(node Node) uint16 { diff --git a/vendor/github.com/parquet-go/parquet-go/page_be128.go b/vendor/github.com/parquet-go/parquet-go/page_be128.go index 30f62d0f924..d5d6ac6470c 100644 --- a/vendor/github.com/parquet-go/parquet-go/page_be128.go +++ b/vendor/github.com/parquet-go/parquet-go/page_be128.go @@ -3,7 +3,9 @@ package parquet import ( "io" + "github.com/google/uuid" "github.com/parquet-go/parquet-go/encoding" + "github.com/parquet-go/parquet-go/internal/unsafecast" ) type be128Page struct { @@ -97,3 +99,32 @@ func (r *be128PageValues) ReadValues(values []Value) (n int, err error) { } return n, err } + +func (r *be128PageValues) ReadBE128s(values [][16]byte) (n int, err error) { + n = copy(values, r.page.values[r.offset:]) + r.offset += n + if r.offset == len(r.page.values) { + err = io.EOF + } + return n, err +} + +func (col *be128ColumnBuffer) WriteBE128s(values [][16]byte) (int, error) { + col.values = append(col.values, values...) + return len(values), nil +} + +func (r *be128PageValues) ReadUUIDs(values []uuid.UUID) (n int, err error) { + pageValues := unsafecast.Slice[uuid.UUID](r.page.values) + n = copy(values, pageValues[r.offset:]) + r.offset += n + if r.offset == len(pageValues) { + err = io.EOF + } + return n, err +} + +func (col *be128ColumnBuffer) WriteUUIDs(values []uuid.UUID) (int, error) { + col.values = append(col.values, unsafecast.Slice[[16]byte](values)...) + return len(values), nil +} diff --git a/vendor/github.com/parquet-go/parquet-go/page_bounds_amd64.go b/vendor/github.com/parquet-go/parquet-go/page_bounds_amd64.go index 9cb513b407c..95d250cc414 100644 --- a/vendor/github.com/parquet-go/parquet-go/page_bounds_amd64.go +++ b/vendor/github.com/parquet-go/parquet-go/page_bounds_amd64.go @@ -38,7 +38,12 @@ package parquet // to running less instructions per loop. The performance starts to equalize // around 256KiB, and degrade beyond 1MiB, so we use this threshold to determine // which approach to prefer. -const combinedBoundsThreshold = 1 * 1024 * 1024 +const ( + combinedBoundsThreshold = 1 * 1024 * 1024 + // ColumnWriter fills pages to 98% of DefaultPageBufferSize. This is the + // first whole INT64 value count that reaches that default page target. + combinedBoundsInt64Threshold = (DefaultPageBufferSize*98/100 + 7) / 8 +) //go:noescape func combinedBoundsBool(data []bool) (min, max bool) @@ -49,6 +54,9 @@ func combinedBoundsInt32(data []int32) (min, max int32) //go:noescape func combinedBoundsInt64(data []int64) (min, max int64) +//go:noescape +func combinedBoundsInt64AVX512(data []int64) (min, max int64) + //go:noescape func combinedBoundsUint32(data []uint32) (min, max uint32) @@ -74,8 +82,13 @@ func boundsInt32(data []int32) (min, max int32) { } func boundsInt64(data []int64) (min, max int64) { - if 8*len(data) >= combinedBoundsThreshold { - return combinedBoundsInt64(data) + if len(data) >= combinedBoundsInt64Threshold { + if hasAVX512VL && 8*len(data) < combinedBoundsThreshold { + return combinedBoundsInt64AVX512(data) + } + if 8*len(data) >= combinedBoundsThreshold { + return combinedBoundsInt64(data) + } } min = minInt64(data) max = maxInt64(data) diff --git a/vendor/github.com/parquet-go/parquet-go/page_bounds_amd64.s b/vendor/github.com/parquet-go/parquet-go/page_bounds_amd64.s index c6d172a5e1a..bdadc5a26bc 100644 --- a/vendor/github.com/parquet-go/parquet-go/page_bounds_amd64.s +++ b/vendor/github.com/parquet-go/parquet-go/page_bounds_amd64.s @@ -212,6 +212,79 @@ done: MOVQ R9, max+32(FP) RET +// func combinedBoundsInt64AVX512(data []int64) (min, max int64) +TEXT ·combinedBoundsInt64AVX512(SB), NOSPLIT, $-40 + MOVQ data_base+0(FP), AX + MOVQ data_len+8(FP), CX + XORQ SI, SI + + MOVQ CX, DI + SHRQ $5, DI + SHLQ $5, DI + VPBROADCASTQ (AX), Z0 + VPBROADCASTQ (AX), Z1 + VPBROADCASTQ (AX), Z2 + VPBROADCASTQ (AX), Z3 +loop32: + VMOVDQU64 (AX)(SI*8), Z4 + VMOVDQU64 64(AX)(SI*8), Z5 + VMOVDQU64 128(AX)(SI*8), Z6 + VMOVDQU64 192(AX)(SI*8), Z7 + VPMINSQ Z4, Z0, Z0 + VPMAXSQ Z4, Z1, Z1 + VPMINSQ Z5, Z2, Z2 + VPMAXSQ Z5, Z3, Z3 + VPMINSQ Z6, Z0, Z0 + VPMAXSQ Z6, Z1, Z1 + VPMINSQ Z7, Z2, Z2 + VPMAXSQ Z7, Z3, Z3 + ADDQ $32, SI + CMPQ SI, DI + JNE loop32 + + VPMINSQ Z2, Z0, Z0 + VPMAXSQ Z3, Z1, Z1 + + VMOVDQU32 swap32+0(SB), Z2 + VMOVDQU32 swap32+0(SB), Z3 + VPERMI2D Z0, Z0, Z2 + VPERMI2D Z1, Z1, Z3 + VPMINSQ Y2, Y0, Y0 + VPMAXSQ Y3, Y1, Y1 + + VMOVDQU32 swap32+32(SB), Y2 + VMOVDQU32 swap32+32(SB), Y3 + VPERMI2D Y0, Y0, Y2 + VPERMI2D Y1, Y1, Y3 + VPMINSQ X2, X0, X0 + VPMAXSQ X3, X1, X1 + + VMOVDQU32 swap32+48(SB), X2 + VMOVDQU32 swap32+48(SB), X3 + VPERMI2D X0, X0, X2 + VPERMI2D X1, X1, X3 + VPMINSQ X2, X0, X0 + VPMAXSQ X3, X1, X1 + VZEROUPPER + + MOVQ X0, R8 + MOVQ X1, R9 + CMPQ SI, CX + JE done +loop: + MOVQ (AX)(SI*8), DX + CMPQ DX, R8 + CMOVQLT DX, R8 + CMPQ DX, R9 + CMOVQGT DX, R9 + INCQ SI + CMPQ SI, CX + JNE loop +done: + MOVQ R8, min+24(FP) + MOVQ R9, max+32(FP) + RET + // func combinedBoundsUint32(data []uint32) (min, max uint32) TEXT ·combinedBoundsUint32(SB), NOSPLIT, $-32 MOVQ data_base+0(FP), AX diff --git a/vendor/github.com/parquet-go/parquet-go/reader.go b/vendor/github.com/parquet-go/parquet-go/reader.go index 29c020892f4..21d54965816 100644 --- a/vendor/github.com/parquet-go/parquet-go/reader.go +++ b/vendor/github.com/parquet-go/parquet-go/reader.go @@ -662,6 +662,9 @@ func makeFileRowGroups(file *File, columns []*Column) ([]FileRowGroup, error) { if err := validateRowGroupOrdinals(rowGroups); err != nil { return nil, err } + if err := validateRowCounts(file.metadata.NumRows, rowGroups); err != nil { + return nil, err + } fileRowGroups := make([]FileRowGroup, len(rowGroups)) for i := range fileRowGroups { @@ -712,3 +715,17 @@ func validateRowGroupOrdinals(rowGroups []format.RowGroup) error { } return nil } + +// validateRowCounts rejects negative row counts in the file footer and row groups +// prevent panics later on that would reach for an invalid slice index +func validateRowCounts(fileNumRows int64, rowGroups []format.RowGroup) error { + if fileNumRows < 0 { + return fmt.Errorf("invalid file metadata: num_rows=%d is negative", fileNumRows) + } + for i := range rowGroups { + if n := rowGroups[i].NumRows; n < 0 { + return fmt.Errorf("invalid file metadata: row group %d num_rows=%d is negative", i, n) + } + } + return nil +} diff --git a/vendor/github.com/parquet-go/parquet-go/row.go b/vendor/github.com/parquet-go/parquet-go/row.go index 190480832c4..c1010525433 100644 --- a/vendor/github.com/parquet-go/parquet-go/row.go +++ b/vendor/github.com/parquet-go/parquet-go/row.go @@ -666,7 +666,8 @@ func reconstructFuncOfRepeated(columnIndex uint16, node Node) (uint16, reconstru return nil } - values := make([][]Value, len(columns)) + b := acquireValuesSliceBuffer() + values := b.reserve(len(columns)) column := columns[0] n := 0 @@ -701,6 +702,7 @@ func reconstructFuncOfRepeated(columnIndex uint16, node Node) (uint16, reconstru } if err := reconstruct(value.Index(i), levels, values); err != nil { + b.release() return err } @@ -711,6 +713,7 @@ func reconstructFuncOfRepeated(columnIndex uint16, node Node) (uint16, reconstru levels.repetitionLevel = levels.repetitionDepth } + b.release() return nil } } @@ -761,7 +764,8 @@ func reconstructFuncOfMap(columnIndex uint16, node Node) (uint16, reconstructFun return nil } - values := make([][]Value, len(columns)) + b := acquireValuesSliceBuffer() + values := b.reserve(len(columns)) column := columns[0] t := value.Type() if t.Kind() == reflect.Interface { @@ -808,6 +812,7 @@ func reconstructFuncOfMap(columnIndex uint16, node Node) (uint16, reconstructFun } if err := reconstruct(elem, levels, values); err != nil { + b.release() return err } @@ -832,6 +837,7 @@ func reconstructFuncOfMap(columnIndex uint16, node Node) (uint16, reconstructFun levels.repetitionLevel = levels.repetitionDepth } + b.release() return nil } } diff --git a/vendor/github.com/parquet-go/parquet-go/row_range.go b/vendor/github.com/parquet-go/parquet-go/row_range.go new file mode 100644 index 00000000000..e70fa490cb8 --- /dev/null +++ b/vendor/github.com/parquet-go/parquet-go/row_range.go @@ -0,0 +1,176 @@ +package parquet + +import ( + "fmt" + "io" +) + +// This file implements row-range views of row groups: a rowRangeRowGroup +// presents rows [off, off+length) of a base row group, with column chunks that +// seek to the range start and stop after the range's row count. Range views are +// produced by the merge planner (see merge_refine.go) to slice partially +// overlapping row groups into disjoint stretches — which stream through the +// writer's column-oriented fast paths — and truly overlapping stretches, which +// go through the loser-tree merge. + +// rowRangeRowGroup is a view of rows [off, off+length) of a base row group. +type rowRangeRowGroup struct { + base RowGroup + off int64 + length int64 + chunks []ColumnChunk +} + +// newRowRangeRowGroup returns a view of rows [off, off+length) of base. The +// caller is responsible for bounds: 0 <= off, off+length <= base.NumRows(), +// length > 0, and for not constructing views that span the whole base row +// group (use the base row group directly instead, which preserves its +// eligibility for the verbatim copy fast path). +func newRowRangeRowGroup(base RowGroup, off, length int64) *rowRangeRowGroup { + baseChunks := base.ColumnChunks() + rg := &rowRangeRowGroup{ + base: base, + off: off, + length: length, + chunks: make([]ColumnChunk, len(baseChunks)), + } + + // The value count of a row range is only knowable from metadata when each + // row holds exactly one value, i.e. for non-repeated columns. + repeated := make([]bool, len(baseChunks)) + if schema := base.Schema(); schema != nil { + forEachLeafColumnOf(schema, func(leaf leafColumn) { + if int(leaf.columnIndex) < len(repeated) { + repeated[leaf.columnIndex] = leaf.maxRepetitionLevel > 0 + } + }) + } + + for i, chunk := range baseChunks { + rg.chunks[i] = &rangeColumnChunk{ + base: chunk, + off: off, + length: length, + exact: !repeated[i], + } + } + return rg +} + +func (rg *rowRangeRowGroup) NumRows() int64 { return rg.length } +func (rg *rowRangeRowGroup) ColumnChunks() []ColumnChunk { return rg.chunks } +func (rg *rowRangeRowGroup) Schema() *Schema { return rg.base.Schema() } +func (rg *rowRangeRowGroup) SortingColumns() []SortingColumn { return rg.base.SortingColumns() } +func (rg *rowRangeRowGroup) Rows() Rows { return NewRowGroupRowReader(rg) } + +// chunkTransparentRowGroup marks range views as safe for the chunk-level write +// fast paths: Rows() is NewRowGroupRowReader over the range chunks, so reading +// the chunks in order is the definition of its row semantics. +func (rg *rowRangeRowGroup) chunkTransparentRowGroup() {} + +// rangeColumnChunk presents rows [off, off+length) of a base column chunk. +type rangeColumnChunk struct { + base ColumnChunk + off int64 + length int64 + exact bool // NumValues is exact (non-repeated column) +} + +func (c *rangeColumnChunk) Type() Type { return c.base.Type() } +func (c *rangeColumnChunk) Column() int { return c.base.Column() } + +func (c *rangeColumnChunk) Pages() Pages { + pages := c.base.Pages() + if err := pages.SeekToRow(c.off); err != nil { + pages.Close() + return &errorPages{err: fmt.Errorf("seeking to start of row range at %d: %w", c.off, err)} + } + return &rangePages{base: pages, off: c.off, length: c.length, remaining: c.length} +} + +// The page index and bloom filter of the base chunk describe all of its rows; +// exposing them for a sub-range would let consumers draw wrong conclusions +// (e.g. bounds that rows in the range never reach), so range views report them +// as absent. +func (c *rangeColumnChunk) ColumnIndex() (ColumnIndex, error) { return nil, ErrMissingColumnIndex } +func (c *rangeColumnChunk) OffsetIndex() (OffsetIndex, error) { return nil, ErrMissingOffsetIndex } +func (c *rangeColumnChunk) BloomFilter() BloomFilter { return nil } + +// NumValues returns the number of values in the row range. For non-repeated +// columns this is exactly the row count; for repeated columns the count is not +// knowable from metadata and the base chunk's total is returned as an upper +// bound (see exactNumValues). +func (c *rangeColumnChunk) NumValues() int64 { + if c.exact { + return c.length + } + return c.base.NumValues() +} + +// exactNumValues reports whether NumValues is exact rather than an upper +// bound. Consumers that size resources from NumValues (bloom filters) must +// check this and fall back when the count is inexact. +func (c *rangeColumnChunk) exactNumValues() bool { return c.exact } + +// rangePages limits a Pages stream positioned inside its base column chunk to +// the rows [off, off+length) of the base, slicing the final page when the +// range ends mid-page. +type rangePages struct { + base Pages + off int64 // start of the range, in base row indexes + length int64 + remaining int64 +} + +func (p *rangePages) ReadPage() (Page, error) { + if p.remaining <= 0 { + return nil, io.EOF + } + page, err := p.base.ReadPage() + if err != nil { + return nil, err + } + numRows := page.NumRows() + if numRows <= p.remaining { + p.remaining -= numRows + return page, nil + } + // The range ends inside this page. The slice shares the page's underlying + // buffers without incrementing their reference counts, so ownership of the + // page transfers to the caller through the slice: the caller's Release of + // the slice releases the shared buffers. + tail := page.Slice(0, p.remaining) + p.remaining = 0 + return tail, nil +} + +// SeekToRow positions the stream on the row at index rowIndex within the +// range (i.e. relative to the start of the range, not of the base chunk). +func (p *rangePages) SeekToRow(rowIndex int64) error { + if rowIndex < 0 || rowIndex > p.length { + return fmt.Errorf("SeekToRow: row index %d out of range of row range view of %d rows", rowIndex, p.length) + } + if err := p.base.SeekToRow(p.off + rowIndex); err != nil { + return err + } + p.remaining = p.length - rowIndex + return nil +} + +func (p *rangePages) Close() error { + p.remaining = 0 + return p.base.Close() +} + +// errorPages is a Pages implementation which returns an error on every read. +type errorPages struct{ err error } + +func (p *errorPages) ReadPage() (Page, error) { return nil, p.err } +func (p *errorPages) SeekToRow(int64) error { return p.err } +func (p *errorPages) Close() error { return nil } + +var ( + _ RowGroup = (*rowRangeRowGroup)(nil) + _ ColumnChunk = (*rangeColumnChunk)(nil) + _ Pages = (*rangePages)(nil) +) diff --git a/vendor/github.com/parquet-go/parquet-go/row_variant.go b/vendor/github.com/parquet-go/parquet-go/row_variant.go index 3fea8b3548f..9914963edf5 100644 --- a/vendor/github.com/parquet-go/parquet-go/row_variant.go +++ b/vendor/github.com/parquet-go/parquet-go/row_variant.go @@ -1,13 +1,10 @@ package parquet import ( - "encoding/binary" "fmt" - "maps" "reflect" "unsafe" - "github.com/google/uuid" "github.com/parquet-go/parquet-go/variant" ) @@ -122,82 +119,76 @@ func deconstructFuncOfUnshreddedVariant(columnIndex uint16, node Node) (uint16, } } -// deconstructFuncOfShreddedVariant handles the 3-field shredded variant: -// metadata (required), value (optional), typed_value (optional). -// -// When the Go value matches the typed_value schema, the value is written to the -// typed_value columns and the value column is set to null. Otherwise, the variant- -// encoded bytes are written to the value column and typed_value columns are null. +// deconstructFuncOfShreddedVariant writes Go values into a shredded variant +// group per the Variant Shredding specification (see +// variant_shredded_write.go): values matching the typed_value schema are +// shredded into typed columns; everything else is encoded as plain variant +// values into the appropriate value column, sharing the row's metadata +// dictionary. // //go:noinline func deconstructFuncOfShreddedVariant(columnIndex uint16, node Node) (uint16, deconstructFunc) { - // Fields are sorted alphabetically: metadata, typed_value, value - var metadataColumnIndex, valueColumnIndex, typedValueStartColumn uint16 - var typedValueLeafCount uint16 - var typedValueNode Node - - col := columnIndex - for _, f := range node.Fields() { - n := numLeafColumnsOf(f) - switch f.Name() { - case "metadata": - metadataColumnIndex = col - col += n - case "typed_value": - typedValueStartColumn = col - typedValueNode = f - typedValueLeafCount = n - col += n - case "value": - valueColumnIndex = col - col += n + // Schemas that cannot be written to (e.g. missing the metadata column) + // may still be read from; fail when a row is written, not at build time. + group, err := buildShreddedVariantGroup(node, 0, 0, 0) + if err == nil && group.metadataCol < 0 { + err = fmt.Errorf("variant: shredded variant group has no metadata field") + } + if err != nil { + numCols := numLeafColumnsOf(node) + return columnIndex + numCols, func([][]Value, columnLevels, reflect.Value) { + panic(fmt.Sprintf("invalid shredded variant schema: %v", err)) } } - nextColumnIndex := col - - // Determine the shredded type structure - typedInner := Required(typedValueNode) - matcher := buildShreddedMatcher(typedInner) + nextColumnIndex := columnIndex + uint16(group.numCols) return nextColumnIndex, func(columns [][]Value, levels columnLevels, value reflect.Value) { - metaIdx := ^metadataColumnIndex - valIdx := ^valueColumnIndex + // An invalid value means an enclosing optional/repeated wrapper is + // null for this row: the whole variant group is null. + if !value.IsValid() { + appendShreddedNulls(columns, columnIndex, 0, group.numCols, levels.definitionLevel, levels.repetitionLevel) + return + } + + // Convert the Go value to a variant value tree. Raw variant structs + // (Metadata/Value []byte fields) are decoded so their contents can + // be shredded like any other value. + var v variant.Value + if metaBytes, valBytes, ok := extractRawVariantStruct(value); ok { + m, err := variant.DecodeMetadata(metaBytes) + if err != nil { + panic(fmt.Sprintf("variant metadata: %v", err)) + } + if v, err = variant.Decode(m, valBytes); err != nil { + panic(fmt.Sprintf("variant decode: %v", err)) + } + } else { + var err error + if v, err = variant.ValueOf(extractGoValue(value)); err != nil { + panic(fmt.Sprintf("variant marshal: %v", err)) + } + } - metadata, val := variantMarshalOrNull(value) + // The row's metadata dictionary contains every object field name of + // the value, shredded or not. + var b variant.MetadataBuilder + addVariantFieldNames(&b, v) + + group.write(columns, columnIndex, &b, v, true, shredLevels{ + baseDef: int(levels.definitionLevel), + baseRep: int(levels.repetitionDepth), + rep: levels.repetitionLevel, + }) - // Always write metadata + // The metadata column is written last so the dictionary includes + // the field IDs assigned while encoding residual values. + _, metadata := b.Build() + metaCol := columnIndex + uint16(group.metadataCol) metaValue := makeValueByteArray(ByteArray, unsafe.SliceData(metadata), len(metadata)) metaValue.repetitionLevel = levels.repetitionLevel metaValue.definitionLevel = levels.definitionLevel - metaValue.columnIndex = metaIdx - columns[metadataColumnIndex] = append(columns[metadataColumnIndex], metaValue) - - // Try to shred the value - goVal := extractGoValue(value) - if goVal != nil && matcher.canShred(goVal) { - // Write null to value column (optional, def level not incremented) - columns[valueColumnIndex] = append(columns[valueColumnIndex], Value{ - repetitionLevel: levels.repetitionLevel, - definitionLevel: levels.definitionLevel, - columnIndex: valIdx, - }) - // Write typed value (increment def level for optional typed_value wrapper) - typedLevels := levels - typedLevels.definitionLevel++ - matcher.shred(columns, typedLevels, typedValueStartColumn, goVal) - } else { - // Write variant bytes to value column (increment def level for optional wrapper) - valueLevels := levels - valueLevels.definitionLevel++ - valValue := makeValueByteArray(ByteArray, unsafe.SliceData(val), len(val)) - valValue.repetitionLevel = valueLevels.repetitionLevel - valValue.definitionLevel = valueLevels.definitionLevel - valValue.columnIndex = valIdx - columns[valueColumnIndex] = append(columns[valueColumnIndex], valValue) - - // Write null to all typed_value columns - writeNullLeaves(columns, typedValueStartColumn, typedValueStartColumn+typedValueLeafCount, levels) - } + metaValue.columnIndex = ^metaCol + columns[metaCol] = append(columns[metaCol], metaValue) } } @@ -217,366 +208,6 @@ func extractGoValue(value reflect.Value) any { return v.Interface() } -// writeNullLeaves writes null values to all leaf columns in the range [start, end). -func writeNullLeaves(columns [][]Value, start, end uint16, levels columnLevels) { - for col := start; col < end; col++ { - columns[col] = append(columns[col], Value{ - repetitionLevel: levels.repetitionLevel, - definitionLevel: levels.definitionLevel, - columnIndex: ^col, - }) - } -} - -// shreddedMatcher determines if a Go value can be shredded into a typed_value -// column and performs the shredding. -// -// A matcher is one of three kinds: -// - primitive: typ is set (leaf column) -// - group: fields is set (object with per-field matchers) -// - unsupported: neither (e.g., LIST — values go to the fallback column) -// -// leafCount is always set to the number of leaf columns occupied. -type shreddedMatcher struct { - typ Type // non-nil for primitive typed_value (leaf node) - fields []shreddedFieldMatcher // non-nil for group typed_value (object node) - leafCount uint16 -} - -func (m *shreddedMatcher) isPrimitive() bool { return m.typ != nil } -func (m *shreddedMatcher) isGroup() bool { return len(m.fields) > 0 } -func (m *shreddedMatcher) kind() Kind { return m.typ.Kind() } -func (m *shreddedMatcher) isString() bool { - lt := m.typ.LogicalType() - return lt != nil && lt.UTF8 != nil -} -func (m *shreddedMatcher) isUUID() bool { - lt := m.typ.LogicalType() - return lt != nil && lt.UUID != nil -} - -type shreddedFieldMatcher struct { - name string - matcher shreddedMatcher -} - -func buildShreddedMatcher(node Node) shreddedMatcher { - if node.Leaf() { - return shreddedMatcher{ - typ: node.Type(), - leafCount: 1, - } - } - - // Check if this is a group with (value, typed_value) pairs for each field - fields := node.Fields() - matchers := make([]shreddedFieldMatcher, 0, len(fields)) - for _, f := range fields { - subFields := f.Fields() - if len(subFields) == 2 { - // This is a (value, typed_value) pair for a named field - valueNode := fieldByName(f, "value") - typedNode := fieldByName(f, "typed_value") - if valueNode != nil && typedNode != nil { - matchers = append(matchers, shreddedFieldMatcher{ - name: f.Name(), - matcher: buildShreddedMatcher(Required(typedNode)), - }) - } - } - } - - if len(matchers) > 0 { - return shreddedMatcher{ - fields: matchers, - leafCount: countMatcherLeaves(matchers), - } - } - - // Unsupported typed_value structure (e.g., LIST). Return a matcher - // that never shreds so values always go to the value column. - // Still compute leaf count so column offsets are correct. - return shreddedMatcher{ - leafCount: numLeafColumnsOf(node), - } -} - -func (m *shreddedMatcher) canShred(v any) bool { - if v == nil { - return false - } - if m.isPrimitive() { - return canShredPrimitive(v, m) - } - if m.isGroup() { - return canShredObject(v, m.fields) - } - return false -} - -func canShredPrimitive(v any, m *shreddedMatcher) bool { - switch m.kind() { - case ByteArray: - if m.isString() { - switch v.(type) { - case string: - return true - } - } else { - switch v.(type) { - case []byte: - return true - } - } - case Int32: - switch v.(type) { - case int8, int16, int32, uint8, uint16: - return true - } - case Int64: - switch v.(type) { - case int8, int16, int32, int64, int, uint8, uint16, uint32: - return true - } - case Float: - switch v.(type) { - case float32: - return true - } - case Double: - switch v.(type) { - case float32, float64: - return true - } - case Boolean: - switch v.(type) { - case bool: - return true - } - case FixedLenByteArray: - if m.isUUID() { - switch v.(type) { - case uuid.UUID, [16]byte: - return true - } - } else { - switch v.(type) { - case [16]byte: - return true - } - } - } - return false -} - -func canShredObject(v any, fields []shreddedFieldMatcher) bool { - m, ok := v.(map[string]any) - if !ok { - return false - } - // An object can be shredded if ALL its fields exist in the shredded schema - for key := range m { - found := false - for _, f := range fields { - if f.name == key { - found = true - break - } - } - if !found { - return false - } - } - return true -} - -func (m *shreddedMatcher) shred(columns [][]Value, levels columnLevels, startColumn uint16, v any) { - if m.isPrimitive() { - col := startColumn - pv := goValueToParquetValue(v, m.kind()) - pv.repetitionLevel = levels.repetitionLevel - pv.definitionLevel = levels.definitionLevel - pv.columnIndex = ^col - columns[col] = append(columns[col], pv) - return - } - if m.isGroup() { - m.shredObject(columns, levels, startColumn, v) - } -} - -func (m *shreddedMatcher) shredObject(columns [][]Value, levels columnLevels, startColumn uint16, v any) { - obj, ok := v.(map[string]any) - if !ok { - // Should not happen if canShred returned true - return - } - - col := startColumn - for _, f := range m.fields { - // Within each field's sub-group, fields are sorted alphabetically: - // typed_value comes before value. - typedValueCol := col - typedCount := f.matcher.leafCount - valueCol := col + typedCount - nextFieldCol := valueCol + 1 - - fieldVal, exists := obj[f.name] - if exists && fieldVal != nil && f.matcher.canShred(fieldVal) { - // Write null to field's value column - columns[valueCol] = append(columns[valueCol], Value{ - repetitionLevel: levels.repetitionLevel, - definitionLevel: levels.definitionLevel, - columnIndex: ^valueCol, - }) - // Write typed value (increment def for optional typed_value) - typedLevels := levels - typedLevels.definitionLevel++ - f.matcher.shred(columns, typedLevels, typedValueCol, fieldVal) - } else if exists && fieldVal != nil { - // Value doesn't match typed schema: write variant to field's value. - // Encode metadata+value together so nested objects can be decoded later. - valueLevels := levels - valueLevels.definitionLevel++ - metadata, val, err := variant.Marshal(fieldVal) - if err != nil { - panic(fmt.Sprintf("variant marshal field %q: %v", f.name, err)) - } - combined := encodeFieldVariant(metadata, val) - valValue := makeValueByteArray(ByteArray, unsafe.SliceData(combined), len(combined)) - valValue.repetitionLevel = valueLevels.repetitionLevel - valValue.definitionLevel = valueLevels.definitionLevel - valValue.columnIndex = ^valueCol - columns[valueCol] = append(columns[valueCol], valValue) - // Write null to typed_value columns - writeNullLeaves(columns, typedValueCol, typedValueCol+typedCount, levels) - } else { - // Field not present or null: write null to both - writeNullLeaves(columns, typedValueCol, nextFieldCol, levels) - } - - col = nextFieldCol - } -} - -// encodeFieldVariant encodes metadata and value bytes together for per-field -// fallback storage. Format: 4-byte LE metadata length + metadata + value. -// This ensures nested objects retain their metadata dictionary for decoding. -func encodeFieldVariant(metadata, value []byte) []byte { - mLen := len(metadata) - buf := make([]byte, 4+mLen+len(value)) - binary.LittleEndian.PutUint32(buf, uint32(mLen)) - copy(buf[4:], metadata) - copy(buf[4+mLen:], value) - return buf -} - -// decodeFieldVariant splits per-field variant bytes back into metadata and value. -func decodeFieldVariant(data []byte) (metadata, value []byte, ok bool) { - if len(data) < 4 { - return nil, data, false - } - mLen := int(binary.LittleEndian.Uint32(data)) - if 4+mLen > len(data) { - return nil, data, false - } - return data[4 : 4+mLen], data[4+mLen:], true -} - -// countMatcherColumns returns the total number of leaf columns for a matcher, -// including the value column for each field in a group. -func countMatcherColumns(m *shreddedMatcher) uint16 { - if m.isGroup() { - return countMatcherLeaves(m.fields) - } - return m.leafCount -} - -// countMatcherLeaves sums the leaf columns for a list of field matchers. -// Each field contributes its typed_value leaf count plus one value column. -func countMatcherLeaves(fields []shreddedFieldMatcher) uint16 { - var count uint16 - for _, f := range fields { - count += f.matcher.leafCount + 1 // typed_value leaves + value column - } - return count -} - -func goValueToParquetValue(v any, kind Kind) Value { - switch kind { - case Boolean: - return BooleanValue(v.(bool)) - case Int32: - switch val := v.(type) { - case int8: - return Int32Value(int32(val)) - case int16: - return Int32Value(int32(val)) - case int32: - return Int32Value(val) - case uint8: - return Int32Value(int32(val)) - case uint16: - return Int32Value(int32(val)) - default: - return Int32Value(0) - } - case Int64: - switch val := v.(type) { - case int8: - return Int64Value(int64(val)) - case int16: - return Int64Value(int64(val)) - case int32: - return Int64Value(int64(val)) - case int64: - return Int64Value(val) - case int: - return Int64Value(int64(val)) - case uint8: - return Int64Value(int64(val)) - case uint16: - return Int64Value(int64(val)) - case uint32: - return Int64Value(int64(val)) - default: - return Int64Value(0) - } - case Float: - return FloatValue(v.(float32)) - case Double: - switch val := v.(type) { - case float32: - return DoubleValue(float64(val)) - case float64: - return DoubleValue(val) - default: - return DoubleValue(0) - } - case ByteArray: - switch val := v.(type) { - case string: - return ByteArrayValue([]byte(val)) - case []byte: - return ByteArrayValue(val) - default: - return ByteArrayValue(nil) - } - case FixedLenByteArray: - switch val := v.(type) { - case uuid.UUID: - b := [16]byte(val) - return FixedLenByteArrayValue(b[:]) - case [16]byte: - return FixedLenByteArrayValue(val[:]) - default: - return FixedLenByteArrayValue(nil) - } - default: - return Value{} - } -} - // reconstructFuncOfVariant handles reconstruction of variant columns back into // Go values. Dispatches to unshredded or shredded variant handling. // @@ -641,110 +272,70 @@ func reconstructFuncOfUnshreddedVariant(columnIndex uint16, node Node) (uint16, } } -// reconstructFuncOfShreddedVariant handles the 3-field shredded variant. +// reconstructFuncOfShreddedVariant reconstructs Go values from a shredded +// variant group using the construct_variant algorithm of the Variant +// Shredding specification (see variant_shredded_read.go). // //go:noinline func reconstructFuncOfShreddedVariant(columnIndex uint16, node Node) (uint16, reconstructFunc) { - // Fields are sorted alphabetically: metadata, typed_value, value - var metadataOffset, valueOffset, typedValueOffset uint16 - var typedValueLeafCount uint16 - var typedValueNode Node - - col := uint16(0) - for _, f := range node.Fields() { - n := numLeafColumnsOf(f) - switch f.Name() { - case "metadata": - metadataOffset = col - col += n - case "typed_value": - typedValueOffset = col - typedValueNode = f - typedValueLeafCount = n - col += n - case "value": - valueOffset = col - col += n + group, err := buildShreddedVariantGroup(node, 0, 0, 0) + if err != nil { + numCols := numLeafColumnsOf(node) + return columnIndex + numCols, func(reflect.Value, columnLevels, [][]Value) error { + return err } } - totalCols := int(col) - nextColumnIndex := columnIndex + col - - typedInner := Required(typedValueNode) - extractor := buildShreddedExtractor(typedInner) + nextColumnIndex := columnIndex + uint16(group.numCols) return nextColumnIndex, func(value reflect.Value, levels columnLevels, columns [][]Value) error { - if len(columns) < totalCols { - return fmt.Errorf("shredded variant reconstruction: expected %d columns, got %d", totalCols, len(columns)) + if len(columns) < group.numCols { + return fmt.Errorf("shredded variant reconstruction: expected %d columns, got %d", group.numCols, len(columns)) } - - metaCol := columns[metadataOffset] - valCol := columns[valueOffset] - typedColumns := columns[typedValueOffset : typedValueOffset+typedValueLeafCount] - - if len(metaCol) == 0 { - return fmt.Errorf("variant reconstruction: no values in metadata column %d", columnIndex) + if group.metadataCol < 0 { + return fmt.Errorf("shredded variant reconstruction: missing metadata column") } - metaVal := metaCol[0] - hasValue := len(valCol) > 0 && !valCol[0].IsNull() - hasTypedValue := hasNonNullInColumns(typedColumns) + reader := &variantColumnReader{ + columns: columns, + pos: make([]int, len(columns)), + } - if metaVal.IsNull() && !hasValue && !hasTypedValue { - // All null: missing/null + metaVal, ok := reader.next(group.metadataCol) + if !ok || metaVal.IsNull() || int(metaVal.definitionLevel) < int(levels.definitionLevel) { + // The variant group itself is null for this row. value.Set(reflect.Zero(value.Type())) return nil } - - if hasValue && !hasTypedValue { - // Unshredded value - valBytes := valCol[0].ByteArray() - if len(valBytes) == 0 { - value.Set(reflect.Zero(value.Type())) - return nil - } - metaBytes := metaVal.ByteArray() - if setRawVariantStruct(value, metaBytes, valBytes) { - return nil - } - goVal, err := variant.Unmarshal(metaBytes, valBytes) - if err != nil { - return fmt.Errorf("variant unmarshal: %w", err) - } - return setVariantGoValue(value, goVal) - } - - if !hasValue && hasTypedValue { - // Shredded value: extract from typed columns - goVal := extractor.extract(typedColumns) - return setVariantGoValue(value, goVal) + metaBytes := metaVal.ByteArray() + m, err := variant.DecodeMetadata(metaBytes) + if err != nil { + return fmt.Errorf("variant metadata: %w", err) } - if hasValue && hasTypedValue { - // Partially shredded: typed_value has some fields, value has the rest - typedVal := extractor.extract(typedColumns) - valBytes := valCol[0].ByteArray() - metaBytes := metaVal.ByteArray() - unshreddedVal, err := variant.Unmarshal(metaBytes, valBytes) - if err != nil { - return fmt.Errorf("variant unmarshal: %w", err) + v, present, err := group.read(reader, m, int(levels.definitionLevel), int(levels.repetitionDepth)) + if err != nil { + return err + } + if !present { + // value and typed_value both null at the top level is invalid + // per the spec; read it as variant null (matching + // parquet-java's behavior). + v = variant.Null() + } + + // If the target is a raw variant struct (Metadata/Value []byte + // fields), re-encode the reconstructed value. + if isRawVariantStructTarget(value) { + var b variant.MetadataBuilder + encoded := variant.Encode(&b, v) + _, metadata := b.Build() + if setRawVariantStruct(value, metadata, encoded) { + return nil } - merged := mergeVariantObjects(typedVal, unshreddedVal) - return setVariantGoValue(value, merged) } - value.Set(reflect.Zero(value.Type())) - return nil - } -} - -func hasNonNullInColumns(columns [][]Value) bool { - for _, col := range columns { - if len(col) > 0 && !col[0].IsNull() { - return true - } + return setVariantGoValue(value, v.GoValue()) } - return false } // setRawVariantStruct checks if the target value is a struct with Metadata and @@ -794,186 +385,19 @@ func setVariantGoValue(value reflect.Value, goVal any) error { return nil } -// shreddedExtractor reconstructs Go values from typed_value columns. -// Same three-kind structure as shreddedMatcher: primitive (typ set), -// group (fields set), or unsupported (neither). -type shreddedExtractor struct { - typ Type // non-nil for primitive (leaf column) - fields []shreddedFieldExtractor // non-nil for group (object) - leafCount int -} - -func (e *shreddedExtractor) isPrimitive() bool { return e.typ != nil } -func (e *shreddedExtractor) isGroup() bool { return len(e.fields) > 0 } -func (e *shreddedExtractor) kind() Kind { return e.typ.Kind() } -func (e *shreddedExtractor) isString() bool { - lt := e.typ.LogicalType() - return lt != nil && lt.UTF8 != nil -} -func (e *shreddedExtractor) isUUID() bool { - lt := e.typ.LogicalType() - return lt != nil && lt.UUID != nil -} - -type shreddedFieldExtractor struct { - name string - extractor shreddedExtractor -} - -func buildShreddedExtractor(node Node) shreddedExtractor { - if node.Leaf() { - return shreddedExtractor{ - typ: node.Type(), - leafCount: 1, - } - } - - fields := node.Fields() - extractors := make([]shreddedFieldExtractor, 0, len(fields)) - for _, f := range fields { - subFields := f.Fields() - if len(subFields) == 2 { - typedNode := fieldByName(f, "typed_value") - if typedNode != nil { - extractors = append(extractors, shreddedFieldExtractor{ - name: f.Name(), - extractor: buildShreddedExtractor(Required(typedNode)), - }) - } - } - } - - if len(extractors) > 0 { - leaves := 0 - for _, f := range extractors { - leaves += f.extractor.leafCount + 1 // typed_value leaves + value column - } - return shreddedExtractor{ - fields: extractors, - leafCount: leaves, - } - } - - // Unsupported typed_value structure (e.g., LIST). Return an extractor - // that always returns nil so values are read from the value column. - return shreddedExtractor{ - leafCount: int(numLeafColumnsOf(node)), +// isRawVariantStructTarget reports whether the reconstruction target is a +// struct with Metadata and Value []byte fields (raw variant passthrough). +func isRawVariantStructTarget(value reflect.Value) bool { + t := value.Type() + for t.Kind() == reflect.Ptr { + t = t.Elem() } -} - -func (e *shreddedExtractor) extract(columns [][]Value) any { - if e.isPrimitive() { - if len(columns) == 0 || len(columns[0]) == 0 || columns[0][0].IsNull() { - return nil - } - return parquetValueToGo(columns[0][0], e) - } - if e.isGroup() { - return e.extractObject(columns) - } - return nil -} - -func (e *shreddedExtractor) extractObject(columns [][]Value) any { - result := make(map[string]any) - col := 0 - for _, f := range e.fields { - // Within each field's sub-group, fields are sorted alphabetically: - // typed_value comes before value. - typedStart := col - typedCount := f.extractor.leafCount - valueCol := col + typedCount - nextFieldCol := valueCol + 1 - - hasValue := valueCol < len(columns) && len(columns[valueCol]) > 0 && !columns[valueCol][0].IsNull() - hasTyped := hasNonNullInRange(columns, typedStart, typedStart+typedCount) - - if hasTyped { - val := f.extractor.extract(columns[typedStart : typedStart+typedCount]) - if val != nil { - result[f.name] = val - } - } else if hasValue { - // Field stored as unshredded variant with metadata+value encoded together. - data := columns[valueCol][0].ByteArray() - metaBytes, valBytes, ok := decodeFieldVariant(data) - if ok { - goVal, err := variant.Unmarshal(metaBytes, valBytes) - if err == nil && goVal != nil { - result[f.name] = goVal - } - } - } - - col = nextFieldCol - } - - if len(result) == 0 { - return nil - } - return result -} - -func hasNonNullInRange(columns [][]Value, start, end int) bool { - for i := start; i < end && i < len(columns); i++ { - if len(columns[i]) > 0 && !columns[i][0].IsNull() { - return true - } - } - return false -} - -func parquetValueToGo(v Value, e *shreddedExtractor) any { - switch e.kind() { - case Boolean: - return v.Boolean() - case Int32: - return v.Int32() - case Int64: - return v.Int64() - case Float: - return v.Float() - case Double: - return v.Double() - case ByteArray: - b := v.ByteArray() - if e.isString() { - return string(b) - } - dst := make([]byte, len(b)) - copy(dst, b) - return dst - case FixedLenByteArray: - b := v.ByteArray() - if e.isUUID() && len(b) == 16 { - return uuid.UUID(b) - } - if len(b) == 16 { - var u [16]byte - copy(u[:], b) - return u - } - dst := make([]byte, len(b)) - copy(dst, b) - return dst - default: - return nil - } -} - -// mergeVariantObjects merges two values, preferring typed (shredded) values -// over unshredded ones. Used for partially shredded objects. -func mergeVariantObjects(typed, unshredded any) any { - typedMap, tOk := typed.(map[string]any) - unshreddedMap, uOk := unshredded.(map[string]any) - if tOk && uOk { - result := make(map[string]any, len(typedMap)+len(unshreddedMap)) - maps.Copy(result, unshreddedMap) - maps.Copy(result, typedMap) - return result - } - if tOk { - return typed + if t.Kind() != reflect.Struct { + return false } - return unshredded + byteSliceType := reflect.TypeOf([]byte(nil)) + metaField, hasMetadata := t.FieldByName("Metadata") + valField, hasValue := t.FieldByName("Value") + return hasMetadata && hasValue && + metaField.Type == byteSliceType && valField.Type == byteSliceType } diff --git a/vendor/github.com/parquet-go/parquet-go/schema.go b/vendor/github.com/parquet-go/parquet-go/schema.go index c4d8a8addac..c233cdb8734 100644 --- a/vendor/github.com/parquet-go/parquet-go/schema.go +++ b/vendor/github.com/parquet-go/parquet-go/schema.go @@ -385,14 +385,7 @@ func (s *Schema) Reconstruct(value any, row Row) error { v = v.Elem() } - b := valuesSliceBufferPool.Get( - func() *valuesSliceBuffer { - return &valuesSliceBuffer{ - values: make([][]Value, 0, 64), - } - }, - func(v *valuesSliceBuffer) { v.values = v.values[:0] }, - ) + b := acquireValuesSliceBuffer() state := s.lazyLoadState() funcs := s.lazyLoadFuncs() @@ -432,6 +425,17 @@ func (v *valuesSliceBuffer) release() { var valuesSliceBufferPool memory.Pool[valuesSliceBuffer] +func acquireValuesSliceBuffer() *valuesSliceBuffer { + return valuesSliceBufferPool.Get( + func() *valuesSliceBuffer { + return &valuesSliceBuffer{ + values: make([][]Value, 0, 64), + } + }, + func(v *valuesSliceBuffer) { v.values = v.values[:0] }, + ) +} + // Lookup returns the leaf column at the given path. // // The path is the sequence of column names identifying a leaf column (not @@ -750,7 +754,7 @@ func nodeOf(path []string, t reflect.Type, tags parquetTags, tagReplacements []S } n = FieldID(n, id) default: - throwUnknownTag(t, "map", option) + throwUnknownTag(t, "map", joinOptionArgs(option, args)) } }) @@ -788,6 +792,17 @@ func splitOptionArgs(s string) (option, args string) { return } +// joinOptionArgs is the inverse of splitOptionArgs for the purpose of +// rendering a tag back to the user. splitOptionArgs returns args="()" as +// a sentinel meaning "no parens in the source"; we drop it here so plain +// options don't render as "foo()" in panic messages. +func joinOptionArgs(option, args string) string { + if args == "()" { + return option + } + return option + args +} + func parseDecimalArgs(args string) (scale, precision int, err error) { if !strings.HasPrefix(args, "(") || !strings.HasSuffix(args, ")") { return 0, 0, fmt.Errorf("malformed decimal args: %s", args) @@ -1069,7 +1084,15 @@ func makeNodeOf(path []string, t reflect.Type, name string, tags parquetTags, ta if t == reflect.TypeFor[json.RawMessage]() { throwInvalidTag(t, name, option) } - element := makeNodeOf(append(path, "list", "element"), t.Elem(), t.Name(), tags.getListElementNodeTags(), tagReplacements) + elementTags := tags.getListElementNodeTags() + if elem := t.Elem(); elem.Kind() == reflect.Slice && elem.Elem().Kind() != reflect.Uint8 && !strings.Contains(elementTags.parquet, "list") { + // A nested slice under a list is itself a list: recurse the + // list option implicitly so any nesting depth is expressible + // with a single `list` tag on the field. An explicit + // parquet-element tag still takes precedence. + elementTags.parquet += ",list" + } + element := makeNodeOf(append(path, "list", "element"), t.Elem(), t.Name(), elementTags, tagReplacements) setNode(element) setList() default: @@ -1327,6 +1350,8 @@ func makeNodeOf(path []string, t reflect.Type, name string, tags parquetTags, ta throwInvalidTag(t, name, option+args) } setNode(Geography(crs, alg)) + default: + throwUnknownTag(t, name, joinOptionArgs(option, args)) } }) } @@ -1390,6 +1415,7 @@ func forEachTagOption(tags []string, do func(option, args string)) { option, tag = split(tag) var args string option, args = splitOptionArgs(option) + option = strings.TrimSpace(option) do(option, args) } } diff --git a/vendor/github.com/parquet-go/parquet-go/sorting.go b/vendor/github.com/parquet-go/parquet-go/sorting.go index cdb5974cc99..c39b02f8e8f 100644 --- a/vendor/github.com/parquet-go/parquet-go/sorting.go +++ b/vendor/github.com/parquet-go/parquet-go/sorting.go @@ -110,15 +110,12 @@ func (w *SortingWriter[T]) Close() error { return err } - rows := m.Rows() - defer rows.Close() - - reader := RowReader(rows) - if w.sorting.DropDuplicatedRows { - reader = DedupeRowReader(rows, w.rowbuf.compare) - } - - if _, err := CopyRows(w.output, reader); err != nil { + // Writing the merged row group (rather than copying its rows) lets the + // writer use its chunk-level fast paths when the sorted chunks do not + // overlap: verbatim column chunk copies and column-oriented packing toward + // MaxRowsPerRowGroup. Overlapping chunks fall back to the row-oriented heap + // merge, and the merge itself applies DropDuplicatedRows when configured. + if _, err := w.output.WriteRowGroup(m); err != nil { return err } diff --git a/vendor/github.com/parquet-go/parquet-go/type.go b/vendor/github.com/parquet-go/parquet-go/type.go index c8e27ec64e5..15158022fd6 100644 --- a/vendor/github.com/parquet-go/parquet-go/type.go +++ b/vendor/github.com/parquet-go/parquet-go/type.go @@ -242,10 +242,36 @@ var ( NullType Type = &nullType{} ) +// logicalTypeOf returns the annotation carried by lt if it is of type T. A nil +// lt, or one carrying a different annotation, yields ok=false. +func logicalTypeOf[T format.LogicalTypeValue](lt *format.LogicalType) (T, bool) { + if lt == nil { + var zero T + return zero, false + } + v, ok := lt.Value.(T) + return v, ok +} + +// logicalTypeIs reports whether lt carries a T annotation. +func logicalTypeIs[T format.LogicalTypeValue](lt *format.LogicalType) bool { + _, ok := logicalTypeOf[T](lt) + return ok +} + +// logicalTypeValueOf returns the annotation carried by lt, or nil when lt is +// nil. It is the nil-safe way to reach lt.Value for a type switch. +func logicalTypeValueOf(lt *format.LogicalType) format.LogicalTypeValue { + if lt == nil { + return nil + } + return lt.Value +} + // In the current parquet version supported by this library, only type-defined // orders are supported. var typeDefinedColumnOrder = format.ColumnOrder{ - TypeOrder: new(format.TypeDefinedOrder), + Value: new(format.TypeDefinedOrder), } var physicalTypes = [...]format.Type{ diff --git a/vendor/github.com/parquet-go/parquet-go/type_bson.go b/vendor/github.com/parquet-go/parquet-go/type_bson.go index 687e5d1f7d0..5303f0af7c7 100644 --- a/vendor/github.com/parquet-go/parquet-go/type_bson.go +++ b/vendor/github.com/parquet-go/parquet-go/type_bson.go @@ -14,7 +14,7 @@ import ( func BSON() Node { return Leaf(&bsonType{}) } var bsonLogicalType = format.LogicalType{ - Bson: new(format.BsonType), + Value: new(format.BsonType), } type bsonType format.BsonType diff --git a/vendor/github.com/parquet-go/parquet-go/type_date.go b/vendor/github.com/parquet-go/parquet-go/type_date.go index e408be207db..42b7862ede9 100644 --- a/vendor/github.com/parquet-go/parquet-go/type_date.go +++ b/vendor/github.com/parquet-go/parquet-go/type_date.go @@ -15,7 +15,7 @@ import ( func Date() Node { return Leaf(&dateType{}) } var dateLogicalType = format.LogicalType{ - Date: new(format.DateType), + Value: new(format.DateType), } type dateType format.DateType diff --git a/vendor/github.com/parquet-go/parquet-go/type_decimal.go b/vendor/github.com/parquet-go/parquet-go/type_decimal.go index a3b71ac7bbc..b7882537a16 100644 --- a/vendor/github.com/parquet-go/parquet-go/type_decimal.go +++ b/vendor/github.com/parquet-go/parquet-go/type_decimal.go @@ -49,7 +49,7 @@ type decimalType struct { func (t *decimalType) String() string { return t.decimal.String() } func (t *decimalType) LogicalType() *format.LogicalType { - return &format.LogicalType{Decimal: &t.decimal} + return &format.LogicalType{Value: &t.decimal} } func (t *decimalType) ConvertedType() *deprecated.ConvertedType { @@ -77,6 +77,14 @@ func (t *decimalType) AssignValue(dst reflect.Value, src Value) error { if t.Type.Kind() != ByteArray && t.Type.Kind() != FixedLenByteArray { return nil } + switch dst.Kind() { + case reflect.Slice, reflect.Array, reflect.String: + // Destinations like []byte, [N]byte, or string receive the raw + // big-endian two's-complement representation of the decimal + // value, as they did when decimalType inherited AssignValue + // from its underlying byte array type. + return t.Type.AssignValue(dst, src) + } data := src.ByteArray() val := new(big.Int) if len(data) > 0 && data[0]&0x80 != 0 { @@ -98,7 +106,13 @@ func (t *decimalType) AssignValue(dst reflect.Value, src Value) error { scaleFactor := new(big.Float).SetPrec(prec) scaleFactor.SetInt(new(big.Int).Exp(big.NewInt(10), big.NewInt(int64(t.decimal.Scale)), nil)) f.Quo(f, scaleFactor) - dst.Set(reflect.ValueOf(f)) + switch dst.Kind() { + case reflect.Float32, reflect.Float64: + v, _ := f.Float64() + dst.SetFloat(v) + default: + dst.Set(reflect.ValueOf(f)) + } } return nil } diff --git a/vendor/github.com/parquet-go/parquet-go/type_enum.go b/vendor/github.com/parquet-go/parquet-go/type_enum.go index d47c7bbb2fe..e2c4eedc7c7 100644 --- a/vendor/github.com/parquet-go/parquet-go/type_enum.go +++ b/vendor/github.com/parquet-go/parquet-go/type_enum.go @@ -14,7 +14,7 @@ import ( func Enum() Node { return Leaf(&enumType{}) } var enumLogicalType = format.LogicalType{ - Enum: new(format.EnumType), + Value: new(format.EnumType), } type enumType format.EnumType diff --git a/vendor/github.com/parquet-go/parquet-go/type_geography.go b/vendor/github.com/parquet-go/parquet-go/type_geography.go index f39b0418e91..74f6a29ada3 100644 --- a/vendor/github.com/parquet-go/parquet-go/type_geography.go +++ b/vendor/github.com/parquet-go/parquet-go/type_geography.go @@ -34,18 +34,18 @@ func (t *geographyType) ColumnOrder() *format.ColumnOrder { return byteArrayType func (t *geographyType) PhysicalType() *format.Type { return byteArrayType{}.PhysicalType() } func (t *geographyType) LogicalType() *format.LogicalType { - f := &format.LogicalType{Geography: &format.GeographyType{ + g := format.GeographyType{ CRS: t.CRS, Algorithm: t.Algorithm, - }} - if t.CRS == "" { - f.Geography.CRS = format.GeometryDefaultCRS + } + if g.CRS == "" { + g.CRS = format.GeometryDefaultCRS } if t.Algorithm != 0 { - f.Geography.Algorithm = t.Algorithm + g.Algorithm = t.Algorithm } - return f + return &format.LogicalType{Value: &g} } func (t *geographyType) ConvertedType() *deprecated.ConvertedType { @@ -120,15 +120,18 @@ func (t *geographyType) AssignValue(dst reflect.Value, src Value) error { func (t *geographyType) ConvertValue(val Value, typ Type) (Value, error) { switch src := typ.(type) { case *geographyType: - if src.LogicalType().Geography.CRS != t.CRS { + srcGeography, _ := logicalTypeOf[*format.GeographyType](src.LogicalType()) + dstGeography, _ := logicalTypeOf[*format.GeographyType](t.LogicalType()) + if srcGeography.CRS != t.CRS { return Value{}, errors.New("cannot convert between geography types with different CRS") } - if src.LogicalType().Geography.Algorithm != t.LogicalType().Geography.Algorithm { + if srcGeography.Algorithm != dstGeography.Algorithm { return Value{}, errors.New("cannot convert between geography types with different Algorithm") } return val, nil case *geometryType: - if src.LogicalType().Geometry.CRS != t.CRS { + srcGeometry, _ := logicalTypeOf[*format.GeometryType](src.LogicalType()) + if srcGeometry.CRS != t.CRS { return Value{}, errors.New("cannot convert between geography and geometry types with different CRS") } return val, nil diff --git a/vendor/github.com/parquet-go/parquet-go/type_geometry.go b/vendor/github.com/parquet-go/parquet-go/type_geometry.go index 54f53ef4fcb..57bf2528612 100644 --- a/vendor/github.com/parquet-go/parquet-go/type_geometry.go +++ b/vendor/github.com/parquet-go/parquet-go/type_geometry.go @@ -37,9 +37,9 @@ func (t *geometryType) PhysicalType() *format.Type { return byteArrayType{}.Phys func (t *geometryType) LogicalType() *format.LogicalType { if t.CRS == "" { - return &format.LogicalType{Geometry: &geometryDefaultCRSLogicType} + return &format.LogicalType{Value: &geometryDefaultCRSLogicType} } - return &format.LogicalType{Geometry: (*format.GeometryType)(t)} + return &format.LogicalType{Value: (*format.GeometryType)(t)} } func (t *geometryType) ConvertedType() *deprecated.ConvertedType { @@ -114,12 +114,14 @@ func (t *geometryType) AssignValue(dst reflect.Value, src Value) error { func (t *geometryType) ConvertValue(val Value, typ Type) (Value, error) { switch src := typ.(type) { case *geometryType: - if src.LogicalType().Geometry.CRS != t.CRS { + srcGeometry, _ := logicalTypeOf[*format.GeometryType](src.LogicalType()) + if srcGeometry.CRS != t.CRS { return Value{}, errors.New("cannot convert between geometry types with different CRS") } return val, nil case *geographyType: - if src.LogicalType().Geography.CRS != t.CRS { + srcGeography, _ := logicalTypeOf[*format.GeographyType](src.LogicalType()) + if srcGeography.CRS != t.CRS { return Value{}, errors.New("cannot convert between geography and geometry types with different CRS") } return val, nil diff --git a/vendor/github.com/parquet-go/parquet-go/type_int32.go b/vendor/github.com/parquet-go/parquet-go/type_int32.go index bf9200b3622..c7a138127e3 100644 --- a/vendor/github.com/parquet-go/parquet-go/type_int32.go +++ b/vendor/github.com/parquet-go/parquet-go/type_int32.go @@ -10,7 +10,7 @@ import ( type int32Type struct{} -var int32LogicalType = format.LogicalType{Integer: &format.IntType{ +var int32LogicalType = format.LogicalType{Value: &format.IntType{ BitWidth: 32, IsSigned: true, }} diff --git a/vendor/github.com/parquet-go/parquet-go/type_int64.go b/vendor/github.com/parquet-go/parquet-go/type_int64.go index db1287b6945..21c4fa7d3b3 100644 --- a/vendor/github.com/parquet-go/parquet-go/type_int64.go +++ b/vendor/github.com/parquet-go/parquet-go/type_int64.go @@ -10,7 +10,7 @@ import ( type int64Type struct{} -var int64LogicalType = format.LogicalType{Integer: &format.IntType{ +var int64LogicalType = format.LogicalType{Value: &format.IntType{ BitWidth: 64, IsSigned: true, }} diff --git a/vendor/github.com/parquet-go/parquet-go/type_int_logical.go b/vendor/github.com/parquet-go/parquet-go/type_int_logical.go index 8a2f7ed7618..94627fb717b 100644 --- a/vendor/github.com/parquet-go/parquet-go/type_int_logical.go +++ b/vendor/github.com/parquet-go/parquet-go/type_int_logical.go @@ -56,17 +56,41 @@ var unsignedIntTypes = [...]intType{ } var signedLogicalIntTypes = [...]format.LogicalType{ - {Integer: (*format.IntType)(&signedIntTypes[0])}, - {Integer: (*format.IntType)(&signedIntTypes[1])}, - {Integer: (*format.IntType)(&signedIntTypes[2])}, - {Integer: (*format.IntType)(&signedIntTypes[3])}, + {Value: (*format.IntType)(&signedIntTypes[0])}, + {Value: (*format.IntType)(&signedIntTypes[1])}, + {Value: (*format.IntType)(&signedIntTypes[2])}, + {Value: (*format.IntType)(&signedIntTypes[3])}, } var unsignedLogicalIntTypes = [...]format.LogicalType{ - {Integer: (*format.IntType)(&unsignedIntTypes[0])}, - {Integer: (*format.IntType)(&unsignedIntTypes[1])}, - {Integer: (*format.IntType)(&unsignedIntTypes[2])}, - {Integer: (*format.IntType)(&unsignedIntTypes[3])}, + {Value: (*format.IntType)(&unsignedIntTypes[0])}, + {Value: (*format.IntType)(&unsignedIntTypes[1])}, + {Value: (*format.IntType)(&unsignedIntTypes[2])}, + {Value: (*format.IntType)(&unsignedIntTypes[3])}, +} + +// canonicalIntType maps a decoded IntType onto the instance this package +// already declares for it. Returning the shared instance rather than a pointer +// into the file metadata lets LogicalType find it by identity, instead of +// allocating a new format.LogicalType on every call. +func canonicalIntType(t *format.IntType) *intType { + table := &unsignedIntTypes + if t.IsSigned { + table = &signedIntTypes + } + switch t.BitWidth { + case 8: + return &table[0] + case 16: + return &table[1] + case 32: + return &table[2] + case 64: + return &table[3] + default: + // Not a bit width the spec allows; keep the value the file carried. + return (*intType)(t) + } } type intType format.IntType @@ -143,7 +167,7 @@ func (t *intType) LogicalType() *format.LogicalType { case &unsignedIntTypes[3]: return &unsignedLogicalIntTypes[3] default: - return &format.LogicalType{Integer: (*format.IntType)(t)} + return &format.LogicalType{Value: (*format.IntType)(t)} } } diff --git a/vendor/github.com/parquet-go/parquet-go/type_json.go b/vendor/github.com/parquet-go/parquet-go/type_json.go index abf452f7fb9..d6d41630801 100644 --- a/vendor/github.com/parquet-go/parquet-go/type_json.go +++ b/vendor/github.com/parquet-go/parquet-go/type_json.go @@ -15,7 +15,7 @@ import ( func JSON() Node { return Leaf(&jsonType{}) } var jsonLogicalType = format.LogicalType{ - Json: new(format.JsonType), + Value: new(format.JsonType), } type jsonType format.JsonType diff --git a/vendor/github.com/parquet-go/parquet-go/type_list.go b/vendor/github.com/parquet-go/parquet-go/type_list.go index 3f17fde4922..ccfd413df95 100644 --- a/vendor/github.com/parquet-go/parquet-go/type_list.go +++ b/vendor/github.com/parquet-go/parquet-go/type_list.go @@ -21,7 +21,7 @@ func (listNode) Type() Type { return &listType{} } type listType format.ListType -var listLogicalType = format.LogicalType{List: new(format.ListType)} +var listLogicalType = format.LogicalType{Value: new(format.ListType)} func (t *listType) String() string { return (*format.ListType)(t).String() } diff --git a/vendor/github.com/parquet-go/parquet-go/type_map.go b/vendor/github.com/parquet-go/parquet-go/type_map.go index 66835cda12f..f1d96d3e09e 100644 --- a/vendor/github.com/parquet-go/parquet-go/type_map.go +++ b/vendor/github.com/parquet-go/parquet-go/type_map.go @@ -26,7 +26,7 @@ func (mapNode) Type() Type { return &mapType{} } type mapType format.MapType -var mapLogicalType = format.LogicalType{Map: new(format.MapType)} +var mapLogicalType = format.LogicalType{Value: new(format.MapType)} func (t *mapType) String() string { return (*format.MapType)(t).String() } diff --git a/vendor/github.com/parquet-go/parquet-go/type_null.go b/vendor/github.com/parquet-go/parquet-go/type_null.go index 3a3318226bc..aa9b66950f5 100644 --- a/vendor/github.com/parquet-go/parquet-go/type_null.go +++ b/vendor/github.com/parquet-go/parquet-go/type_null.go @@ -10,7 +10,7 @@ import ( type nullType format.NullType -var nullLogicalType = format.LogicalType{Unknown: new(format.NullType)} +var nullLogicalType = format.LogicalType{Value: new(format.NullType)} func (t *nullType) String() string { return (*format.NullType)(t).String() } diff --git a/vendor/github.com/parquet-go/parquet-go/type_string.go b/vendor/github.com/parquet-go/parquet-go/type_string.go index cdd9afb7873..89bc6ad82d5 100644 --- a/vendor/github.com/parquet-go/parquet-go/type_string.go +++ b/vendor/github.com/parquet-go/parquet-go/type_string.go @@ -15,7 +15,7 @@ import ( func String() Node { return Leaf(&stringType{}) } var stringLogicalType = format.LogicalType{ - UTF8: new(format.StringType), + Value: new(format.StringType), } type stringType format.StringType @@ -92,7 +92,7 @@ func (t *stringType) ConvertValue(val Value, typ Type) (Value, error) { return convertDateToString(val) case *timeType: tz := t2.tz() - if t2.Unit.Micros != nil { + if isMicros(t2.Unit) { return convertTimeMicrosToString(val, tz) } else { return convertTimeMillisToString(val, tz) diff --git a/vendor/github.com/parquet-go/parquet-go/type_time.go b/vendor/github.com/parquet-go/parquet-go/type_time.go index 327ba8bf0ef..3eb5f8b13c1 100644 --- a/vendor/github.com/parquet-go/parquet-go/type_time.go +++ b/vendor/github.com/parquet-go/parquet-go/type_time.go @@ -24,25 +24,31 @@ var ( Nanosecond TimeUnit = &nanosecond{} ) +// The TimeUnit union holds exactly one of these; testing which one is common +// enough in this package to be worth naming. +func isMillis(u format.TimeUnit) bool { _, ok := u.Value.(*format.MilliSeconds); return ok } +func isMicros(u format.TimeUnit) bool { _, ok := u.Value.(*format.MicroSeconds); return ok } +func isNanos(u format.TimeUnit) bool { _, ok := u.Value.(*format.NanoSeconds); return ok } + type millisecond format.MilliSeconds func (u *millisecond) Duration() time.Duration { return time.Millisecond } func (u *millisecond) TimeUnit() format.TimeUnit { - return format.TimeUnit{Millis: (*format.MilliSeconds)(u)} + return format.TimeUnit{Value: (*format.MilliSeconds)(u)} } type microsecond format.MicroSeconds func (u *microsecond) Duration() time.Duration { return time.Microsecond } func (u *microsecond) TimeUnit() format.TimeUnit { - return format.TimeUnit{Micros: (*format.MicroSeconds)(u)} + return format.TimeUnit{Value: (*format.MicroSeconds)(u)} } type nanosecond format.NanoSeconds func (u *nanosecond) Duration() time.Duration { return time.Nanosecond } func (u *nanosecond) TimeUnit() format.TimeUnit { - return format.TimeUnit{Nanos: (*format.NanoSeconds)(u)} + return format.TimeUnit{Value: (*format.NanoSeconds)(u)} } // Time constructs a leaf node of TIME logical type. @@ -61,21 +67,21 @@ func TimeAdjusted(unit TimeUnit, isAdjustedToUTC bool) Node { // Use pre-allocated instances for common cases timeUnit := unit.TimeUnit() if isAdjustedToUTC { - switch { - case timeUnit.Millis != nil: + switch timeUnit.Value.(type) { + case *format.MilliSeconds: return Leaf(&timeMilliAdjustedToUTC) - case timeUnit.Micros != nil: + case *format.MicroSeconds: return Leaf(&timeMicroAdjustedToUTC) - case timeUnit.Nanos != nil: + case *format.NanoSeconds: return Leaf(&timeNanoAdjustedToUTC) } } else { - switch { - case timeUnit.Millis != nil: + switch timeUnit.Value.(type) { + case *format.MilliSeconds: return Leaf(&timeMilliNotAdjustedToUTC) - case timeUnit.Micros != nil: + case *format.MicroSeconds: return Leaf(&timeMicroNotAdjustedToUTC) - case timeUnit.Nanos != nil: + case *format.NanoSeconds: return Leaf(&timeNanoNotAdjustedToUTC) } } @@ -85,56 +91,82 @@ func TimeAdjusted(unit TimeUnit, isAdjustedToUTC bool) Node { var timeMilliAdjustedToUTC = timeType{ IsAdjustedToUTC: true, - Unit: format.TimeUnit{Millis: new(format.MilliSeconds)}, + Unit: format.TimeUnit{Value: new(format.MilliSeconds)}, } var timeMicroAdjustedToUTC = timeType{ IsAdjustedToUTC: true, - Unit: format.TimeUnit{Micros: new(format.MicroSeconds)}, + Unit: format.TimeUnit{Value: new(format.MicroSeconds)}, } var timeNanoAdjustedToUTC = timeType{ IsAdjustedToUTC: true, - Unit: format.TimeUnit{Nanos: new(format.NanoSeconds)}, + Unit: format.TimeUnit{Value: new(format.NanoSeconds)}, } var timeMilliNotAdjustedToUTC = timeType{ IsAdjustedToUTC: false, - Unit: format.TimeUnit{Millis: new(format.MilliSeconds)}, + Unit: format.TimeUnit{Value: new(format.MilliSeconds)}, } var timeMicroNotAdjustedToUTC = timeType{ IsAdjustedToUTC: false, - Unit: format.TimeUnit{Micros: new(format.MicroSeconds)}, + Unit: format.TimeUnit{Value: new(format.MicroSeconds)}, } var timeNanoNotAdjustedToUTC = timeType{ IsAdjustedToUTC: false, - Unit: format.TimeUnit{Nanos: new(format.NanoSeconds)}, + Unit: format.TimeUnit{Value: new(format.NanoSeconds)}, } var timeMilliAdjustedToUTCLogicalType = format.LogicalType{ - Time: (*format.TimeType)(&timeMilliAdjustedToUTC), + Value: (*format.TimeType)(&timeMilliAdjustedToUTC), } var timeMicroAdjustedToUTCLogicalType = format.LogicalType{ - Time: (*format.TimeType)(&timeMicroAdjustedToUTC), + Value: (*format.TimeType)(&timeMicroAdjustedToUTC), } var timeNanoAdjustedToUTCLogicalType = format.LogicalType{ - Time: (*format.TimeType)(&timeNanoAdjustedToUTC), + Value: (*format.TimeType)(&timeNanoAdjustedToUTC), } var timeMilliNotAdjustedToUTCLogicalType = format.LogicalType{ - Time: (*format.TimeType)(&timeMilliNotAdjustedToUTC), + Value: (*format.TimeType)(&timeMilliNotAdjustedToUTC), } var timeMicroNotAdjustedToUTCLogicalType = format.LogicalType{ - Time: (*format.TimeType)(&timeMicroNotAdjustedToUTC), + Value: (*format.TimeType)(&timeMicroNotAdjustedToUTC), } var timeNanoNotAdjustedToUTCLogicalType = format.LogicalType{ - Time: (*format.TimeType)(&timeNanoNotAdjustedToUTC), + Value: (*format.TimeType)(&timeNanoNotAdjustedToUTC), +} + +// canonicalTimeType maps a decoded TimeType onto the instance this package +// already declares for it. See canonicalIntType. +func canonicalTimeType(t *format.TimeType) *timeType { + if t.IsAdjustedToUTC { + switch t.Unit.Value.(type) { + case *format.MilliSeconds: + return &timeMilliAdjustedToUTC + case *format.MicroSeconds: + return &timeMicroAdjustedToUTC + case *format.NanoSeconds: + return &timeNanoAdjustedToUTC + } + } else { + switch t.Unit.Value.(type) { + case *format.MilliSeconds: + return &timeMilliNotAdjustedToUTC + case *format.MicroSeconds: + return &timeMicroNotAdjustedToUTC + case *format.NanoSeconds: + return &timeNanoNotAdjustedToUTC + } + } + // No unit, or one we do not know; keep the value the file carried. + return (*timeType)(t) } type timeType format.TimeType @@ -155,9 +187,9 @@ func (t *timeType) baseType() Type { } } -func (t *timeType) useInt32() bool { return t.Unit.Millis != nil } +func (t *timeType) useInt32() bool { return isMillis(t.Unit) } -func (t *timeType) useInt64() bool { return t.Unit.Micros != nil } +func (t *timeType) useInt64() bool { return isMicros(t.Unit) } func (t *timeType) String() string { return (*format.TimeType)(t).String() } @@ -190,7 +222,7 @@ func (t *timeType) LogicalType() *format.LogicalType { case &timeNanoNotAdjustedToUTC: return &timeNanoNotAdjustedToUTCLogicalType default: - return &format.LogicalType{Time: (*format.TimeType)(t)} + return &format.LogicalType{Value: (*format.TimeType)(t)} } } @@ -241,17 +273,7 @@ func (t *timeType) AssignValue(dst reflect.Value, src Value) error { // Handle time.Duration specially to convert from the stored time unit to nanoseconds if dst.Type() == reflect.TypeFor[time.Duration]() { v := src.int64() - var nanos int64 - switch { - case t.Unit.Millis != nil: - nanos = v * int64(time.Millisecond) - case t.Unit.Micros != nil: - nanos = v * int64(time.Microsecond) - case t.Unit.Nanos != nil: - nanos = v - default: - nanos = v - } + nanos := v * int64(timeUnitDuration(t.Unit)) dst.SetInt(nanos) return nil } @@ -262,14 +284,14 @@ func (t *timeType) ConvertValue(val Value, typ Type) (Value, error) { switch src := typ.(type) { case *stringType: tz := t.tz() - if t.Unit.Micros != nil { + if isMicros(t.Unit) { return convertStringToTimeMicros(val, tz) } else { return convertStringToTimeMillis(val, tz) } case *timestampType: tz := t.tz() - if t.Unit.Micros != nil { + if isMicros(t.Unit) { return convertTimestampToTimeMicros(val, src.Unit, src.tz(), tz) } else { return convertTimestampToTimeMillis(val, src.Unit, src.tz(), tz) diff --git a/vendor/github.com/parquet-go/parquet-go/type_timestamp.go b/vendor/github.com/parquet-go/parquet-go/type_timestamp.go index 08d58633a1f..04fa6265285 100644 --- a/vendor/github.com/parquet-go/parquet-go/type_timestamp.go +++ b/vendor/github.com/parquet-go/parquet-go/type_timestamp.go @@ -25,21 +25,21 @@ func TimestampAdjusted(unit TimeUnit, isAdjustedToUTC bool) Node { // Use pre-allocated instances for common cases timeUnit := unit.TimeUnit() if isAdjustedToUTC { - switch { - case timeUnit.Millis != nil: + switch timeUnit.Value.(type) { + case *format.MilliSeconds: return Leaf(×tampMilliAdjustedToUTC) - case timeUnit.Micros != nil: + case *format.MicroSeconds: return Leaf(×tampMicroAdjustedToUTC) - case timeUnit.Nanos != nil: + case *format.NanoSeconds: return Leaf(×tampNanoAdjustedToUTC) } } else { - switch { - case timeUnit.Millis != nil: + switch timeUnit.Value.(type) { + case *format.MilliSeconds: return Leaf(×tampMilliNotAdjustedToUTC) - case timeUnit.Micros != nil: + case *format.MicroSeconds: return Leaf(×tampMicroNotAdjustedToUTC) - case timeUnit.Nanos != nil: + case *format.NanoSeconds: return Leaf(×tampNanoNotAdjustedToUTC) } } @@ -49,56 +49,82 @@ func TimestampAdjusted(unit TimeUnit, isAdjustedToUTC bool) Node { var timestampMilliAdjustedToUTC = timestampType{ IsAdjustedToUTC: true, - Unit: format.TimeUnit{Millis: new(format.MilliSeconds)}, + Unit: format.TimeUnit{Value: new(format.MilliSeconds)}, } var timestampMicroAdjustedToUTC = timestampType{ IsAdjustedToUTC: true, - Unit: format.TimeUnit{Micros: new(format.MicroSeconds)}, + Unit: format.TimeUnit{Value: new(format.MicroSeconds)}, } var timestampNanoAdjustedToUTC = timestampType{ IsAdjustedToUTC: true, - Unit: format.TimeUnit{Nanos: new(format.NanoSeconds)}, + Unit: format.TimeUnit{Value: new(format.NanoSeconds)}, } var timestampMilliNotAdjustedToUTC = timestampType{ IsAdjustedToUTC: false, - Unit: format.TimeUnit{Millis: new(format.MilliSeconds)}, + Unit: format.TimeUnit{Value: new(format.MilliSeconds)}, } var timestampMicroNotAdjustedToUTC = timestampType{ IsAdjustedToUTC: false, - Unit: format.TimeUnit{Micros: new(format.MicroSeconds)}, + Unit: format.TimeUnit{Value: new(format.MicroSeconds)}, } var timestampNanoNotAdjustedToUTC = timestampType{ IsAdjustedToUTC: false, - Unit: format.TimeUnit{Nanos: new(format.NanoSeconds)}, + Unit: format.TimeUnit{Value: new(format.NanoSeconds)}, } var timestampMilliAdjustedToUTCLogicalType = format.LogicalType{ - Timestamp: (*format.TimestampType)(×tampMilliAdjustedToUTC), + Value: (*format.TimestampType)(×tampMilliAdjustedToUTC), } var timestampMicroAdjustedToUTCLogicalType = format.LogicalType{ - Timestamp: (*format.TimestampType)(×tampMicroAdjustedToUTC), + Value: (*format.TimestampType)(×tampMicroAdjustedToUTC), } var timestampNanoAdjustedToUTCLogicalType = format.LogicalType{ - Timestamp: (*format.TimestampType)(×tampNanoAdjustedToUTC), + Value: (*format.TimestampType)(×tampNanoAdjustedToUTC), } var timestampMilliNotAdjustedToUTCLogicalType = format.LogicalType{ - Timestamp: (*format.TimestampType)(×tampMilliNotAdjustedToUTC), + Value: (*format.TimestampType)(×tampMilliNotAdjustedToUTC), } var timestampMicroNotAdjustedToUTCLogicalType = format.LogicalType{ - Timestamp: (*format.TimestampType)(×tampMicroNotAdjustedToUTC), + Value: (*format.TimestampType)(×tampMicroNotAdjustedToUTC), } var timestampNanoNotAdjustedToUTCLogicalType = format.LogicalType{ - Timestamp: (*format.TimestampType)(×tampNanoNotAdjustedToUTC), + Value: (*format.TimestampType)(×tampNanoNotAdjustedToUTC), +} + +// canonicalTimestampType maps a decoded TimestampType onto the instance this +// package already declares for it. See canonicalIntType. +func canonicalTimestampType(t *format.TimestampType) *timestampType { + if t.IsAdjustedToUTC { + switch t.Unit.Value.(type) { + case *format.MilliSeconds: + return ×tampMilliAdjustedToUTC + case *format.MicroSeconds: + return ×tampMicroAdjustedToUTC + case *format.NanoSeconds: + return ×tampNanoAdjustedToUTC + } + } else { + switch t.Unit.Value.(type) { + case *format.MilliSeconds: + return ×tampMilliNotAdjustedToUTC + case *format.MicroSeconds: + return ×tampMicroNotAdjustedToUTC + case *format.NanoSeconds: + return ×tampNanoNotAdjustedToUTC + } + } + // No unit, or one we do not know; keep the value the file carried. + return (*timestampType)(t) } type timestampType format.TimestampType @@ -142,15 +168,15 @@ func (t *timestampType) LogicalType() *format.LogicalType { case ×tampNanoNotAdjustedToUTC: return ×tampNanoNotAdjustedToUTCLogicalType default: - return &format.LogicalType{Timestamp: (*format.TimestampType)(t)} + return &format.LogicalType{Value: (*format.TimestampType)(t)} } } func (t *timestampType) ConvertedType() *deprecated.ConvertedType { - switch { - case t.Unit.Millis != nil: + switch t.Unit.Value.(type) { + case *format.MilliSeconds: return &convertedTypes[deprecated.TimestampMillis] - case t.Unit.Micros != nil: + case *format.MicroSeconds: return &convertedTypes[deprecated.TimestampMicros] default: return nil @@ -200,17 +226,11 @@ func (t *timestampType) AssignValue(dst reflect.Value, src Value) error { unit := Nanosecond.TimeUnit() lt := t.LogicalType() - if lt != nil && lt.Timestamp != nil { - unit = lt.Timestamp.Unit + if ts, ok := logicalTypeOf[*format.TimestampType](lt); ok { + unit = ts.Unit } - nanos := src.int64() - switch { - case unit.Millis != nil: - nanos = nanos * 1e6 - case unit.Micros != nil: - nanos = nanos * 1e3 - } + nanos := src.int64() * int64(timeUnitDuration(unit)) val := time.Unix(0, nanos).UTC() dst.Set(reflect.ValueOf(val)) @@ -225,17 +245,11 @@ func (t *timestampType) AssignValue(dst reflect.Value, src Value) error { unit := Nanosecond.TimeUnit() lt := t.LogicalType() - if lt != nil && lt.Timestamp != nil { - unit = lt.Timestamp.Unit + if ts, ok := logicalTypeOf[*format.TimestampType](lt); ok { + unit = ts.Unit } - nanos := src.int64() - switch { - case unit.Millis != nil: - nanos = nanos * 1e6 - case unit.Micros != nil: - nanos = nanos * 1e3 - } + nanos := src.int64() * int64(timeUnitDuration(unit)) val := time.Unix(0, nanos).UTC() ptr := &val diff --git a/vendor/github.com/parquet-go/parquet-go/type_uuid.go b/vendor/github.com/parquet-go/parquet-go/type_uuid.go index 1cf2a4f94fc..c480e63bf7f 100644 --- a/vendor/github.com/parquet-go/parquet-go/type_uuid.go +++ b/vendor/github.com/parquet-go/parquet-go/type_uuid.go @@ -14,7 +14,7 @@ import ( func UUID() Node { return Leaf(&uuidType{}) } var uuidLogicaType = format.LogicalType{ - UUID: new(format.UUIDType), + Value: new(format.UUIDType), } type uuidType format.UUIDType diff --git a/vendor/github.com/parquet-go/parquet-go/type_variant.go b/vendor/github.com/parquet-go/parquet-go/type_variant.go index 8d692e0e0c5..ecd93ad1df5 100644 --- a/vendor/github.com/parquet-go/parquet-go/type_variant.go +++ b/vendor/github.com/parquet-go/parquet-go/type_variant.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "reflect" + "slices" "strings" "github.com/parquet-go/parquet-go/deprecated" @@ -17,13 +18,51 @@ import ( // *Experimental*: Support for the VARIANT type is still being developed and subject to // change. // -// Initial support does not attempt to process the variant data. So reading and writing -// data of this type behaves as if it were just a group with two byte array fields, as -// if the logical type annotation were absent. This may change in the future. +// Go values written to a variant column with the "variant" struct tag are encoded +// with the variant binary encoding (see the variant subpackage); structs with +// Metadata and Value []byte fields pass the raw encoding through unchanged. When +// reading, files that store the column shredded are reconstructed automatically. // // [VARIANT logical type]: https://github.com/apache/parquet-format/blob/master/LogicalTypes.md#variant func Variant() Node { - return variantNode{Group{"metadata": Required(Leaf(ByteArrayType)), "value": Required(Leaf(ByteArrayType))}} + return variantNode{variantOrderedGroup(Group{ + "metadata": Required(Leaf(ByteArrayType)), + "value": Required(Leaf(ByteArrayType)), + })} +} + +// variantOrderedGroup wraps a group so its fields are returned in the +// canonical variant order (metadata, value, typed_value; value before +// typed_value in nested groups) instead of alphabetically. Other engines +// (e.g. DuckDB) require the metadata and value columns to come first in +// the variant group. +func variantOrderedGroup(g Group) Node { + return orderedGroup{Group: g, order: []string{"metadata", "value", "typed_value"}} +} + +// orderedGroup is a Group whose fields are returned in an explicit order. +// Fields not listed in order come last, in alphabetical order. +type orderedGroup struct { + Group + order []string +} + +func (g orderedGroup) Fields() []Field { + fields := g.Group.Fields() + rank := func(name string) int { + for i, n := range g.order { + if n == name { + return i + } + } + return len(g.order) + } + sortedFields := make([]Field, len(fields)) + copy(sortedFields, fields) + slices.SortStableFunc(sortedFields, func(a, b Field) int { + return rank(a.Name()) - rank(b.Name()) + }) + return sortedFields } // ShreddedVariant constructs a node of shredded [VARIANT logical type]. It is a group @@ -48,9 +87,10 @@ func Variant() Node { // *Experimental*: Support for the VARIANT type is still being developed and subject to // change. // -// Initial support does not attempt to process the variant data. So reading and writing -// data of this type behaves as if it were just a group with the three described fields, -// as if the logical type annotation were absent. This may change in the future. +// Go values written to a shredded variant column with the "variant" struct tag are +// shredded per the [Parquet documentation]: values matching the shredded type are +// stored in the typed_value columns, and everything else is encoded into the +// appropriate value column. Reading reconstructs the variant from all columns. // // [VARIANT logical type]: https://github.com/apache/parquet-format/blob/master/LogicalTypes.md#variant // [variant value types]: https://github.com/apache/parquet-format/blob/master/VariantShredding.md#shredded-value-types @@ -60,11 +100,11 @@ func ShreddedVariant(shreddedType Node) (Node, error) { if err != nil { return nil, err } - return variantNode{Group{ + return variantNode{variantOrderedGroup(Group{ "metadata": Required(Leaf(ByteArrayType)), "value": Optional(Leaf(ByteArrayType)), "typed_value": Optional(typedNode), - }}, nil + })}, nil } func variantTypedValueNode(node Node, fieldPath ...string) (typed Node, err error) { @@ -77,7 +117,7 @@ func variantTypedValueNode(node Node, fieldPath ...string) (typed Node, err erro return nil, errors.New("repeated types are not allowed unless they are part of a 3-level LIST logical type") } if lt := node.Type().LogicalType(); lt != nil { - switch lt := getLogicalType(lt).(type) { + switch lt := lt.Value.(type) { case *format.ListType: // We must first extract the inner list.element field of the 3-level LIST type. children := node.Fields() @@ -92,10 +132,10 @@ func variantTypedValueNode(node Node, fieldPath ...string) (typed Node, err erro if err != nil { return nil, err } - list := List(Required(Group{ + list := List(Required(variantOrderedGroup(Group{ "value": Optional(Leaf(ByteArrayType)), "typed_value": Optional(elementNode), - })) + }))) if node.ID() != 0 { return FieldID(list, node.ID()), nil } @@ -113,6 +153,8 @@ func variantTypedValueNode(node Node, fieldPath ...string) (typed Node, err erro case *format.TimestampType: case *format.StringType: case *format.UUIDType: + case nil: + // No logical type annotation. default: // No other logical types are allowed. return nil, fmt.Errorf("%s logical types are not allowed", lt) @@ -131,10 +173,10 @@ func variantTypedValueNode(node Node, fieldPath ...string) (typed Node, err erro if err != nil { return nil, err } - group[child.Name()] = Required(Group{ + group[child.Name()] = Required(variantOrderedGroup(Group{ "value": Optional(Leaf(ByteArrayType)), "typed_value": Optional(childNode), - }) + })) } if node.ID() != 0 { return FieldID(group, node.ID()), nil @@ -142,27 +184,13 @@ func variantTypedValueNode(node Node, fieldPath ...string) (typed Node, err erro return group, nil } -func getLogicalType(lt *format.LogicalType) any { - // We use reflection so we can always catch a logical type annotation. If a - // new one is added, we don't have to remember to update the switch above (unless - // a new one is added that is also supported as a variant value). - refVal := reflect.Indirect(reflect.ValueOf(lt)) - for i := range refVal.NumField() { - field := refVal.Field(i) - if field.CanInterface() && !field.IsZero() { - return field.Interface() - } - } - return nil -} - -type variantNode struct{ Group } +type variantNode struct{ Node } func (variantNode) Type() Type { return &variantType{} } type variantType format.VariantType -var variantLogicalType = format.LogicalType{Variant: new(format.VariantType)} +var variantLogicalType = format.LogicalType{Value: new(format.VariantType)} func (t *variantType) String() string { return (*format.VariantType)(t).String() } diff --git a/vendor/github.com/parquet-go/parquet-go/value.go b/vendor/github.com/parquet-go/parquet-go/value.go index b105dc45aa1..05d7f96b50e 100644 --- a/vendor/github.com/parquet-go/parquet-go/value.go +++ b/vendor/github.com/parquet-go/parquet-go/value.go @@ -269,16 +269,16 @@ func makeValue(k Kind, lt *format.LogicalType, v reflect.Value) Value { switch v.Type() { case reflect.TypeOf(time.Time{}): unit := Nanosecond.TimeUnit() - if lt != nil && lt.Timestamp != nil { - unit = lt.Timestamp.Unit + if ts, ok := logicalTypeOf[*format.TimestampType](lt); ok { + unit = ts.Unit } t := v.Interface().(time.Time) var val int64 - switch { - case unit.Millis != nil: + switch unit.Value.(type) { + case *format.MilliSeconds: val = t.UnixMilli() - case unit.Micros != nil: + case *format.MicroSeconds: val = t.UnixMicro() default: val = t.UnixNano() @@ -337,7 +337,7 @@ func makeValue(k Kind, lt *format.LogicalType, v reflect.Value) Value { case FixedLenByteArray: switch v.Kind() { case reflect.String: - if lt.UUID != nil { // uuid + if logicalTypeIs[*format.UUIDType](lt) { // uuid uuidStr := v.String() encoded, err := uuid.MustParse(uuidStr).MarshalBinary() if err != nil { @@ -788,7 +788,7 @@ func (v Value) String() string { case Float: return strconv.FormatFloat(float64(v.float()), 'g', -1, 32) case Double: - return strconv.FormatFloat(v.double(), 'g', -1, 32) + return strconv.FormatFloat(v.double(), 'g', -1, 64) case ByteArray, FixedLenByteArray: return string(v.byteArray()) default: @@ -802,14 +802,68 @@ func (v Value) GoString() string { return fmt.Sprintf("%#v", v) } // Level returns v with the repetition level, definition level, and column index // set to the values passed as arguments. // -// The method panics if either argument is negative. +// The method panics if any argument is negative or exceeds its maximum +// (MaxRepetitionLevel, MaxDefinitionLevel, MaxColumnIndex respectively). +// +// To mutate a single level field in place, see SetRepetitionLevel, +// SetDefinitionLevel, and SetColumnIndex, which the compiler can inline. func (v Value) Level(repetitionLevel, definitionLevel, columnIndex int) Value { - v.repetitionLevel = makeRepetitionLevel(repetitionLevel) - v.definitionLevel = makeDefinitionLevel(definitionLevel) - v.columnIndex = ^makeColumnIndex(columnIndex) + // MaxRepetitionLevel and MaxDefinitionLevel are both math.MaxUint8, so the + // two levels are bounds-checked with a single comparison: ORing them keeps + // the result in range only if both operands are; a negative value converts + // to a large uint and trips the check as well. + if uint(repetitionLevel)|uint(definitionLevel) > MaxRepetitionLevel || + uint(columnIndex) > MaxColumnIndex { + panicLevelOutOfRange(repetitionLevel, definitionLevel, columnIndex) + } + v.repetitionLevel = byte(repetitionLevel) + v.definitionLevel = byte(definitionLevel) + v.columnIndex = ^uint16(columnIndex) return v } +// SetRepetitionLevel sets the repetition level of v to the given value. +// +// Unlike Level, which sets all three level fields and returns a new Value, this +// method mutates a single field in place through a pointer receiver. Avoiding +// the value copy keeps it small enough for the compiler to inline, which lets +// the bounds check be eliminated entirely when the argument is provably in range +// (for example when forwarding an existing repetition level). Mutating a slice +// element in place (values[i].SetRepetitionLevel(...)) makes it a good fit for +// hot loops. +// +// The method panics if level is negative or greater than MaxRepetitionLevel. +func (v *Value) SetRepetitionLevel(level int) { + if uint(level) > MaxRepetitionLevel { + panicRepetitionLevelOutOfRange(level) + } + v.repetitionLevel = byte(level) +} + +// SetDefinitionLevel sets the definition level of v to the given value. +// +// See SetRepetitionLevel for the rationale behind the single-field setters. +// +// The method panics if level is negative or greater than MaxDefinitionLevel. +func (v *Value) SetDefinitionLevel(level int) { + if uint(level) > MaxDefinitionLevel { + panicDefinitionLevelOutOfRange(level) + } + v.definitionLevel = byte(level) +} + +// SetColumnIndex sets the column index of v to the given value. +// +// See SetRepetitionLevel for the rationale behind the single-field setters. +// +// The method panics if columnIndex is negative or greater than MaxColumnIndex. +func (v *Value) SetColumnIndex(columnIndex int) { + if uint(columnIndex) > MaxColumnIndex { + panicColumnIndexOutOfRange(columnIndex) + } + v.columnIndex = ^uint16(columnIndex) +} + // Clone returns a copy of v which does not share any pointers with it. func (v Value) Clone() Value { switch k := v.Kind(); k { @@ -1093,3 +1147,45 @@ type FixedLenByteArrayWriter interface { // is not a multiple of the expected item size. WriteFixedLenByteArrays(values []byte) (int, error) } + +// BE128Reader is an interface implemented by ValueReader instances which +// expose the content of a column of 128-bit big-endian byte array values. +type BE128Reader interface { + // Read 128-bit big-endian values into the buffer passed as argument, + // returning the number of values read. + // + // The method returns io.EOF when all values have been read. + ReadBE128s(values [][16]byte) (int, error) +} + +// BE128Writer is an interface implemented by ValueWriter instances which +// support writing columns of 128-bit big-endian byte array values. +type BE128Writer interface { + // Write 128-bit big-endian values. + // + // The method returns the number of values written, and any error that + // occurred while writing the values. + WriteBE128s(values [][16]byte) (int, error) +} + +// UUIDReader is an interface implemented by ValueReader instances which +// expose the content of a column of UUID values stored as 16-byte +// FIXED_LEN_BYTE_ARRAY with the UUID logical type. +type UUIDReader interface { + // Read UUID values into the buffer passed as argument, returning the + // number of values read. + // + // The method returns io.EOF when all values have been read. + ReadUUIDs(values []uuid.UUID) (int, error) +} + +// UUIDWriter is an interface implemented by ValueWriter instances which +// support writing columns of UUID values stored as 16-byte +// FIXED_LEN_BYTE_ARRAY with the UUID logical type. +type UUIDWriter interface { + // Write UUID values. + // + // The method returns the number of values written, and any error that + // occurred while writing the values. + WriteUUIDs(values []uuid.UUID) (int, error) +} diff --git a/vendor/github.com/parquet-go/parquet-go/variant/builder.go b/vendor/github.com/parquet-go/parquet-go/variant/builder.go new file mode 100644 index 00000000000..197f0259713 --- /dev/null +++ b/vendor/github.com/parquet-go/parquet-go/variant/builder.go @@ -0,0 +1,636 @@ +package variant + +import ( + "encoding/binary" + "errors" + "fmt" + "math" + "slices" + "strings" + + "github.com/google/uuid" +) + +// ValueBuilder is a streaming event sink for variant values. Callers describe +// a value as a sequence of events — scalars, or containers bracketed by +// Begin/End calls — and implementations consume the events without ever +// materializing the value as a tree. +// +// Exactly one value must be written: a single scalar event, or a single +// balanced container. Inside an object, every value must be preceded by a +// Field call naming it, and field names must be unique within their object +// (duplicates are an error). Errors (both misuse of the event sequence and +// implementation-specific failures) are sticky and reported by Err; events +// after an error are ignored. +// +// ValueBuilder is implemented by Builder, which encodes the events to variant +// binary, and by parquet.VariantColumnWriter, which shreds the events +// directly into parquet column buffers. +type ValueBuilder interface { + Null() + Bool(v bool) + Int8(v int8) + Int16(v int16) + Int32(v int32) + Int64(v int64) + Float(v float32) + Double(v float64) + String(v string) + Binary(v []byte) + Date(days int32) + Time(micros int64) + Timestamp(micros int64) + TimestampNTZ(micros int64) + TimestampNanos(nanos int64) + TimestampNTZNanos(nanos int64) + UUID(v uuid.UUID) + Decimal4(unscaled int32, scale byte) + Decimal8(unscaled int64, scale byte) + Decimal16(unscaled [16]byte, scale byte) + + // BeginObject starts an object value. Calls until the matching EndObject + // must alternate Field and value events. + BeginObject() + + // Field names the next value written as a field of the innermost open + // object. + Field(name string) + + // EndObject closes the innermost open object. + EndObject() + + // BeginArray starts an array value. Every value written until the + // matching EndArray is one element. + BeginArray() + + // EndArray closes the innermost open array. + EndArray() + + // Err returns the first error encountered, or nil. + Err() error +} + +// Write replays the value as a sequence of events on w. It is the bridge +// from the tree representation to any ValueBuilder. +func (v Value) Write(w ValueBuilder) { + switch v.basic { + case BasicObject: + w.BeginObject() + for _, f := range v.object.Fields { + w.Field(f.Name) + f.Value.Write(w) + } + w.EndObject() + case BasicArray: + w.BeginArray() + for _, e := range v.array.Elements { + e.Write(w) + } + w.EndArray() + case BasicShortString: + w.String(v.str) + default: + switch v.primitive { + case PrimitiveNull: + w.Null() + case PrimitiveTrue: + w.Bool(true) + case PrimitiveFalse: + w.Bool(false) + case PrimitiveInt8: + w.Int8(int8(v.i64)) + case PrimitiveInt16: + w.Int16(int16(v.i64)) + case PrimitiveInt32: + w.Int32(int32(v.i64)) + case PrimitiveInt64: + w.Int64(v.i64) + case PrimitiveFloat: + w.Float(float32(v.f64)) + case PrimitiveDouble: + w.Double(v.f64) + case PrimitiveString: + w.String(v.str) + case PrimitiveBinary: + w.Binary(v.bytes) + case PrimitiveDate: + w.Date(int32(v.i64)) + case PrimitiveTime: + w.Time(v.i64) + case PrimitiveTimestamp: + w.Timestamp(v.i64) + case PrimitiveTimestampNTZ: + w.TimestampNTZ(v.i64) + case PrimitiveTimestampNanos: + w.TimestampNanos(v.i64) + case PrimitiveTimestampNTZNanos: + w.TimestampNTZNanos(v.i64) + case PrimitiveUUID: + w.UUID(v.uuid) + case PrimitiveDecimal4: + w.Decimal4(int32(v.i64), v.scale) + case PrimitiveDecimal8: + w.Decimal8(v.i64, v.scale) + case PrimitiveDecimal16: + w.Decimal16(v.decimal16, v.scale) + default: + w.Null() + } + } +} + +// Builder is a streaming encoder for variant values: a ValueBuilder that +// encodes events directly to the variant binary format in a single growing +// buffer, without building a Value tree. +// +// Values are encoded as their events arrive. When a container closes, its +// header (field IDs, offsets) is spliced in front of the already-encoded +// children with one memmove, so encoding is a single pass with no per-value +// allocations beyond buffer growth. Object field values are kept in event +// order and only the header entries are sorted by field name, which the +// encoding permits (field IDs must be sorted, field offsets need not be +// monotonic). +// +// The zero value is ready to use and owns its metadata dictionary; Finish +// returns both the metadata and the value. NewBuilderWithMetadata creates a +// builder that interns field names into a shared, caller-owned dictionary, +// which is how multiple values (e.g. all residuals of one shredded row) +// share one dictionary. +// +// A Builder may be reused after Reset. Reset retains internal buffers, so a +// long-lived Builder encodes a stream of values with amortized zero +// allocation. A Builder must not be copied after first use. +type Builder struct { + meta *MetadataBuilder + ownMeta MetadataBuilder + + buf []byte + scratch []byte + + frames []builderFrame + fields []builderField // arena shared by all open object frames + elems []int // arena shared by all open array frames + + pendingField bool // inside an object, a Field awaits its value + complete bool // one complete top-level value has been written + err error +} + +type builderFrame struct { + isObject bool + start int // buf offset where the container's first child begins + fieldsBase int // objects: base of this frame's entries in the fields arena + elemsBase int // arrays: base of this frame's element starts in the elems arena +} + +type builderField struct { + id int + start int // buf offset where the field's value begins +} + +// NewBuilderWithMetadata returns a Builder that interns object field names +// into the given shared metadata dictionary instead of an internal one. +// Finish builds the shared dictionary; callers encoding multiple values +// against one dictionary typically use Bytes and build the metadata +// themselves once. +func NewBuilderWithMetadata(meta *MetadataBuilder) *Builder { + return &Builder{meta: meta} +} + +func (b *Builder) metadata() *MetadataBuilder { + if b.meta == nil { + b.meta = &b.ownMeta + } + return b.meta +} + +// Err returns the first error encountered, or nil. +func (b *Builder) Err() error { return b.err } + +func (b *Builder) fail(format string, args ...any) { + if b.err == nil { + b.err = fmt.Errorf("variant builder: "+format, args...) + } +} + +// Reset clears the builder for reuse, retaining internal buffers. If the +// builder owns its metadata dictionary the dictionary is cleared too; a +// shared dictionary (NewBuilderWithMetadata) is left untouched. +func (b *Builder) Reset() { + if b.meta == &b.ownMeta { + b.ownMeta.Reset() + } + b.buf = b.buf[:0] + b.frames = b.frames[:0] + b.fields = b.fields[:0] + b.elems = b.elems[:0] + b.pendingField = false + b.complete = false + b.err = nil +} + +// Finish returns the encoded metadata and value. It fails if no value or an +// incomplete value has been written. The value slice aliases the builder's +// internal buffer and is invalidated by Reset or further writes, the same +// as Bytes; the metadata slice is freshly allocated. +func (b *Builder) Finish() (metadata, value []byte, err error) { + value, err = b.Bytes() + if err != nil { + return nil, nil, err + } + meta := b.metadata() + // Dictionary offsets are at most 4 bytes wide; MetadataBuilder.AppendTo + // would silently truncate a larger dictionary. + if uint64(meta.Size()) > math.MaxUint32 { + return nil, nil, fmt.Errorf("variant builder: metadata dictionary of %d bytes exceeds the variant format's 4 GiB limit", meta.Size()) + } + metadata = meta.AppendTo(nil) + return metadata, value, nil +} + +// Bytes returns the encoded value bytes without building the metadata. The +// returned slice aliases the builder's internal buffer and is invalidated by +// Reset or further writes. +func (b *Builder) Bytes() ([]byte, error) { + switch { + case b.err != nil: + return nil, b.err + case len(b.frames) > 0: + return nil, errors.New("variant builder: unclosed object or array") + case !b.complete: + return nil, errors.New("variant builder: no value written") + } + return b.buf, nil +} + +// beginValue validates that a value event is legal in the current state and +// records array element boundaries. It reports whether to proceed. +func (b *Builder) beginValue() bool { + if b.err != nil { + return false + } + if n := len(b.frames); n == 0 { + if b.complete { + b.fail("more than one top-level value") + return false + } + } else if f := &b.frames[n-1]; f.isObject { + if !b.pendingField { + b.fail("value written inside an object without a Field call") + return false + } + b.pendingField = false + } else { + b.elems = append(b.elems, len(b.buf)) + } + return true +} + +func (b *Builder) endValue() { + if len(b.frames) == 0 { + b.complete = true + } +} + +func (b *Builder) appendScalar(data ...byte) { + if b.beginValue() { + b.buf = append(b.buf, data...) + b.endValue() + } +} + +func (b *Builder) Null() { b.appendScalar(makeHeader(BasicPrimitive, byte(PrimitiveNull))) } + +func (b *Builder) Bool(v bool) { + p := PrimitiveFalse + if v { + p = PrimitiveTrue + } + b.appendScalar(makeHeader(BasicPrimitive, byte(p))) +} + +func (b *Builder) Int8(v int8) { + b.appendScalar(makeHeader(BasicPrimitive, byte(PrimitiveInt8)), byte(v)) +} + +func (b *Builder) Int16(v int16) { b.scalar16(PrimitiveInt16, uint16(v)) } + +func (b *Builder) Int32(v int32) { b.scalar32(PrimitiveInt32, uint32(v)) } + +func (b *Builder) Int64(v int64) { b.scalar64(PrimitiveInt64, uint64(v)) } + +func (b *Builder) Float(v float32) { b.scalar32(PrimitiveFloat, math.Float32bits(v)) } + +func (b *Builder) Double(v float64) { b.scalar64(PrimitiveDouble, math.Float64bits(v)) } + +func (b *Builder) String(v string) { + if !b.beginValue() { + return + } + if uint64(len(v)) > math.MaxUint32 { + b.fail("string of %d bytes exceeds the variant format's 4 GiB limit", len(v)) + return + } + if len(v) <= 63 { + b.buf = append(b.buf, makeHeader(BasicShortString, byte(len(v)))) + } else { + b.buf = append(b.buf, makeHeader(BasicPrimitive, byte(PrimitiveString)), 0, 0, 0, 0) + binary.LittleEndian.PutUint32(b.buf[len(b.buf)-4:], uint32(len(v))) + } + b.buf = append(b.buf, v...) + b.endValue() +} + +func (b *Builder) Binary(v []byte) { + if !b.beginValue() { + return + } + if uint64(len(v)) > math.MaxUint32 { + b.fail("binary value of %d bytes exceeds the variant format's 4 GiB limit", len(v)) + return + } + b.buf = append(b.buf, makeHeader(BasicPrimitive, byte(PrimitiveBinary)), 0, 0, 0, 0) + binary.LittleEndian.PutUint32(b.buf[len(b.buf)-4:], uint32(len(v))) + b.buf = append(b.buf, v...) + b.endValue() +} + +func (b *Builder) Date(days int32) { b.scalar32(PrimitiveDate, uint32(days)) } + +func (b *Builder) Time(micros int64) { b.scalar64(PrimitiveTime, uint64(micros)) } + +func (b *Builder) Timestamp(micros int64) { b.scalar64(PrimitiveTimestamp, uint64(micros)) } + +func (b *Builder) TimestampNTZ(micros int64) { b.scalar64(PrimitiveTimestampNTZ, uint64(micros)) } + +func (b *Builder) TimestampNanos(nanos int64) { b.scalar64(PrimitiveTimestampNanos, uint64(nanos)) } + +func (b *Builder) TimestampNTZNanos(nanos int64) { + b.scalar64(PrimitiveTimestampNTZNanos, uint64(nanos)) +} + +func (b *Builder) UUID(v uuid.UUID) { + if !b.beginValue() { + return + } + b.buf = append(b.buf, makeHeader(BasicPrimitive, byte(PrimitiveUUID))) + b.buf = append(b.buf, v[:]...) + b.endValue() +} + +func (b *Builder) Decimal4(unscaled int32, scale byte) { + if !b.beginValue() { + return + } + b.buf = append(b.buf, makeHeader(BasicPrimitive, byte(PrimitiveDecimal4)), scale, 0, 0, 0, 0) + binary.LittleEndian.PutUint32(b.buf[len(b.buf)-4:], uint32(unscaled)) + b.endValue() +} + +func (b *Builder) Decimal8(unscaled int64, scale byte) { + if !b.beginValue() { + return + } + b.buf = append(b.buf, makeHeader(BasicPrimitive, byte(PrimitiveDecimal8)), scale, 0, 0, 0, 0, 0, 0, 0, 0) + binary.LittleEndian.PutUint64(b.buf[len(b.buf)-8:], uint64(unscaled)) + b.endValue() +} + +func (b *Builder) Decimal16(unscaled [16]byte, scale byte) { + if !b.beginValue() { + return + } + b.buf = append(b.buf, makeHeader(BasicPrimitive, byte(PrimitiveDecimal16)), scale) + b.buf = append(b.buf, unscaled[:]...) + b.endValue() +} + +func (b *Builder) scalar16(p PrimitiveType, v uint16) { + if !b.beginValue() { + return + } + b.buf = append(b.buf, makeHeader(BasicPrimitive, byte(p)), 0, 0) + binary.LittleEndian.PutUint16(b.buf[len(b.buf)-2:], v) + b.endValue() +} + +func (b *Builder) scalar32(p PrimitiveType, v uint32) { + if !b.beginValue() { + return + } + b.buf = append(b.buf, makeHeader(BasicPrimitive, byte(p)), 0, 0, 0, 0) + binary.LittleEndian.PutUint32(b.buf[len(b.buf)-4:], v) + b.endValue() +} + +func (b *Builder) scalar64(p PrimitiveType, v uint64) { + if !b.beginValue() { + return + } + b.buf = append(b.buf, makeHeader(BasicPrimitive, byte(p)), 0, 0, 0, 0, 0, 0, 0, 0) + binary.LittleEndian.PutUint64(b.buf[len(b.buf)-8:], v) + b.endValue() +} + +func (b *Builder) BeginObject() { + if !b.beginValue() { + return + } + b.frames = append(b.frames, builderFrame{ + isObject: true, + start: len(b.buf), + fieldsBase: len(b.fields), + }) +} + +func (b *Builder) Field(name string) { + if b.err != nil { + return + } + n := len(b.frames) + if n == 0 || !b.frames[n-1].isObject { + b.fail("Field %q outside of an object", name) + return + } + if b.pendingField { + b.fail("Field %q: previous field has no value", name) + return + } + id := b.metadata().Add(name) + b.fields = append(b.fields, builderField{ + id: id, + start: len(b.buf), + }) + b.pendingField = true +} + +func (b *Builder) EndObject() { + if b.err != nil { + return + } + n := len(b.frames) + if n == 0 || !b.frames[n-1].isObject { + b.fail("EndObject without matching BeginObject") + return + } + meta := b.metadata() + if b.pendingField { + b.fail("EndObject: field %q has no value", meta.stringAt(b.fields[len(b.fields)-1].id)) + return + } + f := b.frames[n-1] + entries := b.fields[f.fieldsBase:] + + // The encoding requires field IDs sorted lexicographically by name; + // field values stay where they were written, offsets need not be + // monotonic. Names are resolved from the metadata slab at close time + // so Field does not retain views that a later Add could invalidate. + slices.SortFunc(entries, func(a, c builderField) int { + return strings.Compare(meta.stringAt(a.id), meta.stringAt(c.id)) + }) + for i := 1; i < len(entries); i++ { + // Names are interned, so equal names always share one id. + if entries[i].id == entries[i-1].id { + b.fail("duplicate object field %q", meta.stringAt(entries[i].id)) + return + } + } + + numFields := len(entries) + contentSize := len(b.buf) - f.start + // Offsets are at most 4 bytes wide, so a container whose encoded + // children exceed math.MaxUint32 bytes is unrepresentable; failing + // beats the silent truncation of writeUint. Field offsets and counts + // are bounded by contentSize, so this one check covers them too. + if uint64(contentSize) > math.MaxUint32 { + b.fail("object content of %d bytes exceeds the variant format's 4 GiB limit", contentSize) + return + } + maxID := 0 + for i := range entries { + if entries[i].id > maxID { + maxID = entries[i].id + } + } + + fieldIDSzCode := offsetSizeCode(maxID) + fieldIDSz := offsetSize(fieldIDSzCode) + offsetSzCode := offsetSizeCode(contentSize) + offsetSz := offsetSize(offsetSzCode) + + isLarge := byte(0) + numElemSize := 1 + if numFields > 255 { + isLarge = 1 + numElemSize = 4 + } + + headerSize := 1 + numElemSize + numFields*fieldIDSz + (numFields+1)*offsetSz + h := b.header(headerSize) + h[0] = byte(BasicObject) | (offsetSzCode << 2) | (fieldIDSzCode << 4) | (isLarge << 6) + pos := 1 + if isLarge == 1 { + binary.LittleEndian.PutUint32(h[pos:], uint32(numFields)) + pos += 4 + } else { + h[pos] = byte(numFields) + pos++ + } + for i := range entries { + writeUint(h[pos:], entries[i].id, fieldIDSz) + pos += fieldIDSz + } + for i := range entries { + writeUint(h[pos:], entries[i].start-f.start, offsetSz) + pos += offsetSz + } + writeUint(h[pos:], contentSize, offsetSz) + + b.splice(f.start, h) + b.fields = b.fields[:f.fieldsBase] + b.frames = b.frames[:n-1] + b.endValue() +} + +func (b *Builder) BeginArray() { + if !b.beginValue() { + return + } + b.frames = append(b.frames, builderFrame{ + start: len(b.buf), + elemsBase: len(b.elems), + }) +} + +func (b *Builder) EndArray() { + if b.err != nil { + return + } + n := len(b.frames) + if n == 0 || b.frames[n-1].isObject { + b.fail("EndArray without matching BeginArray") + return + } + f := b.frames[n-1] + starts := b.elems[f.elemsBase:] + + numElems := len(starts) + contentSize := len(b.buf) - f.start + // See the matching check in EndObject. + if uint64(contentSize) > math.MaxUint32 { + b.fail("array content of %d bytes exceeds the variant format's 4 GiB limit", contentSize) + return + } + + offsetSzCode := offsetSizeCode(contentSize) + offsetSz := offsetSize(offsetSzCode) + + isLarge := byte(0) + numElemSize := 1 + if numElems > 255 { + isLarge = 1 + numElemSize = 4 + } + + headerSize := 1 + numElemSize + (numElems+1)*offsetSz + h := b.header(headerSize) + h[0] = byte(BasicArray) | (offsetSzCode << 2) | (isLarge << 4) + pos := 1 + if isLarge == 1 { + binary.LittleEndian.PutUint32(h[pos:], uint32(numElems)) + pos += 4 + } else { + h[pos] = byte(numElems) + pos++ + } + for _, start := range starts { + writeUint(h[pos:], start-f.start, offsetSz) + pos += offsetSz + } + writeUint(h[pos:], contentSize, offsetSz) + + b.splice(f.start, h) + b.elems = b.elems[:f.elemsBase] + b.frames = b.frames[:n-1] + b.endValue() +} + +// header returns a zeroed scratch slice of the given size for building a +// container header. +func (b *Builder) header(size int) []byte { + if cap(b.scratch) < size { + b.scratch = make([]byte, size) + } + h := b.scratch[:size] + clear(h) + return h +} + +// splice inserts header at position start, shifting the container's encoded +// children right by one memmove. +func (b *Builder) splice(start int, header []byte) { + n := len(header) + b.buf = append(b.buf, header...) + copy(b.buf[start+n:], b.buf[start:len(b.buf)-n]) + copy(b.buf[start:], header) +} diff --git a/vendor/github.com/parquet-go/parquet-go/variant/decoding.go b/vendor/github.com/parquet-go/parquet-go/variant/decoding.go index d426edbe2da..5023e339f25 100644 --- a/vendor/github.com/parquet-go/parquet-go/variant/decoding.go +++ b/vendor/github.com/parquet-go/parquet-go/variant/decoding.go @@ -5,10 +5,18 @@ import ( "errors" "fmt" "math" + "unicode/utf8" ) // Decode decodes a variant value from its binary representation using the // given metadata dictionary. +// +// Decode rejects input the spec declares invalid: strings that are not valid +// UTF-8, objects with duplicate field names, and structures whose declared +// sizes exceed the data. It accepts input that is non-canonical but +// unambiguous, as the spec directs for readers: reserved header bits are +// ignored, object fields need not be listed in lexicographic order, and +// bytes past the end of the value are ignored (values are self-delimiting). func Decode(m Metadata, data []byte) (Value, error) { if len(data) == 0 { return Null(), errors.New("variant value: empty data") @@ -35,8 +43,15 @@ func decodeValue(m Metadata, data []byte) (Value, int, error) { if len(data) < 1+length { return Null(), 0, fmt.Errorf("variant value: short string length %d exceeds data", length) } - v := Value{basic: BasicShortString, str: string(data[1 : 1+length])} - return v, 1 + length, nil + if !utf8.Valid(data[1 : 1+length]) { + return Null(), 0, errors.New("variant value: short string is not valid UTF-8") + } + // Normalize to the string primitive so the value re-encodes + // correctly. VariantEncoding.md: "The 'short string' basic type + // may be used as an optimization to fold string length into the + // type byte for strings less than 64 bytes. It is semantically + // identical to the 'string' primitive type." + return String(string(data[1 : 1+length])), 1 + length, nil case BasicObject: return decodeObject(m, header, data[1:]) case BasicArray: @@ -88,17 +103,31 @@ func decodePrimitive(pt PrimitiveType, data []byte) (Value, int, error) { if len(data) < 4 { return Null(), 0, errors.New("variant value: not enough data for string length") } + // On 32-bit platforms a 4-byte length above math.MaxInt32 + // overflows int and is negative, and 4+length can overflow the + // same way, so the bounds check avoids the addition. Neither + // overflow can happen on 64-bit platforms. length := int(binary.LittleEndian.Uint32(data[:4])) - if len(data) < 4+length { + if length < 0 || length > len(data)-4 { return Null(), 0, fmt.Errorf("variant value: string length %d exceeds data", length) } + // VariantEncoding.md: "All strings within the Variant binary + // format must be UTF-8 encoded. This includes the dictionary key + // string values, the 'short string' values, and the 'long string' + // values." (Short strings and dictionary entries are validated at + // their own decode sites.) + if !utf8.Valid(data[4 : 4+length]) { + return Null(), 0, errors.New("variant value: string is not valid UTF-8") + } return String(string(data[4 : 4+length])), 5 + length, nil case PrimitiveBinary: if len(data) < 4 { return Null(), 0, errors.New("variant value: not enough data for binary length") } length := int(binary.LittleEndian.Uint32(data[:4])) - if len(data) < 4+length { + // The check is phrased for 32-bit overflow safety; see the string + // case above. + if length < 0 || length > len(data)-4 { return Null(), 0, fmt.Errorf("variant value: binary length %d exceeds data", length) } b := make([]byte, length) @@ -124,6 +153,16 @@ func decodePrimitive(pt PrimitiveType, data []byte) (Value, int, error) { return Null(), 0, errors.New("variant value: not enough data for time") } return Time(int64(binary.LittleEndian.Uint64(data[:8]))), 9, nil + case PrimitiveTimestampNanos: + if len(data) < 8 { + return Null(), 0, errors.New("variant value: not enough data for timestamp nanos") + } + return TimestampNanos(int64(binary.LittleEndian.Uint64(data[:8]))), 9, nil + case PrimitiveTimestampNTZNanos: + if len(data) < 8 { + return Null(), 0, errors.New("variant value: not enough data for timestamp_ntz nanos") + } + return TimestampNTZNanos(int64(binary.LittleEndian.Uint64(data[:8]))), 9, nil case PrimitiveUUID: if len(data) < 16 { return Null(), 0, errors.New("variant value: not enough data for uuid") @@ -159,8 +198,11 @@ func decodePrimitive(pt PrimitiveType, data []byte) (Value, int, error) { } func decodeObject(m Metadata, header byte, data []byte) (Value, int, error) { - fieldIDSizeCode := (header >> 2) & 0x03 - offsetSzCode := (header >> 4) & 0x03 + // Object header byte layout (see encodeObject): bits 2-3 hold + // field_offset_size_minus_one, bits 4-5 hold field_id_size_minus_one, + // bit 6 holds is_large. + offsetSzCode := (header >> 2) & 0x03 + fieldIDSizeCode := (header >> 4) & 0x03 isLarge := (header >> 6) & 0x01 fieldIDSize := offsetSize(fieldIDSizeCode) @@ -184,6 +226,15 @@ func decodeObject(m Metadata, header byte, data []byte) (Value, int, error) { pos += 1 } + // Validate the declared element count against the available data + // before allocating, to reject corrupt inputs with absurd sizes. + // numElements < 0 happens only on 32-bit platforms, where a 4-byte + // count above math.MaxInt32 overflows int. + if remaining := len(data) - pos; numElements < 0 || + remaining/(fieldIDSize+offsetSz) < numElements { + return Null(), 0, fmt.Errorf("variant value: object element count %d exceeds data", numElements) + } + // Read field IDs fieldIDs := make([]int, numElements) for i := range numElements { @@ -206,23 +257,60 @@ func decodeObject(m Metadata, header byte, data []byte) (Value, int, error) { pos += n } - // Value data starts at pos + // Value data starts at pos. The last offset is the total size of the + // value data region. Fields must NOT be sliced as [offset[i], + // offset[i+1]) — per VariantEncoding.md, "the actual value entries do + // not need to be in any particular order. This implies that the + // field_offset values may not be monotonically increasing." (Spark + // writes such objects.) Each value is self-delimiting; the offset only + // determines where it starts. valueDataStart := pos + valueDataEnd := valueDataStart + offsets[numElements] + // valueDataEnd < valueDataStart rejects a last offset that overflowed + // int to a negative value on 32-bit platforms. + if valueDataEnd > len(data) || valueDataEnd < valueDataStart { + return Null(), 0, errors.New("variant value: object value data exceeds input") + } fields := make([]Field, numElements) + // VariantEncoding.md: "Field names are required to be unique for each + // object. It is an error for an object to contain two fields with the + // same name, whether or not they have distinct dictionary IDs." (The + // last clause is why the check compares names, not field IDs.) + // + // The spec also requires fields to be listed in lexicographic order of + // their names, so in well-formed input a duplicate is adjacent to its + // twin and one comparison against the previous name detects it. The + // map is only allocated for inputs that violate the sort order (which + // are otherwise accepted, for compatibility with lenient writers). + var seen map[string]struct{} for i := range numElements { name, err := m.Lookup(fieldIDs[i]) if err != nil { return Null(), 0, fmt.Errorf("variant value: object field %d: %w", i, err) } + if seen == nil && i > 0 && name <= fields[i-1].Name { + if name == fields[i-1].Name { + return Null(), 0, fmt.Errorf("variant value: duplicate object field %q", name) + } + seen = make(map[string]struct{}, numElements) + for _, f := range fields[:i] { + seen[f.Name] = struct{}{} + } + } + if seen != nil { + if _, dup := seen[name]; dup { + return Null(), 0, fmt.Errorf("variant value: duplicate object field %q", name) + } + seen[name] = struct{}{} + } valueStart := valueDataStart + offsets[i] - valueEnd := valueDataStart + offsets[i+1] - if valueStart > len(data) || valueEnd > len(data) || valueStart > valueEnd { + if valueStart < valueDataStart || valueStart > valueDataEnd { return Null(), 0, fmt.Errorf("variant value: object field %d: invalid value offset", i) } - v, _, err := decodeValue(m, data[valueStart:valueEnd]) + v, _, err := decodeValue(m, data[valueStart:valueDataEnd]) if err != nil { return Null(), 0, fmt.Errorf("variant value: object field %q: %w", name, err) } @@ -230,7 +318,7 @@ func decodeObject(m Metadata, header byte, data []byte) (Value, int, error) { fields[i] = Field{Name: name, Value: v} } - totalConsumed := 1 + valueDataStart + offsets[numElements] // +1 for header byte + totalConsumed := 1 + valueDataEnd // +1 for header byte return MakeObject(fields), totalConsumed, nil } @@ -258,6 +346,17 @@ func decodeArray(m Metadata, header byte, data []byte) (Value, int, error) { pos += 1 } + // Validate the declared element count against the available data + // before allocating, to reject corrupt inputs with absurd sizes. + // numElements < 0 happens only on 32-bit platforms, where a 4-byte + // count above math.MaxInt32 overflows int; the comparison is phrased + // as <= numElements rather than < numElements+1 (there are + // numElements+1 offsets) so the addition cannot overflow the same way. + if remaining := len(data) - pos; numElements < 0 || + remaining/offsetSz <= numElements { + return Null(), 0, fmt.Errorf("variant value: array element count %d exceeds data", numElements) + } + // Read offsets (numElements+1) offsets := make([]int, numElements+1) for i := range numElements + 1 { @@ -276,7 +375,11 @@ func decodeArray(m Metadata, header byte, data []byte) (Value, int, error) { for i := range numElements { elemStart := valueDataStart + offsets[i] elemEnd := valueDataStart + offsets[i+1] - if elemStart > len(data) || elemEnd > len(data) || elemStart > elemEnd { + // elemStart < 0 happens only on 32-bit platforms, where a 4-byte + // offset above math.MaxInt32 overflows int; without the check the + // slice below would panic. The remaining conditions imply + // elemStart <= elemEnd <= len(data). + if elemStart < 0 || elemEnd > len(data) || elemStart > elemEnd { return Null(), 0, fmt.Errorf("variant value: array element %d: invalid offset", i) } diff --git a/vendor/github.com/parquet-go/parquet-go/variant/encoding.go b/vendor/github.com/parquet-go/parquet-go/variant/encoding.go index 5767d13bcc9..d2b65a83dd2 100644 --- a/vendor/github.com/parquet-go/parquet-go/variant/encoding.go +++ b/vendor/github.com/parquet-go/parquet-go/variant/encoding.go @@ -2,8 +2,14 @@ package variant import ( "encoding/binary" + "fmt" "math" + "reflect" "sort" + "sync" + "time" + + "github.com/google/uuid" ) // Encode encodes a variant Value into its binary representation. @@ -12,9 +18,31 @@ import ( func Encode(b *MetadataBuilder, v Value) []byte { switch v.basic { case BasicObject: - return encodeObject(b, v.object) + enc := getEncoder(b) + + start, end, err := enc.encodeValueObject(v.object) + if err != nil { + releaseEncoder(enc) + return nil + } + res := make([]byte, end-start) + copy(res, enc.scratch[start:end]) + + releaseEncoder(enc) + return res case BasicArray: - return encodeArray(b, v.array) + enc := getEncoder(b) + + start, end, err := enc.encodeValueArray(v.array) + if err != nil { + releaseEncoder(enc) + return nil + } + res := make([]byte, end-start) + copy(res, enc.scratch[start:end]) + + releaseEncoder(enc) + return res default: return encodePrimitive(v) } @@ -58,13 +86,11 @@ func encodePrimitive(v Value) []byte { case PrimitiveString: s := v.str if len(s) <= 63 { - // Use short string encoding buf := make([]byte, 1+len(s)) buf[0] = makeHeader(BasicShortString, byte(len(s))) copy(buf[1:], s) return buf } - // Long string: primitive string type + 4-byte length + data buf := make([]byte, 5+len(s)) buf[0] = makeHeader(BasicPrimitive, byte(PrimitiveString)) binary.LittleEndian.PutUint32(buf[1:], uint32(len(s))) @@ -96,6 +122,16 @@ func encodePrimitive(v Value) []byte { buf[0] = makeHeader(BasicPrimitive, byte(PrimitiveTime)) binary.LittleEndian.PutUint64(buf[1:], uint64(v.i64)) return buf + case PrimitiveTimestampNanos: + buf := make([]byte, 9) + buf[0] = makeHeader(BasicPrimitive, byte(PrimitiveTimestampNanos)) + binary.LittleEndian.PutUint64(buf[1:], uint64(v.i64)) + return buf + case PrimitiveTimestampNTZNanos: + buf := make([]byte, 9) + buf[0] = makeHeader(BasicPrimitive, byte(PrimitiveTimestampNTZNanos)) + binary.LittleEndian.PutUint64(buf[1:], uint64(v.i64)) + return buf case PrimitiveUUID: buf := make([]byte, 17) buf[0] = makeHeader(BasicPrimitive, byte(PrimitiveUUID)) @@ -124,59 +160,408 @@ func encodePrimitive(v Value) []byte { } } -func encodeObject(b *MetadataBuilder, obj Object) []byte { +// makeHeader constructs a value_metadata byte. +func makeHeader(basic BasicType, valueHeader byte) byte { + return byte(basic) | (valueHeader << 2) +} + +type encoder struct { + b *MetadataBuilder + scratch []byte + temp []byte + positions []elementPos + fields []encodedField + offsets []int +} + +var encoderPool = sync.Pool{ + New: func() any { + return &encoder{ + scratch: make([]byte, 0, 1024), + temp: make([]byte, 0, 1024), + positions: make([]elementPos, 0, 32), + fields: make([]encodedField, 0, 32), + offsets: make([]int, 0, 32), + } + }, +} + +const ( + maxPooledEncoderBytes = 1 << 20 + maxPooledEncoderItems = 4096 +) + +func getEncoder(b *MetadataBuilder) *encoder { + enc := encoderPool.Get().(*encoder) + enc.b = b + enc.scratch = enc.scratch[:0] + enc.temp = enc.temp[:0] + enc.positions = enc.positions[:0] + enc.fields = enc.fields[:0] + enc.offsets = enc.offsets[:0] + return enc +} + +func releaseEncoder(enc *encoder) { + enc.b = nil + if cap(enc.scratch) > maxPooledEncoderBytes { + enc.scratch = nil + } else { + enc.scratch = enc.scratch[:0] + } + if cap(enc.temp) > maxPooledEncoderBytes { + enc.temp = nil + } else { + enc.temp = enc.temp[:0] + } + if cap(enc.positions) > maxPooledEncoderItems { + enc.positions = nil + } else { + enc.positions = enc.positions[:0] + } + if cap(enc.fields) > maxPooledEncoderItems { + enc.fields = nil + } else { + enc.fields = enc.fields[:0] + } + if cap(enc.offsets) > maxPooledEncoderItems { + enc.offsets = nil + } else { + enc.offsets = enc.offsets[:0] + } + encoderPool.Put(enc) +} + +type encodedField struct { + id int + name string + start int + end int +} + +type elementPos struct { + start int + end int +} + +var testHookVerifyArrayLayout func(e *encoder, positions []elementPos) +var testHookVerifyObjectLayout func(e *encoder, entries []encodedField) + +func (e *encoder) encodeValuePrimitive(v Value) (start, end int) { + start = len(e.scratch) + switch v.primitive { + case PrimitiveNull: + e.scratch = append(e.scratch, makeHeader(BasicPrimitive, byte(PrimitiveNull))) + case PrimitiveTrue: + e.scratch = append(e.scratch, makeHeader(BasicPrimitive, byte(PrimitiveTrue))) + case PrimitiveFalse: + e.scratch = append(e.scratch, makeHeader(BasicPrimitive, byte(PrimitiveFalse))) + case PrimitiveInt8: + e.scratch = append(e.scratch, makeHeader(BasicPrimitive, byte(PrimitiveInt8)), byte(v.i64)) + case PrimitiveInt16: + e.scratch = append(e.scratch, makeHeader(BasicPrimitive, byte(PrimitiveInt16)), 0, 0) + binary.LittleEndian.PutUint16(e.scratch[start+1:], uint16(v.i64)) + case PrimitiveInt32: + e.scratch = append(e.scratch, makeHeader(BasicPrimitive, byte(PrimitiveInt32)), 0, 0, 0, 0) + binary.LittleEndian.PutUint32(e.scratch[start+1:], uint32(v.i64)) + case PrimitiveInt64: + e.scratch = append(e.scratch, makeHeader(BasicPrimitive, byte(PrimitiveInt64)), 0, 0, 0, 0, 0, 0, 0, 0) + binary.LittleEndian.PutUint64(e.scratch[start+1:], uint64(v.i64)) + case PrimitiveFloat: + e.scratch = append(e.scratch, makeHeader(BasicPrimitive, byte(PrimitiveFloat)), 0, 0, 0, 0) + binary.LittleEndian.PutUint32(e.scratch[start+1:], math.Float32bits(float32(v.f64))) + case PrimitiveDouble: + e.scratch = append(e.scratch, makeHeader(BasicPrimitive, byte(PrimitiveDouble)), 0, 0, 0, 0, 0, 0, 0, 0) + binary.LittleEndian.PutUint64(e.scratch[start+1:], math.Float64bits(v.f64)) + case PrimitiveString: + s := v.str + if len(s) <= 63 { + e.scratch = append(e.scratch, makeHeader(BasicShortString, byte(len(s)))) + e.scratch = append(e.scratch, s...) + } else { + e.scratch = append(e.scratch, makeHeader(BasicPrimitive, byte(PrimitiveString)), 0, 0, 0, 0) + binary.LittleEndian.PutUint32(e.scratch[start+1:], uint32(len(s))) + e.scratch = append(e.scratch, s...) + } + case PrimitiveBinary: + e.scratch = append(e.scratch, makeHeader(BasicPrimitive, byte(PrimitiveBinary)), 0, 0, 0, 0) + binary.LittleEndian.PutUint32(e.scratch[start+1:], uint32(len(v.bytes))) + e.scratch = append(e.scratch, v.bytes...) + case PrimitiveDate: + e.scratch = append(e.scratch, makeHeader(BasicPrimitive, byte(PrimitiveDate)), 0, 0, 0, 0) + binary.LittleEndian.PutUint32(e.scratch[start+1:], uint32(v.i64)) + case PrimitiveTimestamp: + e.scratch = append(e.scratch, makeHeader(BasicPrimitive, byte(PrimitiveTimestamp)), 0, 0, 0, 0, 0, 0, 0, 0) + binary.LittleEndian.PutUint64(e.scratch[start+1:], uint64(v.i64)) + case PrimitiveTimestampNTZ: + e.scratch = append(e.scratch, makeHeader(BasicPrimitive, byte(PrimitiveTimestampNTZ)), 0, 0, 0, 0, 0, 0, 0, 0) + binary.LittleEndian.PutUint64(e.scratch[start+1:], uint64(v.i64)) + case PrimitiveTime: + e.scratch = append(e.scratch, makeHeader(BasicPrimitive, byte(PrimitiveTime)), 0, 0, 0, 0, 0, 0, 0, 0) + binary.LittleEndian.PutUint64(e.scratch[start+1:], uint64(v.i64)) + case PrimitiveTimestampNanos: + e.scratch = append(e.scratch, makeHeader(BasicPrimitive, byte(PrimitiveTimestampNanos)), 0, 0, 0, 0, 0, 0, 0, 0) + binary.LittleEndian.PutUint64(e.scratch[start+1:], uint64(v.i64)) + case PrimitiveTimestampNTZNanos: + e.scratch = append(e.scratch, makeHeader(BasicPrimitive, byte(PrimitiveTimestampNTZNanos)), 0, 0, 0, 0, 0, 0, 0, 0) + binary.LittleEndian.PutUint64(e.scratch[start+1:], uint64(v.i64)) + case PrimitiveUUID: + e.scratch = append(e.scratch, makeHeader(BasicPrimitive, byte(PrimitiveUUID))) + e.scratch = append(e.scratch, v.uuid[:]...) + case PrimitiveDecimal4: + e.scratch = append(e.scratch, makeHeader(BasicPrimitive, byte(PrimitiveDecimal4)), v.scale, 0, 0, 0, 0) + binary.LittleEndian.PutUint32(e.scratch[start+2:], uint32(v.i64)) + case PrimitiveDecimal8: + e.scratch = append(e.scratch, makeHeader(BasicPrimitive, byte(PrimitiveDecimal8)), v.scale, 0, 0, 0, 0, 0, 0, 0, 0) + binary.LittleEndian.PutUint64(e.scratch[start+2:], uint64(v.i64)) + case PrimitiveDecimal16: + e.scratch = append(e.scratch, makeHeader(BasicPrimitive, byte(PrimitiveDecimal16)), v.scale) + e.scratch = append(e.scratch, v.decimal16[:]...) + default: + e.scratch = append(e.scratch, makeHeader(BasicPrimitive, byte(PrimitiveNull))) + } + end = len(e.scratch) + return start, end +} + +func (e *encoder) encodeValue(v Value) (start, end int, err error) { + switch v.basic { + case BasicObject: + return e.encodeValueObject(v.object) + case BasicArray: + return e.encodeValueArray(v.array) + default: + start, end = e.encodeValuePrimitive(v) + return start, end, nil + } +} + +func (e *encoder) encodeValueArray(arr Array) (start, end int, err error) { + n := len(arr.Elements) + if n == 0 { + return e.buildArrayBytes(nil) + } + + savedStart := len(e.positions) + if cap(e.positions) < savedStart+n { + newCap := max(cap(e.positions)*2, savedStart+n) + newP := make([]elementPos, len(e.positions), newCap) + copy(newP, e.positions) + e.positions = newP + } + e.positions = e.positions[:savedStart+n] + positions := e.positions[savedStart : savedStart+n] + + for i := range n { + pStart, pEnd, err := e.encodeValue(arr.Elements[i]) + if err != nil { + e.positions = e.positions[:savedStart] + return 0, 0, err + } + positions[i] = elementPos{start: pStart, end: pEnd} + } + + resStart, resEnd, err := e.buildArrayBytes(positions) + e.positions = e.positions[:savedStart] + return resStart, resEnd, err +} + +func (e *encoder) encodeValueObject(obj Object) (start, end int, err error) { n := len(obj.Fields) + if n == 0 { + return e.buildObjectBytes(nil) + } - // Register all field names and get their IDs - type fieldEntry struct { - id int - name string - valueBytes []byte + savedStart := len(e.fields) + if cap(e.fields) < savedStart+n { + newCap := max(cap(e.fields)*2, savedStart+n) + newF := make([]encodedField, len(e.fields), newCap) + copy(newF, e.fields) + e.fields = newF } - entries := make([]fieldEntry, n) + e.fields = e.fields[:savedStart+n] + entries := e.fields[savedStart : savedStart+n] + for i, f := range obj.Fields { - entries[i] = fieldEntry{ - id: b.Add(f.Name), - name: f.Name, - valueBytes: Encode(b, f.Value), + id := e.b.Add(f.Name) + pStart, pEnd, err := e.encodeValue(f.Value) + if err != nil { + e.fields = e.fields[:savedStart] + return 0, 0, err + } + entries[i] = encodedField{ + id: id, + name: f.Name, + start: pStart, + end: pEnd, } } - // Sort by field name (as required by spec) sort.Slice(entries, func(i, j int) bool { return entries[i].name < entries[j].name }) - // Compute sizes - maxID := 0 - for _, e := range entries { - if e.id > maxID { - maxID = e.id + resStart, resEnd, err := e.buildObjectBytes(entries) + e.fields = e.fields[:savedStart] + return resStart, resEnd, err +} + +func (e *encoder) encodeReflect(rv reflect.Value) (start, end int, err error) { + if !rv.IsValid() { + start, end = e.encodeValuePrimitive(Null()) + return start, end, nil + } + + // Dereference pointers/interfaces + for rv.Kind() == reflect.Ptr || rv.Kind() == reflect.Interface { + if rv.IsNil() { + start, end = e.encodeValuePrimitive(Null()) + return start, end, nil } + rv = rv.Elem() } - // Encode all values and compute offsets - totalValueSize := 0 - valueOffsets := make([]int, n+1) - for i, e := range entries { - valueOffsets[i] = totalValueSize - totalValueSize += len(e.valueBytes) + // Check concrete types first + if rv.Type() == reflect.TypeFor[uuid.UUID]() { + start, end = e.encodeValuePrimitive(UUID(rv.Interface().(uuid.UUID))) + return start, end, nil + } + if rv.Type() == reflect.TypeFor[time.Time]() { + start, end = e.encodeValuePrimitive(timeToVariant(rv.Interface().(time.Time))) + return start, end, nil } - valueOffsets[n] = totalValueSize - fieldIDSizeCode := offsetSizeCode(maxID) - fieldIDSize := offsetSize(fieldIDSizeCode) - offsetSzCode := offsetSizeCode(totalValueSize) + switch rv.Kind() { + case reflect.Bool: + start, end = e.encodeValuePrimitive(Bool(rv.Bool())) + return start, end, nil + case reflect.Int8: + start, end = e.encodeValuePrimitive(Int8(int8(rv.Int()))) + return start, end, nil + case reflect.Int16: + start, end = e.encodeValuePrimitive(Int16(int16(rv.Int()))) + return start, end, nil + case reflect.Int32: + start, end = e.encodeValuePrimitive(Int32(int32(rv.Int()))) + return start, end, nil + case reflect.Int64, reflect.Int: + start, end = e.encodeValuePrimitive(Int64(rv.Int())) + return start, end, nil + case reflect.Uint8: + start, end = e.encodeValuePrimitive(Int16(int16(rv.Uint()))) + return start, end, nil + case reflect.Uint16: + start, end = e.encodeValuePrimitive(Int32(int32(rv.Uint()))) + return start, end, nil + case reflect.Uint32: + start, end = e.encodeValuePrimitive(Int64(int64(rv.Uint()))) + return start, end, nil + case reflect.Uint64, reflect.Uint: + u := rv.Uint() + if u > math.MaxInt64 { + return 0, 0, fmt.Errorf("variant marshal: uint64 value %d overflows int64", u) + } + start, end = e.encodeValuePrimitive(Int64(int64(u))) + return start, end, nil + case reflect.Float32: + start, end = e.encodeValuePrimitive(Float(float32(rv.Float()))) + return start, end, nil + case reflect.Float64: + start, end = e.encodeValuePrimitive(Double(rv.Float())) + return start, end, nil + case reflect.String: + start, end = e.encodeValuePrimitive(String(rv.String())) + return start, end, nil + case reflect.Slice: + if rv.Type().Elem().Kind() == reflect.Uint8 { + start, end = e.encodeValuePrimitive(Binary(rv.Bytes())) + return start, end, nil + } + return e.encodeSliceArray(rv) + case reflect.Array: + // Byte arrays (including [16]byte) map to Binary. uuid.UUID is + // handled above via its concrete type; without a logical UUID + // annotation a fixed-length byte array is just bytes. + if rv.Type().Elem().Kind() == reflect.Uint8 { + b := make([]byte, rv.Len()) + for i := range b { + b[i] = byte(rv.Index(i).Uint()) + } + start, end = e.encodeValuePrimitive(Binary(b)) + return start, end, nil + } + return e.encodeSliceArray(rv) + case reflect.Map: + return e.encodeMapObject(rv) + case reflect.Struct: + return e.encodeStructObject(rv) + default: + return 0, 0, fmt.Errorf("variant marshal: unsupported type %s", rv.Type()) + } +} + +func (e *encoder) encodeSliceArray(rv reflect.Value) (start, end int, err error) { + n := rv.Len() + if n == 0 { + return e.buildArrayBytes(nil) + } + + savedStart := len(e.positions) + if cap(e.positions) < savedStart+n { + newCap := max(cap(e.positions)*2, savedStart+n) + newP := make([]elementPos, len(e.positions), newCap) + copy(newP, e.positions) + e.positions = newP + } + e.positions = e.positions[:savedStart+n] + positions := e.positions[savedStart : savedStart+n] + + for i := range n { + pStart, pEnd, err := e.encodeReflect(rv.Index(i)) + if err != nil { + e.positions = e.positions[:savedStart] + return 0, 0, err + } + positions[i] = elementPos{start: pStart, end: pEnd} + } + + resStart, resEnd, err := e.buildArrayBytes(positions) + e.positions = e.positions[:savedStart] + return resStart, resEnd, err +} + +func (e *encoder) buildArrayBytes(positions []elementPos) (start, end int, err error) { + n := len(positions) + + if testHookVerifyArrayLayout != nil { + testHookVerifyArrayLayout(e, positions) + } + + totalSize := 0 + for _, pos := range positions { + totalSize += pos.end - pos.start + } + + var offsetBuf [32]int + var offsets []int + if n+1 <= len(offsetBuf) { + offsets = offsetBuf[:n+1] + } else { + if cap(e.offsets) < n+1 { + e.offsets = make([]int, n+1) + } + offsets = e.offsets[:n+1] + } + off := 0 + for i, pos := range positions { + offsets[i] = off + off += pos.end - pos.start + } + offsets[n] = off + + offsetSzCode := offsetSizeCode(totalSize) offsetSz := offsetSize(offsetSzCode) - // Header: basic_type=2 (object), value_header encodes num_fields, field_id_size, offset_size - // Object header byte: bits 0-1 = BasicObject(2), bits 2-3 = field_id_size_minus_one, - // bits 4-5 = offset_size_minus_one, bits 6-7 = unused - // Then: num_elements (1 byte for small objects, but spec says offset_size bytes) - // - // Actually the spec says: - // value_metadata byte: bits 0-1 = basic_type (2=object), bits 2-3 = field_id_size-1, - // bits 4-5 = offset_size-1, bits 6-7 = is_large (0=1-byte num_elements, 1=4-byte) isLarge := byte(0) numElemSize := 1 if n > 255 { @@ -184,66 +569,215 @@ func encodeObject(b *MetadataBuilder, obj Object) []byte { numElemSize = 4 } - header := byte(BasicObject) | (fieldIDSizeCode << 2) | (offsetSzCode << 4) | (isLarge << 6) + header := byte(BasicArray) | (offsetSzCode << 2) | (isLarge << 4) - // Total size: header(1) + num_elements + field_ids(n*fieldIDSize) + offsets((n+1)*offsetSz) + values - totalSize := 1 + numElemSize + n*fieldIDSize + (n+1)*offsetSz + totalValueSize - buf := make([]byte, totalSize) - buf[0] = header + bufSize := 1 + numElemSize + (n+1)*offsetSz + totalSize + if cap(e.temp) < bufSize { + e.temp = make([]byte, bufSize) + } else { + e.temp = e.temp[:bufSize] + } + e.temp[0] = header - pos := 1 + posIdx := 1 if isLarge == 1 { - binary.LittleEndian.PutUint32(buf[pos:], uint32(n)) - pos += 4 + binary.LittleEndian.PutUint32(e.temp[posIdx:], uint32(n)) + posIdx += 4 } else { - buf[pos] = byte(n) - pos += 1 + e.temp[posIdx] = byte(n) + posIdx += 1 } - // Write field IDs - for _, e := range entries { - writeUint(buf[pos:], e.id, fieldIDSize) - pos += fieldIDSize + for _, o := range offsets { + writeUint(e.temp[posIdx:], o, offsetSz) + posIdx += offsetSz } - // Write offsets - for _, off := range valueOffsets { - writeUint(buf[pos:], off, offsetSz) - pos += offsetSz + for _, p := range positions { + copy(e.temp[posIdx:], e.scratch[p.start:p.end]) + posIdx += p.end - p.start } - // Write values - for _, e := range entries { - copy(buf[pos:], e.valueBytes) - pos += len(e.valueBytes) + firstStart := len(e.scratch) + if n > 0 { + firstStart = positions[0].start } + e.scratch = e.scratch[:firstStart] - return buf + start = len(e.scratch) + e.scratch = append(e.scratch, e.temp...) + end = len(e.scratch) + + return start, end, nil } -func encodeArray(b *MetadataBuilder, arr Array) []byte { - n := len(arr.Elements) +func (e *encoder) encodeMapObject(rv reflect.Value) (start, end int, err error) { + if rv.IsNil() { + start, end = e.encodeValuePrimitive(Null()) + return start, end, nil + } - // Encode all elements - encodedElems := make([][]byte, n) - totalSize := 0 - for i, e := range arr.Elements { - encodedElems[i] = Encode(b, e) - totalSize += len(encodedElems[i]) + n := rv.Len() + if n == 0 { + return e.buildObjectBytes(nil) } - // Compute offsets - offsets := make([]int, n+1) + savedStart := len(e.fields) + if cap(e.fields) < savedStart+n { + newCap := max(cap(e.fields)*2, savedStart+n) + newF := make([]encodedField, len(e.fields), newCap) + copy(newF, e.fields) + e.fields = newF + } + e.fields = e.fields[:savedStart+n] + entries := e.fields[savedStart : savedStart+n] + + iter := rv.MapRange() + idx := 0 + for iter.Next() { + key := iter.Key() + if key.Kind() != reflect.String { + e.fields = e.fields[:savedStart] + return 0, 0, fmt.Errorf("variant marshal: map key must be string, got %s", key.Type()) + } + name := key.String() + id := e.b.Add(name) + + pStart, pEnd, err := e.encodeReflect(iter.Value()) + if err != nil { + e.fields = e.fields[:savedStart] + return 0, 0, err + } + entries[idx] = encodedField{ + id: id, + name: name, + start: pStart, + end: pEnd, + } + idx++ + } + + sort.Slice(entries, func(i, j int) bool { + return entries[i].name < entries[j].name + }) + + resStart, resEnd, err := e.buildObjectBytes(entries) + e.fields = e.fields[:savedStart] + return resStart, resEnd, err +} + +func (e *encoder) encodeStructObject(rv reflect.Value) (start, end int, err error) { + rt := rv.Type() + numFields := rt.NumField() + + visibleCount := 0 + for i := range numFields { + sf := rt.Field(i) + if !sf.IsExported() { + continue + } + name := fieldName(sf) + if name == "-" { + continue + } + visibleCount++ + } + + if visibleCount == 0 { + return e.buildObjectBytes(nil) + } + + savedStart := len(e.fields) + if cap(e.fields) < savedStart+visibleCount { + newCap := max(cap(e.fields)*2, savedStart+visibleCount) + newF := make([]encodedField, len(e.fields), newCap) + copy(newF, e.fields) + e.fields = newF + } + e.fields = e.fields[:savedStart+visibleCount] + entries := e.fields[savedStart : savedStart+visibleCount] + + idx := 0 + for i := range numFields { + sf := rt.Field(i) + if !sf.IsExported() { + continue + } + name := fieldName(sf) + if name == "-" { + continue + } + + id := e.b.Add(name) + pStart, pEnd, err := e.encodeReflect(rv.Field(i)) + if err != nil { + e.fields = e.fields[:savedStart] + return 0, 0, err + } + entries[idx] = encodedField{ + id: id, + name: name, + start: pStart, + end: pEnd, + } + idx++ + } + + sort.Slice(entries, func(i, j int) bool { + return entries[i].name < entries[j].name + }) + + resStart, resEnd, err := e.buildObjectBytes(entries) + e.fields = e.fields[:savedStart] + return resStart, resEnd, err +} + +func (e *encoder) buildObjectBytes(entries []encodedField) (start, end int, err error) { + n := len(entries) + + if testHookVerifyObjectLayout != nil { + testHookVerifyObjectLayout(e, entries) + } + + maxID := 0 + totalValueSize := 0 + for _, entry := range entries { + if entry.id > maxID { + maxID = entry.id + } + totalValueSize += entry.end - entry.start + } + + var offsetBuf [32]int + var valueOffsets []int + if n+1 <= len(offsetBuf) { + valueOffsets = offsetBuf[:n+1] + } else { + if cap(e.offsets) < n+1 { + e.offsets = make([]int, n+1) + } + valueOffsets = e.offsets[:n+1] + } off := 0 - for i, enc := range encodedElems { - offsets[i] = off - off += len(enc) + for i, entry := range entries { + valueOffsets[i] = off + off += entry.end - entry.start } - offsets[n] = off + valueOffsets[n] = off - offsetSzCode := offsetSizeCode(totalSize) + fieldIDSizeCode := offsetSizeCode(maxID) + fieldIDSize := offsetSize(fieldIDSizeCode) + offsetSzCode := offsetSizeCode(totalValueSize) offsetSz := offsetSize(offsetSzCode) + // Header byte layout for objects, per the spec's value encoding grammar + // (object_header: is_large << 4 | field_id_size_minus_one << 2 | + // field_offset_size_minus_one, shifted left 2 past the basic type): + // + // bits 0-1: basic_type (2 = object) + // bits 2-3: field_offset_size_minus_one + // bits 4-5: field_id_size_minus_one + // bit 6: is_large (0 = 1-byte num_elements, 1 = 4-byte) isLarge := byte(0) numElemSize := 1 if n > 255 { @@ -251,40 +785,54 @@ func encodeArray(b *MetadataBuilder, arr Array) []byte { numElemSize = 4 } - header := byte(BasicArray) | (offsetSzCode << 2) | (isLarge << 4) + header := byte(BasicObject) | (offsetSzCode << 2) | (fieldIDSizeCode << 4) | (isLarge << 6) - // Total: header(1) + num_elements + offsets((n+1)*offsetSz) + values - bufSize := 1 + numElemSize + (n+1)*offsetSz + totalSize - buf := make([]byte, bufSize) - buf[0] = header + totalSize := 1 + numElemSize + n*fieldIDSize + (n+1)*offsetSz + totalValueSize + if cap(e.temp) < totalSize { + e.temp = make([]byte, totalSize) + } else { + e.temp = e.temp[:totalSize] + } + e.temp[0] = header pos := 1 if isLarge == 1 { - binary.LittleEndian.PutUint32(buf[pos:], uint32(n)) + binary.LittleEndian.PutUint32(e.temp[pos:], uint32(n)) pos += 4 } else { - buf[pos] = byte(n) + e.temp[pos] = byte(n) pos += 1 } - // Write offsets - for _, o := range offsets { - writeUint(buf[pos:], o, offsetSz) + for _, entry := range entries { + writeUint(e.temp[pos:], entry.id, fieldIDSize) + pos += fieldIDSize + } + + for _, offsetVal := range valueOffsets { + writeUint(e.temp[pos:], offsetVal, offsetSz) pos += offsetSz } - // Write values - for _, enc := range encodedElems { - copy(buf[pos:], enc) - pos += len(enc) + for _, entry := range entries { + copy(e.temp[pos:], e.scratch[entry.start:entry.end]) + pos += entry.end - entry.start } - return buf -} + firstStart := len(e.scratch) + if n > 0 { + firstStart = entries[0].start + for _, entry := range entries { + if entry.start < firstStart { + firstStart = entry.start + } + } + } + e.scratch = e.scratch[:firstStart] -// makeHeader constructs a value_metadata byte. -// For primitives: bits 0-1 = basic_type(0), bits 2-7 = primitive_type -// For short strings: bits 0-1 = basic_type(1), bits 2-7 = string length -func makeHeader(basic BasicType, valueHeader byte) byte { - return byte(basic) | (valueHeader << 2) + start = len(e.scratch) + e.scratch = append(e.scratch, e.temp...) + end = len(e.scratch) + + return start, end, nil } diff --git a/vendor/github.com/parquet-go/parquet-go/variant/loc.go b/vendor/github.com/parquet-go/parquet-go/variant/loc.go new file mode 100644 index 00000000000..43ab7c47700 --- /dev/null +++ b/vendor/github.com/parquet-go/parquet-go/variant/loc.go @@ -0,0 +1,50 @@ +package variant + +// Loc describes where the value of a variant path lives for one row +// (or one list element) of a columnar reader window. +type Loc uint8 + +const ( + // LocMissing means the path has no value: an enclosing level is null, + // the field is absent from its parent object, or the whole variant + // column is null for the row. + LocMissing Loc = iota + + // LocNull means the path holds the variant null value. + LocNull + + // LocTyped means the value is a scalar stored in a shredded typed_value + // column; it appears in the cursor's typed vector. + LocTyped + + // LocTypedObject means the value is an object stored (at least + // partially) in shredded form. Leftover fields of a partially shredded + // object are available through the residual. + LocTypedObject + + // LocTypedList means the value is a list stored in shredded form. + LocTypedList + + // LocResidual means the value exists only as variant binary at this + // position. + LocResidual +) + +func (l Loc) String() string { + switch l { + case LocMissing: + return "missing" + case LocNull: + return "null" + case LocTyped: + return "typed" + case LocTypedObject: + return "typed-object" + case LocTypedList: + return "typed-list" + case LocResidual: + return "residual" + default: + return "unknown" + } +} diff --git a/vendor/github.com/parquet-go/parquet-go/variant/marshal.go b/vendor/github.com/parquet-go/parquet-go/variant/marshal.go index 377c020ca98..d3fd25b9ed1 100644 --- a/vendor/github.com/parquet-go/parquet-go/variant/marshal.go +++ b/vendor/github.com/parquet-go/parquet-go/variant/marshal.go @@ -5,6 +5,7 @@ import ( "math" "reflect" "strings" + "time" "github.com/google/uuid" ) @@ -12,16 +13,30 @@ import ( // Marshal converts a Go value to variant binary encoding, returning the // metadata and value byte slices. func Marshal(v any) (metadata, value []byte, err error) { - varVal, err := goToVariant(v) + var b MetadataBuilder + enc := getEncoder(&b) + + start, end, err := enc.encodeReflect(reflect.ValueOf(v)) if err != nil { + releaseEncoder(enc) return nil, nil, err } - var b MetadataBuilder - valueBytes := Encode(&b, varVal) + valueBytes := make([]byte, end-start) + copy(valueBytes, enc.scratch[start:end]) + + releaseEncoder(enc) + _, metadataBytes := b.Build() return metadataBytes, valueBytes, nil } +// ValueOf converts a Go value to a variant Value without encoding it. It is +// useful for callers that need to inspect or partially encode the value, +// such as shredded variant writers. +func ValueOf(v any) (Value, error) { + return goToVariant(v) +} + // Unmarshal decodes variant binary data into a Go value. func Unmarshal(metadata, value []byte) (any, error) { m, err := DecodeMetadata(metadata) @@ -35,7 +50,10 @@ func Unmarshal(metadata, value []byte) (any, error) { return v.GoValue(), nil } -// goToVariant converts a Go value to a variant Value. +// goToVariant converts a Go value to a variant Value. Marshal encodes +// through the streaming encoder instead (see encodeReflect); this tree +// walk backs ValueOf, whose callers need the Value tree to make per-field +// decisions before encoding. The two must map Go types identically. func goToVariant(v any) (Value, error) { if v == nil { return Null(), nil @@ -48,7 +66,6 @@ func goToVariantReflect(rv reflect.Value) (Value, error) { return Null(), nil } - // Dereference pointers/interfaces for rv.Kind() == reflect.Ptr || rv.Kind() == reflect.Interface { if rv.IsNil() { return Null(), nil @@ -56,11 +73,15 @@ func goToVariantReflect(rv reflect.Value) (Value, error) { rv = rv.Elem() } - // Check concrete types first + // uuid.UUID and time.Time must be recognized before the Kind switch: + // uuid.UUID is a [16]byte array and time.Time a struct with no exported + // fields, so the generic cases would mishandle them. iface := rv.Interface() switch val := iface.(type) { case uuid.UUID: return UUID(val), nil + case time.Time: + return timeToVariant(val), nil } switch rv.Kind() { @@ -94,15 +115,19 @@ func goToVariantReflect(rv reflect.Value) (Value, error) { return String(rv.String()), nil case reflect.Slice: if rv.Type().Elem().Kind() == reflect.Uint8 { - // []byte return Binary(rv.Bytes()), nil } return goSliceToArray(rv) case reflect.Array: - if rv.Type() == reflect.TypeFor[uuid.UUID]() { - var u uuid.UUID - reflect.ValueOf(&u).Elem().Set(rv) - return UUID(u), nil + // Byte arrays (including [16]byte) map to Binary. uuid.UUID is + // handled above via its concrete type; without a logical UUID + // annotation a fixed-length byte array is just bytes. + if rv.Type().Elem().Kind() == reflect.Uint8 { + b := make([]byte, rv.Len()) + for i := range b { + b[i] = byte(rv.Index(i).Uint()) + } + return Binary(b), nil } return goSliceToArray(rv) case reflect.Map: @@ -168,6 +193,18 @@ func goStructToObject(rv reflect.Value) (Value, error) { return MakeObject(fields), nil } +// timeToVariant converts a time.Time to a timestamp variant value. The +// timestamp is stored with time zone (isAdjustedToUTC), which is the natural +// mapping for time.Time since it represents an instant. Nanosecond precision +// is used when the value has sub-microsecond components and fits in the +// nanosecond timestamp range; microsecond precision otherwise. +func timeToVariant(t time.Time) Value { + if t.Nanosecond()%1000 != 0 && t.Year() >= 1678 && t.Year() <= 2261 { + return TimestampNanos(t.UnixNano()) + } + return Timestamp(t.UnixMicro()) +} + // fieldName returns the name to use for a struct field, checking variant and // json struct tags. func fieldName(sf reflect.StructField) string { diff --git a/vendor/github.com/parquet-go/parquet-go/variant/metadata.go b/vendor/github.com/parquet-go/parquet-go/variant/metadata.go index 030a23adf53..99549fe3f74 100644 --- a/vendor/github.com/parquet-go/parquet-go/variant/metadata.go +++ b/vendor/github.com/parquet-go/parquet-go/variant/metadata.go @@ -4,10 +4,13 @@ import ( "encoding/binary" "errors" "fmt" - "sort" + "unicode/utf8" + "unsafe" ) // Metadata holds the decoded metadata dictionary for a variant value. +// Sorted reports whether the dictionary strings were stored in +// lexicographic order (the sorted_strings header bit). type Metadata struct { Strings []string Sorted bool @@ -17,12 +20,17 @@ type Metadata struct { // // Format: header(1) | dictionary_size(uint) | offsets(dictionary_size+1) | string_data // -// Header bits: +// Header bits (per the spec's metadata encoding grammar, +// header = version | sorted_strings << 4 | offset_size_minus_one << 6): // // 0-3: version (must be 1) -// 4: sorted_strings -// 5-6: offset_size_minus_one -// 7: reserved (must be 0) +// 4: sorted_strings +// 6-7: offset_size_minus_one +// +// Like Decode, DecodeMetadata rejects what the spec declares invalid +// (non-UTF-8 dictionary strings, sizes exceeding the data) and does not +// validate the unused header bit, per VariantEncoding.md: "Bit 5 (marked R) +// is reserved; it must be ignored by readers." func DecodeMetadata(data []byte) (Metadata, error) { if len(data) == 0 { return Metadata{}, errors.New("variant metadata: empty data") @@ -33,12 +41,9 @@ func DecodeMetadata(data []byte) (Metadata, error) { if version != 1 { return Metadata{}, fmt.Errorf("variant metadata: unsupported version %d", version) } - if header&0x80 != 0 { - return Metadata{}, errors.New("variant metadata: reserved bit is set") - } sorted := (header>>4)&1 == 1 - offsetSz := offsetSize((header >> 5) & 0x03) + offsetSz := offsetSize((header >> 6) & 0x03) pos := 1 dictSize, n, err := readUint(data[pos:], offsetSz) @@ -47,7 +52,16 @@ func DecodeMetadata(data []byte) (Metadata, error) { } pos += n - // Read (dictSize+1) offsets + // The metadata must contain at least (dictSize+1) offsets; validate + // against the input size before allocating to reject corrupt data that + // declares an absurdly large dictionary. dictSize < 0 happens only on + // 32-bit platforms, where a 4-byte size above math.MaxInt32 overflows + // int; the comparison is phrased as <= dictSize rather than + // < dictSize+1 so the addition cannot overflow the same way. + if remaining := len(data) - pos; dictSize < 0 || remaining/offsetSz <= dictSize { + return Metadata{}, fmt.Errorf("variant metadata: dictionary size %d exceeds data", dictSize) + } + offsets := make([]int, dictSize+1) for i := range offsets { v, n, err := readUint(data[pos:], offsetSz) @@ -64,9 +78,15 @@ func DecodeMetadata(data []byte) (Metadata, error) { for i := range dictSize { start := offsets[i] end := offsets[i+1] - if start > end || end > len(stringData) { + // start < 0 happens only on 32-bit platforms, where a 4-byte + // offset above math.MaxInt32 overflows int; without the check the + // slice below would panic. + if start < 0 || start > end || end > len(stringData) { return Metadata{}, fmt.Errorf("variant metadata: invalid string offset [%d, %d) in data of length %d", start, end, len(stringData)) } + if !utf8.Valid(stringData[start:end]) { + return Metadata{}, fmt.Errorf("variant metadata: dictionary string %d is not valid UTF-8", i) + } strings[i] = string(stringData[start:end]) } @@ -81,14 +101,22 @@ func (m Metadata) Lookup(id int) (string, error) { return m.Strings[id], nil } -// MetadataBuilder builds a variant metadata dictionary. +// MetadataBuilder builds a variant metadata dictionary. Field names are +// interned into a single contiguous byte buffer so a high-cardinality key +// set pays for buffer growth rather than a heap string per key. type MetadataBuilder struct { - strings []string - index map[string]int + buf []byte // concatenated dictionary strings + offs []int // start offset of each string in buf; end is offs[i+1] or len(buf) + index map[string]int + // unsorted is set when some entry compares below its predecessor; it is + // tracked incrementally by Add so encoding a large dictionary need not + // re-compare every entry. + unsorted bool } -// Add adds a string to the dictionary and returns its index. -// If the string already exists, the existing index is returned. +// Add interns s into the dictionary and returns its stable index. The +// string is copied into the builder's buffer, so callers may reuse the +// argument's backing memory after Add returns. func (b *MetadataBuilder) Add(s string) int { if b.index == nil { b.index = make(map[string]int) @@ -96,73 +124,120 @@ func (b *MetadataBuilder) Add(s string) int { if idx, ok := b.index[s]; ok { return idx } - idx := len(b.strings) - b.strings = append(b.strings, s) - b.index[s] = idx + if n := len(b.offs); n > 0 && !b.unsorted && b.stringAt(n-1) > s { + b.unsorted = true + } + start := len(b.buf) + old := unsafe.SliceData(b.buf) + b.buf = append(b.buf, s...) + idx := len(b.offs) + // Record the new start before any reindex so stringAt can bound the + // previous last entry (and this one) correctly against the grown slab. + b.offs = append(b.offs, start) + if idx > 0 && unsafe.SliceData(b.buf) != old { + b.reindex() + } else { + b.index[b.stringAt(idx)] = idx + } return idx } +// stringAt returns a view of dictionary entry i into the slab. The view is +// only valid until the next Add that grows the buffer, or Reset. +func (b *MetadataBuilder) stringAt(i int) string { + start := b.offs[i] + end := len(b.buf) + if i+1 < len(b.offs) { + end = b.offs[i+1] + } + if end == start { + return "" + } + return unsafe.String(unsafe.SliceData(b.buf[start:end]), end-start) +} + +// reindex rebuilds the lookup map after the slab has been reallocated. +func (b *MetadataBuilder) reindex() { + clear(b.index) + for i := range b.offs { + b.index[b.stringAt(i)] = i + } +} + // Build returns the decoded Metadata and the encoded binary representation. // The dictionary indices in the output match those returned by Add, so -// encoded values referencing those indices remain valid. +// encoded values referencing those indices remain valid. The returned +// Metadata owns its strings and remains valid after Reset. func (b *MetadataBuilder) Build() (Metadata, []byte) { - n := len(b.strings) - - // Check if the strings happen to be sorted - sorted := sort.StringsAreSorted(b.strings) + strs := make([]string, len(b.offs)) + for i := range b.offs { + strs[i] = string(b.stringAt(i)) // detach from the slab so Reset cannot invalidate + } + return Metadata{Strings: strs, Sorted: !b.unsorted}, b.AppendTo(nil) +} - // Compute string data and offsets - offsets := make([]int, n+1) - totalLen := 0 - for i, s := range b.strings { - offsets[i] = totalLen - totalLen += len(s) +// AppendTo appends the encoded binary representation of the dictionary to +// dst and returns the extended slice. The dictionary indices in the output +// match those returned by Add, so encoded values referencing those indices +// remain valid. +// +// The variant format encodes dictionary offsets in at most 4 bytes, so the +// interned names must total at most math.MaxUint32 bytes; callers growing +// the dictionary without bound must check Size before encoding (as +// Builder.Finish and parquet.VariantColumnWriter do). +func (b *MetadataBuilder) AppendTo(dst []byte) []byte { + n := len(b.offs) + totalLen := len(b.buf) + sortedBit := byte(0) + if !b.unsorted { + sortedBit = 1 } - offsets[n] = totalLen - // Determine offset size maxOffset := max(totalLen, n) osc := offsetSizeCode(maxOffset) offsetSz := offsetSize(osc) - // Build the binary blob - // header(1) + dict_size(offsetSz) + offsets((n+1)*offsetSz) + string_data(totalLen) + // Layout: header(1) + dict_size(offsetSz) + offsets((n+1)*offsetSz) + + // string_data(totalLen). size := 1 + offsetSz + (n+1)*offsetSz + totalLen - buf := make([]byte, size) + base := len(dst) + dst = append(dst, make([]byte, size)...) + out := dst[base:] - // Header: version=1, sorted_strings flag, offset_size_minus_one - sortedBit := byte(0) - if sorted { - sortedBit = 1 - } - buf[0] = 1 | (sortedBit << 4) | (osc << 5) + // Header: version=1, sorted_strings flag at bit 4, offset_size_minus_one + // at bits 6-7 (per the spec's metadata encoding grammar). + out[0] = 1 | (sortedBit << 4) | (osc << 6) pos := 1 - writeUint(buf[pos:], n, offsetSz) + writeUint(out[pos:], n, offsetSz) pos += offsetSz - for _, off := range offsets { - writeUint(buf[pos:], off, offsetSz) + for _, off := range b.offs { + writeUint(out[pos:], off, offsetSz) pos += offsetSz } + writeUint(out[pos:], totalLen, offsetSz) + pos += offsetSz - for _, s := range b.strings { - copy(buf[pos:], s) - pos += len(s) - } - - return Metadata{Strings: b.strings, Sorted: sorted}, buf + copy(out[pos:], b.buf) + return dst } -// Reset clears the builder for reuse. +// Size returns the total number of bytes of interned dictionary strings. +func (b *MetadataBuilder) Size() int { return len(b.buf) } + +// Reset clears the builder for reuse, retaining the string buffer's capacity. func (b *MetadataBuilder) Reset() { - b.strings = b.strings[:0] - for k := range b.index { - delete(b.index, k) - } + b.buf = b.buf[:0] + b.offs = b.offs[:0] + b.unsorted = false + clear(b.index) } -// readUint reads an unsigned integer of the given byte width from data. +// readUint reads an unsigned integer of the given byte width from data. Note +// that on 32-bit platforms a 4-byte value above math.MaxInt32 overflows int +// and is returned negative; callers validating sizes and offsets against the +// input must guard against negative results before using them. func readUint(data []byte, size int) (int, int, error) { if len(data) < size { return 0, 0, errors.New("not enough data") diff --git a/vendor/github.com/parquet-go/parquet-go/variant/types.go b/vendor/github.com/parquet-go/parquet-go/variant/types.go index 7e1f76a68ca..70f2746076b 100644 --- a/vendor/github.com/parquet-go/parquet-go/variant/types.go +++ b/vendor/github.com/parquet-go/parquet-go/variant/types.go @@ -15,25 +15,27 @@ const ( type PrimitiveType byte const ( - PrimitiveNull PrimitiveType = 0 - PrimitiveTrue PrimitiveType = 1 - PrimitiveFalse PrimitiveType = 2 - PrimitiveInt8 PrimitiveType = 3 - PrimitiveInt16 PrimitiveType = 4 - PrimitiveInt32 PrimitiveType = 5 - PrimitiveInt64 PrimitiveType = 6 - PrimitiveDouble PrimitiveType = 7 - PrimitiveDecimal4 PrimitiveType = 8 - PrimitiveDecimal8 PrimitiveType = 9 - PrimitiveDecimal16 PrimitiveType = 10 - PrimitiveDate PrimitiveType = 11 - PrimitiveTimestamp PrimitiveType = 12 - PrimitiveTimestampNTZ PrimitiveType = 13 - PrimitiveFloat PrimitiveType = 14 - PrimitiveBinary PrimitiveType = 15 - PrimitiveString PrimitiveType = 16 - PrimitiveTime PrimitiveType = 17 - PrimitiveUUID PrimitiveType = 20 + PrimitiveNull PrimitiveType = 0 + PrimitiveTrue PrimitiveType = 1 + PrimitiveFalse PrimitiveType = 2 + PrimitiveInt8 PrimitiveType = 3 + PrimitiveInt16 PrimitiveType = 4 + PrimitiveInt32 PrimitiveType = 5 + PrimitiveInt64 PrimitiveType = 6 + PrimitiveDouble PrimitiveType = 7 + PrimitiveDecimal4 PrimitiveType = 8 + PrimitiveDecimal8 PrimitiveType = 9 + PrimitiveDecimal16 PrimitiveType = 10 + PrimitiveDate PrimitiveType = 11 + PrimitiveTimestamp PrimitiveType = 12 + PrimitiveTimestampNTZ PrimitiveType = 13 + PrimitiveFloat PrimitiveType = 14 + PrimitiveBinary PrimitiveType = 15 + PrimitiveString PrimitiveType = 16 + PrimitiveTime PrimitiveType = 17 + PrimitiveTimestampNanos PrimitiveType = 18 + PrimitiveTimestampNTZNanos PrimitiveType = 19 + PrimitiveUUID PrimitiveType = 20 ) // primitiveSize returns the byte size of a primitive value's data portion, @@ -48,7 +50,8 @@ func primitiveSize(p PrimitiveType) int { return 2 case PrimitiveInt32, PrimitiveFloat, PrimitiveDate: return 4 - case PrimitiveInt64, PrimitiveDouble, PrimitiveTimestamp, PrimitiveTimestampNTZ, PrimitiveTime: + case PrimitiveInt64, PrimitiveDouble, PrimitiveTimestamp, PrimitiveTimestampNTZ, PrimitiveTime, + PrimitiveTimestampNanos, PrimitiveTimestampNTZNanos: return 8 case PrimitiveDecimal4: return 5 // 1 scale + 4 value diff --git a/vendor/github.com/parquet-go/parquet-go/variant/value.go b/vendor/github.com/parquet-go/parquet-go/variant/value.go index 26611874848..e52aaf8f443 100644 --- a/vendor/github.com/parquet-go/parquet-go/variant/value.go +++ b/vendor/github.com/parquet-go/parquet-go/variant/value.go @@ -2,6 +2,7 @@ package variant import ( "math" + "time" "github.com/google/uuid" ) @@ -111,6 +112,17 @@ func Time(v int64) Value { return Value{basic: BasicPrimitive, primitive: PrimitiveTime, i64: v} } +// TimestampNanos returns a timestamp variant value (nanoseconds since epoch, UTC). +func TimestampNanos(v int64) Value { + return Value{basic: BasicPrimitive, primitive: PrimitiveTimestampNanos, i64: v} +} + +// TimestampNTZNanos returns a timestamp without timezone variant value +// (nanoseconds since epoch). +func TimestampNTZNanos(v int64) Value { + return Value{basic: BasicPrimitive, primitive: PrimitiveTimestampNTZNanos, i64: v} +} + // UUID returns a UUID variant value. func UUID(v uuid.UUID) Value { return Value{basic: BasicPrimitive, primitive: PrimitiveUUID, uuid: v} @@ -224,7 +236,10 @@ func (v Value) ArrayValue() Array { // Float → float32, Double → float64 // String → string, Binary → []byte // Date → int32 (days since epoch) -// Timestamp/TimestampNTZ → int64 (microseconds since epoch) +// Timestamp/TimestampNanos → time.Time (UTC) +// TimestampNTZ/TimestampNTZNanos → int64 (microseconds/nanoseconds since +// epoch; these have no time zone, so no time.Time instant exists for +// them) // Time → int64 (microseconds since midnight) // UUID → uuid.UUID // Decimal4 → int32 (unscaled), Decimal8 → int64 (unscaled), Decimal16 → [16]byte @@ -273,7 +288,11 @@ func (v Value) GoValue() any { return v.bytes case PrimitiveDate: return int32(v.i64) - case PrimitiveTimestamp, PrimitiveTimestampNTZ, PrimitiveTime: + case PrimitiveTimestamp: + return time.UnixMicro(v.i64).UTC() + case PrimitiveTimestampNanos: + return time.Unix(0, v.i64).UTC() + case PrimitiveTimestampNTZ, PrimitiveTimestampNTZNanos, PrimitiveTime: return v.i64 case PrimitiveUUID: return v.uuid @@ -288,8 +307,11 @@ func (v Value) GoValue() any { } } -// Equal reports whether two variant values are deeply equal. -// Short strings and primitive strings with the same content are considered equal. +// Equal reports whether two variant values are structurally equal: the same +// value with the same primitive type. Object fields are compared without +// regard to order, short strings and primitive strings with the same content +// are considered equal, and floating-point values are compared bitwise (NaN +// equals NaN, negative zero does not equal positive zero). func (v Value) Equal(other Value) bool { // Normalize: treat short strings and primitive strings as equivalent if v.isString() && other.isString() { @@ -300,12 +322,22 @@ func (v Value) Equal(other Value) bool { } switch v.basic { case BasicObject: + // Objects are unordered collections of named fields: two objects + // with the same fields in different order are equal. The encoded + // form sorts field IDs by name regardless of construction order — + // VariantEncoding.md: "The field values are not required to be in + // the same order as the field IDs, to enable flexibility when + // constructing Variant values." if len(v.object.Fields) != len(other.object.Fields) { return false } - for i, f := range v.object.Fields { - of := other.object.Fields[i] - if f.Name != of.Name || !f.Value.Equal(of.Value) { + otherByName := make(map[string]Value, len(other.object.Fields)) + for _, f := range other.object.Fields { + otherByName[f.Name] = f.Value + } + for _, f := range v.object.Fields { + ov, ok := otherByName[f.Name] + if !ok || !f.Value.Equal(ov) { return false } } diff --git a/vendor/github.com/parquet-go/parquet-go/variant_column_reader.go b/vendor/github.com/parquet-go/parquet-go/variant_column_reader.go new file mode 100644 index 00000000000..47b982015b0 --- /dev/null +++ b/vendor/github.com/parquet-go/parquet-go/variant_column_reader.go @@ -0,0 +1,1588 @@ +package parquet + +import ( + "fmt" + "io" + "slices" + "strings" + + "github.com/parquet-go/parquet-go/variant" +) + +// This file implements a columnar, cursor-based reader for VARIANT columns. +// +// Unlike the reconstruction path in variant_shredded_read.go — which rebuilds +// one variant.Value tree per row — VariantReader exposes the shredded layout +// of the file directly: every position in the shredding tree is a +// (typed_value, value) pair where at most one side is populated per row, and +// the API surfaces that duality as typed vectors plus a per-row location tag. +// A query engine evaluating a path expression such as $.a.b over a column +// shredded as INT64 runs a plain vector loop over Int64s()/Locs(), and only +// falls back to per-row work for rows where the value exists as residual +// variant binary. +// +// Navigation is total: a cursor exists for every path, whether or not the +// writer shredded it. Below a non-shredded position, cursors are backed by +// navigation of the nearest shredded ancestor's residual bytes, so location +// tags remain accurate through residuals: LocMissing means the path is +// missing even after looking inside ancestor residual values, and a type +// conflict anywhere along the path (a scalar where an object was shredded, a +// list where a scalar was expected) simply surfaces as variant.LocResidual +// with the residual value already navigated to the requested position. + +// VariantCursorKind is the static (schema-derived) kind of a cursor +// position. It tells the engine which access pattern the position supports; +// the per-row runtime disposition is in Locs. +type VariantCursorKind uint8 + +const ( + // VariantCursorUnshredded is a position with no typed_value column: + // either the schema stores only variant binary here, or the cursor + // navigates below the shredded schema entirely. All present values are + // variant.LocNull or variant.LocResidual. + VariantCursorUnshredded VariantCursorKind = iota + + // VariantCursorLeaf is a position shredded as a primitive type; typed + // values are read from the typed vector accessors. + VariantCursorLeaf + + // VariantCursorObject is a position shredded as an object; descend into + // shredded fields with Field. + VariantCursorObject + + // VariantCursorList is a position shredded as a list; descend with + // Elements and use ListOffsets. + VariantCursorList +) + +func (k VariantCursorKind) String() string { + switch k { + case VariantCursorUnshredded: + return "unshredded" + case VariantCursorLeaf: + return "leaf" + case VariantCursorObject: + return "object" + case VariantCursorList: + return "list" + default: + return "unknown" + } +} + +// VariantReader reads one VARIANT column of a row group in columnar form. +// +// All cursors created from a reader share one row window, advanced with +// Next. Vectors and residual views returned by cursors are valid until the +// next call to Next or SeekToRow. +// +// Only the columns reachable from cursors that have been created are read: +// creating cursors is how an engine declares projection. Cursors may be +// created at any time; cursors created after a call to Next take effect on +// the following call. +type VariantReader struct { + rowGroup RowGroup + group *shreddedVariantGroup + groupDef int // definition level at which the variant group is present + baseColumn int // first leaf column of the variant group + numRows int64 + rowOffset int64 + leafInfo []variantLeafInfo + leaves []*variantLeafReader // lazily created, indexed by relative column + metaLeaf *variantLeafReader + root *VariantCursor + metaCache map[string]variant.Metadata + leafSet map[*variantLeafReader]struct{} // reused by Next + err error + + // rootValueRequired is set for plain unshredded variant groups, whose + // value field is required rather than optional. + rootValueRequired bool +} + +// unshreddedVariantGroupOf recognizes the plain unshredded variant group +// shape (required binary metadata and required binary value, nothing else) +// and returns its reconstruction tree. Groups with an optional value field +// are handled by buildShreddedVariantGroup instead. +func unshreddedVariantGroupOf(node Node) (*shreddedVariantGroup, bool) { + g := &shreddedVariantGroup{metadataCol: -1, valueCol: -1} + col := 0 + for _, f := range node.Fields() { + if !f.Leaf() || f.Type().Kind() != ByteArray || f.Repeated() { + return nil, false + } + switch f.Name() { + case "metadata": + if f.Optional() { + return nil, false + } + g.metadataCol = col + case "value": + if f.Optional() { + // An optional value with no typed_value is handled by + // buildShreddedVariantGroup; this recognizer exists for + // the required-value shape it rejects. + return nil, false + } + g.valueCol = col + default: + return nil, false + } + col++ + } + if g.metadataCol < 0 || g.valueCol < 0 { + return nil, false + } + g.numCols = col + return g, true +} + +type variantLeafInfo struct { + typ Type + maxDef byte + maxRep byte +} + +// variantColumnInfo is the result of resolving a variant column path in a +// schema, shared by NewVariantReader and NewVariantColumnWriter. +type variantColumnInfo struct { + node Node + group *shreddedVariantGroup + valueRequired bool // plain unshredded shape (required binary value) + col int // first leaf column of the variant group + def int // definition level at which the group is present + optional bool // whether the group node itself is optional +} + +// variantGroupOf builds the shredding tree of a variant group node, +// accepting both the shredded shapes (optional value) and the plain +// unshredded shape (required value) that VariantEncoding.md declares. The +// boolean result reports the latter. +func variantGroupOf(node Node) (*shreddedVariantGroup, bool, error) { + g, err := buildShreddedVariantGroup(node, 0, 0, 0) + if err != nil { + if u, ok := unshreddedVariantGroupOf(node); ok { + return u, true, nil + } + return nil, false, err + } + if g.metadataCol < 0 { + return nil, false, fmt.Errorf("variant: variant group has no metadata field") + } + return g, false, nil +} + +// resolveVariantColumn walks the schema to the variant group node named by +// path and builds its shredding tree. +func resolveVariantColumn(schema Node, path []string) (info variantColumnInfo, err error) { + if len(path) == 0 { + return info, fmt.Errorf("variant: a column path is required") + } + node := schema + for _, name := range path { + if node.Leaf() { + return info, fmt.Errorf("variant: column %q not found: %q is a leaf", joinPath(path), name) + } + var next Node + for _, f := range node.Fields() { + if f.Name() == name { + next = f + break + } + info.col += int(numLeafColumnsOf(f)) + } + if next == nil { + return info, fmt.Errorf("variant: column %q not found: no field %q", joinPath(path), name) + } + if next.Repeated() { + return info, fmt.Errorf("variant: column %q is beneath a repeated field, which the columnar variant APIs do not support", joinPath(path)) + } + info.optional = next.Optional() + if info.optional { + info.def++ + } + node = next + } + if node.Leaf() { + return info, fmt.Errorf("variant: column %q is not a variant group", joinPath(path)) + } + info.node = node + info.group, info.valueRequired, err = variantGroupOf(node) + if err != nil { + return info, fmt.Errorf("variant: column %q: %w", joinPath(path), err) + } + return info, nil +} + +// NewVariantReader creates a reader for the variant column at the given path +// in the row group. The path names the variant group node in the schema +// (e.g. "event" for a top-level column, "attrs", "v" for a nested one). The +// column may be unshredded (metadata, value) or shredded (metadata, value, +// typed_value) in any shape permitted by the Variant Shredding +// specification. +func NewVariantReader(rowGroup RowGroup, path ...string) (*VariantReader, error) { + info, err := resolveVariantColumn(rowGroup.Schema(), path) + if err != nil { + return nil, err + } + group, node := info.group, info.node + + r := &VariantReader{ + rowGroup: rowGroup, + group: group, + groupDef: info.def, + baseColumn: info.col, + numRows: rowGroup.NumRows(), + leafInfo: make([]variantLeafInfo, group.numCols), + leaves: make([]*variantLeafReader, group.numCols), + metaCache: make(map[string]variant.Metadata), + + rootValueRequired: info.valueRequired, + } + + // Types in leaf order; the traversal order matches the column numbering + // of buildShreddedVariantGroup (both walk Fields() depth-first). + i := 0 + forEachLeafColumnOf(node, func(leaf leafColumn) { + if i < len(r.leafInfo) { + r.leafInfo[i].typ = leaf.node.Type() + } + i++ + }) + if i != group.numCols { + return nil, fmt.Errorf("variant: column %q has %d leaves but the shredded group spans %d", joinPath(path), i, group.numCols) + } + r.fillLeafLevels(group) + + for _, li := range r.leafInfo { + switch li.typ.Kind() { + case Boolean, Int32, Int64, Float, Double, ByteArray, FixedLenByteArray: + default: + return nil, fmt.Errorf("variant: unsupported leaf type %s in shredded variant group", li.typ) + } + } + + r.metaLeaf = r.leafFor(group.metadataCol) + r.root = r.newNodeCursor(nil, group, "", false) + return r, nil +} + +func joinPath(path []string) string { + return strings.Join(path, ".") +} + +// fillLeafLevels computes the absolute max definition and repetition level +// of every leaf column of the variant subtree from the shredding tree. +func (r *VariantReader) fillLeafLevels(g *shreddedVariantGroup) { + if g.metadataCol >= 0 { + r.leafInfo[g.metadataCol].maxDef = byte(r.groupDef + g.defLevel) + r.leafInfo[g.metadataCol].maxRep = byte(g.repDepth) + } + if g.valueCol >= 0 { + valueDef := r.groupDef + g.defLevel + 1 + if g == r.group && r.rootValueRequired { + valueDef = r.groupDef + } + r.leafInfo[g.valueCol].maxDef = byte(valueDef) + r.leafInfo[g.valueCol].maxRep = byte(g.repDepth) + } + if t := g.typed; t != nil { + switch t.kind { + case shreddedTypedPrimitive: + r.leafInfo[t.startCol].maxDef = byte(r.groupDef + t.defLevel) + r.leafInfo[t.startCol].maxRep = byte(g.repDepth) + case shreddedTypedList: + r.fillLeafLevels(t.element) + case shreddedTypedObject: + for _, f := range t.fields { + r.fillLeafLevels(f.group) + } + } + } +} + +func (r *VariantReader) leafFor(relCol int) *variantLeafReader { + if l := r.leaves[relCol]; l != nil { + return l + } + info := r.leafInfo[relCol] + l := &variantLeafReader{ + reader: r, + relCol: relCol, + typ: info.typ, + kind: info.typ.Kind(), + maxDef: info.maxDef, + maxRep: info.maxRep, + pendingSeek: -1, + } + r.leaves[relCol] = l + return l +} + +// Root returns the cursor for the variant value itself. +func (r *VariantReader) Root() *VariantCursor { return r.root } + +// Path returns the cursor for the object field path below the root, +// equivalent to chaining Field calls. +func (r *VariantReader) Path(path ...string) *VariantCursor { + c := r.root + for _, name := range path { + c = c.Field(name) + } + return c +} + +// NumRows returns the number of rows of the row group. +func (r *VariantReader) NumRows() int64 { return r.numRows } + +// Next advances the shared row window by up to n rows and recomputes the +// window state of every cursor. It returns the number of rows in the new +// window, or (0, io.EOF) when the row group is exhausted. +func (r *VariantReader) Next(n int) (int, error) { + if r.err != nil { + return 0, r.err + } + if n <= 0 { + return 0, nil + } + remaining := r.numRows - r.rowOffset + if remaining <= 0 { + return 0, io.EOF + } + if int64(n) > remaining { + n = int(remaining) + } + if r.leafSet == nil { + r.leafSet = make(map[*variantLeafReader]struct{}) + } + clear(r.leafSet) + r.collectLeaves(r.root, r.leafSet) + for l := range r.leafSet { + if err := l.readWindow(n); err != nil { + r.err = err + return 0, err + } + } + if err := r.root.process(n); err != nil { + r.err = err + return 0, err + } + r.rowOffset += int64(n) + return n, nil +} + +func (r *VariantReader) collectLeaves(c *VariantCursor, seen map[*variantLeafReader]struct{}) { + if c == r.root { + seen[r.metaLeaf] = struct{}{} + } + for _, l := range [...]*variantLeafReader{c.valueLeaf, c.typedLeaf, c.presenceLeaf} { + if l != nil { + seen[l] = struct{}{} + } + } + for _, ch := range c.childList { + r.collectLeaves(ch, seen) + } +} + +// SeekToRow positions the reader such that the next call to Next starts at +// the given row of the row group. +func (r *VariantReader) SeekToRow(rowIndex int64) error { + if r.err != nil { + return r.err + } + if rowIndex < 0 || rowIndex > r.numRows { + return fmt.Errorf("variant: seek to row %d out of range [0, %d]", rowIndex, r.numRows) + } + r.rowOffset = rowIndex + for _, l := range r.leaves { + if l != nil && l.opened { + l.pendingSeek = rowIndex + } + } + return nil +} + +// Close releases the page readers of all columns opened by the reader. +func (r *VariantReader) Close() error { + var firstErr error + for _, l := range r.leaves { + if l == nil || !l.opened { + continue + } + if l.page != nil { + Release(l.page) + l.page = nil + } + if err := l.pages.Close(); err != nil && firstErr == nil { + firstErr = err + } + l.opened = false + } + return firstErr +} + +func (r *VariantReader) metadataFor(row int32) (variant.Metadata, error) { + w := &r.metaLeaf.win + d := w.denseIdx[row] + if d < 0 { + return variant.Metadata{}, fmt.Errorf("variant: missing metadata for window row %d", row) + } + b := w.slab[w.offsets[d]:w.offsets[d+1]] + if m, ok := r.metaCache[string(b)]; ok { + return m, nil + } + m, err := variant.DecodeMetadata(b) + if err != nil { + return variant.Metadata{}, fmt.Errorf("variant metadata: %w", err) + } + // The cache key copies the bytes (they alias the window slab); cap the + // cache so files with per-row unique metadata do not grow it unboundedly. + if len(r.metaCache) < 4096 { + r.metaCache[string(b)] = m + } + return m, nil +} + +// VariantCursor is a position in the variant navigation tree: the root +// value, an object field, or a list element. See VariantReader. +type VariantCursor struct { + reader *VariantReader + parent *VariantCursor + node *shreddedVariantGroup // nil for cursors below the shredded schema + kind VariantCursorKind + + fieldName string // step from parent, for field cursors + isElements bool // step from parent, for element cursors + + depth int // repetition depth within the variant subtree + + valueLeaf *variantLeafReader + typedLeaf *variantLeafReader // primitive typed_value + presenceLeaf *variantLeafReader // first leaf under an object/list typed_value + valueMaxDef byte + typedMaxDef byte + typedDefAbs byte // definition level at which typed_value is present + elemsDefAbs byte // definition level at which a typed list has elements + + children map[string]*VariantCursor + childList []*VariantCursor + elemsCursor *VariantCursor + hasVirtualChild bool + + // Window state. All slices are indexed by entry: one entry per row for + // row-level cursors, one per list element for element cursors. + // + // Residual state is stored sparsely: entries holding residual bytes or + // values are rare in shredded-heavy data, and per-entry storage of a + // variant.Value (144 bytes) plus a byte-slice header dominated the + // reader's memory footprint and window-reset cost. + identityRows bool // entry i is row i; rows stays nil + identitySlots bool // entry i is slot group i; slotGroup stays nil + locs []variant.Loc + slotGroup []int32 // slot group in this node's own columns, -1 if none + rows []int32 // window row of each entry, nil means identity + res []variantResidual // residual state of tagged entries, ascending by entry + typedRows []int32 + listOffsets []int32 + residualCount int +} + +// variantResidual is the residual state of one entry: the raw bytes from the +// value column (nil for navigated entries, which are born decoded) and the +// lazily decoded value. +type variantResidual struct { + bytes []byte + val variant.Value + entry int32 + decoded bool +} + +func (r *VariantReader) newNodeCursor(parent *VariantCursor, node *shreddedVariantGroup, name string, elements bool) *VariantCursor { + c := &VariantCursor{ + reader: r, + parent: parent, + node: node, + fieldName: name, + isElements: elements, + depth: node.repDepth, + children: make(map[string]*VariantCursor), + } + c.identityRows = parent == nil || (!elements && parent.identityRows) + c.identitySlots = parent == nil || (!elements && parent.identitySlots) + if node.valueCol >= 0 { + c.valueLeaf = r.leafFor(node.valueCol) + c.valueMaxDef = r.leafInfo[node.valueCol].maxDef + } + if t := node.typed; t != nil { + c.typedDefAbs = byte(r.groupDef + t.defLevel) + switch t.kind { + case shreddedTypedPrimitive: + c.kind = VariantCursorLeaf + c.typedLeaf = r.leafFor(t.startCol) + c.typedMaxDef = byte(r.groupDef + t.defLevel) + case shreddedTypedObject: + c.kind = VariantCursorObject + c.presenceLeaf = r.leafFor(t.startCol) + case shreddedTypedList: + c.kind = VariantCursorList + c.presenceLeaf = r.leafFor(t.startCol) + c.elemsDefAbs = byte(r.groupDef + t.defLevel + 1) + } + } else { + c.kind = VariantCursorUnshredded + } + return c +} + +func (r *VariantReader) newVirtualCursor(parent *VariantCursor, name string, elements bool) *VariantCursor { + return &VariantCursor{ + reader: r, + parent: parent, + kind: VariantCursorUnshredded, + fieldName: name, + isElements: elements, + depth: parent.depth, + children: make(map[string]*VariantCursor), + identityRows: !elements && parent.identityRows, + // Virtual cursors have no columns of their own, so their slot + // groups are never read; leaving identitySlots set skips the + // per-entry slotGroup appends. + identitySlots: true, + } +} + +// Kind returns the static kind of the cursor position, derived from the +// shredded schema. +func (c *VariantCursor) Kind() VariantCursorKind { return c.kind } + +// LeafType returns the parquet type of the typed_value column for cursors of +// kind VariantCursorLeaf, and nil otherwise. The type's logical type +// identifies the variant type per the shredded types table (e.g. a +// STRING-annotated BYTE_ARRAY holds variant strings). +func (c *VariantCursor) LeafType() Type { + if c.typedLeaf != nil { + return c.typedLeaf.typ + } + return nil +} + +// Fields returns the names of the shredded fields at a cursor of kind +// VariantCursorObject, in schema order, and nil for other kinds. Residual +// fields of partially shredded objects are not listed; they are reached +// through Residual (or by name through Field). +func (c *VariantCursor) Fields() []string { + if c.node == nil || c.node.typed == nil || c.node.typed.kind != shreddedTypedObject { + return nil + } + names := make([]string, len(c.node.typed.fields)) + for i, f := range c.node.typed.fields { + names[i] = f.name + } + return names +} + +// Field returns the cursor for the object field with the given name below +// this cursor. Navigation is total: if the field is not part of the shredded +// schema at this position, the returned cursor is backed by per-row +// navigation of residual values. +func (c *VariantCursor) Field(name string) *VariantCursor { + if ch := c.children[name]; ch != nil { + return ch + } + var ch *VariantCursor + if c.node != nil && c.node.typed != nil && c.node.typed.kind == shreddedTypedObject { + if g := c.node.typed.fieldByName(name); g != nil { + ch = c.reader.newNodeCursor(c, g, name, false) + } + } + if ch == nil { + ch = c.reader.newVirtualCursor(c, name, false) + c.hasVirtualChild = true + } + c.children[name] = ch + c.childList = append(c.childList, ch) + return ch +} + +// Elements returns the cursor for the elements of lists at this position. +// The element entry space concatenates, in row order, the elements of typed +// (shredded) lists and the elements of residual values that turn out to be +// arrays, so an engine can process mixed shredded/residual lists in one +// loop. ListOffsets on this cursor maps entries to element ranges. +func (c *VariantCursor) Elements() *VariantCursor { + if c.elemsCursor != nil { + return c.elemsCursor + } + var ch *VariantCursor + if c.node != nil && c.node.typed != nil && c.node.typed.kind == shreddedTypedList { + ch = c.reader.newNodeCursor(c, c.node.typed.element, "", true) + } else { + ch = c.reader.newVirtualCursor(c, "", true) + c.hasVirtualChild = true + } + c.elemsCursor = ch + c.childList = append(c.childList, ch) + return ch +} + +// Locs returns the location tag of every entry of the current window: one +// per row for row-level cursors, one per element for element cursors. +func (c *VariantCursor) Locs() []variant.Loc { return c.locs } + +// Rows maps each entry of the current window to its row index within the +// window. For row-level cursors the mapping is the identity and Rows returns +// nil; for element cursors (and cursors below them) it returns one row index +// per entry, and several entries may map to one row. +func (c *VariantCursor) Rows() []int32 { return c.rows } + +// ResidualCount returns the number of entries tagged variant.LocResidual in +// the current window. A zero count lets an engine skip per-entry residual +// decoding, though Residual may still return values for entries tagged +// variant.LocNull or variant.LocTypedObject (partial-object leftovers). +func (c *VariantCursor) ResidualCount() int { return c.residualCount } + +// TypedRows maps each value of the typed vectors to its entry index in the +// current window: TypedRows()[i] is the entry holding the i-th typed value. +func (c *VariantCursor) TypedRows() []int32 { return c.typedRows } + +// Booleans returns the dense typed values of a BOOLEAN leaf cursor. +func (c *VariantCursor) Booleans() []bool { + if c.typedLeaf == nil { + return nil + } + return c.typedLeaf.win.bools +} + +// Int32s returns the dense typed values of an INT32-backed leaf cursor +// (int8, int16, int32, date, and decimal4 variant types). +func (c *VariantCursor) Int32s() []int32 { + if c.typedLeaf == nil { + return nil + } + return c.typedLeaf.win.i32 +} + +// Int64s returns the dense typed values of an INT64-backed leaf cursor +// (int64, timestamps, time, and decimal8 variant types). +func (c *VariantCursor) Int64s() []int64 { + if c.typedLeaf == nil { + return nil + } + return c.typedLeaf.win.i64 +} + +// Floats returns the dense typed values of a FLOAT leaf cursor. +func (c *VariantCursor) Floats() []float32 { + if c.typedLeaf == nil { + return nil + } + return c.typedLeaf.win.f32 +} + +// Doubles returns the dense typed values of a DOUBLE leaf cursor. +func (c *VariantCursor) Doubles() []float64 { + if c.typedLeaf == nil { + return nil + } + return c.typedLeaf.win.f64 +} + +// ByteArrays returns the dense typed values of a BYTE_ARRAY-backed leaf +// cursor (string, binary, and byte-array decimal variant types) as a shared +// slab plus len+1 offsets: value i is slab[offsets[i]:offsets[i+1]]. +func (c *VariantCursor) ByteArrays() (slab []byte, offsets []uint32) { + if c.typedLeaf == nil { + return nil, nil + } + return c.typedLeaf.win.slab, c.typedLeaf.win.offsets +} + +// FixedLenByteArrays returns the dense typed values of a +// FIXED_LEN_BYTE_ARRAY-backed leaf cursor (uuid and fixed decimal variant +// types) as a shared slab of size-byte values. +func (c *VariantCursor) FixedLenByteArrays() (slab []byte, size int) { + if c.typedLeaf == nil { + return nil, 0 + } + return c.typedLeaf.win.flba, c.typedLeaf.win.flbaSize +} + +// ListOffsets returns len(entries)+1 offsets into the entry space of the +// Elements cursor: the elements of entry e span +// Elements() entries [offsets[e], offsets[e+1]). It is computed only when +// Elements was called before the window was read. +func (c *VariantCursor) ListOffsets() []int32 { return c.listOffsets } + +// Residual returns the residual variant value of entry i. It is valid for +// entries tagged variant.LocResidual (the value itself), variant.LocNull (the +// variant null value), and variant.LocTypedObject when the row is a partially +// shredded object (the leftover fields not covered by the shredded schema, +// as a variant object). The boolean result reports whether a residual value +// exists at the entry. +func (c *VariantCursor) Residual(i int) (variant.Value, bool, error) { + if i < 0 || i >= len(c.locs) { + return variant.Null(), false, fmt.Errorf("variant: residual index %d out of range", i) + } + switch c.locs[i] { + case variant.LocNull: + return variant.Null(), true, nil + case variant.LocResidual, variant.LocTypedObject: + r := c.residualAt(i) + if r == nil { + return variant.Null(), false, nil + } + if r.decoded { + return r.val, true, nil + } + v, err := c.decodeResidual(r) + if err != nil { + return variant.Null(), false, err + } + return v, true, nil + default: + return variant.Null(), false, nil + } +} + +// residualAt returns the residual state of entry e, or nil if the entry has +// none. res is sorted by entry (windows are built in entry order). +func (c *VariantCursor) residualAt(e int) *variantResidual { + i, ok := slices.BinarySearchFunc(c.res, int32(e), func(r variantResidual, e int32) int { + return int(r.entry) - int(e) + }) + if !ok { + return nil + } + return &c.res[i] +} + +// addResidual appends residual state for entry e, which must be greater than +// the entry of any state added to this window before it. The pointer is +// valid only until the next call to addResidual. +func (c *VariantCursor) addResidual(e int) *variantResidual { + c.res = append(c.res, variantResidual{entry: int32(e)}) + return &c.res[len(c.res)-1] +} + +func (c *VariantCursor) decodeResidual(r *variantResidual) (variant.Value, error) { + m, err := c.reader.metadataFor(c.rowOf(int(r.entry))) + if err != nil { + return variant.Null(), err + } + v, err := variant.Decode(m, r.bytes) + if err != nil { + return variant.Null(), fmt.Errorf("variant: decoding residual value: %w", err) + } + r.val = v + r.decoded = true + return v, nil +} + +func (c *VariantCursor) rowOf(i int) int32 { + if c.rows == nil { + return int32(i) + } + return c.rows[i] +} + +// resetWindow clears the per-window state, retaining slice capacity. The +// residual entries are cleared so that references to window slabs and +// decoded values do not outlive the window. +func (c *VariantCursor) resetWindow() { + c.locs = c.locs[:0] + c.slotGroup = c.slotGroup[:0] + c.rows = c.rows[:0] + clear(c.res) + c.res = c.res[:0] + c.typedRows = c.typedRows[:0] + c.listOffsets = c.listOffsets[:0] + c.residualCount = 0 +} + +// growEntries bulk-extends the window to n entries, all tagged +// variant.LocMissing, for the flat window paths that fill locs in place. +func (c *VariantCursor) growEntries(n int) { + c.locs = slices.Grow(c.locs, n)[:n] + clear(c.locs) +} + +func (c *VariantCursor) appendEntry(group, row int32) int { + c.locs = append(c.locs, variant.LocMissing) + if !c.identitySlots { + c.slotGroup = append(c.slotGroup, group) + } + if !c.identityRows { + c.rows = append(c.rows, row) + } + return len(c.locs) - 1 +} + +// groupOf returns the slot group of entry e in this node's own columns. +func (c *VariantCursor) groupOf(e int) int32 { + if c.identitySlots { + return int32(e) + } + return c.slotGroup[e] +} + +func (c *VariantCursor) setNavigated(e int, v variant.Value) { + if v.IsNull() { + c.locs[e] = variant.LocNull + } else { + c.locs[e] = variant.LocResidual + c.residualCount++ + } + r := c.addResidual(e) + r.val = v + r.decoded = true +} + +// process recomputes the cursor's window state from its leaf windows (or its +// parent's residuals), then recurses into child cursors. +func (c *VariantCursor) process(n int) error { + c.resetWindow() + var err error + switch { + case c.parent == nil: + err = c.processRoot(n) + case c.isElements: + err = c.processElements() + case c.node != nil: + err = c.processShreddedField() + default: + err = c.processVirtualField() + } + if err != nil { + return err + } + if len(c.childList) > 0 { + if err := c.decodeResiduals(); err != nil { + return err + } + } + for _, ch := range c.childList { + if err := ch.process(n); err != nil { + return err + } + } + return nil +} + +// decodeResiduals eagerly decodes the residual values that child cursors +// navigate through: all variant.LocResidual entries, plus partial-object +// leftovers when a non-shredded field cursor exists below this one. +func (c *VariantCursor) decodeResiduals() error { + for i := range c.res { + r := &c.res[i] + if r.decoded || r.bytes == nil { + continue + } + if c.locs[r.entry] == variant.LocTypedObject && !c.hasVirtualChild { + continue + } + if _, err := c.decodeResidual(r); err != nil { + return err + } + } + return nil +} + +// flatWindow reports whether the cursor can use the bulk window path: no +// slot or row indirection, and one slot per entry in every leaf window it +// reads. The value and primitive typed_value leaves of a depth-0 cursor are +// never repeated, but the presence leaf can be: it is the first leaf under +// an object or list typed_value, which may sit below a repeated level (a +// list typed_value always does). +func (c *VariantCursor) flatWindow() bool { + return c.depth == 0 && c.identitySlots && c.identityRows && + (c.presenceLeaf == nil || c.presenceLeaf.maxRep == 0) +} + +func (c *VariantCursor) processRoot(n int) error { + mw := &c.reader.metaLeaf.win + if c.flatWindow() { + c.growEntries(n) + c.computeOwnFlat(n, mw.defs, byte(c.reader.groupDef), variant.LocNull) + return nil + } + for row := range n { + e := c.appendEntry(int32(row), int32(row)) + if mw.defs[row] < byte(c.reader.groupDef) { + c.locs[e] = variant.LocMissing + } else { + c.computeOwn(e, int32(row), variant.LocNull) + } + } + return nil +} + +func (c *VariantCursor) processShreddedField() error { + p := c.parent + n := len(p.locs) + if c.flatWindow() && p.residualCount == 0 { + // No parent entry needs residual navigation, so every entry is + // resolved from this node's own columns: entries below an absent + // parent read as missing there too (their definition levels are + // below the maxima). + c.growEntries(n) + c.computeOwnFlat(n, nil, 0, variant.LocMissing) + return nil + } + for e := range n { + g := p.groupOf(e) + e2 := c.appendEntry(g, p.rowOf(e)) + switch p.locs[e] { + case variant.LocTypedObject: + // A typed object always has its own column slots (navigated + // residual entries can only be tagged null or residual). + c.computeOwn(e2, g, variant.LocMissing) + case variant.LocResidual: + if r := p.residualAt(e); r != nil && r.decoded { + c.navigateField(e2, r.val) + } + } + } + return nil +} + +func (c *VariantCursor) processVirtualField() error { + p := c.parent + n := len(p.locs) + if c.identityRows && len(p.res) == 0 { + // Virtual fields exist only inside residual values; with none in + // the parent window every entry is missing. + c.growEntries(n) + return nil + } + for e := range n { + e2 := c.appendEntry(-1, p.rowOf(e)) + switch p.locs[e] { + case variant.LocResidual, variant.LocTypedObject: + if r := p.residualAt(e); r != nil && r.decoded { + c.navigateField(e2, r.val) + } + } + } + return nil +} + +func (c *VariantCursor) navigateField(e int, pv variant.Value) { + if pv.Basic() != variant.BasicObject { + return // stays missing + } + for _, f := range pv.ObjectValue().Fields { + if f.Name == c.fieldName { + c.setNavigated(e, f.Value) + return + } + } +} + +func (c *VariantCursor) processElements() error { + p := c.parent + var startsP, startsE []int32 + var plw *variantLeafWindow + h := 0 + if c.node != nil { + plw = &p.presenceLeaf.win + startsP = plw.starts(p.depth) + startsE = plw.starts(c.depth) + } + p.listOffsets = append(p.listOffsets[:0], 0) + for e := range p.locs { + switch p.locs[e] { + case variant.LocTypedList: + g := p.groupOf(e) + // g beyond the presence column's group count means the file + // is corrupt (sibling columns must agree); skip the entry. + if g < 0 || c.node == nil || int(g) >= len(startsP)-1 { + break + } + gs, ge := startsP[g], startsP[g+1] + for h < len(startsE)-1 && startsE[h] < gs { + h++ + } + if plw.defs[gs] >= p.elemsDefAbs { + for h < len(startsE)-1 && startsE[h] < ge { + e2 := c.appendEntry(int32(h), p.rowOf(e)) + c.computeOwn(e2, int32(h), variant.LocNull) + h++ + } + } + case variant.LocResidual: + if r := p.residualAt(e); r != nil && r.decoded && r.val.Basic() == variant.BasicArray { + for _, elem := range r.val.ArrayValue().Elements { + e2 := c.appendEntry(-1, p.rowOf(e)) + c.setNavigated(e2, elem) + } + } + } + p.listOffsets = append(p.listOffsets, int32(len(c.locs))) + } + return nil +} + +// computeOwn resolves the location of entry e from the node's own value and +// typed_value columns at slot group g. missingLoc is the tag used when both +// sides are null: variant.LocMissing for object fields, variant.LocNull for +// the root and list elements (where both-null is invalid per the spec and +// read as variant null, matching the row-based reader). +func (c *VariantCursor) computeOwn(e int, g int32, missingLoc variant.Loc) { + var vbytes []byte + valuePresent := false + if c.valueLeaf != nil { + w := &c.valueLeaf.win + if s, ok := w.slotOf(c.depth, g); ok && w.defs[s] == c.valueMaxDef { + d := w.denseIdx[s] + vbytes = w.slab[w.offsets[d]:w.offsets[d+1]] + valuePresent = true + } + } + if t := c.node.typed; t != nil { + switch t.kind { + case shreddedTypedPrimitive: + w := &c.typedLeaf.win + if s, ok := w.slotOf(c.depth, g); ok && w.defs[s] == c.typedMaxDef { + // The spec requires value to be null when a primitive + // typed_value is present; if a non-compliant writer set + // both, the typed side wins (readers may assume data is + // written correctly). + c.locs[e] = variant.LocTyped + c.typedRows = append(c.typedRows, int32(e)) + return + } + case shreddedTypedObject: + w := &c.presenceLeaf.win + if s, ok := w.slotOf(c.depth, g); ok && w.defs[s] >= c.typedDefAbs { + c.locs[e] = variant.LocTypedObject + if valuePresent { + c.addResidual(e).bytes = vbytes // partially shredded object + } + return + } + case shreddedTypedList: + w := &c.presenceLeaf.win + if s, ok := w.slotOf(c.depth, g); ok && w.defs[s] >= c.typedDefAbs { + c.locs[e] = variant.LocTypedList + return + } + } + } + if valuePresent { + if len(vbytes) == 0 || vbytes[0] == 0x00 { + // Variant null is a one-byte value with a zero header. Empty + // bytes are how the plain unshredded write path stores a zero + // variant value; the row-based reader reads them as null too. + c.locs[e] = variant.LocNull + } else { + c.locs[e] = variant.LocResidual + c.addResidual(e).bytes = vbytes + c.residualCount++ + } + return + } + c.locs[e] = missingLoc +} + +// computeOwnFlat is the bulk equivalent of computeOwn for flat cursors (see +// flatWindow): entry e reads slot e of every leaf window directly. Entries +// whose gate level (the metadata column for the root) is below gateDef stay +// variant.LocMissing; growEntries pre-tagged every entry that way, so the +// loops only write the other locations. +func (c *VariantCursor) computeOwnFlat(n int, gate []byte, gateDef byte, missingLoc variant.Loc) { + locs := c.locs + switch { + case c.typedLeaf != nil: // primitive typed_value + tdefs := c.typedLeaf.win.defs + for e := range n { + if gate != nil && gate[e] < gateDef { + continue + } + if tdefs[e] == c.typedMaxDef { + locs[e] = variant.LocTyped + c.typedRows = append(c.typedRows, int32(e)) + continue + } + c.resolveValueFlat(e, missingLoc, false) + } + case c.presenceLeaf != nil: // object or list typed_value + typedLoc := variant.LocTypedObject + isObject := c.node.typed.kind == shreddedTypedObject + if !isObject { + typedLoc = variant.LocTypedList + } + pdefs := c.presenceLeaf.win.defs + for e := range n { + if gate != nil && gate[e] < gateDef { + continue + } + if pdefs[e] >= c.typedDefAbs { + locs[e] = typedLoc + if isObject { + // A present value column holds the leftover fields of + // a partially shredded object. + c.resolveValueFlat(e, typedLoc, true) + } + continue + } + c.resolveValueFlat(e, missingLoc, false) + } + default: // no typed_value column + for e := range n { + if gate != nil && gate[e] < gateDef { + continue + } + c.resolveValueFlat(e, missingLoc, false) + } + } +} + +// resolveValueFlat resolves entry e of a flat cursor from the value column +// alone: fallbackLoc when the column is null there, variant.LocNull or +// variant.LocResidual otherwise. With partialObject set (entry already +// tagged variant.LocTypedObject) a present value only records its leftover +// bytes. +func (c *VariantCursor) resolveValueFlat(e int, fallbackLoc variant.Loc, partialObject bool) { + if c.valueLeaf != nil { + w := &c.valueLeaf.win + if w.defs[e] == c.valueMaxDef { + d := w.denseIdx[e] + vbytes := w.slab[w.offsets[d]:w.offsets[d+1]] + switch { + case partialObject: + c.addResidual(e).bytes = vbytes + case len(vbytes) == 0 || vbytes[0] == 0x00: + // See computeOwn: zero or empty bytes read as variant null. + c.locs[e] = variant.LocNull + default: + c.locs[e] = variant.LocResidual + c.addResidual(e).bytes = vbytes + c.residualCount++ + } + return + } + } + c.locs[e] = fallbackLoc +} + +// variantLeafWindow holds the current window of one leaf column in columnar +// form: one definition level (and repetition level for repeated leaves) per +// slot, and the non-null values densely in typed buffers. All buffers are +// reused across windows. +type variantLeafWindow struct { + defs []byte + reps []byte // nil when the leaf is not repeated + denseIdx []int32 // slot -> index in the typed buffers, -1 for null slots + dense int + + // starts[d] lists the first slot of every repetition-depth-d group in + // the window (plus a final sentinel of numSlots). Depth 0 groups are + // rows. Computed lazily per depth per window. + startsByDepth [][]int32 + startsValid []bool + + bools []bool + i32 []int32 + i64 []int64 + f32 []float32 + f64 []float64 + slab []byte + offsets []uint32 // ByteArray: len == dense+1 + flba []byte + flbaSize int +} + +func (w *variantLeafWindow) reset() { + w.defs = w.defs[:0] + w.reps = w.reps[:0] + w.denseIdx = w.denseIdx[:0] + w.dense = 0 + for i := range w.startsValid { + w.startsValid[i] = false + } + w.bools = w.bools[:0] + w.i32 = w.i32[:0] + w.i64 = w.i64[:0] + w.f32 = w.f32[:0] + w.f64 = w.f64[:0] + w.slab = w.slab[:0] + w.offsets = append(w.offsets[:0], 0) + w.flba = w.flba[:0] +} + +// slotOf returns the first slot of depth-d group g and whether the group +// exists in the window. Sibling columns of a valid file agree on group +// counts; a missing group means the file is corrupt, and the caller treats +// the position as missing rather than panicking. +func (w *variantLeafWindow) slotOf(depth int, g int32) (int32, bool) { + if len(w.reps) == 0 { + // Non-repeated window: every slot is its own group at every depth, + // so the starts mapping is the identity. + if int(g) >= len(w.defs) { + return 0, false + } + return g, true + } + starts := w.starts(depth) + if int(g) >= len(starts)-1 { + return 0, false + } + return starts[g], true +} + +func (w *variantLeafWindow) starts(depth int) []int32 { + for len(w.startsByDepth) <= depth { + w.startsByDepth = append(w.startsByDepth, nil) + w.startsValid = append(w.startsValid, false) + } + if w.startsValid[depth] { + return w.startsByDepth[depth] + } + s := w.startsByDepth[depth][:0] + if len(w.reps) == 0 { + for i := range w.defs { + s = append(s, int32(i)) + } + } else { + for i, rp := range w.reps { + if int(rp) <= depth { + s = append(s, int32(i)) + } + } + } + s = append(s, int32(len(w.defs))) + w.startsByDepth[depth] = s + w.startsValid[depth] = true + return s +} + +// variantLeafReader reads windows of one leaf column of the variant subtree +// from its pages, extracting levels and typed data without boxing values. +type variantLeafReader struct { + reader *VariantReader + relCol int + typ Type + kind Kind + maxDef byte + maxRep byte + + opened bool + pages Pages + pendingSeek int64 + + // Current page state. + page Page + pdefs []byte + preps []byte + pcount int // slots in the page + ppos int // slots consumed + pdense int // non-null values consumed + + // Typed data of the current page (one of these per kind), or dictionary + // indexes when the page is dictionary-encoded. + pi32 []int32 + pi64 []int64 + pf32 []float32 + pf64 []float64 + pba []byte + pbaOff []uint32 + pflba []byte + pflbaN int + pbools []bool + pidx []int32 + dictSet bool + di32 []int32 + di64 []int64 + df32 []float32 + df64 []float64 + dba []byte + dbaOff []uint32 + dflba []byte + dflbaN int + + win variantLeafWindow +} + +func (l *variantLeafReader) open() error { + chunks := l.reader.rowGroup.ColumnChunks() + col := l.reader.baseColumn + l.relCol + if col >= len(chunks) { + return fmt.Errorf("variant: column %d out of range", col) + } + l.pages = chunks[col].Pages() + l.opened = true + if l.reader.rowOffset > 0 && l.pendingSeek < 0 { + l.pendingSeek = l.reader.rowOffset + } + return nil +} + +func (l *variantLeafReader) readWindow(nRows int) error { + if !l.opened { + if err := l.open(); err != nil { + return err + } + } + if l.pendingSeek >= 0 { + if l.page != nil { + Release(l.page) + l.page = nil + } + if err := l.pages.SeekToRow(l.pendingSeek); err != nil { + return err + } + l.pendingSeek = -1 + } + w := &l.win + w.reset() + rowsDone := 0 + started := false + for { + if err := l.ensurePage(); err != nil { + if err == io.EOF { + if started { + rowsDone++ + } + if rowsDone == nRows { + return nil + } + return fmt.Errorf("variant: column %d ended after %d of %d rows", l.reader.baseColumn+l.relCol, rowsDone, nRows) + } + return err + } + rep := byte(0) + if l.preps != nil { + rep = l.preps[l.ppos] + } + if rep == 0 { + if started { + rowsDone++ + if rowsDone == nRows { + return nil + } + } + started = true + } + l.consumeSlot(w, rep) + } +} + +func (l *variantLeafReader) ensurePage() error { + for l.page == nil || l.ppos == l.pcount { + if l.page != nil { + Release(l.page) + l.page = nil + } + p, err := l.pages.ReadPage() + if err != nil { + return err + } + if err := l.setPage(p); err != nil { + // setPage stored the page in l.page; clear it so Close does + // not release it a second time. + l.page = nil + Release(p) + return err + } + } + return nil +} + +func (l *variantLeafReader) setPage(p Page) error { + l.page = p + l.pdefs = p.DefinitionLevels() + l.preps = p.RepetitionLevels() + if l.pdefs != nil { + l.pcount = len(l.pdefs) + } else { + l.pcount = int(p.NumValues()) + } + l.ppos, l.pdense = 0, 0 + l.pidx = nil + + if l.kind == Boolean { + // Boolean page data is bit-packed with an internal bit offset that + // Data() does not expose for sliced pages, so booleans go through + // the page's value reader instead. + if err := l.extractBooleans(p); err != nil { + return err + } + return l.checkPageValues() + } + + data := p.Data() + if d := p.Dictionary(); d != nil { + l.pidx = data.Int32() + if !l.dictSet { + dd := d.Page().Data() + switch l.kind { + case Int32: + l.di32 = dd.Int32() + case Int64: + l.di64 = dd.Int64() + case Float: + l.df32 = dd.Float() + case Double: + l.df64 = dd.Double() + case ByteArray: + l.dba, l.dbaOff = dd.ByteArray() + case FixedLenByteArray: + l.dflba, l.dflbaN = dd.FixedLenByteArray() + } + l.dictSet = true + } + return l.checkPageValues() + } + switch l.kind { + case Int32: + l.pi32 = data.Int32() + case Int64: + l.pi64 = data.Int64() + case Float: + l.pf32 = data.Float() + case Double: + l.pf64 = data.Double() + case ByteArray: + l.pba, l.pbaOff = data.ByteArray() + case FixedLenByteArray: + l.pflba, l.pflbaN = data.FixedLenByteArray() + default: + return fmt.Errorf("variant: unsupported page kind %s", l.kind) + } + return l.checkPageValues() +} + +// checkPageValues verifies that the page decoded at least as many non-null +// values as its definition levels declare, so that appendValue never indexes +// past the decoded data. The page decode layer does not enforce this for +// BYTE_ARRAY, dictionary-encoded, or data page v2 pages, where a corrupt +// value section can decode short without error. +func (l *variantLeafReader) checkPageValues() error { + needed := l.pcount + if l.pdefs != nil { + needed = countLevelsEqual(l.pdefs, l.maxDef) + } + var have int + switch { + case l.pidx != nil: + have = len(l.pidx) + case l.kind == Boolean: + have = len(l.pbools) + case l.kind == Int32: + have = len(l.pi32) + case l.kind == Int64: + have = len(l.pi64) + case l.kind == Float: + have = len(l.pf32) + case l.kind == Double: + have = len(l.pf64) + case l.kind == ByteArray: + if n := len(l.pbaOff); n > 0 { + have = n - 1 + } + case l.kind == FixedLenByteArray: + if l.pflbaN > 0 { + have = len(l.pflba) / l.pflbaN + } + } + if have < needed { + return fmt.Errorf("variant: column %d page declares %d non-null values but decoded %d: %w", + l.reader.baseColumn+l.relCol, needed, have, ErrCorrupted) + } + return nil +} + +func (l *variantLeafReader) extractBooleans(p Page) error { + l.pbools = l.pbools[:0] + vr := p.Values() + var buf [128]Value + for { + n, err := vr.ReadValues(buf[:]) + for _, v := range buf[:n] { + if !v.IsNull() { + l.pbools = append(l.pbools, v.Boolean()) + } + } + if err == io.EOF { + return nil + } + if err != nil { + return err + } + if n == 0 { + return fmt.Errorf("variant: boolean page reader made no progress") + } + } +} + +func (l *variantLeafReader) consumeSlot(w *variantLeafWindow, rep byte) { + def := l.maxDef + if l.pdefs != nil { + def = l.pdefs[l.ppos] + } + w.defs = append(w.defs, def) + if l.maxRep > 0 { + w.reps = append(w.reps, rep) + } + if def == l.maxDef { + w.denseIdx = append(w.denseIdx, int32(w.dense)) + w.dense++ + l.appendValue(w) + } else { + w.denseIdx = append(w.denseIdx, -1) + } + l.ppos++ +} + +func (l *variantLeafReader) appendValue(w *variantLeafWindow) { + i := l.pdense + l.pdense++ + switch l.kind { + case Boolean: + w.bools = append(w.bools, l.pbools[i]) + case Int32: + if l.pidx != nil { + w.i32 = append(w.i32, l.di32[l.pidx[i]]) + } else { + w.i32 = append(w.i32, l.pi32[i]) + } + case Int64: + if l.pidx != nil { + w.i64 = append(w.i64, l.di64[l.pidx[i]]) + } else { + w.i64 = append(w.i64, l.pi64[i]) + } + case Float: + if l.pidx != nil { + w.f32 = append(w.f32, l.df32[l.pidx[i]]) + } else { + w.f32 = append(w.f32, l.pf32[i]) + } + case Double: + if l.pidx != nil { + w.f64 = append(w.f64, l.df64[l.pidx[i]]) + } else { + w.f64 = append(w.f64, l.pf64[i]) + } + case ByteArray: + var b []byte + if l.pidx != nil { + j := l.pidx[i] + b = l.dba[l.dbaOff[j]:l.dbaOff[j+1]] + } else { + b = l.pba[l.pbaOff[i]:l.pbaOff[i+1]] + } + w.slab = append(w.slab, b...) + w.offsets = append(w.offsets, uint32(len(w.slab))) + case FixedLenByteArray: + if l.pidx != nil { + j := int(l.pidx[i]) + w.flba = append(w.flba, l.dflba[j*l.dflbaN:(j+1)*l.dflbaN]...) + w.flbaSize = l.dflbaN + } else { + w.flba = append(w.flba, l.pflba[i*l.pflbaN:(i+1)*l.pflbaN]...) + w.flbaSize = l.pflbaN + } + } +} diff --git a/vendor/github.com/parquet-go/parquet-go/variant_column_writer.go b/vendor/github.com/parquet-go/parquet-go/variant_column_writer.go new file mode 100644 index 00000000000..7260236424c --- /dev/null +++ b/vendor/github.com/parquet-go/parquet-go/variant_column_writer.go @@ -0,0 +1,844 @@ +package parquet + +import ( + "fmt" + "math" + "strings" + + "github.com/google/uuid" + "github.com/parquet-go/parquet-go/variant" +) + +// This file implements a columnar, streaming writer for VARIANT columns. +// +// Unlike the row-based write path (column_buffer_variant.go) — which decodes +// each row into a variant.Value tree and shreds the tree — VariantColumnWriter +// consumes variant.ValueBuilder events and shreds them as they arrive: values +// matching the shredded type are appended directly to the typed_value column +// buffers, and everything else is encoded to variant binary residuals with a +// streaming variant.Builder. All rows share one metadata dictionary (reset +// only when it outgrows a bound), so a stable field set interns each name +// once and every row writes byte-identical metadata. No +// intermediate tree, map, or []parquet.Value is ever built, so transcoding +// e.g. JSON into a shredded variant column runs allocation-free per row once +// the writer's buffers are warm. +// +// The shredding semantics are identical to the row path: both follow the +// case tables of the Variant Shredding specification (summarized at the top +// of variant_shredded_write.go) and share variantToParquetValue and the +// shreddedVariantGroup tree. + +// VariantColumnWriter writes one VARIANT column of a parquet file in +// streaming, columnar form. It implements variant.ValueBuilder: each row is +// bracketed by BeginRow and EndRow, and the row's value is described by the +// event methods in between, following the event-sequence rules documented +// on variant.ValueBuilder. WriteValue and WriteNullRow are row-level +// conveniences. String and []byte event arguments, and Field names, are +// copied; callers may reuse their backing memory after the call returns. +// +// The writer appends to the column buffers of the ColumnWriters backing the +// variant column's leaf columns and flushes full pages at row boundaries, +// like ColumnWriter.WriteRowValues. To keep row boundaries cheap the +// page-size check is polled every few rows while the buffers are under half +// the configured page size (and every row past that), so pages may +// moderately overshoot the configured size. Other columns of the file must be +// written separately (e.g. through Writer.ColumnWriters) with the same +// number of rows, and the parent writer must be closed (or its row group +// committed) as usual to flush buffered sub-page data to the file. +// +// Errors are sticky: the first misuse or write failure is retained, +// subsequent events are ignored, and the error is reported by Err, EndRow, +// and row-level methods. After an error the underlying columns may hold a +// partial row, so the parent writer's current row group is inconsistent and +// must be abandoned as a whole, including the other columns' writers: for a +// ConcurrentRowGroupWriter target, do not Commit; for a Writer or +// GenericWriter target, discard the output. +// +// A VariantColumnWriter is not safe for concurrent use, and the parent +// writer must not be flushed, reset, or closed between BeginRow and EndRow +// (rows cannot span pages or row groups). +type VariantColumnWriter struct { + group *shreddedVariantGroup + groupDef int // definition level at which the variant group is present + optional bool // whether the variant group node itself is optional + columns []*ColumnWriter + + // rootValueRequired is set for plain unshredded variant groups, whose + // value field is required rather than optional. + rootValueRequired bool + + meta variant.MetadataBuilder + metaGen uint64 // bumped when meta resets; invalidates VariantFieldRef interns + metaBuf []byte + builders map[*shreddedVariantGroup]*variant.Builder + + // flushCountdown spaces out the page-size scan of flush, which is + // O(columns) and dominates wide schemas when run every row. + flushCountdown int + + // Row state. cur is the shredded node awaiting a value event, nil when + // no value is expected (inside an object before a Field call, or after + // the row's value completed). frames tracks open shredded containers; + // residual tracks an active residual stream. + inRow bool + cur *shreddedVariantGroup + curLevels shredLevels + frames []variantWriterFrame + residual variantResidualState + err error +} + +// variantWriterFrame is one open shredded container (an object or list +// being shredded field-wise or element-wise). +type variantWriterFrame struct { + node *shreddedVariantGroup + isList bool + levels shredLevels // level context of this container occurrence + seen []bool // objects: shredded fields that received a value + partial *variant.Builder + elems int // lists: elements written so far +} + +// variantResidualState tracks an active residual stream: events are +// forwarded to b until the container depth returns to base. +type variantResidualState struct { + b *variant.Builder + node *shreddedVariantGroup + levels shredLevels + depth int + base int +} + +// WriterTarget is the writer surface VariantColumnWriter binds to; +// it is satisfied by *Writer, *GenericWriter[T], and +// *ConcurrentRowGroupWriter. +type WriterTarget interface { + Schema() *Schema + ColumnWriters() []*ColumnWriter +} + +var ( + _ WriterTarget = (*Writer)(nil) + _ WriterTarget = (*GenericWriter[any])(nil) + _ WriterTarget = (*ConcurrentRowGroupWriter)(nil) +) + +// NewVariantColumnWriter returns a streaming columnar writer for the VARIANT +// column at the given path in w's schema (e.g. "event" for a top-level +// column, "attrs", "v" for one nested in a group). The column may be +// unshredded (metadata, value) or shredded (metadata, value, typed_value) +// in any shape permitted by the Variant Shredding specification. +func NewVariantColumnWriter(w WriterTarget, path ...string) (*VariantColumnWriter, error) { + schema := w.Schema() + if schema == nil { + return nil, fmt.Errorf("variant: the writer has no schema configured") + } + info, err := resolveVariantColumn(schema, path) + if err != nil { + return nil, err + } + group := info.group + + columnWriters := w.ColumnWriters() + if info.col+group.numCols > len(columnWriters) { + return nil, fmt.Errorf("variant: column %q spans columns [%d, %d) but the writer has %d", joinPath(path), info.col, info.col+group.numCols, len(columnWriters)) + } + + return &VariantColumnWriter{ + group: group, + groupDef: info.def, + optional: info.optional, + columns: columnWriters[info.col : info.col+group.numCols], + rootValueRequired: info.valueRequired, + builders: make(map[*shreddedVariantGroup]*variant.Builder), + }, nil +} + +// Err returns the first error encountered, or nil. +func (w *VariantColumnWriter) Err() error { return w.err } + +func (w *VariantColumnWriter) fail(format string, args ...any) { + if w.err == nil { + w.err = fmt.Errorf("variant writer: "+format, args...) + } +} + +// variantMetadataResetSize bounds the interned name bytes of the writer's +// metadata dictionary. The dictionary persists across rows so that a stable +// field set interns each name once and every row writes byte-identical +// metadata (which encodes and compresses well); the bound keeps workloads +// with unbounded field-name churn from bloating every row's metadata with +// names of earlier rows. +const variantMetadataResetSize = 4096 + +// variantFlushCheckRows is how many rows may pass between page-size checks +// of the variant group's columns while every column is under half its +// buffer size; past half, flush checks every row. +const variantFlushCheckRows = 16 + +// BeginRow starts a new row. Exactly one value — a single scalar event, or +// a single balanced object or array — must be written before the matching +// EndRow. +func (w *VariantColumnWriter) BeginRow() error { + if w.err != nil { + return w.err + } + if w.inRow { + w.fail("BeginRow inside a row") + return w.err + } + w.inRow = true + w.cur = w.group + w.curLevels = shredLevels{baseDef: w.groupDef} + if w.meta.Size() > variantMetadataResetSize { + w.meta.Reset() + w.metaGen++ + } + return nil +} + +// EndRow completes the current row: it writes the row's metadata dictionary +// and periodically flushes columns whose buffered page reached the writer's +// page size. +func (w *VariantColumnWriter) EndRow() error { + if w.err == nil && !w.inRow { + w.fail("EndRow outside of a row") + } + if w.err == nil && (w.residual.b != nil || len(w.frames) > 0) { + w.fail("EndRow with an unclosed object or array") + } + // With no open frames or residual, cur still set means the row's value + // never arrived (valueDone clears it when the value completes). + if w.err == nil && w.cur != nil { + w.fail("EndRow without a value; use WriteNullRow for SQL null rows") + } + if w.err != nil { + return w.err + } + // Dictionary offsets are at most 4 bytes wide; AppendTo would silently + // truncate a larger dictionary. Only reachable when a single row + // interns over 4 GiB of unique field names, since BeginRow resets the + // dictionary at variantMetadataResetSize. + if uint64(w.meta.Size()) > math.MaxUint32 { + w.fail("metadata dictionary of %d bytes exceeds the variant format's 4 GiB limit", w.meta.Size()) + return w.err + } + w.metaBuf = w.meta.AppendTo(w.metaBuf[:0]) + w.leaf(w.group.metadataCol).writeByteArray(w.levels(byte(w.groupDef), 0), w.metaBuf) + w.inRow = false + w.cur = nil + return w.flush() +} + +// WriteNullRow writes a row where the variant column itself is null (a SQL +// null, distinct from the variant null value). The variant group must be +// optional. Any optional ancestors of the variant group are written as +// present; the writer cannot express a row where an ancestor group is null. +func (w *VariantColumnWriter) WriteNullRow() error { + if w.err != nil { + return w.err + } + if w.inRow { + w.fail("WriteNullRow inside a row") + return w.err + } + if !w.optional { + w.fail("WriteNullRow on a required variant column") + return w.err + } + lv := w.levels(byte(w.groupDef-1), 0) + for col := range w.columns { + w.leaf(col).writeNull(lv) + } + return w.flush() +} + +// WriteValue writes one row holding the given variant value: it brackets +// v.Write(w) with BeginRow and EndRow and reports any error either raised. +func (w *VariantColumnWriter) WriteValue(v variant.Value) error { + if err := w.BeginRow(); err != nil { + return err + } + v.Write(w) + return w.EndRow() +} + +// leaf returns the column buffer of the relative leaf column, creating it on +// first use like ColumnWriter.WriteRowValues does. +func (w *VariantColumnWriter) leaf(col int) ColumnBuffer { + c := w.columns[col] + if c.columnBuffer == nil { + c.columnBuffer = c.newColumnBuffer() + if c.originalColumnBuffer == nil { + c.originalColumnBuffer = c.columnBuffer + } + } + return c.columnBuffer +} + +func (w *VariantColumnWriter) levels(def, rep byte) columnLevels { + return columnLevels{definitionLevel: def, repetitionLevel: rep} +} + +// flush flushes any column whose buffer reached the configured page size. +// It only runs at row boundaries, since a row cannot span two pages. While +// every column is under half its buffer size the poll is spaced out to +// every variantFlushCheckRows rows; once any column crosses half, it runs +// every row so a page cannot silently overshoot by many large rows. +func (w *VariantColumnWriter) flush() error { + if w.flushCountdown > 0 { + w.flushCountdown-- + return nil + } + w.flushCountdown = variantFlushCheckRows - 1 + for _, c := range w.columns { + if c.columnBuffer == nil { + continue + } + if size := c.columnBuffer.Size(); size >= int64(c.bufferSize) { + if err := c.Flush(); err != nil { + w.err = err + return err + } + } else if size >= int64(c.bufferSize)/2 { + w.flushCountdown = 0 + } + } + return nil +} + +// builder returns the residual builder of a shredded node, sharing the +// row's metadata dictionary. +func (w *VariantColumnWriter) builder(node *shreddedVariantGroup) *variant.Builder { + b := w.builders[node] + if b == nil { + b = variant.NewBuilderWithMetadata(&w.meta) + w.builders[node] = b + } + b.Reset() + return b +} + +// writeNulls writes one null to every leaf column in [startCol, endCol). +func (w *VariantColumnWriter) writeNulls(startCol, endCol int, def, rep byte) { + lv := w.levels(def, rep) + for col := startCol; col < endCol; col++ { + w.leaf(col).writeNull(lv) + } +} + +// writeMissing writes a missing occurrence of a shredded node (both value +// and typed_value null), which is how absent object fields are represented. +func (w *VariantColumnWriter) writeMissing(g *shreddedVariantGroup, l shredLevels) { + if g.valueCol >= 0 { + w.leaf(g.valueCol).writeNull(w.levels(l.def(g.defLevel), l.rep)) + } + if g.typed != nil { + w.writeNulls(g.typed.startCol, g.typed.startCol+g.typed.numCols, l.def(g.defLevel), l.rep) + } +} + +// writeResidualBytes writes encoded variant bytes to the node's value +// column. +func (w *VariantColumnWriter) writeResidualBytes(g *shreddedVariantGroup, l shredLevels, data []byte) { + if g.valueCol < 0 { + w.fail("value does not match the shredded type and the schema has no value column to fall back to") + return + } + def := l.def(g.defLevel) + 1 + if g == w.group && w.rootValueRequired { + def = byte(w.groupDef) + } + w.leaf(g.valueCol).writeByteArray(w.levels(def, l.rep), data) +} + +// writeTyped writes a matched scalar to the node's typed_value column. +func (w *VariantColumnWriter) writeTyped(col int, pv Value, def, rep byte) { + buf := w.leaf(col) + lv := w.levels(def, rep) + switch pv.Kind() { + case Boolean: + buf.writeBoolean(lv, pv.Boolean()) + case Int32: + buf.writeInt32(lv, pv.Int32()) + case Int64: + buf.writeInt64(lv, pv.Int64()) + case Float: + buf.writeFloat(lv, pv.Float()) + case Double: + buf.writeDouble(lv, pv.Double()) + default: + buf.writeByteArray(lv, pv.ByteArray()) + } +} + +// valueDone advances the row state after one value completed at node level: +// back to the row, to the enclosing object (awaiting the next Field), or to +// the next element of the enclosing list. +func (w *VariantColumnWriter) valueDone() { + w.cur = nil + if n := len(w.frames); n > 0 { + f := &w.frames[n-1] + if f.isList { + f.elems++ + w.cur = f.node.typed.element + w.curLevels = f.levels + w.curLevels.rep = byte(f.levels.baseRep + f.node.typed.element.repDepth) + } + } +} + +// forward reports whether events must stream into an active residual. +func (w *VariantColumnWriter) forward() bool { + return w.err == nil && w.residual.b != nil +} + +// checkResidual surfaces an error the residual builder recorded from a +// forwarded event (misuse of the event sequence, an oversized value) as the +// writer's error, so it is reported at the offending event rather than when +// the residual is committed. It reports whether the residual is healthy. +func (w *VariantColumnWriter) checkResidual() bool { + if err := w.residual.b.Err(); err != nil { + if w.err == nil { + w.err = err + } + return false + } + return true +} + +// residualDone finalizes a completed residual stream. +func (w *VariantColumnWriter) residualDone() { + r := w.residual + w.residual = variantResidualState{} + if r.base > 0 { + // A residual field of a partial object completed; the partial + // object builder stays open in its frame. + return + } + data, err := r.b.Bytes() + if err != nil { + w.err = err + return + } + w.writeResidualBytes(r.node, r.levels, data) + if w.err != nil { + return + } + w.valueDone() +} + +func (w *VariantColumnWriter) afterResidualScalar() { + if !w.checkResidual() { + return + } + if w.residual.depth == w.residual.base { + w.residualDone() + } +} + +// scalar shreds one scalar value at the current position: into typed_value +// on an exact type match, into the value column as variant binary otherwise. +func (w *VariantColumnWriter) scalar(v variant.Value) { + if w.err != nil { + return + } + node := w.cur + if node == nil { + w.fail("unexpected value event") + return + } + l := w.curLevels + if t := node.typed; t != nil && t.kind == shreddedTypedPrimitive { + if pv, ok := variantToParquetValue(v, t.typ); ok { + w.writeTyped(t.startCol, pv, l.def(t.defLevel), l.rep) + if node.valueCol >= 0 { + w.leaf(node.valueCol).writeNull(w.levels(l.def(node.defLevel), l.rep)) + } + w.valueDone() + return + } + } + b := w.builder(node) + v.Write(b) + data, err := b.Bytes() + if err != nil { + w.err = err + return + } + w.writeResidualBytes(node, l, data) + if w.err != nil { + return + } + if node.typed != nil { + w.writeNulls(node.typed.startCol, node.typed.startCol+node.typed.numCols, l.def(node.defLevel), l.rep) + } + w.valueDone() +} + +// startResidual begins streaming a container that does not match the +// shredded type into the node's residual builder, nulling the typed columns. +func (w *VariantColumnWriter) startResidual(node *shreddedVariantGroup, l shredLevels) *variant.Builder { + if node.typed != nil { + w.writeNulls(node.typed.startCol, node.typed.startCol+node.typed.numCols, l.def(node.defLevel), l.rep) + } + b := w.builder(node) + w.residual = variantResidualState{b: b, node: node, levels: l} + return b +} + +// BeginObject starts an object value at the current position. If the +// position is shredded as an object, its fields shred individually; any +// other shredded type is a conflict and the whole object streams into the +// position's value column. +func (w *VariantColumnWriter) BeginObject() { + if w.forward() { + w.residual.b.BeginObject() + w.residual.depth++ + w.checkResidual() + return + } + if w.err != nil { + return + } + node := w.cur + if node == nil { + w.fail("unexpected BeginObject event") + return + } + l := w.curLevels + if t := node.typed; t != nil && t.kind == shreddedTypedObject { + w.pushFrame(node, false, l) + w.cur = nil + return + } + b := w.startResidual(node, l) + b.BeginObject() + w.residual.depth = 1 + w.cur = nil +} + +// Field names the next value written as a field of the innermost open +// object. Values of shredded fields go to the field's columns; others +// stream into the object's partial residual. +func (w *VariantColumnWriter) Field(name string) { + if w.forward() { + w.residual.b.Field(name) + w.checkResidual() + return + } + f := w.fieldFrame(name) + if f == nil { + return + } + // VariantShredding.md requires all field names, shredded or not, to be + // present in the metadata dictionary. + w.meta.Add(name) + idx, ok := f.node.typed.index[name] + if !ok { + idx = -1 + } + w.beginField(f, name, idx) +} + +// VariantFieldRef is a pre-resolved object field name for FieldByRef: a ref +// caches its resolution (shredded position and metadata intern) against the +// last writer and object it was used with, so hot ingest loops writing the +// same fields on every row skip the per-event name hashing of Field. The +// cache re-resolves whenever the writer or object position changes, but +// FieldByRef mutates it, so a ref must not be used by multiple goroutines +// concurrently — for concurrency and peak performance use one ref per +// writer per field. +type VariantFieldRef struct { + name string + node *shreddedVariantGroup // object node the ref last resolved against + idx int // field index in node, -1 when not shredded + metaFor *VariantColumnWriter // writer whose dictionary holds the cached intern + metaGen uint64 // dictionary generation of the cached intern +} + +// NewVariantFieldRef pre-resolves an object field name for use with +// VariantColumnWriter.FieldByRef. The name is copied; the caller may reuse +// its backing memory. The ref is not bound to any writer: resolution is +// cached lazily by FieldByRef. +func NewVariantFieldRef(name string) *VariantFieldRef { + return &VariantFieldRef{name: strings.Clone(name)} +} + +// FieldByRef is Field with a pre-resolved name; see NewVariantFieldRef. +func (w *VariantColumnWriter) FieldByRef(ref *VariantFieldRef) { + if w.forward() { + w.residual.b.Field(ref.name) + w.checkResidual() + return + } + f := w.fieldFrame(ref.name) + if f == nil { + return + } + if ref.metaFor != w || ref.metaGen != w.metaGen { + w.meta.Add(ref.name) + ref.metaFor = w + ref.metaGen = w.metaGen + } + if ref.node != f.node { + ref.node = f.node + if i, ok := f.node.typed.index[ref.name]; ok { + ref.idx = i + } else { + ref.idx = -1 + } + } + w.beginField(f, ref.name, ref.idx) +} + +// fieldFrame validates that a field event is legal here and returns the +// innermost open object frame, or nil after recording the error. +func (w *VariantColumnWriter) fieldFrame(name string) *variantWriterFrame { + if w.err != nil { + return nil + } + n := len(w.frames) + if n == 0 || w.frames[n-1].isList { + w.fail("Field %q outside of an object", name) + return nil + } + if w.cur != nil { + w.fail("Field %q: previous field has no value", name) + return nil + } + return &w.frames[n-1] +} + +// beginField positions the writer at shredded field idx of the open object +// frame, or at the partial-object residual when idx is -1. +func (w *VariantColumnWriter) beginField(f *variantWriterFrame, name string, idx int) { + if idx >= 0 { + if f.seen[idx] { + w.fail("duplicate object field %q", name) + return + } + f.seen[idx] = true + w.cur = f.node.typed.fields[idx].group + w.curLevels = f.levels + return + } + // Not a shredded field: it goes into the partial-object residual. + if f.node.valueCol < 0 { + w.fail("object field %q is not in the shredded schema and the object has no value column to hold it", name) + return + } + if f.partial == nil { + f.partial = w.builder(f.node) + f.partial.BeginObject() + } + f.partial.Field(name) + w.residual = variantResidualState{b: f.partial, node: f.node, levels: f.levels, depth: 1, base: 1} +} + +// EndObject closes the innermost open object, recording shredded fields +// that received no value as missing and committing the partial residual, if +// any, to the object's value column. +func (w *VariantColumnWriter) EndObject() { + if w.forward() { + if w.residual.depth == w.residual.base { + // Only reachable in a partial-object residual, right after a + // Field: the event tries to close the enclosing shredded + // object while the field's value is still pending. Fail here + // rather than corrupting the residual's depth tracking. + w.fail("EndObject: last field has no value") + return + } + w.residual.b.EndObject() + w.residual.depth-- + if w.checkResidual() && w.residual.depth == w.residual.base { + w.residualDone() + } + return + } + if w.err != nil { + return + } + n := len(w.frames) + if n == 0 || w.frames[n-1].isList { + w.fail("EndObject without matching BeginObject") + return + } + f := &w.frames[n-1] + if w.cur != nil { + w.fail("EndObject: last field has no value") + return + } + node, l := f.node, f.levels + for i := range node.typed.fields { + if !f.seen[i] { + w.writeMissing(node.typed.fields[i].group, l) + } + } + if f.partial != nil { + f.partial.EndObject() + data, err := f.partial.Bytes() + if err != nil { + w.err = err + return + } + w.writeResidualBytes(node, l, data) + } else if node.valueCol >= 0 { + w.leaf(node.valueCol).writeNull(w.levels(l.def(node.defLevel), l.rep)) + } + w.frames = w.frames[:n-1] + w.valueDone() +} + +// BeginArray starts an array value at the current position. If the position +// is shredded as a list, every value until the matching EndArray shreds as +// one element; any other shredded type is a conflict and the whole array +// streams into the position's value column. +func (w *VariantColumnWriter) BeginArray() { + if w.forward() { + w.residual.b.BeginArray() + w.residual.depth++ + w.checkResidual() + return + } + if w.err != nil { + return + } + node := w.cur + if node == nil { + w.fail("unexpected BeginArray event") + return + } + l := w.curLevels + if t := node.typed; t != nil && t.kind == shreddedTypedList { + w.pushFrame(node, true, l) + // The first element carries the enclosing occurrence's repetition + // level; valueDone switches to the element repetition level for + // subsequent elements. + w.cur = t.element + w.curLevels = l + return + } + b := w.startResidual(node, l) + b.BeginArray() + w.residual.depth = 1 + w.cur = nil +} + +// EndArray closes the innermost open array. +func (w *VariantColumnWriter) EndArray() { + if w.forward() { + if w.residual.depth == w.residual.base { + // See the matching guard in EndObject; here the enclosing + // container is an object, so the array being closed was never + // opened. + w.fail("EndArray without matching BeginArray") + return + } + w.residual.b.EndArray() + w.residual.depth-- + if w.checkResidual() && w.residual.depth == w.residual.base { + w.residualDone() + } + return + } + if w.err != nil { + return + } + n := len(w.frames) + if n == 0 || !w.frames[n-1].isList { + w.fail("EndArray without matching BeginArray") + return + } + f := &w.frames[n-1] + node, l := f.node, f.levels + if f.elems == 0 { + // typed_value present but the list is empty: every leaf records + // the list's definition level. + t := node.typed + w.writeNulls(t.startCol, t.startCol+t.numCols, l.def(t.defLevel), l.rep) + } + if node.valueCol >= 0 { + w.leaf(node.valueCol).writeNull(w.levels(l.def(node.defLevel), l.rep)) + } + w.frames = w.frames[:n-1] + w.valueDone() +} + +func (w *VariantColumnWriter) pushFrame(node *shreddedVariantGroup, isList bool, l shredLevels) { + if len(w.frames) < cap(w.frames) { + w.frames = w.frames[:len(w.frames)+1] + } else { + w.frames = append(w.frames, variantWriterFrame{}) + } + f := &w.frames[len(w.frames)-1] + f.node = node + f.isList = isList + f.levels = l + f.partial = nil + f.elems = 0 + if !isList { + numFields := len(node.typed.fields) + if cap(f.seen) < numFields { + f.seen = make([]bool, numFields) + } else { + f.seen = f.seen[:numFields] + clear(f.seen) + } + } +} + +// scalarEvent handles one scalar event: forwarded into an active residual +// stream, or shredded at the current position. +func (w *VariantColumnWriter) scalarEvent(v variant.Value) { + if w.forward() { + v.Write(w.residual.b) + w.afterResidualScalar() + return + } + w.scalar(v) +} + +// The scalar event methods below write one scalar value at the current +// position: the row's value, the current object field, or the next array +// element. A scalar matching the position's shredded type goes to its +// typed_value column; any other scalar encodes into the value column. + +// Null writes the variant null value (distinct from a missing field and +// from a SQL null row; see WriteNullRow). Variant null never matches a +// shredded type: it encodes into the position's value column, or fails the +// row when the position is shredded without one. +func (w *VariantColumnWriter) Null() { w.scalarEvent(variant.Null()) } +func (w *VariantColumnWriter) Bool(v bool) { w.scalarEvent(variant.Bool(v)) } +func (w *VariantColumnWriter) Int8(v int8) { w.scalarEvent(variant.Int8(v)) } +func (w *VariantColumnWriter) Int16(v int16) { w.scalarEvent(variant.Int16(v)) } +func (w *VariantColumnWriter) Int32(v int32) { w.scalarEvent(variant.Int32(v)) } +func (w *VariantColumnWriter) Int64(v int64) { w.scalarEvent(variant.Int64(v)) } +func (w *VariantColumnWriter) Float(v float32) { w.scalarEvent(variant.Float(v)) } +func (w *VariantColumnWriter) Double(v float64) { w.scalarEvent(variant.Double(v)) } +func (w *VariantColumnWriter) String(v string) { w.scalarEvent(variant.String(v)) } +func (w *VariantColumnWriter) Binary(v []byte) { w.scalarEvent(variant.Binary(v)) } +func (w *VariantColumnWriter) Date(days int32) { w.scalarEvent(variant.Date(days)) } +func (w *VariantColumnWriter) Time(micros int64) { w.scalarEvent(variant.Time(micros)) } +func (w *VariantColumnWriter) UUID(v uuid.UUID) { w.scalarEvent(variant.UUID(v)) } +func (w *VariantColumnWriter) Timestamp(us int64) { w.scalarEvent(variant.Timestamp(us)) } +func (w *VariantColumnWriter) TimestampNTZ(us int64) { + w.scalarEvent(variant.TimestampNTZ(us)) +} +func (w *VariantColumnWriter) TimestampNanos(ns int64) { + w.scalarEvent(variant.TimestampNanos(ns)) +} +func (w *VariantColumnWriter) TimestampNTZNanos(ns int64) { + w.scalarEvent(variant.TimestampNTZNanos(ns)) +} +func (w *VariantColumnWriter) Decimal4(unscaled int32, scale byte) { + w.scalarEvent(variant.Decimal4(unscaled, scale)) +} +func (w *VariantColumnWriter) Decimal8(unscaled int64, scale byte) { + w.scalarEvent(variant.Decimal8(unscaled, scale)) +} +func (w *VariantColumnWriter) Decimal16(unscaled [16]byte, scale byte) { + w.scalarEvent(variant.Decimal16(unscaled, scale)) +} + +var _ variant.ValueBuilder = (*VariantColumnWriter)(nil) diff --git a/vendor/github.com/parquet-go/parquet-go/variant_shredded_read.go b/vendor/github.com/parquet-go/parquet-go/variant_shredded_read.go new file mode 100644 index 00000000000..98e32672c1c --- /dev/null +++ b/vendor/github.com/parquet-go/parquet-go/variant_shredded_read.go @@ -0,0 +1,562 @@ +package parquet + +import ( + "fmt" + "slices" + + "github.com/google/uuid" + "github.com/parquet-go/parquet-go/format" + "github.com/parquet-go/parquet-go/variant" +) + +// This file implements the construct_variant reconstruction algorithm from +// the Variant Shredding specification: +// https://github.com/apache/parquet-format/blob/master/VariantShredding.md +// +// Reconstruction is not optional — VariantShredding.md: "When typed_value is +// present, readers must reconstruct shredded values according to this +// specification." +// +// A shredded variant group has the shape: +// +// optional group v (VARIANT) { +// required binary metadata; +// optional binary value; +// optional typed_value; // primitive, LIST, or object group +// } +// +// where object typed_value groups contain one required group per shredded +// field, each with its own optional value/typed_value pair, and LIST +// typed_value groups contain a repeated list of elements with the same +// value/typed_value pair. Reconstruction walks the leaf columns of the +// variant subtree and rebuilds the variant value for each row. + +// shreddedVariantGroup describes one (value, typed_value) pair in a shredded +// variant schema: the top-level variant group, an object field group, or a +// list element group. Column indices are relative to the variant group's +// first leaf column; definition levels are relative to the definition level +// at which the variant group itself is present. +type shreddedVariantGroup struct { + metadataCol int // metadata leaf column, or -1 (top-level group only) + valueCol int // value leaf column, or -1 + typed *shreddedTypedValue + startCol int + numCols int + defLevel int // relative definition level at which this group exists + repDepth int // repetition depth added within the variant subtree +} + +type shreddedTypedKind int + +const ( + shreddedTypedPrimitive shreddedTypedKind = iota + shreddedTypedList + shreddedTypedObject +) + +// shreddedTypedValue describes the typed_value part of a shredded variant +// group. +type shreddedTypedValue struct { + kind shreddedTypedKind + startCol int + numCols int + defLevel int // relative definition level at which typed_value is present + + typ Type // primitive + element *shreddedVariantGroup // list + fields []shreddedVariantField // object + index map[string]int // object: field name to position in fields +} + +type shreddedVariantField struct { + name string + group *shreddedVariantGroup +} + +// fieldByName returns the shredded field with the given name, or nil. +func (t *shreddedTypedValue) fieldByName(name string) *shreddedVariantGroup { + if i, ok := t.index[name]; ok { + return t.fields[i].group + } + return nil +} + +// buildShreddedVariantGroup builds the reconstruction tree for a variant +// group node. defLevel is the relative definition level at which the group +// exists (0 for the top-level variant group), repDepth the repetition depth +// added within the variant subtree. +func buildShreddedVariantGroup(node Node, startCol, defLevel, repDepth int) (*shreddedVariantGroup, error) { + g := &shreddedVariantGroup{ + metadataCol: -1, + valueCol: -1, + startCol: startCol, + defLevel: defLevel, + repDepth: repDepth, + } + col := startCol + for _, f := range node.Fields() { + switch f.Name() { + case "metadata": + // Every schema in VariantShredding.md declares + // "required binary metadata;" — a row cannot lack a dictionary. + if !f.Leaf() || f.Type().Kind() != ByteArray || f.Optional() || f.Repeated() { + return nil, fmt.Errorf("variant: metadata field must be a required binary leaf") + } + g.metadataCol = col + col++ + case "value": + if !f.Leaf() || f.Type().Kind() != ByteArray { + return nil, fmt.Errorf("variant: value field must be a binary leaf") + } + // VariantShredding.md: "Both value and typed_value are optional + // fields". The reconstruction's level arithmetic relies on the + // value column contributing one definition level. + if !f.Optional() { + return nil, fmt.Errorf("variant: value field of a shredded variant group must be optional") + } + g.valueCol = col + col++ + case "typed_value": + typed, err := buildShreddedTypedValue(f, col, defLevel+1, repDepth) + if err != nil { + return nil, err + } + g.typed = typed + col += typed.numCols + default: + return nil, fmt.Errorf("variant: unexpected field %q in shredded variant group", f.Name()) + } + } + g.numCols = col - startCol + if g.valueCol < 0 && g.typed == nil { + return nil, fmt.Errorf("variant: shredded variant group has neither value nor typed_value") + } + return g, nil +} + +// buildShreddedTypedValue builds the reconstruction tree for a typed_value +// field. defLevel is the relative definition level at which typed_value is +// present (its parent group's level + 1, since typed_value is optional). +func buildShreddedTypedValue(node Node, startCol, defLevel, repDepth int) (*shreddedTypedValue, error) { + if !node.Optional() { + return nil, fmt.Errorf("variant: typed_value must be optional") + } + t := &shreddedTypedValue{ + startCol: startCol, + defLevel: defLevel, + } + switch { + case node.Leaf(): + t.kind = shreddedTypedPrimitive + t.typ = node.Type() + t.numCols = 1 + if err := validateShreddedPrimitiveType(t.typ); err != nil { + return nil, err + } + + case isList(node): + t.kind = shreddedTypedList + elem := listElementOf(node) + elemDef := defLevel + 1 // the repeated list group adds one level + if elem.Optional() { + // The spec requires list elements to be required groups, but + // tolerate optional elements by accounting for the extra level. + elemDef++ + } + element, err := buildShreddedVariantGroup(elem, startCol, elemDef, repDepth+1) + if err != nil { + return nil, fmt.Errorf("variant: list element: %w", err) + } + if element.metadataCol >= 0 { + return nil, fmt.Errorf("variant: list element must not contain metadata") + } + t.element = element + t.numCols = element.numCols + + default: + t.kind = shreddedTypedObject + col := startCol + for _, f := range node.Fields() { + if f.Leaf() { + return nil, fmt.Errorf("variant: object field %q must be a group", f.Name()) + } + if f.Repeated() { + return nil, fmt.Errorf("variant: object field %q must not be repeated", f.Name()) + } + // The spec requires field groups to be required, but tolerate + // optional groups (a null group reads as a missing field). + fieldDef := defLevel + if f.Optional() { + fieldDef++ + } + group, err := buildShreddedVariantGroup(f, col, fieldDef, repDepth) + if err != nil { + return nil, fmt.Errorf("variant: object field %q: %w", f.Name(), err) + } + if group.metadataCol >= 0 { + return nil, fmt.Errorf("variant: object field %q must not contain metadata", f.Name()) + } + t.fields = append(t.fields, shreddedVariantField{name: f.Name(), group: group}) + col += group.numCols + } + if len(t.fields) == 0 { + // An empty object group has no columns to carry its own + // presence, so it cannot be reconstructed. + return nil, fmt.Errorf("variant: object typed_value group must have at least one field") + } + // Object field events resolve names against this map; a linear + // scan makes wide shredded objects quadratic per row (measurably + // dominant from a few dozen fields up). + t.index = make(map[string]int, len(t.fields)) + for i := range t.fields { + t.index[t.fields[i].name] = i + } + t.numCols = col - startCol + } + return t, nil +} + +// variantColumnReader reads values from the leaf columns of a variant +// subtree, tracking a cursor per column. The column slices contain the +// values belonging to a single occurrence of the variant group. +type variantColumnReader struct { + columns [][]Value + pos []int +} + +func (r *variantColumnReader) peek(col int) (Value, bool) { + if col >= len(r.columns) || r.pos[col] >= len(r.columns[col]) { + return Value{}, false + } + return r.columns[col][r.pos[col]], true +} + +func (r *variantColumnReader) next(col int) (Value, bool) { + v, ok := r.peek(col) + if ok { + r.pos[col]++ + } + return v, ok +} + +// read reconstructs the variant value for one occurrence of the group. It +// consumes exactly one value from every leaf column of the group's subtree +// (more beneath repeated lists). baseDef and baseRep are the definition +// level and repetition depth of the variant group in the enclosing schema. +// +// The boolean result reports whether the value is present; a false result +// means both value and typed_value were null, which the spec defines as a +// missing object field (and is invalid elsewhere; callers decide). +func (g *shreddedVariantGroup) read(r *variantColumnReader, m variant.Metadata, baseDef, baseRep int) (variant.Value, bool, error) { + var valueBytes []byte + valuePresent := false + if g.valueCol >= 0 { + v, ok := r.next(g.valueCol) + if ok && !v.IsNull() && int(v.definitionLevel) >= baseDef+g.defLevel+1 { + valuePresent = true + valueBytes = v.ByteArray() + } + } + + if g.typed == nil { + if !valuePresent { + return variant.Null(), false, nil + } + val, err := variant.Decode(m, valueBytes) + if err != nil { + return variant.Null(), false, fmt.Errorf("variant: decoding value: %w", err) + } + return val, true, nil + } + + // For primitives and arrays, value and typed_value are mutually + // exclusive. VariantShredding.md: "Unless the value is shredded as an + // object (see Objects), typed_value or value (but not both) must be + // non-null." + switch g.typed.kind { + case shreddedTypedPrimitive: + v, ok := r.next(g.typed.startCol) + typedPresent := ok && !v.IsNull() && int(v.definitionLevel) >= baseDef+g.typed.defLevel + if typedPresent { + if valuePresent { + return variant.Null(), false, fmt.Errorf("variant: value and primitive typed_value are both non-null") + } + val, err := parquetToVariantValue(v, g.typed.typ) + if err != nil { + return variant.Null(), false, err + } + return val, true, nil + } + + case shreddedTypedList: + arr, listPresent, err := g.typed.readList(r, m, baseDef, baseRep) + if err != nil { + return variant.Null(), false, err + } + if listPresent { + if valuePresent { + return variant.Null(), false, fmt.Errorf("variant: value and array typed_value are both non-null") + } + return arr, true, nil + } + + case shreddedTypedObject: + obj, objPresent, err := g.typed.readObject(r, m, baseDef, baseRep) + if err != nil { + return variant.Null(), false, err + } + if objPresent { + if !valuePresent { + return obj, true, nil + } + // Partially shredded object: the residual value must be an + // object. VariantShredding.md: "The value column of a + // partially shredded object must never contain fields + // represented by the Parquet columns in typed_value (shredded + // fields). Readers may always assume that data is written + // correctly" — so if a writer repeats a shredded name anyway, + // readers use the shredded field and ignore the residual copy + // (matching parquet-java). + residual, err := variant.Decode(m, valueBytes) + if err != nil { + return variant.Null(), false, fmt.Errorf("variant: decoding partial object value: %w", err) + } + if residual.Basic() != variant.BasicObject { + return variant.Null(), false, fmt.Errorf("variant: object typed_value with non-object value") + } + fields := slices.Clone(obj.ObjectValue().Fields) + for _, f := range residual.ObjectValue().Fields { + if g.typed.fieldByName(f.Name) != nil { + continue + } + fields = append(fields, f) + } + return variant.MakeObject(fields), true, nil + } + } + + // typed_value is null: fall back to the value column. + if !valuePresent { + return variant.Null(), false, nil + } + val, err := variant.Decode(m, valueBytes) + if err != nil { + return variant.Null(), false, fmt.Errorf("variant: decoding value: %w", err) + } + return val, true, nil +} + +// readList reconstructs a shredded array. The boolean result reports whether +// the typed_value list was present (a present empty list yields an empty +// array). +func (t *shreddedTypedValue) readList(r *variantColumnReader, m variant.Metadata, baseDef, baseRep int) (variant.Value, bool, error) { + first, ok := r.peek(t.startCol) + listPresent := ok && int(first.definitionLevel) >= baseDef+t.defLevel + // The repeated list group adds one definition level when the list has at + // least one element (independent of the element group's own levels). + hasElements := ok && int(first.definitionLevel) >= baseDef+t.defLevel+1 + + if !hasElements { + // Null or empty list: one (null) value per leaf column to consume. + for col := t.startCol; col < t.startCol+t.numCols; col++ { + r.next(col) + } + if listPresent { + return variant.MakeArray(nil), true, nil + } + return variant.Null(), false, nil + } + + elemRep := baseRep + t.element.repDepth + var elements []variant.Value + for { + elem, present, err := t.element.read(r, m, baseDef, baseRep) + if err != nil { + return variant.Null(), false, err + } + if !present { + // Elements with both value and typed_value null are invalid + // per the spec; read them as variant null (matching + // parquet-java's behavior). + elem = variant.Null() + } + elements = append(elements, elem) + + next, ok := r.peek(t.startCol) + if !ok || int(next.repetitionLevel) != elemRep { + break + } + } + return variant.MakeArray(elements), true, nil +} + +// readObject reconstructs the shredded fields of an object typed_value. The +// boolean result reports whether the typed_value group was present. Field +// groups are always consumed, even when the object is absent, because their +// leaf columns carry one (null) value per occurrence either way. +func (t *shreddedTypedValue) readObject(r *variantColumnReader, m variant.Metadata, baseDef, baseRep int) (variant.Value, bool, error) { + objPresent := false + if first, ok := r.peek(t.startCol); ok { + objPresent = int(first.definitionLevel) >= baseDef+t.defLevel + } + + fields := make([]variant.Field, 0, len(t.fields)) + for _, f := range t.fields { + val, present, err := f.group.read(r, m, baseDef, baseRep) + if err != nil { + return variant.Null(), false, fmt.Errorf("variant: object field %q: %w", f.name, err) + } + // A missing field (value and typed_value both null) is simply + // omitted from the reconstructed object. + if objPresent && present { + fields = append(fields, variant.Field{Name: f.name, Value: val}) + } + } + if !objPresent { + return variant.Null(), false, nil + } + return variant.MakeObject(fields), true, nil +} + +// validateShreddedPrimitiveType checks that a typed_value leaf type is one +// of the shredded types permitted by the Variant Shredding specification +// (e.g. unsigned integers and non-UUID fixed-length byte arrays are not). +func validateShreddedPrimitiveType(typ Type) error { + lt := typ.LogicalType() + switch value := logicalTypeValueOf(lt).(type) { + case nil: + switch typ.Kind() { + case Boolean, Int32, Int64, Float, Double, ByteArray: + return nil + } + case *format.StringType: + return nil + case *format.IntType: + if !value.IsSigned { + return fmt.Errorf("variant: unsupported shredded type %s (unsigned integer)", typ) + } + switch value.BitWidth { + case 8, 16, 32, 64: + return nil + } + case *format.DateType: + return nil + case *format.TimeType: + if _, ok := value.Unit.Value.(*format.MicroSeconds); ok { + return nil + } + case *format.TimestampType: + switch value.Unit.Value.(type) { + case *format.MicroSeconds, *format.NanoSeconds: + return nil + } + case *format.DecimalType: + switch typ.Kind() { + case Int32, Int64, FixedLenByteArray, ByteArray: + return nil + } + case *format.UUIDType: + return nil + } + return fmt.Errorf("variant: unsupported shredded type %s", typ) +} + +// parquetToVariantValue converts a parquet leaf value of a shredded +// typed_value column to the corresponding variant value, per the shredded +// types table of the Variant Shredding specification. +func parquetToVariantValue(v Value, typ Type) (variant.Value, error) { + lt := typ.LogicalType() + switch value := logicalTypeValueOf(lt).(type) { + case nil: + switch typ.Kind() { + case Boolean: + return variant.Bool(v.Boolean()), nil + case Int32: + return variant.Int32(v.Int32()), nil + case Int64: + return variant.Int64(v.Int64()), nil + case Float: + return variant.Float(v.Float()), nil + case Double: + return variant.Double(v.Double()), nil + case ByteArray: + return variant.Binary(copyBytes(v.ByteArray())), nil + } + + case *format.StringType: + return variant.String(string(v.ByteArray())), nil + + case *format.IntType: + switch value.BitWidth { + case 8: + return variant.Int8(int8(v.Int32())), nil + case 16: + return variant.Int16(int16(v.Int32())), nil + case 32: + return variant.Int32(v.Int32()), nil + case 64: + return variant.Int64(v.Int64()), nil + } + + case *format.DateType: + return variant.Date(v.Int32()), nil + + case *format.TimeType: + if _, ok := value.Unit.Value.(*format.MicroSeconds); ok { + return variant.Time(v.Int64()), nil + } + + case *format.TimestampType: + switch value.Unit.Value.(type) { + case *format.MicroSeconds: + if value.IsAdjustedToUTC { + return variant.Timestamp(v.Int64()), nil + } + return variant.TimestampNTZ(v.Int64()), nil + case *format.NanoSeconds: + if value.IsAdjustedToUTC { + return variant.TimestampNanos(v.Int64()), nil + } + return variant.TimestampNTZNanos(v.Int64()), nil + } + + case *format.DecimalType: + scale := uint8(value.Scale) + switch typ.Kind() { + case Int32: + return variant.Decimal4(v.Int32(), scale), nil + case Int64: + return variant.Decimal8(v.Int64(), scale), nil + case FixedLenByteArray, ByteArray: + b := v.ByteArray() + if len(b) > 16 { + return variant.Null(), fmt.Errorf("variant: decimal value wider than 16 bytes") + } + return variant.Decimal16(bigEndianToLittleEndian16(b), scale), nil + } + + case *format.UUIDType: + b := v.ByteArray() + if len(b) != 16 { + return variant.Null(), fmt.Errorf("variant: UUID value must be 16 bytes, got %d", len(b)) + } + return variant.UUID(uuid.UUID(b)), nil + } + return variant.Null(), fmt.Errorf("variant: unsupported shredded type %s", typ) +} + +// bigEndianToLittleEndian16 converts a big-endian two's complement integer +// of up to 16 bytes (parquet decimal representation) to the little-endian +// 16-byte representation used by variant decimal16. +func bigEndianToLittleEndian16(b []byte) [16]byte { + var out [16]byte + for i := range b { + out[i] = b[len(b)-1-i] + } + if len(b) > 0 && b[0]&0x80 != 0 { + for i := len(b); i < 16; i++ { + out[i] = 0xFF + } + } + return out +} diff --git a/vendor/github.com/parquet-go/parquet-go/variant_shredded_write.go b/vendor/github.com/parquet-go/parquet-go/variant_shredded_write.go new file mode 100644 index 00000000000..8909d8c1927 --- /dev/null +++ b/vendor/github.com/parquet-go/parquet-go/variant_shredded_write.go @@ -0,0 +1,367 @@ +package parquet + +import ( + "math/bits" + + "github.com/parquet-go/parquet-go/format" + "github.com/parquet-go/parquet-go/variant" +) + +// This file implements the spec-compliant shredded variant write path. It +// reuses the shreddedVariantGroup tree from variant_shredded_read.go for +// column layout and level bookkeeping, and writes values per the case tables +// of the Variant Shredding specification: +// +// - Values that exactly match the shredded type go into typed_value with a +// null value column. +// - Values that do not match are encoded as plain variant values into the +// value column (sharing the row's top-level metadata dictionary), with +// all typed_value columns null. +// - Objects shred field-wise: shredded fields go into the typed_value +// group (missing fields have both columns null), residual fields are +// encoded as an object into the value column. Shredded field names never +// appear in the value column. +// - Arrays shred element-wise through the 3-level LIST structure; variant +// null elements are encoded as variant null (0x00) in the element's +// value column. +// +// The row's metadata dictionary contains every object field name of the +// value, shredded or not, so residual values and reconstruction share one +// dictionary. VariantShredding.md: "All value columns within the Variant +// must use the same metadata. All field names of a Variant, whether shredded +// or not, must be present in the metadata." + +// addVariantFieldNames pre-registers all object field names of v in the +// metadata builder, so the row metadata covers shredded and unshredded +// fields alike. +func addVariantFieldNames(b *variant.MetadataBuilder, v variant.Value) { + switch v.Basic() { + case variant.BasicObject: + for _, f := range v.ObjectValue().Fields { + b.Add(f.Name) + addVariantFieldNames(b, f.Value) + } + case variant.BasicArray: + for _, e := range v.ArrayValue().Elements { + addVariantFieldNames(b, e) + } + } +} + +// shredLevels carries the absolute level context for one occurrence of a +// shredded variant group during writing. +type shredLevels struct { + baseDef int // definition level at which the variant group is present + baseRep int // repetition depth of the variant group + rep byte // repetition level for the first value of this occurrence +} + +func (l shredLevels) def(rel int) byte { return byte(l.baseDef + rel) } + +// appendShredded appends a leaf value with the given levels. +func appendShredded(columns [][]Value, colBase uint16, col int, v Value, def, rep byte) { + c := colBase + uint16(col) + v.definitionLevel = def + v.repetitionLevel = rep + v.columnIndex = ^c + columns[c] = append(columns[c], v) +} + +// appendShreddedNulls appends a null to every leaf column in [start, end) at +// the given levels. +func appendShreddedNulls(columns [][]Value, colBase uint16, start, end int, def, rep byte) { + for col := start; col < end; col++ { + appendShredded(columns, colBase, col, Value{}, def, rep) + } +} + +// write encodes one occurrence of the variant group. present=false writes a +// missing occurrence (both value and typed_value null), which is how absent +// object fields are represented. +func (g *shreddedVariantGroup) write(columns [][]Value, colBase uint16, b *variant.MetadataBuilder, v variant.Value, present bool, l shredLevels) { + if !present { + if g.valueCol >= 0 { + appendShredded(columns, colBase, g.valueCol, Value{}, l.def(g.defLevel), l.rep) + } + if g.typed != nil { + appendShreddedNulls(columns, colBase, g.typed.startCol, g.typed.startCol+g.typed.numCols, l.def(g.defLevel), l.rep) + } + return + } + + if g.typed == nil { + g.writeValueFallback(columns, colBase, b, v, l) + return + } + + switch g.typed.kind { + case shreddedTypedPrimitive: + if pv, ok := variantToParquetValue(v, g.typed.typ); ok { + appendShredded(columns, colBase, g.typed.startCol, pv, l.def(g.typed.defLevel), l.rep) + if g.valueCol >= 0 { + appendShredded(columns, colBase, g.valueCol, Value{}, l.def(g.defLevel), l.rep) + } + return + } + + case shreddedTypedList: + if v.Basic() == variant.BasicArray { + g.typed.writeList(columns, colBase, b, v, l) + if g.valueCol >= 0 { + appendShredded(columns, colBase, g.valueCol, Value{}, l.def(g.defLevel), l.rep) + } + return + } + + case shreddedTypedObject: + if v.Basic() == variant.BasicObject { + g.typed.writeObject(columns, colBase, b, v, g, l) + return + } + } + + // The value does not match the shredded type: write it to the value + // column and null out the typed columns. + g.writeValueFallback(columns, colBase, b, v, l) + appendShreddedNulls(columns, colBase, g.typed.startCol, g.typed.startCol+g.typed.numCols, l.def(g.defLevel), l.rep) +} + +// writeValueFallback encodes v as a plain variant value into the value +// column, sharing the row's metadata dictionary. +func (g *shreddedVariantGroup) writeValueFallback(columns [][]Value, colBase uint16, b *variant.MetadataBuilder, v variant.Value, l shredLevels) { + if g.valueCol < 0 { + panic("variant: value does not match the shredded type and the schema has no value column to fall back to") + } + encoded := variant.Encode(b, v) + pv := ByteArrayValue(encoded) + appendShredded(columns, colBase, g.valueCol, pv, l.def(g.defLevel)+1, l.rep) +} + +// writeList shreds an array value through the 3-level LIST structure. +func (t *shreddedTypedValue) writeList(columns [][]Value, colBase uint16, b *variant.MetadataBuilder, v variant.Value, l shredLevels) { + elements := v.ArrayValue().Elements + if len(elements) == 0 { + // typed_value present but the list is empty: every leaf records the + // list's definition level. + for col := t.startCol; col < t.startCol+t.numCols; col++ { + appendShredded(columns, colBase, col, Value{}, l.def(t.defLevel), l.rep) + } + return + } + elemRep := byte(l.baseRep + t.element.repDepth) + for i, elem := range elements { + el := l + if i > 0 { + el.rep = elemRep + } + // Variant null elements are written as variant null (0x00) in the + // element's value column, via the fallback path. + t.element.write(columns, colBase, b, elem, true, el) + } +} + +// writeObject shreds an object value: schema fields go into the typed_value +// group, residual fields into the value column as a variant object. +func (t *shreddedTypedValue) writeObject(columns [][]Value, colBase uint16, b *variant.MetadataBuilder, v variant.Value, g *shreddedVariantGroup, l shredLevels) { + objFields := v.ObjectValue().Fields + for _, f := range t.fields { + fv, ok := findVariantField(objFields, f.name) + f.group.write(columns, colBase, b, fv, ok, l) + } + + var residual []variant.Field + for _, f := range objFields { + if t.fieldByName(f.Name) == nil { + residual = append(residual, f) + } + } + if len(residual) > 0 { + g.writeValueFallback(columns, colBase, b, variant.MakeObject(residual), l) + } else if g.valueCol >= 0 { + appendShredded(columns, colBase, g.valueCol, Value{}, l.def(g.defLevel), l.rep) + } +} + +// findVariantField returns the value of the named field and whether it was +// found. Objects are typically small, so a linear scan beats building a map +// per row. +func findVariantField(fields []variant.Field, name string) (variant.Value, bool) { + for _, f := range fields { + if f.Name == name { + return f.Value, true + } + } + return variant.Value{}, false +} + +// isSignedIntOrNil reports whether lt is absent, or carries a signed INT +// annotation of the given bit width. A physical int column with no annotation +// is treated as a signed integer of its natural width. +func isSignedIntOrNil(lt *format.LogicalType, bitWidth int8) bool { + if lt == nil { + return true + } + it, ok := logicalTypeOf[*format.IntType](lt) + return ok && it.IsSigned && it.BitWidth == bitWidth +} + +// variantToParquetValue converts a variant value to a parquet value of the +// given shredded column type when the types match exactly (following +// parquet-java's strict matching semantics: no numeric widening or +// narrowing). The boolean result reports whether the types matched. +func variantToParquetValue(v variant.Value, typ Type) (Value, bool) { + if v.Basic() != variant.BasicPrimitive && v.Basic() != variant.BasicShortString { + return Value{}, false + } + lt := typ.LogicalType() + switch v.Type() { + case variant.PrimitiveTrue, variant.PrimitiveFalse: + if lt == nil && typ.Kind() == Boolean { + return BooleanValue(v.BoolValue()), true + } + case variant.PrimitiveInt8: + if it, ok := logicalTypeOf[*format.IntType](lt); ok && it.IsSigned && it.BitWidth == 8 { + return Int32Value(int32(v.Int())), true + } + case variant.PrimitiveInt16: + if it, ok := logicalTypeOf[*format.IntType](lt); ok && it.IsSigned && it.BitWidth == 16 { + return Int32Value(int32(v.Int())), true + } + case variant.PrimitiveInt32: + if typ.Kind() == Int32 && isSignedIntOrNil(lt, 32) { + return Int32Value(int32(v.Int())), true + } + case variant.PrimitiveInt64: + if typ.Kind() == Int64 && isSignedIntOrNil(lt, 64) { + return Int64Value(v.Int()), true + } + case variant.PrimitiveFloat: + if lt == nil && typ.Kind() == Float { + return FloatValue(float32(v.FloatValue())), true + } + case variant.PrimitiveDouble: + if lt == nil && typ.Kind() == Double { + return DoubleValue(v.FloatValue()), true + } + case variant.PrimitiveString: + if logicalTypeIs[*format.StringType](lt) { + // Viewing the immutable string data in place avoids an + // allocation per string. Callers either copy the value into + // column buffers or expose it as a read-only parquet.Value + // (the deconstruct path), matching the library's aliasing + // semantics for byte array values. + return ByteArrayValue(unsafeByteArrayFromString(v.Str())), true + } + case variant.PrimitiveBinary: + if lt == nil && typ.Kind() == ByteArray { + return ByteArrayValue(v.Bytes()), true + } + case variant.PrimitiveDate: + if logicalTypeIs[*format.DateType](lt) { + return Int32Value(int32(v.Int())), true + } + case variant.PrimitiveTime: + if tt, ok := logicalTypeOf[*format.TimeType](lt); ok && isMicros(tt.Unit) { + return Int64Value(v.Int()), true + } + case variant.PrimitiveTimestamp: + if ts, ok := logicalTypeOf[*format.TimestampType](lt); ok && isMicros(ts.Unit) && ts.IsAdjustedToUTC { + return Int64Value(v.Int()), true + } + case variant.PrimitiveTimestampNTZ: + if ts, ok := logicalTypeOf[*format.TimestampType](lt); ok && isMicros(ts.Unit) && !ts.IsAdjustedToUTC { + return Int64Value(v.Int()), true + } + case variant.PrimitiveTimestampNanos: + if ts, ok := logicalTypeOf[*format.TimestampType](lt); ok && isNanos(ts.Unit) && ts.IsAdjustedToUTC { + return Int64Value(v.Int()), true + } + case variant.PrimitiveTimestampNTZNanos: + if ts, ok := logicalTypeOf[*format.TimestampType](lt); ok && isNanos(ts.Unit) && !ts.IsAdjustedToUTC { + return Int64Value(v.Int()), true + } + case variant.PrimitiveDecimal4: + if d, ok := logicalTypeOf[*format.DecimalType](lt); ok && typ.Kind() == Int32 && d.Scale == int32(v.Scale()) && + decimal64FitsPrecision(v.Int(), d.Precision) { + return Int32Value(int32(v.Int())), true + } + case variant.PrimitiveDecimal8: + if d, ok := logicalTypeOf[*format.DecimalType](lt); ok && typ.Kind() == Int64 && d.Scale == int32(v.Scale()) && + decimal64FitsPrecision(v.Int(), d.Precision) { + return Int64Value(v.Int()), true + } + case variant.PrimitiveDecimal16: + if dec, ok := logicalTypeOf[*format.DecimalType](lt); ok && dec.Scale == int32(v.Scale()) && + (typ.Kind() == ByteArray || (typ.Kind() == FixedLenByteArray && typ.Length() == 16)) && + decimal128FitsPrecision(v.Decimal16Value(), dec.Precision) { + d := v.Decimal16Value() + be := littleEndianToBigEndian16(d) + if typ.Kind() == ByteArray { + return ByteArrayValue(be[:]), true + } + return FixedLenByteArrayValue(be[:]), true + } + case variant.PrimitiveUUID: + if logicalTypeIs[*format.UUIDType](lt) { + u := v.UUIDValue() + return FixedLenByteArrayValue(u[:]), true + } + } + return Value{}, false +} + +// littleEndianToBigEndian16 converts the little-endian 16-byte decimal +// representation used by variant to parquet's big-endian representation. +func littleEndianToBigEndian16(b [16]byte) [16]byte { + var out [16]byte + for i := range b { + out[i] = b[15-i] + } + return out +} + +// decimal64FitsPrecision reports whether an unscaled decimal value fits in +// a DECIMAL(P, S) column, i.e. has at most P decimal digits. A DECIMAL(P, S) +// column declares that bound to readers, so writing a wider value would +// corrupt it for engines that trust the declaration (DuckDB renders such a +// column as a different decimal type); the value must fall back to the +// value column instead. +func decimal64FitsPrecision(unscaled int64, precision int32) bool { + if precision >= 19 { + return true // int64 has at most 19 digits + } + bound := int64(1) + for range precision { + bound *= 10 + } + return unscaled > -bound && unscaled < bound +} + +// decimal128FitsPrecision is decimal64FitsPrecision for the little-endian +// 16-byte representation used by variant decimal16. +func decimal128FitsPrecision(le [16]byte, precision int32) bool { + if precision >= 39 { + return true // 128 bits hold at most 39 digits + } + neg := le[15]&0x80 != 0 + var hi, lo uint64 + for i := range 8 { + lo |= uint64(le[i]) << (8 * i) + hi |= uint64(le[8+i]) << (8 * i) + } + if neg { // two's complement negation to get the magnitude + lo = ^lo + 1 + hi = ^hi + if lo == 0 { + hi++ + } + } + // magnitude < 10^precision, computed in 128 bits + boundHi, boundLo := uint64(0), uint64(1) + for range precision { + var carry uint64 + carry, boundLo = bits.Mul64(boundLo, 10) + boundHi = boundHi*10 + carry + } + return hi < boundHi || (hi == boundHi && lo < boundLo) +} diff --git a/vendor/github.com/parquet-go/parquet-go/writer.go b/vendor/github.com/parquet-go/parquet-go/writer.go index 645346eb5f0..3ffcc1402fe 100644 --- a/vendor/github.com/parquet-go/parquet-go/writer.go +++ b/vendor/github.com/parquet-go/parquet-go/writer.go @@ -206,6 +206,19 @@ func makeWriteFunc[T any](t reflect.Type, writeRows writeRowsFunc) writeFunc[T] // These fields are usually lazily initialized when writing rows, // we need them to exist now tho. c.columnBuffer = c.newColumnBuffer() + // Record the original buffer so the dictionary-encoded buffer is + // restored when the row group is flushed after a fallback to PLAIN + // switched the column to a different buffer. + c.originalColumnBuffer = c.columnBuffer + w.columns[i] = c.columnBuffer + } + } else { + // The column buffers may have been replaced since the previous call: + // when a column's dictionary outgrows DictionaryMaxBytes its buffer is + // swapped for a PLAIN-encoded one (fallbackDictionaryToPlain), and + // flushing a row group restores the original buffer. Re-resolve the + // cached references so rows are not written into abandoned buffers. + for i, c := range w.base.writer.currentRowGroup.columns { w.columns[i] = c.columnBuffer } } @@ -543,10 +556,37 @@ func (w *Writer) WriteRowGroup(rowGroup RowGroup) (int64, error) { case !EqualNodes(w.schema, rowGroupSchema): return 0, ErrRowGroupSchemaMismatch } + // When the row group is the in-order concatenation of independently writable + // segments and at least one segment can be copied verbatim (e.g. a merge of + // non-overlapping row groups), write each segment as its own output row group + // so the copyable ones take the fast path. Row group sizing below + // MaxRowsPerRowGroup is an unspecified internal; data and order are preserved. + if segments, ok := w.splittableCopyableSegments(rowGroup); ok { + return w.writeSegmentsPacked(segments, rowGroup.Schema(), rowGroup.SortingColumns()) + } if err := w.writer.flush(); err != nil { return 0, err } - w.writer.currentRowGroup.configureBloomFilters(rowGroup.ColumnChunks()) + // Fast path: when the whole row group can be copied verbatim from a source + // file, splice the compressed bytes in directly instead of decoding and + // re-encoding every value (see writer_copy.go). + if srcs, ok := w.copyableColumnChunks(rowGroup); ok { + if err := w.loadCopiedChunks(srcs); err != nil { + return 0, err + } + return w.writer.writeRowGroup(w.writer.currentRowGroup, rowGroup.Schema(), rowGroup.SortingColumns()) + } + // L3 fast path: a file-backed source whose schema matches but cannot be + // copied verbatim (config differs) is re-encoded column-by-column, skipping + // the row assembly/deconstruction round-trip of the path below. + if cols, ok := w.reencodableRowGroup(rowGroup); ok { + w.writer.currentRowGroup.configureBloomFilters(rowGroup.ColumnChunks(), rowGroup.NumRows()) + if err := w.writeRowGroupByColumn(cols); err != nil { + return 0, err + } + return w.writer.writeRowGroup(w.writer.currentRowGroup, rowGroup.Schema(), rowGroup.SortingColumns()) + } + w.writer.currentRowGroup.configureBloomFilters(rowGroup.ColumnChunks(), rowGroup.NumRows()) rows := rowGroup.Rows() defer rows.Close() n, err := CopyRows(w.writer, rows) @@ -723,6 +763,17 @@ func newConcurrentRowGroupWriter(w *writer, config *WriterConfig) *ConcurrentRow } if isDictionaryEncoding(encoding) { + // The deprecated PLAIN_DICTIONARY encoding is normalized to + // RLE_DICTIONARY: the spec defines a single dictionary data + // page layout for both enum values — Encodings.md: "Data page + // format: the bit width used to encode the entry ids stored + // as 1 byte (max bit width = 32), followed by the values + // encoded using the RLE/Bit-Packing described above" — so the + // plain int32 index layout of plain.DictionaryEncoding + // produces pages no reader understands. Schemas derived from + // files written by legacy writers report PLAIN_DICTIONARY as + // the column encoding, which is how the configuration arises. + encoding = &RLEDictionary dictBuffer := columnType.NewValues(make([]byte, 0, defaultDictBufferSize), nil) dictionary = columnType.NewDictionary(columnIndex, 0, dictBuffer) columnType = dictionary.Type() @@ -754,7 +805,7 @@ func newConcurrentRowGroupWriter(w *writer, config *WriterConfig) *ConcurrentRow dictionaryMaxBytes: config.DictionaryMaxBytes, } - if lt := leaf.node.Type().LogicalType(); lt != nil && (lt.Geometry != nil || lt.Geography != nil) { + if lt := leaf.node.Type().LogicalType(); logicalTypeIs[*format.GeometryType](lt) || logicalTypeIs[*format.GeographyType](lt) { c.geospatialAccumulator = newGeospatialBBoxAccumulator() } @@ -834,11 +885,53 @@ func (rg *ConcurrentRowGroupWriter) reset() { } } -func (rg *ConcurrentRowGroupWriter) configureBloomFilters(columnChunks []ColumnChunk) { +func (rg *ConcurrentRowGroupWriter) configureBloomFilters(columnChunks []ColumnChunk, numRows int64) { for i, c := range rg.columns { - if c.columnFilter != nil { - c.resizeBloomFilter(columnChunks[i].NumValues()) + if c.columnFilter == nil { + continue } + // When the source only knows an upper bound of its value count + // (row-range views of repeated columns), leave the filter + // unallocated: flushFilterPages then builds it from the actual + // number of values written, keeping the filter exactly the size + // the configuration prescribes. + if !chunkNumValuesIsExact(columnChunks[i]) { + continue + } + values := columnChunks[i].NumValues() + if numRows > rg.maxRows { + // The input will be split across multiple output row groups, so the + // whole-input value count over-sizes each group's filter. + if c.maxRepetitionLevel > 0 { + // Repeated columns can hold more values than rows, so we can't + // apportion the value count per group ahead of time. Leave the + // filter unallocated and let each group size itself exactly at + // flush time (see flushFilterPages). + continue + } + // Non-repeated columns hold at most one value per row, so a full + // output group holds at most maxRows values. + values = min(values, rg.maxRows) + } + c.resizeBloomFilter(values) + } +} + +// chunkNumValuesIsExact reports whether chunk.NumValues() is the exact number +// of values, as opposed to an upper bound (see rangeColumnChunk). +func chunkNumValuesIsExact(chunk ColumnChunk) bool { + switch c := chunk.(type) { + case *rangeColumnChunk: + return c.exactNumValues() + case *multiColumnChunk: + for _, part := range c.chunks { + if !chunkNumValuesIsExact(part) { + return false + } + } + return true + default: + return true } } @@ -1031,10 +1124,10 @@ func newWriter(output io.Writer, config *WriterConfig) *writer { // column is of logical type decimal. logicalType := nodeType.LogicalType() if logicalType != nil { - elem.LogicalType.Set(*logicalType) - if logicalType.Decimal != nil { - elem.Scale.Set(logicalType.Decimal.Scale) - elem.Precision.Set(logicalType.Decimal.Precision) + elem.LogicalType = *logicalType + if decimal, ok := logicalType.Value.(*format.DecimalType); ok { + elem.Scale.Set(decimal.Scale) + elem.Precision.Set(decimal.Precision) } } @@ -1226,11 +1319,11 @@ func (w *writer) writeFileFooter() error { if w.encryption == nil { return nil } - switch { - case c.CryptoMetadata.EncryptionWithFooterKey != nil: + switch crypto := c.CryptoMetadata.Value.(type) { + case *format.EncryptionWithFooterKey: return w.encryption.cfg.FooterKey - case c.CryptoMetadata.EncryptionWithColumnKey != nil: - return w.encryption.columnKeyFor(columnPathString(c.CryptoMetadata.EncryptionWithColumnKey.PathInSchema)) + case *format.EncryptionWithColumnKey: + return w.encryption.columnKeyFor(columnPathString(crypto.PathInSchema)) default: return nil } @@ -1313,7 +1406,7 @@ func (w *writer) writeFileFooter() error { if w.encryption != nil { enc := w.encryption algo := format.EncryptionAlgorithm{ - AesGcmV1: &format.AesGcmV1{ + Value: &format.AesGcmV1{ AadFileUnique: enc.fileUnique, AadPrefix: enc.cfg.AadPrefix, }, @@ -1433,6 +1526,12 @@ func (w *writer) writeRowGroup(rg *ConcurrentRowGroupWriter, rowGroupSchema *Sch if err := c.Flush(); err != nil { return 0, err } + // Columns copied verbatim carry the source's bloom filter bytes (when + // configured); building a filter from the writer's (empty) buffers would + // produce a bogus one. + if c.copied != nil { + continue + } if err := c.flushFilterPages(); err != nil { return 0, err } @@ -1444,6 +1543,34 @@ func (w *writer) writeRowGroup(rg *ConcurrentRowGroupWriter, rowGroupSchema *Sch fileOffset := w.writer.offset for i, c := range rg.columns { + if c.copied != nil { + // Column copied verbatim: use the source's column index and size + // statistics, and stream the dictionary and data page bytes straight + // from the source file into the output (no intermediate buffer). + cc := c.copied + rg.columnIndex[i] = cc.columnIndex + c.columnChunk.MetaData.SizeStatistics = cc.sizeStats + + if cc.dictLength > 0 { + c.columnChunk.MetaData.DictionaryPageOffset = w.writer.offset + if _, err := w.writer.ReadFrom(io.NewSectionReader(cc.reader, cc.dictOffset, cc.dictLength)); err != nil { + return 0, fmt.Errorf("writing copied dictionary page of row group column %d: %w", i, err) + } + } + + dataPageOffset := w.writer.offset + c.columnChunk.MetaData.DataPageOffset = dataPageOffset + for j := range c.offsetIndex.PageLocations { + c.offsetIndex.PageLocations[j].Offset += dataPageOffset + } + if cc.dataLength > 0 { + if _, err := w.writer.ReadFrom(io.NewSectionReader(cc.reader, cc.dataOffset, cc.dataLength)); err != nil { + return 0, fmt.Errorf("writing copied data pages of row group column %d: %w", i, err) + } + } + continue + } + rg.columnIndex[i] = c.columnIndex.ColumnIndex() rg.columnIndex[i].RepetitionLevelHistogram = append(rg.columnIndex[i].RepetitionLevelHistogram[:0], c.pageRepetitionLevelHistograms...) rg.columnIndex[i].DefinitionLevelHistogram = append(rg.columnIndex[i].DefinitionLevelHistogram[:0], c.pageDefinitionLevelHistograms...) @@ -1483,6 +1610,41 @@ func (w *writer) writeRowGroup(rg *ConcurrentRowGroupWriter, rowGroupSchema *Sch } for i, c := range rg.columns { + // Columns copied verbatim carry the source's bloom filter as a raw byte + // range (header + bitset); stream it through unchanged. + if c.copied != nil && c.copied.bloomLength > 0 { + cc := c.copied + bloom := io.NewSectionReader(cc.reader, cc.bloomOffset, cc.bloomLength) + + if rg.config.DeferredBloomFiltersBuffers != nil { + buf := rg.config.DeferredBloomFiltersBuffers.GetBuffer() + reset := func() { rg.config.DeferredBloomFiltersBuffers.PutBuffer(buf) } + if _, err := io.Copy(buf, bloom); err != nil { + reset() + return 0, fmt.Errorf("copying bloom filter of row group column %d: %w", i, err) + } + if _, err := buf.Seek(0, io.SeekStart); err != nil { + reset() + return 0, err + } + w.deferredBloomFilterSize += cc.bloomLength + w.deferredBloomFilters = append(w.deferredBloomFilters, deferredBloomFilter{ + rowGroup: rowGroupIndex, + column: i, + buf: buf, + reset: reset, + }) + continue + } + + c.columnChunk.MetaData.BloomFilterOffset = w.writer.offset + if _, err := w.writer.ReadFrom(bloom); err != nil { + return 0, fmt.Errorf("copying bloom filter of row group column %d: %w", i, err) + } + c.columnChunk.MetaData.BloomFilterLength = int32(cc.bloomLength) + continue + } + if len(c.filter) == 0 { continue } @@ -1541,12 +1703,12 @@ func (w *writer) writeRowGroup(rg *ConcurrentRowGroupWriter, rowGroupSchema *Sch _, hasColumnKey := w.encryption.cfg.ColumnKeys[path] if !hasColumnKey { c.columnChunk.CryptoMetadata = format.ColumnCryptoMetaData{ - EncryptionWithFooterKey: &format.EncryptionWithFooterKey{}, + Value: &format.EncryptionWithFooterKey{}, } } else { c.columnChunk.CryptoMetadata = format.ColumnCryptoMetaData{ - EncryptionWithColumnKey: &format.EncryptionWithColumnKey{ - PathInSchema: c.columnPath, + Value: &format.EncryptionWithColumnKey{ + PathInSchema: thrift.Slice[string](c.columnPath), }, } } @@ -1639,7 +1801,7 @@ func (w *writer) writeRowGroup(rg *ConcurrentRowGroupWriter, rowGroupSchema *Sch } for i := range columns { c := &columns[i] - c.MetaData.EncodingStats = append(c.MetaData.EncodingStats[:0], rg.columnChunk[i].MetaData.EncodingStats...) + c.MetaData.EncodingStats = slices.Clone(rg.columnChunk[i].MetaData.EncodingStats) } for i := range offsetIndex { @@ -1839,6 +2001,10 @@ type ColumnWriter struct { hasSwitchedToPlain bool // Tracks if dictionary encoding was switched to PLAIN dictionaryMaxBytes int64 // Per-column dictionary size limit + // Set when this column is being copied verbatim from a source file for the + // current row group (see writer_copy.go). nil for the regular re-encode path. + copied *copiedChunk + // Encryption state; nil encKey means column is not encrypted. encKey []byte rowGroupOrdinal int16 @@ -1878,6 +2044,7 @@ func (c *ColumnWriter) reset() { c.pageBuffer = nil } c.numPages = 0 + c.copied = nil // Bloom filters may change in size between row groups, but we retain the // buffer to avoid reallocating large memory blocks. c.filter = c.filter[:0] diff --git a/vendor/github.com/parquet-go/parquet-go/writer_copy.go b/vendor/github.com/parquet-go/parquet-go/writer_copy.go new file mode 100644 index 00000000000..067e35c6a72 --- /dev/null +++ b/vendor/github.com/parquet-go/parquet-go/writer_copy.go @@ -0,0 +1,426 @@ +package parquet + +import ( + "fmt" + "io" + "slices" + "sync/atomic" + + "github.com/parquet-go/parquet-go/encoding/thrift" + "github.com/parquet-go/parquet-go/format" +) + +// copyPathCounter counts column chunks copied verbatim. It exists so tests can +// assert that the L0 fast path was taken; it is otherwise unused. +var copyPathCounter atomic.Int64 + +// disableWriteCopy forces WriteRowGroup onto the regular re-encode path. It +// exists only so benchmarks can measure the copy optimization against an +// otherwise identical baseline. +var disableWriteCopy bool + +// This file implements the "L0" copy optimization for Writer.WriteRowGroup: +// when a source row group's column chunks can be copied verbatim (compressed +// bytes moved through without decompression, decoding, re-encoding, or +// re-compression), the writer splices the source bytes directly into the output +// and copies the associated statistics and page index. +// +// The optimization is transparent: WriteRowGroup detects copyable sources and +// falls back to the regular re-encode path otherwise. It is conservative — it +// only fires when a verbatim copy is provably indistinguishable from the +// configured re-encode behavior (matching type, encoding, codec, data page +// version; no encryption; no writer-requested bloom filter; source statistics +// and page index present). See docs/merge-copy-optimization.md. +// +// Increment 1 is all-or-nothing per row group: every column chunk must be +// copyable, otherwise the whole row group falls back to the regular path. + +// copiedChunk holds the prebuilt metadata for a column chunk copied verbatim +// from a source file, plus the source byte ranges of its dictionary and data +// pages. The bytes are streamed directly from the source into the output during +// row group assembly (no intermediate buffer or per-chunk allocation). +type copiedChunk struct { + reader io.ReaderAt // source file reader + dictOffset int64 // byte offset of the dictionary page in the source + dictLength int64 // length of the dictionary page, 0 if none + dataOffset int64 // byte offset of the first data page in the source + dataLength int64 // length of all data pages + bloomOffset int64 // byte offset of the bloom filter in the source + bloomLength int64 // length of the bloom filter (header + bitset), 0 if not copied + columnIndex format.ColumnIndex + sizeStats format.SizeStatistics + statistics format.Statistics + encodingStats []format.PageEncodingStats + numValues int64 + numRows int64 + + totalUncompressedSize int64 + totalCompressedSize int64 +} + +// orderedRowGroupSegments is implemented by row groups that are the in-order +// concatenation of independently writable sub-row-groups: writing the segments +// in sequence yields the same rows, in the same order, as reading Rows(). It is +// used so the writer can route copyable segments of a merge through the verbatim +// copy fast path. A row group whose order depends on interleaving across its +// children (e.g. an overlapping heap merge) or that applies cross-segment +// deduplication must return nil to opt out. +type orderedRowGroupSegments interface { + rowGroupSegments() []RowGroup +} + +// splittableCopyableSegments returns the writable segments of rowGroup when it +// is a segmented row group and at least one segment can be written through an +// optimized segment path. The writer then emits packed output row groups so +// copyable single segments can take the L0 fast path and multi-segment batches +// can take the L3 column-oriented packing path. Splitting is gated on +// optimization eligibility so that pure re-encode merges keep their existing +// output structure. +func (w *Writer) splittableCopyableSegments(rowGroup RowGroup) ([]RowGroup, bool) { + if disableWriteCopy && disableWriteReencode { + return nil, false + } + v, ok := rowGroup.(orderedRowGroupSegments) + if !ok { + return nil, false + } + segments := v.rowGroupSegments() + if len(segments) <= 1 { + return nil, false + } + for _, seg := range segments { + if _, ok := w.copyableColumnChunks(seg); ok { + return segments, true + } + if _, ok := w.reencodableRowGroup(seg); ok { + return segments, true + } + } + return nil, false +} + +// copyableColumnChunks returns the source column chunks of rowGroup if the whole +// row group can be copied verbatim into the writer's output, along with true. +// Otherwise it returns nil and false, indicating the caller must fall back to +// the regular re-encode path. +func (w *Writer) copyableColumnChunks(rowGroup RowGroup) ([]*FileColumnChunk, bool) { + if disableWriteCopy { + return nil, false + } + // A verbatim byte copy cannot honor encryption: per-page AAD keys depend on + // the output row-group/column/page ordinals, so an encrypted output requires + // re-encoding from plaintext. + if w.writer.encryption != nil { + return nil, false + } + // A verbatim copy reproduces the source row group as a single output row + // group, so it cannot honor a smaller configured MaxRowsPerRowGroup. When the + // source exceeds the limit, demote so the row path splits it correctly. + if rowGroup.NumRows() > w.writer.currentRowGroup.maxRows { + return nil, false + } + // Row groups whose Rows() implements semantics beyond reading the column + // chunks in order cannot be handled at the chunk level. + if !chunkTransparentRowGroup(rowGroup) { + return nil, false + } + + dst := w.writer.currentRowGroup.columns + columns := rowGroup.ColumnChunks() + if len(columns) != len(dst) { + return nil, false + } + + srcs := make([]*FileColumnChunk, len(columns)) + for i, col := range columns { + fc, ok := col.(*FileColumnChunk) + if !ok { + return nil, false + } + if !columnChunkIsCopyable(dst[i], fc) { + return nil, false + } + srcs[i] = fc + } + return srcs, true +} + +// chunkTransparentMarker is implemented by row group types for which reading +// the column chunks in order is equivalent to reading Rows(). The method is +// unexported on purpose: row group implementations outside this package cannot +// opt in, so they always take the row-oriented path, which honors whatever +// semantics their Rows() implements. +type chunkTransparentMarker interface { + chunkTransparentRowGroup() +} + +// chunkTransparentRowGroup reports whether reading rowGroup's column chunks in +// order is equivalent to reading its Rows(). The fast paths in this file and in +// writer_reencode.go operate on the column chunks directly, so they must only +// be applied to row group types that explicitly opt in via +// chunkTransparentMarker. Everything else — including application-defined +// RowGroup implementations — is conservatively assumed to implement semantics +// in Rows() and handled through the row-oriented path. +// +// Known examples of wrappers whose Rows() adds semantics on top of the chunks: +// +// - dedupRowGroup drops duplicated rows in Rows(); its ColumnChunks() are +// promoted unchanged from the wrapped row group, so a chunk-level copy +// would silently retain the duplicates. +// - convertedRowGroup applies value conversion in Rows() (e.g. numeric or +// time unit conversions); its ColumnChunks() expose the unconverted source +// chunks, so a chunk-level copy would emit pre-conversion values under the +// post-conversion schema. Note that a physical type check is not sufficient +// to detect this: conversions such as timestamp millis→micros change values +// while preserving the INT64 physical type. +// +// Identity conversions never produce wrappers (ConvertRowGroup returns the row +// group unwrapped when schemas are equal), so requiring the marker does not +// cost the fast paths anything in the matched-schema case. +func chunkTransparentRowGroup(rowGroup RowGroup) bool { + _, ok := rowGroup.(chunkTransparentMarker) + return ok +} + +// loadCopiedChunks stages every source column chunk into its destination +// ColumnWriter. The per-column work here is cheap (it reads only the page index +// and records byte ranges); the data bytes are streamed straight to the output +// during row group assembly, so this is done sequentially. +func (w *Writer) loadCopiedChunks(srcs []*FileColumnChunk) error { + cols := w.writer.currentRowGroup.columns + for i, src := range srcs { + if err := cols[i].loadCopiedChunk(src); err != nil { + return err + } + } + return nil +} + +// columnChunkIsCopyable reports whether the source chunk can be copied verbatim +// into the column managed by dst, producing output indistinguishable from the +// configured re-encode behavior. +func columnChunkIsCopyable(dst *ColumnWriter, src *FileColumnChunk) bool { + // Source must be plaintext; we cannot copy ciphertext into a plaintext file. + if src.decryptionKey != nil { + return false + } + // Destination must not be encrypting (also covered by the writer-level check, + // kept here for defensiveness). + if dst.encKey != nil { + return false + } + + meta := &src.chunk.MetaData + + // Physical type must match. + if meta.Type != format.Type(dst.columnType.Kind()) { + return false + } + // Compression codec must match the configured codec. + if meta.Codec != dst.compression.CompressionCodec() { + return false + } + // A writer-requested bloom filter can only be satisfied by a verbatim copy + // when the source chunk carries a filter equivalent to the one the writer + // would build; otherwise the filter must be recomputed from decoded values. + if dst.columnFilter != nil && !bloomFilterIsCopyable(dst, src) { + return false + } + // We copy statistics and the page index from the source; require both to be + // present so the output honors the writer's statistics configuration. + if src.chunk.ColumnIndexOffset == 0 || src.chunk.OffsetIndexOffset == 0 { + return false + } + // All data pages must use the configured encoding and data page version, and + // dictionary presence must match the configured encoding. + if !encodingStatsMatch(meta.EncodingStats, dst) { + return false + } + return true +} + +// encodingStatsMatch reports whether every page recorded in the source encoding +// stats is compatible with the destination column's configured encoding and +// data page version. +func encodingStatsMatch(stats []format.PageEncodingStats, dst *ColumnWriter) bool { + if len(stats) == 0 { + return false // cannot verify the source encodings; demote + } + + wantPageType := dst.header.page.Type // DataPage (v1) or DataPageV2 + wantEncoding := dst.encoding.Encoding() + wantDict := dst.dictionary != nil + sawDict := false + + for _, s := range stats { + switch s.PageType { + case format.DictionaryPage: + sawDict = true + if !wantDict { + return false + } + case format.DataPage, format.DataPageV2: + if s.PageType != wantPageType { + return false // data page version mismatch + } + if s.Encoding != wantEncoding { + return false // encoding mismatch + } + default: + return false + } + } + + if wantDict != sawDict { + return false + } + return true +} + +// bloomFilterIsCopyable reports whether the source chunk carries a bloom filter +// equivalent to the one the destination column writer is configured to build, +// so that copying its bytes verbatim is indistinguishable from recomputing it: +// +// - the source records the filter location and length (older files omit the +// length, in which case the byte range is unknown); +// - both source and destination use the uncompressed filter representation +// (this library's default; compressed filters would require comparing +// post-compression content); +// - the source header describes the same algorithm and hash the writer would +// use (split-block, xxhash — the only ones supported); and +// - the source bitset has exactly the size the destination filter would +// allocate for this chunk's value count, i.e. the same bits-per-value. +func bloomFilterIsCopyable(dst *ColumnWriter, src *FileColumnChunk) bool { + meta := &src.chunk.MetaData + if meta.BloomFilterOffset == 0 || meta.BloomFilterLength <= 0 { + return false + } + if dst.bloomFilterCompression != nil && dst.bloomFilterCompression.CompressionCodec() != format.Uncompressed { + return false + } + + section := io.NewSectionReader(src.file.reader, meta.BloomFilterOffset, int64(meta.BloomFilterLength)) + rbuf, rbufpool := getBufioReader(section, 1024) + defer putBufioReader(rbuf, rbufpool) + + var header format.BloomFilterHeader + compact := thrift.CompactProtocol{} + if err := thrift.NewDecoder(compact.NewReader(rbuf)).Decode(&header); err != nil { + return false + } + if !isSplitBlockAlgorithm(&header) || !isXxHash(&header) { + return false + } + if _, ok := header.Compression.Value.(*format.BloomFilterUncompressed); !ok { + return false + } + return int(header.NumBytes) == dst.columnFilter.Size(meta.NumValues) +} + +// loadCopiedChunk prepares the destination ColumnWriter to emit a source column +// chunk verbatim during row group assembly. It does not read the page bytes — +// only the (much smaller) page index and statistics — and records the source +// byte ranges so the data can be streamed straight to the output later, avoiding +// a per-chunk allocation and an extra copy. +func (c *ColumnWriter) loadCopiedChunk(src *FileColumnChunk) error { + meta := &src.chunk.MetaData + + // The dictionary page (if any) and the data pages are contiguous byte ranges + // in the source file. + dataOffset := meta.DataPageOffset + dataLength := meta.TotalCompressedSize + var dictOffset, dictLength int64 + if meta.DictionaryPageOffset != 0 { + dictOffset = meta.DictionaryPageOffset + dictLength = meta.DataPageOffset - meta.DictionaryPageOffset + if dictLength < 0 || dictLength > meta.TotalCompressedSize { + return fmt.Errorf("invalid source column chunk layout: dictionary offset %d, data offset %d, total %d", + meta.DictionaryPageOffset, meta.DataPageOffset, meta.TotalCompressedSize) + } + dataLength = meta.TotalCompressedSize - dictLength + } + + // Copy the column index verbatim (type matches, so the raw min/max bytes are + // directly reusable). + ci, err := src.ColumnIndex() + if err != nil { + return fmt.Errorf("reading source column index: %w", err) + } + + // Rebuild page locations relative to the start of the data region; the writer + // re-absolutizes them once the output data page offset is known. + oi, err := src.OffsetIndex() + if err != nil { + return fmt.Errorf("reading source offset index: %w", err) + } + srcLocations := oi.(*FileOffsetIndex).index.PageLocations + locations := make([]format.PageLocation, len(srcLocations)) + for i, loc := range srcLocations { + loc.Offset -= meta.DataPageOffset + locations[i] = loc + } + + cc := &copiedChunk{ + reader: src.file.reader, + dictOffset: dictOffset, + dictLength: dictLength, + dataOffset: dataOffset, + dataLength: dataLength, + columnIndex: cloneColumnIndex(ci.(*FileColumnIndex).index), + sizeStats: cloneSizeStatistics(meta.SizeStatistics), + statistics: cloneStatistics(meta.Statistics), + encodingStats: slices.Clone(meta.EncodingStats), + numValues: meta.NumValues, + numRows: src.rowGroup.NumRows, + totalUncompressedSize: meta.TotalUncompressedSize, + totalCompressedSize: meta.TotalCompressedSize, + } + + // When the destination column is configured with a bloom filter, the copy + // predicate has already verified that the source carries an equivalent one; + // record its byte range so it is copied verbatim during assembly. + if c.columnFilter != nil { + cc.bloomOffset = meta.BloomFilterOffset + cc.bloomLength = int64(meta.BloomFilterLength) + } + + c.copied = cc + c.numRows = cc.numRows + c.numPages = len(locations) + c.offsetIndex.PageLocations = locations + copyPathCounter.Add(1) + + // Populate the column chunk metadata that the regular path would accumulate + // via recordPageStats. + c.columnChunk.MetaData.NumValues = cc.numValues + c.columnChunk.MetaData.TotalUncompressedSize = cc.totalUncompressedSize + c.columnChunk.MetaData.TotalCompressedSize = cc.totalCompressedSize + c.columnChunk.MetaData.Statistics = cc.statistics + c.columnChunk.MetaData.EncodingStats = append(c.columnChunk.MetaData.EncodingStats[:0], cc.encodingStats...) + return nil +} + +func cloneStatistics(s format.Statistics) format.Statistics { + s.Min = slices.Clone(s.Min) + s.Max = slices.Clone(s.Max) + s.MinValue = slices.Clone(s.MinValue) + s.MaxValue = slices.Clone(s.MaxValue) + return s +} + +func cloneSizeStatistics(s format.SizeStatistics) format.SizeStatistics { + s.RepetitionLevelHistogram = slices.Clone(s.RepetitionLevelHistogram) + s.DefinitionLevelHistogram = slices.Clone(s.DefinitionLevelHistogram) + return s +} + +func cloneColumnIndex(index *format.ColumnIndex) format.ColumnIndex { + out := *index + out.NullPages = slices.Clone(index.NullPages) + out.MinValues = slices.Clone(index.MinValues) + out.MaxValues = slices.Clone(index.MaxValues) + out.NullCounts = slices.Clone(index.NullCounts) + out.RepetitionLevelHistogram = slices.Clone(index.RepetitionLevelHistogram) + out.DefinitionLevelHistogram = slices.Clone(index.DefinitionLevelHistogram) + return out +} diff --git a/vendor/github.com/parquet-go/parquet-go/writer_reencode.go b/vendor/github.com/parquet-go/parquet-go/writer_reencode.go new file mode 100644 index 00000000000..5b91b0884e1 --- /dev/null +++ b/vendor/github.com/parquet-go/parquet-go/writer_reencode.go @@ -0,0 +1,233 @@ +package parquet + +import ( + "io" + "sync/atomic" +) + +// This file implements the "L3" re-encode path for Writer.WriteRowGroup: when a +// single file-backed source row group's schema matches the writer but it cannot +// be copied verbatim (the configured codec/encoding/etc. differ), re-encode it +// column-by-column instead of assembling rows and then deconstructing them. +// +// The regular fallback reads the source columns, interleaves their values into +// Row objects, then immediately tears those rows back apart into columns to +// re-encode. L3 skips that round-trip: it reads each column's values directly +// and writes them straight through the column writer (which still re-encodes, +// re-compresses, computes statistics, and populates bloom filters exactly as the +// row path would). +// +// L3 still decodes and re-encodes values, so it is far less of a win than the +// verbatim copy (L0); its benefit is avoiding the row round-trip (measured +// ~1.4–1.8x faster with notably less garbage). See +// docs/merge-copy-optimization.md. + +// reencodePathCounter counts row groups written via the L3 column-oriented +// re-encode path. Test/benchmark instrumentation only. +var reencodePathCounter atomic.Int64 + +// disableWriteReencode forces WriteRowGroup onto the row-oriented fallback. It +// exists only so benchmarks can measure L3 against an otherwise identical +// baseline. +var disableWriteReencode bool + +// columnOrientedRowGroup reports whether every column of rowGroup can be read +// column-wise while preserving row order, and the row count fits the configured +// row group size. This holds for file-backed chunks (a single row group of a +// parquet file) and for in-memory column buffers (parquet.Buffer / +// GenericBuffer, whose columns are reordered together when sorted); it excludes +// overlapping heap merges, whose row order depends on cross-column +// interleaving. The size check ensures column-wise writing does not produce a +// row group larger than the row path would. Row groups whose Rows() adds +// semantics on top of the chunks (deduplication, value conversion) are rejected +// by chunkTransparentRowGroup — reading their chunks directly would bypass +// those semantics. +func (w *Writer) columnOrientedRowGroup(rowGroup RowGroup) ([]ColumnChunk, bool) { + if !chunkTransparentRowGroup(rowGroup) { + return nil, false + } + dst := w.writer.currentRowGroup.columns + columns := rowGroup.ColumnChunks() + if len(columns) == 0 || len(columns) != len(dst) { + return nil, false + } + for _, col := range columns { + if !columnOrientedChunk(col) { + return nil, false + } + } + if rowGroup.NumRows() > w.writer.currentRowGroup.maxRows { + return nil, false + } + return columns, true +} + +// columnOrientedChunk reports whether a column chunk can be read column-wise +// while preserving row order: file-backed chunks, in-memory column buffers, +// and row-range views over either. +func columnOrientedChunk(col ColumnChunk) bool { + switch c := col.(type) { + case *FileColumnChunk: + return true + case ColumnBuffer: + return true + case *rangeColumnChunk: + return columnOrientedChunk(c.base) + default: + return false + } +} + +// reencodableRowGroup reports whether rowGroup can be written via the L3 +// column-oriented re-encode path. +func (w *Writer) reencodableRowGroup(rowGroup RowGroup) ([]ColumnChunk, bool) { + if disableWriteReencode { + return nil, false + } + return w.columnOrientedRowGroup(rowGroup) +} + +// writeSegmentsPacked writes the segments of a split merge, packing consecutive +// file-backed (non-overlapping) segments into output row groups up to the +// configured MaxRowsPerRowGroup. A single-segment batch is written through the +// normal path (preserving the verbatim L0 fast path for the 1:1 case); a +// multi-segment batch is consolidated column-by-column via L3 into one output +// row group, undershooting MaxRowsPerRowGroup as needed. Non-file-backed +// segments (overlapping heap merges) or segments larger than the limit flush the +// pending batch and are written individually through the row path. +func (w *Writer) writeSegmentsPacked(segments []RowGroup, schema *Schema, sortingColumns []SortingColumn) (int64, error) { + maxRows := w.writer.currentRowGroup.maxRows + + var ( + total int64 + pending []RowGroup + pendingRows int64 + ) + + flushPending := func() error { + var ( + n int64 + err error + ) + switch len(pending) { + case 0: + return nil + case 1: + n, err = w.WriteRowGroup(pending[0]) + default: + n, err = w.packSegmentsByColumn(pending, schema, sortingColumns) + } + total += n + pending = pending[:0] + pendingRows = 0 + return err + } + + for _, seg := range segments { + if _, ok := w.columnOrientedRowGroup(seg); ok { + if pendingRows > 0 && pendingRows+seg.NumRows() > maxRows { + if err := flushPending(); err != nil { + return total, err + } + } + pending = append(pending, seg) + pendingRows += seg.NumRows() + continue + } + if err := flushPending(); err != nil { + return total, err + } + n, err := w.WriteRowGroup(seg) + total += n + if err != nil { + return total, err + } + } + if err := flushPending(); err != nil { + return total, err + } + return total, nil +} + +// packSegmentsByColumn consolidates several file-backed segments into a single +// output row group by re-encoding each column across all segments in order. +func (w *Writer) packSegmentsByColumn(segments []RowGroup, schema *Schema, sortingColumns []SortingColumn) (int64, error) { + if err := w.writer.flush(); err != nil { + return 0, err + } + dst := w.writer.currentRowGroup.columns + w.configureBloomFiltersForSegments(segments) + for _, seg := range segments { + columns := seg.ColumnChunks() + for i := range columns { + if err := copyColumnValues(dst[i], columns[i]); err != nil { + return 0, err + } + } + } + reencodePathCounter.Add(1) + return w.writer.writeRowGroup(w.writer.currentRowGroup, schema, sortingColumns) +} + +// configureBloomFiltersForSegments sizes each column's bloom filter for the +// total number of values across all segments being packed together. Columns +// whose value count is only an upper bound (row-range views of repeated +// columns) are left unallocated so flushFilterPages sizes the filter from the +// number of values actually written. +func (w *Writer) configureBloomFiltersForSegments(segments []RowGroup) { + for i, c := range w.writer.currentRowGroup.columns { + if c.columnFilter == nil { + continue + } + total := int64(0) + exact := true + for _, seg := range segments { + chunk := seg.ColumnChunks()[i] + exact = exact && chunkNumValuesIsExact(chunk) + total += chunk.NumValues() + } + if exact { + c.resizeBloomFilter(total) + } + } +} + +// writeRowGroupByColumn re-encodes each source column chunk into its destination +// column writer, reading values column-wise instead of materializing rows. +func (w *Writer) writeRowGroupByColumn(columns []ColumnChunk) error { + dst := w.writer.currentRowGroup.columns + for i, col := range columns { + if err := copyColumnValues(dst[i], col); err != nil { + return err + } + } + reencodePathCounter.Add(1) + return nil +} + +// reencodeValueBufferSize is the batch size for column-wise value copies. Larger +// than the default value buffer to amortize per-call overhead. +const reencodeValueBufferSize = 1024 + +// copyColumnValues reads every value of src in order and writes it to dst, +// without materializing rows. +func copyColumnValues(dst *ColumnWriter, src ColumnChunk) error { + reader := NewColumnChunkValueReader(src) + defer reader.Close() + + buf := make([]Value, reencodeValueBufferSize) + for { + n, err := reader.ReadValues(buf) + if n > 0 { + if _, werr := dst.WriteRowValues(buf[:n]); werr != nil { + return werr + } + } + if err != nil { + if err == io.EOF { + return nil + } + return err + } + } +} diff --git a/vendor/github.com/sirupsen/logrus/.golangci.yml b/vendor/github.com/sirupsen/logrus/.golangci.yml index 792db361813..c9a840e0d71 100644 --- a/vendor/github.com/sirupsen/logrus/.golangci.yml +++ b/vendor/github.com/sirupsen/logrus/.golangci.yml @@ -1,12 +1,9 @@ version: "2" -run: - tests: false linters: enable: - asasalint - asciicheck - bidichk - - bodyclose - contextcheck - durationcheck - errchkjson @@ -22,46 +19,21 @@ linters: - nilerr - nilnesserr - noctx - - protogetter - reassign - recvcheck - - rowserrcheck - - spancheck - - sqlclosecheck - testifylint - unparam - - zerologlint - disable: - - prealloc - settings: - errcheck: - check-type-assertions: false - check-blank: false - lll: - line-length: 100 - tab-width: 4 - prealloc: - simple: false - range-loops: false - for-loops: false - whitespace: - multi-if: false - multi-func: false exclusions: - generated: lax presets: - - comments - - common-false-positives - legacy - std-error-handling - paths: - - third_party$ - - builtin$ - - examples$ -formatters: - exclusions: - generated: lax - paths: - - third_party$ - - builtin$ - - examples$ + rules: + # Exclude some linters from running on tests files. + - path: _test\.go + linters: + - gosec + - musttag + - noctx # TODO: enable once we switch to Go 1.24+. + - linters: # TODO: remove once golangci-lint is updated with https://github.com/golangci/golangci-lint/pull/6584 + - gocheckcompilerdirectives + text: 'compiler directive unrecognized: //go:fix' diff --git a/vendor/github.com/sirupsen/logrus/CHANGELOG.md b/vendor/github.com/sirupsen/logrus/CHANGELOG.md index 098608ff4b4..683cec90887 100644 --- a/vendor/github.com/sirupsen/logrus/CHANGELOG.md +++ b/vendor/github.com/sirupsen/logrus/CHANGELOG.md @@ -1,90 +1,253 @@ -# 1.8.1 +# Changelog + +All notable changes to this project will be documented in this file. + +## 1.10.2 + +Changed: + + * Update `github.com/stretchr/testify` to v1.12.1, removing the legacy + `gopkg.in/yaml.v3` dependency. + +## 1.10.1 + +Fixes: + + * Fix a regression introduced in v1.10.0 where `TextFormatter` could panic + when formatting nil or panicking `error` and `fmt.Stringer` values. + * Allow function-backed implementations of `error` as field values. + +## 1.10.0 + +Fixes: + + * Fix reentrant logging deadlocks in formatter paths. + * Fix race conditions in formatter and entry handling. + * Fix generic `Log`, `Logf`, `Logln`, and `LogFn` methods unexpectedly + panicking when called with `PanicLevel`. Use the corresponding `Panic` + methods when panic behavior is desired. + * Improve concurrency safety around formatter and hook access. + +Features: + + * Add `slog` hook for forwarding Logrus entries to `log/slog`. + * Add `slog.Handler` for forwarding `log/slog` records to a Logrus logger, + including levels, fields, groups, context, time, and optional caller + reporting. The hook and handler can also be combined to help migrate + between Logrus and `log/slog`. + * Add minimal, composable logging interfaces for each log level. This enables + consumers to depend on narrower interfaces, making it easier to substitute + or adapt logging implementations. + * Allow `Entry.Caller` to be set explicitly and preserve it across derived + entries, enabling custom caller detection without Logrus overwriting + caller information when `ReportCaller` is enabled. + +Changed: + + * Raise minimum supported Go version to 1.23. + * TextFormatter now renders `[]byte` values as raw/quoted strings instead of slice-of-ints. + * TextFormatter now uses distinct dimmed colors for debug and trace output. + * TextFormatter now automatically enables colors on Windows terminals with ANSI support, + matching the behavior on other platforms. + * `Entry.HasCaller` is now deprecated in favor of checking `Entry.Caller` directly. + * Deprecated `MutexWrap`, which was unintentionally exposed as public API. + It remains available as an alias for compatibility but should not be used + directly. + +Performance: + + * Significantly improve TextFormatter performance and reduce allocations. + * Optimize common Entry and Logger hot paths. + * Reduce allocations in caller reporting. + * ~17% lower geomean runtime and ~27% higher formatter throughput overall. + * Common enabled logging paths are ~30–44% faster. + * TextFormatter paths are up to ~40% faster, with allocation counts reduced + by 25–74% across the measured formatter cases. + + +## 1.9.4 + +Fixes: + + * Remove uses of deprecated `ioutil` package + +Features: + + * Add GNU/Hurd support + * Add WASI wasip1 support + +Code quality: + + * Update minimum supported Go version to 1.17 + * Documentation updates + + +## 1.9.3 + +Fixes: + + * Re-apply fix for potential denial of service in logrus.Writer() when logging >64KB single-line payloads without newlines (#1376) + * Fix panic in Writer + + +## 1.9.2 + +Fixes: + + * Revert Writer DoS fix (#1376) due to regression + + +## 1.9.1 + +Fixes: + + * Fix potential denial of service in logrus.Writer() when logging >64KB single-line payloads without newlines (#1376) + + +## 1.9.0 + +Fixes: + + * Multiple concurrency and race condition fixes + * Improve Windows terminal and ANSI handling + Code quality: + + * Internal cleanups and modernization + + +## 1.8.3 + +Fixes: + + * Fix potential denial of service in logrus.Writer() when logging >64KB single-line payloads without newlines (#1376) + + +## 1.8.2 + +Features: + + * Add support for the logger private buffer pool (#1253) + +Fixes: + + * Fix race condition for SetFormatter and SetReportCaller + * Fix data race in hooks test package + +## 1.8.1 + +Code quality: + * move magefile in its own subdir/submodule to remove magefile dependency on logrus consumer * improve timestamp format documentation Fixes: + * fix race condition on logger hooks -# 1.8.0 +## 1.8.0 Correct versioning number replacing v1.7.1. -# 1.7.1 +## 1.7.1 Beware this release has introduced a new public API and its semver is therefore incorrect. Code quality: + * use go 1.15 in travis * use magefile as task runner Fixes: + * small fixes about new go 1.13 error formatting system * Fix for long time race condiction with mutating data hooks Features: + * build support for zos -# 1.7.0 +## 1.7.0 + Fixes: + * the dependency toward a windows terminal library has been removed Features: + * a new buffer pool management API has been added * a set of `Fn()` functions have been added -# 1.6.0 +## 1.6.0 + Fixes: + * end of line cleanup * revert the entry concurrency bug fix which leads to deadlock under some circumstances * update dependency on go-windows-terminal-sequences to fix a crash with go 1.14 Features: + * add an option to the `TextFormatter` to completely disable fields quoting -# 1.5.0 +## 1.5.0 + Code quality: + * add golangci linter run on travis Fixes: + * add mutex for hooks concurrent access on `Entry` data * caller function field for go1.14 * fix build issue for gopherjs target Feature: + * add an hooks/writer sub-package whose goal is to split output on different stream depending on the trace level * add a `DisableHTMLEscape` option in the `JSONFormatter` * add `ForceQuote` and `PadLevelText` options in the `TextFormatter` -# 1.4.2 +## 1.4.2 + * Fixes build break for plan9, nacl, solaris -# 1.4.1 + +## 1.4.1 + This new release introduces: + * Enhance TextFormatter to not print caller information when they are empty (#944) * Remove dependency on golang.org/x/crypto (#932, #943) Fixes: + * Fix Entry.WithContext method to return a copy of the initial entry (#941) -# 1.4.0 +## 1.4.0 + This new release introduces: + * Add `DeferExitHandler`, similar to `RegisterExitHandler` but prepending the handler to the list of handlers (semantically like `defer`) (#848). * Add `CallerPrettyfier` to `JSONFormatter` and `TextFormatter` (#909, #911) * Add `Entry.WithContext()` and `Entry.Context`, to set a context on entries to be used e.g. in hooks (#919). Fixes: + * Fix wrong method calls `Logger.Print` and `Logger.Warningln` (#893). * Update `Entry.Logf` to not do string formatting unless the log level is enabled (#903) * Fix infinite recursion on unknown `Level.String()` (#907) * Fix race condition in `getCaller` (#916). -# 1.3.0 +## 1.3.0 + This new release introduces: + * Log, Logf, Logln functions for Logger and Entry that take a Level Fixes: + * Building prometheus node_exporter on AIX (#840) * Race condition in TextFormatter (#468) * Travis CI import path (#868) @@ -92,20 +255,26 @@ Fixes: * Pointer to func as field in JSONFormatter (#870) * Properly marshal Levels (#873) -# 1.2.0 +## 1.2.0 + This new release introduces: + * A new method `SetReportCaller` in the `Logger` to enable the file, line and calling function from which the trace has been issued * A new trace level named `Trace` whose level is below `Debug` * A configurable exit function to be called upon a Fatal trace * The `Level` object now implements `encoding.TextUnmarshaler` interface -# 1.1.1 +## 1.1.1 + This is a bug fix release. + * fix the build break on Solaris * don't drop a whole trace in JSONFormatter when a field param is a function pointer which can not be serialized -# 1.1.0 +## 1.1.0 + This new release introduces: + * several fixes: * a fix for a race condition on entry formatting * proper cleanup of previously used entries before putting them back in the pool @@ -122,9 +291,10 @@ This new release introduces: * the field sort function is now configurable for text formatter * the CLICOLOR and CLICOLOR\_FORCE environment variable support in text formater -# 1.0.6 +## 1.0.6 This new release introduces: + * a new api WithTime which allows to easily force the time of the log entry which is mostly useful for logger wrapper * a fix reverting the immutability of the entry given as parameter to the hooks @@ -134,71 +304,71 @@ This new release introduces: * a new configuration of the textformatter to configure the name of the default keys * a new configuration of the text formatter to disable the level truncation -# 1.0.5 +## 1.0.5 * Fix hooks race (#707) * Fix panic deadlock (#695) -# 1.0.4 +## 1.0.4 * Fix race when adding hooks (#612) * Fix terminal check in AppEngine (#635) -# 1.0.3 +## 1.0.3 * Replace example files with testable examples -# 1.0.2 +## 1.0.2 * bug: quote non-string values in text formatter (#583) * Make (*Logger) SetLevel a public method -# 1.0.1 +## 1.0.1 * bug: fix escaping in text formatter (#575) -# 1.0.0 +## 1.0.0 * Officially changed name to lower-case * bug: colors on Windows 10 (#541) * bug: fix race in accessing level (#512) -# 0.11.5 +## 0.11.5 * feature: add writer and writerlevel to entry (#372) -# 0.11.4 +## 0.11.4 * bug: fix undefined variable on solaris (#493) -# 0.11.3 +## 0.11.3 * formatter: configure quoting of empty values (#484) * formatter: configure quoting character (default is `"`) (#484) * bug: fix not importing io correctly in non-linux environments (#481) -# 0.11.2 +## 0.11.2 * bug: fix windows terminal detection (#476) -# 0.11.1 +## 0.11.1 * bug: fix tty detection with custom out (#471) -# 0.11.0 +## 0.11.0 * performance: Use bufferpool to allocate (#370) * terminal: terminal detection for app-engine (#343) * feature: exit handler (#375) -# 0.10.0 +## 0.10.0 * feature: Add a test hook (#180) * feature: `ParseLevel` is now case-insensitive (#326) * feature: `FieldLogger` interface that generalizes `Logger` and `Entry` (#308) * performance: avoid re-allocations on `WithFields` (#335) -# 0.9.0 +## 0.9.0 * logrus/text_formatter: don't emit empty msg * logrus/hooks/airbrake: move out of main repository @@ -210,25 +380,25 @@ This new release introduces: * logrus/core: support `WithError` on logger * logrus/core: Solaris support -# 0.8.7 +## 0.8.7 * logrus/core: fix possible race (#216) * logrus/doc: small typo fixes and doc improvements -# 0.8.6 +## 0.8.6 * hooks/raven: allow passing an initialized client -# 0.8.5 +## 0.8.5 * logrus/core: revert #208 -# 0.8.4 +## 0.8.4 * formatter/text: fix data race (#218) -# 0.8.3 +## 0.8.3 * logrus/core: fix entry log level (#208) * logrus/core: improve performance of text formatter by 40% @@ -236,24 +406,24 @@ This new release introduces: * logrus/core: add support for DragonflyBSD and NetBSD * formatter/text: print structs more verbosely -# 0.8.2 +## 0.8.2 * logrus: fix more Fatal family functions -# 0.8.1 +## 0.8.1 * logrus: fix not exiting on `Fatalf` and `Fatalln` -# 0.8.0 +## 0.8.0 * logrus: defaults to stderr instead of stdout * hooks/sentry: add special field for `*http.Request` * formatter/text: ignore Windows for colors -# 0.7.3 +## 0.7.3 * formatter/\*: allow configuration of timestamp layout -# 0.7.2 +## 0.7.2 * formatter/text: Add configuration option for time format (#158) diff --git a/vendor/github.com/sirupsen/logrus/README.md b/vendor/github.com/sirupsen/logrus/README.md index cc5dab7eb78..b2ff7affcae 100644 --- a/vendor/github.com/sirupsen/logrus/README.md +++ b/vendor/github.com/sirupsen/logrus/README.md @@ -3,13 +3,10 @@ Logrus is a structured logger for Go (golang), completely API compatible with the standard library logger. -**Logrus is in maintenance-mode.** We will not be introducing new features. It's -simply too hard to do in a way that won't break many people's projects, which is -the last thing you want from your Logging library (again...). - -This does not mean Logrus is dead. Logrus will continue to be maintained for -security, (backwards compatible) bug fixes, and performance (where we are -limited by the interface). +**Logrus is in maintenance mode.** The project focuses on security, bug fixes, +and performance improvements. New features are not planned, aside from changes +required to provide interoperability with other logging ecosystems (e.g., Go's +[log/slog](https://pkg.go.dev/log/slog)). I believe Logrus' biggest contribution is to have played a part in today's widespread use of structured logging in Golang. There doesn't seem to be a @@ -23,18 +20,6 @@ about structured logging in Go today. Check out, for example, [zap]: https://github.com/uber-go/zap [apex]: https://github.com/apex/log -**Seeing weird case-sensitive problems?** It's in the past been possible to -import Logrus as both upper- and lower-case. Due to the Go package environment, -this caused issues in the community and we needed a standard. Some environments -experienced problems with the upper-case variant, so the lower-case was decided. -Everything using `logrus` will need to use the lower-case: -`github.com/sirupsen/logrus`. Any package that isn't, should be changed. - -To fix Glide, see [these -comments](https://github.com/sirupsen/logrus/issues/553#issuecomment-306591437). -For an in-depth explanation of the casing issue, see [this -comment](https://github.com/sirupsen/logrus/issues/570#issuecomment-313933276). - Nicely color-coded in development (when a TTY is attached, otherwise just plain text): @@ -43,35 +28,27 @@ plain text): With `logrus.SetFormatter(&logrus.JSONFormatter{})`, for easy parsing by logstash or Splunk: -```text -{"animal":"walrus","level":"info","msg":"A group of walrus emerges from the -ocean","size":10,"time":"2014-03-10 19:57:38.562264131 -0400 EDT"} - -{"level":"warning","msg":"The group's number increased tremendously!", -"number":122,"omg":true,"time":"2014-03-10 19:57:38.562471297 -0400 EDT"} - -{"animal":"walrus","level":"info","msg":"A giant walrus appears!", -"size":10,"time":"2014-03-10 19:57:38.562500591 -0400 EDT"} - -{"animal":"walrus","level":"info","msg":"Tremendously sized cow enters the ocean.", -"size":9,"time":"2014-03-10 19:57:38.562527896 -0400 EDT"} - -{"level":"fatal","msg":"The ice breaks!","number":100,"omg":true, -"time":"2014-03-10 19:57:38.562543128 -0400 EDT"} +```json lines +{"animal":"walrus","level":"info","msg":"A group of walrus emerges from the ocean","size":10,"time":"2014-03-10 19:57:38.562264131 -0400 EDT"} +{"level":"warning","msg":"The group's number increased tremendously!","number":122,"omg":true,"time":"2014-03-10 19:57:38.562471297 -0400 EDT"} +{"animal":"walrus","level":"info","msg":"A giant walrus appears!","size":10,"time":"2014-03-10 19:57:38.562500591 -0400 EDT"} +{"animal":"walrus","level":"info","msg":"Tremendously sized cow enters the ocean.","size":9,"time":"2014-03-10 19:57:38.562527896 -0400 EDT"} +{"level":"fatal","msg":"The ice breaks!","number":100,"omg":true,"time":"2014-03-10 19:57:38.562543128 -0400 EDT"} ``` With the default `logrus.SetFormatter(&logrus.TextFormatter{})` when a TTY is not attached, the output is compatible with the [logfmt](https://pkg.go.dev/github.com/kr/logfmt) format: -```text +```bash time="2015-03-26T01:27:38-04:00" level=debug msg="Started observing beach" animal=walrus number=8 time="2015-03-26T01:27:38-04:00" level=info msg="A group of walrus emerges from the ocean" animal=walrus size=10 time="2015-03-26T01:27:38-04:00" level=warning msg="The group's number increased tremendously!" number=122 omg=true time="2015-03-26T01:27:38-04:00" level=debug msg="Temperature changes" temperature=-4 time="2015-03-26T01:27:38-04:00" level=panic msg="It's over 9000!" animal=orca size=9009 -time="2015-03-26T01:27:38-04:00" level=fatal msg="The ice breaks!" err=&{0x2082280c0 map[animal:orca size:9009] 2015-03-26 01:27:38.441574009 -0400 EDT panic It's over 9000!} number=100 omg=true +time="2015-03-26T01:27:38-04:00" level=fatal msg="The ice breaks!" animal=orca err="It's over 9000!" number=100 omg=true size=9009 ``` + To ensure this behaviour even if a TTY is attached, set your formatter as follows: ```go @@ -88,29 +65,32 @@ If you wish to add the calling method as a field, instruct the logger via: ```go logrus.SetReportCaller(true) ``` + This adds the caller as 'method' like so: ```json -{"animal":"penguin","level":"fatal","method":"github.com/sirupsen/arcticcreatures.migrate","msg":"a penguin swims by", -"time":"2014-03-10 19:57:38.562543129 -0400 EDT"} +{"animal":"penguin","level":"fatal","method":"github.com/sirupsen/arcticcreatures.migrate","msg":"a penguin swims by","time":"2014-03-10 19:57:38.562543129 -0400 EDT"} ``` -```text +```bash time="2015-03-26T01:27:38-04:00" level=fatal method=github.com/sirupsen/arcticcreatures.migrate msg="a penguin swims by" animal=penguin ``` + Note that this does add measurable overhead - the cost will depend on the version of Go, but is between 20 and 40% in recent tests with 1.6 and 1.7. You can validate this in your environment via benchmarks: ```bash -go test -bench=.*CallerTracing +go test -bench=ReportCaller ``` #### Case-sensitivity -The organization's name was changed to lower-case--and this will not be changed -back. If you are getting import conflicts due to case sensitivity, please use -the lower-case import: `github.com/sirupsen/logrus`. +The organization's name was [changed to lower-case][1]. If you are getting import +conflicts due to case sensitivity, please use the lower-case import: +`github.com/sirupsen/logrus`. + +[1]: https://github.com/sirupsen/logrus/issues/570#issuecomment-313933276 #### Example @@ -289,6 +269,7 @@ func init() { } } ``` + Note: Syslog hooks also support connecting to local syslog (Ex. "/dev/log" or "/var/run/syslog" or "/var/run/log"). For the detail, please check the [syslog hook README](hooks/syslog/README.md). A list of currently known service hooks can be found in this wiki [page](https://github.com/sirupsen/logrus/wiki/Hooks) @@ -367,18 +348,21 @@ Splunk or Logstash. The built-in logging formatters are: -* `logrus.TextFormatter`. Logs the event in colors if stdout is a tty, otherwise - without colors. - * *Note:* to force colored output when there is no TTY, set the `ForceColors` +* [`logrus.TextFormatter`](https://pkg.go.dev/github.com/sirupsen/logrus#TextFormatter) + logs the event in colors if the logger output is a TTY, otherwise without colors. + * To force colored output when there is no TTY, set the `ForceColors` field to `true`. To force no colored output even if there is a TTY set the - `DisableColors` field to `true`. For Windows, see - [github.com/mattn/go-colorable](https://github.com/mattn/go-colorable). + `DisableColors` field to `true`. + * On modern Windows terminals with ANSI (Virtual Terminal) support, TextFormatter + automatically enables colored output. + * If your environment does not support ANSI escape sequences, wrap the logger output + using [github.com/mattn/go-colorable](https://github.com/mattn/go-colorable) + and set `ForceColors` (or `CLICOLOR_FORCE=1`) to enable colors through the wrapper. * When colors are enabled, levels are truncated to 4 characters by default. To disable truncation set the `DisableLevelTruncation` field to `true`. * When outputting to a TTY, it's often helpful to visually scan down a column where all the levels are the same width. Setting the `PadLevelText` field to `true` enables this behavior, by adding padding to the level text. - * All options are listed in the [generated docs](https://pkg.go.dev/github.com/sirupsen/logrus#TextFormatter). -* `logrus.JSONFormatter`. Logs fields as JSON. - * All options are listed in the [generated docs](https://pkg.go.dev/github.com/sirupsen/logrus#JSONFormatter). +* [`logrus.JSONFormatter`](https://pkg.go.dev/github.com/sirupsen/logrus#JSONFormatter) + logs fields as JSON. Third-party logging formatters: @@ -390,10 +374,12 @@ Third-party logging formatters: * [`nested-logrus-formatter`](https://github.com/antonfisher/nested-logrus-formatter). Converts logrus fields to a nested structure. * [`powerful-logrus-formatter`](https://github.com/zput/zxcTool). get fileName, log's line number and the latest function's name when print log; Save log to files. * [`caption-json-formatter`](https://github.com/nolleh/caption_json_formatter). logrus's message json formatter with human-readable caption added. +* [`easy-logrus-formatter`](https://github.com/WeiZhixiong/easy-logrus-formatter). Provide a user-friendly formatter for logrus. +* [`redactrus`](https://github.com/ibreakthecloud/redactrus). Redacts sensitive information like password, apikeys, email, etc. from logs. You can define your formatter by implementing the `Formatter` interface, requiring a `Format` method. `Format` takes an `*Entry`. `entry.Data` is a -`Fields` type (`map[string]interface{}`) with all your fields as well as the +`Fields` type (`map[string]any`) with all your fields as well as the default ones (see Entries section above): ```go @@ -516,4 +502,4 @@ Situations when locking is not needed include: 2) logger.Out is an os.File handler opened with `O_APPEND` flag, and every write is smaller than 4k. (This allows multi-thread/multi-process writing) - (Refer to http://www.notthewizard.com/2014/06/17/are-files-appends-really-atomic/) + (Refer to ) diff --git a/vendor/github.com/sirupsen/logrus/alt_exit.go b/vendor/github.com/sirupsen/logrus/alt_exit.go index 8fd189e1cca..1c35cf81c46 100644 --- a/vendor/github.com/sirupsen/logrus/alt_exit.go +++ b/vendor/github.com/sirupsen/logrus/alt_exit.go @@ -57,7 +57,7 @@ func Exit(code int) { // // This method is useful when a caller wishes to use logrus to log a fatal // message but also needs to gracefully shutdown. An example usecase could be -// closing database connections, or sending a alert that the application is +// closing database connections, or sending an alert that the application is // closing. func RegisterExitHandler(handler func()) { handlers = append(handlers, handler) @@ -69,7 +69,7 @@ func RegisterExitHandler(handler func()) { // // This method is useful when a caller wishes to use logrus to log a fatal // message but also needs to gracefully shutdown. An example usecase could be -// closing database connections, or sending a alert that the application is +// closing database connections, or sending an alert that the application is // closing. func DeferExitHandler(handler func()) { handlers = append([]func(){handler}, handlers...) diff --git a/vendor/github.com/sirupsen/logrus/buffer_pool.go b/vendor/github.com/sirupsen/logrus/buffer_pool.go index c7787f77cbf..6b562d8703e 100644 --- a/vendor/github.com/sirupsen/logrus/buffer_pool.go +++ b/vendor/github.com/sirupsen/logrus/buffer_pool.go @@ -5,9 +5,13 @@ import ( "sync" ) -var ( - bufferPool BufferPool -) +var bufferPool BufferPool = &defaultPool{ + pool: &sync.Pool{ + New: func() any { + return new(bytes.Buffer) + }, + }, +} type BufferPool interface { Put(*bytes.Buffer) @@ -27,17 +31,7 @@ func (p *defaultPool) Get() *bytes.Buffer { } // SetBufferPool allows to replace the default logrus buffer pool -// to better meets the specific needs of an application. +// to better meet the specific needs of an application. func SetBufferPool(bp BufferPool) { bufferPool = bp } - -func init() { - SetBufferPool(&defaultPool{ - pool: &sync.Pool{ - New: func() interface{} { - return new(bytes.Buffer) - }, - }, - }) -} diff --git a/vendor/github.com/sirupsen/logrus/doc.go b/vendor/github.com/sirupsen/logrus/doc.go index da67aba06de..75186dc2d2c 100644 --- a/vendor/github.com/sirupsen/logrus/doc.go +++ b/vendor/github.com/sirupsen/logrus/doc.go @@ -1,25 +1,25 @@ /* Package logrus is a structured logger for Go, completely API compatible with the standard library logger. - The simplest way to use Logrus is simply the package-level exported logger: - package main + package main - import ( - log "github.com/sirupsen/logrus" - ) + import ( + log "github.com/sirupsen/logrus" + ) - func main() { - log.WithFields(log.Fields{ - "animal": "walrus", - "number": 1, - "size": 10, - }).Info("A walrus appears") - } + func main() { + log.WithFields(log.Fields{ + "animal": "walrus", + "number": 1, + "size": 10, + }).Info("A walrus appears") + } Output: - time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 + + time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 For a full guide visit https://github.com/sirupsen/logrus */ diff --git a/vendor/github.com/sirupsen/logrus/entry.go b/vendor/github.com/sirupsen/logrus/entry.go index 71d796d0b13..82de41f9f87 100644 --- a/vendor/github.com/sirupsen/logrus/entry.go +++ b/vendor/github.com/sirupsen/logrus/entry.go @@ -4,9 +4,11 @@ import ( "bytes" "context" "fmt" + "maps" "os" "reflect" "runtime" + "strconv" "strings" "sync" "time" @@ -17,8 +19,10 @@ var ( // qualified package name, cached at first use logrusPackage string - // Positions in the call stack when tracing to report the calling method - minimumCallerDepth int + // Positions in the call stack when tracing to report the calling method. + // + // Start at the bottom of the stack before the package-name cache is primed. + minimumCallerDepth = 1 // Used for caller information initialisation callerInitOnce sync.Once @@ -29,68 +33,116 @@ const ( knownLogrusFrames int = 4 ) -func init() { - // start at the bottom of the stack before the package-name cache is primed - minimumCallerDepth = 1 -} - // ErrorKey defines the key when adding errors using [WithError], [Logger.WithError]. var ErrorKey = "error" -// Entry is the final or intermediate Logrus logging entry. It contains all -// the fields passed with WithField{,s}. It's finally logged when Trace, Debug, -// Info, Warn, Error, Fatal or Panic is called on it. These objects can be -// reused and passed around as much as you wish to avoid field duplication. +// Entry represents a single log event. It may be either an intermediate +// entry (created via WithField(s), WithContext, etc.) or a final entry +// that is emitted when one of the level methods (Trace, Debug, Info, +// Warn, Error, Fatal, Panic) is called. // -//nolint:recvcheck // the methods of "Entry" use pointer receiver and non-pointer receiver. +// An Entry always belongs to a Logger. A nil Logger is invalid and will +// cause a panic when the entry is logged. Use [NewEntry] or Logger methods +// to construct entries. +// +// Entries are safe to reuse for adding fields and may be passed around +// to avoid field duplication. Each log operation operates on a copy +// of the Entry’s data to avoid mutation during formatting. +// +//nolint:recvcheck // Entry methods intentionally use both pointer and value receivers. type Entry struct { + // Logger is the Logger that owns this entry and is responsible for + // formatting, hooks, and output. It must not be nil. An Entry without + // a Logger is invalid and will panic when logged. Logger *Logger - // Contains all the fields set by the user. + // Data contains all user-defined fields attached to this entry. Data Fields - // Time at which the log entry was created + // Time is the timestamp for the log event. If zero when the entry is + // logged, it defaults to the current time. Time time.Time - // Level the log entry was logged at: Trace, Debug, Info, Warn, Error, Fatal or Panic - // This field will be set on entry firing and the value will be equal to the one in Logger struct field. + // Level is the severity of the log entry. It is set when the entry + // is fired and reflects the level used for that log call. Level Level - // Calling method, with package name + // Caller contains the calling method information. + // + // When [Logger.ReportCaller] is enabled, Caller is populated automatically at + // log time if it is nil. Hooks and formatters may inspect Caller. + // + // Applications generally should not modify Caller unless they intentionally + // want to provide custom caller information. Caller *runtime.Frame - // Message passed to Trace, Debug, Info, Warn, Error, Fatal or Panic + // Message is the log message supplied to one of the logging methods + // (Trace, Debug, Info, Warn, Error, Fatal, or Panic). It is set when + // the entry is logged. Message string - // When formatter is called in entry.log(), a Buffer may be set to entry + // Buffer is a reusable buffer provided to the formatter. It is set + // before formatting in the normal log path; when nil, formatters + // allocate their own. Buffer *bytes.Buffer - // Contains the context set by the user. Useful for hook processing etc. + // Context carries user-provided context for hooks and formatters. Context context.Context - // err may contain a field formatting error + // err contains internal field-formatting errors. err string } +// NewEntry creates a new [Entry] associated with the provided Logger. +// The logger must not be nil. Passing a nil logger results in a +// panic when a logging method (e.g., [Entry.Info], [Entry.Error], etc.) +// is called. func NewEntry(logger *Logger) *Entry { return &Entry{ Logger: logger, - // Default is three fields, plus one optional. Give a little extra room. - Data: make(Fields, 6), + // Reserve default predefined fields and a little extra room. + Data: make(Fields, defaultFields+3), } } +// Dup creates a copy of the entry for further modification. +// +// Data is cloned to avoid mutating the original entry. Other fields +// (Logger, Time, Context, etc.) are copied by value. func (entry *Entry) Dup() *Entry { - data := make(Fields, len(entry.Data)) - for k, v := range entry.Data { - data[k] = v + dup := entry.dup() + dup.Data = maps.Clone(entry.Data) + return dup +} + +// dup copies the entry fields shared by derived entries except Data, which +// callers must copy or initialize as appropriate for their use. +func (entry *Entry) dup() *Entry { + return &Entry{ + Logger: entry.Logger, + Time: entry.Time, + Caller: entry.Caller, + Context: entry.Context, + err: entry.err, } - return &Entry{Logger: entry.Logger, Data: data, Time: entry.Time, Context: entry.Context, err: entry.err} } // Bytes returns the bytes representation of this entry from the formatter. func (entry *Entry) Bytes() ([]byte, error) { - return entry.Logger.Formatter.Format(entry) + // Snapshot the formatter under the lock to protect against concurrent + // SetFormatter calls, then release the lock before formatting. + // This avoids a data race and prevents a deadlock if Format() triggers + // reentrant logging (e.g., a field's MarshalJSON calls logrus). + // + // See: + // + // - https://github.com/sirupsen/logrus/issues/1440 + // - https://github.com/sirupsen/logrus/issues/1448 + entry.Logger.mu.Lock() + formatter := entry.Logger.Formatter + entry.Logger.mu.Unlock() + + return formatter.Format(entry) } // String returns the string representation from the reader and ultimately the @@ -112,58 +164,61 @@ func (entry *Entry) WithError(err error) *Entry { // WithContext adds a context to the Entry. func (entry *Entry) WithContext(ctx context.Context) *Entry { - dataCopy := make(Fields, len(entry.Data)) - for k, v := range entry.Data { - dataCopy[k] = v - } - return &Entry{Logger: entry.Logger, Data: dataCopy, Time: entry.Time, err: entry.err, Context: ctx} + dup := entry.dup() + dup.Data = maps.Clone(entry.Data) + dup.Context = ctx + return dup } // WithField adds a single field to the Entry. -func (entry *Entry) WithField(key string, value interface{}) *Entry { - return entry.WithFields(Fields{key: value}) +func (entry *Entry) WithField(key string, value any) *Entry { + dup := entry.dup() + dup.Data = maps.Clone(entry.Data) + dup.addField(key, value) + return dup } // WithFields adds a map of fields to the Entry. func (entry *Entry) WithFields(fields Fields) *Entry { - data := make(Fields, len(entry.Data)+len(fields)) - for k, v := range entry.Data { - data[k] = v + dup := entry.dup() + dup.Data = make(Fields, len(entry.Data)+len(fields)) + maps.Copy(dup.Data, entry.Data) + + for key, value := range fields { + dup.addField(key, value) } - fieldErr := entry.err - for k, v := range fields { - isErrField := false - if t := reflect.TypeOf(v); t != nil { - switch { - case t.Kind() == reflect.Func, t.Kind() == reflect.Ptr && t.Elem().Kind() == reflect.Func: - isErrField = true - } - } - if isErrField { - tmp := fmt.Sprintf("can not add field %q", k) - if fieldErr != "" { - fieldErr = entry.err + ", " + tmp + return dup +} + +// WithTime overrides the time of the Entry. +func (entry *Entry) WithTime(t time.Time) *Entry { + dup := entry.dup() + dup.Data = maps.Clone(entry.Data) + dup.Time = t + return dup +} + +func (entry *Entry) addField(key string, value any) { + if _, ok := value.(error); !ok { + t := reflect.TypeOf(value) + if t != nil && (t.Kind() == reflect.Func || t.Kind() == reflect.Pointer && t.Elem().Kind() == reflect.Func) { + if entry.err != "" { + entry.err += ", skipping unsupported field " + strconv.Quote(key) } else { - fieldErr = tmp + entry.err = "skipping unsupported field " + strconv.Quote(key) } - } else { - data[k] = v + return } } - return &Entry{Logger: entry.Logger, Data: data, Time: entry.Time, err: fieldErr, Context: entry.Context} -} -// WithTime overrides the time of the Entry. -func (entry *Entry) WithTime(t time.Time) *Entry { - dataCopy := make(Fields, len(entry.Data)) - for k, v := range entry.Data { - dataCopy[k] = v + if entry.Data == nil { + entry.Data = make(Fields, 1) } - return &Entry{Logger: entry.Logger, Data: dataCopy, Time: t, err: entry.err, Context: entry.Context} + entry.Data[key] = value } // getPackageName reduces a fully qualified function name to the package name -// There really ought to be to be a better way... +// There really ought to be a better way... func getPackageName(f string) string { for { lastPeriod := strings.LastIndex(f, ".") @@ -186,7 +241,7 @@ func getCaller() *runtime.Frame { _ = runtime.Callers(0, pcs) // dynamic get the package name and the minimum caller depth - for i := 0; i < maximumCallerDepth; i++ { + for i := range maximumCallerDepth { funcName := runtime.FuncForPC(pcs[i]).Name() if strings.Contains(funcName, "getCaller") { logrusPackage = getPackageName(funcName) @@ -215,16 +270,47 @@ func getCaller() *runtime.Frame { return nil } -func (entry Entry) HasCaller() (has bool) { - return entry.Logger != nil && - entry.Logger.ReportCaller && - entry.Caller != nil +// HasCaller reports whether this Entry contains caller information. +// +// Caller may be set explicitly, or populated at log time when +// [Logger.ReportCaller] is enabled. +// +// Deprecated: use [Entry.Caller] != nil instead. +// +//go:fix inline +func (entry Entry) HasCaller() bool { + return entry.Caller != nil } -func (entry *Entry) log(level Level, msg string) { - var buffer *bytes.Buffer +func (entry *Entry) logArgs(level Level, panicAfter bool, args ...any) { + entry.log(level, panicAfter, sprint(args...)) +} - newEntry := entry.Dup() +func (entry *Entry) logf(level Level, panicAfter bool, format string, args ...any) { + entry.log(level, panicAfter, fmt.Sprintf(format, args...)) +} + +// logln uses Sprintln for multiple arguments to preserve Println-style +// spacing between args, then trims the trailing newline. +func (entry *Entry) logln(level Level, panicAfter bool, args ...any) { + if len(args) <= 1 { + entry.log(level, panicAfter, sprint(args...)) + return + } + msg := fmt.Sprintln(args...) + msg = msg[:len(msg)-1] // Trim the newline added by Sprintln; logging adds its own. + entry.log(level, panicAfter, msg) +} + +// log writes msg at level. If panicAfter is true, it panics with the fully +// populated entry after hooks and output have completed. +// +// The explicit flag keeps panic behavior limited to Panic, Panicf, and +// Panicln while avoiding a return value used only as the panic value. +// See #1283 and commits f96066e and 5f8c666. +func (entry *Entry) log(level Level, panicAfter bool, msg string) { + newEntry := entry.dup() + newEntry.Data = maps.Clone(entry.Data) if newEntry.Time.IsZero() { newEntry.Time = time.Now() @@ -233,17 +319,24 @@ func (entry *Entry) log(level Level, msg string) { newEntry.Level = level newEntry.Message = msg - newEntry.Logger.mu.Lock() - reportCaller := newEntry.Logger.ReportCaller + logger := newEntry.Logger + logger.mu.Lock() + reportCaller := logger.ReportCaller bufPool := newEntry.getBufferPool() - newEntry.Logger.mu.Unlock() + logger.mu.Unlock() - if reportCaller { + // Preserve explicitly set caller information. + if reportCaller && newEntry.Caller == nil { newEntry.Caller = getCaller() } - newEntry.fireHooks() - buffer = bufPool.Get() + // Select hooks based on the level for this log call. Hooks receive the + // Entry and may mutate it, but that does not affect which hooks are + // fired for this event. + hooks := logger.hooksForLevel(level) + newEntry.fireHooks(hooks) + + buffer := bufPool.Get() defer func() { newEntry.Buffer = nil buffer.Reset() @@ -251,15 +344,12 @@ func (entry *Entry) log(level Level, msg string) { }() buffer.Reset() newEntry.Buffer = buffer - newEntry.write() - newEntry.Buffer = nil - // To avoid Entry#log() returning a value that only would make sense for - // panic() to use in Entry#Panic(), we avoid the allocation by checking - // directly here. - if level <= PanicLevel { + // Panic here so the panic value contains the fully populated entry without + // requiring log to return it to the caller. + if panicAfter { panic(newEntry) } } @@ -271,175 +361,207 @@ func (entry *Entry) getBufferPool() (pool BufferPool) { return bufferPool } -func (entry *Entry) fireHooks() { - var tmpHooks LevelHooks - entry.Logger.mu.Lock() - tmpHooks = make(LevelHooks, len(entry.Logger.Hooks)) - for k, v := range entry.Logger.Hooks { - tmpHooks[k] = v - } - entry.Logger.mu.Unlock() - - err := tmpHooks.Fire(entry.Level, entry) - if err != nil { - fmt.Fprintf(os.Stderr, "Failed to fire hook: %v\n", err) +func (entry *Entry) fireHooks(hooks []Hook) { + for _, hook := range hooks { + if err := hook.Fire(entry); err != nil { + _, _ = fmt.Fprintln(os.Stderr, "Failed to fire hook:", err) + return + } } } func (entry *Entry) write() { + // Snapshot the formatter under the lock to protect against concurrent + // SetFormatter calls, then release the lock before formatting. + // This avoids a deadlock when Format() triggers reentrant logging (e.g., + // a field's MarshalJSON calls logrus). See #1448, #1440. entry.Logger.mu.Lock() - defer entry.Logger.mu.Unlock() - serialized, err := entry.Logger.Formatter.Format(entry) + formatter := entry.Logger.Formatter + entry.Logger.mu.Unlock() + + serialized, err := formatter.Format(entry) if err != nil { - fmt.Fprintf(os.Stderr, "Failed to obtain reader, %v\n", err) + _, _ = fmt.Fprintln(os.Stderr, "Failed to format entry:", err) return } + + // Re-acquire the lock to serialize writes to the underlying io.Writer. + entry.Logger.mu.Lock() + defer entry.Logger.mu.Unlock() if _, err := entry.Logger.Out.Write(serialized); err != nil { - fmt.Fprintf(os.Stderr, "Failed to write to log, %v\n", err) + _, _ = fmt.Fprintln(os.Stderr, "Failed to write to log:", err) } } -// Log will log a message at the level given as parameter. -// Warning: using Log at Panic or Fatal level will not respectively Panic nor Exit. -// For this behaviour Entry.Panic or Entry.Fatal should be used instead. -func (entry *Entry) Log(level Level, args ...interface{}) { +// Log logs a message at the specified level. +// +// Using Log with [PanicLevel] or [FatalLevel] intentionally does not +// trigger a panic or exit. Log treats the level as logging severity only; +// use [Entry.Panic] or [Entry.Fatal] when those side effects are desired. +func (entry *Entry) Log(level Level, args ...any) { + const panicAfter = false if entry.Logger.IsLevelEnabled(level) { - entry.log(level, fmt.Sprint(args...)) + entry.logArgs(level, panicAfter, args...) } } -func (entry *Entry) Trace(args ...interface{}) { +func (entry *Entry) Trace(args ...any) { entry.Log(TraceLevel, args...) } -func (entry *Entry) Debug(args ...interface{}) { +func (entry *Entry) Debug(args ...any) { entry.Log(DebugLevel, args...) } -func (entry *Entry) Print(args ...interface{}) { +func (entry *Entry) Print(args ...any) { entry.Info(args...) } -func (entry *Entry) Info(args ...interface{}) { +func (entry *Entry) Info(args ...any) { entry.Log(InfoLevel, args...) } -func (entry *Entry) Warn(args ...interface{}) { +func (entry *Entry) Warn(args ...any) { entry.Log(WarnLevel, args...) } -func (entry *Entry) Warning(args ...interface{}) { +func (entry *Entry) Warning(args ...any) { entry.Warn(args...) } -func (entry *Entry) Error(args ...interface{}) { +func (entry *Entry) Error(args ...any) { entry.Log(ErrorLevel, args...) } -func (entry *Entry) Fatal(args ...interface{}) { +func (entry *Entry) Fatal(args ...any) { entry.Log(FatalLevel, args...) entry.Logger.Exit(1) } -func (entry *Entry) Panic(args ...interface{}) { - entry.Log(PanicLevel, args...) +func (entry *Entry) Panic(args ...any) { + const panicAfter = true + if entry.Logger.IsLevelEnabled(PanicLevel) { + entry.logArgs(PanicLevel, panicAfter, args...) + } } // Entry Printf family functions -func (entry *Entry) Logf(level Level, format string, args ...interface{}) { +// Logf logs a formatted message at the specified level. +// +// Using Logf with [PanicLevel] or [FatalLevel] intentionally does not +// trigger a panic or exit. Logf treats the level as logging severity only; +// use [Entry.Panicf] or [Entry.Fatalf] when those side effects are desired. +func (entry *Entry) Logf(level Level, format string, args ...any) { + const panicAfter = false if entry.Logger.IsLevelEnabled(level) { - entry.Log(level, fmt.Sprintf(format, args...)) + entry.logf(level, panicAfter, format, args...) } } -func (entry *Entry) Tracef(format string, args ...interface{}) { +func (entry *Entry) Tracef(format string, args ...any) { entry.Logf(TraceLevel, format, args...) } -func (entry *Entry) Debugf(format string, args ...interface{}) { +func (entry *Entry) Debugf(format string, args ...any) { entry.Logf(DebugLevel, format, args...) } -func (entry *Entry) Infof(format string, args ...interface{}) { +func (entry *Entry) Infof(format string, args ...any) { entry.Logf(InfoLevel, format, args...) } -func (entry *Entry) Printf(format string, args ...interface{}) { +func (entry *Entry) Printf(format string, args ...any) { entry.Infof(format, args...) } -func (entry *Entry) Warnf(format string, args ...interface{}) { +func (entry *Entry) Warnf(format string, args ...any) { entry.Logf(WarnLevel, format, args...) } -func (entry *Entry) Warningf(format string, args ...interface{}) { +func (entry *Entry) Warningf(format string, args ...any) { entry.Warnf(format, args...) } -func (entry *Entry) Errorf(format string, args ...interface{}) { +func (entry *Entry) Errorf(format string, args ...any) { entry.Logf(ErrorLevel, format, args...) } -func (entry *Entry) Fatalf(format string, args ...interface{}) { +func (entry *Entry) Fatalf(format string, args ...any) { entry.Logf(FatalLevel, format, args...) entry.Logger.Exit(1) } -func (entry *Entry) Panicf(format string, args ...interface{}) { - entry.Logf(PanicLevel, format, args...) +func (entry *Entry) Panicf(format string, args ...any) { + const panicAfter = true + if entry.Logger.IsLevelEnabled(PanicLevel) { + entry.logf(PanicLevel, panicAfter, format, args...) + } } // Entry Println family functions -func (entry *Entry) Logln(level Level, args ...interface{}) { +// Logln logs a message at the specified level with Println-style spacing. +// +// Using Logln with [PanicLevel] or [FatalLevel] intentionally does not +// trigger a panic or exit. Logln treats the level as logging severity only; +// use [Entry.Panicln] or [Entry.Fatalln] when those side effects are desired. +func (entry *Entry) Logln(level Level, args ...any) { + const panicAfter = false if entry.Logger.IsLevelEnabled(level) { - entry.Log(level, entry.sprintlnn(args...)) + entry.logln(level, panicAfter, args...) } } -func (entry *Entry) Traceln(args ...interface{}) { +func (entry *Entry) Traceln(args ...any) { entry.Logln(TraceLevel, args...) } -func (entry *Entry) Debugln(args ...interface{}) { +func (entry *Entry) Debugln(args ...any) { entry.Logln(DebugLevel, args...) } -func (entry *Entry) Infoln(args ...interface{}) { +func (entry *Entry) Infoln(args ...any) { entry.Logln(InfoLevel, args...) } -func (entry *Entry) Println(args ...interface{}) { +func (entry *Entry) Println(args ...any) { entry.Infoln(args...) } -func (entry *Entry) Warnln(args ...interface{}) { +func (entry *Entry) Warnln(args ...any) { entry.Logln(WarnLevel, args...) } -func (entry *Entry) Warningln(args ...interface{}) { +func (entry *Entry) Warningln(args ...any) { entry.Warnln(args...) } -func (entry *Entry) Errorln(args ...interface{}) { +func (entry *Entry) Errorln(args ...any) { entry.Logln(ErrorLevel, args...) } -func (entry *Entry) Fatalln(args ...interface{}) { +func (entry *Entry) Fatalln(args ...any) { entry.Logln(FatalLevel, args...) entry.Logger.Exit(1) } -func (entry *Entry) Panicln(args ...interface{}) { - entry.Logln(PanicLevel, args...) +func (entry *Entry) Panicln(args ...any) { + const panicAfter = true + if entry.Logger.IsLevelEnabled(PanicLevel) { + entry.logln(PanicLevel, panicAfter, args...) + } } -// sprintlnn => Sprint no newline. This is to get the behavior of how -// fmt.Sprintln where spaces are always added between operands, regardless of -// their type. Instead of vendoring the Sprintln implementation to spare a -// string allocation, we do the simplest thing. -func (entry *Entry) sprintlnn(args ...interface{}) string { - msg := fmt.Sprintln(args...) - return msg[:len(msg)-1] +// sprint is fmt.Sprint with fast paths for zero or one string argument. +func sprint(args ...any) string { + switch len(args) { + case 0: + return "" + case 1: + if msg, ok := args[0].(string); ok { + return msg + } + } + return fmt.Sprint(args...) } diff --git a/vendor/github.com/sirupsen/logrus/exported.go b/vendor/github.com/sirupsen/logrus/exported.go index 017c30ce678..8b261c124dd 100644 --- a/vendor/github.com/sirupsen/logrus/exported.go +++ b/vendor/github.com/sirupsen/logrus/exported.go @@ -6,11 +6,12 @@ import ( "time" ) -var ( - // std is the name of the standard logger in stdlib `log` - std = New() -) +// std is the package-level standard logger, similar to the default logger +// in the stdlib [log] package. +var std = New() +// StandardLogger returns the package-level standard logger used by +// the top-level logging functions. func StandardLogger() *Logger { return std } @@ -41,7 +42,7 @@ func GetLevel() Level { return std.GetLevel() } -// IsLevelEnabled checks if the log level of the standard logger is greater than the level param +// IsLevelEnabled checks if logging for the given level is enabled for the standard logger. func IsLevelEnabled(level Level) bool { return std.IsLevelEnabled(level) } @@ -51,9 +52,10 @@ func AddHook(hook Hook) { std.AddHook(hook) } -// WithError creates an entry from the standard logger and adds an error to it, using the value defined in ErrorKey as key. +// WithError creates an entry from the standard logger and adds an error to it, +// using the value defined in [ErrorKey] as key. func WithError(err error) *Entry { - return std.WithField(ErrorKey, err) + return std.WithError(err) } // WithContext creates an entry from the standard logger and adds a context to it. @@ -61,210 +63,203 @@ func WithContext(ctx context.Context) *Entry { return std.WithContext(ctx) } -// WithField creates an entry from the standard logger and adds a field to -// it. If you want multiple fields, use `WithFields`. -// -// Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal -// or Panic on the Entry it returns. -func WithField(key string, value interface{}) *Entry { +// WithField creates an entry from the standard logger and adds a single field. +// For multiple fields, prefer [WithFields] over chaining WithField calls. +func WithField(key string, value any) *Entry { return std.WithField(key, value) } -// WithFields creates an entry from the standard logger and adds multiple -// fields to it. This is simply a helper for `WithField`, invoking it -// once for each field. -// -// Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal -// or Panic on the Entry it returns. +// WithFields creates an entry from the standard logger and adds the fields to it. func WithFields(fields Fields) *Entry { return std.WithFields(fields) } -// WithTime creates an entry from the standard logger and overrides the time of -// logs generated with it. -// -// Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal -// or Panic on the Entry it returns. +// WithTime creates an entry from the standard logger and overrides the time +// used for logs generated with it. func WithTime(t time.Time) *Entry { return std.WithTime(t) } -// Trace logs a message at level Trace on the standard logger. -func Trace(args ...interface{}) { +// Trace logs a message at level [TraceLevel] on the standard logger. +func Trace(args ...any) { std.Trace(args...) } -// Debug logs a message at level Debug on the standard logger. -func Debug(args ...interface{}) { +// Debug logs a message at level [DebugLevel] on the standard logger. +func Debug(args ...any) { std.Debug(args...) } -// Print logs a message at level Info on the standard logger. -func Print(args ...interface{}) { +// Print logs a message at level [InfoLevel] on the standard logger. +func Print(args ...any) { std.Print(args...) } -// Info logs a message at level Info on the standard logger. -func Info(args ...interface{}) { +// Info logs a message at level [InfoLevel] on the standard logger. +func Info(args ...any) { std.Info(args...) } -// Warn logs a message at level Warn on the standard logger. -func Warn(args ...interface{}) { +// Warn logs a message at level [WarnLevel] on the standard logger. +func Warn(args ...any) { std.Warn(args...) } -// Warning logs a message at level Warn on the standard logger. -func Warning(args ...interface{}) { +// Warning logs a message at level [WarnLevel] on the standard logger. +func Warning(args ...any) { std.Warning(args...) } -// Error logs a message at level Error on the standard logger. -func Error(args ...interface{}) { +// Error logs a message at level [ErrorLevel] on the standard logger. +func Error(args ...any) { std.Error(args...) } -// Panic logs a message at level Panic on the standard logger. -func Panic(args ...interface{}) { +// Panic logs a message at level [PanicLevel] on the standard logger. +func Panic(args ...any) { std.Panic(args...) } -// Fatal logs a message at level Fatal on the standard logger then the process will exit with status set to 1. -func Fatal(args ...interface{}) { +// Fatal logs a message at level [FatalLevel] on the standard logger, +// then exits the process with status 1. +func Fatal(args ...any) { std.Fatal(args...) } -// TraceFn logs a message from a func at level Trace on the standard logger. +// TraceFn logs a message from a func at level [TraceLevel] on the standard logger. func TraceFn(fn LogFunction) { std.TraceFn(fn) } -// DebugFn logs a message from a func at level Debug on the standard logger. +// DebugFn logs a message from a func at level [DebugLevel] on the standard logger. func DebugFn(fn LogFunction) { std.DebugFn(fn) } -// PrintFn logs a message from a func at level Info on the standard logger. +// PrintFn logs a message from a func at level [InfoLevel] on the standard logger. func PrintFn(fn LogFunction) { std.PrintFn(fn) } -// InfoFn logs a message from a func at level Info on the standard logger. +// InfoFn logs a message from a func at level [InfoLevel] on the standard logger. func InfoFn(fn LogFunction) { std.InfoFn(fn) } -// WarnFn logs a message from a func at level Warn on the standard logger. +// WarnFn logs a message from a func at level [WarnLevel] on the standard logger. func WarnFn(fn LogFunction) { std.WarnFn(fn) } -// WarningFn logs a message from a func at level Warn on the standard logger. +// WarningFn logs a message from a func at level [WarnLevel] on the standard logger. func WarningFn(fn LogFunction) { std.WarningFn(fn) } -// ErrorFn logs a message from a func at level Error on the standard logger. +// ErrorFn logs a message from a func at level [ErrorLevel] on the standard logger. func ErrorFn(fn LogFunction) { std.ErrorFn(fn) } -// PanicFn logs a message from a func at level Panic on the standard logger. +// PanicFn logs a message from a func at level [PanicLevel] on the standard logger. func PanicFn(fn LogFunction) { std.PanicFn(fn) } -// FatalFn logs a message from a func at level Fatal on the standard logger then the process will exit with status set to 1. +// FatalFn logs a message from a func at level [FatalLevel] on the standard logger, +// then exits the process with status 1. func FatalFn(fn LogFunction) { std.FatalFn(fn) } -// Tracef logs a message at level Trace on the standard logger. -func Tracef(format string, args ...interface{}) { +// Tracef logs a message at level [TraceLevel] on the standard logger. +func Tracef(format string, args ...any) { std.Tracef(format, args...) } -// Debugf logs a message at level Debug on the standard logger. -func Debugf(format string, args ...interface{}) { +// Debugf logs a message at level [DebugLevel] on the standard logger. +func Debugf(format string, args ...any) { std.Debugf(format, args...) } -// Printf logs a message at level Info on the standard logger. -func Printf(format string, args ...interface{}) { +// Printf logs a message at level [InfoLevel] on the standard logger. +func Printf(format string, args ...any) { std.Printf(format, args...) } -// Infof logs a message at level Info on the standard logger. -func Infof(format string, args ...interface{}) { +// Infof logs a message at level [InfoLevel] on the standard logger. +func Infof(format string, args ...any) { std.Infof(format, args...) } -// Warnf logs a message at level Warn on the standard logger. -func Warnf(format string, args ...interface{}) { +// Warnf logs a message at level [WarnLevel] on the standard logger. +func Warnf(format string, args ...any) { std.Warnf(format, args...) } -// Warningf logs a message at level Warn on the standard logger. -func Warningf(format string, args ...interface{}) { +// Warningf logs a message at level [WarnLevel] on the standard logger. +func Warningf(format string, args ...any) { std.Warningf(format, args...) } -// Errorf logs a message at level Error on the standard logger. -func Errorf(format string, args ...interface{}) { +// Errorf logs a message at level [ErrorLevel] on the standard logger. +func Errorf(format string, args ...any) { std.Errorf(format, args...) } -// Panicf logs a message at level Panic on the standard logger. -func Panicf(format string, args ...interface{}) { +// Panicf logs a message at level [PanicLevel] on the standard logger. +func Panicf(format string, args ...any) { std.Panicf(format, args...) } -// Fatalf logs a message at level Fatal on the standard logger then the process will exit with status set to 1. -func Fatalf(format string, args ...interface{}) { +// Fatalf logs a message at level [FatalLevel] on the standard logger, +// then exits the process with status 1. +func Fatalf(format string, args ...any) { std.Fatalf(format, args...) } -// Traceln logs a message at level Trace on the standard logger. -func Traceln(args ...interface{}) { +// Traceln logs a message at level [TraceLevel] on the standard logger. +func Traceln(args ...any) { std.Traceln(args...) } -// Debugln logs a message at level Debug on the standard logger. -func Debugln(args ...interface{}) { +// Debugln logs a message at level [DebugLevel] on the standard logger. +func Debugln(args ...any) { std.Debugln(args...) } -// Println logs a message at level Info on the standard logger. -func Println(args ...interface{}) { +// Println logs a message at level [InfoLevel] on the standard logger. +func Println(args ...any) { std.Println(args...) } -// Infoln logs a message at level Info on the standard logger. -func Infoln(args ...interface{}) { +// Infoln logs a message at level [InfoLevel] on the standard logger. +func Infoln(args ...any) { std.Infoln(args...) } -// Warnln logs a message at level Warn on the standard logger. -func Warnln(args ...interface{}) { +// Warnln logs a message at level [WarnLevel] on the standard logger. +func Warnln(args ...any) { std.Warnln(args...) } -// Warningln logs a message at level Warn on the standard logger. -func Warningln(args ...interface{}) { +// Warningln logs a message at level [WarnLevel] on the standard logger. +func Warningln(args ...any) { std.Warningln(args...) } -// Errorln logs a message at level Error on the standard logger. -func Errorln(args ...interface{}) { +// Errorln logs a message at level [ErrorLevel] on the standard logger. +func Errorln(args ...any) { std.Errorln(args...) } -// Panicln logs a message at level Panic on the standard logger. -func Panicln(args ...interface{}) { +// Panicln logs a message at level [PanicLevel] on the standard logger. +func Panicln(args ...any) { std.Panicln(args...) } -// Fatalln logs a message at level Fatal on the standard logger then the process will exit with status set to 1. -func Fatalln(args ...interface{}) { +// Fatalln logs a message at level [FatalLevel] on the standard logger, +// then exits the process with status 1. +func Fatalln(args ...any) { std.Fatalln(args...) } diff --git a/vendor/github.com/sirupsen/logrus/formatter.go b/vendor/github.com/sirupsen/logrus/formatter.go index 408883773eb..16f2e0e0fca 100644 --- a/vendor/github.com/sirupsen/logrus/formatter.go +++ b/vendor/github.com/sirupsen/logrus/formatter.go @@ -2,27 +2,40 @@ package logrus import "time" -// Default key names for the default fields const ( + // defaultTimestampFormat is the layout used to format entry timestamps + // when a formatter has not specified a custom TimestampFormat. + // It follows time.RFC3339 and is applied unless timestamps are disabled. defaultTimestampFormat = time.RFC3339 - FieldKeyMsg = "msg" - FieldKeyLevel = "level" - FieldKeyTime = "time" - FieldKeyLogrusError = "logrus_error" - FieldKeyFunc = "func" - FieldKeyFile = "file" + + // defaultFields is the number of commonly included predefined log entry fields + // (msg, level, time). It is used as a capacity hint when constructing + // intermediate collections during formatting (for example, the fixed key list). + // + // It does not include the optional "logrus_error", "func", or "file" fields. + defaultFields = 3 +) + +// Default key names for the default fields +const ( + FieldKeyMsg = "msg" + FieldKeyLevel = "level" + FieldKeyTime = "time" + FieldKeyLogrusError = "logrus_error" + FieldKeyFunc = "func" + FieldKeyFile = "file" ) -// The Formatter interface is used to implement a custom Formatter. It takes an -// `Entry`. It exposes all the fields, including the default ones: +// Formatter is implemented by types that format log entries. It receives an +// [*Entry], which contains: // -// * `entry.Data["msg"]`. The message passed from Info, Warn, Error .. -// * `entry.Data["time"]`. The timestamp. -// * `entry.Data["level"]. The level the entry was logged at. +// - entry.Message: the message passed to logging methods such as [Info], [Warn], [Error] +// - entry.Time: the timestamp +// - entry.Level: the log level // -// Any additional fields added with `WithField` or `WithFields` are also in -// `entry.Data`. Format is expected to return an array of bytes which are then -// logged to `logger.Out`. +// Additional fields added with [WithField] or [WithFields] are available in +// [Entry.Data]. Format should return the formatted log entry as a byte slice, +// which is written to [Logger.Out]. type Formatter interface { Format(*Entry) ([]byte, error) } @@ -30,12 +43,12 @@ type Formatter interface { // This is to not silently overwrite `time`, `msg`, `func` and `level` fields when // dumping it. If this code wasn't there doing: // -// logrus.WithField("level", 1).Info("hello") +// logrus.WithField("level", 1).Info("hello") // // Would just silently drop the user provided level. Instead with this code // it'll logged as: // -// {"level": "info", "fields.level": 1, "msg": "hello", "time": "..."} +// {"level": "info", "fields.level": 1, "msg": "hello", "time": "..."} // // It's not exported because it's still using Data in an opinionated way. It's to // avoid code duplication between the two default formatters. diff --git a/vendor/github.com/sirupsen/logrus/json_formatter.go b/vendor/github.com/sirupsen/logrus/json_formatter.go index c96dc5636bf..fac7695e9e7 100644 --- a/vendor/github.com/sirupsen/logrus/json_formatter.go +++ b/vendor/github.com/sirupsen/logrus/json_formatter.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" "runtime" + "strconv" ) type fieldKey string @@ -20,7 +21,13 @@ func (f FieldMap) resolve(key fieldKey) string { return string(key) } -// JSONFormatter formats logs into parsable json +// JSONFormatter formats logs into parsable JSON. +// +// Fields from [Entry.Data] are included in the JSON object together with the +// standard fields derived from the entry. If a field conflicts with a standard +// field, it is prefixed with "fields.". Standard field names can be customized +// through FieldMap. When DataKey is set, fields from [Entry.Data] are nested +// under that key instead. type JSONFormatter struct { // TimestampFormat sets the format used for marshaling timestamps. // The format to use is the same than for time.Format or time.Parse from the standard @@ -61,7 +68,8 @@ type JSONFormatter struct { // Format renders a single log entry func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) { - data := make(Fields, len(entry.Data)+4) + caller := entry.Caller + data := make(Fields, len(entry.Data)+defaultFields) for k, v := range entry.Data { switch v := v.(type) { case error: @@ -73,13 +81,14 @@ func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) { } } - if f.DataKey != "" { - newData := make(Fields, 4) + if f.DataKey != "" && len(entry.Data) > 0 { + newData := make(Fields, defaultFields+1) newData[f.DataKey] = data data = newData } - prefixFieldClashes(data, f.FieldMap, entry.HasCaller()) + hasCaller := caller != nil + prefixFieldClashes(data, f.FieldMap, hasCaller) timestampFormat := f.TimestampFormat if timestampFormat == "" { @@ -94,11 +103,13 @@ func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) { } data[f.FieldMap.resolve(FieldKeyMsg)] = entry.Message data[f.FieldMap.resolve(FieldKeyLevel)] = entry.Level.String() - if entry.HasCaller() { - funcVal := entry.Caller.Function - fileVal := fmt.Sprintf("%s:%d", entry.Caller.File, entry.Caller.Line) + if caller != nil { + var funcVal, fileVal string if f.CallerPrettyfier != nil { - funcVal, fileVal = f.CallerPrettyfier(entry.Caller) + funcVal, fileVal = f.CallerPrettyfier(caller) + } else { + funcVal = caller.Function + fileVal = caller.File + ":" + strconv.FormatInt(int64(caller.Line), 10) } if funcVal != "" { data[f.FieldMap.resolve(FieldKeyFunc)] = funcVal @@ -108,11 +119,9 @@ func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) { } } - var b *bytes.Buffer - if entry.Buffer != nil { - b = entry.Buffer - } else { - b = &bytes.Buffer{} + b := entry.Buffer + if b == nil { + b = new(bytes.Buffer) } encoder := json.NewEncoder(b) diff --git a/vendor/github.com/sirupsen/logrus/level.go b/vendor/github.com/sirupsen/logrus/level.go new file mode 100644 index 00000000000..7bd4255d3ce --- /dev/null +++ b/vendor/github.com/sirupsen/logrus/level.go @@ -0,0 +1,101 @@ +package logrus + +import ( + "strings" + "sync" +) + +const ( + ansiReset = "\x1b[0m" // reset attributes + ansiRed = "\x1b[31m" // red + ansiYellow = "\x1b[33m" // yellow + ansiCyan = "\x1b[36m" // cyan + ansiDimCyan = "\x1b[2;36m" // dim cyan + ansiDimWhite = "\x1b[2;37m" // dim white (light gray) +) + +type lvlPrefix struct { + full string + truncated string + padded string +} + +func colorize(level Level, s string) string { + color := ansiCyan + switch level { + case TraceLevel: + color = ansiDimWhite + case DebugLevel: + color = ansiDimCyan + case WarnLevel: + color = ansiYellow + case ErrorLevel, FatalLevel, PanicLevel: + color = ansiRed + case InfoLevel: + color = ansiCyan + } + return color + s + ansiReset +} + +func formatLevel(level Level, disableTrunc, pad bool, maxLen int) string { + upper := strings.ToUpper(level.String()) + + if pad && maxLen > len(upper) { + upper += strings.Repeat(" ", maxLen-len(upper)) + } + + if !pad && !disableTrunc && len(upper) > 4 { + upper = upper[:4] + } + + return colorize(level, upper) +} + +var levelPrefixOnce = sync.OnceValues(func() (map[Level]lvlPrefix, lvlPrefix) { + var maxLevel Level + maxLen := 0 + for _, lvl := range AllLevels { + if lvl > maxLevel { + maxLevel = lvl + } + if l := len(lvl.String()); l > maxLen { + maxLen = l + } + } + + prefix := make(map[Level]lvlPrefix, len(AllLevels)) + for _, lvl := range AllLevels { + prefix[lvl] = lvlPrefix{ + full: formatLevel(lvl, true, false, maxLen), + truncated: formatLevel(lvl, false, false, maxLen), + padded: formatLevel(lvl, true, true, maxLen), + } + } + + unknownLevel := maxLevel + 1 + unknown := lvlPrefix{ + full: formatLevel(unknownLevel, true, false, maxLen), + truncated: formatLevel(unknownLevel, false, false, maxLen), + padded: formatLevel(unknownLevel, true, true, maxLen), + } + + return prefix, unknown +}) + +func levelPrefix(level Level, disableTrunc, pad bool) string { + prefix, unknown := levelPrefixOnce() + + p, ok := prefix[level] + if !ok { + p = unknown + } + + switch { + case pad: + return p.padded + case !disableTrunc: + return p.truncated + default: + return p.full + } +} diff --git a/vendor/github.com/sirupsen/logrus/logger.go b/vendor/github.com/sirupsen/logrus/logger.go index f5b8c439ee8..17a46e6a654 100644 --- a/vendor/github.com/sirupsen/logrus/logger.go +++ b/vendor/github.com/sirupsen/logrus/logger.go @@ -12,17 +12,19 @@ import ( // LogFunction For big messages, it can be more efficient to pass a function // and only call it if the log level is actually enables rather than // generating the log message and then checking if the level is enabled -type LogFunction func() []interface{} +type LogFunction func() []any type Logger struct { // The logs are `io.Copy`'d to this in a mutex. It's common to set this to a // file, or leave it default which is `os.Stderr`. You can also set this to // something more adventurous, such as logging to Kafka. Out io.Writer + // Hooks for the logger instance. These allow firing events based on logging // levels and log entries. For example, to send errors to an error tracking // service, log to StatsD or dump the core on fatal errors. Hooks LevelHooks + // All log entries pass through the formatter before logged to Out. The // included formatters are `TextFormatter` and `JSONFormatter` for which // TextFormatter is the default. In development (when a TTY is attached) it @@ -38,37 +40,44 @@ type Logger struct { // to) `logrus.Info`, which allows Info(), Warn(), Error() and Fatal() to be // logged. Level Level + // Used to sync writing to the log. Locking is enabled by Default - mu MutexWrap + mu mutexWrap + // Reusable empty entry entryPool sync.Pool + // Function to exit the application, defaults to `os.Exit()` - ExitFunc exitFunc + ExitFunc func(int) + // The buffer pool used to format the log. If it is nil, the default global // buffer pool will be used. BufferPool BufferPool } -type exitFunc func(int) +// MutexWrap is the mutex implementation used by [Logger]. +// +// Deprecated: MutexWrap is an implementation detail of Logger and should not be used directly. +type MutexWrap = mutexWrap -type MutexWrap struct { +type mutexWrap struct { lock sync.Mutex disabled bool } -func (mw *MutexWrap) Lock() { +func (mw *mutexWrap) Lock() { if !mw.disabled { mw.lock.Lock() } } -func (mw *MutexWrap) Unlock() { +func (mw *mutexWrap) Unlock() { if !mw.disabled { mw.lock.Unlock() } } -func (mw *MutexWrap) Disable() { +func (mw *mutexWrap) Disable() { mw.disabled = true } @@ -104,7 +113,7 @@ func (logger *Logger) newEntry() *Entry { } func (logger *Logger) releaseEntry(entry *Entry) { - entry.Data = map[string]interface{}{} + entry.Data = map[string]any{} logger.entryPool.Put(entry) } @@ -112,7 +121,7 @@ func (logger *Logger) releaseEntry(entry *Entry) { // Debug, Print, Info, Warn, Error, Fatal or Panic must be then applied to // this new returned entry. // If you want multiple fields, use `WithFields`. -func (logger *Logger) WithField(key string, value interface{}) *Entry { +func (logger *Logger) WithField(key string, value any) *Entry { entry := logger.newEntry() defer logger.releaseEntry(entry) return entry.WithField(key, value) @@ -148,7 +157,12 @@ func (logger *Logger) WithTime(t time.Time) *Entry { return entry.WithTime(t) } -func (logger *Logger) Logf(level Level, format string, args ...interface{}) { +// Logf logs a formatted message at the specified level. +// +// Using Logf with [PanicLevel] or [FatalLevel] intentionally does not +// trigger a panic or exit. Logf treats the level as logging severity only; +// use [Logger.Panicf] or [Logger.Fatalf] when those side effects are desired. +func (logger *Logger) Logf(level Level, format string, args ...any) { if logger.IsLevelEnabled(level) { entry := logger.newEntry() entry.Logf(level, format, args...) @@ -156,49 +170,55 @@ func (logger *Logger) Logf(level Level, format string, args ...interface{}) { } } -func (logger *Logger) Tracef(format string, args ...interface{}) { +func (logger *Logger) Tracef(format string, args ...any) { logger.Logf(TraceLevel, format, args...) } -func (logger *Logger) Debugf(format string, args ...interface{}) { +func (logger *Logger) Debugf(format string, args ...any) { logger.Logf(DebugLevel, format, args...) } -func (logger *Logger) Infof(format string, args ...interface{}) { +func (logger *Logger) Infof(format string, args ...any) { logger.Logf(InfoLevel, format, args...) } -func (logger *Logger) Printf(format string, args ...interface{}) { +func (logger *Logger) Printf(format string, args ...any) { entry := logger.newEntry() entry.Printf(format, args...) logger.releaseEntry(entry) } -func (logger *Logger) Warnf(format string, args ...interface{}) { +func (logger *Logger) Warnf(format string, args ...any) { logger.Logf(WarnLevel, format, args...) } -func (logger *Logger) Warningf(format string, args ...interface{}) { +func (logger *Logger) Warningf(format string, args ...any) { logger.Warnf(format, args...) } -func (logger *Logger) Errorf(format string, args ...interface{}) { +func (logger *Logger) Errorf(format string, args ...any) { logger.Logf(ErrorLevel, format, args...) } -func (logger *Logger) Fatalf(format string, args ...interface{}) { +func (logger *Logger) Fatalf(format string, args ...any) { logger.Logf(FatalLevel, format, args...) logger.Exit(1) } -func (logger *Logger) Panicf(format string, args ...interface{}) { - logger.Logf(PanicLevel, format, args...) +func (logger *Logger) Panicf(format string, args ...any) { + if logger.IsLevelEnabled(PanicLevel) { + entry := logger.newEntry() + defer logger.releaseEntry(entry) + entry.Panicf(format, args...) + } } -// Log will log a message at the level given as parameter. -// Warning: using Log at Panic or Fatal level will not respectively Panic nor Exit. -// For this behaviour Logger.Panic or Logger.Fatal should be used instead. -func (logger *Logger) Log(level Level, args ...interface{}) { +// Log logs a message at the specified level. +// +// Using Log with [PanicLevel] or [FatalLevel] intentionally does not +// trigger a panic or exit. Log treats the level as logging severity only; +// use [Logger.Panic] or [Logger.Fatal] when those side effects are desired. +func (logger *Logger) Log(level Level, args ...any) { if logger.IsLevelEnabled(level) { entry := logger.newEntry() entry.Log(level, args...) @@ -206,6 +226,11 @@ func (logger *Logger) Log(level Level, args ...interface{}) { } } +// LogFn logs a message returned by fn at the specified level. +// +// Using LogFn with [PanicLevel] or [FatalLevel] intentionally does not +// trigger a panic or exit. LogFn treats the level as logging severity only; +// use [Logger.PanicFn] or [Logger.FatalFn] when those side effects are desired. func (logger *Logger) LogFn(level Level, fn LogFunction) { if logger.IsLevelEnabled(level) { entry := logger.newEntry() @@ -214,43 +239,47 @@ func (logger *Logger) LogFn(level Level, fn LogFunction) { } } -func (logger *Logger) Trace(args ...interface{}) { +func (logger *Logger) Trace(args ...any) { logger.Log(TraceLevel, args...) } -func (logger *Logger) Debug(args ...interface{}) { +func (logger *Logger) Debug(args ...any) { logger.Log(DebugLevel, args...) } -func (logger *Logger) Info(args ...interface{}) { +func (logger *Logger) Info(args ...any) { logger.Log(InfoLevel, args...) } -func (logger *Logger) Print(args ...interface{}) { +func (logger *Logger) Print(args ...any) { entry := logger.newEntry() entry.Print(args...) logger.releaseEntry(entry) } -func (logger *Logger) Warn(args ...interface{}) { +func (logger *Logger) Warn(args ...any) { logger.Log(WarnLevel, args...) } -func (logger *Logger) Warning(args ...interface{}) { +func (logger *Logger) Warning(args ...any) { logger.Warn(args...) } -func (logger *Logger) Error(args ...interface{}) { +func (logger *Logger) Error(args ...any) { logger.Log(ErrorLevel, args...) } -func (logger *Logger) Fatal(args ...interface{}) { +func (logger *Logger) Fatal(args ...any) { logger.Log(FatalLevel, args...) logger.Exit(1) } -func (logger *Logger) Panic(args ...interface{}) { - logger.Log(PanicLevel, args...) +func (logger *Logger) Panic(args ...any) { + if logger.IsLevelEnabled(PanicLevel) { + entry := logger.newEntry() + defer logger.releaseEntry(entry) + entry.Panic(args...) + } } func (logger *Logger) TraceFn(fn LogFunction) { @@ -289,10 +318,19 @@ func (logger *Logger) FatalFn(fn LogFunction) { } func (logger *Logger) PanicFn(fn LogFunction) { - logger.LogFn(PanicLevel, fn) + if logger.IsLevelEnabled(PanicLevel) { + entry := logger.newEntry() + defer logger.releaseEntry(entry) + entry.Panic(fn()...) + } } -func (logger *Logger) Logln(level Level, args ...interface{}) { +// Logln logs a message at the specified level with Println-style spacing. +// +// Using Logln with [PanicLevel] or [FatalLevel] intentionally does not +// trigger a panic or exit. Logln treats the level as logging severity only; +// use [Logger.Panicln] or [Logger.Fatalln] when those side effects are desired. +func (logger *Logger) Logln(level Level, args ...any) { if logger.IsLevelEnabled(level) { entry := logger.newEntry() entry.Logln(level, args...) @@ -300,43 +338,47 @@ func (logger *Logger) Logln(level Level, args ...interface{}) { } } -func (logger *Logger) Traceln(args ...interface{}) { +func (logger *Logger) Traceln(args ...any) { logger.Logln(TraceLevel, args...) } -func (logger *Logger) Debugln(args ...interface{}) { +func (logger *Logger) Debugln(args ...any) { logger.Logln(DebugLevel, args...) } -func (logger *Logger) Infoln(args ...interface{}) { +func (logger *Logger) Infoln(args ...any) { logger.Logln(InfoLevel, args...) } -func (logger *Logger) Println(args ...interface{}) { +func (logger *Logger) Println(args ...any) { entry := logger.newEntry() entry.Println(args...) logger.releaseEntry(entry) } -func (logger *Logger) Warnln(args ...interface{}) { +func (logger *Logger) Warnln(args ...any) { logger.Logln(WarnLevel, args...) } -func (logger *Logger) Warningln(args ...interface{}) { +func (logger *Logger) Warningln(args ...any) { logger.Warnln(args...) } -func (logger *Logger) Errorln(args ...interface{}) { +func (logger *Logger) Errorln(args ...any) { logger.Logln(ErrorLevel, args...) } -func (logger *Logger) Fatalln(args ...interface{}) { +func (logger *Logger) Fatalln(args ...any) { logger.Logln(FatalLevel, args...) logger.Exit(1) } -func (logger *Logger) Panicln(args ...interface{}) { - logger.Logln(PanicLevel, args...) +func (logger *Logger) Panicln(args ...any) { + if logger.IsLevelEnabled(PanicLevel) { + entry := logger.newEntry() + defer logger.releaseEntry(entry) + entry.Panicln(args...) + } } func (logger *Logger) Exit(code int) { @@ -375,7 +417,22 @@ func (logger *Logger) AddHook(hook Hook) { logger.Hooks.Add(hook) } -// IsLevelEnabled checks if the log level of the logger is greater than the level param +// hooksForLevel returns a snapshot of the hooks registered for the given level. +// The returned slice is a shallow copy and may be used without holding logger.mu. +func (logger *Logger) hooksForLevel(level Level) []Hook { + logger.mu.Lock() + hooks := logger.Hooks[level] + if len(hooks) == 0 { + logger.mu.Unlock() + return nil + } + out := make([]Hook, len(hooks)) + copy(out, hooks) + logger.mu.Unlock() + return out +} + +// IsLevelEnabled checks if logging for the given level is enabled. func (logger *Logger) IsLevelEnabled(level Level) bool { return logger.level() >= level } @@ -394,6 +451,7 @@ func (logger *Logger) SetOutput(output io.Writer) { logger.Out = output } +// SetReportCaller sets whether the caller stack frame must be logged. func (logger *Logger) SetReportCaller(reportCaller bool) { logger.mu.Lock() defer logger.mu.Unlock() @@ -403,9 +461,9 @@ func (logger *Logger) SetReportCaller(reportCaller bool) { // ReplaceHooks replaces the logger hooks and returns the old ones func (logger *Logger) ReplaceHooks(hooks LevelHooks) LevelHooks { logger.mu.Lock() + defer logger.mu.Unlock() oldHooks := logger.Hooks logger.Hooks = hooks - logger.mu.Unlock() return oldHooks } diff --git a/vendor/github.com/sirupsen/logrus/logrus.go b/vendor/github.com/sirupsen/logrus/logrus.go index 37fc4fef85a..d52b4ba73d5 100644 --- a/vendor/github.com/sirupsen/logrus/logrus.go +++ b/vendor/github.com/sirupsen/logrus/logrus.go @@ -1,13 +1,13 @@ package logrus import ( + "bytes" "fmt" "log" - "strings" ) // Fields type, used to pass to [WithFields]. -type Fields map[string]interface{} +type Fields map[string]any // Level type // @@ -16,39 +16,56 @@ type Level uint32 // Convert the Level to a string. E.g. [PanicLevel] becomes "panic". func (level Level) String() string { - if b, err := level.MarshalText(); err == nil { - return string(b) - } else { + switch level { + case TraceLevel: + return "trace" + case DebugLevel: + return "debug" + case InfoLevel: + return "info" + case WarnLevel: + return "warning" + case ErrorLevel: + return "error" + case FatalLevel: + return "fatal" + case PanicLevel: + return "panic" + default: return "unknown" } } // ParseLevel takes a string level and returns the Logrus log level constant. func ParseLevel(lvl string) (Level, error) { - switch strings.ToLower(lvl) { - case "panic": + return parseLevel([]byte(lvl)) +} + +func parseLevel(b []byte) (Level, error) { + switch { + case bytes.EqualFold(b, []byte("panic")): return PanicLevel, nil - case "fatal": + case bytes.EqualFold(b, []byte("fatal")): return FatalLevel, nil - case "error": + case bytes.EqualFold(b, []byte("error")): return ErrorLevel, nil - case "warn", "warning": + case bytes.EqualFold(b, []byte("warn")), + bytes.EqualFold(b, []byte("warning")): return WarnLevel, nil - case "info": + case bytes.EqualFold(b, []byte("info")): return InfoLevel, nil - case "debug": + case bytes.EqualFold(b, []byte("debug")): return DebugLevel, nil - case "trace": + case bytes.EqualFold(b, []byte("trace")): return TraceLevel, nil + default: + return 0, fmt.Errorf("not a valid logrus Level: %q", b) } - - var l Level - return l, fmt.Errorf("not a valid logrus Level: %q", lvl) } // UnmarshalText implements encoding.TextUnmarshaler. func (level *Level) UnmarshalText(text []byte) error { - l, err := ParseLevel(string(text)) + l, err := parseLevel(text) if err != nil { return err } @@ -60,23 +77,11 @@ func (level *Level) UnmarshalText(text []byte) error { func (level Level) MarshalText() ([]byte, error) { switch level { - case TraceLevel: - return []byte("trace"), nil - case DebugLevel: - return []byte("debug"), nil - case InfoLevel: - return []byte("info"), nil - case WarnLevel: - return []byte("warning"), nil - case ErrorLevel: - return []byte("error"), nil - case FatalLevel: - return []byte("fatal"), nil - case PanicLevel: - return []byte("panic"), nil + case TraceLevel, DebugLevel, InfoLevel, WarnLevel, ErrorLevel, FatalLevel, PanicLevel: + return []byte(level.String()), nil + default: + return nil, fmt.Errorf("not a valid logrus level %d", level) } - - return nil, fmt.Errorf("not a valid logrus level %d", level) } // AllLevels exposing all logging levels. @@ -91,7 +96,7 @@ var AllLevels = []Level{ } // These are the different logging levels. You can set the logging level to log -// on your instance of logger, obtained with `logrus.New()`. +// on your instance of logger, obtained with [logrus.New]. const ( // PanicLevel level, highest level of severity. Logs and then calls panic with the // message passed to Debug, Info, ... @@ -113,78 +118,110 @@ const ( TraceLevel ) -// Won't compile if StdLogger can't be realized by a log.Logger +// Compile-time interface assertions. var ( - _ StdLogger = &log.Logger{} - _ StdLogger = &Entry{} - _ StdLogger = &Logger{} + _ StdLogger = (*log.Logger)(nil) + _ StdLogger = (*Entry)(nil) + _ StdLogger = (*Logger)(nil) + + _ FieldLogger = (*Logger)(nil) + _ FieldLogger = (*Entry)(nil) + _ FieldLogger = Ext1FieldLogger(nil) + + _ DebugLogger = (*Logger)(nil) + _ InfoLogger = (*Logger)(nil) + _ WarnLogger = (*Logger)(nil) + _ ErrorLogger = (*Logger)(nil) + _ TraceLogger = (*Logger)(nil) + + _ DebugLogger = (*Entry)(nil) + _ InfoLogger = (*Entry)(nil) + _ WarnLogger = (*Entry)(nil) + _ ErrorLogger = (*Entry)(nil) + _ TraceLogger = (*Entry)(nil) + + _ Ext1FieldLogger = (*Logger)(nil) + _ Ext1FieldLogger = (*Entry)(nil) ) // StdLogger is what your logrus-enabled library should take, that way // it'll accept a stdlib logger ([log.Logger]) and a logrus logger. // There's no standard interface, so this is the closest we get, unfortunately. type StdLogger interface { - Print(...interface{}) - Printf(string, ...interface{}) - Println(...interface{}) + Print(args ...any) + Printf(format string, args ...any) + Println(args ...any) - Fatal(...interface{}) - Fatalf(string, ...interface{}) - Fatalln(...interface{}) + Fatal(args ...any) + Fatalf(format string, args ...any) + Fatalln(args ...any) - Panic(...interface{}) - Panicf(string, ...interface{}) - Panicln(...interface{}) + Panic(args ...any) + Panicf(format string, args ...any) + Panicln(args ...any) } // FieldLogger extends the [StdLogger] interface, generalizing // the [Entry] and [Logger] types. type FieldLogger interface { - WithField(key string, value interface{}) *Entry + WithField(key string, value any) *Entry WithFields(fields Fields) *Entry WithError(err error) *Entry - Debugf(format string, args ...interface{}) - Infof(format string, args ...interface{}) - Printf(format string, args ...interface{}) - Warnf(format string, args ...interface{}) - Warningf(format string, args ...interface{}) - Errorf(format string, args ...interface{}) - Fatalf(format string, args ...interface{}) - Panicf(format string, args ...interface{}) - - Debug(args ...interface{}) - Info(args ...interface{}) - Print(args ...interface{}) - Warn(args ...interface{}) - Warning(args ...interface{}) - Error(args ...interface{}) - Fatal(args ...interface{}) - Panic(args ...interface{}) - - Debugln(args ...interface{}) - Infoln(args ...interface{}) - Println(args ...interface{}) - Warnln(args ...interface{}) - Warningln(args ...interface{}) - Errorln(args ...interface{}) - Fatalln(args ...interface{}) - Panicln(args ...interface{}) - - // IsDebugEnabled() bool - // IsInfoEnabled() bool - // IsWarnEnabled() bool - // IsErrorEnabled() bool - // IsFatalEnabled() bool - // IsPanicEnabled() bool + StdLogger + DebugLogger + InfoLogger + WarnLogger + ErrorLogger + + // Legacy warning aliases. These are kept on FieldLogger for backwards + // compatibility, but are intentionally omitted from [WarnLogger]. + + Warning(args ...any) + Warningf(format string, args ...any) + Warningln(args ...any) +} + +// DebugLogger provides convenience functions to log messages at level [DebugLevel]. +type DebugLogger interface { + Debug(args ...any) + Debugf(format string, args ...any) + Debugln(args ...any) +} + +// InfoLogger provides convenience functions to log messages at level [InfoLevel]. +type InfoLogger interface { + Info(args ...any) + Infof(format string, args ...any) + Infoln(args ...any) +} + +// WarnLogger provides convenience functions to log messages at level [WarnLevel]. +type WarnLogger interface { + Warn(args ...any) + Warnf(format string, args ...any) + Warnln(args ...any) +} + +// ErrorLogger provides convenience functions to log messages at level [ErrorLevel]. +type ErrorLogger interface { + Error(args ...any) + Errorf(format string, args ...any) + Errorln(args ...any) +} + +// TraceLogger provides convenience functions to log messages at level [TraceLevel]. +type TraceLogger interface { + Trace(args ...any) + Tracef(format string, args ...any) + Traceln(args ...any) } -// Ext1FieldLogger (the first extension to [FieldLogger]) is superfluous, it is -// here for consistency. Do not use. Use [FieldLogger], [Logger] or [Entry] -// instead. +// Ext1FieldLogger is FieldLogger extended with Trace-level methods. +// +// New code should prefer the smallest applicable interface, such as +// [FieldLogger] or [TraceLogger], or use [Logger] or [Entry] directly. type Ext1FieldLogger interface { FieldLogger - Tracef(format string, args ...interface{}) - Trace(args ...interface{}) - Traceln(args ...interface{}) + TraceLogger } diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_appengine.go b/vendor/github.com/sirupsen/logrus/terminal_check_appengine.go index 2403de98192..1c6202b8c4e 100644 --- a/vendor/github.com/sirupsen/logrus/terminal_check_appengine.go +++ b/vendor/github.com/sirupsen/logrus/terminal_check_appengine.go @@ -1,11 +1,7 @@ -// +build appengine +//go:build appengine package logrus -import ( - "io" -) - -func checkIfTerminal(w io.Writer) bool { +func checkIfTerminal(_ any) bool { return true } diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_bsd.go b/vendor/github.com/sirupsen/logrus/terminal_check_bsd.go index 69956b425a1..ff9531ac44e 100644 --- a/vendor/github.com/sirupsen/logrus/terminal_check_bsd.go +++ b/vendor/github.com/sirupsen/logrus/terminal_check_bsd.go @@ -1,5 +1,4 @@ -// +build darwin dragonfly freebsd netbsd openbsd hurd -// +build !js +//go:build (darwin || dragonfly || freebsd || netbsd || openbsd || hurd) && !tinygo package logrus diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_no_terminal.go b/vendor/github.com/sirupsen/logrus/terminal_check_no_terminal.go index 97af92c68ea..17ae9f04fb4 100644 --- a/vendor/github.com/sirupsen/logrus/terminal_check_no_terminal.go +++ b/vendor/github.com/sirupsen/logrus/terminal_check_no_terminal.go @@ -1,11 +1,7 @@ -// +build js nacl plan9 +//go:build js || nacl || plan9 || wasi || wasip1 || tinygo package logrus -import ( - "io" -) - -func checkIfTerminal(w io.Writer) bool { +func checkIfTerminal(_ any) bool { return false } diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go b/vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go index 3293fb3caad..780a42a57f2 100644 --- a/vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go +++ b/vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go @@ -1,4 +1,4 @@ -// +build !appengine,!js,!windows,!nacl,!plan9 +//go:build !appengine && !js && !windows && !nacl && !plan9 && !wasi && !wasip1 && !tinygo package logrus @@ -10,7 +10,11 @@ import ( func checkIfTerminal(w io.Writer) bool { switch v := w.(type) { case *os.File: - return isTerminal(int(v.Fd())) + fd := v.Fd() + if fd > uintptr(^uint(0)>>1) { + return false + } + return isTerminal(int(fd)) default: return false } diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_solaris.go b/vendor/github.com/sirupsen/logrus/terminal_check_solaris.go index f6710b3bd0b..8d9b26fcade 100644 --- a/vendor/github.com/sirupsen/logrus/terminal_check_solaris.go +++ b/vendor/github.com/sirupsen/logrus/terminal_check_solaris.go @@ -1,3 +1,5 @@ +//go:build solaris && !tinygo + package logrus import ( diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_unix.go b/vendor/github.com/sirupsen/logrus/terminal_check_unix.go index c9aed267a4c..b161506d3f8 100644 --- a/vendor/github.com/sirupsen/logrus/terminal_check_unix.go +++ b/vendor/github.com/sirupsen/logrus/terminal_check_unix.go @@ -1,7 +1,4 @@ -//go:build (linux || aix || zos) && !js && !wasi -// +build linux aix zos -// +build !js -// +build !wasi +//go:build (linux || aix || zos) && !tinygo package logrus diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_windows.go b/vendor/github.com/sirupsen/logrus/terminal_check_windows.go index 2879eb50ea6..5fd3c43139e 100644 --- a/vendor/github.com/sirupsen/logrus/terminal_check_windows.go +++ b/vendor/github.com/sirupsen/logrus/terminal_check_windows.go @@ -1,4 +1,4 @@ -// +build !appengine,!js,windows +//go:build windows && !appengine package logrus diff --git a/vendor/github.com/sirupsen/logrus/text_formatter.go b/vendor/github.com/sirupsen/logrus/text_formatter.go index 6dfeb18b10e..82c1f3da240 100644 --- a/vendor/github.com/sirupsen/logrus/text_formatter.go +++ b/vendor/github.com/sirupsen/logrus/text_formatter.go @@ -3,30 +3,32 @@ package logrus import ( "bytes" "fmt" + "maps" "os" + "reflect" "runtime" - "sort" + "slices" "strconv" "strings" "sync" "time" - "unicode/utf8" ) -const ( - red = 31 - yellow = 33 - blue = 36 - gray = 37 -) - -var baseTimestamp time.Time - -func init() { - baseTimestamp = time.Now() -} - -// TextFormatter formats logs into text +var baseTimestamp = time.Now() + +// TextFormatter formats logs into text. +// +// Output is logfmt-like: key=value pairs separated by spaces. Fields from +// [Entry.Data] are included together with the standard fields derived from the +// entry. If a field conflicts with a standard field, it is prefixed with +// "fields.". Standard field names can be customized through FieldMap. +// +// Field keys are written as-is (unquoted and unescaped) in the plain +// (non-colored) format; only field values may be quoted depending on +// DisableQuote, ForceQuote, QuoteEmptyFields, and the value content. +// +// When colors are enabled, ANSI escape sequences may be added for presentation. +// For fully escaped structured output (including safe keys), use JSONFormatter. type TextFormatter struct { // Set to true to bypass checking for a TTY before outputting colors. ForceColors bool @@ -64,7 +66,7 @@ type TextFormatter struct { // be desired. DisableSorting bool - // The keys sorting function, when uninitialized it uses sort.Strings. + // The keys sorting function, when uninitialized it uses slices.Sort. SortingFunc func([]string) // Disables the truncation of the level text to 4 characters. @@ -77,16 +79,22 @@ type TextFormatter struct { // QuoteEmptyFields will wrap empty fields in quotes if true QuoteEmptyFields bool - // Whether the logger's out is to a terminal - isTerminal bool + // Whether the logger's out is to a terminal. Don't use this field + // directly; use TextFormatter.isTerminal instead. + terminal bool // FieldMap allows users to customize the names of keys for default fields. + // Mapped keys are written as-is, so they should be safe for plain-text output. + // // As an example: + // // formatter := &TextFormatter{ - // FieldMap: FieldMap{ - // FieldKeyTime: "@timestamp", - // FieldKeyLevel: "@level", - // FieldKeyMsg: "@message"}} + // FieldMap: FieldMap{ + // FieldKeyTime: "@timestamp", + // FieldKeyLevel: "@level", + // FieldKeyMsg: "@message", + // }, + // } FieldMap FieldMap // CallerPrettyfier can be set by the user to modify the content @@ -96,54 +104,78 @@ type TextFormatter struct { CallerPrettyfier func(*runtime.Frame) (function string, file string) terminalInitOnce sync.Once - - // The max length of the level text, generated dynamically on init - levelTextMaxLength int } -func (f *TextFormatter) init(entry *Entry) { - if entry.Logger != nil { - f.isTerminal = checkIfTerminal(entry.Logger.Out) - } - // Get the max length of the level text - for _, level := range AllLevels { - levelTextLength := utf8.RuneCount([]byte(level.String())) - if levelTextLength > f.levelTextMaxLength { - f.levelTextMaxLength = levelTextLength - } +func (f *TextFormatter) isTerminal(entry *Entry) bool { + if entry == nil || entry.Logger == nil { + // Don't run the terminalInitOnce without a logger, otherwise we'd + // cache the default (false) forever even if a logger is attached + // later. + return false } -} -func (f *TextFormatter) isColored() bool { - isColored := f.ForceColors || (f.isTerminal && (runtime.GOOS != "windows")) + f.terminalInitOnce.Do(func() { + entry.Logger.mu.Lock() + out := entry.Logger.Out + entry.Logger.mu.Unlock() - if f.EnvironmentOverrideColors { - switch force, ok := os.LookupEnv("CLICOLOR_FORCE"); { - case ok && force != "0": - isColored = true - case ok && force == "0", os.Getenv("CLICOLOR") == "0": - isColored = false - } + f.terminal = checkIfTerminal(out) + }) + + return f.terminal +} + +func (f *TextFormatter) isColored(isTerminal bool) bool { + if f.DisableColors { + return false } - return isColored && !f.DisableColors + colored := f.ForceColors || isTerminal + if !f.EnvironmentOverrideColors { + return colored + } + if force, ok := os.LookupEnv("CLICOLOR_FORCE"); ok { + return force != "0" + } + if os.Getenv("CLICOLOR") == "0" { + return false + } + return colored } // Format renders a single log entry func (f *TextFormatter) Format(entry *Entry) ([]byte, error) { - data := make(Fields) - for k, v := range entry.Data { - data[k] = v - } - prefixFieldClashes(data, f.FieldMap, entry.HasCaller()) + data := make(Fields, len(entry.Data)) + maps.Copy(data, entry.Data) + isColored := f.isColored(f.isTerminal(entry)) + + caller := entry.Caller + hasCaller := caller != nil + prefixFieldClashes(data, f.FieldMap, hasCaller) keys := make([]string, 0, len(data)) for k := range data { keys = append(keys, k) } - var funcVal, fileVal string + b := entry.Buffer + if b == nil { + b = new(bytes.Buffer) + } + + if isColored { + f.printColored(b, entry, keys, data) + } else { + f.printPlain(b, entry, keys, data) + } + + return b.Bytes(), nil +} + +func (f *TextFormatter) printPlain(b *bytes.Buffer, entry *Entry, keys []string, data Fields) { + caller := entry.Caller + hasCaller := caller != nil - fixedKeys := make([]string, 0, 4+len(data)) + fixedKeys := make([]string, 0, len(keys)+defaultFields) if !f.DisableTimestamp { fixedKeys = append(fixedKeys, f.FieldMap.resolve(FieldKeyTime)) } @@ -154,12 +186,14 @@ func (f *TextFormatter) Format(entry *Entry) ([]byte, error) { if entry.err != "" { fixedKeys = append(fixedKeys, f.FieldMap.resolve(FieldKeyLogrusError)) } - if entry.HasCaller() { + + var funcVal, fileVal string + if caller != nil { if f.CallerPrettyfier != nil { - funcVal, fileVal = f.CallerPrettyfier(entry.Caller) + funcVal, fileVal = f.CallerPrettyfier(caller) } else { - funcVal = entry.Caller.Function - fileVal = fmt.Sprintf("%s:%d", entry.Caller.File, entry.Caller.Line) + funcVal = caller.Function + fileVal = caller.File + ":" + strconv.FormatInt(int64(caller.Line), 10) } if funcVal != "" { @@ -172,169 +206,278 @@ func (f *TextFormatter) Format(entry *Entry) ([]byte, error) { if !f.DisableSorting { if f.SortingFunc == nil { - sort.Strings(keys) + // Default sorting does not sort the "fixed keys"; + // see https://github.com/sirupsen/logrus/commit/73bc94e60c753099e8bae902f81fbd6e7dd95f26 + slices.Sort(keys) fixedKeys = append(fixedKeys, keys...) } else { - if !f.isColored() { - fixedKeys = append(fixedKeys, keys...) - f.SortingFunc(fixedKeys) - } else { - f.SortingFunc(keys) - } + fixedKeys = append(fixedKeys, keys...) + f.SortingFunc(fixedKeys) } } else { fixedKeys = append(fixedKeys, keys...) } - var b *bytes.Buffer - if entry.Buffer != nil { - b = entry.Buffer - } else { - b = &bytes.Buffer{} - } - - f.terminalInitOnce.Do(func() { f.init(entry) }) - - timestampFormat := f.TimestampFormat - if timestampFormat == "" { - timestampFormat = defaultTimestampFormat - } - if f.isColored() { - f.printColored(b, entry, keys, data, timestampFormat) - } else { - - for _, key := range fixedKeys { - var value interface{} - switch { - case key == f.FieldMap.resolve(FieldKeyTime): - value = entry.Time.Format(timestampFormat) - case key == f.FieldMap.resolve(FieldKeyLevel): - value = entry.Level.String() - case key == f.FieldMap.resolve(FieldKeyMsg): - value = entry.Message - case key == f.FieldMap.resolve(FieldKeyLogrusError): - value = entry.err - case key == f.FieldMap.resolve(FieldKeyFunc) && entry.HasCaller(): - value = funcVal - case key == f.FieldMap.resolve(FieldKeyFile) && entry.HasCaller(): - value = fileVal - default: - value = data[key] + for _, key := range fixedKeys { + var value any + switch { + case key == f.FieldMap.resolve(FieldKeyTime): + if f.TimestampFormat == "" { + value = entry.Time.Format(defaultTimestampFormat) + } else { + value = entry.Time.Format(f.TimestampFormat) } - f.appendKeyValue(b, key, value) + case key == f.FieldMap.resolve(FieldKeyLevel): + value = entry.Level.String() + case key == f.FieldMap.resolve(FieldKeyMsg): + value = entry.Message + case key == f.FieldMap.resolve(FieldKeyLogrusError): + value = entry.err + case key == f.FieldMap.resolve(FieldKeyFunc) && hasCaller: + value = funcVal + case key == f.FieldMap.resolve(FieldKeyFile) && hasCaller: + value = fileVal + default: + value = data[key] } + f.appendKeyValue(b, key, value) } b.WriteByte('\n') - return b.Bytes(), nil } -func (f *TextFormatter) printColored(b *bytes.Buffer, entry *Entry, keys []string, data Fields, timestampFormat string) { - var levelColor int - switch entry.Level { - case DebugLevel, TraceLevel: - levelColor = gray - case WarnLevel: - levelColor = yellow - case ErrorLevel, FatalLevel, PanicLevel: - levelColor = red - case InfoLevel: - levelColor = blue - default: - levelColor = blue - } - - levelText := strings.ToUpper(entry.Level.String()) - if !f.DisableLevelTruncation && !f.PadLevelText { - levelText = levelText[0:4] - } - if f.PadLevelText { - // Generates the format string used in the next line, for example "%-6s" or "%-7s". - // Based on the max level text length. - formatString := "%-" + strconv.Itoa(f.levelTextMaxLength) + "s" - // Formats the level text by appending spaces up to the max length, for example: - // - "INFO " - // - "WARNING" - levelText = fmt.Sprintf(formatString, levelText) - } - +func (f *TextFormatter) printColored(b *bytes.Buffer, entry *Entry, keys []string, data Fields) { // Remove a single newline if it already exists in the message to keep // the behavior of logrus text_formatter the same as the stdlib log package entry.Message = strings.TrimSuffix(entry.Message, "\n") - caller := "" - if entry.HasCaller() { - funcVal := fmt.Sprintf("%s()", entry.Caller.Function) - fileVal := fmt.Sprintf("%s:%d", entry.Caller.File, entry.Caller.Line) - + var callerText string + if caller := entry.Caller; caller != nil { + var funcVal, fileVal string if f.CallerPrettyfier != nil { - funcVal, fileVal = f.CallerPrettyfier(entry.Caller) + funcVal, fileVal = f.CallerPrettyfier(caller) + } else { + if caller.Function != "" { + funcVal = caller.Function + "()" + } + fileVal = caller.File + ":" + strconv.FormatInt(int64(caller.Line), 10) } if fileVal == "" { - caller = funcVal + callerText = funcVal } else if funcVal == "" { - caller = fileVal + callerText = fileVal } else { - caller = fileVal + " " + funcVal + callerText = fileVal + " " + funcVal } } + levelText := levelPrefix(entry.Level, f.DisableLevelTruncation, f.PadLevelText) switch { case f.DisableTimestamp: - fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m%s %-44s ", levelColor, levelText, caller, entry.Message) + _, _ = fmt.Fprintf(b, "%s%s %-44s ", levelText, callerText, entry.Message) case !f.FullTimestamp: - fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m[%04d]%s %-44s ", levelColor, levelText, int(entry.Time.Sub(baseTimestamp)/time.Second), caller, entry.Message) + _, _ = fmt.Fprintf(b, "%s[%04d]%s %-44s ", levelText, int(entry.Time.Sub(baseTimestamp)/time.Second), callerText, entry.Message) default: - fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m[%s]%s %-44s ", levelColor, levelText, entry.Time.Format(timestampFormat), caller, entry.Message) + timestampFormat := f.TimestampFormat + if timestampFormat == "" { + timestampFormat = defaultTimestampFormat + } + _, _ = fmt.Fprintf(b, "%s[%s]%s %-44s ", levelText, entry.Time.Format(timestampFormat), callerText, entry.Message) + } + + if !f.DisableSorting { + if f.SortingFunc == nil { + slices.Sort(keys) + } else { + f.SortingFunc(keys) + } } + + // Keys use the same color as the level-prefix. for _, k := range keys { - v := data[k] - fmt.Fprintf(b, " \x1b[%dm%s\x1b[0m=", levelColor, k) - f.appendValue(b, v) + b.WriteByte(' ') + b.WriteString(colorize(entry.Level, k)) + b.WriteByte('=') + f.appendValue(b, data[k]) } + + b.WriteByte('\n') } -func (f *TextFormatter) needsQuoting(text string) bool { - if f.ForceQuote { - return true +// appendKeyValue writes key=value. Keys are written verbatim (unquoted/unescaped); +// values are subject to quoting/escaping. +func (f *TextFormatter) appendKeyValue(b *bytes.Buffer, key string, value any) { + if b.Len() > 0 { + b.WriteByte(' ') } - if f.QuoteEmptyFields && len(text) == 0 { - return true + b.WriteString(key) + b.WriteByte('=') + f.appendValue(b, value) +} + +func (f *TextFormatter) appendValue(b *bytes.Buffer, value any) { + // Fast paths. + switch v := value.(type) { + case string: + f.appendString(b, v) + return + case []byte: + f.appendBytes(b, v) + return + case bool: + var raw [8]byte + f.appendBytes(b, strconv.AppendBool(raw[:0], v)) + return + case error: + f.appendError(b, v) + return + case fmt.Stringer: + f.appendStringer(b, v) + return } - if f.DisableQuote { - return false + + // Handle common primitives. + var raw [64]byte + var num []byte + + switch v := value.(type) { + case int: + num = strconv.AppendInt(raw[:0], int64(v), 10) + case int8: + num = strconv.AppendInt(raw[:0], int64(v), 10) + case int16: + num = strconv.AppendInt(raw[:0], int64(v), 10) + case int32: + num = strconv.AppendInt(raw[:0], int64(v), 10) + case int64: + num = strconv.AppendInt(raw[:0], v, 10) + + case uint: + num = strconv.AppendUint(raw[:0], uint64(v), 10) + case uint8: + num = strconv.AppendUint(raw[:0], uint64(v), 10) + case uint16: + num = strconv.AppendUint(raw[:0], uint64(v), 10) + case uint32: + num = strconv.AppendUint(raw[:0], uint64(v), 10) + case uint64: + num = strconv.AppendUint(raw[:0], v, 10) + case uintptr: + num = strconv.AppendUint(raw[:0], uint64(v), 10) + + case float32: + num = strconv.AppendFloat(raw[:0], float64(v), 'g', -1, 32) + case float64: + num = strconv.AppendFloat(raw[:0], v, 'g', -1, 64) + + default: + f.appendString(b, fmt.Sprint(value)) + return + } + + f.appendNumeric(b, num) +} + +func (f *TextFormatter) appendString(b *bytes.Buffer, s string) { + quote := f.ForceQuote || (f.QuoteEmptyFields && len(s) == 0) || (!f.DisableQuote && needsQuoting(s)) + if !quote { + b.WriteString(s) + return + } + if len(s) == 0 { + b.WriteString(`""`) + return + } + + var tmp [128]byte + b.Write(strconv.AppendQuote(tmp[:0], s)) +} + +func (f *TextFormatter) appendBytes(b *bytes.Buffer, bs []byte) { + quote := f.ForceQuote || (f.QuoteEmptyFields && len(bs) == 0) || (!f.DisableQuote && needsQuotingBytes(bs)) + if !quote { + b.Write(bs) + return + } + if len(bs) == 0 { + b.WriteString(`""`) + return + } + + var tmp [128]byte + b.Write(strconv.AppendQuote(tmp[:0], string(bs))) +} + +func (f *TextFormatter) appendNumeric(b *bytes.Buffer, out []byte) { + if f.ForceQuote { + var tmp [128]byte + b.Write(strconv.AppendQuote(tmp[:0], string(out))) + return } - for _, ch := range text { - //nolint:staticcheck // QF1001: could apply De Morgan's law - if !((ch >= 'a' && ch <= 'z') || - (ch >= 'A' && ch <= 'Z') || - (ch >= '0' && ch <= '9') || - ch == '-' || ch == '.' || ch == '_' || ch == '/' || ch == '@' || ch == '^' || ch == '+') { + b.Write(out) +} + +func (f *TextFormatter) appendError(b *bytes.Buffer, v error) { + defer f.recoverValue(b, v, "Error") + + f.appendString(b, v.Error()) +} + +func (f *TextFormatter) appendStringer(b *bytes.Buffer, v fmt.Stringer) { + defer f.recoverValue(b, v, "String") + + f.appendString(b, v.String()) +} + +func (f *TextFormatter) recoverValue(b *bytes.Buffer, v any, method string) { + if r := recover(); r != nil { + rv := reflect.ValueOf(v) + if rv.Kind() == reflect.Pointer && rv.IsNil() { + f.appendString(b, "") + } else { + f.appendString(b, fmt.Sprintf("%%!v(PANIC=%s method: %v)", method, r)) + } + } +} + +// needsQuoting returns true if the string contains any byte that +// requires quoting. It returns false when every byte is "safe" according +// to isSafeByte. +func needsQuoting(s string) bool { + // use an index loop (avoid rune decoding). + for i := range len(s) { + c := s[i] + if !isSafeByte(c) { return true } } return false } -func (f *TextFormatter) appendKeyValue(b *bytes.Buffer, key string, value interface{}) { - if b.Len() > 0 { - b.WriteByte(' ') +// needsQuotingBytes returns true if the byte slice contains any byte that +// requires quoting. It returns false when every byte is "safe" according +// to isSafeByte. +func needsQuotingBytes(bs []byte) bool { + for _, c := range bs { + if !isSafeByte(c) { + return true + } } - b.WriteString(key) - b.WriteByte('=') - f.appendValue(b, value) + return false } -func (f *TextFormatter) appendValue(b *bytes.Buffer, value interface{}) { - stringVal, ok := value.(string) - if !ok { - stringVal = fmt.Sprint(value) +// isSafeByte returns true if the byte is allowed unquoted (ASCII and in the allowlist). +// It purposely uses byte arithmetic (no runes) for performance. +func isSafeByte(ch byte) bool { + ok := ch < 0x80 && ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9')) + if ok { + return true } - - if !f.needsQuoting(stringVal) { - b.WriteString(stringVal) - } else { - fmt.Fprintf(b, "%q", stringVal) + switch ch { + case '-', '.', '_', '/', '@', '^', '+': + return true + default: + return false } } diff --git a/vendor/github.com/sirupsen/logrus/writer.go b/vendor/github.com/sirupsen/logrus/writer.go index 074fd4b8bd7..30e34cda72d 100644 --- a/vendor/github.com/sirupsen/logrus/writer.go +++ b/vendor/github.com/sirupsen/logrus/writer.go @@ -30,7 +30,7 @@ func (entry *Entry) Writer() *io.PipeWriter { func (entry *Entry) WriterLevel(level Level) *io.PipeWriter { reader, writer := io.Pipe() - var printFunc func(args ...interface{}) + printFunc := entry.Print // Determine which log function to use based on the specified log level switch level { @@ -48,8 +48,6 @@ func (entry *Entry) WriterLevel(level Level) *io.PipeWriter { printFunc = entry.Fatal case PanicLevel: printFunc = entry.Panic - default: - printFunc = entry.Print } // Start a new goroutine to scan the input and write it to the logger using the specified print function. @@ -63,7 +61,7 @@ func (entry *Entry) WriterLevel(level Level) *io.PipeWriter { } // writerScanner scans the input from the reader and writes it to the logger -func (entry *Entry) writerScanner(reader *io.PipeReader, printFunc func(args ...interface{})) { +func (entry *Entry) writerScanner(reader *io.PipeReader, printFunc func(args ...any)) { scanner := bufio.NewScanner(reader) // Set the buffer size to the maximum token size to avoid buffer overflows diff --git a/vendor/github.com/spiffe/go-spiffe/v2/bundle/jwtbundle/bundle.go b/vendor/github.com/spiffe/go-spiffe/v2/bundle/jwtbundle/bundle.go index 78cdaddfcad..06ce6374c8a 100644 --- a/vendor/github.com/spiffe/go-spiffe/v2/bundle/jwtbundle/bundle.go +++ b/vendor/github.com/spiffe/go-spiffe/v2/bundle/jwtbundle/bundle.go @@ -154,7 +154,7 @@ func (b *Bundle) Marshal() ([]byte, error) { b.mtx.RLock() defer b.mtx.RUnlock() - jwks := jose.JSONWebKeySet{} + jwks := jose.JSONWebKeySet{Keys: make([]jose.JSONWebKey, 0, len(b.jwtAuthorities))} for keyID, jwtAuthority := range b.jwtAuthorities { jwks.Keys = append(jwks.Keys, jose.JSONWebKey{ Key: jwtAuthority, diff --git a/vendor/github.com/spiffe/go-spiffe/v2/exp/bundle/witbundle/bundle.go b/vendor/github.com/spiffe/go-spiffe/v2/exp/bundle/witbundle/bundle.go index dbf8cf3cd9f..95598c5629a 100644 --- a/vendor/github.com/spiffe/go-spiffe/v2/exp/bundle/witbundle/bundle.go +++ b/vendor/github.com/spiffe/go-spiffe/v2/exp/bundle/witbundle/bundle.go @@ -16,6 +16,8 @@ import ( "github.com/spiffe/go-spiffe/v2/spiffeid" ) +const witSVIDUse = "wit-svid" + // Bundle is a collection of trusted WIT authorities for a trust domain. type Bundle struct { trustDomain spiffeid.TrustDomain @@ -160,11 +162,12 @@ func (b *Bundle) Marshal() ([]byte, error) { b.mtx.RLock() defer b.mtx.RUnlock() - jwks := jose.JSONWebKeySet{} + jwks := jose.JSONWebKeySet{Keys: make([]jose.JSONWebKey, 0, len(b.witAuthorities))} for keyID, witAuthority := range b.witAuthorities { jwks.Keys = append(jwks.Keys, jose.JSONWebKey{ Key: witAuthority, KeyID: keyID, + Use: witSVIDUse, }) } diff --git a/vendor/github.com/stretchr/objx/README.md b/vendor/github.com/stretchr/objx/README.md index 78dc1f8b03e..e9ba8307354 100644 --- a/vendor/github.com/stretchr/objx/README.md +++ b/vendor/github.com/stretchr/objx/README.md @@ -1,8 +1,6 @@ # Objx [![Build Status](https://travis-ci.org/stretchr/objx.svg?branch=master)](https://travis-ci.org/stretchr/objx) [![Go Report Card](https://goreportcard.com/badge/github.com/stretchr/objx)](https://goreportcard.com/report/github.com/stretchr/objx) -[![Maintainability](https://api.codeclimate.com/v1/badges/1d64bc6c8474c2074f2b/maintainability)](https://codeclimate.com/github/stretchr/objx/maintainability) -[![Test Coverage](https://api.codeclimate.com/v1/badges/1d64bc6c8474c2074f2b/test_coverage)](https://codeclimate.com/github/stretchr/objx/test_coverage) [![Sourcegraph](https://sourcegraph.com/github.com/stretchr/objx/-/badge.svg)](https://sourcegraph.com/github.com/stretchr/objx) [![GoDoc](https://pkg.go.dev/badge/github.com/stretchr/objx?utm_source=godoc)](https://pkg.go.dev/github.com/stretchr/objx) @@ -19,49 +17,62 @@ Objx provides the `objx.Map` type, which is a `map[string]interface{}` that expo ### Pattern Objx uses a predictable pattern to make access data from within `map[string]interface{}` easy. Call one of the `objx.` functions to create your `objx.Map` to get going: - m, err := objx.FromJSON(json) +```go +m, err := objx.FromJSON(json) +``` NOTE: Any methods or functions with the `Must` prefix will panic if something goes wrong, the rest will be optimistic and try to figure things out without panicking. Use `Get` to access the value you're interested in. You can use dot and array notation too: - m.Get("places[0].latlng") +```go +m.Get("places[0].latlng") +``` Once you have sought the `Value` you're interested in, you can use the `Is*` methods to determine its type. - if m.Get("code").IsStr() { // Your code... } +```go +if m.Get("code").IsStr() { // Your code... } +``` Or you can just assume the type, and use one of the strong type methods to extract the real value: - m.Get("code").Int() +```go +m.Get("code").Int() +``` If there's no value there (or if it's the wrong type) then a default value will be returned, or you can be explicit about the default value. - Get("code").Int(-1) - +```go +Get("code").Int(-1) +``` If you're dealing with a slice of data as a value, Objx provides many useful methods for iterating, manipulating and selecting that data. You can find out more by exploring the index below. ### Reading data A simple example of how to use Objx: - // Use MustFromJSON to make an objx.Map from some JSON - m := objx.MustFromJSON(`{"name": "Mat", "age": 30}`) +```go +// Use MustFromJSON to make an objx.Map from some JSON +m := objx.MustFromJSON(`{"name": "Mat", "age": 30}`) - // Get the details - name := m.Get("name").Str() - age := m.Get("age").Int() +// Get the details +name := m.Get("name").Str() +age := m.Get("age").Int() - // Get their nickname (or use their name if they don't have one) - nickname := m.Get("nickname").Str(name) +// Get their nickname (or use their name if they don't have one) +nickname := m.Get("nickname").Str(name) +``` ### Ranging Since `objx.Map` is a `map[string]interface{}` you can treat it as such. For example, to `range` the data, do what you would expect: - m := objx.MustFromJSON(json) - for key, value := range m { - // Your code... - } +```go +m := objx.MustFromJSON(json) +for key, value := range m { + // Your code... +} +``` ## Installation To install Objx, use go get: diff --git a/vendor/github.com/stretchr/testify/assert/assertion_format.go b/vendor/github.com/stretchr/testify/assert/assertion_format.go index c592f6ad5fb..a19a89279cc 100644 --- a/vendor/github.com/stretchr/testify/assert/assertion_format.go +++ b/vendor/github.com/stretchr/testify/assert/assertion_format.go @@ -84,7 +84,7 @@ func Equalf(t TestingT, expected interface{}, actual interface{}, msg string, ar return Equal(t, expected, actual, append([]interface{}{msg}, args...)...) } -// EqualErrorf asserts that a function returned an error (i.e. not `nil`) +// EqualErrorf asserts that a function returned a non-nil error (i.e. an error) // and that it is equal to the provided error. // // actualObj, err := SomeFunction() @@ -124,7 +124,7 @@ func EqualValuesf(t TestingT, expected interface{}, actual interface{}, msg stri return EqualValues(t, expected, actual, append([]interface{}{msg}, args...)...) } -// Errorf asserts that a function returned an error (i.e. not `nil`). +// Errorf asserts that a function returned a non-nil error (ie. an error). // // actualObj, err := SomeFunction() // assert.Errorf(t, err, "error message %s", "formatted") @@ -144,8 +144,8 @@ func ErrorAsf(t TestingT, err error, target interface{}, msg string, args ...int return ErrorAs(t, err, target, append([]interface{}{msg}, args...)...) } -// ErrorContainsf asserts that a function returned an error (i.e. not `nil`) -// and that the error contains the specified substring. +// ErrorContainsf asserts that a function returned a non-nil error (i.e. an +// error) and that the error contains the specified substring. // // actualObj, err := SomeFunction() // assert.ErrorContainsf(t, err, expectedErrorSubString, "error message %s", "formatted") @@ -190,10 +190,10 @@ func Eventuallyf(t TestingT, condition func() bool, waitFor time.Duration, tick // time.Sleep(8*time.Second) // externalValue = true // }() -// assert.EventuallyWithTf(t, func(c *assert.CollectT, "error message %s", "formatted") { +// assert.EventuallyWithTf(t, func(c *assert.CollectT) { // // add assertions as needed; any assertion failure will fail the current tick // assert.True(c, externalValue, "expected 'externalValue' to be true") -// }, 10*time.Second, 1*time.Second, "external state has not changed to 'true'; still false") +// }, 10*time.Second, 1*time.Second, "error message %s", "formatted") func EventuallyWithTf(t TestingT, condition func(collect *CollectT), waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -552,7 +552,7 @@ func NoDirExistsf(t TestingT, path string, msg string, args ...interface{}) bool return NoDirExists(t, path, append([]interface{}{msg}, args...)...) } -// NoErrorf asserts that a function returned no error (i.e. `nil`). +// NoErrorf asserts that a function returned a nil error (ie. no error). // // actualObj, err := SomeFunction() // if assert.NoErrorf(t, err, "error message %s", "formatted") { @@ -849,7 +849,19 @@ func WithinRangef(t TestingT, actual time.Time, start time.Time, end time.Time, return WithinRange(t, actual, start, end, append([]interface{}{msg}, args...)...) } -// YAMLEqf asserts that two YAML strings are equivalent. +// YAMLEqf asserts that the first documents in the two YAML strings are equivalent. +// +// expected := `--- +// key: value +// --- +// key: this is a second document, it is not evaluated +// ` +// actual := `--- +// key: value +// --- +// key: this is a subsequent document, it is not evaluated +// ` +// assert.YAMLEqf(t, expected, actual, "error message %s", "formatted") func YAMLEqf(t TestingT, expected string, actual string, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() diff --git a/vendor/github.com/stretchr/testify/assert/assertion_forward.go b/vendor/github.com/stretchr/testify/assert/assertion_forward.go index 58db928450d..cd2a86061c6 100644 --- a/vendor/github.com/stretchr/testify/assert/assertion_forward.go +++ b/vendor/github.com/stretchr/testify/assert/assertion_forward.go @@ -146,7 +146,7 @@ func (a *Assertions) Equal(expected interface{}, actual interface{}, msgAndArgs return Equal(a.t, expected, actual, msgAndArgs...) } -// EqualError asserts that a function returned an error (i.e. not `nil`) +// EqualError asserts that a function returned a non-nil error (i.e. an error) // and that it is equal to the provided error. // // actualObj, err := SomeFunction() @@ -158,7 +158,7 @@ func (a *Assertions) EqualError(theError error, errString string, msgAndArgs ... return EqualError(a.t, theError, errString, msgAndArgs...) } -// EqualErrorf asserts that a function returned an error (i.e. not `nil`) +// EqualErrorf asserts that a function returned a non-nil error (i.e. an error) // and that it is equal to the provided error. // // actualObj, err := SomeFunction() @@ -240,7 +240,7 @@ func (a *Assertions) Equalf(expected interface{}, actual interface{}, msg string return Equalf(a.t, expected, actual, msg, args...) } -// Error asserts that a function returned an error (i.e. not `nil`). +// Error asserts that a function returned a non-nil error (ie. an error). // // actualObj, err := SomeFunction() // a.Error(err) @@ -269,8 +269,8 @@ func (a *Assertions) ErrorAsf(err error, target interface{}, msg string, args .. return ErrorAsf(a.t, err, target, msg, args...) } -// ErrorContains asserts that a function returned an error (i.e. not `nil`) -// and that the error contains the specified substring. +// ErrorContains asserts that a function returned a non-nil error (i.e. an +// error) and that the error contains the specified substring. // // actualObj, err := SomeFunction() // a.ErrorContains(err, expectedErrorSubString) @@ -281,8 +281,8 @@ func (a *Assertions) ErrorContains(theError error, contains string, msgAndArgs . return ErrorContains(a.t, theError, contains, msgAndArgs...) } -// ErrorContainsf asserts that a function returned an error (i.e. not `nil`) -// and that the error contains the specified substring. +// ErrorContainsf asserts that a function returned a non-nil error (i.e. an +// error) and that the error contains the specified substring. // // actualObj, err := SomeFunction() // a.ErrorContainsf(err, expectedErrorSubString, "error message %s", "formatted") @@ -311,7 +311,7 @@ func (a *Assertions) ErrorIsf(err error, target error, msg string, args ...inter return ErrorIsf(a.t, err, target, msg, args...) } -// Errorf asserts that a function returned an error (i.e. not `nil`). +// Errorf asserts that a function returned a non-nil error (ie. an error). // // actualObj, err := SomeFunction() // a.Errorf(err, "error message %s", "formatted") @@ -372,10 +372,10 @@ func (a *Assertions) EventuallyWithT(condition func(collect *CollectT), waitFor // time.Sleep(8*time.Second) // externalValue = true // }() -// a.EventuallyWithTf(func(c *assert.CollectT, "error message %s", "formatted") { +// a.EventuallyWithTf(func(c *assert.CollectT) { // // add assertions as needed; any assertion failure will fail the current tick // assert.True(c, externalValue, "expected 'externalValue' to be true") -// }, 10*time.Second, 1*time.Second, "external state has not changed to 'true'; still false") +// }, 10*time.Second, 1*time.Second, "error message %s", "formatted") func (a *Assertions) EventuallyWithTf(condition func(collect *CollectT), waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1096,7 +1096,7 @@ func (a *Assertions) NoDirExistsf(path string, msg string, args ...interface{}) return NoDirExistsf(a.t, path, msg, args...) } -// NoError asserts that a function returned no error (i.e. `nil`). +// NoError asserts that a function returned a nil error (ie. no error). // // actualObj, err := SomeFunction() // if a.NoError(err) { @@ -1109,7 +1109,7 @@ func (a *Assertions) NoError(err error, msgAndArgs ...interface{}) bool { return NoError(a.t, err, msgAndArgs...) } -// NoErrorf asserts that a function returned no error (i.e. `nil`). +// NoErrorf asserts that a function returned a nil error (ie. no error). // // actualObj, err := SomeFunction() // if a.NoErrorf(err, "error message %s", "formatted") { @@ -1690,7 +1690,19 @@ func (a *Assertions) WithinRangef(actual time.Time, start time.Time, end time.Ti return WithinRangef(a.t, actual, start, end, msg, args...) } -// YAMLEq asserts that two YAML strings are equivalent. +// YAMLEq asserts that the first documents in the two YAML strings are equivalent. +// +// expected := `--- +// key: value +// --- +// key: this is a second document, it is not evaluated +// ` +// actual := `--- +// key: value +// --- +// key: this is a subsequent document, it is not evaluated +// ` +// a.YAMLEq(expected, actual) func (a *Assertions) YAMLEq(expected string, actual string, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1698,7 +1710,19 @@ func (a *Assertions) YAMLEq(expected string, actual string, msgAndArgs ...interf return YAMLEq(a.t, expected, actual, msgAndArgs...) } -// YAMLEqf asserts that two YAML strings are equivalent. +// YAMLEqf asserts that the first documents in the two YAML strings are equivalent. +// +// expected := `--- +// key: value +// --- +// key: this is a second document, it is not evaluated +// ` +// actual := `--- +// key: value +// --- +// key: this is a subsequent document, it is not evaluated +// ` +// a.YAMLEqf(expected, actual, "error message %s", "formatted") func (a *Assertions) YAMLEqf(expected string, actual string, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() diff --git a/vendor/github.com/stretchr/testify/assert/assertion_order.go b/vendor/github.com/stretchr/testify/assert/assertion_order.go index 2fdf80fdd30..a44b40ed3f5 100644 --- a/vendor/github.com/stretchr/testify/assert/assertion_order.go +++ b/vendor/github.com/stretchr/testify/assert/assertion_order.go @@ -9,7 +9,7 @@ import ( func isOrdered(t TestingT, object interface{}, allowedComparesResults []compareResult, failMessage string, msgAndArgs ...interface{}) bool { objKind := reflect.TypeOf(object).Kind() if objKind != reflect.Slice && objKind != reflect.Array { - return false + return Fail(t, fmt.Sprintf("object %T is not an ordered collection", object), msgAndArgs...) } objValue := reflect.ValueOf(object) @@ -50,6 +50,9 @@ func isOrdered(t TestingT, object interface{}, allowedComparesResults []compareR // assert.IsIncreasing(t, []float{1, 2}) // assert.IsIncreasing(t, []string{"a", "b"}) func IsIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } return isOrdered(t, object, []compareResult{compareLess}, "\"%v\" is not less than \"%v\"", msgAndArgs...) } @@ -59,6 +62,9 @@ func IsIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) boo // assert.IsNonIncreasing(t, []float{2, 1}) // assert.IsNonIncreasing(t, []string{"b", "a"}) func IsNonIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } return isOrdered(t, object, []compareResult{compareEqual, compareGreater}, "\"%v\" is not greater than or equal to \"%v\"", msgAndArgs...) } @@ -68,6 +74,9 @@ func IsNonIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) // assert.IsDecreasing(t, []float{2, 1}) // assert.IsDecreasing(t, []string{"b", "a"}) func IsDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } return isOrdered(t, object, []compareResult{compareGreater}, "\"%v\" is not greater than \"%v\"", msgAndArgs...) } @@ -77,5 +86,8 @@ func IsDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) boo // assert.IsNonDecreasing(t, []float{1, 2}) // assert.IsNonDecreasing(t, []string{"a", "b"}) func IsNonDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } return isOrdered(t, object, []compareResult{compareLess, compareEqual}, "\"%v\" is not less than or equal to \"%v\"", msgAndArgs...) } diff --git a/vendor/github.com/stretchr/testify/assert/assertions.go b/vendor/github.com/stretchr/testify/assert/assertions.go index de8de0cb6c4..166f63726cf 100644 --- a/vendor/github.com/stretchr/testify/assert/assertions.go +++ b/vendor/github.com/stretchr/testify/assert/assertions.go @@ -17,11 +17,10 @@ import ( "unicode" "unicode/utf8" - "github.com/davecgh/go-spew/spew" - "github.com/pmezard/go-difflib/difflib" - - // Wrapper around gopkg.in/yaml.v3 + // Wrapper around go.yaml.in/yaml/v3 "github.com/stretchr/testify/assert/yaml" + "github.com/stretchr/testify/internal/difflib" + "github.com/stretchr/testify/internal/spew" ) //go:generate sh -c "cd ../_codegen && go build && cd - && ../_codegen/_codegen -output-package=assert -template=assertion_format.go.tmpl" @@ -33,19 +32,19 @@ type TestingT interface { // ComparisonAssertionFunc is a common function prototype when comparing two values. Can be useful // for table driven tests. -type ComparisonAssertionFunc func(TestingT, interface{}, interface{}, ...interface{}) bool +type ComparisonAssertionFunc = func(TestingT, interface{}, interface{}, ...interface{}) bool // ValueAssertionFunc is a common function prototype when validating a single value. Can be useful // for table driven tests. -type ValueAssertionFunc func(TestingT, interface{}, ...interface{}) bool +type ValueAssertionFunc = func(TestingT, interface{}, ...interface{}) bool // BoolAssertionFunc is a common function prototype when validating a bool value. Can be useful // for table driven tests. -type BoolAssertionFunc func(TestingT, bool, ...interface{}) bool +type BoolAssertionFunc = func(TestingT, bool, ...interface{}) bool // ErrorAssertionFunc is a common function prototype when validating an error value. Can be useful // for table driven tests. -type ErrorAssertionFunc func(TestingT, error, ...interface{}) bool +type ErrorAssertionFunc = func(TestingT, error, ...interface{}) bool // PanicAssertionFunc is a common function prototype when validating a panic value. Can be useful // for table driven tests. @@ -325,13 +324,15 @@ func messageFromMsgAndArgs(msgAndArgs ...interface{}) string { func indentMessageLines(message string, longestLabelLen int) string { outBuf := new(bytes.Buffer) - for i, scanner := 0, bufio.NewScanner(strings.NewReader(message)); scanner.Scan(); i++ { - // no need to align first line because it starts at the correct location (after the label) - if i != 0 { - // append alignLen+1 spaces to align with "{{longestLabel}}:" before adding tab - outBuf.WriteString("\n\t" + strings.Repeat(" ", longestLabelLen+1) + "\t") + scanner := bufio.NewScanner(strings.NewReader(message)) + for firstLine := true; scanner.Scan(); firstLine = false { + if !firstLine { + fmt.Fprint(outBuf, "\n\t"+strings.Repeat(" ", longestLabelLen+1)+"\t") } - outBuf.WriteString(scanner.Text()) + fmt.Fprint(outBuf, scanner.Text()) + } + if err := scanner.Err(); err != nil { + return fmt.Sprintf("cannot display message: %s", err) } return outBuf.String() @@ -544,9 +545,8 @@ func Same(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) b if !same { // both are pointers but not the same type & pointing to the same address return Fail(t, fmt.Sprintf("Not same: \n"+ - "expected: %p %#[1]v\n"+ - "actual : %p %#[2]v", - expected, actual), msgAndArgs...) + "expected: %[2]s (%[1]T)(%[1]p)\n"+ + "actual : %[4]s (%[3]T)(%[3]p)", expected, truncatingFormat("%#v", expected), actual, truncatingFormat("%#v", actual)), msgAndArgs...) } return true @@ -571,8 +571,8 @@ func NotSame(t TestingT, expected, actual interface{}, msgAndArgs ...interface{} if same { return Fail(t, fmt.Sprintf( - "Expected and actual point to the same object: %p %#[1]v", - expected), msgAndArgs...) + "Expected and actual point to the same object: %p %s", + expected, truncatingFormat("%#v", expected)), msgAndArgs...) } return true } @@ -604,25 +604,26 @@ func samePointers(first, second interface{}) (same bool, ok bool) { // to a type conversion in the Go grammar. func formatUnequalValues(expected, actual interface{}) (e string, a string) { if reflect.TypeOf(expected) != reflect.TypeOf(actual) { - return fmt.Sprintf("%T(%s)", expected, truncatingFormat(expected)), - fmt.Sprintf("%T(%s)", actual, truncatingFormat(actual)) + return fmt.Sprintf("%T(%s)", expected, truncatingFormat("%#v", expected)), + fmt.Sprintf("%T(%s)", actual, truncatingFormat("%#v", actual)) } switch expected.(type) { case time.Duration: return fmt.Sprintf("%v", expected), fmt.Sprintf("%v", actual) } - return truncatingFormat(expected), truncatingFormat(actual) + return truncatingFormat("%#v", expected), truncatingFormat("%#v", actual) } // truncatingFormat formats the data and truncates it if it's too long. // // This helps keep formatted error messages lines from exceeding the // bufio.MaxScanTokenSize max line length that the go testing framework imposes. -func truncatingFormat(data interface{}) string { - value := fmt.Sprintf("%#v", data) - max := bufio.MaxScanTokenSize - 100 // Give us some space the type info too if needed. - if len(value) > max { - value = value[0:max] + "<... truncated>" +func truncatingFormat(format string, data interface{}) string { + value := fmt.Sprintf(format, data) + // Give us space for two truncated objects and the surrounding sentence. + maxMessageSize := bufio.MaxScanTokenSize/2 - 100 + if len(value) > maxMessageSize { + value = value[0:maxMessageSize] + "<... truncated>" } return value } @@ -743,7 +744,7 @@ func Nil(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } - return Fail(t, fmt.Sprintf("Expected nil, but got: %#v", object), msgAndArgs...) + return Fail(t, fmt.Sprintf("Expected nil, but got: %s", truncatingFormat("%#v", object)), msgAndArgs...) } // isEmpty gets whether the specified object is considered empty or not. @@ -793,7 +794,7 @@ func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } - Fail(t, fmt.Sprintf("Should be empty, but was %v", object), msgAndArgs...) + Fail(t, fmt.Sprintf("Should be empty, but was %s", truncatingFormat("%v", object)), msgAndArgs...) } return pass @@ -836,11 +837,11 @@ func Len(t TestingT, object interface{}, length int, msgAndArgs ...interface{}) } l, ok := getLen(object) if !ok { - return Fail(t, fmt.Sprintf("\"%v\" could not be applied builtin len()", object), msgAndArgs...) + return Fail(t, fmt.Sprintf("%q could not be applied builtin len()", truncatingFormat("%v", object)), msgAndArgs...) } if l != length { - return Fail(t, fmt.Sprintf("\"%v\" should have %d item(s), but has %d", object, length, l), msgAndArgs...) + return Fail(t, fmt.Sprintf("%q should have %d item(s), but has %d", truncatingFormat("%v", object), length, l), msgAndArgs...) } return true } @@ -889,7 +890,7 @@ func NotEqual(t TestingT, expected, actual interface{}, msgAndArgs ...interface{ } if ObjectsAreEqual(expected, actual) { - return Fail(t, fmt.Sprintf("Should not be: %#v\n", actual), msgAndArgs...) + return Fail(t, fmt.Sprintf("Should not be: %s\n", truncatingFormat("%#v", actual)), msgAndArgs...) } return true @@ -904,7 +905,7 @@ func NotEqualValues(t TestingT, expected, actual interface{}, msgAndArgs ...inte } if ObjectsAreEqualValues(expected, actual) { - return Fail(t, fmt.Sprintf("Should not be: %#v\n", actual), msgAndArgs...) + return Fail(t, fmt.Sprintf("Should not be: %s\n", truncatingFormat("%#v", actual)), msgAndArgs...) } return true @@ -964,10 +965,10 @@ func Contains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) bo ok, found := containsElement(s, contains) if !ok { - return Fail(t, fmt.Sprintf("%#v could not be applied builtin len()", s), msgAndArgs...) + return Fail(t, fmt.Sprintf("%s could not be applied builtin len()", truncatingFormat("%#v", s)), msgAndArgs...) } if !found { - return Fail(t, fmt.Sprintf("%#v does not contain %#v", s, contains), msgAndArgs...) + return Fail(t, fmt.Sprintf("%s does not contain %#v", truncatingFormat("%#v", s), contains), msgAndArgs...) } return true @@ -986,10 +987,10 @@ func NotContains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) ok, found := containsElement(s, contains) if !ok { - return Fail(t, fmt.Sprintf("%#v could not be applied builtin len()", s), msgAndArgs...) + return Fail(t, fmt.Sprintf("%s could not be applied builtin len()", truncatingFormat("%#v", s)), msgAndArgs...) } if found { - return Fail(t, fmt.Sprintf("%#v should not contain %#v", s, contains), msgAndArgs...) + return Fail(t, fmt.Sprintf("%s should not contain %#v", truncatingFormat("%#v", s), contains), msgAndArgs...) } return true @@ -1031,10 +1032,10 @@ func Subset(t TestingT, list, subset interface{}, msgAndArgs ...interface{}) (ok av := actualMap.MapIndex(k) if !av.IsValid() { - return Fail(t, fmt.Sprintf("%#v does not contain %#v", list, subset), msgAndArgs...) + return Fail(t, fmt.Sprintf("%s does not contain %s", truncatingFormat("%#v", list), truncatingFormat("%#v", subset)), msgAndArgs...) } if !ObjectsAreEqual(ev.Interface(), av.Interface()) { - return Fail(t, fmt.Sprintf("%#v does not contain %#v", list, subset), msgAndArgs...) + return Fail(t, fmt.Sprintf("%s does not contain %s", truncatingFormat("%#v", list), truncatingFormat("%#v", subset)), msgAndArgs...) } } @@ -1056,7 +1057,7 @@ func Subset(t TestingT, list, subset interface{}, msgAndArgs ...interface{}) (ok return Fail(t, fmt.Sprintf("%#v could not be applied builtin len()", list), msgAndArgs...) } if !found { - return Fail(t, fmt.Sprintf("%#v does not contain %#v", list, element), msgAndArgs...) + return Fail(t, fmt.Sprintf("%s does not contain %#v", truncatingFormat("%#v", list), element), msgAndArgs...) } } @@ -1082,12 +1083,12 @@ func NotSubset(t TestingT, list, subset interface{}, msgAndArgs ...interface{}) listKind := reflect.TypeOf(list).Kind() if listKind != reflect.Array && listKind != reflect.Slice && listKind != reflect.Map { - return Fail(t, fmt.Sprintf("%q has an unsupported type %s", list, listKind), msgAndArgs...) + return Fail(t, fmt.Sprintf("%#v has an unsupported type %s", list, listKind), msgAndArgs...) } subsetKind := reflect.TypeOf(subset).Kind() if subsetKind != reflect.Array && subsetKind != reflect.Slice && subsetKind != reflect.Map { - return Fail(t, fmt.Sprintf("%q has an unsupported type %s", subset, subsetKind), msgAndArgs...) + return Fail(t, fmt.Sprintf("%#v has an unsupported type %s", subset, subsetKind), msgAndArgs...) } if subsetKind == reflect.Map && listKind == reflect.Map { @@ -1106,7 +1107,7 @@ func NotSubset(t TestingT, list, subset interface{}, msgAndArgs ...interface{}) } } - return Fail(t, fmt.Sprintf("%q is a subset of %q", subset, list), msgAndArgs...) + return Fail(t, fmt.Sprintf("%s is a subset of %s", truncatingFormat("%#v", subset), truncatingFormat("%#v", list)), msgAndArgs...) } subsetList := reflect.ValueOf(subset) @@ -1121,14 +1122,14 @@ func NotSubset(t TestingT, list, subset interface{}, msgAndArgs ...interface{}) element := subsetList.Index(i).Interface() ok, found := containsElement(list, element) if !ok { - return Fail(t, fmt.Sprintf("%q could not be applied builtin len()", list), msgAndArgs...) + return Fail(t, fmt.Sprintf("%#v could not be applied builtin len()", list), msgAndArgs...) } if !found { return true } } - return Fail(t, fmt.Sprintf("%q is a subset of %q", subset, list), msgAndArgs...) + return Fail(t, fmt.Sprintf("%s is a subset of %s", truncatingFormat("%#v", subset), truncatingFormat("%#v", list)), msgAndArgs...) } // ElementsMatch asserts that the specified listA(array, slice...) is equal to specified @@ -1343,9 +1344,15 @@ func PanicsWithError(t TestingT, errString string, f PanicTestFunc, msgAndArgs . if !funcDidPanic { return Fail(t, fmt.Sprintf("func %#v should panic\n\tPanic value:\t%#v", f, panicValue), msgAndArgs...) } - panicErr, ok := panicValue.(error) - if !ok || panicErr.Error() != errString { - return Fail(t, fmt.Sprintf("func %#v should panic with error message:\t%#v\n\tPanic value:\t%#v\n\tPanic stack:\t%s", f, errString, panicValue, panickedStack), msgAndArgs...) + panicErr, isError := panicValue.(error) + if !isError || panicErr.Error() != errString { + msg := fmt.Sprintf("func %#v should panic with error message:\t%#v\n", f, errString) + if isError { + msg += fmt.Sprintf("\tError message:\t%#v\n", panicErr.Error()) + } + msg += fmt.Sprintf("\tPanic value:\t%#v\n", panicValue) + msg += fmt.Sprintf("\tPanic stack:\t%s\n", panickedStack) + return Fail(t, msg, msgAndArgs...) } return true @@ -1624,7 +1631,7 @@ func InEpsilonSlice(t TestingT, expected, actual interface{}, epsilon float64, m Errors */ -// NoError asserts that a function returned no error (i.e. `nil`). +// NoError asserts that a function returned a nil error (ie. no error). // // actualObj, err := SomeFunction() // if assert.NoError(t, err) { @@ -1635,13 +1642,13 @@ func NoError(t TestingT, err error, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } - return Fail(t, fmt.Sprintf("Received unexpected error:\n%+v", err), msgAndArgs...) + return Fail(t, fmt.Sprintf("Received unexpected error:\n%s", truncatingFormat("%+v", err)), msgAndArgs...) } return true } -// Error asserts that a function returned an error (i.e. not `nil`). +// Error asserts that a function returned a non-nil error (ie. an error). // // actualObj, err := SomeFunction() // assert.Error(t, err) @@ -1656,7 +1663,7 @@ func Error(t TestingT, err error, msgAndArgs ...interface{}) bool { return true } -// EqualError asserts that a function returned an error (i.e. not `nil`) +// EqualError asserts that a function returned a non-nil error (i.e. an error) // and that it is equal to the provided error. // // actualObj, err := SomeFunction() @@ -1674,13 +1681,13 @@ func EqualError(t TestingT, theError error, errString string, msgAndArgs ...inte if expected != actual { return Fail(t, fmt.Sprintf("Error message not equal:\n"+ "expected: %q\n"+ - "actual : %q", expected, actual), msgAndArgs...) + "actual : %s", expected, truncatingFormat("%q", actual)), msgAndArgs...) } return true } -// ErrorContains asserts that a function returned an error (i.e. not `nil`) -// and that the error contains the specified substring. +// ErrorContains asserts that a function returned a non-nil error (i.e. an +// error) and that the error contains the specified substring. // // actualObj, err := SomeFunction() // assert.ErrorContains(t, err, expectedErrorSubString) @@ -1694,7 +1701,7 @@ func ErrorContains(t TestingT, theError error, contains string, msgAndArgs ...in actual := theError.Error() if !strings.Contains(actual, contains) { - return Fail(t, fmt.Sprintf("Error %#v does not contain %#v", actual, contains), msgAndArgs...) + return Fail(t, fmt.Sprintf("Error %s does not contain %#v", truncatingFormat("%#v", actual), contains), msgAndArgs...) } return true @@ -1760,7 +1767,7 @@ func Zero(t TestingT, i interface{}, msgAndArgs ...interface{}) bool { h.Helper() } if i != nil && !reflect.DeepEqual(i, reflect.Zero(reflect.TypeOf(i)).Interface()) { - return Fail(t, fmt.Sprintf("Should be zero, but was %v", i), msgAndArgs...) + return Fail(t, fmt.Sprintf("Should be zero, but was %s", truncatingFormat("%v", i)), msgAndArgs...) } return true } @@ -1874,7 +1881,19 @@ func JSONEq(t TestingT, expected string, actual string, msgAndArgs ...interface{ return Equal(t, expectedJSONAsInterface, actualJSONAsInterface, msgAndArgs...) } -// YAMLEq asserts that two YAML strings are equivalent. +// YAMLEq asserts that the first documents in the two YAML strings are equivalent. +// +// expected := `--- +// key: value +// --- +// key: this is a second document, it is not evaluated +// ` +// actual := `--- +// key: value +// --- +// key: this is a subsequent document, it is not evaluated +// ` +// assert.YAMLEq(t, expected, actual) func YAMLEq(t TestingT, expected string, actual string, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -2188,8 +2207,8 @@ func ErrorIs(t TestingT, err, target error, msgAndArgs ...interface{}) bool { chain := buildErrorChainString(err, false) return Fail(t, fmt.Sprintf("Target error should be in err chain:\n"+ - "expected: %q\n"+ - "in chain: %s", expectedText, chain, + "expected: %s\n"+ + "in chain: %s", truncatingFormat("%q", expectedText), truncatingFormat("%s", chain), ), msgAndArgs...) } @@ -2211,8 +2230,8 @@ func NotErrorIs(t TestingT, err, target error, msgAndArgs ...interface{}) bool { chain := buildErrorChainString(err, false) return Fail(t, fmt.Sprintf("Target error should not be in err chain:\n"+ - "found: %q\n"+ - "in chain: %s", expectedText, chain, + "found: %s\n"+ + "in chain: %s", truncatingFormat("%q", expectedText), truncatingFormat("%s", chain), ), msgAndArgs...) } @@ -2236,7 +2255,7 @@ func ErrorAs(t TestingT, err error, target interface{}, msgAndArgs ...interface{ return Fail(t, fmt.Sprintf("Should be in error chain:\n"+ "expected: %s\n"+ - "in chain: %s", expectedType, chain, + "in chain: %s", expectedType, truncatingFormat("%s", chain), ), msgAndArgs...) } @@ -2254,7 +2273,7 @@ func NotErrorAs(t TestingT, err error, target interface{}, msgAndArgs ...interfa return Fail(t, fmt.Sprintf("Target error should not be in err chain:\n"+ "found: %s\n"+ - "in chain: %s", reflect.TypeOf(target).Elem().String(), chain, + "in chain: %s", reflect.TypeOf(target).Elem().String(), truncatingFormat("%s", chain), ), msgAndArgs...) } diff --git a/vendor/github.com/stretchr/testify/assert/doc.go b/vendor/github.com/stretchr/testify/assert/doc.go index a0b953aa5cf..c111589c7eb 100644 --- a/vendor/github.com/stretchr/testify/assert/doc.go +++ b/vendor/github.com/stretchr/testify/assert/doc.go @@ -40,8 +40,8 @@ // // # Assertions // -// Assertions allow you to easily write test code, and are global funcs in the `assert` package. -// All assertion functions take, as the first argument, the `*testing.T` object provided by the +// Assertions allow you to easily write test code, and are global funcs in the assert package. +// All assertion functions take, as the first argument, the [*testing.T] object provided by the // testing framework. This allows the assertion funcs to write the failings and other details to // the correct place. // diff --git a/vendor/github.com/stretchr/testify/assert/yaml/yaml_custom.go b/vendor/github.com/stretchr/testify/assert/yaml/yaml_custom.go index 5a74c4f4d5b..956227ca272 100644 --- a/vendor/github.com/stretchr/testify/assert/yaml/yaml_custom.go +++ b/vendor/github.com/stretchr/testify/assert/yaml/yaml_custom.go @@ -7,7 +7,7 @@ // go test -tags testify_yaml_custom // // This implementation can be used at build time to replace the default implementation -// to avoid linking with [gopkg.in/yaml.v3]. +// to avoid linking with [go.yaml.in/yaml/v3]. // // In your test package: // diff --git a/vendor/github.com/stretchr/testify/assert/yaml/yaml_default.go b/vendor/github.com/stretchr/testify/assert/yaml/yaml_default.go index 0bae80e34a3..dd89ac03aab 100644 --- a/vendor/github.com/stretchr/testify/assert/yaml/yaml_default.go +++ b/vendor/github.com/stretchr/testify/assert/yaml/yaml_default.go @@ -6,7 +6,7 @@ // indirection with an alternative implementation of this package that uses // another implementation of YAML deserialization. This allows to not either not // use YAML deserialization at all, or to use another implementation than -// [gopkg.in/yaml.v3] (for example for license compatibility reasons, see [PR #1120]). +// [go.yaml.in/yaml/v3] (for example for license compatibility reasons, see [PR #1120]). // // Alternative implementations are selected using build tags: // @@ -28,9 +28,9 @@ // [PR #1120]: https://github.com/stretchr/testify/pull/1120 package yaml -import goyaml "gopkg.in/yaml.v3" +import goyaml "go.yaml.in/yaml/v3" -// Unmarshal is just a wrapper of [gopkg.in/yaml.v3.Unmarshal]. +// Unmarshal is just a wrapper of [go.yaml.in/yaml/v3.Unmarshal]. func Unmarshal(in []byte, out interface{}) error { return goyaml.Unmarshal(in, out) } diff --git a/vendor/github.com/stretchr/testify/assert/yaml/yaml_fail.go b/vendor/github.com/stretchr/testify/assert/yaml/yaml_fail.go index 8041803fd2f..a51d2792508 100644 --- a/vendor/github.com/stretchr/testify/assert/yaml/yaml_fail.go +++ b/vendor/github.com/stretchr/testify/assert/yaml/yaml_fail.go @@ -3,7 +3,7 @@ // Package yaml is an implementation of YAML functions that always fail. // // This implementation can be used at build time to replace the default implementation -// to avoid linking with [gopkg.in/yaml.v3]: +// to avoid linking with [go.yaml.in/yaml/v3]: // // go test -tags testify_yaml_fail package yaml diff --git a/vendor/github.com/stretchr/testify/internal/difflib/LICENSE b/vendor/github.com/stretchr/testify/internal/difflib/LICENSE new file mode 100644 index 00000000000..485be13c67b --- /dev/null +++ b/vendor/github.com/stretchr/testify/internal/difflib/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2013, Patrick Mezard +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + The names of its contributors may not be used to endorse or promote +products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/vendor/github.com/stretchr/testify/internal/difflib/difflib.go b/vendor/github.com/stretchr/testify/internal/difflib/difflib.go new file mode 100644 index 00000000000..9984599b4ff --- /dev/null +++ b/vendor/github.com/stretchr/testify/internal/difflib/difflib.go @@ -0,0 +1,592 @@ +// Package difflib is a partial port of Python difflib module. +// +// It provides tools to compare sequences of strings and generate textual diffs. +// +// The following class and functions have been ported: +// +// - SequenceMatcher +// +// - unified_diff +// +// Getting unified diffs was the main goal of the port. Keep in mind this code +// is mostly suitable to output text differences in a human friendly way, there +// are no guarantees generated diffs are consumable by patch(1). +// +// This package was adopted from [github.com/pmezard/go-difflib] which +// is no longer maintained. +// +// [github.com/pmezard/go-difflib]: https://github.com/pmezard/go-difflib +package difflib + +import ( + "bufio" + "bytes" + "fmt" + "io" + "strings" +) + +func min(a, b int) int { + if a < b { + return a + } + return b +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +type Match struct { + A int + B int + Size int +} + +type OpCode struct { + Tag byte + I1 int + I2 int + J1 int + J2 int +} + +// SequenceMatcher compares sequence of strings. The basic +// algorithm predates, and is a little fancier than, an algorithm +// published in the late 1980's by Ratcliff and Obershelp under the +// hyperbolic name "gestalt pattern matching". The basic idea is to find +// the longest contiguous matching subsequence that contains no "junk" +// elements (R-O doesn't address junk). The same idea is then applied +// recursively to the pieces of the sequences to the left and to the right +// of the matching subsequence. This does not yield minimal edit +// sequences, but does tend to yield matches that "look right" to people. +// +// SequenceMatcher tries to compute a "human-friendly diff" between two +// sequences. Unlike e.g. UNIX(tm) diff, the fundamental notion is the +// longest *contiguous* & junk-free matching subsequence. That's what +// catches peoples' eyes. The Windows(tm) windiff has another interesting +// notion, pairing up elements that appear uniquely in each sequence. +// That, and the method here, appear to yield more intuitive difference +// reports than does diff. This method appears to be the least vulnerable +// to synching up on blocks of "junk lines", though (like blank lines in +// ordinary text files, or maybe "

" lines in HTML files). That may be +// because this is the only method of the 3 that has a *concept* of +// "junk" . +// +// Timing: Basic R-O is cubic time worst case and quadratic time expected +// case. SequenceMatcher is quadratic time for the worst case and has +// expected-case behavior dependent in a complicated way on how many +// elements the sequences have in common; best case time is linear. +type SequenceMatcher struct { + a []string + b []string + b2j map[string][]int + IsJunk func(string) bool + autoJunk bool + bJunk map[string]struct{} + matchingBlocks []Match + fullBCount map[string]int + bPopular map[string]struct{} + opCodes []OpCode +} + +func NewMatcher(a, b []string) *SequenceMatcher { + m := SequenceMatcher{autoJunk: true} + m.SetSeqs(a, b) + return &m +} + +// Set two sequences to be compared. +func (m *SequenceMatcher) SetSeqs(a, b []string) { + m.SetSeq1(a) + m.SetSeq2(b) +} + +// Set the first sequence to be compared. The second sequence to be compared is +// not changed. +// +// SequenceMatcher computes and caches detailed information about the second +// sequence, so if you want to compare one sequence S against many sequences, +// use .SetSeq2(s) once and call .SetSeq1(x) repeatedly for each of the other +// sequences. +// +// See also SetSeqs() and SetSeq2(). +func (m *SequenceMatcher) SetSeq1(a []string) { + if &a == &m.a { + return + } + m.a = a + m.matchingBlocks = nil + m.opCodes = nil +} + +// Set the second sequence to be compared. The first sequence to be compared is +// not changed. +func (m *SequenceMatcher) SetSeq2(b []string) { + if &b == &m.b { + return + } + m.b = b + m.matchingBlocks = nil + m.opCodes = nil + m.fullBCount = nil + m.chainB() +} + +func (m *SequenceMatcher) chainB() { + // Populate line -> index mapping + b2j := map[string][]int{} + for i, s := range m.b { + indices := b2j[s] + indices = append(indices, i) + b2j[s] = indices + } + + // Purge junk elements + m.bJunk = map[string]struct{}{} + if m.IsJunk != nil { + junk := m.bJunk + for s, _ := range b2j { + if m.IsJunk(s) { + junk[s] = struct{}{} + } + } + for s, _ := range junk { + delete(b2j, s) + } + } + + // Purge remaining popular elements + popular := map[string]struct{}{} + n := len(m.b) + if m.autoJunk && n >= 200 { + ntest := n/100 + 1 + for s, indices := range b2j { + if len(indices) > ntest { + popular[s] = struct{}{} + } + } + for s, _ := range popular { + delete(b2j, s) + } + } + m.bPopular = popular + m.b2j = b2j +} + +func (m *SequenceMatcher) isBJunk(s string) bool { + _, ok := m.bJunk[s] + return ok +} + +// Find longest matching block in a[alo:ahi] and b[blo:bhi]. +// +// If IsJunk is not defined: +// +// Return (i,j,k) such that a[i:i+k] is equal to b[j:j+k], where +// +// alo <= i <= i+k <= ahi +// blo <= j <= j+k <= bhi +// +// and for all (i',j',k') meeting those conditions, +// +// k >= k' +// i <= i' +// and if i == i', j <= j' +// +// In other words, of all maximal matching blocks, return one that +// starts earliest in a, and of all those maximal matching blocks that +// start earliest in a, return the one that starts earliest in b. +// +// If IsJunk is defined, first the longest matching block is +// determined as above, but with the additional restriction that no +// junk element appears in the block. Then that block is extended as +// far as possible by matching (only) junk elements on both sides. So +// the resulting block never matches on junk except as identical junk +// happens to be adjacent to an "interesting" match. +// +// If no blocks match, return (alo, blo, 0). +func (m *SequenceMatcher) findLongestMatch(alo, ahi, blo, bhi int) Match { + // CAUTION: stripping common prefix or suffix would be incorrect. + // E.g., + // ab + // acab + // Longest matching block is "ab", but if common prefix is + // stripped, it's "a" (tied with "b"). UNIX(tm) diff does so + // strip, so ends up claiming that ab is changed to acab by + // inserting "ca" in the middle. That's minimal but unintuitive: + // "it's obvious" that someone inserted "ac" at the front. + // Windiff ends up at the same place as diff, but by pairing up + // the unique 'b's and then matching the first two 'a's. + besti, bestj, bestsize := alo, blo, 0 + + // find longest junk-free match + // during an iteration of the loop, j2len[j] = length of longest + // junk-free match ending with a[i-1] and b[j] + j2len := map[int]int{} + for i := alo; i != ahi; i++ { + // look at all instances of a[i] in b; note that because + // b2j has no junk keys, the loop is skipped if a[i] is junk + newj2len := map[int]int{} + for _, j := range m.b2j[m.a[i]] { + // a[i] matches b[j] + if j < blo { + continue + } + if j >= bhi { + break + } + k := j2len[j-1] + 1 + newj2len[j] = k + if k > bestsize { + besti, bestj, bestsize = i-k+1, j-k+1, k + } + } + j2len = newj2len + } + + // Extend the best by non-junk elements on each end. In particular, + // "popular" non-junk elements aren't in b2j, which greatly speeds + // the inner loop above, but also means "the best" match so far + // doesn't contain any junk *or* popular non-junk elements. + for besti > alo && bestj > blo && !m.isBJunk(m.b[bestj-1]) && + m.a[besti-1] == m.b[bestj-1] { + besti, bestj, bestsize = besti-1, bestj-1, bestsize+1 + } + for besti+bestsize < ahi && bestj+bestsize < bhi && + !m.isBJunk(m.b[bestj+bestsize]) && + m.a[besti+bestsize] == m.b[bestj+bestsize] { + bestsize += 1 + } + + // Now that we have a wholly interesting match (albeit possibly + // empty!), we may as well suck up the matching junk on each + // side of it too. Can't think of a good reason not to, and it + // saves post-processing the (possibly considerable) expense of + // figuring out what to do with it. In the case of an empty + // interesting match, this is clearly the right thing to do, + // because no other kind of match is possible in the regions. + for besti > alo && bestj > blo && m.isBJunk(m.b[bestj-1]) && + m.a[besti-1] == m.b[bestj-1] { + besti, bestj, bestsize = besti-1, bestj-1, bestsize+1 + } + for besti+bestsize < ahi && bestj+bestsize < bhi && + m.isBJunk(m.b[bestj+bestsize]) && + m.a[besti+bestsize] == m.b[bestj+bestsize] { + bestsize += 1 + } + + return Match{A: besti, B: bestj, Size: bestsize} +} + +// Return list of triples describing matching subsequences. +// +// Each triple is of the form (i, j, n), and means that +// a[i:i+n] == b[j:j+n]. The triples are monotonically increasing in +// i and in j. It's also guaranteed that if (i, j, n) and (i', j', n') are +// adjacent triples in the list, and the second is not the last triple in the +// list, then i+n != i' or j+n != j'. IOW, adjacent triples never describe +// adjacent equal blocks. +// +// The last triple is a dummy, (len(a), len(b), 0), and is the only +// triple with n==0. +func (m *SequenceMatcher) GetMatchingBlocks() []Match { + if m.matchingBlocks != nil { + return m.matchingBlocks + } + + var matchBlocks func(alo, ahi, blo, bhi int, matched []Match) []Match + matchBlocks = func(alo, ahi, blo, bhi int, matched []Match) []Match { + match := m.findLongestMatch(alo, ahi, blo, bhi) + i, j, k := match.A, match.B, match.Size + if match.Size > 0 { + if alo < i && blo < j { + matched = matchBlocks(alo, i, blo, j, matched) + } + matched = append(matched, match) + if i+k < ahi && j+k < bhi { + matched = matchBlocks(i+k, ahi, j+k, bhi, matched) + } + } + return matched + } + matched := matchBlocks(0, len(m.a), 0, len(m.b), nil) + + // It's possible that we have adjacent equal blocks in the + // matching_blocks list now. + nonAdjacent := []Match{} + i1, j1, k1 := 0, 0, 0 + for _, b := range matched { + // Is this block adjacent to i1, j1, k1? + i2, j2, k2 := b.A, b.B, b.Size + if i1+k1 == i2 && j1+k1 == j2 { + // Yes, so collapse them -- this just increases the length of + // the first block by the length of the second, and the first + // block so lengthened remains the block to compare against. + k1 += k2 + } else { + // Not adjacent. Remember the first block (k1==0 means it's + // the dummy we started with), and make the second block the + // new block to compare against. + if k1 > 0 { + nonAdjacent = append(nonAdjacent, Match{i1, j1, k1}) + } + i1, j1, k1 = i2, j2, k2 + } + } + if k1 > 0 { + nonAdjacent = append(nonAdjacent, Match{i1, j1, k1}) + } + + nonAdjacent = append(nonAdjacent, Match{len(m.a), len(m.b), 0}) + m.matchingBlocks = nonAdjacent + return m.matchingBlocks +} + +// Return list of 5-tuples describing how to turn a into b. +// +// Each tuple is of the form (tag, i1, i2, j1, j2). The first tuple +// has i1 == j1 == 0, and remaining tuples have i1 == the i2 from the +// tuple preceding it, and likewise for j1 == the previous j2. +// +// The tags are characters, with these meanings: +// +// 'r' (replace): a[i1:i2] should be replaced by b[j1:j2] +// +// 'd' (delete): a[i1:i2] should be deleted, j1==j2 in this case. +// +// 'i' (insert): b[j1:j2] should be inserted at a[i1:i1], i1==i2 in this case. +// +// 'e' (equal): a[i1:i2] == b[j1:j2] +func (m *SequenceMatcher) GetOpCodes() []OpCode { + if m.opCodes != nil { + return m.opCodes + } + i, j := 0, 0 + matching := m.GetMatchingBlocks() + opCodes := make([]OpCode, 0, len(matching)) + for _, m := range matching { + // invariant: we've pumped out correct diffs to change + // a[:i] into b[:j], and the next matching block is + // a[ai:ai+size] == b[bj:bj+size]. So we need to pump + // out a diff to change a[i:ai] into b[j:bj], pump out + // the matching block, and move (i,j) beyond the match + ai, bj, size := m.A, m.B, m.Size + tag := byte(0) + if i < ai && j < bj { + tag = 'r' + } else if i < ai { + tag = 'd' + } else if j < bj { + tag = 'i' + } + if tag > 0 { + opCodes = append(opCodes, OpCode{tag, i, ai, j, bj}) + } + i, j = ai+size, bj+size + // the list of matching blocks is terminated by a + // sentinel with size 0 + if size > 0 { + opCodes = append(opCodes, OpCode{'e', ai, i, bj, j}) + } + } + m.opCodes = opCodes + return m.opCodes +} + +// Isolate change clusters by eliminating ranges with no changes. +// +// Return a generator of groups with up to n lines of context. +// Each group is in the same format as returned by GetOpCodes(). +func (m *SequenceMatcher) GetGroupedOpCodes(n int) [][]OpCode { + if n < 0 { + n = 3 + } + codes := m.GetOpCodes() + if len(codes) == 0 { + codes = []OpCode{OpCode{'e', 0, 1, 0, 1}} + } + // Fixup leading and trailing groups if they show no changes. + if codes[0].Tag == 'e' { + c := codes[0] + i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 + codes[0] = OpCode{c.Tag, max(i1, i2-n), i2, max(j1, j2-n), j2} + } + if codes[len(codes)-1].Tag == 'e' { + c := codes[len(codes)-1] + i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 + codes[len(codes)-1] = OpCode{c.Tag, i1, min(i2, i1+n), j1, min(j2, j1+n)} + } + nn := n + n + groups := [][]OpCode{} + group := []OpCode{} + for _, c := range codes { + i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 + // End the current group and start a new one whenever + // there is a large range with no changes. + if c.Tag == 'e' && i2-i1 > nn { + group = append(group, OpCode{c.Tag, i1, min(i2, i1+n), + j1, min(j2, j1+n)}) + groups = append(groups, group) + group = []OpCode{} + i1, j1 = max(i1, i2-n), max(j1, j2-n) + } + group = append(group, OpCode{c.Tag, i1, i2, j1, j2}) + } + if len(group) > 0 && !(len(group) == 1 && group[0].Tag == 'e') { + groups = append(groups, group) + } + return groups +} + +// Convert range to the "ed" format +func formatRangeUnified(start, stop int) string { + // Per the diff spec at http://www.unix.org/single_unix_specification/ + beginning := start + 1 // lines start numbering with one + length := stop - start + if length == 1 { + return fmt.Sprintf("%d", beginning) + } + if length == 0 { + beginning -= 1 // empty ranges begin at line just before the range + } + return fmt.Sprintf("%d,%d", beginning, length) +} + +// Unified diff parameters +type UnifiedDiff struct { + A []string // First sequence lines + FromFile string // First file name + FromDate string // First file time + B []string // Second sequence lines + ToFile string // Second file name + ToDate string // Second file time + Eol string // Headers end of line, defaults to LF + Context int // Number of context lines +} + +// Compare two sequences of lines; generate the delta as a unified diff. +// +// Unified diffs are a compact way of showing line changes and a few +// lines of context. The number of context lines is set by 'n' which +// defaults to three. +// +// By default, the diff control lines (those with ---, +++, or @@) are +// created with a trailing newline. This is helpful so that inputs +// created from file.readlines() result in diffs that are suitable for +// file.writelines() since both the inputs and outputs have trailing +// newlines. +// +// For inputs that do not have trailing newlines, set the lineterm +// argument to "" so that the output will be uniformly newline free. +// +// The unidiff format normally has a header for filenames and modification +// times. Any or all of these may be specified using strings for +// 'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'. +// The modification times are normally expressed in the ISO 8601 format. +func WriteUnifiedDiff(writer io.Writer, diff UnifiedDiff) error { + buf := bufio.NewWriter(writer) + defer buf.Flush() + wf := func(format string, args ...interface{}) error { + _, err := buf.WriteString(fmt.Sprintf(format, args...)) + return err + } + ws := func(s string) error { + _, err := buf.WriteString(s) + return err + } + + if len(diff.Eol) == 0 { + diff.Eol = "\n" + } + + started := false + m := NewMatcher(diff.A, diff.B) + for _, g := range m.GetGroupedOpCodes(diff.Context) { + if !started { + started = true + fromDate := "" + if len(diff.FromDate) > 0 { + fromDate = "\t" + diff.FromDate + } + toDate := "" + if len(diff.ToDate) > 0 { + toDate = "\t" + diff.ToDate + } + if diff.FromFile != "" || diff.ToFile != "" { + err := wf("--- %s%s%s", diff.FromFile, fromDate, diff.Eol) + if err != nil { + return err + } + err = wf("+++ %s%s%s", diff.ToFile, toDate, diff.Eol) + if err != nil { + return err + } + } + } + first, last := g[0], g[len(g)-1] + range1 := formatRangeUnified(first.I1, last.I2) + range2 := formatRangeUnified(first.J1, last.J2) + if err := wf("@@ -%s +%s @@%s", range1, range2, diff.Eol); err != nil { + return err + } + for _, c := range g { + i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 + if c.Tag == 'e' { + for _, line := range diff.A[i1:i2] { + if err := ws(" " + line); err != nil { + return err + } + } + continue + } + if c.Tag == 'r' || c.Tag == 'd' { + for _, line := range diff.A[i1:i2] { + if err := ws("-" + line); err != nil { + return err + } + } + } + if c.Tag == 'r' || c.Tag == 'i' { + for _, line := range diff.B[j1:j2] { + if err := ws("+" + line); err != nil { + return err + } + } + } + } + } + return nil +} + +// Like WriteUnifiedDiff but returns the diff a string. +func GetUnifiedDiffString(diff UnifiedDiff) (string, error) { + w := &bytes.Buffer{} + err := WriteUnifiedDiff(w, diff) + return string(w.Bytes()), err +} + +// Convert range to the "ed" format. +func formatRangeContext(start, stop int) string { + // Per the diff spec at http://www.unix.org/single_unix_specification/ + beginning := start + 1 // lines start numbering with one + length := stop - start + if length == 0 { + beginning -= 1 // empty ranges begin at line just before the range + } + if length <= 1 { + return fmt.Sprintf("%d", beginning) + } + return fmt.Sprintf("%d,%d", beginning, beginning+length-1) +} + +// Split a string on "\n" while preserving them. The output can be used +// as input for UnifiedDiff and ContextDiff structures. +func SplitLines(s string) []string { + lines := strings.SplitAfter(s, "\n") + lines[len(lines)-1] += "\n" + return lines +} diff --git a/vendor/github.com/stretchr/testify/internal/spew/LICENSE b/vendor/github.com/stretchr/testify/internal/spew/LICENSE new file mode 100644 index 00000000000..bc52e96f2b0 --- /dev/null +++ b/vendor/github.com/stretchr/testify/internal/spew/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright (c) 2012-2016 Dave Collins + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/vendor/github.com/stretchr/testify/internal/spew/README.md b/vendor/github.com/stretchr/testify/internal/spew/README.md new file mode 100644 index 00000000000..51a909e2ef0 --- /dev/null +++ b/vendor/github.com/stretchr/testify/internal/spew/README.md @@ -0,0 +1,12 @@ +go-spew +======= + +[![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) + +Go-spew implements a deep pretty printer for Go data structures to aid in +debugging. A comprehensive suite of tests with 100% test coverage is provided +to ensure proper functionality. + +## License + +Go-spew is licensed under the [copyfree](http://copyfree.org) ISC License. diff --git a/vendor/github.com/stretchr/testify/internal/spew/bypass.go b/vendor/github.com/stretchr/testify/internal/spew/bypass.go new file mode 100644 index 00000000000..70ddeaad3e5 --- /dev/null +++ b/vendor/github.com/stretchr/testify/internal/spew/bypass.go @@ -0,0 +1,146 @@ +// Copyright (c) 2015-2016 Dave Collins +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +// NOTE: Due to the following build constraints, this file will only be compiled +// when the code is not running on Google App Engine, compiled by GopherJS, and +// "-tags safe" is not added to the go build command line. The "disableunsafe" +// tag is deprecated and thus should not be used. +// Go versions prior to 1.4 are disabled because they use a different layout +// for interfaces which make the implementation of unsafeReflectValue more complex. +//go:build !js && !appengine && !safe && !disableunsafe && go1.4 +// +build !js,!appengine,!safe,!disableunsafe,go1.4 + +package spew + +import ( + "reflect" + "unsafe" +) + +const ( + // UnsafeDisabled is a build-time constant which specifies whether or + // not access to the unsafe package is available. + UnsafeDisabled = false + + // ptrSize is the size of a pointer on the current arch. + ptrSize = unsafe.Sizeof((*byte)(nil)) +) + +type flag uintptr + +var ( + // flagRO indicates whether the value field of a reflect.Value + // is read-only. + flagRO flag + + // flagAddr indicates whether the address of the reflect.Value's + // value may be taken. + flagAddr flag +) + +// flagKindMask holds the bits that make up the kind +// part of the flags field. In all the supported versions, +// it is in the lower 5 bits. +const flagKindMask = flag(0x1f) + +// Different versions of Go have used different +// bit layouts for the flags type. This table +// records the known combinations. +var okFlags = []struct { + ro, addr flag +}{{ + // From Go 1.4 to 1.5 + ro: 1 << 5, + addr: 1 << 7, +}, { + // Up to Go tip. + ro: 1<<5 | 1<<6, + addr: 1 << 8, +}} + +var flagValOffset = func() uintptr { + field, ok := reflect.TypeOf(reflect.Value{}).FieldByName("flag") + if !ok { + panic("reflect.Value has no flag field") + } + return field.Offset +}() + +// flagField returns a pointer to the flag field of a reflect.Value. +func flagField(v *reflect.Value) *flag { + return (*flag)(unsafe.Pointer(uintptr(unsafe.Pointer(v)) + flagValOffset)) +} + +// unsafeReflectValue converts the passed reflect.Value into a one that bypasses +// the typical safety restrictions preventing access to unaddressable and +// unexported data. It works by digging the raw pointer to the underlying +// value out of the protected value and generating a new unprotected (unsafe) +// reflect.Value to it. +// +// This allows us to check for implementations of the Stringer and error +// interfaces to be used for pretty printing ordinarily unaddressable and +// inaccessible values such as unexported struct fields. +func unsafeReflectValue(v reflect.Value) reflect.Value { + if !v.IsValid() || (v.CanInterface() && v.CanAddr()) { + return v + } + flagFieldPtr := flagField(&v) + *flagFieldPtr &^= flagRO + *flagFieldPtr |= flagAddr + return v +} + +// Sanity checks against future reflect package changes +// to the type or semantics of the Value.flag field. +func init() { + field, ok := reflect.TypeOf(reflect.Value{}).FieldByName("flag") + if !ok { + panic("reflect.Value has no flag field") + } + if field.Type.Kind() != reflect.TypeOf(flag(0)).Kind() { + panic("reflect.Value flag field has changed kind") + } + type t0 int + var t struct { + A t0 + // t0 will have flagEmbedRO set. + t0 + // a will have flagStickyRO set + a t0 + } + vA := reflect.ValueOf(t).FieldByName("A") + va := reflect.ValueOf(t).FieldByName("a") + vt0 := reflect.ValueOf(t).FieldByName("t0") + + // Infer flagRO from the difference between the flags + // for the (otherwise identical) fields in t. + flagPublic := *flagField(&vA) + flagWithRO := *flagField(&va) | *flagField(&vt0) + flagRO = flagPublic ^ flagWithRO + + // Infer flagAddr from the difference between a value + // taken from a pointer and not. + vPtrA := reflect.ValueOf(&t).Elem().FieldByName("A") + flagNoPtr := *flagField(&vA) + flagPtr := *flagField(&vPtrA) + flagAddr = flagNoPtr ^ flagPtr + + // Check that the inferred flags tally with one of the known versions. + for _, f := range okFlags { + if flagRO == f.ro && flagAddr == f.addr { + return + } + } + panic("reflect.Value read-only flag has changed semantics") +} diff --git a/vendor/github.com/stretchr/testify/internal/spew/bypasssafe.go b/vendor/github.com/stretchr/testify/internal/spew/bypasssafe.go new file mode 100644 index 00000000000..5e2d890d6ac --- /dev/null +++ b/vendor/github.com/stretchr/testify/internal/spew/bypasssafe.go @@ -0,0 +1,39 @@ +// Copyright (c) 2015-2016 Dave Collins +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +// NOTE: Due to the following build constraints, this file will only be compiled +// when the code is running on Google App Engine, compiled by GopherJS, or +// "-tags safe" is added to the go build command line. The "disableunsafe" +// tag is deprecated and thus should not be used. +//go:build js || appengine || safe || disableunsafe || !go1.4 +// +build js appengine safe disableunsafe !go1.4 + +package spew + +import "reflect" + +const ( + // UnsafeDisabled is a build-time constant which specifies whether or + // not access to the unsafe package is available. + UnsafeDisabled = true +) + +// unsafeReflectValue typically converts the passed reflect.Value into a one +// that bypasses the typical safety restrictions preventing access to +// unaddressable and unexported data. However, doing this relies on access to +// the unsafe package. This is a stub version which simply returns the passed +// reflect.Value when the unsafe package is not available. +func unsafeReflectValue(v reflect.Value) reflect.Value { + return v +} diff --git a/vendor/github.com/stretchr/testify/internal/spew/common.go b/vendor/github.com/stretchr/testify/internal/spew/common.go new file mode 100644 index 00000000000..1be8ce94576 --- /dev/null +++ b/vendor/github.com/stretchr/testify/internal/spew/common.go @@ -0,0 +1,341 @@ +/* + * Copyright (c) 2013-2016 Dave Collins + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package spew + +import ( + "bytes" + "fmt" + "io" + "reflect" + "sort" + "strconv" +) + +// Some constants in the form of bytes to avoid string overhead. This mirrors +// the technique used in the fmt package. +var ( + panicBytes = []byte("(PANIC=") + plusBytes = []byte("+") + iBytes = []byte("i") + trueBytes = []byte("true") + falseBytes = []byte("false") + interfaceBytes = []byte("(interface {})") + commaNewlineBytes = []byte(",\n") + newlineBytes = []byte("\n") + openBraceBytes = []byte("{") + openBraceNewlineBytes = []byte("{\n") + closeBraceBytes = []byte("}") + asteriskBytes = []byte("*") + colonBytes = []byte(":") + colonSpaceBytes = []byte(": ") + openParenBytes = []byte("(") + closeParenBytes = []byte(")") + spaceBytes = []byte(" ") + pointerChainBytes = []byte("->") + nilAngleBytes = []byte("") + maxNewlineBytes = []byte("\n") + maxShortBytes = []byte("") + circularBytes = []byte("") + circularShortBytes = []byte("") + invalidAngleBytes = []byte("") + openBracketBytes = []byte("[") + closeBracketBytes = []byte("]") + percentBytes = []byte("%") + precisionBytes = []byte(".") + openAngleBytes = []byte("<") + closeAngleBytes = []byte(">") + openMapBytes = []byte("map[") + closeMapBytes = []byte("]") + lenEqualsBytes = []byte("len=") + capEqualsBytes = []byte("cap=") +) + +// hexDigits is used to map a decimal value to a hex digit. +var hexDigits = "0123456789abcdef" + +// catchPanic handles any panics that might occur during the handleMethods +// calls. +func catchPanic(w io.Writer, v reflect.Value) { + if err := recover(); err != nil { + w.Write(panicBytes) + fmt.Fprintf(w, "%v", err) + w.Write(closeParenBytes) + } +} + +// handleMethods attempts to call the Error and String methods on the underlying +// type the passed reflect.Value represents and outputes the result to Writer w. +// +// It handles panics in any called methods by catching and displaying the error +// as the formatted value. +func handleMethods(cs *ConfigState, w io.Writer, v reflect.Value) (handled bool) { + // We need an interface to check if the type implements the error or + // Stringer interface. However, the reflect package won't give us an + // interface on certain things like unexported struct fields in order + // to enforce visibility rules. We use unsafe, when it's available, + // to bypass these restrictions since this package does not mutate the + // values. + if !v.CanInterface() { + if UnsafeDisabled { + return false + } + + v = unsafeReflectValue(v) + } + + // Choose whether or not to do error and Stringer interface lookups against + // the base type or a pointer to the base type depending on settings. + // Technically calling one of these methods with a pointer receiver can + // mutate the value, however, types which choose to satisify an error or + // Stringer interface with a pointer receiver should not be mutating their + // state inside these interface methods. + if !cs.DisablePointerMethods && !UnsafeDisabled && !v.CanAddr() { + v = unsafeReflectValue(v) + } + if v.CanAddr() { + v = v.Addr() + } + + // Is it an error or Stringer? + switch iface := v.Interface().(type) { + case error: + defer catchPanic(w, v) + if cs.ContinueOnMethod { + w.Write(openParenBytes) + w.Write([]byte(iface.Error())) + w.Write(closeParenBytes) + w.Write(spaceBytes) + return false + } + + w.Write([]byte(iface.Error())) + return true + + case fmt.Stringer: + defer catchPanic(w, v) + if cs.ContinueOnMethod { + w.Write(openParenBytes) + w.Write([]byte(iface.String())) + w.Write(closeParenBytes) + w.Write(spaceBytes) + return false + } + w.Write([]byte(iface.String())) + return true + } + return false +} + +// printBool outputs a boolean value as true or false to Writer w. +func printBool(w io.Writer, val bool) { + if val { + w.Write(trueBytes) + } else { + w.Write(falseBytes) + } +} + +// printInt outputs a signed integer value to Writer w. +func printInt(w io.Writer, val int64, base int) { + w.Write([]byte(strconv.FormatInt(val, base))) +} + +// printUint outputs an unsigned integer value to Writer w. +func printUint(w io.Writer, val uint64, base int) { + w.Write([]byte(strconv.FormatUint(val, base))) +} + +// printFloat outputs a floating point value using the specified precision, +// which is expected to be 32 or 64bit, to Writer w. +func printFloat(w io.Writer, val float64, precision int) { + w.Write([]byte(strconv.FormatFloat(val, 'g', -1, precision))) +} + +// printComplex outputs a complex value using the specified float precision +// for the real and imaginary parts to Writer w. +func printComplex(w io.Writer, c complex128, floatPrecision int) { + r := real(c) + w.Write(openParenBytes) + w.Write([]byte(strconv.FormatFloat(r, 'g', -1, floatPrecision))) + i := imag(c) + if i >= 0 { + w.Write(plusBytes) + } + w.Write([]byte(strconv.FormatFloat(i, 'g', -1, floatPrecision))) + w.Write(iBytes) + w.Write(closeParenBytes) +} + +// printHexPtr outputs a uintptr formatted as hexadecimal with a leading '0x' +// prefix to Writer w. +func printHexPtr(w io.Writer, p uintptr) { + // Null pointer. + num := uint64(p) + if num == 0 { + w.Write(nilAngleBytes) + return + } + + // Max uint64 is 16 bytes in hex + 2 bytes for '0x' prefix + buf := make([]byte, 18) + + // It's simpler to construct the hex string right to left. + base := uint64(16) + i := len(buf) - 1 + for num >= base { + buf[i] = hexDigits[num%base] + num /= base + i-- + } + buf[i] = hexDigits[num] + + // Add '0x' prefix. + i-- + buf[i] = 'x' + i-- + buf[i] = '0' + + // Strip unused leading bytes. + buf = buf[i:] + w.Write(buf) +} + +// valuesSorter implements sort.Interface to allow a slice of reflect.Value +// elements to be sorted. +type valuesSorter struct { + values []reflect.Value + strings []string // either nil or same len and values + cs *ConfigState +} + +// newValuesSorter initializes a valuesSorter instance, which holds a set of +// surrogate keys on which the data should be sorted. It uses flags in +// ConfigState to decide if and how to populate those surrogate keys. +func newValuesSorter(values []reflect.Value, cs *ConfigState) sort.Interface { + vs := &valuesSorter{values: values, cs: cs} + if canSortSimply(vs.values[0].Kind()) { + return vs + } + if !cs.DisableMethods { + vs.strings = make([]string, len(values)) + for i := range vs.values { + b := bytes.Buffer{} + if !handleMethods(cs, &b, vs.values[i]) { + vs.strings = nil + break + } + vs.strings[i] = b.String() + } + } + if vs.strings == nil && cs.SpewKeys { + vs.strings = make([]string, len(values)) + for i := range vs.values { + vs.strings[i] = Sprintf("%#v", vs.values[i].Interface()) + } + } + return vs +} + +// canSortSimply tests whether a reflect.Kind is a primitive that can be sorted +// directly, or whether it should be considered for sorting by surrogate keys +// (if the ConfigState allows it). +func canSortSimply(kind reflect.Kind) bool { + // This switch parallels valueSortLess, except for the default case. + switch kind { + case reflect.Bool: + return true + case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: + return true + case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: + return true + case reflect.Float32, reflect.Float64: + return true + case reflect.String: + return true + case reflect.Uintptr: + return true + case reflect.Array: + return true + } + return false +} + +// Len returns the number of values in the slice. It is part of the +// sort.Interface implementation. +func (s *valuesSorter) Len() int { + return len(s.values) +} + +// Swap swaps the values at the passed indices. It is part of the +// sort.Interface implementation. +func (s *valuesSorter) Swap(i, j int) { + s.values[i], s.values[j] = s.values[j], s.values[i] + if s.strings != nil { + s.strings[i], s.strings[j] = s.strings[j], s.strings[i] + } +} + +// valueSortLess returns whether the first value should sort before the second +// value. It is used by valueSorter.Less as part of the sort.Interface +// implementation. +func valueSortLess(a, b reflect.Value) bool { + switch a.Kind() { + case reflect.Bool: + return !a.Bool() && b.Bool() + case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: + return a.Int() < b.Int() + case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: + return a.Uint() < b.Uint() + case reflect.Float32, reflect.Float64: + return a.Float() < b.Float() + case reflect.String: + return a.String() < b.String() + case reflect.Uintptr: + return a.Uint() < b.Uint() + case reflect.Array: + // Compare the contents of both arrays. + l := a.Len() + for i := 0; i < l; i++ { + av := a.Index(i) + bv := b.Index(i) + if av.Interface() == bv.Interface() { + continue + } + return valueSortLess(av, bv) + } + } + return a.String() < b.String() +} + +// Less returns whether the value at index i should sort before the +// value at index j. It is part of the sort.Interface implementation. +func (s *valuesSorter) Less(i, j int) bool { + if s.strings == nil { + return valueSortLess(s.values[i], s.values[j]) + } + return s.strings[i] < s.strings[j] +} + +// sortValues is a sort function that handles both native types and any type that +// can be converted to error or Stringer. Other inputs are sorted according to +// their Value.String() value to ensure display stability. +func sortValues(values []reflect.Value, cs *ConfigState) { + if len(values) == 0 { + return + } + sort.Sort(newValuesSorter(values, cs)) +} diff --git a/vendor/github.com/stretchr/testify/internal/spew/config.go b/vendor/github.com/stretchr/testify/internal/spew/config.go new file mode 100644 index 00000000000..161895fc6db --- /dev/null +++ b/vendor/github.com/stretchr/testify/internal/spew/config.go @@ -0,0 +1,306 @@ +/* + * Copyright (c) 2013-2016 Dave Collins + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package spew + +import ( + "bytes" + "fmt" + "io" + "os" +) + +// ConfigState houses the configuration options used by spew to format and +// display values. There is a global instance, Config, that is used to control +// all top-level Formatter and Dump functionality. Each ConfigState instance +// provides methods equivalent to the top-level functions. +// +// The zero value for ConfigState provides no indentation. You would typically +// want to set it to a space or a tab. +// +// Alternatively, you can use NewDefaultConfig to get a ConfigState instance +// with default settings. See the documentation of NewDefaultConfig for default +// values. +type ConfigState struct { + // Indent specifies the string to use for each indentation level. The + // global config instance that all top-level functions use set this to a + // single space by default. If you would like more indentation, you might + // set this to a tab with "\t" or perhaps two spaces with " ". + Indent string + + // MaxDepth controls the maximum number of levels to descend into nested + // data structures. The default, 0, means there is no limit. + // + // NOTE: Circular data structures are properly detected, so it is not + // necessary to set this value unless you specifically want to limit deeply + // nested data structures. + MaxDepth int + + // DisableMethods specifies whether or not error and Stringer interfaces are + // invoked for types that implement them. + DisableMethods bool + + // DisablePointerMethods specifies whether or not to check for and invoke + // error and Stringer interfaces on types which only accept a pointer + // receiver when the current type is not a pointer. + // + // NOTE: This might be an unsafe action since calling one of these methods + // with a pointer receiver could technically mutate the value, however, + // in practice, types which choose to satisify an error or Stringer + // interface with a pointer receiver should not be mutating their state + // inside these interface methods. As a result, this option relies on + // access to the unsafe package, so it will not have any effect when + // running in environments without access to the unsafe package such as + // Google App Engine or with the "safe" build tag specified. + DisablePointerMethods bool + + // DisablePointerAddresses specifies whether to disable the printing of + // pointer addresses. This is useful when diffing data structures in tests. + DisablePointerAddresses bool + + // DisableCapacities specifies whether to disable the printing of capacities + // for arrays, slices, maps and channels. This is useful when diffing + // data structures in tests. + DisableCapacities bool + + // ContinueOnMethod specifies whether or not recursion should continue once + // a custom error or Stringer interface is invoked. The default, false, + // means it will print the results of invoking the custom error or Stringer + // interface and return immediately instead of continuing to recurse into + // the internals of the data type. + // + // NOTE: This flag does not have any effect if method invocation is disabled + // via the DisableMethods or DisablePointerMethods options. + ContinueOnMethod bool + + // SortKeys specifies map keys should be sorted before being printed. Use + // this to have a more deterministic, diffable output. Note that only + // native types (bool, int, uint, floats, uintptr and string) and types + // that support the error or Stringer interfaces (if methods are + // enabled) are supported, with other types sorted according to the + // reflect.Value.String() output which guarantees display stability. + SortKeys bool + + // SpewKeys specifies that, as a last resort attempt, map keys should + // be spewed to strings and sorted by those strings. This is only + // considered if SortKeys is true. + SpewKeys bool +} + +// Config is the active configuration of the top-level functions. +// The configuration can be changed by modifying the contents of spew.Config. +var Config = ConfigState{Indent: " "} + +// Errorf is a wrapper for fmt.Errorf that treats each argument as if it were +// passed with a Formatter interface returned by c.NewFormatter. It returns +// the formatted string as a value that satisfies error. See NewFormatter +// for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Errorf(format, c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Errorf(format string, a ...interface{}) (err error) { + return fmt.Errorf(format, c.convertArgs(a)...) +} + +// Fprint is a wrapper for fmt.Fprint that treats each argument as if it were +// passed with a Formatter interface returned by c.NewFormatter. It returns +// the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Fprint(w, c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Fprint(w io.Writer, a ...interface{}) (n int, err error) { + return fmt.Fprint(w, c.convertArgs(a)...) +} + +// Fprintf is a wrapper for fmt.Fprintf that treats each argument as if it were +// passed with a Formatter interface returned by c.NewFormatter. It returns +// the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Fprintf(w, format, c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) { + return fmt.Fprintf(w, format, c.convertArgs(a)...) +} + +// Fprintln is a wrapper for fmt.Fprintln that treats each argument as if it +// passed with a Formatter interface returned by c.NewFormatter. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Fprintln(w, c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Fprintln(w io.Writer, a ...interface{}) (n int, err error) { + return fmt.Fprintln(w, c.convertArgs(a)...) +} + +// Print is a wrapper for fmt.Print that treats each argument as if it were +// passed with a Formatter interface returned by c.NewFormatter. It returns +// the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Print(c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Print(a ...interface{}) (n int, err error) { + return fmt.Print(c.convertArgs(a)...) +} + +// Printf is a wrapper for fmt.Printf that treats each argument as if it were +// passed with a Formatter interface returned by c.NewFormatter. It returns +// the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Printf(format, c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Printf(format string, a ...interface{}) (n int, err error) { + return fmt.Printf(format, c.convertArgs(a)...) +} + +// Println is a wrapper for fmt.Println that treats each argument as if it were +// passed with a Formatter interface returned by c.NewFormatter. It returns +// the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Println(c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Println(a ...interface{}) (n int, err error) { + return fmt.Println(c.convertArgs(a)...) +} + +// Sprint is a wrapper for fmt.Sprint that treats each argument as if it were +// passed with a Formatter interface returned by c.NewFormatter. It returns +// the resulting string. See NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Sprint(c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Sprint(a ...interface{}) string { + return fmt.Sprint(c.convertArgs(a)...) +} + +// Sprintf is a wrapper for fmt.Sprintf that treats each argument as if it were +// passed with a Formatter interface returned by c.NewFormatter. It returns +// the resulting string. See NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Sprintf(format, c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Sprintf(format string, a ...interface{}) string { + return fmt.Sprintf(format, c.convertArgs(a)...) +} + +// Sprintln is a wrapper for fmt.Sprintln that treats each argument as if it +// were passed with a Formatter interface returned by c.NewFormatter. It +// returns the resulting string. See NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Sprintln(c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Sprintln(a ...interface{}) string { + return fmt.Sprintln(c.convertArgs(a)...) +} + +/* +NewFormatter returns a custom formatter that satisfies the fmt.Formatter +interface. As a result, it integrates cleanly with standard fmt package +printing functions. The formatter is useful for inline printing of smaller data +types similar to the standard %v format specifier. + +The custom formatter only responds to the %v (most compact), %+v (adds pointer +addresses), %#v (adds types), and %#+v (adds types and pointer addresses) verb +combinations. Any other verbs such as %x and %q will be sent to the the +standard fmt package for formatting. In addition, the custom formatter ignores +the width and precision arguments (however they will still work on the format +specifiers not handled by the custom formatter). + +Typically this function shouldn't be called directly. It is much easier to make +use of the custom formatter by calling one of the convenience functions such as +c.Printf, c.Println, or c.Printf. +*/ +func (c *ConfigState) NewFormatter(v interface{}) fmt.Formatter { + return newFormatter(c, v) +} + +// Fdump formats and displays the passed arguments to io.Writer w. It formats +// exactly the same as Dump. +func (c *ConfigState) Fdump(w io.Writer, a ...interface{}) { + fdump(c, w, a...) +} + +/* +Dump displays the passed parameters to standard out with newlines, customizable +indentation, and additional debug information such as complete types and all +pointer addresses used to indirect to the final value. It provides the +following features over the built-in printing facilities provided by the fmt +package: + + - Pointers are dereferenced and followed + - Circular data structures are detected and handled properly + - Custom Stringer/error interfaces are optionally invoked, including + on unexported types + - Custom types which only implement the Stringer/error interfaces via + a pointer receiver are optionally invoked when passing non-pointer + variables + - Byte arrays and slices are dumped like the hexdump -C command which + includes offsets, byte values in hex, and ASCII output + +The configuration options are controlled by modifying the public members +of c. See ConfigState for options documentation. + +See Fdump if you would prefer dumping to an arbitrary io.Writer or Sdump to +get the formatted result as a string. +*/ +func (c *ConfigState) Dump(a ...interface{}) { + fdump(c, os.Stdout, a...) +} + +// Sdump returns a string with the passed arguments formatted exactly the same +// as Dump. +func (c *ConfigState) Sdump(a ...interface{}) string { + var buf bytes.Buffer + fdump(c, &buf, a...) + return buf.String() +} + +// convertArgs accepts a slice of arguments and returns a slice of the same +// length with each argument converted to a spew Formatter interface using +// the ConfigState associated with s. +func (c *ConfigState) convertArgs(args []interface{}) (formatters []interface{}) { + formatters = make([]interface{}, len(args)) + for index, arg := range args { + formatters[index] = newFormatter(c, arg) + } + return formatters +} + +// NewDefaultConfig returns a ConfigState with the following default settings. +// +// Indent: " " +// MaxDepth: 0 +// DisableMethods: false +// DisablePointerMethods: false +// ContinueOnMethod: false +// SortKeys: false +func NewDefaultConfig() *ConfigState { + return &ConfigState{Indent: " "} +} diff --git a/vendor/github.com/stretchr/testify/internal/spew/doc.go b/vendor/github.com/stretchr/testify/internal/spew/doc.go new file mode 100644 index 00000000000..722e9aa7912 --- /dev/null +++ b/vendor/github.com/stretchr/testify/internal/spew/doc.go @@ -0,0 +1,217 @@ +/* + * Copyright (c) 2013-2016 Dave Collins + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* +Package spew implements a deep pretty printer for Go data structures to aid in +debugging. + +A quick overview of the additional features spew provides over the built-in +printing facilities for Go data types are as follows: + + - Pointers are dereferenced and followed + - Circular data structures are detected and handled properly + - Custom Stringer/error interfaces are optionally invoked, including + on unexported types + - Custom types which only implement the Stringer/error interfaces via + a pointer receiver are optionally invoked when passing non-pointer + variables + - Byte arrays and slices are dumped like the hexdump -C command which + includes offsets, byte values in hex, and ASCII output (only when using + Dump style) + +There are two different approaches spew allows for dumping Go data structures: + + - Dump style which prints with newlines, customizable indentation, + and additional debug information such as types and all pointer addresses + used to indirect to the final value + - A custom Formatter interface that integrates cleanly with the standard fmt + package and replaces %v, %+v, %#v, and %#+v to provide inline printing + similar to the default %v while providing the additional functionality + outlined above and passing unsupported format verbs such as %x and %q + along to fmt + +# Quick Start + +This section demonstrates how to quickly get started with spew. See the +sections below for further details on formatting and configuration options. + +To dump a variable with full newlines, indentation, type, and pointer +information use Dump, Fdump, or Sdump: + + spew.Dump(myVar1, myVar2, ...) + spew.Fdump(someWriter, myVar1, myVar2, ...) + str := spew.Sdump(myVar1, myVar2, ...) + +Alternatively, if you would prefer to use format strings with a compacted inline +printing style, use the convenience wrappers Printf, Fprintf, etc with +%v (most compact), %+v (adds pointer addresses), %#v (adds types), or +%#+v (adds types and pointer addresses): + + spew.Printf("myVar1: %v -- myVar2: %+v", myVar1, myVar2) + spew.Printf("myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) + spew.Fprintf(someWriter, "myVar1: %v -- myVar2: %+v", myVar1, myVar2) + spew.Fprintf(someWriter, "myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) + +# Configuration Options + +Configuration of spew is handled by fields in the ConfigState type. For +convenience, all of the top-level functions use a global state available +via the spew.Config global. + +It is also possible to create a ConfigState instance that provides methods +equivalent to the top-level functions. This allows concurrent configuration +options. See the ConfigState documentation for more details. + +The following configuration options are available: + + - Indent + String to use for each indentation level for Dump functions. + It is a single space by default. A popular alternative is "\t". + + - MaxDepth + Maximum number of levels to descend into nested data structures. + There is no limit by default. + + - DisableMethods + Disables invocation of error and Stringer interface methods. + Method invocation is enabled by default. + + - DisablePointerMethods + Disables invocation of error and Stringer interface methods on types + which only accept pointer receivers from non-pointer variables. + Pointer method invocation is enabled by default. + + - DisablePointerAddresses + DisablePointerAddresses specifies whether to disable the printing of + pointer addresses. This is useful when diffing data structures in tests. + + - DisableCapacities + DisableCapacities specifies whether to disable the printing of + capacities for arrays, slices, maps and channels. This is useful when + diffing data structures in tests. + + - ContinueOnMethod + Enables recursion into types after invoking error and Stringer interface + methods. Recursion after method invocation is disabled by default. + + - SortKeys + Specifies map keys should be sorted before being printed. Use + this to have a more deterministic, diffable output. Note that + only native types (bool, int, uint, floats, uintptr and string) + and types which implement error or Stringer interfaces are + supported with other types sorted according to the + reflect.Value.String() output which guarantees display + stability. Natural map order is used by default. + + - SpewKeys + Specifies that, as a last resort attempt, map keys should be + spewed to strings and sorted by those strings. This is only + considered if SortKeys is true. + +# Dump Usage + +Simply call spew.Dump with a list of variables you want to dump: + + spew.Dump(myVar1, myVar2, ...) + +You may also call spew.Fdump if you would prefer to output to an arbitrary +io.Writer. For example, to dump to standard error: + + spew.Fdump(os.Stderr, myVar1, myVar2, ...) + +A third option is to call spew.Sdump to get the formatted output as a string: + + str := spew.Sdump(myVar1, myVar2, ...) + +# Sample Dump Output + +See the Dump example for details on the setup of the types and variables being +shown here. + + (main.Foo) { + unexportedField: (*main.Bar)(0xf84002e210)({ + flag: (main.Flag) flagTwo, + data: (uintptr) + }), + ExportedField: (map[interface {}]interface {}) (len=1) { + (string) (len=3) "one": (bool) true + } + } + +Byte (and uint8) arrays and slices are displayed uniquely like the hexdump -C +command as shown. + + ([]uint8) (len=32 cap=32) { + 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 |............... | + 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 |!"#$%&'()*+,-./0| + 00000020 31 32 |12| + } + +# Custom Formatter + +Spew provides a custom formatter that implements the fmt.Formatter interface +so that it integrates cleanly with standard fmt package printing functions. The +formatter is useful for inline printing of smaller data types similar to the +standard %v format specifier. + +The custom formatter only responds to the %v (most compact), %+v (adds pointer +addresses), %#v (adds types), or %#+v (adds types and pointer addresses) verb +combinations. Any other verbs such as %x and %q will be sent to the the +standard fmt package for formatting. In addition, the custom formatter ignores +the width and precision arguments (however they will still work on the format +specifiers not handled by the custom formatter). + +# Custom Formatter Usage + +The simplest way to make use of the spew custom formatter is to call one of the +convenience functions such as spew.Printf, spew.Println, or spew.Printf. The +functions have syntax you are most likely already familiar with: + + spew.Printf("myVar1: %v -- myVar2: %+v", myVar1, myVar2) + spew.Printf("myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) + spew.Println(myVar, myVar2) + spew.Fprintf(os.Stderr, "myVar1: %v -- myVar2: %+v", myVar1, myVar2) + spew.Fprintf(os.Stderr, "myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) + +See the Index for the full list convenience functions. + +# Sample Formatter Output + +Double pointer to a uint8: + + %v: <**>5 + %+v: <**>(0xf8400420d0->0xf8400420c8)5 + %#v: (**uint8)5 + %#+v: (**uint8)(0xf8400420d0->0xf8400420c8)5 + +Pointer to circular struct with a uint8 field and a pointer to itself: + + %v: <*>{1 <*>} + %+v: <*>(0xf84003e260){ui8:1 c:<*>(0xf84003e260)} + %#v: (*main.circular){ui8:(uint8)1 c:(*main.circular)} + %#+v: (*main.circular)(0xf84003e260){ui8:(uint8)1 c:(*main.circular)(0xf84003e260)} + +See the Printf example for details on the setup of variables being shown +here. + +# Errors + +Since it is possible for custom Stringer/error interfaces to panic, spew +detects them and handles them internally by printing the panic information +inline with the output. Since spew is intended to provide deep pretty printing +capabilities on structures, it intentionally does not return any errors. +*/ +package spew diff --git a/vendor/github.com/stretchr/testify/internal/spew/dump.go b/vendor/github.com/stretchr/testify/internal/spew/dump.go new file mode 100644 index 00000000000..8323041a481 --- /dev/null +++ b/vendor/github.com/stretchr/testify/internal/spew/dump.go @@ -0,0 +1,509 @@ +/* + * Copyright (c) 2013-2016 Dave Collins + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package spew + +import ( + "bytes" + "encoding/hex" + "fmt" + "io" + "os" + "reflect" + "regexp" + "strconv" + "strings" +) + +var ( + // uint8Type is a reflect.Type representing a uint8. It is used to + // convert cgo types to uint8 slices for hexdumping. + uint8Type = reflect.TypeOf(uint8(0)) + + // cCharRE is a regular expression that matches a cgo char. + // It is used to detect character arrays to hexdump them. + cCharRE = regexp.MustCompile(`^.*\._Ctype_char$`) + + // cUnsignedCharRE is a regular expression that matches a cgo unsigned + // char. It is used to detect unsigned character arrays to hexdump + // them. + cUnsignedCharRE = regexp.MustCompile(`^.*\._Ctype_unsignedchar$`) + + // cUint8tCharRE is a regular expression that matches a cgo uint8_t. + // It is used to detect uint8_t arrays to hexdump them. + cUint8tCharRE = regexp.MustCompile(`^.*\._Ctype_uint8_t$`) +) + +// dumpState contains information about the state of a dump operation. +type dumpState struct { + w io.Writer + depth int + pointers map[uintptr]int + ignoreNextType bool + ignoreNextIndent bool + cs *ConfigState +} + +// indent performs indentation according to the depth level and cs.Indent +// option. +func (d *dumpState) indent() { + if d.ignoreNextIndent { + d.ignoreNextIndent = false + return + } + d.w.Write(bytes.Repeat([]byte(d.cs.Indent), d.depth)) +} + +// unpackValue returns values inside of non-nil interfaces when possible. +// This is useful for data types like structs, arrays, slices, and maps which +// can contain varying types packed inside an interface. +func (d *dumpState) unpackValue(v reflect.Value) reflect.Value { + if v.Kind() == reflect.Interface && !v.IsNil() { + v = v.Elem() + } + return v +} + +// dumpPtr handles formatting of pointers by indirecting them as necessary. +func (d *dumpState) dumpPtr(v reflect.Value) { + // Remove pointers at or below the current depth from map used to detect + // circular refs. + for k, depth := range d.pointers { + if depth >= d.depth { + delete(d.pointers, k) + } + } + + // Keep list of all dereferenced pointers to show later. + pointerChain := make([]uintptr, 0) + + // Figure out how many levels of indirection there are by dereferencing + // pointers and unpacking interfaces down the chain while detecting circular + // references. + nilFound := false + cycleFound := false + indirects := 0 + ve := v + for ve.Kind() == reflect.Ptr { + if ve.IsNil() { + nilFound = true + break + } + indirects++ + addr := ve.Pointer() + pointerChain = append(pointerChain, addr) + if pd, ok := d.pointers[addr]; ok && pd < d.depth { + cycleFound = true + indirects-- + break + } + d.pointers[addr] = d.depth + + ve = ve.Elem() + if ve.Kind() == reflect.Interface { + if ve.IsNil() { + nilFound = true + break + } + ve = ve.Elem() + } + } + + // Display type information. + d.w.Write(openParenBytes) + d.w.Write(bytes.Repeat(asteriskBytes, indirects)) + d.w.Write([]byte(ve.Type().String())) + d.w.Write(closeParenBytes) + + // Display pointer information. + if !d.cs.DisablePointerAddresses && len(pointerChain) > 0 { + d.w.Write(openParenBytes) + for i, addr := range pointerChain { + if i > 0 { + d.w.Write(pointerChainBytes) + } + printHexPtr(d.w, addr) + } + d.w.Write(closeParenBytes) + } + + // Display dereferenced value. + d.w.Write(openParenBytes) + switch { + case nilFound: + d.w.Write(nilAngleBytes) + + case cycleFound: + d.w.Write(circularBytes) + + default: + d.ignoreNextType = true + d.dump(ve) + } + d.w.Write(closeParenBytes) +} + +// dumpSlice handles formatting of arrays and slices. Byte (uint8 under +// reflection) arrays and slices are dumped in hexdump -C fashion. +func (d *dumpState) dumpSlice(v reflect.Value) { + // Determine whether this type should be hex dumped or not. Also, + // for types which should be hexdumped, try to use the underlying data + // first, then fall back to trying to convert them to a uint8 slice. + var buf []uint8 + doConvert := false + doHexDump := false + numEntries := v.Len() + if numEntries > 0 { + vt := v.Index(0).Type() + vts := vt.String() + switch { + // C types that need to be converted. + case cCharRE.MatchString(vts): + fallthrough + case cUnsignedCharRE.MatchString(vts): + fallthrough + case cUint8tCharRE.MatchString(vts): + doConvert = true + + // Try to use existing uint8 slices and fall back to converting + // and copying if that fails. + case vt.Kind() == reflect.Uint8: + // We need an addressable interface to convert the type + // to a byte slice. However, the reflect package won't + // give us an interface on certain things like + // unexported struct fields in order to enforce + // visibility rules. We use unsafe, when available, to + // bypass these restrictions since this package does not + // mutate the values. + vs := v + if !vs.CanInterface() || !vs.CanAddr() { + vs = unsafeReflectValue(vs) + } + if !UnsafeDisabled { + vs = vs.Slice(0, numEntries) + + // Use the existing uint8 slice if it can be + // type asserted. + iface := vs.Interface() + if slice, ok := iface.([]uint8); ok { + buf = slice + doHexDump = true + break + } + } + + // The underlying data needs to be converted if it can't + // be type asserted to a uint8 slice. + doConvert = true + } + + // Copy and convert the underlying type if needed. + if doConvert && vt.ConvertibleTo(uint8Type) { + // Convert and copy each element into a uint8 byte + // slice. + buf = make([]uint8, numEntries) + for i := 0; i < numEntries; i++ { + vv := v.Index(i) + buf[i] = uint8(vv.Convert(uint8Type).Uint()) + } + doHexDump = true + } + } + + // Hexdump the entire slice as needed. + if doHexDump { + indent := strings.Repeat(d.cs.Indent, d.depth) + str := indent + hex.Dump(buf) + str = strings.Replace(str, "\n", "\n"+indent, -1) + str = strings.TrimRight(str, d.cs.Indent) + d.w.Write([]byte(str)) + return + } + + // Recursively call dump for each item. + for i := 0; i < numEntries; i++ { + d.dump(d.unpackValue(v.Index(i))) + if i < (numEntries - 1) { + d.w.Write(commaNewlineBytes) + } else { + d.w.Write(newlineBytes) + } + } +} + +// dump is the main workhorse for dumping a value. It uses the passed reflect +// value to figure out what kind of object we are dealing with and formats it +// appropriately. It is a recursive function, however circular data structures +// are detected and handled properly. +func (d *dumpState) dump(v reflect.Value) { + // Handle invalid reflect values immediately. + kind := v.Kind() + if kind == reflect.Invalid { + d.w.Write(invalidAngleBytes) + return + } + + // Handle pointers specially. + if kind == reflect.Ptr { + d.indent() + d.dumpPtr(v) + return + } + + // Print type information unless already handled elsewhere. + if !d.ignoreNextType { + d.indent() + d.w.Write(openParenBytes) + d.w.Write([]byte(v.Type().String())) + d.w.Write(closeParenBytes) + d.w.Write(spaceBytes) + } + d.ignoreNextType = false + + // Display length and capacity if the built-in len and cap functions + // work with the value's kind and the len/cap itself is non-zero. + valueLen, valueCap := 0, 0 + switch v.Kind() { + case reflect.Array, reflect.Slice, reflect.Chan: + valueLen, valueCap = v.Len(), v.Cap() + case reflect.Map, reflect.String: + valueLen = v.Len() + } + if valueLen != 0 || !d.cs.DisableCapacities && valueCap != 0 { + d.w.Write(openParenBytes) + if valueLen != 0 { + d.w.Write(lenEqualsBytes) + printInt(d.w, int64(valueLen), 10) + } + if !d.cs.DisableCapacities && valueCap != 0 { + if valueLen != 0 { + d.w.Write(spaceBytes) + } + d.w.Write(capEqualsBytes) + printInt(d.w, int64(valueCap), 10) + } + d.w.Write(closeParenBytes) + d.w.Write(spaceBytes) + } + + // Call Stringer/error interfaces if they exist and the handle methods flag + // is enabled + if !d.cs.DisableMethods { + if (kind != reflect.Invalid) && (kind != reflect.Interface) { + if handled := handleMethods(d.cs, d.w, v); handled { + return + } + } + } + + switch kind { + case reflect.Invalid: + // Do nothing. We should never get here since invalid has already + // been handled above. + + case reflect.Bool: + printBool(d.w, v.Bool()) + + case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: + printInt(d.w, v.Int(), 10) + + case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: + printUint(d.w, v.Uint(), 10) + + case reflect.Float32: + printFloat(d.w, v.Float(), 32) + + case reflect.Float64: + printFloat(d.w, v.Float(), 64) + + case reflect.Complex64: + printComplex(d.w, v.Complex(), 32) + + case reflect.Complex128: + printComplex(d.w, v.Complex(), 64) + + case reflect.Slice: + if v.IsNil() { + d.w.Write(nilAngleBytes) + break + } + fallthrough + + case reflect.Array: + d.w.Write(openBraceNewlineBytes) + d.depth++ + if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) { + d.indent() + d.w.Write(maxNewlineBytes) + } else { + d.dumpSlice(v) + } + d.depth-- + d.indent() + d.w.Write(closeBraceBytes) + + case reflect.String: + d.w.Write([]byte(strconv.Quote(v.String()))) + + case reflect.Interface: + // The only time we should get here is for nil interfaces due to + // unpackValue calls. + if v.IsNil() { + d.w.Write(nilAngleBytes) + } + + case reflect.Ptr: + // Do nothing. We should never get here since pointers have already + // been handled above. + + case reflect.Map: + // nil maps should be indicated as different than empty maps + if v.IsNil() { + d.w.Write(nilAngleBytes) + break + } + + d.w.Write(openBraceNewlineBytes) + d.depth++ + if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) { + d.indent() + d.w.Write(maxNewlineBytes) + } else { + numEntries := v.Len() + keys := v.MapKeys() + if d.cs.SortKeys { + sortValues(keys, d.cs) + } + for i, key := range keys { + d.dump(d.unpackValue(key)) + d.w.Write(colonSpaceBytes) + d.ignoreNextIndent = true + d.dump(d.unpackValue(v.MapIndex(key))) + if i < (numEntries - 1) { + d.w.Write(commaNewlineBytes) + } else { + d.w.Write(newlineBytes) + } + } + } + d.depth-- + d.indent() + d.w.Write(closeBraceBytes) + + case reflect.Struct: + d.w.Write(openBraceNewlineBytes) + d.depth++ + if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) { + d.indent() + d.w.Write(maxNewlineBytes) + } else { + vt := v.Type() + numFields := v.NumField() + for i := 0; i < numFields; i++ { + d.indent() + vtf := vt.Field(i) + d.w.Write([]byte(vtf.Name)) + d.w.Write(colonSpaceBytes) + d.ignoreNextIndent = true + d.dump(d.unpackValue(v.Field(i))) + if i < (numFields - 1) { + d.w.Write(commaNewlineBytes) + } else { + d.w.Write(newlineBytes) + } + } + } + d.depth-- + d.indent() + d.w.Write(closeBraceBytes) + + case reflect.Uintptr: + printHexPtr(d.w, uintptr(v.Uint())) + + case reflect.UnsafePointer, reflect.Chan, reflect.Func: + printHexPtr(d.w, v.Pointer()) + + // There were not any other types at the time this code was written, but + // fall back to letting the default fmt package handle it in case any new + // types are added. + default: + if v.CanInterface() { + fmt.Fprintf(d.w, "%v", v.Interface()) + } else { + fmt.Fprintf(d.w, "%v", v.String()) + } + } +} + +// fdump is a helper function to consolidate the logic from the various public +// methods which take varying writers and config states. +func fdump(cs *ConfigState, w io.Writer, a ...interface{}) { + for _, arg := range a { + if arg == nil { + w.Write(interfaceBytes) + w.Write(spaceBytes) + w.Write(nilAngleBytes) + w.Write(newlineBytes) + continue + } + + d := dumpState{w: w, cs: cs} + d.pointers = make(map[uintptr]int) + d.dump(reflect.ValueOf(arg)) + d.w.Write(newlineBytes) + } +} + +// Fdump formats and displays the passed arguments to io.Writer w. It formats +// exactly the same as Dump. +func Fdump(w io.Writer, a ...interface{}) { + fdump(&Config, w, a...) +} + +// Sdump returns a string with the passed arguments formatted exactly the same +// as Dump. +func Sdump(a ...interface{}) string { + var buf bytes.Buffer + fdump(&Config, &buf, a...) + return buf.String() +} + +/* +Dump displays the passed parameters to standard out with newlines, customizable +indentation, and additional debug information such as complete types and all +pointer addresses used to indirect to the final value. It provides the +following features over the built-in printing facilities provided by the fmt +package: + + - Pointers are dereferenced and followed + - Circular data structures are detected and handled properly + - Custom Stringer/error interfaces are optionally invoked, including + on unexported types + - Custom types which only implement the Stringer/error interfaces via + a pointer receiver are optionally invoked when passing non-pointer + variables + - Byte arrays and slices are dumped like the hexdump -C command which + includes offsets, byte values in hex, and ASCII output + +The configuration options are controlled by an exported package global, +spew.Config. See ConfigState for options documentation. + +See Fdump if you would prefer dumping to an arbitrary io.Writer or Sdump to +get the formatted result as a string. +*/ +func Dump(a ...interface{}) { + fdump(&Config, os.Stdout, a...) +} diff --git a/vendor/github.com/stretchr/testify/internal/spew/format.go b/vendor/github.com/stretchr/testify/internal/spew/format.go new file mode 100644 index 00000000000..b04edb7d7ac --- /dev/null +++ b/vendor/github.com/stretchr/testify/internal/spew/format.go @@ -0,0 +1,419 @@ +/* + * Copyright (c) 2013-2016 Dave Collins + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package spew + +import ( + "bytes" + "fmt" + "reflect" + "strconv" + "strings" +) + +// supportedFlags is a list of all the character flags supported by fmt package. +const supportedFlags = "0-+# " + +// formatState implements the fmt.Formatter interface and contains information +// about the state of a formatting operation. The NewFormatter function can +// be used to get a new Formatter which can be used directly as arguments +// in standard fmt package printing calls. +type formatState struct { + value interface{} + fs fmt.State + depth int + pointers map[uintptr]int + ignoreNextType bool + cs *ConfigState +} + +// buildDefaultFormat recreates the original format string without precision +// and width information to pass in to fmt.Sprintf in the case of an +// unrecognized type. Unless new types are added to the language, this +// function won't ever be called. +func (f *formatState) buildDefaultFormat() (format string) { + buf := bytes.NewBuffer(percentBytes) + + for _, flag := range supportedFlags { + if f.fs.Flag(int(flag)) { + buf.WriteRune(flag) + } + } + + buf.WriteRune('v') + + format = buf.String() + return format +} + +// constructOrigFormat recreates the original format string including precision +// and width information to pass along to the standard fmt package. This allows +// automatic deferral of all format strings this package doesn't support. +func (f *formatState) constructOrigFormat(verb rune) (format string) { + buf := bytes.NewBuffer(percentBytes) + + for _, flag := range supportedFlags { + if f.fs.Flag(int(flag)) { + buf.WriteRune(flag) + } + } + + if width, ok := f.fs.Width(); ok { + buf.WriteString(strconv.Itoa(width)) + } + + if precision, ok := f.fs.Precision(); ok { + buf.Write(precisionBytes) + buf.WriteString(strconv.Itoa(precision)) + } + + buf.WriteRune(verb) + + format = buf.String() + return format +} + +// unpackValue returns values inside of non-nil interfaces when possible and +// ensures that types for values which have been unpacked from an interface +// are displayed when the show types flag is also set. +// This is useful for data types like structs, arrays, slices, and maps which +// can contain varying types packed inside an interface. +func (f *formatState) unpackValue(v reflect.Value) reflect.Value { + if v.Kind() == reflect.Interface { + f.ignoreNextType = false + if !v.IsNil() { + v = v.Elem() + } + } + return v +} + +// formatPtr handles formatting of pointers by indirecting them as necessary. +func (f *formatState) formatPtr(v reflect.Value) { + // Display nil if top level pointer is nil. + showTypes := f.fs.Flag('#') + if v.IsNil() && (!showTypes || f.ignoreNextType) { + f.fs.Write(nilAngleBytes) + return + } + + // Remove pointers at or below the current depth from map used to detect + // circular refs. + for k, depth := range f.pointers { + if depth >= f.depth { + delete(f.pointers, k) + } + } + + // Keep list of all dereferenced pointers to possibly show later. + pointerChain := make([]uintptr, 0) + + // Figure out how many levels of indirection there are by derferencing + // pointers and unpacking interfaces down the chain while detecting circular + // references. + nilFound := false + cycleFound := false + indirects := 0 + ve := v + for ve.Kind() == reflect.Ptr { + if ve.IsNil() { + nilFound = true + break + } + indirects++ + addr := ve.Pointer() + pointerChain = append(pointerChain, addr) + if pd, ok := f.pointers[addr]; ok && pd < f.depth { + cycleFound = true + indirects-- + break + } + f.pointers[addr] = f.depth + + ve = ve.Elem() + if ve.Kind() == reflect.Interface { + if ve.IsNil() { + nilFound = true + break + } + ve = ve.Elem() + } + } + + // Display type or indirection level depending on flags. + if showTypes && !f.ignoreNextType { + f.fs.Write(openParenBytes) + f.fs.Write(bytes.Repeat(asteriskBytes, indirects)) + f.fs.Write([]byte(ve.Type().String())) + f.fs.Write(closeParenBytes) + } else { + if nilFound || cycleFound { + indirects += strings.Count(ve.Type().String(), "*") + } + f.fs.Write(openAngleBytes) + f.fs.Write([]byte(strings.Repeat("*", indirects))) + f.fs.Write(closeAngleBytes) + } + + // Display pointer information depending on flags. + if f.fs.Flag('+') && (len(pointerChain) > 0) { + f.fs.Write(openParenBytes) + for i, addr := range pointerChain { + if i > 0 { + f.fs.Write(pointerChainBytes) + } + printHexPtr(f.fs, addr) + } + f.fs.Write(closeParenBytes) + } + + // Display dereferenced value. + switch { + case nilFound: + f.fs.Write(nilAngleBytes) + + case cycleFound: + f.fs.Write(circularShortBytes) + + default: + f.ignoreNextType = true + f.format(ve) + } +} + +// format is the main workhorse for providing the Formatter interface. It +// uses the passed reflect value to figure out what kind of object we are +// dealing with and formats it appropriately. It is a recursive function, +// however circular data structures are detected and handled properly. +func (f *formatState) format(v reflect.Value) { + // Handle invalid reflect values immediately. + kind := v.Kind() + if kind == reflect.Invalid { + f.fs.Write(invalidAngleBytes) + return + } + + // Handle pointers specially. + if kind == reflect.Ptr { + f.formatPtr(v) + return + } + + // Print type information unless already handled elsewhere. + if !f.ignoreNextType && f.fs.Flag('#') { + f.fs.Write(openParenBytes) + f.fs.Write([]byte(v.Type().String())) + f.fs.Write(closeParenBytes) + } + f.ignoreNextType = false + + // Call Stringer/error interfaces if they exist and the handle methods + // flag is enabled. + if !f.cs.DisableMethods { + if (kind != reflect.Invalid) && (kind != reflect.Interface) { + if handled := handleMethods(f.cs, f.fs, v); handled { + return + } + } + } + + switch kind { + case reflect.Invalid: + // Do nothing. We should never get here since invalid has already + // been handled above. + + case reflect.Bool: + printBool(f.fs, v.Bool()) + + case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: + printInt(f.fs, v.Int(), 10) + + case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: + printUint(f.fs, v.Uint(), 10) + + case reflect.Float32: + printFloat(f.fs, v.Float(), 32) + + case reflect.Float64: + printFloat(f.fs, v.Float(), 64) + + case reflect.Complex64: + printComplex(f.fs, v.Complex(), 32) + + case reflect.Complex128: + printComplex(f.fs, v.Complex(), 64) + + case reflect.Slice: + if v.IsNil() { + f.fs.Write(nilAngleBytes) + break + } + fallthrough + + case reflect.Array: + f.fs.Write(openBracketBytes) + f.depth++ + if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) { + f.fs.Write(maxShortBytes) + } else { + numEntries := v.Len() + for i := 0; i < numEntries; i++ { + if i > 0 { + f.fs.Write(spaceBytes) + } + f.ignoreNextType = true + f.format(f.unpackValue(v.Index(i))) + } + } + f.depth-- + f.fs.Write(closeBracketBytes) + + case reflect.String: + f.fs.Write([]byte(v.String())) + + case reflect.Interface: + // The only time we should get here is for nil interfaces due to + // unpackValue calls. + if v.IsNil() { + f.fs.Write(nilAngleBytes) + } + + case reflect.Ptr: + // Do nothing. We should never get here since pointers have already + // been handled above. + + case reflect.Map: + // nil maps should be indicated as different than empty maps + if v.IsNil() { + f.fs.Write(nilAngleBytes) + break + } + + f.fs.Write(openMapBytes) + f.depth++ + if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) { + f.fs.Write(maxShortBytes) + } else { + keys := v.MapKeys() + if f.cs.SortKeys { + sortValues(keys, f.cs) + } + for i, key := range keys { + if i > 0 { + f.fs.Write(spaceBytes) + } + f.ignoreNextType = true + f.format(f.unpackValue(key)) + f.fs.Write(colonBytes) + f.ignoreNextType = true + f.format(f.unpackValue(v.MapIndex(key))) + } + } + f.depth-- + f.fs.Write(closeMapBytes) + + case reflect.Struct: + numFields := v.NumField() + f.fs.Write(openBraceBytes) + f.depth++ + if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) { + f.fs.Write(maxShortBytes) + } else { + vt := v.Type() + for i := 0; i < numFields; i++ { + if i > 0 { + f.fs.Write(spaceBytes) + } + vtf := vt.Field(i) + if f.fs.Flag('+') || f.fs.Flag('#') { + f.fs.Write([]byte(vtf.Name)) + f.fs.Write(colonBytes) + } + f.format(f.unpackValue(v.Field(i))) + } + } + f.depth-- + f.fs.Write(closeBraceBytes) + + case reflect.Uintptr: + printHexPtr(f.fs, uintptr(v.Uint())) + + case reflect.UnsafePointer, reflect.Chan, reflect.Func: + printHexPtr(f.fs, v.Pointer()) + + // There were not any other types at the time this code was written, but + // fall back to letting the default fmt package handle it if any get added. + default: + format := f.buildDefaultFormat() + if v.CanInterface() { + fmt.Fprintf(f.fs, format, v.Interface()) + } else { + fmt.Fprintf(f.fs, format, v.String()) + } + } +} + +// Format satisfies the fmt.Formatter interface. See NewFormatter for usage +// details. +func (f *formatState) Format(fs fmt.State, verb rune) { + f.fs = fs + + // Use standard formatting for verbs that are not v. + if verb != 'v' { + format := f.constructOrigFormat(verb) + fmt.Fprintf(fs, format, f.value) + return + } + + if f.value == nil { + if fs.Flag('#') { + fs.Write(interfaceBytes) + } + fs.Write(nilAngleBytes) + return + } + + f.format(reflect.ValueOf(f.value)) +} + +// newFormatter is a helper function to consolidate the logic from the various +// public methods which take varying config states. +func newFormatter(cs *ConfigState, v interface{}) fmt.Formatter { + fs := &formatState{value: v, cs: cs} + fs.pointers = make(map[uintptr]int) + return fs +} + +/* +NewFormatter returns a custom formatter that satisfies the fmt.Formatter +interface. As a result, it integrates cleanly with standard fmt package +printing functions. The formatter is useful for inline printing of smaller data +types similar to the standard %v format specifier. + +The custom formatter only responds to the %v (most compact), %+v (adds pointer +addresses), %#v (adds types), or %#+v (adds types and pointer addresses) verb +combinations. Any other verbs such as %x and %q will be sent to the the +standard fmt package for formatting. In addition, the custom formatter ignores +the width and precision arguments (however they will still work on the format +specifiers not handled by the custom formatter). + +Typically this function shouldn't be called directly. It is much easier to make +use of the custom formatter by calling one of the convenience functions such as +Printf, Println, or Fprintf. +*/ +func NewFormatter(v interface{}) fmt.Formatter { + return newFormatter(&Config, v) +} diff --git a/vendor/github.com/stretchr/testify/internal/spew/spew.go b/vendor/github.com/stretchr/testify/internal/spew/spew.go new file mode 100644 index 00000000000..32c0e338825 --- /dev/null +++ b/vendor/github.com/stretchr/testify/internal/spew/spew.go @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2013-2016 Dave Collins + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package spew + +import ( + "fmt" + "io" +) + +// Errorf is a wrapper for fmt.Errorf that treats each argument as if it were +// passed with a default Formatter interface returned by NewFormatter. It +// returns the formatted string as a value that satisfies error. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Errorf(format, spew.NewFormatter(a), spew.NewFormatter(b)) +func Errorf(format string, a ...interface{}) (err error) { + return fmt.Errorf(format, convertArgs(a)...) +} + +// Fprint is a wrapper for fmt.Fprint that treats each argument as if it were +// passed with a default Formatter interface returned by NewFormatter. It +// returns the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Fprint(w, spew.NewFormatter(a), spew.NewFormatter(b)) +func Fprint(w io.Writer, a ...interface{}) (n int, err error) { + return fmt.Fprint(w, convertArgs(a)...) +} + +// Fprintf is a wrapper for fmt.Fprintf that treats each argument as if it were +// passed with a default Formatter interface returned by NewFormatter. It +// returns the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Fprintf(w, format, spew.NewFormatter(a), spew.NewFormatter(b)) +func Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) { + return fmt.Fprintf(w, format, convertArgs(a)...) +} + +// Fprintln is a wrapper for fmt.Fprintln that treats each argument as if it +// passed with a default Formatter interface returned by NewFormatter. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Fprintln(w, spew.NewFormatter(a), spew.NewFormatter(b)) +func Fprintln(w io.Writer, a ...interface{}) (n int, err error) { + return fmt.Fprintln(w, convertArgs(a)...) +} + +// Print is a wrapper for fmt.Print that treats each argument as if it were +// passed with a default Formatter interface returned by NewFormatter. It +// returns the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Print(spew.NewFormatter(a), spew.NewFormatter(b)) +func Print(a ...interface{}) (n int, err error) { + return fmt.Print(convertArgs(a)...) +} + +// Printf is a wrapper for fmt.Printf that treats each argument as if it were +// passed with a default Formatter interface returned by NewFormatter. It +// returns the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Printf(format, spew.NewFormatter(a), spew.NewFormatter(b)) +func Printf(format string, a ...interface{}) (n int, err error) { + return fmt.Printf(format, convertArgs(a)...) +} + +// Println is a wrapper for fmt.Println that treats each argument as if it were +// passed with a default Formatter interface returned by NewFormatter. It +// returns the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Println(spew.NewFormatter(a), spew.NewFormatter(b)) +func Println(a ...interface{}) (n int, err error) { + return fmt.Println(convertArgs(a)...) +} + +// Sprint is a wrapper for fmt.Sprint that treats each argument as if it were +// passed with a default Formatter interface returned by NewFormatter. It +// returns the resulting string. See NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Sprint(spew.NewFormatter(a), spew.NewFormatter(b)) +func Sprint(a ...interface{}) string { + return fmt.Sprint(convertArgs(a)...) +} + +// Sprintf is a wrapper for fmt.Sprintf that treats each argument as if it were +// passed with a default Formatter interface returned by NewFormatter. It +// returns the resulting string. See NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Sprintf(format, spew.NewFormatter(a), spew.NewFormatter(b)) +func Sprintf(format string, a ...interface{}) string { + return fmt.Sprintf(format, convertArgs(a)...) +} + +// Sprintln is a wrapper for fmt.Sprintln that treats each argument as if it +// were passed with a default Formatter interface returned by NewFormatter. It +// returns the resulting string. See NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Sprintln(spew.NewFormatter(a), spew.NewFormatter(b)) +func Sprintln(a ...interface{}) string { + return fmt.Sprintln(convertArgs(a)...) +} + +// convertArgs accepts a slice of arguments and returns a slice of the same +// length with each argument converted to a default spew Formatter interface. +func convertArgs(args []interface{}) (formatters []interface{}) { + formatters = make([]interface{}, len(args)) + for index, arg := range args { + formatters[index] = NewFormatter(arg) + } + return formatters +} diff --git a/vendor/github.com/stretchr/testify/mock/mock.go b/vendor/github.com/stretchr/testify/mock/mock.go index efc89deff38..7f4d28d5ee6 100644 --- a/vendor/github.com/stretchr/testify/mock/mock.go +++ b/vendor/github.com/stretchr/testify/mock/mock.go @@ -11,11 +11,11 @@ import ( "sync" "time" - "github.com/davecgh/go-spew/spew" - "github.com/pmezard/go-difflib/difflib" "github.com/stretchr/objx" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/internal/difflib" + "github.com/stretchr/testify/internal/spew" ) // regex for GCCGO functions @@ -470,7 +470,7 @@ func callString(method string, arguments Arguments, includeArgumentValues bool) // Called tells the mock object that a method has been called, and gets an array // of arguments to return. Panics if the call is unexpected (i.e. not preceded by -// appropriate .On .Return() calls) +// appropriate [Mock.On] calls) // If Call.WaitFor is set, blocks until the channel is closed or receives a message. func (m *Mock) Called(arguments ...interface{}) Arguments { // get the calling function's name @@ -493,7 +493,7 @@ func (m *Mock) Called(arguments ...interface{}) Arguments { // MethodCalled tells the mock object that the given method has been called, and gets // an array of arguments to return. Panics if the call is unexpected (i.e. not preceded -// by appropriate .On .Return() calls) +// by appropriate [Mock.On] calls) // If Call.WaitFor is set, blocks until the channel is closed or receives a message. func (m *Mock) MethodCalled(methodName string, arguments ...interface{}) Arguments { m.mutex.Lock() @@ -510,8 +510,7 @@ func (m *Mock) MethodCalled(methodName string, arguments ...interface{}) Argumen // as the return arguments. This is because: // // a) this is a totally unexpected call to this method, - // b) the arguments are not what was expected, or - // c) the developer has forgotten to add an accompanying On...Return pair. + // b) the arguments are not what was expected closestCall, mismatch := m.findClosestCall(methodName, arguments...) m.mutex.Unlock() @@ -595,7 +594,7 @@ type assertExpectationiser interface { AssertExpectations(TestingT) bool } -// AssertExpectationsForObjects asserts that everything specified with On and Return +// AssertExpectationsForObjects asserts that everything specified with [Mock.On] // of the specified objects was in fact called as expected. // // Calls may have occurred in any order. @@ -604,11 +603,12 @@ func AssertExpectationsForObjects(t TestingT, testObjects ...interface{}) bool { h.Helper() } for _, obj := range testObjects { - if m, ok := obj.(*Mock); ok { - t.Logf("Deprecated mock.AssertExpectationsForObjects(myMock.Mock) use mock.AssertExpectationsForObjects(myMock)") - obj = m + m, ok := obj.(assertExpectationiser) + if !ok { + t.Errorf("Invalid test object type %T. Expected reference to a mock.Mock, eg: 'AssertExpectationsForObjects(t, myMock)' or 'AssertExpectationsForObjects(t, &myMock.Mock)'", obj) + continue + } - m := obj.(assertExpectationiser) if !m.AssertExpectations(t) { t.Logf("Expectations didn't match for Mock: %+v", reflect.TypeOf(m)) return false @@ -617,7 +617,7 @@ func AssertExpectationsForObjects(t TestingT, testObjects ...interface{}) bool { return true } -// AssertExpectations asserts that everything specified with On and Return was +// AssertExpectations asserts that everything specified with [Mock.On] was // in fact called as expected. Calls may have occurred in any order. func (m *Mock) AssertExpectations(t TestingT) bool { if s, ok := t.(interface{ Skipped() bool }); ok && s.Skipped() { @@ -712,8 +712,8 @@ func (m *Mock) AssertNotCalled(t TestingT, methodName string, arguments ...inter return true } -// IsMethodCallable checking that the method can be called -// If the method was called more than `Repeatability` return false +// IsMethodCallable returns true if given methodName and arguments have an +// unsatisfied expected call registered in the Mock. func (m *Mock) IsMethodCallable(t TestingT, methodName string, arguments ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -833,6 +833,10 @@ type IsTypeArgument struct { // For example: // // args.Assert(t, IsType(""), IsType(0)) +// +// Mock cannot match interface types because the contained type will be passed +// to both IsType and Mock.Called, for the zero value of all interfaces this +// will be type. func IsType(t interface{}) *IsTypeArgument { return &IsTypeArgument{t: reflect.TypeOf(t)} } @@ -1012,7 +1016,7 @@ func (args Arguments) Diff(objects []interface{}) (string, int) { actualT := reflect.TypeOf(actual) if actualT != expected.t { differences++ - output = fmt.Sprintf("%s\t%d: FAIL: type %s != type %s - %s\n", output, i, expected.t.Name(), actualT.Name(), actualFmt) + output = fmt.Sprintf("%s\t%d: FAIL: type %s != type %s - %s\n", output, i, safeTypeName(expected.t), safeTypeName(actualT), actualFmt) } case *FunctionalOptionsArgument: var name string @@ -1141,6 +1145,15 @@ func (args Arguments) Bool(index int) bool { return s } +// safeTypeName returns the reflect.Type's name without causing a panic. +// If the provided reflect.Type is nil, it returns the placeholder string "" +func safeTypeName(t reflect.Type) string { + if t == nil { + return "" + } + return t.Name() +} + func typeAndKind(v interface{}) (reflect.Type, reflect.Kind) { t := reflect.TypeOf(v) k := t.Kind() diff --git a/vendor/github.com/stretchr/testify/require/doc.go b/vendor/github.com/stretchr/testify/require/doc.go index c8e3f94a803..ee84cc47916 100644 --- a/vendor/github.com/stretchr/testify/require/doc.go +++ b/vendor/github.com/stretchr/testify/require/doc.go @@ -1,4 +1,4 @@ -// Package require implements the same assertions as the `assert` package but +// Package require implements the same assertions as the assert package but // stops test execution when a test fails. // // # Example Usage @@ -21,8 +21,8 @@ // // # Assertions // -// The `require` package have same global functions as in the `assert` package, -// but instead of returning a boolean result they call `t.FailNow()`. +// The require package have same global functions as in the assert package, +// but instead of returning a boolean result they call [testing.T.FailNow]. // A consequence of this is that it must be called from the goroutine running // the test function, not from other goroutines created during the test. // diff --git a/vendor/github.com/stretchr/testify/require/require.go b/vendor/github.com/stretchr/testify/require/require.go index 2d02f9bcef1..652871f2eb7 100644 --- a/vendor/github.com/stretchr/testify/require/require.go +++ b/vendor/github.com/stretchr/testify/require/require.go @@ -180,7 +180,7 @@ func Equal(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...i t.FailNow() } -// EqualError asserts that a function returned an error (i.e. not `nil`) +// EqualError asserts that a function returned a non-nil error (i.e. an error) // and that it is equal to the provided error. // // actualObj, err := SomeFunction() @@ -195,7 +195,7 @@ func EqualError(t TestingT, theError error, errString string, msgAndArgs ...inte t.FailNow() } -// EqualErrorf asserts that a function returned an error (i.e. not `nil`) +// EqualErrorf asserts that a function returned a non-nil error (i.e. an error) // and that it is equal to the provided error. // // actualObj, err := SomeFunction() @@ -295,7 +295,7 @@ func Equalf(t TestingT, expected interface{}, actual interface{}, msg string, ar t.FailNow() } -// Error asserts that a function returned an error (i.e. not `nil`). +// Error asserts that a function returned a non-nil error (ie. an error). // // actualObj, err := SomeFunction() // require.Error(t, err) @@ -333,8 +333,8 @@ func ErrorAsf(t TestingT, err error, target interface{}, msg string, args ...int t.FailNow() } -// ErrorContains asserts that a function returned an error (i.e. not `nil`) -// and that the error contains the specified substring. +// ErrorContains asserts that a function returned a non-nil error (i.e. an +// error) and that the error contains the specified substring. // // actualObj, err := SomeFunction() // require.ErrorContains(t, err, expectedErrorSubString) @@ -348,8 +348,8 @@ func ErrorContains(t TestingT, theError error, contains string, msgAndArgs ...in t.FailNow() } -// ErrorContainsf asserts that a function returned an error (i.e. not `nil`) -// and that the error contains the specified substring. +// ErrorContainsf asserts that a function returned a non-nil error (i.e. an +// error) and that the error contains the specified substring. // // actualObj, err := SomeFunction() // require.ErrorContainsf(t, err, expectedErrorSubString, "error message %s", "formatted") @@ -387,7 +387,7 @@ func ErrorIsf(t TestingT, err error, target error, msg string, args ...interface t.FailNow() } -// Errorf asserts that a function returned an error (i.e. not `nil`). +// Errorf asserts that a function returned a non-nil error (ie. an error). // // actualObj, err := SomeFunction() // require.Errorf(t, err, "error message %s", "formatted") @@ -429,7 +429,7 @@ func Eventually(t TestingT, condition func() bool, waitFor time.Duration, tick t // time.Sleep(8*time.Second) // externalValue = true // }() -// require.EventuallyWithT(t, func(c *require.CollectT) { +// require.EventuallyWithT(t, func(c *assert.CollectT) { // // add assertions as needed; any assertion failure will fail the current tick // require.True(c, externalValue, "expected 'externalValue' to be true") // }, 10*time.Second, 1*time.Second, "external state has not changed to 'true'; still false") @@ -457,10 +457,10 @@ func EventuallyWithT(t TestingT, condition func(collect *assert.CollectT), waitF // time.Sleep(8*time.Second) // externalValue = true // }() -// require.EventuallyWithTf(t, func(c *require.CollectT, "error message %s", "formatted") { +// require.EventuallyWithTf(t, func(c *assert.CollectT) { // // add assertions as needed; any assertion failure will fail the current tick // require.True(c, externalValue, "expected 'externalValue' to be true") -// }, 10*time.Second, 1*time.Second, "external state has not changed to 'true'; still false") +// }, 10*time.Second, 1*time.Second, "error message %s", "formatted") func EventuallyWithTf(t TestingT, condition func(collect *assert.CollectT), waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -671,8 +671,6 @@ func Greaterf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...in // body that contains a string. // // require.HTTPBodyContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") -// -// Returns whether the assertion was successful (true) or not (false). func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -687,8 +685,6 @@ func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method string, url s // body that contains a string. // // require.HTTPBodyContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func HTTPBodyContainsf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -703,8 +699,6 @@ func HTTPBodyContainsf(t TestingT, handler http.HandlerFunc, method string, url // body that does not contain a string. // // require.HTTPBodyNotContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") -// -// Returns whether the assertion was successful (true) or not (false). func HTTPBodyNotContains(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -719,8 +713,6 @@ func HTTPBodyNotContains(t TestingT, handler http.HandlerFunc, method string, ur // body that does not contain a string. // // require.HTTPBodyNotContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func HTTPBodyNotContainsf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -734,8 +726,6 @@ func HTTPBodyNotContainsf(t TestingT, handler http.HandlerFunc, method string, u // HTTPError asserts that a specified handler returns an error status code. // // require.HTTPError(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} -// -// Returns whether the assertion was successful (true) or not (false). func HTTPError(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -749,8 +739,6 @@ func HTTPError(t TestingT, handler http.HandlerFunc, method string, url string, // HTTPErrorf asserts that a specified handler returns an error status code. // // require.HTTPErrorf(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} -// -// Returns whether the assertion was successful (true) or not (false). func HTTPErrorf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -764,8 +752,6 @@ func HTTPErrorf(t TestingT, handler http.HandlerFunc, method string, url string, // HTTPRedirect asserts that a specified handler returns a redirect status code. // // require.HTTPRedirect(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} -// -// Returns whether the assertion was successful (true) or not (false). func HTTPRedirect(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -779,8 +765,6 @@ func HTTPRedirect(t TestingT, handler http.HandlerFunc, method string, url strin // HTTPRedirectf asserts that a specified handler returns a redirect status code. // // require.HTTPRedirectf(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} -// -// Returns whether the assertion was successful (true) or not (false). func HTTPRedirectf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -794,8 +778,6 @@ func HTTPRedirectf(t TestingT, handler http.HandlerFunc, method string, url stri // HTTPStatusCode asserts that a specified handler returns a specified status code. // // require.HTTPStatusCode(t, myHandler, "GET", "/notImplemented", nil, 501) -// -// Returns whether the assertion was successful (true) or not (false). func HTTPStatusCode(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -809,8 +791,6 @@ func HTTPStatusCode(t TestingT, handler http.HandlerFunc, method string, url str // HTTPStatusCodef asserts that a specified handler returns a specified status code. // // require.HTTPStatusCodef(t, myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func HTTPStatusCodef(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -824,8 +804,6 @@ func HTTPStatusCodef(t TestingT, handler http.HandlerFunc, method string, url st // HTTPSuccess asserts that a specified handler returns a success status code. // // require.HTTPSuccess(t, myHandler, "POST", "http://www.google.com", nil) -// -// Returns whether the assertion was successful (true) or not (false). func HTTPSuccess(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -839,8 +817,6 @@ func HTTPSuccess(t TestingT, handler http.HandlerFunc, method string, url string // HTTPSuccessf asserts that a specified handler returns a success status code. // // require.HTTPSuccessf(t, myHandler, "POST", "http://www.google.com", nil, "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func HTTPSuccessf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1385,12 +1361,11 @@ func NoDirExistsf(t TestingT, path string, msg string, args ...interface{}) { t.FailNow() } -// NoError asserts that a function returned no error (i.e. `nil`). +// NoError asserts that a function returned a nil error (ie. no error). // -// actualObj, err := SomeFunction() -// if require.NoError(t, err) { -// require.Equal(t, expectedObj, actualObj) -// } +// actualObj, err := SomeFunction() +// require.NoError(t, err) +// require.Equal(t, expectedObj, actualObj) func NoError(t TestingT, err error, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1401,12 +1376,11 @@ func NoError(t TestingT, err error, msgAndArgs ...interface{}) { t.FailNow() } -// NoErrorf asserts that a function returned no error (i.e. `nil`). +// NoErrorf asserts that a function returned a nil error (ie. no error). // -// actualObj, err := SomeFunction() -// if require.NoErrorf(t, err, "error message %s", "formatted") { -// require.Equal(t, expectedObj, actualObj) -// } +// actualObj, err := SomeFunction() +// require.NoErrorf(t, err, "error message %s", "formatted") +// require.Equal(t, expectedObj, actualObj) func NoErrorf(t TestingT, err error, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1515,9 +1489,8 @@ func NotElementsMatchf(t TestingT, listA interface{}, listB interface{}, msg str // NotEmpty asserts that the specified object is NOT [Empty]. // -// if require.NotEmpty(t, obj) { -// require.Equal(t, "two", obj[1]) -// } +// require.NotEmpty(t, obj) +// require.Equal(t, "two", obj[1]) func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1530,9 +1503,8 @@ func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) { // NotEmptyf asserts that the specified object is NOT [Empty]. // -// if require.NotEmptyf(t, obj, "error message %s", "formatted") { -// require.Equal(t, "two", obj[1]) -// } +// require.NotEmptyf(t, obj, "error message %s", "formatted") +// require.Equal(t, "two", obj[1]) func NotEmptyf(t TestingT, object interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -2135,7 +2107,19 @@ func WithinRangef(t TestingT, actual time.Time, start time.Time, end time.Time, t.FailNow() } -// YAMLEq asserts that two YAML strings are equivalent. +// YAMLEq asserts that the first documents in the two YAML strings are equivalent. +// +// expected := `--- +// key: value +// --- +// key: this is a second document, it is not evaluated +// ` +// actual := `--- +// key: value +// --- +// key: this is a subsequent document, it is not evaluated +// ` +// require.YAMLEq(t, expected, actual) func YAMLEq(t TestingT, expected string, actual string, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -2146,7 +2130,19 @@ func YAMLEq(t TestingT, expected string, actual string, msgAndArgs ...interface{ t.FailNow() } -// YAMLEqf asserts that two YAML strings are equivalent. +// YAMLEqf asserts that the first documents in the two YAML strings are equivalent. +// +// expected := `--- +// key: value +// --- +// key: this is a second document, it is not evaluated +// ` +// actual := `--- +// key: value +// --- +// key: this is a subsequent document, it is not evaluated +// ` +// require.YAMLEqf(t, expected, actual, "error message %s", "formatted") func YAMLEqf(t TestingT, expected string, actual string, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() diff --git a/vendor/github.com/stretchr/testify/require/require.go.tmpl b/vendor/github.com/stretchr/testify/require/require.go.tmpl index 8b328368509..6a975501ee7 100644 --- a/vendor/github.com/stretchr/testify/require/require.go.tmpl +++ b/vendor/github.com/stretchr/testify/require/require.go.tmpl @@ -1,4 +1,4 @@ -{{ replace .Comment "assert." "require."}} +{{.CommentRequire}} func {{.DocInfo.Name}}(t TestingT, {{.Params}}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.{{.DocInfo.Name}}(t, {{.ForwardedParams}}) { return } diff --git a/vendor/github.com/stretchr/testify/require/require_forward.go b/vendor/github.com/stretchr/testify/require/require_forward.go index e6f7e944684..edac147ef46 100644 --- a/vendor/github.com/stretchr/testify/require/require_forward.go +++ b/vendor/github.com/stretchr/testify/require/require_forward.go @@ -147,7 +147,7 @@ func (a *Assertions) Equal(expected interface{}, actual interface{}, msgAndArgs Equal(a.t, expected, actual, msgAndArgs...) } -// EqualError asserts that a function returned an error (i.e. not `nil`) +// EqualError asserts that a function returned a non-nil error (i.e. an error) // and that it is equal to the provided error. // // actualObj, err := SomeFunction() @@ -159,7 +159,7 @@ func (a *Assertions) EqualError(theError error, errString string, msgAndArgs ... EqualError(a.t, theError, errString, msgAndArgs...) } -// EqualErrorf asserts that a function returned an error (i.e. not `nil`) +// EqualErrorf asserts that a function returned a non-nil error (i.e. an error) // and that it is equal to the provided error. // // actualObj, err := SomeFunction() @@ -241,7 +241,7 @@ func (a *Assertions) Equalf(expected interface{}, actual interface{}, msg string Equalf(a.t, expected, actual, msg, args...) } -// Error asserts that a function returned an error (i.e. not `nil`). +// Error asserts that a function returned a non-nil error (ie. an error). // // actualObj, err := SomeFunction() // a.Error(err) @@ -270,8 +270,8 @@ func (a *Assertions) ErrorAsf(err error, target interface{}, msg string, args .. ErrorAsf(a.t, err, target, msg, args...) } -// ErrorContains asserts that a function returned an error (i.e. not `nil`) -// and that the error contains the specified substring. +// ErrorContains asserts that a function returned a non-nil error (i.e. an +// error) and that the error contains the specified substring. // // actualObj, err := SomeFunction() // a.ErrorContains(err, expectedErrorSubString) @@ -282,8 +282,8 @@ func (a *Assertions) ErrorContains(theError error, contains string, msgAndArgs . ErrorContains(a.t, theError, contains, msgAndArgs...) } -// ErrorContainsf asserts that a function returned an error (i.e. not `nil`) -// and that the error contains the specified substring. +// ErrorContainsf asserts that a function returned a non-nil error (i.e. an +// error) and that the error contains the specified substring. // // actualObj, err := SomeFunction() // a.ErrorContainsf(err, expectedErrorSubString, "error message %s", "formatted") @@ -312,7 +312,7 @@ func (a *Assertions) ErrorIsf(err error, target error, msg string, args ...inter ErrorIsf(a.t, err, target, msg, args...) } -// Errorf asserts that a function returned an error (i.e. not `nil`). +// Errorf asserts that a function returned a non-nil error (ie. an error). // // actualObj, err := SomeFunction() // a.Errorf(err, "error message %s", "formatted") @@ -373,10 +373,10 @@ func (a *Assertions) EventuallyWithT(condition func(collect *assert.CollectT), w // time.Sleep(8*time.Second) // externalValue = true // }() -// a.EventuallyWithTf(func(c *assert.CollectT, "error message %s", "formatted") { +// a.EventuallyWithTf(func(c *assert.CollectT) { // // add assertions as needed; any assertion failure will fail the current tick // assert.True(c, externalValue, "expected 'externalValue' to be true") -// }, 10*time.Second, 1*time.Second, "external state has not changed to 'true'; still false") +// }, 10*time.Second, 1*time.Second, "error message %s", "formatted") func (a *Assertions) EventuallyWithTf(condition func(collect *assert.CollectT), waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -539,8 +539,6 @@ func (a *Assertions) Greaterf(e1 interface{}, e2 interface{}, msg string, args . // body that contains a string. // // a.HTTPBodyContains(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPBodyContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -552,8 +550,6 @@ func (a *Assertions) HTTPBodyContains(handler http.HandlerFunc, method string, u // body that contains a string. // // a.HTTPBodyContainsf(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPBodyContainsf(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -565,8 +561,6 @@ func (a *Assertions) HTTPBodyContainsf(handler http.HandlerFunc, method string, // body that does not contain a string. // // a.HTTPBodyNotContains(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPBodyNotContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -578,8 +572,6 @@ func (a *Assertions) HTTPBodyNotContains(handler http.HandlerFunc, method string // body that does not contain a string. // // a.HTTPBodyNotContainsf(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPBodyNotContainsf(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -590,8 +582,6 @@ func (a *Assertions) HTTPBodyNotContainsf(handler http.HandlerFunc, method strin // HTTPError asserts that a specified handler returns an error status code. // // a.HTTPError(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPError(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -602,8 +592,6 @@ func (a *Assertions) HTTPError(handler http.HandlerFunc, method string, url stri // HTTPErrorf asserts that a specified handler returns an error status code. // // a.HTTPErrorf(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPErrorf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -614,8 +602,6 @@ func (a *Assertions) HTTPErrorf(handler http.HandlerFunc, method string, url str // HTTPRedirect asserts that a specified handler returns a redirect status code. // // a.HTTPRedirect(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPRedirect(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -626,8 +612,6 @@ func (a *Assertions) HTTPRedirect(handler http.HandlerFunc, method string, url s // HTTPRedirectf asserts that a specified handler returns a redirect status code. // // a.HTTPRedirectf(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPRedirectf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -638,8 +622,6 @@ func (a *Assertions) HTTPRedirectf(handler http.HandlerFunc, method string, url // HTTPStatusCode asserts that a specified handler returns a specified status code. // // a.HTTPStatusCode(myHandler, "GET", "/notImplemented", nil, 501) -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPStatusCode(handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -650,8 +632,6 @@ func (a *Assertions) HTTPStatusCode(handler http.HandlerFunc, method string, url // HTTPStatusCodef asserts that a specified handler returns a specified status code. // // a.HTTPStatusCodef(myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPStatusCodef(handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -662,8 +642,6 @@ func (a *Assertions) HTTPStatusCodef(handler http.HandlerFunc, method string, ur // HTTPSuccess asserts that a specified handler returns a success status code. // // a.HTTPSuccess(myHandler, "POST", "http://www.google.com", nil) -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPSuccess(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -674,8 +652,6 @@ func (a *Assertions) HTTPSuccess(handler http.HandlerFunc, method string, url st // HTTPSuccessf asserts that a specified handler returns a success status code. // // a.HTTPSuccessf(myHandler, "POST", "http://www.google.com", nil, "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPSuccessf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1097,12 +1073,11 @@ func (a *Assertions) NoDirExistsf(path string, msg string, args ...interface{}) NoDirExistsf(a.t, path, msg, args...) } -// NoError asserts that a function returned no error (i.e. `nil`). +// NoError asserts that a function returned a nil error (ie. no error). // -// actualObj, err := SomeFunction() -// if a.NoError(err) { -// assert.Equal(t, expectedObj, actualObj) -// } +// actualObj, err := SomeFunction() +// a.NoError(err) +// a.Equal(expectedObj, actualObj) func (a *Assertions) NoError(err error, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1110,12 +1085,11 @@ func (a *Assertions) NoError(err error, msgAndArgs ...interface{}) { NoError(a.t, err, msgAndArgs...) } -// NoErrorf asserts that a function returned no error (i.e. `nil`). +// NoErrorf asserts that a function returned a nil error (ie. no error). // -// actualObj, err := SomeFunction() -// if a.NoErrorf(err, "error message %s", "formatted") { -// assert.Equal(t, expectedObj, actualObj) -// } +// actualObj, err := SomeFunction() +// a.NoErrorf(err, "error message %s", "formatted") +// a.Equal(expectedObj, actualObj) func (a *Assertions) NoErrorf(err error, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1203,9 +1177,8 @@ func (a *Assertions) NotElementsMatchf(listA interface{}, listB interface{}, msg // NotEmpty asserts that the specified object is NOT [Empty]. // -// if a.NotEmpty(obj) { -// assert.Equal(t, "two", obj[1]) -// } +// a.NotEmpty(obj) +// a.Equal("two", obj[1]) func (a *Assertions) NotEmpty(object interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1215,9 +1188,8 @@ func (a *Assertions) NotEmpty(object interface{}, msgAndArgs ...interface{}) { // NotEmptyf asserts that the specified object is NOT [Empty]. // -// if a.NotEmptyf(obj, "error message %s", "formatted") { -// assert.Equal(t, "two", obj[1]) -// } +// a.NotEmptyf(obj, "error message %s", "formatted") +// a.Equal("two", obj[1]) func (a *Assertions) NotEmptyf(object interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1691,7 +1663,19 @@ func (a *Assertions) WithinRangef(actual time.Time, start time.Time, end time.Ti WithinRangef(a.t, actual, start, end, msg, args...) } -// YAMLEq asserts that two YAML strings are equivalent. +// YAMLEq asserts that the first documents in the two YAML strings are equivalent. +// +// expected := `--- +// key: value +// --- +// key: this is a second document, it is not evaluated +// ` +// actual := `--- +// key: value +// --- +// key: this is a subsequent document, it is not evaluated +// ` +// a.YAMLEq(expected, actual) func (a *Assertions) YAMLEq(expected string, actual string, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1699,7 +1683,19 @@ func (a *Assertions) YAMLEq(expected string, actual string, msgAndArgs ...interf YAMLEq(a.t, expected, actual, msgAndArgs...) } -// YAMLEqf asserts that two YAML strings are equivalent. +// YAMLEqf asserts that the first documents in the two YAML strings are equivalent. +// +// expected := `--- +// key: value +// --- +// key: this is a second document, it is not evaluated +// ` +// actual := `--- +// key: value +// --- +// key: this is a subsequent document, it is not evaluated +// ` +// a.YAMLEqf(expected, actual, "error message %s", "formatted") func (a *Assertions) YAMLEqf(expected string, actual string, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() diff --git a/vendor/github.com/stretchr/testify/require/require_forward.go.tmpl b/vendor/github.com/stretchr/testify/require/require_forward.go.tmpl index 54124df1d3b..b3b751de48a 100644 --- a/vendor/github.com/stretchr/testify/require/require_forward.go.tmpl +++ b/vendor/github.com/stretchr/testify/require/require_forward.go.tmpl @@ -1,4 +1,4 @@ -{{.CommentWithoutT "a"}} +{{.CommentRequireWithoutT "a"}} func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) { if h, ok := a.t.(tHelper); ok { h.Helper() } {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) diff --git a/vendor/github.com/stretchr/testify/require/requirements.go b/vendor/github.com/stretchr/testify/require/requirements.go index 6b7ce929eb1..375adb0a6ad 100644 --- a/vendor/github.com/stretchr/testify/require/requirements.go +++ b/vendor/github.com/stretchr/testify/require/requirements.go @@ -12,18 +12,18 @@ type tHelper = interface { // ComparisonAssertionFunc is a common function prototype when comparing two values. Can be useful // for table driven tests. -type ComparisonAssertionFunc func(TestingT, interface{}, interface{}, ...interface{}) +type ComparisonAssertionFunc = func(TestingT, interface{}, interface{}, ...interface{}) // ValueAssertionFunc is a common function prototype when validating a single value. Can be useful // for table driven tests. -type ValueAssertionFunc func(TestingT, interface{}, ...interface{}) +type ValueAssertionFunc = func(TestingT, interface{}, ...interface{}) // BoolAssertionFunc is a common function prototype when validating a bool value. Can be useful // for table driven tests. -type BoolAssertionFunc func(TestingT, bool, ...interface{}) +type BoolAssertionFunc = func(TestingT, bool, ...interface{}) // ErrorAssertionFunc is a common function prototype when validating an error value. Can be useful // for table driven tests. -type ErrorAssertionFunc func(TestingT, error, ...interface{}) +type ErrorAssertionFunc = func(TestingT, error, ...interface{}) //go:generate sh -c "cd ../_codegen && go build && cd - && ../_codegen/_codegen -output-package=require -template=require.go.tmpl -include-format-funcs" diff --git a/vendor/github.com/tinylib/msgp/msgp/json.go b/vendor/github.com/tinylib/msgp/msgp/json.go index 896d690ba09..49bd54bf124 100644 --- a/vendor/github.com/tinylib/msgp/msgp/json.go +++ b/vendor/github.com/tinylib/msgp/msgp/json.go @@ -131,11 +131,35 @@ func rwMap(dst jsWriter, src *Reader) (n int, err error) { n++ } - field, err = src.ReadMapKeyPtr() + var kt Type + kt, err = src.NextType() if err != nil { return } - nn, err = rwquoted(dst, field) + switch kt { + case IntType: + var i64 int64 + i64, err = src.ReadInt64() + if err != nil { + return + } + src.scratch = strconv.AppendInt(src.scratch[:0], i64, 10) + nn, err = rwquoted(dst, src.scratch) + case UintType: + var u64 uint64 + u64, err = src.ReadUint64() + if err != nil { + return + } + src.scratch = strconv.AppendUint(src.scratch[:0], u64, 10) + nn, err = rwquoted(dst, src.scratch) + default: + field, err = src.ReadMapKeyPtr() + if err != nil { + return + } + nn, err = rwquoted(dst, field) + } n += nn if err != nil { return diff --git a/vendor/github.com/tinylib/msgp/msgp/json_bytes.go b/vendor/github.com/tinylib/msgp/msgp/json_bytes.go index 7efd162f199..4aced1b16c3 100644 --- a/vendor/github.com/tinylib/msgp/msgp/json_bytes.go +++ b/vendor/github.com/tinylib/msgp/msgp/json_bytes.go @@ -144,6 +144,27 @@ func rwMapBytes(w jsWriter, msg []byte, scratch []byte, depth int) ([]byte, []by } func rwMapKeyBytes(w jsWriter, msg []byte, scratch []byte, depth int) ([]byte, []byte, error) { + if len(msg) < 1 { + return msg, scratch, ErrShortBytes + } + switch getType(msg[0]) { + case IntType: + i, msg, err := ReadInt64Bytes(msg) + if err != nil { + return msg, scratch, err + } + scratch = strconv.AppendInt(scratch[:0], i, 10) + _, err = rwquoted(w, scratch) + return msg, scratch, err + case UintType: + u, msg, err := ReadUint64Bytes(msg) + if err != nil { + return msg, scratch, err + } + scratch = strconv.AppendUint(scratch[:0], u, 10) + _, err = rwquoted(w, scratch) + return msg, scratch, err + } msg, scratch, err := rwStringBytes(w, msg, scratch, depth) if err != nil { if tperr, ok := err.(TypeError); ok && tperr.Encoded == BinType { diff --git a/vendor/github.com/tinylib/msgp/msgp/read.go b/vendor/github.com/tinylib/msgp/msgp/read.go index 264933ad0ef..b029e5740c7 100644 --- a/vendor/github.com/tinylib/msgp/msgp/read.go +++ b/vendor/github.com/tinylib/msgp/msgp/read.go @@ -121,6 +121,10 @@ func Decode(r io.Reader, d Decodable) error { // reader will be buffered. func NewReader(r io.Reader) *Reader { p := readerPool.Get().(*Reader) + p.recursionDepth = 0 + p.maxElements = 0 + p.maxRecursionDepth = 0 + p.maxStrLen = 0 if p.R == nil { p.R = fwd.NewReader(r) } else { @@ -1009,6 +1013,62 @@ func (m *Reader) ReadBytes(scratch []byte) (b []byte, err error) { return } +// ReadBytesLimit reads a MessagePack 'bin' object +// from the reader and returns its value. It may +// use 'scratch' for storage if it is non-nil. +// If n >= 0 this will be the maximum bytes read. +// If n < 0, the cap(scratch) will be the limit. +// If SetMaxElements has been used on the Reader, +// that will only be checked if the scratch is too small. +func (m *Reader) ReadBytesLimit(scratch []byte, n int64) (b []byte, err error) { + var p []byte + var lead byte + p, err = m.R.Peek(2) + if err != nil { + return + } + lead = p[0] + var read int64 + switch lead { + case mbin8: + read = int64(p[1]) + m.R.Skip(2) + case mbin16: + p, err = m.R.Next(3) + if err != nil { + return + } + read = int64(big.Uint16(p[1:])) + case mbin32: + p, err = m.R.Next(5) + if err != nil { + return + } + read = int64(big.Uint32(p[1:])) + default: + err = badPrefix(BinType, lead) + return + } + if n < 0 { + n = int64(cap(scratch)) + } + if read > n { + err = ErrLimitExceeded + return + } + if int64(cap(scratch)) < read { + b = make([]byte, read) + if read > int64(m.GetMaxElements()) { + err = ErrLimitExceeded + return + } + } else { + b = scratch[0:read] + } + _, err = m.R.ReadFull(b) + return +} + // ReadBytesHeader reads the size header // of a MessagePack 'bin' object. The user // is responsible for dealing with the next diff --git a/vendor/go.opentelemetry.io/collector/featuregate/flag.go b/vendor/go.opentelemetry.io/collector/featuregate/flag.go index 1c6f3a5e873..6f5a27070cf 100644 --- a/vendor/go.opentelemetry.io/collector/featuregate/flag.go +++ b/vendor/go.opentelemetry.io/collector/featuregate/flag.go @@ -5,6 +5,7 @@ package featuregate // import "go.opentelemetry.io/collector/featuregate" import ( "flag" + "fmt" "strings" "go.uber.org/multierr" @@ -57,6 +58,10 @@ func (f *flagValue) Set(s string) error { ids := strings.Split(s, ",") for i := range ids { id := ids[i] + if id == "" { + errs = multierr.Append(errs, fmt.Errorf("empty feature gate identifier at index %d", i)) + continue + } val := true switch id[0] { case '-': diff --git a/vendor/go.opentelemetry.io/collector/featuregate/registry.go b/vendor/go.opentelemetry.io/collector/featuregate/registry.go index 00e6ec21518..a7bbfc7cfde 100644 --- a/vendor/go.opentelemetry.io/collector/featuregate/registry.go +++ b/vendor/go.opentelemetry.io/collector/featuregate/registry.go @@ -19,8 +19,10 @@ var ( globalRegistry = NewRegistry() // idRegexp is used to validate the ID of a Gate. - // IDs' characters must be alphanumeric or dots. - idRegexp = regexp.MustCompile(`^[0-9a-zA-Z.]*$`) + // IDs are one or more dot-separated segments; each segment must be a + // non-empty run of alphanumeric characters, so a leading, trailing, or + // doubled dot (e.g. ".foo", "foo.", "foo..bar") is rejected. + idRegexp = regexp.MustCompile(`^[0-9a-zA-Z]+(\.[0-9a-zA-Z]+)*$`) ) // ErrAlreadyRegistered is returned when adding a Gate that is already registered. diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_anyvalue.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_anyvalue.go index 032051078a9..cb94bd0351d 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_anyvalue.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_anyvalue.go @@ -317,7 +317,7 @@ func CopyAnyValue(dest, src *AnyValue) *AnyValue { } else { ov = ProtoPoolAnyValue_BytesValue.Get().(*AnyValue_BytesValue) } - ov.BytesValue = t.BytesValue + ov.BytesValue = append(ov.BytesValue[:0], t.BytesValue...) dest.Value = ov case *AnyValue_StringValueStrindex: diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_exemplar.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_exemplar.go index c277d671f80..ea57d99ec4b 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_exemplar.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_exemplar.go @@ -51,9 +51,9 @@ func (m *Exemplar) GetAsInt() int64 { // Exemplars also hold information about the environment when the measurement was recorded, // for example the span and trace ID of the active span when the exemplar was recorded. type Exemplar struct { - Value any FilteredAttributes []KeyValue TimeUnixNano uint64 + Value any TraceId TraceID SpanId SpanID } diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_exponentialhistogramdatapoint.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_exponentialhistogramdatapoint.go index 2b674760aa9..5df1ba37fa7 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_exponentialhistogramdatapoint.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_exponentialhistogramdatapoint.go @@ -22,21 +22,21 @@ import ( // summary statistics for a population of values, it may optionally contain the // distribution of those values across a set of buckets. type ExponentialHistogramDataPoint struct { - Positive ExponentialHistogramDataPointBuckets - Negative ExponentialHistogramDataPointBuckets Attributes []KeyValue - Exemplars []Exemplar StartTimeUnixNano uint64 TimeUnixNano uint64 Count uint64 Sum float64 + Scale int32 ZeroCount uint64 + Positive ExponentialHistogramDataPointBuckets + Negative ExponentialHistogramDataPointBuckets + Flags uint32 + Exemplars []Exemplar Min float64 Max float64 ZeroThreshold float64 metadata [1]uint64 - Scale int32 - Flags uint32 } var ( diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_exponentialhistogramdatapointbuckets.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_exponentialhistogramdatapointbuckets.go index b4046ab04ee..93321505c63 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_exponentialhistogramdatapointbuckets.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_exponentialhistogramdatapointbuckets.go @@ -17,8 +17,8 @@ import ( // ExponentialHistogramDataPointBuckets are a set of bucket counts, encoded in a contiguous array of counts. type ExponentialHistogramDataPointBuckets struct { - BucketCounts []uint64 Offset int32 + BucketCounts []uint64 } var ( diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_exportlogspartialsuccess.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_exportlogspartialsuccess.go index f6eb015ed5d..90de3f0f050 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_exportlogspartialsuccess.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_exportlogspartialsuccess.go @@ -17,8 +17,8 @@ import ( // ExportPartialSuccess represents the details of a partially successful export request. type ExportLogsPartialSuccess struct { - ErrorMessage string RejectedLogRecords int64 + ErrorMessage string } var ( diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_exportmetricspartialsuccess.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_exportmetricspartialsuccess.go index cbad581e377..01c68f1d406 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_exportmetricspartialsuccess.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_exportmetricspartialsuccess.go @@ -17,8 +17,8 @@ import ( // ExportPartialSuccess represents the details of a partially successful export request. type ExportMetricsPartialSuccess struct { - ErrorMessage string RejectedDataPoints int64 + ErrorMessage string } var ( diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_exportprofilespartialsuccess.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_exportprofilespartialsuccess.go index ed8413e93a2..585784d7281 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_exportprofilespartialsuccess.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_exportprofilespartialsuccess.go @@ -17,8 +17,8 @@ import ( // ExportPartialSuccess represents the details of a partially successful export request. type ExportProfilesPartialSuccess struct { - ErrorMessage string RejectedProfiles int64 + ErrorMessage string } var ( diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_exporttracepartialsuccess.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_exporttracepartialsuccess.go index 237330dc150..2acb9ee12b6 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_exporttracepartialsuccess.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_exporttracepartialsuccess.go @@ -17,8 +17,8 @@ import ( // ExportPartialSuccess represents the details of a partially successful export request. type ExportTracePartialSuccess struct { - ErrorMessage string RejectedSpans int64 + ErrorMessage string } var ( diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_histogramdatapoint.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_histogramdatapoint.go index ef558bad06a..43556d1c5ea 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_histogramdatapoint.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_histogramdatapoint.go @@ -20,17 +20,17 @@ import ( // HistogramDataPoint is a single data point in a timeseries that describes the time-varying values of a Histogram of values. type HistogramDataPoint struct { Attributes []KeyValue - BucketCounts []uint64 - ExplicitBounds []float64 - Exemplars []Exemplar StartTimeUnixNano uint64 TimeUnixNano uint64 Count uint64 Sum float64 + BucketCounts []uint64 + ExplicitBounds []float64 + Exemplars []Exemplar + Flags uint32 Min float64 Max float64 metadata [1]uint64 - Flags uint32 } var ( diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_ipaddr.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_ipaddr.go index adcb5a02b64..e06a8d40bc8 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_ipaddr.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_ipaddr.go @@ -16,8 +16,8 @@ import ( ) type IPAddr struct { - Zone string IP []byte + Zone string } var ( diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_keyvalue.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_keyvalue.go index 43099dd4021..51c86d648af 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_keyvalue.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_keyvalue.go @@ -16,8 +16,8 @@ import ( ) type KeyValue struct { - Value AnyValue Key string + Value AnyValue KeyStrindex int32 } diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_keyvalueandunit.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_keyvalueandunit.go index d9dec2874cc..4cd9e96bc24 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_keyvalueandunit.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_keyvalueandunit.go @@ -19,8 +19,8 @@ import ( // style of encoding attributes which is more convenient // for profiles than opentelemetry.proto.common.v1.KeyValue. type KeyValueAndUnit struct { - Value AnyValue KeyStrindex int32 + Value AnyValue UnitStrindex int32 } diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_location.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_location.go index 4c93c390f6e..e423c18a647 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_location.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_location.go @@ -17,10 +17,10 @@ import ( // Location describes function and line table debug information. type Location struct { + MappingIndex int32 + Address uint64 Lines []*Line AttributeIndices []int32 - Address uint64 - MappingIndex int32 } var ( diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_logrecord.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_logrecord.go index d878ca0c5e8..9332398d68d 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_logrecord.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_logrecord.go @@ -19,17 +19,17 @@ import ( // LogRecord are experimental implementation of OpenTelemetry Log Data Model. type LogRecord struct { - Body AnyValue - SeverityText string - EventName string - Attributes []KeyValue TimeUnixNano uint64 ObservedTimeUnixNano uint64 SeverityNumber SeverityNumber + SeverityText string + Body AnyValue + Attributes []KeyValue DroppedAttributesCount uint32 Flags uint32 TraceId TraceID SpanId SpanID + EventName string } var ( diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_mapping.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_mapping.go index a527313a198..29dcd5237ed 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_mapping.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_mapping.go @@ -17,11 +17,11 @@ import ( // Mapping describes the mapping of a binary in memory, including its address range, file offset, and metadata like build ID type Mapping struct { - AttributeIndices []int32 MemoryStart uint64 MemoryLimit uint64 FileOffset uint64 FilenameStrindex int32 + AttributeIndices []int32 } var ( diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_numberdatapoint.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_numberdatapoint.go index e74c59b33db..80f5dab9703 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_numberdatapoint.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_numberdatapoint.go @@ -48,11 +48,11 @@ func (m *NumberDataPoint) GetAsInt() int64 { // NumberDataPoint is a single data point in a timeseries that describes the time-varying value of a number metric. type NumberDataPoint struct { - Value any Attributes []KeyValue - Exemplars []Exemplar StartTimeUnixNano uint64 TimeUnixNano uint64 + Value any + Exemplars []Exemplar Flags uint32 } diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_profile.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_profile.go index 553105af201..f353b1cffb1 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_profile.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_profile.go @@ -19,17 +19,17 @@ import ( // Profile are an implementation of the pprofextended data model. type Profile struct { - OriginalPayloadFormat string + SampleType ValueType Samples []*Sample - OriginalPayload []byte - AttributeIndices []int32 TimeUnixNano uint64 DurationNano uint64 - Period int64 - SampleType ValueType PeriodType ValueType - DroppedAttributesCount uint32 + Period int64 ProfileId ProfileID + DroppedAttributesCount uint32 + OriginalPayloadFormat string + OriginalPayload []byte + AttributeIndices []int32 } var ( diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_requestcontext.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_requestcontext.go index 808f7e364d4..ebc406b72fe 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_requestcontext.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_requestcontext.go @@ -67,9 +67,9 @@ func (m *RequestContext) GetUnix() *UnixAddr { } type RequestContext struct { - ClientAddress any SpanContext *SpanContext ClientMetadata []KeyValue + ClientAddress any } var ( diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_resource.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_resource.go index 2b89f32e03a..23b17d08c48 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_resource.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_resource.go @@ -18,8 +18,8 @@ import ( // Resource is a message representing the resource information. type Resource struct { Attributes []KeyValue - EntityRefs []*EntityRef DroppedAttributesCount uint32 + EntityRefs []*EntityRef } var ( diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_resourceprofiles.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_resourceprofiles.go index 8d759baaa3a..efd84ba9feb 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_resourceprofiles.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_resourceprofiles.go @@ -17,9 +17,9 @@ import ( // ResourceProfiles is a collection of profiles from a Resource. type ResourceProfiles struct { - SchemaUrl string Resource Resource ScopeProfiles []*ScopeProfiles + SchemaUrl string } var ( diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_sample.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_sample.go index 5d0cadd9be4..e382bfe6ad3 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_sample.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_sample.go @@ -18,11 +18,11 @@ import ( // Sample represents each record value encountered within a profiled program. type Sample struct { + StackIndex int32 AttributeIndices []int32 + LinkIndex int32 Values []int64 TimestampsUnixNano []uint64 - StackIndex int32 - LinkIndex int32 } var ( diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_scopelogs.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_scopelogs.go index 21f101529c5..1d0d2f1aba9 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_scopelogs.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_scopelogs.go @@ -17,9 +17,9 @@ import ( // ScopeLogs is a collection of logs from a LibraryInstrumentation. type ScopeLogs struct { - SchemaUrl string - LogRecords []*LogRecord Scope InstrumentationScope + LogRecords []*LogRecord + SchemaUrl string } var ( diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_scopemetrics.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_scopemetrics.go index 51085e812a7..bf991dc3288 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_scopemetrics.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_scopemetrics.go @@ -17,9 +17,9 @@ import ( // ScopeMetrics is a collection of metrics from a LibraryInstrumentation. type ScopeMetrics struct { - SchemaUrl string - Metrics []*Metric Scope InstrumentationScope + Metrics []*Metric + SchemaUrl string } var ( diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_scopeprofiles.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_scopeprofiles.go index b8a9a4d3b56..cb52b40a8c8 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_scopeprofiles.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_scopeprofiles.go @@ -17,9 +17,9 @@ import ( // ScopeProfiles is a collection of profiles from a LibraryInstrumentation. type ScopeProfiles struct { - SchemaUrl string - Profiles []*Profile Scope InstrumentationScope + Profiles []*Profile + SchemaUrl string } var ( diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_scopespans.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_scopespans.go index 0b9473c64ad..5af80a16856 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_scopespans.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_scopespans.go @@ -17,9 +17,9 @@ import ( // ScopeSpans is a collection of spans from a LibraryInstrumentation. type ScopeSpans struct { - SchemaUrl string - Spans []*Span Scope InstrumentationScope + Spans []*Span + SchemaUrl string } var ( diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_span.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_span.go index 43081e5748c..c71328f275a 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_span.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_span.go @@ -19,22 +19,22 @@ import ( // Span represents a single operation within a trace. // See Span definition in OTLP: https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/trace/v1/trace.proto type Span struct { + TraceId TraceID + SpanId SpanID TraceState string + ParentSpanId SpanID + Flags uint32 Name string - Attributes []KeyValue - Events []*SpanEvent - Links []*SpanLink - Status Status + Kind SpanKind StartTimeUnixNano uint64 EndTimeUnixNano uint64 - Flags uint32 - Kind SpanKind + Attributes []KeyValue DroppedAttributesCount uint32 + Events []*SpanEvent DroppedEventsCount uint32 + Links []*SpanLink DroppedLinksCount uint32 - TraceId TraceID - SpanId SpanID - ParentSpanId SpanID + Status Status } var ( diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_spancontext.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_spancontext.go index bd98320ea95..498e2891a8c 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_spancontext.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_spancontext.go @@ -17,10 +17,10 @@ import ( ) type SpanContext struct { - TraceState string - TraceFlags uint32 TraceID TraceID SpanID SpanID + TraceFlags uint32 + TraceState string Remote bool } diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_spanevent.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_spanevent.go index 2211f06ba38..1259973c733 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_spanevent.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_spanevent.go @@ -19,9 +19,9 @@ import ( // SpanEvent is a time-stamped annotation of the span, consisting of user-supplied // text description and key-value pairs. See OTLP for event definition. type SpanEvent struct { + TimeUnixNano uint64 Name string Attributes []KeyValue - TimeUnixNano uint64 DroppedAttributesCount uint32 } diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_spanlink.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_spanlink.go index e0b9f7d8770..34e9cffc5dd 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_spanlink.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_spanlink.go @@ -20,12 +20,12 @@ import ( // different trace. // See Link definition in OTLP: https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/trace/v1/trace.proto type SpanLink struct { + TraceId TraceID + SpanId SpanID TraceState string Attributes []KeyValue DroppedAttributesCount uint32 Flags uint32 - TraceId TraceID - SpanId SpanID } var ( diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_summarydatapoint.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_summarydatapoint.go index cc1dfa170b0..274f63f97ce 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_summarydatapoint.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_summarydatapoint.go @@ -20,11 +20,11 @@ import ( // SummaryDataPoint is a single data point in a timeseries that describes the time-varying values of a Summary of double values. type SummaryDataPoint struct { Attributes []KeyValue - QuantileValues []*SummaryDataPointValueAtQuantile StartTimeUnixNano uint64 TimeUnixNano uint64 Count uint64 Sum float64 + QuantileValues []*SummaryDataPointValueAtQuantile Flags uint32 } diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_tcpaddr.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_tcpaddr.go index d923037177e..72f7865739d 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_tcpaddr.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_tcpaddr.go @@ -16,9 +16,9 @@ import ( ) type TCPAddr struct { - Zone string IP []byte Port int64 + Zone string } var ( diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_udpaddr.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_udpaddr.go index 25044ff4cc2..a7e90d82dce 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_udpaddr.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_proto_udpaddr.go @@ -16,9 +16,9 @@ import ( ) type UDPAddr struct { - Zone string IP []byte Port int64 + Zone string } var ( diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/json/stream.go b/vendor/go.opentelemetry.io/collector/pdata/internal/json/stream.go index 0f1b7538908..afe6c3bfa38 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/json/stream.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/json/stream.go @@ -56,12 +56,24 @@ func (ots *Stream) WriteObjectEnd() { // WriteInt64 writes the values as a decimal string. This is per the protobuf encoding rules for int64, fixed64, uint64. func (ots *Stream) WriteInt64(val int64) { - ots.WriteString(strconv.FormatInt(val, 10)) + // 19 digits + optional leading '-' + 2 quotes = 22 bytes maximum. + var buf [22]byte + buf[0] = '"' + b := strconv.AppendInt(buf[1:1], val, 10) + n := 1 + len(b) + buf[n] = '"' + _, _ = ots.Write(buf[:n+1]) } // WriteUint64 writes the values as a decimal string. This is per the protobuf encoding rules for int64, fixed64, uint64. func (ots *Stream) WriteUint64(val uint64) { - ots.WriteString(strconv.FormatUint(val, 10)) + // 20 digits + 2 quotes = 22 bytes maximum. + var buf [22]byte + buf[0] = '"' + b := strconv.AppendUint(buf[1:1], val, 10) + n := 1 + len(b) + buf[n] = '"' + _, _ = ots.Write(buf[:n+1]) } // WriteBytes writes the values as a base64 encoded string. This is per the protobuf encoding rules for bytes. diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/otelgrpc/profiles_service.go b/vendor/go.opentelemetry.io/collector/pdata/internal/otelgrpc/profiles_service.go index c91220b2645..f1ac231407b 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/otelgrpc/profiles_service.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/otelgrpc/profiles_service.go @@ -8,9 +8,11 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" "go.opentelemetry.io/collector/pdata/internal" + "go.opentelemetry.io/collector/pdata/internal/otlp" ) // ProfilesServiceClient is the client API for ProfilesService service. @@ -57,6 +59,11 @@ func RegisterProfilesServiceServer(s *grpc.Server, srv ProfilesServiceServer) { // //nolint:revive func profilesServiceExportHandler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { + // Unary interceptors run after dec, so validate the version here to reject + // incompatible payloads before protobuf deserialization. + if err := otlp.ValidateProfilesDevelopmentVersion(metadata.ValueFromIncomingContext(ctx, otlp.ProfilesDevelopmentVersionHeader)); err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } in := internal.NewExportProfilesServiceRequest() if err := dec(in); err != nil { return nil, err diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/otlp/profiles_dictionary.go b/vendor/go.opentelemetry.io/collector/pdata/internal/otlp/profiles_dictionary.go new file mode 100644 index 00000000000..837b90e3a60 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/otlp/profiles_dictionary.go @@ -0,0 +1,188 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package otlp // import "go.opentelemetry.io/collector/pdata/internal/otlp" + +import ( + "errors" + "fmt" + + "go.opentelemetry.io/collector/pdata/internal" + "go.opentelemetry.io/collector/pdata/internal/metadata" +) + +var errProfilesStringIndexNotInitialized = errors.New("profiles dictionary string index is not initialized") + +// ConvertProfilesToReferences interns resource and scope attribute strings in +// the profiles dictionary. The request must be mutable. +func ConvertProfilesToReferences(request *internal.ExportProfilesServiceRequest) error { + stringTable := &request.Dictionary.StringTable + if len(*stringTable) == 0 { + // string_table[0] is the required empty-string sentinel. + *stringTable = append(*stringTable, "") + } + + stringIndex := make(map[string]int32, len(*stringTable)) + for i, value := range *stringTable { + if i == 0 && value != "" { + // Preserve existing dictionary indices without using the reserved + // zero index for a new attribute key. + continue + } + // Keep the first occurrence so the required empty string resolves to + // the canonical index 0 even if the table already contains duplicates. + if _, ok := stringIndex[value]; !ok { + stringIndex[value] = int32(i) + } + } + + getStringIndex := func(s string) (int32, error) { + if stringIndex == nil { + return 0, errProfilesStringIndexNotInitialized + } + if index, ok := stringIndex[s]; ok { + return index, nil + } + index := int32(len(*stringTable)) + *stringTable = append(*stringTable, s) + stringIndex[s] = index + return index, nil + } + + for resourceIndex, resourceProfiles := range request.ResourceProfiles { + if err := ConvertProfilesKeyValuesToReferences(getStringIndex, resourceProfiles.Resource.Attributes); err != nil { + return fmt.Errorf("resource profiles %d resource attributes: %w", resourceIndex, err) + } + for scopeIndex, scopeProfiles := range resourceProfiles.ScopeProfiles { + if err := ConvertProfilesKeyValuesToReferences(getStringIndex, scopeProfiles.Scope.Attributes); err != nil { + return fmt.Errorf("resource profiles %d scope profiles %d attributes: %w", resourceIndex, scopeIndex, err) + } + } + } + return nil +} + +// ResolveProfilesReferences resolves resource and scope attribute string-table +// references so pdata consumers can access the attributes transparently. +func ResolveProfilesReferences(request *internal.ExportProfilesServiceRequest) error { + stringTable := request.Dictionary.StringTable + for resourceIndex, resourceProfiles := range request.ResourceProfiles { + if err := ResolveProfilesKeyValueReferences(stringTable, resourceProfiles.Resource.Attributes); err != nil { + return fmt.Errorf("resource profiles %d resource attributes: %w", resourceIndex, err) + } + for scopeIndex, scopeProfiles := range resourceProfiles.ScopeProfiles { + if err := ResolveProfilesKeyValueReferences(stringTable, scopeProfiles.Scope.Attributes); err != nil { + return fmt.Errorf("resource profiles %d scope profiles %d attributes: %w", resourceIndex, scopeIndex, err) + } + } + } + return nil +} + +// ConvertProfilesKeyValuesToReferences converts attribute strings to dictionary references. +func ConvertProfilesKeyValuesToReferences(getStringIndex func(string) (int32, error), keyValues []internal.KeyValue) error { + for i := range keyValues { + keyValue := &keyValues[i] + if keyValue.Key != "" && keyValue.KeyStrindex != 0 { + return fmt.Errorf("attribute %d has both key and key_strindex set", i) + } + if keyValue.Key != "" { + index, err := getStringIndex(keyValue.Key) + if err != nil { + return err + } + keyValue.KeyStrindex = index + keyValue.Key = "" + } + if err := ConvertProfilesAnyValueToReference(getStringIndex, &keyValue.Value); err != nil { + return err + } + } + return nil +} + +// ConvertProfilesAnyValueToReference converts strings recursively in an attribute value. +func ConvertProfilesAnyValueToReference(getStringIndex func(string) (int32, error), value *internal.AnyValue) error { + switch original := value.Value.(type) { + case *internal.AnyValue_StringValueStrindex: + return nil + case *internal.AnyValue_StringValue: + index, err := getStringIndex(original.StringValue) + if err != nil { + return err + } + var reference *internal.AnyValue_StringValueStrindex + if metadata.PdataUseProtoPoolingFeatureGate.IsEnabled() { + reference = internal.ProtoPoolAnyValue_StringValueStrindex.Get().(*internal.AnyValue_StringValueStrindex) + } else { + reference = &internal.AnyValue_StringValueStrindex{} + } + reference.StringValueStrindex = index + value.Value = reference + case *internal.AnyValue_KvlistValue: + if original.KvlistValue != nil { + return ConvertProfilesKeyValuesToReferences(getStringIndex, original.KvlistValue.Values) + } + case *internal.AnyValue_ArrayValue: + if original.ArrayValue != nil { + for i := range original.ArrayValue.Values { + if err := ConvertProfilesAnyValueToReference(getStringIndex, &original.ArrayValue.Values[i]); err != nil { + return err + } + } + } + } + return nil +} + +// ResolveProfilesKeyValueReferences resolves attribute dictionary references. +func ResolveProfilesKeyValueReferences(stringTable []string, keyValues []internal.KeyValue) error { + for i := range keyValues { + keyValue := &keyValues[i] + if keyValue.Key != "" && keyValue.KeyStrindex != 0 { + return fmt.Errorf("attribute %d has both key and key_strindex set", i) + } + if keyValue.KeyStrindex < 0 || (keyValue.KeyStrindex > 0 && int(keyValue.KeyStrindex) >= len(stringTable)) { + return fmt.Errorf("attribute %d has invalid key_strindex %d", i, keyValue.KeyStrindex) + } + if keyValue.KeyStrindex > 0 { + keyValue.Key = stringTable[keyValue.KeyStrindex] + keyValue.KeyStrindex = 0 + } + if err := ResolveProfilesAnyValueReference(stringTable, &keyValue.Value); err != nil { + return fmt.Errorf("attribute %d value: %w", i, err) + } + } + return nil +} + +// ResolveProfilesAnyValueReference resolves string references recursively in an attribute value. +func ResolveProfilesAnyValueReference(stringTable []string, value *internal.AnyValue) error { + switch original := value.Value.(type) { + case *internal.AnyValue_StringValueStrindex: + if original.StringValueStrindex < 0 || int(original.StringValueStrindex) >= len(stringTable) { + return fmt.Errorf("invalid string_value_strindex %d", original.StringValueStrindex) + } + var resolved *internal.AnyValue_StringValue + if metadata.PdataUseProtoPoolingFeatureGate.IsEnabled() { + resolved = internal.ProtoPoolAnyValue_StringValue.Get().(*internal.AnyValue_StringValue) + } else { + resolved = &internal.AnyValue_StringValue{} + } + resolved.StringValue = stringTable[original.StringValueStrindex] + value.Value = resolved + case *internal.AnyValue_KvlistValue: + if original.KvlistValue != nil { + return ResolveProfilesKeyValueReferences(stringTable, original.KvlistValue.Values) + } + case *internal.AnyValue_ArrayValue: + if original.ArrayValue != nil { + for i := range original.ArrayValue.Values { + if err := ResolveProfilesAnyValueReference(stringTable, &original.ArrayValue.Values[i]); err != nil { + return fmt.Errorf("array value %d: %w", i, err) + } + } + } + } + return nil +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/otlp/profiles_version.go b/vendor/go.opentelemetry.io/collector/pdata/internal/otlp/profiles_version.go new file mode 100644 index 00000000000..59884b92c58 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/otlp/profiles_version.go @@ -0,0 +1,31 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package otlp // import "go.opentelemetry.io/collector/pdata/internal/otlp" + +import "fmt" + +// ProfilesDevelopmentVersion is the version of the Profiles schema compiled into pdata. +// Update it when adopting an incompatible schema change from opentelemetry-proto. +const ProfilesDevelopmentVersion = "1" + +// ProfilesDevelopmentVersionHeader is the OTLP Profiles development version metadata key. +const ProfilesDevelopmentVersionHeader = "otlp-profiles-development-version" + +// ValidateProfilesDevelopmentVersion checks all values of the request metadata. +// Missing metadata identifies version 1, including after pdata adopts a later version. +func ValidateProfilesDevelopmentVersion(values []string) error { + if len(values) > 1 { + return fmt.Errorf("%s must contain exactly one value", ProfilesDevelopmentVersionHeader) + } + version := "1" + if len(values) == 1 { + version = values[0] + } + // An exact match also rejects malformed values, including empty strings, + // leading zeros, and comma-separated values combined by an HTTP intermediary. + if version != ProfilesDevelopmentVersion { + return fmt.Errorf("invalid or unsupported %s: supported version is %s", ProfilesDevelopmentVersionHeader, ProfilesDevelopmentVersion) + } + return nil +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/profileid.go b/vendor/go.opentelemetry.io/collector/pdata/internal/profileid.go index 5a038fe0854..a1a23fcdefd 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/profileid.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/profileid.go @@ -24,7 +24,7 @@ func CopyProfileID(dest, src *ProfileID) { *dest = *src } -// IsEmpty returns true if id contains at leas one non-zero byte. +// IsEmpty returns true if id doesn't contain at least one non-zero byte. func (pid ProfileID) IsEmpty() bool { return pid == [profileIDSize]byte{} } diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/spanid.go b/vendor/go.opentelemetry.io/collector/pdata/internal/spanid.go index 9ec0f465fb0..8c6245b41bb 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/spanid.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/spanid.go @@ -24,7 +24,7 @@ func CopySpanID(dest, src *SpanID) { *dest = *src } -// IsEmpty returns true if id contains at least one non-zero byte. +// IsEmpty returns true if id doesn't contain at least one non-zero byte. func (sid SpanID) IsEmpty() bool { return sid == [spanIDSize]byte{} } diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/traceid.go b/vendor/go.opentelemetry.io/collector/pdata/internal/traceid.go index fe54123de6d..1e48cfc46e4 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/traceid.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/traceid.go @@ -24,7 +24,7 @@ func CopyTraceID(dest, src *TraceID) { *dest = *src } -// IsEmpty returns true if id contains at leas one non-zero byte. +// IsEmpty returns true if id doesn't contain at least one non-zero byte. func (tid TraceID) IsEmpty() bool { return tid == [traceIDSize]byte{} } diff --git a/vendor/go.opentelemetry.io/collector/pdata/pcommon/map.go b/vendor/go.opentelemetry.io/collector/pdata/pcommon/map.go index b5d94967c28..a586bab65f9 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pcommon/map.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pcommon/map.go @@ -73,7 +73,8 @@ func (m Map) Get(key string) (Value, bool) { } // Remove removes the entry associated with the key and returns true if the key -// was present in the map, otherwise returns false. +// was present in the map, otherwise returns false. Removing an entry +// invalidates any Value previously returned by Get from this Map. func (m Map) Remove(key string) bool { m.getState().AssertMutable() for i := range *m.getOrig() { diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/LICENSE b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/LICENSE index 261eeb9e9f8..f1aee0f1100 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/LICENSE +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/LICENSE @@ -199,3 +199,33 @@ 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. + +-------------------------------------------------------------------------------- + +Copyright 2009 The Go Authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google LLC nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/config.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/config.go index 296407f38e1..7ba1b654f8d 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/config.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/config.go @@ -1,16 +1,19 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" +package otelgrpc import ( - "google.golang.org/grpc/stats" + "context" + "os" + "strings" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/propagation" "go.opentelemetry.io/otel/trace" + "google.golang.org/grpc/stats" ) // ScopeName is the instrumentation scope name. @@ -28,19 +31,33 @@ type InterceptorFilter func(*InterceptorInfo) bool // A Filter must return true if the request should be instrumented. type Filter func(*stats.RPCTagInfo) bool +type semconvMode int + +const ( + semconvModeNew semconvMode = iota // Default + semconvModeOld + semconvModeDup +) + // config is a group of options for this instrumentation. type config struct { - Filter Filter - InterceptorFilter InterceptorFilter - Propagators propagation.TextMapPropagator - TracerProvider trace.TracerProvider - MeterProvider metric.MeterProvider - SpanStartOptions []trace.SpanStartOption - SpanAttributes []attribute.KeyValue - MetricAttributes []attribute.KeyValue + Filter Filter + InterceptorFilter InterceptorFilter + Propagators propagation.TextMapPropagator + TracerProvider trace.TracerProvider + MeterProvider metric.MeterProvider + SpanKind trace.SpanKind + SpanAttributes []attribute.KeyValue + MetricAttributes []attribute.KeyValue + MetricAttributesFn func(ctx context.Context) []attribute.KeyValue + + PublicEndpoint bool + PublicEndpointFn func(ctx context.Context, info *stats.RPCTagInfo) bool ReceivedEvent bool SentEvent bool + + semconvMode semconvMode } // Option applies an option value for a config. @@ -48,91 +65,113 @@ type Option interface { apply(*config) } +type optionFunc func(*config) + +func (f optionFunc) apply(c *config) { + f(c) +} + // newConfig returns a config configured with all the passed Options. func newConfig(opts []Option) *config { c := &config{ Propagators: otel.GetTextMapPropagator(), TracerProvider: otel.GetTracerProvider(), MeterProvider: otel.GetMeterProvider(), + semconvMode: parseSemconvMode(), } for _, o := range opts { o.apply(c) } + return c } -type propagatorsOption struct{ p propagation.TextMapPropagator } - -func (o propagatorsOption) apply(c *config) { - if o.p != nil { - c.Propagators = o.p +func parseSemconvMode() semconvMode { + val := os.Getenv("OTEL_SEMCONV_STABILITY_OPT_IN") + if val == "" { + return semconvModeNew + } + parts := strings.SplitSeq(val, ",") + for p := range parts { + p = strings.TrimSpace(p) + if p == "rpc/dup" { + return semconvModeDup + } + if p == "rpc/old" { + return semconvModeOld + } } + return semconvModeNew } -// WithPropagators returns an Option to use the Propagators when extracting -// and injecting trace context from requests. -func WithPropagators(p propagation.TextMapPropagator) Option { - return propagatorsOption{p: p} +// WithPublicEndpoint configures the Handler to link the span with an incoming +// span context. If this option is not provided, then the association is a child +// association instead of a link. +func WithPublicEndpoint() Option { + return optionFunc(func(c *config) { + c.PublicEndpoint = true + }) } -type tracerProviderOption struct{ tp trace.TracerProvider } +// WithPublicEndpointFn runs with every request, and allows conditionally +// configuring the Handler to link the span with an incoming span context. If +// this option is not provided or returns false, then the association is a +// child association instead of a link. +// Note: WithPublicEndpoint takes precedence over WithPublicEndpointFn. +func WithPublicEndpointFn(fn func(context.Context, *stats.RPCTagInfo) bool) Option { + return optionFunc(func(c *config) { + c.PublicEndpointFn = fn + }) +} -func (o tracerProviderOption) apply(c *config) { - if o.tp != nil { - c.TracerProvider = o.tp - } +// WithPropagators returns an Option to use the Propagators when extracting +// and injecting trace context from requests. +func WithPropagators(p propagation.TextMapPropagator) Option { + return optionFunc(func(c *config) { + if p != nil { + c.Propagators = p + } + }) } // WithInterceptorFilter returns an Option to use the request filter. // // Deprecated: Use stats handlers instead. func WithInterceptorFilter(f InterceptorFilter) Option { - return interceptorFilterOption{f: f} -} - -type interceptorFilterOption struct { - f InterceptorFilter -} - -func (o interceptorFilterOption) apply(c *config) { - if o.f != nil { - c.InterceptorFilter = o.f - } + return optionFunc(func(c *config) { + if f != nil { + c.InterceptorFilter = f + } + }) } // WithFilter returns an Option to use the request filter. func WithFilter(f Filter) Option { - return filterOption{f: f} -} - -type filterOption struct { - f Filter -} - -func (o filterOption) apply(c *config) { - if o.f != nil { - c.Filter = o.f - } + return optionFunc(func(c *config) { + if f != nil { + c.Filter = f + } + }) } // WithTracerProvider returns an Option to use the TracerProvider when // creating a Tracer. func WithTracerProvider(tp trace.TracerProvider) Option { - return tracerProviderOption{tp: tp} -} - -type meterProviderOption struct{ mp metric.MeterProvider } - -func (o meterProviderOption) apply(c *config) { - if o.mp != nil { - c.MeterProvider = o.mp - } + return optionFunc(func(c *config) { + if tp != nil { + c.TracerProvider = tp + } + }) } // WithMeterProvider returns an Option to use the MeterProvider when // creating a Meter. If this option is not provide the global MeterProvider will be used. func WithMeterProvider(mp metric.MeterProvider) Option { - return meterProviderOption{mp: mp} + return optionFunc(func(c *config) { + if mp != nil { + c.MeterProvider = mp + } + }) } // Event type that can be recorded, see WithMessageEvents. @@ -144,21 +183,6 @@ const ( SentEvents ) -type messageEventsProviderOption struct { - events []Event -} - -func (m messageEventsProviderOption) apply(c *config) { - for _, e := range m.events { - switch e { - case ReceivedEvents: - c.ReceivedEvent = true - case SentEvents: - c.SentEvent = true - } - } -} - // WithMessageEvents configures the Handler to record the specified events // (span.AddEvent) on spans. By default only summary attributes are added at the // end of the request. @@ -167,43 +191,56 @@ func (m messageEventsProviderOption) apply(c *config) { // - ReceivedEvents: Record the number of bytes read after every gRPC read operation. // - SentEvents: Record the number of bytes written after every gRPC write operation. func WithMessageEvents(events ...Event) Option { - return messageEventsProviderOption{events: events} -} - -type spanStartOption struct{ opts []trace.SpanStartOption } - -func (o spanStartOption) apply(c *config) { - c.SpanStartOptions = append(c.SpanStartOptions, o.opts...) -} - -// WithSpanOptions configures an additional set of -// trace.SpanOptions, which are applied to each new span. -func WithSpanOptions(opts ...trace.SpanStartOption) Option { - return spanStartOption{opts} + return optionFunc(func(c *config) { + for _, e := range events { + switch e { + case ReceivedEvents: + c.ReceivedEvent = true + case SentEvents: + c.SentEvent = true + } + } + }) } -type spanAttributesOption struct{ a []attribute.KeyValue } - -func (o spanAttributesOption) apply(c *config) { - if o.a != nil { - c.SpanAttributes = o.a - } +// WithSpanKind returns an Option to set the span kind for spans created by +// the handler. +// +// By default, [NewServerHandler] creates spans with +// [trace.SpanKindServer] and [NewClientHandler] creates spans with +// [trace.SpanKindClient]. +func WithSpanKind(sk trace.SpanKind) Option { + return optionFunc(func(c *config) { + c.SpanKind = sk + }) } // WithSpanAttributes returns an Option to add custom attributes to the spans. func WithSpanAttributes(a ...attribute.KeyValue) Option { - return spanAttributesOption{a: a} -} - -type metricAttributesOption struct{ a []attribute.KeyValue } - -func (o metricAttributesOption) apply(c *config) { - if o.a != nil { - c.MetricAttributes = o.a - } + return optionFunc(func(c *config) { + if a != nil { + c.SpanAttributes = a + } + }) } // WithMetricAttributes returns an Option to add custom attributes to the metrics. func WithMetricAttributes(a ...attribute.KeyValue) Option { - return metricAttributesOption{a: a} + return optionFunc(func(c *config) { + if a != nil { + c.MetricAttributes = append(c.MetricAttributes, a...) + } + }) +} + +// WithMetricAttributesFn returns an Option to add dynamic custom attributes to the handler's metrics. +// The function is called once per RPC and the returned attributes are applied to all metrics recorded by this handler. +// +// The context parameter is the standard gRPC request context and provides access to request-scoped data. +func WithMetricAttributesFn(fn func(ctx context.Context) []attribute.KeyValue) Option { + return optionFunc(func(c *config) { + if fn != nil { + c.MetricAttributesFn = fn + } + }) } diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/doc.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/doc.go index b8b836b00fb..353e288bb69 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/doc.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/doc.go @@ -8,4 +8,4 @@ Use [NewClientHandler] with [grpc.WithStatsHandler] to instrument a gRPC client. Use [NewServerHandler] with [grpc.StatsHandler] to instrument a gRPC server. */ -package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" +package otelgrpc diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go index f63513d456c..c8065028e9c 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go @@ -1,319 +1,60 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" +package otelgrpc // gRPC tracing middleware -// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/rpc.md +// https://opentelemetry.io/docs/specs/semconv/rpc/ import ( - "context" - "errors" - "io" "net" + "net/url" "strconv" + "strings" - "google.golang.org/grpc" - grpc_codes "google.golang.org/grpc/codes" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/peer" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" - - "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" - semconv "go.opentelemetry.io/otel/semconv/v1.30.0" - "go.opentelemetry.io/otel/trace" -) - -type messageType attribute.KeyValue - -// Event adds an event of the messageType to the span associated with the -// passed context with a message id. -func (m messageType) Event(ctx context.Context, id int, _ interface{}) { - span := trace.SpanFromContext(ctx) - if !span.IsRecording() { - return - } - span.AddEvent("message", trace.WithAttributes( - attribute.KeyValue(m), - semconv.RPCMessageIDKey.Int(id), - )) -} - -var ( - messageSent = messageType(semconv.RPCMessageTypeSent) - messageReceived = messageType(semconv.RPCMessageTypeReceived) + semconv "go.opentelemetry.io/otel/semconv/v1.43.0" + grpc_codes "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" ) -// clientStream wraps around the embedded grpc.ClientStream, and intercepts the RecvMsg and -// SendMsg method call. -type clientStream struct { - grpc.ClientStream - desc *grpc.StreamDesc - - span trace.Span - - receivedEvent bool - sentEvent bool - - receivedMessageID int - sentMessageID int -} - -var _ = proto.Marshal - -func (w *clientStream) RecvMsg(m interface{}) error { - err := w.ClientStream.RecvMsg(m) - - if err == nil && !w.desc.ServerStreams { - w.endSpan(nil) - } else if errors.Is(err, io.EOF) { - w.endSpan(nil) - } else if err != nil { - w.endSpan(err) - } else { - w.receivedMessageID++ - - if w.receivedEvent { - messageReceived.Event(w.Context(), w.receivedMessageID, m) - } - } - - return err -} - -func (w *clientStream) SendMsg(m interface{}) error { - err := w.ClientStream.SendMsg(m) - - w.sentMessageID++ - - if w.sentEvent { - messageSent.Event(w.Context(), w.sentMessageID, m) - } - - if err != nil { - w.endSpan(err) - } - - return err -} - -func (w *clientStream) Header() (metadata.MD, error) { - md, err := w.ClientStream.Header() - if err != nil { - w.endSpan(err) - } - - return md, err -} - -func (w *clientStream) CloseSend() error { - err := w.ClientStream.CloseSend() - if err != nil { - w.endSpan(err) - } - - return err -} - -func wrapClientStream(s grpc.ClientStream, desc *grpc.StreamDesc, span trace.Span, cfg *config) *clientStream { - return &clientStream{ - ClientStream: s, - span: span, - desc: desc, - receivedEvent: cfg.ReceivedEvent, - sentEvent: cfg.SentEvent, - } -} - -func (w *clientStream) endSpan(err error) { - if err != nil { - s, _ := status.FromError(err) - w.span.SetStatus(codes.Error, s.Message()) - w.span.SetAttributes(statusCodeAttr(s.Code())) - } else { - w.span.SetAttributes(statusCodeAttr(grpc_codes.OK)) - } - - w.span.End() -} - -// StreamClientInterceptor returns a grpc.StreamClientInterceptor suitable -// for use in a grpc.NewClient call. +// serverAddrAttrsFromCanonicalTarget extracts server address attributes from a +// canonical gRPC target as returned by [google.golang.org/grpc.ClientConn.CanonicalTarget]. +// Canonical targets always have the form "scheme://[authority]/endpoint", e.g.: // -// Deprecated: Use [NewClientHandler] instead. -func StreamClientInterceptor(opts ...Option) grpc.StreamClientInterceptor { - cfg := newConfig(opts) - tracer := cfg.TracerProvider.Tracer( - ScopeName, - trace.WithInstrumentationVersion(Version()), - ) - - return func( - ctx context.Context, - desc *grpc.StreamDesc, - cc *grpc.ClientConn, - method string, - streamer grpc.Streamer, - callOpts ...grpc.CallOption, - ) (grpc.ClientStream, error) { - i := &InterceptorInfo{ - Method: method, - Type: StreamClient, - } - if cfg.InterceptorFilter != nil && !cfg.InterceptorFilter(i) { - return streamer(ctx, desc, cc, method, callOpts...) - } - - name, attr := telemetryAttributes(method, cc.Target()) - - startOpts := append([]trace.SpanStartOption{ - trace.WithSpanKind(trace.SpanKindClient), - trace.WithAttributes(attr...), - }, - cfg.SpanStartOptions..., - ) - - ctx, span := tracer.Start( - ctx, - name, - startOpts..., - ) - - ctx = inject(ctx, cfg.Propagators) - - s, err := streamer(ctx, desc, cc, method, callOpts...) - if err != nil { - grpcStatus, _ := status.FromError(err) - span.SetStatus(codes.Error, grpcStatus.Message()) - span.SetAttributes(statusCodeAttr(grpcStatus.Code())) - span.End() - return s, err +// passthrough:///127.0.0.1:7777 → ServerAddress("127.0.0.1"), ServerPort(7777) +// dns:///example.com:443 → ServerAddress("example.com"), ServerPort(443) +// dns://authority/example.com:443 → ServerAddress("example.com"), ServerPort(443) +// unix:///tmp/grpc.sock → ServerAddress("/tmp/grpc.sock") +func serverAddrAttrsFromCanonicalTarget(target string) []attribute.KeyValue { + // Fast path: confirmed host:port with numeric port, no scheme involved. + if h, pStr, err := net.SplitHostPort(target); err == nil { + if p, err := strconv.Atoi(pStr); err == nil { + return []attribute.KeyValue{ + semconv.ServerAddress(h), + semconv.ServerPort(p), + } } - stream := wrapClientStream(s, desc, span, cfg) - return stream, nil } -} - -// serverStream wraps around the embedded grpc.ServerStream, and intercepts the RecvMsg and -// SendMsg method call. -type serverStream struct { - grpc.ServerStream - ctx context.Context - - receivedMessageID int - sentMessageID int - - receivedEvent bool - sentEvent bool -} - -func (w *serverStream) Context() context.Context { - return w.ctx -} - -func (w *serverStream) RecvMsg(m interface{}) error { - err := w.ServerStream.RecvMsg(m) - - if err == nil { - w.receivedMessageID++ - if w.receivedEvent { - messageReceived.Event(w.Context(), w.receivedMessageID, m) - } + // gRPC URI: scheme://authority/endpoint → endpoint in Path + // scheme:endpoint → endpoint in Opaque + u, err := url.Parse(target) + if err != nil { + return []attribute.KeyValue{semconv.ServerAddress(target)} } - - return err -} - -func (w *serverStream) SendMsg(m interface{}) error { - err := w.ServerStream.SendMsg(m) - - w.sentMessageID++ - if w.sentEvent { - messageSent.Event(w.Context(), w.sentMessageID, m) + ep := u.Path + if u.Scheme != "unix" && u.Scheme != "unix-abstract" { + // Strip the leading "/" added by url.Parse for hierarchical URIs; + // preserve it for unix socket paths where the slash is meaningful. + ep = strings.TrimPrefix(ep, "/") } - - return err -} - -func wrapServerStream(ctx context.Context, ss grpc.ServerStream, cfg *config) *serverStream { - return &serverStream{ - ServerStream: ss, - ctx: ctx, - receivedEvent: cfg.ReceivedEvent, - sentEvent: cfg.SentEvent, + if ep == "" { + ep = u.Opaque } -} - -// StreamServerInterceptor returns a grpc.StreamServerInterceptor suitable -// for use in a grpc.NewServer call. -// -// Deprecated: Use [NewServerHandler] instead. -func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor { - cfg := newConfig(opts) - tracer := cfg.TracerProvider.Tracer( - ScopeName, - trace.WithInstrumentationVersion(Version()), - ) - - return func( - srv interface{}, - ss grpc.ServerStream, - info *grpc.StreamServerInfo, - handler grpc.StreamHandler, - ) error { - ctx := ss.Context() - i := &InterceptorInfo{ - StreamServerInfo: info, - Type: StreamServer, - } - if cfg.InterceptorFilter != nil && !cfg.InterceptorFilter(i) { - return handler(srv, wrapServerStream(ctx, ss, cfg)) - } - - ctx = extract(ctx, cfg.Propagators) - name, attr := telemetryAttributes(info.FullMethod, peerFromCtx(ctx)) - - startOpts := append([]trace.SpanStartOption{ - trace.WithSpanKind(trace.SpanKindServer), - trace.WithAttributes(attr...), - }, - cfg.SpanStartOptions..., - ) - - ctx, span := tracer.Start( - trace.ContextWithRemoteSpanContext(ctx, trace.SpanContextFromContext(ctx)), - name, - startOpts..., - ) - defer span.End() - - err := handler(srv, wrapServerStream(ctx, ss, cfg)) - if err != nil { - s, _ := status.FromError(err) - statusCode, msg := serverStatus(s) - span.SetStatus(statusCode, msg) - span.SetAttributes(statusCodeAttr(s.Code())) - } else { - span.SetAttributes(statusCodeAttr(grpc_codes.OK)) - } - - return err + if ep != "" { + return serverAddrAttrs(ep) } -} - -// telemetryAttributes returns a span name and span and metric attributes from -// the gRPC method and peer address. -func telemetryAttributes(fullMethod, sererAddr string) (string, []attribute.KeyValue) { - name, methodAttrs := internal.ParseFullMethod(fullMethod) - srvAttrs := serverAddrAttrs(sererAddr) - - attrs := make([]attribute.KeyValue, 0, 1+len(methodAttrs)+len(srvAttrs)) - attrs = append(attrs, semconv.RPCSystemGRPC) - attrs = append(attrs, methodAttrs...) - attrs = append(attrs, srvAttrs...) - return name, attrs + return []attribute.KeyValue{semconv.ServerAddress(target)} } // serverAddrAttrs returns the server address attributes for the hostport. @@ -333,20 +74,6 @@ func serverAddrAttrs(hostport string) []attribute.KeyValue { } } -// peerFromCtx returns a peer address from a context, if one exists. -func peerFromCtx(ctx context.Context) string { - p, ok := peer.FromContext(ctx) - if !ok { - return "" - } - return p.Addr.String() -} - -// statusCodeAttr returns status code attribute based on given gRPC code. -func statusCodeAttr(c grpc_codes.Code) attribute.KeyValue { - return semconv.RPCGRPCStatusCodeKey.Int64(int64(c)) -} - // serverStatus returns a span status code and message for a given gRPC // status code. It maps specific gRPC status codes to a corresponding span // status code and message. This function is intended for use on the server diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptorinfo.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptorinfo.go index b62f7cd7c46..7a3083f3cad 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptorinfo.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptorinfo.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" +package otelgrpc import ( "google.golang.org/grpc" diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go index 1fa73c2f943..aa4bbfa4ac7 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go @@ -2,13 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 // Package internal provides internal functionality for the otelgrpc package. -package internal // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal" +package internal import ( "strings" "go.opentelemetry.io/otel/attribute" - semconv "go.opentelemetry.io/otel/semconv/v1.30.0" + oldsemconv "go.opentelemetry.io/otel/semconv/v1.37.0" //nolint:depguard // Use of v1.37.0 is required for backward compatibility stability opt-in. + semconv "go.opentelemetry.io/otel/semconv/v1.43.0" ) // ParseFullMethod returns a span name following the OpenTelemetry semantic @@ -23,19 +24,30 @@ func ParseFullMethod(fullMethod string) (string, []attribute.KeyValue) { return fullMethod, nil } name := fullMethod[1:] - pos := strings.LastIndex(name, "/") - if pos < 0 { - // Invalid format, does not follow `/package.service/method`. - return name, nil - } - service, method := name[:pos], name[pos+1:] + return name, []attribute.KeyValue{semconv.RPCMethod(name)} +} - var attrs []attribute.KeyValue - if service != "" { - attrs = append(attrs, semconv.RPCService(service)) +// ParseFullMethodOld returns a span name following the old OpenTelemetry semantic +// conventions as well as all applicable span attribute.KeyValue attributes based +// on a gRPC's FullMethod. +// Based on the implementation in: +// https://github.com/open-telemetry/opentelemetry-go-contrib/blob/072dcf8ad7e5e48b506e05720b29d8b078759606/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go#L20 +func ParseFullMethodOld(fullMethod string) (string, []attribute.KeyValue) { + if !strings.HasPrefix(fullMethod, "/") { + return fullMethod, nil + } + name := fullMethod[1:] + parts := strings.Split(name, "/") + if len(parts) < 2 { + return name, []attribute.KeyValue{ + attribute.String("rpc.system", "grpc"), + } } - if method != "" { - attrs = append(attrs, semconv.RPCMethod(method)) + service := parts[0] + method := parts[1] + return name, []attribute.KeyValue{ + oldsemconv.RPCSystemKey.String("grpc"), + oldsemconv.RPCServiceKey.String(service), + oldsemconv.RPCMethodKey.String(method), } - return name, attrs } diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/metadata_supplier.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/metadata_supplier.go index 6e67f0216b0..6651e8bd804 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/metadata_supplier.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/metadata_supplier.go @@ -1,26 +1,23 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" +package otelgrpc import ( "context" - "google.golang.org/grpc/metadata" - - "go.opentelemetry.io/otel/baggage" "go.opentelemetry.io/otel/propagation" - "go.opentelemetry.io/otel/trace" + "google.golang.org/grpc/metadata" ) type metadataSupplier struct { - metadata *metadata.MD + metadata metadata.MD } // assert that metadataSupplier implements the TextMapCarrier interface. -var _ propagation.TextMapCarrier = &metadataSupplier{} +var _ propagation.TextMapCarrier = metadataSupplier{} -func (s *metadataSupplier) Get(key string) string { +func (s metadataSupplier) Get(key string) string { values := s.metadata.Get(key) if len(values) == 0 { return "" @@ -28,51 +25,27 @@ func (s *metadataSupplier) Get(key string) string { return values[0] } -func (s *metadataSupplier) Set(key string, value string) { +func (s metadataSupplier) Set(key, value string) { s.metadata.Set(key, value) } -func (s *metadataSupplier) Keys() []string { - out := make([]string, 0, len(*s.metadata)) - for key := range *s.metadata { +func (s metadataSupplier) Keys() []string { + out := make([]string, 0, len(s.metadata)) + for key := range s.metadata { out = append(out, key) } return out } -// Inject injects correlation context and span context into the gRPC -// metadata object. This function is meant to be used on outgoing -// requests. -// Deprecated: Unnecessary public func. -func Inject(ctx context.Context, md *metadata.MD, opts ...Option) { - c := newConfig(opts) - c.Propagators.Inject(ctx, &metadataSupplier{ - metadata: md, - }) -} - func inject(ctx context.Context, propagators propagation.TextMapPropagator) context.Context { md, ok := metadata.FromOutgoingContext(ctx) if !ok { md = metadata.MD{} } - propagators.Inject(ctx, &metadataSupplier{ - metadata: &md, - }) - return metadata.NewOutgoingContext(ctx, md) -} - -// Extract returns the correlation context and span context that -// another service encoded in the gRPC metadata object with Inject. -// This function is meant to be used on incoming requests. -// Deprecated: Unnecessary public func. -func Extract(ctx context.Context, md *metadata.MD, opts ...Option) (baggage.Baggage, trace.SpanContext) { - c := newConfig(opts) - ctx = c.Propagators.Extract(ctx, &metadataSupplier{ + propagators.Inject(ctx, metadataSupplier{ metadata: md, }) - - return baggage.FromContext(ctx), trace.SpanContextFromContext(ctx) + return metadata.NewOutgoingContext(ctx, md) } func extract(ctx context.Context, propagators propagation.TextMapPropagator) context.Context { @@ -81,7 +54,7 @@ func extract(ctx context.Context, propagators propagation.TextMapPropagator) con md = metadata.MD{} } - return propagators.Extract(ctx, &metadataSupplier{ - metadata: &md, + return propagators.Extract(ctx, metadataSupplier{ + metadata: md, }) } diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/stats_handler.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/stats_handler.go index 9bec51df339..1d0fc062262 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/stats_handler.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/stats_handler.go @@ -1,34 +1,37 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" +package otelgrpc import ( "context" - "sync/atomic" + "strconv" "time" - grpc_codes "google.golang.org/grpc/codes" - "google.golang.org/grpc/peer" - "google.golang.org/grpc/stats" - "google.golang.org/grpc/status" - "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/metric/noop" - semconv "go.opentelemetry.io/otel/semconv/v1.30.0" + oldrpcconv "go.opentelemetry.io/otel/semconv/v1.37.0/rpcconv" //nolint:depguard // Use of v1.37.0 is required for backward compatibility stability opt-in. + semconv "go.opentelemetry.io/otel/semconv/v1.43.0" + "go.opentelemetry.io/otel/semconv/v1.43.0/rpcconv" "go.opentelemetry.io/otel/trace" + grpc_codes "google.golang.org/grpc/codes" + "google.golang.org/grpc/stats" + "google.golang.org/grpc/status" + "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal" ) type gRPCContextKey struct{} +// dialTargetContextKey carries the dial target seeded by client interceptors +// so the stats handler can use the hostname for server.address instead of the +// post-DNS IP from RemoteAddr. +type dialTargetContextKey struct{} + type gRPCContext struct { - inMessages int64 - outMessages int64 metricAttrs []attribute.KeyValue record bool } @@ -38,87 +41,50 @@ type serverHandler struct { tracer trace.Tracer - duration metric.Float64Histogram - inSize metric.Int64Histogram - outSize metric.Int64Histogram - inMsg metric.Int64Histogram - outMsg metric.Int64Histogram + duration rpcconv.ServerCallDuration + oldDuration oldrpcconv.ServerDuration } // NewServerHandler creates a stats.Handler for a gRPC server. func NewServerHandler(opts ...Option) stats.Handler { c := newConfig(opts) + if c.SpanKind == trace.SpanKindUnspecified { + c.SpanKind = trace.SpanKindServer + } + h := &serverHandler{config: c} h.tracer = c.TracerProvider.Tracer( ScopeName, - trace.WithInstrumentationVersion(Version()), + trace.WithInstrumentationVersion(Version), ) meter := c.MeterProvider.Meter( ScopeName, - metric.WithInstrumentationVersion(Version()), + metric.WithInstrumentationVersion(Version), metric.WithSchemaURL(semconv.SchemaURL), ) var err error - h.duration, err = meter.Float64Histogram( - semconv.RPCServerDurationName, - metric.WithDescription(semconv.RPCServerDurationDescription), - metric.WithUnit(semconv.RPCServerDurationUnit), - ) - if err != nil { - otel.Handle(err) - if h.duration == nil { - h.duration = noop.Float64Histogram{} - } - } - - h.inSize, err = meter.Int64Histogram( - semconv.RPCServerRequestSizeName, - metric.WithDescription(semconv.RPCServerRequestSizeDescription), - metric.WithUnit(semconv.RPCServerRequestSizeUnit), - ) - if err != nil { - otel.Handle(err) - if h.inSize == nil { - h.inSize = noop.Int64Histogram{} - } - } - - h.outSize, err = meter.Int64Histogram( - semconv.RPCServerResponseSizeName, - metric.WithDescription(semconv.RPCServerResponseSizeDescription), - metric.WithUnit(semconv.RPCServerResponseSizeUnit), - ) - if err != nil { - otel.Handle(err) - if h.outSize == nil { - h.outSize = noop.Int64Histogram{} - } - } - - h.inMsg, err = meter.Int64Histogram( - semconv.RPCServerRequestsPerRPCName, - metric.WithDescription(semconv.RPCServerRequestsPerRPCDescription), - metric.WithUnit(semconv.RPCServerRequestsPerRPCUnit), - ) - if err != nil { - otel.Handle(err) - if h.inMsg == nil { - h.inMsg = noop.Int64Histogram{} + if c.semconvMode == semconvModeOld || c.semconvMode == semconvModeDup { + oldDur, err := oldrpcconv.NewServerDuration(meter) + if err != nil { + otel.Handle(err) + } else { + h.oldDuration = oldDur } } - h.outMsg, err = meter.Int64Histogram( - semconv.RPCServerResponsesPerRPCName, - metric.WithDescription(semconv.RPCServerResponsesPerRPCDescription), - metric.WithUnit(semconv.RPCServerResponsesPerRPCUnit), - ) - if err != nil { - otel.Handle(err) - if h.outMsg == nil { - h.outMsg = noop.Int64Histogram{} + if c.semconvMode == semconvModeNew || c.semconvMode == semconvModeDup { + h.duration, err = rpcconv.NewServerCallDuration( + meter, + metric.WithExplicitBucketBoundaries( + 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, + 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10, + ), + ) + if err != nil { + otel.Handle(err) } } @@ -126,20 +92,35 @@ func NewServerHandler(opts ...Option) stats.Handler { } // TagConn can attach some information to the given context. -func (h *serverHandler) TagConn(ctx context.Context, info *stats.ConnTagInfo) context.Context { +func (*serverHandler) TagConn(ctx context.Context, _ *stats.ConnTagInfo) context.Context { return ctx } // HandleConn processes the Conn stats. -func (h *serverHandler) HandleConn(ctx context.Context, info stats.ConnStats) { +func (*serverHandler) HandleConn(context.Context, stats.ConnStats) { } // TagRPC can attach some information to the given context. func (h *serverHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context { ctx = extract(ctx, h.Propagators) - name, attrs := internal.ParseFullMethod(info.FullMethodName) - attrs = append(attrs, semconv.RPCSystemGRPC) + var name string + var attrs []attribute.KeyValue + + switch h.semconvMode { + case semconvModeOld: + name, attrs = internal.ParseFullMethodOld(info.FullMethodName) + case semconvModeDup: + var attrsNew, attrsOld []attribute.KeyValue + name, attrsNew = internal.ParseFullMethod(info.FullMethodName) + _, attrsOld = internal.ParseFullMethodOld(info.FullMethodName) + // Combine both. We append New last so its rpc.method (fully qualified) wins when deduplicated. + attrs = append(append([]attribute.KeyValue{}, attrsOld...), attrsNew...) + attrs = append(attrs, semconv.RPCSystemNameGRPC) // New convention + default: // semconvModeNew + name, attrs = internal.ParseFullMethod(info.FullMethodName) + attrs = append(attrs, semconv.RPCSystemNameGRPC) + } record := true if h.Filter != nil { @@ -147,11 +128,24 @@ func (h *serverHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) cont } if record { + // Make a new slice to avoid aliasing into the same attrs slice used by metrics. + spanAttributes := make([]attribute.KeyValue, 0, len(attrs)+len(h.SpanAttributes)) + spanAttributes = append(append(spanAttributes, attrs...), h.SpanAttributes...) + opts := []trace.SpanStartOption{ + trace.WithSpanKind(h.SpanKind), + trace.WithAttributes(spanAttributes...), + } + if h.PublicEndpoint || (h.PublicEndpointFn != nil && h.PublicEndpointFn(ctx, info)) { + opts = append(opts, trace.WithNewRoot()) + // Linking incoming span context if any for public endpoint. + if s := trace.SpanContextFromContext(ctx); s.IsValid() && s.IsRemote() { + opts = append(opts, trace.WithLinks(trace.Link{SpanContext: s})) + } + } ctx, _ = h.tracer.Start( trace.ContextWithRemoteSpanContext(ctx, trace.SpanContextFromContext(ctx)), name, - trace.WithSpanKind(trace.SpanKindServer), - trace.WithAttributes(append(attrs, h.SpanAttributes...)...), + opts..., ) } @@ -160,12 +154,31 @@ func (h *serverHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) cont record: record, } + if h.MetricAttributesFn != nil { + extraAttrs := h.MetricAttributesFn(ctx) + gctx.metricAttrs = append(gctx.metricAttrs, extraAttrs...) + } + return context.WithValue(ctx, gRPCContextKey{}, &gctx) } // HandleRPC processes the RPC stats. func (h *serverHandler) HandleRPC(ctx context.Context, rs stats.RPCStats) { - h.handleRPC(ctx, rs, h.duration, h.inSize, h.outSize, h.inMsg, h.outMsg, serverStatus) + var dur metric.Float64Histogram + if h.semconvMode == semconvModeNew || h.semconvMode == semconvModeDup { + dur = h.duration.Inst() + } + var oldDur metric.Float64Histogram + if h.semconvMode == semconvModeOld || h.semconvMode == semconvModeDup { + oldDur = h.oldDuration.Inst() + } + h.handleRPC( + ctx, + rs, + dur, + oldDur, + serverStatus, + ) } type clientHandler struct { @@ -173,87 +186,50 @@ type clientHandler struct { tracer trace.Tracer - duration metric.Float64Histogram - inSize metric.Int64Histogram - outSize metric.Int64Histogram - inMsg metric.Int64Histogram - outMsg metric.Int64Histogram + duration rpcconv.ClientCallDuration + oldDuration oldrpcconv.ClientDuration } // NewClientHandler creates a stats.Handler for a gRPC client. func NewClientHandler(opts ...Option) stats.Handler { c := newConfig(opts) + if c.SpanKind == trace.SpanKindUnspecified { + c.SpanKind = trace.SpanKindClient + } + h := &clientHandler{config: c} h.tracer = c.TracerProvider.Tracer( ScopeName, - trace.WithInstrumentationVersion(Version()), + trace.WithInstrumentationVersion(Version), ) meter := c.MeterProvider.Meter( ScopeName, - metric.WithInstrumentationVersion(Version()), + metric.WithInstrumentationVersion(Version), metric.WithSchemaURL(semconv.SchemaURL), ) var err error - h.duration, err = meter.Float64Histogram( - semconv.RPCClientDurationName, - metric.WithDescription(semconv.RPCClientDurationDescription), - metric.WithUnit(semconv.RPCClientDurationUnit), - ) - if err != nil { - otel.Handle(err) - if h.duration == nil { - h.duration = noop.Float64Histogram{} - } - } - - h.outSize, err = meter.Int64Histogram( - semconv.RPCClientRequestSizeName, - metric.WithDescription(semconv.RPCClientRequestSizeDescription), - metric.WithUnit(semconv.RPCClientRequestSizeUnit), - ) - if err != nil { - otel.Handle(err) - if h.outSize == nil { - h.outSize = noop.Int64Histogram{} - } - } - - h.inSize, err = meter.Int64Histogram( - semconv.RPCClientResponseSizeName, - metric.WithDescription(semconv.RPCClientResponseSizeDescription), - metric.WithUnit(semconv.RPCClientResponseSizeUnit), - ) - if err != nil { - otel.Handle(err) - if h.inSize == nil { - h.inSize = noop.Int64Histogram{} - } - } - - h.outMsg, err = meter.Int64Histogram( - semconv.RPCClientRequestsPerRPCName, - metric.WithDescription(semconv.RPCClientRequestsPerRPCDescription), - metric.WithUnit(semconv.RPCClientRequestsPerRPCUnit), - ) - if err != nil { - otel.Handle(err) - if h.outMsg == nil { - h.outMsg = noop.Int64Histogram{} + if c.semconvMode == semconvModeOld || c.semconvMode == semconvModeDup { + oldDur, err := oldrpcconv.NewClientDuration(meter) + if err != nil { + otel.Handle(err) + } else { + h.oldDuration = oldDur } } - h.inMsg, err = meter.Int64Histogram( - semconv.RPCClientResponsesPerRPCName, - metric.WithDescription(semconv.RPCClientResponsesPerRPCDescription), - metric.WithUnit(semconv.RPCClientResponsesPerRPCUnit), - ) - if err != nil { - otel.Handle(err) - if h.inMsg == nil { - h.inMsg = noop.Int64Histogram{} + if c.semconvMode == semconvModeNew || c.semconvMode == semconvModeDup { + h.duration, err = rpcconv.NewClientCallDuration( + meter, + metric.WithExplicitBucketBoundaries( + 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, + 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10, + ), + ) + if err != nil { + otel.Handle(err) } } @@ -262,8 +238,23 @@ func NewClientHandler(opts ...Option) stats.Handler { // TagRPC can attach some information to the given context. func (h *clientHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context { - name, attrs := internal.ParseFullMethod(info.FullMethodName) - attrs = append(attrs, semconv.RPCSystemGRPC) + var name string + var attrs []attribute.KeyValue + + switch h.semconvMode { + case semconvModeOld: + name, attrs = internal.ParseFullMethodOld(info.FullMethodName) + case semconvModeDup: + var attrsNew, attrsOld []attribute.KeyValue + name, attrsNew = internal.ParseFullMethod(info.FullMethodName) + _, attrsOld = internal.ParseFullMethodOld(info.FullMethodName) + // Combine both. We append New last so its rpc.method (fully qualified) wins when deduplicated. + attrs = append(append([]attribute.KeyValue{}, attrsOld...), attrsNew...) + attrs = append(attrs, semconv.RPCSystemNameGRPC) // New convention + default: // semconvModeNew + name, attrs = internal.ParseFullMethod(info.FullMethodName) + attrs = append(attrs, semconv.RPCSystemNameGRPC) + } record := true if h.Filter != nil { @@ -271,11 +262,14 @@ func (h *clientHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) cont } if record { + // Make a new slice to avoid aliasing into the same attrs slice used by metrics. + spanAttributes := make([]attribute.KeyValue, 0, len(attrs)+len(h.SpanAttributes)) + spanAttributes = append(append(spanAttributes, attrs...), h.SpanAttributes...) ctx, _ = h.tracer.Start( ctx, name, - trace.WithSpanKind(trace.SpanKindClient), - trace.WithAttributes(append(attrs, h.SpanAttributes...)...), + trace.WithSpanKind(h.SpanKind), + trace.WithAttributes(spanAttributes...), ) } @@ -284,13 +278,29 @@ func (h *clientHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) cont record: record, } + if h.MetricAttributesFn != nil { + extraAttrs := h.MetricAttributesFn(ctx) + gctx.metricAttrs = append(gctx.metricAttrs, extraAttrs...) + } + return inject(context.WithValue(ctx, gRPCContextKey{}, &gctx), h.Propagators) } // HandleRPC processes the RPC stats. func (h *clientHandler) HandleRPC(ctx context.Context, rs stats.RPCStats) { + var dur metric.Float64Histogram + if h.semconvMode == semconvModeNew || h.semconvMode == semconvModeDup { + dur = h.duration.Inst() + } + var oldDur metric.Float64Histogram + if h.semconvMode == semconvModeOld || h.semconvMode == semconvModeDup { + oldDur = h.oldDuration.Inst() + } h.handleRPC( - ctx, rs, h.duration, h.inSize, h.outSize, h.inMsg, h.outMsg, + ctx, + rs, + dur, + oldDur, func(s *status.Status) (codes.Code, string) { return codes.Error, s.Message() }, @@ -298,20 +308,20 @@ func (h *clientHandler) HandleRPC(ctx context.Context, rs stats.RPCStats) { } // TagConn can attach some information to the given context. -func (h *clientHandler) TagConn(ctx context.Context, info *stats.ConnTagInfo) context.Context { +func (*clientHandler) TagConn(ctx context.Context, _ *stats.ConnTagInfo) context.Context { return ctx } // HandleConn processes the Conn stats. -func (h *clientHandler) HandleConn(context.Context, stats.ConnStats) { +func (*clientHandler) HandleConn(context.Context, stats.ConnStats) { // no-op } -func (c *config) handleRPC( +func (*config) handleRPC( ctx context.Context, rs stats.RPCStats, duration metric.Float64Histogram, - inSize, outSize, inMsg, outMsg metric.Int64Histogram, + oldDuration metric.Float64Histogram, recordStatus func(*status.Status) (codes.Code, string), ) { gctx, _ := ctx.Value(gRPCContextKey{}).(*gRPCContext) @@ -320,47 +330,46 @@ func (c *config) handleRPC( } span := trace.SpanFromContext(ctx) - var messageId int64 switch rs := rs.(type) { case *stats.Begin: - case *stats.InPayload: - if gctx != nil { - messageId = atomic.AddInt64(&gctx.inMessages, 1) - inSize.Record(ctx, int64(rs.Length), metric.WithAttributes(gctx.metricAttrs...)) + // Set server.address early from the dial target when available (upcoming + // interceptors will seed this). Covers both success and failure paths since Begin + // fires on every RPC regardless of outcome. + if rs.Client { + if target, ok := ctx.Value(dialTargetContextKey{}).(string); ok && target != "" { + attrs := serverAddrAttrsFromCanonicalTarget(target) + if span.IsRecording() { + span.SetAttributes(attrs...) + } + if gctx != nil { + gctx.metricAttrs = append(gctx.metricAttrs, attrs...) + } + } } - - if c.ReceivedEvent && span.IsRecording() { - span.AddEvent("message", - trace.WithAttributes( - semconv.RPCMessageTypeReceived, - semconv.RPCMessageIDKey.Int64(messageId), - semconv.RPCMessageCompressedSizeKey.Int(rs.CompressedLength), - semconv.RPCMessageUncompressedSizeKey.Int(rs.Length), - ), - ) + case *stats.InPayload: + case *stats.InHeader: + if !rs.Client && rs.LocalAddr != nil { + if span.IsRecording() { + span.SetAttributes(serverAddrAttrs(rs.LocalAddr.String())...) + } + // TODO: add server.address and server.port to metrics once the API supports opt-in attributes. } case *stats.OutPayload: - if gctx != nil { - messageId = atomic.AddInt64(&gctx.outMessages, 1) - outSize.Record(ctx, int64(rs.Length), metric.WithAttributes(gctx.metricAttrs...)) - } - - if c.SentEvent && span.IsRecording() { - span.AddEvent("message", - trace.WithAttributes( - semconv.RPCMessageTypeSent, - semconv.RPCMessageIDKey.Int64(messageId), - semconv.RPCMessageCompressedSizeKey.Int(rs.CompressedLength), - semconv.RPCMessageUncompressedSizeKey.Int(rs.Length), - ), - ) - } case *stats.OutTrailer: case *stats.OutHeader: - if span.IsRecording() { - if p, ok := peer.FromContext(ctx); ok { - span.SetAttributes(serverAddrAttrs(p.Addr.String())...) + // Only use the resolved IP from RemoteAddr when no dial target was seeded + // (i.e. NewClientHandler callers without interceptors). When dialTargetContextKey + // is present, Begin already set server.address to the hostname. + if rs.Client && rs.RemoteAddr != nil && (span.IsRecording() || gctx != nil) { + if target, ok := ctx.Value(dialTargetContextKey{}).(string); !ok || target == "" { + attrs := serverAddrAttrs(rs.RemoteAddr.String()) + if span.IsRecording() { + span.SetAttributes(attrs...) + } + if gctx != nil { + gctx.metricAttrs = append(gctx.metricAttrs, attrs...) + } } } case *stats.End: @@ -369,9 +378,9 @@ func (c *config) handleRPC( var s *status.Status if rs.Error != nil { s, _ = status.FromError(rs.Error) - rpcStatusAttr = semconv.RPCGRPCStatusCodeKey.Int(int(s.Code())) + rpcStatusAttr = semconv.RPCResponseStatusCode(canonicalString(s.Code())) } else { - rpcStatusAttr = semconv.RPCGRPCStatusCodeKey.Int(int(grpc_codes.OK)) + rpcStatusAttr = semconv.RPCResponseStatusCode(canonicalString(grpc_codes.OK)) } if span.IsRecording() { if s != nil { @@ -382,25 +391,83 @@ func (c *config) handleRPC( span.End() } - var metricAttrs []attribute.KeyValue - if gctx != nil { - metricAttrs = make([]attribute.KeyValue, 0, len(gctx.metricAttrs)+1) - metricAttrs = append(metricAttrs, gctx.metricAttrs...) + var durationEnabled bool + var oldDurationEnabled bool + + if duration != nil { + durationEnabled = duration.Enabled(ctx) } - metricAttrs = append(metricAttrs, rpcStatusAttr) - // Allocate vararg slice once. - recordOpts := []metric.RecordOption{metric.WithAttributeSet(attribute.NewSet(metricAttrs...))} - - // Use floating point division here for higher precision (instead of Millisecond method). - // Measure right before calling Record() to capture as much elapsed time as possible. - elapsedTime := float64(rs.EndTime.Sub(rs.BeginTime)) / float64(time.Millisecond) - - duration.Record(ctx, elapsedTime, recordOpts...) - if gctx != nil { - inMsg.Record(ctx, atomic.LoadInt64(&gctx.inMessages), recordOpts...) - outMsg.Record(ctx, atomic.LoadInt64(&gctx.outMessages), recordOpts...) + if oldDuration != nil { + oldDurationEnabled = oldDuration.Enabled(ctx) + } + + if durationEnabled || oldDurationEnabled { + var metricAttrs []attribute.KeyValue + if gctx != nil { + // Don't use gctx.metricAttrSet here, because it requires passing + // multiple RecordOptions, which would call metric.mergeSets and + // allocate a new set for each Record call. + metricAttrs = make([]attribute.KeyValue, 0, len(gctx.metricAttrs)+1) + metricAttrs = append(metricAttrs, gctx.metricAttrs...) + } + metricAttrs = append(metricAttrs, rpcStatusAttr) + // Allocate vararg slice once. + recordOpts := []metric.RecordOption{metric.WithAttributeSet(attribute.NewSet(metricAttrs...))} + + // Use floating point division here for higher precision (instead of Millisecond method). + // Measure right before calling Record() to capture as much elapsed time as possible. + elapsedTime := float64(rs.EndTime.Sub(rs.BeginTime)) / float64(time.Second) + + if durationEnabled { + duration.Record(ctx, elapsedTime, recordOpts...) + } + if oldDurationEnabled { + oldDuration.Record(ctx, elapsedTime*1000.0, recordOpts...) + } } + default: return } } + +func canonicalString(code grpc_codes.Code) string { + switch code { + case grpc_codes.OK: + return "OK" + case grpc_codes.Canceled: + return "CANCELLED" + case grpc_codes.Unknown: + return "UNKNOWN" + case grpc_codes.InvalidArgument: + return "INVALID_ARGUMENT" + case grpc_codes.DeadlineExceeded: + return "DEADLINE_EXCEEDED" + case grpc_codes.NotFound: + return "NOT_FOUND" + case grpc_codes.AlreadyExists: + return "ALREADY_EXISTS" + case grpc_codes.PermissionDenied: + return "PERMISSION_DENIED" + case grpc_codes.ResourceExhausted: + return "RESOURCE_EXHAUSTED" + case grpc_codes.FailedPrecondition: + return "FAILED_PRECONDITION" + case grpc_codes.Aborted: + return "ABORTED" + case grpc_codes.OutOfRange: + return "OUT_OF_RANGE" + case grpc_codes.Unimplemented: + return "UNIMPLEMENTED" + case grpc_codes.Internal: + return "INTERNAL" + case grpc_codes.Unavailable: + return "UNAVAILABLE" + case grpc_codes.DataLoss: + return "DATA_LOSS" + case grpc_codes.Unauthenticated: + return "UNAUTHENTICATED" + default: + return "CODE(" + strconv.FormatInt(int64(code), 10) + ")" + } +} diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/version.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/version.go index b1feeca494f..23fda6f503b 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/version.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/version.go @@ -1,10 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" +package otelgrpc // Version is the current release version of the gRPC instrumentation. -func Version() string { - return "0.61.0" - // This string is updated by the pre_release.sh script during release -} +const Version = "0.70.0" diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go index 3ae08243441..733b75dca75 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" +package otelhttp import ( "net/http" diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go index a7d4b2a815c..08ba0778f6d 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" +package otelhttp import ( "context" diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/doc.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/doc.go index 1c9aa3ff425..09a2103fe46 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/doc.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/doc.go @@ -3,4 +3,4 @@ // Package otelhttp provides an http.Handler and functions that are intended // to be used to add tracing by wrapping existing handlers. -package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" +package otelhttp diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go index 204588b849a..844363a0908 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" +package otelhttp import ( "net/http" diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/body_wrapper.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/body_wrapper.go index d032aa841b3..aeff4160467 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/body_wrapper.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/body_wrapper.go @@ -1,12 +1,12 @@ -// Code generated by gotmpl. DO NOT MODIFY. -// source: internal/shared/request/body_wrapper.go.tmpl - // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +// DO NOT MODIFY. Generated by gotmpl. +// source: internal/shared/request/body_wrapper.go.tmpl + // Package request provides types and functionality to handle HTTP request // handling. -package request // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request" +package request import ( "io" diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/gen.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/gen.go index 9e00dd2fcef..98f7bdbfcfd 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/gen.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/gen.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package request // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request" +package request // Generate request package: //go:generate gotmpl --body=../../../../../../internal/shared/request/body_wrapper.go.tmpl "--data={}" --out=body_wrapper.go diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/resp_writer_wrapper.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/resp_writer_wrapper.go index f29f9b7c962..6b523cb74fe 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/resp_writer_wrapper.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/resp_writer_wrapper.go @@ -1,10 +1,10 @@ -// Code generated by gotmpl. DO NOT MODIFY. -// source: internal/shared/request/resp_writer_wrapper.go.tmpl - // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package request // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request" +// DO NOT MODIFY. Generated by gotmpl. +// source: internal/shared/request/resp_writer_wrapper.go.tmpl + +package request import ( "net/http" diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/client.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/client.go index 0241b08e856..c275b5f0514 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/client.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/client.go @@ -1,12 +1,12 @@ -// Code generated by gotmpl. DO NOT MODIFY. -// source: internal/shared/semconv/client.go.tmpl - // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +// DO NOT MODIFY. Generated by gotmpl. +// source: internal/shared/semconv/client.go.tmpl + // Package semconv provides OpenTelemetry semantic convention types and // functionality. -package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv" +package semconv import ( "context" @@ -20,8 +20,8 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/semconv/v1.41.0" - "go.opentelemetry.io/otel/semconv/v1.41.0/httpconv" + semconv "go.opentelemetry.io/otel/semconv/v1.43.0" + "go.opentelemetry.io/otel/semconv/v1.43.0/httpconv" ) type HTTPClient struct { @@ -45,7 +45,7 @@ func NewHTTPClient(meter metric.Meter) HTTPClient { return client } -func (n HTTPClient) Status(code int) (codes.Code, string) { +func (HTTPClient) Status(code int) (codes.Code, string) { if code < 100 || code >= 600 { return codes.Error, fmt.Sprintf("Invalid HTTP status code %d", code) } @@ -120,9 +120,7 @@ func (n HTTPClient) RequestTraceAttrs(req *http.Request) []attribute.KeyValue { // Restore any username/password info that was removed. req.URL.User = userinfo } - attrs = append(attrs, semconv.URLFull(u)) - - attrs = append(attrs, semconv.ServerAddress(requestHost)) + attrs = append(attrs, semconv.URLFull(u), semconv.ServerAddress(requestHost)) if eligiblePort > 0 { attrs = append(attrs, semconv.ServerPort(eligiblePort)) } @@ -138,11 +136,13 @@ func (n HTTPClient) RequestTraceAttrs(req *http.Request) []attribute.KeyValue { } // ResponseTraceAttrs returns trace attributes for an HTTP response made by a client. -func (n HTTPClient) ResponseTraceAttrs(resp *http.Response) []attribute.KeyValue { +func (HTTPClient) ResponseTraceAttrs(resp *http.Response) []attribute.KeyValue { /* below attributes are returned: - http.response.status_code - error.type + - network.protocol.name (only when it is not "http") + - network.protocol.version */ var count int if resp.StatusCode > 0 { @@ -153,6 +153,21 @@ func (n HTTPClient) ResponseTraceAttrs(resp *http.Response) []attribute.KeyValue count++ } + // The protocol version is only known for certain once the response + // arrives: req.Proto reflects what the caller asked for, but the + // transport may negotiate a different version (for example HTTP/2 via + // ALPN). Report resp.Proto here so it overrides the request-time value + // on the span. As in RequestTraceAttrs, network.protocol.name is omitted + // when it is "http": the spec only requires it when the name differs from + // the protocol implied by http.request.method. + protoName, protoVersion := netProtocol(resp.Proto) + if protoName != "" && protoName != "http" { + count++ + } + if protoVersion != "" { + count++ + } + attrs := make([]attribute.KeyValue, 0, count) if resp.StatusCode > 0 { attrs = append(attrs, semconv.HTTPResponseStatusCode(resp.StatusCode)) @@ -162,10 +177,17 @@ func (n HTTPClient) ResponseTraceAttrs(resp *http.Response) []attribute.KeyValue errorType := strconv.Itoa(resp.StatusCode) attrs = append(attrs, semconv.ErrorTypeKey.String(errorType)) } + + if protoName != "" && protoName != "http" { + attrs = append(attrs, semconv.NetworkProtocolName(protoName)) + } + if protoVersion != "" { + attrs = append(attrs, semconv.NetworkProtocolVersion(protoVersion)) + } return attrs } -func (n HTTPClient) method(method string) (attribute.KeyValue, attribute.KeyValue) { +func (HTTPClient) method(method string) (attribute.KeyValue, attribute.KeyValue) { if method == "" { return semconv.HTTPRequestMethodOther, attribute.KeyValue{} } @@ -180,7 +202,7 @@ func (n HTTPClient) method(method string) (attribute.KeyValue, attribute.KeyValu return semconv.HTTPRequestMethodOther, orig } -func (n HTTPClient) MetricAttributes(req *http.Request, statusCode int, additionalAttributes []attribute.KeyValue) []attribute.KeyValue { +func (n HTTPClient) MetricAttributes(req *http.Request, resp *http.Response, statusCode int, additionalAttributes []attribute.KeyValue) []attribute.KeyValue { num := len(additionalAttributes) + 2 var h string if req.URL != nil { @@ -200,7 +222,14 @@ func (n HTTPClient) MetricAttributes(req *http.Request, statusCode int, addition num++ } - protoName, protoVersion := netProtocol(req.Proto) + // Prefer the negotiated protocol reported on the response: req.Proto is + // only what the caller asked for, and the transport may have upgraded + // the connection (for example HTTP/2 via ALPN). + proto := req.Proto + if resp != nil && resp.Proto != "" { + proto = resp.Proto + } + protoName, protoVersion := netProtocol(proto) if protoName != "" { num++ } @@ -213,7 +242,8 @@ func (n HTTPClient) MetricAttributes(req *http.Request, statusCode int, addition } attributes := slices.Grow(additionalAttributes, num) - attributes = append(attributes, + attributes = append( + attributes, semconv.HTTPRequestMethodKey.String(standardizeHTTPMethod(req.Method)), semconv.ServerAddress(requestHost), n.scheme(req), @@ -249,7 +279,7 @@ func (o MetricOpts) AddOptions() metric.AddOption { } func (n HTTPClient) MetricOptions(ma MetricAttributes) MetricOpts { - attributes := n.MetricAttributes(ma.Req, ma.StatusCode, ma.AdditionalAttributes) + attributes := n.MetricAttributes(ma.Req, ma.Resp, ma.StatusCode, ma.AdditionalAttributes) if ma.StatusCode == 0 && ma.Err != nil { attributes = append(attributes, n.ErrorType(ma.Err)) } @@ -269,12 +299,12 @@ func (n HTTPClient) MetricOptions(ma MetricAttributes) MetricOpts { // type per failure keeps attribute cardinality bounded, as required by the // OTel spec (error.type SHOULD have low cardinality). Callers that need // finer-grained error distinctions should inspect the error themselves. -func (n HTTPClient) ErrorType(err error) attribute.KeyValue { +func (HTTPClient) ErrorType(err error) attribute.KeyValue { t := reflect.TypeOf(err) if t == nil { return semconv.ErrorTypeOther } - if t.Kind() == reflect.Ptr { + if t.Kind() == reflect.Pointer { t = t.Elem() } var value string @@ -307,13 +337,13 @@ func (n HTTPClient) RecordMetrics(ctx context.Context, md MetricData, opts Metri } // TraceAttributes returns attributes for httptrace. -func (n HTTPClient) TraceAttributes(host string) []attribute.KeyValue { +func (HTTPClient) TraceAttributes(host string) []attribute.KeyValue { return []attribute.KeyValue{ semconv.ServerAddress(host), } } -func (n HTTPClient) scheme(req *http.Request) attribute.KeyValue { +func (HTTPClient) scheme(req *http.Request) attribute.KeyValue { if req.URL != nil && req.URL.Scheme != "" { return semconv.URLScheme(req.URL.Scheme) } diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/gen.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/gen.go index a8a0d58df35..fbcd4f6b230 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/gen.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/gen.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv" +package semconv // Generate semconv package: //go:generate gotmpl --body=../../../../../../internal/shared/semconv/bench_test.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=bench_test.go diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/server.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/server.go index 8e0430863d9..35e744e41d2 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/server.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/server.go @@ -1,12 +1,12 @@ -// Code generated by gotmpl. DO NOT MODIFY. -// source: internal/shared/semconv/server.go.tmpl - // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +// DO NOT MODIFY. Generated by gotmpl. +// source: internal/shared/semconv/server.go.tmpl + // Package semconv provides OpenTelemetry semantic convention types and // functionality. -package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv" +package semconv import ( "context" @@ -20,8 +20,8 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/semconv/v1.41.0" - "go.opentelemetry.io/otel/semconv/v1.41.0/httpconv" + semconv "go.opentelemetry.io/otel/semconv/v1.43.0" + "go.opentelemetry.io/otel/semconv/v1.43.0/httpconv" ) type RequestTraceAttrsOpts struct { @@ -67,7 +67,7 @@ func NewHTTPServer(meter metric.Meter) HTTPServer { // Status returns a span status code and message for an HTTP status code // value returned by a server. Status codes in the 400-499 range are not // returned as errors. -func (n HTTPServer) Status(code int) (codes.Code, string) { +func (HTTPServer) Status(code int) (codes.Code, string) { if code < 100 || code >= 600 { return codes.Error, fmt.Sprintf("Invalid HTTP status code %d", code) } @@ -168,7 +168,8 @@ func (n HTTPServer) RequestTraceAttrs(server string, req *http.Request, opts Req } attrs := make([]attribute.KeyValue, 0, count) - attrs = append(attrs, + attrs = append( + attrs, semconv.ServerAddress(host), method, scheme, @@ -216,7 +217,7 @@ func (n HTTPServer) RequestTraceAttrs(server string, req *http.Request, opts Req return attrs } -func (s HTTPServer) NetworkTransportAttr(network string) []attribute.KeyValue { +func (HTTPServer) NetworkTransportAttr(network string) []attribute.KeyValue { attr := semconv.NetworkTransportPipe switch network { case "tcp", "tcp4", "tcp6": @@ -239,7 +240,11 @@ type ServerMetricData struct { } type MetricAttributes struct { - Req *http.Request + Req *http.Request + // Resp is the client response, if any. It is only consulted by + // HTTPClient.MetricAttributes to source the negotiated protocol version; + // server-side metric recording ignores it. + Resp *http.Response StatusCode int Route string AdditionalAttributes []attribute.KeyValue @@ -274,7 +279,7 @@ func (n HTTPServer) RecordMetrics(ctx context.Context, md ServerMetricData) { // It returns "{method} {route}" when the request has a pattern, // or just "{method}" when no route is available. // Non-standard HTTP methods are replaced by "HTTP". -func (n HTTPServer) SpanName(r *http.Request) string { +func (HTTPServer) SpanName(r *http.Request) string { method := strings.ToUpper(r.Method) if _, ok := methodLookup[method]; !ok { method = "HTTP" @@ -287,7 +292,7 @@ func (n HTTPServer) SpanName(r *http.Request) string { return method } -func (n HTTPServer) method(method string) (attribute.KeyValue, attribute.KeyValue) { +func (HTTPServer) method(method string) (attribute.KeyValue, attribute.KeyValue) { if method == "" { return semconv.HTTPRequestMethodOther, attribute.KeyValue{} } @@ -314,7 +319,7 @@ func (n HTTPServer) scheme(https bool) attribute.KeyValue { //nolint:revive // i // // If any of the fields in the ResponseTelemetry are not set the attribute will // be omitted. -func (n HTTPServer) ResponseTraceAttrs(resp ResponseTelemetry) []attribute.KeyValue { +func (HTTPServer) ResponseTraceAttrs(resp ResponseTelemetry) []attribute.KeyValue { var count int if resp.ReadBytes > 0 { @@ -330,17 +335,20 @@ func (n HTTPServer) ResponseTraceAttrs(resp ResponseTelemetry) []attribute.KeyVa attributes := make([]attribute.KeyValue, 0, count) if resp.ReadBytes > 0 { - attributes = append(attributes, + attributes = append( + attributes, semconv.HTTPRequestBodySize(int(resp.ReadBytes)), ) } if resp.WriteBytes > 0 { - attributes = append(attributes, + attributes = append( + attributes, semconv.HTTPResponseBodySize(int(resp.WriteBytes)), ) } if resp.StatusCode > 0 { - attributes = append(attributes, + attributes = append( + attributes, semconv.HTTPResponseStatusCode(resp.StatusCode), ) } @@ -349,7 +357,7 @@ func (n HTTPServer) ResponseTraceAttrs(resp ResponseTelemetry) []attribute.KeyVa } // Route returns the attribute for the route. -func (n HTTPServer) Route(route string) attribute.KeyValue { +func (HTTPServer) Route(route string) attribute.KeyValue { return semconv.HTTPRoute(route) } diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go index d6842ed2ab5..0de0bd83c45 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go @@ -1,10 +1,10 @@ -// Code generated by gotmpl. DO NOT MODIFY. -// source: internal/shared/semconv/util.go.tmpl - // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv" +// DO NOT MODIFY. Generated by gotmpl. +// source: internal/shared/semconv/util.go.tmpl + +package semconv import ( "net" @@ -15,7 +15,7 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" - semconvNew "go.opentelemetry.io/otel/semconv/v1.41.0" + semconvNew "go.opentelemetry.io/otel/semconv/v1.43.0" ) // SplitHostPort splits a network address hostport of the form "host", @@ -32,29 +32,29 @@ func SplitHostPort(hostport string) (host string, port int) { addrEnd := strings.LastIndexByte(hostport, ']') if addrEnd < 0 { // Invalid hostport. - return + return host, port } if i := strings.LastIndexByte(hostport[addrEnd:], ':'); i < 0 { host = hostport[1:addrEnd] - return + return host, port } } else { if i := strings.LastIndexByte(hostport, ':'); i < 0 { host = hostport - return + return host, port } } host, pStr, err := net.SplitHostPort(hostport) if err != nil { - return + return host, port } p, err := strconv.ParseUint(pStr, 10, 16) if err != nil { - return + return host, port } - return host, int(p) //nolint:gosec // Byte size checked 16 above. + return host, int(p) } func requiredHTTPPort(https bool, port int) int { //nolint:revive // ignore linter @@ -84,7 +84,7 @@ func httpRoute(pattern string) string { return "" } -func netProtocol(proto string) (name string, version string) { +func netProtocol(proto string) (name, version string) { name, version, _ = strings.Cut(proto, "/") switch name { case "HTTP": diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/labeler.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/labeler.go index d62ce44b002..8362b824687 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/labeler.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/labeler.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" +package otelhttp import ( "context" diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/start_time_context.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/start_time_context.go index 9476ef01b01..9b6c0a889ba 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/start_time_context.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/start_time_context.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" +package otelhttp import ( "context" diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go index b15895cee22..82501eab325 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go @@ -1,10 +1,11 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" +package otelhttp import ( "context" + "fmt" "io" "net/http" "net/http/httptrace" @@ -15,7 +16,7 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/propagation" - otelsemconv "go.opentelemetry.io/otel/semconv/v1.41.0" + otelsemconv "go.opentelemetry.io/otel/semconv/v1.43.0" "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request" @@ -142,6 +143,9 @@ func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) { t.propagators.Inject(ctx, propagation.HeaderCarrier(r.Header)) res, err := t.rt.RoundTrip(r) + if err == nil { + res, err = ensureResponseBody(t.rt, r, res) + } // Record the metrics on error or no error. statusCode := 0 @@ -160,6 +164,7 @@ func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) { }, t.semconv.MetricOptions(semconv.MetricAttributes{ Req: r, + Resp: res, StatusCode: statusCode, Err: err, AdditionalAttributes: append(labeler.Get(), t.metricAttributesFromRequest(r)...), @@ -183,6 +188,20 @@ func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) { return res, nil } +func ensureResponseBody(rt http.RoundTripper, r *http.Request, res *http.Response) (*http.Response, error) { + switch { + case res == nil: + return nil, fmt.Errorf("http: RoundTripper implementation (%T) returned a nil *Response with a nil error", rt) + case res.Body != nil: + return res, nil + case res.ContentLength > 0 && r.Method != http.MethodHead: + return nil, fmt.Errorf("http: RoundTripper implementation (%T) returned a *Response with content length %d but a nil Body", rt, res.ContentLength) + default: + res.Body = http.NoBody + return res, nil + } +} + func (t *Transport) metricAttributesFromRequest(r *http.Request) []attribute.KeyValue { var attributeForRequest []attribute.KeyValue if t.metricAttributesFn != nil { diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go index 2feb885000f..b757d6e9d03 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" +package otelhttp // Version is the current release version of the otelhttp instrumentation. -const Version = "0.69.0" +const Version = "0.70.0" diff --git a/vendor/go.opentelemetry.io/contrib/propagators/aws/xray/idgenerator.go b/vendor/go.opentelemetry.io/contrib/propagators/aws/xray/idgenerator.go index df439448b57..7058ff45bfc 100644 --- a/vendor/go.opentelemetry.io/contrib/propagators/aws/xray/idgenerator.go +++ b/vendor/go.opentelemetry.io/contrib/propagators/aws/xray/idgenerator.go @@ -1,14 +1,13 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package xray // import "go.opentelemetry.io/contrib/propagators/aws/xray" +package xray import ( "context" - crand "crypto/rand" "encoding/binary" "encoding/hex" - "math/rand" + "math/rand/v2" "strconv" "sync" "time" @@ -18,19 +17,27 @@ import ( ) // IDGenerator is used for generating a new traceID and spanID. +// +// math/rand/v2's top-level generator is used instead of a per-instance +// math/rand.Rand seeded from crypto/rand: the former is safe for concurrent +// use without a mutex and, unlike a locally seeded math/rand.Rand, has no +// seed-read step that can silently fail and leave it deterministic. type IDGenerator struct { + // Mutex is embedded for backward compatibility but is not used internally. sync.Mutex - randSource *rand.Rand } var _ sdktrace.IDGenerator = &IDGenerator{} // NewSpanID returns a non-zero span ID from a randomly-chosen sequence. -func (gen *IDGenerator) NewSpanID(context.Context, trace.TraceID) trace.SpanID { - gen.Lock() - defer gen.Unlock() +func (gen *IDGenerator) NewSpanID(context.Context, trace.TraceID) trace.SpanID { //nolint:revive // ignore linter sid := trace.SpanID{} - _, _ = gen.randSource.Read(sid[:]) + for { + binary.NativeEndian.PutUint64(sid[:], rand.Uint64()) //nolint:gosec // G404: Use of weak random number generator (math/rand instead of crypto/rand) is ignored as this is not security-sensitive. + if sid.IsValid() { + break + } + } return sid } @@ -39,27 +46,26 @@ func (gen *IDGenerator) NewSpanID(context.Context, trace.TraceID) trace.SpanID { // - https://docs.aws.amazon.com/xray/latest/devguide/xray-api-sendingdata.html#xray-api-traceids // // span ID is from a randomly-chosen sequence. -func (gen *IDGenerator) NewIDs(context.Context) (trace.TraceID, trace.SpanID) { - gen.Lock() - defer gen.Unlock() - +func (gen *IDGenerator) NewIDs(context.Context) (trace.TraceID, trace.SpanID) { //nolint:revive // ignore linter tid := trace.TraceID{} currentTime := getCurrentTimeHex() copy(tid[:4], currentTime) - _, _ = gen.randSource.Read(tid[4:]) + binary.NativeEndian.PutUint64(tid[4:12], rand.Uint64()) //nolint:gosec // G404: Use of weak random number generator (math/rand instead of crypto/rand) is ignored as this is not security-sensitive. + binary.NativeEndian.PutUint32(tid[12:16], rand.Uint32()) //nolint:gosec // G404: Use of weak random number generator (math/rand instead of crypto/rand) is ignored as this is not security-sensitive. sid := trace.SpanID{} - _, _ = gen.randSource.Read(sid[:]) + for { + binary.NativeEndian.PutUint64(sid[:], rand.Uint64()) //nolint:gosec // G404: Use of weak random number generator (math/rand instead of crypto/rand) is ignored as this is not security-sensitive. + if sid.IsValid() { + break + } + } return tid, sid } // NewIDGenerator returns an IDGenerator reference used for sending traces to AWS X-Ray. func NewIDGenerator() *IDGenerator { - gen := &IDGenerator{} - var rngSeed int64 - _ = binary.Read(crand.Reader, binary.LittleEndian, &rngSeed) - gen.randSource = rand.New(rand.NewSource(rngSeed)) //nolint:gosec // G404: Use of weak random number generator (math/rand instead of crypto/rand) is ignored as this is not security-sensitive. - return gen + return &IDGenerator{} } func getCurrentTimeHex() []uint8 { diff --git a/vendor/go.opentelemetry.io/contrib/propagators/aws/xray/propagator.go b/vendor/go.opentelemetry.io/contrib/propagators/aws/xray/propagator.go index 8929bf05ff3..59f17c5ec41 100644 --- a/vendor/go.opentelemetry.io/contrib/propagators/aws/xray/propagator.go +++ b/vendor/go.opentelemetry.io/contrib/propagators/aws/xray/propagator.go @@ -3,7 +3,7 @@ // Package xray provides an OpenTelemetry propagator for the AWS XRAY // propagation format. -package xray // import "go.opentelemetry.io/contrib/propagators/aws/xray" +package xray import ( "context" diff --git a/vendor/go.opentelemetry.io/otel/.golangci.yml b/vendor/go.opentelemetry.io/otel/.golangci.yml index 8a7f1ec5d99..1fef8520b3a 100644 --- a/vendor/go.opentelemetry.io/otel/.golangci.yml +++ b/vendor/go.opentelemetry.io/otel/.golangci.yml @@ -143,8 +143,7 @@ linters: - name: constant-logical-expr - name: context-as-argument arguments: - - allow-types-before: '*testing.T' - disabled: true + - allow-types-before: '*testing.T,*testing.B' - name: context-keys-type - name: deep-exit - name: defer @@ -231,13 +230,6 @@ linters: - revive path: schema/v.*/types/.* text: avoid meaningless package names - # TODO: Having appropriate comments for exported objects helps development, - # even for objects in internal packages. Appropriate comments for all - # exported objects should be added and this exclusion removed. - - linters: - - revive - path: .*internal/.* - text: exported (method|function|type|const) (.+) should have comment or be unexported # Yes, they are, but it's okay in a test. - linters: - revive @@ -273,7 +265,10 @@ formatters: - golines settings: gofumpt: - extra-rules: true + extra: + group-params: true + clothe-returns: true + balance-calls: true goimports: local-prefixes: - go.opentelemetry.io/otel diff --git a/vendor/go.opentelemetry.io/otel/CHANGELOG.md b/vendor/go.opentelemetry.io/otel/CHANGELOG.md index 2db588ea27d..18903c889b1 100644 --- a/vendor/go.opentelemetry.io/otel/CHANGELOG.md +++ b/vendor/go.opentelemetry.io/otel/CHANGELOG.md @@ -11,6 +11,121 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm +## [1.47.0/0.69.0/0.23.0/0.1.0] - 2026-10-02 + +This release contains the first stable release of the OpenTelemetry Go Logs API and SDK. +Our project stability guarantees now apply to the following modules: + +- `go.opentelemetry.io/otel/log` +- `go.opentelemetry.io/otel/sdk/log` + +See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. + +### Added + +- Add `String` method for `KeyValue` type in `go.opentelemetry.io/otel/attribute`. (#8205) +- Add `String` method for `Set` type in `go.opentelemetry.io/otel/attribute`. (#8347) +- Add `WithMaxExportBatchSize` to `go.opentelemetry.io/otel/sdk/metric` to configure the maximum export batch size for `PeriodicReader`. (#8960) +- Add `WithAttributeValueDepthLimit`, `DefaultAttributeValueDepthLimit`, and `SpanLimits.AttributeValueDepthLimit` in `go.opentelemetry.io/otel/sdk/trace` to configure the maximum depth of span, event, link, and instrumentation scope attribute values. (#8938) +- Add `WithAttributeValueDepthLimit` in `go.opentelemetry.io/otel/sdk/log` to configure the maximum depth of log record and instrumentation scope attribute values. (#8938) +- Add `WithMaxResponseSize` to `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`, + `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`, and + `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#8941) +- Add experimental `ProbabilitySampler` in `go.opentelemetry.io/otel/sdk/trace/x` that conforms to the [OpenTelemetry specification's threshold-based sampling algorithm](https://opentelemetry.io/docs/specs/otel/trace/sdk/#probabilitysampler). (#8123) +- Add experimental `*Binder` extension interfaces in `go.opentelemetry.io/otel/metric/x` for instruments that support binding attributes ahead of time. (#8760) +- Add the experimental `Finisher` synchronous metric instrument extension interface to `go.opentelemetry.io/otel/metric/x`. (#8906) + +### Changed + +- Use the [OpenTelemetry Attribute Collection representation for non-OTLP protocols](https://opentelemetry.io/docs/specs/otel/common/#attribute-collection-representation-for-non-otlp) for metric data diffs in `go.opentelemetry.io/otel/sdk/metric/metricdata/metricdatatest`. (#8993) +- Apply a maximum depth of 64 by default to span, event, link, log record, and instrumentation scope attribute values in `go.opentelemetry.io/otel/sdk/trace` and `go.opentelemetry.io/otel/sdk/log`. (#8938) +- Reduce allocations when applying attribute value length limits in `go.opentelemetry.io/otel/sdk/trace` and `go.opentelemetry.io/otel/sdk/log` by rebuilding composite values only when truncation is needed. (#8912) +- Decode `traceparent` using a hex lookup table in `go.opentelemetry.io/otel/propagation`, which rejects the specification-disallowed upper-case characters without a separate scan of the header. (#8739) +- Decode all characters at constant indices in `TraceIDFromHex` and `SpanIDFromHex` in `go.opentelemetry.io/otel/trace` to eliminate bounds checks. (#8740) + +### Fixed + +- Count valid U+FFFD replacement characters toward attribute value length limits in `go.opentelemetry.io/otel/trace`, `go.opentelemetry.io/otel/sdk/trace`, and `go.opentelemetry.io/otel/sdk/log`. +- Truncate string attribute values to empty strings when the configured length limit is zero, including malformed UTF-8, in `go.opentelemetry.io/otel/trace`, `go.opentelemetry.io/otel/sdk/trace`, and `go.opentelemetry.io/otel/sdk/log`. (#9054) +- Fix a data race in `NewPeriodicReader` where `r.inst` was assigned after the background goroutine was launched in `go.opentelemetry.io/otel/sdk/metric`. (#9028) +- Prevent precision loss for large `int64` values in `Sum`, `Histogram`, and `ExponentialHistogram` aggregations in `go.opentelemetry.io/otel/sdk/metric`. (#8981) +- Ensure `grpc.DialOption` values passed via `WithDialOption` take precedence over conflicting internally-computed defaults in + `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc`, + `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`, and + `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`. (#8805, #8834, #8836) +- Treat overflowing `OTEL_METRIC_EXPORT_INTERVAL` and `OTEL_METRIC_EXPORT_TIMEOUT` values as invalid in `go.opentelemetry.io/otel/sdk/metric`. (#8800) +- Prevent a panic in `NewFixedSizeReservoir` and `FixedSizeReservoirProvider` when given a negative size in `go.opentelemetry.io/otel/sdk/metric/exemplar`; negative sizes are now clamped to zero, consistent with a size of zero. (#8832) +- Preserve exponential histogram `ZeroThreshold` during OTLP metric export in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric`. (#8801) +- Ensure metric helpers in `go.opentelemetry.io/otel/semconv/v1.32.0`, `go.opentelemetry.io/otel/semconv/v1.33.0`, and `go.opentelemetry.io/otel/semconv/v1.34.0` record measurements only once when no attributes are provided. (#8849) +- Treat empty `OTEL_TRACES_SAMPLER` and `OTEL_TRACES_SAMPLER_ARG` values as unset in `go.opentelemetry.io/otel/sdk/trace`. (#8873) +- Normalize global `OTEL_EXPORTER_OTLP_ENDPOINT` path joining in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp` so trailing-slash base URLs do not produce double-slash log export paths. (#8864) +- Prevent a deadlock when formatting an error passed to `RecordError` calls back into the span in `go.opentelemetry.io/otel/sdk/trace`. (#8815) +- Prevent `SimpleSpanProcessor.Shutdown` from panicking when constructed with a nil exporter in `go.opentelemetry.io/otel/sdk/trace`. (#8844) +- Propagate invalid exponential histogram scale errors to Prometheus exporter self-observability metrics in `go.opentelemetry.io/otel/exporters/prometheus`. (#8839) +- Retain instrument advisory attributes configured with `go.opentelemetry.io/otel/metric/x.WithDefaultAttributes` when a matching View in `go.opentelemetry.io/otel/sdk/metric` does not specify an attribute filter. (#8859) +- Ignore HTTP URL paths when building OTLP/gRPC metric exporter targets from `OTEL_EXPORTER_OTLP_ENDPOINT` and `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT`, while preserving `unix://` and `unix-abstract://` targets; treat `unix-abstract://` endpoints as insecure in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#8862) +- Ignore HTTP(S) paths when deriving gRPC trace exporter endpoints from `OTEL_EXPORTER_OTLP_ENDPOINT` and `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`. (#8852) +- Bound memory used while parsing dense W3C property metadata by storing it compactly and materializing `Property` values on demand in `go.opentelemetry.io/otel/baggage` and `go.opentelemetry.io/otel/propagation`. + +### Removed + +- Remove the experimental `OTEL_GO_X_METRIC_EXPORT_BATCH_SIZE` environment variable in `go.opentelemetry.io/otel/sdk/metric`. + Use the `WithMaxExportBatchSize` option instead. (#8960) + +## [1.47.0-rc.1] - 2026-08-28 + +This is a release candidate for the v1.47.0 release. +That release is expected to include the `v1` release of the OpenTelemetry Go Logs API and SDK and will provide stability guarantees for the following modules: + +- `go.opentelemetry.io/otel/log` +- `go.opentelemetry.io/otel/sdk/log` + +See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. + +### Added + +- Add `Logger`, `GetLoggerProvider`, and `SetLoggerProvider` to `go.opentelemetry.io/otel`. (#8874) + +### Deprecated + +- Deprecate `go.opentelemetry.io/otel/log/global`; use the equivalent APIs in `go.opentelemetry.io/otel`. (#8874) + +### Fixed + +- Ignore attempts to unregister unknown span processors in `go.opentelemetry.io/otel/sdk/trace`. (#8840) + +### Removed + +- Drop support for [Go 1.25]. (#8876) + +## [1.46.0/0.68.0/0.22.0/0.0.19] - 2026-08-25 + +This release is the last to support [Go 1.25]. +The next release will require at least [Go 1.26]. + +### Added + +- Support testing of [Go 1.27]. (#8811) +- Support `http/json` protocol in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#8273, #8775, #8831) +- Add `Hasher` struct and methods in `go.opentelemetry.io/otel/attribute` to compute authoritative `Distinct` hashes incrementally for attribute filtering and deduplication. (#8598) + +### Changed + +- Lazily evaluate filtered and dropped attributes on measurement hot paths in `go.opentelemetry.io/otel/sdk/metric` to avoid unnecessary attribute set allocations. (#8598) +- Add `ErrExporterShutdown` to `go.opentelemetry.io/otel/sdk/log` and return it from the `go.opentelemetry.io/otel/exporters/stdout/stdoutlog`, `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc`, and `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp` exporters when `Export` is called after `Shutdown`. (#8773) +- Clarify in `go.opentelemetry.io/otel/log` that calling `Logger.Enabled` is optional and that cached results can become stale. (#8764) + +### Fixed + +- Export dropped attribute counts in OTLP log records from `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc` and `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#8829) +- Name span events created from OpenTracing logs after the `event` log field, falling back to `log`, instead of always using an empty name in `go.opentelemetry.io/otel/bridge/opentracing`. (#8648) +- Count exception attributes omitted due to the attribute count limit as dropped in `go.opentelemetry.io/otel/sdk/log`. (#8796) +- Prevent log record and instrumentation scope attributes with empty keys from reaching processors and exporters in `go.opentelemetry.io/otel/sdk/log`. (#8797) +- Fix a data race when span attributes are read concurrently in `go.opentelemetry.io/otel/sdk/trace`. (#8706) +- Prevent a panic in `(*Set).Filter` when called on a nil receiver in `go.opentelemetry.io/otel/attribute`. (#8792) +- The simple span and log processors record `otel.sdk.processor.{span,log}.processed` when the record is submitted to the exporter instead of after the export completes, and no longer set `error.type` from the export outcome, in `go.opentelemetry.io/otel/sdk/trace` and `go.opentelemetry.io/otel/sdk/log`. (#8705) +- Prevent `Resource.MarshalLog` from panicking on nil resources in `go.opentelemetry.io/otel/sdk/resource`. (#8758) + ## [1.45.0/0.67.0/0.21.0/0.0.18] - 2026-08-03 ### Added @@ -3782,7 +3897,10 @@ It contains api and sdk for trace and meter. - CircleCI build CI manifest files. - CODEOWNERS file to track owners of this project. -[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.45.0...HEAD +[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.47.0...HEAD +[1.47.0/0.69.0/0.23.0/0.1.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.47.0 +[1.47.0-rc.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.47.0-rc.1 +[1.46.0/0.68.0/0.22.0/0.0.19]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.46.0 [1.45.0/0.67.0/0.21.0/0.0.18]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.45.0 [1.44.0/0.66.0/0.20.0/0.0.17]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.44.0 [1.43.0/0.65.0/0.19.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.43.0 @@ -3887,6 +4005,7 @@ It contains api and sdk for trace and meter. +[Go 1.27]: https://go.dev/doc/go1.27 [Go 1.26]: https://go.dev/doc/go1.26 [Go 1.25]: https://go.dev/doc/go1.25 [Go 1.24]: https://go.dev/doc/go1.24 diff --git a/vendor/go.opentelemetry.io/otel/CODEOWNERS b/vendor/go.opentelemetry.io/otel/CODEOWNERS index 26a03aed1d2..41937a38957 100644 --- a/vendor/go.opentelemetry.io/otel/CODEOWNERS +++ b/vendor/go.opentelemetry.io/otel/CODEOWNERS @@ -12,6 +12,6 @@ # https://help.github.com/en/articles/about-code-owners # -* @MrAlias @XSAM @dashpole @pellared @dmathieu @flc1125 +* @MrAlias @XSAM @dashpole @pellared @dmathieu @flc1125 @ps-mir CODEOWNERS @MrAlias @pellared @dashpole @XSAM @dmathieu diff --git a/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md b/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md index 2aba71e196d..958a698db73 100644 --- a/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md +++ b/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md @@ -779,7 +779,7 @@ func newInstrumentation() (*instrumentation, error) { if !x.Observability.Enabled() { return nil, nil } - + meter := otel.GetMeterProvider().Meter( "", metric.WithInstrumentationVersion(sdk.Version()), @@ -949,7 +949,7 @@ func BenchmarkExportSpans(b *testing.B) { {"ObsDisabled", false}, {"ObsEnabled", true}, } - + for _, scenario := range scenarios { b.Run(scenario.name, func(b *testing.B) { b.Setenv( @@ -980,7 +980,7 @@ func newInstrumentation() (*instrumentation, error) { if !x.Observability.Enabled() { return nil, nil } - + m := otel.GetMeterProvider().Meter(/* initialize meter */) counter, err := otelconv.NewSDKComponentCounter(m) // Use the partially initialized counter if available. @@ -996,7 +996,7 @@ func newInstrumentation() *instrumentation { if !x.Observability.Enabled() { return nil, nil } - + m := otel.GetMeterProvider().Meter(/* initialize meter */) counter, err := otelconv.NewSDKComponentCounter(m) if err != nil { @@ -1023,7 +1023,7 @@ func (e *Exporter) ExportSpans(ctx context.Context, spans []trace.ReadOnlySpan) if e.inst.Enabled(ctx) { e.inst.recordSpanExportStarted(ctx, len(spans)) } - + err := e.doExport(ctx, spans) if e.inst.Enabled(ctx) { @@ -1043,11 +1043,11 @@ func (e *Exporter) ExportSpans(ctx context.Context, spans []trace.ReadOnlySpan) func (e *Exporter) ExportSpans(ctx context.Context, spans []trace.ReadOnlySpan) error { // ❌ Do not break the context propagation. e.inst.recordSpanExportStarted(context.Background(), len(spans)) - + err := e.doExport(ctx, spans) /* ... */ - + return err } ``` @@ -1118,7 +1118,7 @@ func TestObservability(t *testing.T) { // Reset component ID counter to ensure deterministic component names. componentIDCounter.Store(0) - + /* ... test code ... */ } ``` @@ -1203,18 +1203,20 @@ For more information about the maintainer role, see the [community repository](h ### Approvers - [Flc](https://github.com/flc1125), Independent +- [Puneet Singh](https://github.com/ps-mir), Independent For more information about the approver role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#approver). ### Triagers -- [Alex Kats](https://github.com/akats7), Capital One +- [Marc Schäfer](https://github.com/marcschaeferger), T&A SYSTEME GmbH For more information about the triager role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#triager). ### Emeritus - [Aaron Clawson](https://github.com/MadVikingGod) +- [Alex Kats](https://github.com/akats7) - [Anthony Mirabella](https://github.com/Aneurysm9) - [Cheng-Zhen Yang](https://github.com/scorpionknifes) - [Chester Cheung](https://github.com/hanyuancheung) diff --git a/vendor/go.opentelemetry.io/otel/Makefile b/vendor/go.opentelemetry.io/otel/Makefile index d4711257dff..c674ef8a177 100644 --- a/vendor/go.opentelemetry.io/otel/Makefile +++ b/vendor/go.opentelemetry.io/otel/Makefile @@ -69,8 +69,13 @@ $(GORELEASE): PACKAGE=golang.org/x/exp/cmd/gorelease GOVULNCHECK = $(TOOLS)/govulncheck $(TOOLS)/govulncheck: PACKAGE=golang.org/x/vuln/cmd/govulncheck +AFFECTEDMODS = $(TOOLS)/affectedmods +AFFECTEDMODS_FILES := $(sort $(shell find $(TOOLS_MOD_DIR)/affectedmods -type f)) +$(TOOLS)/affectedmods: PACKAGE=go.opentelemetry.io/otel/$(TOOLS_MOD_DIR)/affectedmods +$(TOOLS)/affectedmods: $(AFFECTEDMODS_FILES) + .PHONY: tools -tools: $(CROSSLINK) $(GOLANGCI_LINT) $(MISSPELL) $(GOCOVMERGE) $(STRINGER) $(VERIFYREADMES) $(MULTIMOD) $(SEMCONVKIT) $(GOTMPL) $(GORELEASE) +tools: $(CROSSLINK) $(GOLANGCI_LINT) $(MISSPELL) $(GOCOVMERGE) $(STRINGER) $(VERIFYREADMES) $(MULTIMOD) $(SEMCONVKIT) $(GOTMPL) $(GORELEASE) $(AFFECTEDMODS) # Virtualized python tools via docker @@ -125,9 +130,11 @@ go-work: $(CROSSLINK) # Build -.PHONY: build +.PHONY: build cross-build build: $(OTEL_GO_MOD_DIRS:%=build/%) $(OTEL_GO_MOD_DIRS:%=build-tests/%) +# Cross-platform builds cannot execute the binaries produced by build-tests (go test), so use a compile-only target. +cross-build: $(OTEL_GO_MOD_DIRS:%=build/%) build/%: DIR=$* build/%: @echo "$(GO) build $(DIR)/..." \ @@ -163,6 +170,9 @@ test/%: | grep -v third_party \ | xargs $(GO) test -timeout $(TIMEOUT)s $(ARGS) +.PHONY: test-tools +test-tools: test/$(TOOLS_MOD_DIR) + COVERAGE_MODE = atomic COVERAGE_PROFILE = coverage.out .PHONY: test-coverage @@ -187,15 +197,23 @@ benchmark/%: # sdk/metric is split into two shards to work around CodSpeed limitations. # See https://github.com/CodSpeedHQ/codspeed-go/issues/56 -BENCHMARK_SHARDS := $(filter-out ./sdk/metric,$(OTEL_GO_MOD_DIRS)) ./sdk/metric/root ./sdk/metric/internal -benchmark/./sdk/metric/root: +BENCHMARK_SHARDS := $(filter-out ./sdk/metric,$(OTEL_GO_MOD_DIRS)) ./sdk/metric/. ./sdk/metric/internal +benchmark/./sdk/metric/.: cd ./sdk/metric && $(GO) test -run='^$$' -bench=. $(ARGS) . ./exemplar/... -benchmark/./sdk/metric/internal: - cd ./sdk/metric && $(GO) test -run='^$$' -bench=. $(ARGS) ./internal/... print-sharded-benchmarks: @echo $(BENCHMARK_SHARDS) | jq -cR 'split(" ")' +# Print the JSON list of benchmark shards whose code changed since +# BASE_REF (default: main). Filters print-sharded-benchmarks +# down to shards whose underlying module contains a changed *.go file. +# Non-Go changes (docs, workflows, Makefile, go.mod/go.sum, tooling) emit []. +# Override the diff base via BASE_REF, or pass ARGS=-all to emit the full list. +BASE_REF ?= main +.PHONY: print-affected-benchmarks +print-affected-benchmarks: + @$(MAKE) -s print-sharded-benchmarks | $(GO) -C $(TOOLS_MOD_DIR) run ./affectedmods $(if $(strip $(BASE_REF)),-base=$(BASE_REF),) $(ARGS) + .PHONY: golangci-lint golangci-lint-fix golangci-lint-fix: ARGS=--fix golangci-lint-fix: golangci-lint diff --git a/vendor/go.opentelemetry.io/otel/README.md b/vendor/go.opentelemetry.io/otel/README.md index ce97e9a2510..bcdb73e0170 100644 --- a/vendor/go.opentelemetry.io/otel/README.md +++ b/vendor/go.opentelemetry.io/otel/README.md @@ -3,12 +3,11 @@ [![ci](https://github.com/open-telemetry/opentelemetry-go/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/open-telemetry/opentelemetry-go/actions/workflows/ci.yml) [![codecov.io](https://codecov.io/gh/open-telemetry/opentelemetry-go/coverage.svg?branch=main)](https://app.codecov.io/gh/open-telemetry/opentelemetry-go?branch=main) [![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel)](https://pkg.go.dev/go.opentelemetry.io/otel) -[![Go Report Card](https://goreportcard.com/badge/go.opentelemetry.io/otel)](https://goreportcard.com/report/go.opentelemetry.io/otel) [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/open-telemetry/opentelemetry-go/badge)](https://scorecard.dev/viewer/?uri=github.com/open-telemetry/opentelemetry-go) [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/9996/badge)](https://www.bestpractices.dev/projects/9996) [![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/opentelemetry-go.svg)](https://issues.oss-fuzz.com/issues?q=project:opentelemetry-go) [![FOSSA Status](https://app.fossa.com/api/projects/custom%2B162%2Fgithub.com%2Fopen-telemetry%2Fopentelemetry-go.svg?type=shield&issueType=license)](https://app.fossa.com/projects/custom%2B162%2Fgithub.com%2Fopen-telemetry%2Fopentelemetry-go?ref=badge_shield&issueType=license) -[![Slack](https://img.shields.io/badge/slack-@cncf/otel--go-brightgreen.svg?logo=slack)](https://cloud-native.slack.com/archives/C01NPAXACKT) +[![Slack](https://img.shields.io/badge/slack-@cncf/otel--go-brightgreen.svg?logo=slack)](https://slack.cncf.io/) OpenTelemetry-Go is the [Go](https://golang.org/) implementation of [OpenTelemetry](https://opentelemetry.io/). It provides a set of APIs to directly measure performance and behavior of your software and send this data to observability platforms. @@ -19,7 +18,7 @@ It provides a set of APIs to directly measure performance and behavior of your s |---------|--------------------| | Traces | Stable | | Metrics | Stable | -| Logs | Beta[^1] | +| Logs | Stable | Progress and status specific to this repository is tracked in our [project boards](https://github.com/open-telemetry/opentelemetry-go/projects) @@ -29,8 +28,6 @@ and Project versioning information and stability guarantees can be found in the [versioning documentation](VERSIONING.md). -[^1]: https://github.com/orgs/open-telemetry/projects/43 - ### Compatibility OpenTelemetry-Go ensures compatibility with the current supported versions of @@ -53,20 +50,20 @@ Currently, this project supports the following environments. | OS | Go Version | Architecture | |----------|------------|--------------| +| Ubuntu | 1.27 | amd64 | | Ubuntu | 1.26 | amd64 | -| Ubuntu | 1.25 | amd64 | +| Ubuntu | 1.27 | 386 | | Ubuntu | 1.26 | 386 | -| Ubuntu | 1.25 | 386 | +| Ubuntu | 1.27 | arm64 | | Ubuntu | 1.26 | arm64 | -| Ubuntu | 1.25 | arm64 | +| macOS | 1.27 | amd64 | | macOS | 1.26 | amd64 | -| macOS | 1.25 | amd64 | +| macOS | 1.27 | arm64 | | macOS | 1.26 | arm64 | -| macOS | 1.25 | arm64 | +| Windows | 1.27 | amd64 | | Windows | 1.26 | amd64 | -| Windows | 1.25 | amd64 | +| Windows | 1.27 | 386 | | Windows | 1.26 | 386 | -| Windows | 1.25 | 386 | While this project should work for other systems, no compatibility guarantees are made for those systems currently. @@ -113,10 +110,3 @@ All officially supported exporters for the OpenTelemetry project are contained i ## Contributing See the [contributing documentation](CONTRIBUTING.md). - -### Emeritus - -- [Alex Kats](https://github.com/akats7), Triager - -For more information about the emeritus role, see the -[community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#emeritus-maintainerapprovertriager). diff --git a/vendor/go.opentelemetry.io/otel/VERSIONING.md b/vendor/go.opentelemetry.io/otel/VERSIONING.md index b27c9e84f51..56eaa7d2204 100644 --- a/vendor/go.opentelemetry.io/otel/VERSIONING.md +++ b/vendor/go.opentelemetry.io/otel/VERSIONING.md @@ -12,6 +12,12 @@ is designed so the following goals can be achieved. * [Semantic import versioning](https://github.com/golang/go/wiki/Modules#semantic-import-versioning) will be used. + * Stable module compatibility is understood in terms of the [Go 1 + compatibility guidelines](https://go.dev/doc/go1compat). Code that + compiled against an older version of a package should continue to compile + against newer versions of that package, subject to the exceptions in the + Go 1 compatibility guidelines and any additional exceptions documented + below. * Versions will comply with [semver 2.0](https://semver.org/spec/v2.0.0.html) with the following exceptions. * New methods may be added to exported API interfaces. All exported diff --git a/vendor/go.opentelemetry.io/otel/attribute/hash.go b/vendor/go.opentelemetry.io/otel/attribute/hash.go index f651eb13d90..54c26e67a05 100644 --- a/vendor/go.opentelemetry.io/otel/attribute/hash.go +++ b/vendor/go.opentelemetry.io/otel/attribute/hash.go @@ -33,19 +33,71 @@ const ( emptyID uint64 = 7305809155345288421 // "__empty_" (little endian) ) +// Hasher computes a Distinct value from KeyValue attributes supplied with +// Write. +// +// A Hasher must be obtained from [NewHasher]. The zero value is not usable and +// its methods will panic. +type Hasher struct { + h xxhash.Hash +} + +// NewHasher returns a new Hasher. +func NewHasher() *Hasher { + return &Hasher{h: xxhash.New()} +} + +// Reset resets h to its initial state so it can be reused. +func (h *Hasher) Reset() { + h.h.Reset() +} + +// Write adds kv to the hash. +// +// Write requires attributes to be supplied in ascending key order with no +// duplicate keys. To produce the same Distinct as Set.Equivalent, write +// attributes in ascending key order, with no more than one value for each key. +// If the source contains duplicate keys, retain the last value for each key +// before calling Write. +func (h *Hasher) Write(kv KeyValue) { + // hashKV mutates the digest h.h refers to in place and returns the same + // Hash value it was passed. Discarding the result keeps the digest pointer + // from flowing back into h, which would force the digest to be heap + // allocated for every Hasher. Keeping Write this small also keeps it within + // the inlining budget, which matters because hashKVs calls it per attribute. + _ = hashKV(h.h, kv) +} + +// Distinct returns the identifier for the attributes written to h. When Write +// is called as described above, it returns the same value as [Set.Equivalent]. +func (h *Hasher) Distinct() Distinct { + // No count of written attributes is needed to detect the empty case. The + // sum of a digest with nothing written to it is emptyHash, which is + // non-zero (0xef46db3751d8e999), so it passes through remapZeroHash + // unchanged and matches emptySet.Equivalent. + return Distinct{hash: remapZeroHash(h.h.Sum64())} +} + +// remapZeroHash remaps a 0 sum to a non-zero value, because hash == 0 is a +// reserved sentinel (treated as empty/invalid). +func remapZeroHash(sum uint64) uint64 { + if sum == 0 { + return 1 + } + return sum +} + // hashKVs returns a new xxHash64 hash of kvs. +// +// This routes through [Hasher] so that Set hashing and Hasher cannot disagree: +// there is exactly one implementation of how attributes are mixed and how the +// final sum is framed. func hashKVs(kvs []KeyValue) uint64 { - h := xxhash.New() + h := NewHasher() for _, kv := range kvs { - h = hashKV(h, kv) + h.Write(kv) } - sum := h.Sum64() - // Remap 0 to a non-zero value for non-empty input because hash == 0 is a reserved sentinel (treated as empty/invalid). - const remappedZeroHash uint64 = 1 - if sum == 0 && len(kvs) > 0 { - return remappedZeroHash - } - return sum + return h.Distinct().hash } // hashKV returns the xxHash64 hash of kv with h as the base. diff --git a/vendor/go.opentelemetry.io/otel/attribute/internal/xxhash/xxhash.go b/vendor/go.opentelemetry.io/otel/attribute/internal/xxhash/xxhash.go index c851179ccaa..499aa3318f3 100644 --- a/vendor/go.opentelemetry.io/otel/attribute/internal/xxhash/xxhash.go +++ b/vendor/go.opentelemetry.io/otel/attribute/internal/xxhash/xxhash.go @@ -21,6 +21,7 @@ func New() Hash { return Hash{d: xxhash.New()} } +// Uint64 hashes val into h, returning the updated Hash. func (h Hash) Uint64(val uint64) Hash { var buf [8]byte binary.LittleEndian.PutUint64(buf[:], val) @@ -40,10 +41,12 @@ func (h Hash) Bool(val bool) Hash { // nolint:revive // This is a hashing functi return h.Uint64(0) } +// Float64 hashes val into h, returning the updated Hash. func (h Hash) Float64(val float64) Hash { return h.Uint64(math.Float64bits(val)) } +// Int64 hashes val into h, returning the updated Hash. func (h Hash) Int64(val int64) Hash { return h.Uint64(uint64(val)) // nolint:gosec // Overflow doesn't matter since we are hashing. } @@ -62,3 +65,8 @@ func (h Hash) String(val string) Hash { func (h Hash) Sum64() uint64 { return h.d.Sum64() } + +// Reset resets the hash to its initial state. +func (h Hash) Reset() { + h.d.Reset() +} diff --git a/vendor/go.opentelemetry.io/otel/attribute/kv.go b/vendor/go.opentelemetry.io/otel/attribute/kv.go index c4f0dd9281e..60d49739a39 100644 --- a/vendor/go.opentelemetry.io/otel/attribute/kv.go +++ b/vendor/go.opentelemetry.io/otel/attribute/kv.go @@ -13,6 +13,16 @@ type KeyValue struct { Value Value } +// String returns a string representation of KeyValue using the +// [OpenTelemetry Attribute representation for non-OTLP protocols] rules. +// +// The KeyValue is encoded as a JSON object containing a single key-value pair. +// +// [OpenTelemetry Attribute representation for non-OTLP protocols]: https://opentelemetry.io/docs/specs/otel/common/#attribute-representation-for-non-otlp +func (kv KeyValue) String() string { + return formatMap([]KeyValue{kv}) +} + // Valid reports whether kv is a valid OpenTelemetry attribute. func (kv KeyValue) Valid() bool { return kv.Key.Defined() diff --git a/vendor/go.opentelemetry.io/otel/attribute/set.go b/vendor/go.opentelemetry.io/otel/attribute/set.go index 87d6f96200d..d3b2e240ba4 100644 --- a/vendor/go.opentelemetry.io/otel/attribute/set.go +++ b/vendor/go.opentelemetry.io/otel/attribute/set.go @@ -313,6 +313,9 @@ func filteredToFront(slice []KeyValue, keep Filter) int { // Filter returns a filtered copy of this Set. See the documentation for // NewSetWithSortableFiltered for more details. func (l *Set) Filter(re Filter) (Set, []KeyValue) { + if l == nil { + return emptySet, nil + } if re == nil { return *l, nil } @@ -406,6 +409,21 @@ func computeDataReflect(kvs []KeyValue) any { return at.Interface() } +// String returns a string representation of the Set using the +// [OpenTelemetry Attribute Collection representation for non-OTLP protocols] +// rules. +// +// The Set is encoded as a JSON object. A nil or empty Set is encoded as an +// empty JSON object. +// +// [OpenTelemetry Attribute Collection representation for non-OTLP protocols]: https://opentelemetry.io/docs/specs/otel/common/#attribute-collection-representation-for-non-otlp +func (l *Set) String() string { + if l == nil || l.hash == 0 { + return "{}" + } + return formatMapValue(l.data) +} + // MarshalJSON returns the JSON encoding of the Set. func (l *Set) MarshalJSON() ([]byte, error) { return json.Marshal(l.data) diff --git a/vendor/go.opentelemetry.io/otel/baggage/baggage.go b/vendor/go.opentelemetry.io/otel/baggage/baggage.go index 25c739d0825..72a58c1b618 100644 --- a/vendor/go.opentelemetry.io/otel/baggage/baggage.go +++ b/vendor/go.opentelemetry.io/otel/baggage/baggage.go @@ -247,10 +247,78 @@ func (p properties) String() string { return strings.Join(props, propertyDelimiter) } +// validateMetadata validates non-empty W3C property elements without decoding +// or materializing Property values. Empty elements are accepted to preserve +// existing parsing behavior. +func validateMetadata(raw string) (string, bool) { + start := 0 + for end := 0; end <= len(raw); end++ { + if end != len(raw) && raw[end] != propertyDelimiter[0] { + continue + } + + if start != end { + if _, ok := parsePropertyFields(raw[start:end]); !ok { + return raw[start:end], false + } + } + start = end + 1 + } + return "", true +} + +// normalizeMetadata removes empty property elements while preserving the raw +// representation of all non-empty elements. +func normalizeMetadata(metadata string) string { + if metadata == "" || + (metadata[0] != propertyDelimiter[0] && + metadata[len(metadata)-1] != propertyDelimiter[0] && + !strings.Contains(metadata, propertyDelimiter+propertyDelimiter)) { + return metadata + } + + var normalized strings.Builder + normalized.Grow(len(metadata)) + for property := range strings.SplitSeq(metadata, propertyDelimiter) { + if property == "" { + continue + } + if normalized.Len() > 0 { + _, _ = normalized.WriteString(propertyDelimiter) + } + _, _ = normalized.WriteString(property) + } + return normalized.String() +} + +func propertiesFromMetadata(metadata string) properties { + if metadata == "" { + return nil + } + + props := make(properties, 0, strings.Count(metadata, propertyDelimiter)+1) + for pStr := range strings.SplitSeq(metadata, propertyDelimiter) { + if pStr == "" { + continue + } + p, err := parseProperty(pStr) + if err != nil { + return nil + } + props = append(props, p) + } + return props +} + // Member is a list-member of a baggage-string as defined by the W3C Baggage // specification. type Member struct { key, value string + + // metadata contains the opaque W3C property suffix extracted from the wire + // without the leading semicolon. properties contains API-created + // properties. The fields are mutually exclusive. + metadata string properties properties // hasData indicates whether the created property contains data or not. @@ -307,21 +375,16 @@ func newInvalidMember() Member { return Member{} } -// parseMember attempts to decode a Member from the passed string. It returns -// an error if the input is invalid according to the W3C Baggage -// specification. +// parseMember attempts to decode a Member from the passed string. Property +// metadata grammar is validated without decoding or materializing properties. func parseMember(member string) (Member, error) { - var props properties - keyValue, properties, found := strings.Cut(member, propertyDelimiter) + var metadata string + keyValue, rawMetadata, found := strings.Cut(member, propertyDelimiter) if found { - // Parse the member properties. - for pStr := range strings.SplitSeq(properties, propertyDelimiter) { - p, err := parseProperty(pStr) - if err != nil { - return newInvalidMember(), err - } - props = append(props, p) + if invalid, ok := validateMetadata(rawMetadata); !ok { + return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidProperty, invalid) } + metadata = normalizeMetadata(rawMetadata) } // Parse the member key/value pair. @@ -349,7 +412,7 @@ func parseMember(member string) (Member, error) { } value := replaceInvalidUTF8Sequences(len(rawVal), unescapeVal) - return Member{key: key, value: value, properties: props, hasData: true}, nil + return Member{key: key, value: value, metadata: metadata, hasData: true}, nil } // replaceInvalidUTF8Sequences replaces invalid UTF-8 sequences with '�'. @@ -399,10 +462,14 @@ func (m Member) Key() string { return m.key } func (m Member) Value() string { return m.value } // Properties returns a copy of the Member properties. -func (m Member) Properties() []Property { return m.properties.Copy() } +func (m Member) Properties() []Property { + if m.metadata != "" { + return propertiesFromMetadata(m.metadata) + } + return m.properties.Copy() +} -// String encodes Member into a header string compliant with the W3C Baggage -// specification. +// String encodes Member into a baggage header string. // It would return empty string if the key is invalid with the W3C Baggage // specification. This could happen for a UTF-8 key, as it may contain // invalid characters. @@ -413,12 +480,31 @@ func (m Member) String() string { } s := m.key + keyValueDelimiter + valueEscape(m.value) - if len(m.properties) > 0 { + if m.metadata != "" { + s += propertyDelimiter + m.metadata + } else if len(m.properties) > 0 { s += propertyDelimiter + m.properties.String() } return s } +func memberFromItem(key string, item baggage.Item) Member { + return Member{ + key: key, + value: item.Value(), + metadata: item.Metadata(), + properties: fromInternalProperties(item.Properties()), + hasData: true, + } +} + +func itemFromMember(member Member) baggage.Item { + if member.metadata != "" { + return baggage.NewItemWithMetadata(member.value, member.metadata) + } + return baggage.NewItemWithProperties(member.value, member.properties.asInternal()) +} + // Baggage is a list of baggage members representing the baggage-string as // defined by the W3C Baggage specification. type Baggage struct { //nolint:golint @@ -444,10 +530,7 @@ func New(members ...Member) (Baggage, error) { return Baggage{}, errInvalidMember } // OpenTelemetry resolves duplicates by last-one-wins. - b[m.key] = baggage.Item{ - Value: m.value, - Properties: m.properties.asInternal(), - } + b[m.key] = itemFromMember(m) } var truncateErr error @@ -467,11 +550,7 @@ func New(members ...Member) (Baggage, error) { totalBytes := 0 first := true for k := range b { - m := Member{ - key: k, - value: b[k].Value, - properties: fromInternalProperties(b[k].Properties), - } + m := memberFromItem(k, b[k]) memberSize := len(m.String()) if !first { memberSize++ // comma separator @@ -563,10 +642,7 @@ func Parse(bStr string) (Baggage, error) { } // OpenTelemetry resolves duplicates by last-one-wins. - b[m.key] = baggage.Item{ - Value: m.value, - Properties: m.properties.asInternal(), - } + b[m.key] = itemFromMember(m) sizes[m.key] = memberBytes totalBytes = newTotalBytes } @@ -597,12 +673,7 @@ func (b Baggage) Member(key string) Member { return newInvalidMember() } - return Member{ - key: key, - value: v.Value, - properties: fromInternalProperties(v.Properties), - hasData: true, - } + return memberFromItem(key, v) } // Members returns all the baggage list-members. @@ -617,12 +688,7 @@ func (b Baggage) Members() []Member { members := make([]Member, 0, len(b.list)) for k, v := range b.list { - members = append(members, Member{ - key: k, - value: v.Value, - properties: fromInternalProperties(v.Properties), - hasData: true, - }) + members = append(members, memberFromItem(k, v)) } return members } @@ -652,10 +718,7 @@ func (b Baggage) SetMember(member Member) (Baggage, error) { list[k] = v } - list[member.key] = baggage.Item{ - Value: member.value, - Properties: member.properties.asInternal(), - } + list[member.key] = itemFromMember(member) return Baggage{list: list}, nil } @@ -692,11 +755,7 @@ func (b Baggage) Len() int { func (b Baggage) String() string { members := make([]string, 0, len(b.list)) for k, v := range b.list { - s := Member{ - key: k, - value: v.Value, - properties: fromInternalProperties(v.Properties), - }.String() + s := memberFromItem(k, v).String() // Ignored empty members. if s != "" { @@ -706,9 +765,14 @@ func (b Baggage) String() string { return strings.Join(members, listDelimiter) } -// parsePropertyInternal attempts to decode a Property from the passed string. -// It follows the spec at https://www.w3.org/TR/baggage/#definition. -func parsePropertyInternal(s string) (p Property, ok bool) { +type propertyFields struct { + key, rawValue string + hasValue bool +} + +// parsePropertyFields validates and locates a property's fields without +// decoding or allocating them. +func parsePropertyFields(s string) (fields propertyFields, ok bool) { // For the entire function we will use " key = value " as an example. // Attempting to parse the key. // First skip spaces at the beginning "< >key = value " (they could be empty). @@ -727,7 +791,7 @@ func parsePropertyInternal(s string) (p Property, ok bool) { // If we couldn't find any valid key character, // it means the key is either empty or invalid. if keyStart == keyEnd { - return p, ok + return fields, ok } // Skip spaces after the key: " key< >= value ". @@ -735,15 +799,14 @@ func parsePropertyInternal(s string) (p Property, ok bool) { if index == len(s) { // A key can have no value, like: " key ". - ok = true - p.key = s[keyStart:keyEnd] - return p, ok + fields.key = s[keyStart:keyEnd] + return fields, true } // If we have not reached the end and we can't find the '=' delimiter, // it means the property is invalid. if s[index] != keyValueDelimiter[0] { - return p, ok + return fields, ok } // Attempting to parse the value. @@ -769,23 +832,59 @@ func parsePropertyInternal(s string) (p Property, ok bool) { // we have not reached the end, it means the property is // invalid, something like: " key = value value1". if index != len(s) { - return p, ok + return fields, ok + } + rawVal := s[valueStart:valueEnd] + if !validPercentEncoding(rawVal) { + return fields, ok + } + + fields.key = s[keyStart:keyEnd] + fields.rawValue = rawVal + fields.hasValue = true + return fields, true +} + +func validPercentEncoding(s string) bool { + for i := 0; i < len(s); i++ { + if s[i] != '%' { + continue + } + if i+2 >= len(s) || !isHex(s[i+1]) || !isHex(s[i+2]) { + return false + } + i += 2 + } + return true +} + +func isHex(c byte) bool { + return '0' <= c && c <= '9' || 'a' <= c && c <= 'f' || 'A' <= c && c <= 'F' +} + +// parsePropertyInternal attempts to decode a Property from the passed string. +// It follows the spec at https://www.w3.org/TR/baggage/#definition. +func parsePropertyInternal(s string) (p Property, ok bool) { + fields, ok := parsePropertyFields(s) + if !ok { + return p, false + } + if !fields.hasValue { + p.key = fields.key + return p, true } // Decode a percent-encoded value. - rawVal := s[valueStart:valueEnd] - unescapeVal, err := url.PathUnescape(rawVal) + unescapeVal, err := url.PathUnescape(fields.rawValue) if err != nil { - return p, ok + return p, false } - value := replaceInvalidUTF8Sequences(len(rawVal), unescapeVal) + value := replaceInvalidUTF8Sequences(len(fields.rawValue), unescapeVal) - ok = true - p.key = s[keyStart:keyEnd] + p.key = fields.key p.hasValue = true - p.value = value - return p, ok + return p, true } func skipSpace(s string, offset int) int { diff --git a/vendor/go.opentelemetry.io/otel/bridge/opentracing/bridge.go b/vendor/go.opentelemetry.io/otel/bridge/opentracing/bridge.go index 3519223e052..2f88bfb4704 100644 --- a/vendor/go.opentelemetry.io/otel/bridge/opentracing/bridge.go +++ b/vendor/go.opentelemetry.io/otel/bridge/opentracing/bridge.go @@ -7,6 +7,7 @@ import ( "context" "fmt" "maps" + "slices" "strconv" "strings" "sync" @@ -116,10 +117,11 @@ func (s *bridgeSpan) FinishWithOptions(opts ot.FinishOptions) { } func (s *bridgeSpan) logRecord(record ot.LogRecord) { + attrs := otLogFieldsToOTelAttrs(record.Fields) s.otelSpan.AddEvent( - "", + otelEventName(attrs), trace.WithTimestamp(record.Timestamp), - trace.WithAttributes(otLogFieldsToOTelAttrs(record.Fields)...), + trace.WithAttributes(attrs...), ) } @@ -156,9 +158,10 @@ func (s *bridgeSpan) SetTag(key string, value any) ot.Span { } func (s *bridgeSpan) LogFields(fields ...otlog.Field) { + attrs := otLogFieldsToOTelAttrs(fields) s.otelSpan.AddEvent( - "", - trace.WithAttributes(otLogFieldsToOTelAttrs(fields)...), + otelEventName(attrs), + trace.WithAttributes(attrs...), ) } @@ -224,6 +227,31 @@ func otLogFieldsToOTelAttrs(fields []otlog.Field) []attribute.KeyValue { return encoder.pairs } +// eventNameKey is the OpenTracing log field conventionally carrying the name +// of the logged event. +const eventNameKey = attribute.Key("event") + +// defaultEventName is used when a log field set carries no usable +// eventNameKey field. +const defaultEventName = "log" + +// otelEventName returns the OTel event name for a set of converted OpenTracing +// log fields: the value of the last eventNameKey attribute, falling back to +// defaultEventName. An event name is semantically required to be non-empty, so +// an empty value is treated as absent. +func otelEventName(attrs []attribute.KeyValue) string { + for _, attr := range slices.Backward(attrs) { + if attr.Key != eventNameKey { + continue + } + if name := attr.Value.String(); name != "" { + return name + } + return defaultEventName + } + return defaultEventName +} + func (s *bridgeSpan) LogKV(alternatingKeyValues ...any) { fields, err := otlog.InterleavedKVToFields(alternatingKeyValues...) if err != nil { @@ -375,7 +403,7 @@ func (t *BridgeTracer) baggageSetHook(ctx context.Context, list iBaggage.List) c return ctx } for k, v := range list { - bSpan.setBaggageItemOnly(k, v.Value) + bSpan.setBaggageItemOnly(k, v.Value()) } return ctx } @@ -412,7 +440,7 @@ func (t *BridgeTracer) baggageGetHook(ctx context.Context, list iBaggage.List) i for k, v := range items { // Overwrite according to OpenTelemetry specification. - merged[k] = iBaggage.Item{Value: v} + merged[k] = iBaggage.NewItemWithProperties(v, nil) } return merged diff --git a/vendor/go.opentelemetry.io/otel/codes/codes.go b/vendor/go.opentelemetry.io/otel/codes/codes.go index 9355545a8c7..1502de3500c 100644 --- a/vendor/go.opentelemetry.io/otel/codes/codes.go +++ b/vendor/go.opentelemetry.io/otel/codes/codes.go @@ -32,7 +32,7 @@ const ( maxCode = 3 ) -// Code is an 32-bit representation of a status state. +// Code is a 32-bit representation of a status state. type Code uint32 var codeToStr = map[Code]string{ diff --git a/vendor/go.opentelemetry.io/otel/dependencies.Dockerfile b/vendor/go.opentelemetry.io/otel/dependencies.Dockerfile index 20eecba40da..82653bca913 100644 --- a/vendor/go.opentelemetry.io/otel/dependencies.Dockerfile +++ b/vendor/go.opentelemetry.io/otel/dependencies.Dockerfile @@ -1,4 +1,4 @@ # This is a renovate-friendly source of Docker images. FROM python:3.13.6-slim-bullseye@sha256:e98b521460ee75bca92175c16247bdf7275637a8faaeb2bcfa19d879ae5c4b9a AS python -FROM otel/weaver:v0.25.1@sha256:9ad46ca9cd4fa5974b121f886aa3e9946a8ef8ea905001a96c018d21f9db87ca AS weaver +FROM otel/weaver:v0.26.1@sha256:9094862c0ab261bdbcb079bb981f9a573b3659b130a6d2ab8616eca6ba37aaec AS weaver FROM avtodev/markdown-lint:v1@sha256:6aeedc2f49138ce7a1cd0adffc1b1c0321b841dc2102408967d9301c031949ee AS markdown diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/clients.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/clients.go index 3c1a625c067..d97fada29fb 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/clients.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/clients.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package otlptrace // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace" +package otlptrace import ( "context" diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/doc.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/doc.go index 09ad5eadb6f..5fd4bf5bb55 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/doc.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/doc.go @@ -7,4 +7,4 @@ See the official OTLP span exporter implementations: - [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc], - [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp]. */ -package otlptrace // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace" +package otlptrace diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/exporter.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/exporter.go index 30446bd28b6..037d485d5e0 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/exporter.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/exporter.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package otlptrace // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace" +package otlptrace import ( "context" @@ -97,9 +97,9 @@ func NewUnstarted(client Client) *Exporter { func (e *Exporter) MarshalLog() any { return struct { Type string - Client Client + Client string }{ Type: "otlptrace", - Client: e.client, + Client: fmt.Sprintf("%T", e.client), } } diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/attribute.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/attribute.go index 0d43a5dc5b7..86a34d3b9fb 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/attribute.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/attribute.go @@ -3,7 +3,7 @@ // Package tracetransform provides conversion functionality for the otlptrace // exporters. -package tracetransform // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform" +package tracetransform import ( commonpb "go.opentelemetry.io/proto/otlp/common/v1" @@ -97,6 +97,12 @@ func Value(v attribute.Value) *commonpb.AnyValue { Values: values(v.AsSlice()), }, } + case attribute.MAP: + av.Value = &commonpb.AnyValue_KvlistValue{ + KvlistValue: &commonpb.KeyValueList{ + Values: KeyValues(v.AsMap()), + }, + } case attribute.STRINGSLICE: av.Value = &commonpb.AnyValue_ArrayValue{ ArrayValue: &commonpb.ArrayValue{ diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/instrumentation.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/instrumentation.go index 43359c89449..1754a7fcb66 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/instrumentation.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/instrumentation.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package tracetransform // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform" +package tracetransform import ( commonpb "go.opentelemetry.io/proto/otlp/common/v1" @@ -9,6 +9,8 @@ import ( "go.opentelemetry.io/otel/sdk/instrumentation" ) +// InstrumentationScope transforms il into an OTLP InstrumentationScope, +// returning nil if il is the zero value. func InstrumentationScope(il instrumentation.Scope) *commonpb.InstrumentationScope { if il == (instrumentation.Scope{}) { return nil diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/resource.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/resource.go index 526bb5e070b..14e5bdc5630 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/resource.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/resource.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package tracetransform // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform" +package tracetransform import ( resourcepb "go.opentelemetry.io/proto/otlp/resource/v1" diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/span.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/span.go index d431fc4517d..3ab14b54fd1 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/span.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/span.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package tracetransform // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform" +package tracetransform import ( "math" @@ -37,21 +37,22 @@ func Spans(sdl []tracesdk.ReadOnlySpan) []*tracepb.ResourceSpans { } rKey := sd.Resource().Equivalent() + scope := sd.InstrumentationScope() k := key{ r: rKey, - is: sd.InstrumentationScope(), + is: scope, } scopeSpan, iOk := ssm[k] if !iOk { // Either the resource or instrumentation scope were unknown. scopeSpan = &tracepb.ScopeSpans{ - Scope: InstrumentationScope(sd.InstrumentationScope()), + Scope: InstrumentationScope(scope), Spans: []*tracepb.Span{}, - SchemaUrl: sd.InstrumentationScope().SchemaURL, + SchemaUrl: scope.SchemaURL, } + ssm[k] = scopeSpan } scopeSpan.Spans = append(scopeSpan.Spans, span(sd)) - ssm[k] = scopeSpan rs, rOk := rsm[rKey] if !rOk { @@ -90,14 +91,16 @@ func span(sd tracesdk.ReadOnlySpan) *tracepb.Span { return nil } - tid := sd.SpanContext().TraceID() - sid := sd.SpanContext().SpanID() + spanContext := sd.SpanContext() + tid := spanContext.TraceID() + sid := spanContext.SpanID() + sdStatus := sd.Status() s := &tracepb.Span{ TraceId: tid[:], SpanId: sid[:], - TraceState: sd.SpanContext().TraceState().String(), - Status: status(sd.Status().Code, sd.Status().Description), + TraceState: spanContext.TraceState().String(), + Status: status(sdStatus.Code, sdStatus.Description), StartTimeUnixNano: uint64(max(0, sd.StartTime().UnixNano())), // nolint:gosec // Overflow checked. EndTimeUnixNano: uint64(max(0, sd.EndTime().UnixNano())), // nolint:gosec // Overflow checked. Links: links(sd.Links()), @@ -110,10 +113,11 @@ func span(sd tracesdk.ReadOnlySpan) *tracepb.Span { DroppedLinksCount: clampUint32(sd.DroppedLinks()), } - if psid := sd.Parent().SpanID(); psid.IsValid() { + sdParent := sd.Parent() + if psid := sdParent.SpanID(); psid.IsValid() { s.ParentSpanId = psid[:] } - s.Flags = buildSpanFlagsWith(sd.SpanContext().TraceFlags(), sd.Parent()) + s.Flags = buildSpanFlagsWith(spanContext.TraceFlags(), sdParent) return s } diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/client.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/client.go index e8b33d3fa55..494bece44ea 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/client.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/client.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package otlptracegrpc // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc" +package otlptracegrpc import ( "context" @@ -328,12 +328,10 @@ func throttleDelay(s *status.Status) (bool, time.Duration) { } // MarshalLog is the marshaling function used by the logging system to represent this Client. -func (c *client) MarshalLog() any { +func (*client) MarshalLog() any { return struct { - Type string - Endpoint string + Type string }{ - Type: "otlptracegrpc", - Endpoint: c.endpoint, + Type: "otlptracegrpc", } } diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/doc.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/doc.go index b7bd429ffdf..3dbc8427544 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/doc.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/doc.go @@ -12,8 +12,9 @@ The environment variables described below can be used for configuration. OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_TRACES_ENDPOINT (default: "https://localhost:4317") - target to which the exporter sends telemetry. The target syntax is defined in https://github.com/grpc/grpc/blob/master/doc/naming.md. -The value must contain a scheme ("http" or "https") and host. -The value may additionally contain a port, and a path. +If the value uses the "http" or "https" scheme, the host and optional port are +used as the gRPC target and any path is ignored. +Values with other schemes are passed to gRPC as-is. The value should not contain a query string or fragment. OTEL_EXPORTER_OTLP_TRACES_ENDPOINT takes precedence over OTEL_EXPORTER_OTLP_ENDPOINT. The configuration can be overridden by [WithEndpoint], [WithEndpointURL], [WithInsecure], and [WithGRPCConn] options. @@ -62,4 +63,4 @@ The configuration can be overridden by [WithTLSCredentials], [WithGRPCConn] opti [W3C Baggage HTTP Header Content Format]: https://www.w3.org/TR/baggage/#header-content */ -package otlptracegrpc // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc" +package otlptracegrpc diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/exporter.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/exporter.go index b826b84247e..d75b18443d3 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/exporter.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/exporter.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package otlptracegrpc // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc" +package otlptracegrpc import ( "context" diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/counter/counter.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/counter/counter.go index 323b2a2c9a6..57c6acb781d 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/counter/counter.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/counter/counter.go @@ -1,14 +1,14 @@ -// Code generated by gotmpl. DO NOT MODIFY. -// source: internal/shared/counter/counter.go.tmpl - // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +// DO NOT MODIFY. Generated by gotmpl. +// source: internal/shared/counter/counter.go.tmpl + // Package counter provides a simple counter for generating unique IDs. // // This package is used to generate unique IDs while allowing testing packages // to reset the counter. -package counter // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/counter" +package counter import "sync/atomic" diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig/envconfig.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig/envconfig.go index 6eacdf311d2..87764a6952d 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig/envconfig.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig/envconfig.go @@ -1,12 +1,12 @@ -// Code generated by gotmpl. DO NOT MODIFY. -// source: internal/shared/otlp/envconfig/envconfig.go.tmpl - // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +// DO NOT MODIFY. Generated by gotmpl. +// source: internal/shared/otlp/envconfig/envconfig.go.tmpl + // Package envconfig provides functionality to parse configuration from // environment variables. -package envconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig" +package envconfig import ( "crypto/tls" @@ -60,7 +60,7 @@ func WithString(n string, fn func(string)) func(e *EnvOptionsReader) { func WithBool(n string, fn func(bool)) ConfigFn { return func(e *EnvOptionsReader) { if v, ok := e.GetEnvValue(n); ok { - b := strings.ToLower(v) == "true" + b := strings.EqualFold(v, "true") fn(b) } } diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/gen.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/gen.go index 7fe9c9f3a33..26066e33681 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/gen.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/gen.go @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // Package internal provides internal functionally for the otlptracegrpc package. -package internal // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal" +package internal //go:generate gotmpl --body=../../../../../internal/shared/otlp/partialsuccess.go.tmpl "--data={}" --out=partialsuccess.go //go:generate gotmpl --body=../../../../../internal/shared/otlp/partialsuccess_test.go.tmpl "--data={}" --out=partialsuccess_test.go @@ -14,8 +14,8 @@ package internal // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/ot //go:generate gotmpl --body=../../../../../internal/shared/otlp/envconfig/envconfig_test.go.tmpl "--data={}" --out=envconfig/envconfig_test.go //go:generate gotmpl --body=../../../../../internal/shared/otlp/otlptrace/otlpconfig/envconfig.go.tmpl "--data={\"envconfigImportPath\": \"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig\"}" --out=otlpconfig/envconfig.go -//go:generate gotmpl --body=../../../../../internal/shared/otlp/otlptrace/otlpconfig/options.go.tmpl "--data={\"retryImportPath\": \"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry\"}" --out=otlpconfig/options.go -//go:generate gotmpl --body=../../../../../internal/shared/otlp/otlptrace/otlpconfig/options_test.go.tmpl "--data={\"envconfigImportPath\": \"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig\"}" --out=otlpconfig/options_test.go +//go:generate gotmpl --body=../../../../../internal/shared/otlp/otlptrace/otlpconfig/options.go.tmpl "--data={\"isHTTP\": false, \"retryImportPath\": \"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry\"}" --out=otlpconfig/options.go +//go:generate gotmpl --body=../../../../../internal/shared/otlp/otlptrace/otlpconfig/options_test.go.tmpl "--data={\"isHTTP\": false, \"envconfigImportPath\": \"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig\"}" --out=otlpconfig/options_test.go //go:generate gotmpl --body=../../../../../internal/shared/otlp/otlptrace/otlpconfig/optiontypes.go.tmpl "--data={}" --out=otlpconfig/optiontypes.go //go:generate gotmpl --body=../../../../../internal/shared/otlp/otlptrace/otlpconfig/tls.go.tmpl "--data={}" --out=otlpconfig/tls.go @@ -27,8 +27,8 @@ package internal // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/ot //go:generate gotmpl --body=../../../../../internal/shared/x/x.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc\" }" --out=x/x.go //go:generate gotmpl --body=../../../../../internal/shared/x/x_test.go.tmpl "--data={}" --out=x/x_test.go -//go:generate gotmpl --body=../../../../../internal/shared/otlp/observ/target.go.tmpl "--data={ \"pkg\": \"observ\", \"pkg_path\": \"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/observ\" }" --out=observ/target.go +//go:generate gotmpl --body=../../../../../internal/shared/otlp/observ/target.go.tmpl "--data={ \"pkg\": \"observ\" }" --out=observ/target.go //go:generate gotmpl --body=../../../../../internal/shared/otlp/observ/target_test.go.tmpl "--data={ \"pkg\": \"observ\" }" --out=observ/target_test.go -//go:generate gotmpl --body=../../../../../internal/shared/counter/counter.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/counter\" }" --out=counter/counter.go +//go:generate gotmpl --body=../../../../../internal/shared/counter/counter.go.tmpl "--data={}" --out=counter/counter.go //go:generate gotmpl --body=../../../../../internal/shared/counter/counter_test.go.tmpl "--data={}" --out=counter/counter_test.go diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/observ/doc.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/observ/doc.go index 0dd54e4b969..32188bf72be 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/observ/doc.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/observ/doc.go @@ -3,4 +3,4 @@ // Package observ provides experimental observability instrumentation for the // otlptracegrpc exporter. -package observ // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/observ" +package observ diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/observ/instrumentation.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/observ/instrumentation.go index 676a93514bd..d6730bc1ecd 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/observ/instrumentation.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/observ/instrumentation.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package observ // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/observ" +package observ import ( "context" @@ -18,8 +18,8 @@ import ( "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/x" "go.opentelemetry.io/otel/internal/global" "go.opentelemetry.io/otel/metric" - semconv "go.opentelemetry.io/otel/semconv/v1.41.0" - "go.opentelemetry.io/otel/semconv/v1.41.0/otelconv" + semconv "go.opentelemetry.io/otel/semconv/v1.43.0" + "go.opentelemetry.io/otel/semconv/v1.43.0/otelconv" ) const ( diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/observ/target.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/observ/target.go index 34eee27db0d..3bd37988298 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/observ/target.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/observ/target.go @@ -1,10 +1,10 @@ -// Code generated by gotmpl. DO NOT MODIFY. -// source: internal/shared/otlp/observ/target.go.tmpl - // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package observ // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/observ" +// DO NOT MODIFY. Generated by gotmpl. +// source: internal/shared/otlp/observ/target.go.tmpl + +package observ import ( "errors" @@ -21,13 +21,13 @@ const ( ) // ParseCanonicalTarget parses a target string and returns the extracted host -// (domain address or IP), the target port, or an error. +// (domain name or IP address), the target port, or an error. // // If no port is specified, -1 is returned. // // If no host is specified, an empty string is returned. // -// The target string is expected to always have the form +// The target string must have the form // "://[authority]/". For example: // - "dns:///example.com:42" // - "dns://8.8.8.8/example.com:42" @@ -35,17 +35,16 @@ const ( // - "unix-abstract:///socket-name" // - "passthrough:///192.34.2.1:42" // -// The target is expected to come from the CanonicalTarget method of a gRPC -// Client. +// The target is expected to be returned by gRPC's ClientConn.CanonicalTarget +// method. func ParseCanonicalTarget(target string) (string, int, error) { const sep = "://" // Find scheme. Do not allocate the string by using url.Parse. - idx := strings.Index(target, sep) - if idx == -1 { + scheme, endpoint, found := strings.Cut(target, sep) + if !found { return "", -1, fmt.Errorf("invalid target %q: missing scheme", target) } - scheme, endpoint := target[:idx], target[idx+len(sep):] // Check for unix schemes. if scheme == schemeUnix || scheme == schemeUnixAbstract { @@ -61,7 +60,7 @@ func ParseCanonicalTarget(target string) (string, int, error) { return parseEndpoint(endpoint) } -// parseUnix parses unix socket targets. +// parseUnix parses Unix socket targets. func parseUnix(endpoint string) (string, int, error) { // Format: unix[-abstract]://path // @@ -71,8 +70,8 @@ func parseUnix(endpoint string) (string, int, error) { return endpoint, -1, nil } - // If there's no leading slash, it means there might be an authority - // Check for authority case (should error): "authority/path" + // If there is no leading slash, an authority might be present, which is + // invalid. Check for this case: "authority/path". if slashIdx := strings.Index(endpoint, "/"); slashIdx > 0 { return "", -1, fmt.Errorf("invalid (non-empty) authority: %s", endpoint[:slashIdx]) } @@ -98,8 +97,8 @@ func parseUnix(endpoint string) (string, int, error) { // - "[ipv6]:port" // - "[ipv6%zone]:port" // -// It returns the host or host%zone (domain address or IP), the port (or -1 if -// not specified), or an error if the input is not a valid. +// It returns the host or host%zone (domain name or IP address), the port (or +// -1 if not specified), or an error if the input is invalid. func parseEndpoint(endpoint string) (string, int, error) { // First check if the endpoint is just an IP address. if ip := parseIP(endpoint); ip != "" { diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/envconfig.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/envconfig.go index 1d840be205b..ce41a22ebfe 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/envconfig.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/envconfig.go @@ -1,10 +1,10 @@ -// Code generated by gotmpl. DO NOT MODIFY. -// source: internal/shared/otlp/otlptrace/otlpconfig/envconfig.go.tmpl - // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package otlpconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig" +// DO NOT MODIFY. Generated by gotmpl. +// source: internal/shared/otlp/otlptrace/otlpconfig/envconfig.go.tmpl + +package otlpconfig import ( "crypto/tls" @@ -49,31 +49,37 @@ func getOptionsFromEnv() []GenericOption { tlsConf := &tls.Config{} DefaultEnvOptionsReader.Apply( envconfig.WithURL("ENDPOINT", func(u *url.URL) { - opts = append(opts, withEndpointScheme(u)) - opts = append(opts, newSplitOption(func(cfg Config) Config { - cfg.Traces.Endpoint = u.Host - // For OTLP/HTTP endpoint URLs without a per-signal - // configuration, the passed endpoint is used as a base URL - // and the signals are sent to these paths relative to that. - cfg.Traces.URLPath = path.Join(u.Path, DefaultTracesPath) - return cfg - }, withEndpointForGRPC(u))) + opts = append( + opts, + withEndpointScheme(u), + newSplitOption(func(cfg Config) Config { + cfg.Traces.Endpoint = u.Host + // For OTLP/HTTP endpoint URLs without a per-signal + // configuration, the passed endpoint is used as a base URL + // and the signals are sent to these paths relative to that. + cfg.Traces.URLPath = path.Join(u.Path, DefaultTracesPath) + return cfg + }, withEndpointForGRPC(u)), + ) }), envconfig.WithURL("TRACES_ENDPOINT", func(u *url.URL) { - opts = append(opts, withEndpointScheme(u)) - opts = append(opts, newSplitOption(func(cfg Config) Config { - cfg.Traces.Endpoint = u.Host - // For endpoint URLs for OTLP/HTTP per-signal variables, the - // URL MUST be used as-is without any modification. The only - // exception is that if an URL contains no path part, the root - // path / MUST be used. - path := u.Path - if path == "" { - path = "/" - } - cfg.Traces.URLPath = path - return cfg - }, withEndpointForGRPC(u))) + opts = append( + opts, + withEndpointScheme(u), + newSplitOption(func(cfg Config) Config { + cfg.Traces.Endpoint = u.Host + // For endpoint URLs for OTLP/HTTP per-signal variables, the + // URL MUST be used as-is without any modification. The only + // exception is that if an URL contains no path part, the root + // path / MUST be used. + path := u.Path + if path == "" { + path = "/" + } + cfg.Traces.URLPath = path + return cfg + }, withEndpointForGRPC(u)), + ) }), envconfig.WithCertPool("CERTIFICATE", func(p *x509.CertPool) { tlsConf.RootCAs = p }), envconfig.WithCertPool("TRACES_CERTIFICATE", func(p *x509.CertPool) { tlsConf.RootCAs = p }), @@ -94,6 +100,8 @@ func getOptionsFromEnv() []GenericOption { envconfig.WithHeaders("TRACES_HEADERS", func(h map[string]string) { opts = append(opts, WithHeaders(h)) }), WithEnvCompression("COMPRESSION", func(c Compression) { opts = append(opts, WithCompression(c)) }), WithEnvCompression("TRACES_COMPRESSION", func(c Compression) { opts = append(opts, WithCompression(c)) }), + WithEnvProtocol("PROTOCOL", func(p Protocol) { opts = append(opts, WithProtocol(p)) }), + WithEnvProtocol("TRACES_PROTOCOL", func(p Protocol) { opts = append(opts, WithProtocol(p)) }), envconfig.WithDuration("TIMEOUT", func(d time.Duration) { opts = append(opts, WithTimeout(d)) }), envconfig.WithDuration("TRACES_TIMEOUT", func(d time.Duration) { opts = append(opts, WithTimeout(d)) }), ) @@ -111,10 +119,20 @@ func withEndpointScheme(u *url.URL) GenericOption { } func withEndpointForGRPC(u *url.URL) func(cfg Config) Config { + target := u.String() + switch strings.ToLower(u.Scheme) { + case "http", "https": + target = u.Host + case "": + if u.Host != "" { + target = path.Join(u.Host, u.Path) + } + } + return func(cfg Config) Config { // For OTLP/gRPC endpoints, this is the target to which the // exporter is going to send telemetry. - cfg.Traces.Endpoint = path.Join(u.Host, u.Path) + cfg.Traces.Endpoint = target return cfg } } @@ -133,6 +151,25 @@ func WithEnvCompression(n string, fn func(Compression)) func(e *envconfig.EnvOpt } } +// WithEnvProtocol retrieves the specified config and passes it to ConfigFn as a Protocol. +func WithEnvProtocol(n string, fn func(Protocol)) func(e *envconfig.EnvOptionsReader) { + return func(e *envconfig.EnvOptionsReader) { + if v, ok := e.GetEnvValue(n); ok { + protocol := ProtocolHTTPProtobuf + switch v { + case "grpc": + protocol = ProtocolGRPC + case "http/protobuf": + protocol = ProtocolHTTPProtobuf + case "http/json": + protocol = ProtocolHTTPJSON + } + + fn(protocol) + } + } +} + // revive:disable-next-line:flag-parameter func withInsecure(b bool) GenericOption { if b { @@ -142,7 +179,7 @@ func withInsecure(b bool) GenericOption { } func withTLSConfig(c *tls.Config, fn func(*tls.Config)) func(e *envconfig.EnvOptionsReader) { - return func(e *envconfig.EnvOptionsReader) { + return func(*envconfig.EnvOptionsReader) { if c.RootCAs != nil || len(c.Certificates) > 0 { fn(c) } diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/options.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/options.go index d940b67625f..b990dd3f77f 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/options.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/options.go @@ -1,11 +1,11 @@ -// Code generated by gotmpl. DO NOT MODIFY. -// source: internal/shared/otlp/otlptrace/otlpconfig/options.go.tmpl - // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +// DO NOT MODIFY. Generated by gotmpl. +// source: internal/shared/otlp/otlptrace/otlpconfig/options.go.tmpl + // Package otlpconfig provides configuration for the otlptrace exporters. -package otlpconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig" +package otlpconfig import ( "crypto/tls" @@ -44,12 +44,14 @@ type ( // This type is compatible with `http.Transport.Proxy` and can be used to set a custom proxy function to the OTLP HTTP client. HTTPTransportProxyFunc func(*http.Request) (*url.URL, error) + // SignalConfig holds the configuration for exporting a single signal. SignalConfig struct { Endpoint string Insecure bool TLSCfg *tls.Config Headers map[string]string Compression Compression + Protocol Protocol MaxRequestSize int Timeout time.Duration URLPath string @@ -62,6 +64,7 @@ type ( HTTPClient *http.Client } + // Config holds the configuration for an otlptrace exporter. Config struct { // Signal specific configurations Traces SignalConfig @@ -84,6 +87,7 @@ func NewHTTPConfig(opts ...HTTPOption) Config { Endpoint: fmt.Sprintf("%s:%d", DefaultCollectorHost, DefaultCollectorHTTPPort), URLPath: DefaultTracesPath, Compression: NoCompression, + Protocol: ProtocolHTTPProtobuf, MaxRequestSize: DefaultMaxRequestSize, Timeout: DefaultTimeout, }, @@ -99,7 +103,7 @@ func NewHTTPConfig(opts ...HTTPOption) Config { // cleanPath returns a path with all spaces trimmed. If urlPath is empty, // defaultPath is returned instead. -func cleanPath(urlPath string, defaultPath string) string { +func cleanPath(urlPath, defaultPath string) string { tmp := strings.TrimSpace(urlPath) if tmp == "" || tmp == "." { return defaultPath @@ -119,41 +123,47 @@ func NewGRPCConfig(opts ...GRPCOption) Config { Endpoint: fmt.Sprintf("%s:%d", DefaultCollectorHost, DefaultCollectorGRPCPort), URLPath: DefaultTracesPath, Compression: NoCompression, + Protocol: ProtocolGRPC, MaxRequestSize: DefaultMaxRequestSize, Timeout: DefaultTimeout, }, RetryConfig: retry.DefaultConfig, - DialOptions: []grpc.DialOption{grpc.WithUserAgent(userAgent)}, } cfg = ApplyGRPCEnvConfigs(cfg) for _, opt := range opts { cfg = opt.ApplyGRPCOption(cfg) } + // dialOptsPrefix holds the internally computed defaults. It is prepended + // to cfg.DialOptions so that a raw grpc.DialOption supplied via WithDialOption + // always takes precedence: grpc.DialOption values are opaque closures, so this code has no way to + // detect a conflicting user-supplied option and defer to it instead. + dialOptsPrefix := []grpc.DialOption{grpc.WithUserAgent(userAgent)} if cfg.ServiceConfig != "" { - cfg.DialOptions = append(cfg.DialOptions, grpc.WithDefaultServiceConfig(cfg.ServiceConfig)) + dialOptsPrefix = append(dialOptsPrefix, grpc.WithDefaultServiceConfig(cfg.ServiceConfig)) } // Prioritize GRPCCredentials over Insecure (passing both is an error). - if cfg.Traces.GRPCCredentials != nil { - cfg.DialOptions = append(cfg.DialOptions, grpc.WithTransportCredentials(cfg.Traces.GRPCCredentials)) + if cfg.Traces.GRPCCredentials != nil { //nolint:gocritic // if-else is clearer than switch + dialOptsPrefix = append(dialOptsPrefix, grpc.WithTransportCredentials(cfg.Traces.GRPCCredentials)) } else if cfg.Traces.Insecure { - cfg.DialOptions = append(cfg.DialOptions, grpc.WithTransportCredentials(insecure.NewCredentials())) + dialOptsPrefix = append(dialOptsPrefix, grpc.WithTransportCredentials(insecure.NewCredentials())) } else { // Default to using the host's root CA. creds := credentials.NewTLS(nil) cfg.Traces.GRPCCredentials = creds - cfg.DialOptions = append(cfg.DialOptions, grpc.WithTransportCredentials(creds)) + dialOptsPrefix = append(dialOptsPrefix, grpc.WithTransportCredentials(creds)) } if cfg.Traces.Compression == GzipCompression { - cfg.DialOptions = append(cfg.DialOptions, grpc.WithDefaultCallOptions(grpc.UseCompressor(gzip.Name))) + dialOptsPrefix = append(dialOptsPrefix, grpc.WithDefaultCallOptions(grpc.UseCompressor(gzip.Name))) } if cfg.ReconnectionPeriod != 0 { p := grpc.ConnectParams{ Backoff: backoff.DefaultConfig, MinConnectTimeout: cfg.ReconnectionPeriod, } - cfg.DialOptions = append(cfg.DialOptions, grpc.WithConnectParams(p)) + dialOptsPrefix = append(dialOptsPrefix, grpc.WithConnectParams(p)) } + cfg.DialOptions = append(dialOptsPrefix, cfg.DialOptions...) return cfg } @@ -228,7 +238,7 @@ func (g *splitOption) ApplyHTTPOption(cfg Config) Config { func (splitOption) private() {} -func newSplitOption(httpFn func(cfg Config) Config, grpcFn func(cfg Config) Config) GenericOption { +func newSplitOption(httpFn, grpcFn func(cfg Config) Config) GenericOption { return &splitOption{httpFn: httpFn, grpcFn: grpcFn} } @@ -243,6 +253,7 @@ func (h *httpOption) ApplyHTTPOption(cfg Config) Config { func (httpOption) private() {} +// NewHTTPOption creates an option that is only applied to the HTTP driver. func NewHTTPOption(fn func(cfg Config) Config) HTTPOption { return &httpOption{fn: fn} } @@ -258,6 +269,7 @@ func (h *grpcOption) ApplyGRPCOption(cfg Config) Config { func (grpcOption) private() {} +// NewGRPCOption creates an option that is only applied to the gRPC driver. func NewGRPCOption(fn func(cfg Config) Config) GRPCOption { return &grpcOption{fn: fn} } @@ -286,12 +298,18 @@ func WithEndpointURL(v string) GenericOption { cfg.Traces.Endpoint = u.Host cfg.Traces.URLPath = u.Path + if cfg.Traces.URLPath == "" { + // For HTTP exporters, a URL without a path targets the root path. Set it explicitly so the default signal + // path is not appended by cleanPath. (URLPath is ignored by gRPC exporters.) + cfg.Traces.URLPath = "/" + } cfg.Traces.Insecure = u.Scheme != "https" return cfg }) } +// WithCompression configures the compression used for exports. func WithCompression(compression Compression) GenericOption { return newGenericOption(func(cfg Config) Config { cfg.Traces.Compression = compression @@ -299,6 +317,7 @@ func WithCompression(compression Compression) GenericOption { }) } +// WithURLPath configures the URL path the exporter sends requests to. func WithURLPath(urlPath string) GenericOption { return newGenericOption(func(cfg Config) Config { cfg.Traces.URLPath = urlPath @@ -306,6 +325,7 @@ func WithURLPath(urlPath string) GenericOption { }) } +// WithRetry configures the retry policy used on failed exports. func WithRetry(rc retry.Config) GenericOption { return newGenericOption(func(cfg Config) Config { cfg.RetryConfig = rc @@ -313,6 +333,8 @@ func WithRetry(rc retry.Config) GenericOption { }) } +// WithTLSClientConfig configures the TLS configuration used by the +// exporter's client. func WithTLSClientConfig(tlsCfg *tls.Config) GenericOption { return newSplitOption(func(cfg Config) Config { cfg.Traces.TLSCfg = tlsCfg.Clone() @@ -323,6 +345,8 @@ func WithTLSClientConfig(tlsCfg *tls.Config) GenericOption { }) } +// WithInsecure disables client transport security for the exporter's +// connection. func WithInsecure() GenericOption { return newGenericOption(func(cfg Config) Config { cfg.Traces.Insecure = true @@ -330,6 +354,8 @@ func WithInsecure() GenericOption { }) } +// WithSecure enables client transport security for the exporter's +// connection. func WithSecure() GenericOption { return newGenericOption(func(cfg Config) Config { cfg.Traces.Insecure = false @@ -337,6 +363,7 @@ func WithSecure() GenericOption { }) } +// WithHeaders configures headers sent with every export request. func WithHeaders(headers map[string]string) GenericOption { return newGenericOption(func(cfg Config) Config { cfg.Traces.Headers = headers @@ -344,6 +371,8 @@ func WithHeaders(headers map[string]string) GenericOption { }) } +// WithTimeout configures the max waiting time for the backend to process +// each export batch. func WithTimeout(duration time.Duration) GenericOption { return newGenericOption(func(cfg Config) Config { cfg.Traces.Timeout = duration @@ -351,6 +380,8 @@ func WithTimeout(duration time.Duration) GenericOption { }) } +// WithMaxRequestSize configures the maximum size, in bytes, of a serialized +// export request, before compression. func WithMaxRequestSize(size int) GenericOption { return newGenericOption(func(cfg Config) Config { cfg.Traces.MaxRequestSize = size @@ -358,6 +389,8 @@ func WithMaxRequestSize(size int) GenericOption { }) } +// WithProxy configures the proxy function used by the exporter's HTTP +// client. func WithProxy(pf HTTPTransportProxyFunc) GenericOption { return newGenericOption(func(cfg Config) Config { cfg.Traces.Proxy = pf @@ -365,9 +398,33 @@ func WithProxy(pf HTTPTransportProxyFunc) GenericOption { }) } +// WithHTTPClient configures the HTTP client used to make requests. func WithHTTPClient(c *http.Client) GenericOption { return newGenericOption(func(cfg Config) Config { cfg.Traces.HTTPClient = c return cfg }) } + +// WithProtocol configures the protocol used to encode and send telemetry. +func WithProtocol(protocol Protocol) GenericOption { + return newSplitOption( + // For OTLP/HTTP endpoints, this is the encoding format of the payloads sent to the collector. + func(cfg Config) Config { + if protocol == ProtocolGRPC { + global.Warn("grpc is not a valid protocol for OTLP/HTTP, defaulting to http/protobuf") + protocol = ProtocolHTTPProtobuf + } + cfg.Traces.Protocol = protocol + return cfg + }, + // For OTLP/gRPC endpoints, it's always "grpc". + func(cfg Config) Config { + if protocol != ProtocolGRPC { + global.Debug("protocol option is ignored for OTLP/gRPC and is set to grpc") + } + cfg.Traces.Protocol = ProtocolGRPC + return cfg + }, + ) +} diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/optiontypes.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/optiontypes.go index 91849038722..4f2da74275b 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/optiontypes.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/optiontypes.go @@ -1,10 +1,10 @@ -// Code generated by gotmpl. DO NOT MODIFY. -// source: internal/shared/otlp/otlptrace/otlpconfig/optiontypes.go.tmpl - // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package otlpconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig" +// DO NOT MODIFY. Generated by gotmpl. +// source: internal/shared/otlp/otlptrace/otlpconfig/optiontypes.go.tmpl + +package otlpconfig const ( // DefaultCollectorGRPCPort is the default gRPC port of the collector. @@ -38,3 +38,15 @@ const ( // MarshalJSON tells the driver to send using json format. MarshalJSON ) + +// Protocol describes the transport protocol used to send data to the collector. +type Protocol int + +const ( + // ProtocolGRPC describes the "grpc" protocol. + ProtocolGRPC Protocol = iota + // ProtocolHTTPProtobuf describes the "http/protobuf" protocol. + ProtocolHTTPProtobuf + // ProtocolHTTPJSON describes the "http/json" protocol. + ProtocolHTTPJSON +) diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/tls.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/tls.go index ba6e411835f..a14d5e6ecfe 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/tls.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/tls.go @@ -1,10 +1,10 @@ -// Code generated by gotmpl. DO NOT MODIFY. -// source: internal/shared/otlp/otlptrace/otlpconfig/tls.go.tmpl - // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package otlpconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig" +// DO NOT MODIFY. Generated by gotmpl. +// source: internal/shared/otlp/otlptrace/otlpconfig/tls.go.tmpl + +package otlpconfig import ( "crypto/tls" diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/partialsuccess.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/partialsuccess.go index a811a07b352..1138f2e718b 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/partialsuccess.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/partialsuccess.go @@ -1,10 +1,10 @@ -// Code generated by gotmpl. DO NOT MODIFY. -// source: internal/shared/otlp/partialsuccess.go - // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package internal // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal" +// DO NOT MODIFY. Generated by gotmpl. +// source: internal/shared/otlp/partialsuccess.go + +package internal import "fmt" @@ -41,7 +41,7 @@ func (ps PartialSuccess) As(target any) bool { } // Is supports the errors.Is() interface. -func (ps PartialSuccess) Is(err error) bool { +func (PartialSuccess) Is(err error) bool { _, ok := err.(PartialSuccess) return ok } diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry/retry.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry/retry.go index a7b8e81a786..468c7c8eb9f 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry/retry.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry/retry.go @@ -1,13 +1,13 @@ -// Code generated by gotmpl. DO NOT MODIFY. -// source: internal/shared/otlp/retry/retry.go.tmpl - // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +// DO NOT MODIFY. Generated by gotmpl. +// source: internal/shared/otlp/retry/retry.go.tmpl + // Package retry provides request retry functionality that can perform // configurable exponential backoff for transient errors and honor any // explicit throttle responses received. -package retry // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry" +package retry import ( "context" @@ -17,7 +17,7 @@ import ( "github.com/cenkalti/backoff/v5" ) -// DefaultConfig are the recommended defaults to use. +// DefaultConfig is the recommended default configuration. var DefaultConfig = Config{ Enabled: true, InitialInterval: 5 * time.Second, @@ -25,42 +25,40 @@ var DefaultConfig = Config{ MaxElapsedTime: time.Minute, } -// Config defines configuration for retrying batches in case of export failure -// using an exponential backoff. +// Config defines configuration for retrying batches after an export failure +// using exponential backoff. type Config struct { - // Enabled indicates whether to not retry sending batches in case of - // export failure. + // Enabled indicates whether to retry sending batches after an export + // failure. Enabled bool - // InitialInterval the time to wait after the first failure before + // InitialInterval is the time to wait after the first failure before // retrying. InitialInterval time.Duration - // MaxInterval is the upper bound on backoff interval. Once this value is - // reached the delay between consecutive retries will always be - // `MaxInterval`. + // MaxInterval is the upper bound on the backoff interval before + // randomization. Once this value is reached, the base interval remains at + // MaxInterval. MaxInterval time.Duration // MaxElapsedTime is the maximum amount of time (including retries) spent - // trying to send a request/batch. Once this value is reached, the data - // is discarded. + // trying to send a request/batch. Once this value is reached, retrying stops. MaxElapsedTime time.Duration } // RequestFunc wraps a request with retry logic. type RequestFunc func(context.Context, func(context.Context) error) error -// EvaluateFunc returns if an error is retry-able and if an explicit throttle -// duration should be honored that was included in the error. +// EvaluateFunc reports whether an error is retryable and returns any explicit +// throttle duration to honor. // -// The function must return true if the error argument is retry-able, -// otherwise it must return false for the first return parameter. +// The function must return true as its first return value if the error +// argument is retryable; otherwise, it must return false. // -// The function must return a non-zero time.Duration if the error contains -// explicit throttle duration that should be honored, otherwise it must return -// a zero valued time.Duration. +// The function must return a nonzero time.Duration if the error contains an +// explicit throttle duration that should be honored; otherwise, it must return +// the zero value for time.Duration. type EvaluateFunc func(error) (bool, time.Duration) -// RequestFunc returns a RequestFunc using the evaluate function to determine -// if requests can be retried and based on the exponential backoff -// configuration of c. +// RequestFunc returns a RequestFunc that uses evaluate to determine whether +// requests can be retried and uses c to configure exponential backoff. func (c Config) RequestFunc(evaluate EvaluateFunc) RequestFunc { if !c.Enabled { return func(ctx context.Context, fn func(context.Context) error) error { @@ -96,7 +94,7 @@ func (c Config) RequestFunc(evaluate EvaluateFunc) RequestFunc { // Check if context is canceled before attempting to wait and retry. if ctx.Err() != nil { - return fmt.Errorf("%w: %w", ctx.Err(), err) + return fmt.Errorf("%w: %w", context.Cause(ctx), err) } if maxElapsedTime != 0 && time.Since(startTime) > maxElapsedTime { @@ -119,12 +117,12 @@ func (c Config) RequestFunc(evaluate EvaluateFunc) RequestFunc { } } -// Allow override for testing. +// waitFunc can be overridden for testing. var waitFunc = wait -// wait takes the caller's context, and the amount of time to wait. It will -// return nil if the timer fires before or at the same time as the context's -// deadline. This indicates that the call can be retried. +// wait blocks until delay elapses or ctx is done. If both happen +// simultaneously, wait favors the elapsed delay and returns nil to indicate +// that the call can be retried. func wait(ctx context.Context, delay time.Duration) error { timer := time.NewTimer(delay) defer timer.Stop() diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/version.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/version.go index 28e51e443fc..badf29557ad 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/version.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/version.go @@ -1,8 +1,8 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package internal // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal" +package internal // Version is the current release version of the OpenTelemetry OTLP gRPC trace // exporter in use. -const Version = "1.44.0" +const Version = "1.47.0" diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/x/observ.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/x/observ.go index 4e89c6524f0..76b6fdebdb0 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/x/observ.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/x/observ.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package x // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/x" +package x import "strings" diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/x/x.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/x/x.go index 741ba62c97f..71011358c2f 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/x/x.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/x/x.go @@ -1,11 +1,11 @@ -// Code generated by gotmpl. DO NOT MODIFY. -// source: internal/shared/x/x.go.tmpl - // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +// DO NOT MODIFY. Generated by gotmpl. +// source: internal/shared/x/x.go.tmpl + // Package x documents experimental features for [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc]. -package x // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/x" +package x import ( "os" @@ -34,9 +34,9 @@ func newFeature[T any](suffix []string, parse func(string) (T, bool)) Feature[T] // feature. func (f Feature[T]) Keys() []string { return f.keys } -// Lookup returns the user configured value for the feature and true if the +// Lookup returns the user-configured value for the feature and true if the // user has enabled the feature. Otherwise, if the feature is not enabled, a -// zero-value and false are returned. +// zero value and false are returned. func (f Feature[T]) Lookup() (v T, ok bool) { // https://github.com/open-telemetry/opentelemetry-specification/blob/62effed618589a0bec416a87e559c0a9d96289bb/specification/configuration/sdk-environment-variables.md#parsing-empty-value // diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/options.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/options.go index b320060525e..516113b786c 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/options.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/options.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package otlptracegrpc // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc" +package otlptracegrpc import ( "fmt" @@ -74,9 +74,10 @@ func WithEndpoint(endpoint string) Option { return wrappedOption{otlpconfig.WithEndpoint(endpoint)} } -// WithEndpointURL sets the target endpoint URL (scheme, host, port, path) -// the Exporter will connect to. The provided endpoint URL should resemble -// "https://example.com:4318/v1/traces". +// WithEndpointURL sets the target endpoint URL (scheme, host, port) the +// Exporter will connect to. The provided endpoint URL should resemble +// "https://example.com:4317". If the URL contains a path, it is ignored by +// the gRPC client. // // If the OTEL_EXPORTER_OTLP_ENDPOINT or OTEL_EXPORTER_OTLP_TRACES_ENDPOINT // environment variable is set, and this option is not passed, that variable @@ -90,7 +91,7 @@ func WithEndpoint(endpoint string) Option { // If an invalid URL is provided, the default value will be kept. // // By default, if an environment variable is not set, and this option is not -// passed, "https://localhost:4317/v1/traces" will be used. +// passed, "https://localhost:4317" will be used. // // This option has no effect if WithGRPCConn is used. func WithEndpointURL(u string) Option { diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go index d847210dbaf..78e4f8e6145 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go @@ -1,9 +1,9 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package otlptrace // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace" +package otlptrace // Version is the current release version of the OpenTelemetry OTLP trace exporter in use. func Version() string { - return "1.44.0" + return "1.47.0" } diff --git a/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go b/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go index cbeb14fcd87..d682f8c811e 100644 --- a/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go +++ b/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go @@ -16,12 +16,35 @@ package baggage // but OpenTelemetry does not, therefore, this is represented as a map. type List map[string]Item -// Item is the value and metadata properties part of a list-member. +// Item is the value and metadata or properties part of a list-member. +// Metadata and properties are mutually exclusive representations. type Item struct { - Value string - Properties []Property + value string + metadata string + properties []Property } +// NewItemWithMetadata returns an Item with opaque W3C metadata. +func NewItemWithMetadata(value, metadata string) Item { + return Item{value: value, metadata: metadata} +} + +// NewItemWithProperties returns an Item with materialized properties. +func NewItemWithProperties(value string, properties []Property) Item { + return Item{value: value, properties: properties} +} + +// Value returns the value of i. +func (i Item) Value() string { return i.value } + +// Metadata returns the opaque W3C metadata of i. It is empty for an Item +// created with properties. +func (i Item) Metadata() string { return i.metadata } + +// Properties returns the materialized properties of i. It is nil for an Item +// created with metadata. +func (i Item) Properties() []Property { return i.properties } + // Property is a metadata entry for a list-member. type Property struct { Key, Value string diff --git a/vendor/go.opentelemetry.io/otel/internal/errorhandler/errorhandler.go b/vendor/go.opentelemetry.io/otel/internal/errorhandler/errorhandler.go index de294461c7f..1234ead63c0 100644 --- a/vendor/go.opentelemetry.io/otel/internal/errorhandler/errorhandler.go +++ b/vendor/go.opentelemetry.io/otel/internal/errorhandler/errorhandler.go @@ -21,6 +21,9 @@ type ErrorHandler interface { Handle(error) } +// ErrDelegator is an ErrorHandler that forwards errors to a delegate +// ErrorHandler set with setDelegate. Before a delegate is set, it logs +// errors to STDERR. type ErrDelegator struct { delegate atomic.Pointer[ErrorHandler] } @@ -28,6 +31,8 @@ type ErrDelegator struct { // Compile-time check that delegator implements ErrorHandler. var _ ErrorHandler = (*ErrDelegator)(nil) +// Handle handles err by forwarding it to the configured delegate, or +// logging it to STDERR if no delegate is set. func (d *ErrDelegator) Handle(err error) { if eh := d.delegate.Load(); eh != nil { (*eh).Handle(err) diff --git a/vendor/go.opentelemetry.io/otel/internal/global/logger.go b/vendor/go.opentelemetry.io/otel/internal/global/logger.go new file mode 100644 index 00000000000..e4328daa91e --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/global/logger.go @@ -0,0 +1,96 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package global + +import ( + "context" + "sync" + "sync/atomic" + + "go.opentelemetry.io/otel/log" + "go.opentelemetry.io/otel/log/embedded" +) + +type loggerProvider struct { + embedded.LoggerProvider + + mu sync.Mutex + loggers map[il]*logger + delegate log.LoggerProvider +} + +// This is a compile-time guarantee that loggerProvider implements LoggerProvider. +var _ log.LoggerProvider = (*loggerProvider)(nil) + +func (p *loggerProvider) Logger(name string, options ...log.LoggerOption) log.Logger { + p.mu.Lock() + defer p.mu.Unlock() + + if p.delegate != nil { + return p.delegate.Logger(name, options...) + } + + cfg := log.NewLoggerConfig(options...) + key := il{ + name: name, + version: cfg.InstrumentationVersion(), + schema: cfg.SchemaURL(), + attrs: cfg.InstrumentationAttributes(), + } + + if p.loggers == nil { + l := &logger{name: name, options: options} + p.loggers = map[il]*logger{key: l} + return l + } + + if l, ok := p.loggers[key]; ok { + return l + } + + l := &logger{name: name, options: options} + p.loggers[key] = l + return l +} + +func (p *loggerProvider) setDelegate(provider log.LoggerProvider) { + p.mu.Lock() + defer p.mu.Unlock() + + p.delegate = provider + for _, l := range p.loggers { + l.setDelegate(provider) + } + p.loggers = nil // Only set logger delegates once. +} + +type logger struct { + embedded.Logger + + name string + options []log.LoggerOption + + delegate atomic.Value // log.Logger +} + +// This is a compile-time guarantee that logger implements Logger. +var _ log.Logger = (*logger)(nil) + +func (l *logger) Emit(ctx context.Context, r log.Record) { + if del, ok := l.delegate.Load().(log.Logger); ok { + del.Emit(ctx, r) + } +} + +func (l *logger) Enabled(ctx context.Context, param log.EnabledParameters) bool { + var enabled bool + if del, ok := l.delegate.Load().(log.Logger); ok { + enabled = del.Enabled(ctx, param) + } + return enabled +} + +func (l *logger) setDelegate(provider log.LoggerProvider) { + l.delegate.Store(provider.Logger(l.name, l.options...)) +} diff --git a/vendor/go.opentelemetry.io/otel/internal/global/state.go b/vendor/go.opentelemetry.io/otel/internal/global/state.go index f8fcb82bcb0..bd388d8341a 100644 --- a/vendor/go.opentelemetry.io/otel/internal/global/state.go +++ b/vendor/go.opentelemetry.io/otel/internal/global/state.go @@ -9,6 +9,7 @@ import ( "sync/atomic" "go.opentelemetry.io/otel/internal/errorhandler" + "go.opentelemetry.io/otel/log" "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/propagation" "go.opentelemetry.io/otel/trace" @@ -26,16 +27,22 @@ type ( meterProviderHolder struct { mp metric.MeterProvider } + + loggerProviderHolder struct { + provider log.LoggerProvider + } ) var ( - globalTracer = defaultTracerValue() - globalPropagators = defaultPropagatorsValue() - globalMeterProvider = defaultMeterProvider() + globalTracer = defaultTracerValue() + globalPropagators = defaultPropagatorsValue() + globalMeterProvider = defaultMeterProvider() + globalLoggerProvider = defaultLoggerProvider() delegateTraceOnce sync.Once delegateTextMapPropagatorOnce sync.Once delegateMeterOnce sync.Once + delegateLoggerOnce sync.Once ) // GetErrorHandler returns the global ErrorHandler instance. @@ -150,6 +157,32 @@ func SetMeterProvider(mp metric.MeterProvider) { globalMeterProvider.Store(meterProviderHolder{mp: mp}) } +// LoggerProvider is the internal implementation for global.LoggerProvider. +func LoggerProvider() log.LoggerProvider { + return globalLoggerProvider.Load().(loggerProviderHolder).provider +} + +// SetLoggerProvider is the internal implementation for global.SetLoggerProvider. +func SetLoggerProvider(provider log.LoggerProvider) { + current := LoggerProvider() + if _, cOk := current.(*loggerProvider); cOk { + if _, lpOk := provider.(*loggerProvider); lpOk && current == provider { + Error( + errors.New("no delegate configured in logger provider"), + "Setting logger provider to its current value. No delegate will be configured", + ) + return + } + } + + delegateLoggerOnce.Do(func() { + if def, ok := current.(*loggerProvider); ok { + def.setDelegate(provider) + } + }) + globalLoggerProvider.Store(loggerProviderHolder{provider: provider}) +} + func defaultTracerValue() *atomic.Value { v := &atomic.Value{} v.Store(tracerProviderHolder{tp: &tracerProvider{}}) @@ -167,3 +200,9 @@ func defaultMeterProvider() *atomic.Value { v.Store(meterProviderHolder{mp: &meterProvider{}}) return v } + +func defaultLoggerProvider() *atomic.Value { + v := &atomic.Value{} + v.Store(loggerProviderHolder{provider: &loggerProvider{}}) + return v +} diff --git a/vendor/go.opentelemetry.io/otel/log.go b/vendor/go.opentelemetry.io/otel/log.go new file mode 100644 index 00000000000..1758913fa24 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/log.go @@ -0,0 +1,41 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package otel + +import ( + "go.opentelemetry.io/otel/internal/global" + "go.opentelemetry.io/otel/log" +) + +// Logger returns a [log.Logger] configured with the provided name and options +// from the globally configured [log.LoggerProvider]. +// +// If this is called before a global LoggerProvider is configured, the returned +// Logger will be a No-Op implementation of a Logger. When a global +// LoggerProvider is registered for the first time, the returned Logger is +// updated in place to report to this new LoggerProvider. There is no need to +// call this function again for an updated instance. +// +// This is a convenience function. It is equivalent to: +// +// GetLoggerProvider().Logger(name, options...) +func Logger(name string, options ...log.LoggerOption) log.Logger { + return GetLoggerProvider().Logger(name, options...) +} + +// GetLoggerProvider returns the globally configured [log.LoggerProvider]. +// +// If a global LoggerProvider has not been configured with [SetLoggerProvider], +// the returned LoggerProvider will be a No-Op implementation. When +// a global LoggerProvider is registered for the first time, the returned +// LoggerProvider and all Loggers it has created are updated in place. There is +// no need to call this function again for an updated instance. +func GetLoggerProvider() log.LoggerProvider { + return global.LoggerProvider() +} + +// SetLoggerProvider configures provider as the global [log.LoggerProvider]. +func SetLoggerProvider(provider log.LoggerProvider) { + global.SetLoggerProvider(provider) +} diff --git a/vendor/go.opentelemetry.io/otel/log/DESIGN.md b/vendor/go.opentelemetry.io/otel/log/DESIGN.md new file mode 100644 index 00000000000..d36c9677397 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/log/DESIGN.md @@ -0,0 +1,566 @@ +# Logs API + +## Abstract + +`go.opentelemetry.io/otel/log` provides +[Logs API](https://opentelemetry.io/docs/specs/otel/logs/api/). + +The prototype was created in +[#4725](https://github.com/open-telemetry/opentelemetry-go/pull/4725). + +## Background + +The key challenge is to create a performant API compliant with the [specification](https://opentelemetry.io/docs/specs/otel/logs/api/) +with an intuitive and user friendly design. +Performance is seen as one of the most important characteristics of logging libraries in Go. + +## Design + +This proposed design aims to: + +- be specification compliant, +- be similar to Trace and Metrics API, +- take advantage of both OpenTelemetry and `slog` experience to achieve acceptable performance. + +### Module structure + +The API is published as a single `go.opentelemetry.io/otel/log` Go module. + +The package structure is similar to Trace API and Metrics API. +The Go module consists of the following packages: + +- `go.opentelemetry.io/otel/log` +- `go.opentelemetry.io/otel/log/embedded` +- `go.opentelemetry.io/otel/log/logtest` +- `go.opentelemetry.io/otel/log/noop` + +Rejected alternative: + +- [Reuse slog](#reuse-slog) + +### LoggerProvider + +The [`LoggerProvider` abstraction](https://opentelemetry.io/docs/specs/otel/logs/api/#loggerprovider) +is defined as `LoggerProvider` interface in [provider.go](provider.go). + +The specification may add new operations to `LoggerProvider`. +The interface may have methods added without a package major version bump. +This embeds `embedded.LoggerProvider` to help inform an API implementation +author about this non-standard API evolution. +This approach is already used in Trace API and Metrics API. + +#### LoggerProvider.Logger + +The `Logger` method implements the [`Get a Logger` operation](https://opentelemetry.io/docs/specs/otel/logs/api/#get-a-logger). + +The required `name` parameter is accepted as a `string` method argument. + +The `LoggerOption` options are defined to support optional parameters. + +Implementation requirements: + +- The [specification requires](https://opentelemetry.io/docs/specs/otel/logs/api/#concurrency-requirements) + the method to be safe to be called concurrently. + +- If the passed name is empty, this should be reported as invalid as specified + by the [Logs SDK specification](https://opentelemetry.io/docs/specs/otel/logs/sdk/#logger-creation). + The method should still use it as the instrumentation scope name and return + a working logger. + +`Logger` can be extended by adding new `LoggerOption` options +and adding new exported fields to the `LoggerConfig` struct. +This design is already used in Trace API for getting tracers +and in Metrics API for getting meters. + +Rejected alternative: + +- [Passing struct as parameter to LoggerProvider.Logger](#passing-struct-as-parameter-to-loggerproviderlogger). + +### Logger + +The [`Logger` abstraction](https://opentelemetry.io/docs/specs/otel/logs/api/#logger) +is defined as `Logger` interface in [logger.go](logger.go). + +The specification may add new operations to `Logger`. +The interface may have methods added without a package major version bump. +This embeds `embedded.Logger` to help inform an API implementation +author about this non-standard API evolution. +This approach is already used in Trace API and Metrics API. + +### Logger.Emit + +The `Emit` method implements the [`Emit a LogRecord` operation](https://opentelemetry.io/docs/specs/otel/logs/api/#emit-a-logrecord). + +[`Context` associated with the `LogRecord`](https://opentelemetry.io/docs/specs/otel/context/) +is accepted as a `context.Context` method argument. + +Calls to `Emit` are supposed to be on the hot path. +Therefore, in order to reduce the number of heap allocations, +the [`LogRecord` abstraction](https://opentelemetry.io/docs/specs/otel/logs/api/#emit-a-logrecord), +is defined as `Record` struct in [record.go](record.go). + +[`Timestamp`](https://opentelemetry.io/docs/specs/otel/logs/data-model/#field-timestamp) +is accessed using following methods: + +```go +func (r *Record) Timestamp() time.Time +func (r *Record) SetTimestamp(t time.Time) +``` + +[`ObservedTimestamp`](https://opentelemetry.io/docs/specs/otel/logs/data-model/#field-observedtimestamp) +is accessed using following methods: + +```go +func (r *Record) ObservedTimestamp() time.Time +func (r *Record) SetObservedTimestamp(t time.Time) +``` + +[`EventName`](https://opentelemetry.io/docs/specs/otel/logs/data-model/#field-eventname) +is accessed using following methods: + +```go +func (r *Record) EventName() string +func (r *Record) SetEventName(s string) +``` + +[`SeverityNumber`](https://opentelemetry.io/docs/specs/otel/logs/data-model/#field-severitynumber) +is accessed using following methods: + +```go +func (r *Record) Severity() Severity +func (r *Record) SetSeverity(s Severity) +``` + +`Severity` type is defined in [severity.go](severity.go). +The constants are are based on +[Displaying Severity recommendation](https://opentelemetry.io/docs/specs/otel/logs/data-model/#displaying-severity). +Additionally, `Severity[Level]` constants are defined to make the API more readable and user friendly. + +[`SeverityText`](https://opentelemetry.io/docs/specs/otel/logs/data-model/#field-severitytext) +is accessed using following methods: + +```go +func (r *Record) SeverityText() string +func (r *Record) SetSeverityText(s string) +``` + +[`Body`](https://opentelemetry.io/docs/specs/otel/logs/data-model/#field-body) +is accessed using following methods: + +```go +func (r *Record) Body() attribute.Value +func (r *Record) SetBody(v attribute.Value) +``` + +[Log record attributes](https://opentelemetry.io/docs/specs/otel/logs/data-model/#field-attributes) +are accessed using following methods: + +```go +func (r *Record) WalkAttributes(f func(attribute.KeyValue) bool) +func (r *Record) AddAttributes(attrs ...attribute.KeyValue) +``` + +`Record` has a `AttributesLen` method that returns +the number of attributes to allow slice preallocation +when converting records to a different representation: + +```go +func (r *Record) AttributesLen() int +``` + +The records attributes design and implementation is based on +[`slog.Record`](https://pkg.go.dev/log/slog#Record). +It allows achieving high-performance access and manipulation of the attributes +while keeping the API user friendly. +It relieves the user from making his own improvements +for reducing the number of allocations when passing attributes. + +Log body and attributes use the common +[`attribute.Value`](https://pkg.go.dev/go.opentelemetry.io/otel/attribute#Value) +and +[`attribute.KeyValue`](https://pkg.go.dev/go.opentelemetry.io/otel/attribute#KeyValue) +types. +These types cover the Logs Data Model `any` value shape, including empty +values, byte slices, generic slices, and maps. +Reusing the attribute package keeps the API consistent across signals and +avoids maintaining a second value model with conversion helpers. + +The zero value of `attribute.Value` represents an empty body. +Log maps use `attribute.MAP`, which may contain duplicate keys when callers +construct one that way. Duplicate-key normalization is an SDK policy, not an +API behavior. + +The caller must not subsequently mutate the record passed to `Emit`. +This would allow the implementation to not clone the record, +but simply retain, modify or discard it. +The implementation may still choose to clone the record or copy its attributes +if it needs to retain or modify it, +e.g. in case of asynchronous processing to eliminate the possibility of data races, +because the user can technically reuse the record and add new attributes +after the call (even when the documentation says that the caller must not do it). + +Implementation requirements: + +- The [specification requires](https://opentelemetry.io/docs/specs/otel/logs/api/#concurrency-requirements) + the method to be safe to be called concurrently. + +- The method must not interrupt the record processing if the context is canceled + per ["ignoring context cancellation" guideline](../CONTRIBUTING.md#ignoring-context-cancellation). + +- The [specification requires](https://opentelemetry.io/docs/specs/otel/logs/api/#emit-a-logrecord) + use the current time as observed timestamp if the passed is empty. + +- The method should handle the trace context passed via `ctx` argument in order to meet the + [specification's SDK requirement](https://opentelemetry.io/docs/specs/otel/logs/sdk/#readablelogrecord) + to populate the trace context fields from the resolved context. + +`Emit` can be extended by adding new exported fields to the `Record` struct. + +Rejected alternatives: + +- [Record as interface](#record-as-interface) +- [Options as parameter to Logger.Emit](#options-as-parameter-to-loggeremit) +- [Passing record as pointer to Logger.Emit](#passing-record-as-pointer-to-loggeremit) +- [Logger.WithAttributes](#loggerwithattributes) +- [Record attributes as slice](#record-attributes-as-slice) +- [Use any instead of attribute.Value](#use-any-instead-of-attributevalue) +- [Severity type encapsulating number and text](#severity-type-encapsulating-number-and-text) +- [Define log-specific value types](#define-log-specific-value-types) +- [Mix receiver types for Record](#mix-receiver-types-for-record) +- [Add XYZ method to Logger](#add-xyz-method-to-logger) + +### Logger.Enabled + +The `Enabled` method implements the [`Enabled` operation](https://opentelemetry.io/docs/specs/otel/logs/api/#enabled). + +[`Context` associated with the `LogRecord`](https://opentelemetry.io/docs/specs/otel/context/) +is accepted as a `context.Context` method argument. + +Calls to `Enabled` are supposed to be on the hot path and the list of arguments +can be extendend in future. Therefore, in order to reduce the number of heap +allocations and make it possible to handle new arguments, `Enabled` accepts +a `EnabledParameters` struct, defined in [logger.go](logger.go), as the second +method argument. + +The `EnabledParameters` uses fields, instead of getters and setters, to allow +simpler usage which allows configuring the `EnabledParameters` in the same line +where `Enabled` is called. + +### noop package + +The `go.opentelemetry.io/otel/log/noop` package provides +[Logs API No-Op Implementation](https://opentelemetry.io/docs/specs/otel/logs/noop/). + +### Trace context correlation + +The bridge implementation should do its best to pass +the `ctx` containing the trace context from the caller +so it can later be passed via `Logger.Emit`. + +It is not expected that users (caller or bridge implementation) reconstruct +a `context.Context`. Reconstructing a `context.Context` with +[`trace.ContextWithSpanContext`](https://pkg.go.dev/go.opentelemetry.io/otel/trace#ContextWithSpanContext) +and [`trace.NewSpanContext`](https://pkg.go.dev/go.opentelemetry.io/otel/trace#NewSpanContext) +would usually involve more memory allocations. + +The logging libraries which have recording methods that accepts `context.Context`, +such us [`slog`](https://pkg.go.dev/log/slog), +[`logrus`](https://pkg.go.dev/github.com/sirupsen/logrus), +[`zerolog`](https://pkg.go.dev/github.com/rs/zerolog), +makes passing the trace context trivial. + +However, some libraries do not accept a `context.Context` in their recording methods. +Structured logging libraries, +such as [`logr`](https://pkg.go.dev/github.com/go-logr/logr) +and [`zap`](https://pkg.go.dev/go.uber.org/zap), +offer passing `any` type as a log attribute/field. +Therefore, their bridge implementations can define a "special" log attributes/field +that will be used to capture the trace context. + +[The prototype](https://github.com/open-telemetry/opentelemetry-go/pull/4725) +has bridge implementations that handle trace context correlation efficiently. + +## Benchmarking + +The benchmarks take inspiration from [`slog`](https://pkg.go.dev/log/slog), +because for the Go team it was also critical to create API that would be fast +and interoperable with existing logging packages.[^2][^3] + +The benchmark results can be found in [the prototype](https://github.com/open-telemetry/opentelemetry-go/pull/4725). + +## Rejected alternatives + +### Reuse slog + +The API must not be coupled to [`slog`](https://pkg.go.dev/log/slog), +nor any other logging library. + +The API needs to evolve orthogonally to `slog`. + +`slog` is not compliant with the [Logs API](https://opentelemetry.io/docs/specs/otel/logs/api/). +and we cannot expect the Go team to make `slog` compliant with it. + +The interoperability can be achieved using [a log bridge](https://opentelemetry.io/docs/specs/otel/glossary/#log-appender--bridge). + +You can read more about OpenTelemetry Logs design on [opentelemetry.io](https://opentelemetry.io/docs/concepts/signals/logs/). + +### Record as interface + +`Record` is defined as a `struct` because of the following reasons. + +Log record is a value object without any behavior. +It is used as data input for Logger methods. + +The log record resembles the instrument config structs like [metric.Float64CounterConfig](https://pkg.go.dev/go.opentelemetry.io/otel/metric#Float64CounterConfig). + +Using `struct` instead of `interface` improves the performance as e.g. +indirect calls are less optimized, +usage of interfaces tend to increase heap allocations.[^3] + +### Options as parameter to Logger.Emit + +One of the initial ideas was to have: + +```go +type Logger interface{ + embedded.Logger + Emit(ctx context.Context, options ...RecordOption) +} +``` + +The main reason was that design would be similar +to the [Meter API](https://pkg.go.dev/go.opentelemetry.io/otel/metric#Meter) +for creating instruments. + +However, passing `Record` directly, instead of using options, +is more performant as it reduces heap allocations.[^4] + +Another advantage of passing `Record` is that API would not have functions like `NewRecord(options...)`, +which would be used by the SDK and not by the users. + +Finally, the definition would be similar to [`slog.Handler.Handle`](https://pkg.go.dev/log/slog#Handler) +that was designed to provide optimization opportunities.[^2] + +### Passing record as pointer to Logger.Emit + +So far the benchmarks do not show differences that would +favor passing the record via pointer (and vice versa). + +Passing via value feels safer because of the following reasons. + +The user would not be able to pass `nil`. +Therefore, it reduces the possibility to have a nil pointer dereference. + +It should reduce the possibility of a heap allocation. + +It follows the design of [`slog.Handler`](https://pkg.go.dev/log/slog#Handler). + +If follows one of Google's Go Style Decisions +to prefer [passing values](https://google.github.io/styleguide/go/decisions#pass-values). + +### Passing struct as parameter to LoggerProvider.Logger + +Similarly to `Logger.Emit`, we could have something like: + +```go +type LoggerProvider interface{ + embedded.LoggerProvider + Logger(name string, config LoggerConfig) +} +``` + +The drawback of this idea would be that this would be +a different design from Trace and Metrics API. + +The performance of acquiring a logger is not as critical +as the performance of emitting a log record. While a single +HTTP/RPC handler could write hundreds of logs, it should not +create a new logger for each log entry. +The bridge implementation should reuse loggers whenever possible. + +### Logger.WithAttributes + +We could add `WithAttributes` to the `Logger` interface. +Then `Record` could be a simple struct with only exported fields. +The idea was that the SDK would implement the performance improvements +instead of doing it in the API. +This would allow having different optimization strategies. + +During the analysis[^5], it occurred that the main problem of this proposal +is that the variadic slice passed to an interface method is always heap allocated. + +Moreover, the logger returned by `WithAttribute` was allocated on the heap. + +Lastly, the proposal was not specification compliant. + +### Record attributes as slice + +One of the proposals[^6] was to have `Record` as a simple struct: + +```go +type Record struct { + Timestamp time.Time + ObservedTimestamp time.Time + EventName string + Severity Severity + SeverityText string + Body Value + Attributes []KeyValue +} +``` + +The bridge implementations could use [`sync.Pool`](https://pkg.go.dev/sync#Pool) +for reducing the number of allocations when passing attributes. + +The benchmarks results were better. + +In such a design, most bridges would have a `sync.Pool` +to reduce the number of heap allocations. +However, the `sync.Pool` will not work correctly with API implementations +that would take ownership of the record +(e.g. implementations that do not copy records for asynchronous processing). +The current design, even in case of improper API implementation, +has lower chances of encountering a bug as most bridges would +create a record, pass it, and forget about it. + +For reference, here is the reason why `slog` does not use `sync.Pool`[^3] +as well: + +> We can use a sync pool for records though we decided not to. +You can but it's a bad idea for us. Why? +Because users have control of Records. +Handler writers can get their hands on a record +and we'd have to ask them to free it +or try to free it magically at some some point. +But either way, they could get themselves in trouble by freeing it twice +or holding on to one after they free it. +That's a use after free bug and that's why `zerolog` was problematic for us. +`zerolog` as as part of its speed exposes a pool allocated value to users +if you use `zerolog` the normal way, that you'll see in all the examples, +you will never encounter a problem. +But if you do something a little out of the ordinary you can get +use after free bugs and we just didn't want to put that in the standard library. + +Therefore, we decided to not follow the proposal as it is +less user friendly (users and bridges would use e.g. a `sync.Pool` to reduce +the number of heap allocation), less safe (more prone to use after free bugs +and race conditions), and the benchmark differences were not significant. + +### Use any instead of attribute.Value + +[Logs Data Model](https://opentelemetry.io/docs/specs/otel/logs/data-model/#field-body) +defines Body to be `any`. +One could propose to define `Body` (and attribute values) as `any` +instead of using `attribute.Value`. + +First of all, [`any` type defined in the specification](https://opentelemetry.io/docs/specs/otel/logs/data-model/#type-any) +is not the same as `any` (`interface{}`) in Go. + +Moreover, using `any` as a field would decrease the performance.[^7] + +Using `attribute.Value` preserves a typed, allocation-conscious representation +of the Logs Data Model `any` values while avoiding unconstrained `interface{}` +handling in bridge implementations. + +### Severity type encapsulating number and text + +We could combine severity into a single field defining a type: + +```go +type Severity struct { + Number SeverityNumber + Text string +} +``` + +However, the [Logs Data Model](https://opentelemetry.io/docs/specs/otel/logs/data-model/#log-and-event-record-definition) +define it as independent fields. +It should be more user friendly to have them separated. +Especially when having getter and setter methods, setting one value +when the other is already set would be unpleasant. + +### Define log-specific value types + +The original design defined `Kind`, `Value`, and `KeyValue` in +`go.opentelemetry.io/otel/log`. +That avoided coupling log bodies to the common attribute package while logs were +still exploring structured value support. + +The Logs Data Model and common attribute value model now share the structured +`any` shapes needed by Go: empty, bool, int64, float64, string, byte slice, +homogeneous slices, generic slices, and maps. +The specification direction is to reuse these value shapes across signals. +Keeping log-specific types would duplicate API surface, require conversion +helpers, and make bridge code choose between two equivalent value models. + +Therefore log records now use `attribute.Value` for body values and +`attribute.KeyValue` for attributes and map entries. + +### Mix receiver types for Record + +Methods of [`slog.Record`](https://pkg.go.dev/log/slog#Record) +have different receiver types. + +In `log/slog` GitHub issue we can only find that the reason is:[^8] + +>> some receiver of Record struct is by value +> Passing Records by value means they incur no heap allocation. +> That improves performance overall, even though they are copied. + +However, the benchmarks do not show any noticeable differences.[^9] + +The compiler is smart-enough to not make a heap allocation for any of these methods. +The use of a pointer receiver does not cause any heap allocation. +From Go FAQ:[^10] + +> In the current compilers, if a variable has its address taken, +> that variable is a candidate for allocation on the heap. +> However, a basic escape analysis recognizes some cases +> when such variables will not live past the return from the function +> and can reside on the stack. + +The [Understanding Allocations: the Stack and the Heap](https://www.youtube.com/watch?v=ZMZpH4yT7M0) +presentation by Jacob Walker describes the escape analysis with details. + +Moreover, also from Go FAQ:[^10] + +> Also, if a local variable is very large, +> it might make more sense to store it on the heap rather than the stack. + +Therefore, even if we use a value receiver and the value is very large +it may be heap allocated. + +Both [Go Code Review Comments](https://go.dev/wiki/CodeReviewComments#receiver-type) +and [Google's Go Style Decisions](https://google.github.io/styleguide/go/decisions#receiver-type) +highly recommend making the methods for a type either all pointer methods +or all value methods. Google's Go Style Decisions even goes further and says: + +> There is a lot of misinformation about whether passing a value or a pointer +> to a function can affect performance. +> The compiler can choose to pass pointers to values on the stack +> as well as copying values on the stack, +> but these considerations should not outweigh the readability +> and correctness of the code in most circumstances. +> When the performance does matter, it is important to profile both approaches +> with a realistic benchmark before deciding that one approach outperforms the other. + +Because, the benchmarks[^9] do not proof any performance difference +and the general recommendation is to not mix receiver types, +we decided to use pointer receivers for all `Record` methods. + +### Add XYZ method to Logger + +The `Logger` does not have methods like `SetSeverity`, etc. +as the Logs API needs to follow (be compliant with) +the [specification](https://opentelemetry.io/docs/specs/otel/logs/api/) + +[^1]: [Handle structured body and attributes](https://github.com/pellared/opentelemetry-go/pull/7) +[^2]: Jonathan Amsterdam, [The Go Blog: Structured Logging with slog](https://go.dev/blog/slog) +[^3]: Jonathan Amsterdam, [GopherCon Europe 2023: A Fast Structured Logging Package](https://www.youtube.com/watch?v=tC4Jt3i62ns) +[^4]: [Emit definition discussion with benchmarks](https://github.com/open-telemetry/opentelemetry-go/pull/4725#discussion_r1400869566) +[^5]: [Logger.WithAttributes analysis](https://github.com/pellared/opentelemetry-go/pull/3) +[^6]: [Record attributes as field and use sync.Pool for reducing allocations](https://github.com/pellared/opentelemetry-go/pull/4) and [Record attributes based on slog.Record](https://github.com/pellared/opentelemetry-go/pull/6) +[^7]: [Record.Body as any](https://github.com/pellared/opentelemetry-go/pull/5) +[^8]: [log/slog: structured, leveled logging](https://github.com/golang/go/issues/56345#issuecomment-1302563756) +[^9]: [Record with pointer receivers only](https://github.com/pellared/opentelemetry-go/pull/8) +[^10]: [Go FAQ: Stack or heap](https://go.dev/doc/faq#stack_or_heap) diff --git a/vendor/go.opentelemetry.io/otel/log/LICENSE b/vendor/go.opentelemetry.io/otel/log/LICENSE new file mode 100644 index 00000000000..f1aee0f1100 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/log/LICENSE @@ -0,0 +1,231 @@ + 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. + +-------------------------------------------------------------------------------- + +Copyright 2009 The Go Authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google LLC nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/vendor/go.opentelemetry.io/otel/log/README.md b/vendor/go.opentelemetry.io/otel/log/README.md new file mode 100644 index 00000000000..3f714271191 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/log/README.md @@ -0,0 +1,3 @@ +# Log API + +[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/log)](https://pkg.go.dev/go.opentelemetry.io/otel/log) diff --git a/vendor/go.opentelemetry.io/otel/log/doc.go b/vendor/go.opentelemetry.io/otel/log/doc.go new file mode 100644 index 00000000000..211de35f58d --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/log/doc.go @@ -0,0 +1,85 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +/* +Package log provides the OpenTelemetry Logs API. + +This API is separate from its implementation, so the instrumentation built +from it is reusable. See [go.opentelemetry.io/otel/sdk/log] for the official +OpenTelemetry implementation of this API. + +The log package provides the OpenTelemetry Logs API, which serves as a standard +interface for generating and managing log records within the OpenTelemetry ecosystem. +This package allows users to emit LogRecords, enabling structured, context-rich logging +that can be easily integrated with observability tools. It ensures that log data is captured +in a way that is consistent with OpenTelemetry's data model. + +This package can be used to create bridges between existing logging libraries and OpenTelemetry. +Log bridges allow existing logging setups to be integrated with OpenTelemetry. +Log bridges can be found in the [registry]. + +# API Implementations + +This package does not conform to the standard Go versioning policy; all of its +interfaces may have methods added to them without a package major version bump. +This non-standard API evolution could surprise an uninformed implementation +author. They could unknowingly build their implementation in a way that would +result in a runtime panic for their users who update to the new API. + +The API is designed to help inform an instrumentation author about this +non-standard API evolution. It requires them to choose a default behavior for +unimplemented interface methods. There are three behavior choices they can +make: + + - Compilation failure + - Panic + - Default to another implementation + +All interfaces in this API embed a corresponding interface from +[go.opentelemetry.io/otel/log/embedded]. If an author wants the default +behavior of their implementations to be a compilation failure, signaling to +their users that they need to update to the latest version of that implementation, +they need to embed the corresponding interface from +[go.opentelemetry.io/otel/log/embedded] in their implementation. For example, + + import "go.opentelemetry.io/otel/log/embedded" + + type LoggerProvider struct { + embedded.LoggerProvider + // ... + } + +If an author wants the default behavior of their implementations to panic, +they need to embed the API interface directly. + + import "go.opentelemetry.io/otel/log" + + type LoggerProvider struct { + log.LoggerProvider + // ... + } + +This is not a recommended behavior as it could lead to publishing packages that +contain runtime panics when users update other packages that use newer versions +of [go.opentelemetry.io/otel/log]. + +Finally, an author can embed another implementation in theirs. The embedded +implementation will be used for methods not defined by the author. For example, +an author who wants to default to silently dropping the call can use +[go.opentelemetry.io/otel/log/noop]: + + import "go.opentelemetry.io/otel/log/noop" + + type LoggerProvider struct { + noop.LoggerProvider + // ... + } + +It is strongly recommended that authors only embed +go.opentelemetry.io/otel/log/noop if they choose this default behavior. That +implementation is the only one OpenTelemetry authors can guarantee will fully +implement all the API interfaces when a user updates their API. + +[registry]: https://opentelemetry.io/ecosystem/registry/?language=go&component=log-bridge +*/ +package log diff --git a/vendor/go.opentelemetry.io/otel/log/embedded/README.md b/vendor/go.opentelemetry.io/otel/log/embedded/README.md new file mode 100644 index 00000000000..bae4ac68f0b --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/log/embedded/README.md @@ -0,0 +1,3 @@ +# Log Embedded + +[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/log/embedded)](https://pkg.go.dev/go.opentelemetry.io/otel/log/embedded) diff --git a/vendor/go.opentelemetry.io/otel/log/embedded/embedded.go b/vendor/go.opentelemetry.io/otel/log/embedded/embedded.go new file mode 100644 index 00000000000..3b97fcddcf2 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/log/embedded/embedded.go @@ -0,0 +1,36 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Package embedded provides interfaces embedded within the [OpenTelemetry Logs +// Bridge API]. +// +// Implementers of the [OpenTelemetry Logs API] can embed the relevant +// type from this package into their implementation directly. Doing so will +// result in a compilation error for users when the [OpenTelemetry Logs Bridge +// API] is extended (which is something that can happen without a major version +// bump of the API package). +// +// [OpenTelemetry Logs API]: https://pkg.go.dev/go.opentelemetry.io/otel/log +package embedded + +// LoggerProvider is embedded in the [Logs API LoggerProvider]. +// +// Embed this interface in your implementation of the [Logs API +// LoggerProvider] if you want users to experience a compilation error when the +// [Logs Bridge API LoggerProvider] interface is extended (which is something +// that can happen without a major version bump of the API package). This error +// signals that they need to update to your latest implementation. +// +// [Logs API LoggerProvider]: https://pkg.go.dev/go.opentelemetry.io/otel/log#LoggerProvider +type LoggerProvider interface{ loggerProvider() } + +// Logger is embedded in the [Logs API Logger]. +// +// Embed this interface in your implementation of the [Logs API Logger] +// if you want users to experience a compilation error when the [Logs API +// Logger] interface is extended (which is something that can happen without a +// major version bump of the API package). This error signals that they need to +// update to your latest implementation. +// +// [Logs API Logger]: https://pkg.go.dev/go.opentelemetry.io/otel/log#Logger +type Logger interface{ logger() } diff --git a/vendor/go.opentelemetry.io/otel/log/logger.go b/vendor/go.opentelemetry.io/otel/log/logger.go new file mode 100644 index 00000000000..c0e4ca7ae27 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/log/logger.go @@ -0,0 +1,197 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package log + +import ( + "context" + "slices" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/log/embedded" +) + +// Logger emits log records. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// the default behavior for unimplemented methods. +type Logger interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Logger + + // Emit emits a log record. + // + // The record may be held by the implementation. Callers should not mutate + // the record after it is passed. + // + // Implementations of this method need to be safe for a user to call + // concurrently. + Emit(ctx context.Context, record Record) + + // Enabled reports whether the Logger emits for the given context and + // param. + // + // Calling Enabled is optional. It is not required before calling + // [Logger.Emit]. + // + // Enabled is useful when constructing a [Record] is expensive. A caller can + // call Enabled first and skip record construction when it returns false. + // When constructing the Record is inexpensive, a caller can emit it + // directly. + // + // The returned value is not static and may change over time. A cached value + // can become stale. + // + // The passed param is likely to contain only partial information about a + // record (e.g., a param with only the Severity set). + // If a Logger needs more information than is provided, it + // is said to be in an indeterminate state (see below). + // + // The returned value is true if the Logger emits for the provided context + // and param, and false if the Logger does not emit. The returned value may be + // true or false in an indeterminate state. + // An implementation should default to returning true for an indeterminate + // state, but may return false if there are valid reasons to do so in + // particular circumstances (e.g., performance or correctness). + // + // The param should not be held by the implementation. A copy should be + // made if the param needs to be held after the call returns. + // + // Implementations of this method need to be safe for a user to call + // concurrently. + Enabled(ctx context.Context, param EnabledParameters) bool +} + +// LoggerOption applies configuration options to a [Logger]. +type LoggerOption interface { + // applyLogger applies a LoggerOption to a LoggerConfig. + applyLogger(LoggerConfig) LoggerConfig +} + +// LoggerConfig contains options for a [Logger]. +type LoggerConfig struct { + // Ensure forward compatibility by explicitly making this not comparable. + noCmp [0]func() //nolint: unused // This is indeed used. + + version string + schemaURL string + attrs attribute.Set +} + +type experimentalOption interface { + Experimental() +} + +// NewLoggerConfig returns a new [LoggerConfig] with all the options applied. +func NewLoggerConfig(options ...LoggerOption) LoggerConfig { + var c LoggerConfig + for _, opt := range options { + if _, ok := opt.(experimentalOption); ok { + continue + } + c = opt.applyLogger(c) + } + return c +} + +// InstrumentationVersion returns the version of the library providing +// instrumentation. +func (cfg LoggerConfig) InstrumentationVersion() string { + return cfg.version +} + +// InstrumentationAttributes returns the attributes associated with the library +// providing instrumentation. +func (cfg LoggerConfig) InstrumentationAttributes() attribute.Set { + return cfg.attrs +} + +// SchemaURL returns the schema URL of the library providing instrumentation. +func (cfg LoggerConfig) SchemaURL() string { + return cfg.schemaURL +} + +type loggerOptionFunc func(LoggerConfig) LoggerConfig + +func (fn loggerOptionFunc) applyLogger(cfg LoggerConfig) LoggerConfig { + return fn(cfg) +} + +// WithInstrumentationVersion returns a [LoggerOption] that sets the +// instrumentation version of a [Logger]. +func WithInstrumentationVersion(version string) LoggerOption { + return loggerOptionFunc(func(config LoggerConfig) LoggerConfig { + config.version = version + return config + }) +} + +// mergeSets returns the union of the keys in a and b. For duplicate keys, the +// value associated with b is used. +func mergeSets(a, b attribute.Set) attribute.Set { + // NewMergeIterator uses the first value for any duplicates. + iter := attribute.NewMergeIterator(&b, &a) + merged := make([]attribute.KeyValue, 0, a.Len()+b.Len()) + for iter.Next() { + merged = append(merged, iter.Attribute()) + } + return attribute.NewSet(merged...) +} + +// WithInstrumentationAttributes returns a [LoggerOption] that sets the +// instrumentation attributes of a [Logger]. +// +// This is equivalent to calling WithInstrumentationAttributeSet with an +// [attribute.Set] created from a clone of the passed attributes. +// [WithInstrumentationAttributeSet] is recommended for more control. +// +// If multiple [WithInstrumentationAttributes] or [WithInstrumentationAttributeSet] +// options are passed, the attributes will be merged together in the order +// they are passed. For attributes with duplicate keys, the last value passed +// will be used. +func WithInstrumentationAttributes(attr ...attribute.KeyValue) LoggerOption { + set := attribute.NewSet(slices.Clone(attr)...) + return WithInstrumentationAttributeSet(set) +} + +// WithInstrumentationAttributeSet returns a [LoggerOption] that adds +// instrumentation attributes to a [Logger]. +// +// If multiple [WithInstrumentationAttributes] or [WithInstrumentationAttributeSet] +// options are passed, the attributes will be merged together in the order +// they are passed. For attributes with duplicate keys, the last value passed +// will be used. +func WithInstrumentationAttributeSet(set attribute.Set) LoggerOption { + if set.Len() == 0 { + return loggerOptionFunc(func(config LoggerConfig) LoggerConfig { + return config + }) + } + + return loggerOptionFunc(func(config LoggerConfig) LoggerConfig { + if config.attrs.Len() == 0 { + config.attrs = set + } else { + config.attrs = mergeSets(config.attrs, set) + } + return config + }) +} + +// WithSchemaURL returns a [LoggerOption] that sets the schema URL for a +// [Logger]. +func WithSchemaURL(schemaURL string) LoggerOption { + return loggerOptionFunc(func(config LoggerConfig) LoggerConfig { + config.schemaURL = schemaURL + return config + }) +} + +// EnabledParameters represents the payload for [Logger.Enabled]. +type EnabledParameters struct { + Severity Severity + EventName string +} diff --git a/vendor/go.opentelemetry.io/otel/log/provider.go b/vendor/go.opentelemetry.io/otel/log/provider.go new file mode 100644 index 00000000000..10969b41556 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/log/provider.go @@ -0,0 +1,38 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package log + +import "go.opentelemetry.io/otel/log/embedded" + +// LoggerProvider provides access to [Logger]. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// the default behavior for unimplemented methods. +type LoggerProvider interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.LoggerProvider + + // Logger returns a new [Logger] with the provided name and configuration. + // + // The name needs to uniquely identify the source of logged code. It is + // recommended that name be the Go package name of the library using a log + // bridge (note: this is not the name of the bridge package). Most + // commonly, this means a bridge will need to accept this value from its + // users. + // + // An empty name is invalid. Implementations should retain the empty value as the + // instrumentation scope name, return a working Logger, and report the invalid value. + // + // The version of the package using a bridge can be critical information + // to include when logging. The bridge should accept this version + // information and use the [WithInstrumentationVersion] option to configure + // the Logger appropriately. + // + // Implementations of this method need to be safe for a user to call + // concurrently. + Logger(name string, options ...LoggerOption) Logger +} diff --git a/vendor/go.opentelemetry.io/otel/log/record.go b/vendor/go.opentelemetry.io/otel/log/record.go new file mode 100644 index 00000000000..351657e953c --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/log/record.go @@ -0,0 +1,168 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package log + +import ( + "slices" + "time" + + "go.opentelemetry.io/otel/attribute" +) + +// attributesInlineCount is the number of attributes that are efficiently +// stored in an array within a Record. This value is borrowed from slog, which +// performed a quantitative survey of log library use and found that this value +// covers 95% of all use cases (https://go.dev/blog/slog#performance). +const attributesInlineCount = 5 + +// Record represents a log record. +// A log record with a non-empty event name is interpreted as an event record. +type Record struct { + // Ensure forward compatibility by explicitly making this not comparable. + noCmp [0]func() //nolint: unused // This is indeed used. + + eventName string + timestamp time.Time + observedTimestamp time.Time + severity Severity + severityText string + body attribute.Value + err error + + // The fields below are for optimizing the implementation of Attributes and + // AddAttributes. This design is borrowed from the slog Record type: + // https://cs.opensource.google/go/go/+/refs/tags/go1.22.0:src/log/slog/record.go;l=20 + + // Allocation optimization: an inline array sized to hold + // the majority of log calls (based on examination of open-source + // code). It holds the start of the list of attributes. + front [attributesInlineCount]attribute.KeyValue + + // The number of attributes in front. + nFront int + + // The list of attributes except for those in front. + // Invariants: + // - len(back) > 0 if nFront == len(front) + // - Unused array elements are zeroed to detect mistakes. + back []attribute.KeyValue +} + +// EventName returns the event name. +// A log record with a non-empty event name is interpreted as an event record. +func (r *Record) EventName() string { + return r.eventName +} + +// SetEventName sets the event name. +// A log record with a non-empty event name is interpreted as an event record. +// Event names should uniquely identify the structure of the event's attributes +// and body. +func (r *Record) SetEventName(s string) { + r.eventName = s +} + +// Timestamp returns the time when the log record occurred. +func (r *Record) Timestamp() time.Time { + return r.timestamp +} + +// SetTimestamp sets the time when the log record occurred. +func (r *Record) SetTimestamp(t time.Time) { + r.timestamp = t +} + +// ObservedTimestamp returns the time when the log record was observed. +func (r *Record) ObservedTimestamp() time.Time { + return r.observedTimestamp +} + +// SetObservedTimestamp sets the time when the log record was observed. +func (r *Record) SetObservedTimestamp(t time.Time) { + r.observedTimestamp = t +} + +// Severity returns the [Severity] of the log record. +func (r *Record) Severity() Severity { + return r.severity +} + +// SetSeverity sets the [Severity] level of the log record. +func (r *Record) SetSeverity(level Severity) { + r.severity = level +} + +// SeverityText returns the text of the severity (also known as the log level) +// as originally known at the source. +func (r *Record) SeverityText() string { + return r.severityText +} + +// SetSeverityText sets the text of the severity (also known as the log level) +// as originally known at the source. +func (r *Record) SetSeverityText(text string) { + r.severityText = text +} + +// Body returns the body of the log record. +func (r *Record) Body() attribute.Value { + return r.body +} + +// SetBody sets the body of the log record. +func (r *Record) SetBody(v attribute.Value) { + r.body = v +} + +// Err returns the associated error if one has been set. +func (r *Record) Err() error { + return r.err +} + +// SetErr sets the associated error. Passing nil clears the error. +func (r *Record) SetErr(err error) { + r.err = err +} + +// WalkAttributes walks all attributes in the log record by calling f for each +// [attribute.KeyValue] in the [Record]. Iteration stops if f returns false. +func (r *Record) WalkAttributes(f func(attribute.KeyValue) bool) { + for i := 0; i < r.nFront; i++ { + if !f(r.front[i]) { + return + } + } + for _, a := range r.back { + if !f(a) { + return + } + } +} + +// AddAttributes adds attributes to the log record. +func (r *Record) AddAttributes(attrs ...attribute.KeyValue) { + var i int + for i = 0; i < len(attrs) && r.nFront < len(r.front); i++ { + a := attrs[i] + r.front[r.nFront] = a + r.nFront++ + } + + r.back = slices.Grow(r.back, len(attrs[i:])) + r.back = append(r.back, attrs[i:]...) +} + +// AttributesLen returns the number of attributes in the log record. +func (r *Record) AttributesLen() int { + return r.nFront + len(r.back) +} + +// Clone returns a copy of the record with no shared state. +// The original record and the clone can both be modified without interfering +// with each other. +func (r *Record) Clone() Record { + res := *r + res.back = slices.Clone(r.back) + return res +} diff --git a/vendor/go.opentelemetry.io/otel/log/severity.go b/vendor/go.opentelemetry.io/otel/log/severity.go new file mode 100644 index 00000000000..4f305be3627 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/log/severity.go @@ -0,0 +1,69 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +//go:generate stringer -type=Severity -linecomment + +package log + +// Severity represents a log record's severity (also known as its log level). +// Smaller numerical values correspond to less severe log records (such as +// debug events); larger numerical values correspond to more severe log records +// (such as errors and critical events). +type Severity int + +// The following Severity values are defined by OpenTelemetry. +const ( + // SeverityUndefined represents an unset Severity. + SeverityUndefined Severity = 0 // UNDEFINED + + // The following are severity values for fine-grained debugging log records. + // They are typically disabled in default configurations. + SeverityTrace1 Severity = 1 // TRACE + SeverityTrace2 Severity = 2 // TRACE2 + SeverityTrace3 Severity = 3 // TRACE3 + SeverityTrace4 Severity = 4 // TRACE4 + + // The following are severity values for debugging log records. + SeverityDebug1 Severity = 5 // DEBUG + SeverityDebug2 Severity = 6 // DEBUG2 + SeverityDebug3 Severity = 7 // DEBUG3 + SeverityDebug4 Severity = 8 // DEBUG4 + + // The following are severity values for informational log records indicating + // that an event happened. + SeverityInfo1 Severity = 9 // INFO + SeverityInfo2 Severity = 10 // INFO2 + SeverityInfo3 Severity = 11 // INFO3 + SeverityInfo4 Severity = 12 // INFO4 + + // The following are severity values for warning log records. These records + // are not errors, but they are likely more important than informational + // events. + SeverityWarn1 Severity = 13 // WARN + SeverityWarn2 Severity = 14 // WARN2 + SeverityWarn3 Severity = 15 // WARN3 + SeverityWarn4 Severity = 16 // WARN4 + + // The following are severity values for error log records indicating that + // something went wrong. + SeverityError1 Severity = 17 // ERROR + SeverityError2 Severity = 18 // ERROR2 + SeverityError3 Severity = 19 // ERROR3 + SeverityError4 Severity = 20 // ERROR4 + + // The following are severity values for fatal log records, such as those + // associated with an application or system crash. + SeverityFatal1 Severity = 21 // FATAL + SeverityFatal2 Severity = 22 // FATAL2 + SeverityFatal3 Severity = 23 // FATAL3 + SeverityFatal4 Severity = 24 // FATAL4 + + // The following are convenience definitions for the base severity of each + // level. + SeverityTrace = SeverityTrace1 + SeverityDebug = SeverityDebug1 + SeverityInfo = SeverityInfo1 + SeverityWarn = SeverityWarn1 + SeverityError = SeverityError1 + SeverityFatal = SeverityFatal1 +) diff --git a/vendor/go.opentelemetry.io/otel/log/severity_string.go b/vendor/go.opentelemetry.io/otel/log/severity_string.go new file mode 100644 index 00000000000..fb94caeaba5 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/log/severity_string.go @@ -0,0 +1,48 @@ +// Code generated by "stringer -type=Severity -linecomment"; DO NOT EDIT. + +package log + +import "strconv" + +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[SeverityUndefined-0] + _ = x[SeverityTrace1-1] + _ = x[SeverityTrace2-2] + _ = x[SeverityTrace3-3] + _ = x[SeverityTrace4-4] + _ = x[SeverityDebug1-5] + _ = x[SeverityDebug2-6] + _ = x[SeverityDebug3-7] + _ = x[SeverityDebug4-8] + _ = x[SeverityInfo1-9] + _ = x[SeverityInfo2-10] + _ = x[SeverityInfo3-11] + _ = x[SeverityInfo4-12] + _ = x[SeverityWarn1-13] + _ = x[SeverityWarn2-14] + _ = x[SeverityWarn3-15] + _ = x[SeverityWarn4-16] + _ = x[SeverityError1-17] + _ = x[SeverityError2-18] + _ = x[SeverityError3-19] + _ = x[SeverityError4-20] + _ = x[SeverityFatal1-21] + _ = x[SeverityFatal2-22] + _ = x[SeverityFatal3-23] + _ = x[SeverityFatal4-24] +} + +const _Severity_name = "UNDEFINEDTRACETRACE2TRACE3TRACE4DEBUGDEBUG2DEBUG3DEBUG4INFOINFO2INFO3INFO4WARNWARN2WARN3WARN4ERRORERROR2ERROR3ERROR4FATALFATAL2FATAL3FATAL4" + +var _Severity_index = [...]uint8{0, 9, 14, 20, 26, 32, 37, 43, 49, 55, 59, 64, 69, 74, 78, 83, 88, 93, 98, 104, 110, 116, 121, 127, 133, 139} + +func (i Severity) String() string { + idx := int(i) - 0 + if i < 0 || idx >= len(_Severity_index)-1 { + return "Severity(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _Severity_name[_Severity_index[idx]:_Severity_index[idx+1]] +} diff --git a/vendor/go.opentelemetry.io/otel/metric/meter.go b/vendor/go.opentelemetry.io/otel/metric/meter.go index 70ff4c73184..971241572b8 100644 --- a/vendor/go.opentelemetry.io/otel/metric/meter.go +++ b/vendor/go.opentelemetry.io/otel/metric/meter.go @@ -320,7 +320,7 @@ type Observer interface { ObserveInt64(obsrv Int64Observable, value int64, opts ...ObserveOption) } -// Registration is an token representing the unique registration of a callback +// Registration is a token representing the unique registration of a callback // for a set of instruments with a Meter. // // Warning: Methods may be added to this interface in minor releases. See diff --git a/vendor/go.opentelemetry.io/otel/propagation/internal/hextable/hextable.go b/vendor/go.opentelemetry.io/otel/propagation/internal/hextable/hextable.go new file mode 100644 index 00000000000..3d63244c27a --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/propagation/internal/hextable/hextable.go @@ -0,0 +1,32 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Package hextable provides a lookup table for decoding lowercase +// hexadecimal. +package hextable + +// Rev is a reverse hex lookup table for lowercase hex digits. Valid +// hexadecimal characters are indexed at their respective values. All other +// characters, including the upper-case A-F disallowed by the W3C trace +// context specification, are represented with '\xff'. +// +// The '\xff' character is used as invalid because no valid character has the +// upper 4 bits set. Meaning, an efficient validation can be performed over +// multiple character parsing by checking these bits remain zero. +const Rev = "" + + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\xff\xff\xff\xff\xff\xff" + + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + + "\xff\x0a\x0b\x0c\x0d\x0e\x0f\xff\xff\xff\xff\xff\xff\xff\xff\xff" + + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" diff --git a/vendor/go.opentelemetry.io/otel/propagation/trace_context.go b/vendor/go.opentelemetry.io/otel/propagation/trace_context.go index ffaa903039c..1eb36b88e84 100644 --- a/vendor/go.opentelemetry.io/otel/propagation/trace_context.go +++ b/vendor/go.opentelemetry.io/otel/propagation/trace_context.go @@ -9,6 +9,7 @@ import ( "fmt" "strings" + "go.opentelemetry.io/otel/propagation/internal/hextable" "go.opentelemetry.io/otel/trace" ) @@ -126,27 +127,23 @@ func (TraceContext) extract(carrier TextMapCarrier) trace.SpanContext { return sc } -// upperHex detect hex is upper case Unicode characters. -func upperHex(v string) bool { - for _, c := range v { - if c >= 'A' && c <= 'F' { - return true - } - } - return false -} - func extractPart(dst []byte, h *string, n int) bool { part, left, _ := strings.Cut(*h, delimiter) *h = left - // hex.Decode decodes unsupported upper-case characters, so exclude explicitly. - if len(part) != n || upperHex(part) { + if len(part) != n { return false } - if p, err := hex.Decode(dst, []byte(part)); err != nil || p != n/2 { - return false + // hextable.Rev maps every invalid character to 0xff, including the + // upper-case A-F the specification disallows. OR-ing every looked-up value + // together lets a single check detect any invalid character, because no + // valid value has the upper 4 bits set. + invalidMark := byte(0) + for i := 0; i < n; i += 2 { + hi, lo := hextable.Rev[part[i]], hextable.Rev[part[i+1]] + dst[i/2] = (hi << 4) | lo + invalidMark |= hi | lo } - return true + return invalidMark&0xf0 == 0 } // Fields returns the keys who's values are set with Inject. diff --git a/vendor/go.opentelemetry.io/otel/renovate.json b/vendor/go.opentelemetry.io/otel/renovate.json index fa5acf2d3bd..5008ab2bf16 100644 --- a/vendor/go.opentelemetry.io/otel/renovate.json +++ b/vendor/go.opentelemetry.io/otel/renovate.json @@ -15,6 +15,13 @@ "matchDepTypes": ["indirect"], "enabled": true }, + { + "description": "Disable Go module major updates to v2+", + "matchManagers": ["gomod"], + "matchUpdateTypes": ["major"], + "matchNewValue": "/^v?([2-9]|[1-9][0-9]+)\\./", + "enabled": false + }, { "matchPackageNames": ["go.opentelemetry.io/build-tools/**"], "groupName": "build-tools" diff --git a/vendor/go.opentelemetry.io/otel/sdk/instrumentation/doc.go b/vendor/go.opentelemetry.io/otel/sdk/instrumentation/doc.go index a4faa6a03d5..39b34eabeae 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/instrumentation/doc.go +++ b/vendor/go.opentelemetry.io/otel/sdk/instrumentation/doc.go @@ -10,4 +10,4 @@ // and // https://github.com/open-telemetry/oteps/blob/d226b677d73a785523fe9b9701be13225ebc528d/text/0201-scope-attributes.md // for more information. -package instrumentation // import "go.opentelemetry.io/otel/sdk/instrumentation" +package instrumentation diff --git a/vendor/go.opentelemetry.io/otel/sdk/instrumentation/library.go b/vendor/go.opentelemetry.io/otel/sdk/instrumentation/library.go index f2cdf3c6518..8baf8dbb359 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/instrumentation/library.go +++ b/vendor/go.opentelemetry.io/otel/sdk/instrumentation/library.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package instrumentation // import "go.opentelemetry.io/otel/sdk/instrumentation" +package instrumentation // Library represents the instrumentation library. // diff --git a/vendor/go.opentelemetry.io/otel/sdk/instrumentation/scope.go b/vendor/go.opentelemetry.io/otel/sdk/instrumentation/scope.go index 34852a47b21..1fd06db75b7 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/instrumentation/scope.go +++ b/vendor/go.opentelemetry.io/otel/sdk/instrumentation/scope.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package instrumentation // import "go.opentelemetry.io/otel/sdk/instrumentation" +package instrumentation import "go.opentelemetry.io/otel/attribute" diff --git a/vendor/go.opentelemetry.io/otel/sdk/internal/attrnorm/dedup.go b/vendor/go.opentelemetry.io/otel/sdk/internal/attrnorm/dedup.go new file mode 100644 index 00000000000..d72cfb3c925 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/sdk/internal/attrnorm/dedup.go @@ -0,0 +1,802 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// DO NOT MODIFY. Generated by gotmpl. +// source: internal/shared/attrnorm/dedup.go.tmpl + +// Package attrnorm normalizes attribute values. +package attrnorm + +import ( + "reflect" + "unsafe" + + "go.opentelemetry.io/otel/attribute" +) + +var ( + keyValueType = reflect.TypeFor[attribute.KeyValue]() + valueType = reflect.TypeFor[attribute.Value]() +) + +// rawValue mirrors attribute.Value. It is used only to read immutable slice +// storage without calling AsMap or AsSlice on no-op paths. +type rawValue struct { + vtype attribute.Type + numeric uint64 + stringly string + slice any +} + +type valueChanges uint8 + +const ( + depthLimitChanged valueChanges = 1 << iota + deduplicationChanged +) + +// ValueDedup returns value with all map values deduplicated and whether +// it changed. +// +// Duplicate map keys are resolved using last-value-wins semantics. +func ValueDedup(value attribute.Value) (attribute.Value, bool) { + switch value.Type() { + case attribute.SLICE: + return sliceValueDedup(value) + case attribute.MAP: + return mapValueDedup(value) + default: + return value, false + } +} + +// ValueDedupLimitDepth returns value with all map values +// deduplicated and all array and map values limited to depthLimit. The boolean +// results report depth limiting and deduplication changes, respectively. +// +// Duplicate map keys are resolved using last-value-wins semantics. Depth +// starts at one for value and increments when descending into an array element +// or map value. An array or map beyond a non-negative depthLimit is replaced by +// an empty value. A negative depthLimit disables depth limiting. +func ValueDedupLimitDepth( + value attribute.Value, + depthLimit int, +) (attribute.Value, bool, bool) { + if depthLimit < 0 { + value, deduplicated := ValueDedup(value) + return value, false, deduplicated + } + + // Keep the common scalar and primitive-array cases in this wrapper. Routing + // them through the recursive, multi-result transform adds measurable + // overhead to the dominant simple attribute path. + switch value.Type() { + case attribute.BOOLSLICE, + attribute.INT64SLICE, + attribute.FLOAT64SLICE, + attribute.STRINGSLICE, + attribute.BYTESLICE: + if depthLimit == 0 { + return attribute.Value{}, true, false + } + return value, false, false + case attribute.SLICE, attribute.MAP: + default: + return value, false, false + } + + value, changes := valueDedupLimitDepth(value, depthLimit) + return value, changes&depthLimitChanged != 0, changes&deduplicationChanged != 0 +} + +// ValueLimitDepth returns value with all array and map values limited to +// depthLimit. Map keys are not deduplicated. +// +// Depth starts at one for value and increments when descending into an array +// element or map value. An array or map beyond a non-negative depthLimit is +// replaced by an empty value. A negative depthLimit disables depth limiting. +func ValueLimitDepth(value attribute.Value, depthLimit int) (attribute.Value, bool) { + if depthLimit < 0 { + return value, false + } + + switch value.Type() { + case attribute.BOOLSLICE, + attribute.INT64SLICE, + attribute.FLOAT64SLICE, + attribute.STRINGSLICE, + attribute.BYTESLICE: + if depthLimit == 0 { + return attribute.Value{}, true + } + return value, false + case attribute.SLICE, attribute.MAP: + default: + return value, false + } + + return valueLimitDepth(value, depthLimit) +} + +// KeyValueDedup returns kv with all map values deduplicated and whether +// it changed. +func KeyValueDedup(kv attribute.KeyValue) (attribute.KeyValue, bool) { + value, changed := ValueDedup(kv.Value) + if changed { + kv.Value = value + } + return kv, changed +} + +// KeyValueDedupLimitDepth returns kv with all map values +// deduplicated and all array and map values limited to depthLimit. The boolean +// results report depth limiting and deduplication changes, respectively. +func KeyValueDedupLimitDepth( + kv attribute.KeyValue, + depthLimit int, +) (attribute.KeyValue, bool, bool) { + value, depthLimited, deduplicated := ValueDedupLimitDepth(kv.Value, depthLimit) + if depthLimited || deduplicated { + kv.Value = value + } + return kv, depthLimited, deduplicated +} + +// KeyValueLimitDepth returns kv with all array and map values limited to +// depthLimit. Map keys are not deduplicated. +func KeyValueLimitDepth(kv attribute.KeyValue, depthLimit int) (attribute.KeyValue, bool) { + value, changed := ValueLimitDepth(kv.Value, depthLimit) + if changed { + kv.Value = value + } + return kv, changed +} + +// KeyValuesDedup returns kvs with all map values deduplicated and whether +// they changed. +// +// The returned slice is the original kvs slice if no value needs +// deduplication. Top-level keys in kvs are not deduplicated. +func KeyValuesDedup(kvs []attribute.KeyValue) ([]attribute.KeyValue, bool) { + // Preserve the caller's slice on the common no-op path. Once a changed + // value is found, copy the prior values exactly once and fill the rest in + // place as the scan continues. + var normalized []attribute.KeyValue + for i, kv := range kvs { + kv, changed := KeyValueDedup(kv) + if normalized != nil { + normalized[i] = kv + continue + } + if !changed { + continue + } + + normalized = make([]attribute.KeyValue, len(kvs)) + copy(normalized, kvs[:i]) + normalized[i] = kv + } + if normalized == nil { + return kvs, false + } + return normalized, true +} + +// KeyValuesDedupLimitDepth returns kvs with all map values +// deduplicated and all array and map values limited to depthLimit. The boolean +// results report depth limiting and deduplication changes, respectively. +// +// The returned slice is the original kvs slice if no value needs +// normalization. Top-level keys in kvs are not deduplicated. +func KeyValuesDedupLimitDepth( + kvs []attribute.KeyValue, + depthLimit int, +) ([]attribute.KeyValue, bool, bool) { + if depthLimit < 0 { + kvs, deduplicated := KeyValuesDedup(kvs) + return kvs, false, deduplicated + } + + var normalized []attribute.KeyValue + var allChanges valueChanges + for i, kv := range kvs { + value, changes := valueDedupLimitDepth(kv.Value, depthLimit) + allChanges |= changes + if changes != 0 { + kv.Value = value + } + if normalized != nil { + normalized[i] = kv + continue + } + if changes == 0 { + continue + } + + normalized = make([]attribute.KeyValue, len(kvs)) + copy(normalized, kvs[:i]) + normalized[i] = kv + } + if normalized == nil { + return kvs, false, false + } + return normalized, + allChanges&depthLimitChanged != 0, + allChanges&deduplicationChanged != 0 +} + +// SetDedup returns set with all map values deduplicated and whether it +// changed. +// +// The returned Set is the original set if no value needs deduplication. +// Top-level key uniqueness remains attribute.Set's responsibility; this only +// normalizes map attribute values. +func SetDedup(set attribute.Set) (attribute.Set, bool) { + length := set.Len() + if length == 0 { + return set, false + } + + // Most attribute sets contain no duplicate map keys. Delay allocation until + // the first changed value so the no-op path returns the original Set. + var normalized []attribute.KeyValue + for i := range length { + kv, _ := set.Get(i) + kv, changed := KeyValueDedup(kv) + if normalized != nil { + normalized = append(normalized, kv) + continue + } + if !changed { + continue + } + + normalized = make([]attribute.KeyValue, 0, length) + for j := range i { + prior, _ := set.Get(j) + normalized = append(normalized, prior) + } + normalized = append(normalized, kv) + } + if normalized == nil { + return set, false + } + + return attribute.NewSet(normalized...), true +} + +// SetDedupLimitDepth returns set with all map values deduplicated and +// all array and map values limited to depthLimit. The boolean results report +// depth limiting and deduplication changes, respectively. +// +// The returned Set is the original set if no value needs normalization. +// Top-level key uniqueness remains attribute.Set's responsibility; this only +// normalizes attribute values. +func SetDedupLimitDepth( + set attribute.Set, + depthLimit int, +) (attribute.Set, bool, bool) { + if depthLimit < 0 { + set, deduplicated := SetDedup(set) + return set, false, deduplicated + } + length := set.Len() + if length == 0 { + return set, false, false + } + + var normalized []attribute.KeyValue + var allChanges valueChanges + for i := range length { + kv, _ := set.Get(i) + value, changes := valueDedupLimitDepth(kv.Value, depthLimit) + allChanges |= changes + if changes != 0 { + kv.Value = value + } + if normalized != nil { + normalized = append(normalized, kv) + continue + } + if changes == 0 { + continue + } + + normalized = make([]attribute.KeyValue, 0, length) + for j := range i { + prior, _ := set.Get(j) + normalized = append(normalized, prior) + } + normalized = append(normalized, kv) + } + if normalized == nil { + return set, false, false + } + return attribute.NewSet(normalized...), + allChanges&depthLimitChanged != 0, + allChanges&deduplicationChanged != 0 +} + +// SetLimitDepth returns set with all array and map values limited to +// depthLimit. Map keys are not deduplicated. +// +// The returned Set is the original set if no value changes. +func SetLimitDepth(set attribute.Set, depthLimit int) (attribute.Set, bool) { + if depthLimit < 0 { + return set, false + } + length := set.Len() + if length == 0 { + return set, false + } + + var normalized []attribute.KeyValue + for i := range length { + kv, _ := set.Get(i) + value, changed := valueLimitDepth(kv.Value, depthLimit) + if changed { + kv.Value = value + } + if normalized != nil { + normalized = append(normalized, kv) + continue + } + if !changed { + continue + } + + normalized = make([]attribute.KeyValue, 0, length) + for j := range i { + prior, _ := set.Get(j) + normalized = append(normalized, prior) + } + normalized = append(normalized, kv) + } + if normalized == nil { + return set, false + } + return attribute.NewSet(normalized...), true +} + +// valueDedupLimitDepth combines depth limiting with recursive map +// deduplication. remainingDepth is non-negative. It checks the remaining +// budget before reading collection storage and lazily rebuilds only changed +// ancestry. +func valueDedupLimitDepth( + value attribute.Value, + remainingDepth int, +) (attribute.Value, valueChanges) { + switch value.Type() { + case attribute.BOOLSLICE, + attribute.INT64SLICE, + attribute.FLOAT64SLICE, + attribute.STRINGSLICE, + attribute.BYTESLICE: + if remainingDepth == 0 { + return attribute.Value{}, depthLimitChanged + } + case attribute.SLICE: + if remainingDepth == 0 { + return attribute.Value{}, depthLimitChanged + } + return sliceValueDedupLimitDepth(value, remainingDepth) + case attribute.MAP: + if remainingDepth == 0 { + return attribute.Value{}, depthLimitChanged + } + return mapValueDedupLimitDepth(value, remainingDepth) + } + return value, 0 +} + +// valueLimitDepth limits collection depth while preserving duplicate map keys. +func valueLimitDepth( + value attribute.Value, + remainingDepth int, +) (attribute.Value, bool) { + switch value.Type() { + case attribute.BOOLSLICE, + attribute.INT64SLICE, + attribute.FLOAT64SLICE, + attribute.STRINGSLICE, + attribute.BYTESLICE: + if remainingDepth == 0 { + return attribute.Value{}, true + } + case attribute.SLICE: + if remainingDepth == 0 { + return attribute.Value{}, true + } + return sliceValueLimitDepth(value, remainingDepth) + case attribute.MAP: + if remainingDepth == 0 { + return attribute.Value{}, true + } + return mapValueLimitDepth(value, remainingDepth) + } + return value, false +} + +func sliceValueDedupLimitDepth( + value attribute.Value, + remainingDepth int, +) (attribute.Value, valueChanges) { + storage := valueStorage(value) + length := valueLen(storage) + if length <= 1 { + if length == 1 { + elem := valueAt(storage, 0) + newElem, changes := valueDedupLimitDepth( + elem, + remainingDepth-1, + ) + if changes != 0 { + return attribute.SliceValue(newElem), changes + } + } + return value, 0 + } + + var normalized []attribute.Value + var allChanges valueChanges + for i := range length { + elem := valueAt(storage, i) + newElem, changes := valueDedupLimitDepth( + elem, + remainingDepth-1, + ) + allChanges |= changes + if normalized != nil { + normalized[i] = newElem + continue + } + if changes == 0 { + continue + } + + normalized = make([]attribute.Value, length) + for j := range i { + normalized[j] = valueAt(storage, j) + } + normalized[i] = newElem + } + if normalized == nil { + return value, 0 + } + return attribute.SliceValue(normalized...), allChanges +} + +func sliceValueLimitDepth( + value attribute.Value, + remainingDepth int, +) (attribute.Value, bool) { + storage := valueStorage(value) + length := valueLen(storage) + if length <= 1 { + if length == 1 { + elem := valueAt(storage, 0) + newElem, changed := valueLimitDepth(elem, remainingDepth-1) + if changed { + return attribute.SliceValue(newElem), true + } + } + return value, false + } + + var normalized []attribute.Value + for i := range length { + elem := valueAt(storage, i) + newElem, changed := valueLimitDepth(elem, remainingDepth-1) + if normalized != nil { + normalized[i] = newElem + continue + } + if !changed { + continue + } + + normalized = make([]attribute.Value, length) + for j := range i { + normalized[j] = valueAt(storage, j) + } + normalized[i] = newElem + } + if normalized == nil { + return value, false + } + return attribute.SliceValue(normalized...), true +} + +func mapValueDedupLimitDepth( + value attribute.Value, + remainingDepth int, +) (attribute.Value, valueChanges) { + storage := valueStorage(value) + length := keyValueLen(storage) + if length <= 1 { + if length == 1 { + kv := keyValueAt(storage, 0) + newValue, changes := valueDedupLimitDepth( + kv.Value, + remainingDepth-1, + ) + if changes != 0 { + kv.Value = newValue + return attribute.MapValue(kv), changes + } + } + return value, 0 + } + + var normalized []attribute.KeyValue + var allChanges valueChanges + for i := 0; i < length; { + // attribute.MapValue stores key-values sorted by key using a stable + // sort. Only the last entry in an equal-key run survives, so avoid + // traversing values that will be discarded. + first := keyValueAt(storage, i) + j := i + 1 + for j < length && keyValueAt(storage, j).Key == first.Key { + j++ + } + + kv := keyValueAt(storage, j-1) + newValue, changes := valueDedupLimitDepth( + kv.Value, + remainingDepth-1, + ) + if changes != 0 { + kv.Value = newValue + } + if j-i > 1 { + changes |= deduplicationChanged + } + allChanges |= changes + if normalized != nil { + normalized = append(normalized, kv) + } else if changes != 0 { + if i == 0 && j == length { + return attribute.MapValue(kv), allChanges + } + normalized = make([]attribute.KeyValue, 0, length-(j-i-1)) + for k := range i { + normalized = append(normalized, keyValueAt(storage, k)) + } + normalized = append(normalized, kv) + } + i = j + } + if normalized == nil { + return value, 0 + } + return attribute.MapValue(normalized...), allChanges +} + +func mapValueLimitDepth( + value attribute.Value, + remainingDepth int, +) (attribute.Value, bool) { + storage := valueStorage(value) + length := keyValueLen(storage) + if length <= 1 { + if length == 1 { + kv := keyValueAt(storage, 0) + newValue, changed := valueLimitDepth(kv.Value, remainingDepth-1) + if changed { + kv.Value = newValue + return attribute.MapValue(kv), true + } + } + return value, false + } + + var normalized []attribute.KeyValue + for i := range length { + kv := keyValueAt(storage, i) + newValue, changed := valueLimitDepth(kv.Value, remainingDepth-1) + if changed { + kv.Value = newValue + } + if normalized != nil { + normalized[i] = kv + continue + } + if !changed { + continue + } + + normalized = make([]attribute.KeyValue, length) + for j := range i { + normalized[j] = keyValueAt(storage, j) + } + normalized[i] = kv + } + if normalized == nil { + return value, false + } + return attribute.MapValue(normalized...), true +} + +func sliceValueDedup(value attribute.Value) (attribute.Value, bool) { + storage := valueStorage(value) + length := valueLen(storage) + + // Slice values can contain map values, so recurse into each element while + // keeping the original attribute.Value when no element changes. + var normalized []attribute.Value + for i := range length { + elem := valueAt(storage, i) + elem, changed := ValueDedup(elem) + if normalized != nil { + normalized[i] = elem + continue + } + if !changed { + continue + } + + normalized = make([]attribute.Value, length) + for j := range i { + normalized[j] = valueAt(storage, j) + } + normalized[i] = elem + } + if normalized == nil { + return value, false + } + return attribute.SliceValue(normalized...), true +} + +func mapValueDedup(value attribute.Value) (attribute.Value, bool) { + storage := valueStorage(value) + length := keyValueLen(storage) + if length <= 1 { + // A single map entry cannot duplicate its own key, but its value might + // contain a map or slice that needs recursive normalization. + if length == 1 { + kv, changed := KeyValueDedup(keyValueAt(storage, 0)) + if changed { + return attribute.MapValue(kv), true + } + } + return value, false + } + + var normalized []attribute.KeyValue + for i := 0; i < length; { + // attribute.MapValue stores key-values sorted by key using a stable + // sort. Equal keys therefore form a contiguous run, and the last + // element in that run is the last value provided by the caller. + first := keyValueAt(storage, i) + j := i + 1 + for j < length && keyValueAt(storage, j).Key == first.Key { + j++ + } + + kv, nestedChanged := KeyValueDedup(keyValueAt(storage, j-1)) + // j-i > 1 means the current key run contained duplicates. + changed := nestedChanged || j-i > 1 + if normalized != nil { + normalized = append(normalized, kv) + } else if changed { + if i == 0 && j == length { + return attribute.MapValue(kv), true + } + normalized = make([]attribute.KeyValue, 0, length-(j-i-1)) + for k := range i { + normalized = append(normalized, keyValueAt(storage, k)) + } + normalized = append(normalized, kv) + } + i = j + } + if normalized == nil { + return value, false + } + return attribute.MapValue(normalized...), true +} + +func valueStorage(value attribute.Value) any { + // attribute.Value does not expose allocation-free map/slice iteration. + // The raw mirror lets us read the immutable backing array directly and + // reserve AsMap/AsSlice-style allocation for paths that actually change. + return (*rawValue)( + unsafe.Pointer(&value), + ).slice //nolint:gosec // Read-only mirror of attribute.Value for allocation-free iteration. +} + +func valueLen(storage any) int { + // attribute.Value stores small slices in fixed-size array values. Handle + // the common sizes directly and fall back to reflection for larger arrays. + switch storage.(type) { + case [0]attribute.Value: + return 0 + case [1]attribute.Value: + return 1 + case [2]attribute.Value: + return 2 + case [3]attribute.Value: + return 3 + case [4]attribute.Value: + return 4 + case [5]attribute.Value: + return 5 + default: + return arrayLen(storage, valueType) + } +} + +func valueAt(storage any, i int) attribute.Value { + switch values := storage.(type) { + case [1]attribute.Value: + return values[i] + case [2]attribute.Value: + return values[i] + case [3]attribute.Value: + return values[i] + case [4]attribute.Value: + return values[i] + case [5]attribute.Value: + return values[i] + default: + return arrayAt[attribute.Value](storage, valueType, i) + } +} + +func keyValueLen(storage any) int { + // attribute.Value stores small maps in fixed-size key-value arrays. Handle + // the common sizes directly and fall back to reflection for larger arrays. + switch storage.(type) { + case [0]attribute.KeyValue: + return 0 + case [1]attribute.KeyValue: + return 1 + case [2]attribute.KeyValue: + return 2 + case [3]attribute.KeyValue: + return 3 + case [4]attribute.KeyValue: + return 4 + case [5]attribute.KeyValue: + return 5 + default: + return arrayLen(storage, keyValueType) + } +} + +func keyValueAt(storage any, i int) attribute.KeyValue { + switch kvs := storage.(type) { + case [1]attribute.KeyValue: + return kvs[i] + case [2]attribute.KeyValue: + return kvs[i] + case [3]attribute.KeyValue: + return kvs[i] + case [4]attribute.KeyValue: + return kvs[i] + case [5]attribute.KeyValue: + return kvs[i] + default: + return arrayAt[attribute.KeyValue](storage, keyValueType, i) + } +} + +func arrayLen(storage any, elem reflect.Type) int { + // Be defensive around invalid or unexpected Value storage. Returning zero + // makes malformed storage a no-op instead of panicking in telemetry paths. + array := reflect.ValueOf(storage) + if array.Kind() != reflect.Array || array.Type().Elem() != elem { + return 0 + } + return array.Len() +} + +func arrayAt[T any](storage any, elem reflect.Type, i int) T { + // Match arrayLen's fail-closed behavior for unexpected storage. + array := reflect.ValueOf(storage) + if array.Kind() != reflect.Array || array.Type().Elem() != elem || i < 0 || i >= array.Len() { + var zero T + return zero + } + return array.Index(i).Interface().(T) +} diff --git a/vendor/go.opentelemetry.io/otel/sdk/internal/attrnorm/truncate.go b/vendor/go.opentelemetry.io/otel/sdk/internal/attrnorm/truncate.go new file mode 100644 index 00000000000..db7c5388ca2 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/sdk/internal/attrnorm/truncate.go @@ -0,0 +1,416 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// DO NOT MODIFY. Generated by gotmpl. +// source: internal/shared/attrnorm/truncate.go.tmpl + +package attrnorm + +import ( + "reflect" + "strings" + "unicode/utf8" + + "go.opentelemetry.io/otel/attribute" +) + +// Truncate returns a truncated version of attr. Only string, string slice, +// byte slice, slice, and map attribute values are truncated. String values are +// truncated according to limit. Each string slice value is truncated in this +// fashion (the slice length itself is unaffected), and byte slice values are +// truncated to at most limit bytes. For slice and map attribute values, the +// limit is applied recursively to contained values. +// +// No truncation is performed for a negative limit. +func Truncate(limit int, attr attribute.KeyValue) attribute.KeyValue { + if limit < 0 { + return attr + } + + // Keep scalar cases in this wrapper. Routing them through the recursive, + // multi-result transform adds measurable overhead to the dominant simple + // attribute path. + switch attr.Value.Type() { + case attribute.STRING: + attr.Value = attribute.StringValue(truncate(limit, attr.Value.AsString())) + case attribute.BYTESLICE: + s := attr.Value.AsString() + if len(s) > limit { + attr.Value = attribute.ByteSliceValue([]byte(s[:limit])) + } + case attribute.STRINGSLICE: + attr.Value, _ = truncateStringSliceValue(limit, attr.Value) + case attribute.SLICE: + attr.Value, _ = truncateSliceValue(limit, attr.Value) + case attribute.MAP: + attr.Value, _ = truncateMapValue(limit, attr.Value) + } + return attr +} + +// TruncateValue returns a truncated version of v. Only string, string +// slice, byte slice, and (recursively) slice and map values are modified. +// +// No truncation is performed for a negative limit. +func TruncateValue(limit int, v attribute.Value) attribute.Value { + if limit < 0 { + return v + } + + // Match Truncate's direct scalar path to avoid paying for the recursive, + // multi-result transform when no composite traversal is needed. + switch v.Type() { + case attribute.STRING: + return attribute.StringValue(truncate(limit, v.AsString())) + case attribute.BYTESLICE: + s := v.AsString() + if len(s) > limit { + return attribute.ByteSliceValue([]byte(s[:limit])) + } + case attribute.STRINGSLICE: + v, _ = truncateStringSliceValue(limit, v) + case attribute.SLICE: + v, _ = truncateSliceValue(limit, v) + case attribute.MAP: + v, _ = truncateMapValue(limit, v) + } + return v +} + +// truncateValue traverses composite values once and rebuilds them lazily on +// the first changed child. Recursion provides O(depth) temporary stack space +// without forcing a heap allocation on the common no-op path. +func truncateValue(limit int, v attribute.Value) (attribute.Value, bool) { + switch v.Type() { + case attribute.STRING: + s := v.AsString() + truncated := truncate(limit, s) + if truncated != s { + return attribute.StringValue(truncated), true + } + case attribute.STRINGSLICE: + return truncateStringSliceValue(limit, v) + case attribute.BYTESLICE: + // len(v.AsString()) is identical to len(v.AsByteSlice()) but + // avoids allocating the full slice before truncation. + s := v.AsString() + if len(s) > limit { + return attribute.ByteSliceValue([]byte(s[:limit])), true + } + case attribute.SLICE: + return truncateSliceValue(limit, v) + case attribute.MAP: + return truncateMapValue(limit, v) + } + return v, false +} + +func truncateStringSliceValue(limit int, value attribute.Value) (attribute.Value, bool) { + storage := valueStorage(value) + switch values := storage.(type) { + case [0]string: + return value, false + case [1]string: + return truncateStrings(limit, value, values[:]) + case [2]string: + return truncateStrings(limit, value, values[:]) + case [3]string: + return truncateStrings(limit, value, values[:]) + default: + array := reflect.ValueOf(storage) + if array.Kind() != reflect.Array || array.Type().Elem() != stringType { + return value, false + } + return truncateStringArray(limit, value, array) + } +} + +func truncateStrings(limit int, value attribute.Value, values []string) (attribute.Value, bool) { + var truncated []string + for i, s := range values { + newS := truncate(limit, s) + if truncated != nil { + truncated[i] = newS + continue + } + if newS == s { + continue + } + + truncated = make([]string, len(values)) + copy(truncated, values[:i]) + truncated[i] = newS + } + if truncated == nil { + return value, false + } + return attribute.StringSliceValue(truncated), true +} + +func truncateStringArray(limit int, value attribute.Value, values reflect.Value) (attribute.Value, bool) { + var truncated []string + for i := range values.Len() { + s := values.Index(i).String() + newS := truncate(limit, s) + if truncated != nil { + truncated[i] = newS + continue + } + if newS == s { + continue + } + + truncated = make([]string, values.Len()) + for j := range i { + truncated[j] = values.Index(j).String() + } + truncated[i] = newS + } + if truncated == nil { + return value, false + } + return attribute.StringSliceValue(truncated), true +} + +func truncateSliceValue(limit int, value attribute.Value) (attribute.Value, bool) { + storage := valueStorage(value) + switch values := storage.(type) { + case [0]attribute.Value: + return value, false + case [1]attribute.Value: + return truncateValueSlice(limit, value, values[:]) + case [2]attribute.Value: + return truncateValueSlice(limit, value, values[:]) + case [3]attribute.Value: + return truncateValueSlice(limit, value, values[:]) + case [4]attribute.Value: + return truncateValueSlice(limit, value, values[:]) + case [5]attribute.Value: + return truncateValueSlice(limit, value, values[:]) + default: + array := reflect.ValueOf(storage) + if array.Kind() != reflect.Array || array.Type().Elem() != valueType { + return value, false + } + return truncateValueArray(limit, value, array) + } +} + +func truncateValueSlice(limit int, value attribute.Value, values []attribute.Value) (attribute.Value, bool) { + var truncated []attribute.Value + for i, elem := range values { + newElem, changed := truncateValue(limit, elem) + if truncated != nil { + truncated[i] = newElem + continue + } + if !changed { + continue + } + + truncated = make([]attribute.Value, len(values)) + copy(truncated, values[:i]) + truncated[i] = newElem + } + if truncated == nil { + return value, false + } + return attribute.SliceValue(truncated...), true +} + +func truncateValueArray(limit int, value attribute.Value, values reflect.Value) (attribute.Value, bool) { + var truncated []attribute.Value + for i := range values.Len() { + elem := values.Index(i).Interface().(attribute.Value) + newElem, changed := truncateValue(limit, elem) + if truncated != nil { + truncated[i] = newElem + continue + } + if !changed { + continue + } + + truncated = make([]attribute.Value, values.Len()) + for j := range i { + truncated[j] = values.Index(j).Interface().(attribute.Value) + } + truncated[i] = newElem + } + if truncated == nil { + return value, false + } + return attribute.SliceValue(truncated...), true +} + +func truncateMapValue(limit int, value attribute.Value) (attribute.Value, bool) { + storage := valueStorage(value) + switch keyValues := storage.(type) { + case [0]attribute.KeyValue: + return value, false + case [1]attribute.KeyValue: + return truncateKeyValueSlice(limit, value, keyValues[:]) + case [2]attribute.KeyValue: + return truncateKeyValueSlice(limit, value, keyValues[:]) + case [3]attribute.KeyValue: + return truncateKeyValueSlice(limit, value, keyValues[:]) + case [4]attribute.KeyValue: + return truncateKeyValueSlice(limit, value, keyValues[:]) + case [5]attribute.KeyValue: + return truncateKeyValueSlice(limit, value, keyValues[:]) + default: + array := reflect.ValueOf(storage) + if array.Kind() != reflect.Array || array.Type().Elem() != keyValueType { + return value, false + } + return truncateKeyValueArray(limit, value, array) + } +} + +func truncateKeyValueSlice( + limit int, + value attribute.Value, + keyValues []attribute.KeyValue, +) (attribute.Value, bool) { + var truncated []attribute.KeyValue + for i, kv := range keyValues { + newValue, changed := truncateValue(limit, kv.Value) + if changed { + kv.Value = newValue + } + if truncated != nil { + truncated[i] = kv + continue + } + if !changed { + continue + } + + truncated = make([]attribute.KeyValue, len(keyValues)) + copy(truncated, keyValues[:i]) + truncated[i] = kv + } + if truncated == nil { + return value, false + } + return attribute.MapValue(truncated...), true +} + +func truncateKeyValueArray(limit int, value attribute.Value, keyValues reflect.Value) (attribute.Value, bool) { + var truncated []attribute.KeyValue + for i := range keyValues.Len() { + kv := keyValues.Index(i).Interface().(attribute.KeyValue) + newValue, changed := truncateValue(limit, kv.Value) + if changed { + kv.Value = newValue + } + if truncated != nil { + truncated[i] = kv + continue + } + if !changed { + continue + } + + truncated = make([]attribute.KeyValue, keyValues.Len()) + for j := range i { + truncated[j] = keyValues.Index(j).Interface().(attribute.KeyValue) + } + truncated[i] = kv + } + if truncated == nil { + return value, false + } + return attribute.MapValue(truncated...), true +} + +var stringType = reflect.TypeFor[string]() + +// truncate returns a version of s truncated according to limit. +// +// If limit is negative, it returns the original string. +// +// UTF-8 is supported. When truncating, all invalid UTF-8 bytes are dropped +// before applying truncation. +// +// If s already contains at most limit bytes, it is returned unchanged. No +// invalid characters are removed. +func truncate(limit int, s string) string { + // This prioritizes performance in the following order based on the most + // common expected use cases. + // + // - Values whose byte length does not exceed the limit. + // - Strings with valid encodings that exceed the limit. + // - No limit. + // - Strings with invalid encodings that exceed the limit. + if limit < 0 || len(s) <= limit { + return s + } + + // Optimistically, assume all valid UTF-8. + var b strings.Builder + count := 0 + for i, c := range s { + if c != utf8.RuneError { + count++ + if count > limit { + return s[:i] + } + continue + } + + // A zero limit also truncates a leading invalid byte or U+FFFD. + if limit == 0 { + return "" + } + // Range reports RuneError for both an invalid byte and a valid U+FFFD. + // Only a size-1 decoding indicates invalid UTF-8. + _, size := utf8.DecodeRuneInString(s[i:]) + if size == 1 { + // Removing this byte makes len(s)-1 an upper bound for a rebuilt + // result. Keep the valid prefix before rescanning s[i:]. + b.Grow(len(s) - 1) + _, _ = b.WriteString(s[:i]) + s = s[i:] + break + } + + // A valid U+FFFD still consumes one character of the limit. + count++ + if count > limit { + return s[:i] + } + } + + // Fast-path, no invalid input. + if b.Cap() == 0 { + return s + } + + // The builder holds the valid prefix before the first invalid byte, and + // count includes its runes. Skip malformed bytes without counting them + // while copying the remaining valid runes up to the limit. + for i := 0; i < len(s) && count < limit; { + c := s[i] + if c < utf8.RuneSelf { + // Optimization for single byte runes (common case). + _ = b.WriteByte(c) + i++ + count++ + continue + } + + _, size := utf8.DecodeRuneInString(s[i:]) + if size == 1 { + // We checked for all 1-byte runes above, this is a RuneError. + i++ + continue + } + + _, _ = b.WriteString(s[i : i+size]) + i += size + count++ + } + + return b.String() +} diff --git a/vendor/go.opentelemetry.io/otel/sdk/internal/x/features.go b/vendor/go.opentelemetry.io/otel/sdk/internal/x/features.go index 694b64a3180..13ff34b276f 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/internal/x/features.go +++ b/vendor/go.opentelemetry.io/otel/sdk/internal/x/features.go @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // Package x documents experimental features for [go.opentelemetry.io/otel/sdk]. -package x // import "go.opentelemetry.io/otel/sdk/internal/x" +package x import "strings" diff --git a/vendor/go.opentelemetry.io/otel/sdk/internal/x/x.go b/vendor/go.opentelemetry.io/otel/sdk/internal/x/x.go index 13347e56052..67eea20a746 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/internal/x/x.go +++ b/vendor/go.opentelemetry.io/otel/sdk/internal/x/x.go @@ -1,11 +1,11 @@ -// Code generated by gotmpl. DO NOT MODIFY. -// source: internal/shared/x/x.go.tmpl - // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +// DO NOT MODIFY. Generated by gotmpl. +// source: internal/shared/x/x.go.tmpl + // Package x documents experimental features for [go.opentelemetry.io/otel/sdk]. -package x // import "go.opentelemetry.io/otel/sdk/internal/x" +package x import ( "os" @@ -34,9 +34,9 @@ func newFeature[T any](suffix []string, parse func(string) (T, bool)) Feature[T] // feature. func (f Feature[T]) Keys() []string { return f.keys } -// Lookup returns the user configured value for the feature and true if the +// Lookup returns the user-configured value for the feature and true if the // user has enabled the feature. Otherwise, if the feature is not enabled, a -// zero-value and false are returned. +// zero value and false are returned. func (f Feature[T]) Lookup() (v T, ok bool) { // https://github.com/open-telemetry/opentelemetry-specification/blob/62effed618589a0bec416a87e559c0a9d96289bb/specification/configuration/sdk-environment-variables.md#parsing-empty-value // diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/aggregation.go b/vendor/go.opentelemetry.io/otel/sdk/metric/aggregation.go index e6f5cfb2ad9..5c7e85904dc 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/aggregation.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/aggregation.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package metric // import "go.opentelemetry.io/otel/sdk/metric" +package metric import ( "errors" @@ -79,7 +79,7 @@ func (l AggregationLastValue) copy() Aggregation { return l } func (AggregationLastValue) err() error { return nil } // AggregationExplicitBucketHistogram is an Aggregation that summarizes a set of -// measurements as an histogram with explicitly defined buckets. +// measurements as a histogram with explicitly defined buckets. type AggregationExplicitBucketHistogram struct { // Boundaries are the increasing bucket boundary values. Boundary values // define bucket upper bounds. Buckets are exclusive of their lower @@ -138,7 +138,7 @@ func (h AggregationExplicitBucketHistogram) copy() Aggregation { } // AggregationBase2ExponentialHistogram is an Aggregation that summarizes a set of -// measurements as an histogram with bucket widths that grow exponentially. +// measurements as a histogram with bucket widths that grow exponentially. type AggregationBase2ExponentialHistogram struct { // MaxSize is the maximum number of buckets to use for the histogram. MaxSize int32 diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/cache.go b/vendor/go.opentelemetry.io/otel/sdk/metric/cache.go index 63b88f08664..1d6f6a089aa 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/cache.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/cache.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package metric // import "go.opentelemetry.io/otel/sdk/metric" +package metric import ( "sync" diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/config.go b/vendor/go.opentelemetry.io/otel/sdk/metric/config.go index dda4e086db8..444a8cfda91 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/config.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/config.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package metric // import "go.opentelemetry.io/otel/sdk/metric" +package metric import ( "context" @@ -157,6 +157,8 @@ func WithView(views ...View) Option { // exemplar reservoir, but the exemplar reservoir makes the final decision of // whether to store an exemplar. // +// The filter must not be nil. +// // By default, the [exemplar.TraceBasedFilter] // is used. Exemplars can be entirely disabled by providing the // [exemplar.AlwaysOffFilter]. diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/doc.go b/vendor/go.opentelemetry.io/otel/sdk/metric/doc.go index 51e168c7504..61410b33091 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/doc.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/doc.go @@ -86,4 +86,4 @@ // // See [go.opentelemetry.io/otel/sdk/metric/internal/x] for information about // the experimental features. -package metric // import "go.opentelemetry.io/otel/sdk/metric" +package metric diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/env.go b/vendor/go.opentelemetry.io/otel/sdk/metric/env.go index a6c403797f6..090446d844c 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/env.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/env.go @@ -1,9 +1,10 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package metric // import "go.opentelemetry.io/otel/sdk/metric" +package metric import ( + "errors" "os" "strconv" "time" @@ -11,6 +12,8 @@ import ( "go.opentelemetry.io/otel/internal/global" ) +var errDurationOverflow = errors.New("duration overflows time.Duration") + // Environment variable names. const ( // The time interval (in milliseconds) between the start of two export attempts. @@ -26,7 +29,7 @@ func envDuration(key string, defaultValue time.Duration) time.Duration { if v == "" { return defaultValue } - d, err := strconv.Atoi(v) + d, err := strconv.ParseInt(v, 10, 64) if err != nil { global.Error(err, "parse duration", "environment variable", key, "value", v) return defaultValue @@ -35,5 +38,9 @@ func envDuration(key string, defaultValue time.Duration) time.Duration { global.Error(errNonPositiveDuration, "non-positive duration", "environment variable", key, "value", v) return defaultValue } + if d > int64(time.Duration(1<<63-1)/time.Millisecond) { + global.Error(errDurationOverflow, "duration overflows time.Duration", "environment variable", key, "value", v) + return defaultValue + } return time.Duration(d) * time.Millisecond } diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar.go b/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar.go index 993f001ae91..fb124052c63 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package metric // import "go.opentelemetry.io/otel/sdk/metric" +package metric import ( "reflect" diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/doc.go b/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/doc.go index 9f238937688..f7e54761769 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/doc.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/doc.go @@ -3,4 +3,4 @@ // Package exemplar provides an implementation of the OpenTelemetry exemplar // reservoir to be used in metric collection pipelines. -package exemplar // import "go.opentelemetry.io/otel/sdk/metric/exemplar" +package exemplar diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/exemplar.go b/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/exemplar.go index 1ab69467868..32913a6e5d4 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/exemplar.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/exemplar.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package exemplar // import "go.opentelemetry.io/otel/sdk/metric/exemplar" +package exemplar import ( "time" diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/filter.go b/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/filter.go index b50f5c1531c..a9efd20d1ad 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/filter.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/filter.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package exemplar // import "go.opentelemetry.io/otel/sdk/metric/exemplar" +package exemplar import ( "context" diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/fixed_size_reservoir.go b/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/fixed_size_reservoir.go index ce97ab1bf72..64f5884d047 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/fixed_size_reservoir.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/fixed_size_reservoir.go @@ -1,12 +1,10 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package exemplar // import "go.opentelemetry.io/otel/sdk/metric/exemplar" +package exemplar import ( "context" - "math" - "math/rand/v2" "sync" "time" @@ -26,7 +24,18 @@ func FixedSizeReservoirProvider(k int) ReservoirProvider { // sample each one. If there are more than k, the Reservoir will then randomly // sample all additional measurement with a decreasing probability. func NewFixedSizeReservoir(k int) *FixedSizeReservoir { - return newFixedSizeReservoir(newStorage(k)) + // A negative size is invalid. The constructor cannot return an error, so + // clamp it to zero and treat it as an empty reservoir (consistent with the + // existing behavior for k == 0) rather than panicking in make below. + if k < 0 { + k = 0 + } + r := &FixedSizeReservoir{ + storage: make([]measurement, k), + } + r.nt.k = k + r.nt.reset() + return r } var _ Reservoir = &FixedSizeReservoir{} @@ -37,43 +46,9 @@ var _ Reservoir = &FixedSizeReservoir{} // additional measurement with a decreasing probability. type FixedSizeReservoir struct { reservoir.ConcurrentSafe - *storage - mu sync.Mutex - - // count is the number of measurement seen. - count int64 - // next is the next count that will store a measurement at a random index - // once the reservoir has been filled. - next int64 - // w is the largest random number in a distribution that is used to compute - // the next next. - w float64 -} - -func newFixedSizeReservoir(s *storage) *FixedSizeReservoir { - r := &FixedSizeReservoir{ - storage: s, - } - if cap(r.measurements) > 0 { - r.reset() - } - return r -} - -// randomFloat64 returns, as a float64, a uniform pseudo-random number in the -// open interval (0.0,1.0). -func (*FixedSizeReservoir) randomFloat64() float64 { - // TODO: Use an algorithm that avoids rejection sampling. For example: - // - // const precision = 1 << 53 // 2^53 - // // Generate an integer in [1, 2^53 - 1] - // v := rand.Uint64() % (precision - 1) + 1 - // return float64(v) / float64(precision) - f := rand.Float64() - for f == 0 { - f = rand.Float64() - } - return f + mu sync.Mutex + storage []measurement + nt nextTracker } // Offer accepts the parameters associated with a measurement. The @@ -88,128 +63,39 @@ func (*FixedSizeReservoir) randomFloat64() float64 { // parameters are the value and dropped (filtered) attributes of the // measurement respectively. func (r *FixedSizeReservoir) Offer(ctx context.Context, t time.Time, n Value, a []attribute.KeyValue) { - if cap(r.measurements) == 0 { + if len(r.storage) == 0 { return } - // The following algorithm is "Algorithm L" from Li, Kim-Hung (4 December - // 1994). "Reservoir-Sampling Algorithms of Time Complexity - // O(n(1+log(N/n)))". ACM Transactions on Mathematical Software. 20 (4): - // 481–493 (https://dl.acm.org/doi/10.1145/198429.198435). - // - // A high-level overview of "Algorithm L": - // 0) Pre-calculate the random count greater than the storage size when - // an exemplar will be replaced. - // 1) Accept all measurements offered until the configured storage size is - // reached. - // 2) Loop: - // a) When the pre-calculate count is reached, replace a random - // existing exemplar with the offered measurement. - // b) Calculate the next random count greater than the existing one - // which will replace another exemplars - // - // The way a "replacement" count is computed is by looking at `n` number of - // independent random numbers each corresponding to an offered measurement. - // Of these numbers the smallest `k` (the same size as the storage - // capacity) of them are kept as a subset. The maximum value in this - // subset, called `w` is used to weight another random number generation - // for the next count that will be considered. - // - // By weighting the next count computation like described, it is able to - // perform a uniformly-weighted sampling algorithm based on the number of - // samples the reservoir has seen so far. The sampling will "slow down" as - // more and more samples are offered so as to reduce a bias towards those - // offered just prior to the end of the collection. - // - // This algorithm is preferred because of its balance of simplicity and - // performance. It will compute three random numbers (the bulk of - // computation time) for each item that becomes part of the reservoir, but - // it does not spend any time on items that do not. In particular it has an - // asymptotic runtime of O(k(1 + log(n/k)) where n is the number of - // measurements offered and k is the reservoir size. - // - // See https://en.wikipedia.org/wiki/Reservoir_sampling for an overview of - // this and other reservoir sampling algorithms. See - // https://github.com/MrAlias/reservoir-sampling for a performance - // comparison of reservoir sampling algorithms. - r.mu.Lock() defer r.mu.Unlock() - if int(r.count) < cap(r.measurements) { - r.store(ctx, int(r.count), t, n, a) - } else if r.count == r.next { - // Overwrite a random existing measurement with the one offered. - idx := int(rand.Int64N(int64(cap(r.measurements)))) - r.store(ctx, idx, t, n, a) - r.advance() + sampled, idx := r.nt.shouldSample() + if sampled { + r.storage[idx].store(ctx, t, n, a) } - r.count++ -} - -// reset resets r to the initial state. -func (r *FixedSizeReservoir) reset() { - // This resets the number of exemplars known. - r.count = 0 - // Random index inserts should only happen after the storage is full. - r.next = int64(cap(r.measurements)) - - // Initial random number in the series used to generate r.next. - // - // This is set before r.advance to reset or initialize the random number - // series. Without doing so it would always be 0 or never restart a new - // random number series. - // - // This maps the uniform random number in (0,1) to a geometric distribution - // over the same interval. The mean of the distribution is inversely - // proportional to the storage capacity. - r.w = math.Exp(math.Log(r.randomFloat64()) / float64(cap(r.measurements))) - - r.advance() -} - -// advance updates the count at which the offered measurement will overwrite an -// existing exemplar. -func (r *FixedSizeReservoir) advance() { - // Calculate the next value in the random number series. - // - // The current value of r.w is based on the max of a distribution of random - // numbers (i.e. `w = max(u_1,u_2,...,u_k)` for `k` equal to the capacity - // of the storage and each `u` in the interval (0,w)). To calculate the - // next r.w we use the fact that when the next exemplar is selected to be - // included in the storage an existing one will be dropped, and the - // corresponding random number in the set used to calculate r.w will also - // be replaced. The replacement random number will also be within (0,w), - // therefore the next r.w will be based on the same distribution (i.e. - // `max(u_1,u_2,...,u_k)`). Therefore, we can sample the next r.w by - // computing the next random number `u` and take r.w as `w * u^(1/k)`. - r.w *= math.Exp(math.Log(r.randomFloat64()) / float64(cap(r.measurements))) - // Use the new random number in the series to calculate the count of the - // next measurement that will be stored. - // - // Given 0 < r.w < 1, each iteration will result in subsequent r.w being - // smaller. This translates here into the next next being selected against - // a distribution with a higher mean (i.e. the expected value will increase - // and replacements become less likely) - // - // Important to note, the new r.next will always be at least 1 more than - // the last r.next. - r.next += int64(math.Log(r.randomFloat64())/math.Log(1-r.w)) + 1 } // Collect returns all the held exemplars. // -// The Reservoir state is preserved after this call. +// The stored exemplars are preserved after this call, but the sampling state is reset. func (r *FixedSizeReservoir) Collect(dest *[]Exemplar) { - if cap(r.measurements) == 0 { + if len(r.storage) == 0 { *dest = (*dest)[:0] return } r.mu.Lock() defer r.mu.Unlock() - r.storage.Collect(dest) + *dest = reset(*dest, len(r.storage), len(r.storage)) + var n int + for i := range r.storage { + if r.storage[i].exemplar(&(*dest)[n]) { + n++ + } + } + *dest = (*dest)[:n] // Call reset here even though it will reset r.count and restart the random // number series. This will persist any old exemplars as long as no new // measurements are offered, but it will also prioritize those new // measurements that are made over the older collection cycle ones. - r.reset() + r.nt.reset() } diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/histogram_reservoir.go b/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/histogram_reservoir.go index dacac3ebaec..e1001e4dc74 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/histogram_reservoir.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/histogram_reservoir.go @@ -1,12 +1,13 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package exemplar // import "go.opentelemetry.io/otel/sdk/metric/exemplar" +package exemplar import ( "context" "slices" "sort" + "sync" "time" "go.opentelemetry.io/otel/attribute" @@ -22,29 +23,39 @@ func HistogramReservoirProvider(bounds []float64) ReservoirProvider { } } -// NewHistogramReservoir returns a [HistogramReservoir] that samples the last -// measurement that falls within a histogram bucket. The histogram bucket -// upper-boundaries are define by bounds. +type bucket struct { + mu sync.Mutex + nt nextTracker + measurement +} + +// NewHistogramReservoir returns a [HistogramReservoir] that samples +// measurements that fall within a histogram bucket using Algorithm L. The +// histogram bucket upper-boundaries are defined by bounds. // // The passed bounds must be sorted before calling this function. func NewHistogramReservoir(bounds []float64) *HistogramReservoir { + buckets := make([]bucket, len(bounds)+1) + for i := range buckets { + buckets[i].nt.k = 1 + buckets[i].nt.reset() + } return &HistogramReservoir{ bounds: bounds, - storage: newStorage(len(bounds) + 1), + buckets: buckets, } } var _ Reservoir = &HistogramReservoir{} -// HistogramReservoir is a [Reservoir] that samples the last measurement that -// falls within a histogram bucket. The histogram bucket upper-boundaries are -// define by bounds. +// HistogramReservoir is a [Reservoir] that samples +// measurements that fall within a histogram bucket using Algorithm L. The +// histogram bucket upper-boundaries are defined by bounds. type HistogramReservoir struct { reservoir.ConcurrentSafe - *storage - // bounds are bucket bounds in ascending order. - bounds []float64 + bounds []float64 + buckets []bucket } // Offer accepts the parameters associated with a measurement. The @@ -69,14 +80,31 @@ func (r *HistogramReservoir) Offer(ctx context.Context, t time.Time, v Value, a panic("unknown value type") } - idx := sort.SearchFloat64s(r.bounds, n) + b := &r.buckets[sort.SearchFloat64s(r.bounds, n)] - r.store(ctx, idx, t, v, a) + b.mu.Lock() + defer b.mu.Unlock() + + sampled, _ := b.nt.shouldSample() + if sampled { + b.store(ctx, t, v, a) + } } // Collect returns all the held exemplars. // -// The Reservoir state is preserved after this call. +// The stored exemplars are preserved after this call, but the sampling state is reset. func (r *HistogramReservoir) Collect(dest *[]Exemplar) { - r.storage.Collect(dest) + *dest = reset(*dest, len(r.buckets), len(r.buckets)) + var n int + for i := range r.buckets { + b := &r.buckets[i] + b.mu.Lock() + if b.exemplar(&(*dest)[n]) { + n++ + } + b.nt.reset() + b.mu.Unlock() + } + *dest = (*dest)[:n] } diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/next_tracker.go b/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/next_tracker.go new file mode 100644 index 00000000000..da5eb241c81 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/next_tracker.go @@ -0,0 +1,154 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package exemplar + +import ( + "math" + "math/rand/v2" +) + +// nextTracker tracks the next measurement that should be sampled using Algorithm L. +type nextTracker struct { + // count is the number of measurements seen. + count int64 + // next is the next count that will store a measurement at a random index + // once the reservoir has been filled. + next int64 + // w is the largest random number in a distribution that is used to compute + // the next next. + w float64 + // k is the size of the reservoir. + k int +} + +// reset resets the tracker to the initial state for a reservoir of size k. +func (t *nextTracker) reset() { + t.count = 0 + if t.k <= 0 { + return + } + // Random index inserts should only happen after the storage is full. + // -1 accounts for the fact that advance() will unconditionally add 1 to + // t.next below. + t.next = int64(t.k) - 1 + + // Initial random number in the series used to generate t.next. + // + // This is set before t.advance to reset or initialize the random number + // series. Without doing so it would always be 0 or never restart a new + // random number series. + // + // This maps the uniform random number in (0,1) to a geometric distribution + // over the same interval. The mean of the distribution is inversely + // proportional to the storage capacity. + t.w = math.Exp(math.Log(randomFloat64()) / float64(t.k)) + t.advance() +} + +// advance updates the count at which the offered measurement will overwrite an +// existing exemplar. +func (t *nextTracker) advance() { + // Use the current random number in the series to calculate the count of the + // next measurement that will be stored. + // + // Given 0 < t.w < 1, each iteration will result in subsequent t.w being + // smaller. This translates here into the next next being selected against + // a distribution with a higher mean (i.e. the expected value will increase + // and replacements become less likely) + // + // Important to note, the new t.next will always be at least 1 more than + // the last t.next. + t.next += int64(math.Log(randomFloat64())/math.Log(1-t.w)) + 1 + + // Calculate the next value in the random number series. + // + // The current value of t.w is based on the max of a distribution of random + // numbers (i.e. `w = max(u_1,u_2,...,u_k)` for `k` equal to the capacity + // of the storage and each `u` in the interval (0,w)). To calculate the + // next t.w we use the fact that when the next exemplar is selected to be + // included in the storage an existing one will be dropped, and the + // corresponding random number in the set used to calculate t.w will also + // be replaced. The replacement random number will also be within (0,w), + // therefore the next t.w will be based on the same distribution (i.e. + // `max(u_1,u_2,...,u_k)`). Therefore, we can sample the next t.w by + // computing the next random number `u` and take t.w as `w * u^(1/k)`. + t.w *= math.Exp(math.Log(randomFloat64()) / float64(t.k)) +} + +// shouldSample returns true if the measurement should be sampled. +// It also returns the index at which the measurement should be stored. +// +// The following algorithm is "Algorithm L" from Li, Kim-Hung (4 December +// 1994). "Reservoir-Sampling Algorithms of Time Complexity +// O(n(1+log(N/n)))". ACM Transactions on Mathematical Software. 20 (4): +// 481–493 (https://dl.acm.org/doi/10.1145/198429.198435). +// +// A high-level overview of "Algorithm L": +// 0. Pre-calculate the random count greater than the storage size when +// an exemplar will be replaced. +// 1. Accept all measurements offered until the configured storage size is +// reached. +// 2. Loop: +// a) When the pre-calculate count is reached, replace a random +// existing exemplar with the offered measurement. +// b) Calculate the next random count greater than the existing one +// which will replace another exemplars +// +// The way a "replacement" count is computed is by looking at `n` number of +// independent random numbers each corresponding to an offered measurement. +// Of these numbers the smallest `k` (the same size as the storage +// capacity) of them are kept as a subset. The maximum value in this +// subset, called `w` is used to weight another random number generation +// for the next count that will be considered. +// +// By weighting the next count computation like described, it is able to +// perform a uniformly-weighted sampling algorithm based on the number of +// samples the reservoir has seen so far. The sampling will "slow down" as +// more and more samples are offered so as to reduce a bias towards those +// offered just prior to the end of the collection. +// +// This algorithm is preferred because of its balance of simplicity and +// performance. It will compute three random numbers (the bulk of +// computation time) for each item that becomes part of the reservoir, but +// it does not spend any time on items that do not. In particular it has an +// asymptotic runtime of O(k(1 + log(n/k))) where n is the number of +// measurements offered and k is the reservoir size. +// +// See https://en.wikipedia.org/wiki/Reservoir_sampling for an overview of +// this and other reservoir sampling algorithms. See +// https://github.com/MrAlias/reservoir-sampling for a performance +// comparison of reservoir sampling algorithms. +func (t *nextTracker) shouldSample() (bool, int) { + if t.k <= 0 { + return false, 0 + } + if t.count < int64(t.k) { + idx := int(t.count) + t.count++ + return true, idx + } + if t.count == t.next { + idx := 0 + if t.k > 1 { + idx = int(rand.Int64N(int64(t.k))) + } + t.advance() + t.count++ + return true, idx + } + t.count++ + return false, 0 +} + +// randomFloat64 returns a pseudo-random value uniformly selected from +// {k / 2^53 | 1 <= k < 2^53}. +func randomFloat64() float64 { + // rand.Float64 returns a value in [0, 1). Retry in the extremely + // unlikely event that it returns zero to produce a value in (0, 1). + f := rand.Float64() + for f == 0 { + f = rand.Float64() + } + return f +} diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/reservoir.go b/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/reservoir.go index ba5cd1a6b3d..a6cfdf44f99 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/reservoir.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/reservoir.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package exemplar // import "go.opentelemetry.io/otel/sdk/metric/exemplar" +package exemplar import ( "context" diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/storage.go b/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/storage.go index 790496027da..9a0be05a24a 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/storage.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/storage.go @@ -1,74 +1,41 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package exemplar // import "go.opentelemetry.io/otel/sdk/metric/exemplar" +package exemplar import ( "context" - "sync" "time" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" ) -// storage is an exemplar storage for [Reservoir] implementations. -type storage struct { - // measurements are the measurements sampled. - // - // This does not use []metricdata.Exemplar because it potentially would - // require an allocation for trace and span IDs in the hot path of Offer. - measurements []measurement -} - -func newStorage(n int) *storage { - return &storage{measurements: make([]measurement, n)} -} - -func (r *storage) store(ctx context.Context, idx int, ts time.Time, v Value, droppedAttr []attribute.KeyValue) { - r.measurements[idx].mux.Lock() - defer r.measurements[idx].mux.Unlock() - r.measurements[idx].FilteredAttributes = droppedAttr - r.measurements[idx].Time = ts - r.measurements[idx].Value = v - r.measurements[idx].Ctx = ctx - r.measurements[idx].valid = true -} - -// Collect returns all the held exemplars. -// -// The Reservoir state is preserved after this call. -func (r *storage) Collect(dest *[]Exemplar) { - *dest = reset(*dest, len(r.measurements), len(r.measurements)) - var n int - for i := range r.measurements { - if r.measurements[i].exemplar(&(*dest)[n]) { - n++ - } - } - *dest = (*dest)[:n] -} - // measurement is a measurement made by a telemetry system. type measurement struct { - mux sync.Mutex // FilteredAttributes are the attributes dropped during the measurement. FilteredAttributes []attribute.KeyValue // Time is the time when the measurement was made. Time time.Time // Value is the value of the measurement. Value Value - // Ctx is the context active when a measurement was made. - Ctx context.Context + // SpanContext is the SpanContext active when a measurement was made. + SpanContext trace.SpanContext valid bool } +func (m *measurement) store(ctx context.Context, ts time.Time, v Value, droppedAttr []attribute.KeyValue) { + m.FilteredAttributes = droppedAttr + m.Time = ts + m.Value = v + m.SpanContext = trace.SpanContextFromContext(ctx) + m.valid = true +} + // exemplar returns m as an [Exemplar]. // returns true if it populated the exemplar. func (m *measurement) exemplar(dest *Exemplar) bool { - m.mux.Lock() - defer m.mux.Unlock() if !m.valid { return false } @@ -77,7 +44,7 @@ func (m *measurement) exemplar(dest *Exemplar) bool { dest.Time = m.Time dest.Value = m.Value - sc := trace.SpanContextFromContext(m.Ctx) + sc := m.SpanContext if sc.HasTraceID() { traceID := sc.TraceID() dest.TraceID = traceID[:] diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/value.go b/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/value.go index 590b089a806..af045e27618 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/value.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/exemplar/value.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package exemplar // import "go.opentelemetry.io/otel/sdk/metric/exemplar" +package exemplar import "math" @@ -49,8 +49,8 @@ func (v Value) Int64() int64 { return 0 } -// Float64 returns the value of v as an float64. If the ValueType of v is not -// an Float64ValueType, 0 is returned. +// Float64 returns the value of v as a float64. If the ValueType of v is not +// a Float64ValueType, 0 is returned. func (v Value) Float64() float64 { if v.t == Float64ValueType { return math.Float64frombits(v.val) diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/exporter.go b/vendor/go.opentelemetry.io/otel/sdk/metric/exporter.go index 1969cb42cf4..7bec415296f 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/exporter.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/exporter.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package metric // import "go.opentelemetry.io/otel/sdk/metric" +package metric import ( "context" diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/instrument.go b/vendor/go.opentelemetry.io/otel/sdk/metric/instrument.go index dfb4964d9f8..f0865731402 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/instrument.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/instrument.go @@ -3,7 +3,7 @@ //go:generate stringer -type=InstrumentKind -trimprefix=InstrumentKind -package metric // import "go.opentelemetry.io/otel/sdk/metric" +package metric import ( "context" @@ -16,6 +16,7 @@ import ( "go.opentelemetry.io/otel/metric/embedded" "go.opentelemetry.io/otel/sdk/instrumentation" "go.opentelemetry.io/otel/sdk/metric/internal/aggregate" + "go.opentelemetry.io/otel/sdk/metric/internal/attrnorm" ) var zeroScope instrumentation.Scope @@ -141,6 +142,9 @@ type Stream struct { // the attribute will not be recorded, otherwise, if it returns true, it // will record the attribute. // + // If nil, the instrument's advisory attribute keys are used. If the + // instrument has no advisory attribute keys, all attributes are recorded. + // // Note that attributes filtered out by a View may still appear on Exemplars, // because Exemplars are recorded with the dropped measurement attributes // when View attribute filtering is applied. @@ -180,6 +184,46 @@ func (i instID) normalize() instID { return i } +type rawAttributesOption interface { + RawAttributes() []attribute.KeyValue + Experimental() +} + +func extractRawKVs[T any](opts []T) []attribute.KeyValue { + var rawKVs []attribute.KeyValue + var count int + for _, opt := range opts { + if r, ok := any(opt).(rawAttributesOption); ok { + count++ + if count == 1 { + rawKVs = r.RawAttributes() + } else { + if count == 2 { + // Create a new slice to avoid modifying the original slice from the first option. + rawKVs = append([]attribute.KeyValue(nil), rawKVs...) + } + rawKVs = append(rawKVs, r.RawAttributes()...) + } + } + } + return rawKVs +} + +func resolveAttributes(configAttrs attribute.Set, rawKVs []attribute.KeyValue) attribute.Set { + configAttrs, _ = attrnorm.SetDedup(configAttrs) + if len(rawKVs) == 0 { + return configAttrs + } + rawKVs, _ = attrnorm.KeyValuesDedup(rawKVs) + merged := make([]attribute.KeyValue, 0, configAttrs.Len()+len(rawKVs)) + merged = append(merged, configAttrs.ToSlice()...) + // rawKVs are appended after configAttrs, meaning they will override any duplicate keys in configAttrs. + // This behavior is documented in WithUnsafeAttributes. + merged = append(merged, rawKVs...) + // TODO(#7743): Defer computing the full attribute.NewSet. + return attribute.NewSet(merged...) +} + type int64Inst struct { measures []aggregate.Measure[int64] @@ -198,12 +242,14 @@ var ( func (i *int64Inst) Add(ctx context.Context, val int64, opts ...metric.AddOption) { c := metric.NewAddConfig(opts) - i.aggregate(ctx, val, c.Attributes()) + rawKVs := extractRawKVs(opts) + i.aggregate(ctx, val, resolveAttributes(c.Attributes(), rawKVs)) } func (i *int64Inst) Record(ctx context.Context, val int64, opts ...metric.RecordOption) { c := metric.NewRecordConfig(opts) - i.aggregate(ctx, val, c.Attributes()) + rawKVs := extractRawKVs(opts) + i.aggregate(ctx, val, resolveAttributes(c.Attributes(), rawKVs)) } func (i *int64Inst) Enabled(context.Context) bool { @@ -238,12 +284,14 @@ var ( func (i *float64Inst) Add(ctx context.Context, val float64, opts ...metric.AddOption) { c := metric.NewAddConfig(opts) - i.aggregate(ctx, val, c.Attributes()) + rawKVs := extractRawKVs(opts) + i.aggregate(ctx, val, resolveAttributes(c.Attributes(), rawKVs)) } func (i *float64Inst) Record(ctx context.Context, val float64, opts ...metric.RecordOption) { c := metric.NewRecordConfig(opts) - i.aggregate(ctx, val, c.Attributes()) + rawKVs := extractRawKVs(opts) + i.aggregate(ctx, val, resolveAttributes(c.Attributes(), rawKVs)) } func (i *float64Inst) Enabled(context.Context) bool { diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/aggregate.go b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/aggregate.go index a35f3bcc1bb..98916ae766e 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/aggregate.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/aggregate.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package aggregate // import "go.opentelemetry.io/otel/sdk/metric/internal/aggregate" +package aggregate import ( "context" @@ -57,18 +57,17 @@ func (b Builder[N]) resFunc() func(attribute.Set) FilteredExemplarReservoir[N] { return DropReservoir } -type fltrMeasure[N int64 | float64] func(ctx context.Context, value N, fltrAttr attribute.Set, droppedAttr []attribute.KeyValue) +type fltrMeasure[N int64 | float64] func(ctx context.Context, value N, lazy lazyFilteredAttributes) func (b Builder[N]) filter(f fltrMeasure[N]) Measure[N] { if b.Filter != nil { fltr := b.Filter // Copy to make it immutable after assignment. return func(ctx context.Context, n N, a attribute.Set) { - fAttr, dropped := a.Filter(fltr) - f(ctx, n, fAttr, dropped) + f(ctx, n, newLazyFilteredAttributes(a, fltr)) } } return func(ctx context.Context, n N, a attribute.Set) { - f(ctx, n, a, nil) + f(ctx, n, newLazyFilteredAttributes(a, nil)) } } diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/atomic.go b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/atomic.go index eb69e965079..1e342420e00 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/atomic.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/atomic.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package aggregate // import "go.opentelemetry.io/otel/sdk/metric/internal/aggregate" +package aggregate import ( "math" @@ -27,10 +27,18 @@ type atomicCounter[N int64 | float64] struct { // load returns the current value. The caller must ensure all calls to add have // returned prior to calling load. -func (n *atomicCounter[N]) load() N { - fval := math.Float64frombits(n.nFloatBits.Load()) - ival := n.nInt.Load() - return N(fval + float64(ival)) +func (n *atomicCounter[N]) load() (value N) { + switch any(value).(type) { + case int64: + value = N(n.nInt.Load()) + case float64: + fval := math.Float64frombits(n.nFloatBits.Load()) + ival := n.nInt.Load() + value = N(fval + float64(ival)) + default: + panic("unsupported type") + } + return value } func (n *atomicCounter[N]) add(value N) { @@ -183,61 +191,79 @@ type hotColdWaitGroup struct { endedCounts [2]atomic.Uint64 } +// hotIdx represents an index (0 or 1) to the currently active "hot" buffer +// where concurrent writes are accepted. +// +// coldIdx represents an index (0 or 1) to the "cold" buffer where collection +// reads and resets occur after a swap. +// +// These distinct types enforce at compile time that hot (write) and cold (read) +// indices are not accidentally interchanged across call boundaries. +type ( + hotIdx uint64 + coldIdx uint64 +) + // start returns the hot index that the writer should write to. The returned // hot index is 0 or 1. The caller must call done(hot index) after it finishes // its operation. start() is safe to call concurrently with other methods. -func (l *hotColdWaitGroup) start() uint64 { +func (l *hotColdWaitGroup) start() hotIdx { // We increment h.startedCountAndHotIdx so that the counter in the lower // 63 bits gets incremented. At the same time, we get the new value // back, which we can use to return the currently-hot index. - return l.startedCountAndHotIdx.Add(1) >> 63 + return hotIdx(l.startedCountAndHotIdx.Add(1) >> 63) } // done signals to the reader that an operation has fully completed. // done is safe to call concurrently. -func (l *hotColdWaitGroup) done(hotIdx uint64) { +func (l *hotColdWaitGroup) done(hotIdx hotIdx) { l.endedCounts[hotIdx].Add(1) } // swapHotAndWait swaps the hot bit, waits for all start() calls to be done(), // and then returns the now-cold index for the reader to read from. The // returned index is 0 or 1. swapHotAndWait must not be called concurrently. -func (l *hotColdWaitGroup) swapHotAndWait() uint64 { +func (l *hotColdWaitGroup) swapHotAndWait() coldIdx { n := l.startedCountAndHotIdx.Load() - coldIdx := (^n) >> 63 + coldIdxVal := (^n) >> 63 // Swap the hot and cold index while resetting the started measurements // count to zero. - n = l.startedCountAndHotIdx.Swap((coldIdx << 63)) - hotIdx := n >> 63 + n = l.startedCountAndHotIdx.Swap((coldIdxVal << 63)) + hotIdxVal := n >> 63 startedCount := n & ((1 << 63) - 1) // Wait for all measurements to the previously-hot map to finish. - for startedCount != l.endedCounts[hotIdx].Load() { + for startedCount != l.endedCounts[hotIdxVal].Load() { runtime.Gosched() // Let measurements complete. } // reset the number of ended operations - l.endedCounts[hotIdx].Store(0) - return hotIdx + l.endedCounts[hotIdxVal].Store(0) + return coldIdx(hotIdxVal) } // limitedSyncMap is a sync.Map which enforces the aggregation limit on // attribute sets and provides a Len() function. -type limitedSyncMap struct { +type limitedSyncMap[V any] struct { sync.Map aggLimit int len int lenMux sync.Mutex } -func (m *limitedSyncMap) LoadOrStoreAttr(fltrAttr attribute.Set, newValue func(attribute.Set) any) any { - actual, loaded := m.Load(fltrAttr.Equivalent()) +// LoadOrStoreAttr performs lookup using lazy.Distinct() on the hot path without +// constructing a Set. If the entry is not found and the aggregation limit has not +// been exceeded, lazy.Set() is called to construct the attribute.Set for storage. +// If the aggregation limit is exceeded, overflowSet is used instead without calling lazy.Set(). +func (m *limitedSyncMap[V]) LoadOrStoreAttr(lazy lazyFilteredAttributes, newValue func(attribute.Set) V) V { + distinct := lazy.Distinct() + actual, loaded := m.Load(distinct) if loaded { - return actual + return actual.(V) } // If the overflow set exists, assume we have already overflowed and don't // bother with the slow path below. actual, loaded = m.Load(overflowSet.Equivalent()) if loaded { - return actual + return actual.(V) } // Slow path: add a new attribute set. m.lenMux.Lock() @@ -246,30 +272,131 @@ func (m *limitedSyncMap) LoadOrStoreAttr(fltrAttr attribute.Set, newValue func(a // re-fetch now that we hold the lock to ensure we don't use the overflow // set unless we are sure the attribute set isn't being written // concurrently. - actual, loaded = m.Load(fltrAttr.Equivalent()) + actual, loaded = m.Load(distinct) if loaded { - return actual + return actual.(V) } + var fltrAttr attribute.Set if m.aggLimit > 0 && m.len >= m.aggLimit-1 { fltrAttr = overflowSet + distinct = overflowSet.Equivalent() + } else { + fltrAttr = lazy.Set() } - actual, loaded = m.LoadOrStore(fltrAttr.Equivalent(), newValue(fltrAttr)) + actual, loaded = m.LoadOrStore(distinct, newValue(fltrAttr)) if !loaded { m.len++ } - return actual + return actual.(V) } -func (m *limitedSyncMap) Clear() { +// LoadOrStoreAttrReclaiming is equivalent to LoadOrStoreAttr, except that a +// slot released after overflow was created can be reused for a new attribute +// set. The shared overflow entry remains available for measurements made while +// all normal slots are occupied. It reports whether the value was loaded and +// whether this lookup was routed to the shared overflow entry. +func (m *limitedSyncMap[V]) LoadOrStoreAttrReclaiming( + lazy lazyFilteredAttributes, + newValue func(attribute.Set, bool) V, +) (value V, loaded, overflowed bool) { + distinct := lazy.Distinct() + actual, loaded := m.Load(distinct) + if loaded { + return actual.(V), true, false + } + + m.lenMux.Lock() + defer m.lenMux.Unlock() + + actual, loaded = m.Load(distinct) + if loaded { + return actual.(V), true, false + } + + overflow, hasOverflow := m.Load(overflowSet.Equivalent()) + if m.aggLimit > 0 && hasOverflow && m.len >= m.aggLimit { + return overflow.(V), true, true + } + + var attrs attribute.Set + overflowed = m.aggLimit > 0 && !hasOverflow && m.len >= m.aggLimit-1 + if overflowed { + attrs = overflowSet + distinct = overflowSet.Equivalent() + } else { + attrs = lazy.Set() + } + actual, loaded = m.LoadOrStore(distinct, newValue(attrs, overflowed)) + if !loaded { + m.len++ + } + return actual.(V), loaded, overflowed +} + +func (m *limitedSyncMap[V]) Clear() { m.lenMux.Lock() defer m.lenMux.Unlock() m.len = 0 m.Map.Clear() } -func (m *limitedSyncMap) Len() int { +// CompareAndDelete deletes the entry for key if its value is equal to old. +// It reports whether the entry was deleted. +func (m *limitedSyncMap[V]) CompareAndDelete(key attribute.Distinct, old V) bool { + m.lenMux.Lock() + defer m.lenMux.Unlock() + if !m.Map.CompareAndDelete(key, old) { + return false + } + m.len-- + return true +} + +func (m *limitedSyncMap[V]) Len() int { m.lenMux.Lock() defer m.lenMux.Unlock() return m.len } + +// hotColdMap manages two [limitedSyncMap] instances so that measurement and +// collection operate on separate maps and do not lock each other out. +// +// Measurements write to the currently hot map returned by [hotColdMap.hot] +// using the index from [hotColdWaitGroup.start]. Collection is performed by +// calling [hotColdWaitGroup.swapHotAndWait] to atomically swap the hot and cold +// maps and wait for in-flight writes to the cold map to complete. The caller +// can then read the cold map via [hotColdMap.Range] and must call +// [hotColdMap.Clear] on the cold index so that unused attribute sets do not +// report in subsequent collection cycles and the cardinality limit budget is +// reset. +// +// swapHotAndWait must not be called concurrently. +type hotColdMap[V any] struct { + hotColdWaitGroup + hotColdValMap [2]limitedSyncMap[V] +} + +func (m *hotColdMap[V]) init(limit int) { + m.hotColdValMap[0].aggLimit = limit + m.hotColdValMap[1].aggLimit = limit +} + +func (m *hotColdMap[V]) hot(i hotIdx) *limitedSyncMap[V] { + return &m.hotColdValMap[i] +} + +// Len returns the length of the specified map. +func (m *hotColdMap[V]) Len(readIdx coldIdx) int { + return m.hotColdValMap[readIdx].Len() +} + +// Range calls f sequentially for each key and value present in the map at readIdx. +func (m *hotColdMap[V]) Range(readIdx coldIdx, f func(key, value any) bool) { + m.hotColdValMap[readIdx].Range(f) +} + +// Clear clears the map at readIdx. +func (m *hotColdMap[V]) Clear(readIdx coldIdx) { + m.hotColdValMap[readIdx].Clear() +} diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/doc.go b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/doc.go index 7b7225e6ef9..c0399c4087b 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/doc.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/doc.go @@ -4,4 +4,4 @@ // Package aggregate provides aggregate types used compute aggregations and // cycle the state of metric measurements made by the SDK. These types and // functionality are meant only for internal SDK use. -package aggregate // import "go.opentelemetry.io/otel/sdk/metric/internal/aggregate" +package aggregate diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/drop.go b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/drop.go index 7adfcaf8531..c78bdc6713d 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/drop.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/drop.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package aggregate // import "go.opentelemetry.io/otel/sdk/metric/internal/aggregate" +package aggregate import ( "context" @@ -18,7 +18,7 @@ func DropReservoir[N int64 | float64](attribute.Set) FilteredExemplarReservoir[N type dropRes[N int64 | float64] struct{} // Offer does nothing, all measurements offered will be dropped. -func (*dropRes[N]) Offer(context.Context, N, []attribute.KeyValue) {} +func (*dropRes[N]) Offer(context.Context, N, lazyFilteredAttributes) {} // Collect resets dest. No exemplars will ever be returned. func (*dropRes[N]) Collect(dest *[]exemplar.Exemplar) { diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/exemplar.go b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/exemplar.go index 25d709948e9..45b62041925 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/exemplar.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/exemplar.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package aggregate // import "go.opentelemetry.io/otel/sdk/metric/internal/aggregate" +package aggregate import ( "sync" diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/exponential_histogram.go b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/exponential_histogram.go index 767b1d6dc7d..f539be94228 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/exponential_histogram.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/exponential_histogram.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package aggregate // import "go.opentelemetry.io/otel/sdk/metric/internal/aggregate" +package aggregate import ( "context" @@ -331,8 +331,7 @@ type expoHistogram[N int64 | float64] struct { func (e *expoHistogram[N]) measure( ctx context.Context, value N, - fltrAttr attribute.Set, - droppedAttr []attribute.KeyValue, + lazy lazyFilteredAttributes, ) { // Ignore NaN and infinity. if math.IsInf(float64(value), 0) || math.IsNaN(float64(value)) { @@ -342,13 +341,17 @@ func (e *expoHistogram[N]) measure( e.valuesMu.Lock() defer e.valuesMu.Unlock() - v, ok := e.values[fltrAttr.Equivalent()] + distinct := lazy.Distinct() + v, ok := e.values[distinct] if !ok { - fltrAttr = e.limit.Attributes(fltrAttr, e.values) - // If we overflowed, make sure we add to the existing overflow series - // if it already exists. - v, ok = e.values[fltrAttr.Equivalent()] + v, ok = e.values[overflowSet.Equivalent()] if !ok { + var fltrAttr attribute.Set + if e.limit.aggLimit > 0 && len(e.values) >= e.limit.aggLimit-1 { + fltrAttr = overflowSet + } else { + fltrAttr = lazy.Set() + } v = newExpoHistogramDataPoint[N](fltrAttr, e.maxSize, e.maxScale, e.noMinMax, e.noSum) r := e.newRes(fltrAttr) _, isDrop := r.(*dropRes[N]) @@ -360,7 +363,7 @@ func (e *expoHistogram[N]) measure( } v.record(value) if !v.dropExemplars { - v.res.Offer(ctx, value, droppedAttr) + v.res.Offer(ctx, value, lazy) } } @@ -412,12 +415,15 @@ func (e *expoHistogram[N]) delta( if !e.noSum { hDPts[i].Sum = val.sum.load() + } else { + hDPts[i].Sum = 0 } - if !e.noMinMax { - if val.minMax.set.Load() { - hDPts[i].Min = metricdata.NewExtrema(val.minMax.minimum.Load()) - hDPts[i].Max = metricdata.NewExtrema(val.minMax.maximum.Load()) - } + if !e.noMinMax && val.minMax.set.Load() { + hDPts[i].Min = metricdata.NewExtrema(val.minMax.minimum.Load()) + hDPts[i].Max = metricdata.NewExtrema(val.minMax.maximum.Load()) + } else { + hDPts[i].Min = metricdata.Extrema[N]{} + hDPts[i].Max = metricdata.Extrema[N]{} } collectExemplars(&hDPts[i].Exemplars, val.res.Collect) @@ -488,12 +494,15 @@ func (e *expoHistogram[N]) cumulative( if !e.noSum { hDPts[i].Sum = val.sum.load() + } else { + hDPts[i].Sum = 0 } - if !e.noMinMax { - if val.minMax.set.Load() { - hDPts[i].Min = metricdata.NewExtrema(val.minMax.minimum.Load()) - hDPts[i].Max = metricdata.NewExtrema(val.minMax.maximum.Load()) - } + if !e.noMinMax && val.minMax.set.Load() { + hDPts[i].Min = metricdata.NewExtrema(val.minMax.minimum.Load()) + hDPts[i].Max = metricdata.NewExtrema(val.minMax.maximum.Load()) + } else { + hDPts[i].Min = metricdata.Extrema[N]{} + hDPts[i].Max = metricdata.Extrema[N]{} } collectExemplars(&hDPts[i].Exemplars, val.res.Collect) diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/filtered_reservoir.go b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/filtered_reservoir.go index e4f9409bc80..20e26c57d36 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/filtered_reservoir.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/filtered_reservoir.go @@ -1,14 +1,13 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package aggregate // import "go.opentelemetry.io/otel/sdk/metric/internal/aggregate" +package aggregate import ( "context" "sync" "time" - "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/sdk/metric/exemplar" "go.opentelemetry.io/otel/sdk/metric/internal/reservoir" ) @@ -22,7 +21,10 @@ type FilteredExemplarReservoir[N int64 | float64] interface { // The passed ctx needs to contain any baggage or span that were active // when the measurement was made. This information may be used by the // Reservoir in making a sampling decision. - Offer(ctx context.Context, val N, attr []attribute.KeyValue) + // + // The lazy parameter provides filtered attribute details when sampled, + // allowing dropped attributes to be computed only if the measurement is sampled. + Offer(ctx context.Context, val N, lazy lazyFilteredAttributes) // Collect returns all the held exemplars in the reservoir. Collect(dest *[]exemplar.Exemplar) } @@ -52,10 +54,11 @@ func NewFilteredExemplarReservoir[N int64 | float64]( } } -func (f *filteredExemplarReservoir[N]) Offer(ctx context.Context, val N, attr []attribute.KeyValue) { +func (f *filteredExemplarReservoir[N]) Offer(ctx context.Context, val N, lazy lazyFilteredAttributes) { if f.filter(ctx) { // only record the current time if we are sampling this measurement. ts := time.Now() + attr := lazy.Dropped() if !f.concurrentSafe { f.reservoirMux.Lock() defer f.reservoirMux.Unlock() diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/finish_sum.go b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/finish_sum.go new file mode 100644 index 00000000000..d167acdae1c --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/finish_sum.go @@ -0,0 +1,313 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package aggregate + +import ( + "context" + "sync" + "sync/atomic" + "time" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/sdk/metric/internal/finish" + "go.opentelemetry.io/otel/sdk/metric/metricdata" +) + +type finishSumValue[N int64 | float64] struct { + lifecycle finish.Lifecycle + value atomicCounter[N] + attrs attribute.Set + start time.Time + dropExemplars bool + reservoir FilteredExemplarReservoir[N] +} + +func newFinishSumValue[N int64 | float64]( + attrs attribute.Set, + reservoir func(attribute.Set) FilteredExemplarReservoir[N], +) *finishSumValue[N] { + r := reservoir(attrs) + _, drop := r.(*dropRes[N]) + point := &finishSumValue[N]{ + attrs: attrs, + start: now(), + dropExemplars: drop, + reservoir: r, + } + return point +} + +func (v *finishSumValue[N]) measure( + ctx context.Context, + value N, + lazy lazyFilteredAttributes, +) bool { + measurement, ok := v.lifecycle.AcquireMeasurement() + if !ok { + return false + } + v.measureAcquired(ctx, value, lazy, measurement) + return true +} + +func (v *finishSumValue[N]) measureOverflow( + ctx context.Context, + value N, + lazy lazyFilteredAttributes, +) bool { + measurement, ok := v.lifecycle.AcquireSharedMeasurement() + if !ok { + return false + } + v.measureAcquired(ctx, value, lazy, measurement) + return true +} + +func (v *finishSumValue[N]) measureAcquired( + ctx context.Context, + value N, + lazy lazyFilteredAttributes, + measurement finish.Measurement, +) { + v.value.add(value) + if v.dropExemplars { + measurement.Release() + return + } + defer measurement.Release() + v.reservoir.Offer(ctx, value, lazy) +} + +func (v *finishSumValue[N]) finish(t time.Time) { + v.lifecycle.Finish(t) +} + +func (v *finishSumValue[N]) collectCumulative( + t time.Time, +) (metricdata.DataPoint[N], bool, bool) { + collection, ok := v.lifecycle.BeginCumulativeCollection(t) + if !ok { + return metricdata.DataPoint[N]{}, false, false + } + dp, retire := v.collect(v.start, collection) + return dp, true, retire +} + +func (v *finishSumValue[N]) collectDelta( + start time.Time, + t time.Time, +) (metricdata.DataPoint[N], bool, bool) { + collection, ok := v.lifecycle.BeginDeltaCollection(t) + if !ok { + return metricdata.DataPoint[N]{}, false, false + } + dp, retire := v.collect(start, collection) + return dp, true, retire +} + +func (v *finishSumValue[N]) collect( + start time.Time, + collection finish.Collection, +) (metricdata.DataPoint[N], bool) { + defer collection.Complete() + + dp := metricdata.DataPoint[N]{ + Attributes: v.attrs, + StartTime: start, + Time: collection.Time(), + Value: v.value.load(), + } + collectExemplars(&dp.Exemplars, v.reservoir.Collect) + return dp, collection.ShouldRetire() +} + +func (v *finishSumValue[N]) shutdown() { + v.lifecycle.Retire() +} + +// FinishSum contains the operations of a finish-aware Sum aggregation. +type FinishSum[N int64 | float64] struct { + Measure Measure[N] + ComputeAggregation ComputeAggregation + Finish func(attribute.Distinct, time.Time) + Shutdown func() +} + +type finishSum[N int64 | float64] struct { + collectMu sync.Mutex + shutdownOnce sync.Once + stopped atomic.Bool + + values limitedSyncMap[*finishSumValue[N]] + start time.Time + temporality metricdata.Temporality + monotonic bool + reservoir func(attribute.Set) FilteredExemplarReservoir[N] +} + +func newFinishSum[N int64 | float64]( + monotonic bool, + temporality metricdata.Temporality, + limit int, + reservoir func(attribute.Set) FilteredExemplarReservoir[N], +) *finishSum[N] { + var start time.Time + if temporality != metricdata.DeltaTemporality { + temporality = metricdata.CumulativeTemporality + } else { + start = now() + } + return &finishSum[N]{ + values: limitedSyncMap[*finishSumValue[N]]{ + aggLimit: limit, + }, + start: start, + temporality: temporality, + monotonic: monotonic, + reservoir: reservoir, + } +} + +func (s *finishSum[N]) measure( + ctx context.Context, + value N, + lazy lazyFilteredAttributes, +) { + for { + if s.stopped.Load() { + return + } + var initial finish.Measurement + point, loaded, overflowed := s.values.LoadOrStoreAttrReclaiming(lazy, func( + attrs attribute.Set, + overflow bool, + ) *finishSumValue[N] { + point := newFinishSumValue(attrs, s.reservoir) + // The point has not been published, so its new lifecycle cannot be + // retired and this initial measurement admission cannot fail. + if overflow { + initial, _ = point.lifecycle.AcquireSharedMeasurement() + } else { + initial, _ = point.lifecycle.AcquireMeasurement() + } + return point + }) + if !loaded { + point.measureAcquired(ctx, value, lazy, initial) + if s.stopped.Load() { + s.retireAndDelete(point) + } + return + } + if overflowed { + if point.measureOverflow(ctx, value, lazy) { + if s.stopped.Load() { + s.retireAndDelete(point) + } + return + } + continue + } + if point.measure(ctx, value, lazy) { + if s.stopped.Load() { + s.retireAndDelete(point) + } + return + } + s.values.CompareAndDelete(lazy.Distinct(), point) + } +} + +func (s *finishSum[N]) retireAndDelete(point *finishSumValue[N]) { + point.shutdown() + s.values.CompareAndDelete(point.attrs.Equivalent(), point) +} + +func (s *finishSum[N]) finish( + distinct attribute.Distinct, + t time.Time, +) { + if s.stopped.Load() { + return + } + value, ok := s.values.Load(distinct) + if !ok { + return + } + point := value.(*finishSumValue[N]) + point.finish(t) +} + +func (s *finishSum[N]) collect( + dest *metricdata.Aggregation, //nolint:gocritic // Required by ComputeAggregation. +) int { + s.collectMu.Lock() + defer s.collectMu.Unlock() + if s.stopped.Load() { + return 0 + } + + t := now() + start := s.start + if s.temporality == metricdata.DeltaTemporality { + s.start = t + } + sData, _ := (*dest).(metricdata.Sum[N]) + sData.Temporality = s.temporality + sData.IsMonotonic = s.monotonic + points := reset(sData.DataPoints, 0, s.values.Len()) + + s.values.Range(func(key, raw any) bool { + point := raw.(*finishSumValue[N]) + var dp metricdata.DataPoint[N] + var emit, retire bool + if s.temporality == metricdata.DeltaTemporality { + dp, emit, retire = point.collectDelta(start, t) + } else { + dp, emit, retire = point.collectCumulative(t) + } + if !emit { + return true + } + points = append(points, dp) + + if retire { + s.values.CompareAndDelete(key.(attribute.Distinct), point) + } + return true + }) + + sData.DataPoints = points + *dest = sData + return len(points) +} + +func (s *finishSum[N]) shutdown() { + s.shutdownOnce.Do(func() { + s.stopped.Store(true) + s.collectMu.Lock() + defer s.collectMu.Unlock() + s.values.Range(func(_, raw any) bool { + raw.(*finishSumValue[N]).shutdown() + return true + }) + s.values.Clear() + }) +} + +// FinishSum returns a Sum aggregation with exact-attribute lifecycle support. +func (b Builder[N]) FinishSum(monotonic bool) FinishSum[N] { + store := newFinishSum( + monotonic, + b.Temporality, + b.AggregationLimit, + b.resFunc(), + ) + return FinishSum[N]{ + Measure: b.filter(store.measure), + ComputeAggregation: store.collect, + Finish: store.finish, + Shutdown: store.shutdown, + } +} diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/histogram.go b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/histogram.go index 50c82ff32f9..152ae46ea1d 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/histogram.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/histogram.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package aggregate // import "go.opentelemetry.io/otel/sdk/metric/internal/aggregate" +package aggregate import ( "context" @@ -44,8 +44,6 @@ type histogramPointCounters[N int64 | float64] struct { } func (b *histogramPointCounters[N]) loadCountsInto(into *[]uint64) uint64 { - // TODO (#3047): Making copies for counts incurs a large - // memory allocation footprint. Alternatives should be explored. counts := reset(*into, len(b.counts), len(b.counts)) count := uint64(0) for i := range b.counts { @@ -87,18 +85,8 @@ func (b *histogramPointCounters[N]) mergeIntoAndReset( // nolint:revive // Inten // deltaHistogram is a histogram whose internal storage is reset when it is // collected. -// -// deltaHistogram's measure is implemented without locking, even when called -// concurrently with collect. This is done by maintaining two separate maps: -// one "hot" which is concurrently updated by measure(), and one "cold", which -// is read and reset by collect(). The [hotcoldWaitGroup] allows collect() to -// swap the hot and cold maps, and wait for updates to the cold map to complete -// prior to reading. deltaHistogram swaps ald clears complete maps so that -// unused attribute sets do not report in subsequent collect() calls. type deltaHistogram[N int64 | float64] struct { - hcwg hotColdWaitGroup - hotColdValMap [2]limitedSyncMap - + vals hotColdMap[*histogramPoint[N]] start time.Time noMinMax bool noSum bool @@ -109,15 +97,15 @@ type deltaHistogram[N int64 | float64] struct { func (s *deltaHistogram[N]) measure( ctx context.Context, value N, - fltrAttr attribute.Set, - droppedAttr []attribute.KeyValue, + lazy lazyFilteredAttributes, ) { - hotIdx := s.hcwg.start() - defer s.hcwg.done(hotIdx) - h := s.hotColdValMap[hotIdx].LoadOrStoreAttr(fltrAttr, func(attr attribute.Set) any { + hotIdx := s.vals.start() + defer s.vals.done(hotIdx) + + h := s.vals.hot(hotIdx).LoadOrStoreAttr(lazy, func(attr attribute.Set) *histogramPoint[N] { r := s.newRes(attr) _, isDrop := r.(*dropRes[N]) - hPt := &histogramPoint[N]{ + return &histogramPoint[N]{ res: r, attrs: attr, dropExemplars: isDrop, @@ -130,8 +118,7 @@ func (s *deltaHistogram[N]) measure( // counts = (-∞, 0], (0, 5.0], (5.0, 10.0], (10.0, +∞) histogramPointCounters: histogramPointCounters[N]{counts: make([]atomic.Uint64, len(s.bounds)+1)}, } - return hPt - }).(*histogramPoint[N]) + }) // This search will return an index in the range [0, len(s.bounds)], where // it will return len(s.bounds) if value is greater than the last element @@ -147,7 +134,7 @@ func (s *deltaHistogram[N]) measure( h.total.add(value) } if !h.dropExemplars { - h.res.Offer(ctx, value, droppedAttr) + h.res.Offer(ctx, value, lazy) } } @@ -165,17 +152,15 @@ func newDeltaHistogram[N int64 | float64]( // complete control over the fix. b := slices.Clone(boundaries) slices.Sort(b) - return &deltaHistogram[N]{ + h := &deltaHistogram[N]{ start: now(), noMinMax: noMinMax, noSum: noSum, bounds: b, newRes: r, - hotColdValMap: [2]limitedSyncMap{ - {aggLimit: limit}, - {aggLimit: limit}, - }, } + h.vals.init(limit) + return h } func (s *deltaHistogram[N]) collect( @@ -189,20 +174,19 @@ func (s *deltaHistogram[N]) collect( h.Temporality = metricdata.DeltaTemporality // delta always clears values on collection - readIdx := s.hcwg.swapHotAndWait() + readIdx := s.vals.swapHotAndWait() // Do not allow modification of our copy of bounds. bounds := slices.Clone(s.bounds) // The len will not change while we iterate over values, since we waited // for all writes to finish to the cold values and len. - n := s.hotColdValMap[readIdx].Len() + n := s.vals.Len(readIdx) hDPts := reset(h.DataPoints, n, n) var i int - s.hotColdValMap[readIdx].Range(func(_, value any) bool { + s.vals.Range(readIdx, func(_, value any) bool { val := value.(*histogramPoint[N]) - count := val.loadCountsInto(&hDPts[i].BucketCounts) hDPts[i].Attributes = val.attrs hDPts[i].StartTime = s.start @@ -212,22 +196,25 @@ func (s *deltaHistogram[N]) collect( if !s.noSum { hDPts[i].Sum = val.total.load() + } else { + hDPts[i].Sum = 0 } - if !s.noMinMax { - if val.minMax.set.Load() { - hDPts[i].Min = metricdata.NewExtrema(val.minMax.minimum.Load()) - hDPts[i].Max = metricdata.NewExtrema(val.minMax.maximum.Load()) - } + if !s.noMinMax && val.minMax.set.Load() { + hDPts[i].Min = metricdata.NewExtrema(val.minMax.minimum.Load()) + hDPts[i].Max = metricdata.NewExtrema(val.minMax.maximum.Load()) + } else { + hDPts[i].Min = metricdata.Extrema[N]{} + hDPts[i].Max = metricdata.Extrema[N]{} } collectExemplars(&hDPts[i].Exemplars, val.res.Collect) - i++ return true }) // Unused attribute sets do not report. - s.hotColdValMap[readIdx].Clear() + s.vals.Clear(readIdx) + // The delta collection cycle resets. s.start = t @@ -249,7 +236,7 @@ func (s *deltaHistogram[N]) collect( // to reading. Unlike deltaHistogram, this maintains a single map so that the // preserved attribute sets do not change when collect() is called. type cumulativeHistogram[N int64 | float64] struct { - values limitedSyncMap + values limitedSyncMap[*hotColdHistogramPoint[N]] start time.Time noMinMax bool @@ -278,17 +265,16 @@ func newCumulativeHistogram[N int64 | float64]( noSum: noSum, bounds: b, newRes: r, - values: limitedSyncMap{aggLimit: limit}, + values: limitedSyncMap[*hotColdHistogramPoint[N]]{aggLimit: limit}, } } func (s *cumulativeHistogram[N]) measure( ctx context.Context, value N, - fltrAttr attribute.Set, - droppedAttr []attribute.KeyValue, + lazy lazyFilteredAttributes, ) { - h := s.values.LoadOrStoreAttr(fltrAttr, func(attr attribute.Set) any { + h := s.values.LoadOrStoreAttr(lazy, func(attr attribute.Set) *hotColdHistogramPoint[N] { r := s.newRes(attr) _, isDrop := r.(*dropRes[N]) hPt := &hotColdHistogramPoint[N]{ @@ -313,7 +299,7 @@ func (s *cumulativeHistogram[N]) measure( }, } return hPt - }).(*hotColdHistogramPoint[N]) + }) // This search will return an index in the range [0, len(s.bounds)], where // it will return len(s.bounds) if value is greater than the last element @@ -333,7 +319,7 @@ func (s *cumulativeHistogram[N]) measure( h.hotColdPoint[hotIdx].total.add(value) } if !h.dropExemplars { - h.res.Offer(ctx, value, droppedAttr) + h.res.Offer(ctx, value, lazy) } } @@ -350,9 +336,16 @@ func (s *cumulativeHistogram[N]) collect( // Do not allow modification of our copy of bounds. bounds := slices.Clone(s.bounds) - // Values are being concurrently written while we iterate, so only use the - // current length for capacity. - hDPts := reset(h.DataPoints, 0, s.values.Len()) + // Pre-size hDPts so per-series destination slots are addressable by index. + // This lets loadCountsInto and collectExemplars reuse each slot's existing + // BucketCounts/Exemplars slices from the previous cycle. s.values is + // append-only here during cumulative collect, and limitedSyncMap only + // increments its len after a successful underlying LoadOrStore, so Range + // will visit at least n entries. Concurrent measurers may add more between + // Len() and Range; those extra slots are appended on demand inside the + // loop. + n := s.values.Len() + hDPts := reset(h.DataPoints, n, n) perSeriesStartTimeEnabled := x.PerSeriesStartTimestamps.Enabled() @@ -366,35 +359,41 @@ func (s *cumulativeHistogram[N]) collect( } // swap, observe, and clear the point readIdx := val.hcwg.swapHotAndWait() - var bucketCounts []uint64 - count := val.hotColdPoint[readIdx].loadCountsInto(&bucketCounts) - newPt := metricdata.HistogramDataPoint[N]{ - Attributes: val.attrs, - StartTime: startTime, - Time: t, - Count: count, - Bounds: bounds, - // The HistogramDataPoint field values returned need to be copies of - // the histogramPoint value as we will keep updating them. - BucketCounts: bucketCounts, - } + // Concurrent writers can grow s.values between Len() and Range. + // Cold-path grow. + if i >= len(hDPts) { + hDPts = append(hDPts, metricdata.HistogramDataPoint[N]{}) + } + dp := &hDPts[i] + + count := val.hotColdPoint[readIdx].loadCountsInto(&dp.BucketCounts) + dp.Attributes = val.attrs + dp.StartTime = startTime + dp.Time = t + dp.Count = count + dp.Bounds = bounds if !s.noSum { - newPt.Sum = val.hotColdPoint[readIdx].total.load() + dp.Sum = val.hotColdPoint[readIdx].total.load() + } else { + // Slot may be reused; clear stale Sum from previous series. + var zero N + dp.Sum = zero } - if !s.noMinMax { - if val.hotColdPoint[readIdx].minMax.set.Load() { - newPt.Min = metricdata.NewExtrema(val.hotColdPoint[readIdx].minMax.minimum.Load()) - newPt.Max = metricdata.NewExtrema(val.hotColdPoint[readIdx].minMax.maximum.Load()) - } + if !s.noMinMax && val.hotColdPoint[readIdx].minMax.set.Load() { + dp.Min = metricdata.NewExtrema(val.hotColdPoint[readIdx].minMax.minimum.Load()) + dp.Max = metricdata.NewExtrema(val.hotColdPoint[readIdx].minMax.maximum.Load()) + } else { + // Slot may be reused; clear stale Min/Max from previous series. + dp.Min = metricdata.Extrema[N]{} + dp.Max = metricdata.Extrema[N]{} } // Once we've read the point, merge it back into the hot histogram // point since it is cumulative. - hotIdx := (readIdx + 1) % 2 + hotIdx := hotIdx((readIdx + 1) % 2) val.hotColdPoint[readIdx].mergeIntoAndReset(&val.hotColdPoint[hotIdx], s.noMinMax, s.noSum) - collectExemplars(&newPt.Exemplars, val.res.Collect) - hDPts = append(hDPts, newPt) + collectExemplars(&dp.Exemplars, val.res.Collect) i++ // TODO (#3006): This will use an unbounded amount of memory if there diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/lastvalue.go b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/lastvalue.go index 2af252ec5df..8c901434520 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/lastvalue.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/lastvalue.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package aggregate // import "go.opentelemetry.io/otel/sdk/metric/internal/aggregate" +package aggregate import ( "context" @@ -21,55 +21,16 @@ type lastValuePoint[N int64 | float64] struct { dropExemplars bool } -// lastValueMap summarizes a set of measurements as the last one made. -type lastValueMap[N int64 | float64] struct { - newRes func(attribute.Set) FilteredExemplarReservoir[N] - values limitedSyncMap -} - -func (s *lastValueMap[N]) measure( - ctx context.Context, - value N, - fltrAttr attribute.Set, - droppedAttr []attribute.KeyValue, -) { - lv := s.values.LoadOrStoreAttr(fltrAttr, func(attr attribute.Set) any { - r := s.newRes(attr) - _, isDrop := r.(*dropRes[N]) - p := &lastValuePoint[N]{ - res: r, - attrs: attr, - startTime: now(), - dropExemplars: isDrop, - } - p.value.Store(value) - return p - }).(*lastValuePoint[N]) - - lv.value.Store(value) - if !lv.dropExemplars { - lv.res.Offer(ctx, value, droppedAttr) - } -} - func newDeltaLastValue[N int64 | float64]( limit int, r func(attribute.Set) FilteredExemplarReservoir[N], ) *deltaLastValue[N] { - return &deltaLastValue[N]{ + s := &deltaLastValue[N]{ newRes: r, start: now(), - hotColdValMap: [2]lastValueMap[N]{ - { - values: limitedSyncMap{aggLimit: limit}, - newRes: r, - }, - { - values: limitedSyncMap{aggLimit: limit}, - newRes: r, - }, - }, } + s.vals.init(limit) + return s } // deltaLastValue summarizes a set of measurements as the last one made. @@ -77,19 +38,34 @@ type deltaLastValue[N int64 | float64] struct { newRes func(attribute.Set) FilteredExemplarReservoir[N] start time.Time - hcwg hotColdWaitGroup - hotColdValMap [2]lastValueMap[N] + vals hotColdMap[*lastValuePoint[N]] } func (s *deltaLastValue[N]) measure( ctx context.Context, value N, - fltrAttr attribute.Set, - droppedAttr []attribute.KeyValue, + lazy lazyFilteredAttributes, ) { - hotIdx := s.hcwg.start() - defer s.hcwg.done(hotIdx) - s.hotColdValMap[hotIdx].measure(ctx, value, fltrAttr, droppedAttr) + hotIdx := s.vals.start() + defer s.vals.done(hotIdx) + + lv := s.vals.hot(hotIdx).LoadOrStoreAttr(lazy, func(attr attribute.Set) *lastValuePoint[N] { + r := s.newRes(attr) + _, isDrop := r.(*dropRes[N]) + p := &lastValuePoint[N]{ + res: r, + attrs: attr, + startTime: now(), + dropExemplars: isDrop, + } + p.value.Store(value) + return p + }) + + lv.value.Store(value) + if !lv.dropExemplars { + lv.res.Offer(ctx, value, lazy) + } } func (s *deltaLastValue[N]) collect( @@ -112,14 +88,14 @@ func (s *deltaLastValue[N]) copyAndClearDpts( // the DataPoints is missed (better luck next time). gData, _ := (*dest).(metricdata.Gauge[N]) // delta always clears values on collection - readIdx := s.hcwg.swapHotAndWait() + readIdx := s.vals.swapHotAndWait() // The len will not change while we iterate over values, since we waited // for all writes to finish to the cold values and len. - n := s.hotColdValMap[readIdx].values.Len() + n := s.vals.Len(readIdx) dPts := reset(gData.DataPoints, n, n) var i int - s.hotColdValMap[readIdx].values.Range(func(_, value any) bool { + s.vals.Range(readIdx, func(_, value any) bool { v := value.(*lastValuePoint[N]) dPts[i].Attributes = v.attrs dPts[i].StartTime = s.start @@ -129,17 +105,19 @@ func (s *deltaLastValue[N]) copyAndClearDpts( i++ return true }) - gData.DataPoints = dPts // Do not report stale values. - s.hotColdValMap[readIdx].values.Clear() + s.vals.Clear(readIdx) + + gData.DataPoints = dPts *dest = gData return i } // cumulativeLastValue summarizes a set of measurements as the last one made. type cumulativeLastValue[N int64 | float64] struct { - lastValueMap[N] - start time.Time + values limitedSyncMap[*lastValuePoint[N]] + newRes func(attribute.Set) FilteredExemplarReservoir[N] + start time.Time } func newCumulativeLastValue[N int64 | float64]( @@ -147,11 +125,33 @@ func newCumulativeLastValue[N int64 | float64]( r func(attribute.Set) FilteredExemplarReservoir[N], ) *cumulativeLastValue[N] { return &cumulativeLastValue[N]{ - lastValueMap: lastValueMap[N]{ - values: limitedSyncMap{aggLimit: limit}, - newRes: r, - }, - start: now(), + values: limitedSyncMap[*lastValuePoint[N]]{aggLimit: limit}, + newRes: r, + start: now(), + } +} + +func (s *cumulativeLastValue[N]) measure( + ctx context.Context, + value N, + lazy lazyFilteredAttributes, +) { + lv := s.values.LoadOrStoreAttr(lazy, func(attr attribute.Set) *lastValuePoint[N] { + r := s.newRes(attr) + _, isDrop := r.(*dropRes[N]) + p := &lastValuePoint[N]{ + res: r, + attrs: attr, + startTime: now(), + dropExemplars: isDrop, + } + p.value.Store(value) + return p + }) + + lv.value.Store(value) + if !lv.dropExemplars { + lv.res.Offer(ctx, value, lazy) } } diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/lazy_attributes.go b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/lazy_attributes.go new file mode 100644 index 00000000000..2fe88624703 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/lazy_attributes.go @@ -0,0 +1,146 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package aggregate + +import ( + "math/bits" + + "go.opentelemetry.io/otel/attribute" +) + +type lazyFilteredAttributes struct { + orig attribute.Set + distinct attribute.Distinct + mask uint64 // bitmask of kept attributes (bit i == 1 if kept) for len <= 64 + bigMask []bool // fallback decision slice for len > 64 + hasDropped bool +} + +// newLazyFilteredAttributes filters orig using filter and computes the distinct +// hash of the resulting attributes. The filter function is evaluated once per +// attribute during initialization, and kept attribute indices are recorded in a +// bitmask so subsequent Set and Dropped calls do not re-evaluate filter. +func newLazyFilteredAttributes(orig attribute.Set, filter attribute.Filter) lazyFilteredAttributes { + if filter == nil { + return lazyFilteredAttributes{ + orig: orig, + distinct: orig.Equivalent(), + } + } + l := lazyFilteredAttributes{orig: orig, hasDropped: true} + + n := orig.Len() + hasher := attribute.NewHasher() + keptCount := 0 + for i := range n { + kv, _ := orig.Get(i) + if filter(kv) { + hasher.Write(kv) + l.recordKept(i, keptCount, n) + keptCount++ + } + } + if keptCount == n { + l.hasDropped = false + l.mask = 0 + l.bigMask = nil + l.distinct = orig.Equivalent() + return l + } + keptBefore64 := bits.OnesCount64(l.mask) + if keptCount-keptBefore64 > 0 { + l.ensureBigMask(n, keptCount) + } + l.distinct = hasher.Distinct() + return l +} + +// recordKept marks index i as kept in the bitmask or fallback slice. +func (l *lazyFilteredAttributes) recordKept(i, keptCount, total int) { + if i < 64 { + l.mask |= uint64(1) << i + return + } + if l.bigMask == nil && keptCount < i { + l.ensureBigMask(total, keptCount) + } + if l.bigMask != nil { + l.bigMask[i] = true + } +} + +// ensureBigMask initializes the bigMask slice and backfills any attributes past +// index 63 that were kept before attributes were dropped. +func (l *lazyFilteredAttributes) ensureBigMask(total, keptCount int) { + if l.bigMask != nil { + return + } + l.bigMask = make([]bool, total) + keptBefore64 := bits.OnesCount64(l.mask) + for j := 64; j < 64+(keptCount-keptBefore64); j++ { + l.bigMask[j] = true + } +} + +// isKept reports whether the attribute at index i was kept by the filter. +func (l lazyFilteredAttributes) isKept(i int) bool { + if i < 64 { + return (l.mask & (uint64(1) << i)) != 0 + } + return i < len(l.bigMask) && l.bigMask[i] +} + +// Distinct returns the precomputed Distinct hash of the filtered attributes. +func (l lazyFilteredAttributes) Distinct() attribute.Distinct { + return l.distinct +} + +// HasDroppedAttributes reports whether the filter dropped any attributes. +func (l lazyFilteredAttributes) HasDroppedAttributes() bool { + return l.hasDropped +} + +// Set constructs the filtered attribute Set using the recorded bitmask. +func (l lazyFilteredAttributes) Set() attribute.Set { + if !l.hasDropped { + return l.orig + } + if l.mask == 0 && l.bigMask == nil { + return attribute.NewSet() + } + n := l.orig.Len() + var kept []attribute.KeyValue + for i := range n { + if l.isKept(i) { + if kept == nil { + kept = make([]attribute.KeyValue, 0, n) + } + kv, _ := l.orig.Get(i) + kept = append(kept, kv) + } + } + return attribute.NewSet(kept...) +} + +// Dropped constructs the dropped attribute slice using the recorded bitmask. +func (l lazyFilteredAttributes) Dropped() []attribute.KeyValue { + if !l.hasDropped { + return nil + } + if l.mask == 0 && l.bigMask == nil { + return l.orig.ToSlice() + } + n := l.orig.Len() + var dropped []attribute.KeyValue + for i := range n { + if !l.isKept(i) { + if dropped == nil { + dropped = make([]attribute.KeyValue, 0, n) + } + kv, _ := l.orig.Get(i) + dropped = append(dropped, kv) + } + } + return dropped +} diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/limit.go b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/limit.go index c19a1aff68f..426a8b275ed 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/limit.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/limit.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package aggregate // import "go.opentelemetry.io/otel/sdk/metric/internal/aggregate" +package aggregate import "go.opentelemetry.io/otel/attribute" diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/sum.go b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/sum.go index 0cd3c94575b..ed3530cff6d 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/sum.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/sum.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package aggregate // import "go.opentelemetry.io/otel/sdk/metric/internal/aggregate" +package aggregate import ( "context" @@ -20,36 +20,6 @@ type sumValue[N int64 | float64] struct { dropExemplars bool } -type sumValueMap[N int64 | float64] struct { - values limitedSyncMap - newRes func(attribute.Set) FilteredExemplarReservoir[N] -} - -func (s *sumValueMap[N]) measure( - ctx context.Context, - value N, - fltrAttr attribute.Set, - droppedAttr []attribute.KeyValue, -) { - sv := s.values.LoadOrStoreAttr(fltrAttr, func(attr attribute.Set) any { - r := s.newRes(attr) - _, isDrop := r.(*dropRes[N]) - return &sumValue[N]{ - res: r, - attrs: attr, - startTime: now(), - dropExemplars: isDrop, - } - }).(*sumValue[N]) - sv.n.add(value) - // It is possible for collection to race with measurement and observe the - // exemplar in the batch of metrics after the add() for cumulative sums. - // This is an accepted tradeoff to avoid locking during measurement. - if !sv.dropExemplars { - sv.res.Offer(ctx, value, droppedAttr) - } -} - // newDeltaSum returns an aggregator that summarizes a set of measurements as // their arithmetic sum. Each sum is scoped by attributes and the aggregation // cycle the measurements were made in. @@ -58,20 +28,13 @@ func newDeltaSum[N int64 | float64]( limit int, r func(attribute.Set) FilteredExemplarReservoir[N], ) *deltaSum[N] { - return &deltaSum[N]{ + s := &deltaSum[N]{ monotonic: monotonic, start: now(), - hotColdValMap: [2]sumValueMap[N]{ - { - values: limitedSyncMap{aggLimit: limit}, - newRes: r, - }, - { - values: limitedSyncMap{aggLimit: limit}, - newRes: r, - }, - }, + newRes: r, } + s.vals.init(limit) + return s } // deltaSum is the storage for sums which resets every collection interval. @@ -79,14 +42,28 @@ type deltaSum[N int64 | float64] struct { monotonic bool start time.Time - hcwg hotColdWaitGroup - hotColdValMap [2]sumValueMap[N] + vals hotColdMap[*sumValue[N]] + newRes func(attribute.Set) FilteredExemplarReservoir[N] } -func (s *deltaSum[N]) measure(ctx context.Context, value N, fltrAttr attribute.Set, droppedAttr []attribute.KeyValue) { - hotIdx := s.hcwg.start() - defer s.hcwg.done(hotIdx) - s.hotColdValMap[hotIdx].measure(ctx, value, fltrAttr, droppedAttr) +func (s *deltaSum[N]) measure(ctx context.Context, value N, lazy lazyFilteredAttributes) { + hotIdx := s.vals.start() + defer s.vals.done(hotIdx) + + sv := s.vals.hot(hotIdx).LoadOrStoreAttr(lazy, func(attr attribute.Set) *sumValue[N] { + r := s.newRes(attr) + _, isDrop := r.(*dropRes[N]) + return &sumValue[N]{ + res: r, + attrs: attr, + startTime: now(), + dropExemplars: isDrop, + } + }) + sv.n.add(value) + if !sv.dropExemplars { + sv.res.Offer(ctx, value, lazy) + } } func (s *deltaSum[N]) collect( @@ -101,14 +78,14 @@ func (s *deltaSum[N]) collect( sData.IsMonotonic = s.monotonic // delta always clears values on collection - readIdx := s.hcwg.swapHotAndWait() + readIdx := s.vals.swapHotAndWait() // The len will not change while we iterate over values, since we waited // for all writes to finish to the cold values and len. - n := s.hotColdValMap[readIdx].values.Len() + n := s.vals.Len(readIdx) dPts := reset(sData.DataPoints, n, n) var i int - s.hotColdValMap[readIdx].values.Range(func(_, value any) bool { + s.vals.Range(readIdx, func(_, value any) bool { val := value.(*sumValue[N]) collectExemplars(&dPts[i].Exemplars, val.res.Collect) dPts[i].Attributes = val.attrs @@ -118,7 +95,9 @@ func (s *deltaSum[N]) collect( i++ return true }) - s.hotColdValMap[readIdx].values.Clear() + // Unused attribute sets do not report. + s.vals.Clear(readIdx) + // The delta collection cycle resets. s.start = t @@ -139,19 +118,38 @@ func newCumulativeSum[N int64 | float64]( return &cumulativeSum[N]{ monotonic: monotonic, start: now(), - sumValueMap: sumValueMap[N]{ - values: limitedSyncMap{aggLimit: limit}, - newRes: r, - }, + values: limitedSyncMap[*sumValue[N]]{aggLimit: limit}, + newRes: r, } } -// deltaSum is the storage for sums which never reset. +// cumulativeSum is the storage for sums which never reset. type cumulativeSum[N int64 | float64] struct { monotonic bool start time.Time - sumValueMap[N] + values limitedSyncMap[*sumValue[N]] + newRes func(attribute.Set) FilteredExemplarReservoir[N] +} + +func (s *cumulativeSum[N]) measure(ctx context.Context, value N, lazy lazyFilteredAttributes) { + sv := s.values.LoadOrStoreAttr(lazy, func(attr attribute.Set) *sumValue[N] { + r := s.newRes(attr) + _, isDrop := r.(*dropRes[N]) + return &sumValue[N]{ + res: r, + attrs: attr, + startTime: now(), + dropExemplars: isDrop, + } + }) + sv.n.add(value) + // It is possible for collection to race with measurement and observe the + // exemplar in the batch of metrics after the add() for cumulative sums. + // This is an accepted tradeoff to avoid locking during measurement. + if !sv.dropExemplars { + sv.res.Offer(ctx, value, lazy) + } } func (s *cumulativeSum[N]) collect( @@ -210,7 +208,7 @@ func newPrecomputedSum[N int64 | float64]( r func(attribute.Set) FilteredExemplarReservoir[N], ) *precomputedSum[N] { return &precomputedSum[N]{ - deltaSum: newDeltaSum(monotonic, limit, r), + deltaSum: newDeltaSum[N](monotonic, limit, r), } } @@ -234,14 +232,14 @@ func (s *precomputedSum[N]) delta( sData.IsMonotonic = s.monotonic // delta always clears values on collection - readIdx := s.hcwg.swapHotAndWait() + readIdx := s.vals.swapHotAndWait() // The len will not change while we iterate over values, since we waited // for all writes to finish to the cold values and len. - n := s.hotColdValMap[readIdx].values.Len() + n := s.vals.Len(readIdx) dPts := reset(sData.DataPoints, n, n) var i int - s.hotColdValMap[readIdx].values.Range(func(key, value any) bool { + s.vals.Range(readIdx, func(key, value any) bool { val := value.(*sumValue[N]) n := val.n.load() @@ -255,7 +253,8 @@ func (s *precomputedSum[N]) delta( i++ return true }) - s.hotColdValMap[readIdx].values.Clear() + // Unused attribute sets do not report. + s.vals.Clear(readIdx) s.reported = newReported // The delta collection cycle resets. s.start = t @@ -278,14 +277,14 @@ func (s *precomputedSum[N]) cumulative( sData.IsMonotonic = s.monotonic // cumulative precomputed always clears values on collection - readIdx := s.hcwg.swapHotAndWait() + readIdx := s.vals.swapHotAndWait() // The len will not change while we iterate over values, since we waited // for all writes to finish to the cold values and len. - n := s.hotColdValMap[readIdx].values.Len() + n := s.vals.Len(readIdx) dPts := reset(sData.DataPoints, n, n) var i int - s.hotColdValMap[readIdx].values.Range(func(_, value any) bool { + s.vals.Range(readIdx, func(_, value any) bool { val := value.(*sumValue[N]) collectExemplars(&dPts[i].Exemplars, val.res.Collect) dPts[i].Attributes = val.attrs @@ -295,7 +294,8 @@ func (s *precomputedSum[N]) cumulative( i++ return true }) - s.hotColdValMap[readIdx].values.Clear() + // Unused attribute sets do not report. + s.vals.Clear(readIdx) sData.DataPoints = dPts *dest = sData diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/attrnorm/dedup.go b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/attrnorm/dedup.go new file mode 100644 index 00000000000..3e183f55760 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/attrnorm/dedup.go @@ -0,0 +1,308 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// DO NOT MODIFY. Generated by gotmpl. +// source: internal/shared/attrnorm/dedup.go.tmpl + +// Package attrnorm normalizes attribute values. +package attrnorm + +import ( + "reflect" + "unsafe" + + "go.opentelemetry.io/otel/attribute" +) + +var ( + keyValueType = reflect.TypeFor[attribute.KeyValue]() + valueType = reflect.TypeFor[attribute.Value]() +) + +// rawValue mirrors attribute.Value. It is used only to read immutable slice +// storage without calling AsMap or AsSlice on no-op paths. +type rawValue struct { + vtype attribute.Type + numeric uint64 + stringly string + slice any +} + +// ValueDedup returns value with all map values deduplicated and whether +// it changed. +// +// Duplicate map keys are resolved using last-value-wins semantics. +func ValueDedup(value attribute.Value) (attribute.Value, bool) { + switch value.Type() { + case attribute.SLICE: + return sliceValueDedup(value) + case attribute.MAP: + return mapValueDedup(value) + default: + return value, false + } +} + +// KeyValueDedup returns kv with all map values deduplicated and whether +// it changed. +func KeyValueDedup(kv attribute.KeyValue) (attribute.KeyValue, bool) { + value, changed := ValueDedup(kv.Value) + if changed { + kv.Value = value + } + return kv, changed +} + +// KeyValuesDedup returns kvs with all map values deduplicated and whether +// they changed. +// +// The returned slice is the original kvs slice if no value needs +// deduplication. Top-level keys in kvs are not deduplicated. +func KeyValuesDedup(kvs []attribute.KeyValue) ([]attribute.KeyValue, bool) { + // Preserve the caller's slice on the common no-op path. Once a changed + // value is found, copy the prior values exactly once and fill the rest in + // place as the scan continues. + var normalized []attribute.KeyValue + for i, kv := range kvs { + kv, changed := KeyValueDedup(kv) + if normalized != nil { + normalized[i] = kv + continue + } + if !changed { + continue + } + + normalized = make([]attribute.KeyValue, len(kvs)) + copy(normalized, kvs[:i]) + normalized[i] = kv + } + if normalized == nil { + return kvs, false + } + return normalized, true +} + +// SetDedup returns set with all map values deduplicated and whether it +// changed. +// +// The returned Set is the original set if no value needs deduplication. +// Top-level key uniqueness remains attribute.Set's responsibility; this only +// normalizes map attribute values. +func SetDedup(set attribute.Set) (attribute.Set, bool) { + length := set.Len() + if length == 0 { + return set, false + } + + // Most attribute sets contain no duplicate map keys. Delay allocation until + // the first changed value so the no-op path returns the original Set. + var normalized []attribute.KeyValue + for i := range length { + kv, _ := set.Get(i) + kv, changed := KeyValueDedup(kv) + if normalized != nil { + normalized = append(normalized, kv) + continue + } + if !changed { + continue + } + + normalized = make([]attribute.KeyValue, 0, length) + for j := range i { + prior, _ := set.Get(j) + normalized = append(normalized, prior) + } + normalized = append(normalized, kv) + } + if normalized == nil { + return set, false + } + + return attribute.NewSet(normalized...), true +} + +func sliceValueDedup(value attribute.Value) (attribute.Value, bool) { + storage := valueStorage(value) + length := valueLen(storage) + + // Slice values can contain map values, so recurse into each element while + // keeping the original attribute.Value when no element changes. + var normalized []attribute.Value + for i := range length { + elem := valueAt(storage, i) + elem, changed := ValueDedup(elem) + if normalized != nil { + normalized[i] = elem + continue + } + if !changed { + continue + } + + normalized = make([]attribute.Value, length) + for j := range i { + normalized[j] = valueAt(storage, j) + } + normalized[i] = elem + } + if normalized == nil { + return value, false + } + return attribute.SliceValue(normalized...), true +} + +func mapValueDedup(value attribute.Value) (attribute.Value, bool) { + storage := valueStorage(value) + length := keyValueLen(storage) + if length <= 1 { + // A single map entry cannot duplicate its own key, but its value might + // contain a map or slice that needs recursive normalization. + if length == 1 { + kv, changed := KeyValueDedup(keyValueAt(storage, 0)) + if changed { + return attribute.MapValue(kv), true + } + } + return value, false + } + + var normalized []attribute.KeyValue + for i := 0; i < length; { + // attribute.MapValue stores key-values sorted by key using a stable + // sort. Equal keys therefore form a contiguous run, and the last + // element in that run is the last value provided by the caller. + first := keyValueAt(storage, i) + j := i + 1 + for j < length && keyValueAt(storage, j).Key == first.Key { + j++ + } + + kv, nestedChanged := KeyValueDedup(keyValueAt(storage, j-1)) + // j-i > 1 means the current key run contained duplicates. + changed := nestedChanged || j-i > 1 + if normalized != nil { + normalized = append(normalized, kv) + } else if changed { + if i == 0 && j == length { + return attribute.MapValue(kv), true + } + normalized = make([]attribute.KeyValue, 0, length-(j-i-1)) + for k := range i { + normalized = append(normalized, keyValueAt(storage, k)) + } + normalized = append(normalized, kv) + } + i = j + } + if normalized == nil { + return value, false + } + return attribute.MapValue(normalized...), true +} + +func valueStorage(value attribute.Value) any { + // attribute.Value does not expose allocation-free map/slice iteration. + // The raw mirror lets us read the immutable backing array directly and + // reserve AsMap/AsSlice-style allocation for paths that actually change. + return (*rawValue)( + unsafe.Pointer(&value), + ).slice //nolint:gosec // Read-only mirror of attribute.Value for allocation-free iteration. +} + +func valueLen(storage any) int { + // attribute.Value stores small slices in fixed-size array values. Handle + // the common sizes directly and fall back to reflection for larger arrays. + switch storage.(type) { + case [0]attribute.Value: + return 0 + case [1]attribute.Value: + return 1 + case [2]attribute.Value: + return 2 + case [3]attribute.Value: + return 3 + case [4]attribute.Value: + return 4 + case [5]attribute.Value: + return 5 + default: + return arrayLen(storage, valueType) + } +} + +func valueAt(storage any, i int) attribute.Value { + switch values := storage.(type) { + case [1]attribute.Value: + return values[i] + case [2]attribute.Value: + return values[i] + case [3]attribute.Value: + return values[i] + case [4]attribute.Value: + return values[i] + case [5]attribute.Value: + return values[i] + default: + return arrayAt[attribute.Value](storage, valueType, i) + } +} + +func keyValueLen(storage any) int { + // attribute.Value stores small maps in fixed-size key-value arrays. Handle + // the common sizes directly and fall back to reflection for larger arrays. + switch storage.(type) { + case [0]attribute.KeyValue: + return 0 + case [1]attribute.KeyValue: + return 1 + case [2]attribute.KeyValue: + return 2 + case [3]attribute.KeyValue: + return 3 + case [4]attribute.KeyValue: + return 4 + case [5]attribute.KeyValue: + return 5 + default: + return arrayLen(storage, keyValueType) + } +} + +func keyValueAt(storage any, i int) attribute.KeyValue { + switch kvs := storage.(type) { + case [1]attribute.KeyValue: + return kvs[i] + case [2]attribute.KeyValue: + return kvs[i] + case [3]attribute.KeyValue: + return kvs[i] + case [4]attribute.KeyValue: + return kvs[i] + case [5]attribute.KeyValue: + return kvs[i] + default: + return arrayAt[attribute.KeyValue](storage, keyValueType, i) + } +} + +func arrayLen(storage any, elem reflect.Type) int { + // Be defensive around invalid or unexpected Value storage. Returning zero + // makes malformed storage a no-op instead of panicking in telemetry paths. + array := reflect.ValueOf(storage) + if array.Kind() != reflect.Array || array.Type().Elem() != elem { + return 0 + } + return array.Len() +} + +func arrayAt[T any](storage any, elem reflect.Type, i int) T { + // Match arrayLen's fail-closed behavior for unexpected storage. + array := reflect.ValueOf(storage) + if array.Kind() != reflect.Array || array.Type().Elem() != elem || i < 0 || i >= array.Len() { + var zero T + return zero + } + return array.Index(i).Interface().(T) +} diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/attrnorm/distinct.go b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/attrnorm/distinct.go new file mode 100644 index 00000000000..2bfc243da7d --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/attrnorm/distinct.go @@ -0,0 +1,110 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package attrnorm + +import ( + "cmp" + "slices" + + "go.opentelemetry.io/otel/attribute" +) + +// stackAttributes is the maximum number of unordered attributes copied to a +// stack buffer for canonicalization. Larger inputs use an allocated copy to +// keep sorting time bounded without modifying caller-owned attributes. +const stackAttributes = 10 + +// NewDistinct returns the identity of kvs after normalization and filtering. +// It does not retain or modify kvs. Duplicate keys use the last value supplied. +// The filter is called once for each unique normalized attribute in ascending +// key order. +func NewDistinct(kvs []attribute.KeyValue, filter attribute.Filter) attribute.Distinct { + if filter == nil { + if distinct, ok := tryUnfilteredDistinct(kvs); ok { + return distinct + } + } else if ordered(kvs) { + return orderedDistinct(kvs, filter) + } + if len(kvs) <= stackAttributes { + return sortedDistinct(kvs, filter) + } + return allocatedDistinct(kvs, filter) +} + +// tryUnfilteredDistinct hashes kvs while verifying their keys are ordered. The +// partial hash is discarded if an out-of-order key is found. +func tryUnfilteredDistinct(kvs []attribute.KeyValue) (attribute.Distinct, bool) { + hasher := attribute.NewHasher() + if len(kvs) == 0 { + return hasher.Distinct(), true + } + + // pending identifies the last value seen for the current key. + pending := 0 + for i := 1; i < len(kvs); i++ { + if kvs[i].Key < kvs[pending].Key { + return attribute.Distinct{}, false + } + if kvs[i].Key == kvs[pending].Key { + pending = i + continue + } + + normalized, _ := KeyValueDedup(kvs[pending]) + hasher.Write(normalized) + pending = i + } + + normalized, _ := KeyValueDedup(kvs[pending]) + hasher.Write(normalized) + return hasher.Distinct(), true +} + +// Keep this direct loop instead of slices.IsSortedFunc. It only needs a +// greater-than comparison and benchmarks faster for typical attribute counts. +func ordered(kvs []attribute.KeyValue) bool { + for i := 1; i < len(kvs); i++ { + if kvs[i-1].Key > kvs[i].Key { + return false + } + } + return true +} + +// orderedDistinct hashes key-values whose keys are in ascending order. Equal +// keys remain in input order so selecting the last retains last-value-wins. +func orderedDistinct(kvs []attribute.KeyValue, filter attribute.Filter) attribute.Distinct { + hasher := attribute.NewHasher() + for i := 0; i < len(kvs); { + j := i + 1 + for j < len(kvs) && kvs[j].Key == kvs[i].Key { + j++ + } + kv, _ := KeyValueDedup(kvs[j-1]) + if filter == nil || filter(kv) { + hasher.Write(kv) + } + i = j + } + return hasher.Distinct() +} + +func sortedDistinct(kvs []attribute.KeyValue, filter attribute.Filter) attribute.Distinct { + var scratch [stackAttributes]attribute.KeyValue + cpy := scratch[:len(kvs)] + copy(cpy, kvs) + return sortDistinct(cpy, filter) +} + +func allocatedDistinct(kvs []attribute.KeyValue, filter attribute.Filter) attribute.Distinct { + return sortDistinct(slices.Clone(kvs), filter) +} + +func sortDistinct(kvs []attribute.KeyValue, filter attribute.Filter) attribute.Distinct { + slices.SortStableFunc(kvs, func(a, b attribute.KeyValue) int { + return cmp.Compare(a.Key, b.Key) + }) + return orderedDistinct(kvs, filter) +} diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/finish/doc.go b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/finish/doc.go new file mode 100644 index 00000000000..7dcd3737019 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/finish/doc.go @@ -0,0 +1,5 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Package finish coordinates the lifecycle of finish-aware metric series. +package finish diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/finish/lifecycle.go b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/finish/lifecycle.go new file mode 100644 index 00000000000..2638fc77dd7 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/finish/lifecycle.go @@ -0,0 +1,253 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package finish + +import ( + "runtime" + "sync" + "sync/atomic" + "time" +) + +type lifecycleState uint32 + +const ( + lifecycleActive lifecycleState = iota + lifecycleShared + lifecycleFinishPending + lifecycleRetired + lifecycleCollecting +) + +// Lifecycle coordinates measurements, explicit finishes, collections, and +// retirement for one metric series. Its zero value is ready for use. +// +// Lifecycle methods are safe to call concurrently. A successful measurement +// acquisition and an emitted collection must each be completed exactly once. +// A Lifecycle must not be copied after first use. +// +// The valid transitions are active to finish-pending on Finish, active or +// finish-pending to shared on a shared measurement, finish-pending to active on +// an ordinary measurement, any non-retired state to collecting on collection, +// and collecting to its prior state or retired when collection completes. +// Shared lifetimes ignore Finish. Retired is terminal. +type Lifecycle struct { + control sync.Mutex + state atomic.Uint32 + writers atomic.Uint64 + // finished is meaningful only while a pending finish is being collected. + // Reactivation leaves the old value in place so measurements remain lock-free. + finished time.Time +} + +// Measurement represents admission to update one metric-series lifetime. A +// successful call to Lifecycle.AcquireMeasurement returns a Measurement, which +// must be released exactly once after the aggregate and exemplars are updated. +type Measurement struct { + lifecycle *Lifecycle +} + +// Release completes the admitted measurement. +func (m Measurement) Release() { + m.lifecycle.releaseMeasurement() +} + +// Collection describes an exclusive collection phase for a metric-series +// lifetime. A Collection returned with true by a Lifecycle collection method +// must be completed exactly once after the aggregate and exemplars are read. +type Collection struct { + lifecycle *Lifecycle + time time.Time + restore lifecycleState + retire bool +} + +// Time returns the timestamp to use for the collected point. +func (c Collection) Time() time.Time { + return c.time +} + +// ShouldRetire reports whether Complete will retire the series lifetime. +func (c Collection) ShouldRetire() bool { + return c.retire +} + +// Complete ends the exclusive collection phase. It must be called exactly once. +func (c Collection) Complete() { + state := c.restore + if c.retire { + state = lifecycleRetired + } + c.lifecycle.finished = time.Time{} + c.lifecycle.state.Store(uint32(state)) + c.lifecycle.control.Unlock() +} + +// AcquireMeasurement reserves this series lifetime for a measurement. It waits +// for an in-progress collection and returns false only if the lifetime is +// retired. A successful acquisition must be paired with exactly one call to +// Measurement.Release after the aggregate and exemplars are updated. +func (l *Lifecycle) AcquireMeasurement() (Measurement, bool) { + for { + // Increment before checking state so a collection either waits for this + // attempt or closes admission before the attempt can update the aggregate. + l.writers.Add(1) + switch lifecycleState(l.state.Load()) { + case lifecycleActive, lifecycleShared: + return Measurement{lifecycle: l}, true + case lifecycleFinishPending: + if l.state.CompareAndSwap( + uint32(lifecycleFinishPending), + uint32(lifecycleActive), + ) { + return Measurement{lifecycle: l}, true + } + l.releaseMeasurement() + case lifecycleCollecting: + l.releaseMeasurement() + l.waitForCollection() + case lifecycleRetired: + l.releaseMeasurement() + return Measurement{}, false + } + } +} + +// AcquireSharedMeasurement reserves this series lifetime for a measurement and +// atomically makes the lifetime shared. A shared lifetime cannot be finished. +// It waits for an in-progress collection and returns false only if the lifetime +// is retired. A successful acquisition must be paired with exactly one call to +// Measurement.Release after the aggregate and exemplars are updated. +func (l *Lifecycle) AcquireSharedMeasurement() (Measurement, bool) { + for { + // Increment before checking state so a collection either waits for this + // attempt or closes admission before the attempt can update the aggregate. + l.writers.Add(1) + switch lifecycleState(l.state.Load()) { + case lifecycleShared: + return Measurement{lifecycle: l}, true + case lifecycleActive: + if l.state.CompareAndSwap( + uint32(lifecycleActive), + uint32(lifecycleShared), + ) { + return Measurement{lifecycle: l}, true + } + l.releaseMeasurement() + case lifecycleFinishPending: + if l.state.CompareAndSwap( + uint32(lifecycleFinishPending), + uint32(lifecycleShared), + ) { + return Measurement{lifecycle: l}, true + } + l.releaseMeasurement() + case lifecycleCollecting: + l.releaseMeasurement() + l.waitForCollection() + case lifecycleRetired: + l.releaseMeasurement() + return Measurement{}, false + } + } +} + +func (l *Lifecycle) waitForCollection() { + l.control.Lock() + l.control.Unlock() //nolint:gocritic,staticcheck // Lock acquisition parks until collection completes. +} + +func (l *Lifecycle) releaseMeasurement() { + // atomic.Uint64 has no subtraction operation. Adding MaxUint64 decrements + // the writer count modulo 2^64. A matching acquisition guarantees the count + // is nonzero. + l.writers.Add(^uint64(0)) +} + +// Finish marks an active series lifetime to be retired by its next collection +// at the supplied time. It returns false if the lifetime is already pending, +// shared, collecting, or retired. A measurement admitted after Finish +// reactivates the lifetime. +func (l *Lifecycle) Finish(at time.Time) bool { + l.control.Lock() + defer l.control.Unlock() + if !l.state.CompareAndSwap( + uint32(lifecycleActive), + uint32(lifecycleFinishPending), + ) { + return false + } + // Collection also holds control, so it cannot observe finish-pending before + // its timestamp is available. A concurrent measurement may reactivate or + // share the lifetime; in that case the timestamp is intentionally ignored. + l.finished = at + return true +} + +// BeginCumulativeCollection closes measurement admission and waits for admitted +// measurements to complete. An active or shared lifetime returns to its prior +// state when the returned Collection is completed; a finish-pending lifetime is +// retired. It returns false without a Collection if the lifetime is retired. A +// returned Collection must be completed exactly once. +func (l *Lifecycle) BeginCumulativeCollection(at time.Time) (Collection, bool) { + l.control.Lock() + collection, ok := l.beginCollection(at) + if !ok { + l.control.Unlock() + } + return collection, ok +} + +// BeginDeltaCollection closes measurement admission and waits for admitted +// measurements to complete. Every emitted lifetime is retired when the returned +// Collection is completed. It returns false without a Collection if the +// lifetime is retired. A returned Collection must be completed exactly once. +func (l *Lifecycle) BeginDeltaCollection(at time.Time) (Collection, bool) { + l.control.Lock() + collection, ok := l.beginCollection(at) + if !ok { + l.control.Unlock() + return Collection{}, false + } + collection.retire = true + return collection, true +} + +func (l *Lifecycle) beginCollection(at time.Time) (Collection, bool) { + state := lifecycleState(l.state.Load()) + if state == lifecycleRetired { + return Collection{}, false + } + state = lifecycleState(l.state.Swap(uint32(lifecycleCollecting))) + for l.writers.Load() != 0 { + runtime.Gosched() + } + + if state == lifecycleFinishPending { + return Collection{ + lifecycle: l, + time: l.finished, + restore: state, + retire: true, + }, true + } + return Collection{lifecycle: l, time: at, restore: state}, true +} + +// Retire permanently closes the series lifetime. It waits for admitted +// measurements to complete and has no effect if the lifetime is already +// retired. +func (l *Lifecycle) Retire() { + l.control.Lock() + defer l.control.Unlock() + if lifecycleState(l.state.Load()) == lifecycleRetired { + return + } + l.state.Store(uint32(lifecycleCollecting)) + for l.writers.Load() != 0 { + runtime.Gosched() + } + l.finished = time.Time{} + l.state.Store(uint32(lifecycleRetired)) +} diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/gen.go b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/gen.go new file mode 100644 index 00000000000..5f077dfe93b --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/gen.go @@ -0,0 +1,10 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Package internal provides internal functionality for the sdk/metric package. +package internal + +//go:generate gotmpl --body=../../../internal/shared/x/x.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/otel/sdk/metric\" }" --out=x/x.go +//go:generate gotmpl --body=../../../internal/shared/x/x_test.go.tmpl "--data={}" --out=x/x_test.go +//go:generate gotmpl --body=../../../internal/shared/attrnorm/dedup.go.tmpl "--data={}" --out=attrnorm/dedup.go +//go:generate gotmpl --body=../../../internal/shared/attrnorm/dedup_test.go.tmpl "--data={}" --out=attrnorm/dedup_test.go diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/observ/instrumentation.go b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/observ/instrumentation.go index c580dcc30d2..b09748a79fa 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/observ/instrumentation.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/observ/instrumentation.go @@ -3,7 +3,7 @@ // Package observ provides experimental observability instrumentation for the // metric reader. -package observ // import "go.opentelemetry.io/otel/sdk/metric/internal/observ" +package observ import ( "context" @@ -16,8 +16,8 @@ import ( "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/sdk" "go.opentelemetry.io/otel/sdk/internal/x" - semconv "go.opentelemetry.io/otel/semconv/v1.41.0" - "go.opentelemetry.io/otel/semconv/v1.41.0/otelconv" + semconv "go.opentelemetry.io/otel/semconv/v1.43.0" + "go.opentelemetry.io/otel/semconv/v1.43.0/otelconv" ) const ( diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/reservoir/concurrent_safe.go b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/reservoir/concurrent_safe.go index 3be234a4108..8542fd94bd7 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/reservoir/concurrent_safe.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/reservoir/concurrent_safe.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package reservoir // import "go.opentelemetry.io/otel/sdk/metric/internal/reservoir" +package reservoir // ConcurrentSafe is an interface that can be embedded in an // exemplar.Reservoir to indicate to the SDK that it is safe to invoke its diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/reservoir/doc.go b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/reservoir/doc.go index 6cd213b5f32..6dbf906c8ad 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/reservoir/doc.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/reservoir/doc.go @@ -3,4 +3,4 @@ // Package reservoir contains experimental features used by built-in exemplar // reservoirs which require coordination with the metrics SDK. -package reservoir // import "go.opentelemetry.io/otel/sdk/metric/internal/reservoir" +package reservoir diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/reuse_slice.go b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/reuse_slice.go index ea452be6c2c..6ddf01473b4 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/internal/reuse_slice.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/internal/reuse_slice.go @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // Package internal provides internal functionality for the metric package. -package internal // import "go.opentelemetry.io/otel/sdk/metric/internal" +package internal // ReuseSlice returns a zeroed view of slice if its capacity is greater than or // equal to n. Otherwise, it returns a new []T with capacity equal to n. diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/manual_reader.go b/vendor/go.opentelemetry.io/otel/sdk/metric/manual_reader.go index 7e0cccdff60..b98e255d8c4 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/manual_reader.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/manual_reader.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package metric // import "go.opentelemetry.io/otel/sdk/metric" +package metric import ( "context" diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/meter.go b/vendor/go.opentelemetry.io/otel/sdk/metric/meter.go index e9a2d59572e..8c54974e062 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/meter.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/meter.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package metric // import "go.opentelemetry.io/otel/sdk/metric" +package metric import ( "context" @@ -593,11 +593,13 @@ func (r observer) ObserveFloat64(o metric.Float64Observable, v float64, opts ... return } c := metric.NewObserveConfig(opts) + rawKVs := extractRawKVs(opts) + set := resolveAttributes(c.Attributes(), rawKVs) // Access to r.pipe.float64Measure is already guarded by a lock in pipeline.produce. // TODO (#5946): Refactor pipeline and observable measures. measures := r.pipe.float64Measures[oImpl.observableID] for _, m := range measures { - m(context.Background(), v, c.Attributes()) + m(context.Background(), v, set) } } @@ -624,11 +626,13 @@ func (r observer) ObserveInt64(o metric.Int64Observable, v int64, opts ...metric return } c := metric.NewObserveConfig(opts) + rawKVs := extractRawKVs(opts) + set := resolveAttributes(c.Attributes(), rawKVs) // Access to r.pipe.int64Measures is already guarded b a lock in pipeline.produce. // TODO (#5946): Refactor pipeline and observable measures. measures := r.pipe.int64Measures[oImpl.observableID] for _, m := range measures { - m(context.Background(), v, c.Attributes()) + m(context.Background(), v, set) } } @@ -793,7 +797,8 @@ type int64Observer struct { func (o int64Observer) Observe(val int64, opts ...metric.ObserveOption) { c := metric.NewObserveConfig(opts) - o.observe(val, c.Attributes()) + rawKVs := extractRawKVs(opts) + o.observe(val, resolveAttributes(c.Attributes(), rawKVs)) } type float64Observer struct { @@ -803,7 +808,8 @@ type float64Observer struct { func (o float64Observer) Observe(val float64, opts ...metric.ObserveOption) { c := metric.NewObserveConfig(opts) - o.observe(val, c.Attributes()) + rawKVs := extractRawKVs(opts) + o.observe(val, resolveAttributes(c.Attributes(), rawKVs)) } func defaultAttributes[T any](opts []T) []attribute.Key { diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/metricdata/data.go b/vendor/go.opentelemetry.io/otel/sdk/metric/metricdata/data.go index af835e9d992..3155a22bbeb 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/metricdata/data.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/metricdata/data.go @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // Package metricdata provides types for the metric SDK data model. -package metricdata // import "go.opentelemetry.io/otel/sdk/metric/metricdata" +package metricdata import ( "encoding/json" @@ -190,7 +190,7 @@ type ExponentialHistogramDataPoint[N int64 | float64] struct { type ExponentialBucket struct { // Offset is the bucket index of the first entry in the Counts slice. Offset int32 - // Counts is an slice where Counts[i] carries the count of the bucket at + // Counts is a slice where Counts[i] carries the count of the bucket at // index (Offset+i). Counts[i] is the count of values greater than // base^(Offset+i) and less than or equal to base^(Offset+i+1). Counts []uint64 diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/metricdata/temporality.go b/vendor/go.opentelemetry.io/otel/sdk/metric/metricdata/temporality.go index 2ac840ff356..8d7c89d857f 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/metricdata/temporality.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/metricdata/temporality.go @@ -3,7 +3,7 @@ //go:generate stringer -type=Temporality -package metricdata // import "go.opentelemetry.io/otel/sdk/metric/metricdata" +package metricdata // Temporality defines the window that an aggregation was calculated over. type Temporality uint8 diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/periodic_reader.go b/vendor/go.opentelemetry.io/otel/sdk/metric/periodic_reader.go index c1c2e3e2f0a..9405959c653 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/periodic_reader.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/periodic_reader.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package metric // import "go.opentelemetry.io/otel/sdk/metric" +package metric import ( "context" @@ -14,9 +14,8 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/internal/global" "go.opentelemetry.io/otel/sdk/metric/internal/observ" - "go.opentelemetry.io/otel/sdk/metric/internal/x" "go.opentelemetry.io/otel/sdk/metric/metricdata" - semconv "go.opentelemetry.io/otel/semconv/v1.41.0" + semconv "go.opentelemetry.io/otel/semconv/v1.43.0" ) // Default periodic reader timing. @@ -29,6 +28,7 @@ const ( type periodicReaderConfig struct { interval time.Duration timeout time.Duration + maxExportBatchSize int producers []Producer cardinalityLimitSelector CardinalityLimitSelector } @@ -99,6 +99,21 @@ func WithInterval(d time.Duration) PeriodicReaderOption { }) } +// WithMaxExportBatchSize configures the maximum number of metric data points in +// a batch that are exported at once. +// +// If this option is not used or size is less than or equal to zero, no limit is +// applied. +func WithMaxExportBatchSize(size int) PeriodicReaderOption { + return periodicReaderOptionFunc(func(conf periodicReaderConfig) periodicReaderConfig { + if size <= 0 { + return conf + } + conf.maxExportBatchSize = size + return conf + }) +} + // NewPeriodicReader returns a Reader that collects and exports metric data to // the exporter at a defined interval. By default, the returned Reader will // collect and export data every 60 seconds, and will cancel any attempts that @@ -116,6 +131,7 @@ func NewPeriodicReader(exporter Exporter, options ...PeriodicReaderOption) *Peri r := &PeriodicReader{ interval: conf.interval, timeout: conf.timeout, + batcher: batcher{size: conf.maxExportBatchSize}, exporter: exporter, flushCh: make(chan chan error), cancel: cancel, @@ -127,16 +143,8 @@ func NewPeriodicReader(exporter Exporter, options ...PeriodicReaderOption) *Peri }, }, } - if val, ok := x.MetricExportBatchSize.Lookup(); ok { - r.batcher = batcher{size: val} - } r.externalProducers.Store(conf.producers) - go func() { - defer func() { close(r.done) }() - r.run(ctx, conf.interval) - }() - var err error r.inst, err = observ.NewInstrumentation( semconv.OTelComponentTypePeriodicMetricReader.Value.AsString(), @@ -146,6 +154,11 @@ func NewPeriodicReader(exporter Exporter, options ...PeriodicReaderOption) *Peri otel.Handle(err) } + go func() { + defer func() { close(r.done) }() + r.run(ctx, conf.interval) + }() + return r } diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/pipeline.go b/vendor/go.opentelemetry.io/otel/sdk/metric/pipeline.go index 09d10eeb5f2..af705ea9192 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/pipeline.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/pipeline.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package metric // import "go.opentelemetry.io/otel/sdk/metric" +package metric import ( "container/list" @@ -255,7 +255,7 @@ func (i *inserter[N]) Instrument( continue } matched = true - in, id, e := i.cachedAggregator(inst.Scope, inst.Kind, stream, readerAggregation) + in, id, e := i.cachedAggregator(inst.Scope, inst.Kind, stream, allowedKeys, readerAggregation) if e != nil { err = errors.Join(err, e) } @@ -284,13 +284,7 @@ func (i *inserter[N]) Instrument( Description: inst.Description, Unit: inst.Unit, } - // allowedKeys == nil indicates that the WithDefaultAttributes option was not passed, - // and all keys are allowed. An empty (non-nil) slice indicates that the option was passed - // with an empty set of keys, and no keys are allowed. - if allowedKeys != nil { - stream.AttributeFilter = attribute.NewAllowKeysFilter(allowedKeys...) - } - in, _, e := i.cachedAggregator(inst.Scope, inst.Kind, stream, readerAggregation) + in, _, e := i.cachedAggregator(inst.Scope, inst.Kind, stream, allowedKeys, readerAggregation) if e != nil { if err == nil { err = errCreatingAggregators @@ -364,6 +358,7 @@ func (i *inserter[N]) cachedAggregator( scope instrumentation.Scope, kind InstrumentKind, stream Stream, + allowedKeys []attribute.Key, readerAggregation Aggregation, ) (meas aggregate.Measure[N], aggID uint64, err error) { switch stream.Aggregation.(type) { @@ -378,6 +373,14 @@ func (i *inserter[N]) cachedAggregator( if stream.ExemplarReservoirProviderSelector == nil { stream.ExemplarReservoirProviderSelector = DefaultExemplarReservoirProviderSelector } + // If attribute_keys is not provided on the view (AttributeFilter == nil), + // use the advisory Attributes configured on the instrument (allowedKeys). + // allowedKeys == nil indicates that the WithDefaultAttributes option was not passed, + // and all keys are allowed. An empty (non-nil) slice indicates that the option was passed + // with an empty set of keys, and no keys are allowed. + if stream.AttributeFilter == nil && allowedKeys != nil { + stream.AttributeFilter = attribute.NewAllowKeysFilter(allowedKeys...) + } if err := isAggregatorCompatible(kind, stream.Aggregation); err != nil { return nil, 0, fmt.Errorf( diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/provider.go b/vendor/go.opentelemetry.io/otel/sdk/metric/provider.go index fd4cdccd0ff..2a9f29ac2d9 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/provider.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/provider.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package metric // import "go.opentelemetry.io/otel/sdk/metric" +package metric import ( "context" @@ -12,6 +12,7 @@ import ( "go.opentelemetry.io/otel/metric/embedded" "go.opentelemetry.io/otel/metric/noop" "go.opentelemetry.io/otel/sdk/instrumentation" + "go.opentelemetry.io/otel/sdk/metric/internal/attrnorm" ) // MeterProvider handles the creation and coordination of Meters. All Meters @@ -76,11 +77,12 @@ func (mp *MeterProvider) Meter(name string, options ...metric.MeterOption) metri } c := metric.NewMeterConfig(options...) + attrs, _ := attrnorm.SetDedup(c.InstrumentationAttributes()) s := instrumentation.Scope{ Name: name, Version: c.InstrumentationVersion(), SchemaURL: c.SchemaURL(), - Attributes: c.InstrumentationAttributes(), + Attributes: attrs, } global.Info( diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/reader.go b/vendor/go.opentelemetry.io/otel/sdk/metric/reader.go index 556afcea6bb..505c9ad9388 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/reader.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/reader.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package metric // import "go.opentelemetry.io/otel/sdk/metric" +package metric import ( "context" diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/splitmetrics.go b/vendor/go.opentelemetry.io/otel/sdk/metric/splitmetrics.go index a7931412bb2..b183cf4863c 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/splitmetrics.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/splitmetrics.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package metric // import "go.opentelemetry.io/otel/sdk/metric" +package metric import ( "go.opentelemetry.io/otel/sdk/metric/metricdata" diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/version.go b/vendor/go.opentelemetry.io/otel/sdk/metric/version.go index 3e1bea4b446..2310096801c 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/version.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/version.go @@ -1,9 +1,9 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package metric // import "go.opentelemetry.io/otel/sdk/metric" +package metric // version is the current release version of the metric SDK in use. func version() string { - return "1.44.0" + return "1.47.0" } diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/view.go b/vendor/go.opentelemetry.io/otel/sdk/metric/view.go index 13fb7143ce0..62ee9727a59 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/metric/view.go +++ b/vendor/go.opentelemetry.io/otel/sdk/metric/view.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package metric // import "go.opentelemetry.io/otel/sdk/metric" +package metric import ( "errors" @@ -44,7 +44,7 @@ type View func(Instrument) (Stream, bool) // the Instrument the View matches against will be use for the Name, // Description, and Unit of the returned Stream and no Aggregation or // AttributeFilter are set. All non-zero-value fields of mask are used instead -// of the default. If you need to zero out an Stream field returned from a +// of the default. If you need to zero out a Stream field returned from a // View, create a View directly. func NewView(criteria Instrument, mask Stream) View { if criteria.IsEmpty() { diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/auto.go b/vendor/go.opentelemetry.io/otel/sdk/resource/auto.go index c02aeefdde5..8754313af99 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/resource/auto.go +++ b/vendor/go.opentelemetry.io/otel/sdk/resource/auto.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package resource // import "go.opentelemetry.io/otel/sdk/resource" +package resource import ( "context" diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go b/vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go index 28823edd53d..d5f6dc0a6d3 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go +++ b/vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package resource // import "go.opentelemetry.io/otel/sdk/resource" +package resource import ( "context" @@ -13,7 +13,7 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/sdk" - semconv "go.opentelemetry.io/otel/semconv/v1.41.0" + semconv "go.opentelemetry.io/otel/semconv/v1.43.0" ) type ( diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/config.go b/vendor/go.opentelemetry.io/otel/sdk/resource/config.go index a3d647d92c2..c5ffa45d022 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/resource/config.go +++ b/vendor/go.opentelemetry.io/otel/sdk/resource/config.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package resource // import "go.opentelemetry.io/otel/sdk/resource" +package resource import ( "context" @@ -23,7 +23,9 @@ type Option interface { apply(config) config } -// WithAttributes adds attributes to the configured Resource. +// WithAttributes adds attributes to the configured Resource. Duplicate +// top-level attribute keys and duplicate keys inside map values are +// resolved using last-value-wins semantics. func WithAttributes(attributes ...attribute.KeyValue) Option { return WithDetectors(detectAttributes{attributes}) } diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/container.go b/vendor/go.opentelemetry.io/otel/sdk/resource/container.go index ce03e24c419..c81163bf85e 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/resource/container.go +++ b/vendor/go.opentelemetry.io/otel/sdk/resource/container.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package resource // import "go.opentelemetry.io/otel/sdk/resource" +package resource import ( "bufio" @@ -11,7 +11,7 @@ import ( "os" "regexp" - semconv "go.opentelemetry.io/otel/semconv/v1.41.0" + semconv "go.opentelemetry.io/otel/semconv/v1.43.0" ) type containerIDProvider func() (string, error) diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/doc.go b/vendor/go.opentelemetry.io/otel/sdk/resource/doc.go index 64939a27131..f5a79d3fe49 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/resource/doc.go +++ b/vendor/go.opentelemetry.io/otel/sdk/resource/doc.go @@ -17,4 +17,4 @@ // // While this package provides a stable API, // the attributes added by resource detectors may change. -package resource // import "go.opentelemetry.io/otel/sdk/resource" +package resource diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/env.go b/vendor/go.opentelemetry.io/otel/sdk/resource/env.go index ac5691c08d9..0eeb1e2ae5e 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/resource/env.go +++ b/vendor/go.opentelemetry.io/otel/sdk/resource/env.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package resource // import "go.opentelemetry.io/otel/sdk/resource" +package resource import ( "context" @@ -12,7 +12,7 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" - semconv "go.opentelemetry.io/otel/semconv/v1.41.0" + semconv "go.opentelemetry.io/otel/semconv/v1.43.0" ) const ( diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go index cb38fa1a8b0..47219be223a 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go +++ b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go @@ -1,14 +1,14 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package resource // import "go.opentelemetry.io/otel/sdk/resource" +package resource import ( "context" "errors" "strings" - semconv "go.opentelemetry.io/otel/semconv/v1.41.0" + semconv "go.opentelemetry.io/otel/semconv/v1.43.0" ) type hostIDProvider func() (string, error) diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_bsd.go b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_bsd.go index 4c1c30f2560..bcd174342b2 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_bsd.go +++ b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_bsd.go @@ -3,7 +3,7 @@ //go:build dragonfly || freebsd || netbsd || openbsd || solaris -package resource // import "go.opentelemetry.io/otel/sdk/resource" +package resource var platformHostIDReader hostIDReader = &hostIDReaderBSD{ execCommand: execCommand, diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_darwin.go b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_darwin.go index b09fde3b735..81ece5b34d6 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_darwin.go +++ b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_darwin.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package resource // import "go.opentelemetry.io/otel/sdk/resource" +package resource var platformHostIDReader hostIDReader = &hostIDReaderDarwin{ execCommand: execCommand, diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_exec.go b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_exec.go index e239ead0287..c058f0d26b0 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_exec.go +++ b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_exec.go @@ -3,7 +3,7 @@ //go:build darwin || dragonfly || freebsd || netbsd || openbsd || solaris -package resource // import "go.opentelemetry.io/otel/sdk/resource" +package resource import ( "context" diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_linux.go b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_linux.go index 4a26096c8d0..26cf6a5d1e2 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_linux.go +++ b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_linux.go @@ -3,7 +3,7 @@ //go:build linux -package resource // import "go.opentelemetry.io/otel/sdk/resource" +package resource var platformHostIDReader hostIDReader = &hostIDReaderLinux{ readFile: readFile, diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_readfile.go b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_readfile.go index c95d87685c9..d955c2c909f 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_readfile.go +++ b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_readfile.go @@ -3,7 +3,7 @@ //go:build linux || dragonfly || freebsd || netbsd || openbsd || solaris -package resource // import "go.opentelemetry.io/otel/sdk/resource" +package resource import "os" diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_unsupported.go b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_unsupported.go index 63ad2fa4e05..9f6ca82118c 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_unsupported.go +++ b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_unsupported.go @@ -3,7 +3,7 @@ //go:build !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows -package resource // import "go.opentelemetry.io/otel/sdk/resource" +package resource // hostIDReaderUnsupported is a placeholder implementation for operating systems // for which this project currently doesn't support host.id diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_windows.go b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_windows.go index 2b8ca20b381..e9e4a038484 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_windows.go +++ b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_windows.go @@ -3,7 +3,7 @@ //go:build windows -package resource // import "go.opentelemetry.io/otel/sdk/resource" +package resource import ( "golang.org/x/sys/windows/registry" diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/os.go b/vendor/go.opentelemetry.io/otel/sdk/resource/os.go index 4c0def41483..6af4915679f 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/resource/os.go +++ b/vendor/go.opentelemetry.io/otel/sdk/resource/os.go @@ -1,14 +1,14 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package resource // import "go.opentelemetry.io/otel/sdk/resource" +package resource import ( "context" "strings" "go.opentelemetry.io/otel/attribute" - semconv "go.opentelemetry.io/otel/semconv/v1.41.0" + semconv "go.opentelemetry.io/otel/semconv/v1.43.0" ) type osDescriptionProvider func() (string, error) diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/os_release_darwin.go b/vendor/go.opentelemetry.io/otel/sdk/resource/os_release_darwin.go index 3d703c5d98e..f12876d17a5 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/resource/os_release_darwin.go +++ b/vendor/go.opentelemetry.io/otel/sdk/resource/os_release_darwin.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package resource // import "go.opentelemetry.io/otel/sdk/resource" +package resource import ( "encoding/xml" diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/os_release_unix.go b/vendor/go.opentelemetry.io/otel/sdk/resource/os_release_unix.go index a1763267c22..ad92858546e 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/resource/os_release_unix.go +++ b/vendor/go.opentelemetry.io/otel/sdk/resource/os_release_unix.go @@ -3,7 +3,7 @@ //go:build aix || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos -package resource // import "go.opentelemetry.io/otel/sdk/resource" +package resource import ( "bufio" diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/os_unix.go b/vendor/go.opentelemetry.io/otel/sdk/resource/os_unix.go index 1cd87c39834..ba5e48db244 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/resource/os_unix.go +++ b/vendor/go.opentelemetry.io/otel/sdk/resource/os_unix.go @@ -3,7 +3,7 @@ //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos -package resource // import "go.opentelemetry.io/otel/sdk/resource" +package resource import ( "fmt" diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/os_unsupported.go b/vendor/go.opentelemetry.io/otel/sdk/resource/os_unsupported.go index 25f629532a3..e2c19c2b3aa 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/resource/os_unsupported.go +++ b/vendor/go.opentelemetry.io/otel/sdk/resource/os_unsupported.go @@ -3,7 +3,7 @@ //go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos -package resource // import "go.opentelemetry.io/otel/sdk/resource" +package resource // platformOSDescription is a placeholder implementation for OSes // for which this project currently doesn't support os.description diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/os_windows.go b/vendor/go.opentelemetry.io/otel/sdk/resource/os_windows.go index ebd50826d6e..9b76489577a 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/resource/os_windows.go +++ b/vendor/go.opentelemetry.io/otel/sdk/resource/os_windows.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package resource // import "go.opentelemetry.io/otel/sdk/resource" +package resource import ( "fmt" diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/process.go b/vendor/go.opentelemetry.io/otel/sdk/resource/process.go index b015f8233c6..a578fc3258e 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/resource/process.go +++ b/vendor/go.opentelemetry.io/otel/sdk/resource/process.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package resource // import "go.opentelemetry.io/otel/sdk/resource" +package resource import ( "context" @@ -11,7 +11,7 @@ import ( "path/filepath" "runtime" - semconv "go.opentelemetry.io/otel/semconv/v1.41.0" + semconv "go.opentelemetry.io/otel/semconv/v1.43.0" ) type ( diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/resource.go b/vendor/go.opentelemetry.io/otel/sdk/resource/resource.go index f715be53eda..1ab929a3ab8 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/resource/resource.go +++ b/vendor/go.opentelemetry.io/otel/sdk/resource/resource.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package resource // import "go.opentelemetry.io/otel/sdk/resource" +package resource import ( "context" @@ -11,6 +11,7 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/sdk/internal/attrnorm" "go.opentelemetry.io/otel/sdk/internal/x" ) @@ -47,6 +48,8 @@ var ( var ErrSchemaURLConflict = errors.New("conflicting Schema URL") // New returns a [Resource] built using opts. +// Duplicate top-level attribute keys and duplicate keys inside map +// values are resolved using last-value-wins semantics. // // This may return a partial Resource along with an error containing // [ErrPartialResource] if options that provide a [Detector] are used and that @@ -66,25 +69,29 @@ func New(ctx context.Context, opts ...Option) (*Resource, error) { return r, detect(ctx, r, cfg.detectors) } -// NewWithAttributes creates a resource from attrs and associates the resource with a -// schema URL. If attrs contains duplicate keys, the last value will be used. If attrs -// contains any invalid items those items will be dropped. The attrs are assumed to be -// in a schema identified by schemaURL. +// NewWithAttributes creates a resource from attrs and associates the resource +// with a schema URL. If attrs contains duplicate top-level attribute keys or +// duplicate keys inside map values, the last value will be used. If attrs +// contains any invalid items those items will be dropped. The attrs are assumed +// to be in a schema identified by schemaURL. func NewWithAttributes(schemaURL string, attrs ...attribute.KeyValue) *Resource { resource := NewSchemaless(attrs...) resource.schemaURL = schemaURL return resource } -// NewSchemaless creates a resource from attrs. If attrs contains duplicate keys, -// the last value will be used. If attrs contains any invalid items those items will -// be dropped. The resource will not be associated with a schema URL. If the schema +// NewSchemaless creates a resource from attrs. If attrs contains duplicate +// top-level attribute keys or duplicate keys inside map values, the last +// value will be used. If attrs contains any invalid items those items will be +// dropped. The resource will not be associated with a schema URL. If the schema // of the attrs is known use NewWithAttributes instead. func NewSchemaless(attrs ...attribute.KeyValue) *Resource { if len(attrs) == 0 { return &Resource{} } + attrs, _ = attrnorm.KeyValuesDedup(attrs) + // Ensure attributes comply with the specification: // https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/common/README.md#attribute s, _ := attribute.NewSetWithFiltered(attrs, func(kv attribute.KeyValue) bool { @@ -113,6 +120,9 @@ func (r *Resource) String() string { // MarshalLog is the marshaling function used by the logging system to represent this Resource. func (r *Resource) MarshalLog() any { + if r == nil { + r = Empty() + } return struct { Attributes attribute.Set SchemaURL string diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/batch_span_processor.go b/vendor/go.opentelemetry.io/otel/sdk/trace/batch_span_processor.go index f9f2a6c2c85..2b9560ee7f9 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/trace/batch_span_processor.go +++ b/vendor/go.opentelemetry.io/otel/sdk/trace/batch_span_processor.go @@ -1,11 +1,12 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package trace // import "go.opentelemetry.io/otel/sdk/trace" +package trace import ( "context" "errors" + "fmt" "sync" "sync/atomic" "time" @@ -435,11 +436,11 @@ func (bsp *batchSpanProcessor) enqueueDrop(ctx context.Context, sd ReadOnlySpan) func (bsp *batchSpanProcessor) MarshalLog() any { return struct { Type string - SpanExporter SpanExporter + SpanExporter string Config BatchSpanProcessorOptions }{ Type: "BatchSpanProcessor", - SpanExporter: bsp.e, + SpanExporter: fmt.Sprintf("%T", bsp.e), Config: bsp.o, } } diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/doc.go b/vendor/go.opentelemetry.io/otel/sdk/trace/doc.go index b502c7d4798..b292fa3113e 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/trace/doc.go +++ b/vendor/go.opentelemetry.io/otel/sdk/trace/doc.go @@ -10,4 +10,4 @@ See https://opentelemetry.io. See [go.opentelemetry.io/otel/sdk/internal/x] for information about the experimental features. */ -package trace // import "go.opentelemetry.io/otel/sdk/trace" +package trace diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/event.go b/vendor/go.opentelemetry.io/otel/sdk/trace/event.go index 60a7ed1349b..49eac0459f4 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/trace/event.go +++ b/vendor/go.opentelemetry.io/otel/sdk/trace/event.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package trace // import "go.opentelemetry.io/otel/sdk/trace" +package trace import ( "time" diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/evictedqueue.go b/vendor/go.opentelemetry.io/otel/sdk/trace/evictedqueue.go index 8c308dd60a9..1f62b528c3e 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/trace/evictedqueue.go +++ b/vendor/go.opentelemetry.io/otel/sdk/trace/evictedqueue.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package trace // import "go.opentelemetry.io/otel/sdk/trace" +package trace import ( "slices" diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go b/vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go index 3649322a6e4..be22ac63228 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go +++ b/vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package trace // import "go.opentelemetry.io/otel/sdk/trace" +package trace import ( "context" diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/internal/env/env.go b/vendor/go.opentelemetry.io/otel/sdk/trace/internal/env/env.go index 58f68df4417..1385ae6fc24 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/trace/internal/env/env.go +++ b/vendor/go.opentelemetry.io/otel/sdk/trace/internal/env/env.go @@ -3,7 +3,7 @@ // Package env provides types and functionality for environment variable support // in the OpenTelemetry SDK. -package env // import "go.opentelemetry.io/otel/sdk/trace/internal/env" +package env import ( "os" diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/internal/observ/batch_span_processor.go b/vendor/go.opentelemetry.io/otel/sdk/trace/internal/observ/batch_span_processor.go index c725ebf372d..b55750a8442 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/trace/internal/observ/batch_span_processor.go +++ b/vendor/go.opentelemetry.io/otel/sdk/trace/internal/observ/batch_span_processor.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package observ // import "go.opentelemetry.io/otel/sdk/trace/internal/observ" +package observ import ( "context" @@ -13,8 +13,8 @@ import ( "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/sdk" "go.opentelemetry.io/otel/sdk/internal/x" - semconv "go.opentelemetry.io/otel/semconv/v1.41.0" - "go.opentelemetry.io/otel/semconv/v1.41.0/otelconv" + semconv "go.opentelemetry.io/otel/semconv/v1.43.0" + "go.opentelemetry.io/otel/semconv/v1.43.0/otelconv" ) const ( @@ -47,6 +47,8 @@ type BSP struct { processedQueueFullOpts []metric.AddOption } +// NewBSP creates new instrumentation for a BatchSpanProcessor. +// It returns nil if observability is not enabled. func NewBSP(id int64, qLen func() int64, qMax int64) (*BSP, error) { if !x.Observability.Enabled() { return nil, nil @@ -108,12 +110,16 @@ func NewBSP(id int64, qLen func() int64, qMax int64) (*BSP, error) { }, err } +// Shutdown unregisters the callbacks registered by NewBSP. func (b *BSP) Shutdown() error { return b.reg.Unregister() } +// Processed records n spans as having finished processing successfully. func (b *BSP) Processed(ctx context.Context, n int64) { b.processed.Add(ctx, n, b.processedOpts...) } +// ProcessedQueueFull records n spans as having finished processing with a +// queue-full error. func (b *BSP) ProcessedQueueFull(ctx context.Context, n int64) { b.processed.Add(ctx, n, b.processedQueueFullOpts...) } diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/internal/observ/doc.go b/vendor/go.opentelemetry.io/otel/sdk/trace/internal/observ/doc.go index b542121e6a2..64fd5238d04 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/trace/internal/observ/doc.go +++ b/vendor/go.opentelemetry.io/otel/sdk/trace/internal/observ/doc.go @@ -3,4 +3,4 @@ // Package observ provides observability instrumentation for the OTel trace SDK // package. -package observ // import "go.opentelemetry.io/otel/sdk/trace/internal/observ" +package observ diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/internal/observ/simple_span_processor.go b/vendor/go.opentelemetry.io/otel/sdk/trace/internal/observ/simple_span_processor.go index cf4b5d481fc..e7ca1a6d973 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/trace/internal/observ/simple_span_processor.go +++ b/vendor/go.opentelemetry.io/otel/sdk/trace/internal/observ/simple_span_processor.go @@ -1,38 +1,25 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package observ // import "go.opentelemetry.io/otel/sdk/trace/internal/observ" +package observ import ( "context" "fmt" - "sync" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/sdk" "go.opentelemetry.io/otel/sdk/internal/x" - semconv "go.opentelemetry.io/otel/semconv/v1.41.0" - "go.opentelemetry.io/otel/semconv/v1.41.0/otelconv" + semconv "go.opentelemetry.io/otel/semconv/v1.43.0" + "go.opentelemetry.io/otel/semconv/v1.43.0/otelconv" ) -var measureAttrsPool = sync.Pool{ - New: func() any { - // "component.name" + "component.type" + "error.type" - const n = 1 + 1 + 1 - s := make([]attribute.KeyValue, 0, n) - // Return a pointer to a slice instead of a slice itself - // to avoid allocations on every call. - return &s - }, -} - // SSP is the instrumentation for an OTel SDK SimpleSpanProcessor. type SSP struct { spansProcessedCounter metric.Int64Counter addOpts []metric.AddOption - attrs []attribute.KeyValue } // SSPComponentName returns the component name attribute for a @@ -70,29 +57,12 @@ func NewSSP(id int64) (*SSP, error) { return &SSP{ spansProcessedCounter: spansProcessedCounter.Inst(), addOpts: addOpts, - attrs: attrs, }, err } -// SpanProcessed records that a span has been processed by the SimpleSpanProcessor. -// If err is non-nil, it records the processing error as an attribute. -func (ssp *SSP) SpanProcessed(ctx context.Context, err error) { - ssp.spansProcessedCounter.Add(ctx, 1, ssp.addOption(err)...) -} - -func (ssp *SSP) addOption(err error) []metric.AddOption { - if err == nil { - return ssp.addOpts - } - attrs := measureAttrsPool.Get().(*[]attribute.KeyValue) - defer func() { - clear(*attrs) - *attrs = (*attrs)[:0] // reset the slice for reuse - measureAttrsPool.Put(attrs) - }() - *attrs = append(*attrs, ssp.attrs...) - *attrs = append(*attrs, semconv.ErrorType(err)) - // Do not inefficiently make a copy of attrs by using - // WithAttributes instead of WithAttributeSet. - return []metric.AddOption{metric.WithAttributeSet(attribute.NewSet(*attrs...))} +// SpanProcessed records that a span has been submitted to the exporter by the +// SimpleSpanProcessor. Per the semantic conventions, this count is recorded at +// submission time and MUST NOT be affected by the export outcome. +func (ssp *SSP) SpanProcessed(ctx context.Context) { + ssp.spansProcessedCounter.Add(ctx, 1, ssp.addOpts...) } diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/internal/observ/tracer.go b/vendor/go.opentelemetry.io/otel/sdk/trace/internal/observ/tracer.go index 5aae89e883c..16fad3c43df 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/trace/internal/observ/tracer.go +++ b/vendor/go.opentelemetry.io/otel/sdk/trace/internal/observ/tracer.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package observ // import "go.opentelemetry.io/otel/sdk/trace/internal/observ" +package observ import ( "context" @@ -13,7 +13,7 @@ import ( "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/sdk" "go.opentelemetry.io/otel/sdk/internal/x" - "go.opentelemetry.io/otel/semconv/v1.41.0/otelconv" + "go.opentelemetry.io/otel/semconv/v1.43.0/otelconv" "go.opentelemetry.io/otel/trace" ) @@ -30,6 +30,8 @@ type Tracer struct { started metric.Int64Counter } +// NewTracer creates new instrumentation for a Tracer. +// It returns an empty, disabled Tracer if observability is not enabled. func NewTracer() (Tracer, error) { if !x.Observability.Enabled() { return Tracer{}, nil @@ -52,8 +54,11 @@ func NewTracer() (Tracer, error) { return Tracer{enabled: true, live: l.Inst(), started: s.Inst()}, err } +// Enabled returns whether observability is enabled for t. func (t Tracer) Enabled() bool { return t.enabled } +// SpanStarted records the start of span, which was created with psc as its +// parent span context. func (t Tracer) SpanStarted(ctx context.Context, psc trace.SpanContext, span trace.Span) { if !t.started.Enabled(ctx) { return @@ -84,10 +89,12 @@ func (t Tracer) SpanStarted(ctx context.Context, psc trace.SpanContext, span tra t.started.Add(ctx, 1, opts...) } +// SpanLive records span as a live span. func (t Tracer) SpanLive(ctx context.Context, span trace.Span) { t.spanLive(ctx, 1, span) } +// SpanEnded records span as no longer being live. func (t Tracer) SpanEnded(ctx context.Context, span trace.Span) { t.spanLive(ctx, -1, span) } diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/link.go b/vendor/go.opentelemetry.io/otel/sdk/trace/link.go index c03bdc90f68..d4a07a714be 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/trace/link.go +++ b/vendor/go.opentelemetry.io/otel/sdk/trace/link.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package trace // import "go.opentelemetry.io/otel/sdk/trace" +package trace import ( "go.opentelemetry.io/otel/attribute" diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/provider.go b/vendor/go.opentelemetry.io/otel/sdk/trace/provider.go index 9d90c2eda5a..ce615a1b02f 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/trace/provider.go +++ b/vendor/go.opentelemetry.io/otel/sdk/trace/provider.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package trace // import "go.opentelemetry.io/otel/sdk/trace" +package trace import ( "context" @@ -13,6 +13,7 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/internal/global" "go.opentelemetry.io/otel/sdk/instrumentation" + "go.opentelemetry.io/otel/sdk/internal/attrnorm" "go.opentelemetry.io/otel/sdk/resource" "go.opentelemetry.io/otel/sdk/trace/internal/observ" "go.opentelemetry.io/otel/trace" @@ -42,22 +43,27 @@ type tracerProviderConfig struct { // resource contains attributes representing an entity that produces telemetry. resource *resource.Resource + + // panicRecordingDisabled disables recording exception events from panics. + panicRecordingDisabled bool } // MarshalLog is the marshaling function used by the logging system to represent this Provider. func (cfg tracerProviderConfig) MarshalLog() any { return struct { - SpanProcessors []SpanProcessor - SamplerType string - IDGeneratorType string - SpanLimits SpanLimits - Resource *resource.Resource + SpanProcessors []SpanProcessor + SamplerType string + IDGeneratorType string + SpanLimits SpanLimits + Resource *resource.Resource + PanicRecordingDisabled bool }{ - SpanProcessors: cfg.processors, - SamplerType: fmt.Sprintf("%T", cfg.sampler), - IDGeneratorType: fmt.Sprintf("%T", cfg.idGenerator), - SpanLimits: cfg.spanLimits, - Resource: cfg.resource, + SpanProcessors: cfg.processors, + SamplerType: fmt.Sprintf("%T", cfg.sampler), + IDGeneratorType: fmt.Sprintf("%T", cfg.idGenerator), + SpanLimits: cfg.spanLimits, + Resource: cfg.resource, + PanicRecordingDisabled: cfg.panicRecordingDisabled, } } @@ -74,10 +80,11 @@ type TracerProvider struct { // These fields are not protected by the lock mu. They are assumed to be // immutable after creation of the TracerProvider. - sampler Sampler - idGenerator IDGenerator - spanLimits SpanLimits - resource *resource.Resource + sampler Sampler + idGenerator IDGenerator + spanLimits SpanLimits + resource *resource.Resource + panicRecordingDisabled bool } var _ trace.TracerProvider = &TracerProvider{} @@ -112,11 +119,12 @@ func NewTracerProvider(opts ...TracerProviderOption) *TracerProvider { o = ensureValidTracerProviderConfig(o) tp := &TracerProvider{ - namedTracer: make(map[instrumentation.Scope]*tracer), - sampler: o.sampler, - idGenerator: o.idGenerator, - spanLimits: o.spanLimits, - resource: o.resource, + namedTracer: make(map[instrumentation.Scope]*tracer), + sampler: o.sampler, + idGenerator: o.idGenerator, + spanLimits: o.spanLimits, + resource: o.resource, + panicRecordingDisabled: o.panicRecordingDisabled, } global.Info("TracerProvider created", "config", o) @@ -142,6 +150,10 @@ func (p *TracerProvider) Tracer(name string, opts ...trace.TracerOption) trace.T return noop.NewTracerProvider().Tracer(name, opts...) } c := trace.NewTracerConfig(opts...) + attrs, _, _ := attrnorm.SetDedupLimitDepth( + c.InstrumentationAttributes(), + p.spanLimits.AttributeValueDepthLimit, + ) if name == "" { name = defaultTracerName } @@ -149,7 +161,7 @@ func (p *TracerProvider) Tracer(name string, opts ...trace.TracerOption) trace.T Name: name, Version: c.InstrumentationVersion(), SchemaURL: c.SchemaURL(), - Attributes: c.InstrumentationAttributes(), + Attributes: attrs, } t, ok := func() (trace.Tracer, bool) { @@ -246,13 +258,14 @@ func (p *TracerProvider) UnregisterSpanProcessor(sp SpanProcessor) { idx = i } } - if stopOnce != nil { - stopOnce.state.Do(func() { - if err := sp.Shutdown(context.Background()); err != nil { - otel.Handle(err) - } - }) + if stopOnce == nil { + return } + stopOnce.state.Do(func() { + if err := sp.Shutdown(context.Background()); err != nil { + otel.Handle(err) + } + }) if len(spss) > 1 { copy(spss[idx:], spss[idx+1:]) } @@ -357,6 +370,16 @@ func WithSpanProcessor(sp SpanProcessor) TracerProviderOption { }) } +// WithoutPanicRecording configures the TracerProvider to not record exception +// events when a Span is ended while panicking. The panic continues to +// propagate, and the span is ended without adding the event. +func WithoutPanicRecording() TracerProviderOption { + return traceProviderOptionFunc(func(cfg tracerProviderConfig) tracerProviderConfig { + cfg.panicRecordingDisabled = true + return cfg + }) +} + // WithResource returns a TracerProviderOption that will configure the // Resource r as a TracerProvider's Resource. The configured Resource is // referenced by all the Tracers the TracerProvider creates. It represents the @@ -410,6 +433,29 @@ func WithSampler(s Sampler) TracerProviderOption { }) } +// WithAttributeValueDepthLimit sets the maximum allowed depth for attribute +// values. Depth starts at one for the top-level value and increments when +// descending into an array element or map value. An array or map beyond this +// depth is replaced by an empty value. +// +// This limit applies to span, event, link, and instrumentation scope +// attributes processed by this TracerProvider. It does not apply to Resource +// attributes. +// +// Setting this to zero means the default limit of 64 is used. Setting this to +// a negative value means no limit is applied. +// +// There is no environment variable for this limit. +func WithAttributeValueDepthLimit(limit int) TracerProviderOption { + if limit == 0 { + limit = DefaultAttributeValueDepthLimit + } + return traceProviderOptionFunc(func(cfg tracerProviderConfig) tracerProviderConfig { + cfg.spanLimits.AttributeValueDepthLimit = limit + return cfg + }) +} + // WithSpanLimits returns a TracerProviderOption that configures a // TracerProvider to use the SpanLimits sl. These SpanLimits bound any Span // created by a Tracer from the TracerProvider. @@ -429,6 +475,9 @@ func WithSpanLimits(sl SpanLimits) TracerProviderOption { if sl.AttributeValueLengthLimit <= 0 { sl.AttributeValueLengthLimit = DefaultAttributeValueLengthLimit } + if sl.AttributeValueDepthLimit <= 0 { + sl.AttributeValueDepthLimit = DefaultAttributeValueDepthLimit + } if sl.AttributeCountLimit <= 0 { sl.AttributeCountLimit = DefaultAttributeCountLimit } @@ -454,13 +503,14 @@ func WithSpanLimits(sl SpanLimits) TracerProviderOption { // TracerProvider to use these limits. These limits bound any Span created by // a Tracer from the TracerProvider. // -// The limits will be used as-is. Zero or negative values will not be changed -// to the default value like WithSpanLimits does. Setting a limit to zero will -// effectively disable the related resource it limits and setting to a -// negative value will mean that resource is unlimited. Consequentially, this -// means that the zero-value SpanLimits will disable all span resources. -// Because of this, limits should be constructed using NewSpanLimits and -// updated accordingly. +// The limits will be used as-is, except that an AttributeValueDepthLimit of +// zero means the default limit is used. Other zero or negative values will not +// be changed to the default value like WithSpanLimits does. Setting a limit to +// zero will effectively disable the related resource it limits and setting to +// a negative value will mean that resource is unlimited. Consequentially, the +// zero-value SpanLimits will disable all span resources except the attribute +// value depth limit. Because of this, limits should be constructed using +// NewSpanLimits and updated accordingly. // // If this or WithSpanLimits are not provided, the TracerProvider will use the // limits defined by environment variables, or the defaults if unset. Refer to @@ -506,5 +556,8 @@ func ensureValidTracerProviderConfig(cfg tracerProviderConfig) tracerProviderCon if cfg.resource == nil { cfg.resource = resource.Default() } + if cfg.spanLimits.AttributeValueDepthLimit == 0 { + cfg.spanLimits.AttributeValueDepthLimit = DefaultAttributeValueDepthLimit + } return cfg } diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/sampler_env.go b/vendor/go.opentelemetry.io/otel/sdk/trace/sampler_env.go index 9b672a1d70d..76cca5cd5bf 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/trace/sampler_env.go +++ b/vendor/go.opentelemetry.io/otel/sdk/trace/sampler_env.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package trace // import "go.opentelemetry.io/otel/sdk/trace" +package trace import ( "errors" @@ -46,14 +46,13 @@ func (e samplerArgParseError) Unwrap() error { } func samplerFromEnv() (Sampler, error) { - sampler, ok := os.LookupEnv(tracesSamplerKey) - if !ok { + sampler := strings.ToLower(strings.TrimSpace(os.Getenv(tracesSamplerKey))) + if sampler == "" { return nil, nil } - sampler = strings.ToLower(strings.TrimSpace(sampler)) - samplerArg, hasSamplerArg := os.LookupEnv(tracesSamplerArgKey) - samplerArg = strings.TrimSpace(samplerArg) + samplerArg := strings.TrimSpace(os.Getenv(tracesSamplerArgKey)) + hasSamplerArg := samplerArg != "" switch sampler { case samplerAlwaysOn: diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/sampling.go b/vendor/go.opentelemetry.io/otel/sdk/trace/sampling.go index 5a4c74318b8..c79177ae8d5 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/trace/sampling.go +++ b/vendor/go.opentelemetry.io/otel/sdk/trace/sampling.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package trace // import "go.opentelemetry.io/otel/sdk/trace" +package trace import ( "context" diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/simple_span_processor.go b/vendor/go.opentelemetry.io/otel/sdk/trace/simple_span_processor.go index 771e427a4c5..1e6be124862 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/trace/simple_span_processor.go +++ b/vendor/go.opentelemetry.io/otel/sdk/trace/simple_span_processor.go @@ -1,10 +1,11 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package trace // import "go.opentelemetry.io/otel/sdk/trace" +package trace import ( "context" + "fmt" "sync" "sync/atomic" @@ -66,19 +67,19 @@ func (ssp *simpleSpanProcessor) OnEnd(s ReadOnlySpan) { ssp.exporterMu.Lock() defer ssp.exporterMu.Unlock() - var err error - if ssp.exporter != nil && s.SpanContext().TraceFlags().IsSampled() { - err = ssp.exporter.ExportSpans(context.Background(), []ReadOnlySpan{s}) - if err != nil { - otel.Handle(err) - } - } - if ssp.inst != nil { // Add the span to the context to ensure the metric is recorded - // with the correct span context. + // with the correct span context. Record the span as processed before + // invoking the exporter so the count is unaffected by the export + // outcome. ctx := trace.ContextWithSpanContext(context.Background(), s.SpanContext()) - ssp.inst.SpanProcessed(ctx, err) + ssp.inst.SpanProcessed(ctx) + } + + if ssp.exporter != nil && s.SpanContext().TraceFlags().IsSampled() { + if err := ssp.exporter.ExportSpans(context.Background(), []ReadOnlySpan{s}); err != nil { + otel.Handle(err) + } } } @@ -103,10 +104,15 @@ func (ssp *simpleSpanProcessor) Shutdown(ctx context.Context) error { // span would need to be exported. Meaning, OnEnd would be called and // try acquiring the lock that is held here. ssp.exporterMu.Lock() - done, shutdown := stopFunc(ssp.exporter) + exp := ssp.exporter ssp.exporter = nil ssp.exporterMu.Unlock() + if exp == nil { + return + } + + done, shutdown := stopFunc(exp) go shutdown() // Wait for the exporter to shut down or the deadline to expire. @@ -140,11 +146,18 @@ func (*simpleSpanProcessor) ForceFlush(context.Context) error { // MarshalLog is the marshaling function used by the logging system to represent // this Span Processor. func (ssp *simpleSpanProcessor) MarshalLog() any { + // Shutdown clears exporter under exporterMu. + // Copy it while holding the same lock so MarshalLog + // can run concurrently without racing with Shutdown. + ssp.exporterMu.Lock() + exp := ssp.exporter + ssp.exporterMu.Unlock() + return struct { Type string - Exporter SpanExporter + Exporter string }{ Type: "SimpleSpanProcessor", - Exporter: ssp.exporter, + Exporter: fmt.Sprintf("%T", exp), } } diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/snapshot.go b/vendor/go.opentelemetry.io/otel/sdk/trace/snapshot.go index 63aa337800c..6e0c06be5ea 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/trace/snapshot.go +++ b/vendor/go.opentelemetry.io/otel/sdk/trace/snapshot.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package trace // import "go.opentelemetry.io/otel/sdk/trace" +package trace import ( "time" @@ -12,7 +12,7 @@ import ( "go.opentelemetry.io/otel/trace" ) -// snapshot is an record of a spans state at a particular checkpointed time. +// snapshot is a record of a span's state at a particular checkpointed time. // It is used as a read-only representation of that state. type snapshot struct { name string diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/span.go b/vendor/go.opentelemetry.io/otel/sdk/trace/span.go index d1d9af29d79..05920ab8722 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/trace/span.go +++ b/vendor/go.opentelemetry.io/otel/sdk/trace/span.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package trace // import "go.opentelemetry.io/otel/sdk/trace" +package trace import ( "context" @@ -10,17 +10,16 @@ import ( "runtime" rt "runtime/trace" "slices" - "strings" "sync" "time" - "unicode/utf8" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/internal/global" "go.opentelemetry.io/otel/sdk/instrumentation" + "go.opentelemetry.io/otel/sdk/internal/attrnorm" "go.opentelemetry.io/otel/sdk/resource" - semconv "go.opentelemetry.io/otel/semconv/v1.41.0" + semconv "go.opentelemetry.io/otel/semconv/v1.43.0" "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/otel/trace/embedded" ) @@ -139,6 +138,11 @@ type recordingSpan struct { attributes []attribute.KeyValue droppedAttributes int logDropAttrsOnce sync.Once + // attributesDirty indicates attributes may contain duplicate keys. + attributesDirty bool + // attributesShared indicates the attributes backing array has been exposed + // to a reader and must not be modified. + attributesShared bool // events are stored in FIFO queue capped by configured limit. events evictedQueue[Event] @@ -252,6 +256,11 @@ func (s *recordingSpan) SetAttributes(attributes ...attribute.KeyValue) { s.addDroppedAttr(len(attributes)) return } + maxCap := len(s.attributes) + len(attributes) + if limit > 0 { + maxCap = min(maxCap, limit) + } + s.ensureAttrsWritable(maxCap) // If adding these attributes could exceed the capacity of s perform a // de-duplication and truncation while adding to avoid over allocation. @@ -269,9 +278,27 @@ func (s *recordingSpan) SetAttributes(attributes ...attribute.KeyValue) { s.addDroppedAttr(1) continue } - a = truncateAttr(s.tracer.provider.spanLimits.AttributeValueLengthLimit, a) + a = normAttr( + a, + s.tracer.provider.spanLimits.AttributeValueDepthLimit, + s.tracer.provider.spanLimits.AttributeValueLengthLimit, + ) s.attributes = append(s.attributes, a) + s.attributesDirty = true + } +} + +// ensureAttrsWritable copies shared attributes into a backing array with at +// least capacity. This method assumes s.mu.Lock is held by the caller. +func (s *recordingSpan) ensureAttrsWritable(capacity int) { + if !s.attributesShared { + return } + capacity = max(capacity, len(s.attributes)) + attrs := make([]attribute.KeyValue, len(s.attributes), capacity) + copy(attrs, s.attributes) + s.attributes = attrs + s.attributesShared = false } // Declared as a var so tests can override. @@ -329,7 +356,11 @@ func (s *recordingSpan) addOverCapAttrs(limit int, attrs []attribute.KeyValue) { if idx, ok := exists[a.Key]; ok { // Perform all updates before dropping, even when at capacity. - a = truncateAttr(s.tracer.provider.spanLimits.AttributeValueLengthLimit, a) + a = normAttr( + a, + s.tracer.provider.spanLimits.AttributeValueDepthLimit, + s.tracer.provider.spanLimits.AttributeValueLengthLimit, + ) s.attributes[idx] = a continue } @@ -339,208 +370,36 @@ func (s *recordingSpan) addOverCapAttrs(limit int, attrs []attribute.KeyValue) { // updates are checked and performed. s.addDroppedAttr(1) } else { - a = truncateAttr(s.tracer.provider.spanLimits.AttributeValueLengthLimit, a) + a = normAttr( + a, + s.tracer.provider.spanLimits.AttributeValueDepthLimit, + s.tracer.provider.spanLimits.AttributeValueLengthLimit, + ) s.attributes = append(s.attributes, a) exists[a.Key] = len(s.attributes) - 1 } } } -// truncateAttr returns a truncated version of attr. Only string, string -// slice, byte slice, and slice attribute values are truncated. String values are truncated -// to at most a length of limit. Each string slice value is truncated in this -// fashion (the slice length itself is unaffected), and byte slice values are truncated to at most -// limit bytes. For slice attribute values, the limit is applied to each -// element recursively. -// -// No truncation is performed for a negative limit. -func truncateAttr(limit int, attr attribute.KeyValue) attribute.KeyValue { - if limit < 0 { - return attr - } +func normAttr(attr attribute.KeyValue, depthLimit, lengthLimit int) attribute.KeyValue { switch attr.Value.Type() { - case attribute.STRING: - v := attr.Value.AsString() - return attr.Key.String(truncate(limit, v)) - case attribute.STRINGSLICE: - v := attr.Value.AsStringSlice() - for i := range v { - v[i] = truncate(limit, v[i]) - } - return attr.Key.StringSlice(v) - case attribute.BYTESLICE: - v := attr.Value.AsString() - if len(v) > limit { - return attr.Key.ByteSlice([]byte(v[:limit])) - } - return attr - case attribute.SLICE: - v := attr.Value.AsSlice() - if !slices.ContainsFunc(v, func(e attribute.Value) bool { return needsTruncation(limit, e) }) { - return attr - } - newV := make([]attribute.Value, len(v)) - for i, elem := range v { - newV[i] = truncateValue(limit, elem) - } - return attr.Key.Slice(newV...) - } - return attr -} - -// truncateValue returns a truncated version of v. Only string, string slice, -// byte slice, and (recursively) slice values are modified. -// -// No truncation is performed for a negative limit. -func truncateValue(limit int, v attribute.Value) attribute.Value { - switch v.Type() { - case attribute.STRING: - return attribute.StringValue(truncate(limit, v.AsString())) - case attribute.STRINGSLICE: - ss := v.AsStringSlice() - for i := range ss { - ss[i] = truncate(limit, ss[i]) - } - return attribute.StringSliceValue(ss) - - case attribute.BYTESLICE: - // len(v.AsString()) is identical to len(v.AsByteSlice()) but - // avoids allocating the full slice before truncation. - s := v.AsString() - if limit >= 0 && len(s) > limit { - return attribute.ByteSliceValue([]byte(s[:limit])) - } - case attribute.SLICE: - sl := v.AsSlice() - if !slices.ContainsFunc(sl, func(e attribute.Value) bool { return needsTruncation(limit, e) }) { - return v - } - newSl := make([]attribute.Value, len(sl)) - for i, elem := range sl { - newSl[i] = truncateValue(limit, elem) - } - return attribute.SliceValue(newSl...) - } - return v -} - -// stringNeedsTruncation reports whether s would be modified by truncate for the -// given limit. -func stringNeedsTruncation(limit int, s string) bool { - if limit < 0 || len(s) <= limit { - return false - } - return utf8.RuneCountInString(s) > limit || !utf8.ValidString(s) -} - -// needsTruncation reports whether v would be modified by truncateValue for the -// given limit. -func needsTruncation(limit int, v attribute.Value) bool { - switch v.Type() { - case attribute.STRING: - return stringNeedsTruncation(limit, v.AsString()) - case attribute.BYTESLICE: - // len(v.AsString()) is identical to len(v.AsByteSlice()) but - // avoids memory allocation. - if limit >= 0 && len(v.AsString()) > limit { - return true - } - case attribute.STRINGSLICE: - for _, s := range v.AsStringSlice() { - if stringNeedsTruncation(limit, s) { - return true - } - } - case attribute.SLICE: - return slices.ContainsFunc(v.AsSlice(), func(e attribute.Value) bool { return needsTruncation(limit, e) }) - } - return false -} - -// truncate returns a truncated version of s such that it contains less than -// the limit number of characters. Truncation is applied by returning the limit -// number of valid characters contained in s. -// -// If limit is negative, it returns the original string. -// -// UTF-8 is supported. When truncating, all invalid characters are dropped -// before applying truncation. -// -// If s already contains less than the limit number of bytes, it is returned -// unchanged. No invalid characters are removed. -func truncate(limit int, s string) string { - // This prioritize performance in the following order based on the most - // common expected use-cases. - // - // - Short values less than the default limit (128). - // - Strings with valid encodings that exceed the limit. - // - No limit. - // - Strings with invalid encodings that exceed the limit. - if limit < 0 || len(s) <= limit { - return s - } - - // Optimistically, assume all valid UTF-8. - var b strings.Builder - count := 0 - for i, c := range s { - if c != utf8.RuneError { - count++ - if count > limit { - return s[:i] - } - continue - } - - _, size := utf8.DecodeRuneInString(s[i:]) - if size == 1 { - // Invalid encoding. - b.Grow(len(s) - 1) - _, _ = b.WriteString(s[:i]) - s = s[i:] - break - } - } - - // Fast-path, no invalid input. - if b.Cap() == 0 { - return s - } - - // Truncate while validating UTF-8. - for i := 0; i < len(s) && count < limit; { - c := s[i] - if c < utf8.RuneSelf { - // Optimization for single byte runes (common case). - _ = b.WriteByte(c) - i++ - count++ - continue - } - - _, size := utf8.DecodeRuneInString(s[i:]) - if size == 1 { - // We checked for all 1-byte runes above, this is a RuneError. - i++ - continue + case attribute.SLICE, attribute.MAP: + if depthLimit < 0 { + attr, _ = attrnorm.KeyValueDedup(attr) + } else { + attr, _, _ = attrnorm.KeyValueDedupLimitDepth(attr, depthLimit) } - - _, _ = b.WriteString(s[i : i+size]) - i += size - count++ } - - return b.String() + return attrnorm.Truncate(lengthLimit, attr) } // End ends the span. This method does nothing if the span is already ended or // is not being recorded. // -// The only SpanEndOption currently supported are [trace.WithTimestamp], and -// [trace.WithStackTrace]. -// -// If this method is called while panicking an error event is added to the -// Span before ending it and the panic is continued. +// The only supported SpanEndOptions are [trace.WithTimestamp] and [trace.WithStackTrace]. +// If this method is called while panicking and panic recording is not disabled +// on the TracerProvider, an error event is added to the Span before ending it +// and the panic is continued. func (s *recordingSpan) End(options ...trace.SpanEndOption) { // Do not start by checking if the span is being recorded which requires // acquiring a lock. Make a minimal check that the span is not nil. @@ -560,23 +419,25 @@ func (s *recordingSpan) End(options ...trace.SpanEndOption) { } config := trace.NewSpanEndConfig(options...) - if recovered := recover(); recovered != nil { - // Record but don't stop the panic. - defer panic(recovered) - opts := []trace.EventOption{ - trace.WithAttributes( - semconv.ExceptionType(typeStr(recovered)), - semconv.ExceptionMessage(fmt.Sprint(recovered)), - ), - } + if !s.tracer.provider.panicRecordingDisabled { + if recovered := recover(); recovered != nil { + // Record but don't stop the panic. + defer panic(recovered) + opts := []trace.EventOption{ + trace.WithAttributes( + semconv.ExceptionType(typeStr(recovered)), + semconv.ExceptionMessage(fmt.Sprint(recovered)), + ), + } - if config.StackTrace() { - opts = append(opts, trace.WithAttributes( - semconv.ExceptionStacktrace(recordStackTrace()), - )) - } + if config.StackTrace() { + opts = append(opts, trace.WithAttributes( + semconv.ExceptionStacktrace(recordStackTrace()), + )) + } - s.addEvent(semconv.ExceptionEventName, opts...) + s.addEvent(semconv.ExceptionEventName, opts...) + } } if s.executionTracerTaskEnd != nil { @@ -633,9 +494,7 @@ func (s *recordingSpan) RecordError(err error, opts ...trace.EventOption) { return } - s.mu.Lock() - defer s.mu.Unlock() - if !s.isRecording() { + if !s.IsRecording() { return } @@ -651,7 +510,7 @@ func (s *recordingSpan) RecordError(err error, opts ...trace.EventOption) { )) } - s.addEvent(semconv.ExceptionEventName, opts...) + s.AddEvent(semconv.ExceptionEventName, opts...) } func typeStr(i any) string { @@ -690,7 +549,11 @@ func (s *recordingSpan) AddEvent(name string, o ...trace.EventOption) { // This method assumes s.mu.Lock is held by the caller. func (s *recordingSpan) addEvent(name string, o ...trace.EventOption) { c := trace.NewEventConfig(o...) - e := Event{Name: name, Attributes: c.Attributes(), Time: c.Timestamp()} + attrs, _, _ := attrnorm.KeyValuesDedupLimitDepth( + c.Attributes(), + s.tracer.provider.spanLimits.AttributeValueDepthLimit, + ) + e := Event{Name: name, Attributes: attrs, Time: c.Timestamp()} // Discard attributes over limit. limit := s.tracer.provider.spanLimits.AttributePerEventCountLimit @@ -729,7 +592,7 @@ func (s *recordingSpan) Name() string { return s.name } -// Name returns the SpanContext of this span's parent span. +// Parent returns the SpanContext of this span's parent span. func (s *recordingSpan) Parent() trace.SpanContext { s.mu.Lock() defer s.mu.Unlock() @@ -765,6 +628,7 @@ func (s *recordingSpan) Attributes() []attribute.KeyValue { s.mu.Lock() defer s.mu.Unlock() s.dedupeAttrs() + s.attributesShared = cap(s.attributes) > 0 return s.attributes } @@ -772,6 +636,10 @@ func (s *recordingSpan) Attributes() []attribute.KeyValue { // // This method assumes s.mu.Lock is held by the caller. func (s *recordingSpan) dedupeAttrs() { + if !s.attributesDirty { + return + } + s.ensureAttrsWritable(len(s.attributes)) // Do not set a capacity when creating this map. Benchmark testing has // showed this to only add unused memory allocations in general use. exists := make(map[attribute.Key]int, len(s.attributes)) @@ -795,6 +663,7 @@ func (s *recordingSpan) dedupeAttrsFromRecord(record map[attribute.Key]int) { } clear(s.attributes[len(unique):]) // Erase unneeded elements to let GC collect objects. s.attributes = unique + s.attributesDirty = false } // Links returns the links of this span. @@ -863,7 +732,11 @@ func (s *recordingSpan) AddLink(link trace.Link) { return } - l := Link{SpanContext: link.SpanContext, Attributes: link.Attributes} + attrs, _, _ := attrnorm.KeyValuesDedupLimitDepth( + link.Attributes, + s.tracer.provider.spanLimits.AttributeValueDepthLimit, + ) + l := Link{SpanContext: link.SpanContext, Attributes: attrs} // Discard attributes over limit. limit := s.tracer.provider.spanLimits.AttributePerLinkCountLimit @@ -937,6 +810,7 @@ func (s *recordingSpan) snapshot() ReadOnlySpan { if len(s.attributes) > 0 { s.dedupeAttrs() sd.attributes = s.attributes + s.attributesShared = true } sd.droppedAttributeCount = s.droppedAttributes if len(s.events.queue) > 0 { diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/span_exporter.go b/vendor/go.opentelemetry.io/otel/sdk/trace/span_exporter.go index 6bdda3d94a4..fad839a24e4 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/trace/span_exporter.go +++ b/vendor/go.opentelemetry.io/otel/sdk/trace/span_exporter.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package trace // import "go.opentelemetry.io/otel/sdk/trace" +package trace import "context" diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/span_limits.go b/vendor/go.opentelemetry.io/otel/sdk/trace/span_limits.go index 348ee0e808b..3069e22692d 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/trace/span_limits.go +++ b/vendor/go.opentelemetry.io/otel/sdk/trace/span_limits.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package trace // import "go.opentelemetry.io/otel/sdk/trace" +package trace import "go.opentelemetry.io/otel/sdk/trace/internal/env" @@ -10,6 +10,10 @@ const ( // attribute value length, unlimited. DefaultAttributeValueLengthLimit = -1 + // DefaultAttributeValueDepthLimit is the default maximum allowed depth for + // nested attribute values. + DefaultAttributeValueDepthLimit = 64 + // DefaultAttributeCountLimit is the default maximum number of attributes // a span can have. DefaultAttributeCountLimit = 128 @@ -35,14 +39,28 @@ const ( type SpanLimits struct { // AttributeValueLengthLimit is the maximum allowed attribute value length. // - // This limit only applies to string, string slice, byte slice, and slice attribute - // values. Any string and byte slice longer than this value will be truncated to this - // length. For slice attribute values, the limit is applied to each string and byte slice - // element recursively. + // This limit only applies to string, string slice, byte slice, slice, and + // map attribute values. Any string and byte slice longer than this value + // will be truncated to this length. For slice and map attribute values, + // the limit is applied recursively to contained values. // // Setting this to a negative value means no limit is applied. AttributeValueLengthLimit int + // AttributeValueDepthLimit is the maximum allowed depth for an attribute + // value. Depth starts at one for the top-level value and increments when + // descending into an array element or map value. An array or map beyond this + // depth is replaced by an empty value. + // + // This limit applies to span, event, link, and instrumentation scope + // attributes processed by a TracerProvider. It does not apply to Resource + // attributes. + // + // Setting this to zero means the default limit is used. + // + // Setting this to a negative value means no limit is applied. + AttributeValueDepthLimit int + // AttributeCountLimit is the maximum allowed span attribute count. Any // attribute added to a span once this limit is reached will be dropped. // @@ -88,12 +106,15 @@ type SpanLimits struct { AttributePerLinkCountLimit int } -// NewSpanLimits returns a SpanLimits with all limits set to the value their -// corresponding environment variable holds, or the default if unset. +// NewSpanLimits returns a SpanLimits with all limits set to their default. +// Limits with a corresponding environment variable are set from the +// environment when the variable is defined. // // • AttributeValueLengthLimit: OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT // (default: unlimited) // +// • AttributeValueDepthLimit: default 64 (no environment variable) +// // • AttributeCountLimit: OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT (default: 128) // // • EventCountLimit: OTEL_SPAN_EVENT_COUNT_LIMIT (default: 128) @@ -107,6 +128,7 @@ type SpanLimits struct { func NewSpanLimits() SpanLimits { return SpanLimits{ AttributeValueLengthLimit: env.SpanAttributeValueLength(DefaultAttributeValueLengthLimit), + AttributeValueDepthLimit: DefaultAttributeValueDepthLimit, AttributeCountLimit: env.SpanAttributeCount(DefaultAttributeCountLimit), EventCountLimit: env.SpanEventCount(DefaultEventCountLimit), LinkCountLimit: env.SpanLinkCount(DefaultLinkCountLimit), diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/span_processor.go b/vendor/go.opentelemetry.io/otel/sdk/trace/span_processor.go index af7f9177fc5..ffd093a2f7e 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/trace/span_processor.go +++ b/vendor/go.opentelemetry.io/otel/sdk/trace/span_processor.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package trace // import "go.opentelemetry.io/otel/sdk/trace" +package trace import ( "context" diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go b/vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go index e1d08fd4d8d..be576ffe088 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go +++ b/vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package trace // import "go.opentelemetry.io/otel/sdk/trace" +package trace import ( "context" diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/tracetest/exporter.go b/vendor/go.opentelemetry.io/otel/sdk/trace/tracetest/exporter.go index e12fa67e63b..4aa2d562fdd 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/trace/tracetest/exporter.go +++ b/vendor/go.opentelemetry.io/otel/sdk/trace/tracetest/exporter.go @@ -4,7 +4,7 @@ // Package tracetest is a testing helper package for the SDK. User can // configure no-op or in-memory exporters to verify different SDK behaviors or // custom instrumentation. -package tracetest // import "go.opentelemetry.io/otel/sdk/trace/tracetest" +package tracetest import ( "context" diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/tracetest/recorder.go b/vendor/go.opentelemetry.io/otel/sdk/trace/tracetest/recorder.go index ca63038f34e..11e3d5b3f61 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/trace/tracetest/recorder.go +++ b/vendor/go.opentelemetry.io/otel/sdk/trace/tracetest/recorder.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package tracetest // import "go.opentelemetry.io/otel/sdk/trace/tracetest" +package tracetest import ( "context" diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/tracetest/span.go b/vendor/go.opentelemetry.io/otel/sdk/trace/tracetest/span.go index 12b384b0884..6ee1b3f9854 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/trace/tracetest/span.go +++ b/vendor/go.opentelemetry.io/otel/sdk/trace/tracetest/span.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package tracetest // import "go.opentelemetry.io/otel/sdk/trace/tracetest" +package tracetest import ( "time" diff --git a/vendor/go.opentelemetry.io/otel/sdk/version.go b/vendor/go.opentelemetry.io/otel/sdk/version.go index 218dce1f562..2335ebdd761 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/version.go +++ b/vendor/go.opentelemetry.io/otel/sdk/version.go @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 // Package sdk provides the OpenTelemetry default SDK for Go. -package sdk // import "go.opentelemetry.io/otel/sdk" +package sdk // Version is the current release version of the OpenTelemetry SDK in use. func Version() string { - return "1.44.0" + return "1.47.0" } diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/rpcconv/metric.go b/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/rpcconv/metric.go new file mode 100644 index 00000000000..089b0c457fc --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/rpcconv/metric.go @@ -0,0 +1,1010 @@ +// Code generated from semantic convention specification. DO NOT EDIT. + +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Package rpcconv provides types and functionality for OpenTelemetry semantic +// conventions in the "rpc" namespace. +package rpcconv + +import ( + "context" + "sync" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/metric/noop" +) + +var ( + addOptPool = &sync.Pool{New: func() any { return &[]metric.AddOption{} }} + recOptPool = &sync.Pool{New: func() any { return &[]metric.RecordOption{} }} +) + +// ClientDuration is an instrument used to record metric values conforming to the +// "rpc.client.duration" semantic conventions. It represents the measures the +// duration of outbound RPC. +type ClientDuration struct { + metric.Float64Histogram +} + +var newClientDurationOpts = []metric.Float64HistogramOption{ + metric.WithDescription("Measures the duration of outbound RPC."), + metric.WithUnit("ms"), +} + +// NewClientDuration returns a new ClientDuration instrument. +func NewClientDuration( + m metric.Meter, + opt ...metric.Float64HistogramOption, +) (ClientDuration, error) { + // Check if the meter is nil. + if m == nil { + return ClientDuration{noop.Float64Histogram{}}, nil + } + + if len(opt) == 0 { + opt = newClientDurationOpts + } else { + opt = append(opt, newClientDurationOpts...) + } + + i, err := m.Float64Histogram( + "rpc.client.duration", + opt..., + ) + if err != nil { + return ClientDuration{noop.Float64Histogram{}}, err + } + return ClientDuration{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ClientDuration) Inst() metric.Float64Histogram { + return m.Float64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ClientDuration) Name() string { + return "rpc.client.duration" +} + +// Unit returns the semantic convention unit of the instrument +func (ClientDuration) Unit() string { + return "ms" +} + +// Description returns the semantic convention description of the instrument +func (ClientDuration) Description() string { + return "Measures the duration of outbound RPC." +} + +// Record records val to the current distribution for attrs. +// +// While streaming RPCs may record this metric as start-of-batch +// to end-of-batch, it's hard to interpret in practice. +// +// **Streaming**: N/A. +func (m ClientDuration) Record(ctx context.Context, val float64, attrs ...attribute.KeyValue) { + if len(attrs) == 0 { + m.Float64Histogram.Record(ctx, val) + return + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributes(attrs...)) + m.Float64Histogram.Record(ctx, val, *o...) +} + +// RecordSet records val to the current distribution for set. +// +// While streaming RPCs may record this metric as start-of-batch +// to end-of-batch, it's hard to interpret in practice. +// +// **Streaming**: N/A. +func (m ClientDuration) RecordSet(ctx context.Context, val float64, set attribute.Set) { + if set.Len() == 0 { + m.Float64Histogram.Record(ctx, val) + return + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributeSet(set)) + m.Float64Histogram.Record(ctx, val, *o...) +} + +// ClientRequestSize is an instrument used to record metric values conforming to +// the "rpc.client.request.size" semantic conventions. It represents the measures +// the size of RPC request messages (uncompressed). +type ClientRequestSize struct { + metric.Int64Histogram +} + +var newClientRequestSizeOpts = []metric.Int64HistogramOption{ + metric.WithDescription("Measures the size of RPC request messages (uncompressed)."), + metric.WithUnit("By"), +} + +// NewClientRequestSize returns a new ClientRequestSize instrument. +func NewClientRequestSize( + m metric.Meter, + opt ...metric.Int64HistogramOption, +) (ClientRequestSize, error) { + // Check if the meter is nil. + if m == nil { + return ClientRequestSize{noop.Int64Histogram{}}, nil + } + + if len(opt) == 0 { + opt = newClientRequestSizeOpts + } else { + opt = append(opt, newClientRequestSizeOpts...) + } + + i, err := m.Int64Histogram( + "rpc.client.request.size", + opt..., + ) + if err != nil { + return ClientRequestSize{noop.Int64Histogram{}}, err + } + return ClientRequestSize{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ClientRequestSize) Inst() metric.Int64Histogram { + return m.Int64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ClientRequestSize) Name() string { + return "rpc.client.request.size" +} + +// Unit returns the semantic convention unit of the instrument +func (ClientRequestSize) Unit() string { + return "By" +} + +// Description returns the semantic convention description of the instrument +func (ClientRequestSize) Description() string { + return "Measures the size of RPC request messages (uncompressed)." +} + +// Record records val to the current distribution for attrs. +// +// **Streaming**: Recorded per message in a streaming batch +func (m ClientRequestSize) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue) { + if len(attrs) == 0 { + m.Int64Histogram.Record(ctx, val) + return + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributes(attrs...)) + m.Int64Histogram.Record(ctx, val, *o...) +} + +// RecordSet records val to the current distribution for set. +// +// **Streaming**: Recorded per message in a streaming batch +func (m ClientRequestSize) RecordSet(ctx context.Context, val int64, set attribute.Set) { + if set.Len() == 0 { + m.Int64Histogram.Record(ctx, val) + return + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributeSet(set)) + m.Int64Histogram.Record(ctx, val, *o...) +} + +// ClientRequestsPerRPC is an instrument used to record metric values conforming +// to the "rpc.client.requests_per_rpc" semantic conventions. It represents the +// measures the number of messages received per RPC. +type ClientRequestsPerRPC struct { + metric.Int64Histogram +} + +var newClientRequestsPerRPCOpts = []metric.Int64HistogramOption{ + metric.WithDescription("Measures the number of messages received per RPC."), + metric.WithUnit("{count}"), +} + +// NewClientRequestsPerRPC returns a new ClientRequestsPerRPC instrument. +func NewClientRequestsPerRPC( + m metric.Meter, + opt ...metric.Int64HistogramOption, +) (ClientRequestsPerRPC, error) { + // Check if the meter is nil. + if m == nil { + return ClientRequestsPerRPC{noop.Int64Histogram{}}, nil + } + + if len(opt) == 0 { + opt = newClientRequestsPerRPCOpts + } else { + opt = append(opt, newClientRequestsPerRPCOpts...) + } + + i, err := m.Int64Histogram( + "rpc.client.requests_per_rpc", + opt..., + ) + if err != nil { + return ClientRequestsPerRPC{noop.Int64Histogram{}}, err + } + return ClientRequestsPerRPC{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ClientRequestsPerRPC) Inst() metric.Int64Histogram { + return m.Int64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ClientRequestsPerRPC) Name() string { + return "rpc.client.requests_per_rpc" +} + +// Unit returns the semantic convention unit of the instrument +func (ClientRequestsPerRPC) Unit() string { + return "{count}" +} + +// Description returns the semantic convention description of the instrument +func (ClientRequestsPerRPC) Description() string { + return "Measures the number of messages received per RPC." +} + +// Record records val to the current distribution for attrs. +// +// Should be 1 for all non-streaming RPCs. +// +// **Streaming**: This metric is required for server and client streaming RPCs +func (m ClientRequestsPerRPC) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue) { + if len(attrs) == 0 { + m.Int64Histogram.Record(ctx, val) + return + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributes(attrs...)) + m.Int64Histogram.Record(ctx, val, *o...) +} + +// RecordSet records val to the current distribution for set. +// +// Should be 1 for all non-streaming RPCs. +// +// **Streaming**: This metric is required for server and client streaming RPCs +func (m ClientRequestsPerRPC) RecordSet(ctx context.Context, val int64, set attribute.Set) { + if set.Len() == 0 { + m.Int64Histogram.Record(ctx, val) + return + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributeSet(set)) + m.Int64Histogram.Record(ctx, val, *o...) +} + +// ClientResponseSize is an instrument used to record metric values conforming to +// the "rpc.client.response.size" semantic conventions. It represents the +// measures the size of RPC response messages (uncompressed). +type ClientResponseSize struct { + metric.Int64Histogram +} + +var newClientResponseSizeOpts = []metric.Int64HistogramOption{ + metric.WithDescription("Measures the size of RPC response messages (uncompressed)."), + metric.WithUnit("By"), +} + +// NewClientResponseSize returns a new ClientResponseSize instrument. +func NewClientResponseSize( + m metric.Meter, + opt ...metric.Int64HistogramOption, +) (ClientResponseSize, error) { + // Check if the meter is nil. + if m == nil { + return ClientResponseSize{noop.Int64Histogram{}}, nil + } + + if len(opt) == 0 { + opt = newClientResponseSizeOpts + } else { + opt = append(opt, newClientResponseSizeOpts...) + } + + i, err := m.Int64Histogram( + "rpc.client.response.size", + opt..., + ) + if err != nil { + return ClientResponseSize{noop.Int64Histogram{}}, err + } + return ClientResponseSize{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ClientResponseSize) Inst() metric.Int64Histogram { + return m.Int64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ClientResponseSize) Name() string { + return "rpc.client.response.size" +} + +// Unit returns the semantic convention unit of the instrument +func (ClientResponseSize) Unit() string { + return "By" +} + +// Description returns the semantic convention description of the instrument +func (ClientResponseSize) Description() string { + return "Measures the size of RPC response messages (uncompressed)." +} + +// Record records val to the current distribution for attrs. +// +// **Streaming**: Recorded per response in a streaming batch +func (m ClientResponseSize) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue) { + if len(attrs) == 0 { + m.Int64Histogram.Record(ctx, val) + return + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributes(attrs...)) + m.Int64Histogram.Record(ctx, val, *o...) +} + +// RecordSet records val to the current distribution for set. +// +// **Streaming**: Recorded per response in a streaming batch +func (m ClientResponseSize) RecordSet(ctx context.Context, val int64, set attribute.Set) { + if set.Len() == 0 { + m.Int64Histogram.Record(ctx, val) + return + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributeSet(set)) + m.Int64Histogram.Record(ctx, val, *o...) +} + +// ClientResponsesPerRPC is an instrument used to record metric values conforming +// to the "rpc.client.responses_per_rpc" semantic conventions. It represents the +// measures the number of messages sent per RPC. +type ClientResponsesPerRPC struct { + metric.Int64Histogram +} + +var newClientResponsesPerRPCOpts = []metric.Int64HistogramOption{ + metric.WithDescription("Measures the number of messages sent per RPC."), + metric.WithUnit("{count}"), +} + +// NewClientResponsesPerRPC returns a new ClientResponsesPerRPC instrument. +func NewClientResponsesPerRPC( + m metric.Meter, + opt ...metric.Int64HistogramOption, +) (ClientResponsesPerRPC, error) { + // Check if the meter is nil. + if m == nil { + return ClientResponsesPerRPC{noop.Int64Histogram{}}, nil + } + + if len(opt) == 0 { + opt = newClientResponsesPerRPCOpts + } else { + opt = append(opt, newClientResponsesPerRPCOpts...) + } + + i, err := m.Int64Histogram( + "rpc.client.responses_per_rpc", + opt..., + ) + if err != nil { + return ClientResponsesPerRPC{noop.Int64Histogram{}}, err + } + return ClientResponsesPerRPC{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ClientResponsesPerRPC) Inst() metric.Int64Histogram { + return m.Int64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ClientResponsesPerRPC) Name() string { + return "rpc.client.responses_per_rpc" +} + +// Unit returns the semantic convention unit of the instrument +func (ClientResponsesPerRPC) Unit() string { + return "{count}" +} + +// Description returns the semantic convention description of the instrument +func (ClientResponsesPerRPC) Description() string { + return "Measures the number of messages sent per RPC." +} + +// Record records val to the current distribution for attrs. +// +// Should be 1 for all non-streaming RPCs. +// +// **Streaming**: This metric is required for server and client streaming RPCs +func (m ClientResponsesPerRPC) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue) { + if len(attrs) == 0 { + m.Int64Histogram.Record(ctx, val) + return + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributes(attrs...)) + m.Int64Histogram.Record(ctx, val, *o...) +} + +// RecordSet records val to the current distribution for set. +// +// Should be 1 for all non-streaming RPCs. +// +// **Streaming**: This metric is required for server and client streaming RPCs +func (m ClientResponsesPerRPC) RecordSet(ctx context.Context, val int64, set attribute.Set) { + if set.Len() == 0 { + m.Int64Histogram.Record(ctx, val) + return + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributeSet(set)) + m.Int64Histogram.Record(ctx, val, *o...) +} + +// ServerDuration is an instrument used to record metric values conforming to the +// "rpc.server.duration" semantic conventions. It represents the measures the +// duration of inbound RPC. +type ServerDuration struct { + metric.Float64Histogram +} + +var newServerDurationOpts = []metric.Float64HistogramOption{ + metric.WithDescription("Measures the duration of inbound RPC."), + metric.WithUnit("ms"), +} + +// NewServerDuration returns a new ServerDuration instrument. +func NewServerDuration( + m metric.Meter, + opt ...metric.Float64HistogramOption, +) (ServerDuration, error) { + // Check if the meter is nil. + if m == nil { + return ServerDuration{noop.Float64Histogram{}}, nil + } + + if len(opt) == 0 { + opt = newServerDurationOpts + } else { + opt = append(opt, newServerDurationOpts...) + } + + i, err := m.Float64Histogram( + "rpc.server.duration", + opt..., + ) + if err != nil { + return ServerDuration{noop.Float64Histogram{}}, err + } + return ServerDuration{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ServerDuration) Inst() metric.Float64Histogram { + return m.Float64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ServerDuration) Name() string { + return "rpc.server.duration" +} + +// Unit returns the semantic convention unit of the instrument +func (ServerDuration) Unit() string { + return "ms" +} + +// Description returns the semantic convention description of the instrument +func (ServerDuration) Description() string { + return "Measures the duration of inbound RPC." +} + +// Record records val to the current distribution for attrs. +// +// While streaming RPCs may record this metric as start-of-batch +// to end-of-batch, it's hard to interpret in practice. +// +// **Streaming**: N/A. +func (m ServerDuration) Record(ctx context.Context, val float64, attrs ...attribute.KeyValue) { + if len(attrs) == 0 { + m.Float64Histogram.Record(ctx, val) + return + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributes(attrs...)) + m.Float64Histogram.Record(ctx, val, *o...) +} + +// RecordSet records val to the current distribution for set. +// +// While streaming RPCs may record this metric as start-of-batch +// to end-of-batch, it's hard to interpret in practice. +// +// **Streaming**: N/A. +func (m ServerDuration) RecordSet(ctx context.Context, val float64, set attribute.Set) { + if set.Len() == 0 { + m.Float64Histogram.Record(ctx, val) + return + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributeSet(set)) + m.Float64Histogram.Record(ctx, val, *o...) +} + +// ServerRequestSize is an instrument used to record metric values conforming to +// the "rpc.server.request.size" semantic conventions. It represents the measures +// the size of RPC request messages (uncompressed). +type ServerRequestSize struct { + metric.Int64Histogram +} + +var newServerRequestSizeOpts = []metric.Int64HistogramOption{ + metric.WithDescription("Measures the size of RPC request messages (uncompressed)."), + metric.WithUnit("By"), +} + +// NewServerRequestSize returns a new ServerRequestSize instrument. +func NewServerRequestSize( + m metric.Meter, + opt ...metric.Int64HistogramOption, +) (ServerRequestSize, error) { + // Check if the meter is nil. + if m == nil { + return ServerRequestSize{noop.Int64Histogram{}}, nil + } + + if len(opt) == 0 { + opt = newServerRequestSizeOpts + } else { + opt = append(opt, newServerRequestSizeOpts...) + } + + i, err := m.Int64Histogram( + "rpc.server.request.size", + opt..., + ) + if err != nil { + return ServerRequestSize{noop.Int64Histogram{}}, err + } + return ServerRequestSize{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ServerRequestSize) Inst() metric.Int64Histogram { + return m.Int64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ServerRequestSize) Name() string { + return "rpc.server.request.size" +} + +// Unit returns the semantic convention unit of the instrument +func (ServerRequestSize) Unit() string { + return "By" +} + +// Description returns the semantic convention description of the instrument +func (ServerRequestSize) Description() string { + return "Measures the size of RPC request messages (uncompressed)." +} + +// Record records val to the current distribution for attrs. +// +// **Streaming**: Recorded per message in a streaming batch +func (m ServerRequestSize) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue) { + if len(attrs) == 0 { + m.Int64Histogram.Record(ctx, val) + return + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributes(attrs...)) + m.Int64Histogram.Record(ctx, val, *o...) +} + +// RecordSet records val to the current distribution for set. +// +// **Streaming**: Recorded per message in a streaming batch +func (m ServerRequestSize) RecordSet(ctx context.Context, val int64, set attribute.Set) { + if set.Len() == 0 { + m.Int64Histogram.Record(ctx, val) + return + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributeSet(set)) + m.Int64Histogram.Record(ctx, val, *o...) +} + +// ServerRequestsPerRPC is an instrument used to record metric values conforming +// to the "rpc.server.requests_per_rpc" semantic conventions. It represents the +// measures the number of messages received per RPC. +type ServerRequestsPerRPC struct { + metric.Int64Histogram +} + +var newServerRequestsPerRPCOpts = []metric.Int64HistogramOption{ + metric.WithDescription("Measures the number of messages received per RPC."), + metric.WithUnit("{count}"), +} + +// NewServerRequestsPerRPC returns a new ServerRequestsPerRPC instrument. +func NewServerRequestsPerRPC( + m metric.Meter, + opt ...metric.Int64HistogramOption, +) (ServerRequestsPerRPC, error) { + // Check if the meter is nil. + if m == nil { + return ServerRequestsPerRPC{noop.Int64Histogram{}}, nil + } + + if len(opt) == 0 { + opt = newServerRequestsPerRPCOpts + } else { + opt = append(opt, newServerRequestsPerRPCOpts...) + } + + i, err := m.Int64Histogram( + "rpc.server.requests_per_rpc", + opt..., + ) + if err != nil { + return ServerRequestsPerRPC{noop.Int64Histogram{}}, err + } + return ServerRequestsPerRPC{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ServerRequestsPerRPC) Inst() metric.Int64Histogram { + return m.Int64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ServerRequestsPerRPC) Name() string { + return "rpc.server.requests_per_rpc" +} + +// Unit returns the semantic convention unit of the instrument +func (ServerRequestsPerRPC) Unit() string { + return "{count}" +} + +// Description returns the semantic convention description of the instrument +func (ServerRequestsPerRPC) Description() string { + return "Measures the number of messages received per RPC." +} + +// Record records val to the current distribution for attrs. +// +// Should be 1 for all non-streaming RPCs. +// +// **Streaming** : This metric is required for server and client streaming RPCs +func (m ServerRequestsPerRPC) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue) { + if len(attrs) == 0 { + m.Int64Histogram.Record(ctx, val) + return + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributes(attrs...)) + m.Int64Histogram.Record(ctx, val, *o...) +} + +// RecordSet records val to the current distribution for set. +// +// Should be 1 for all non-streaming RPCs. +// +// **Streaming** : This metric is required for server and client streaming RPCs +func (m ServerRequestsPerRPC) RecordSet(ctx context.Context, val int64, set attribute.Set) { + if set.Len() == 0 { + m.Int64Histogram.Record(ctx, val) + return + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributeSet(set)) + m.Int64Histogram.Record(ctx, val, *o...) +} + +// ServerResponseSize is an instrument used to record metric values conforming to +// the "rpc.server.response.size" semantic conventions. It represents the +// measures the size of RPC response messages (uncompressed). +type ServerResponseSize struct { + metric.Int64Histogram +} + +var newServerResponseSizeOpts = []metric.Int64HistogramOption{ + metric.WithDescription("Measures the size of RPC response messages (uncompressed)."), + metric.WithUnit("By"), +} + +// NewServerResponseSize returns a new ServerResponseSize instrument. +func NewServerResponseSize( + m metric.Meter, + opt ...metric.Int64HistogramOption, +) (ServerResponseSize, error) { + // Check if the meter is nil. + if m == nil { + return ServerResponseSize{noop.Int64Histogram{}}, nil + } + + if len(opt) == 0 { + opt = newServerResponseSizeOpts + } else { + opt = append(opt, newServerResponseSizeOpts...) + } + + i, err := m.Int64Histogram( + "rpc.server.response.size", + opt..., + ) + if err != nil { + return ServerResponseSize{noop.Int64Histogram{}}, err + } + return ServerResponseSize{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ServerResponseSize) Inst() metric.Int64Histogram { + return m.Int64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ServerResponseSize) Name() string { + return "rpc.server.response.size" +} + +// Unit returns the semantic convention unit of the instrument +func (ServerResponseSize) Unit() string { + return "By" +} + +// Description returns the semantic convention description of the instrument +func (ServerResponseSize) Description() string { + return "Measures the size of RPC response messages (uncompressed)." +} + +// Record records val to the current distribution for attrs. +// +// **Streaming**: Recorded per response in a streaming batch +func (m ServerResponseSize) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue) { + if len(attrs) == 0 { + m.Int64Histogram.Record(ctx, val) + return + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributes(attrs...)) + m.Int64Histogram.Record(ctx, val, *o...) +} + +// RecordSet records val to the current distribution for set. +// +// **Streaming**: Recorded per response in a streaming batch +func (m ServerResponseSize) RecordSet(ctx context.Context, val int64, set attribute.Set) { + if set.Len() == 0 { + m.Int64Histogram.Record(ctx, val) + return + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributeSet(set)) + m.Int64Histogram.Record(ctx, val, *o...) +} + +// ServerResponsesPerRPC is an instrument used to record metric values conforming +// to the "rpc.server.responses_per_rpc" semantic conventions. It represents the +// measures the number of messages sent per RPC. +type ServerResponsesPerRPC struct { + metric.Int64Histogram +} + +var newServerResponsesPerRPCOpts = []metric.Int64HistogramOption{ + metric.WithDescription("Measures the number of messages sent per RPC."), + metric.WithUnit("{count}"), +} + +// NewServerResponsesPerRPC returns a new ServerResponsesPerRPC instrument. +func NewServerResponsesPerRPC( + m metric.Meter, + opt ...metric.Int64HistogramOption, +) (ServerResponsesPerRPC, error) { + // Check if the meter is nil. + if m == nil { + return ServerResponsesPerRPC{noop.Int64Histogram{}}, nil + } + + if len(opt) == 0 { + opt = newServerResponsesPerRPCOpts + } else { + opt = append(opt, newServerResponsesPerRPCOpts...) + } + + i, err := m.Int64Histogram( + "rpc.server.responses_per_rpc", + opt..., + ) + if err != nil { + return ServerResponsesPerRPC{noop.Int64Histogram{}}, err + } + return ServerResponsesPerRPC{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ServerResponsesPerRPC) Inst() metric.Int64Histogram { + return m.Int64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ServerResponsesPerRPC) Name() string { + return "rpc.server.responses_per_rpc" +} + +// Unit returns the semantic convention unit of the instrument +func (ServerResponsesPerRPC) Unit() string { + return "{count}" +} + +// Description returns the semantic convention description of the instrument +func (ServerResponsesPerRPC) Description() string { + return "Measures the number of messages sent per RPC." +} + +// Record records val to the current distribution for attrs. +// +// Should be 1 for all non-streaming RPCs. +// +// **Streaming**: This metric is required for server and client streaming RPCs +func (m ServerResponsesPerRPC) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue) { + if len(attrs) == 0 { + m.Int64Histogram.Record(ctx, val) + return + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributes(attrs...)) + m.Int64Histogram.Record(ctx, val, *o...) +} + +// RecordSet records val to the current distribution for set. +// +// Should be 1 for all non-streaming RPCs. +// +// **Streaming**: This metric is required for server and client streaming RPCs +func (m ServerResponsesPerRPC) RecordSet(ctx context.Context, val int64, set attribute.Set) { + if set.Len() == 0 { + m.Int64Histogram.Record(ctx, val) + return + } + + o := recOptPool.Get().(*[]metric.RecordOption) + defer func() { + *o = (*o)[:0] + recOptPool.Put(o) + }() + + *o = append(*o, metric.WithAttributeSet(set)) + m.Int64Histogram.Record(ctx, val, *o...) +} diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.43.0/httpconv/metric.go b/vendor/go.opentelemetry.io/otel/semconv/v1.43.0/httpconv/metric.go new file mode 100644 index 00000000000..1eb8c9e2a9d --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.43.0/httpconv/metric.go @@ -0,0 +1,2051 @@ +// Code generated from semantic convention specification. DO NOT EDIT. + +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Package httpconv provides types and functionality for OpenTelemetry semantic +// conventions in the "http" namespace. +package httpconv + +import ( + "context" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/metric/noop" + "go.opentelemetry.io/otel/semconv/internal/metricpool" +) + +// ErrorTypeAttr is an attribute conforming to the error.type semantic +// conventions. It represents the describes a class of error the operation ended +// with. +type ErrorTypeAttr string + +var ( + // ErrorTypeOther is a fallback error value to be used when the instrumentation + // doesn't define a custom value. + ErrorTypeOther ErrorTypeAttr = "_OTHER" +) + +// ConnectionStateAttr is an attribute conforming to the http.connection.state +// semantic conventions. It represents the state of the HTTP connection in the +// HTTP connection pool. +type ConnectionStateAttr string + +var ( + // ConnectionStateActive is the active state. + ConnectionStateActive ConnectionStateAttr = "active" + // ConnectionStateIdle is the idle state. + ConnectionStateIdle ConnectionStateAttr = "idle" +) + +// RequestMethodAttr is an attribute conforming to the http.request.method +// semantic conventions. It represents the HTTP request method. +type RequestMethodAttr string + +var ( + // RequestMethodConnect is the CONNECT method. + RequestMethodConnect RequestMethodAttr = "CONNECT" + // RequestMethodDelete is the DELETE method. + RequestMethodDelete RequestMethodAttr = "DELETE" + // RequestMethodGet is the GET method. + RequestMethodGet RequestMethodAttr = "GET" + // RequestMethodHead is the HEAD method. + RequestMethodHead RequestMethodAttr = "HEAD" + // RequestMethodOptions is the OPTIONS method. + RequestMethodOptions RequestMethodAttr = "OPTIONS" + // RequestMethodPatch is the PATCH method. + RequestMethodPatch RequestMethodAttr = "PATCH" + // RequestMethodPost is the POST method. + RequestMethodPost RequestMethodAttr = "POST" + // RequestMethodPut is the PUT method. + RequestMethodPut RequestMethodAttr = "PUT" + // RequestMethodTrace is the TRACE method. + RequestMethodTrace RequestMethodAttr = "TRACE" + // RequestMethodQuery is the QUERY method. + RequestMethodQuery RequestMethodAttr = "QUERY" + // RequestMethodOther is the any HTTP method that the instrumentation has no + // prior knowledge of. + RequestMethodOther RequestMethodAttr = "_OTHER" +) + +// UserAgentSyntheticTypeAttr is an attribute conforming to the +// user_agent.synthetic.type semantic conventions. It represents the specifies +// the category of synthetic traffic, such as tests or bots. +type UserAgentSyntheticTypeAttr string + +var ( + // UserAgentSyntheticTypeBot is the bot source. + UserAgentSyntheticTypeBot UserAgentSyntheticTypeAttr = "bot" + // UserAgentSyntheticTypeTest is the synthetic test source. + UserAgentSyntheticTypeTest UserAgentSyntheticTypeAttr = "test" +) + +// ClientActiveRequests is an instrument used to record metric values conforming +// to the "http.client.active_requests" semantic conventions. It represents the +// number of active HTTP requests. +type ClientActiveRequests struct { + metric.Int64UpDownCounter +} + +var newClientActiveRequestsOpts = []metric.Int64UpDownCounterOption{ + metric.WithDescription("Number of active HTTP requests."), + metric.WithUnit("{request}"), +} + +// NewClientActiveRequests returns a new ClientActiveRequests instrument. +func NewClientActiveRequests( + m metric.Meter, + opt ...metric.Int64UpDownCounterOption, +) (ClientActiveRequests, error) { + // Check if the meter is nil. + if m == nil { + return ClientActiveRequests{noop.Int64UpDownCounter{}}, nil + } + + if len(opt) == 0 { + opt = newClientActiveRequestsOpts + } else { + opt = append(opt, newClientActiveRequestsOpts...) + } + + i, err := m.Int64UpDownCounter( + "http.client.active_requests", + opt..., + ) + if err != nil { + return ClientActiveRequests{noop.Int64UpDownCounter{}}, err + } + return ClientActiveRequests{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ClientActiveRequests) Inst() metric.Int64UpDownCounter { + return m.Int64UpDownCounter +} + +// Name returns the semantic convention name of the instrument. +func (ClientActiveRequests) Name() string { + return "http.client.active_requests" +} + +// Unit returns the semantic convention unit of the instrument +func (ClientActiveRequests) Unit() string { + return "{request}" +} + +// Description returns the semantic convention description of the instrument +func (ClientActiveRequests) Description() string { + return "Number of active HTTP requests." +} + +// Add adds incr to the existing count for attrs. +// +// The serverAddress is the server domain name if available without reverse DNS +// lookup; otherwise, IP address or Unix domain socket name. +// +// The serverPort is the server port number. +// +// All additional attrs passed are included in the recorded value. +func (m ClientActiveRequests) Add( + ctx context.Context, + incr int64, + serverAddress string, + serverPort int, + attrs ...attribute.KeyValue, +) { + if !m.Int64UpDownCounter.Enabled(ctx) { + return + } + if len(attrs) == 0 { + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )) + return + } + + o := metricpool.AddOptions() + defer metricpool.PutAddOptions(o) + + *o = append( + *o, + metric.WithAttributes( + append( + attrs[:len(attrs):len(attrs)], + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )..., + ), + ) + + m.Int64UpDownCounter.Add(ctx, incr, *o...) +} + +// AddSet adds incr to the existing count for set. +func (m ClientActiveRequests) AddSet(ctx context.Context, incr int64, set attribute.Set) { + if !m.Int64UpDownCounter.Enabled(ctx) { + return + } + if set.Len() == 0 { + m.Int64UpDownCounter.Add(ctx, incr) + return + } + + o := metricpool.AddOptions() + defer metricpool.PutAddOptions(o) + + *o = append(*o, metric.WithAttributeSet(set)) + m.Int64UpDownCounter.Add(ctx, incr, *o...) +} + +// AttrURLTemplate returns an optional attribute for the "url.template" semantic +// convention. It represents the low-cardinality template of an +// [absolute path reference]. +// +// [absolute path reference]: https://www.rfc-editor.org/rfc/rfc3986#section-4.2 +func (ClientActiveRequests) AttrURLTemplate(val string) attribute.KeyValue { + return attribute.String("url.template", val) +} + +// AttrRequestMethod returns an optional attribute for the "http.request.method" +// semantic convention. It represents the HTTP request method. +func (ClientActiveRequests) AttrRequestMethod(val RequestMethodAttr) attribute.KeyValue { + return attribute.String("http.request.method", string(val)) +} + +// AttrURLScheme returns an optional attribute for the "url.scheme" semantic +// convention. It represents the [URI scheme] component identifying the used +// protocol. +// +// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 +func (ClientActiveRequests) AttrURLScheme(val string) attribute.KeyValue { + return attribute.String("url.scheme", val) +} + +// ClientActiveRequestsObservable is an instrument used to record metric values +// conforming to the "http.client.active_requests" semantic conventions. It +// represents the number of active HTTP requests. +type ClientActiveRequestsObservable struct { + metric.Int64ObservableUpDownCounter +} + +var newClientActiveRequestsObservableOpts = []metric.Int64ObservableUpDownCounterOption{ + metric.WithDescription("Number of active HTTP requests."), + metric.WithUnit("{request}"), +} + +// NewClientActiveRequestsObservable returns a new ClientActiveRequestsObservable +// instrument. +func NewClientActiveRequestsObservable( + m metric.Meter, + opt ...metric.Int64ObservableUpDownCounterOption, +) (ClientActiveRequestsObservable, error) { + // Check if the meter is nil. + if m == nil { + return ClientActiveRequestsObservable{noop.Int64ObservableUpDownCounter{}}, nil + } + + if len(opt) == 0 { + opt = newClientActiveRequestsObservableOpts + } else { + opt = append(opt, newClientActiveRequestsObservableOpts...) + } + + i, err := m.Int64ObservableUpDownCounter( + "http.client.active_requests", + opt..., + ) + if err != nil { + return ClientActiveRequestsObservable{noop.Int64ObservableUpDownCounter{}}, err + } + return ClientActiveRequestsObservable{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ClientActiveRequestsObservable) Inst() metric.Int64ObservableUpDownCounter { + return m.Int64ObservableUpDownCounter +} + +// Name returns the semantic convention name of the instrument. +func (ClientActiveRequestsObservable) Name() string { + return "http.client.active_requests" +} + +// Unit returns the semantic convention unit of the instrument +func (ClientActiveRequestsObservable) Unit() string { + return "{request}" +} + +// Description returns the semantic convention description of the instrument +func (ClientActiveRequestsObservable) Description() string { + return "Number of active HTTP requests." +} + +// AttrServerAddress returns a required attribute for the "server.address" +// semantic convention. It represents the server domain name if available without +// reverse DNS lookup; otherwise, IP address or Unix domain socket name. +func (ClientActiveRequestsObservable) AttrServerAddress(val string) attribute.KeyValue { + return attribute.String("server.address", val) +} + +// AttrServerPort returns a required attribute for the "server.port" semantic +// convention. It represents the server port number. +func (ClientActiveRequestsObservable) AttrServerPort(val int) attribute.KeyValue { + return attribute.Int("server.port", val) +} + +// AttrURLTemplate returns an optional attribute for the "url.template" semantic +// convention. It represents the low-cardinality template of an +// [absolute path reference]. +// +// [absolute path reference]: https://www.rfc-editor.org/rfc/rfc3986#section-4.2 +func (ClientActiveRequestsObservable) AttrURLTemplate(val string) attribute.KeyValue { + return attribute.String("url.template", val) +} + +// AttrRequestMethod returns an optional attribute for the "http.request.method" +// semantic convention. It represents the HTTP request method. +func (ClientActiveRequestsObservable) AttrRequestMethod(val RequestMethodAttr) attribute.KeyValue { + return attribute.String("http.request.method", string(val)) +} + +// AttrURLScheme returns an optional attribute for the "url.scheme" semantic +// convention. It represents the [URI scheme] component identifying the used +// protocol. +// +// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 +func (ClientActiveRequestsObservable) AttrURLScheme(val string) attribute.KeyValue { + return attribute.String("url.scheme", val) +} + +// ClientConnectionDuration is an instrument used to record metric values +// conforming to the "http.client.connection.duration" semantic conventions. It +// represents the duration of the successfully established outbound HTTP +// connections. +type ClientConnectionDuration struct { + metric.Float64Histogram +} + +var newClientConnectionDurationOpts = []metric.Float64HistogramOption{ + metric.WithDescription("The duration of the successfully established outbound HTTP connections."), + metric.WithUnit("s"), +} + +// NewClientConnectionDuration returns a new ClientConnectionDuration instrument. +func NewClientConnectionDuration( + m metric.Meter, + opt ...metric.Float64HistogramOption, +) (ClientConnectionDuration, error) { + // Check if the meter is nil. + if m == nil { + return ClientConnectionDuration{noop.Float64Histogram{}}, nil + } + + if len(opt) == 0 { + opt = newClientConnectionDurationOpts + } else { + opt = append(opt, newClientConnectionDurationOpts...) + } + + i, err := m.Float64Histogram( + "http.client.connection.duration", + opt..., + ) + if err != nil { + return ClientConnectionDuration{noop.Float64Histogram{}}, err + } + return ClientConnectionDuration{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ClientConnectionDuration) Inst() metric.Float64Histogram { + return m.Float64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ClientConnectionDuration) Name() string { + return "http.client.connection.duration" +} + +// Unit returns the semantic convention unit of the instrument +func (ClientConnectionDuration) Unit() string { + return "s" +} + +// Description returns the semantic convention description of the instrument +func (ClientConnectionDuration) Description() string { + return "The duration of the successfully established outbound HTTP connections." +} + +// Record records val to the current distribution for attrs. +// +// The serverAddress is the server domain name if available without reverse DNS +// lookup; otherwise, IP address or Unix domain socket name. +// +// The serverPort is the server port number. +// +// All additional attrs passed are included in the recorded value. +func (m ClientConnectionDuration) Record( + ctx context.Context, + val float64, + serverAddress string, + serverPort int, + attrs ...attribute.KeyValue, +) { + if !m.Float64Histogram.Enabled(ctx) { + return + } + if len(attrs) == 0 { + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )) + return + } + + o := metricpool.RecordOptions() + defer metricpool.PutRecordOptions(o) + + *o = append( + *o, + metric.WithAttributes( + append( + attrs[:len(attrs):len(attrs)], + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )..., + ), + ) + + m.Float64Histogram.Record(ctx, val, *o...) +} + +// RecordSet records val to the current distribution for set. +func (m ClientConnectionDuration) RecordSet(ctx context.Context, val float64, set attribute.Set) { + if !m.Float64Histogram.Enabled(ctx) { + return + } + if set.Len() == 0 { + m.Float64Histogram.Record(ctx, val) + return + } + + o := metricpool.RecordOptions() + defer metricpool.PutRecordOptions(o) + + *o = append(*o, metric.WithAttributeSet(set)) + m.Float64Histogram.Record(ctx, val, *o...) +} + +// AttrNetworkProtocolVersion returns an optional attribute for the +// "network.protocol.version" semantic convention. It represents the actual +// version of the protocol used for network communication. +func (ClientConnectionDuration) AttrNetworkProtocolVersion(val string) attribute.KeyValue { + return attribute.String("network.protocol.version", val) +} + +// AttrNetworkPeerAddress returns an optional attribute for the +// "network.peer.address" semantic convention. It represents the peer address of +// the network connection - IP address or Unix domain socket name. +func (ClientConnectionDuration) AttrNetworkPeerAddress(val string) attribute.KeyValue { + return attribute.String("network.peer.address", val) +} + +// AttrURLScheme returns an optional attribute for the "url.scheme" semantic +// convention. It represents the [URI scheme] component identifying the used +// protocol. +// +// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 +func (ClientConnectionDuration) AttrURLScheme(val string) attribute.KeyValue { + return attribute.String("url.scheme", val) +} + +// ClientOpenConnections is an instrument used to record metric values conforming +// to the "http.client.open_connections" semantic conventions. It represents the +// number of outbound HTTP connections that are currently active or idle on the +// client. +type ClientOpenConnections struct { + metric.Int64UpDownCounter +} + +var newClientOpenConnectionsOpts = []metric.Int64UpDownCounterOption{ + metric.WithDescription("Number of outbound HTTP connections that are currently active or idle on the client."), + metric.WithUnit("{connection}"), +} + +// NewClientOpenConnections returns a new ClientOpenConnections instrument. +func NewClientOpenConnections( + m metric.Meter, + opt ...metric.Int64UpDownCounterOption, +) (ClientOpenConnections, error) { + // Check if the meter is nil. + if m == nil { + return ClientOpenConnections{noop.Int64UpDownCounter{}}, nil + } + + if len(opt) == 0 { + opt = newClientOpenConnectionsOpts + } else { + opt = append(opt, newClientOpenConnectionsOpts...) + } + + i, err := m.Int64UpDownCounter( + "http.client.open_connections", + opt..., + ) + if err != nil { + return ClientOpenConnections{noop.Int64UpDownCounter{}}, err + } + return ClientOpenConnections{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ClientOpenConnections) Inst() metric.Int64UpDownCounter { + return m.Int64UpDownCounter +} + +// Name returns the semantic convention name of the instrument. +func (ClientOpenConnections) Name() string { + return "http.client.open_connections" +} + +// Unit returns the semantic convention unit of the instrument +func (ClientOpenConnections) Unit() string { + return "{connection}" +} + +// Description returns the semantic convention description of the instrument +func (ClientOpenConnections) Description() string { + return "Number of outbound HTTP connections that are currently active or idle on the client." +} + +// Add adds incr to the existing count for attrs. +// +// The connectionState is the state of the HTTP connection in the HTTP connection +// pool. +// +// The serverAddress is the server domain name if available without reverse DNS +// lookup; otherwise, IP address or Unix domain socket name. +// +// The serverPort is the server port number. +// +// All additional attrs passed are included in the recorded value. +func (m ClientOpenConnections) Add( + ctx context.Context, + incr int64, + connectionState ConnectionStateAttr, + serverAddress string, + serverPort int, + attrs ...attribute.KeyValue, +) { + if !m.Int64UpDownCounter.Enabled(ctx) { + return + } + if len(attrs) == 0 { + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("http.connection.state", string(connectionState)), + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )) + return + } + + o := metricpool.AddOptions() + defer metricpool.PutAddOptions(o) + + *o = append( + *o, + metric.WithAttributes( + append( + attrs[:len(attrs):len(attrs)], + attribute.String("http.connection.state", string(connectionState)), + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )..., + ), + ) + + m.Int64UpDownCounter.Add(ctx, incr, *o...) +} + +// AddSet adds incr to the existing count for set. +func (m ClientOpenConnections) AddSet(ctx context.Context, incr int64, set attribute.Set) { + if !m.Int64UpDownCounter.Enabled(ctx) { + return + } + if set.Len() == 0 { + m.Int64UpDownCounter.Add(ctx, incr) + return + } + + o := metricpool.AddOptions() + defer metricpool.PutAddOptions(o) + + *o = append(*o, metric.WithAttributeSet(set)) + m.Int64UpDownCounter.Add(ctx, incr, *o...) +} + +// AttrNetworkProtocolVersion returns an optional attribute for the +// "network.protocol.version" semantic convention. It represents the actual +// version of the protocol used for network communication. +func (ClientOpenConnections) AttrNetworkProtocolVersion(val string) attribute.KeyValue { + return attribute.String("network.protocol.version", val) +} + +// AttrNetworkPeerAddress returns an optional attribute for the +// "network.peer.address" semantic convention. It represents the peer address of +// the network connection - IP address or Unix domain socket name. +func (ClientOpenConnections) AttrNetworkPeerAddress(val string) attribute.KeyValue { + return attribute.String("network.peer.address", val) +} + +// AttrURLScheme returns an optional attribute for the "url.scheme" semantic +// convention. It represents the [URI scheme] component identifying the used +// protocol. +// +// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 +func (ClientOpenConnections) AttrURLScheme(val string) attribute.KeyValue { + return attribute.String("url.scheme", val) +} + +// ClientOpenConnectionsObservable is an instrument used to record metric values +// conforming to the "http.client.open_connections" semantic conventions. It +// represents the number of outbound HTTP connections that are currently active +// or idle on the client. +type ClientOpenConnectionsObservable struct { + metric.Int64ObservableUpDownCounter +} + +var newClientOpenConnectionsObservableOpts = []metric.Int64ObservableUpDownCounterOption{ + metric.WithDescription("Number of outbound HTTP connections that are currently active or idle on the client."), + metric.WithUnit("{connection}"), +} + +// NewClientOpenConnectionsObservable returns a new +// ClientOpenConnectionsObservable instrument. +func NewClientOpenConnectionsObservable( + m metric.Meter, + opt ...metric.Int64ObservableUpDownCounterOption, +) (ClientOpenConnectionsObservable, error) { + // Check if the meter is nil. + if m == nil { + return ClientOpenConnectionsObservable{noop.Int64ObservableUpDownCounter{}}, nil + } + + if len(opt) == 0 { + opt = newClientOpenConnectionsObservableOpts + } else { + opt = append(opt, newClientOpenConnectionsObservableOpts...) + } + + i, err := m.Int64ObservableUpDownCounter( + "http.client.open_connections", + opt..., + ) + if err != nil { + return ClientOpenConnectionsObservable{noop.Int64ObservableUpDownCounter{}}, err + } + return ClientOpenConnectionsObservable{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ClientOpenConnectionsObservable) Inst() metric.Int64ObservableUpDownCounter { + return m.Int64ObservableUpDownCounter +} + +// Name returns the semantic convention name of the instrument. +func (ClientOpenConnectionsObservable) Name() string { + return "http.client.open_connections" +} + +// Unit returns the semantic convention unit of the instrument +func (ClientOpenConnectionsObservable) Unit() string { + return "{connection}" +} + +// Description returns the semantic convention description of the instrument +func (ClientOpenConnectionsObservable) Description() string { + return "Number of outbound HTTP connections that are currently active or idle on the client." +} + +// AttrConnectionState returns a required attribute for the +// "http.connection.state" semantic convention. It represents the state of the +// HTTP connection in the HTTP connection pool. +func (ClientOpenConnectionsObservable) AttrConnectionState(val ConnectionStateAttr) attribute.KeyValue { + return attribute.String("http.connection.state", string(val)) +} + +// AttrServerAddress returns a required attribute for the "server.address" +// semantic convention. It represents the server domain name if available without +// reverse DNS lookup; otherwise, IP address or Unix domain socket name. +func (ClientOpenConnectionsObservable) AttrServerAddress(val string) attribute.KeyValue { + return attribute.String("server.address", val) +} + +// AttrServerPort returns a required attribute for the "server.port" semantic +// convention. It represents the server port number. +func (ClientOpenConnectionsObservable) AttrServerPort(val int) attribute.KeyValue { + return attribute.Int("server.port", val) +} + +// AttrNetworkProtocolVersion returns an optional attribute for the +// "network.protocol.version" semantic convention. It represents the actual +// version of the protocol used for network communication. +func (ClientOpenConnectionsObservable) AttrNetworkProtocolVersion(val string) attribute.KeyValue { + return attribute.String("network.protocol.version", val) +} + +// AttrNetworkPeerAddress returns an optional attribute for the +// "network.peer.address" semantic convention. It represents the peer address of +// the network connection - IP address or Unix domain socket name. +func (ClientOpenConnectionsObservable) AttrNetworkPeerAddress(val string) attribute.KeyValue { + return attribute.String("network.peer.address", val) +} + +// AttrURLScheme returns an optional attribute for the "url.scheme" semantic +// convention. It represents the [URI scheme] component identifying the used +// protocol. +// +// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 +func (ClientOpenConnectionsObservable) AttrURLScheme(val string) attribute.KeyValue { + return attribute.String("url.scheme", val) +} + +// ClientRequestBodySize is an instrument used to record metric values conforming +// to the "http.client.request.body.size" semantic conventions. It represents the +// size of HTTP client request bodies. +type ClientRequestBodySize struct { + metric.Int64Histogram +} + +var newClientRequestBodySizeOpts = []metric.Int64HistogramOption{ + metric.WithDescription("Size of HTTP client request bodies."), + metric.WithUnit("By"), +} + +// NewClientRequestBodySize returns a new ClientRequestBodySize instrument. +func NewClientRequestBodySize( + m metric.Meter, + opt ...metric.Int64HistogramOption, +) (ClientRequestBodySize, error) { + // Check if the meter is nil. + if m == nil { + return ClientRequestBodySize{noop.Int64Histogram{}}, nil + } + + if len(opt) == 0 { + opt = newClientRequestBodySizeOpts + } else { + opt = append(opt, newClientRequestBodySizeOpts...) + } + + i, err := m.Int64Histogram( + "http.client.request.body.size", + opt..., + ) + if err != nil { + return ClientRequestBodySize{noop.Int64Histogram{}}, err + } + return ClientRequestBodySize{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ClientRequestBodySize) Inst() metric.Int64Histogram { + return m.Int64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ClientRequestBodySize) Name() string { + return "http.client.request.body.size" +} + +// Unit returns the semantic convention unit of the instrument +func (ClientRequestBodySize) Unit() string { + return "By" +} + +// Description returns the semantic convention description of the instrument +func (ClientRequestBodySize) Description() string { + return "Size of HTTP client request bodies." +} + +// Record records val to the current distribution for attrs. +// +// The requestMethod is the HTTP request method. +// +// The serverAddress is the server domain name if available without reverse DNS +// lookup; otherwise, IP address or Unix domain socket name. +// +// The serverPort is the server port number. +// +// All additional attrs passed are included in the recorded value. +// +// The size of the request payload body in bytes. This is the number of bytes +// transferred excluding headers and is often, but not always, present as the +// [Content-Length] header. For requests using transport encoding, this should be +// the compressed size. +// +// [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length +func (m ClientRequestBodySize) Record( + ctx context.Context, + val int64, + requestMethod RequestMethodAttr, + serverAddress string, + serverPort int, + attrs ...attribute.KeyValue, +) { + if !m.Int64Histogram.Enabled(ctx) { + return + } + if len(attrs) == 0 { + m.Int64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("http.request.method", string(requestMethod)), + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )) + return + } + + o := metricpool.RecordOptions() + defer metricpool.PutRecordOptions(o) + + *o = append( + *o, + metric.WithAttributes( + append( + attrs[:len(attrs):len(attrs)], + attribute.String("http.request.method", string(requestMethod)), + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )..., + ), + ) + + m.Int64Histogram.Record(ctx, val, *o...) +} + +// RecordSet records val to the current distribution for set. +// +// The size of the request payload body in bytes. This is the number of bytes +// transferred excluding headers and is often, but not always, present as the +// [Content-Length] header. For requests using transport encoding, this should be +// the compressed size. +// +// [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length +func (m ClientRequestBodySize) RecordSet(ctx context.Context, val int64, set attribute.Set) { + if !m.Int64Histogram.Enabled(ctx) { + return + } + if set.Len() == 0 { + m.Int64Histogram.Record(ctx, val) + return + } + + o := metricpool.RecordOptions() + defer metricpool.PutRecordOptions(o) + + *o = append(*o, metric.WithAttributeSet(set)) + m.Int64Histogram.Record(ctx, val, *o...) +} + +// AttrErrorType returns an optional attribute for the "error.type" semantic +// convention. It represents the describes a class of error the operation ended +// with. +func (ClientRequestBodySize) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { + return attribute.String("error.type", string(val)) +} + +// AttrResponseStatusCode returns an optional attribute for the +// "http.response.status_code" semantic convention. It represents the +// [HTTP response status code]. +// +// [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6 +func (ClientRequestBodySize) AttrResponseStatusCode(val int) attribute.KeyValue { + return attribute.Int("http.response.status_code", val) +} + +// AttrNetworkProtocolName returns an optional attribute for the +// "network.protocol.name" semantic convention. It represents the +// [OSI application layer] or non-OSI equivalent. +// +// [OSI application layer]: https://wikipedia.org/wiki/Application_layer +func (ClientRequestBodySize) AttrNetworkProtocolName(val string) attribute.KeyValue { + return attribute.String("network.protocol.name", val) +} + +// AttrURLTemplate returns an optional attribute for the "url.template" semantic +// convention. It represents the low-cardinality template of an +// [absolute path reference]. +// +// [absolute path reference]: https://www.rfc-editor.org/rfc/rfc3986#section-4.2 +func (ClientRequestBodySize) AttrURLTemplate(val string) attribute.KeyValue { + return attribute.String("url.template", val) +} + +// AttrNetworkProtocolVersion returns an optional attribute for the +// "network.protocol.version" semantic convention. It represents the actual +// version of the protocol used for network communication. +func (ClientRequestBodySize) AttrNetworkProtocolVersion(val string) attribute.KeyValue { + return attribute.String("network.protocol.version", val) +} + +// AttrURLScheme returns an optional attribute for the "url.scheme" semantic +// convention. It represents the [URI scheme] component identifying the used +// protocol. +// +// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 +func (ClientRequestBodySize) AttrURLScheme(val string) attribute.KeyValue { + return attribute.String("url.scheme", val) +} + +// ClientRequestDuration is an instrument used to record metric values conforming +// to the "http.client.request.duration" semantic conventions. It represents the +// duration of HTTP client requests. +type ClientRequestDuration struct { + metric.Float64Histogram +} + +var newClientRequestDurationOpts = []metric.Float64HistogramOption{ + metric.WithDescription("Duration of HTTP client requests."), + metric.WithUnit("s"), + metric.WithExplicitBucketBoundaries([]float64{0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10}...), +} + +// NewClientRequestDuration returns a new ClientRequestDuration instrument. +func NewClientRequestDuration( + m metric.Meter, + opt ...metric.Float64HistogramOption, +) (ClientRequestDuration, error) { + // Check if the meter is nil. + if m == nil { + return ClientRequestDuration{noop.Float64Histogram{}}, nil + } + + if len(opt) == 0 { + opt = newClientRequestDurationOpts + } else { + opt = append(opt, newClientRequestDurationOpts...) + } + + i, err := m.Float64Histogram( + "http.client.request.duration", + opt..., + ) + if err != nil { + return ClientRequestDuration{noop.Float64Histogram{}}, err + } + return ClientRequestDuration{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ClientRequestDuration) Inst() metric.Float64Histogram { + return m.Float64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ClientRequestDuration) Name() string { + return "http.client.request.duration" +} + +// Unit returns the semantic convention unit of the instrument +func (ClientRequestDuration) Unit() string { + return "s" +} + +// Description returns the semantic convention description of the instrument +func (ClientRequestDuration) Description() string { + return "Duration of HTTP client requests." +} + +// Record records val to the current distribution for attrs. +// +// The requestMethod is the HTTP request method. +// +// The serverAddress is the server domain name if available without reverse DNS +// lookup; otherwise, IP address or Unix domain socket name. +// +// The serverPort is the server port number. +// +// All additional attrs passed are included in the recorded value. +func (m ClientRequestDuration) Record( + ctx context.Context, + val float64, + requestMethod RequestMethodAttr, + serverAddress string, + serverPort int, + attrs ...attribute.KeyValue, +) { + if !m.Float64Histogram.Enabled(ctx) { + return + } + if len(attrs) == 0 { + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("http.request.method", string(requestMethod)), + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )) + return + } + + o := metricpool.RecordOptions() + defer metricpool.PutRecordOptions(o) + + *o = append( + *o, + metric.WithAttributes( + append( + attrs[:len(attrs):len(attrs)], + attribute.String("http.request.method", string(requestMethod)), + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )..., + ), + ) + + m.Float64Histogram.Record(ctx, val, *o...) +} + +// RecordSet records val to the current distribution for set. +func (m ClientRequestDuration) RecordSet(ctx context.Context, val float64, set attribute.Set) { + if !m.Float64Histogram.Enabled(ctx) { + return + } + if set.Len() == 0 { + m.Float64Histogram.Record(ctx, val) + return + } + + o := metricpool.RecordOptions() + defer metricpool.PutRecordOptions(o) + + *o = append(*o, metric.WithAttributeSet(set)) + m.Float64Histogram.Record(ctx, val, *o...) +} + +// AttrErrorType returns an optional attribute for the "error.type" semantic +// convention. It represents the describes a class of error the operation ended +// with. +func (ClientRequestDuration) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { + return attribute.String("error.type", string(val)) +} + +// AttrResponseStatusCode returns an optional attribute for the +// "http.response.status_code" semantic convention. It represents the +// [HTTP response status code]. +// +// [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6 +func (ClientRequestDuration) AttrResponseStatusCode(val int) attribute.KeyValue { + return attribute.Int("http.response.status_code", val) +} + +// AttrNetworkProtocolName returns an optional attribute for the +// "network.protocol.name" semantic convention. It represents the +// [OSI application layer] or non-OSI equivalent. +// +// [OSI application layer]: https://wikipedia.org/wiki/Application_layer +func (ClientRequestDuration) AttrNetworkProtocolName(val string) attribute.KeyValue { + return attribute.String("network.protocol.name", val) +} + +// AttrNetworkProtocolVersion returns an optional attribute for the +// "network.protocol.version" semantic convention. It represents the actual +// version of the protocol used for network communication. +func (ClientRequestDuration) AttrNetworkProtocolVersion(val string) attribute.KeyValue { + return attribute.String("network.protocol.version", val) +} + +// AttrURLScheme returns an optional attribute for the "url.scheme" semantic +// convention. It represents the [URI scheme] component identifying the used +// protocol. +// +// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 +func (ClientRequestDuration) AttrURLScheme(val string) attribute.KeyValue { + return attribute.String("url.scheme", val) +} + +// AttrURLTemplate returns an optional attribute for the "url.template" semantic +// convention. It represents the low-cardinality template of an +// [absolute path reference]. +// +// [absolute path reference]: https://www.rfc-editor.org/rfc/rfc3986#section-4.2 +func (ClientRequestDuration) AttrURLTemplate(val string) attribute.KeyValue { + return attribute.String("url.template", val) +} + +// ClientResponseBodySize is an instrument used to record metric values +// conforming to the "http.client.response.body.size" semantic conventions. It +// represents the size of HTTP client response bodies. +type ClientResponseBodySize struct { + metric.Int64Histogram +} + +var newClientResponseBodySizeOpts = []metric.Int64HistogramOption{ + metric.WithDescription("Size of HTTP client response bodies."), + metric.WithUnit("By"), +} + +// NewClientResponseBodySize returns a new ClientResponseBodySize instrument. +func NewClientResponseBodySize( + m metric.Meter, + opt ...metric.Int64HistogramOption, +) (ClientResponseBodySize, error) { + // Check if the meter is nil. + if m == nil { + return ClientResponseBodySize{noop.Int64Histogram{}}, nil + } + + if len(opt) == 0 { + opt = newClientResponseBodySizeOpts + } else { + opt = append(opt, newClientResponseBodySizeOpts...) + } + + i, err := m.Int64Histogram( + "http.client.response.body.size", + opt..., + ) + if err != nil { + return ClientResponseBodySize{noop.Int64Histogram{}}, err + } + return ClientResponseBodySize{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ClientResponseBodySize) Inst() metric.Int64Histogram { + return m.Int64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ClientResponseBodySize) Name() string { + return "http.client.response.body.size" +} + +// Unit returns the semantic convention unit of the instrument +func (ClientResponseBodySize) Unit() string { + return "By" +} + +// Description returns the semantic convention description of the instrument +func (ClientResponseBodySize) Description() string { + return "Size of HTTP client response bodies." +} + +// Record records val to the current distribution for attrs. +// +// The requestMethod is the HTTP request method. +// +// The serverAddress is the server domain name if available without reverse DNS +// lookup; otherwise, IP address or Unix domain socket name. +// +// The serverPort is the server port number. +// +// All additional attrs passed are included in the recorded value. +// +// The size of the response payload body in bytes. This is the number of bytes +// transferred excluding headers and is often, but not always, present as the +// [Content-Length] header. For requests using transport encoding, this should be +// the compressed size. +// +// [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length +func (m ClientResponseBodySize) Record( + ctx context.Context, + val int64, + requestMethod RequestMethodAttr, + serverAddress string, + serverPort int, + attrs ...attribute.KeyValue, +) { + if !m.Int64Histogram.Enabled(ctx) { + return + } + if len(attrs) == 0 { + m.Int64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("http.request.method", string(requestMethod)), + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )) + return + } + + o := metricpool.RecordOptions() + defer metricpool.PutRecordOptions(o) + + *o = append( + *o, + metric.WithAttributes( + append( + attrs[:len(attrs):len(attrs)], + attribute.String("http.request.method", string(requestMethod)), + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )..., + ), + ) + + m.Int64Histogram.Record(ctx, val, *o...) +} + +// RecordSet records val to the current distribution for set. +// +// The size of the response payload body in bytes. This is the number of bytes +// transferred excluding headers and is often, but not always, present as the +// [Content-Length] header. For requests using transport encoding, this should be +// the compressed size. +// +// [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length +func (m ClientResponseBodySize) RecordSet(ctx context.Context, val int64, set attribute.Set) { + if !m.Int64Histogram.Enabled(ctx) { + return + } + if set.Len() == 0 { + m.Int64Histogram.Record(ctx, val) + return + } + + o := metricpool.RecordOptions() + defer metricpool.PutRecordOptions(o) + + *o = append(*o, metric.WithAttributeSet(set)) + m.Int64Histogram.Record(ctx, val, *o...) +} + +// AttrErrorType returns an optional attribute for the "error.type" semantic +// convention. It represents the describes a class of error the operation ended +// with. +func (ClientResponseBodySize) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { + return attribute.String("error.type", string(val)) +} + +// AttrResponseStatusCode returns an optional attribute for the +// "http.response.status_code" semantic convention. It represents the +// [HTTP response status code]. +// +// [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6 +func (ClientResponseBodySize) AttrResponseStatusCode(val int) attribute.KeyValue { + return attribute.Int("http.response.status_code", val) +} + +// AttrNetworkProtocolName returns an optional attribute for the +// "network.protocol.name" semantic convention. It represents the +// [OSI application layer] or non-OSI equivalent. +// +// [OSI application layer]: https://wikipedia.org/wiki/Application_layer +func (ClientResponseBodySize) AttrNetworkProtocolName(val string) attribute.KeyValue { + return attribute.String("network.protocol.name", val) +} + +// AttrURLTemplate returns an optional attribute for the "url.template" semantic +// convention. It represents the low-cardinality template of an +// [absolute path reference]. +// +// [absolute path reference]: https://www.rfc-editor.org/rfc/rfc3986#section-4.2 +func (ClientResponseBodySize) AttrURLTemplate(val string) attribute.KeyValue { + return attribute.String("url.template", val) +} + +// AttrNetworkProtocolVersion returns an optional attribute for the +// "network.protocol.version" semantic convention. It represents the actual +// version of the protocol used for network communication. +func (ClientResponseBodySize) AttrNetworkProtocolVersion(val string) attribute.KeyValue { + return attribute.String("network.protocol.version", val) +} + +// AttrURLScheme returns an optional attribute for the "url.scheme" semantic +// convention. It represents the [URI scheme] component identifying the used +// protocol. +// +// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 +func (ClientResponseBodySize) AttrURLScheme(val string) attribute.KeyValue { + return attribute.String("url.scheme", val) +} + +// ServerActiveRequests is an instrument used to record metric values conforming +// to the "http.server.active_requests" semantic conventions. It represents the +// number of active HTTP server requests. +type ServerActiveRequests struct { + metric.Int64UpDownCounter +} + +var newServerActiveRequestsOpts = []metric.Int64UpDownCounterOption{ + metric.WithDescription("Number of active HTTP server requests."), + metric.WithUnit("{request}"), +} + +// NewServerActiveRequests returns a new ServerActiveRequests instrument. +func NewServerActiveRequests( + m metric.Meter, + opt ...metric.Int64UpDownCounterOption, +) (ServerActiveRequests, error) { + // Check if the meter is nil. + if m == nil { + return ServerActiveRequests{noop.Int64UpDownCounter{}}, nil + } + + if len(opt) == 0 { + opt = newServerActiveRequestsOpts + } else { + opt = append(opt, newServerActiveRequestsOpts...) + } + + i, err := m.Int64UpDownCounter( + "http.server.active_requests", + opt..., + ) + if err != nil { + return ServerActiveRequests{noop.Int64UpDownCounter{}}, err + } + return ServerActiveRequests{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ServerActiveRequests) Inst() metric.Int64UpDownCounter { + return m.Int64UpDownCounter +} + +// Name returns the semantic convention name of the instrument. +func (ServerActiveRequests) Name() string { + return "http.server.active_requests" +} + +// Unit returns the semantic convention unit of the instrument +func (ServerActiveRequests) Unit() string { + return "{request}" +} + +// Description returns the semantic convention description of the instrument +func (ServerActiveRequests) Description() string { + return "Number of active HTTP server requests." +} + +// Add adds incr to the existing count for attrs. +// +// The requestMethod is the HTTP request method. +// +// The urlScheme is the the [URI scheme] component identifying the used protocol. +// +// All additional attrs passed are included in the recorded value. +// +// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 +func (m ServerActiveRequests) Add( + ctx context.Context, + incr int64, + requestMethod RequestMethodAttr, + urlScheme string, + attrs ...attribute.KeyValue, +) { + if !m.Int64UpDownCounter.Enabled(ctx) { + return + } + if len(attrs) == 0 { + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("http.request.method", string(requestMethod)), + attribute.String("url.scheme", urlScheme), + )) + return + } + + o := metricpool.AddOptions() + defer metricpool.PutAddOptions(o) + + *o = append( + *o, + metric.WithAttributes( + append( + attrs[:len(attrs):len(attrs)], + attribute.String("http.request.method", string(requestMethod)), + attribute.String("url.scheme", urlScheme), + )..., + ), + ) + + m.Int64UpDownCounter.Add(ctx, incr, *o...) +} + +// AddSet adds incr to the existing count for set. +func (m ServerActiveRequests) AddSet(ctx context.Context, incr int64, set attribute.Set) { + if !m.Int64UpDownCounter.Enabled(ctx) { + return + } + if set.Len() == 0 { + m.Int64UpDownCounter.Add(ctx, incr) + return + } + + o := metricpool.AddOptions() + defer metricpool.PutAddOptions(o) + + *o = append(*o, metric.WithAttributeSet(set)) + m.Int64UpDownCounter.Add(ctx, incr, *o...) +} + +// AttrServerAddress returns an optional attribute for the "server.address" +// semantic convention. It represents the name of the local HTTP server that +// received the request. +func (ServerActiveRequests) AttrServerAddress(val string) attribute.KeyValue { + return attribute.String("server.address", val) +} + +// AttrServerPort returns an optional attribute for the "server.port" semantic +// convention. It represents the port of the local HTTP server that received the +// request. +func (ServerActiveRequests) AttrServerPort(val int) attribute.KeyValue { + return attribute.Int("server.port", val) +} + +// ServerActiveRequestsObservable is an instrument used to record metric values +// conforming to the "http.server.active_requests" semantic conventions. It +// represents the number of active HTTP server requests. +type ServerActiveRequestsObservable struct { + metric.Int64ObservableUpDownCounter +} + +var newServerActiveRequestsObservableOpts = []metric.Int64ObservableUpDownCounterOption{ + metric.WithDescription("Number of active HTTP server requests."), + metric.WithUnit("{request}"), +} + +// NewServerActiveRequestsObservable returns a new ServerActiveRequestsObservable +// instrument. +func NewServerActiveRequestsObservable( + m metric.Meter, + opt ...metric.Int64ObservableUpDownCounterOption, +) (ServerActiveRequestsObservable, error) { + // Check if the meter is nil. + if m == nil { + return ServerActiveRequestsObservable{noop.Int64ObservableUpDownCounter{}}, nil + } + + if len(opt) == 0 { + opt = newServerActiveRequestsObservableOpts + } else { + opt = append(opt, newServerActiveRequestsObservableOpts...) + } + + i, err := m.Int64ObservableUpDownCounter( + "http.server.active_requests", + opt..., + ) + if err != nil { + return ServerActiveRequestsObservable{noop.Int64ObservableUpDownCounter{}}, err + } + return ServerActiveRequestsObservable{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ServerActiveRequestsObservable) Inst() metric.Int64ObservableUpDownCounter { + return m.Int64ObservableUpDownCounter +} + +// Name returns the semantic convention name of the instrument. +func (ServerActiveRequestsObservable) Name() string { + return "http.server.active_requests" +} + +// Unit returns the semantic convention unit of the instrument +func (ServerActiveRequestsObservable) Unit() string { + return "{request}" +} + +// Description returns the semantic convention description of the instrument +func (ServerActiveRequestsObservable) Description() string { + return "Number of active HTTP server requests." +} + +// AttrRequestMethod returns a required attribute for the "http.request.method" +// semantic convention. It represents the HTTP request method. +func (ServerActiveRequestsObservable) AttrRequestMethod(val RequestMethodAttr) attribute.KeyValue { + return attribute.String("http.request.method", string(val)) +} + +// AttrURLScheme returns a required attribute for the "url.scheme" semantic +// convention. It represents the [URI scheme] component identifying the used +// protocol. +// +// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 +func (ServerActiveRequestsObservable) AttrURLScheme(val string) attribute.KeyValue { + return attribute.String("url.scheme", val) +} + +// AttrServerAddress returns an optional attribute for the "server.address" +// semantic convention. It represents the name of the local HTTP server that +// received the request. +func (ServerActiveRequestsObservable) AttrServerAddress(val string) attribute.KeyValue { + return attribute.String("server.address", val) +} + +// AttrServerPort returns an optional attribute for the "server.port" semantic +// convention. It represents the port of the local HTTP server that received the +// request. +func (ServerActiveRequestsObservable) AttrServerPort(val int) attribute.KeyValue { + return attribute.Int("server.port", val) +} + +// ServerRequestBodySize is an instrument used to record metric values conforming +// to the "http.server.request.body.size" semantic conventions. It represents the +// size of HTTP server request bodies. +type ServerRequestBodySize struct { + metric.Int64Histogram +} + +var newServerRequestBodySizeOpts = []metric.Int64HistogramOption{ + metric.WithDescription("Size of HTTP server request bodies."), + metric.WithUnit("By"), +} + +// NewServerRequestBodySize returns a new ServerRequestBodySize instrument. +func NewServerRequestBodySize( + m metric.Meter, + opt ...metric.Int64HistogramOption, +) (ServerRequestBodySize, error) { + // Check if the meter is nil. + if m == nil { + return ServerRequestBodySize{noop.Int64Histogram{}}, nil + } + + if len(opt) == 0 { + opt = newServerRequestBodySizeOpts + } else { + opt = append(opt, newServerRequestBodySizeOpts...) + } + + i, err := m.Int64Histogram( + "http.server.request.body.size", + opt..., + ) + if err != nil { + return ServerRequestBodySize{noop.Int64Histogram{}}, err + } + return ServerRequestBodySize{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ServerRequestBodySize) Inst() metric.Int64Histogram { + return m.Int64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ServerRequestBodySize) Name() string { + return "http.server.request.body.size" +} + +// Unit returns the semantic convention unit of the instrument +func (ServerRequestBodySize) Unit() string { + return "By" +} + +// Description returns the semantic convention description of the instrument +func (ServerRequestBodySize) Description() string { + return "Size of HTTP server request bodies." +} + +// Record records val to the current distribution for attrs. +// +// The requestMethod is the HTTP request method. +// +// The urlScheme is the the [URI scheme] component identifying the used protocol. +// +// All additional attrs passed are included in the recorded value. +// +// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 +// +// The size of the request payload body in bytes. This is the number of bytes +// transferred excluding headers and is often, but not always, present as the +// [Content-Length] header. For requests using transport encoding, this should be +// the compressed size. +// +// [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length +func (m ServerRequestBodySize) Record( + ctx context.Context, + val int64, + requestMethod RequestMethodAttr, + urlScheme string, + attrs ...attribute.KeyValue, +) { + if !m.Int64Histogram.Enabled(ctx) { + return + } + if len(attrs) == 0 { + m.Int64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("http.request.method", string(requestMethod)), + attribute.String("url.scheme", urlScheme), + )) + return + } + + o := metricpool.RecordOptions() + defer metricpool.PutRecordOptions(o) + + *o = append( + *o, + metric.WithAttributes( + append( + attrs[:len(attrs):len(attrs)], + attribute.String("http.request.method", string(requestMethod)), + attribute.String("url.scheme", urlScheme), + )..., + ), + ) + + m.Int64Histogram.Record(ctx, val, *o...) +} + +// RecordSet records val to the current distribution for set. +// +// The size of the request payload body in bytes. This is the number of bytes +// transferred excluding headers and is often, but not always, present as the +// [Content-Length] header. For requests using transport encoding, this should be +// the compressed size. +// +// [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length +func (m ServerRequestBodySize) RecordSet(ctx context.Context, val int64, set attribute.Set) { + if !m.Int64Histogram.Enabled(ctx) { + return + } + if set.Len() == 0 { + m.Int64Histogram.Record(ctx, val) + return + } + + o := metricpool.RecordOptions() + defer metricpool.PutRecordOptions(o) + + *o = append(*o, metric.WithAttributeSet(set)) + m.Int64Histogram.Record(ctx, val, *o...) +} + +// AttrErrorType returns an optional attribute for the "error.type" semantic +// convention. It represents the describes a class of error the operation ended +// with. +func (ServerRequestBodySize) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { + return attribute.String("error.type", string(val)) +} + +// AttrResponseStatusCode returns an optional attribute for the +// "http.response.status_code" semantic convention. It represents the +// [HTTP response status code]. +// +// [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6 +func (ServerRequestBodySize) AttrResponseStatusCode(val int) attribute.KeyValue { + return attribute.Int("http.response.status_code", val) +} + +// AttrRoute returns an optional attribute for the "http.route" semantic +// convention. It represents the matched route template for the request. This +// MUST be low-cardinality and include all static path segments, with dynamic +// path segments represented with placeholders. +func (ServerRequestBodySize) AttrRoute(val string) attribute.KeyValue { + return attribute.String("http.route", val) +} + +// AttrNetworkProtocolName returns an optional attribute for the +// "network.protocol.name" semantic convention. It represents the +// [OSI application layer] or non-OSI equivalent. +// +// [OSI application layer]: https://wikipedia.org/wiki/Application_layer +func (ServerRequestBodySize) AttrNetworkProtocolName(val string) attribute.KeyValue { + return attribute.String("network.protocol.name", val) +} + +// AttrNetworkProtocolVersion returns an optional attribute for the +// "network.protocol.version" semantic convention. It represents the actual +// version of the protocol used for network communication. +func (ServerRequestBodySize) AttrNetworkProtocolVersion(val string) attribute.KeyValue { + return attribute.String("network.protocol.version", val) +} + +// AttrServerAddress returns an optional attribute for the "server.address" +// semantic convention. It represents the name of the local HTTP server that +// received the request. +func (ServerRequestBodySize) AttrServerAddress(val string) attribute.KeyValue { + return attribute.String("server.address", val) +} + +// AttrServerPort returns an optional attribute for the "server.port" semantic +// convention. It represents the port of the local HTTP server that received the +// request. +func (ServerRequestBodySize) AttrServerPort(val int) attribute.KeyValue { + return attribute.Int("server.port", val) +} + +// AttrUserAgentSyntheticType returns an optional attribute for the +// "user_agent.synthetic.type" semantic convention. It represents the specifies +// the category of synthetic traffic, such as tests or bots. +func (ServerRequestBodySize) AttrUserAgentSyntheticType(val UserAgentSyntheticTypeAttr) attribute.KeyValue { + return attribute.String("user_agent.synthetic.type", string(val)) +} + +// ServerRequestDuration is an instrument used to record metric values conforming +// to the "http.server.request.duration" semantic conventions. It represents the +// duration of HTTP server requests. +type ServerRequestDuration struct { + metric.Float64Histogram +} + +var newServerRequestDurationOpts = []metric.Float64HistogramOption{ + metric.WithDescription("Duration of HTTP server requests."), + metric.WithUnit("s"), + metric.WithExplicitBucketBoundaries([]float64{0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10}...), +} + +// NewServerRequestDuration returns a new ServerRequestDuration instrument. +func NewServerRequestDuration( + m metric.Meter, + opt ...metric.Float64HistogramOption, +) (ServerRequestDuration, error) { + // Check if the meter is nil. + if m == nil { + return ServerRequestDuration{noop.Float64Histogram{}}, nil + } + + if len(opt) == 0 { + opt = newServerRequestDurationOpts + } else { + opt = append(opt, newServerRequestDurationOpts...) + } + + i, err := m.Float64Histogram( + "http.server.request.duration", + opt..., + ) + if err != nil { + return ServerRequestDuration{noop.Float64Histogram{}}, err + } + return ServerRequestDuration{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ServerRequestDuration) Inst() metric.Float64Histogram { + return m.Float64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ServerRequestDuration) Name() string { + return "http.server.request.duration" +} + +// Unit returns the semantic convention unit of the instrument +func (ServerRequestDuration) Unit() string { + return "s" +} + +// Description returns the semantic convention description of the instrument +func (ServerRequestDuration) Description() string { + return "Duration of HTTP server requests." +} + +// Record records val to the current distribution for attrs. +// +// The requestMethod is the HTTP request method. +// +// The urlScheme is the the [URI scheme] component identifying the used protocol. +// +// All additional attrs passed are included in the recorded value. +// +// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 +func (m ServerRequestDuration) Record( + ctx context.Context, + val float64, + requestMethod RequestMethodAttr, + urlScheme string, + attrs ...attribute.KeyValue, +) { + if !m.Float64Histogram.Enabled(ctx) { + return + } + if len(attrs) == 0 { + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("http.request.method", string(requestMethod)), + attribute.String("url.scheme", urlScheme), + )) + return + } + + o := metricpool.RecordOptions() + defer metricpool.PutRecordOptions(o) + + *o = append( + *o, + metric.WithAttributes( + append( + attrs[:len(attrs):len(attrs)], + attribute.String("http.request.method", string(requestMethod)), + attribute.String("url.scheme", urlScheme), + )..., + ), + ) + + m.Float64Histogram.Record(ctx, val, *o...) +} + +// RecordSet records val to the current distribution for set. +func (m ServerRequestDuration) RecordSet(ctx context.Context, val float64, set attribute.Set) { + if !m.Float64Histogram.Enabled(ctx) { + return + } + if set.Len() == 0 { + m.Float64Histogram.Record(ctx, val) + return + } + + o := metricpool.RecordOptions() + defer metricpool.PutRecordOptions(o) + + *o = append(*o, metric.WithAttributeSet(set)) + m.Float64Histogram.Record(ctx, val, *o...) +} + +// AttrErrorType returns an optional attribute for the "error.type" semantic +// convention. It represents the describes a class of error the operation ended +// with. +func (ServerRequestDuration) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { + return attribute.String("error.type", string(val)) +} + +// AttrResponseStatusCode returns an optional attribute for the +// "http.response.status_code" semantic convention. It represents the +// [HTTP response status code]. +// +// [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6 +func (ServerRequestDuration) AttrResponseStatusCode(val int) attribute.KeyValue { + return attribute.Int("http.response.status_code", val) +} + +// AttrRoute returns an optional attribute for the "http.route" semantic +// convention. It represents the matched route template for the request. This +// MUST be low-cardinality and include all static path segments, with dynamic +// path segments represented with placeholders. +func (ServerRequestDuration) AttrRoute(val string) attribute.KeyValue { + return attribute.String("http.route", val) +} + +// AttrNetworkProtocolName returns an optional attribute for the +// "network.protocol.name" semantic convention. It represents the +// [OSI application layer] or non-OSI equivalent. +// +// [OSI application layer]: https://wikipedia.org/wiki/Application_layer +func (ServerRequestDuration) AttrNetworkProtocolName(val string) attribute.KeyValue { + return attribute.String("network.protocol.name", val) +} + +// AttrNetworkProtocolVersion returns an optional attribute for the +// "network.protocol.version" semantic convention. It represents the actual +// version of the protocol used for network communication. +func (ServerRequestDuration) AttrNetworkProtocolVersion(val string) attribute.KeyValue { + return attribute.String("network.protocol.version", val) +} + +// AttrServerAddress returns an optional attribute for the "server.address" +// semantic convention. It represents the name of the local HTTP server that +// received the request. +func (ServerRequestDuration) AttrServerAddress(val string) attribute.KeyValue { + return attribute.String("server.address", val) +} + +// AttrServerPort returns an optional attribute for the "server.port" semantic +// convention. It represents the port of the local HTTP server that received the +// request. +func (ServerRequestDuration) AttrServerPort(val int) attribute.KeyValue { + return attribute.Int("server.port", val) +} + +// AttrUserAgentSyntheticType returns an optional attribute for the +// "user_agent.synthetic.type" semantic convention. It represents the specifies +// the category of synthetic traffic, such as tests or bots. +func (ServerRequestDuration) AttrUserAgentSyntheticType(val UserAgentSyntheticTypeAttr) attribute.KeyValue { + return attribute.String("user_agent.synthetic.type", string(val)) +} + +// ServerResponseBodySize is an instrument used to record metric values +// conforming to the "http.server.response.body.size" semantic conventions. It +// represents the size of HTTP server response bodies. +type ServerResponseBodySize struct { + metric.Int64Histogram +} + +var newServerResponseBodySizeOpts = []metric.Int64HistogramOption{ + metric.WithDescription("Size of HTTP server response bodies."), + metric.WithUnit("By"), +} + +// NewServerResponseBodySize returns a new ServerResponseBodySize instrument. +func NewServerResponseBodySize( + m metric.Meter, + opt ...metric.Int64HistogramOption, +) (ServerResponseBodySize, error) { + // Check if the meter is nil. + if m == nil { + return ServerResponseBodySize{noop.Int64Histogram{}}, nil + } + + if len(opt) == 0 { + opt = newServerResponseBodySizeOpts + } else { + opt = append(opt, newServerResponseBodySizeOpts...) + } + + i, err := m.Int64Histogram( + "http.server.response.body.size", + opt..., + ) + if err != nil { + return ServerResponseBodySize{noop.Int64Histogram{}}, err + } + return ServerResponseBodySize{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ServerResponseBodySize) Inst() metric.Int64Histogram { + return m.Int64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ServerResponseBodySize) Name() string { + return "http.server.response.body.size" +} + +// Unit returns the semantic convention unit of the instrument +func (ServerResponseBodySize) Unit() string { + return "By" +} + +// Description returns the semantic convention description of the instrument +func (ServerResponseBodySize) Description() string { + return "Size of HTTP server response bodies." +} + +// Record records val to the current distribution for attrs. +// +// The requestMethod is the HTTP request method. +// +// The urlScheme is the the [URI scheme] component identifying the used protocol. +// +// All additional attrs passed are included in the recorded value. +// +// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 +// +// The size of the response payload body in bytes. This is the number of bytes +// transferred excluding headers and is often, but not always, present as the +// [Content-Length] header. For requests using transport encoding, this should be +// the compressed size. +// +// [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length +func (m ServerResponseBodySize) Record( + ctx context.Context, + val int64, + requestMethod RequestMethodAttr, + urlScheme string, + attrs ...attribute.KeyValue, +) { + if !m.Int64Histogram.Enabled(ctx) { + return + } + if len(attrs) == 0 { + m.Int64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("http.request.method", string(requestMethod)), + attribute.String("url.scheme", urlScheme), + )) + return + } + + o := metricpool.RecordOptions() + defer metricpool.PutRecordOptions(o) + + *o = append( + *o, + metric.WithAttributes( + append( + attrs[:len(attrs):len(attrs)], + attribute.String("http.request.method", string(requestMethod)), + attribute.String("url.scheme", urlScheme), + )..., + ), + ) + + m.Int64Histogram.Record(ctx, val, *o...) +} + +// RecordSet records val to the current distribution for set. +// +// The size of the response payload body in bytes. This is the number of bytes +// transferred excluding headers and is often, but not always, present as the +// [Content-Length] header. For requests using transport encoding, this should be +// the compressed size. +// +// [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length +func (m ServerResponseBodySize) RecordSet(ctx context.Context, val int64, set attribute.Set) { + if !m.Int64Histogram.Enabled(ctx) { + return + } + if set.Len() == 0 { + m.Int64Histogram.Record(ctx, val) + return + } + + o := metricpool.RecordOptions() + defer metricpool.PutRecordOptions(o) + + *o = append(*o, metric.WithAttributeSet(set)) + m.Int64Histogram.Record(ctx, val, *o...) +} + +// AttrErrorType returns an optional attribute for the "error.type" semantic +// convention. It represents the describes a class of error the operation ended +// with. +func (ServerResponseBodySize) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { + return attribute.String("error.type", string(val)) +} + +// AttrResponseStatusCode returns an optional attribute for the +// "http.response.status_code" semantic convention. It represents the +// [HTTP response status code]. +// +// [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6 +func (ServerResponseBodySize) AttrResponseStatusCode(val int) attribute.KeyValue { + return attribute.Int("http.response.status_code", val) +} + +// AttrRoute returns an optional attribute for the "http.route" semantic +// convention. It represents the matched route template for the request. This +// MUST be low-cardinality and include all static path segments, with dynamic +// path segments represented with placeholders. +func (ServerResponseBodySize) AttrRoute(val string) attribute.KeyValue { + return attribute.String("http.route", val) +} + +// AttrNetworkProtocolName returns an optional attribute for the +// "network.protocol.name" semantic convention. It represents the +// [OSI application layer] or non-OSI equivalent. +// +// [OSI application layer]: https://wikipedia.org/wiki/Application_layer +func (ServerResponseBodySize) AttrNetworkProtocolName(val string) attribute.KeyValue { + return attribute.String("network.protocol.name", val) +} + +// AttrNetworkProtocolVersion returns an optional attribute for the +// "network.protocol.version" semantic convention. It represents the actual +// version of the protocol used for network communication. +func (ServerResponseBodySize) AttrNetworkProtocolVersion(val string) attribute.KeyValue { + return attribute.String("network.protocol.version", val) +} + +// AttrServerAddress returns an optional attribute for the "server.address" +// semantic convention. It represents the name of the local HTTP server that +// received the request. +func (ServerResponseBodySize) AttrServerAddress(val string) attribute.KeyValue { + return attribute.String("server.address", val) +} + +// AttrServerPort returns an optional attribute for the "server.port" semantic +// convention. It represents the port of the local HTTP server that received the +// request. +func (ServerResponseBodySize) AttrServerPort(val int) attribute.KeyValue { + return attribute.Int("server.port", val) +} + +// AttrUserAgentSyntheticType returns an optional attribute for the +// "user_agent.synthetic.type" semantic convention. It represents the specifies +// the category of synthetic traffic, such as tests or bots. +func (ServerResponseBodySize) AttrUserAgentSyntheticType(val UserAgentSyntheticTypeAttr) attribute.KeyValue { + return attribute.String("user_agent.synthetic.type", string(val)) +} diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.43.0/otelconv/metric.go b/vendor/go.opentelemetry.io/otel/semconv/v1.43.0/otelconv/metric.go new file mode 100644 index 00000000000..9eaf0fd9a2d --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.43.0/otelconv/metric.go @@ -0,0 +1,3197 @@ +// Code generated from semantic convention specification. DO NOT EDIT. + +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Package otelconv provides types and functionality for OpenTelemetry semantic +// conventions in the "otel" namespace. +package otelconv + +import ( + "context" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/metric/noop" + "go.opentelemetry.io/otel/semconv/internal/metricpool" +) + +// ErrorTypeAttr is an attribute conforming to the error.type semantic +// conventions. It represents the describes a class of error the operation ended +// with. +type ErrorTypeAttr string + +var ( + // ErrorTypeOther is a fallback error value to be used when the instrumentation + // doesn't define a custom value. + ErrorTypeOther ErrorTypeAttr = "_OTHER" +) + +// ComponentTypeAttr is an attribute conforming to the otel.component.type +// semantic conventions. It represents a name identifying the type of the +// OpenTelemetry component. +type ComponentTypeAttr string + +var ( + // ComponentTypeBatchingSpanProcessor is the builtin SDK batching span + // processor. + ComponentTypeBatchingSpanProcessor ComponentTypeAttr = "batching_span_processor" + // ComponentTypeSimpleSpanProcessor is the builtin SDK simple span processor. + ComponentTypeSimpleSpanProcessor ComponentTypeAttr = "simple_span_processor" + // ComponentTypeBatchingLogProcessor is the builtin SDK batching log record + // processor. + ComponentTypeBatchingLogProcessor ComponentTypeAttr = "batching_log_processor" + // ComponentTypeSimpleLogProcessor is the builtin SDK simple log record + // processor. + ComponentTypeSimpleLogProcessor ComponentTypeAttr = "simple_log_processor" + // ComponentTypeOtlpGRPCSpanExporter is the OTLP span exporter over gRPC with + // protobuf serialization. + ComponentTypeOtlpGRPCSpanExporter ComponentTypeAttr = "otlp_grpc_span_exporter" + // ComponentTypeOtlpHTTPSpanExporter is the OTLP span exporter over HTTP with + // protobuf serialization. + ComponentTypeOtlpHTTPSpanExporter ComponentTypeAttr = "otlp_http_span_exporter" + // ComponentTypeOtlpHTTPJSONSpanExporter is the OTLP span exporter over HTTP + // with JSON serialization. + ComponentTypeOtlpHTTPJSONSpanExporter ComponentTypeAttr = "otlp_http_json_span_exporter" + // ComponentTypeZipkinHTTPSpanExporter is the zipkin span exporter over HTTP. + ComponentTypeZipkinHTTPSpanExporter ComponentTypeAttr = "zipkin_http_span_exporter" + // ComponentTypeOtlpGRPCLogExporter is the OTLP log record exporter over gRPC + // with protobuf serialization. + ComponentTypeOtlpGRPCLogExporter ComponentTypeAttr = "otlp_grpc_log_exporter" + // ComponentTypeOtlpHTTPLogExporter is the OTLP log record exporter over HTTP + // with protobuf serialization. + ComponentTypeOtlpHTTPLogExporter ComponentTypeAttr = "otlp_http_log_exporter" + // ComponentTypeOtlpHTTPJSONLogExporter is the OTLP log record exporter over + // HTTP with JSON serialization. + ComponentTypeOtlpHTTPJSONLogExporter ComponentTypeAttr = "otlp_http_json_log_exporter" + // ComponentTypePeriodicMetricReader is the builtin SDK periodically exporting + // metric reader. + ComponentTypePeriodicMetricReader ComponentTypeAttr = "periodic_metric_reader" + // ComponentTypeOtlpGRPCMetricExporter is the OTLP metric exporter over gRPC + // with protobuf serialization. + ComponentTypeOtlpGRPCMetricExporter ComponentTypeAttr = "otlp_grpc_metric_exporter" + // ComponentTypeOtlpHTTPMetricExporter is the OTLP metric exporter over HTTP + // with protobuf serialization. + ComponentTypeOtlpHTTPMetricExporter ComponentTypeAttr = "otlp_http_metric_exporter" + // ComponentTypeOtlpHTTPJSONMetricExporter is the OTLP metric exporter over HTTP + // with JSON serialization. + ComponentTypeOtlpHTTPJSONMetricExporter ComponentTypeAttr = "otlp_http_json_metric_exporter" + // ComponentTypePrometheusHTTPTextMetricExporter is the prometheus metric + // exporter over HTTP with the default text-based format. + ComponentTypePrometheusHTTPTextMetricExporter ComponentTypeAttr = "prometheus_http_text_metric_exporter" +) + +// SpanParentOriginAttr is an attribute conforming to the otel.span.parent.origin +// semantic conventions. It represents the determines whether the span has a +// parent span, and if so, [whether it is a remote parent]. +// +// [whether it is a remote parent]: https://opentelemetry.io/docs/specs/otel/trace/api/#isremote +type SpanParentOriginAttr string + +var ( + // SpanParentOriginNone is the span does not have a parent, it is a root span. + SpanParentOriginNone SpanParentOriginAttr = "none" + // SpanParentOriginLocal is the span has a parent and the parent's span context + // [isRemote()] is false. + // + // [isRemote()]: https://opentelemetry.io/docs/specs/otel/trace/api/#isremote + SpanParentOriginLocal SpanParentOriginAttr = "local" + // SpanParentOriginRemote is the span has a parent and the parent's span context + // [isRemote()] is true. + // + // [isRemote()]: https://opentelemetry.io/docs/specs/otel/trace/api/#isremote + SpanParentOriginRemote SpanParentOriginAttr = "remote" +) + +// SpanSamplingResultAttr is an attribute conforming to the +// otel.span.sampling_result semantic conventions. It represents the result value +// of the sampler for this span. +type SpanSamplingResultAttr string + +var ( + // SpanSamplingResultDrop is the span is not sampled and not recording. + SpanSamplingResultDrop SpanSamplingResultAttr = "DROP" + // SpanSamplingResultRecordOnly is the span is not sampled, but recording. + SpanSamplingResultRecordOnly SpanSamplingResultAttr = "RECORD_ONLY" + // SpanSamplingResultRecordAndSample is the span is sampled and recording. + SpanSamplingResultRecordAndSample SpanSamplingResultAttr = "RECORD_AND_SAMPLE" +) + +// SDKExporterLogExported is an instrument used to record metric values +// conforming to the "otel.sdk.exporter.log.exported" semantic conventions. It +// represents the number of log records for which the export has finished, either +// successful or failed. +type SDKExporterLogExported struct { + metric.Int64Counter +} + +var newSDKExporterLogExportedOpts = []metric.Int64CounterOption{ + metric.WithDescription("The number of log records for which the export has finished, either successful or failed."), + metric.WithUnit("{log_record}"), +} + +// NewSDKExporterLogExported returns a new SDKExporterLogExported instrument. +func NewSDKExporterLogExported( + m metric.Meter, + opt ...metric.Int64CounterOption, +) (SDKExporterLogExported, error) { + // Check if the meter is nil. + if m == nil { + return SDKExporterLogExported{noop.Int64Counter{}}, nil + } + + if len(opt) == 0 { + opt = newSDKExporterLogExportedOpts + } else { + opt = append(opt, newSDKExporterLogExportedOpts...) + } + + i, err := m.Int64Counter( + "otel.sdk.exporter.log.exported", + opt..., + ) + if err != nil { + return SDKExporterLogExported{noop.Int64Counter{}}, err + } + return SDKExporterLogExported{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m SDKExporterLogExported) Inst() metric.Int64Counter { + return m.Int64Counter +} + +// Name returns the semantic convention name of the instrument. +func (SDKExporterLogExported) Name() string { + return "otel.sdk.exporter.log.exported" +} + +// Unit returns the semantic convention unit of the instrument +func (SDKExporterLogExported) Unit() string { + return "{log_record}" +} + +// Description returns the semantic convention description of the instrument +func (SDKExporterLogExported) Description() string { + return "The number of log records for which the export has finished, either successful or failed." +} + +// Add adds incr to the existing count for attrs. +// +// All additional attrs passed are included in the recorded value. +// +// For successful exports, `error.type` MUST NOT be set. For failed exports, +// `error.type` MUST contain the failure cause. +// For exporters with partial success semantics (e.g. OTLP with +// `rejected_log_records`), rejected log records MUST count as failed and only +// non-rejected log records count as success. +// If no rejection reason is available, `rejected` SHOULD be used as value for +// `error.type`. +// If the exporter retries failed export attempts, the export operation is +// considered finished only after the final attempt has concluded. +// Each log record MUST be counted exactly once per export operation: +// intermediate failed attempts that are followed by a retry MUST NOT increment +// the counter, +// and `error.type` reflects the cause of the final attempt. +func (m SDKExporterLogExported) Add( + ctx context.Context, + incr int64, + attrs ...attribute.KeyValue, +) { + if !m.Int64Counter.Enabled(ctx) { + return + } + if len(attrs) == 0 { + m.Int64Counter.Add(ctx, incr) + return + } + + o := metricpool.AddOptions() + defer metricpool.PutAddOptions(o) + + *o = append( + *o, + metric.WithAttributes( + attrs..., + ), + ) + + m.Int64Counter.Add(ctx, incr, *o...) +} + +// AddSet adds incr to the existing count for set. +// +// For successful exports, `error.type` MUST NOT be set. For failed exports, +// `error.type` MUST contain the failure cause. +// For exporters with partial success semantics (e.g. OTLP with +// `rejected_log_records`), rejected log records MUST count as failed and only +// non-rejected log records count as success. +// If no rejection reason is available, `rejected` SHOULD be used as value for +// `error.type`. +// If the exporter retries failed export attempts, the export operation is +// considered finished only after the final attempt has concluded. +// Each log record MUST be counted exactly once per export operation: +// intermediate failed attempts that are followed by a retry MUST NOT increment +// the counter, +// and `error.type` reflects the cause of the final attempt. +func (m SDKExporterLogExported) AddSet(ctx context.Context, incr int64, set attribute.Set) { + if !m.Int64Counter.Enabled(ctx) { + return + } + if set.Len() == 0 { + m.Int64Counter.Add(ctx, incr) + return + } + + o := metricpool.AddOptions() + defer metricpool.PutAddOptions(o) + + *o = append(*o, metric.WithAttributeSet(set)) + m.Int64Counter.Add(ctx, incr, *o...) +} + +// AttrErrorType returns an optional attribute for the "error.type" semantic +// convention. It represents the describes a class of error the operation ended +// with. +func (SDKExporterLogExported) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { + return attribute.String("error.type", string(val)) +} + +// AttrComponentName returns an optional attribute for the "otel.component.name" +// semantic convention. It represents a name uniquely identifying the instance of +// the OpenTelemetry component within its containing SDK instance. +func (SDKExporterLogExported) AttrComponentName(val string) attribute.KeyValue { + return attribute.String("otel.component.name", val) +} + +// AttrComponentType returns an optional attribute for the "otel.component.type" +// semantic convention. It represents a name identifying the type of the +// OpenTelemetry component. +func (SDKExporterLogExported) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { + return attribute.String("otel.component.type", string(val)) +} + +// AttrServerAddress returns an optional attribute for the "server.address" +// semantic convention. It represents the server domain name if available without +// reverse DNS lookup; otherwise, IP address or Unix domain socket name. +func (SDKExporterLogExported) AttrServerAddress(val string) attribute.KeyValue { + return attribute.String("server.address", val) +} + +// AttrServerPort returns an optional attribute for the "server.port" semantic +// convention. It represents the server port number. +func (SDKExporterLogExported) AttrServerPort(val int) attribute.KeyValue { + return attribute.Int("server.port", val) +} + +// SDKExporterLogExportedObservable is an instrument used to record metric values +// conforming to the "otel.sdk.exporter.log.exported" semantic conventions. It +// represents the number of log records for which the export has finished, either +// successful or failed. +type SDKExporterLogExportedObservable struct { + metric.Int64ObservableCounter +} + +var newSDKExporterLogExportedObservableOpts = []metric.Int64ObservableCounterOption{ + metric.WithDescription("The number of log records for which the export has finished, either successful or failed."), + metric.WithUnit("{log_record}"), +} + +// NewSDKExporterLogExportedObservable returns a new +// SDKExporterLogExportedObservable instrument. +func NewSDKExporterLogExportedObservable( + m metric.Meter, + opt ...metric.Int64ObservableCounterOption, +) (SDKExporterLogExportedObservable, error) { + // Check if the meter is nil. + if m == nil { + return SDKExporterLogExportedObservable{noop.Int64ObservableCounter{}}, nil + } + + if len(opt) == 0 { + opt = newSDKExporterLogExportedObservableOpts + } else { + opt = append(opt, newSDKExporterLogExportedObservableOpts...) + } + + i, err := m.Int64ObservableCounter( + "otel.sdk.exporter.log.exported", + opt..., + ) + if err != nil { + return SDKExporterLogExportedObservable{noop.Int64ObservableCounter{}}, err + } + return SDKExporterLogExportedObservable{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m SDKExporterLogExportedObservable) Inst() metric.Int64ObservableCounter { + return m.Int64ObservableCounter +} + +// Name returns the semantic convention name of the instrument. +func (SDKExporterLogExportedObservable) Name() string { + return "otel.sdk.exporter.log.exported" +} + +// Unit returns the semantic convention unit of the instrument +func (SDKExporterLogExportedObservable) Unit() string { + return "{log_record}" +} + +// Description returns the semantic convention description of the instrument +func (SDKExporterLogExportedObservable) Description() string { + return "The number of log records for which the export has finished, either successful or failed." +} + +// AttrErrorType returns an optional attribute for the "error.type" semantic +// convention. It represents the describes a class of error the operation ended +// with. +func (SDKExporterLogExportedObservable) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { + return attribute.String("error.type", string(val)) +} + +// AttrComponentName returns an optional attribute for the "otel.component.name" +// semantic convention. It represents a name uniquely identifying the instance of +// the OpenTelemetry component within its containing SDK instance. +func (SDKExporterLogExportedObservable) AttrComponentName(val string) attribute.KeyValue { + return attribute.String("otel.component.name", val) +} + +// AttrComponentType returns an optional attribute for the "otel.component.type" +// semantic convention. It represents a name identifying the type of the +// OpenTelemetry component. +func (SDKExporterLogExportedObservable) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { + return attribute.String("otel.component.type", string(val)) +} + +// AttrServerAddress returns an optional attribute for the "server.address" +// semantic convention. It represents the server domain name if available without +// reverse DNS lookup; otherwise, IP address or Unix domain socket name. +func (SDKExporterLogExportedObservable) AttrServerAddress(val string) attribute.KeyValue { + return attribute.String("server.address", val) +} + +// AttrServerPort returns an optional attribute for the "server.port" semantic +// convention. It represents the server port number. +func (SDKExporterLogExportedObservable) AttrServerPort(val int) attribute.KeyValue { + return attribute.Int("server.port", val) +} + +// SDKExporterLogInflight is an instrument used to record metric values +// conforming to the "otel.sdk.exporter.log.inflight" semantic conventions. It +// represents the number of log records which were passed to the exporter, but +// that have not been exported yet (neither successful, nor failed). +type SDKExporterLogInflight struct { + metric.Int64UpDownCounter +} + +var newSDKExporterLogInflightOpts = []metric.Int64UpDownCounterOption{ + metric.WithDescription("The number of log records which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)."), + metric.WithUnit("{log_record}"), +} + +// NewSDKExporterLogInflight returns a new SDKExporterLogInflight instrument. +func NewSDKExporterLogInflight( + m metric.Meter, + opt ...metric.Int64UpDownCounterOption, +) (SDKExporterLogInflight, error) { + // Check if the meter is nil. + if m == nil { + return SDKExporterLogInflight{noop.Int64UpDownCounter{}}, nil + } + + if len(opt) == 0 { + opt = newSDKExporterLogInflightOpts + } else { + opt = append(opt, newSDKExporterLogInflightOpts...) + } + + i, err := m.Int64UpDownCounter( + "otel.sdk.exporter.log.inflight", + opt..., + ) + if err != nil { + return SDKExporterLogInflight{noop.Int64UpDownCounter{}}, err + } + return SDKExporterLogInflight{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m SDKExporterLogInflight) Inst() metric.Int64UpDownCounter { + return m.Int64UpDownCounter +} + +// Name returns the semantic convention name of the instrument. +func (SDKExporterLogInflight) Name() string { + return "otel.sdk.exporter.log.inflight" +} + +// Unit returns the semantic convention unit of the instrument +func (SDKExporterLogInflight) Unit() string { + return "{log_record}" +} + +// Description returns the semantic convention description of the instrument +func (SDKExporterLogInflight) Description() string { + return "The number of log records which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)." +} + +// Add adds incr to the existing count for attrs. +// +// All additional attrs passed are included in the recorded value. +// +// Log records are counted as inflight from when they are passed to the exporter +// until the export operation has concluded. +// If the exporter retries failed export attempts, log records remain inflight +// across all retry attempts and any backoff between them. +func (m SDKExporterLogInflight) Add( + ctx context.Context, + incr int64, + attrs ...attribute.KeyValue, +) { + if !m.Int64UpDownCounter.Enabled(ctx) { + return + } + if len(attrs) == 0 { + m.Int64UpDownCounter.Add(ctx, incr) + return + } + + o := metricpool.AddOptions() + defer metricpool.PutAddOptions(o) + + *o = append( + *o, + metric.WithAttributes( + attrs..., + ), + ) + + m.Int64UpDownCounter.Add(ctx, incr, *o...) +} + +// AddSet adds incr to the existing count for set. +// +// Log records are counted as inflight from when they are passed to the exporter +// until the export operation has concluded. +// If the exporter retries failed export attempts, log records remain inflight +// across all retry attempts and any backoff between them. +func (m SDKExporterLogInflight) AddSet(ctx context.Context, incr int64, set attribute.Set) { + if !m.Int64UpDownCounter.Enabled(ctx) { + return + } + if set.Len() == 0 { + m.Int64UpDownCounter.Add(ctx, incr) + return + } + + o := metricpool.AddOptions() + defer metricpool.PutAddOptions(o) + + *o = append(*o, metric.WithAttributeSet(set)) + m.Int64UpDownCounter.Add(ctx, incr, *o...) +} + +// AttrComponentName returns an optional attribute for the "otel.component.name" +// semantic convention. It represents a name uniquely identifying the instance of +// the OpenTelemetry component within its containing SDK instance. +func (SDKExporterLogInflight) AttrComponentName(val string) attribute.KeyValue { + return attribute.String("otel.component.name", val) +} + +// AttrComponentType returns an optional attribute for the "otel.component.type" +// semantic convention. It represents a name identifying the type of the +// OpenTelemetry component. +func (SDKExporterLogInflight) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { + return attribute.String("otel.component.type", string(val)) +} + +// AttrServerAddress returns an optional attribute for the "server.address" +// semantic convention. It represents the server domain name if available without +// reverse DNS lookup; otherwise, IP address or Unix domain socket name. +func (SDKExporterLogInflight) AttrServerAddress(val string) attribute.KeyValue { + return attribute.String("server.address", val) +} + +// AttrServerPort returns an optional attribute for the "server.port" semantic +// convention. It represents the server port number. +func (SDKExporterLogInflight) AttrServerPort(val int) attribute.KeyValue { + return attribute.Int("server.port", val) +} + +// SDKExporterLogInflightObservable is an instrument used to record metric values +// conforming to the "otel.sdk.exporter.log.inflight" semantic conventions. It +// represents the number of log records which were passed to the exporter, but +// that have not been exported yet (neither successful, nor failed). +type SDKExporterLogInflightObservable struct { + metric.Int64ObservableUpDownCounter +} + +var newSDKExporterLogInflightObservableOpts = []metric.Int64ObservableUpDownCounterOption{ + metric.WithDescription("The number of log records which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)."), + metric.WithUnit("{log_record}"), +} + +// NewSDKExporterLogInflightObservable returns a new +// SDKExporterLogInflightObservable instrument. +func NewSDKExporterLogInflightObservable( + m metric.Meter, + opt ...metric.Int64ObservableUpDownCounterOption, +) (SDKExporterLogInflightObservable, error) { + // Check if the meter is nil. + if m == nil { + return SDKExporterLogInflightObservable{noop.Int64ObservableUpDownCounter{}}, nil + } + + if len(opt) == 0 { + opt = newSDKExporterLogInflightObservableOpts + } else { + opt = append(opt, newSDKExporterLogInflightObservableOpts...) + } + + i, err := m.Int64ObservableUpDownCounter( + "otel.sdk.exporter.log.inflight", + opt..., + ) + if err != nil { + return SDKExporterLogInflightObservable{noop.Int64ObservableUpDownCounter{}}, err + } + return SDKExporterLogInflightObservable{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m SDKExporterLogInflightObservable) Inst() metric.Int64ObservableUpDownCounter { + return m.Int64ObservableUpDownCounter +} + +// Name returns the semantic convention name of the instrument. +func (SDKExporterLogInflightObservable) Name() string { + return "otel.sdk.exporter.log.inflight" +} + +// Unit returns the semantic convention unit of the instrument +func (SDKExporterLogInflightObservable) Unit() string { + return "{log_record}" +} + +// Description returns the semantic convention description of the instrument +func (SDKExporterLogInflightObservable) Description() string { + return "The number of log records which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)." +} + +// AttrComponentName returns an optional attribute for the "otel.component.name" +// semantic convention. It represents a name uniquely identifying the instance of +// the OpenTelemetry component within its containing SDK instance. +func (SDKExporterLogInflightObservable) AttrComponentName(val string) attribute.KeyValue { + return attribute.String("otel.component.name", val) +} + +// AttrComponentType returns an optional attribute for the "otel.component.type" +// semantic convention. It represents a name identifying the type of the +// OpenTelemetry component. +func (SDKExporterLogInflightObservable) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { + return attribute.String("otel.component.type", string(val)) +} + +// AttrServerAddress returns an optional attribute for the "server.address" +// semantic convention. It represents the server domain name if available without +// reverse DNS lookup; otherwise, IP address or Unix domain socket name. +func (SDKExporterLogInflightObservable) AttrServerAddress(val string) attribute.KeyValue { + return attribute.String("server.address", val) +} + +// AttrServerPort returns an optional attribute for the "server.port" semantic +// convention. It represents the server port number. +func (SDKExporterLogInflightObservable) AttrServerPort(val int) attribute.KeyValue { + return attribute.Int("server.port", val) +} + +// SDKExporterMetricDataPointExported is an instrument used to record metric +// values conforming to the "otel.sdk.exporter.metric_data_point.exported" +// semantic conventions. It represents the number of metric data points for which +// the export has finished, either successful or failed. +type SDKExporterMetricDataPointExported struct { + metric.Int64Counter +} + +var newSDKExporterMetricDataPointExportedOpts = []metric.Int64CounterOption{ + metric.WithDescription("The number of metric data points for which the export has finished, either successful or failed."), + metric.WithUnit("{data_point}"), +} + +// NewSDKExporterMetricDataPointExported returns a new +// SDKExporterMetricDataPointExported instrument. +func NewSDKExporterMetricDataPointExported( + m metric.Meter, + opt ...metric.Int64CounterOption, +) (SDKExporterMetricDataPointExported, error) { + // Check if the meter is nil. + if m == nil { + return SDKExporterMetricDataPointExported{noop.Int64Counter{}}, nil + } + + if len(opt) == 0 { + opt = newSDKExporterMetricDataPointExportedOpts + } else { + opt = append(opt, newSDKExporterMetricDataPointExportedOpts...) + } + + i, err := m.Int64Counter( + "otel.sdk.exporter.metric_data_point.exported", + opt..., + ) + if err != nil { + return SDKExporterMetricDataPointExported{noop.Int64Counter{}}, err + } + return SDKExporterMetricDataPointExported{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m SDKExporterMetricDataPointExported) Inst() metric.Int64Counter { + return m.Int64Counter +} + +// Name returns the semantic convention name of the instrument. +func (SDKExporterMetricDataPointExported) Name() string { + return "otel.sdk.exporter.metric_data_point.exported" +} + +// Unit returns the semantic convention unit of the instrument +func (SDKExporterMetricDataPointExported) Unit() string { + return "{data_point}" +} + +// Description returns the semantic convention description of the instrument +func (SDKExporterMetricDataPointExported) Description() string { + return "The number of metric data points for which the export has finished, either successful or failed." +} + +// Add adds incr to the existing count for attrs. +// +// All additional attrs passed are included in the recorded value. +// +// For successful exports, `error.type` MUST NOT be set. For failed exports, +// `error.type` MUST contain the failure cause. +// For exporters with partial success semantics (e.g. OTLP with +// `rejected_data_points`), rejected data points MUST count as failed and only +// non-rejected data points count as success. +// If no rejection reason is available, `rejected` SHOULD be used as value for +// `error.type`. +// If the exporter retries failed export attempts, the export operation is +// considered finished only after the final attempt has concluded. +// Each metric data point MUST be counted exactly once per export operation: +// intermediate failed attempts that are followed by a retry MUST NOT increment +// the counter, +// and `error.type` reflects the cause of the final attempt. +func (m SDKExporterMetricDataPointExported) Add( + ctx context.Context, + incr int64, + attrs ...attribute.KeyValue, +) { + if !m.Int64Counter.Enabled(ctx) { + return + } + if len(attrs) == 0 { + m.Int64Counter.Add(ctx, incr) + return + } + + o := metricpool.AddOptions() + defer metricpool.PutAddOptions(o) + + *o = append( + *o, + metric.WithAttributes( + attrs..., + ), + ) + + m.Int64Counter.Add(ctx, incr, *o...) +} + +// AddSet adds incr to the existing count for set. +// +// For successful exports, `error.type` MUST NOT be set. For failed exports, +// `error.type` MUST contain the failure cause. +// For exporters with partial success semantics (e.g. OTLP with +// `rejected_data_points`), rejected data points MUST count as failed and only +// non-rejected data points count as success. +// If no rejection reason is available, `rejected` SHOULD be used as value for +// `error.type`. +// If the exporter retries failed export attempts, the export operation is +// considered finished only after the final attempt has concluded. +// Each metric data point MUST be counted exactly once per export operation: +// intermediate failed attempts that are followed by a retry MUST NOT increment +// the counter, +// and `error.type` reflects the cause of the final attempt. +func (m SDKExporterMetricDataPointExported) AddSet(ctx context.Context, incr int64, set attribute.Set) { + if !m.Int64Counter.Enabled(ctx) { + return + } + if set.Len() == 0 { + m.Int64Counter.Add(ctx, incr) + return + } + + o := metricpool.AddOptions() + defer metricpool.PutAddOptions(o) + + *o = append(*o, metric.WithAttributeSet(set)) + m.Int64Counter.Add(ctx, incr, *o...) +} + +// AttrErrorType returns an optional attribute for the "error.type" semantic +// convention. It represents the describes a class of error the operation ended +// with. +func (SDKExporterMetricDataPointExported) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { + return attribute.String("error.type", string(val)) +} + +// AttrComponentName returns an optional attribute for the "otel.component.name" +// semantic convention. It represents a name uniquely identifying the instance of +// the OpenTelemetry component within its containing SDK instance. +func (SDKExporterMetricDataPointExported) AttrComponentName(val string) attribute.KeyValue { + return attribute.String("otel.component.name", val) +} + +// AttrComponentType returns an optional attribute for the "otel.component.type" +// semantic convention. It represents a name identifying the type of the +// OpenTelemetry component. +func (SDKExporterMetricDataPointExported) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { + return attribute.String("otel.component.type", string(val)) +} + +// AttrServerAddress returns an optional attribute for the "server.address" +// semantic convention. It represents the server domain name if available without +// reverse DNS lookup; otherwise, IP address or Unix domain socket name. +func (SDKExporterMetricDataPointExported) AttrServerAddress(val string) attribute.KeyValue { + return attribute.String("server.address", val) +} + +// AttrServerPort returns an optional attribute for the "server.port" semantic +// convention. It represents the server port number. +func (SDKExporterMetricDataPointExported) AttrServerPort(val int) attribute.KeyValue { + return attribute.Int("server.port", val) +} + +// SDKExporterMetricDataPointExportedObservable is an instrument used to record +// metric values conforming to the "otel.sdk.exporter.metric_data_point.exported" +// semantic conventions. It represents the number of metric data points for which +// the export has finished, either successful or failed. +type SDKExporterMetricDataPointExportedObservable struct { + metric.Int64ObservableCounter +} + +var newSDKExporterMetricDataPointExportedObservableOpts = []metric.Int64ObservableCounterOption{ + metric.WithDescription("The number of metric data points for which the export has finished, either successful or failed."), + metric.WithUnit("{data_point}"), +} + +// NewSDKExporterMetricDataPointExportedObservable returns a new +// SDKExporterMetricDataPointExportedObservable instrument. +func NewSDKExporterMetricDataPointExportedObservable( + m metric.Meter, + opt ...metric.Int64ObservableCounterOption, +) (SDKExporterMetricDataPointExportedObservable, error) { + // Check if the meter is nil. + if m == nil { + return SDKExporterMetricDataPointExportedObservable{noop.Int64ObservableCounter{}}, nil + } + + if len(opt) == 0 { + opt = newSDKExporterMetricDataPointExportedObservableOpts + } else { + opt = append(opt, newSDKExporterMetricDataPointExportedObservableOpts...) + } + + i, err := m.Int64ObservableCounter( + "otel.sdk.exporter.metric_data_point.exported", + opt..., + ) + if err != nil { + return SDKExporterMetricDataPointExportedObservable{noop.Int64ObservableCounter{}}, err + } + return SDKExporterMetricDataPointExportedObservable{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m SDKExporterMetricDataPointExportedObservable) Inst() metric.Int64ObservableCounter { + return m.Int64ObservableCounter +} + +// Name returns the semantic convention name of the instrument. +func (SDKExporterMetricDataPointExportedObservable) Name() string { + return "otel.sdk.exporter.metric_data_point.exported" +} + +// Unit returns the semantic convention unit of the instrument +func (SDKExporterMetricDataPointExportedObservable) Unit() string { + return "{data_point}" +} + +// Description returns the semantic convention description of the instrument +func (SDKExporterMetricDataPointExportedObservable) Description() string { + return "The number of metric data points for which the export has finished, either successful or failed." +} + +// AttrErrorType returns an optional attribute for the "error.type" semantic +// convention. It represents the describes a class of error the operation ended +// with. +func (SDKExporterMetricDataPointExportedObservable) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { + return attribute.String("error.type", string(val)) +} + +// AttrComponentName returns an optional attribute for the "otel.component.name" +// semantic convention. It represents a name uniquely identifying the instance of +// the OpenTelemetry component within its containing SDK instance. +func (SDKExporterMetricDataPointExportedObservable) AttrComponentName(val string) attribute.KeyValue { + return attribute.String("otel.component.name", val) +} + +// AttrComponentType returns an optional attribute for the "otel.component.type" +// semantic convention. It represents a name identifying the type of the +// OpenTelemetry component. +func (SDKExporterMetricDataPointExportedObservable) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { + return attribute.String("otel.component.type", string(val)) +} + +// AttrServerAddress returns an optional attribute for the "server.address" +// semantic convention. It represents the server domain name if available without +// reverse DNS lookup; otherwise, IP address or Unix domain socket name. +func (SDKExporterMetricDataPointExportedObservable) AttrServerAddress(val string) attribute.KeyValue { + return attribute.String("server.address", val) +} + +// AttrServerPort returns an optional attribute for the "server.port" semantic +// convention. It represents the server port number. +func (SDKExporterMetricDataPointExportedObservable) AttrServerPort(val int) attribute.KeyValue { + return attribute.Int("server.port", val) +} + +// SDKExporterMetricDataPointInflight is an instrument used to record metric +// values conforming to the "otel.sdk.exporter.metric_data_point.inflight" +// semantic conventions. It represents the number of metric data points which +// were passed to the exporter, but that have not been exported yet (neither +// successful, nor failed). +type SDKExporterMetricDataPointInflight struct { + metric.Int64UpDownCounter +} + +var newSDKExporterMetricDataPointInflightOpts = []metric.Int64UpDownCounterOption{ + metric.WithDescription("The number of metric data points which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)."), + metric.WithUnit("{data_point}"), +} + +// NewSDKExporterMetricDataPointInflight returns a new +// SDKExporterMetricDataPointInflight instrument. +func NewSDKExporterMetricDataPointInflight( + m metric.Meter, + opt ...metric.Int64UpDownCounterOption, +) (SDKExporterMetricDataPointInflight, error) { + // Check if the meter is nil. + if m == nil { + return SDKExporterMetricDataPointInflight{noop.Int64UpDownCounter{}}, nil + } + + if len(opt) == 0 { + opt = newSDKExporterMetricDataPointInflightOpts + } else { + opt = append(opt, newSDKExporterMetricDataPointInflightOpts...) + } + + i, err := m.Int64UpDownCounter( + "otel.sdk.exporter.metric_data_point.inflight", + opt..., + ) + if err != nil { + return SDKExporterMetricDataPointInflight{noop.Int64UpDownCounter{}}, err + } + return SDKExporterMetricDataPointInflight{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m SDKExporterMetricDataPointInflight) Inst() metric.Int64UpDownCounter { + return m.Int64UpDownCounter +} + +// Name returns the semantic convention name of the instrument. +func (SDKExporterMetricDataPointInflight) Name() string { + return "otel.sdk.exporter.metric_data_point.inflight" +} + +// Unit returns the semantic convention unit of the instrument +func (SDKExporterMetricDataPointInflight) Unit() string { + return "{data_point}" +} + +// Description returns the semantic convention description of the instrument +func (SDKExporterMetricDataPointInflight) Description() string { + return "The number of metric data points which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)." +} + +// Add adds incr to the existing count for attrs. +// +// All additional attrs passed are included in the recorded value. +// +// Metric data points are counted as inflight from when they are passed to the +// exporter until the export operation has concluded. +// If the exporter retries failed export attempts, metric data points remain +// inflight across all retry attempts and any backoff between them. +func (m SDKExporterMetricDataPointInflight) Add( + ctx context.Context, + incr int64, + attrs ...attribute.KeyValue, +) { + if !m.Int64UpDownCounter.Enabled(ctx) { + return + } + if len(attrs) == 0 { + m.Int64UpDownCounter.Add(ctx, incr) + return + } + + o := metricpool.AddOptions() + defer metricpool.PutAddOptions(o) + + *o = append( + *o, + metric.WithAttributes( + attrs..., + ), + ) + + m.Int64UpDownCounter.Add(ctx, incr, *o...) +} + +// AddSet adds incr to the existing count for set. +// +// Metric data points are counted as inflight from when they are passed to the +// exporter until the export operation has concluded. +// If the exporter retries failed export attempts, metric data points remain +// inflight across all retry attempts and any backoff between them. +func (m SDKExporterMetricDataPointInflight) AddSet(ctx context.Context, incr int64, set attribute.Set) { + if !m.Int64UpDownCounter.Enabled(ctx) { + return + } + if set.Len() == 0 { + m.Int64UpDownCounter.Add(ctx, incr) + return + } + + o := metricpool.AddOptions() + defer metricpool.PutAddOptions(o) + + *o = append(*o, metric.WithAttributeSet(set)) + m.Int64UpDownCounter.Add(ctx, incr, *o...) +} + +// AttrComponentName returns an optional attribute for the "otel.component.name" +// semantic convention. It represents a name uniquely identifying the instance of +// the OpenTelemetry component within its containing SDK instance. +func (SDKExporterMetricDataPointInflight) AttrComponentName(val string) attribute.KeyValue { + return attribute.String("otel.component.name", val) +} + +// AttrComponentType returns an optional attribute for the "otel.component.type" +// semantic convention. It represents a name identifying the type of the +// OpenTelemetry component. +func (SDKExporterMetricDataPointInflight) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { + return attribute.String("otel.component.type", string(val)) +} + +// AttrServerAddress returns an optional attribute for the "server.address" +// semantic convention. It represents the server domain name if available without +// reverse DNS lookup; otherwise, IP address or Unix domain socket name. +func (SDKExporterMetricDataPointInflight) AttrServerAddress(val string) attribute.KeyValue { + return attribute.String("server.address", val) +} + +// AttrServerPort returns an optional attribute for the "server.port" semantic +// convention. It represents the server port number. +func (SDKExporterMetricDataPointInflight) AttrServerPort(val int) attribute.KeyValue { + return attribute.Int("server.port", val) +} + +// SDKExporterMetricDataPointInflightObservable is an instrument used to record +// metric values conforming to the "otel.sdk.exporter.metric_data_point.inflight" +// semantic conventions. It represents the number of metric data points which +// were passed to the exporter, but that have not been exported yet (neither +// successful, nor failed). +type SDKExporterMetricDataPointInflightObservable struct { + metric.Int64ObservableUpDownCounter +} + +var newSDKExporterMetricDataPointInflightObservableOpts = []metric.Int64ObservableUpDownCounterOption{ + metric.WithDescription("The number of metric data points which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)."), + metric.WithUnit("{data_point}"), +} + +// NewSDKExporterMetricDataPointInflightObservable returns a new +// SDKExporterMetricDataPointInflightObservable instrument. +func NewSDKExporterMetricDataPointInflightObservable( + m metric.Meter, + opt ...metric.Int64ObservableUpDownCounterOption, +) (SDKExporterMetricDataPointInflightObservable, error) { + // Check if the meter is nil. + if m == nil { + return SDKExporterMetricDataPointInflightObservable{noop.Int64ObservableUpDownCounter{}}, nil + } + + if len(opt) == 0 { + opt = newSDKExporterMetricDataPointInflightObservableOpts + } else { + opt = append(opt, newSDKExporterMetricDataPointInflightObservableOpts...) + } + + i, err := m.Int64ObservableUpDownCounter( + "otel.sdk.exporter.metric_data_point.inflight", + opt..., + ) + if err != nil { + return SDKExporterMetricDataPointInflightObservable{noop.Int64ObservableUpDownCounter{}}, err + } + return SDKExporterMetricDataPointInflightObservable{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m SDKExporterMetricDataPointInflightObservable) Inst() metric.Int64ObservableUpDownCounter { + return m.Int64ObservableUpDownCounter +} + +// Name returns the semantic convention name of the instrument. +func (SDKExporterMetricDataPointInflightObservable) Name() string { + return "otel.sdk.exporter.metric_data_point.inflight" +} + +// Unit returns the semantic convention unit of the instrument +func (SDKExporterMetricDataPointInflightObservable) Unit() string { + return "{data_point}" +} + +// Description returns the semantic convention description of the instrument +func (SDKExporterMetricDataPointInflightObservable) Description() string { + return "The number of metric data points which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)." +} + +// AttrComponentName returns an optional attribute for the "otel.component.name" +// semantic convention. It represents a name uniquely identifying the instance of +// the OpenTelemetry component within its containing SDK instance. +func (SDKExporterMetricDataPointInflightObservable) AttrComponentName(val string) attribute.KeyValue { + return attribute.String("otel.component.name", val) +} + +// AttrComponentType returns an optional attribute for the "otel.component.type" +// semantic convention. It represents a name identifying the type of the +// OpenTelemetry component. +func (SDKExporterMetricDataPointInflightObservable) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { + return attribute.String("otel.component.type", string(val)) +} + +// AttrServerAddress returns an optional attribute for the "server.address" +// semantic convention. It represents the server domain name if available without +// reverse DNS lookup; otherwise, IP address or Unix domain socket name. +func (SDKExporterMetricDataPointInflightObservable) AttrServerAddress(val string) attribute.KeyValue { + return attribute.String("server.address", val) +} + +// AttrServerPort returns an optional attribute for the "server.port" semantic +// convention. It represents the server port number. +func (SDKExporterMetricDataPointInflightObservable) AttrServerPort(val int) attribute.KeyValue { + return attribute.Int("server.port", val) +} + +// SDKExporterOperationDuration is an instrument used to record metric values +// conforming to the "otel.sdk.exporter.operation.duration" semantic conventions. +// It represents the duration of exporting a batch of telemetry records. +type SDKExporterOperationDuration struct { + metric.Float64Histogram +} + +var newSDKExporterOperationDurationOpts = []metric.Float64HistogramOption{ + metric.WithDescription("The duration of exporting a batch of telemetry records."), + metric.WithUnit("s"), +} + +// NewSDKExporterOperationDuration returns a new SDKExporterOperationDuration +// instrument. +func NewSDKExporterOperationDuration( + m metric.Meter, + opt ...metric.Float64HistogramOption, +) (SDKExporterOperationDuration, error) { + // Check if the meter is nil. + if m == nil { + return SDKExporterOperationDuration{noop.Float64Histogram{}}, nil + } + + if len(opt) == 0 { + opt = newSDKExporterOperationDurationOpts + } else { + opt = append(opt, newSDKExporterOperationDurationOpts...) + } + + i, err := m.Float64Histogram( + "otel.sdk.exporter.operation.duration", + opt..., + ) + if err != nil { + return SDKExporterOperationDuration{noop.Float64Histogram{}}, err + } + return SDKExporterOperationDuration{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m SDKExporterOperationDuration) Inst() metric.Float64Histogram { + return m.Float64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (SDKExporterOperationDuration) Name() string { + return "otel.sdk.exporter.operation.duration" +} + +// Unit returns the semantic convention unit of the instrument +func (SDKExporterOperationDuration) Unit() string { + return "s" +} + +// Description returns the semantic convention description of the instrument +func (SDKExporterOperationDuration) Description() string { + return "The duration of exporting a batch of telemetry records." +} + +// Record records val to the current distribution for attrs. +// +// All additional attrs passed are included in the recorded value. +// +// This metric defines successful operations using the full success definitions +// for [http] +// and [grpc]. Anything else is defined as an unsuccessful operation. For +// successful +// operations, `error.type` MUST NOT be set. For unsuccessful export operations, +// `error.type` MUST contain a relevant failure cause. +// If the exporter retries failed export attempts, exactly one observation MUST +// be recorded per export operation, +// covering the wall-clock duration from the start of the first attempt through +// the conclusion of the final attempt (including any backoff between attempts). +// `error.type` reflects the cause of the final attempt. +// +// [http]: https://github.com/open-telemetry/opentelemetry-proto/blob/v1.5.0/docs/specification.md#full-success-1 +// [grpc]: https://github.com/open-telemetry/opentelemetry-proto/blob/v1.5.0/docs/specification.md#full-success +func (m SDKExporterOperationDuration) Record( + ctx context.Context, + val float64, + attrs ...attribute.KeyValue, +) { + if !m.Float64Histogram.Enabled(ctx) { + return + } + if len(attrs) == 0 { + m.Float64Histogram.Record(ctx, val) + return + } + + o := metricpool.RecordOptions() + defer metricpool.PutRecordOptions(o) + + *o = append( + *o, + metric.WithAttributes( + attrs..., + ), + ) + + m.Float64Histogram.Record(ctx, val, *o...) +} + +// RecordSet records val to the current distribution for set. +// +// This metric defines successful operations using the full success definitions +// for [http] +// and [grpc]. Anything else is defined as an unsuccessful operation. For +// successful +// operations, `error.type` MUST NOT be set. For unsuccessful export operations, +// `error.type` MUST contain a relevant failure cause. +// If the exporter retries failed export attempts, exactly one observation MUST +// be recorded per export operation, +// covering the wall-clock duration from the start of the first attempt through +// the conclusion of the final attempt (including any backoff between attempts). +// `error.type` reflects the cause of the final attempt. +// +// [http]: https://github.com/open-telemetry/opentelemetry-proto/blob/v1.5.0/docs/specification.md#full-success-1 +// [grpc]: https://github.com/open-telemetry/opentelemetry-proto/blob/v1.5.0/docs/specification.md#full-success +func (m SDKExporterOperationDuration) RecordSet(ctx context.Context, val float64, set attribute.Set) { + if !m.Float64Histogram.Enabled(ctx) { + return + } + if set.Len() == 0 { + m.Float64Histogram.Record(ctx, val) + return + } + + o := metricpool.RecordOptions() + defer metricpool.PutRecordOptions(o) + + *o = append(*o, metric.WithAttributeSet(set)) + m.Float64Histogram.Record(ctx, val, *o...) +} + +// AttrErrorType returns an optional attribute for the "error.type" semantic +// convention. It represents the describes a class of error the operation ended +// with. +func (SDKExporterOperationDuration) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { + return attribute.String("error.type", string(val)) +} + +// AttrHTTPResponseStatusCode returns an optional attribute for the +// "http.response.status_code" semantic convention. It represents the HTTP status +// code of the last HTTP request performed in scope of this export call. +func (SDKExporterOperationDuration) AttrHTTPResponseStatusCode(val int) attribute.KeyValue { + return attribute.Int("http.response.status_code", val) +} + +// AttrComponentName returns an optional attribute for the "otel.component.name" +// semantic convention. It represents a name uniquely identifying the instance of +// the OpenTelemetry component within its containing SDK instance. +func (SDKExporterOperationDuration) AttrComponentName(val string) attribute.KeyValue { + return attribute.String("otel.component.name", val) +} + +// AttrComponentType returns an optional attribute for the "otel.component.type" +// semantic convention. It represents a name identifying the type of the +// OpenTelemetry component. +func (SDKExporterOperationDuration) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { + return attribute.String("otel.component.type", string(val)) +} + +// AttrRPCResponseStatusCode returns an optional attribute for the +// "rpc.response.status_code" semantic convention. It represents the gRPC status +// code of the last gRPC request performed in scope of this export call. +func (SDKExporterOperationDuration) AttrRPCResponseStatusCode(val string) attribute.KeyValue { + return attribute.String("rpc.response.status_code", val) +} + +// AttrServerAddress returns an optional attribute for the "server.address" +// semantic convention. It represents the server domain name if available without +// reverse DNS lookup; otherwise, IP address or Unix domain socket name. +func (SDKExporterOperationDuration) AttrServerAddress(val string) attribute.KeyValue { + return attribute.String("server.address", val) +} + +// AttrServerPort returns an optional attribute for the "server.port" semantic +// convention. It represents the server port number. +func (SDKExporterOperationDuration) AttrServerPort(val int) attribute.KeyValue { + return attribute.Int("server.port", val) +} + +// SDKExporterSpanExported is an instrument used to record metric values +// conforming to the "otel.sdk.exporter.span.exported" semantic conventions. It +// represents the number of spans for which the export has finished, either +// successful or failed. +type SDKExporterSpanExported struct { + metric.Int64Counter +} + +var newSDKExporterSpanExportedOpts = []metric.Int64CounterOption{ + metric.WithDescription("The number of spans for which the export has finished, either successful or failed."), + metric.WithUnit("{span}"), +} + +// NewSDKExporterSpanExported returns a new SDKExporterSpanExported instrument. +func NewSDKExporterSpanExported( + m metric.Meter, + opt ...metric.Int64CounterOption, +) (SDKExporterSpanExported, error) { + // Check if the meter is nil. + if m == nil { + return SDKExporterSpanExported{noop.Int64Counter{}}, nil + } + + if len(opt) == 0 { + opt = newSDKExporterSpanExportedOpts + } else { + opt = append(opt, newSDKExporterSpanExportedOpts...) + } + + i, err := m.Int64Counter( + "otel.sdk.exporter.span.exported", + opt..., + ) + if err != nil { + return SDKExporterSpanExported{noop.Int64Counter{}}, err + } + return SDKExporterSpanExported{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m SDKExporterSpanExported) Inst() metric.Int64Counter { + return m.Int64Counter +} + +// Name returns the semantic convention name of the instrument. +func (SDKExporterSpanExported) Name() string { + return "otel.sdk.exporter.span.exported" +} + +// Unit returns the semantic convention unit of the instrument +func (SDKExporterSpanExported) Unit() string { + return "{span}" +} + +// Description returns the semantic convention description of the instrument +func (SDKExporterSpanExported) Description() string { + return "The number of spans for which the export has finished, either successful or failed." +} + +// Add adds incr to the existing count for attrs. +// +// All additional attrs passed are included in the recorded value. +// +// For successful exports, `error.type` MUST NOT be set. For failed exports, +// `error.type` MUST contain the failure cause. +// For exporters with partial success semantics (e.g. OTLP with `rejected_spans` +// ), rejected spans MUST count as failed and only non-rejected spans count as +// success. +// If no rejection reason is available, `rejected` SHOULD be used as value for +// `error.type`. +// If the exporter retries failed export attempts, the export operation is +// considered finished only after the final attempt has concluded. +// Each span MUST be counted exactly once per export operation: intermediate +// failed attempts that are followed by a retry MUST NOT increment the counter, +// and `error.type` reflects the cause of the final attempt. +func (m SDKExporterSpanExported) Add( + ctx context.Context, + incr int64, + attrs ...attribute.KeyValue, +) { + if !m.Int64Counter.Enabled(ctx) { + return + } + if len(attrs) == 0 { + m.Int64Counter.Add(ctx, incr) + return + } + + o := metricpool.AddOptions() + defer metricpool.PutAddOptions(o) + + *o = append( + *o, + metric.WithAttributes( + attrs..., + ), + ) + + m.Int64Counter.Add(ctx, incr, *o...) +} + +// AddSet adds incr to the existing count for set. +// +// For successful exports, `error.type` MUST NOT be set. For failed exports, +// `error.type` MUST contain the failure cause. +// For exporters with partial success semantics (e.g. OTLP with `rejected_spans` +// ), rejected spans MUST count as failed and only non-rejected spans count as +// success. +// If no rejection reason is available, `rejected` SHOULD be used as value for +// `error.type`. +// If the exporter retries failed export attempts, the export operation is +// considered finished only after the final attempt has concluded. +// Each span MUST be counted exactly once per export operation: intermediate +// failed attempts that are followed by a retry MUST NOT increment the counter, +// and `error.type` reflects the cause of the final attempt. +func (m SDKExporterSpanExported) AddSet(ctx context.Context, incr int64, set attribute.Set) { + if !m.Int64Counter.Enabled(ctx) { + return + } + if set.Len() == 0 { + m.Int64Counter.Add(ctx, incr) + return + } + + o := metricpool.AddOptions() + defer metricpool.PutAddOptions(o) + + *o = append(*o, metric.WithAttributeSet(set)) + m.Int64Counter.Add(ctx, incr, *o...) +} + +// AttrErrorType returns an optional attribute for the "error.type" semantic +// convention. It represents the describes a class of error the operation ended +// with. +func (SDKExporterSpanExported) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { + return attribute.String("error.type", string(val)) +} + +// AttrComponentName returns an optional attribute for the "otel.component.name" +// semantic convention. It represents a name uniquely identifying the instance of +// the OpenTelemetry component within its containing SDK instance. +func (SDKExporterSpanExported) AttrComponentName(val string) attribute.KeyValue { + return attribute.String("otel.component.name", val) +} + +// AttrComponentType returns an optional attribute for the "otel.component.type" +// semantic convention. It represents a name identifying the type of the +// OpenTelemetry component. +func (SDKExporterSpanExported) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { + return attribute.String("otel.component.type", string(val)) +} + +// AttrServerAddress returns an optional attribute for the "server.address" +// semantic convention. It represents the server domain name if available without +// reverse DNS lookup; otherwise, IP address or Unix domain socket name. +func (SDKExporterSpanExported) AttrServerAddress(val string) attribute.KeyValue { + return attribute.String("server.address", val) +} + +// AttrServerPort returns an optional attribute for the "server.port" semantic +// convention. It represents the server port number. +func (SDKExporterSpanExported) AttrServerPort(val int) attribute.KeyValue { + return attribute.Int("server.port", val) +} + +// SDKExporterSpanExportedObservable is an instrument used to record metric +// values conforming to the "otel.sdk.exporter.span.exported" semantic +// conventions. It represents the number of spans for which the export has +// finished, either successful or failed. +type SDKExporterSpanExportedObservable struct { + metric.Int64ObservableCounter +} + +var newSDKExporterSpanExportedObservableOpts = []metric.Int64ObservableCounterOption{ + metric.WithDescription("The number of spans for which the export has finished, either successful or failed."), + metric.WithUnit("{span}"), +} + +// NewSDKExporterSpanExportedObservable returns a new +// SDKExporterSpanExportedObservable instrument. +func NewSDKExporterSpanExportedObservable( + m metric.Meter, + opt ...metric.Int64ObservableCounterOption, +) (SDKExporterSpanExportedObservable, error) { + // Check if the meter is nil. + if m == nil { + return SDKExporterSpanExportedObservable{noop.Int64ObservableCounter{}}, nil + } + + if len(opt) == 0 { + opt = newSDKExporterSpanExportedObservableOpts + } else { + opt = append(opt, newSDKExporterSpanExportedObservableOpts...) + } + + i, err := m.Int64ObservableCounter( + "otel.sdk.exporter.span.exported", + opt..., + ) + if err != nil { + return SDKExporterSpanExportedObservable{noop.Int64ObservableCounter{}}, err + } + return SDKExporterSpanExportedObservable{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m SDKExporterSpanExportedObservable) Inst() metric.Int64ObservableCounter { + return m.Int64ObservableCounter +} + +// Name returns the semantic convention name of the instrument. +func (SDKExporterSpanExportedObservable) Name() string { + return "otel.sdk.exporter.span.exported" +} + +// Unit returns the semantic convention unit of the instrument +func (SDKExporterSpanExportedObservable) Unit() string { + return "{span}" +} + +// Description returns the semantic convention description of the instrument +func (SDKExporterSpanExportedObservable) Description() string { + return "The number of spans for which the export has finished, either successful or failed." +} + +// AttrErrorType returns an optional attribute for the "error.type" semantic +// convention. It represents the describes a class of error the operation ended +// with. +func (SDKExporterSpanExportedObservable) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { + return attribute.String("error.type", string(val)) +} + +// AttrComponentName returns an optional attribute for the "otel.component.name" +// semantic convention. It represents a name uniquely identifying the instance of +// the OpenTelemetry component within its containing SDK instance. +func (SDKExporterSpanExportedObservable) AttrComponentName(val string) attribute.KeyValue { + return attribute.String("otel.component.name", val) +} + +// AttrComponentType returns an optional attribute for the "otel.component.type" +// semantic convention. It represents a name identifying the type of the +// OpenTelemetry component. +func (SDKExporterSpanExportedObservable) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { + return attribute.String("otel.component.type", string(val)) +} + +// AttrServerAddress returns an optional attribute for the "server.address" +// semantic convention. It represents the server domain name if available without +// reverse DNS lookup; otherwise, IP address or Unix domain socket name. +func (SDKExporterSpanExportedObservable) AttrServerAddress(val string) attribute.KeyValue { + return attribute.String("server.address", val) +} + +// AttrServerPort returns an optional attribute for the "server.port" semantic +// convention. It represents the server port number. +func (SDKExporterSpanExportedObservable) AttrServerPort(val int) attribute.KeyValue { + return attribute.Int("server.port", val) +} + +// SDKExporterSpanInflight is an instrument used to record metric values +// conforming to the "otel.sdk.exporter.span.inflight" semantic conventions. It +// represents the number of spans which were passed to the exporter, but that +// have not been exported yet (neither successful, nor failed). +type SDKExporterSpanInflight struct { + metric.Int64UpDownCounter +} + +var newSDKExporterSpanInflightOpts = []metric.Int64UpDownCounterOption{ + metric.WithDescription("The number of spans which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)."), + metric.WithUnit("{span}"), +} + +// NewSDKExporterSpanInflight returns a new SDKExporterSpanInflight instrument. +func NewSDKExporterSpanInflight( + m metric.Meter, + opt ...metric.Int64UpDownCounterOption, +) (SDKExporterSpanInflight, error) { + // Check if the meter is nil. + if m == nil { + return SDKExporterSpanInflight{noop.Int64UpDownCounter{}}, nil + } + + if len(opt) == 0 { + opt = newSDKExporterSpanInflightOpts + } else { + opt = append(opt, newSDKExporterSpanInflightOpts...) + } + + i, err := m.Int64UpDownCounter( + "otel.sdk.exporter.span.inflight", + opt..., + ) + if err != nil { + return SDKExporterSpanInflight{noop.Int64UpDownCounter{}}, err + } + return SDKExporterSpanInflight{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m SDKExporterSpanInflight) Inst() metric.Int64UpDownCounter { + return m.Int64UpDownCounter +} + +// Name returns the semantic convention name of the instrument. +func (SDKExporterSpanInflight) Name() string { + return "otel.sdk.exporter.span.inflight" +} + +// Unit returns the semantic convention unit of the instrument +func (SDKExporterSpanInflight) Unit() string { + return "{span}" +} + +// Description returns the semantic convention description of the instrument +func (SDKExporterSpanInflight) Description() string { + return "The number of spans which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)." +} + +// Add adds incr to the existing count for attrs. +// +// All additional attrs passed are included in the recorded value. +// +// Spans are counted as inflight from when they are passed to the exporter until +// the export operation has concluded. +// If the exporter retries failed export attempts, spans remain inflight across +// all retry attempts and any backoff between them. +func (m SDKExporterSpanInflight) Add( + ctx context.Context, + incr int64, + attrs ...attribute.KeyValue, +) { + if !m.Int64UpDownCounter.Enabled(ctx) { + return + } + if len(attrs) == 0 { + m.Int64UpDownCounter.Add(ctx, incr) + return + } + + o := metricpool.AddOptions() + defer metricpool.PutAddOptions(o) + + *o = append( + *o, + metric.WithAttributes( + attrs..., + ), + ) + + m.Int64UpDownCounter.Add(ctx, incr, *o...) +} + +// AddSet adds incr to the existing count for set. +// +// Spans are counted as inflight from when they are passed to the exporter until +// the export operation has concluded. +// If the exporter retries failed export attempts, spans remain inflight across +// all retry attempts and any backoff between them. +func (m SDKExporterSpanInflight) AddSet(ctx context.Context, incr int64, set attribute.Set) { + if !m.Int64UpDownCounter.Enabled(ctx) { + return + } + if set.Len() == 0 { + m.Int64UpDownCounter.Add(ctx, incr) + return + } + + o := metricpool.AddOptions() + defer metricpool.PutAddOptions(o) + + *o = append(*o, metric.WithAttributeSet(set)) + m.Int64UpDownCounter.Add(ctx, incr, *o...) +} + +// AttrComponentName returns an optional attribute for the "otel.component.name" +// semantic convention. It represents a name uniquely identifying the instance of +// the OpenTelemetry component within its containing SDK instance. +func (SDKExporterSpanInflight) AttrComponentName(val string) attribute.KeyValue { + return attribute.String("otel.component.name", val) +} + +// AttrComponentType returns an optional attribute for the "otel.component.type" +// semantic convention. It represents a name identifying the type of the +// OpenTelemetry component. +func (SDKExporterSpanInflight) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { + return attribute.String("otel.component.type", string(val)) +} + +// AttrServerAddress returns an optional attribute for the "server.address" +// semantic convention. It represents the server domain name if available without +// reverse DNS lookup; otherwise, IP address or Unix domain socket name. +func (SDKExporterSpanInflight) AttrServerAddress(val string) attribute.KeyValue { + return attribute.String("server.address", val) +} + +// AttrServerPort returns an optional attribute for the "server.port" semantic +// convention. It represents the server port number. +func (SDKExporterSpanInflight) AttrServerPort(val int) attribute.KeyValue { + return attribute.Int("server.port", val) +} + +// SDKExporterSpanInflightObservable is an instrument used to record metric +// values conforming to the "otel.sdk.exporter.span.inflight" semantic +// conventions. It represents the number of spans which were passed to the +// exporter, but that have not been exported yet (neither successful, nor +// failed). +type SDKExporterSpanInflightObservable struct { + metric.Int64ObservableUpDownCounter +} + +var newSDKExporterSpanInflightObservableOpts = []metric.Int64ObservableUpDownCounterOption{ + metric.WithDescription("The number of spans which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)."), + metric.WithUnit("{span}"), +} + +// NewSDKExporterSpanInflightObservable returns a new +// SDKExporterSpanInflightObservable instrument. +func NewSDKExporterSpanInflightObservable( + m metric.Meter, + opt ...metric.Int64ObservableUpDownCounterOption, +) (SDKExporterSpanInflightObservable, error) { + // Check if the meter is nil. + if m == nil { + return SDKExporterSpanInflightObservable{noop.Int64ObservableUpDownCounter{}}, nil + } + + if len(opt) == 0 { + opt = newSDKExporterSpanInflightObservableOpts + } else { + opt = append(opt, newSDKExporterSpanInflightObservableOpts...) + } + + i, err := m.Int64ObservableUpDownCounter( + "otel.sdk.exporter.span.inflight", + opt..., + ) + if err != nil { + return SDKExporterSpanInflightObservable{noop.Int64ObservableUpDownCounter{}}, err + } + return SDKExporterSpanInflightObservable{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m SDKExporterSpanInflightObservable) Inst() metric.Int64ObservableUpDownCounter { + return m.Int64ObservableUpDownCounter +} + +// Name returns the semantic convention name of the instrument. +func (SDKExporterSpanInflightObservable) Name() string { + return "otel.sdk.exporter.span.inflight" +} + +// Unit returns the semantic convention unit of the instrument +func (SDKExporterSpanInflightObservable) Unit() string { + return "{span}" +} + +// Description returns the semantic convention description of the instrument +func (SDKExporterSpanInflightObservable) Description() string { + return "The number of spans which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)." +} + +// AttrComponentName returns an optional attribute for the "otel.component.name" +// semantic convention. It represents a name uniquely identifying the instance of +// the OpenTelemetry component within its containing SDK instance. +func (SDKExporterSpanInflightObservable) AttrComponentName(val string) attribute.KeyValue { + return attribute.String("otel.component.name", val) +} + +// AttrComponentType returns an optional attribute for the "otel.component.type" +// semantic convention. It represents a name identifying the type of the +// OpenTelemetry component. +func (SDKExporterSpanInflightObservable) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { + return attribute.String("otel.component.type", string(val)) +} + +// AttrServerAddress returns an optional attribute for the "server.address" +// semantic convention. It represents the server domain name if available without +// reverse DNS lookup; otherwise, IP address or Unix domain socket name. +func (SDKExporterSpanInflightObservable) AttrServerAddress(val string) attribute.KeyValue { + return attribute.String("server.address", val) +} + +// AttrServerPort returns an optional attribute for the "server.port" semantic +// convention. It represents the server port number. +func (SDKExporterSpanInflightObservable) AttrServerPort(val int) attribute.KeyValue { + return attribute.Int("server.port", val) +} + +// SDKLogCreated is an instrument used to record metric values conforming to the +// "otel.sdk.log.created" semantic conventions. It represents the number of logs +// submitted to enabled SDK Loggers. +type SDKLogCreated struct { + metric.Int64Counter +} + +var newSDKLogCreatedOpts = []metric.Int64CounterOption{ + metric.WithDescription("The number of logs submitted to enabled SDK Loggers."), + metric.WithUnit("{log_record}"), +} + +// NewSDKLogCreated returns a new SDKLogCreated instrument. +func NewSDKLogCreated( + m metric.Meter, + opt ...metric.Int64CounterOption, +) (SDKLogCreated, error) { + // Check if the meter is nil. + if m == nil { + return SDKLogCreated{noop.Int64Counter{}}, nil + } + + if len(opt) == 0 { + opt = newSDKLogCreatedOpts + } else { + opt = append(opt, newSDKLogCreatedOpts...) + } + + i, err := m.Int64Counter( + "otel.sdk.log.created", + opt..., + ) + if err != nil { + return SDKLogCreated{noop.Int64Counter{}}, err + } + return SDKLogCreated{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m SDKLogCreated) Inst() metric.Int64Counter { + return m.Int64Counter +} + +// Name returns the semantic convention name of the instrument. +func (SDKLogCreated) Name() string { + return "otel.sdk.log.created" +} + +// Unit returns the semantic convention unit of the instrument +func (SDKLogCreated) Unit() string { + return "{log_record}" +} + +// Description returns the semantic convention description of the instrument +func (SDKLogCreated) Description() string { + return "The number of logs submitted to enabled SDK Loggers." +} + +// Add adds incr to the existing count for attrs. +func (m SDKLogCreated) Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue) { + if !m.Int64Counter.Enabled(ctx) { + return + } + if len(attrs) == 0 { + m.Int64Counter.Add(ctx, incr) + return + } + + o := metricpool.AddOptions() + defer metricpool.PutAddOptions(o) + + *o = append(*o, metric.WithAttributes(attrs...)) + m.Int64Counter.Add(ctx, incr, *o...) +} + +// AddSet adds incr to the existing count for set. +func (m SDKLogCreated) AddSet(ctx context.Context, incr int64, set attribute.Set) { + if !m.Int64Counter.Enabled(ctx) { + return + } + if set.Len() == 0 { + m.Int64Counter.Add(ctx, incr) + return + } + + o := metricpool.AddOptions() + defer metricpool.PutAddOptions(o) + + *o = append(*o, metric.WithAttributeSet(set)) + m.Int64Counter.Add(ctx, incr, *o...) +} + +// SDKLogCreatedObservable is an instrument used to record metric values +// conforming to the "otel.sdk.log.created" semantic conventions. It represents +// the number of logs submitted to enabled SDK Loggers. +type SDKLogCreatedObservable struct { + metric.Int64ObservableCounter +} + +var newSDKLogCreatedObservableOpts = []metric.Int64ObservableCounterOption{ + metric.WithDescription("The number of logs submitted to enabled SDK Loggers."), + metric.WithUnit("{log_record}"), +} + +// NewSDKLogCreatedObservable returns a new SDKLogCreatedObservable instrument. +func NewSDKLogCreatedObservable( + m metric.Meter, + opt ...metric.Int64ObservableCounterOption, +) (SDKLogCreatedObservable, error) { + // Check if the meter is nil. + if m == nil { + return SDKLogCreatedObservable{noop.Int64ObservableCounter{}}, nil + } + + if len(opt) == 0 { + opt = newSDKLogCreatedObservableOpts + } else { + opt = append(opt, newSDKLogCreatedObservableOpts...) + } + + i, err := m.Int64ObservableCounter( + "otel.sdk.log.created", + opt..., + ) + if err != nil { + return SDKLogCreatedObservable{noop.Int64ObservableCounter{}}, err + } + return SDKLogCreatedObservable{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m SDKLogCreatedObservable) Inst() metric.Int64ObservableCounter { + return m.Int64ObservableCounter +} + +// Name returns the semantic convention name of the instrument. +func (SDKLogCreatedObservable) Name() string { + return "otel.sdk.log.created" +} + +// Unit returns the semantic convention unit of the instrument +func (SDKLogCreatedObservable) Unit() string { + return "{log_record}" +} + +// Description returns the semantic convention description of the instrument +func (SDKLogCreatedObservable) Description() string { + return "The number of logs submitted to enabled SDK Loggers." +} + +// SDKMetricReaderCollectionDuration is an instrument used to record metric +// values conforming to the "otel.sdk.metric_reader.collection.duration" semantic +// conventions. It represents the duration of the collect operation of the metric +// reader. +type SDKMetricReaderCollectionDuration struct { + metric.Float64Histogram +} + +var newSDKMetricReaderCollectionDurationOpts = []metric.Float64HistogramOption{ + metric.WithDescription("The duration of the collect operation of the metric reader."), + metric.WithUnit("s"), +} + +// NewSDKMetricReaderCollectionDuration returns a new +// SDKMetricReaderCollectionDuration instrument. +func NewSDKMetricReaderCollectionDuration( + m metric.Meter, + opt ...metric.Float64HistogramOption, +) (SDKMetricReaderCollectionDuration, error) { + // Check if the meter is nil. + if m == nil { + return SDKMetricReaderCollectionDuration{noop.Float64Histogram{}}, nil + } + + if len(opt) == 0 { + opt = newSDKMetricReaderCollectionDurationOpts + } else { + opt = append(opt, newSDKMetricReaderCollectionDurationOpts...) + } + + i, err := m.Float64Histogram( + "otel.sdk.metric_reader.collection.duration", + opt..., + ) + if err != nil { + return SDKMetricReaderCollectionDuration{noop.Float64Histogram{}}, err + } + return SDKMetricReaderCollectionDuration{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m SDKMetricReaderCollectionDuration) Inst() metric.Float64Histogram { + return m.Float64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (SDKMetricReaderCollectionDuration) Name() string { + return "otel.sdk.metric_reader.collection.duration" +} + +// Unit returns the semantic convention unit of the instrument +func (SDKMetricReaderCollectionDuration) Unit() string { + return "s" +} + +// Description returns the semantic convention description of the instrument +func (SDKMetricReaderCollectionDuration) Description() string { + return "The duration of the collect operation of the metric reader." +} + +// Record records val to the current distribution for attrs. +// +// All additional attrs passed are included in the recorded value. +// +// For successful collections, `error.type` MUST NOT be set. For failed +// collections, `error.type` SHOULD contain the failure cause. +// It can happen that metrics collection is successful for some MetricProducers, +// while others fail. In that case `error.type` SHOULD be set to any of the +// failure causes. +func (m SDKMetricReaderCollectionDuration) Record( + ctx context.Context, + val float64, + attrs ...attribute.KeyValue, +) { + if !m.Float64Histogram.Enabled(ctx) { + return + } + if len(attrs) == 0 { + m.Float64Histogram.Record(ctx, val) + return + } + + o := metricpool.RecordOptions() + defer metricpool.PutRecordOptions(o) + + *o = append( + *o, + metric.WithAttributes( + attrs..., + ), + ) + + m.Float64Histogram.Record(ctx, val, *o...) +} + +// RecordSet records val to the current distribution for set. +// +// For successful collections, `error.type` MUST NOT be set. For failed +// collections, `error.type` SHOULD contain the failure cause. +// It can happen that metrics collection is successful for some MetricProducers, +// while others fail. In that case `error.type` SHOULD be set to any of the +// failure causes. +func (m SDKMetricReaderCollectionDuration) RecordSet(ctx context.Context, val float64, set attribute.Set) { + if !m.Float64Histogram.Enabled(ctx) { + return + } + if set.Len() == 0 { + m.Float64Histogram.Record(ctx, val) + return + } + + o := metricpool.RecordOptions() + defer metricpool.PutRecordOptions(o) + + *o = append(*o, metric.WithAttributeSet(set)) + m.Float64Histogram.Record(ctx, val, *o...) +} + +// AttrErrorType returns an optional attribute for the "error.type" semantic +// convention. It represents the describes a class of error the operation ended +// with. +func (SDKMetricReaderCollectionDuration) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { + return attribute.String("error.type", string(val)) +} + +// AttrComponentName returns an optional attribute for the "otel.component.name" +// semantic convention. It represents a name uniquely identifying the instance of +// the OpenTelemetry component within its containing SDK instance. +func (SDKMetricReaderCollectionDuration) AttrComponentName(val string) attribute.KeyValue { + return attribute.String("otel.component.name", val) +} + +// AttrComponentType returns an optional attribute for the "otel.component.type" +// semantic convention. It represents a name identifying the type of the +// OpenTelemetry component. +func (SDKMetricReaderCollectionDuration) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { + return attribute.String("otel.component.type", string(val)) +} + +// SDKProcessorLogProcessed is an instrument used to record metric values +// conforming to the "otel.sdk.processor.log.processed" semantic conventions. It +// represents the number of log records for which the processing has finished, +// either successful or failed. +type SDKProcessorLogProcessed struct { + metric.Int64Counter +} + +var newSDKProcessorLogProcessedOpts = []metric.Int64CounterOption{ + metric.WithDescription("The number of log records for which the processing has finished, either successful or failed."), + metric.WithUnit("{log_record}"), +} + +// NewSDKProcessorLogProcessed returns a new SDKProcessorLogProcessed instrument. +func NewSDKProcessorLogProcessed( + m metric.Meter, + opt ...metric.Int64CounterOption, +) (SDKProcessorLogProcessed, error) { + // Check if the meter is nil. + if m == nil { + return SDKProcessorLogProcessed{noop.Int64Counter{}}, nil + } + + if len(opt) == 0 { + opt = newSDKProcessorLogProcessedOpts + } else { + opt = append(opt, newSDKProcessorLogProcessedOpts...) + } + + i, err := m.Int64Counter( + "otel.sdk.processor.log.processed", + opt..., + ) + if err != nil { + return SDKProcessorLogProcessed{noop.Int64Counter{}}, err + } + return SDKProcessorLogProcessed{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m SDKProcessorLogProcessed) Inst() metric.Int64Counter { + return m.Int64Counter +} + +// Name returns the semantic convention name of the instrument. +func (SDKProcessorLogProcessed) Name() string { + return "otel.sdk.processor.log.processed" +} + +// Unit returns the semantic convention unit of the instrument +func (SDKProcessorLogProcessed) Unit() string { + return "{log_record}" +} + +// Description returns the semantic convention description of the instrument +func (SDKProcessorLogProcessed) Description() string { + return "The number of log records for which the processing has finished, either successful or failed." +} + +// Add adds incr to the existing count for attrs. +// +// All additional attrs passed are included in the recorded value. +// +// For successful processing, `error.type` MUST NOT be set. For failed +// processing, `error.type` MUST contain the failure cause. +// SDK Batching Log Record Processors MUST use `queue_full` as the value of +// `error.type` for log records dropped due to a full queue. +// SDK Log Record Processors MUST use `already_shutdown` as the value of +// `error.type` for log records dropped because the processor has already been +// shut down. +// For the SDK Simple and Batching Log Record Processor a log record is +// considered to be processed already when it has been submitted to the exporter, +// not when the corresponding export call has finished. +func (m SDKProcessorLogProcessed) Add( + ctx context.Context, + incr int64, + attrs ...attribute.KeyValue, +) { + if !m.Int64Counter.Enabled(ctx) { + return + } + if len(attrs) == 0 { + m.Int64Counter.Add(ctx, incr) + return + } + + o := metricpool.AddOptions() + defer metricpool.PutAddOptions(o) + + *o = append( + *o, + metric.WithAttributes( + attrs..., + ), + ) + + m.Int64Counter.Add(ctx, incr, *o...) +} + +// AddSet adds incr to the existing count for set. +// +// For successful processing, `error.type` MUST NOT be set. For failed +// processing, `error.type` MUST contain the failure cause. +// SDK Batching Log Record Processors MUST use `queue_full` as the value of +// `error.type` for log records dropped due to a full queue. +// SDK Log Record Processors MUST use `already_shutdown` as the value of +// `error.type` for log records dropped because the processor has already been +// shut down. +// For the SDK Simple and Batching Log Record Processor a log record is +// considered to be processed already when it has been submitted to the exporter, +// not when the corresponding export call has finished. +func (m SDKProcessorLogProcessed) AddSet(ctx context.Context, incr int64, set attribute.Set) { + if !m.Int64Counter.Enabled(ctx) { + return + } + if set.Len() == 0 { + m.Int64Counter.Add(ctx, incr) + return + } + + o := metricpool.AddOptions() + defer metricpool.PutAddOptions(o) + + *o = append(*o, metric.WithAttributeSet(set)) + m.Int64Counter.Add(ctx, incr, *o...) +} + +// AttrErrorType returns an optional attribute for the "error.type" semantic +// convention. It represents a low-cardinality description of the failure reason. +func (SDKProcessorLogProcessed) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { + return attribute.String("error.type", string(val)) +} + +// AttrComponentName returns an optional attribute for the "otel.component.name" +// semantic convention. It represents a name uniquely identifying the instance of +// the OpenTelemetry component within its containing SDK instance. +func (SDKProcessorLogProcessed) AttrComponentName(val string) attribute.KeyValue { + return attribute.String("otel.component.name", val) +} + +// AttrComponentType returns an optional attribute for the "otel.component.type" +// semantic convention. It represents a name identifying the type of the +// OpenTelemetry component. +func (SDKProcessorLogProcessed) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { + return attribute.String("otel.component.type", string(val)) +} + +// SDKProcessorLogProcessedObservable is an instrument used to record metric +// values conforming to the "otel.sdk.processor.log.processed" semantic +// conventions. It represents the number of log records for which the processing +// has finished, either successful or failed. +type SDKProcessorLogProcessedObservable struct { + metric.Int64ObservableCounter +} + +var newSDKProcessorLogProcessedObservableOpts = []metric.Int64ObservableCounterOption{ + metric.WithDescription("The number of log records for which the processing has finished, either successful or failed."), + metric.WithUnit("{log_record}"), +} + +// NewSDKProcessorLogProcessedObservable returns a new +// SDKProcessorLogProcessedObservable instrument. +func NewSDKProcessorLogProcessedObservable( + m metric.Meter, + opt ...metric.Int64ObservableCounterOption, +) (SDKProcessorLogProcessedObservable, error) { + // Check if the meter is nil. + if m == nil { + return SDKProcessorLogProcessedObservable{noop.Int64ObservableCounter{}}, nil + } + + if len(opt) == 0 { + opt = newSDKProcessorLogProcessedObservableOpts + } else { + opt = append(opt, newSDKProcessorLogProcessedObservableOpts...) + } + + i, err := m.Int64ObservableCounter( + "otel.sdk.processor.log.processed", + opt..., + ) + if err != nil { + return SDKProcessorLogProcessedObservable{noop.Int64ObservableCounter{}}, err + } + return SDKProcessorLogProcessedObservable{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m SDKProcessorLogProcessedObservable) Inst() metric.Int64ObservableCounter { + return m.Int64ObservableCounter +} + +// Name returns the semantic convention name of the instrument. +func (SDKProcessorLogProcessedObservable) Name() string { + return "otel.sdk.processor.log.processed" +} + +// Unit returns the semantic convention unit of the instrument +func (SDKProcessorLogProcessedObservable) Unit() string { + return "{log_record}" +} + +// Description returns the semantic convention description of the instrument +func (SDKProcessorLogProcessedObservable) Description() string { + return "The number of log records for which the processing has finished, either successful or failed." +} + +// AttrErrorType returns an optional attribute for the "error.type" semantic +// convention. It represents a low-cardinality description of the failure reason. +func (SDKProcessorLogProcessedObservable) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { + return attribute.String("error.type", string(val)) +} + +// AttrComponentName returns an optional attribute for the "otel.component.name" +// semantic convention. It represents a name uniquely identifying the instance of +// the OpenTelemetry component within its containing SDK instance. +func (SDKProcessorLogProcessedObservable) AttrComponentName(val string) attribute.KeyValue { + return attribute.String("otel.component.name", val) +} + +// AttrComponentType returns an optional attribute for the "otel.component.type" +// semantic convention. It represents a name identifying the type of the +// OpenTelemetry component. +func (SDKProcessorLogProcessedObservable) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { + return attribute.String("otel.component.type", string(val)) +} + +// SDKProcessorLogQueueCapacity is an instrument used to record metric values +// conforming to the "otel.sdk.processor.log.queue.capacity" semantic +// conventions. It represents the maximum number of log records the queue of a +// given instance of an SDK Log Record processor can hold. +type SDKProcessorLogQueueCapacity struct { + metric.Int64ObservableUpDownCounter +} + +var newSDKProcessorLogQueueCapacityOpts = []metric.Int64ObservableUpDownCounterOption{ + metric.WithDescription("The maximum number of log records the queue of a given instance of an SDK Log Record processor can hold."), + metric.WithUnit("{log_record}"), +} + +// NewSDKProcessorLogQueueCapacity returns a new SDKProcessorLogQueueCapacity +// instrument. +func NewSDKProcessorLogQueueCapacity( + m metric.Meter, + opt ...metric.Int64ObservableUpDownCounterOption, +) (SDKProcessorLogQueueCapacity, error) { + // Check if the meter is nil. + if m == nil { + return SDKProcessorLogQueueCapacity{noop.Int64ObservableUpDownCounter{}}, nil + } + + if len(opt) == 0 { + opt = newSDKProcessorLogQueueCapacityOpts + } else { + opt = append(opt, newSDKProcessorLogQueueCapacityOpts...) + } + + i, err := m.Int64ObservableUpDownCounter( + "otel.sdk.processor.log.queue.capacity", + opt..., + ) + if err != nil { + return SDKProcessorLogQueueCapacity{noop.Int64ObservableUpDownCounter{}}, err + } + return SDKProcessorLogQueueCapacity{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m SDKProcessorLogQueueCapacity) Inst() metric.Int64ObservableUpDownCounter { + return m.Int64ObservableUpDownCounter +} + +// Name returns the semantic convention name of the instrument. +func (SDKProcessorLogQueueCapacity) Name() string { + return "otel.sdk.processor.log.queue.capacity" +} + +// Unit returns the semantic convention unit of the instrument +func (SDKProcessorLogQueueCapacity) Unit() string { + return "{log_record}" +} + +// Description returns the semantic convention description of the instrument +func (SDKProcessorLogQueueCapacity) Description() string { + return "The maximum number of log records the queue of a given instance of an SDK Log Record processor can hold." +} + +// AttrComponentName returns an optional attribute for the "otel.component.name" +// semantic convention. It represents a name uniquely identifying the instance of +// the OpenTelemetry component within its containing SDK instance. +func (SDKProcessorLogQueueCapacity) AttrComponentName(val string) attribute.KeyValue { + return attribute.String("otel.component.name", val) +} + +// AttrComponentType returns an optional attribute for the "otel.component.type" +// semantic convention. It represents a name identifying the type of the +// OpenTelemetry component. +func (SDKProcessorLogQueueCapacity) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { + return attribute.String("otel.component.type", string(val)) +} + +// SDKProcessorLogQueueSize is an instrument used to record metric values +// conforming to the "otel.sdk.processor.log.queue.size" semantic conventions. It +// represents the number of log records in the queue of a given instance of an +// SDK log processor. +type SDKProcessorLogQueueSize struct { + metric.Int64ObservableUpDownCounter +} + +var newSDKProcessorLogQueueSizeOpts = []metric.Int64ObservableUpDownCounterOption{ + metric.WithDescription("The number of log records in the queue of a given instance of an SDK log processor."), + metric.WithUnit("{log_record}"), +} + +// NewSDKProcessorLogQueueSize returns a new SDKProcessorLogQueueSize instrument. +func NewSDKProcessorLogQueueSize( + m metric.Meter, + opt ...metric.Int64ObservableUpDownCounterOption, +) (SDKProcessorLogQueueSize, error) { + // Check if the meter is nil. + if m == nil { + return SDKProcessorLogQueueSize{noop.Int64ObservableUpDownCounter{}}, nil + } + + if len(opt) == 0 { + opt = newSDKProcessorLogQueueSizeOpts + } else { + opt = append(opt, newSDKProcessorLogQueueSizeOpts...) + } + + i, err := m.Int64ObservableUpDownCounter( + "otel.sdk.processor.log.queue.size", + opt..., + ) + if err != nil { + return SDKProcessorLogQueueSize{noop.Int64ObservableUpDownCounter{}}, err + } + return SDKProcessorLogQueueSize{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m SDKProcessorLogQueueSize) Inst() metric.Int64ObservableUpDownCounter { + return m.Int64ObservableUpDownCounter +} + +// Name returns the semantic convention name of the instrument. +func (SDKProcessorLogQueueSize) Name() string { + return "otel.sdk.processor.log.queue.size" +} + +// Unit returns the semantic convention unit of the instrument +func (SDKProcessorLogQueueSize) Unit() string { + return "{log_record}" +} + +// Description returns the semantic convention description of the instrument +func (SDKProcessorLogQueueSize) Description() string { + return "The number of log records in the queue of a given instance of an SDK log processor." +} + +// AttrComponentName returns an optional attribute for the "otel.component.name" +// semantic convention. It represents a name uniquely identifying the instance of +// the OpenTelemetry component within its containing SDK instance. +func (SDKProcessorLogQueueSize) AttrComponentName(val string) attribute.KeyValue { + return attribute.String("otel.component.name", val) +} + +// AttrComponentType returns an optional attribute for the "otel.component.type" +// semantic convention. It represents a name identifying the type of the +// OpenTelemetry component. +func (SDKProcessorLogQueueSize) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { + return attribute.String("otel.component.type", string(val)) +} + +// SDKProcessorSpanProcessed is an instrument used to record metric values +// conforming to the "otel.sdk.processor.span.processed" semantic conventions. It +// represents the number of spans for which the processing has finished, either +// successful or failed. +type SDKProcessorSpanProcessed struct { + metric.Int64Counter +} + +var newSDKProcessorSpanProcessedOpts = []metric.Int64CounterOption{ + metric.WithDescription("The number of spans for which the processing has finished, either successful or failed."), + metric.WithUnit("{span}"), +} + +// NewSDKProcessorSpanProcessed returns a new SDKProcessorSpanProcessed +// instrument. +func NewSDKProcessorSpanProcessed( + m metric.Meter, + opt ...metric.Int64CounterOption, +) (SDKProcessorSpanProcessed, error) { + // Check if the meter is nil. + if m == nil { + return SDKProcessorSpanProcessed{noop.Int64Counter{}}, nil + } + + if len(opt) == 0 { + opt = newSDKProcessorSpanProcessedOpts + } else { + opt = append(opt, newSDKProcessorSpanProcessedOpts...) + } + + i, err := m.Int64Counter( + "otel.sdk.processor.span.processed", + opt..., + ) + if err != nil { + return SDKProcessorSpanProcessed{noop.Int64Counter{}}, err + } + return SDKProcessorSpanProcessed{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m SDKProcessorSpanProcessed) Inst() metric.Int64Counter { + return m.Int64Counter +} + +// Name returns the semantic convention name of the instrument. +func (SDKProcessorSpanProcessed) Name() string { + return "otel.sdk.processor.span.processed" +} + +// Unit returns the semantic convention unit of the instrument +func (SDKProcessorSpanProcessed) Unit() string { + return "{span}" +} + +// Description returns the semantic convention description of the instrument +func (SDKProcessorSpanProcessed) Description() string { + return "The number of spans for which the processing has finished, either successful or failed." +} + +// Add adds incr to the existing count for attrs. +// +// All additional attrs passed are included in the recorded value. +// +// For successful processing, `error.type` MUST NOT be set. For failed +// processing, `error.type` MUST contain the failure cause. +// SDK Batching Span Processors MUST use `queue_full` as the value of +// `error.type` for spans dropped due to a full queue. +// SDK Span Processors MUST use `already_shutdown` as the value of `error.type` +// for spans dropped because the processor has already been shut down. +// For the SDK Simple and Batching Span Processor a span is considered to be +// processed already when it has been submitted to the exporter, not when the +// corresponding export call has finished. +func (m SDKProcessorSpanProcessed) Add( + ctx context.Context, + incr int64, + attrs ...attribute.KeyValue, +) { + if !m.Int64Counter.Enabled(ctx) { + return + } + if len(attrs) == 0 { + m.Int64Counter.Add(ctx, incr) + return + } + + o := metricpool.AddOptions() + defer metricpool.PutAddOptions(o) + + *o = append( + *o, + metric.WithAttributes( + attrs..., + ), + ) + + m.Int64Counter.Add(ctx, incr, *o...) +} + +// AddSet adds incr to the existing count for set. +// +// For successful processing, `error.type` MUST NOT be set. For failed +// processing, `error.type` MUST contain the failure cause. +// SDK Batching Span Processors MUST use `queue_full` as the value of +// `error.type` for spans dropped due to a full queue. +// SDK Span Processors MUST use `already_shutdown` as the value of `error.type` +// for spans dropped because the processor has already been shut down. +// For the SDK Simple and Batching Span Processor a span is considered to be +// processed already when it has been submitted to the exporter, not when the +// corresponding export call has finished. +func (m SDKProcessorSpanProcessed) AddSet(ctx context.Context, incr int64, set attribute.Set) { + if !m.Int64Counter.Enabled(ctx) { + return + } + if set.Len() == 0 { + m.Int64Counter.Add(ctx, incr) + return + } + + o := metricpool.AddOptions() + defer metricpool.PutAddOptions(o) + + *o = append(*o, metric.WithAttributeSet(set)) + m.Int64Counter.Add(ctx, incr, *o...) +} + +// AttrErrorType returns an optional attribute for the "error.type" semantic +// convention. It represents a low-cardinality description of the failure reason. +func (SDKProcessorSpanProcessed) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { + return attribute.String("error.type", string(val)) +} + +// AttrComponentName returns an optional attribute for the "otel.component.name" +// semantic convention. It represents a name uniquely identifying the instance of +// the OpenTelemetry component within its containing SDK instance. +func (SDKProcessorSpanProcessed) AttrComponentName(val string) attribute.KeyValue { + return attribute.String("otel.component.name", val) +} + +// AttrComponentType returns an optional attribute for the "otel.component.type" +// semantic convention. It represents a name identifying the type of the +// OpenTelemetry component. +func (SDKProcessorSpanProcessed) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { + return attribute.String("otel.component.type", string(val)) +} + +// SDKProcessorSpanProcessedObservable is an instrument used to record metric +// values conforming to the "otel.sdk.processor.span.processed" semantic +// conventions. It represents the number of spans for which the processing has +// finished, either successful or failed. +type SDKProcessorSpanProcessedObservable struct { + metric.Int64ObservableCounter +} + +var newSDKProcessorSpanProcessedObservableOpts = []metric.Int64ObservableCounterOption{ + metric.WithDescription("The number of spans for which the processing has finished, either successful or failed."), + metric.WithUnit("{span}"), +} + +// NewSDKProcessorSpanProcessedObservable returns a new +// SDKProcessorSpanProcessedObservable instrument. +func NewSDKProcessorSpanProcessedObservable( + m metric.Meter, + opt ...metric.Int64ObservableCounterOption, +) (SDKProcessorSpanProcessedObservable, error) { + // Check if the meter is nil. + if m == nil { + return SDKProcessorSpanProcessedObservable{noop.Int64ObservableCounter{}}, nil + } + + if len(opt) == 0 { + opt = newSDKProcessorSpanProcessedObservableOpts + } else { + opt = append(opt, newSDKProcessorSpanProcessedObservableOpts...) + } + + i, err := m.Int64ObservableCounter( + "otel.sdk.processor.span.processed", + opt..., + ) + if err != nil { + return SDKProcessorSpanProcessedObservable{noop.Int64ObservableCounter{}}, err + } + return SDKProcessorSpanProcessedObservable{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m SDKProcessorSpanProcessedObservable) Inst() metric.Int64ObservableCounter { + return m.Int64ObservableCounter +} + +// Name returns the semantic convention name of the instrument. +func (SDKProcessorSpanProcessedObservable) Name() string { + return "otel.sdk.processor.span.processed" +} + +// Unit returns the semantic convention unit of the instrument +func (SDKProcessorSpanProcessedObservable) Unit() string { + return "{span}" +} + +// Description returns the semantic convention description of the instrument +func (SDKProcessorSpanProcessedObservable) Description() string { + return "The number of spans for which the processing has finished, either successful or failed." +} + +// AttrErrorType returns an optional attribute for the "error.type" semantic +// convention. It represents a low-cardinality description of the failure reason. +func (SDKProcessorSpanProcessedObservable) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { + return attribute.String("error.type", string(val)) +} + +// AttrComponentName returns an optional attribute for the "otel.component.name" +// semantic convention. It represents a name uniquely identifying the instance of +// the OpenTelemetry component within its containing SDK instance. +func (SDKProcessorSpanProcessedObservable) AttrComponentName(val string) attribute.KeyValue { + return attribute.String("otel.component.name", val) +} + +// AttrComponentType returns an optional attribute for the "otel.component.type" +// semantic convention. It represents a name identifying the type of the +// OpenTelemetry component. +func (SDKProcessorSpanProcessedObservable) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { + return attribute.String("otel.component.type", string(val)) +} + +// SDKProcessorSpanQueueCapacity is an instrument used to record metric values +// conforming to the "otel.sdk.processor.span.queue.capacity" semantic +// conventions. It represents the maximum number of spans the queue of a given +// instance of an SDK span processor can hold. +type SDKProcessorSpanQueueCapacity struct { + metric.Int64ObservableUpDownCounter +} + +var newSDKProcessorSpanQueueCapacityOpts = []metric.Int64ObservableUpDownCounterOption{ + metric.WithDescription("The maximum number of spans the queue of a given instance of an SDK span processor can hold."), + metric.WithUnit("{span}"), +} + +// NewSDKProcessorSpanQueueCapacity returns a new SDKProcessorSpanQueueCapacity +// instrument. +func NewSDKProcessorSpanQueueCapacity( + m metric.Meter, + opt ...metric.Int64ObservableUpDownCounterOption, +) (SDKProcessorSpanQueueCapacity, error) { + // Check if the meter is nil. + if m == nil { + return SDKProcessorSpanQueueCapacity{noop.Int64ObservableUpDownCounter{}}, nil + } + + if len(opt) == 0 { + opt = newSDKProcessorSpanQueueCapacityOpts + } else { + opt = append(opt, newSDKProcessorSpanQueueCapacityOpts...) + } + + i, err := m.Int64ObservableUpDownCounter( + "otel.sdk.processor.span.queue.capacity", + opt..., + ) + if err != nil { + return SDKProcessorSpanQueueCapacity{noop.Int64ObservableUpDownCounter{}}, err + } + return SDKProcessorSpanQueueCapacity{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m SDKProcessorSpanQueueCapacity) Inst() metric.Int64ObservableUpDownCounter { + return m.Int64ObservableUpDownCounter +} + +// Name returns the semantic convention name of the instrument. +func (SDKProcessorSpanQueueCapacity) Name() string { + return "otel.sdk.processor.span.queue.capacity" +} + +// Unit returns the semantic convention unit of the instrument +func (SDKProcessorSpanQueueCapacity) Unit() string { + return "{span}" +} + +// Description returns the semantic convention description of the instrument +func (SDKProcessorSpanQueueCapacity) Description() string { + return "The maximum number of spans the queue of a given instance of an SDK span processor can hold." +} + +// AttrComponentName returns an optional attribute for the "otel.component.name" +// semantic convention. It represents a name uniquely identifying the instance of +// the OpenTelemetry component within its containing SDK instance. +func (SDKProcessorSpanQueueCapacity) AttrComponentName(val string) attribute.KeyValue { + return attribute.String("otel.component.name", val) +} + +// AttrComponentType returns an optional attribute for the "otel.component.type" +// semantic convention. It represents a name identifying the type of the +// OpenTelemetry component. +func (SDKProcessorSpanQueueCapacity) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { + return attribute.String("otel.component.type", string(val)) +} + +// SDKProcessorSpanQueueSize is an instrument used to record metric values +// conforming to the "otel.sdk.processor.span.queue.size" semantic conventions. +// It represents the number of spans in the queue of a given instance of an SDK +// span processor. +type SDKProcessorSpanQueueSize struct { + metric.Int64ObservableUpDownCounter +} + +var newSDKProcessorSpanQueueSizeOpts = []metric.Int64ObservableUpDownCounterOption{ + metric.WithDescription("The number of spans in the queue of a given instance of an SDK span processor."), + metric.WithUnit("{span}"), +} + +// NewSDKProcessorSpanQueueSize returns a new SDKProcessorSpanQueueSize +// instrument. +func NewSDKProcessorSpanQueueSize( + m metric.Meter, + opt ...metric.Int64ObservableUpDownCounterOption, +) (SDKProcessorSpanQueueSize, error) { + // Check if the meter is nil. + if m == nil { + return SDKProcessorSpanQueueSize{noop.Int64ObservableUpDownCounter{}}, nil + } + + if len(opt) == 0 { + opt = newSDKProcessorSpanQueueSizeOpts + } else { + opt = append(opt, newSDKProcessorSpanQueueSizeOpts...) + } + + i, err := m.Int64ObservableUpDownCounter( + "otel.sdk.processor.span.queue.size", + opt..., + ) + if err != nil { + return SDKProcessorSpanQueueSize{noop.Int64ObservableUpDownCounter{}}, err + } + return SDKProcessorSpanQueueSize{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m SDKProcessorSpanQueueSize) Inst() metric.Int64ObservableUpDownCounter { + return m.Int64ObservableUpDownCounter +} + +// Name returns the semantic convention name of the instrument. +func (SDKProcessorSpanQueueSize) Name() string { + return "otel.sdk.processor.span.queue.size" +} + +// Unit returns the semantic convention unit of the instrument +func (SDKProcessorSpanQueueSize) Unit() string { + return "{span}" +} + +// Description returns the semantic convention description of the instrument +func (SDKProcessorSpanQueueSize) Description() string { + return "The number of spans in the queue of a given instance of an SDK span processor." +} + +// AttrComponentName returns an optional attribute for the "otel.component.name" +// semantic convention. It represents a name uniquely identifying the instance of +// the OpenTelemetry component within its containing SDK instance. +func (SDKProcessorSpanQueueSize) AttrComponentName(val string) attribute.KeyValue { + return attribute.String("otel.component.name", val) +} + +// AttrComponentType returns an optional attribute for the "otel.component.type" +// semantic convention. It represents a name identifying the type of the +// OpenTelemetry component. +func (SDKProcessorSpanQueueSize) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { + return attribute.String("otel.component.type", string(val)) +} + +// SDKSpanLive is an instrument used to record metric values conforming to the +// "otel.sdk.span.live" semantic conventions. It represents the number of created +// spans with `recording=true` for which the end operation has not been called +// yet. +type SDKSpanLive struct { + metric.Int64UpDownCounter +} + +var newSDKSpanLiveOpts = []metric.Int64UpDownCounterOption{ + metric.WithDescription("The number of created spans with `recording=true` for which the end operation has not been called yet."), + metric.WithUnit("{span}"), +} + +// NewSDKSpanLive returns a new SDKSpanLive instrument. +func NewSDKSpanLive( + m metric.Meter, + opt ...metric.Int64UpDownCounterOption, +) (SDKSpanLive, error) { + // Check if the meter is nil. + if m == nil { + return SDKSpanLive{noop.Int64UpDownCounter{}}, nil + } + + if len(opt) == 0 { + opt = newSDKSpanLiveOpts + } else { + opt = append(opt, newSDKSpanLiveOpts...) + } + + i, err := m.Int64UpDownCounter( + "otel.sdk.span.live", + opt..., + ) + if err != nil { + return SDKSpanLive{noop.Int64UpDownCounter{}}, err + } + return SDKSpanLive{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m SDKSpanLive) Inst() metric.Int64UpDownCounter { + return m.Int64UpDownCounter +} + +// Name returns the semantic convention name of the instrument. +func (SDKSpanLive) Name() string { + return "otel.sdk.span.live" +} + +// Unit returns the semantic convention unit of the instrument +func (SDKSpanLive) Unit() string { + return "{span}" +} + +// Description returns the semantic convention description of the instrument +func (SDKSpanLive) Description() string { + return "The number of created spans with `recording=true` for which the end operation has not been called yet." +} + +// Add adds incr to the existing count for attrs. +// +// All additional attrs passed are included in the recorded value. +// +// Non-recording spans are not counted, hence `otel.span.sampling_result` can +// only take values `RECORD_ONLY` and `RECORD_AND_SAMPLE`, not `DROP`. +func (m SDKSpanLive) Add( + ctx context.Context, + incr int64, + attrs ...attribute.KeyValue, +) { + if !m.Int64UpDownCounter.Enabled(ctx) { + return + } + if len(attrs) == 0 { + m.Int64UpDownCounter.Add(ctx, incr) + return + } + + o := metricpool.AddOptions() + defer metricpool.PutAddOptions(o) + + *o = append( + *o, + metric.WithAttributes( + attrs..., + ), + ) + + m.Int64UpDownCounter.Add(ctx, incr, *o...) +} + +// AddSet adds incr to the existing count for set. +// +// Non-recording spans are not counted, hence `otel.span.sampling_result` can +// only take values `RECORD_ONLY` and `RECORD_AND_SAMPLE`, not `DROP`. +func (m SDKSpanLive) AddSet(ctx context.Context, incr int64, set attribute.Set) { + if !m.Int64UpDownCounter.Enabled(ctx) { + return + } + if set.Len() == 0 { + m.Int64UpDownCounter.Add(ctx, incr) + return + } + + o := metricpool.AddOptions() + defer metricpool.PutAddOptions(o) + + *o = append(*o, metric.WithAttributeSet(set)) + m.Int64UpDownCounter.Add(ctx, incr, *o...) +} + +// AttrSpanSamplingResult returns an optional attribute for the +// "otel.span.sampling_result" semantic convention. It represents the result +// value of the sampler for this span. +func (SDKSpanLive) AttrSpanSamplingResult(val SpanSamplingResultAttr) attribute.KeyValue { + return attribute.String("otel.span.sampling_result", string(val)) +} + +// SDKSpanLiveObservable is an instrument used to record metric values conforming +// to the "otel.sdk.span.live" semantic conventions. It represents the number of +// created spans with `recording=true` for which the end operation has not been +// called yet. +type SDKSpanLiveObservable struct { + metric.Int64ObservableUpDownCounter +} + +var newSDKSpanLiveObservableOpts = []metric.Int64ObservableUpDownCounterOption{ + metric.WithDescription("The number of created spans with `recording=true` for which the end operation has not been called yet."), + metric.WithUnit("{span}"), +} + +// NewSDKSpanLiveObservable returns a new SDKSpanLiveObservable instrument. +func NewSDKSpanLiveObservable( + m metric.Meter, + opt ...metric.Int64ObservableUpDownCounterOption, +) (SDKSpanLiveObservable, error) { + // Check if the meter is nil. + if m == nil { + return SDKSpanLiveObservable{noop.Int64ObservableUpDownCounter{}}, nil + } + + if len(opt) == 0 { + opt = newSDKSpanLiveObservableOpts + } else { + opt = append(opt, newSDKSpanLiveObservableOpts...) + } + + i, err := m.Int64ObservableUpDownCounter( + "otel.sdk.span.live", + opt..., + ) + if err != nil { + return SDKSpanLiveObservable{noop.Int64ObservableUpDownCounter{}}, err + } + return SDKSpanLiveObservable{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m SDKSpanLiveObservable) Inst() metric.Int64ObservableUpDownCounter { + return m.Int64ObservableUpDownCounter +} + +// Name returns the semantic convention name of the instrument. +func (SDKSpanLiveObservable) Name() string { + return "otel.sdk.span.live" +} + +// Unit returns the semantic convention unit of the instrument +func (SDKSpanLiveObservable) Unit() string { + return "{span}" +} + +// Description returns the semantic convention description of the instrument +func (SDKSpanLiveObservable) Description() string { + return "The number of created spans with `recording=true` for which the end operation has not been called yet." +} + +// AttrSpanSamplingResult returns an optional attribute for the +// "otel.span.sampling_result" semantic convention. It represents the result +// value of the sampler for this span. +func (SDKSpanLiveObservable) AttrSpanSamplingResult(val SpanSamplingResultAttr) attribute.KeyValue { + return attribute.String("otel.span.sampling_result", string(val)) +} + +// SDKSpanStarted is an instrument used to record metric values conforming to the +// "otel.sdk.span.started" semantic conventions. It represents the number of +// created spans. +type SDKSpanStarted struct { + metric.Int64Counter +} + +var newSDKSpanStartedOpts = []metric.Int64CounterOption{ + metric.WithDescription("The number of created spans."), + metric.WithUnit("{span}"), +} + +// NewSDKSpanStarted returns a new SDKSpanStarted instrument. +func NewSDKSpanStarted( + m metric.Meter, + opt ...metric.Int64CounterOption, +) (SDKSpanStarted, error) { + // Check if the meter is nil. + if m == nil { + return SDKSpanStarted{noop.Int64Counter{}}, nil + } + + if len(opt) == 0 { + opt = newSDKSpanStartedOpts + } else { + opt = append(opt, newSDKSpanStartedOpts...) + } + + i, err := m.Int64Counter( + "otel.sdk.span.started", + opt..., + ) + if err != nil { + return SDKSpanStarted{noop.Int64Counter{}}, err + } + return SDKSpanStarted{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m SDKSpanStarted) Inst() metric.Int64Counter { + return m.Int64Counter +} + +// Name returns the semantic convention name of the instrument. +func (SDKSpanStarted) Name() string { + return "otel.sdk.span.started" +} + +// Unit returns the semantic convention unit of the instrument +func (SDKSpanStarted) Unit() string { + return "{span}" +} + +// Description returns the semantic convention description of the instrument +func (SDKSpanStarted) Description() string { + return "The number of created spans." +} + +// Add adds incr to the existing count for attrs. +// +// All additional attrs passed are included in the recorded value. +// +// Implementations MUST record this metric for all spans, even for non-recording +// ones. +func (m SDKSpanStarted) Add( + ctx context.Context, + incr int64, + attrs ...attribute.KeyValue, +) { + if !m.Int64Counter.Enabled(ctx) { + return + } + if len(attrs) == 0 { + m.Int64Counter.Add(ctx, incr) + return + } + + o := metricpool.AddOptions() + defer metricpool.PutAddOptions(o) + + *o = append( + *o, + metric.WithAttributes( + attrs..., + ), + ) + + m.Int64Counter.Add(ctx, incr, *o...) +} + +// AddSet adds incr to the existing count for set. +// +// Implementations MUST record this metric for all spans, even for non-recording +// ones. +func (m SDKSpanStarted) AddSet(ctx context.Context, incr int64, set attribute.Set) { + if !m.Int64Counter.Enabled(ctx) { + return + } + if set.Len() == 0 { + m.Int64Counter.Add(ctx, incr) + return + } + + o := metricpool.AddOptions() + defer metricpool.PutAddOptions(o) + + *o = append(*o, metric.WithAttributeSet(set)) + m.Int64Counter.Add(ctx, incr, *o...) +} + +// AttrSpanParentOrigin returns an optional attribute for the +// "otel.span.parent.origin" semantic convention. It represents the determines +// whether the span has a parent span, and if so, [whether it is a remote parent] +// . +// +// [whether it is a remote parent]: https://opentelemetry.io/docs/specs/otel/trace/api/#isremote +func (SDKSpanStarted) AttrSpanParentOrigin(val SpanParentOriginAttr) attribute.KeyValue { + return attribute.String("otel.span.parent.origin", string(val)) +} + +// AttrSpanSamplingResult returns an optional attribute for the +// "otel.span.sampling_result" semantic convention. It represents the result +// value of the sampler for this span. +func (SDKSpanStarted) AttrSpanSamplingResult(val SpanSamplingResultAttr) attribute.KeyValue { + return attribute.String("otel.span.sampling_result", string(val)) +} + +// SDKSpanStartedObservable is an instrument used to record metric values +// conforming to the "otel.sdk.span.started" semantic conventions. It represents +// the number of created spans. +type SDKSpanStartedObservable struct { + metric.Int64ObservableCounter +} + +var newSDKSpanStartedObservableOpts = []metric.Int64ObservableCounterOption{ + metric.WithDescription("The number of created spans."), + metric.WithUnit("{span}"), +} + +// NewSDKSpanStartedObservable returns a new SDKSpanStartedObservable instrument. +func NewSDKSpanStartedObservable( + m metric.Meter, + opt ...metric.Int64ObservableCounterOption, +) (SDKSpanStartedObservable, error) { + // Check if the meter is nil. + if m == nil { + return SDKSpanStartedObservable{noop.Int64ObservableCounter{}}, nil + } + + if len(opt) == 0 { + opt = newSDKSpanStartedObservableOpts + } else { + opt = append(opt, newSDKSpanStartedObservableOpts...) + } + + i, err := m.Int64ObservableCounter( + "otel.sdk.span.started", + opt..., + ) + if err != nil { + return SDKSpanStartedObservable{noop.Int64ObservableCounter{}}, err + } + return SDKSpanStartedObservable{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m SDKSpanStartedObservable) Inst() metric.Int64ObservableCounter { + return m.Int64ObservableCounter +} + +// Name returns the semantic convention name of the instrument. +func (SDKSpanStartedObservable) Name() string { + return "otel.sdk.span.started" +} + +// Unit returns the semantic convention unit of the instrument +func (SDKSpanStartedObservable) Unit() string { + return "{span}" +} + +// Description returns the semantic convention description of the instrument +func (SDKSpanStartedObservable) Description() string { + return "The number of created spans." +} + +// AttrSpanParentOrigin returns an optional attribute for the +// "otel.span.parent.origin" semantic convention. It represents the determines +// whether the span has a parent span, and if so, [whether it is a remote parent] +// . +// +// [whether it is a remote parent]: https://opentelemetry.io/docs/specs/otel/trace/api/#isremote +func (SDKSpanStartedObservable) AttrSpanParentOrigin(val SpanParentOriginAttr) attribute.KeyValue { + return attribute.String("otel.span.parent.origin", string(val)) +} + +// AttrSpanSamplingResult returns an optional attribute for the +// "otel.span.sampling_result" semantic convention. It represents the result +// value of the sampler for this span. +func (SDKSpanStartedObservable) AttrSpanSamplingResult(val SpanSamplingResultAttr) attribute.KeyValue { + return attribute.String("otel.span.sampling_result", string(val)) +} diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.43.0/rpcconv/metric.go b/vendor/go.opentelemetry.io/otel/semconv/v1.43.0/rpcconv/metric.go new file mode 100644 index 00000000000..c766d4b9e8a --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.43.0/rpcconv/metric.go @@ -0,0 +1,357 @@ +// Code generated from semantic convention specification. DO NOT EDIT. + +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Package rpcconv provides types and functionality for OpenTelemetry semantic +// conventions in the "rpc" namespace. +package rpcconv + +import ( + "context" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/metric/noop" + "go.opentelemetry.io/otel/semconv/internal/metricpool" +) + +// ErrorTypeAttr is an attribute conforming to the error.type semantic +// conventions. It represents the describes a class of error the operation ended +// with. +type ErrorTypeAttr string + +var ( + // ErrorTypeOther is a fallback error value to be used when the instrumentation + // doesn't define a custom value. + ErrorTypeOther ErrorTypeAttr = "_OTHER" +) + +// SystemNameAttr is an attribute conforming to the rpc.system.name semantic +// conventions. It represents the Remote Procedure Call (RPC) system. +type SystemNameAttr string + +var ( + // SystemNameGRPC is the [gRPC]. + // + // [gRPC]: https://grpc.io/ + SystemNameGRPC SystemNameAttr = "grpc" + // SystemNameDubbo is the [Apache Dubbo]. + // + // [Apache Dubbo]: https://dubbo.apache.org/ + SystemNameDubbo SystemNameAttr = "dubbo" + // SystemNameConnectrpc is the [Connect RPC]. + // + // [Connect RPC]: https://connectrpc.com/ + SystemNameConnectrpc SystemNameAttr = "connectrpc" + // SystemNameJSONRPC is the [JSON-RPC]. + // + // [JSON-RPC]: https://www.jsonrpc.org/ + SystemNameJSONRPC SystemNameAttr = "jsonrpc" +) + +// ClientCallDuration is an instrument used to record metric values conforming to +// the "rpc.client.call.duration" semantic conventions. It represents the +// measures the duration of an outgoing Remote Procedure Call (RPC). +type ClientCallDuration struct { + metric.Float64Histogram +} + +var newClientCallDurationOpts = []metric.Float64HistogramOption{ + metric.WithDescription("Measures the duration of an outgoing Remote Procedure Call (RPC)."), + metric.WithUnit("s"), + metric.WithExplicitBucketBoundaries([]float64{0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10}...), +} + +// NewClientCallDuration returns a new ClientCallDuration instrument. +func NewClientCallDuration( + m metric.Meter, + opt ...metric.Float64HistogramOption, +) (ClientCallDuration, error) { + // Check if the meter is nil. + if m == nil { + return ClientCallDuration{noop.Float64Histogram{}}, nil + } + + if len(opt) == 0 { + opt = newClientCallDurationOpts + } else { + opt = append(opt, newClientCallDurationOpts...) + } + + i, err := m.Float64Histogram( + "rpc.client.call.duration", + opt..., + ) + if err != nil { + return ClientCallDuration{noop.Float64Histogram{}}, err + } + return ClientCallDuration{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ClientCallDuration) Inst() metric.Float64Histogram { + return m.Float64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ClientCallDuration) Name() string { + return "rpc.client.call.duration" +} + +// Unit returns the semantic convention unit of the instrument +func (ClientCallDuration) Unit() string { + return "s" +} + +// Description returns the semantic convention description of the instrument +func (ClientCallDuration) Description() string { + return "Measures the duration of an outgoing Remote Procedure Call (RPC)." +} + +// Record records val to the current distribution for attrs. +// +// The systemName is the the Remote Procedure Call (RPC) system. +// +// All additional attrs passed are included in the recorded value. +// +// When this metric is reported alongside an RPC client span, the metric value +// SHOULD be the same as the RPC client span duration. +func (m ClientCallDuration) Record( + ctx context.Context, + val float64, + systemName SystemNameAttr, + attrs ...attribute.KeyValue, +) { + if !m.Float64Histogram.Enabled(ctx) { + return + } + if len(attrs) == 0 { + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("rpc.system.name", string(systemName)), + )) + return + } + + o := metricpool.RecordOptions() + defer metricpool.PutRecordOptions(o) + + *o = append( + *o, + metric.WithAttributes( + append( + attrs[:len(attrs):len(attrs)], + attribute.String("rpc.system.name", string(systemName)), + )..., + ), + ) + + m.Float64Histogram.Record(ctx, val, *o...) +} + +// RecordSet records val to the current distribution for set. +// +// When this metric is reported alongside an RPC client span, the metric value +// SHOULD be the same as the RPC client span duration. +func (m ClientCallDuration) RecordSet(ctx context.Context, val float64, set attribute.Set) { + if !m.Float64Histogram.Enabled(ctx) { + return + } + if set.Len() == 0 { + m.Float64Histogram.Record(ctx, val) + return + } + + o := metricpool.RecordOptions() + defer metricpool.PutRecordOptions(o) + + *o = append(*o, metric.WithAttributeSet(set)) + m.Float64Histogram.Record(ctx, val, *o...) +} + +// AttrErrorType returns an optional attribute for the "error.type" semantic +// convention. It represents the describes a class of error the operation ended +// with. +func (ClientCallDuration) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { + return attribute.String("error.type", string(val)) +} + +// AttrMethod returns an optional attribute for the "rpc.method" semantic +// convention. It represents the fully-qualified logical name of the method from +// the RPC interface perspective. +func (ClientCallDuration) AttrMethod(val string) attribute.KeyValue { + return attribute.String("rpc.method", val) +} + +// AttrResponseStatusCode returns an optional attribute for the +// "rpc.response.status_code" semantic convention. It represents the status code +// of the RPC returned by the RPC server or generated by the client. +func (ClientCallDuration) AttrResponseStatusCode(val string) attribute.KeyValue { + return attribute.String("rpc.response.status_code", val) +} + +// AttrServerAddress returns an optional attribute for the "server.address" +// semantic convention. It represents a string identifying a group of RPC server +// instances request is sent to. +func (ClientCallDuration) AttrServerAddress(val string) attribute.KeyValue { + return attribute.String("server.address", val) +} + +// AttrServerPort returns an optional attribute for the "server.port" semantic +// convention. It represents the server port number. +func (ClientCallDuration) AttrServerPort(val int) attribute.KeyValue { + return attribute.Int("server.port", val) +} + +// ServerCallDuration is an instrument used to record metric values conforming to +// the "rpc.server.call.duration" semantic conventions. It represents the +// measures the duration of an incoming Remote Procedure Call (RPC). +type ServerCallDuration struct { + metric.Float64Histogram +} + +var newServerCallDurationOpts = []metric.Float64HistogramOption{ + metric.WithDescription("Measures the duration of an incoming Remote Procedure Call (RPC)."), + metric.WithUnit("s"), + metric.WithExplicitBucketBoundaries([]float64{0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10}...), +} + +// NewServerCallDuration returns a new ServerCallDuration instrument. +func NewServerCallDuration( + m metric.Meter, + opt ...metric.Float64HistogramOption, +) (ServerCallDuration, error) { + // Check if the meter is nil. + if m == nil { + return ServerCallDuration{noop.Float64Histogram{}}, nil + } + + if len(opt) == 0 { + opt = newServerCallDurationOpts + } else { + opt = append(opt, newServerCallDurationOpts...) + } + + i, err := m.Float64Histogram( + "rpc.server.call.duration", + opt..., + ) + if err != nil { + return ServerCallDuration{noop.Float64Histogram{}}, err + } + return ServerCallDuration{i}, nil +} + +// Inst returns the underlying metric instrument. +func (m ServerCallDuration) Inst() metric.Float64Histogram { + return m.Float64Histogram +} + +// Name returns the semantic convention name of the instrument. +func (ServerCallDuration) Name() string { + return "rpc.server.call.duration" +} + +// Unit returns the semantic convention unit of the instrument +func (ServerCallDuration) Unit() string { + return "s" +} + +// Description returns the semantic convention description of the instrument +func (ServerCallDuration) Description() string { + return "Measures the duration of an incoming Remote Procedure Call (RPC)." +} + +// Record records val to the current distribution for attrs. +// +// The systemName is the the Remote Procedure Call (RPC) system. +// +// All additional attrs passed are included in the recorded value. +// +// When this metric is reported alongside an RPC server span, the metric value +// SHOULD be the same as the RPC server span duration. +func (m ServerCallDuration) Record( + ctx context.Context, + val float64, + systemName SystemNameAttr, + attrs ...attribute.KeyValue, +) { + if !m.Float64Histogram.Enabled(ctx) { + return + } + if len(attrs) == 0 { + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("rpc.system.name", string(systemName)), + )) + return + } + + o := metricpool.RecordOptions() + defer metricpool.PutRecordOptions(o) + + *o = append( + *o, + metric.WithAttributes( + append( + attrs[:len(attrs):len(attrs)], + attribute.String("rpc.system.name", string(systemName)), + )..., + ), + ) + + m.Float64Histogram.Record(ctx, val, *o...) +} + +// RecordSet records val to the current distribution for set. +// +// When this metric is reported alongside an RPC server span, the metric value +// SHOULD be the same as the RPC server span duration. +func (m ServerCallDuration) RecordSet(ctx context.Context, val float64, set attribute.Set) { + if !m.Float64Histogram.Enabled(ctx) { + return + } + if set.Len() == 0 { + m.Float64Histogram.Record(ctx, val) + return + } + + o := metricpool.RecordOptions() + defer metricpool.PutRecordOptions(o) + + *o = append(*o, metric.WithAttributeSet(set)) + m.Float64Histogram.Record(ctx, val, *o...) +} + +// AttrErrorType returns an optional attribute for the "error.type" semantic +// convention. It represents the describes a class of error the operation ended +// with. +func (ServerCallDuration) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { + return attribute.String("error.type", string(val)) +} + +// AttrMethod returns an optional attribute for the "rpc.method" semantic +// convention. It represents the fully-qualified logical name of the method from +// the RPC interface perspective. +func (ServerCallDuration) AttrMethod(val string) attribute.KeyValue { + return attribute.String("rpc.method", val) +} + +// AttrResponseStatusCode returns an optional attribute for the +// "rpc.response.status_code" semantic convention. It represents the status code +// of the RPC returned by the RPC server or generated by the client. +func (ServerCallDuration) AttrResponseStatusCode(val string) attribute.KeyValue { + return attribute.String("rpc.response.status_code", val) +} + +// AttrServerAddress returns an optional attribute for the "server.address" +// semantic convention. It represents a string identifying a group of RPC server +// instances request is sent to. +func (ServerCallDuration) AttrServerAddress(val string) attribute.KeyValue { + return attribute.String("server.address", val) +} + +// AttrServerPort returns an optional attribute for the "server.port" semantic +// convention. It represents the server port number. +func (ServerCallDuration) AttrServerPort(val int) attribute.KeyValue { + return attribute.Int("server.port", val) +} diff --git a/vendor/go.opentelemetry.io/otel/trace/auto.go b/vendor/go.opentelemetry.io/otel/trace/auto.go index 17cf898cd9a..be4a9644590 100644 --- a/vendor/go.opentelemetry.io/otel/trace/auto.go +++ b/vendor/go.opentelemetry.io/otel/trace/auto.go @@ -372,7 +372,7 @@ func convAttrValue(value attribute.Value) telemetry.Value { return telemetry.Value{} } -// truncate returns a truncated version of s such that it contains less than +// truncate returns a truncated version of s such that it contains at most // the limit number of characters. Truncation is applied by returning the limit // number of valid characters contained in s. // @@ -381,7 +381,7 @@ func convAttrValue(value attribute.Value) telemetry.Value { // UTF-8 is supported. When truncating, all invalid characters are dropped // before applying truncation. // -// If s already contains less than the limit number of bytes, it is returned +// If s already contains at most the limit number of bytes, it is returned // unchanged. No invalid characters are removed. func truncate(limit int, s string) string { // This prioritize performance in the following order based on the most @@ -407,6 +407,10 @@ func truncate(limit int, s string) string { continue } + // A zero limit also truncates a leading invalid byte or U+FFFD. + if limit == 0 { + return "" + } _, size := utf8.DecodeRuneInString(s[i:]) if size == 1 { // Invalid encoding. @@ -415,6 +419,12 @@ func truncate(limit int, s string) string { s = s[i:] break } + + // A valid U+FFFD still consumes one character of the limit. + count++ + if count > limit { + return s[:i] + } } // Fast-path, no invalid input. diff --git a/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/number.go b/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/number.go index 29e629d6674..5bb3b16c704 100644 --- a/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/number.go +++ b/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/number.go @@ -41,7 +41,7 @@ func (i *protoInt64) UnmarshalJSON(data []byte) error { // strings or integers. type protoUint64 uint64 -// Int64 returns the protoUint64 as a uint64. +// Uint64 returns the protoUint64 as a uint64. func (i *protoUint64) Uint64() uint64 { return uint64(*i) } // UnmarshalJSON decodes both strings and integers. diff --git a/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/value.go b/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/value.go index 9d2d680634f..b7b0e8b58dc 100644 --- a/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/value.go +++ b/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/value.go @@ -327,7 +327,7 @@ func (v Value) String() string { // Try to handle this as gracefully as possible. // // Don't panic here. The goal here is to have developers find this - // first if a slog.Kind is is not handled. It is + // first if a slog.Kind is not handled. It is // preferable to have user's open issue asking why their attributes // have a "unhandled: " prefix than say that their code is panicking. return fmt.Sprintf("", v.Kind()) diff --git a/vendor/go.opentelemetry.io/otel/trace/trace.go b/vendor/go.opentelemetry.io/otel/trace/trace.go index c4c383819f7..66b967e7dc9 100644 --- a/vendor/go.opentelemetry.io/otel/trace/trace.go +++ b/vendor/go.opentelemetry.io/otel/trace/trace.go @@ -134,13 +134,49 @@ func TraceIDFromHex(h string) (TraceID, error) { if len(h) != 32 { return [16]byte{}, errInvalidTraceIDLength } - var b [16]byte - invalidMark := byte(0) - for i := 0; i < len(h); i += 4 { - b[i/2] = (hexRev[h[i]] << 4) | hexRev[h[i+1]] - b[i/2+1] = (hexRev[h[i+2]] << 4) | hexRev[h[i+3]] - invalidMark |= hexRev[h[i]] | hexRev[h[i+1]] | hexRev[h[i+2]] | hexRev[h[i+3]] + // Decoding every character at a constant index allows the compiler to + // eliminate the bounds checks a loop over h would retain. + n0, n1 := hexRev[h[0]], hexRev[h[1]] + n2, n3 := hexRev[h[2]], hexRev[h[3]] + n4, n5 := hexRev[h[4]], hexRev[h[5]] + n6, n7 := hexRev[h[6]], hexRev[h[7]] + n8, n9 := hexRev[h[8]], hexRev[h[9]] + n10, n11 := hexRev[h[10]], hexRev[h[11]] + n12, n13 := hexRev[h[12]], hexRev[h[13]] + n14, n15 := hexRev[h[14]], hexRev[h[15]] + n16, n17 := hexRev[h[16]], hexRev[h[17]] + n18, n19 := hexRev[h[18]], hexRev[h[19]] + n20, n21 := hexRev[h[20]], hexRev[h[21]] + n22, n23 := hexRev[h[22]], hexRev[h[23]] + n24, n25 := hexRev[h[24]], hexRev[h[25]] + n26, n27 := hexRev[h[26]], hexRev[h[27]] + n28, n29 := hexRev[h[28]], hexRev[h[29]] + n30, n31 := hexRev[h[30]], hexRev[h[31]] + + b := [16]byte{ + (n0 << 4) | n1, + (n2 << 4) | n3, + (n4 << 4) | n5, + (n6 << 4) | n7, + (n8 << 4) | n9, + (n10 << 4) | n11, + (n12 << 4) | n13, + (n14 << 4) | n15, + (n16 << 4) | n17, + (n18 << 4) | n19, + (n20 << 4) | n21, + (n22 << 4) | n23, + (n24 << 4) | n25, + (n26 << 4) | n27, + (n28 << 4) | n29, + (n30 << 4) | n31, } + + invalidMark := n0 | n1 | n2 | n3 | n4 | n5 | n6 | n7 | + n8 | n9 | n10 | n11 | n12 | n13 | n14 | n15 | + n16 | n17 | n18 | n19 | n20 | n21 | n22 | n23 | + n24 | n25 | n26 | n27 | n28 | n29 | n30 | n31 + // If the upper 4 bits of any byte are not zero, there was an invalid hex // character since invalid hex characters are 0xff in hexRev. if invalidMark&0xf0 != 0 { @@ -160,13 +196,31 @@ func SpanIDFromHex(h string) (SpanID, error) { if len(h) != 16 { return [8]byte{}, errInvalidSpanIDLength } - var b [8]byte - invalidMark := byte(0) - for i := 0; i < len(h); i += 4 { - b[i/2] = (hexRev[h[i]] << 4) | hexRev[h[i+1]] - b[i/2+1] = (hexRev[h[i+2]] << 4) | hexRev[h[i+3]] - invalidMark |= hexRev[h[i]] | hexRev[h[i+1]] | hexRev[h[i+2]] | hexRev[h[i+3]] + // Decoding every character at a constant index allows the compiler to + // eliminate the bounds checks a loop over h would retain. + n0, n1 := hexRev[h[0]], hexRev[h[1]] + n2, n3 := hexRev[h[2]], hexRev[h[3]] + n4, n5 := hexRev[h[4]], hexRev[h[5]] + n6, n7 := hexRev[h[6]], hexRev[h[7]] + n8, n9 := hexRev[h[8]], hexRev[h[9]] + n10, n11 := hexRev[h[10]], hexRev[h[11]] + n12, n13 := hexRev[h[12]], hexRev[h[13]] + n14, n15 := hexRev[h[14]], hexRev[h[15]] + + b := [8]byte{ + (n0 << 4) | n1, + (n2 << 4) | n3, + (n4 << 4) | n5, + (n6 << 4) | n7, + (n8 << 4) | n9, + (n10 << 4) | n11, + (n12 << 4) | n13, + (n14 << 4) | n15, } + + invalidMark := n0 | n1 | n2 | n3 | n4 | n5 | n6 | n7 | + n8 | n9 | n10 | n11 | n12 | n13 | n14 | n15 + // If the upper 4 bits of any byte are not zero, there was an invalid hex // character since invalid hex characters are 0xff in hexRev. if invalidMark&0xf0 != 0 { diff --git a/vendor/go.opentelemetry.io/otel/trace/tracestate.go b/vendor/go.opentelemetry.io/otel/trace/tracestate.go index 9ac78fa04ce..062ceb2ad23 100644 --- a/vendor/go.opentelemetry.io/otel/trace/tracestate.go +++ b/vendor/go.opentelemetry.io/otel/trace/tracestate.go @@ -283,7 +283,7 @@ func (ts TraceState) Walk(f func(key, value string) bool) { // specification an error is returned with the original TraceState. // // If adding a new list-member means the TraceState would have more members -// then is allowed, the new list-member will be inserted and the right-most +// than is allowed, the new list-member will be inserted and the right-most // list-member will be dropped in the returned TraceState. func (ts TraceState) Insert(key, value string) (TraceState, error) { m, err := newMember(key, value) diff --git a/vendor/go.opentelemetry.io/otel/version.go b/vendor/go.opentelemetry.io/otel/version.go index ea790309690..29ff1801fad 100644 --- a/vendor/go.opentelemetry.io/otel/version.go +++ b/vendor/go.opentelemetry.io/otel/version.go @@ -5,5 +5,5 @@ package otel // Version is the current release version of OpenTelemetry in use. func Version() string { - return "1.45.0" + return "1.47.0" } diff --git a/vendor/go.opentelemetry.io/otel/versions.yaml b/vendor/go.opentelemetry.io/otel/versions.yaml index 3b1ad7301a2..a0cb35f4d41 100644 --- a/vendor/go.opentelemetry.io/otel/versions.yaml +++ b/vendor/go.opentelemetry.io/otel/versions.yaml @@ -3,7 +3,7 @@ module-sets: stable-v1: - version: v1.45.0 + version: v1.47.0 modules: - go.opentelemetry.io/otel - go.opentelemetry.io/otel/bridge/opencensus @@ -17,27 +17,31 @@ module-sets: - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric - go.opentelemetry.io/otel/exporters/stdout/stdouttrace - go.opentelemetry.io/otel/exporters/zipkin + - go.opentelemetry.io/otel/log - go.opentelemetry.io/otel/metric - go.opentelemetry.io/otel/sdk + - go.opentelemetry.io/otel/sdk/log - go.opentelemetry.io/otel/sdk/metric - go.opentelemetry.io/otel/trace experimental-metrics: - version: v0.67.0 + version: v0.69.0 modules: - go.opentelemetry.io/otel/exporters/prometheus - go.opentelemetry.io/otel/metric/x experimental-logs: - version: v0.21.0 + version: v0.23.0 modules: - - go.opentelemetry.io/otel/log - go.opentelemetry.io/otel/log/logtest - - go.opentelemetry.io/otel/sdk/log - go.opentelemetry.io/otel/sdk/log/logtest - go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc - go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp - go.opentelemetry.io/otel/exporters/stdout/stdoutlog + experimental-traces: + version: v0.1.0 + modules: + - go.opentelemetry.io/otel/sdk/trace/x experimental-schema: - version: v0.0.18 + version: v0.0.19 modules: - go.opentelemetry.io/otel/schema excluded-modules: diff --git a/vendor/go.opentelemetry.io/proto/otlp/common/v1/common.pb.go b/vendor/go.opentelemetry.io/proto/otlp/common/v1/common.pb.go index 304f6476374..cef3580008e 100644 --- a/vendor/go.opentelemetry.io/proto/otlp/common/v1/common.pb.go +++ b/vendor/go.opentelemetry.io/proto/otlp/common/v1/common.pb.go @@ -194,7 +194,7 @@ type AnyValue_StringValueStrindex struct { // Profiling signal and process the data as if this value were absent or // empty, ignoring its semantic content for the non-Profiling signal. // - // Status: [Development] + // Status: [Alpha] StringValueStrindex int32 `protobuf:"varint,8,opt,name=string_value_strindex,json=stringValueStrindex,proto3,oneof"` } @@ -330,7 +330,7 @@ type KeyValue struct { unknownFields protoimpl.UnknownFields // The key name of the pair. - // key_ref MUST NOT be set if key is used. + // key_strindex MUST NOT be set if key is used. Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // The value of the pair. Value *AnyValue `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` @@ -344,7 +344,7 @@ type KeyValue struct { // Profiling signal and process the data as if this value were absent or // empty, ignoring its semantic content for the non-Profiling signal. // - // Status: [Development] + // Status: [Alpha] KeyStrindex int32 `protobuf:"varint,3,opt,name=key_strindex,json=keyStrindex,proto3" json:"key_strindex,omitempty"` } diff --git a/vendor/go.uber.org/atomic/CHANGELOG.md b/vendor/go.uber.org/atomic/CHANGELOG.md index 6f87f33fa95..b944b9fe256 100644 --- a/vendor/go.uber.org/atomic/CHANGELOG.md +++ b/vendor/go.uber.org/atomic/CHANGELOG.md @@ -4,9 +4,21 @@ 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). +## [1.12.0] - 2026-09-17 +### Added +- Add `MarshalJSON` and `UnmarshalJSON` method to `atomic.Pointer[T]` type +allowing users to use pointer with json. +- Add `MarshalJSON` and `UnmarshalJSON` methods to `atomic.Time` so it +encodes and decodes the wrapped `time.Time` instead of an empty struct. + +### Updated +- Bumped https://github.com/stretchr/testify to v1.12.1. + +[1.12.0]: https://github.com/uber-go/atomic/compare/v1.11.0...v1.12.0 + ## [1.11.0] - 2023-05-02 ### Fixed -- Fix initialization of `Value` wrappers. +- Fix `Swap` and `CompareAndSwap` for `Value` wrappers without initialization. ### Added - Add `String` method to `atomic.Pointer[T]` type allowing users to safely print diff --git a/vendor/go.uber.org/atomic/README.md b/vendor/go.uber.org/atomic/README.md index 96b47a1f12d..f3fdb9c74cd 100644 --- a/vendor/go.uber.org/atomic/README.md +++ b/vendor/go.uber.org/atomic/README.md @@ -40,7 +40,7 @@ provide a safer, more convenient API. var atom atomic.Uint32 atom.Store(42) atom.Sub(2) -atom.CAS(40, 11) +atom.CompareAndSwap(40, 11) ``` See the [documentation][doc] for a complete API specification. diff --git a/vendor/go.uber.org/atomic/bool_ext.go b/vendor/go.uber.org/atomic/bool_ext.go index a2e60e98739..2a8b1e43217 100644 --- a/vendor/go.uber.org/atomic/bool_ext.go +++ b/vendor/go.uber.org/atomic/bool_ext.go @@ -41,7 +41,7 @@ func boolToInt(b bool) uint32 { func (b *Bool) Toggle() (old bool) { for { old := b.Load() - if b.CAS(old, !old) { + if b.CompareAndSwap(old, !old) { return old } } diff --git a/vendor/go.uber.org/atomic/float32_ext.go b/vendor/go.uber.org/atomic/float32_ext.go index b0cd8d9c820..f52d281a2a9 100644 --- a/vendor/go.uber.org/atomic/float32_ext.go +++ b/vendor/go.uber.org/atomic/float32_ext.go @@ -32,7 +32,7 @@ func (f *Float32) Add(delta float32) float32 { for { old := f.Load() new := old + delta - if f.CAS(old, new) { + if f.CompareAndSwap(old, new) { return new } } diff --git a/vendor/go.uber.org/atomic/float64_ext.go b/vendor/go.uber.org/atomic/float64_ext.go index 48c52b0abf6..ffed1f28cbc 100644 --- a/vendor/go.uber.org/atomic/float64_ext.go +++ b/vendor/go.uber.org/atomic/float64_ext.go @@ -32,7 +32,7 @@ func (f *Float64) Add(delta float64) float64 { for { old := f.Load() new := old + delta - if f.CAS(old, new) { + if f.CompareAndSwap(old, new) { return new } } diff --git a/vendor/go.uber.org/atomic/pointer_go118.go b/vendor/go.uber.org/atomic/pointer_go118.go index 1fb6c03b261..fb7e124e8f1 100644 --- a/vendor/go.uber.org/atomic/pointer_go118.go +++ b/vendor/go.uber.org/atomic/pointer_go118.go @@ -23,9 +23,27 @@ package atomic -import "fmt" +import ( + "encoding/json" + "fmt" +) // String returns a human readable representation of a Pointer's underlying value. func (p *Pointer[T]) String() string { return fmt.Sprint(p.Load()) } + +// MarshalJSON encodes the wrapped pointer into JSON. +func (p *Pointer[T]) MarshalJSON() ([]byte, error) { + return json.Marshal(p.Load()) +} + +// UnmarshalJSON decodes JSON into the wrapped pointer. +func (p *Pointer[T]) UnmarshalJSON(b []byte) error { + var v T + if err := json.Unmarshal(b, &v); err != nil { + return err + } + p.Store(&v) + return nil +} diff --git a/vendor/go.uber.org/atomic/time_ext.go b/vendor/go.uber.org/atomic/time_ext.go index 1e3dc978aa5..830fc971647 100644 --- a/vendor/go.uber.org/atomic/time_ext.go +++ b/vendor/go.uber.org/atomic/time_ext.go @@ -20,7 +20,10 @@ package atomic -import "time" +import ( + "encoding/json" + "time" +) //go:generate bin/gen-atomicwrapper -name=Time -type=time.Time -wrapped=Value -pack=packTime -unpack=unpackTime -imports time -file=time.go @@ -34,3 +37,18 @@ func unpackTime(v interface{}) time.Time { } return time.Time{} } + +// MarshalJSON encodes the wrapped time.Time into JSON. +func (x *Time) MarshalJSON() ([]byte, error) { + return json.Marshal(x.Load()) +} + +// UnmarshalJSON decodes a time.Time from JSON. +func (x *Time) UnmarshalJSON(b []byte) error { + var v time.Time + if err := json.Unmarshal(b, &v); err != nil { + return err + } + x.Store(v) + return nil +} diff --git a/vendor/go.yaml.in/yaml/v3/parserc.go b/vendor/go.yaml.in/yaml/v3/parserc.go index 25fe823637a..f35829db4da 100644 --- a/vendor/go.yaml.in/yaml/v3/parserc.go +++ b/vendor/go.yaml.in/yaml/v3/parserc.go @@ -226,9 +226,9 @@ func yaml_parser_state_machine(parser *yaml_parser_t, event *yaml_event_t) bool } // Parse the production: -// stream ::= STREAM-START implicit_document? explicit_document* STREAM-END // -// ************ +// stream ::= STREAM-START implicit_document? explicit_document* STREAM-END +// ************ func yaml_parser_parse_stream_start(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { @@ -249,13 +249,11 @@ func yaml_parser_parse_stream_start(parser *yaml_parser_t, event *yaml_event_t) } // Parse the productions: -// implicit_document ::= block_node DOCUMENT-END* -// -// * // -// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* -// -// ************************* +// implicit_document ::= block_node DOCUMENT-END* +// * +// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* +// ************************* func yaml_parser_parse_document_start(parser *yaml_parser_t, event *yaml_event_t, implicit bool) bool { token := peek_token(parser) @@ -359,9 +357,9 @@ func yaml_parser_parse_document_start(parser *yaml_parser_t, event *yaml_event_t } // Parse the productions: -// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* // -// *********** +// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* +// *********** func yaml_parser_parse_document_content(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { @@ -382,11 +380,10 @@ func yaml_parser_parse_document_content(parser *yaml_parser_t, event *yaml_event } // Parse the productions: -// implicit_document ::= block_node DOCUMENT-END* -// -// ************* // -// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* +// implicit_document ::= block_node DOCUMENT-END* +// ************* +// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* func yaml_parser_parse_document_end(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { @@ -432,42 +429,32 @@ func yaml_parser_set_event_comments(parser *yaml_parser_t, event *yaml_event_t) } // Parse the productions: -// block_node_or_indentless_sequence ::= -// -// ALIAS -// ***** -// | properties (block_content | indentless_block_sequence)? -// ********** * -// | block_content | indentless_block_sequence -// * -// -// block_node ::= ALIAS -// -// ***** -// | properties block_content? -// ********** * -// | block_content -// * -// -// flow_node ::= ALIAS -// -// ***** -// | properties flow_content? -// ********** * -// | flow_content -// * -// -// properties ::= TAG ANCHOR? | ANCHOR TAG? -// -// ************************* -// -// block_content ::= block_collection | flow_collection | SCALAR -// -// ****** // -// flow_content ::= flow_collection | SCALAR -// -// ****** +// block_node_or_indentless_sequence ::= +// ALIAS +// ***** +// | properties (block_content | indentless_block_sequence)? +// ********** * +// | block_content | indentless_block_sequence +// * +// block_node ::= ALIAS +// ***** +// | properties block_content? +// ********** * +// | block_content +// * +// flow_node ::= ALIAS +// ***** +// | properties flow_content? +// ********** * +// | flow_content +// * +// properties ::= TAG ANCHOR? | ANCHOR TAG? +// ************************* +// block_content ::= block_collection | flow_collection | SCALAR +// ****** +// flow_content ::= flow_collection | SCALAR +// ****** func yaml_parser_parse_node(parser *yaml_parser_t, event *yaml_event_t, block, indentless_sequence bool) bool { //defer trace("yaml_parser_parse_node", "block:", block, "indentless_sequence:", indentless_sequence)() @@ -697,9 +684,9 @@ func yaml_parser_parse_node(parser *yaml_parser_t, event *yaml_event_t, block, i } // Parse the productions: -// block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END // -// ******************** *********** * ********* +// block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END +// ******************** *********** * ********* func yaml_parser_parse_block_sequence_entry(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { if first { token := peek_token(parser) @@ -755,9 +742,9 @@ func yaml_parser_parse_block_sequence_entry(parser *yaml_parser_t, event *yaml_e } // Parse the productions: -// indentless_sequence ::= (BLOCK-ENTRY block_node?)+ // -// *********** * +// indentless_sequence ::= (BLOCK-ENTRY block_node?)+ +// *********** * func yaml_parser_parse_indentless_sequence_entry(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { @@ -821,15 +808,15 @@ func yaml_parser_split_stem_comment(parser *yaml_parser_t, stem_len int) { } // Parse the productions: -// block_mapping ::= BLOCK-MAPPING_START // -// ******************* -// ((KEY block_node_or_indentless_sequence?)? -// *** * -// (VALUE block_node_or_indentless_sequence?)?)* +// block_mapping ::= BLOCK-MAPPING_START +// ******************* +// ((KEY block_node_or_indentless_sequence?)? +// *** * +// (VALUE block_node_or_indentless_sequence?)?)* // -// BLOCK-END -// ********* +// BLOCK-END +// ********* func yaml_parser_parse_block_mapping_key(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { if first { token := peek_token(parser) @@ -896,13 +883,14 @@ func yaml_parser_parse_block_mapping_key(parser *yaml_parser_t, event *yaml_even } // Parse the productions: -// block_mapping ::= BLOCK-MAPPING_START // -// ((KEY block_node_or_indentless_sequence?)? +// block_mapping ::= BLOCK-MAPPING_START +// +// ((KEY block_node_or_indentless_sequence?)? // -// (VALUE block_node_or_indentless_sequence?)?)* -// ***** * -// BLOCK-END +// (VALUE block_node_or_indentless_sequence?)?)* +// ***** * +// BLOCK-END func yaml_parser_parse_block_mapping_value(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { @@ -929,19 +917,17 @@ func yaml_parser_parse_block_mapping_value(parser *yaml_parser_t, event *yaml_ev } // Parse the productions: -// flow_sequence ::= FLOW-SEQUENCE-START -// -// ******************* -// (flow_sequence_entry FLOW-ENTRY)* -// * ********** -// flow_sequence_entry? -// * -// FLOW-SEQUENCE-END -// ***************** // -// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// -// * +// flow_sequence ::= FLOW-SEQUENCE-START +// ******************* +// (flow_sequence_entry FLOW-ENTRY)* +// * ********** +// flow_sequence_entry? +// * +// FLOW-SEQUENCE-END +// ***************** +// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? +// * func yaml_parser_parse_flow_sequence_entry(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { if first { token := peek_token(parser) @@ -1005,9 +991,9 @@ func yaml_parser_parse_flow_sequence_entry(parser *yaml_parser_t, event *yaml_ev } // Parse the productions: -// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? // -// *** * +// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? +// *** * func yaml_parser_parse_flow_sequence_entry_mapping_key(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { @@ -1026,9 +1012,9 @@ func yaml_parser_parse_flow_sequence_entry_mapping_key(parser *yaml_parser_t, ev } // Parse the productions: -// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? // -// ***** * +// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? +// ***** * func yaml_parser_parse_flow_sequence_entry_mapping_value(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { @@ -1050,9 +1036,9 @@ func yaml_parser_parse_flow_sequence_entry_mapping_value(parser *yaml_parser_t, } // Parse the productions: -// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? // -// * +// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? +// * func yaml_parser_parse_flow_sequence_entry_mapping_end(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { @@ -1068,18 +1054,17 @@ func yaml_parser_parse_flow_sequence_entry_mapping_end(parser *yaml_parser_t, ev } // Parse the productions: -// flow_mapping ::= FLOW-MAPPING-START -// -// ****************** -// (flow_mapping_entry FLOW-ENTRY)* -// * ********** -// flow_mapping_entry? -// ****************** -// FLOW-MAPPING-END -// **************** // -// flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// - *** * +// flow_mapping ::= FLOW-MAPPING-START +// ****************** +// (flow_mapping_entry FLOW-ENTRY)* +// * ********** +// flow_mapping_entry? +// ****************** +// FLOW-MAPPING-END +// **************** +// flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? +// * *** * func yaml_parser_parse_flow_mapping_key(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { if first { token := peek_token(parser) @@ -1144,8 +1129,9 @@ func yaml_parser_parse_flow_mapping_key(parser *yaml_parser_t, event *yaml_event } // Parse the productions: -// flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// - ***** * +// +// flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? +// * ***** * func yaml_parser_parse_flow_mapping_value(parser *yaml_parser_t, event *yaml_event_t, empty bool) bool { token := peek_token(parser) if token == nil { diff --git a/vendor/go.yaml.in/yaml/v3/yamlh.go b/vendor/go.yaml.in/yaml/v3/yamlh.go index f59aa40f640..07c442361ce 100644 --- a/vendor/go.yaml.in/yaml/v3/yamlh.go +++ b/vendor/go.yaml.in/yaml/v3/yamlh.go @@ -433,21 +433,19 @@ type yaml_document_t struct { // The prototype of a read handler. // -// The read handler is called when the parser needs to read more bytes from the -// source. The handler should write not more than size bytes to the buffer. -// The number of written bytes should be set to the size_read variable. +// The read handler is called when the parser needs to read more bytes from the +// source. The handler should write not more than size bytes to the buffer. +// The number of written bytes should be set to the size_read variable. // -// [in,out] data A pointer to an application data specified by +// [in,out] data A pointer to an application data specified by +// yaml_parser_set_input(). +// [out] buffer The buffer to write the data from the source. +// [in] size The size of the buffer. +// [out] size_read The actual number of bytes read from the source. // -// yaml_parser_set_input(). -// -// [out] buffer The buffer to write the data from the source. -// [in] size The size of the buffer. -// [out] size_read The actual number of bytes read from the source. -// -// On success, the handler should return 1. If the handler failed, -// the returned value should be 0. On EOF, the handler should set the -// size_read to 0 and return 1. +// On success, the handler should return 1. If the handler failed, +// the returned value should be 0. On EOF, the handler should set the +// size_read to 0 and return 1. type yaml_read_handler_t func(parser *yaml_parser_t, buffer []byte) (n int, err error) // This structure holds information about a potential simple key. @@ -655,19 +653,17 @@ type yaml_comment_t struct { // The prototype of a write handler. // -// The write handler is called when the emitter needs to flush the accumulated -// characters to the output. The handler should write @a size bytes of the -// @a buffer to the output. -// -// @param[in,out] data A pointer to an application data specified by -// -// yaml_emitter_set_output(). +// The write handler is called when the emitter needs to flush the accumulated +// characters to the output. The handler should write @a size bytes of the +// @a buffer to the output. // -// @param[in] buffer The buffer with bytes to be written. -// @param[in] size The size of the buffer. +// @param[in,out] data A pointer to an application data specified by +// yaml_emitter_set_output(). +// @param[in] buffer The buffer with bytes to be written. +// @param[in] size The size of the buffer. // -// @returns On success, the handler should return @c 1. If the handler failed, -// the returned value should be @c 0. +// @returns On success, the handler should return @c 1. If the handler failed, +// the returned value should be @c 0. type yaml_write_handler_t func(emitter *yaml_emitter_t, buffer []byte) error type yaml_emitter_state_t int diff --git a/vendor/golang.org/x/net/http2/ascii.go b/vendor/golang.org/x/net/http2/ascii.go index 17caa205869..3a7aed12c59 100644 --- a/vendor/golang.org/x/net/http2/ascii.go +++ b/vendor/golang.org/x/net/http2/ascii.go @@ -4,7 +4,9 @@ package http2 -import "strings" +import ( + "strings" +) // The HTTP protocols are defined in terms of ASCII, not Unicode. This file // contains helper functions which may use Unicode-aware functions which would @@ -43,6 +45,16 @@ func isASCIIPrint(s string) bool { return true } +// isASCII returns whether s is ASCII. +func isASCII(s string) bool { + for i := 0; i < len(s); i++ { + if s[i] > 0x7f { + return false + } + } + return true +} + // asciiToLower returns the lowercase version of s if s is ASCII and printable, // and whether or not it was. func asciiToLower(s string) (lower string, ok bool) { diff --git a/vendor/golang.org/x/net/http2/databuffer.go b/vendor/golang.org/x/net/http2/databuffer.go index e6f55cbd163..9763ab134c2 100644 --- a/vendor/golang.org/x/net/http2/databuffer.go +++ b/vendor/golang.org/x/net/http2/databuffer.go @@ -121,10 +121,7 @@ func (b *dataBuffer) Write(p []byte) (int, error) { // If the last chunk is empty, allocate a new chunk. Try to allocate // enough to fully copy p plus any additional bytes we expect to // receive. However, this may allocate less than len(p). - want := int64(len(p)) - if b.expected > want { - want = b.expected - } + want := max(int64(len(p)), b.expected) chunk := b.lastChunkOrAlloc(want) n := copy(chunk[b.w:], p) p = p[n:] diff --git a/vendor/golang.org/x/net/http2/flow.go b/vendor/golang.org/x/net/http2/flow.go index b7dbd186957..5066a39912b 100644 --- a/vendor/golang.org/x/net/http2/flow.go +++ b/vendor/golang.org/x/net/http2/flow.go @@ -10,6 +10,9 @@ package http2 // flow control window update. const inflowMinRefresh = 4 << 10 +// maxFlowWindow is the maximum size of a flow control window. +const maxFlowWindow = (1 << 31) - 1 + // inflow accounts for an inbound flow control window. // It tracks both the latest window sent to the peer (used for enforcement) // and the accumulated unsent window. @@ -74,47 +77,99 @@ func takeInflows(f1, f2 *inflow, n uint32) bool { return true } -// outflow is the outbound flow control window's size. +// connOutflow is connection-level outbound flow control. +type connOutflow struct { + initial int32 // SETTINGS_INITIAL_WINDOW_SIZE, changes with settings updates + n int32 // connection-level flow control window + flowErr bool // set when a flow control error is encountered +} + +func (f *connOutflow) init() { + f.initial = initialWindowSize // initial stream window size + f.n = initialWindowSize // current connection window size +} + +func (f *connOutflow) changeInitialWindowSize(size int64) bool { + if size > maxFlowWindow { + f.flowErr = true + return false + } + f.initial = int32(size) + return true +} + +func (f *connOutflow) add(n int32) bool { + sum := int64(f.n) + int64(n) + if sum > maxFlowWindow { + f.flowErr = true + return false + } + f.n += n + return true +} + +// outflow is the stream-level outbound flow control window's size. type outflow struct { _ incomparable - // n is the number of DATA bytes we're allowed to send. - // An outflow is kept both on a conn and a per-stream. - n int32 + // delta is the difference between the stream's flow control window and + // the connection's initial window size (conn.initial). + // + // Another view is that delta is the number of flow control bytes provided to this + // stream in WINDOW_UPDATE frames, less the number of bytes sent on the stream. + delta int32 // conn points to the shared connection-level outflow that is - // shared by all streams on that conn. It is nil for the outflow - // that's on the conn directly. - conn *outflow + // shared by all streams on that conn. + conn *connOutflow } -func (f *outflow) setConnFlow(cf *outflow) { f.conn = cf } - -func (f *outflow) available() int32 { - n := f.n - if f.conn != nil && f.conn.n < n { - n = f.conn.n +func (f *outflow) available() (int32, bool) { + if f.conn == nil { + return maxFlowWindow, true // only happens in tests } - return n + if f.conn.flowErr { + // Block all sending once any stream observes a flow control error. + return 0, false + } + n := int64(f.conn.initial) + int64(f.delta) + if n > maxFlowWindow { + f.conn.flowErr = true + return 0, false + } + return min(int32(n), f.conn.n), true } func (f *outflow) take(n int32) { - if n > f.available() { - panic("internal error: took too much") + if f.conn == nil { + return // only happens in tests } - f.n -= n - if f.conn != nil { - f.conn.n -= n + avail, _ := f.available() + if n > avail { + panic("internal error: took too much") } + f.delta -= n + f.conn.n -= n } // add adds n bytes (positive or negative) to the flow control window. // It returns false if the sum would exceed 2^31-1. func (f *outflow) add(n int32) bool { - sum := f.n + n - if (sum > n) == (f.n > 0) { - f.n = sum - return true + if f.conn == nil { + return true // only happens in tests + } + avail := int64(f.conn.initial) + int64(f.delta) + if avail > maxFlowWindow { + // An earlier change to the initial window pushed this stream over the limit. + // This is a connection-level flow control error. + f.conn.flowErr = true + return false } - return false + if avail+int64(n) > maxFlowWindow { + // This update would push the stream over the limit. + // This is a stream-level flow control error. + return false + } + f.delta += n + return true } diff --git a/vendor/golang.org/x/net/http2/frame.go b/vendor/golang.org/x/net/http2/frame.go index be75badcc0e..3363bbafc85 100644 --- a/vendor/golang.org/x/net/http2/frame.go +++ b/vendor/golang.org/x/net/http2/frame.go @@ -1711,7 +1711,8 @@ func (fr *Framer) readMetaFrame(hf *HeadersFrame) (Frame, error) { mh := &MetaHeadersFrame{ HeadersFrame: hf, } - var remainSize = fr.maxHeaderListSize() + var headersRemainSize = fr.maxHeaderListSize() + var trailersRemainSize = fr.maxHeaderListSize() var sawRegular bool var invalid error // pseudo header field errors @@ -1743,14 +1744,29 @@ func (fr *Framer) readMetaFrame(hf *HeadersFrame) (Frame, error) { return } - size := hf.Size() - if size > remainSize { + var remainSize *uint32 + var size uint32 + if hf.Name == "trailer" { + remainSize = &trailersRemainSize + fieldCount := strings.Count(hf.Value, ",") + 1 + // Rather than actually constructing hpack.HeaderField for each + // trailer field and cumulatively adding its Size, just do the math + // manually to avoid unnecessary work. This does make it so + // whitespaces after comma are counted against the budget, but that + // should be innocuous. + size = uint32(len(hf.Value)-fieldCount+1) + uint32(fieldCount)*hpack.HeaderField{}.Size() + } else { + remainSize = &headersRemainSize + size = hf.Size() + } + if size > *remainSize { hdec.SetEmitEnabled(false) mh.Truncated = true - remainSize = 0 + headersRemainSize = 0 + trailersRemainSize = 0 return } - remainSize -= size + *remainSize -= size mh.Fields = append(mh.Fields, hf) }) @@ -1766,10 +1782,10 @@ func (fr *Framer) readMetaFrame(hf *HeadersFrame) (Frame, error) { // skip parsing the fragment and close the connection. // // "Too much" is either any CONTINUATION frame after we've already - // exceeded the max header list size (in which case remainSize is 0), - // or a frame whose encoded size is more than twice the remaining - // header list bytes we're willing to accept. - if int64(len(frag)) > int64(2*remainSize) { + // exceeded the max header list size (if so, both budgets are 0), or a + // frame whose encoded size is more than twice the remaining header + // list bytes we're willing to accept. + if int64(len(frag)) > 2*int64(headersRemainSize+trailersRemainSize) { if VerboseLogs { log.Printf("http2: header list too large") } diff --git a/vendor/golang.org/x/net/http2/server.go b/vendor/golang.org/x/net/http2/server.go index a7d2053b6c7..a6cd66226d0 100644 --- a/vendor/golang.org/x/net/http2/server.go +++ b/vendor/golang.org/x/net/http2/server.go @@ -280,7 +280,6 @@ func (s *Server) serveConn(c net.Conn, opts *ServeConnOpts, newf func(*serverCon doneServing: make(chan struct{}), clientMaxStreams: math.MaxUint32, // Section 6.5.2: "Initially, there is no limit to this value" advMaxStreams: conf.MaxConcurrentStreams, - initialStreamSendWindowSize: initialWindowSize, initialStreamRecvWindowSize: conf.MaxUploadBufferPerStream, maxFrameSize: initialMaxFrameSize, pingTimeout: conf.PingTimeout, @@ -320,7 +319,7 @@ func (s *Server) serveConn(c net.Conn, opts *ServeConnOpts, newf func(*serverCon // These start at the RFC-specified defaults. If there is a higher // configured value for inflow, that will be updated when we send a // WINDOW_UPDATE shortly after sending SETTINGS. - sc.flow.add(initialWindowSize) + sc.flow.init() sc.inflow.init(initialWindowSize) sc.hpackEncoder = hpack.NewEncoder(&sc.headerWriteBuf) sc.hpackEncoder.SetMaxDynamicTableSizeLimit(conf.MaxEncoderHeaderTableSize) @@ -427,7 +426,7 @@ type serverConn struct { wroteFrameCh chan frameWriteResult // from writeFrameAsync -> serve, tickles more frame writes bodyReadCh chan bodyReadMsg // from handlers -> serve serveMsgCh chan interface{} // misc messages & code to send to / run on the serve loop - flow outflow // conn-wide (not stream-specific) outbound flow control + flow connOutflow // conn-wide (not stream-specific) outbound flow control inflow inflow // conn-wide inbound flow control tlsState *tls.ConnectionState // shared by all handlers, like net/http remoteAddrStr string @@ -441,6 +440,9 @@ type serverConn struct { sawFirstSettings bool // got the initial SETTINGS frame after the preface needToSendSettingsAck bool unackedSettings int // how many SETTINGS have we sent without ACKs? + pendingEncoderTableSize bool // peer changed SETTINGS_HEADER_TABLE_SIZE; apply to hpackEncoder before the next frame write + encoderTableSizeMin uint32 // smallest SETTINGS_HEADER_TABLE_SIZE since the last apply + encoderTableSize uint32 // latest SETTINGS_HEADER_TABLE_SIZE queuedControlFrames int // control frames in the writeSched queue clientMaxStreams uint32 // SETTINGS_MAX_CONCURRENT_STREAMS from client (our PUSH_PROMISE limit) advMaxStreams uint32 // our SETTINGS_MAX_CONCURRENT_STREAMS advertised the client @@ -451,7 +453,6 @@ type serverConn struct { maxPushPromiseID uint32 // ID of the last push promise (even), or 0 if there have been no pushes streams map[uint32]*stream unstartedHandlers []unstartedHandler - initialStreamSendWindowSize int32 initialStreamRecvWindowSize int32 maxFrameSize int32 peerMaxHeaderListSize uint32 // zero means unknown (default) @@ -521,7 +522,8 @@ type stream struct { // immutable: sc *serverConn id uint32 - body *pipe // non-nil if expecting DATA frames + body *pipe // non-nil if expecting DATA frames + reqBody *requestBody cw closeWaiter // closed wait stream transitions to closed state ctx context.Context cancelCtx func() @@ -1172,6 +1174,16 @@ func (sc *serverConn) startFrameWrite(wr FrameWriteRequest) { sc.writingFrame = true sc.needsFrameFlush = true + if sc.pendingEncoderTableSize { + // hpackEncoder may be in use by writeFrameAsync, so SETTINGS + // changes to it are deferred until no frame is being written. + // Replaying the smallest size before the latest one keeps the + // encoder's view identical to having applied every change + // (RFC 7541, Section 4.2). + sc.pendingEncoderTableSize = false + sc.hpackEncoder.SetMaxDynamicTableSize(sc.encoderTableSizeMin) + sc.hpackEncoder.SetMaxDynamicTableSize(sc.encoderTableSize) + } if wr.write.staysWithinBuffer(sc.bw.Available()) { sc.writingFrameAsync = false err := wr.write.writeFrame(sc) @@ -1271,6 +1283,11 @@ func (sc *serverConn) scheduleFrameWrite() { } sc.inFrameScheduleLoop = true for !sc.writingFrameAsync { + if sc.flow.flowErr && (!sc.inGoAway || sc.goAwayCode == ErrCodeNo) { + sc.inGoAway = true + sc.needToSendGoAway = true + sc.goAwayCode = ErrCodeFlowControl + } if sc.needToSendGoAway { sc.needToSendGoAway = false sc.startFrameWrite(FrameWriteRequest{ @@ -1294,6 +1311,9 @@ func (sc *serverConn) scheduleFrameWrite() { sc.startFrameWrite(wr) continue } + if sc.flow.flowErr { + continue + } } if sc.needsFrameFlush { sc.startFrameWrite(FrameWriteRequest{write: flushFrameWriter{}}) @@ -1526,6 +1546,10 @@ func (sc *serverConn) processWindowUpdate(f *WindowUpdateFrame) error { return nil } if !st.flow.add(int32(f.Increment)) { + if st.flow.conn.flowErr { + // This is a lazily-detected connection-level flow control error. + return sc.countError("bad_flow", ConnectionError(ErrCodeFlowControl)) + } return sc.countError("bad_flow", streamError(f.StreamID, ErrCodeFlowControl)) } default: // connection-level flow control @@ -1584,10 +1608,6 @@ func (sc *serverConn) closeStream(st *stream, err error) { } } if p := st.body; p != nil { - // Return any buffered unread bytes worth of conn-level flow control. - // See golang.org/issue/16481 - sc.sendWindowUpdate(nil, p.Len()) - p.CloseWithError(err) } if e, ok := err.(StreamError); ok { @@ -1641,7 +1661,12 @@ func (sc *serverConn) processSetting(s Setting) error { } switch s.ID { case SettingHeaderTableSize: - sc.hpackEncoder.SetMaxDynamicTableSize(s.Val) + // Applied by startFrameWrite; see comment there. + if !sc.pendingEncoderTableSize || s.Val < sc.encoderTableSizeMin { + sc.encoderTableSizeMin = s.Val + } + sc.encoderTableSize = s.Val + sc.pendingEncoderTableSize = true case SettingEnablePush: sc.pushEnabled = s.Val != 0 case SettingMaxConcurrentStreams: @@ -1672,28 +1697,14 @@ func (sc *serverConn) processSetting(s Setting) error { func (sc *serverConn) processSettingInitialWindowSize(val uint32) error { sc.serveG.check() - // Note: val already validated to be within range by - // processSetting's Valid call. - - // "A SETTINGS frame can alter the initial flow control window - // size for all current streams. When the value of - // SETTINGS_INITIAL_WINDOW_SIZE changes, a receiver MUST - // adjust the size of all stream flow control windows that it - // maintains by the difference between the new value and the - // old value." - old := sc.initialStreamSendWindowSize - sc.initialStreamSendWindowSize = int32(val) - growth := int32(val) - old // may be negative - for _, st := range sc.streams { - if !st.flow.add(growth) { - // 6.9.2 Initial Flow Control Window Size - // "An endpoint MUST treat a change to - // SETTINGS_INITIAL_WINDOW_SIZE that causes any flow - // control window to exceed the maximum size as a - // connection error (Section 5.4.1) of type - // FLOW_CONTROL_ERROR." - return sc.countError("setting_win_size", ConnectionError(ErrCodeFlowControl)) - } + if !sc.flow.changeInitialWindowSize(int64(val)) { + // 6.9.2 Initial Flow Control Window Size + // "An endpoint MUST treat a change to + // SETTINGS_INITIAL_WINDOW_SIZE that causes any flow + // control window to exceed the maximum size as a + // connection error (Section 5.4.1) of type + // FLOW_CONTROL_ERROR." + return sc.countError("setting_win_size", ConnectionError(ErrCodeFlowControl)) } return nil } @@ -1966,7 +1977,7 @@ func (sc *serverConn) processHeaders(f *MetaHeadersFrame) error { if st.reqTrailer != nil { st.trailer = make(http.Header) } - st.body = req.Body.(*requestBody).pipe // may be nil + st.body = st.reqBody.pipe // may be nil st.declBodyBytes = req.ContentLength handler := sc.handler.ServeHTTP @@ -1989,7 +2000,7 @@ func (sc *serverConn) processHeaders(f *MetaHeadersFrame) error { st.readDeadline = time.AfterFunc(sc.hs.ReadTimeout, st.onReadTimeout) } - return sc.scheduleHandler(id, rw, req, handler) + return sc.scheduleHandler(st, rw, req, handler) } func (sc *serverConn) upgradeRequest(req *http.Request) { @@ -2102,7 +2113,6 @@ func (sc *serverConn) newStream(id, pusherID uint32, state streamState, priority } st.cw.Init() st.flow.conn = &sc.flow // link to conn-level counter - st.flow.add(sc.initialStreamSendWindowSize) st.inflow.init(sc.initialStreamRecvWindowSize) if sc.hs.WriteTimeout > 0 { st.writeDeadline = time.AfterFunc(sc.hs.WriteTimeout, st.onWriteTimeout) @@ -2184,7 +2194,7 @@ func (sc *serverConn) newWriterAndRequest(st *stream, f *MetaHeadersFrame) (*res } else { req.ContentLength = -1 } - req.Body.(*requestBody).pipe = &pipe{ + st.reqBody.pipe = &pipe{ b: &dataBuffer{expected: req.ContentLength}, } } @@ -2204,7 +2214,7 @@ func (sc *serverConn) newWriterAndRequestNoBody(st *stream, rp httpcommon.Server return nil, nil, sc.countError(res.InvalidReason, streamError(st.id, ErrCodeProtocol)) } - body := &requestBody{ + st.reqBody = &requestBody{ conn: sc, stream: st, needsContinue: res.NeedsContinue, @@ -2220,7 +2230,7 @@ func (sc *serverConn) newWriterAndRequestNoBody(st *stream, rp httpcommon.Server ProtoMinor: 0, TLS: tlsState, Host: rp.Authority, - Body: body, + Body: st.reqBody, Trailer: res.Trailer, }).WithContext(st.ctx) rw := sc.newResponseWriter(st, req) @@ -2244,11 +2254,12 @@ type unstartedHandler struct { rw *responseWriter req *http.Request handler func(http.ResponseWriter, *http.Request) + body *pipe } // scheduleHandler starts a handler goroutine, // or schedules one to start as soon as an existing handler finishes. -func (sc *serverConn) scheduleHandler(streamID uint32, rw *responseWriter, req *http.Request, handler func(http.ResponseWriter, *http.Request)) error { +func (sc *serverConn) scheduleHandler(st *stream, rw *responseWriter, req *http.Request, handler func(http.ResponseWriter, *http.Request)) error { sc.serveG.check() maxHandlers := sc.advMaxStreams if sc.curHandlers < maxHandlers { @@ -2260,10 +2271,11 @@ func (sc *serverConn) scheduleHandler(streamID uint32, rw *responseWriter, req * return sc.countError("too_many_early_resets", ConnectionError(ErrCodeEnhanceYourCalm)) } sc.unstartedHandlers = append(sc.unstartedHandlers, unstartedHandler{ - streamID: streamID, + streamID: st.id, rw: rw, req: req, handler: handler, + body: st.body, }) return nil } @@ -2277,6 +2289,10 @@ func (sc *serverConn) handlerDone() { u := sc.unstartedHandlers[i] if sc.streams[u.streamID] == nil { // This stream was reset before its goroutine had a chance to start. + if u.body != nil { + u.body.BreakWithError(errClosedBody) + sc.sendWindowUpdate(nil, u.body.Len()) + } continue } if sc.curHandlers >= maxHandlers { @@ -2298,6 +2314,12 @@ func (sc *serverConn) runHandler(rw *responseWriter, req *http.Request, handler didPanic := true defer func() { rw.rws.stream.cancelCtx() + if b := rw.rws.stream.reqBody; b != nil { + // Closing the body refunds flow control credit for any unconsumed data. + // (reqBody is nil for Upgrade: h2c requests, but those do not use flow + // control for the request body.) + b.Close() + } if req.MultipartForm != nil { req.MultipartForm.RemoveAll() } @@ -2396,7 +2418,7 @@ func (sc *serverConn) noteBodyReadFromHandler(st *stream, n int, err error) { func (sc *serverConn) noteBodyRead(st *stream, n int) { sc.serveG.check() sc.sendWindowUpdate(nil, n) // conn-level - if st.state != stateHalfClosedRemote && st.state != stateClosed { + if st != nil && st.state != stateHalfClosedRemote && st.state != stateClosed { // Don't send this WINDOW_UPDATE if the stream is closed // remotely. sc.sendWindowUpdate(st, n) @@ -2444,6 +2466,9 @@ func (b *requestBody) Close() error { b.closeOnce.Do(func() { if b.pipe != nil { b.pipe.BreakWithError(errClosedBody) + if unread := b.pipe.Len(); unread > 0 { + b.conn.noteBodyReadFromHandler(nil, unread, errClosedBody) + } } }) return nil @@ -2461,9 +2486,6 @@ func (b *requestBody) Read(p []byte) (n int, err error) { if err == io.EOF { b.sawEOF = true } - if b.conn == nil { - return - } b.conn.noteBodyReadFromHandler(b.stream, n, err) return } diff --git a/vendor/golang.org/x/net/http2/server_common.go b/vendor/golang.org/x/net/http2/server_common.go index 449538c861a..fec369092a2 100644 --- a/vendor/golang.org/x/net/http2/server_common.go +++ b/vendor/golang.org/x/net/http2/server_common.go @@ -25,6 +25,8 @@ import ( // // https://golang.org/pkg/net/http/#ResponseWriter // https://golang.org/pkg/net/http/#example_ResponseWriter_trailers +// +// Deprecated: Use [http.TrailerPrefix] instead. const TrailerPrefix = "Trailer:" // Push errors. @@ -38,16 +40,22 @@ var ( // The configuration conf may be nil. // // ConfigureServer must be called before s begins serving. +// +// Deprecated: Set [http.Server.Protocols] instead. func ConfigureServer(s *http.Server, conf *Server) error { return configureServer(s, conf) } // Server is an HTTP/2 server. +// +// Deprecated: Use [http.Server] instead. type Server struct { // MaxHandlers limits the number of http.Handler ServeHTTP goroutines // which may run at a time over all connections. // Negative or zero no limit. // TODO: implement + // + // Deprecated: This field has never had any effect. MaxHandlers int // MaxConcurrentStreams optionally specifies the number of @@ -56,6 +64,9 @@ type Server struct { // which may be active globally, which is MaxHandlers. // If zero, MaxConcurrentStreams defaults to at least 100, per // the HTTP/2 spec's recommendations. + // + // Deprecated: Use [http.Server.HTTP2] and + // [http.HTTP2Config.MaxConcurrentStreams] instead. MaxConcurrentStreams uint32 // MaxDecoderHeaderTableSize optionally specifies the http2 @@ -63,44 +74,67 @@ type Server struct { // informs the remote endpoint of the maximum size of the header compression // table used to decode header blocks, in octets. If zero, the default value // of 4096 is used. + // + // Deprecated: Use [http.Server.HTTP2] and + // [http.HTTP2Config.MaxDecoderHeaderTableSize] instead. MaxDecoderHeaderTableSize uint32 // MaxEncoderHeaderTableSize optionally specifies an upper limit for the // header compression table used for encoding request headers. Received // SETTINGS_HEADER_TABLE_SIZE settings are capped at this limit. If zero, // the default value of 4096 is used. + // + // Deprecated: Use [http.Server.HTTP2] and + // [http.HTTP2Config.MaxEncoderHeaderTableSize] instead. MaxEncoderHeaderTableSize uint32 // MaxReadFrameSize optionally specifies the largest frame // this server is willing to read. A valid value is between // 16k and 16M, inclusive. If zero or otherwise invalid, a // default value is used. + // + // Deprecated: Use [http.Server.HTTP2] and + // [http.HTTP2Config.MaxReadFrameSize] instead. MaxReadFrameSize uint32 // PermitProhibitedCipherSuites, if true, permits the use of // cipher suites prohibited by the HTTP/2 spec. + // + // Deprecated: Use [http.Server.HTTP2] and + // [http.HTTP2Config.PermitProhibitedCipherSuites] instead. PermitProhibitedCipherSuites bool // IdleTimeout specifies how long until idle clients should be // closed with a GOAWAY frame. PING frames are not considered // activity for the purposes of IdleTimeout. // If zero or negative, there is no timeout. + // + // Deprecated: Use [http.Server.IdleTimeout] instead. IdleTimeout time.Duration // ReadIdleTimeout is the timeout after which a health check using a ping // frame will be carried out if no frame is received on the connection. // If zero, no health check is performed. + // + // Deprecated: Use [http.Server.HTTP2] and + // [http.HTTP2Config.SendPingTimeout] instead. ReadIdleTimeout time.Duration // PingTimeout is the timeout after which the connection will be closed // if a response to a ping is not received. // If zero, a default of 15 seconds is used. + // + // Deprecated: Use [http.Server.HTTP2] and + // [http.HTTP2Config.PingTimeout] instead. PingTimeout time.Duration // WriteByteTimeout is the timeout after which a connection will be // closed if no data can be written to it. The timeout begins when data is // available to write, and is extended whenever any bytes are written. // If zero or negative, there is no timeout. + // + // Deprecated: Use [http.Server.HTTP2] and + // [http.HTTP2Config.WriteByteTimeout] instead. WriteByteTimeout time.Duration // MaxUploadBufferPerConnection is the size of the initial flow @@ -108,12 +142,18 @@ type Server struct { // allow this to be smaller than 65535 or larger than 2^32-1. // If the value is outside this range, a default value will be // used instead. + // + // Deprecated: Use [http.Server.HTTP2] and + // [http.HTTP2Config.MaxReceiveBufferPerConnection] instead. MaxUploadBufferPerConnection int32 // MaxUploadBufferPerStream is the size of the initial flow control // window for each stream. The HTTP/2 spec does not allow this to // be larger than 2^32-1. If the value is zero or larger than the // maximum, a default value will be used instead. + // + // Deprecated: Use [http.Server.HTTP2] and + // [http.HTTP2Config.MaxReceiveBufferPerStream] instead. MaxUploadBufferPerStream int32 // NewWriteScheduler constructs a write scheduler for a connection. @@ -126,6 +166,9 @@ type Server struct { // It's intended to increment a metric for monitoring, such // as an expvar or Prometheus metric. // The errType consists of only ASCII word characters. + // + // Deprecated: Use [http.Server.HTTP2] and + // [http.HTTP2Config.CountError] instead. CountError func(errType string) // Internal state. This is a pointer (rather than embedded directly) @@ -135,6 +178,8 @@ type Server struct { } // ServeConnOpts are options for the Server.ServeConn method. +// +// Deprecated: ServeConnOpts is deprecated. type ServeConnOpts struct { // Context is the base context to use. // If nil, context.Background is used. @@ -178,6 +223,8 @@ type ServeConnOpts struct { // implemented in terms of providing a suitably-behaving net.Conn. // // The opts parameter is optional. If nil, default values are used. +// +// Deprecated: Use [http.Server.Serve] or [http.Server.ServeTLS] instead. func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) { if opts == nil { opts = &ServeConnOpts{} diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go index 08ac409b0e0..d894c6019c5 100644 --- a/vendor/golang.org/x/net/http2/transport.go +++ b/vendor/golang.org/x/net/http2/transport.go @@ -27,6 +27,7 @@ import ( "net/http" "net/http/httptrace" "net/textproto" + "slices" "strconv" "sync" "sync/atomic" @@ -184,6 +185,8 @@ func (t *Transport) initConnPool() { // ClientConn is the state of a single HTTP/2 client connection to an // HTTP/2 server. +// +// Deprecated: Use [http.ClientConn] instead. type ClientConn struct { t *Transport tconn net.Conn // usually *tls.Conn, except specialized impls @@ -201,7 +204,7 @@ type ClientConn struct { mu sync.Mutex // guards following cond *sync.Cond // hold mu; broadcast on flow/closed changes - flow outflow // our conn-level flow control quota (cs.outflow is per stream) + flow connOutflow // our conn-level flow control quota (cs.outflow is per stream) inflow inflow // peer's conn-level flow control doNotReuse bool // whether conn is marked to not be reused for any future requests closing bool @@ -225,7 +228,6 @@ type ClientConn struct { maxConcurrentStreams uint32 peerMaxHeaderListSize uint64 peerMaxHeaderTableSize uint32 - initialWindowSize uint32 initialStreamRecvWindowSize int32 readIdleTimeout time.Duration pingTimeout time.Duration @@ -470,7 +472,6 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool, internalStateHook readerDone: make(chan struct{}), nextStreamID: 1, maxFrameSize: 16 << 10, // spec default - initialWindowSize: 65535, // spec default initialStreamRecvWindowSize: conf.MaxUploadBufferPerStream, maxConcurrentStreams: initialMaxConcurrentStreams, // "infinite", per spec. Use a smaller value until we have received server settings. strictMaxConcurrentStreams: conf.StrictMaxConcurrentRequests, @@ -495,7 +496,7 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool, internalStateHook } cc.cond = sync.NewCond(&cc.mu) - cc.flow.add(int32(initialWindowSize)) + cc.flow.init() // TODO: adjust this writer size to account for frame size + // MTU + crypto/tls record padding. @@ -874,6 +875,33 @@ func (cc *ClientConn) sendGoAway() error { return nil } +func (cc *ClientConn) goAwayAndClose(code ErrCode) { + cc.mu.Lock() + closed := cc.closed + cc.closing = true + cc.closed = true + cc.mu.Unlock() + if closed { + return + } + if f := cc.fr.countError; f != nil { + f(fmt.Sprintf("conn_close_error_%s", code.stringToken())) + } + done := make(chan struct{}) + go func() { + defer close(done) + cc.wmu.Lock() + cc.fr.WriteGoAway(0, code, nil) + cc.bw.Flush() + cc.wmu.Unlock() + }() + select { + case <-done: + case <-time.After(250 * time.Millisecond): + } + cc.closeForError(fmt.Errorf("http2: closing connection with %v", code)) +} + // closes the client connection immediately. In-flight requests are interrupted. // err is sent to streams. func (cc *ClientConn) closeForError(err error) { @@ -1317,7 +1345,9 @@ func (cs *clientStream) cleanupWriteRequest(err error) { } if err != nil { cs.abortStream(err) // possibly redundant, but harmless - if cs.sentHeaders { + if ce, ok := err.(ConnectionError); ok { + cc.goAwayAndClose(ErrCode(ce)) + } else if cs.sentHeaders { if se, ok := err.(StreamError); ok { if se.Cause != errFromPeer { cc.writeStreamReset(cs.ID, se.Code, false, err) @@ -1646,8 +1676,12 @@ func (cs *clientStream) awaitFlowControl(maxBytes int) (taken int32, err error) return 0, errRequestCanceled default: } - if a := cs.flow.available(); a > 0 { - take := a + avail, ok := cs.flow.available() + if !ok { + return 0, ConnectionError(ErrCodeFlowControl) + } + if avail > 0 { + take := avail if int(take) > maxBytes { take = int32(maxBytes) // can't truncate int; take is int32 @@ -1708,8 +1742,7 @@ type resAndError struct { // requires cc.mu be held. func (cc *ClientConn) addStreamLocked(cs *clientStream) { - cs.flow.add(int32(cc.initialWindowSize)) - cs.flow.setConnFlow(&cc.flow) + cs.flow.conn = &cc.flow cs.inflow.init(cc.initialStreamRecvWindowSize) cs.ID = cc.nextStreamID cc.nextStreamID += 2 @@ -2093,18 +2126,42 @@ func (rl *clientConnReadLoop) handleResponse(cs *clientStream, f *MetaHeadersFra return nil, nil } + // Delete various headers that might mess up framing for HTTP/1. This is + // not a problem for HTTP/2, but someone might use HTTP/2 transport as a + // reverse proxy which forwards the response to an HTTP/1 client. Our + // HTTP/1 client transport will properly reject improper headers such as + // multiple conflicting Content-Length headers, but other implementations + // might not. + // TODO: just reject such responses? We deleted them for compatibility + // since this was done in a security fix (go.dev/issue/81115). However, + // rejecting them seems entirely reasonable and relatively safe. + + // Connection-specific header fields must not appear in an HTTP/2 message, + // and any message containing them is malformed. RFC 9113, Section 8.2.2. + for _, k := range connHeaders { + delete(res.Header, k) + } res.ContentLength = -1 - if clens := res.Header["Content-Length"]; len(clens) == 1 { - if cl, err := strconv.ParseUint(clens[0], 10, 63); err == nil { - res.ContentLength = int64(cl) + if clens, ok := res.Header["Content-Length"]; ok { + // Repeated Content-Length values may be collapsed into one only if + // they are identical per RFC 9110 Section 8.6. + // No need to trim whitespace, HTTP/2 header values must not have + // extraneous whitespace per RFC 9113 Section 8.2.1. + // Non-canonical headers are already rejected by our framer at this + // point. + conflicting := slices.ContainsFunc(clens[1:], func(clen string) bool { + return clen != clens[0] + }) + cl, err := strconv.ParseUint(clens[0], 10, 63) + if conflicting || err != nil { + delete(res.Header, "Content-Length") } else { - // TODO: care? unlike http/1, it won't mess up our framing, so it's - // more safe smuggling-wise to ignore. + res.Header["Content-Length"] = clens[:1] + res.ContentLength = int64(cl) } - } else if len(clens) > 1 { - // TODO: care? unlike http/1, it won't mess up our framing, so it's - // more safe smuggling-wise to ignore. - } else if f.StreamEnded() && !cs.isHead { + } + + if res.ContentLength < 0 && f.StreamEnded() && !cs.isHead { res.ContentLength = 0 } @@ -2415,6 +2472,10 @@ const ( func (rl *clientConnReadLoop) streamByID(id uint32, headerOrData bool) *clientStream { rl.cc.mu.Lock() defer rl.cc.mu.Unlock() + return rl.streamByIDLocked(id, headerOrData) +} + +func (rl *clientConnReadLoop) streamByIDLocked(id uint32, headerOrData bool) *clientStream { if headerOrData { // Work around an unfortunate gRPC behavior. // See comment on ClientConn.rstStreamPingsBlocked for details. @@ -2497,24 +2558,10 @@ func (rl *clientConnReadLoop) processSettingsNoWrite(f *SettingsFrame) error { case SettingMaxHeaderListSize: cc.peerMaxHeaderListSize = uint64(s.Val) case SettingInitialWindowSize: - // Values above the maximum flow-control - // window size of 2^31-1 MUST be treated as a - // connection error (Section 5.4.1) of type - // FLOW_CONTROL_ERROR. - if s.Val > math.MaxInt32 { + if !cc.flow.changeInitialWindowSize(int64(s.Val)) { return ConnectionError(ErrCodeFlowControl) } - - // Adjust flow control of currently-open - // frames by the difference of the old initial - // window size and this one. - delta := int32(s.Val) - int32(cc.initialWindowSize) - for _, cs := range cc.streams { - cs.flow.add(delta) - } cc.cond.Broadcast() - - cc.initialWindowSize = s.Val case SettingHeaderTableSize: cc.henc.SetMaxDynamicTableSize(s.Val) cc.peerMaxHeaderTableSize = s.Val @@ -2556,29 +2603,30 @@ func (rl *clientConnReadLoop) processSettingsNoWrite(f *SettingsFrame) error { func (rl *clientConnReadLoop) processWindowUpdate(f *WindowUpdateFrame) error { cc := rl.cc - cs := rl.streamByID(f.StreamID, notHeaderOrDataFrame) - if f.StreamID != 0 && cs == nil { - return nil - } - cc.mu.Lock() defer cc.mu.Unlock() - - fl := &cc.flow - if cs != nil { - fl = &cs.flow - } - if !fl.add(int32(f.Increment)) { - // For stream, the sender sends RST_STREAM with an error code of FLOW_CONTROL_ERROR - if cs != nil { + if f.StreamID == 0 { + if !cc.flow.add(int32(f.Increment)) { + return ConnectionError(ErrCodeFlowControl) + } + } else { + cs := rl.streamByIDLocked(f.StreamID, notHeaderOrDataFrame) + if cs == nil { + return nil + } + if !cs.flow.add(int32(f.Increment)) { + if cs.flow.conn.flowErr { + // This is a lazily-detected connection-level flow control error. + return ConnectionError(ErrCodeFlowControl) + } + // For stream, the sender sends RST_STREAM with + // an error code of FLOW_CONTROL_ERROR. rl.endStreamErrorLocked(cs, StreamError{ StreamID: f.StreamID, Code: ErrCodeFlowControl, }) return nil } - - return ConnectionError(ErrCodeFlowControl) } cc.cond.Broadcast() return nil diff --git a/vendor/golang.org/x/net/http2/transport_common.go b/vendor/golang.org/x/net/http2/transport_common.go index b9f52932e92..4f0333a7037 100644 --- a/vendor/golang.org/x/net/http2/transport_common.go +++ b/vendor/golang.org/x/net/http2/transport_common.go @@ -24,6 +24,8 @@ import ( // It returns an error if t1 has already been HTTP/2-enabled. // // Use ConfigureTransports instead to configure the HTTP/2 Transport. +// +// Deprecated: Set [http.Transport.Protocols] instead. func ConfigureTransport(t1 *http.Transport) error { return configureTransport(t1) } @@ -31,6 +33,8 @@ func ConfigureTransport(t1 *http.Transport) error { // ConfigureTransports configures a net/http HTTP/1 Transport to use HTTP/2. // It returns a new HTTP/2 Transport for further configuration. // It returns an error if t1 has already been HTTP/2-enabled. +// +// Deprecated: Set [http.Transport.Protocols] instead. func ConfigureTransports(t1 *http.Transport) (*Transport, error) { return configureTransports(t1) } @@ -39,6 +43,8 @@ func ConfigureTransports(t1 *http.Transport) (*Transport, error) { // // A Transport internally caches connections to servers. It is safe // for concurrent use by multiple goroutines. +// +// Deprecated: Use [http.Transport] instead. type Transport struct { // DialTLSContext specifies an optional dial function with context for // creating TLS connections for requests. @@ -47,6 +53,8 @@ type Transport struct { // // If the returned net.Conn has a ConnectionState method like tls.Conn, // it will be used to set http.Response.TLS. + // + // Deprecated: Use [http.Transport.DialTLSContext] instead. DialTLSContext func(ctx context.Context, network, addr string, cfg *tls.Config) (net.Conn, error) // DialTLS specifies an optional dial function for creating @@ -54,17 +62,21 @@ type Transport struct { // // If DialTLSContext and DialTLS is nil, tls.Dial is used. // - // Deprecated: Use DialTLSContext instead, which allows the transport - // to cancel dials as soon as they are no longer needed. - // If both are set, DialTLSContext takes priority. + // Deprecated: Use [http.Transport.DialTLSContext] instead. DialTLS func(network, addr string, cfg *tls.Config) (net.Conn, error) // TLSClientConfig specifies the TLS configuration to use with // tls.Client. If nil, the default configuration is used. + // + // Deprecated: Use [http.Transport.TLSClientConfig] instead. TLSClientConfig *tls.Config // ConnPool optionally specifies an alternate connection pool to use. // If nil, the default is used. + // + // Deprecated: To create a custom connection pool, implement + // [http.RoundTripper]. Use [http.Transport.NewClientConn] + // to create connections for the pool. ConnPool ClientConnPool // DisableCompression, if true, prevents the Transport from @@ -75,10 +87,14 @@ type Transport struct { // decoded in the Response.Body. However, if the user // explicitly requested gzip it is not automatically // uncompressed. + // + // Deprecated: Use [http.Transport.DisableCompression] instead. DisableCompression bool // AllowHTTP, if true, permits HTTP/2 requests using the insecure, // plain-text "http" scheme. Note that this does not enable h2c support. + // + // Deprecated: Use [http.Transport.Protocols] instead. AllowHTTP bool // MaxHeaderListSize is the http2 SETTINGS_MAX_HEADER_LIST_SIZE to @@ -88,6 +104,8 @@ type Transport struct { // want to advertise an unlimited value to the peer, Transport // interprets the highest possible value here (0xffffffff or 1<<32-1) // to mean no limit. + // + // Deprecated: Use [http.Transport.MaxResponseHeaderBytes] instead. MaxHeaderListSize uint32 // MaxReadFrameSize is the http2 SETTINGS_MAX_FRAME_SIZE to send in the @@ -97,6 +115,9 @@ type Transport struct { // according to the spec: // https://datatracker.ietf.org/doc/html/rfc7540#section-6.5.2. // Values are bounded in the range 16k to 16M. + // + // Deprecated: Use [http.Transport.HTTP2] and + // [http.HTTP2Config.MaxReadFrameSize] instead. MaxReadFrameSize uint32 // MaxDecoderHeaderTableSize optionally specifies the http2 @@ -104,12 +125,18 @@ type Transport struct { // informs the remote endpoint of the maximum size of the header compression // table used to decode header blocks, in octets. If zero, the default value // of 4096 is used. + // + // Deprecated: Use [http.Transport.HTTP2] and + // [http.HTTP2Config.MaxDecoderHeaderTableSize] instead. MaxDecoderHeaderTableSize uint32 // MaxEncoderHeaderTableSize optionally specifies an upper limit for the // header compression table used for encoding request headers. Received // SETTINGS_HEADER_TABLE_SIZE settings are capped at this limit. If zero, // the default value of 4096 is used. + // + // Deprecated: Use [http.Transport.HTTP2] and + // [http.HTTP2Config.MaxEncoderHeaderTableSize] instead. MaxEncoderHeaderTableSize uint32 // StrictMaxConcurrentStreams controls whether the server's @@ -120,12 +147,17 @@ type Transport struct { // server's SETTINGS_MAX_CONCURRENT_STREAMS is interpreted as // a global limit and callers of RoundTrip block when needed, // waiting for their turn. + // + // Deprecated: Use [http.Transport.HTTP2] and + // [http.HTTP2Config.StrictMaxConcurrentRequests] instead. StrictMaxConcurrentStreams bool // IdleConnTimeout is the maximum amount of time an idle // (keep-alive) connection will remain idle before closing // itself. // Zero means no limit. + // + // Deprecated: Use [http.Transport.IdleConnTimeout] instead. IdleConnTimeout time.Duration // ReadIdleTimeout is the timeout after which a health check using ping @@ -134,22 +166,34 @@ type Transport struct { // there is no other traffic on the connection, the health check will // be performed every ReadIdleTimeout interval. // If zero, no health check is performed. + // + // Deprecated: Use [http.Transport.HTTP2] and + // [http.HTTP2Config.SendPingTimeout] instead. ReadIdleTimeout time.Duration // PingTimeout is the timeout after which the connection will be closed // if a response to Ping is not received. // Defaults to 15s. + // + // Deprecated: Use [http.Transport.HTTP2] and + // [http.HTTP2Config.PingTimeout] instead. PingTimeout time.Duration // WriteByteTimeout is the timeout after which the connection will be // closed no data can be written to it. The timeout begins when data is // available to write, and is extended whenever any bytes are written. + // + // Deprecated: Use [http.Transport.HTTP2] and + // [http.HTTP2Config.WriteByteTimeout] instead. WriteByteTimeout time.Duration // CountError, if non-nil, is called on HTTP/2 transport errors. // It's intended to increment a metric for monitoring, such // as an expvar or Prometheus metric. // The errType consists of only ASCII word characters. + // + // Deprecated: Use [http.Transport.HTTP2] and + // [http.HTTP2Config.CountError] instead. CountError func(errType string) // Internal state, differs between wrapped and non-wrapped implementations. @@ -165,6 +209,10 @@ var ( ) // ClientConnPool manages a pool of HTTP/2 client connections. +// +// Deprecated: To create a custom connection pool, implement +// [http.RoundTripper]. Use [http.Transport.NewClientConn] +// to create connections for the pool. type ClientConnPool interface { // GetClientConn returns a specific HTTP/2 connection (usually // a TLS-TCP connection) to an HTTP/2 server. On success, the @@ -177,6 +225,8 @@ type ClientConnPool interface { } // ClientConnState describes the state of a ClientConn. +// +// Deprecated: Use [http.ClientConn] instead. type ClientConnState struct { // Closed is whether the connection is closed. Closed bool @@ -210,6 +260,8 @@ type ClientConnState struct { } // RoundTripOpt are options for the Transport.RoundTripOpt method. +// +// Deprecated: There are no options to set. type RoundTripOpt struct { // OnlyCachedConn controls whether RoundTripOpt may // create a new TCP connection. If set true and @@ -222,11 +274,14 @@ type RoundTripOpt struct { allowHTTP bool // allow http:// URLs } +// Deprecated: Use [http.Transport.RoundTrip] instead. func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { return t.RoundTripOpt(req, RoundTripOpt{}) } // RoundTripOpt is like RoundTrip, but takes options. +// +// Deprecated: Use [http.Transport.RoundTrip] instead. func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Response, error) { return t.roundTripOpt(req, opt) } @@ -234,10 +289,15 @@ func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Res // CloseIdleConnections closes any connections which were previously // connected from previous requests but are now sitting idle. // It does not interrupt any connections currently in use. +// +// Deprecated: Use [http.Transport.CloseIdleConnections] instead. func (t *Transport) CloseIdleConnections() { t.closeIdleConnections() } +// NewClientConn is deprecated. +// +// Deprecated: Use [http.Transport.NewClientConn] instead. func (t *Transport) NewClientConn(c net.Conn) (*ClientConn, error) { return t.newUserClientConn(c) } @@ -256,8 +316,15 @@ func authorityAddr(scheme string, authority string) (addr string) { port = "80" } } - if a, err := idna.ToASCII(host); err == nil { - host = a + // Skip IDNA processing on hosts which are already ASCII. + // This is consistent with net/http and the WHATWG URL Specification. + // (We currently don't follow all of WHATWG, but we're aligned on + // permitting all-ASCII hostnames which fail IDNA validation. + // There are existing, valid domain names which TR #46 processing rejects.) + if !isASCII(host) { + if a, err := idna.Lookup.ToASCII(host); err == nil && a != "" { + host = a + } } // IPv6 address literal, without a port: if strings.HasPrefix(host, "[") && strings.HasSuffix(host, "]") { @@ -414,6 +481,8 @@ func (t *Transport) dialTLSWithContext(ctx context.Context, network, addr string // GoAwayError is returned by the Transport when the server closes the // TCP connection after sending a GOAWAY frame. +// +// Deprecated: GoAwayError is deprecated. type GoAwayError struct { LastStreamID uint32 ErrCode ErrCode diff --git a/vendor/golang.org/x/net/http2/transport_wrap.go b/vendor/golang.org/x/net/http2/transport_wrap.go index 741fb97062e..eeaa95f03cb 100644 --- a/vendor/golang.org/x/net/http2/transport_wrap.go +++ b/vendor/golang.org/x/net/http2/transport_wrap.go @@ -119,33 +119,27 @@ type http2TransportContextKey struct{} // DialFromContext dials a new connection using the http2.Transport's DialTLS/DialTLSContext. func (t transportConfig) DialFromContext(ctx context.Context, network, address string) (net.Conn, error) { - if ctx.Value(http2TransportContextKey{}) == nil { + dial, _ := ctx.Value(http2TransportContextKey{}).(*transportRoundTripState) + if dial == nil { // We're being called from a RoundTrip that did not start with an http2.Transport. // Use the http.Transport's dialer. return nil, errors.ErrUnsupported } - - tlsConf := t.t.TLSClientConfig - if tlsConf == nil { - tlsConf = &tls.Config{} - } else { - tlsConf = tlsConf.Clone() - } - if !slices.Contains(tlsConf.NextProtos, "h2") { - tlsConf.NextProtos = append([]string{"h2"}, tlsConf.NextProtos...) - } - if tlsConf.ServerName == "" { - host, _, err := net.SplitHostPort(address) - if err == nil { - tlsConf.ServerName = host - } - } - return t.t.dialTLS(ctx, network, address, tlsConf) + return t.t.dialForRoundTrip(ctx, dial, network, address) } type transportInternal struct { initOnce sync.Once lazyt1 *http.Transport + + dialMu sync.Mutex + dials map[string]*transportDialState +} + +type transportDialState struct { + dialc chan struct{} // close when dial returns + dialErr error // dial result, set before dialc is closed + rtdonec chan struct{} // closed when RoundTrip initiating the dial returns } func (t *Transport) init() *http.Transport { @@ -167,6 +161,52 @@ func (t *Transport) configure(t1 *http.Transport) { } } +// transportRoundTripState is the state of the dial for an http2.Transport.RoundTrip. +type transportRoundTripState struct { + mu sync.Mutex + rtdone bool // set when RoundTrip returns + rtdonec chan struct{} // closed when RoundTrip returns + gotconnc chan struct{} // closed when GotConn hook is called +} + +// startDial is called when a dial starts. +// +// It returns done=true if the RoundTrip has already returned, +// in which case we should skip dialing. +func (dial *transportRoundTripState) startDial() (gotconnc chan struct{}, done bool) { + dial.mu.Lock() + defer dial.mu.Unlock() + if dial.rtdone { + return nil, true + } + if dial.rtdonec == nil { + dial.rtdonec = make(chan struct{}) + } + dial.gotconnc = make(chan struct{}) + return dial.gotconnc, false +} + +// gotConn is called when RoundTrip gets a connection. +// This may happen multiple times per RoundTrip, if a request is retried. +func (dial *transportRoundTripState) gotConn() { + dial.mu.Lock() + defer dial.mu.Unlock() + if dial.gotconnc != nil { + close(dial.gotconnc) + dial.gotconnc = nil + } +} + +// roundTripDone is called when RoundTrip returns. +func (dial *transportRoundTripState) roundTripDone() { + dial.mu.Lock() + defer dial.mu.Unlock() + dial.rtdone = true + if dial.rtdonec != nil { + close(dial.rtdonec) + } +} + func (t *Transport) roundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Response, error) { t1 := t.init() @@ -186,12 +226,146 @@ func (t *Transport) roundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Res // Both http.Transport and http2.Transport allow the user to provide a custom // dial function, and historically you only get the dial function from the // Transport you're calling RoundTrip on. - ctx := context.WithValue(req.Context(), http2TransportContextKey{}, t) + // + // In addition, http2.Transport coalesces dials, which http.Transport historically + // has not. + dial := &transportRoundTripState{} + defer dial.roundTripDone() + ctx := context.WithValue(req.Context(), http2TransportContextKey{}, dial) + ctx = httptrace.WithClientTrace(ctx, &httptrace.ClientTrace{ + GotConn: func(httptrace.GotConnInfo) { + // Tell dialForRoundTrip that we have received a connection. + dial.gotConn() + }, + }) req = req.WithContext(ctx) - return t1.RoundTrip(req) } +var errCoalescedDialAbandoned = errors.New("http2: abandoned coalesced dial") + +const coalescedDialRetryTimeout = 50 * time.Millisecond + +// dialForRoundTrip is called (indirectly) by net/http when dialing a new connection +// for a request call which originated as an http2.Transport.RoundTrip call. +// +// It uses the http2.Transport's Dial hooks and coalesces dials. +func (t *Transport) dialForRoundTrip(ctx context.Context, dial *transportRoundTripState, network, address string) (net.Conn, error) { + gotconnc, rtdone := dial.startDial() + if rtdone { + // RoundTrip returned, no need for this dial to proceed. + return nil, errCoalescedDialAbandoned + } + + var state *transportDialState + for { + // The first dial to an address registers itself with t.dials. + // When the dial finishes, it records the outcome and removes itself from t.dials + // so future dials will start a new round of coalescing. + // + // Subsequent dials observe that a dial is in progress, and skip dialing. + t.dialMu.Lock() + if t.dials == nil { + t.dials = make(map[string]*transportDialState) + } + leader := t.dials[address] + if leader == nil { + // No entry in t.dials to coalesce with. Add ourselves as leader. + state = &transportDialState{ + dialc: make(chan struct{}), + rtdonec: dial.rtdonec, + } + t.dials[address] = state + } + t.dialMu.Unlock() + if leader == nil { + // We are the leader, so we should dial for real. + break + } + + // Coalesce with a previous dial. + var ( + done = false + leaderdialc = leader.dialc + leaderrtdonec = leader.rtdonec + timerc <-chan time.Time + ) + for !done { + if leaderdialc == nil && leaderrtdonec == nil && timerc == nil { + // The leader finished dialing, and its RoundTrip finished. + // + // There are several possibilities, which reduce to: + // - The RoundTrip we are dialing for is about to receive + // a connection (possibly the one the leader just dialed), + // but we haven't observed it yet. + // - There's something wrong with the leader's connection, + // such as a TLS handshake failure. + // + // We have no good way to distinguish between these cases. + // + // Wait a short time for the leader's connection (or some + // other usable connection) to be delivered to our RoundTrip. + // If it is not, start a dial of our own. + timerc = time.After(coalescedDialRetryTimeout) + } + select { + case <-leaderdialc: + // The leader's dial completed. + if leader.dialErr != nil { + return nil, leader.dialErr + } + leaderdialc = nil + case <-leaderrtdonec: + // The leader's RoundTrip completed. + leaderrtdonec = nil + case <-timerc: + // The leader's dial and RoundTrip completed, and some time + // has passed. Assume we're not getting a connection and + // restart the dial process. + done = true + case <-dial.rtdonec: + // Our RoundTrip returned. + return nil, errCoalescedDialAbandoned + case <-gotconnc: + // Our RoundTrip got a connection. + return nil, errCoalescedDialAbandoned + case <-ctx.Done(): + // net/http abandoned the dial. + return nil, ctx.Err() + } + } + } + + // Dial for real. + tlsConf := t.TLSClientConfig + if tlsConf == nil { + tlsConf = &tls.Config{} + } else { + tlsConf = tlsConf.Clone() + } + if !slices.Contains(tlsConf.NextProtos, "h2") { + tlsConf.NextProtos = append([]string{"h2"}, tlsConf.NextProtos...) + } + if tlsConf.ServerName == "" { + host, _, err := net.SplitHostPort(address) + if err == nil { + tlsConf.ServerName = host + } + } + nc, err := t.dialTLS(ctx, network, address, tlsConf) + + // Remove this dial from t.dials, so future dial attempts will not coalesce with it. + t.dialMu.Lock() + delete(t.dials, address) + t.dialMu.Unlock() + + // Notify any dial coalesced with this one that we are done. + state.dialErr = err + close(state.dialc) + + return nc, err +} + func (t *Transport) closeIdleConnections() { t1 := t.init() t1.CloseIdleConnections() @@ -216,6 +390,8 @@ func (t *Transport) newUserClientConn(c net.Conn) (*ClientConn, error) { // ClientConn is the state of a single HTTP/2 client connection to an // HTTP/2 server. +// +// Deprecated: Use [http.ClientConn] instead. type ClientConn struct { cc *http.ClientConn tconn net.Conn diff --git a/vendor/golang.org/x/net/http2/writesched.go b/vendor/golang.org/x/net/http2/writesched.go index 36ad5e32b4d..f1903a8c66a 100644 --- a/vendor/golang.org/x/net/http2/writesched.go +++ b/vendor/golang.org/x/net/http2/writesched.go @@ -79,10 +79,11 @@ func (wr FrameWriteRequest) Consume(n int32) (FrameWriteRequest, FrameWriteReque } // Might need to split after applying limits. - allowed := wr.stream.flow.available() - if n < allowed { - allowed = n + avail, ok := wr.stream.flow.available() + if !ok { + return empty, empty, 0 } + allowed := min(n, avail) if wr.stream.sc.maxFrameSize < allowed { allowed = wr.stream.sc.maxFrameSize } diff --git a/vendor/golang.org/x/net/internal/httpcommon/README.md b/vendor/golang.org/x/net/internal/httpcommon/README.md new file mode 100644 index 00000000000..951c346c2d2 --- /dev/null +++ b/vendor/golang.org/x/net/internal/httpcommon/README.md @@ -0,0 +1,7 @@ +These two packages are identical: + +- net/http/internal/httpcommon +- golang.org/x/net/internal/httpcommon + +The two are kept in sync manually. +Any change to one should be made in the other. diff --git a/vendor/golang.org/x/net/internal/httpcommon/gzip.go b/vendor/golang.org/x/net/internal/httpcommon/gzip.go new file mode 100644 index 00000000000..819dd650cb6 --- /dev/null +++ b/vendor/golang.org/x/net/internal/httpcommon/gzip.go @@ -0,0 +1,132 @@ +// Copyright 2026 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package httpcommon + +import ( + "compress/flate" + "compress/gzip" + "errors" + "io" + "io/fs" + "sync" +) + +var errConcurrentRead = errors.New("http: concurrent read on response body") + +// incomparable is a zero-width, non-comparable type. Adding it to a struct +// makes that struct also non-comparable, and generally doesn't add +// any size (as long as it's first). +type incomparable [0]func() + +// GzipReader wraps a response body so it can lazily +// get gzip.Reader from the pool on the first call to Read. +// After Close is called it puts gzip.Reader to the pool immediately +// if there is no Read in progress or later when Read completes. +type GzipReader struct { + _ incomparable + Body io.ReadCloser // underlying Response.Body + mu sync.Mutex // guards zr and zerr + zr *gzip.Reader // stores gzip reader from the pool between reads + zerr error // sticky gzip reader init error or sentinel value to detect concurrent read and read after close +} + +type eofReader struct{} + +func (eofReader) Read([]byte) (int, error) { return 0, io.EOF } +func (eofReader) ReadByte() (byte, error) { return 0, io.EOF } + +var gzipPool = sync.Pool{New: func() any { return new(gzip.Reader) }} + +// gzipPoolGet gets a gzip.Reader from the pool and resets it to read from r. +func gzipPoolGet(r io.Reader) (*gzip.Reader, error) { + zr := gzipPool.Get().(*gzip.Reader) + if err := zr.Reset(r); err != nil { + gzipPoolPut(zr) + return nil, err + } + return zr, nil +} + +// gzipPoolPut puts a gzip.Reader back into the pool. +func gzipPoolPut(zr *gzip.Reader) { + // Reset will allocate bufio.Reader if we pass it anything + // other than a flate.Reader, so ensure that it's getting one. + var r flate.Reader = eofReader{} + zr.Reset(r) + gzipPool.Put(zr) +} + +// acquire returns a gzip.Reader for reading response body. +// The reader must be released after use. +func (gz *GzipReader) acquire() (*gzip.Reader, error) { + gz.mu.Lock() + defer gz.mu.Unlock() + if gz.zerr != nil { + return nil, gz.zerr + } + if gz.zr == nil { + // gzipPoolGet might block indefinitely since it reads the gzip header. + // Therefore, drop mu temporarily when using gzipPoolGet. + // We set zerr to errConcurrentRead to prevent concurrent read + // even when mu is temporarily dropped. + gz.zerr = errConcurrentRead + gz.mu.Unlock() + zr, err := gzipPoolGet(gz.Body) + gz.mu.Lock() + // Guard against Close being called while gzipPoolGet is running. + if gz.zerr != errConcurrentRead { + if zr != nil { + gzipPoolPut(zr) + } + return nil, gz.zerr + } + gz.zr, gz.zerr = zr, err + if gz.zerr != nil { + return nil, gz.zerr + } + } + ret := gz.zr + gz.zr, gz.zerr = nil, errConcurrentRead + return ret, nil +} + +// release returns the gzip.Reader to the pool if Close was called during Read. +func (gz *GzipReader) release(zr *gzip.Reader) { + gz.mu.Lock() + defer gz.mu.Unlock() + if gz.zerr == errConcurrentRead { + gz.zr, gz.zerr = zr, nil + } else { // fs.ErrClosed + gzipPoolPut(zr) + } +} + +// close returns the gzip.Reader to the pool immediately or +// signals release to do so after Read completes. +func (gz *GzipReader) close() { + gz.mu.Lock() + defer gz.mu.Unlock() + if gz.zerr == nil && gz.zr != nil { + gzipPoolPut(gz.zr) + gz.zr = nil + } + gz.zerr = fs.ErrClosed +} + +func (gz *GzipReader) Read(p []byte) (n int, err error) { + zr, err := gz.acquire() + if err != nil { + return 0, err + } + defer gz.release(zr) + + return zr.Read(p) +} + +func (gz *GzipReader) Close() error { + gz.close() + + return gz.Body.Close() +} diff --git a/vendor/golang.org/x/net/internal/httpcommon/request.go b/vendor/golang.org/x/net/internal/httpcommon/request.go index d94c87429a6..5aaca5989b0 100644 --- a/vendor/golang.org/x/net/internal/httpcommon/request.go +++ b/vendor/golang.org/x/net/internal/httpcommon/request.go @@ -391,6 +391,7 @@ type ServerRequestParam struct { // ServerRequestResult is the result of NewServerRequest. type ServerRequestResult struct { // Various http.Request fields. + Host string URL *url.URL RequestURI string Trailer map[string][]string @@ -433,20 +434,46 @@ func NewServerRequest(rp ServerRequestParam) ServerRequestResult { } delete(rp.Header, "Trailer") + authority := rp.Authority + if host := rp.Header["Host"]; len(host) == 1 { + // HTTP/2 and HTTP/3 permit the Host header to be present, + // but it must match the :authority pseudo-header. + if authority == "" { + authority = host[0] + } else if host[0] != authority { + return ServerRequestResult{ + InvalidReason: "authority_host_mismatch", + } + } + delete(rp.Header, "Host") + } else if len(host) > 1 { + // HTTP/1.1 rejects any request containing more than one Host header. + // HTTP/2 and HTTP/3 don't use the Host header, but reject multiple anyway. + return ServerRequestResult{ + InvalidReason: "multiple_host_headers", + } + } + // "':authority' MUST NOT include the deprecated userinfo subcomponent // for "http" or "https" schemed URIs." // https://www.rfc-editor.org/rfc/rfc9113.html#section-8.3.1-2.3.8 - if strings.IndexByte(rp.Authority, '@') != -1 && (rp.Scheme == "http" || rp.Scheme == "https") { + if strings.IndexByte(authority, '@') != -1 && (rp.Scheme == "http" || rp.Scheme == "https") { return ServerRequestResult{ InvalidReason: "userinfo_in_authority", } } + if authority != "" && !httpguts.ValidHostHeader(authority) { + return ServerRequestResult{ + InvalidReason: "invalid_authority", + } + } + var url_ *url.URL var requestURI string if rp.Method == "CONNECT" && rp.Protocol == "" { - url_ = &url.URL{Host: rp.Authority} - requestURI = rp.Authority // mimic HTTP/1 server behavior + url_ = &url.URL{Host: authority} + requestURI = authority // mimic HTTP/1 server behavior } else { // "[The :path] pseudo-header field MUST NOT be empty [...]" // https://www.rfc-editor.org/rfc/rfc9113.html#section-8.3.1-2.4.2 @@ -467,6 +494,7 @@ func NewServerRequest(rp ServerRequestParam) ServerRequestResult { } return ServerRequestResult{ + Host: authority, URL: url_, NeedsContinue: needsContinue, RequestURI: requestURI, diff --git a/vendor/golang.org/x/net/trace/histogram.go b/vendor/golang.org/x/net/trace/histogram.go index d6c71101e4d..2f786831448 100644 --- a/vendor/golang.org/x/net/trace/histogram.go +++ b/vendor/golang.org/x/net/trace/histogram.go @@ -70,10 +70,7 @@ func log2(i int64) int { } func getBucket(i int64) (index int) { - index = log2(i) - 1 - if index < 0 { - index = 0 - } + index = max(log2(i)-1, 0) if index >= bucketCount { index = bucketCount - 1 } diff --git a/vendor/golang.org/x/sync/semaphore/semaphore.go b/vendor/golang.org/x/sync/semaphore/semaphore.go index 96a035aedeb..f2a7d3ff494 100644 --- a/vendor/golang.org/x/sync/semaphore/semaphore.go +++ b/vendor/golang.org/x/sync/semaphore/semaphore.go @@ -17,10 +17,13 @@ type waiter struct { } // NewWeighted creates a new weighted semaphore with the given -// maximum combined weight for concurrent access. +// maximum combined weight for concurrent access. NewWeighted panics if n is +// negative. func NewWeighted(n int64) *Weighted { - w := &Weighted{size: n} - return w + if n < 0 { + panic("semaphore: size < 0") + } + return &Weighted{size: n} } // Weighted provides a way to bound concurrent access to a resource. diff --git a/vendor/golang.org/x/sys/cpu/cpu.go b/vendor/golang.org/x/sys/cpu/cpu.go index f1ce515d5c9..df8dbd1dbf1 100644 --- a/vendor/golang.org/x/sys/cpu/cpu.go +++ b/vendor/golang.org/x/sys/cpu/cpu.go @@ -182,12 +182,13 @@ var MIPS64X struct { // require kernel support to work (DARN, SCV), so there are feature bits for // those as well. The struct is padded to avoid false sharing. var PPC64 struct { - _ CacheLinePad - HasDARN bool // Hardware random number generator (requires kernel enablement) - HasSCV bool // Syscall vectored (requires kernel enablement) - IsPOWER8 bool // ISA v2.07 (POWER8) - IsPOWER9 bool // ISA v3.00 (POWER9), implies IsPOWER8 - _ CacheLinePad + _ CacheLinePad + HasDARN bool // Hardware random number generator (requires kernel enablement) + HasSCV bool // Syscall vectored (requires kernel enablement) + IsPOWER8 bool // ISA v2.07 (POWER8) + IsPOWER9 bool // ISA v3.00 (POWER9), implies IsPOWER8 + IsPOWER10 bool // ISA v3.1 (POWER10 and POWER11; POWER11 did not add a new architected level), implies IsPOWER9 + _ CacheLinePad } // S390X contains the supported CPU features of the current IBM Z @@ -248,13 +249,21 @@ var RISCV64 struct { HasZvks bool // ShangMi Algorithm Suite HasZvksc bool // ShangMi Algorithm Suite with carryless multiplication HasZvksg bool // ShangMi Algorithm Suite with GCM + VLENB uint // Vector register length in bytes, 0 if undetected _ CacheLinePad } +// doDerived, if non-nil, is called after processing GODEBUG to set "derived" +// feature flags. +var doDerived func() + func init() { archInit() initOptions() processOptions() + if doDerived != nil { + doDerived() + } } // options contains the cpu debug options that can be used in GODEBUG. diff --git a/vendor/golang.org/x/sys/cpu/cpu_gc_riscv64.go b/vendor/golang.org/x/sys/cpu/cpu_gc_riscv64.go new file mode 100644 index 00000000000..3d660dd48c5 --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_gc_riscv64.go @@ -0,0 +1,11 @@ +// Copyright 2026 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build gc + +package cpu + +// Can only be called when the vector extension is present. +// Implemented in cpu_riscv64.s. +func readVLENB() uint diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go b/vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go index 197188e67f3..70b3dc7dd0d 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go +++ b/vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go @@ -11,6 +11,7 @@ const ( // ISA Level _PPC_FEATURE2_ARCH_2_07 = 0x80000000 _PPC_FEATURE2_ARCH_3_00 = 0x00800000 + _PPC_FEATURE2_ARCH_3_1 = 0x00040000 // CPU features _PPC_FEATURE2_DARN = 0x00200000 @@ -21,6 +22,9 @@ func doinit() { // HWCAP2 feature bits PPC64.IsPOWER8 = isSet(hwCap2, _PPC_FEATURE2_ARCH_2_07) PPC64.IsPOWER9 = isSet(hwCap2, _PPC_FEATURE2_ARCH_3_00) + // ISA 3.1 covers both POWER10 and POWER11: POWER11 did not introduce a + // new architected HWCAP level, so there is no separate IsPOWER11. + PPC64.IsPOWER10 = isSet(hwCap2, _PPC_FEATURE2_ARCH_3_1) PPC64.HasDARN = isSet(hwCap2, _PPC_FEATURE2_DARN) PPC64.HasSCV = isSet(hwCap2, _PPC_FEATURE2_SCV) } diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go b/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go index f4fb52ee966..53e909114bb 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go @@ -130,6 +130,9 @@ func doinit() { RISCV64.HasFastMisaligned = v == riscv_HWPROBE_MISALIGNED_FAST } } + if RISCV64.HasV { + RISCV64.VLENB = readVLENB() + } // Let's double check with HWCAP if the C extension does not appear to be supported. // This may happen if we're running on a kernel older than 6.4. @@ -137,6 +140,14 @@ func doinit() { if !RISCV64.HasC { RISCV64.HasC = isSet(hwCap, hwcap_RISCV_ISA_C) } + + doDerived = func() { + // If the vector extension is disabled by GODEBUG, then the VLENB is zero. + if !RISCV64.HasV { + RISCV64.VLENB = 0 + } + } + } func isSet(hwc uint, value uint) bool { diff --git a/vendor/golang.org/x/sys/cpu/cpu_netbsd_amd64.go b/vendor/golang.org/x/sys/cpu/cpu_netbsd_amd64.go new file mode 100644 index 00000000000..4f981b1c8a6 --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_netbsd_amd64.go @@ -0,0 +1,47 @@ +// Copyright 2026 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build netbsd && amd64 && gc + +package cpu + +func doinit() { + // NetBSD corrupts avx registers when receiving signals. + // See issue 80285. + // TODO: when NetBSD fixes the bug, add a version + // check and skip here. + X86.HasAVX = false + X86.HasAVX2 = false + // Set these also, just to be safe + X86.HasAVXVNNI = false + X86.HasAVX512 = false + X86.HasAVX512F = false + X86.HasAVX512CD = false + X86.HasAVX512CD = false + X86.HasAVX512ER = false + X86.HasAVX512PF = false + X86.HasAVX512VL = false + X86.HasAVX512BW = false + X86.HasAVX512DQ = false + X86.HasAVX512IFMA = false + X86.HasAVX512VBMI = false + X86.HasAVX5124VNNIW = false + X86.HasAVX5124FMAPS = false + X86.HasAVX512VPOPCNTDQ = false + X86.HasAVX512VPCLMULQDQ = false + X86.HasAVX512VNNI = false + X86.HasAVX512GFNI = false + X86.HasAVX512VAES = false + X86.HasAVX512VBMI2 = false + X86.HasAVX512BITALG = false + X86.HasAVX512BF16 = false + X86.HasAVXIFMA = false + X86.HasAVXVNNI = false + X86.HasAVXVNNIInt8 = false + +} + +func darwinSupportsAVX512() bool { + panic("only implemented for gc && amd64 && darwin") +} diff --git a/vendor/golang.org/x/sys/cpu/cpu_other_x86.go b/vendor/golang.org/x/sys/cpu/cpu_other_x86.go index a0fd7e2f75d..82b7580d0b7 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_other_x86.go +++ b/vendor/golang.org/x/sys/cpu/cpu_other_x86.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build 386 || amd64p32 || (amd64 && (!darwin || !gc)) +//go:build 386 || amd64p32 || (amd64 && ((!darwin && !netbsd) || !gc)) package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_riscv64.s b/vendor/golang.org/x/sys/cpu/cpu_riscv64.s new file mode 100644 index 00000000000..b092fb2697e --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_riscv64.s @@ -0,0 +1,17 @@ +// Copyright 2026 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build gc + +#include "textflag.h" + +// Read the vector register length in bytes from the vlenb CSR. +// May only be called when the vector extension is present. +// func readVLENB() uint +TEXT ·readVLENB(SB), NOSPLIT|NOFRAME, $0-8 + // Go 1.25's assembler does not recognize VLENB, so use its raw CSRR encoding. + // Replace WORD with CSRR VLENB, X10 once go.mod requires Go 1.27. + WORD $0xc2202573 + MOV X10, ret+0(FP) + RET diff --git a/vendor/golang.org/x/sys/cpu/cpu_sparc64.go b/vendor/golang.org/x/sys/cpu/cpu_sparc64.go new file mode 100644 index 00000000000..0199ef19ba9 --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_sparc64.go @@ -0,0 +1,12 @@ +// Copyright 2026 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build sparc64 + +package cpu + +// The L1 line is 32 bytes; false sharing is governed by the 64-byte L2 line. +const cacheLineSize = 64 + +func initOptions() {} diff --git a/vendor/golang.org/x/sys/unix/ifreq_linux.go b/vendor/golang.org/x/sys/unix/ifreq_linux.go index 309f5a2b0c7..3f7fa766437 100644 --- a/vendor/golang.org/x/sys/unix/ifreq_linux.go +++ b/vendor/golang.org/x/sys/unix/ifreq_linux.go @@ -22,7 +22,13 @@ import ( // fields can be get and set using the following methods: // - Uint16/SetUint16: flags // - Uint32/SetUint32: ifindex, metric, mtu -type Ifreq struct{ raw ifreq } +type Ifreq struct { + // Aligns the union for the accessors below, which cast it in place; + // the generated ifreq is all byte arrays, so its alignment is one. + _ [0]int64 + + raw ifreq +} // NewIfreq creates an Ifreq with the input network interface name after // validating the name does not exceed IFNAMSIZ-1 (trailing NULL required) diff --git a/vendor/golang.org/x/sys/unix/ioctl_linux.go b/vendor/golang.org/x/sys/unix/ioctl_linux.go index 7ca4fa12aa6..5589d4f665f 100644 --- a/vendor/golang.org/x/sys/unix/ioctl_linux.go +++ b/vendor/golang.org/x/sys/unix/ioctl_linux.go @@ -332,3 +332,10 @@ func IoctlLoopSetStatus64(fd int, value *LoopInfo64) error { func IoctlLoopConfigure(fd int, value *LoopConfig) error { return ioctlPtr(fd, LOOP_CONFIGURE, unsafe.Pointer(value)) } + +// IoctlPidfdInfo fetches information about a pidfd. +// The Mask field of the info argument indicates which +// values to fetch. +func IoctlPidfdInfo(fd int, info *PidfdInfo) error { + return ioctlPtr(fd, PIDFD_GET_INFO, unsafe.Pointer(info)) +} diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh index fa74cfe9e8a..9e907ac2967 100644 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -290,14 +290,7 @@ struct ltchars { #include #include -#if defined(__sparc__) -// On sparc{,64}, the kernel defines struct termios2 itself which clashes with the -// definition in glibc. As only the error constants are needed here, include the -// generic termibits.h (which is included by termbits.h on sparc). -#include -#else #include -#endif #ifndef PTRACE_GETREGS #define PTRACE_GETREGS 0xc @@ -544,7 +537,7 @@ ccflags="$@" $2 ~ /^LO_(KEY|NAME)_SIZE$/ || $2 ~ /^LOOP_(CLR|CTL|GET|SET)_/ || $2 == "LOOP_CONFIGURE" || - $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|MCAST|EVFILT|NOTE|SHUT|PROT|MAP|MREMAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL|TCPOPT|UDP)_/ || + $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|MCAST|EVFILT|NOTE|SHUT|PROT|MAP|MREMAP|MFD|MLOCK|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL|TCPOPT|UDP)_/ || $2 ~ /^NFC_(GENL|PROTO|COMM|RF|SE|DIRECTION|LLCP|SOCKPROTO)_/ || $2 ~ /^NFC_.*_(MAX)?SIZE$/ || $2 ~ /^PTP_/ || diff --git a/vendor/golang.org/x/sys/unix/syscall.go b/vendor/golang.org/x/sys/unix/syscall.go index 5ea74da9820..8f27e7ecb58 100644 --- a/vendor/golang.org/x/sys/unix/syscall.go +++ b/vendor/golang.org/x/sys/unix/syscall.go @@ -76,7 +76,7 @@ func BytePtrToString(p *byte) string { // Find NUL terminator. n := 0 for ptr := unsafe.Pointer(p); *(*byte)(ptr) != 0; n++ { - ptr = unsafe.Pointer(uintptr(ptr) + 1) + ptr = unsafe.Add(ptr, 1) } return string(unsafe.Slice(p, n)) diff --git a/vendor/golang.org/x/sys/unix/syscall_bsd.go b/vendor/golang.org/x/sys/unix/syscall_bsd.go index a00c3e5450b..035c2cd9167 100644 --- a/vendor/golang.org/x/sys/unix/syscall_bsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_bsd.go @@ -188,7 +188,7 @@ func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) { } sa.raw.Len = byte(3 + n) // 2 for Family, Len; 1 for NUL sa.raw.Family = AF_UNIX - for i := 0; i < n; i++ { + for i := range n { sa.raw.Path[i] = int8(name[i]) } return unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go index 21e2bfa398b..6926057e9e8 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -2363,7 +2363,7 @@ func (fh *FileHandle) Bytes() []byte { if n == 0 { return nil } - return unsafe.Slice((*byte)(unsafe.Pointer(uintptr(unsafe.Pointer(&fh.fileHandle.Type))+4)), n) + return unsafe.Slice((*byte)(unsafe.Add(unsafe.Pointer(&fh.fileHandle.Type), 4)), n) } // NameToHandleAt wraps the name_to_handle_at system call; it obtains diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go index 5bb51d7ae1e..45feb124536 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -2048,6 +2048,7 @@ const ( MINIX3_SUPER_MAGIC = 0x4d5a MINIX_SUPER_MAGIC = 0x137f MINIX_SUPER_MAGIC2 = 0x138f + MLOCK_ONFAULT = 0x1 MNT_DETACH = 0x2 MNT_EXPIRE = 0x4 MNT_FORCE = 0x1 @@ -3862,6 +3863,7 @@ const ( TIOCPKT_NOSTOP = 0x10 TIOCPKT_START = 0x8 TIOCPKT_STOP = 0x4 + TIOCSER_TEMT = 0x1 TIPC_ADDR_ID = 0x3 TIPC_ADDR_MCAST = 0x1 TIPC_ADDR_NAME = 0x2 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go index c0a8ea1de0e..6f74d4a0cff 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -483,7 +483,6 @@ const ( TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 - TIOCSER_TEMT = 0x1 TIOCSETD = 0x5423 TIOCSIG = 0x40045436 TIOCSISO7816 = 0xc0285443 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go index ff927c83010..36c1f0b68c4 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -484,7 +484,6 @@ const ( TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 - TIOCSER_TEMT = 0x1 TIOCSETD = 0x5423 TIOCSIG = 0x40045436 TIOCSISO7816 = 0xc0285443 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go index 55294eda5bc..c5512dbea60 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go @@ -489,7 +489,6 @@ const ( TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 - TIOCSER_TEMT = 0x1 TIOCSETD = 0x5423 TIOCSIG = 0x40045436 TIOCSISO7816 = 0xc0285443 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go index 5dac54c35cc..4dabfae0711 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -483,7 +483,6 @@ const ( TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 - TIOCSER_TEMT = 0x1 TIOCSETD = 0x5423 TIOCSIG = 0x40045436 TIOCSISO7816 = 0xc0285443 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go index 46ac1fcb220..ea97930f1f3 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go @@ -476,7 +476,6 @@ const ( TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 - TIOCSER_TEMT = 0x1 TIOCSETD = 0x5423 TIOCSIG = 0x40045436 TIOCSISO7816 = 0xc0285443 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go index b55483e8a98..0826a929e01 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go @@ -481,7 +481,6 @@ const ( TIOCSERGWILD = 0x5489 TIOCSERSETMULTI = 0x5490 TIOCSERSWILD = 0x548a - TIOCSER_TEMT = 0x1 TIOCSETD = 0x7401 TIOCSETN = 0x740a TIOCSETP = 0x7409 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go index 71890c98a40..139deedd956 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go @@ -481,7 +481,6 @@ const ( TIOCSERGWILD = 0x5489 TIOCSERSETMULTI = 0x5490 TIOCSERSWILD = 0x548a - TIOCSER_TEMT = 0x1 TIOCSETD = 0x7401 TIOCSETN = 0x740a TIOCSETP = 0x7409 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go index a78b6cc14bf..b8018af3352 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go @@ -481,7 +481,6 @@ const ( TIOCSERGWILD = 0x5489 TIOCSERSETMULTI = 0x5490 TIOCSERSWILD = 0x548a - TIOCSER_TEMT = 0x1 TIOCSETD = 0x7401 TIOCSETN = 0x740a TIOCSETP = 0x7409 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go index d0e38ca7390..deb5c2e6a9c 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go @@ -481,7 +481,6 @@ const ( TIOCSERGWILD = 0x5489 TIOCSERSETMULTI = 0x5490 TIOCSERSWILD = 0x548a - TIOCSER_TEMT = 0x1 TIOCSETD = 0x7401 TIOCSETN = 0x740a TIOCSETP = 0x7409 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go index c883e14c772..0603bf3a1a1 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go @@ -535,7 +535,6 @@ const ( TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 - TIOCSER_TEMT = 0x1 TIOCSETC = 0x80067411 TIOCSETD = 0x5423 TIOCSETN = 0x8006740a diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go index 1834273d44a..5fa8a5d3672 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go @@ -539,7 +539,6 @@ const ( TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 - TIOCSER_TEMT = 0x1 TIOCSETC = 0x80067411 TIOCSETD = 0x5423 TIOCSETN = 0x8006740a diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go index 39945dd9aec..2733e999345 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go @@ -539,7 +539,6 @@ const ( TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 - TIOCSER_TEMT = 0x1 TIOCSETC = 0x80067411 TIOCSETD = 0x5423 TIOCSETN = 0x8006740a diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go index bc0f372416f..1470172fd9e 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go @@ -486,7 +486,6 @@ const ( TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 - TIOCSER_TEMT = 0x1 TIOCSETD = 0x5423 TIOCSIG = 0x40045436 TIOCSISO7816 = 0xc0285443 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go index 6e87bd6598b..1871579c5c8 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go @@ -545,7 +545,6 @@ const ( TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 - TIOCSER_TEMT = 0x1 TIOCSETD = 0x5423 TIOCSIG = 0x40045436 TIOCSISO7816 = 0xc0285443 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go index 7e2b2e8a667..10881cf6d31 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go @@ -14,21 +14,21 @@ const ( ASI_LEON_DFLUSH = 0x11 ASI_LEON_IFLUSH = 0x10 ASI_LEON_MMUFLUSH = 0x18 - B1000000 = 0x1008 + B1000000 = 0x100c B115200 = 0x1002 - B1152000 = 0x1009 - B1500000 = 0x100a - B2000000 = 0x100b + B1152000 = 0x100d + B1500000 = 0x100e + B153600 = 0x1006 + B2000000 = 0x100f B230400 = 0x1003 - B2500000 = 0x100c - B3000000 = 0x100d - B3500000 = 0x100e - B4000000 = 0x100f + B307200 = 0x1007 B460800 = 0x1004 - B500000 = 0x1005 + B500000 = 0x100a B57600 = 0x1001 - B576000 = 0x1006 - B921600 = 0x1007 + B576000 = 0x100b + B614400 = 0x1008 + B76800 = 0x1005 + B921600 = 0x1009 BLKALIGNOFF = 0x2000127a BLKBSZGET = 0x40081270 BLKBSZSET = 0x80081271 @@ -91,7 +91,7 @@ const ( FFDLY = 0x8000 FICLONE = 0x80049409 FICLONERANGE = 0x8020940d - FLUSHO = 0x1000 + FLUSHO = 0x2000 FS_IOC_ENABLE_VERITY = 0x80806685 FS_IOC_GETFLAGS = 0x40086601 FS_IOC_GET_ENCRYPTION_NONCE = 0x4010661b @@ -563,6 +563,9 @@ const ( TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 + TIOCM_LOOP = 0x8000 + TIOCM_OUT1 = 0x2000 + TIOCM_OUT2 = 0x4000 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_SR = 0x10 @@ -641,10 +644,11 @@ const ( UBI_IOCVOLRMBLK = 0x20004f08 UBI_IOCVOLUP = 0x80084f00 VDISCARD = 0xd + VDSUSP = 0xb VEOF = 0x4 - VEOL = 0xb - VEOL2 = 0x10 - VMIN = 0x6 + VEOL = 0x5 + VEOL2 = 0x6 + VMIN = 0x4 VREPRINT = 0xc VSTART = 0x8 VSTOP = 0x9 @@ -664,6 +668,7 @@ const ( WDIOC_KEEPALIVE = 0x40045705 WDIOC_SETOPTIONS = 0x40045704 WORDSIZE = 0x40 + WRAP = 0x20000 XCASE = 0x4 XTABS = 0x1800 _HIDIOCGRAWNAME = 0x40804804 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go index 526a0d5f434..538a18f27c2 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -4264,19 +4264,29 @@ type HwTstampConfig struct { } const ( - HWTSTAMP_FILTER_NONE = 0x0 - HWTSTAMP_FILTER_ALL = 0x1 - HWTSTAMP_FILTER_SOME = 0x2 - HWTSTAMP_FILTER_PTP_V1_L4_EVENT = 0x3 - HWTSTAMP_FILTER_PTP_V2_L4_EVENT = 0x6 - HWTSTAMP_FILTER_PTP_V2_L2_EVENT = 0x9 - HWTSTAMP_FILTER_PTP_V2_EVENT = 0xc + HWTSTAMP_FILTER_NONE = 0x0 + HWTSTAMP_FILTER_ALL = 0x1 + HWTSTAMP_FILTER_SOME = 0x2 + HWTSTAMP_FILTER_PTP_V1_L4_EVENT = 0x3 + HWTSTAMP_FILTER_PTP_V1_L4_SYNC = 0x4 + HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ = 0x5 + HWTSTAMP_FILTER_PTP_V2_L4_EVENT = 0x6 + HWTSTAMP_FILTER_PTP_V2_L4_SYNC = 0x7 + HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ = 0x8 + HWTSTAMP_FILTER_PTP_V2_L2_EVENT = 0x9 + HWTSTAMP_FILTER_PTP_V2_L2_SYNC = 0xa + HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ = 0xb + HWTSTAMP_FILTER_PTP_V2_EVENT = 0xc + HWTSTAMP_FILTER_PTP_V2_SYNC = 0xd + HWTSTAMP_FILTER_PTP_V2_DELAY_REQ = 0xe + HWTSTAMP_FILTER_NTP_ALL = 0xf ) const ( HWTSTAMP_TX_OFF = 0x0 HWTSTAMP_TX_ON = 0x1 HWTSTAMP_TX_ONESTEP_SYNC = 0x2 + HWTSTAMP_TX_ONESTEP_P2P = 0x3 ) type ( @@ -4541,6 +4551,48 @@ const ( LANDLOCK_RULE_PATH_BENEATH = 0x1 ) +const ( + PIDFD_SIGNAL_THREAD = 0x1 + PIDFD_SIGNAL_THREAD_GROUP = 0x2 + PIDFD_SIGNAL_PROCESS_GROUP = 0x4 + PIDFD_SELF_THREAD = -0x2710 + PIDFD_SELF_THREAD_GROUP = -0x2711 + PIDFD_SELF = -0x2710 + PIDFD_SELF_PROCESS = -0x2711 + PIDFD_INFO_PID = 0x1 + PIDFD_INFO_CREDS = 0x2 + PIDFD_INFO_CGROUPID = 0x4 + PIDFD_INFO_EXIT = 0x8 + PIDFD_INFO_COREDUMP = 0x10 + PIDFD_COREDUMPED = 0x1 + PIDFD_COREDUMP_SKIP = 0x2 + PIDFD_COREDUMP_USER = 0x4 + PIDFD_COREDUMP_ROOT = 0x8 + PIDFD_INFO_SIZE_VER0 = 0x40 + PIDFD_GET_INFO = 0xc048ff0b +) + +const SizeofPidfdInfo = 0x48 + +type PidfdInfo struct { + Mask uint64 + Cgroupid uint64 + Pid uint32 + Tgid uint32 + Ppid uint32 + Ruid uint32 + Rgid uint32 + Euid uint32 + Egid uint32 + Suid uint32 + Sgid uint32 + Fsuid uint32 + Fsgid uint32 + Exit_code int32 + Coredump_mask uint32 + _ uint32 +} + const ( IPC_CREAT = 0x200 IPC_EXCL = 0x400 @@ -6473,3 +6525,23 @@ type GPIOV2LineEvent struct { Line_seqno uint32 _ [6]uint32 } + +const ( + IPMI_MAX_ADDR_SIZE = 0x20 + IPMI_SYSTEM_INTERFACE_ADDR_TYPE = 0xc + IPMI_BMC_CHANNEL = 0xf + IPMI_RESPONSE_RECV_TYPE = 0x1 +) + +type IPMISystemInterfaceAddr struct { + Type int32 + Channel int16 + Lun uint8 + _ [1]byte +} +type IPMIMsg struct { + Netfn uint8 + Cmd uint8 + Len uint16 + Data *uint8 +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go index aede1de7f2e..38658a345bd 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go @@ -680,7 +680,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x800 + PIDFD_NONBLOCK = 0x800 + PIDFD_THREAD = 0x80 + PIDFD_GET_CGROUP_NAMESPACE = 0xff01 + PIDFD_GET_IPC_NAMESPACE = 0xff02 + PIDFD_GET_MNT_NAMESPACE = 0xff03 + PIDFD_GET_NET_NAMESPACE = 0xff04 + PIDFD_GET_PID_NAMESPACE = 0xff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0xff06 + PIDFD_GET_TIME_NAMESPACE = 0xff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0xff08 + PIDFD_GET_USER_NAMESPACE = 0xff09 + PIDFD_GET_UTS_NAMESPACE = 0xff0a ) type SysvIpcPerm struct { @@ -715,3 +726,22 @@ type SysvShmDesc struct { const ( GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x8014690d + IPMICTL_RECEIVE_MSG = 0xc018690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int32 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int32 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go index bb3bc4dc2c4..267ffe05f32 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go @@ -697,7 +697,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x800 + PIDFD_NONBLOCK = 0x800 + PIDFD_THREAD = 0x80 + PIDFD_GET_CGROUP_NAMESPACE = 0xff01 + PIDFD_GET_IPC_NAMESPACE = 0xff02 + PIDFD_GET_MNT_NAMESPACE = 0xff03 + PIDFD_GET_NET_NAMESPACE = 0xff04 + PIDFD_GET_PID_NAMESPACE = 0xff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0xff06 + PIDFD_GET_TIME_NAMESPACE = 0xff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0xff08 + PIDFD_GET_USER_NAMESPACE = 0xff09 + PIDFD_GET_UTS_NAMESPACE = 0xff0a ) type SysvIpcPerm struct { @@ -729,3 +740,22 @@ type SysvShmDesc struct { const ( GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x8028690d + IPMICTL_RECEIVE_MSG = 0xc030690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int64 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int64 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go index 1fdf4c5175c..ec459d5f3fd 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go @@ -674,7 +674,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x800 + PIDFD_NONBLOCK = 0x800 + PIDFD_THREAD = 0x80 + PIDFD_GET_CGROUP_NAMESPACE = 0xff01 + PIDFD_GET_IPC_NAMESPACE = 0xff02 + PIDFD_GET_MNT_NAMESPACE = 0xff03 + PIDFD_GET_NET_NAMESPACE = 0xff04 + PIDFD_GET_PID_NAMESPACE = 0xff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0xff06 + PIDFD_GET_TIME_NAMESPACE = 0xff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0xff08 + PIDFD_GET_USER_NAMESPACE = 0xff09 + PIDFD_GET_UTS_NAMESPACE = 0xff0a ) type SysvIpcPerm struct { @@ -709,3 +720,22 @@ type SysvShmDesc struct { const ( GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x8014690d + IPMICTL_RECEIVE_MSG = 0xc018690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int32 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int32 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go index 063e6f0b41e..fa45ab7d2ce 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go @@ -676,7 +676,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x800 + PIDFD_NONBLOCK = 0x800 + PIDFD_THREAD = 0x80 + PIDFD_GET_CGROUP_NAMESPACE = 0xff01 + PIDFD_GET_IPC_NAMESPACE = 0xff02 + PIDFD_GET_MNT_NAMESPACE = 0xff03 + PIDFD_GET_NET_NAMESPACE = 0xff04 + PIDFD_GET_PID_NAMESPACE = 0xff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0xff06 + PIDFD_GET_TIME_NAMESPACE = 0xff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0xff08 + PIDFD_GET_USER_NAMESPACE = 0xff09 + PIDFD_GET_UTS_NAMESPACE = 0xff0a ) type SysvIpcPerm struct { @@ -708,3 +719,22 @@ type SysvShmDesc struct { const ( GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x8028690d + IPMICTL_RECEIVE_MSG = 0xc030690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int64 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int64 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go index 9cf836c708f..3da72ccdf8b 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go @@ -677,7 +677,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x800 + PIDFD_NONBLOCK = 0x800 + PIDFD_THREAD = 0x80 + PIDFD_GET_CGROUP_NAMESPACE = 0xff01 + PIDFD_GET_IPC_NAMESPACE = 0xff02 + PIDFD_GET_MNT_NAMESPACE = 0xff03 + PIDFD_GET_NET_NAMESPACE = 0xff04 + PIDFD_GET_PID_NAMESPACE = 0xff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0xff06 + PIDFD_GET_TIME_NAMESPACE = 0xff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0xff08 + PIDFD_GET_USER_NAMESPACE = 0xff09 + PIDFD_GET_UTS_NAMESPACE = 0xff0a ) type SysvIpcPerm struct { @@ -709,3 +720,22 @@ type SysvShmDesc struct { const ( GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x8028690d + IPMICTL_RECEIVE_MSG = 0xc030690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int64 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int64 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go index 1d222fcb312..78f8c6d5557 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go @@ -680,7 +680,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x80 + PIDFD_NONBLOCK = 0x80 + PIDFD_THREAD = 0x400 + PIDFD_GET_CGROUP_NAMESPACE = 0x2000ff01 + PIDFD_GET_IPC_NAMESPACE = 0x2000ff02 + PIDFD_GET_MNT_NAMESPACE = 0x2000ff03 + PIDFD_GET_NET_NAMESPACE = 0x2000ff04 + PIDFD_GET_PID_NAMESPACE = 0x2000ff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0x2000ff06 + PIDFD_GET_TIME_NAMESPACE = 0x2000ff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0x2000ff08 + PIDFD_GET_USER_NAMESPACE = 0x2000ff09 + PIDFD_GET_UTS_NAMESPACE = 0x2000ff0a ) type SysvIpcPerm struct { @@ -714,3 +725,22 @@ type SysvShmDesc struct { const ( GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x4014690d + IPMICTL_RECEIVE_MSG = 0xc018690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int32 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int32 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go index 912cc4ab63b..bbd4c6c2b92 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go @@ -679,7 +679,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x80 + PIDFD_NONBLOCK = 0x80 + PIDFD_THREAD = 0x400 + PIDFD_GET_CGROUP_NAMESPACE = 0x2000ff01 + PIDFD_GET_IPC_NAMESPACE = 0x2000ff02 + PIDFD_GET_MNT_NAMESPACE = 0x2000ff03 + PIDFD_GET_NET_NAMESPACE = 0x2000ff04 + PIDFD_GET_PID_NAMESPACE = 0x2000ff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0x2000ff06 + PIDFD_GET_TIME_NAMESPACE = 0x2000ff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0x2000ff08 + PIDFD_GET_USER_NAMESPACE = 0x2000ff09 + PIDFD_GET_UTS_NAMESPACE = 0x2000ff0a ) type SysvIpcPerm struct { @@ -711,3 +722,22 @@ type SysvShmDesc struct { const ( GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x4028690d + IPMICTL_RECEIVE_MSG = 0xc030690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int64 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int64 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go index 1e358ef34f2..644d31d6ae5 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go @@ -679,7 +679,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x80 + PIDFD_NONBLOCK = 0x80 + PIDFD_THREAD = 0x400 + PIDFD_GET_CGROUP_NAMESPACE = 0x2000ff01 + PIDFD_GET_IPC_NAMESPACE = 0x2000ff02 + PIDFD_GET_MNT_NAMESPACE = 0x2000ff03 + PIDFD_GET_NET_NAMESPACE = 0x2000ff04 + PIDFD_GET_PID_NAMESPACE = 0x2000ff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0x2000ff06 + PIDFD_GET_TIME_NAMESPACE = 0x2000ff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0x2000ff08 + PIDFD_GET_USER_NAMESPACE = 0x2000ff09 + PIDFD_GET_UTS_NAMESPACE = 0x2000ff0a ) type SysvIpcPerm struct { @@ -711,3 +722,22 @@ type SysvShmDesc struct { const ( GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x4028690d + IPMICTL_RECEIVE_MSG = 0xc030690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int64 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int64 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go index df59f32f5e4..a976f62676b 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go @@ -680,7 +680,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x80 + PIDFD_NONBLOCK = 0x80 + PIDFD_THREAD = 0x400 + PIDFD_GET_CGROUP_NAMESPACE = 0x2000ff01 + PIDFD_GET_IPC_NAMESPACE = 0x2000ff02 + PIDFD_GET_MNT_NAMESPACE = 0x2000ff03 + PIDFD_GET_NET_NAMESPACE = 0x2000ff04 + PIDFD_GET_PID_NAMESPACE = 0x2000ff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0x2000ff06 + PIDFD_GET_TIME_NAMESPACE = 0x2000ff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0x2000ff08 + PIDFD_GET_USER_NAMESPACE = 0x2000ff09 + PIDFD_GET_UTS_NAMESPACE = 0x2000ff0a ) type SysvIpcPerm struct { @@ -714,3 +725,22 @@ type SysvShmDesc struct { const ( GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x4014690d + IPMICTL_RECEIVE_MSG = 0xc018690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int32 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int32 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go index 29355aa0bfe..46324695f64 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go @@ -686,7 +686,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x800 + PIDFD_NONBLOCK = 0x800 + PIDFD_THREAD = 0x80 + PIDFD_GET_CGROUP_NAMESPACE = 0x2000ff01 + PIDFD_GET_IPC_NAMESPACE = 0x2000ff02 + PIDFD_GET_MNT_NAMESPACE = 0x2000ff03 + PIDFD_GET_NET_NAMESPACE = 0x2000ff04 + PIDFD_GET_PID_NAMESPACE = 0x2000ff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0x2000ff06 + PIDFD_GET_TIME_NAMESPACE = 0x2000ff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0x2000ff08 + PIDFD_GET_USER_NAMESPACE = 0x2000ff09 + PIDFD_GET_UTS_NAMESPACE = 0x2000ff0a ) type SysvIpcPerm struct { @@ -722,3 +733,22 @@ type SysvShmDesc struct { const ( GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x4014690d + IPMICTL_RECEIVE_MSG = 0xc018690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int32 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int32 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go index c6083a15d7d..cbc303974fe 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go @@ -686,7 +686,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x800 + PIDFD_NONBLOCK = 0x800 + PIDFD_THREAD = 0x80 + PIDFD_GET_CGROUP_NAMESPACE = 0x2000ff01 + PIDFD_GET_IPC_NAMESPACE = 0x2000ff02 + PIDFD_GET_MNT_NAMESPACE = 0x2000ff03 + PIDFD_GET_NET_NAMESPACE = 0x2000ff04 + PIDFD_GET_PID_NAMESPACE = 0x2000ff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0x2000ff06 + PIDFD_GET_TIME_NAMESPACE = 0x2000ff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0x2000ff08 + PIDFD_GET_USER_NAMESPACE = 0x2000ff09 + PIDFD_GET_UTS_NAMESPACE = 0x2000ff0a ) type SysvIpcPerm struct { @@ -717,3 +728,22 @@ type SysvShmDesc struct { const ( GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x4028690d + IPMICTL_RECEIVE_MSG = 0xc030690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int64 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int64 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go index 6321cc76266..b47f7b49844 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go @@ -686,7 +686,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x800 + PIDFD_NONBLOCK = 0x800 + PIDFD_THREAD = 0x80 + PIDFD_GET_CGROUP_NAMESPACE = 0x2000ff01 + PIDFD_GET_IPC_NAMESPACE = 0x2000ff02 + PIDFD_GET_MNT_NAMESPACE = 0x2000ff03 + PIDFD_GET_NET_NAMESPACE = 0x2000ff04 + PIDFD_GET_PID_NAMESPACE = 0x2000ff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0x2000ff06 + PIDFD_GET_TIME_NAMESPACE = 0x2000ff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0x2000ff08 + PIDFD_GET_USER_NAMESPACE = 0x2000ff09 + PIDFD_GET_UTS_NAMESPACE = 0x2000ff0a ) type SysvIpcPerm struct { @@ -717,3 +728,22 @@ type SysvShmDesc struct { const ( GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x4028690d + IPMICTL_RECEIVE_MSG = 0xc030690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int64 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int64 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go index b44f402feb6..cb16add54c4 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go @@ -704,7 +704,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x800 + PIDFD_NONBLOCK = 0x800 + PIDFD_THREAD = 0x80 + PIDFD_GET_CGROUP_NAMESPACE = 0xff01 + PIDFD_GET_IPC_NAMESPACE = 0xff02 + PIDFD_GET_MNT_NAMESPACE = 0xff03 + PIDFD_GET_NET_NAMESPACE = 0xff04 + PIDFD_GET_PID_NAMESPACE = 0xff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0xff06 + PIDFD_GET_TIME_NAMESPACE = 0xff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0xff08 + PIDFD_GET_USER_NAMESPACE = 0xff09 + PIDFD_GET_UTS_NAMESPACE = 0xff0a ) type SysvIpcPerm struct { @@ -796,3 +807,22 @@ const ( const ( GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x8028690d + IPMICTL_RECEIVE_MSG = 0xc030690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int64 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int64 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go index b22c795a646..a57ab8fadd7 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go @@ -700,7 +700,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x800 + PIDFD_NONBLOCK = 0x800 + PIDFD_THREAD = 0x80 + PIDFD_GET_CGROUP_NAMESPACE = 0xff01 + PIDFD_GET_IPC_NAMESPACE = 0xff02 + PIDFD_GET_MNT_NAMESPACE = 0xff03 + PIDFD_GET_NET_NAMESPACE = 0xff04 + PIDFD_GET_PID_NAMESPACE = 0xff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0xff06 + PIDFD_GET_TIME_NAMESPACE = 0xff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0xff08 + PIDFD_GET_USER_NAMESPACE = 0xff09 + PIDFD_GET_UTS_NAMESPACE = 0xff0a ) type SysvIpcPerm struct { @@ -731,3 +742,22 @@ type SysvShmDesc struct { const ( GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x8028690d + IPMICTL_RECEIVE_MSG = 0xc030690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int64 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int64 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go index 0b18075b53e..bf99635d8ad 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go @@ -681,7 +681,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x4000 + PIDFD_NONBLOCK = 0x4000 + PIDFD_THREAD = 0x800 + PIDFD_GET_CGROUP_NAMESPACE = 0x2000ff01 + PIDFD_GET_IPC_NAMESPACE = 0x2000ff02 + PIDFD_GET_MNT_NAMESPACE = 0x2000ff03 + PIDFD_GET_NET_NAMESPACE = 0x2000ff04 + PIDFD_GET_PID_NAMESPACE = 0x2000ff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0x2000ff06 + PIDFD_GET_TIME_NAMESPACE = 0x2000ff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0x2000ff08 + PIDFD_GET_USER_NAMESPACE = 0x2000ff09 + PIDFD_GET_UTS_NAMESPACE = 0x2000ff0a ) type SysvIpcPerm struct { @@ -712,3 +723,22 @@ type SysvShmDesc struct { const ( GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x4028690d + IPMICTL_RECEIVE_MSG = 0xc030690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int64 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int64 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/windows/types_windows.go b/vendor/golang.org/x/sys/windows/types_windows.go index 75a50b3165e..643737d4553 100644 --- a/vendor/golang.org/x/sys/windows/types_windows.go +++ b/vendor/golang.org/x/sys/windows/types_windows.go @@ -1065,6 +1065,7 @@ const ( SO_BROADCAST = 32 SO_LINGER = 128 SO_RCVBUF = 0x1002 + SO_SNDTIMEO = 0x1005 SO_RCVTIMEO = 0x1006 SO_SNDBUF = 0x1001 SO_UPDATE_ACCEPT_CONTEXT = 0x700b diff --git a/vendor/golang.org/x/text/unicode/bidi/core.go b/vendor/golang.org/x/text/unicode/bidi/core.go index fb8273236dd..e28ac8c8aa2 100644 --- a/vendor/golang.org/x/text/unicode/bidi/core.go +++ b/vendor/golang.org/x/text/unicode/bidi/core.go @@ -6,7 +6,6 @@ package bidi import ( "fmt" - "log" ) // This implementation is a port based on the reference implementation found at: @@ -248,7 +247,7 @@ func (p *paragraph) determineParagraphEmbeddingLevel(start, end int) level { } else if t.in(FSI, LRI, RLI) { i = p.matchingPDI[i] // skip over to the matching PDI if i > end { - log.Panic("assert (i <= end)") + panic("assert (i <= end)") } } } @@ -729,7 +728,7 @@ loop: continue loop } } - log.Panicf("invalid bidi code %v present in assertOnly at position %d", t, s.indexes[i]) + panic(fmt.Errorf("invalid bidi code %v present in assertOnly at position %d", t, s.indexes[i])) } } diff --git a/vendor/golang.org/x/text/unicode/norm/composition.go b/vendor/golang.org/x/text/unicode/norm/composition.go index e2087bce527..e024e74b9f9 100644 --- a/vendor/golang.org/x/text/unicode/norm/composition.go +++ b/vendor/golang.org/x/text/unicode/norm/composition.go @@ -449,6 +449,16 @@ func (rb *reorderBuffer) combineHangul(s, i, k int) { // ACxx plus 11Ax to LVT rb.assignRune(s, l+v-jamoTBase) default: + // Not a Hangul composition. The segment may still + // contain regular canonical compositions, such as + // combining marks following a Hangul syllable, so + // fall back to the composition table. + if b[i].combinesBackward() { + if combined := combine(l, v); combined != 0 { + rb.assignRune(s, combined) + continue + } + } b[k] = b[i] k++ } @@ -484,25 +494,27 @@ func (rb *reorderBuffer) compose() { return } ii := b[i] + // Track the last starter unconditionally: b[i] must be blocked by + // any starter between it and s, even one that b[i] itself cannot + // combine with, and even if the runes in between never enter the + // combinesBackward branch below. + cccB := b[k-1].ccc + cccC := ii.ccc + blocked := false // b[i] blocked by starter or greater or equal CCC? + if cccB == 0 { + s = k - 1 + } else { + blocked = s != k-1 && cccB >= cccC + } // We can only use combineForward as a filter if we later // get the info for the combined character. This is more // expensive than using the filter. Using combinesBackward() // is safe. - if ii.combinesBackward() { - cccB := b[k-1].ccc - cccC := ii.ccc - blocked := false // b[i] blocked by starter or greater or equal CCC? - if cccB == 0 { - s = k - 1 - } else { - blocked = s != k-1 && cccB >= cccC - } - if !blocked { - combined := combine(rb.runeAt(s), rb.runeAt(i)) - if combined != 0 { - rb.assignRune(s, combined) - continue - } + if ii.combinesBackward() && !blocked { + combined := combine(rb.runeAt(s), rb.runeAt(i)) + if combined != 0 { + rb.assignRune(s, combined) + continue } } b[k] = b[i] diff --git a/vendor/golang.org/x/text/unicode/norm/forminfo.go b/vendor/golang.org/x/text/unicode/norm/forminfo.go index b3cf5d9bdee..956708eec0d 100644 --- a/vendor/golang.org/x/text/unicode/norm/forminfo.go +++ b/vendor/golang.org/x/text/unicode/norm/forminfo.go @@ -191,30 +191,30 @@ func (p Properties) TrailCCC() uint8 { return ccc[p.tccc] } +// Recomposition +// Each entry of recompMapPacked holds the two runes of the key and the +// composed rune of the value packed into a big-endian uint64 as three +// 21-bit fields, which is wide enough for any rune. +// Note that the recomposition map for NFC and NFKC are identical. + +const recompShift = 21 + func buildRecompMap() { - recompMap = make(map[uint32]rune, len(recompMapPacked)/8) + recompMap = make(map[uint64]rune, len(recompMapPacked)/8) var buf [8]byte for i := 0; i < len(recompMapPacked); i += 8 { copy(buf[:], recompMapPacked[i:i+8]) - key := binary.BigEndian.Uint32(buf[:4]) - val := binary.BigEndian.Uint32(buf[4:]) - recompMap[key] = rune(val) + e := binary.BigEndian.Uint64(buf[:]) + recompMap[e>>recompShift] = rune(e & (1<" + // 0x006C030C: 0x0000013E - "\x00N\x03\x01\x00\x00\x01C" + // 0x004E0301: 0x00000143 - "\x00n\x03\x01\x00\x00\x01D" + // 0x006E0301: 0x00000144 - "\x00N\x03'\x00\x00\x01E" + // 0x004E0327: 0x00000145 - "\x00n\x03'\x00\x00\x01F" + // 0x006E0327: 0x00000146 - "\x00N\x03\f\x00\x00\x01G" + // 0x004E030C: 0x00000147 - "\x00n\x03\f\x00\x00\x01H" + // 0x006E030C: 0x00000148 - "\x00O\x03\x04\x00\x00\x01L" + // 0x004F0304: 0x0000014C - "\x00o\x03\x04\x00\x00\x01M" + // 0x006F0304: 0x0000014D - "\x00O\x03\x06\x00\x00\x01N" + // 0x004F0306: 0x0000014E - "\x00o\x03\x06\x00\x00\x01O" + // 0x006F0306: 0x0000014F - "\x00O\x03\v\x00\x00\x01P" + // 0x004F030B: 0x00000150 - "\x00o\x03\v\x00\x00\x01Q" + // 0x006F030B: 0x00000151 - "\x00R\x03\x01\x00\x00\x01T" + // 0x00520301: 0x00000154 - "\x00r\x03\x01\x00\x00\x01U" + // 0x00720301: 0x00000155 - "\x00R\x03'\x00\x00\x01V" + // 0x00520327: 0x00000156 - "\x00r\x03'\x00\x00\x01W" + // 0x00720327: 0x00000157 - "\x00R\x03\f\x00\x00\x01X" + // 0x0052030C: 0x00000158 - "\x00r\x03\f\x00\x00\x01Y" + // 0x0072030C: 0x00000159 - "\x00S\x03\x01\x00\x00\x01Z" + // 0x00530301: 0x0000015A - "\x00s\x03\x01\x00\x00\x01[" + // 0x00730301: 0x0000015B - "\x00S\x03\x02\x00\x00\x01\\" + // 0x00530302: 0x0000015C - "\x00s\x03\x02\x00\x00\x01]" + // 0x00730302: 0x0000015D - "\x00S\x03'\x00\x00\x01^" + // 0x00530327: 0x0000015E - "\x00s\x03'\x00\x00\x01_" + // 0x00730327: 0x0000015F - "\x00S\x03\f\x00\x00\x01`" + // 0x0053030C: 0x00000160 - "\x00s\x03\f\x00\x00\x01a" + // 0x0073030C: 0x00000161 - "\x00T\x03'\x00\x00\x01b" + // 0x00540327: 0x00000162 - "\x00t\x03'\x00\x00\x01c" + // 0x00740327: 0x00000163 - "\x00T\x03\f\x00\x00\x01d" + // 0x0054030C: 0x00000164 - "\x00t\x03\f\x00\x00\x01e" + // 0x0074030C: 0x00000165 - "\x00U\x03\x03\x00\x00\x01h" + // 0x00550303: 0x00000168 - "\x00u\x03\x03\x00\x00\x01i" + // 0x00750303: 0x00000169 - "\x00U\x03\x04\x00\x00\x01j" + // 0x00550304: 0x0000016A - "\x00u\x03\x04\x00\x00\x01k" + // 0x00750304: 0x0000016B - "\x00U\x03\x06\x00\x00\x01l" + // 0x00550306: 0x0000016C - "\x00u\x03\x06\x00\x00\x01m" + // 0x00750306: 0x0000016D - "\x00U\x03\n\x00\x00\x01n" + // 0x0055030A: 0x0000016E - "\x00u\x03\n\x00\x00\x01o" + // 0x0075030A: 0x0000016F - "\x00U\x03\v\x00\x00\x01p" + // 0x0055030B: 0x00000170 - "\x00u\x03\v\x00\x00\x01q" + // 0x0075030B: 0x00000171 - "\x00U\x03(\x00\x00\x01r" + // 0x00550328: 0x00000172 - "\x00u\x03(\x00\x00\x01s" + // 0x00750328: 0x00000173 - "\x00W\x03\x02\x00\x00\x01t" + // 0x00570302: 0x00000174 - "\x00w\x03\x02\x00\x00\x01u" + // 0x00770302: 0x00000175 - "\x00Y\x03\x02\x00\x00\x01v" + // 0x00590302: 0x00000176 - "\x00y\x03\x02\x00\x00\x01w" + // 0x00790302: 0x00000177 - "\x00Y\x03\b\x00\x00\x01x" + // 0x00590308: 0x00000178 - "\x00Z\x03\x01\x00\x00\x01y" + // 0x005A0301: 0x00000179 - "\x00z\x03\x01\x00\x00\x01z" + // 0x007A0301: 0x0000017A - "\x00Z\x03\a\x00\x00\x01{" + // 0x005A0307: 0x0000017B - "\x00z\x03\a\x00\x00\x01|" + // 0x007A0307: 0x0000017C - "\x00Z\x03\f\x00\x00\x01}" + // 0x005A030C: 0x0000017D - "\x00z\x03\f\x00\x00\x01~" + // 0x007A030C: 0x0000017E - "\x00O\x03\x1b\x00\x00\x01\xa0" + // 0x004F031B: 0x000001A0 - "\x00o\x03\x1b\x00\x00\x01\xa1" + // 0x006F031B: 0x000001A1 - "\x00U\x03\x1b\x00\x00\x01\xaf" + // 0x0055031B: 0x000001AF - "\x00u\x03\x1b\x00\x00\x01\xb0" + // 0x0075031B: 0x000001B0 - "\x00A\x03\f\x00\x00\x01\xcd" + // 0x0041030C: 0x000001CD - "\x00a\x03\f\x00\x00\x01\xce" + // 0x0061030C: 0x000001CE - "\x00I\x03\f\x00\x00\x01\xcf" + // 0x0049030C: 0x000001CF - "\x00i\x03\f\x00\x00\x01\xd0" + // 0x0069030C: 0x000001D0 - "\x00O\x03\f\x00\x00\x01\xd1" + // 0x004F030C: 0x000001D1 - "\x00o\x03\f\x00\x00\x01\xd2" + // 0x006F030C: 0x000001D2 - "\x00U\x03\f\x00\x00\x01\xd3" + // 0x0055030C: 0x000001D3 - "\x00u\x03\f\x00\x00\x01\xd4" + // 0x0075030C: 0x000001D4 - "\x00\xdc\x03\x04\x00\x00\x01\xd5" + // 0x00DC0304: 0x000001D5 - "\x00\xfc\x03\x04\x00\x00\x01\xd6" + // 0x00FC0304: 0x000001D6 - "\x00\xdc\x03\x01\x00\x00\x01\xd7" + // 0x00DC0301: 0x000001D7 - "\x00\xfc\x03\x01\x00\x00\x01\xd8" + // 0x00FC0301: 0x000001D8 - "\x00\xdc\x03\f\x00\x00\x01\xd9" + // 0x00DC030C: 0x000001D9 - "\x00\xfc\x03\f\x00\x00\x01\xda" + // 0x00FC030C: 0x000001DA - "\x00\xdc\x03\x00\x00\x00\x01\xdb" + // 0x00DC0300: 0x000001DB - "\x00\xfc\x03\x00\x00\x00\x01\xdc" + // 0x00FC0300: 0x000001DC - "\x00\xc4\x03\x04\x00\x00\x01\xde" + // 0x00C40304: 0x000001DE - "\x00\xe4\x03\x04\x00\x00\x01\xdf" + // 0x00E40304: 0x000001DF - "\x02&\x03\x04\x00\x00\x01\xe0" + // 0x02260304: 0x000001E0 - "\x02'\x03\x04\x00\x00\x01\xe1" + // 0x02270304: 0x000001E1 - "\x00\xc6\x03\x04\x00\x00\x01\xe2" + // 0x00C60304: 0x000001E2 - "\x00\xe6\x03\x04\x00\x00\x01\xe3" + // 0x00E60304: 0x000001E3 - "\x00G\x03\f\x00\x00\x01\xe6" + // 0x0047030C: 0x000001E6 - "\x00g\x03\f\x00\x00\x01\xe7" + // 0x0067030C: 0x000001E7 - "\x00K\x03\f\x00\x00\x01\xe8" + // 0x004B030C: 0x000001E8 - "\x00k\x03\f\x00\x00\x01\xe9" + // 0x006B030C: 0x000001E9 - "\x00O\x03(\x00\x00\x01\xea" + // 0x004F0328: 0x000001EA - "\x00o\x03(\x00\x00\x01\xeb" + // 0x006F0328: 0x000001EB - "\x01\xea\x03\x04\x00\x00\x01\xec" + // 0x01EA0304: 0x000001EC - "\x01\xeb\x03\x04\x00\x00\x01\xed" + // 0x01EB0304: 0x000001ED - "\x01\xb7\x03\f\x00\x00\x01\xee" + // 0x01B7030C: 0x000001EE - "\x02\x92\x03\f\x00\x00\x01\xef" + // 0x0292030C: 0x000001EF - "\x00j\x03\f\x00\x00\x01\xf0" + // 0x006A030C: 0x000001F0 - "\x00G\x03\x01\x00\x00\x01\xf4" + // 0x00470301: 0x000001F4 - "\x00g\x03\x01\x00\x00\x01\xf5" + // 0x00670301: 0x000001F5 - "\x00N\x03\x00\x00\x00\x01\xf8" + // 0x004E0300: 0x000001F8 - "\x00n\x03\x00\x00\x00\x01\xf9" + // 0x006E0300: 0x000001F9 - "\x00\xc5\x03\x01\x00\x00\x01\xfa" + // 0x00C50301: 0x000001FA - "\x00\xe5\x03\x01\x00\x00\x01\xfb" + // 0x00E50301: 0x000001FB - "\x00\xc6\x03\x01\x00\x00\x01\xfc" + // 0x00C60301: 0x000001FC - "\x00\xe6\x03\x01\x00\x00\x01\xfd" + // 0x00E60301: 0x000001FD - "\x00\xd8\x03\x01\x00\x00\x01\xfe" + // 0x00D80301: 0x000001FE - "\x00\xf8\x03\x01\x00\x00\x01\xff" + // 0x00F80301: 0x000001FF - "\x00A\x03\x0f\x00\x00\x02\x00" + // 0x0041030F: 0x00000200 - "\x00a\x03\x0f\x00\x00\x02\x01" + // 0x0061030F: 0x00000201 - "\x00A\x03\x11\x00\x00\x02\x02" + // 0x00410311: 0x00000202 - "\x00a\x03\x11\x00\x00\x02\x03" + // 0x00610311: 0x00000203 - "\x00E\x03\x0f\x00\x00\x02\x04" + // 0x0045030F: 0x00000204 - "\x00e\x03\x0f\x00\x00\x02\x05" + // 0x0065030F: 0x00000205 - "\x00E\x03\x11\x00\x00\x02\x06" + // 0x00450311: 0x00000206 - "\x00e\x03\x11\x00\x00\x02\a" + // 0x00650311: 0x00000207 - "\x00I\x03\x0f\x00\x00\x02\b" + // 0x0049030F: 0x00000208 - "\x00i\x03\x0f\x00\x00\x02\t" + // 0x0069030F: 0x00000209 - "\x00I\x03\x11\x00\x00\x02\n" + // 0x00490311: 0x0000020A - "\x00i\x03\x11\x00\x00\x02\v" + // 0x00690311: 0x0000020B - "\x00O\x03\x0f\x00\x00\x02\f" + // 0x004F030F: 0x0000020C - "\x00o\x03\x0f\x00\x00\x02\r" + // 0x006F030F: 0x0000020D - "\x00O\x03\x11\x00\x00\x02\x0e" + // 0x004F0311: 0x0000020E - "\x00o\x03\x11\x00\x00\x02\x0f" + // 0x006F0311: 0x0000020F - "\x00R\x03\x0f\x00\x00\x02\x10" + // 0x0052030F: 0x00000210 - "\x00r\x03\x0f\x00\x00\x02\x11" + // 0x0072030F: 0x00000211 - "\x00R\x03\x11\x00\x00\x02\x12" + // 0x00520311: 0x00000212 - "\x00r\x03\x11\x00\x00\x02\x13" + // 0x00720311: 0x00000213 - "\x00U\x03\x0f\x00\x00\x02\x14" + // 0x0055030F: 0x00000214 - "\x00u\x03\x0f\x00\x00\x02\x15" + // 0x0075030F: 0x00000215 - "\x00U\x03\x11\x00\x00\x02\x16" + // 0x00550311: 0x00000216 - "\x00u\x03\x11\x00\x00\x02\x17" + // 0x00750311: 0x00000217 - "\x00S\x03&\x00\x00\x02\x18" + // 0x00530326: 0x00000218 - "\x00s\x03&\x00\x00\x02\x19" + // 0x00730326: 0x00000219 - "\x00T\x03&\x00\x00\x02\x1a" + // 0x00540326: 0x0000021A - "\x00t\x03&\x00\x00\x02\x1b" + // 0x00740326: 0x0000021B - "\x00H\x03\f\x00\x00\x02\x1e" + // 0x0048030C: 0x0000021E - "\x00h\x03\f\x00\x00\x02\x1f" + // 0x0068030C: 0x0000021F - "\x00A\x03\a\x00\x00\x02&" + // 0x00410307: 0x00000226 - "\x00a\x03\a\x00\x00\x02'" + // 0x00610307: 0x00000227 - "\x00E\x03'\x00\x00\x02(" + // 0x00450327: 0x00000228 - "\x00e\x03'\x00\x00\x02)" + // 0x00650327: 0x00000229 - "\x00\xd6\x03\x04\x00\x00\x02*" + // 0x00D60304: 0x0000022A - "\x00\xf6\x03\x04\x00\x00\x02+" + // 0x00F60304: 0x0000022B - "\x00\xd5\x03\x04\x00\x00\x02," + // 0x00D50304: 0x0000022C - "\x00\xf5\x03\x04\x00\x00\x02-" + // 0x00F50304: 0x0000022D - "\x00O\x03\a\x00\x00\x02." + // 0x004F0307: 0x0000022E - "\x00o\x03\a\x00\x00\x02/" + // 0x006F0307: 0x0000022F - "\x02.\x03\x04\x00\x00\x020" + // 0x022E0304: 0x00000230 - "\x02/\x03\x04\x00\x00\x021" + // 0x022F0304: 0x00000231 - "\x00Y\x03\x04\x00\x00\x022" + // 0x00590304: 0x00000232 - "\x00y\x03\x04\x00\x00\x023" + // 0x00790304: 0x00000233 - "\x00\xa8\x03\x01\x00\x00\x03\x85" + // 0x00A80301: 0x00000385 - "\x03\x91\x03\x01\x00\x00\x03\x86" + // 0x03910301: 0x00000386 - "\x03\x95\x03\x01\x00\x00\x03\x88" + // 0x03950301: 0x00000388 - "\x03\x97\x03\x01\x00\x00\x03\x89" + // 0x03970301: 0x00000389 - "\x03\x99\x03\x01\x00\x00\x03\x8a" + // 0x03990301: 0x0000038A - "\x03\x9f\x03\x01\x00\x00\x03\x8c" + // 0x039F0301: 0x0000038C - "\x03\xa5\x03\x01\x00\x00\x03\x8e" + // 0x03A50301: 0x0000038E - "\x03\xa9\x03\x01\x00\x00\x03\x8f" + // 0x03A90301: 0x0000038F - "\x03\xca\x03\x01\x00\x00\x03\x90" + // 0x03CA0301: 0x00000390 - "\x03\x99\x03\b\x00\x00\x03\xaa" + // 0x03990308: 0x000003AA - "\x03\xa5\x03\b\x00\x00\x03\xab" + // 0x03A50308: 0x000003AB - "\x03\xb1\x03\x01\x00\x00\x03\xac" + // 0x03B10301: 0x000003AC - "\x03\xb5\x03\x01\x00\x00\x03\xad" + // 0x03B50301: 0x000003AD - "\x03\xb7\x03\x01\x00\x00\x03\xae" + // 0x03B70301: 0x000003AE - "\x03\xb9\x03\x01\x00\x00\x03\xaf" + // 0x03B90301: 0x000003AF - "\x03\xcb\x03\x01\x00\x00\x03\xb0" + // 0x03CB0301: 0x000003B0 - "\x03\xb9\x03\b\x00\x00\x03\xca" + // 0x03B90308: 0x000003CA - "\x03\xc5\x03\b\x00\x00\x03\xcb" + // 0x03C50308: 0x000003CB - "\x03\xbf\x03\x01\x00\x00\x03\xcc" + // 0x03BF0301: 0x000003CC - "\x03\xc5\x03\x01\x00\x00\x03\xcd" + // 0x03C50301: 0x000003CD - "\x03\xc9\x03\x01\x00\x00\x03\xce" + // 0x03C90301: 0x000003CE - "\x03\xd2\x03\x01\x00\x00\x03\xd3" + // 0x03D20301: 0x000003D3 - "\x03\xd2\x03\b\x00\x00\x03\xd4" + // 0x03D20308: 0x000003D4 - "\x04\x15\x03\x00\x00\x00\x04\x00" + // 0x04150300: 0x00000400 - "\x04\x15\x03\b\x00\x00\x04\x01" + // 0x04150308: 0x00000401 - "\x04\x13\x03\x01\x00\x00\x04\x03" + // 0x04130301: 0x00000403 - "\x04\x06\x03\b\x00\x00\x04\a" + // 0x04060308: 0x00000407 - "\x04\x1a\x03\x01\x00\x00\x04\f" + // 0x041A0301: 0x0000040C - "\x04\x18\x03\x00\x00\x00\x04\r" + // 0x04180300: 0x0000040D - "\x04#\x03\x06\x00\x00\x04\x0e" + // 0x04230306: 0x0000040E - "\x04\x18\x03\x06\x00\x00\x04\x19" + // 0x04180306: 0x00000419 - "\x048\x03\x06\x00\x00\x049" + // 0x04380306: 0x00000439 - "\x045\x03\x00\x00\x00\x04P" + // 0x04350300: 0x00000450 - "\x045\x03\b\x00\x00\x04Q" + // 0x04350308: 0x00000451 - "\x043\x03\x01\x00\x00\x04S" + // 0x04330301: 0x00000453 - "\x04V\x03\b\x00\x00\x04W" + // 0x04560308: 0x00000457 - "\x04:\x03\x01\x00\x00\x04\\" + // 0x043A0301: 0x0000045C - "\x048\x03\x00\x00\x00\x04]" + // 0x04380300: 0x0000045D - "\x04C\x03\x06\x00\x00\x04^" + // 0x04430306: 0x0000045E - "\x04t\x03\x0f\x00\x00\x04v" + // 0x0474030F: 0x00000476 - "\x04u\x03\x0f\x00\x00\x04w" + // 0x0475030F: 0x00000477 - "\x04\x16\x03\x06\x00\x00\x04\xc1" + // 0x04160306: 0x000004C1 - "\x046\x03\x06\x00\x00\x04\xc2" + // 0x04360306: 0x000004C2 - "\x04\x10\x03\x06\x00\x00\x04\xd0" + // 0x04100306: 0x000004D0 - "\x040\x03\x06\x00\x00\x04\xd1" + // 0x04300306: 0x000004D1 - "\x04\x10\x03\b\x00\x00\x04\xd2" + // 0x04100308: 0x000004D2 - "\x040\x03\b\x00\x00\x04\xd3" + // 0x04300308: 0x000004D3 - "\x04\x15\x03\x06\x00\x00\x04\xd6" + // 0x04150306: 0x000004D6 - "\x045\x03\x06\x00\x00\x04\xd7" + // 0x04350306: 0x000004D7 - "\x04\xd8\x03\b\x00\x00\x04\xda" + // 0x04D80308: 0x000004DA - "\x04\xd9\x03\b\x00\x00\x04\xdb" + // 0x04D90308: 0x000004DB - "\x04\x16\x03\b\x00\x00\x04\xdc" + // 0x04160308: 0x000004DC - "\x046\x03\b\x00\x00\x04\xdd" + // 0x04360308: 0x000004DD - "\x04\x17\x03\b\x00\x00\x04\xde" + // 0x04170308: 0x000004DE - "\x047\x03\b\x00\x00\x04\xdf" + // 0x04370308: 0x000004DF - "\x04\x18\x03\x04\x00\x00\x04\xe2" + // 0x04180304: 0x000004E2 - "\x048\x03\x04\x00\x00\x04\xe3" + // 0x04380304: 0x000004E3 - "\x04\x18\x03\b\x00\x00\x04\xe4" + // 0x04180308: 0x000004E4 - "\x048\x03\b\x00\x00\x04\xe5" + // 0x04380308: 0x000004E5 - "\x04\x1e\x03\b\x00\x00\x04\xe6" + // 0x041E0308: 0x000004E6 - "\x04>\x03\b\x00\x00\x04\xe7" + // 0x043E0308: 0x000004E7 - "\x04\xe8\x03\b\x00\x00\x04\xea" + // 0x04E80308: 0x000004EA - "\x04\xe9\x03\b\x00\x00\x04\xeb" + // 0x04E90308: 0x000004EB - "\x04-\x03\b\x00\x00\x04\xec" + // 0x042D0308: 0x000004EC - "\x04M\x03\b\x00\x00\x04\xed" + // 0x044D0308: 0x000004ED - "\x04#\x03\x04\x00\x00\x04\xee" + // 0x04230304: 0x000004EE - "\x04C\x03\x04\x00\x00\x04\xef" + // 0x04430304: 0x000004EF - "\x04#\x03\b\x00\x00\x04\xf0" + // 0x04230308: 0x000004F0 - "\x04C\x03\b\x00\x00\x04\xf1" + // 0x04430308: 0x000004F1 - "\x04#\x03\v\x00\x00\x04\xf2" + // 0x0423030B: 0x000004F2 - "\x04C\x03\v\x00\x00\x04\xf3" + // 0x0443030B: 0x000004F3 - "\x04'\x03\b\x00\x00\x04\xf4" + // 0x04270308: 0x000004F4 - "\x04G\x03\b\x00\x00\x04\xf5" + // 0x04470308: 0x000004F5 - "\x04+\x03\b\x00\x00\x04\xf8" + // 0x042B0308: 0x000004F8 - "\x04K\x03\b\x00\x00\x04\xf9" + // 0x044B0308: 0x000004F9 - "\x06'\x06S\x00\x00\x06\"" + // 0x06270653: 0x00000622 - "\x06'\x06T\x00\x00\x06#" + // 0x06270654: 0x00000623 - "\x06H\x06T\x00\x00\x06$" + // 0x06480654: 0x00000624 - "\x06'\x06U\x00\x00\x06%" + // 0x06270655: 0x00000625 - "\x06J\x06T\x00\x00\x06&" + // 0x064A0654: 0x00000626 - "\x06\xd5\x06T\x00\x00\x06\xc0" + // 0x06D50654: 0x000006C0 - "\x06\xc1\x06T\x00\x00\x06\xc2" + // 0x06C10654: 0x000006C2 - "\x06\xd2\x06T\x00\x00\x06\xd3" + // 0x06D20654: 0x000006D3 - "\t(\t<\x00\x00\t)" + // 0x0928093C: 0x00000929 - "\t0\t<\x00\x00\t1" + // 0x0930093C: 0x00000931 - "\t3\t<\x00\x00\t4" + // 0x0933093C: 0x00000934 - "\t\xc7\t\xbe\x00\x00\t\xcb" + // 0x09C709BE: 0x000009CB - "\t\xc7\t\xd7\x00\x00\t\xcc" + // 0x09C709D7: 0x000009CC - "\vG\vV\x00\x00\vH" + // 0x0B470B56: 0x00000B48 - "\vG\v>\x00\x00\vK" + // 0x0B470B3E: 0x00000B4B - "\vG\vW\x00\x00\vL" + // 0x0B470B57: 0x00000B4C - "\v\x92\v\xd7\x00\x00\v\x94" + // 0x0B920BD7: 0x00000B94 - "\v\xc6\v\xbe\x00\x00\v\xca" + // 0x0BC60BBE: 0x00000BCA - "\v\xc7\v\xbe\x00\x00\v\xcb" + // 0x0BC70BBE: 0x00000BCB - "\v\xc6\v\xd7\x00\x00\v\xcc" + // 0x0BC60BD7: 0x00000BCC - "\fF\fV\x00\x00\fH" + // 0x0C460C56: 0x00000C48 - "\f\xbf\f\xd5\x00\x00\f\xc0" + // 0x0CBF0CD5: 0x00000CC0 - "\f\xc6\f\xd5\x00\x00\f\xc7" + // 0x0CC60CD5: 0x00000CC7 - "\f\xc6\f\xd6\x00\x00\f\xc8" + // 0x0CC60CD6: 0x00000CC8 - "\f\xc6\f\xc2\x00\x00\f\xca" + // 0x0CC60CC2: 0x00000CCA - "\f\xca\f\xd5\x00\x00\f\xcb" + // 0x0CCA0CD5: 0x00000CCB - "\rF\r>\x00\x00\rJ" + // 0x0D460D3E: 0x00000D4A - "\rG\r>\x00\x00\rK" + // 0x0D470D3E: 0x00000D4B - "\rF\rW\x00\x00\rL" + // 0x0D460D57: 0x00000D4C - "\r\xd9\r\xca\x00\x00\r\xda" + // 0x0DD90DCA: 0x00000DDA - "\r\xd9\r\xcf\x00\x00\r\xdc" + // 0x0DD90DCF: 0x00000DDC - "\r\xdc\r\xca\x00\x00\r\xdd" + // 0x0DDC0DCA: 0x00000DDD - "\r\xd9\r\xdf\x00\x00\r\xde" + // 0x0DD90DDF: 0x00000DDE - "\x10%\x10.\x00\x00\x10&" + // 0x1025102E: 0x00001026 - "\x1b\x05\x1b5\x00\x00\x1b\x06" + // 0x1B051B35: 0x00001B06 - "\x1b\a\x1b5\x00\x00\x1b\b" + // 0x1B071B35: 0x00001B08 - "\x1b\t\x1b5\x00\x00\x1b\n" + // 0x1B091B35: 0x00001B0A - "\x1b\v\x1b5\x00\x00\x1b\f" + // 0x1B0B1B35: 0x00001B0C - "\x1b\r\x1b5\x00\x00\x1b\x0e" + // 0x1B0D1B35: 0x00001B0E - "\x1b\x11\x1b5\x00\x00\x1b\x12" + // 0x1B111B35: 0x00001B12 - "\x1b:\x1b5\x00\x00\x1b;" + // 0x1B3A1B35: 0x00001B3B - "\x1b<\x1b5\x00\x00\x1b=" + // 0x1B3C1B35: 0x00001B3D - "\x1b>\x1b5\x00\x00\x1b@" + // 0x1B3E1B35: 0x00001B40 - "\x1b?\x1b5\x00\x00\x1bA" + // 0x1B3F1B35: 0x00001B41 - "\x1bB\x1b5\x00\x00\x1bC" + // 0x1B421B35: 0x00001B43 - "\x00A\x03%\x00\x00\x1e\x00" + // 0x00410325: 0x00001E00 - "\x00a\x03%\x00\x00\x1e\x01" + // 0x00610325: 0x00001E01 - "\x00B\x03\a\x00\x00\x1e\x02" + // 0x00420307: 0x00001E02 - "\x00b\x03\a\x00\x00\x1e\x03" + // 0x00620307: 0x00001E03 - "\x00B\x03#\x00\x00\x1e\x04" + // 0x00420323: 0x00001E04 - "\x00b\x03#\x00\x00\x1e\x05" + // 0x00620323: 0x00001E05 - "\x00B\x031\x00\x00\x1e\x06" + // 0x00420331: 0x00001E06 - "\x00b\x031\x00\x00\x1e\a" + // 0x00620331: 0x00001E07 - "\x00\xc7\x03\x01\x00\x00\x1e\b" + // 0x00C70301: 0x00001E08 - "\x00\xe7\x03\x01\x00\x00\x1e\t" + // 0x00E70301: 0x00001E09 - "\x00D\x03\a\x00\x00\x1e\n" + // 0x00440307: 0x00001E0A - "\x00d\x03\a\x00\x00\x1e\v" + // 0x00640307: 0x00001E0B - "\x00D\x03#\x00\x00\x1e\f" + // 0x00440323: 0x00001E0C - "\x00d\x03#\x00\x00\x1e\r" + // 0x00640323: 0x00001E0D - "\x00D\x031\x00\x00\x1e\x0e" + // 0x00440331: 0x00001E0E - "\x00d\x031\x00\x00\x1e\x0f" + // 0x00640331: 0x00001E0F - "\x00D\x03'\x00\x00\x1e\x10" + // 0x00440327: 0x00001E10 - "\x00d\x03'\x00\x00\x1e\x11" + // 0x00640327: 0x00001E11 - "\x00D\x03-\x00\x00\x1e\x12" + // 0x0044032D: 0x00001E12 - "\x00d\x03-\x00\x00\x1e\x13" + // 0x0064032D: 0x00001E13 - "\x01\x12\x03\x00\x00\x00\x1e\x14" + // 0x01120300: 0x00001E14 - "\x01\x13\x03\x00\x00\x00\x1e\x15" + // 0x01130300: 0x00001E15 - "\x01\x12\x03\x01\x00\x00\x1e\x16" + // 0x01120301: 0x00001E16 - "\x01\x13\x03\x01\x00\x00\x1e\x17" + // 0x01130301: 0x00001E17 - "\x00E\x03-\x00\x00\x1e\x18" + // 0x0045032D: 0x00001E18 - "\x00e\x03-\x00\x00\x1e\x19" + // 0x0065032D: 0x00001E19 - "\x00E\x030\x00\x00\x1e\x1a" + // 0x00450330: 0x00001E1A - "\x00e\x030\x00\x00\x1e\x1b" + // 0x00650330: 0x00001E1B - "\x02(\x03\x06\x00\x00\x1e\x1c" + // 0x02280306: 0x00001E1C - "\x02)\x03\x06\x00\x00\x1e\x1d" + // 0x02290306: 0x00001E1D - "\x00F\x03\a\x00\x00\x1e\x1e" + // 0x00460307: 0x00001E1E - "\x00f\x03\a\x00\x00\x1e\x1f" + // 0x00660307: 0x00001E1F - "\x00G\x03\x04\x00\x00\x1e " + // 0x00470304: 0x00001E20 - "\x00g\x03\x04\x00\x00\x1e!" + // 0x00670304: 0x00001E21 - "\x00H\x03\a\x00\x00\x1e\"" + // 0x00480307: 0x00001E22 - "\x00h\x03\a\x00\x00\x1e#" + // 0x00680307: 0x00001E23 - "\x00H\x03#\x00\x00\x1e$" + // 0x00480323: 0x00001E24 - "\x00h\x03#\x00\x00\x1e%" + // 0x00680323: 0x00001E25 - "\x00H\x03\b\x00\x00\x1e&" + // 0x00480308: 0x00001E26 - "\x00h\x03\b\x00\x00\x1e'" + // 0x00680308: 0x00001E27 - "\x00H\x03'\x00\x00\x1e(" + // 0x00480327: 0x00001E28 - "\x00h\x03'\x00\x00\x1e)" + // 0x00680327: 0x00001E29 - "\x00H\x03.\x00\x00\x1e*" + // 0x0048032E: 0x00001E2A - "\x00h\x03.\x00\x00\x1e+" + // 0x0068032E: 0x00001E2B - "\x00I\x030\x00\x00\x1e," + // 0x00490330: 0x00001E2C - "\x00i\x030\x00\x00\x1e-" + // 0x00690330: 0x00001E2D - "\x00\xcf\x03\x01\x00\x00\x1e." + // 0x00CF0301: 0x00001E2E - "\x00\xef\x03\x01\x00\x00\x1e/" + // 0x00EF0301: 0x00001E2F - "\x00K\x03\x01\x00\x00\x1e0" + // 0x004B0301: 0x00001E30 - "\x00k\x03\x01\x00\x00\x1e1" + // 0x006B0301: 0x00001E31 - "\x00K\x03#\x00\x00\x1e2" + // 0x004B0323: 0x00001E32 - "\x00k\x03#\x00\x00\x1e3" + // 0x006B0323: 0x00001E33 - "\x00K\x031\x00\x00\x1e4" + // 0x004B0331: 0x00001E34 - "\x00k\x031\x00\x00\x1e5" + // 0x006B0331: 0x00001E35 - "\x00L\x03#\x00\x00\x1e6" + // 0x004C0323: 0x00001E36 - "\x00l\x03#\x00\x00\x1e7" + // 0x006C0323: 0x00001E37 - "\x1e6\x03\x04\x00\x00\x1e8" + // 0x1E360304: 0x00001E38 - "\x1e7\x03\x04\x00\x00\x1e9" + // 0x1E370304: 0x00001E39 - "\x00L\x031\x00\x00\x1e:" + // 0x004C0331: 0x00001E3A - "\x00l\x031\x00\x00\x1e;" + // 0x006C0331: 0x00001E3B - "\x00L\x03-\x00\x00\x1e<" + // 0x004C032D: 0x00001E3C - "\x00l\x03-\x00\x00\x1e=" + // 0x006C032D: 0x00001E3D - "\x00M\x03\x01\x00\x00\x1e>" + // 0x004D0301: 0x00001E3E - "\x00m\x03\x01\x00\x00\x1e?" + // 0x006D0301: 0x00001E3F - "\x00M\x03\a\x00\x00\x1e@" + // 0x004D0307: 0x00001E40 - "\x00m\x03\a\x00\x00\x1eA" + // 0x006D0307: 0x00001E41 - "\x00M\x03#\x00\x00\x1eB" + // 0x004D0323: 0x00001E42 - "\x00m\x03#\x00\x00\x1eC" + // 0x006D0323: 0x00001E43 - "\x00N\x03\a\x00\x00\x1eD" + // 0x004E0307: 0x00001E44 - "\x00n\x03\a\x00\x00\x1eE" + // 0x006E0307: 0x00001E45 - "\x00N\x03#\x00\x00\x1eF" + // 0x004E0323: 0x00001E46 - "\x00n\x03#\x00\x00\x1eG" + // 0x006E0323: 0x00001E47 - "\x00N\x031\x00\x00\x1eH" + // 0x004E0331: 0x00001E48 - "\x00n\x031\x00\x00\x1eI" + // 0x006E0331: 0x00001E49 - "\x00N\x03-\x00\x00\x1eJ" + // 0x004E032D: 0x00001E4A - "\x00n\x03-\x00\x00\x1eK" + // 0x006E032D: 0x00001E4B - "\x00\xd5\x03\x01\x00\x00\x1eL" + // 0x00D50301: 0x00001E4C - "\x00\xf5\x03\x01\x00\x00\x1eM" + // 0x00F50301: 0x00001E4D - "\x00\xd5\x03\b\x00\x00\x1eN" + // 0x00D50308: 0x00001E4E - "\x00\xf5\x03\b\x00\x00\x1eO" + // 0x00F50308: 0x00001E4F - "\x01L\x03\x00\x00\x00\x1eP" + // 0x014C0300: 0x00001E50 - "\x01M\x03\x00\x00\x00\x1eQ" + // 0x014D0300: 0x00001E51 - "\x01L\x03\x01\x00\x00\x1eR" + // 0x014C0301: 0x00001E52 - "\x01M\x03\x01\x00\x00\x1eS" + // 0x014D0301: 0x00001E53 - "\x00P\x03\x01\x00\x00\x1eT" + // 0x00500301: 0x00001E54 - "\x00p\x03\x01\x00\x00\x1eU" + // 0x00700301: 0x00001E55 - "\x00P\x03\a\x00\x00\x1eV" + // 0x00500307: 0x00001E56 - "\x00p\x03\a\x00\x00\x1eW" + // 0x00700307: 0x00001E57 - "\x00R\x03\a\x00\x00\x1eX" + // 0x00520307: 0x00001E58 - "\x00r\x03\a\x00\x00\x1eY" + // 0x00720307: 0x00001E59 - "\x00R\x03#\x00\x00\x1eZ" + // 0x00520323: 0x00001E5A - "\x00r\x03#\x00\x00\x1e[" + // 0x00720323: 0x00001E5B - "\x1eZ\x03\x04\x00\x00\x1e\\" + // 0x1E5A0304: 0x00001E5C - "\x1e[\x03\x04\x00\x00\x1e]" + // 0x1E5B0304: 0x00001E5D - "\x00R\x031\x00\x00\x1e^" + // 0x00520331: 0x00001E5E - "\x00r\x031\x00\x00\x1e_" + // 0x00720331: 0x00001E5F - "\x00S\x03\a\x00\x00\x1e`" + // 0x00530307: 0x00001E60 - "\x00s\x03\a\x00\x00\x1ea" + // 0x00730307: 0x00001E61 - "\x00S\x03#\x00\x00\x1eb" + // 0x00530323: 0x00001E62 - "\x00s\x03#\x00\x00\x1ec" + // 0x00730323: 0x00001E63 - "\x01Z\x03\a\x00\x00\x1ed" + // 0x015A0307: 0x00001E64 - "\x01[\x03\a\x00\x00\x1ee" + // 0x015B0307: 0x00001E65 - "\x01`\x03\a\x00\x00\x1ef" + // 0x01600307: 0x00001E66 - "\x01a\x03\a\x00\x00\x1eg" + // 0x01610307: 0x00001E67 - "\x1eb\x03\a\x00\x00\x1eh" + // 0x1E620307: 0x00001E68 - "\x1ec\x03\a\x00\x00\x1ei" + // 0x1E630307: 0x00001E69 - "\x00T\x03\a\x00\x00\x1ej" + // 0x00540307: 0x00001E6A - "\x00t\x03\a\x00\x00\x1ek" + // 0x00740307: 0x00001E6B - "\x00T\x03#\x00\x00\x1el" + // 0x00540323: 0x00001E6C - "\x00t\x03#\x00\x00\x1em" + // 0x00740323: 0x00001E6D - "\x00T\x031\x00\x00\x1en" + // 0x00540331: 0x00001E6E - "\x00t\x031\x00\x00\x1eo" + // 0x00740331: 0x00001E6F - "\x00T\x03-\x00\x00\x1ep" + // 0x0054032D: 0x00001E70 - "\x00t\x03-\x00\x00\x1eq" + // 0x0074032D: 0x00001E71 - "\x00U\x03$\x00\x00\x1er" + // 0x00550324: 0x00001E72 - "\x00u\x03$\x00\x00\x1es" + // 0x00750324: 0x00001E73 - "\x00U\x030\x00\x00\x1et" + // 0x00550330: 0x00001E74 - "\x00u\x030\x00\x00\x1eu" + // 0x00750330: 0x00001E75 - "\x00U\x03-\x00\x00\x1ev" + // 0x0055032D: 0x00001E76 - "\x00u\x03-\x00\x00\x1ew" + // 0x0075032D: 0x00001E77 - "\x01h\x03\x01\x00\x00\x1ex" + // 0x01680301: 0x00001E78 - "\x01i\x03\x01\x00\x00\x1ey" + // 0x01690301: 0x00001E79 - "\x01j\x03\b\x00\x00\x1ez" + // 0x016A0308: 0x00001E7A - "\x01k\x03\b\x00\x00\x1e{" + // 0x016B0308: 0x00001E7B - "\x00V\x03\x03\x00\x00\x1e|" + // 0x00560303: 0x00001E7C - "\x00v\x03\x03\x00\x00\x1e}" + // 0x00760303: 0x00001E7D - "\x00V\x03#\x00\x00\x1e~" + // 0x00560323: 0x00001E7E - "\x00v\x03#\x00\x00\x1e\x7f" + // 0x00760323: 0x00001E7F - "\x00W\x03\x00\x00\x00\x1e\x80" + // 0x00570300: 0x00001E80 - "\x00w\x03\x00\x00\x00\x1e\x81" + // 0x00770300: 0x00001E81 - "\x00W\x03\x01\x00\x00\x1e\x82" + // 0x00570301: 0x00001E82 - "\x00w\x03\x01\x00\x00\x1e\x83" + // 0x00770301: 0x00001E83 - "\x00W\x03\b\x00\x00\x1e\x84" + // 0x00570308: 0x00001E84 - "\x00w\x03\b\x00\x00\x1e\x85" + // 0x00770308: 0x00001E85 - "\x00W\x03\a\x00\x00\x1e\x86" + // 0x00570307: 0x00001E86 - "\x00w\x03\a\x00\x00\x1e\x87" + // 0x00770307: 0x00001E87 - "\x00W\x03#\x00\x00\x1e\x88" + // 0x00570323: 0x00001E88 - "\x00w\x03#\x00\x00\x1e\x89" + // 0x00770323: 0x00001E89 - "\x00X\x03\a\x00\x00\x1e\x8a" + // 0x00580307: 0x00001E8A - "\x00x\x03\a\x00\x00\x1e\x8b" + // 0x00780307: 0x00001E8B - "\x00X\x03\b\x00\x00\x1e\x8c" + // 0x00580308: 0x00001E8C - "\x00x\x03\b\x00\x00\x1e\x8d" + // 0x00780308: 0x00001E8D - "\x00Y\x03\a\x00\x00\x1e\x8e" + // 0x00590307: 0x00001E8E - "\x00y\x03\a\x00\x00\x1e\x8f" + // 0x00790307: 0x00001E8F - "\x00Z\x03\x02\x00\x00\x1e\x90" + // 0x005A0302: 0x00001E90 - "\x00z\x03\x02\x00\x00\x1e\x91" + // 0x007A0302: 0x00001E91 - "\x00Z\x03#\x00\x00\x1e\x92" + // 0x005A0323: 0x00001E92 - "\x00z\x03#\x00\x00\x1e\x93" + // 0x007A0323: 0x00001E93 - "\x00Z\x031\x00\x00\x1e\x94" + // 0x005A0331: 0x00001E94 - "\x00z\x031\x00\x00\x1e\x95" + // 0x007A0331: 0x00001E95 - "\x00h\x031\x00\x00\x1e\x96" + // 0x00680331: 0x00001E96 - "\x00t\x03\b\x00\x00\x1e\x97" + // 0x00740308: 0x00001E97 - "\x00w\x03\n\x00\x00\x1e\x98" + // 0x0077030A: 0x00001E98 - "\x00y\x03\n\x00\x00\x1e\x99" + // 0x0079030A: 0x00001E99 - "\x01\x7f\x03\a\x00\x00\x1e\x9b" + // 0x017F0307: 0x00001E9B - "\x00A\x03#\x00\x00\x1e\xa0" + // 0x00410323: 0x00001EA0 - "\x00a\x03#\x00\x00\x1e\xa1" + // 0x00610323: 0x00001EA1 - "\x00A\x03\t\x00\x00\x1e\xa2" + // 0x00410309: 0x00001EA2 - "\x00a\x03\t\x00\x00\x1e\xa3" + // 0x00610309: 0x00001EA3 - "\x00\xc2\x03\x01\x00\x00\x1e\xa4" + // 0x00C20301: 0x00001EA4 - "\x00\xe2\x03\x01\x00\x00\x1e\xa5" + // 0x00E20301: 0x00001EA5 - "\x00\xc2\x03\x00\x00\x00\x1e\xa6" + // 0x00C20300: 0x00001EA6 - "\x00\xe2\x03\x00\x00\x00\x1e\xa7" + // 0x00E20300: 0x00001EA7 - "\x00\xc2\x03\t\x00\x00\x1e\xa8" + // 0x00C20309: 0x00001EA8 - "\x00\xe2\x03\t\x00\x00\x1e\xa9" + // 0x00E20309: 0x00001EA9 - "\x00\xc2\x03\x03\x00\x00\x1e\xaa" + // 0x00C20303: 0x00001EAA - "\x00\xe2\x03\x03\x00\x00\x1e\xab" + // 0x00E20303: 0x00001EAB - "\x1e\xa0\x03\x02\x00\x00\x1e\xac" + // 0x1EA00302: 0x00001EAC - "\x1e\xa1\x03\x02\x00\x00\x1e\xad" + // 0x1EA10302: 0x00001EAD - "\x01\x02\x03\x01\x00\x00\x1e\xae" + // 0x01020301: 0x00001EAE - "\x01\x03\x03\x01\x00\x00\x1e\xaf" + // 0x01030301: 0x00001EAF - "\x01\x02\x03\x00\x00\x00\x1e\xb0" + // 0x01020300: 0x00001EB0 - "\x01\x03\x03\x00\x00\x00\x1e\xb1" + // 0x01030300: 0x00001EB1 - "\x01\x02\x03\t\x00\x00\x1e\xb2" + // 0x01020309: 0x00001EB2 - "\x01\x03\x03\t\x00\x00\x1e\xb3" + // 0x01030309: 0x00001EB3 - "\x01\x02\x03\x03\x00\x00\x1e\xb4" + // 0x01020303: 0x00001EB4 - "\x01\x03\x03\x03\x00\x00\x1e\xb5" + // 0x01030303: 0x00001EB5 - "\x1e\xa0\x03\x06\x00\x00\x1e\xb6" + // 0x1EA00306: 0x00001EB6 - "\x1e\xa1\x03\x06\x00\x00\x1e\xb7" + // 0x1EA10306: 0x00001EB7 - "\x00E\x03#\x00\x00\x1e\xb8" + // 0x00450323: 0x00001EB8 - "\x00e\x03#\x00\x00\x1e\xb9" + // 0x00650323: 0x00001EB9 - "\x00E\x03\t\x00\x00\x1e\xba" + // 0x00450309: 0x00001EBA - "\x00e\x03\t\x00\x00\x1e\xbb" + // 0x00650309: 0x00001EBB - "\x00E\x03\x03\x00\x00\x1e\xbc" + // 0x00450303: 0x00001EBC - "\x00e\x03\x03\x00\x00\x1e\xbd" + // 0x00650303: 0x00001EBD - "\x00\xca\x03\x01\x00\x00\x1e\xbe" + // 0x00CA0301: 0x00001EBE - "\x00\xea\x03\x01\x00\x00\x1e\xbf" + // 0x00EA0301: 0x00001EBF - "\x00\xca\x03\x00\x00\x00\x1e\xc0" + // 0x00CA0300: 0x00001EC0 - "\x00\xea\x03\x00\x00\x00\x1e\xc1" + // 0x00EA0300: 0x00001EC1 - "\x00\xca\x03\t\x00\x00\x1e\xc2" + // 0x00CA0309: 0x00001EC2 - "\x00\xea\x03\t\x00\x00\x1e\xc3" + // 0x00EA0309: 0x00001EC3 - "\x00\xca\x03\x03\x00\x00\x1e\xc4" + // 0x00CA0303: 0x00001EC4 - "\x00\xea\x03\x03\x00\x00\x1e\xc5" + // 0x00EA0303: 0x00001EC5 - "\x1e\xb8\x03\x02\x00\x00\x1e\xc6" + // 0x1EB80302: 0x00001EC6 - "\x1e\xb9\x03\x02\x00\x00\x1e\xc7" + // 0x1EB90302: 0x00001EC7 - "\x00I\x03\t\x00\x00\x1e\xc8" + // 0x00490309: 0x00001EC8 - "\x00i\x03\t\x00\x00\x1e\xc9" + // 0x00690309: 0x00001EC9 - "\x00I\x03#\x00\x00\x1e\xca" + // 0x00490323: 0x00001ECA - "\x00i\x03#\x00\x00\x1e\xcb" + // 0x00690323: 0x00001ECB - "\x00O\x03#\x00\x00\x1e\xcc" + // 0x004F0323: 0x00001ECC - "\x00o\x03#\x00\x00\x1e\xcd" + // 0x006F0323: 0x00001ECD - "\x00O\x03\t\x00\x00\x1e\xce" + // 0x004F0309: 0x00001ECE - "\x00o\x03\t\x00\x00\x1e\xcf" + // 0x006F0309: 0x00001ECF - "\x00\xd4\x03\x01\x00\x00\x1e\xd0" + // 0x00D40301: 0x00001ED0 - "\x00\xf4\x03\x01\x00\x00\x1e\xd1" + // 0x00F40301: 0x00001ED1 - "\x00\xd4\x03\x00\x00\x00\x1e\xd2" + // 0x00D40300: 0x00001ED2 - "\x00\xf4\x03\x00\x00\x00\x1e\xd3" + // 0x00F40300: 0x00001ED3 - "\x00\xd4\x03\t\x00\x00\x1e\xd4" + // 0x00D40309: 0x00001ED4 - "\x00\xf4\x03\t\x00\x00\x1e\xd5" + // 0x00F40309: 0x00001ED5 - "\x00\xd4\x03\x03\x00\x00\x1e\xd6" + // 0x00D40303: 0x00001ED6 - "\x00\xf4\x03\x03\x00\x00\x1e\xd7" + // 0x00F40303: 0x00001ED7 - "\x1e\xcc\x03\x02\x00\x00\x1e\xd8" + // 0x1ECC0302: 0x00001ED8 - "\x1e\xcd\x03\x02\x00\x00\x1e\xd9" + // 0x1ECD0302: 0x00001ED9 - "\x01\xa0\x03\x01\x00\x00\x1e\xda" + // 0x01A00301: 0x00001EDA - "\x01\xa1\x03\x01\x00\x00\x1e\xdb" + // 0x01A10301: 0x00001EDB - "\x01\xa0\x03\x00\x00\x00\x1e\xdc" + // 0x01A00300: 0x00001EDC - "\x01\xa1\x03\x00\x00\x00\x1e\xdd" + // 0x01A10300: 0x00001EDD - "\x01\xa0\x03\t\x00\x00\x1e\xde" + // 0x01A00309: 0x00001EDE - "\x01\xa1\x03\t\x00\x00\x1e\xdf" + // 0x01A10309: 0x00001EDF - "\x01\xa0\x03\x03\x00\x00\x1e\xe0" + // 0x01A00303: 0x00001EE0 - "\x01\xa1\x03\x03\x00\x00\x1e\xe1" + // 0x01A10303: 0x00001EE1 - "\x01\xa0\x03#\x00\x00\x1e\xe2" + // 0x01A00323: 0x00001EE2 - "\x01\xa1\x03#\x00\x00\x1e\xe3" + // 0x01A10323: 0x00001EE3 - "\x00U\x03#\x00\x00\x1e\xe4" + // 0x00550323: 0x00001EE4 - "\x00u\x03#\x00\x00\x1e\xe5" + // 0x00750323: 0x00001EE5 - "\x00U\x03\t\x00\x00\x1e\xe6" + // 0x00550309: 0x00001EE6 - "\x00u\x03\t\x00\x00\x1e\xe7" + // 0x00750309: 0x00001EE7 - "\x01\xaf\x03\x01\x00\x00\x1e\xe8" + // 0x01AF0301: 0x00001EE8 - "\x01\xb0\x03\x01\x00\x00\x1e\xe9" + // 0x01B00301: 0x00001EE9 - "\x01\xaf\x03\x00\x00\x00\x1e\xea" + // 0x01AF0300: 0x00001EEA - "\x01\xb0\x03\x00\x00\x00\x1e\xeb" + // 0x01B00300: 0x00001EEB - "\x01\xaf\x03\t\x00\x00\x1e\xec" + // 0x01AF0309: 0x00001EEC - "\x01\xb0\x03\t\x00\x00\x1e\xed" + // 0x01B00309: 0x00001EED - "\x01\xaf\x03\x03\x00\x00\x1e\xee" + // 0x01AF0303: 0x00001EEE - "\x01\xb0\x03\x03\x00\x00\x1e\xef" + // 0x01B00303: 0x00001EEF - "\x01\xaf\x03#\x00\x00\x1e\xf0" + // 0x01AF0323: 0x00001EF0 - "\x01\xb0\x03#\x00\x00\x1e\xf1" + // 0x01B00323: 0x00001EF1 - "\x00Y\x03\x00\x00\x00\x1e\xf2" + // 0x00590300: 0x00001EF2 - "\x00y\x03\x00\x00\x00\x1e\xf3" + // 0x00790300: 0x00001EF3 - "\x00Y\x03#\x00\x00\x1e\xf4" + // 0x00590323: 0x00001EF4 - "\x00y\x03#\x00\x00\x1e\xf5" + // 0x00790323: 0x00001EF5 - "\x00Y\x03\t\x00\x00\x1e\xf6" + // 0x00590309: 0x00001EF6 - "\x00y\x03\t\x00\x00\x1e\xf7" + // 0x00790309: 0x00001EF7 - "\x00Y\x03\x03\x00\x00\x1e\xf8" + // 0x00590303: 0x00001EF8 - "\x00y\x03\x03\x00\x00\x1e\xf9" + // 0x00790303: 0x00001EF9 - "\x03\xb1\x03\x13\x00\x00\x1f\x00" + // 0x03B10313: 0x00001F00 - "\x03\xb1\x03\x14\x00\x00\x1f\x01" + // 0x03B10314: 0x00001F01 - "\x1f\x00\x03\x00\x00\x00\x1f\x02" + // 0x1F000300: 0x00001F02 - "\x1f\x01\x03\x00\x00\x00\x1f\x03" + // 0x1F010300: 0x00001F03 - "\x1f\x00\x03\x01\x00\x00\x1f\x04" + // 0x1F000301: 0x00001F04 - "\x1f\x01\x03\x01\x00\x00\x1f\x05" + // 0x1F010301: 0x00001F05 - "\x1f\x00\x03B\x00\x00\x1f\x06" + // 0x1F000342: 0x00001F06 - "\x1f\x01\x03B\x00\x00\x1f\a" + // 0x1F010342: 0x00001F07 - "\x03\x91\x03\x13\x00\x00\x1f\b" + // 0x03910313: 0x00001F08 - "\x03\x91\x03\x14\x00\x00\x1f\t" + // 0x03910314: 0x00001F09 - "\x1f\b\x03\x00\x00\x00\x1f\n" + // 0x1F080300: 0x00001F0A - "\x1f\t\x03\x00\x00\x00\x1f\v" + // 0x1F090300: 0x00001F0B - "\x1f\b\x03\x01\x00\x00\x1f\f" + // 0x1F080301: 0x00001F0C - "\x1f\t\x03\x01\x00\x00\x1f\r" + // 0x1F090301: 0x00001F0D - "\x1f\b\x03B\x00\x00\x1f\x0e" + // 0x1F080342: 0x00001F0E - "\x1f\t\x03B\x00\x00\x1f\x0f" + // 0x1F090342: 0x00001F0F - "\x03\xb5\x03\x13\x00\x00\x1f\x10" + // 0x03B50313: 0x00001F10 - "\x03\xb5\x03\x14\x00\x00\x1f\x11" + // 0x03B50314: 0x00001F11 - "\x1f\x10\x03\x00\x00\x00\x1f\x12" + // 0x1F100300: 0x00001F12 - "\x1f\x11\x03\x00\x00\x00\x1f\x13" + // 0x1F110300: 0x00001F13 - "\x1f\x10\x03\x01\x00\x00\x1f\x14" + // 0x1F100301: 0x00001F14 - "\x1f\x11\x03\x01\x00\x00\x1f\x15" + // 0x1F110301: 0x00001F15 - "\x03\x95\x03\x13\x00\x00\x1f\x18" + // 0x03950313: 0x00001F18 - "\x03\x95\x03\x14\x00\x00\x1f\x19" + // 0x03950314: 0x00001F19 - "\x1f\x18\x03\x00\x00\x00\x1f\x1a" + // 0x1F180300: 0x00001F1A - "\x1f\x19\x03\x00\x00\x00\x1f\x1b" + // 0x1F190300: 0x00001F1B - "\x1f\x18\x03\x01\x00\x00\x1f\x1c" + // 0x1F180301: 0x00001F1C - "\x1f\x19\x03\x01\x00\x00\x1f\x1d" + // 0x1F190301: 0x00001F1D - "\x03\xb7\x03\x13\x00\x00\x1f " + // 0x03B70313: 0x00001F20 - "\x03\xb7\x03\x14\x00\x00\x1f!" + // 0x03B70314: 0x00001F21 - "\x1f \x03\x00\x00\x00\x1f\"" + // 0x1F200300: 0x00001F22 - "\x1f!\x03\x00\x00\x00\x1f#" + // 0x1F210300: 0x00001F23 - "\x1f \x03\x01\x00\x00\x1f$" + // 0x1F200301: 0x00001F24 - "\x1f!\x03\x01\x00\x00\x1f%" + // 0x1F210301: 0x00001F25 - "\x1f \x03B\x00\x00\x1f&" + // 0x1F200342: 0x00001F26 - "\x1f!\x03B\x00\x00\x1f'" + // 0x1F210342: 0x00001F27 - "\x03\x97\x03\x13\x00\x00\x1f(" + // 0x03970313: 0x00001F28 - "\x03\x97\x03\x14\x00\x00\x1f)" + // 0x03970314: 0x00001F29 - "\x1f(\x03\x00\x00\x00\x1f*" + // 0x1F280300: 0x00001F2A - "\x1f)\x03\x00\x00\x00\x1f+" + // 0x1F290300: 0x00001F2B - "\x1f(\x03\x01\x00\x00\x1f," + // 0x1F280301: 0x00001F2C - "\x1f)\x03\x01\x00\x00\x1f-" + // 0x1F290301: 0x00001F2D - "\x1f(\x03B\x00\x00\x1f." + // 0x1F280342: 0x00001F2E - "\x1f)\x03B\x00\x00\x1f/" + // 0x1F290342: 0x00001F2F - "\x03\xb9\x03\x13\x00\x00\x1f0" + // 0x03B90313: 0x00001F30 - "\x03\xb9\x03\x14\x00\x00\x1f1" + // 0x03B90314: 0x00001F31 - "\x1f0\x03\x00\x00\x00\x1f2" + // 0x1F300300: 0x00001F32 - "\x1f1\x03\x00\x00\x00\x1f3" + // 0x1F310300: 0x00001F33 - "\x1f0\x03\x01\x00\x00\x1f4" + // 0x1F300301: 0x00001F34 - "\x1f1\x03\x01\x00\x00\x1f5" + // 0x1F310301: 0x00001F35 - "\x1f0\x03B\x00\x00\x1f6" + // 0x1F300342: 0x00001F36 - "\x1f1\x03B\x00\x00\x1f7" + // 0x1F310342: 0x00001F37 - "\x03\x99\x03\x13\x00\x00\x1f8" + // 0x03990313: 0x00001F38 - "\x03\x99\x03\x14\x00\x00\x1f9" + // 0x03990314: 0x00001F39 - "\x1f8\x03\x00\x00\x00\x1f:" + // 0x1F380300: 0x00001F3A - "\x1f9\x03\x00\x00\x00\x1f;" + // 0x1F390300: 0x00001F3B - "\x1f8\x03\x01\x00\x00\x1f<" + // 0x1F380301: 0x00001F3C - "\x1f9\x03\x01\x00\x00\x1f=" + // 0x1F390301: 0x00001F3D - "\x1f8\x03B\x00\x00\x1f>" + // 0x1F380342: 0x00001F3E - "\x1f9\x03B\x00\x00\x1f?" + // 0x1F390342: 0x00001F3F - "\x03\xbf\x03\x13\x00\x00\x1f@" + // 0x03BF0313: 0x00001F40 - "\x03\xbf\x03\x14\x00\x00\x1fA" + // 0x03BF0314: 0x00001F41 - "\x1f@\x03\x00\x00\x00\x1fB" + // 0x1F400300: 0x00001F42 - "\x1fA\x03\x00\x00\x00\x1fC" + // 0x1F410300: 0x00001F43 - "\x1f@\x03\x01\x00\x00\x1fD" + // 0x1F400301: 0x00001F44 - "\x1fA\x03\x01\x00\x00\x1fE" + // 0x1F410301: 0x00001F45 - "\x03\x9f\x03\x13\x00\x00\x1fH" + // 0x039F0313: 0x00001F48 - "\x03\x9f\x03\x14\x00\x00\x1fI" + // 0x039F0314: 0x00001F49 - "\x1fH\x03\x00\x00\x00\x1fJ" + // 0x1F480300: 0x00001F4A - "\x1fI\x03\x00\x00\x00\x1fK" + // 0x1F490300: 0x00001F4B - "\x1fH\x03\x01\x00\x00\x1fL" + // 0x1F480301: 0x00001F4C - "\x1fI\x03\x01\x00\x00\x1fM" + // 0x1F490301: 0x00001F4D - "\x03\xc5\x03\x13\x00\x00\x1fP" + // 0x03C50313: 0x00001F50 - "\x03\xc5\x03\x14\x00\x00\x1fQ" + // 0x03C50314: 0x00001F51 - "\x1fP\x03\x00\x00\x00\x1fR" + // 0x1F500300: 0x00001F52 - "\x1fQ\x03\x00\x00\x00\x1fS" + // 0x1F510300: 0x00001F53 - "\x1fP\x03\x01\x00\x00\x1fT" + // 0x1F500301: 0x00001F54 - "\x1fQ\x03\x01\x00\x00\x1fU" + // 0x1F510301: 0x00001F55 - "\x1fP\x03B\x00\x00\x1fV" + // 0x1F500342: 0x00001F56 - "\x1fQ\x03B\x00\x00\x1fW" + // 0x1F510342: 0x00001F57 - "\x03\xa5\x03\x14\x00\x00\x1fY" + // 0x03A50314: 0x00001F59 - "\x1fY\x03\x00\x00\x00\x1f[" + // 0x1F590300: 0x00001F5B - "\x1fY\x03\x01\x00\x00\x1f]" + // 0x1F590301: 0x00001F5D - "\x1fY\x03B\x00\x00\x1f_" + // 0x1F590342: 0x00001F5F - "\x03\xc9\x03\x13\x00\x00\x1f`" + // 0x03C90313: 0x00001F60 - "\x03\xc9\x03\x14\x00\x00\x1fa" + // 0x03C90314: 0x00001F61 - "\x1f`\x03\x00\x00\x00\x1fb" + // 0x1F600300: 0x00001F62 - "\x1fa\x03\x00\x00\x00\x1fc" + // 0x1F610300: 0x00001F63 - "\x1f`\x03\x01\x00\x00\x1fd" + // 0x1F600301: 0x00001F64 - "\x1fa\x03\x01\x00\x00\x1fe" + // 0x1F610301: 0x00001F65 - "\x1f`\x03B\x00\x00\x1ff" + // 0x1F600342: 0x00001F66 - "\x1fa\x03B\x00\x00\x1fg" + // 0x1F610342: 0x00001F67 - "\x03\xa9\x03\x13\x00\x00\x1fh" + // 0x03A90313: 0x00001F68 - "\x03\xa9\x03\x14\x00\x00\x1fi" + // 0x03A90314: 0x00001F69 - "\x1fh\x03\x00\x00\x00\x1fj" + // 0x1F680300: 0x00001F6A - "\x1fi\x03\x00\x00\x00\x1fk" + // 0x1F690300: 0x00001F6B - "\x1fh\x03\x01\x00\x00\x1fl" + // 0x1F680301: 0x00001F6C - "\x1fi\x03\x01\x00\x00\x1fm" + // 0x1F690301: 0x00001F6D - "\x1fh\x03B\x00\x00\x1fn" + // 0x1F680342: 0x00001F6E - "\x1fi\x03B\x00\x00\x1fo" + // 0x1F690342: 0x00001F6F - "\x03\xb1\x03\x00\x00\x00\x1fp" + // 0x03B10300: 0x00001F70 - "\x03\xb5\x03\x00\x00\x00\x1fr" + // 0x03B50300: 0x00001F72 - "\x03\xb7\x03\x00\x00\x00\x1ft" + // 0x03B70300: 0x00001F74 - "\x03\xb9\x03\x00\x00\x00\x1fv" + // 0x03B90300: 0x00001F76 - "\x03\xbf\x03\x00\x00\x00\x1fx" + // 0x03BF0300: 0x00001F78 - "\x03\xc5\x03\x00\x00\x00\x1fz" + // 0x03C50300: 0x00001F7A - "\x03\xc9\x03\x00\x00\x00\x1f|" + // 0x03C90300: 0x00001F7C - "\x1f\x00\x03E\x00\x00\x1f\x80" + // 0x1F000345: 0x00001F80 - "\x1f\x01\x03E\x00\x00\x1f\x81" + // 0x1F010345: 0x00001F81 - "\x1f\x02\x03E\x00\x00\x1f\x82" + // 0x1F020345: 0x00001F82 - "\x1f\x03\x03E\x00\x00\x1f\x83" + // 0x1F030345: 0x00001F83 - "\x1f\x04\x03E\x00\x00\x1f\x84" + // 0x1F040345: 0x00001F84 - "\x1f\x05\x03E\x00\x00\x1f\x85" + // 0x1F050345: 0x00001F85 - "\x1f\x06\x03E\x00\x00\x1f\x86" + // 0x1F060345: 0x00001F86 - "\x1f\a\x03E\x00\x00\x1f\x87" + // 0x1F070345: 0x00001F87 - "\x1f\b\x03E\x00\x00\x1f\x88" + // 0x1F080345: 0x00001F88 - "\x1f\t\x03E\x00\x00\x1f\x89" + // 0x1F090345: 0x00001F89 - "\x1f\n\x03E\x00\x00\x1f\x8a" + // 0x1F0A0345: 0x00001F8A - "\x1f\v\x03E\x00\x00\x1f\x8b" + // 0x1F0B0345: 0x00001F8B - "\x1f\f\x03E\x00\x00\x1f\x8c" + // 0x1F0C0345: 0x00001F8C - "\x1f\r\x03E\x00\x00\x1f\x8d" + // 0x1F0D0345: 0x00001F8D - "\x1f\x0e\x03E\x00\x00\x1f\x8e" + // 0x1F0E0345: 0x00001F8E - "\x1f\x0f\x03E\x00\x00\x1f\x8f" + // 0x1F0F0345: 0x00001F8F - "\x1f \x03E\x00\x00\x1f\x90" + // 0x1F200345: 0x00001F90 - "\x1f!\x03E\x00\x00\x1f\x91" + // 0x1F210345: 0x00001F91 - "\x1f\"\x03E\x00\x00\x1f\x92" + // 0x1F220345: 0x00001F92 - "\x1f#\x03E\x00\x00\x1f\x93" + // 0x1F230345: 0x00001F93 - "\x1f$\x03E\x00\x00\x1f\x94" + // 0x1F240345: 0x00001F94 - "\x1f%\x03E\x00\x00\x1f\x95" + // 0x1F250345: 0x00001F95 - "\x1f&\x03E\x00\x00\x1f\x96" + // 0x1F260345: 0x00001F96 - "\x1f'\x03E\x00\x00\x1f\x97" + // 0x1F270345: 0x00001F97 - "\x1f(\x03E\x00\x00\x1f\x98" + // 0x1F280345: 0x00001F98 - "\x1f)\x03E\x00\x00\x1f\x99" + // 0x1F290345: 0x00001F99 - "\x1f*\x03E\x00\x00\x1f\x9a" + // 0x1F2A0345: 0x00001F9A - "\x1f+\x03E\x00\x00\x1f\x9b" + // 0x1F2B0345: 0x00001F9B - "\x1f,\x03E\x00\x00\x1f\x9c" + // 0x1F2C0345: 0x00001F9C - "\x1f-\x03E\x00\x00\x1f\x9d" + // 0x1F2D0345: 0x00001F9D - "\x1f.\x03E\x00\x00\x1f\x9e" + // 0x1F2E0345: 0x00001F9E - "\x1f/\x03E\x00\x00\x1f\x9f" + // 0x1F2F0345: 0x00001F9F - "\x1f`\x03E\x00\x00\x1f\xa0" + // 0x1F600345: 0x00001FA0 - "\x1fa\x03E\x00\x00\x1f\xa1" + // 0x1F610345: 0x00001FA1 - "\x1fb\x03E\x00\x00\x1f\xa2" + // 0x1F620345: 0x00001FA2 - "\x1fc\x03E\x00\x00\x1f\xa3" + // 0x1F630345: 0x00001FA3 - "\x1fd\x03E\x00\x00\x1f\xa4" + // 0x1F640345: 0x00001FA4 - "\x1fe\x03E\x00\x00\x1f\xa5" + // 0x1F650345: 0x00001FA5 - "\x1ff\x03E\x00\x00\x1f\xa6" + // 0x1F660345: 0x00001FA6 - "\x1fg\x03E\x00\x00\x1f\xa7" + // 0x1F670345: 0x00001FA7 - "\x1fh\x03E\x00\x00\x1f\xa8" + // 0x1F680345: 0x00001FA8 - "\x1fi\x03E\x00\x00\x1f\xa9" + // 0x1F690345: 0x00001FA9 - "\x1fj\x03E\x00\x00\x1f\xaa" + // 0x1F6A0345: 0x00001FAA - "\x1fk\x03E\x00\x00\x1f\xab" + // 0x1F6B0345: 0x00001FAB - "\x1fl\x03E\x00\x00\x1f\xac" + // 0x1F6C0345: 0x00001FAC - "\x1fm\x03E\x00\x00\x1f\xad" + // 0x1F6D0345: 0x00001FAD - "\x1fn\x03E\x00\x00\x1f\xae" + // 0x1F6E0345: 0x00001FAE - "\x1fo\x03E\x00\x00\x1f\xaf" + // 0x1F6F0345: 0x00001FAF - "\x03\xb1\x03\x06\x00\x00\x1f\xb0" + // 0x03B10306: 0x00001FB0 - "\x03\xb1\x03\x04\x00\x00\x1f\xb1" + // 0x03B10304: 0x00001FB1 - "\x1fp\x03E\x00\x00\x1f\xb2" + // 0x1F700345: 0x00001FB2 - "\x03\xb1\x03E\x00\x00\x1f\xb3" + // 0x03B10345: 0x00001FB3 - "\x03\xac\x03E\x00\x00\x1f\xb4" + // 0x03AC0345: 0x00001FB4 - "\x03\xb1\x03B\x00\x00\x1f\xb6" + // 0x03B10342: 0x00001FB6 - "\x1f\xb6\x03E\x00\x00\x1f\xb7" + // 0x1FB60345: 0x00001FB7 - "\x03\x91\x03\x06\x00\x00\x1f\xb8" + // 0x03910306: 0x00001FB8 - "\x03\x91\x03\x04\x00\x00\x1f\xb9" + // 0x03910304: 0x00001FB9 - "\x03\x91\x03\x00\x00\x00\x1f\xba" + // 0x03910300: 0x00001FBA - "\x03\x91\x03E\x00\x00\x1f\xbc" + // 0x03910345: 0x00001FBC - "\x00\xa8\x03B\x00\x00\x1f\xc1" + // 0x00A80342: 0x00001FC1 - "\x1ft\x03E\x00\x00\x1f\xc2" + // 0x1F740345: 0x00001FC2 - "\x03\xb7\x03E\x00\x00\x1f\xc3" + // 0x03B70345: 0x00001FC3 - "\x03\xae\x03E\x00\x00\x1f\xc4" + // 0x03AE0345: 0x00001FC4 - "\x03\xb7\x03B\x00\x00\x1f\xc6" + // 0x03B70342: 0x00001FC6 - "\x1f\xc6\x03E\x00\x00\x1f\xc7" + // 0x1FC60345: 0x00001FC7 - "\x03\x95\x03\x00\x00\x00\x1f\xc8" + // 0x03950300: 0x00001FC8 - "\x03\x97\x03\x00\x00\x00\x1f\xca" + // 0x03970300: 0x00001FCA - "\x03\x97\x03E\x00\x00\x1f\xcc" + // 0x03970345: 0x00001FCC - "\x1f\xbf\x03\x00\x00\x00\x1f\xcd" + // 0x1FBF0300: 0x00001FCD - "\x1f\xbf\x03\x01\x00\x00\x1f\xce" + // 0x1FBF0301: 0x00001FCE - "\x1f\xbf\x03B\x00\x00\x1f\xcf" + // 0x1FBF0342: 0x00001FCF - "\x03\xb9\x03\x06\x00\x00\x1f\xd0" + // 0x03B90306: 0x00001FD0 - "\x03\xb9\x03\x04\x00\x00\x1f\xd1" + // 0x03B90304: 0x00001FD1 - "\x03\xca\x03\x00\x00\x00\x1f\xd2" + // 0x03CA0300: 0x00001FD2 - "\x03\xb9\x03B\x00\x00\x1f\xd6" + // 0x03B90342: 0x00001FD6 - "\x03\xca\x03B\x00\x00\x1f\xd7" + // 0x03CA0342: 0x00001FD7 - "\x03\x99\x03\x06\x00\x00\x1f\xd8" + // 0x03990306: 0x00001FD8 - "\x03\x99\x03\x04\x00\x00\x1f\xd9" + // 0x03990304: 0x00001FD9 - "\x03\x99\x03\x00\x00\x00\x1f\xda" + // 0x03990300: 0x00001FDA - "\x1f\xfe\x03\x00\x00\x00\x1f\xdd" + // 0x1FFE0300: 0x00001FDD - "\x1f\xfe\x03\x01\x00\x00\x1f\xde" + // 0x1FFE0301: 0x00001FDE - "\x1f\xfe\x03B\x00\x00\x1f\xdf" + // 0x1FFE0342: 0x00001FDF - "\x03\xc5\x03\x06\x00\x00\x1f\xe0" + // 0x03C50306: 0x00001FE0 - "\x03\xc5\x03\x04\x00\x00\x1f\xe1" + // 0x03C50304: 0x00001FE1 - "\x03\xcb\x03\x00\x00\x00\x1f\xe2" + // 0x03CB0300: 0x00001FE2 - "\x03\xc1\x03\x13\x00\x00\x1f\xe4" + // 0x03C10313: 0x00001FE4 - "\x03\xc1\x03\x14\x00\x00\x1f\xe5" + // 0x03C10314: 0x00001FE5 - "\x03\xc5\x03B\x00\x00\x1f\xe6" + // 0x03C50342: 0x00001FE6 - "\x03\xcb\x03B\x00\x00\x1f\xe7" + // 0x03CB0342: 0x00001FE7 - "\x03\xa5\x03\x06\x00\x00\x1f\xe8" + // 0x03A50306: 0x00001FE8 - "\x03\xa5\x03\x04\x00\x00\x1f\xe9" + // 0x03A50304: 0x00001FE9 - "\x03\xa5\x03\x00\x00\x00\x1f\xea" + // 0x03A50300: 0x00001FEA - "\x03\xa1\x03\x14\x00\x00\x1f\xec" + // 0x03A10314: 0x00001FEC - "\x00\xa8\x03\x00\x00\x00\x1f\xed" + // 0x00A80300: 0x00001FED - "\x1f|\x03E\x00\x00\x1f\xf2" + // 0x1F7C0345: 0x00001FF2 - "\x03\xc9\x03E\x00\x00\x1f\xf3" + // 0x03C90345: 0x00001FF3 - "\x03\xce\x03E\x00\x00\x1f\xf4" + // 0x03CE0345: 0x00001FF4 - "\x03\xc9\x03B\x00\x00\x1f\xf6" + // 0x03C90342: 0x00001FF6 - "\x1f\xf6\x03E\x00\x00\x1f\xf7" + // 0x1FF60345: 0x00001FF7 - "\x03\x9f\x03\x00\x00\x00\x1f\xf8" + // 0x039F0300: 0x00001FF8 - "\x03\xa9\x03\x00\x00\x00\x1f\xfa" + // 0x03A90300: 0x00001FFA - "\x03\xa9\x03E\x00\x00\x1f\xfc" + // 0x03A90345: 0x00001FFC - "!\x90\x038\x00\x00!\x9a" + // 0x21900338: 0x0000219A - "!\x92\x038\x00\x00!\x9b" + // 0x21920338: 0x0000219B - "!\x94\x038\x00\x00!\xae" + // 0x21940338: 0x000021AE - "!\xd0\x038\x00\x00!\xcd" + // 0x21D00338: 0x000021CD - "!\xd4\x038\x00\x00!\xce" + // 0x21D40338: 0x000021CE - "!\xd2\x038\x00\x00!\xcf" + // 0x21D20338: 0x000021CF - "\"\x03\x038\x00\x00\"\x04" + // 0x22030338: 0x00002204 - "\"\b\x038\x00\x00\"\t" + // 0x22080338: 0x00002209 - "\"\v\x038\x00\x00\"\f" + // 0x220B0338: 0x0000220C - "\"#\x038\x00\x00\"$" + // 0x22230338: 0x00002224 - "\"%\x038\x00\x00\"&" + // 0x22250338: 0x00002226 - "\"<\x038\x00\x00\"A" + // 0x223C0338: 0x00002241 - "\"C\x038\x00\x00\"D" + // 0x22430338: 0x00002244 - "\"E\x038\x00\x00\"G" + // 0x22450338: 0x00002247 - "\"H\x038\x00\x00\"I" + // 0x22480338: 0x00002249 - "\x00=\x038\x00\x00\"`" + // 0x003D0338: 0x00002260 - "\"a\x038\x00\x00\"b" + // 0x22610338: 0x00002262 - "\"M\x038\x00\x00\"m" + // 0x224D0338: 0x0000226D - "\x00<\x038\x00\x00\"n" + // 0x003C0338: 0x0000226E - "\x00>\x038\x00\x00\"o" + // 0x003E0338: 0x0000226F - "\"d\x038\x00\x00\"p" + // 0x22640338: 0x00002270 - "\"e\x038\x00\x00\"q" + // 0x22650338: 0x00002271 - "\"r\x038\x00\x00\"t" + // 0x22720338: 0x00002274 - "\"s\x038\x00\x00\"u" + // 0x22730338: 0x00002275 - "\"v\x038\x00\x00\"x" + // 0x22760338: 0x00002278 - "\"w\x038\x00\x00\"y" + // 0x22770338: 0x00002279 - "\"z\x038\x00\x00\"\x80" + // 0x227A0338: 0x00002280 - "\"{\x038\x00\x00\"\x81" + // 0x227B0338: 0x00002281 - "\"\x82\x038\x00\x00\"\x84" + // 0x22820338: 0x00002284 - "\"\x83\x038\x00\x00\"\x85" + // 0x22830338: 0x00002285 - "\"\x86\x038\x00\x00\"\x88" + // 0x22860338: 0x00002288 - "\"\x87\x038\x00\x00\"\x89" + // 0x22870338: 0x00002289 - "\"\xa2\x038\x00\x00\"\xac" + // 0x22A20338: 0x000022AC - "\"\xa8\x038\x00\x00\"\xad" + // 0x22A80338: 0x000022AD - "\"\xa9\x038\x00\x00\"\xae" + // 0x22A90338: 0x000022AE - "\"\xab\x038\x00\x00\"\xaf" + // 0x22AB0338: 0x000022AF - "\"|\x038\x00\x00\"\xe0" + // 0x227C0338: 0x000022E0 - "\"}\x038\x00\x00\"\xe1" + // 0x227D0338: 0x000022E1 - "\"\x91\x038\x00\x00\"\xe2" + // 0x22910338: 0x000022E2 - "\"\x92\x038\x00\x00\"\xe3" + // 0x22920338: 0x000022E3 - "\"\xb2\x038\x00\x00\"\xea" + // 0x22B20338: 0x000022EA - "\"\xb3\x038\x00\x00\"\xeb" + // 0x22B30338: 0x000022EB - "\"\xb4\x038\x00\x00\"\xec" + // 0x22B40338: 0x000022EC - "\"\xb5\x038\x00\x00\"\xed" + // 0x22B50338: 0x000022ED - "0K0\x99\x00\x000L" + // 0x304B3099: 0x0000304C - "0M0\x99\x00\x000N" + // 0x304D3099: 0x0000304E - "0O0\x99\x00\x000P" + // 0x304F3099: 0x00003050 - "0Q0\x99\x00\x000R" + // 0x30513099: 0x00003052 - "0S0\x99\x00\x000T" + // 0x30533099: 0x00003054 - "0U0\x99\x00\x000V" + // 0x30553099: 0x00003056 - "0W0\x99\x00\x000X" + // 0x30573099: 0x00003058 - "0Y0\x99\x00\x000Z" + // 0x30593099: 0x0000305A - "0[0\x99\x00\x000\\" + // 0x305B3099: 0x0000305C - "0]0\x99\x00\x000^" + // 0x305D3099: 0x0000305E - "0_0\x99\x00\x000`" + // 0x305F3099: 0x00003060 - "0a0\x99\x00\x000b" + // 0x30613099: 0x00003062 - "0d0\x99\x00\x000e" + // 0x30643099: 0x00003065 - "0f0\x99\x00\x000g" + // 0x30663099: 0x00003067 - "0h0\x99\x00\x000i" + // 0x30683099: 0x00003069 - "0o0\x99\x00\x000p" + // 0x306F3099: 0x00003070 - "0o0\x9a\x00\x000q" + // 0x306F309A: 0x00003071 - "0r0\x99\x00\x000s" + // 0x30723099: 0x00003073 - "0r0\x9a\x00\x000t" + // 0x3072309A: 0x00003074 - "0u0\x99\x00\x000v" + // 0x30753099: 0x00003076 - "0u0\x9a\x00\x000w" + // 0x3075309A: 0x00003077 - "0x0\x99\x00\x000y" + // 0x30783099: 0x00003079 - "0x0\x9a\x00\x000z" + // 0x3078309A: 0x0000307A - "0{0\x99\x00\x000|" + // 0x307B3099: 0x0000307C - "0{0\x9a\x00\x000}" + // 0x307B309A: 0x0000307D - "0F0\x99\x00\x000\x94" + // 0x30463099: 0x00003094 - "0\x9d0\x99\x00\x000\x9e" + // 0x309D3099: 0x0000309E - "0\xab0\x99\x00\x000\xac" + // 0x30AB3099: 0x000030AC - "0\xad0\x99\x00\x000\xae" + // 0x30AD3099: 0x000030AE - "0\xaf0\x99\x00\x000\xb0" + // 0x30AF3099: 0x000030B0 - "0\xb10\x99\x00\x000\xb2" + // 0x30B13099: 0x000030B2 - "0\xb30\x99\x00\x000\xb4" + // 0x30B33099: 0x000030B4 - "0\xb50\x99\x00\x000\xb6" + // 0x30B53099: 0x000030B6 - "0\xb70\x99\x00\x000\xb8" + // 0x30B73099: 0x000030B8 - "0\xb90\x99\x00\x000\xba" + // 0x30B93099: 0x000030BA - "0\xbb0\x99\x00\x000\xbc" + // 0x30BB3099: 0x000030BC - "0\xbd0\x99\x00\x000\xbe" + // 0x30BD3099: 0x000030BE - "0\xbf0\x99\x00\x000\xc0" + // 0x30BF3099: 0x000030C0 - "0\xc10\x99\x00\x000\xc2" + // 0x30C13099: 0x000030C2 - "0\xc40\x99\x00\x000\xc5" + // 0x30C43099: 0x000030C5 - "0\xc60\x99\x00\x000\xc7" + // 0x30C63099: 0x000030C7 - "0\xc80\x99\x00\x000\xc9" + // 0x30C83099: 0x000030C9 - "0\xcf0\x99\x00\x000\xd0" + // 0x30CF3099: 0x000030D0 - "0\xcf0\x9a\x00\x000\xd1" + // 0x30CF309A: 0x000030D1 - "0\xd20\x99\x00\x000\xd3" + // 0x30D23099: 0x000030D3 - "0\xd20\x9a\x00\x000\xd4" + // 0x30D2309A: 0x000030D4 - "0\xd50\x99\x00\x000\xd6" + // 0x30D53099: 0x000030D6 - "0\xd50\x9a\x00\x000\xd7" + // 0x30D5309A: 0x000030D7 - "0\xd80\x99\x00\x000\xd9" + // 0x30D83099: 0x000030D9 - "0\xd80\x9a\x00\x000\xda" + // 0x30D8309A: 0x000030DA - "0\xdb0\x99\x00\x000\xdc" + // 0x30DB3099: 0x000030DC - "0\xdb0\x9a\x00\x000\xdd" + // 0x30DB309A: 0x000030DD - "0\xa60\x99\x00\x000\xf4" + // 0x30A63099: 0x000030F4 - "0\xef0\x99\x00\x000\xf7" + // 0x30EF3099: 0x000030F7 - "0\xf00\x99\x00\x000\xf8" + // 0x30F03099: 0x000030F8 - "0\xf10\x99\x00\x000\xf9" + // 0x30F13099: 0x000030F9 - "0\xf20\x99\x00\x000\xfa" + // 0x30F23099: 0x000030FA - "0\xfd0\x99\x00\x000\xfe" + // 0x30FD3099: 0x000030FE - "\x10\x99\x10\xba\x00\x01\x10\x9a" + // 0x109910BA: 0x0001109A - "\x10\x9b\x10\xba\x00\x01\x10\x9c" + // 0x109B10BA: 0x0001109C - "\x10\xa5\x10\xba\x00\x01\x10\xab" + // 0x10A510BA: 0x000110AB - "\x111\x11'\x00\x01\x11." + // 0x11311127: 0x0001112E - "\x112\x11'\x00\x01\x11/" + // 0x11321127: 0x0001112F - "\x13G\x13>\x00\x01\x13K" + // 0x1347133E: 0x0001134B - "\x13G\x13W\x00\x01\x13L" + // 0x13471357: 0x0001134C - "\x14\xb9\x14\xba\x00\x01\x14\xbb" + // 0x14B914BA: 0x000114BB - "\x14\xb9\x14\xb0\x00\x01\x14\xbc" + // 0x14B914B0: 0x000114BC - "\x14\xb9\x14\xbd\x00\x01\x14\xbe" + // 0x14B914BD: 0x000114BE - "\x15\xb8\x15\xaf\x00\x01\x15\xba" + // 0x15B815AF: 0x000115BA - "\x15\xb9\x15\xaf\x00\x01\x15\xbb" + // 0x15B915AF: 0x000115BB - "\x195\x190\x00\x01\x198" + // 0x19351930: 0x00011938 + "\x00\x01\x04\x00`\x00\x00\xc0" + // 0x00041 0x00300: 0x000C0 + "\x00\x01\x04\x00` \x00\xc1" + // 0x00041 0x00301: 0x000C1 + "\x00\x01\x04\x00`@\x00\xc2" + // 0x00041 0x00302: 0x000C2 + "\x00\x01\x04\x00``\x00\xc3" + // 0x00041 0x00303: 0x000C3 + "\x00\x01\x04\x00a\x00\x00\xc4" + // 0x00041 0x00308: 0x000C4 + "\x00\x01\x04\x00a@\x00\xc5" + // 0x00041 0x0030A: 0x000C5 + "\x00\x01\f\x00d\xe0\x00\xc7" + // 0x00043 0x00327: 0x000C7 + "\x00\x01\x14\x00`\x00\x00\xc8" + // 0x00045 0x00300: 0x000C8 + "\x00\x01\x14\x00` \x00\xc9" + // 0x00045 0x00301: 0x000C9 + "\x00\x01\x14\x00`@\x00\xca" + // 0x00045 0x00302: 0x000CA + "\x00\x01\x14\x00a\x00\x00\xcb" + // 0x00045 0x00308: 0x000CB + "\x00\x01$\x00`\x00\x00\xcc" + // 0x00049 0x00300: 0x000CC + "\x00\x01$\x00` \x00\xcd" + // 0x00049 0x00301: 0x000CD + "\x00\x01$\x00`@\x00\xce" + // 0x00049 0x00302: 0x000CE + "\x00\x01$\x00a\x00\x00\xcf" + // 0x00049 0x00308: 0x000CF + "\x00\x018\x00``\x00\xd1" + // 0x0004E 0x00303: 0x000D1 + "\x00\x01<\x00`\x00\x00\xd2" + // 0x0004F 0x00300: 0x000D2 + "\x00\x01<\x00` \x00\xd3" + // 0x0004F 0x00301: 0x000D3 + "\x00\x01<\x00`@\x00\xd4" + // 0x0004F 0x00302: 0x000D4 + "\x00\x01<\x00``\x00\xd5" + // 0x0004F 0x00303: 0x000D5 + "\x00\x01<\x00a\x00\x00\xd6" + // 0x0004F 0x00308: 0x000D6 + "\x00\x01T\x00`\x00\x00\xd9" + // 0x00055 0x00300: 0x000D9 + "\x00\x01T\x00` \x00\xda" + // 0x00055 0x00301: 0x000DA + "\x00\x01T\x00`@\x00\xdb" + // 0x00055 0x00302: 0x000DB + "\x00\x01T\x00a\x00\x00\xdc" + // 0x00055 0x00308: 0x000DC + "\x00\x01d\x00` \x00\xdd" + // 0x00059 0x00301: 0x000DD + "\x00\x01\x84\x00`\x00\x00\xe0" + // 0x00061 0x00300: 0x000E0 + "\x00\x01\x84\x00` \x00\xe1" + // 0x00061 0x00301: 0x000E1 + "\x00\x01\x84\x00`@\x00\xe2" + // 0x00061 0x00302: 0x000E2 + "\x00\x01\x84\x00``\x00\xe3" + // 0x00061 0x00303: 0x000E3 + "\x00\x01\x84\x00a\x00\x00\xe4" + // 0x00061 0x00308: 0x000E4 + "\x00\x01\x84\x00a@\x00\xe5" + // 0x00061 0x0030A: 0x000E5 + "\x00\x01\x8c\x00d\xe0\x00\xe7" + // 0x00063 0x00327: 0x000E7 + "\x00\x01\x94\x00`\x00\x00\xe8" + // 0x00065 0x00300: 0x000E8 + "\x00\x01\x94\x00` \x00\xe9" + // 0x00065 0x00301: 0x000E9 + "\x00\x01\x94\x00`@\x00\xea" + // 0x00065 0x00302: 0x000EA + "\x00\x01\x94\x00a\x00\x00\xeb" + // 0x00065 0x00308: 0x000EB + "\x00\x01\xa4\x00`\x00\x00\xec" + // 0x00069 0x00300: 0x000EC + "\x00\x01\xa4\x00` \x00\xed" + // 0x00069 0x00301: 0x000ED + "\x00\x01\xa4\x00`@\x00\xee" + // 0x00069 0x00302: 0x000EE + "\x00\x01\xa4\x00a\x00\x00\xef" + // 0x00069 0x00308: 0x000EF + "\x00\x01\xb8\x00``\x00\xf1" + // 0x0006E 0x00303: 0x000F1 + "\x00\x01\xbc\x00`\x00\x00\xf2" + // 0x0006F 0x00300: 0x000F2 + "\x00\x01\xbc\x00` \x00\xf3" + // 0x0006F 0x00301: 0x000F3 + "\x00\x01\xbc\x00`@\x00\xf4" + // 0x0006F 0x00302: 0x000F4 + "\x00\x01\xbc\x00``\x00\xf5" + // 0x0006F 0x00303: 0x000F5 + "\x00\x01\xbc\x00a\x00\x00\xf6" + // 0x0006F 0x00308: 0x000F6 + "\x00\x01\xd4\x00`\x00\x00\xf9" + // 0x00075 0x00300: 0x000F9 + "\x00\x01\xd4\x00` \x00\xfa" + // 0x00075 0x00301: 0x000FA + "\x00\x01\xd4\x00`@\x00\xfb" + // 0x00075 0x00302: 0x000FB + "\x00\x01\xd4\x00a\x00\x00\xfc" + // 0x00075 0x00308: 0x000FC + "\x00\x01\xe4\x00` \x00\xfd" + // 0x00079 0x00301: 0x000FD + "\x00\x01\xe4\x00a\x00\x00\xff" + // 0x00079 0x00308: 0x000FF + "\x00\x01\x04\x00`\x80\x01\x00" + // 0x00041 0x00304: 0x00100 + "\x00\x01\x84\x00`\x80\x01\x01" + // 0x00061 0x00304: 0x00101 + "\x00\x01\x04\x00`\xc0\x01\x02" + // 0x00041 0x00306: 0x00102 + "\x00\x01\x84\x00`\xc0\x01\x03" + // 0x00061 0x00306: 0x00103 + "\x00\x01\x04\x00e\x00\x01\x04" + // 0x00041 0x00328: 0x00104 + "\x00\x01\x84\x00e\x00\x01\x05" + // 0x00061 0x00328: 0x00105 + "\x00\x01\f\x00` \x01\x06" + // 0x00043 0x00301: 0x00106 + "\x00\x01\x8c\x00` \x01\a" + // 0x00063 0x00301: 0x00107 + "\x00\x01\f\x00`@\x01\b" + // 0x00043 0x00302: 0x00108 + "\x00\x01\x8c\x00`@\x01\t" + // 0x00063 0x00302: 0x00109 + "\x00\x01\f\x00`\xe0\x01\n" + // 0x00043 0x00307: 0x0010A + "\x00\x01\x8c\x00`\xe0\x01\v" + // 0x00063 0x00307: 0x0010B + "\x00\x01\f\x00a\x80\x01\f" + // 0x00043 0x0030C: 0x0010C + "\x00\x01\x8c\x00a\x80\x01\r" + // 0x00063 0x0030C: 0x0010D + "\x00\x01\x10\x00a\x80\x01\x0e" + // 0x00044 0x0030C: 0x0010E + "\x00\x01\x90\x00a\x80\x01\x0f" + // 0x00064 0x0030C: 0x0010F + "\x00\x01\x14\x00`\x80\x01\x12" + // 0x00045 0x00304: 0x00112 + "\x00\x01\x94\x00`\x80\x01\x13" + // 0x00065 0x00304: 0x00113 + "\x00\x01\x14\x00`\xc0\x01\x14" + // 0x00045 0x00306: 0x00114 + "\x00\x01\x94\x00`\xc0\x01\x15" + // 0x00065 0x00306: 0x00115 + "\x00\x01\x14\x00`\xe0\x01\x16" + // 0x00045 0x00307: 0x00116 + "\x00\x01\x94\x00`\xe0\x01\x17" + // 0x00065 0x00307: 0x00117 + "\x00\x01\x14\x00e\x00\x01\x18" + // 0x00045 0x00328: 0x00118 + "\x00\x01\x94\x00e\x00\x01\x19" + // 0x00065 0x00328: 0x00119 + "\x00\x01\x14\x00a\x80\x01\x1a" + // 0x00045 0x0030C: 0x0011A + "\x00\x01\x94\x00a\x80\x01\x1b" + // 0x00065 0x0030C: 0x0011B + "\x00\x01\x1c\x00`@\x01\x1c" + // 0x00047 0x00302: 0x0011C + "\x00\x01\x9c\x00`@\x01\x1d" + // 0x00067 0x00302: 0x0011D + "\x00\x01\x1c\x00`\xc0\x01\x1e" + // 0x00047 0x00306: 0x0011E + "\x00\x01\x9c\x00`\xc0\x01\x1f" + // 0x00067 0x00306: 0x0011F + "\x00\x01\x1c\x00`\xe0\x01 " + // 0x00047 0x00307: 0x00120 + "\x00\x01\x9c\x00`\xe0\x01!" + // 0x00067 0x00307: 0x00121 + "\x00\x01\x1c\x00d\xe0\x01\"" + // 0x00047 0x00327: 0x00122 + "\x00\x01\x9c\x00d\xe0\x01#" + // 0x00067 0x00327: 0x00123 + "\x00\x01 \x00`@\x01$" + // 0x00048 0x00302: 0x00124 + "\x00\x01\xa0\x00`@\x01%" + // 0x00068 0x00302: 0x00125 + "\x00\x01$\x00``\x01(" + // 0x00049 0x00303: 0x00128 + "\x00\x01\xa4\x00``\x01)" + // 0x00069 0x00303: 0x00129 + "\x00\x01$\x00`\x80\x01*" + // 0x00049 0x00304: 0x0012A + "\x00\x01\xa4\x00`\x80\x01+" + // 0x00069 0x00304: 0x0012B + "\x00\x01$\x00`\xc0\x01," + // 0x00049 0x00306: 0x0012C + "\x00\x01\xa4\x00`\xc0\x01-" + // 0x00069 0x00306: 0x0012D + "\x00\x01$\x00e\x00\x01." + // 0x00049 0x00328: 0x0012E + "\x00\x01\xa4\x00e\x00\x01/" + // 0x00069 0x00328: 0x0012F + "\x00\x01$\x00`\xe0\x010" + // 0x00049 0x00307: 0x00130 + "\x00\x01(\x00`@\x014" + // 0x0004A 0x00302: 0x00134 + "\x00\x01\xa8\x00`@\x015" + // 0x0006A 0x00302: 0x00135 + "\x00\x01,\x00d\xe0\x016" + // 0x0004B 0x00327: 0x00136 + "\x00\x01\xac\x00d\xe0\x017" + // 0x0006B 0x00327: 0x00137 + "\x00\x010\x00` \x019" + // 0x0004C 0x00301: 0x00139 + "\x00\x01\xb0\x00` \x01:" + // 0x0006C 0x00301: 0x0013A + "\x00\x010\x00d\xe0\x01;" + // 0x0004C 0x00327: 0x0013B + "\x00\x01\xb0\x00d\xe0\x01<" + // 0x0006C 0x00327: 0x0013C + "\x00\x010\x00a\x80\x01=" + // 0x0004C 0x0030C: 0x0013D + "\x00\x01\xb0\x00a\x80\x01>" + // 0x0006C 0x0030C: 0x0013E + "\x00\x018\x00` \x01C" + // 0x0004E 0x00301: 0x00143 + "\x00\x01\xb8\x00` \x01D" + // 0x0006E 0x00301: 0x00144 + "\x00\x018\x00d\xe0\x01E" + // 0x0004E 0x00327: 0x00145 + "\x00\x01\xb8\x00d\xe0\x01F" + // 0x0006E 0x00327: 0x00146 + "\x00\x018\x00a\x80\x01G" + // 0x0004E 0x0030C: 0x00147 + "\x00\x01\xb8\x00a\x80\x01H" + // 0x0006E 0x0030C: 0x00148 + "\x00\x01<\x00`\x80\x01L" + // 0x0004F 0x00304: 0x0014C + "\x00\x01\xbc\x00`\x80\x01M" + // 0x0006F 0x00304: 0x0014D + "\x00\x01<\x00`\xc0\x01N" + // 0x0004F 0x00306: 0x0014E + "\x00\x01\xbc\x00`\xc0\x01O" + // 0x0006F 0x00306: 0x0014F + "\x00\x01<\x00a`\x01P" + // 0x0004F 0x0030B: 0x00150 + "\x00\x01\xbc\x00a`\x01Q" + // 0x0006F 0x0030B: 0x00151 + "\x00\x01H\x00` \x01T" + // 0x00052 0x00301: 0x00154 + "\x00\x01\xc8\x00` \x01U" + // 0x00072 0x00301: 0x00155 + "\x00\x01H\x00d\xe0\x01V" + // 0x00052 0x00327: 0x00156 + "\x00\x01\xc8\x00d\xe0\x01W" + // 0x00072 0x00327: 0x00157 + "\x00\x01H\x00a\x80\x01X" + // 0x00052 0x0030C: 0x00158 + "\x00\x01\xc8\x00a\x80\x01Y" + // 0x00072 0x0030C: 0x00159 + "\x00\x01L\x00` \x01Z" + // 0x00053 0x00301: 0x0015A + "\x00\x01\xcc\x00` \x01[" + // 0x00073 0x00301: 0x0015B + "\x00\x01L\x00`@\x01\\" + // 0x00053 0x00302: 0x0015C + "\x00\x01\xcc\x00`@\x01]" + // 0x00073 0x00302: 0x0015D + "\x00\x01L\x00d\xe0\x01^" + // 0x00053 0x00327: 0x0015E + "\x00\x01\xcc\x00d\xe0\x01_" + // 0x00073 0x00327: 0x0015F + "\x00\x01L\x00a\x80\x01`" + // 0x00053 0x0030C: 0x00160 + "\x00\x01\xcc\x00a\x80\x01a" + // 0x00073 0x0030C: 0x00161 + "\x00\x01P\x00d\xe0\x01b" + // 0x00054 0x00327: 0x00162 + "\x00\x01\xd0\x00d\xe0\x01c" + // 0x00074 0x00327: 0x00163 + "\x00\x01P\x00a\x80\x01d" + // 0x00054 0x0030C: 0x00164 + "\x00\x01\xd0\x00a\x80\x01e" + // 0x00074 0x0030C: 0x00165 + "\x00\x01T\x00``\x01h" + // 0x00055 0x00303: 0x00168 + "\x00\x01\xd4\x00``\x01i" + // 0x00075 0x00303: 0x00169 + "\x00\x01T\x00`\x80\x01j" + // 0x00055 0x00304: 0x0016A + "\x00\x01\xd4\x00`\x80\x01k" + // 0x00075 0x00304: 0x0016B + "\x00\x01T\x00`\xc0\x01l" + // 0x00055 0x00306: 0x0016C + "\x00\x01\xd4\x00`\xc0\x01m" + // 0x00075 0x00306: 0x0016D + "\x00\x01T\x00a@\x01n" + // 0x00055 0x0030A: 0x0016E + "\x00\x01\xd4\x00a@\x01o" + // 0x00075 0x0030A: 0x0016F + "\x00\x01T\x00a`\x01p" + // 0x00055 0x0030B: 0x00170 + "\x00\x01\xd4\x00a`\x01q" + // 0x00075 0x0030B: 0x00171 + "\x00\x01T\x00e\x00\x01r" + // 0x00055 0x00328: 0x00172 + "\x00\x01\xd4\x00e\x00\x01s" + // 0x00075 0x00328: 0x00173 + "\x00\x01\\\x00`@\x01t" + // 0x00057 0x00302: 0x00174 + "\x00\x01\xdc\x00`@\x01u" + // 0x00077 0x00302: 0x00175 + "\x00\x01d\x00`@\x01v" + // 0x00059 0x00302: 0x00176 + "\x00\x01\xe4\x00`@\x01w" + // 0x00079 0x00302: 0x00177 + "\x00\x01d\x00a\x00\x01x" + // 0x00059 0x00308: 0x00178 + "\x00\x01h\x00` \x01y" + // 0x0005A 0x00301: 0x00179 + "\x00\x01\xe8\x00` \x01z" + // 0x0007A 0x00301: 0x0017A + "\x00\x01h\x00`\xe0\x01{" + // 0x0005A 0x00307: 0x0017B + "\x00\x01\xe8\x00`\xe0\x01|" + // 0x0007A 0x00307: 0x0017C + "\x00\x01h\x00a\x80\x01}" + // 0x0005A 0x0030C: 0x0017D + "\x00\x01\xe8\x00a\x80\x01~" + // 0x0007A 0x0030C: 0x0017E + "\x00\x01<\x00c`\x01\xa0" + // 0x0004F 0x0031B: 0x001A0 + "\x00\x01\xbc\x00c`\x01\xa1" + // 0x0006F 0x0031B: 0x001A1 + "\x00\x01T\x00c`\x01\xaf" + // 0x00055 0x0031B: 0x001AF + "\x00\x01\xd4\x00c`\x01\xb0" + // 0x00075 0x0031B: 0x001B0 + "\x00\x01\x04\x00a\x80\x01\xcd" + // 0x00041 0x0030C: 0x001CD + "\x00\x01\x84\x00a\x80\x01\xce" + // 0x00061 0x0030C: 0x001CE + "\x00\x01$\x00a\x80\x01\xcf" + // 0x00049 0x0030C: 0x001CF + "\x00\x01\xa4\x00a\x80\x01\xd0" + // 0x00069 0x0030C: 0x001D0 + "\x00\x01<\x00a\x80\x01\xd1" + // 0x0004F 0x0030C: 0x001D1 + "\x00\x01\xbc\x00a\x80\x01\xd2" + // 0x0006F 0x0030C: 0x001D2 + "\x00\x01T\x00a\x80\x01\xd3" + // 0x00055 0x0030C: 0x001D3 + "\x00\x01\xd4\x00a\x80\x01\xd4" + // 0x00075 0x0030C: 0x001D4 + "\x00\x03p\x00`\x80\x01\xd5" + // 0x000DC 0x00304: 0x001D5 + "\x00\x03\xf0\x00`\x80\x01\xd6" + // 0x000FC 0x00304: 0x001D6 + "\x00\x03p\x00` \x01\xd7" + // 0x000DC 0x00301: 0x001D7 + "\x00\x03\xf0\x00` \x01\xd8" + // 0x000FC 0x00301: 0x001D8 + "\x00\x03p\x00a\x80\x01\xd9" + // 0x000DC 0x0030C: 0x001D9 + "\x00\x03\xf0\x00a\x80\x01\xda" + // 0x000FC 0x0030C: 0x001DA + "\x00\x03p\x00`\x00\x01\xdb" + // 0x000DC 0x00300: 0x001DB + "\x00\x03\xf0\x00`\x00\x01\xdc" + // 0x000FC 0x00300: 0x001DC + "\x00\x03\x10\x00`\x80\x01\xde" + // 0x000C4 0x00304: 0x001DE + "\x00\x03\x90\x00`\x80\x01\xdf" + // 0x000E4 0x00304: 0x001DF + "\x00\b\x98\x00`\x80\x01\xe0" + // 0x00226 0x00304: 0x001E0 + "\x00\b\x9c\x00`\x80\x01\xe1" + // 0x00227 0x00304: 0x001E1 + "\x00\x03\x18\x00`\x80\x01\xe2" + // 0x000C6 0x00304: 0x001E2 + "\x00\x03\x98\x00`\x80\x01\xe3" + // 0x000E6 0x00304: 0x001E3 + "\x00\x01\x1c\x00a\x80\x01\xe6" + // 0x00047 0x0030C: 0x001E6 + "\x00\x01\x9c\x00a\x80\x01\xe7" + // 0x00067 0x0030C: 0x001E7 + "\x00\x01,\x00a\x80\x01\xe8" + // 0x0004B 0x0030C: 0x001E8 + "\x00\x01\xac\x00a\x80\x01\xe9" + // 0x0006B 0x0030C: 0x001E9 + "\x00\x01<\x00e\x00\x01\xea" + // 0x0004F 0x00328: 0x001EA + "\x00\x01\xbc\x00e\x00\x01\xeb" + // 0x0006F 0x00328: 0x001EB + "\x00\a\xa8\x00`\x80\x01\xec" + // 0x001EA 0x00304: 0x001EC + "\x00\a\xac\x00`\x80\x01\xed" + // 0x001EB 0x00304: 0x001ED + "\x00\x06\xdc\x00a\x80\x01\xee" + // 0x001B7 0x0030C: 0x001EE + "\x00\nH\x00a\x80\x01\xef" + // 0x00292 0x0030C: 0x001EF + "\x00\x01\xa8\x00a\x80\x01\xf0" + // 0x0006A 0x0030C: 0x001F0 + "\x00\x01\x1c\x00` \x01\xf4" + // 0x00047 0x00301: 0x001F4 + "\x00\x01\x9c\x00` \x01\xf5" + // 0x00067 0x00301: 0x001F5 + "\x00\x018\x00`\x00\x01\xf8" + // 0x0004E 0x00300: 0x001F8 + "\x00\x01\xb8\x00`\x00\x01\xf9" + // 0x0006E 0x00300: 0x001F9 + "\x00\x03\x14\x00` \x01\xfa" + // 0x000C5 0x00301: 0x001FA + "\x00\x03\x94\x00` \x01\xfb" + // 0x000E5 0x00301: 0x001FB + "\x00\x03\x18\x00` \x01\xfc" + // 0x000C6 0x00301: 0x001FC + "\x00\x03\x98\x00` \x01\xfd" + // 0x000E6 0x00301: 0x001FD + "\x00\x03`\x00` \x01\xfe" + // 0x000D8 0x00301: 0x001FE + "\x00\x03\xe0\x00` \x01\xff" + // 0x000F8 0x00301: 0x001FF + "\x00\x01\x04\x00a\xe0\x02\x00" + // 0x00041 0x0030F: 0x00200 + "\x00\x01\x84\x00a\xe0\x02\x01" + // 0x00061 0x0030F: 0x00201 + "\x00\x01\x04\x00b \x02\x02" + // 0x00041 0x00311: 0x00202 + "\x00\x01\x84\x00b \x02\x03" + // 0x00061 0x00311: 0x00203 + "\x00\x01\x14\x00a\xe0\x02\x04" + // 0x00045 0x0030F: 0x00204 + "\x00\x01\x94\x00a\xe0\x02\x05" + // 0x00065 0x0030F: 0x00205 + "\x00\x01\x14\x00b \x02\x06" + // 0x00045 0x00311: 0x00206 + "\x00\x01\x94\x00b \x02\a" + // 0x00065 0x00311: 0x00207 + "\x00\x01$\x00a\xe0\x02\b" + // 0x00049 0x0030F: 0x00208 + "\x00\x01\xa4\x00a\xe0\x02\t" + // 0x00069 0x0030F: 0x00209 + "\x00\x01$\x00b \x02\n" + // 0x00049 0x00311: 0x0020A + "\x00\x01\xa4\x00b \x02\v" + // 0x00069 0x00311: 0x0020B + "\x00\x01<\x00a\xe0\x02\f" + // 0x0004F 0x0030F: 0x0020C + "\x00\x01\xbc\x00a\xe0\x02\r" + // 0x0006F 0x0030F: 0x0020D + "\x00\x01<\x00b \x02\x0e" + // 0x0004F 0x00311: 0x0020E + "\x00\x01\xbc\x00b \x02\x0f" + // 0x0006F 0x00311: 0x0020F + "\x00\x01H\x00a\xe0\x02\x10" + // 0x00052 0x0030F: 0x00210 + "\x00\x01\xc8\x00a\xe0\x02\x11" + // 0x00072 0x0030F: 0x00211 + "\x00\x01H\x00b \x02\x12" + // 0x00052 0x00311: 0x00212 + "\x00\x01\xc8\x00b \x02\x13" + // 0x00072 0x00311: 0x00213 + "\x00\x01T\x00a\xe0\x02\x14" + // 0x00055 0x0030F: 0x00214 + "\x00\x01\xd4\x00a\xe0\x02\x15" + // 0x00075 0x0030F: 0x00215 + "\x00\x01T\x00b \x02\x16" + // 0x00055 0x00311: 0x00216 + "\x00\x01\xd4\x00b \x02\x17" + // 0x00075 0x00311: 0x00217 + "\x00\x01L\x00d\xc0\x02\x18" + // 0x00053 0x00326: 0x00218 + "\x00\x01\xcc\x00d\xc0\x02\x19" + // 0x00073 0x00326: 0x00219 + "\x00\x01P\x00d\xc0\x02\x1a" + // 0x00054 0x00326: 0x0021A + "\x00\x01\xd0\x00d\xc0\x02\x1b" + // 0x00074 0x00326: 0x0021B + "\x00\x01 \x00a\x80\x02\x1e" + // 0x00048 0x0030C: 0x0021E + "\x00\x01\xa0\x00a\x80\x02\x1f" + // 0x00068 0x0030C: 0x0021F + "\x00\x01\x04\x00`\xe0\x02&" + // 0x00041 0x00307: 0x00226 + "\x00\x01\x84\x00`\xe0\x02'" + // 0x00061 0x00307: 0x00227 + "\x00\x01\x14\x00d\xe0\x02(" + // 0x00045 0x00327: 0x00228 + "\x00\x01\x94\x00d\xe0\x02)" + // 0x00065 0x00327: 0x00229 + "\x00\x03X\x00`\x80\x02*" + // 0x000D6 0x00304: 0x0022A + "\x00\x03\xd8\x00`\x80\x02+" + // 0x000F6 0x00304: 0x0022B + "\x00\x03T\x00`\x80\x02," + // 0x000D5 0x00304: 0x0022C + "\x00\x03\xd4\x00`\x80\x02-" + // 0x000F5 0x00304: 0x0022D + "\x00\x01<\x00`\xe0\x02." + // 0x0004F 0x00307: 0x0022E + "\x00\x01\xbc\x00`\xe0\x02/" + // 0x0006F 0x00307: 0x0022F + "\x00\b\xb8\x00`\x80\x020" + // 0x0022E 0x00304: 0x00230 + "\x00\b\xbc\x00`\x80\x021" + // 0x0022F 0x00304: 0x00231 + "\x00\x01d\x00`\x80\x022" + // 0x00059 0x00304: 0x00232 + "\x00\x01\xe4\x00`\x80\x023" + // 0x00079 0x00304: 0x00233 + "\x00\x02\xa0\x00` \x03\x85" + // 0x000A8 0x00301: 0x00385 + "\x00\x0eD\x00` \x03\x86" + // 0x00391 0x00301: 0x00386 + "\x00\x0eT\x00` \x03\x88" + // 0x00395 0x00301: 0x00388 + "\x00\x0e\\\x00` \x03\x89" + // 0x00397 0x00301: 0x00389 + "\x00\x0ed\x00` \x03\x8a" + // 0x00399 0x00301: 0x0038A + "\x00\x0e|\x00` \x03\x8c" + // 0x0039F 0x00301: 0x0038C + "\x00\x0e\x94\x00` \x03\x8e" + // 0x003A5 0x00301: 0x0038E + "\x00\x0e\xa4\x00` \x03\x8f" + // 0x003A9 0x00301: 0x0038F + "\x00\x0f(\x00` \x03\x90" + // 0x003CA 0x00301: 0x00390 + "\x00\x0ed\x00a\x00\x03\xaa" + // 0x00399 0x00308: 0x003AA + "\x00\x0e\x94\x00a\x00\x03\xab" + // 0x003A5 0x00308: 0x003AB + "\x00\x0e\xc4\x00` \x03\xac" + // 0x003B1 0x00301: 0x003AC + "\x00\x0e\xd4\x00` \x03\xad" + // 0x003B5 0x00301: 0x003AD + "\x00\x0e\xdc\x00` \x03\xae" + // 0x003B7 0x00301: 0x003AE + "\x00\x0e\xe4\x00` \x03\xaf" + // 0x003B9 0x00301: 0x003AF + "\x00\x0f,\x00` \x03\xb0" + // 0x003CB 0x00301: 0x003B0 + "\x00\x0e\xe4\x00a\x00\x03\xca" + // 0x003B9 0x00308: 0x003CA + "\x00\x0f\x14\x00a\x00\x03\xcb" + // 0x003C5 0x00308: 0x003CB + "\x00\x0e\xfc\x00` \x03\xcc" + // 0x003BF 0x00301: 0x003CC + "\x00\x0f\x14\x00` \x03\xcd" + // 0x003C5 0x00301: 0x003CD + "\x00\x0f$\x00` \x03\xce" + // 0x003C9 0x00301: 0x003CE + "\x00\x0fH\x00` \x03\xd3" + // 0x003D2 0x00301: 0x003D3 + "\x00\x0fH\x00a\x00\x03\xd4" + // 0x003D2 0x00308: 0x003D4 + "\x00\x10T\x00`\x00\x04\x00" + // 0x00415 0x00300: 0x00400 + "\x00\x10T\x00a\x00\x04\x01" + // 0x00415 0x00308: 0x00401 + "\x00\x10L\x00` \x04\x03" + // 0x00413 0x00301: 0x00403 + "\x00\x10\x18\x00a\x00\x04\a" + // 0x00406 0x00308: 0x00407 + "\x00\x10h\x00` \x04\f" + // 0x0041A 0x00301: 0x0040C + "\x00\x10`\x00`\x00\x04\r" + // 0x00418 0x00300: 0x0040D + "\x00\x10\x8c\x00`\xc0\x04\x0e" + // 0x00423 0x00306: 0x0040E + "\x00\x10`\x00`\xc0\x04\x19" + // 0x00418 0x00306: 0x00419 + "\x00\x10\xe0\x00`\xc0\x049" + // 0x00438 0x00306: 0x00439 + "\x00\x10\xd4\x00`\x00\x04P" + // 0x00435 0x00300: 0x00450 + "\x00\x10\xd4\x00a\x00\x04Q" + // 0x00435 0x00308: 0x00451 + "\x00\x10\xcc\x00` \x04S" + // 0x00433 0x00301: 0x00453 + "\x00\x11X\x00a\x00\x04W" + // 0x00456 0x00308: 0x00457 + "\x00\x10\xe8\x00` \x04\\" + // 0x0043A 0x00301: 0x0045C + "\x00\x10\xe0\x00`\x00\x04]" + // 0x00438 0x00300: 0x0045D + "\x00\x11\f\x00`\xc0\x04^" + // 0x00443 0x00306: 0x0045E + "\x00\x11\xd0\x00a\xe0\x04v" + // 0x00474 0x0030F: 0x00476 + "\x00\x11\xd4\x00a\xe0\x04w" + // 0x00475 0x0030F: 0x00477 + "\x00\x10X\x00`\xc0\x04\xc1" + // 0x00416 0x00306: 0x004C1 + "\x00\x10\xd8\x00`\xc0\x04\xc2" + // 0x00436 0x00306: 0x004C2 + "\x00\x10@\x00`\xc0\x04\xd0" + // 0x00410 0x00306: 0x004D0 + "\x00\x10\xc0\x00`\xc0\x04\xd1" + // 0x00430 0x00306: 0x004D1 + "\x00\x10@\x00a\x00\x04\xd2" + // 0x00410 0x00308: 0x004D2 + "\x00\x10\xc0\x00a\x00\x04\xd3" + // 0x00430 0x00308: 0x004D3 + "\x00\x10T\x00`\xc0\x04\xd6" + // 0x00415 0x00306: 0x004D6 + "\x00\x10\xd4\x00`\xc0\x04\xd7" + // 0x00435 0x00306: 0x004D7 + "\x00\x13`\x00a\x00\x04\xda" + // 0x004D8 0x00308: 0x004DA + "\x00\x13d\x00a\x00\x04\xdb" + // 0x004D9 0x00308: 0x004DB + "\x00\x10X\x00a\x00\x04\xdc" + // 0x00416 0x00308: 0x004DC + "\x00\x10\xd8\x00a\x00\x04\xdd" + // 0x00436 0x00308: 0x004DD + "\x00\x10\\\x00a\x00\x04\xde" + // 0x00417 0x00308: 0x004DE + "\x00\x10\xdc\x00a\x00\x04\xdf" + // 0x00437 0x00308: 0x004DF + "\x00\x10`\x00`\x80\x04\xe2" + // 0x00418 0x00304: 0x004E2 + "\x00\x10\xe0\x00`\x80\x04\xe3" + // 0x00438 0x00304: 0x004E3 + "\x00\x10`\x00a\x00\x04\xe4" + // 0x00418 0x00308: 0x004E4 + "\x00\x10\xe0\x00a\x00\x04\xe5" + // 0x00438 0x00308: 0x004E5 + "\x00\x10x\x00a\x00\x04\xe6" + // 0x0041E 0x00308: 0x004E6 + "\x00\x10\xf8\x00a\x00\x04\xe7" + // 0x0043E 0x00308: 0x004E7 + "\x00\x13\xa0\x00a\x00\x04\xea" + // 0x004E8 0x00308: 0x004EA + "\x00\x13\xa4\x00a\x00\x04\xeb" + // 0x004E9 0x00308: 0x004EB + "\x00\x10\xb4\x00a\x00\x04\xec" + // 0x0042D 0x00308: 0x004EC + "\x00\x114\x00a\x00\x04\xed" + // 0x0044D 0x00308: 0x004ED + "\x00\x10\x8c\x00`\x80\x04\xee" + // 0x00423 0x00304: 0x004EE + "\x00\x11\f\x00`\x80\x04\xef" + // 0x00443 0x00304: 0x004EF + "\x00\x10\x8c\x00a\x00\x04\xf0" + // 0x00423 0x00308: 0x004F0 + "\x00\x11\f\x00a\x00\x04\xf1" + // 0x00443 0x00308: 0x004F1 + "\x00\x10\x8c\x00a`\x04\xf2" + // 0x00423 0x0030B: 0x004F2 + "\x00\x11\f\x00a`\x04\xf3" + // 0x00443 0x0030B: 0x004F3 + "\x00\x10\x9c\x00a\x00\x04\xf4" + // 0x00427 0x00308: 0x004F4 + "\x00\x11\x1c\x00a\x00\x04\xf5" + // 0x00447 0x00308: 0x004F5 + "\x00\x10\xac\x00a\x00\x04\xf8" + // 0x0042B 0x00308: 0x004F8 + "\x00\x11,\x00a\x00\x04\xf9" + // 0x0044B 0x00308: 0x004F9 + "\x00\x18\x9c\x00\xca`\x06\"" + // 0x00627 0x00653: 0x00622 + "\x00\x18\x9c\x00ʀ\x06#" + // 0x00627 0x00654: 0x00623 + "\x00\x19 \x00ʀ\x06$" + // 0x00648 0x00654: 0x00624 + "\x00\x18\x9c\x00ʠ\x06%" + // 0x00627 0x00655: 0x00625 + "\x00\x19(\x00ʀ\x06&" + // 0x0064A 0x00654: 0x00626 + "\x00\x1bT\x00ʀ\x06\xc0" + // 0x006D5 0x00654: 0x006C0 + "\x00\x1b\x04\x00ʀ\x06\xc2" + // 0x006C1 0x00654: 0x006C2 + "\x00\x1bH\x00ʀ\x06\xd3" + // 0x006D2 0x00654: 0x006D3 + "\x00$\xa0\x01'\x80\t)" + // 0x00928 0x0093C: 0x00929 + "\x00$\xc0\x01'\x80\t1" + // 0x00930 0x0093C: 0x00931 + "\x00$\xcc\x01'\x80\t4" + // 0x00933 0x0093C: 0x00934 + "\x00'\x1c\x017\xc0\t\xcb" + // 0x009C7 0x009BE: 0x009CB + "\x00'\x1c\x01:\xe0\t\xcc" + // 0x009C7 0x009D7: 0x009CC + "\x00-\x1c\x01j\xc0\vH" + // 0x00B47 0x00B56: 0x00B48 + "\x00-\x1c\x01g\xc0\vK" + // 0x00B47 0x00B3E: 0x00B4B + "\x00-\x1c\x01j\xe0\vL" + // 0x00B47 0x00B57: 0x00B4C + "\x00.H\x01z\xe0\v\x94" + // 0x00B92 0x00BD7: 0x00B94 + "\x00/\x18\x01w\xc0\v\xca" + // 0x00BC6 0x00BBE: 0x00BCA + "\x00/\x1c\x01w\xc0\v\xcb" + // 0x00BC7 0x00BBE: 0x00BCB + "\x00/\x18\x01z\xe0\v\xcc" + // 0x00BC6 0x00BD7: 0x00BCC + "\x001\x18\x01\x8a\xc0\fH" + // 0x00C46 0x00C56: 0x00C48 + "\x002\xfc\x01\x9a\xa0\f\xc0" + // 0x00CBF 0x00CD5: 0x00CC0 + "\x003\x18\x01\x9a\xa0\f\xc7" + // 0x00CC6 0x00CD5: 0x00CC7 + "\x003\x18\x01\x9a\xc0\f\xc8" + // 0x00CC6 0x00CD6: 0x00CC8 + "\x003\x18\x01\x98@\f\xca" + // 0x00CC6 0x00CC2: 0x00CCA + "\x003(\x01\x9a\xa0\f\xcb" + // 0x00CCA 0x00CD5: 0x00CCB + "\x005\x18\x01\xa7\xc0\rJ" + // 0x00D46 0x00D3E: 0x00D4A + "\x005\x1c\x01\xa7\xc0\rK" + // 0x00D47 0x00D3E: 0x00D4B + "\x005\x18\x01\xaa\xe0\rL" + // 0x00D46 0x00D57: 0x00D4C + "\x007d\x01\xb9@\r\xda" + // 0x00DD9 0x00DCA: 0x00DDA + "\x007d\x01\xb9\xe0\r\xdc" + // 0x00DD9 0x00DCF: 0x00DDC + "\x007p\x01\xb9@\r\xdd" + // 0x00DDC 0x00DCA: 0x00DDD + "\x007d\x01\xbb\xe0\r\xde" + // 0x00DD9 0x00DDF: 0x00DDE + "\x00@\x94\x02\x05\xc0\x10&" + // 0x01025 0x0102E: 0x01026 + "\x00l\x14\x03f\xa0\x1b\x06" + // 0x01B05 0x01B35: 0x01B06 + "\x00l\x1c\x03f\xa0\x1b\b" + // 0x01B07 0x01B35: 0x01B08 + "\x00l$\x03f\xa0\x1b\n" + // 0x01B09 0x01B35: 0x01B0A + "\x00l,\x03f\xa0\x1b\f" + // 0x01B0B 0x01B35: 0x01B0C + "\x00l4\x03f\xa0\x1b\x0e" + // 0x01B0D 0x01B35: 0x01B0E + "\x00lD\x03f\xa0\x1b\x12" + // 0x01B11 0x01B35: 0x01B12 + "\x00l\xe8\x03f\xa0\x1b;" + // 0x01B3A 0x01B35: 0x01B3B + "\x00l\xf0\x03f\xa0\x1b=" + // 0x01B3C 0x01B35: 0x01B3D + "\x00l\xf8\x03f\xa0\x1b@" + // 0x01B3E 0x01B35: 0x01B40 + "\x00l\xfc\x03f\xa0\x1bA" + // 0x01B3F 0x01B35: 0x01B41 + "\x00m\b\x03f\xa0\x1bC" + // 0x01B42 0x01B35: 0x01B43 + "\x00\x01\x04\x00d\xa0\x1e\x00" + // 0x00041 0x00325: 0x01E00 + "\x00\x01\x84\x00d\xa0\x1e\x01" + // 0x00061 0x00325: 0x01E01 + "\x00\x01\b\x00`\xe0\x1e\x02" + // 0x00042 0x00307: 0x01E02 + "\x00\x01\x88\x00`\xe0\x1e\x03" + // 0x00062 0x00307: 0x01E03 + "\x00\x01\b\x00d`\x1e\x04" + // 0x00042 0x00323: 0x01E04 + "\x00\x01\x88\x00d`\x1e\x05" + // 0x00062 0x00323: 0x01E05 + "\x00\x01\b\x00f \x1e\x06" + // 0x00042 0x00331: 0x01E06 + "\x00\x01\x88\x00f \x1e\a" + // 0x00062 0x00331: 0x01E07 + "\x00\x03\x1c\x00` \x1e\b" + // 0x000C7 0x00301: 0x01E08 + "\x00\x03\x9c\x00` \x1e\t" + // 0x000E7 0x00301: 0x01E09 + "\x00\x01\x10\x00`\xe0\x1e\n" + // 0x00044 0x00307: 0x01E0A + "\x00\x01\x90\x00`\xe0\x1e\v" + // 0x00064 0x00307: 0x01E0B + "\x00\x01\x10\x00d`\x1e\f" + // 0x00044 0x00323: 0x01E0C + "\x00\x01\x90\x00d`\x1e\r" + // 0x00064 0x00323: 0x01E0D + "\x00\x01\x10\x00f \x1e\x0e" + // 0x00044 0x00331: 0x01E0E + "\x00\x01\x90\x00f \x1e\x0f" + // 0x00064 0x00331: 0x01E0F + "\x00\x01\x10\x00d\xe0\x1e\x10" + // 0x00044 0x00327: 0x01E10 + "\x00\x01\x90\x00d\xe0\x1e\x11" + // 0x00064 0x00327: 0x01E11 + "\x00\x01\x10\x00e\xa0\x1e\x12" + // 0x00044 0x0032D: 0x01E12 + "\x00\x01\x90\x00e\xa0\x1e\x13" + // 0x00064 0x0032D: 0x01E13 + "\x00\x04H\x00`\x00\x1e\x14" + // 0x00112 0x00300: 0x01E14 + "\x00\x04L\x00`\x00\x1e\x15" + // 0x00113 0x00300: 0x01E15 + "\x00\x04H\x00` \x1e\x16" + // 0x00112 0x00301: 0x01E16 + "\x00\x04L\x00` \x1e\x17" + // 0x00113 0x00301: 0x01E17 + "\x00\x01\x14\x00e\xa0\x1e\x18" + // 0x00045 0x0032D: 0x01E18 + "\x00\x01\x94\x00e\xa0\x1e\x19" + // 0x00065 0x0032D: 0x01E19 + "\x00\x01\x14\x00f\x00\x1e\x1a" + // 0x00045 0x00330: 0x01E1A + "\x00\x01\x94\x00f\x00\x1e\x1b" + // 0x00065 0x00330: 0x01E1B + "\x00\b\xa0\x00`\xc0\x1e\x1c" + // 0x00228 0x00306: 0x01E1C + "\x00\b\xa4\x00`\xc0\x1e\x1d" + // 0x00229 0x00306: 0x01E1D + "\x00\x01\x18\x00`\xe0\x1e\x1e" + // 0x00046 0x00307: 0x01E1E + "\x00\x01\x98\x00`\xe0\x1e\x1f" + // 0x00066 0x00307: 0x01E1F + "\x00\x01\x1c\x00`\x80\x1e " + // 0x00047 0x00304: 0x01E20 + "\x00\x01\x9c\x00`\x80\x1e!" + // 0x00067 0x00304: 0x01E21 + "\x00\x01 \x00`\xe0\x1e\"" + // 0x00048 0x00307: 0x01E22 + "\x00\x01\xa0\x00`\xe0\x1e#" + // 0x00068 0x00307: 0x01E23 + "\x00\x01 \x00d`\x1e$" + // 0x00048 0x00323: 0x01E24 + "\x00\x01\xa0\x00d`\x1e%" + // 0x00068 0x00323: 0x01E25 + "\x00\x01 \x00a\x00\x1e&" + // 0x00048 0x00308: 0x01E26 + "\x00\x01\xa0\x00a\x00\x1e'" + // 0x00068 0x00308: 0x01E27 + "\x00\x01 \x00d\xe0\x1e(" + // 0x00048 0x00327: 0x01E28 + "\x00\x01\xa0\x00d\xe0\x1e)" + // 0x00068 0x00327: 0x01E29 + "\x00\x01 \x00e\xc0\x1e*" + // 0x00048 0x0032E: 0x01E2A + "\x00\x01\xa0\x00e\xc0\x1e+" + // 0x00068 0x0032E: 0x01E2B + "\x00\x01$\x00f\x00\x1e," + // 0x00049 0x00330: 0x01E2C + "\x00\x01\xa4\x00f\x00\x1e-" + // 0x00069 0x00330: 0x01E2D + "\x00\x03<\x00` \x1e." + // 0x000CF 0x00301: 0x01E2E + "\x00\x03\xbc\x00` \x1e/" + // 0x000EF 0x00301: 0x01E2F + "\x00\x01,\x00` \x1e0" + // 0x0004B 0x00301: 0x01E30 + "\x00\x01\xac\x00` \x1e1" + // 0x0006B 0x00301: 0x01E31 + "\x00\x01,\x00d`\x1e2" + // 0x0004B 0x00323: 0x01E32 + "\x00\x01\xac\x00d`\x1e3" + // 0x0006B 0x00323: 0x01E33 + "\x00\x01,\x00f \x1e4" + // 0x0004B 0x00331: 0x01E34 + "\x00\x01\xac\x00f \x1e5" + // 0x0006B 0x00331: 0x01E35 + "\x00\x010\x00d`\x1e6" + // 0x0004C 0x00323: 0x01E36 + "\x00\x01\xb0\x00d`\x1e7" + // 0x0006C 0x00323: 0x01E37 + "\x00x\xd8\x00`\x80\x1e8" + // 0x01E36 0x00304: 0x01E38 + "\x00x\xdc\x00`\x80\x1e9" + // 0x01E37 0x00304: 0x01E39 + "\x00\x010\x00f \x1e:" + // 0x0004C 0x00331: 0x01E3A + "\x00\x01\xb0\x00f \x1e;" + // 0x0006C 0x00331: 0x01E3B + "\x00\x010\x00e\xa0\x1e<" + // 0x0004C 0x0032D: 0x01E3C + "\x00\x01\xb0\x00e\xa0\x1e=" + // 0x0006C 0x0032D: 0x01E3D + "\x00\x014\x00` \x1e>" + // 0x0004D 0x00301: 0x01E3E + "\x00\x01\xb4\x00` \x1e?" + // 0x0006D 0x00301: 0x01E3F + "\x00\x014\x00`\xe0\x1e@" + // 0x0004D 0x00307: 0x01E40 + "\x00\x01\xb4\x00`\xe0\x1eA" + // 0x0006D 0x00307: 0x01E41 + "\x00\x014\x00d`\x1eB" + // 0x0004D 0x00323: 0x01E42 + "\x00\x01\xb4\x00d`\x1eC" + // 0x0006D 0x00323: 0x01E43 + "\x00\x018\x00`\xe0\x1eD" + // 0x0004E 0x00307: 0x01E44 + "\x00\x01\xb8\x00`\xe0\x1eE" + // 0x0006E 0x00307: 0x01E45 + "\x00\x018\x00d`\x1eF" + // 0x0004E 0x00323: 0x01E46 + "\x00\x01\xb8\x00d`\x1eG" + // 0x0006E 0x00323: 0x01E47 + "\x00\x018\x00f \x1eH" + // 0x0004E 0x00331: 0x01E48 + "\x00\x01\xb8\x00f \x1eI" + // 0x0006E 0x00331: 0x01E49 + "\x00\x018\x00e\xa0\x1eJ" + // 0x0004E 0x0032D: 0x01E4A + "\x00\x01\xb8\x00e\xa0\x1eK" + // 0x0006E 0x0032D: 0x01E4B + "\x00\x03T\x00` \x1eL" + // 0x000D5 0x00301: 0x01E4C + "\x00\x03\xd4\x00` \x1eM" + // 0x000F5 0x00301: 0x01E4D + "\x00\x03T\x00a\x00\x1eN" + // 0x000D5 0x00308: 0x01E4E + "\x00\x03\xd4\x00a\x00\x1eO" + // 0x000F5 0x00308: 0x01E4F + "\x00\x050\x00`\x00\x1eP" + // 0x0014C 0x00300: 0x01E50 + "\x00\x054\x00`\x00\x1eQ" + // 0x0014D 0x00300: 0x01E51 + "\x00\x050\x00` \x1eR" + // 0x0014C 0x00301: 0x01E52 + "\x00\x054\x00` \x1eS" + // 0x0014D 0x00301: 0x01E53 + "\x00\x01@\x00` \x1eT" + // 0x00050 0x00301: 0x01E54 + "\x00\x01\xc0\x00` \x1eU" + // 0x00070 0x00301: 0x01E55 + "\x00\x01@\x00`\xe0\x1eV" + // 0x00050 0x00307: 0x01E56 + "\x00\x01\xc0\x00`\xe0\x1eW" + // 0x00070 0x00307: 0x01E57 + "\x00\x01H\x00`\xe0\x1eX" + // 0x00052 0x00307: 0x01E58 + "\x00\x01\xc8\x00`\xe0\x1eY" + // 0x00072 0x00307: 0x01E59 + "\x00\x01H\x00d`\x1eZ" + // 0x00052 0x00323: 0x01E5A + "\x00\x01\xc8\x00d`\x1e[" + // 0x00072 0x00323: 0x01E5B + "\x00yh\x00`\x80\x1e\\" + // 0x01E5A 0x00304: 0x01E5C + "\x00yl\x00`\x80\x1e]" + // 0x01E5B 0x00304: 0x01E5D + "\x00\x01H\x00f \x1e^" + // 0x00052 0x00331: 0x01E5E + "\x00\x01\xc8\x00f \x1e_" + // 0x00072 0x00331: 0x01E5F + "\x00\x01L\x00`\xe0\x1e`" + // 0x00053 0x00307: 0x01E60 + "\x00\x01\xcc\x00`\xe0\x1ea" + // 0x00073 0x00307: 0x01E61 + "\x00\x01L\x00d`\x1eb" + // 0x00053 0x00323: 0x01E62 + "\x00\x01\xcc\x00d`\x1ec" + // 0x00073 0x00323: 0x01E63 + "\x00\x05h\x00`\xe0\x1ed" + // 0x0015A 0x00307: 0x01E64 + "\x00\x05l\x00`\xe0\x1ee" + // 0x0015B 0x00307: 0x01E65 + "\x00\x05\x80\x00`\xe0\x1ef" + // 0x00160 0x00307: 0x01E66 + "\x00\x05\x84\x00`\xe0\x1eg" + // 0x00161 0x00307: 0x01E67 + "\x00y\x88\x00`\xe0\x1eh" + // 0x01E62 0x00307: 0x01E68 + "\x00y\x8c\x00`\xe0\x1ei" + // 0x01E63 0x00307: 0x01E69 + "\x00\x01P\x00`\xe0\x1ej" + // 0x00054 0x00307: 0x01E6A + "\x00\x01\xd0\x00`\xe0\x1ek" + // 0x00074 0x00307: 0x01E6B + "\x00\x01P\x00d`\x1el" + // 0x00054 0x00323: 0x01E6C + "\x00\x01\xd0\x00d`\x1em" + // 0x00074 0x00323: 0x01E6D + "\x00\x01P\x00f \x1en" + // 0x00054 0x00331: 0x01E6E + "\x00\x01\xd0\x00f \x1eo" + // 0x00074 0x00331: 0x01E6F + "\x00\x01P\x00e\xa0\x1ep" + // 0x00054 0x0032D: 0x01E70 + "\x00\x01\xd0\x00e\xa0\x1eq" + // 0x00074 0x0032D: 0x01E71 + "\x00\x01T\x00d\x80\x1er" + // 0x00055 0x00324: 0x01E72 + "\x00\x01\xd4\x00d\x80\x1es" + // 0x00075 0x00324: 0x01E73 + "\x00\x01T\x00f\x00\x1et" + // 0x00055 0x00330: 0x01E74 + "\x00\x01\xd4\x00f\x00\x1eu" + // 0x00075 0x00330: 0x01E75 + "\x00\x01T\x00e\xa0\x1ev" + // 0x00055 0x0032D: 0x01E76 + "\x00\x01\xd4\x00e\xa0\x1ew" + // 0x00075 0x0032D: 0x01E77 + "\x00\x05\xa0\x00` \x1ex" + // 0x00168 0x00301: 0x01E78 + "\x00\x05\xa4\x00` \x1ey" + // 0x00169 0x00301: 0x01E79 + "\x00\x05\xa8\x00a\x00\x1ez" + // 0x0016A 0x00308: 0x01E7A + "\x00\x05\xac\x00a\x00\x1e{" + // 0x0016B 0x00308: 0x01E7B + "\x00\x01X\x00``\x1e|" + // 0x00056 0x00303: 0x01E7C + "\x00\x01\xd8\x00``\x1e}" + // 0x00076 0x00303: 0x01E7D + "\x00\x01X\x00d`\x1e~" + // 0x00056 0x00323: 0x01E7E + "\x00\x01\xd8\x00d`\x1e\x7f" + // 0x00076 0x00323: 0x01E7F + "\x00\x01\\\x00`\x00\x1e\x80" + // 0x00057 0x00300: 0x01E80 + "\x00\x01\xdc\x00`\x00\x1e\x81" + // 0x00077 0x00300: 0x01E81 + "\x00\x01\\\x00` \x1e\x82" + // 0x00057 0x00301: 0x01E82 + "\x00\x01\xdc\x00` \x1e\x83" + // 0x00077 0x00301: 0x01E83 + "\x00\x01\\\x00a\x00\x1e\x84" + // 0x00057 0x00308: 0x01E84 + "\x00\x01\xdc\x00a\x00\x1e\x85" + // 0x00077 0x00308: 0x01E85 + "\x00\x01\\\x00`\xe0\x1e\x86" + // 0x00057 0x00307: 0x01E86 + "\x00\x01\xdc\x00`\xe0\x1e\x87" + // 0x00077 0x00307: 0x01E87 + "\x00\x01\\\x00d`\x1e\x88" + // 0x00057 0x00323: 0x01E88 + "\x00\x01\xdc\x00d`\x1e\x89" + // 0x00077 0x00323: 0x01E89 + "\x00\x01`\x00`\xe0\x1e\x8a" + // 0x00058 0x00307: 0x01E8A + "\x00\x01\xe0\x00`\xe0\x1e\x8b" + // 0x00078 0x00307: 0x01E8B + "\x00\x01`\x00a\x00\x1e\x8c" + // 0x00058 0x00308: 0x01E8C + "\x00\x01\xe0\x00a\x00\x1e\x8d" + // 0x00078 0x00308: 0x01E8D + "\x00\x01d\x00`\xe0\x1e\x8e" + // 0x00059 0x00307: 0x01E8E + "\x00\x01\xe4\x00`\xe0\x1e\x8f" + // 0x00079 0x00307: 0x01E8F + "\x00\x01h\x00`@\x1e\x90" + // 0x0005A 0x00302: 0x01E90 + "\x00\x01\xe8\x00`@\x1e\x91" + // 0x0007A 0x00302: 0x01E91 + "\x00\x01h\x00d`\x1e\x92" + // 0x0005A 0x00323: 0x01E92 + "\x00\x01\xe8\x00d`\x1e\x93" + // 0x0007A 0x00323: 0x01E93 + "\x00\x01h\x00f \x1e\x94" + // 0x0005A 0x00331: 0x01E94 + "\x00\x01\xe8\x00f \x1e\x95" + // 0x0007A 0x00331: 0x01E95 + "\x00\x01\xa0\x00f \x1e\x96" + // 0x00068 0x00331: 0x01E96 + "\x00\x01\xd0\x00a\x00\x1e\x97" + // 0x00074 0x00308: 0x01E97 + "\x00\x01\xdc\x00a@\x1e\x98" + // 0x00077 0x0030A: 0x01E98 + "\x00\x01\xe4\x00a@\x1e\x99" + // 0x00079 0x0030A: 0x01E99 + "\x00\x05\xfc\x00`\xe0\x1e\x9b" + // 0x0017F 0x00307: 0x01E9B + "\x00\x01\x04\x00d`\x1e\xa0" + // 0x00041 0x00323: 0x01EA0 + "\x00\x01\x84\x00d`\x1e\xa1" + // 0x00061 0x00323: 0x01EA1 + "\x00\x01\x04\x00a \x1e\xa2" + // 0x00041 0x00309: 0x01EA2 + "\x00\x01\x84\x00a \x1e\xa3" + // 0x00061 0x00309: 0x01EA3 + "\x00\x03\b\x00` \x1e\xa4" + // 0x000C2 0x00301: 0x01EA4 + "\x00\x03\x88\x00` \x1e\xa5" + // 0x000E2 0x00301: 0x01EA5 + "\x00\x03\b\x00`\x00\x1e\xa6" + // 0x000C2 0x00300: 0x01EA6 + "\x00\x03\x88\x00`\x00\x1e\xa7" + // 0x000E2 0x00300: 0x01EA7 + "\x00\x03\b\x00a \x1e\xa8" + // 0x000C2 0x00309: 0x01EA8 + "\x00\x03\x88\x00a \x1e\xa9" + // 0x000E2 0x00309: 0x01EA9 + "\x00\x03\b\x00``\x1e\xaa" + // 0x000C2 0x00303: 0x01EAA + "\x00\x03\x88\x00``\x1e\xab" + // 0x000E2 0x00303: 0x01EAB + "\x00z\x80\x00`@\x1e\xac" + // 0x01EA0 0x00302: 0x01EAC + "\x00z\x84\x00`@\x1e\xad" + // 0x01EA1 0x00302: 0x01EAD + "\x00\x04\b\x00` \x1e\xae" + // 0x00102 0x00301: 0x01EAE + "\x00\x04\f\x00` \x1e\xaf" + // 0x00103 0x00301: 0x01EAF + "\x00\x04\b\x00`\x00\x1e\xb0" + // 0x00102 0x00300: 0x01EB0 + "\x00\x04\f\x00`\x00\x1e\xb1" + // 0x00103 0x00300: 0x01EB1 + "\x00\x04\b\x00a \x1e\xb2" + // 0x00102 0x00309: 0x01EB2 + "\x00\x04\f\x00a \x1e\xb3" + // 0x00103 0x00309: 0x01EB3 + "\x00\x04\b\x00``\x1e\xb4" + // 0x00102 0x00303: 0x01EB4 + "\x00\x04\f\x00``\x1e\xb5" + // 0x00103 0x00303: 0x01EB5 + "\x00z\x80\x00`\xc0\x1e\xb6" + // 0x01EA0 0x00306: 0x01EB6 + "\x00z\x84\x00`\xc0\x1e\xb7" + // 0x01EA1 0x00306: 0x01EB7 + "\x00\x01\x14\x00d`\x1e\xb8" + // 0x00045 0x00323: 0x01EB8 + "\x00\x01\x94\x00d`\x1e\xb9" + // 0x00065 0x00323: 0x01EB9 + "\x00\x01\x14\x00a \x1e\xba" + // 0x00045 0x00309: 0x01EBA + "\x00\x01\x94\x00a \x1e\xbb" + // 0x00065 0x00309: 0x01EBB + "\x00\x01\x14\x00``\x1e\xbc" + // 0x00045 0x00303: 0x01EBC + "\x00\x01\x94\x00``\x1e\xbd" + // 0x00065 0x00303: 0x01EBD + "\x00\x03(\x00` \x1e\xbe" + // 0x000CA 0x00301: 0x01EBE + "\x00\x03\xa8\x00` \x1e\xbf" + // 0x000EA 0x00301: 0x01EBF + "\x00\x03(\x00`\x00\x1e\xc0" + // 0x000CA 0x00300: 0x01EC0 + "\x00\x03\xa8\x00`\x00\x1e\xc1" + // 0x000EA 0x00300: 0x01EC1 + "\x00\x03(\x00a \x1e\xc2" + // 0x000CA 0x00309: 0x01EC2 + "\x00\x03\xa8\x00a \x1e\xc3" + // 0x000EA 0x00309: 0x01EC3 + "\x00\x03(\x00``\x1e\xc4" + // 0x000CA 0x00303: 0x01EC4 + "\x00\x03\xa8\x00``\x1e\xc5" + // 0x000EA 0x00303: 0x01EC5 + "\x00z\xe0\x00`@\x1e\xc6" + // 0x01EB8 0x00302: 0x01EC6 + "\x00z\xe4\x00`@\x1e\xc7" + // 0x01EB9 0x00302: 0x01EC7 + "\x00\x01$\x00a \x1e\xc8" + // 0x00049 0x00309: 0x01EC8 + "\x00\x01\xa4\x00a \x1e\xc9" + // 0x00069 0x00309: 0x01EC9 + "\x00\x01$\x00d`\x1e\xca" + // 0x00049 0x00323: 0x01ECA + "\x00\x01\xa4\x00d`\x1e\xcb" + // 0x00069 0x00323: 0x01ECB + "\x00\x01<\x00d`\x1e\xcc" + // 0x0004F 0x00323: 0x01ECC + "\x00\x01\xbc\x00d`\x1e\xcd" + // 0x0006F 0x00323: 0x01ECD + "\x00\x01<\x00a \x1e\xce" + // 0x0004F 0x00309: 0x01ECE + "\x00\x01\xbc\x00a \x1e\xcf" + // 0x0006F 0x00309: 0x01ECF + "\x00\x03P\x00` \x1e\xd0" + // 0x000D4 0x00301: 0x01ED0 + "\x00\x03\xd0\x00` \x1e\xd1" + // 0x000F4 0x00301: 0x01ED1 + "\x00\x03P\x00`\x00\x1e\xd2" + // 0x000D4 0x00300: 0x01ED2 + "\x00\x03\xd0\x00`\x00\x1e\xd3" + // 0x000F4 0x00300: 0x01ED3 + "\x00\x03P\x00a \x1e\xd4" + // 0x000D4 0x00309: 0x01ED4 + "\x00\x03\xd0\x00a \x1e\xd5" + // 0x000F4 0x00309: 0x01ED5 + "\x00\x03P\x00``\x1e\xd6" + // 0x000D4 0x00303: 0x01ED6 + "\x00\x03\xd0\x00``\x1e\xd7" + // 0x000F4 0x00303: 0x01ED7 + "\x00{0\x00`@\x1e\xd8" + // 0x01ECC 0x00302: 0x01ED8 + "\x00{4\x00`@\x1e\xd9" + // 0x01ECD 0x00302: 0x01ED9 + "\x00\x06\x80\x00` \x1e\xda" + // 0x001A0 0x00301: 0x01EDA + "\x00\x06\x84\x00` \x1e\xdb" + // 0x001A1 0x00301: 0x01EDB + "\x00\x06\x80\x00`\x00\x1e\xdc" + // 0x001A0 0x00300: 0x01EDC + "\x00\x06\x84\x00`\x00\x1e\xdd" + // 0x001A1 0x00300: 0x01EDD + "\x00\x06\x80\x00a \x1e\xde" + // 0x001A0 0x00309: 0x01EDE + "\x00\x06\x84\x00a \x1e\xdf" + // 0x001A1 0x00309: 0x01EDF + "\x00\x06\x80\x00``\x1e\xe0" + // 0x001A0 0x00303: 0x01EE0 + "\x00\x06\x84\x00``\x1e\xe1" + // 0x001A1 0x00303: 0x01EE1 + "\x00\x06\x80\x00d`\x1e\xe2" + // 0x001A0 0x00323: 0x01EE2 + "\x00\x06\x84\x00d`\x1e\xe3" + // 0x001A1 0x00323: 0x01EE3 + "\x00\x01T\x00d`\x1e\xe4" + // 0x00055 0x00323: 0x01EE4 + "\x00\x01\xd4\x00d`\x1e\xe5" + // 0x00075 0x00323: 0x01EE5 + "\x00\x01T\x00a \x1e\xe6" + // 0x00055 0x00309: 0x01EE6 + "\x00\x01\xd4\x00a \x1e\xe7" + // 0x00075 0x00309: 0x01EE7 + "\x00\x06\xbc\x00` \x1e\xe8" + // 0x001AF 0x00301: 0x01EE8 + "\x00\x06\xc0\x00` \x1e\xe9" + // 0x001B0 0x00301: 0x01EE9 + "\x00\x06\xbc\x00`\x00\x1e\xea" + // 0x001AF 0x00300: 0x01EEA + "\x00\x06\xc0\x00`\x00\x1e\xeb" + // 0x001B0 0x00300: 0x01EEB + "\x00\x06\xbc\x00a \x1e\xec" + // 0x001AF 0x00309: 0x01EEC + "\x00\x06\xc0\x00a \x1e\xed" + // 0x001B0 0x00309: 0x01EED + "\x00\x06\xbc\x00``\x1e\xee" + // 0x001AF 0x00303: 0x01EEE + "\x00\x06\xc0\x00``\x1e\xef" + // 0x001B0 0x00303: 0x01EEF + "\x00\x06\xbc\x00d`\x1e\xf0" + // 0x001AF 0x00323: 0x01EF0 + "\x00\x06\xc0\x00d`\x1e\xf1" + // 0x001B0 0x00323: 0x01EF1 + "\x00\x01d\x00`\x00\x1e\xf2" + // 0x00059 0x00300: 0x01EF2 + "\x00\x01\xe4\x00`\x00\x1e\xf3" + // 0x00079 0x00300: 0x01EF3 + "\x00\x01d\x00d`\x1e\xf4" + // 0x00059 0x00323: 0x01EF4 + "\x00\x01\xe4\x00d`\x1e\xf5" + // 0x00079 0x00323: 0x01EF5 + "\x00\x01d\x00a \x1e\xf6" + // 0x00059 0x00309: 0x01EF6 + "\x00\x01\xe4\x00a \x1e\xf7" + // 0x00079 0x00309: 0x01EF7 + "\x00\x01d\x00``\x1e\xf8" + // 0x00059 0x00303: 0x01EF8 + "\x00\x01\xe4\x00``\x1e\xf9" + // 0x00079 0x00303: 0x01EF9 + "\x00\x0e\xc4\x00b`\x1f\x00" + // 0x003B1 0x00313: 0x01F00 + "\x00\x0e\xc4\x00b\x80\x1f\x01" + // 0x003B1 0x00314: 0x01F01 + "\x00|\x00\x00`\x00\x1f\x02" + // 0x01F00 0x00300: 0x01F02 + "\x00|\x04\x00`\x00\x1f\x03" + // 0x01F01 0x00300: 0x01F03 + "\x00|\x00\x00` \x1f\x04" + // 0x01F00 0x00301: 0x01F04 + "\x00|\x04\x00` \x1f\x05" + // 0x01F01 0x00301: 0x01F05 + "\x00|\x00\x00h@\x1f\x06" + // 0x01F00 0x00342: 0x01F06 + "\x00|\x04\x00h@\x1f\a" + // 0x01F01 0x00342: 0x01F07 + "\x00\x0eD\x00b`\x1f\b" + // 0x00391 0x00313: 0x01F08 + "\x00\x0eD\x00b\x80\x1f\t" + // 0x00391 0x00314: 0x01F09 + "\x00| \x00`\x00\x1f\n" + // 0x01F08 0x00300: 0x01F0A + "\x00|$\x00`\x00\x1f\v" + // 0x01F09 0x00300: 0x01F0B + "\x00| \x00` \x1f\f" + // 0x01F08 0x00301: 0x01F0C + "\x00|$\x00` \x1f\r" + // 0x01F09 0x00301: 0x01F0D + "\x00| \x00h@\x1f\x0e" + // 0x01F08 0x00342: 0x01F0E + "\x00|$\x00h@\x1f\x0f" + // 0x01F09 0x00342: 0x01F0F + "\x00\x0e\xd4\x00b`\x1f\x10" + // 0x003B5 0x00313: 0x01F10 + "\x00\x0e\xd4\x00b\x80\x1f\x11" + // 0x003B5 0x00314: 0x01F11 + "\x00|@\x00`\x00\x1f\x12" + // 0x01F10 0x00300: 0x01F12 + "\x00|D\x00`\x00\x1f\x13" + // 0x01F11 0x00300: 0x01F13 + "\x00|@\x00` \x1f\x14" + // 0x01F10 0x00301: 0x01F14 + "\x00|D\x00` \x1f\x15" + // 0x01F11 0x00301: 0x01F15 + "\x00\x0eT\x00b`\x1f\x18" + // 0x00395 0x00313: 0x01F18 + "\x00\x0eT\x00b\x80\x1f\x19" + // 0x00395 0x00314: 0x01F19 + "\x00|`\x00`\x00\x1f\x1a" + // 0x01F18 0x00300: 0x01F1A + "\x00|d\x00`\x00\x1f\x1b" + // 0x01F19 0x00300: 0x01F1B + "\x00|`\x00` \x1f\x1c" + // 0x01F18 0x00301: 0x01F1C + "\x00|d\x00` \x1f\x1d" + // 0x01F19 0x00301: 0x01F1D + "\x00\x0e\xdc\x00b`\x1f " + // 0x003B7 0x00313: 0x01F20 + "\x00\x0e\xdc\x00b\x80\x1f!" + // 0x003B7 0x00314: 0x01F21 + "\x00|\x80\x00`\x00\x1f\"" + // 0x01F20 0x00300: 0x01F22 + "\x00|\x84\x00`\x00\x1f#" + // 0x01F21 0x00300: 0x01F23 + "\x00|\x80\x00` \x1f$" + // 0x01F20 0x00301: 0x01F24 + "\x00|\x84\x00` \x1f%" + // 0x01F21 0x00301: 0x01F25 + "\x00|\x80\x00h@\x1f&" + // 0x01F20 0x00342: 0x01F26 + "\x00|\x84\x00h@\x1f'" + // 0x01F21 0x00342: 0x01F27 + "\x00\x0e\\\x00b`\x1f(" + // 0x00397 0x00313: 0x01F28 + "\x00\x0e\\\x00b\x80\x1f)" + // 0x00397 0x00314: 0x01F29 + "\x00|\xa0\x00`\x00\x1f*" + // 0x01F28 0x00300: 0x01F2A + "\x00|\xa4\x00`\x00\x1f+" + // 0x01F29 0x00300: 0x01F2B + "\x00|\xa0\x00` \x1f," + // 0x01F28 0x00301: 0x01F2C + "\x00|\xa4\x00` \x1f-" + // 0x01F29 0x00301: 0x01F2D + "\x00|\xa0\x00h@\x1f." + // 0x01F28 0x00342: 0x01F2E + "\x00|\xa4\x00h@\x1f/" + // 0x01F29 0x00342: 0x01F2F + "\x00\x0e\xe4\x00b`\x1f0" + // 0x003B9 0x00313: 0x01F30 + "\x00\x0e\xe4\x00b\x80\x1f1" + // 0x003B9 0x00314: 0x01F31 + "\x00|\xc0\x00`\x00\x1f2" + // 0x01F30 0x00300: 0x01F32 + "\x00|\xc4\x00`\x00\x1f3" + // 0x01F31 0x00300: 0x01F33 + "\x00|\xc0\x00` \x1f4" + // 0x01F30 0x00301: 0x01F34 + "\x00|\xc4\x00` \x1f5" + // 0x01F31 0x00301: 0x01F35 + "\x00|\xc0\x00h@\x1f6" + // 0x01F30 0x00342: 0x01F36 + "\x00|\xc4\x00h@\x1f7" + // 0x01F31 0x00342: 0x01F37 + "\x00\x0ed\x00b`\x1f8" + // 0x00399 0x00313: 0x01F38 + "\x00\x0ed\x00b\x80\x1f9" + // 0x00399 0x00314: 0x01F39 + "\x00|\xe0\x00`\x00\x1f:" + // 0x01F38 0x00300: 0x01F3A + "\x00|\xe4\x00`\x00\x1f;" + // 0x01F39 0x00300: 0x01F3B + "\x00|\xe0\x00` \x1f<" + // 0x01F38 0x00301: 0x01F3C + "\x00|\xe4\x00` \x1f=" + // 0x01F39 0x00301: 0x01F3D + "\x00|\xe0\x00h@\x1f>" + // 0x01F38 0x00342: 0x01F3E + "\x00|\xe4\x00h@\x1f?" + // 0x01F39 0x00342: 0x01F3F + "\x00\x0e\xfc\x00b`\x1f@" + // 0x003BF 0x00313: 0x01F40 + "\x00\x0e\xfc\x00b\x80\x1fA" + // 0x003BF 0x00314: 0x01F41 + "\x00}\x00\x00`\x00\x1fB" + // 0x01F40 0x00300: 0x01F42 + "\x00}\x04\x00`\x00\x1fC" + // 0x01F41 0x00300: 0x01F43 + "\x00}\x00\x00` \x1fD" + // 0x01F40 0x00301: 0x01F44 + "\x00}\x04\x00` \x1fE" + // 0x01F41 0x00301: 0x01F45 + "\x00\x0e|\x00b`\x1fH" + // 0x0039F 0x00313: 0x01F48 + "\x00\x0e|\x00b\x80\x1fI" + // 0x0039F 0x00314: 0x01F49 + "\x00} \x00`\x00\x1fJ" + // 0x01F48 0x00300: 0x01F4A + "\x00}$\x00`\x00\x1fK" + // 0x01F49 0x00300: 0x01F4B + "\x00} \x00` \x1fL" + // 0x01F48 0x00301: 0x01F4C + "\x00}$\x00` \x1fM" + // 0x01F49 0x00301: 0x01F4D + "\x00\x0f\x14\x00b`\x1fP" + // 0x003C5 0x00313: 0x01F50 + "\x00\x0f\x14\x00b\x80\x1fQ" + // 0x003C5 0x00314: 0x01F51 + "\x00}@\x00`\x00\x1fR" + // 0x01F50 0x00300: 0x01F52 + "\x00}D\x00`\x00\x1fS" + // 0x01F51 0x00300: 0x01F53 + "\x00}@\x00` \x1fT" + // 0x01F50 0x00301: 0x01F54 + "\x00}D\x00` \x1fU" + // 0x01F51 0x00301: 0x01F55 + "\x00}@\x00h@\x1fV" + // 0x01F50 0x00342: 0x01F56 + "\x00}D\x00h@\x1fW" + // 0x01F51 0x00342: 0x01F57 + "\x00\x0e\x94\x00b\x80\x1fY" + // 0x003A5 0x00314: 0x01F59 + "\x00}d\x00`\x00\x1f[" + // 0x01F59 0x00300: 0x01F5B + "\x00}d\x00` \x1f]" + // 0x01F59 0x00301: 0x01F5D + "\x00}d\x00h@\x1f_" + // 0x01F59 0x00342: 0x01F5F + "\x00\x0f$\x00b`\x1f`" + // 0x003C9 0x00313: 0x01F60 + "\x00\x0f$\x00b\x80\x1fa" + // 0x003C9 0x00314: 0x01F61 + "\x00}\x80\x00`\x00\x1fb" + // 0x01F60 0x00300: 0x01F62 + "\x00}\x84\x00`\x00\x1fc" + // 0x01F61 0x00300: 0x01F63 + "\x00}\x80\x00` \x1fd" + // 0x01F60 0x00301: 0x01F64 + "\x00}\x84\x00` \x1fe" + // 0x01F61 0x00301: 0x01F65 + "\x00}\x80\x00h@\x1ff" + // 0x01F60 0x00342: 0x01F66 + "\x00}\x84\x00h@\x1fg" + // 0x01F61 0x00342: 0x01F67 + "\x00\x0e\xa4\x00b`\x1fh" + // 0x003A9 0x00313: 0x01F68 + "\x00\x0e\xa4\x00b\x80\x1fi" + // 0x003A9 0x00314: 0x01F69 + "\x00}\xa0\x00`\x00\x1fj" + // 0x01F68 0x00300: 0x01F6A + "\x00}\xa4\x00`\x00\x1fk" + // 0x01F69 0x00300: 0x01F6B + "\x00}\xa0\x00` \x1fl" + // 0x01F68 0x00301: 0x01F6C + "\x00}\xa4\x00` \x1fm" + // 0x01F69 0x00301: 0x01F6D + "\x00}\xa0\x00h@\x1fn" + // 0x01F68 0x00342: 0x01F6E + "\x00}\xa4\x00h@\x1fo" + // 0x01F69 0x00342: 0x01F6F + "\x00\x0e\xc4\x00`\x00\x1fp" + // 0x003B1 0x00300: 0x01F70 + "\x00\x0e\xd4\x00`\x00\x1fr" + // 0x003B5 0x00300: 0x01F72 + "\x00\x0e\xdc\x00`\x00\x1ft" + // 0x003B7 0x00300: 0x01F74 + "\x00\x0e\xe4\x00`\x00\x1fv" + // 0x003B9 0x00300: 0x01F76 + "\x00\x0e\xfc\x00`\x00\x1fx" + // 0x003BF 0x00300: 0x01F78 + "\x00\x0f\x14\x00`\x00\x1fz" + // 0x003C5 0x00300: 0x01F7A + "\x00\x0f$\x00`\x00\x1f|" + // 0x003C9 0x00300: 0x01F7C + "\x00|\x00\x00h\xa0\x1f\x80" + // 0x01F00 0x00345: 0x01F80 + "\x00|\x04\x00h\xa0\x1f\x81" + // 0x01F01 0x00345: 0x01F81 + "\x00|\b\x00h\xa0\x1f\x82" + // 0x01F02 0x00345: 0x01F82 + "\x00|\f\x00h\xa0\x1f\x83" + // 0x01F03 0x00345: 0x01F83 + "\x00|\x10\x00h\xa0\x1f\x84" + // 0x01F04 0x00345: 0x01F84 + "\x00|\x14\x00h\xa0\x1f\x85" + // 0x01F05 0x00345: 0x01F85 + "\x00|\x18\x00h\xa0\x1f\x86" + // 0x01F06 0x00345: 0x01F86 + "\x00|\x1c\x00h\xa0\x1f\x87" + // 0x01F07 0x00345: 0x01F87 + "\x00| \x00h\xa0\x1f\x88" + // 0x01F08 0x00345: 0x01F88 + "\x00|$\x00h\xa0\x1f\x89" + // 0x01F09 0x00345: 0x01F89 + "\x00|(\x00h\xa0\x1f\x8a" + // 0x01F0A 0x00345: 0x01F8A + "\x00|,\x00h\xa0\x1f\x8b" + // 0x01F0B 0x00345: 0x01F8B + "\x00|0\x00h\xa0\x1f\x8c" + // 0x01F0C 0x00345: 0x01F8C + "\x00|4\x00h\xa0\x1f\x8d" + // 0x01F0D 0x00345: 0x01F8D + "\x00|8\x00h\xa0\x1f\x8e" + // 0x01F0E 0x00345: 0x01F8E + "\x00|<\x00h\xa0\x1f\x8f" + // 0x01F0F 0x00345: 0x01F8F + "\x00|\x80\x00h\xa0\x1f\x90" + // 0x01F20 0x00345: 0x01F90 + "\x00|\x84\x00h\xa0\x1f\x91" + // 0x01F21 0x00345: 0x01F91 + "\x00|\x88\x00h\xa0\x1f\x92" + // 0x01F22 0x00345: 0x01F92 + "\x00|\x8c\x00h\xa0\x1f\x93" + // 0x01F23 0x00345: 0x01F93 + "\x00|\x90\x00h\xa0\x1f\x94" + // 0x01F24 0x00345: 0x01F94 + "\x00|\x94\x00h\xa0\x1f\x95" + // 0x01F25 0x00345: 0x01F95 + "\x00|\x98\x00h\xa0\x1f\x96" + // 0x01F26 0x00345: 0x01F96 + "\x00|\x9c\x00h\xa0\x1f\x97" + // 0x01F27 0x00345: 0x01F97 + "\x00|\xa0\x00h\xa0\x1f\x98" + // 0x01F28 0x00345: 0x01F98 + "\x00|\xa4\x00h\xa0\x1f\x99" + // 0x01F29 0x00345: 0x01F99 + "\x00|\xa8\x00h\xa0\x1f\x9a" + // 0x01F2A 0x00345: 0x01F9A + "\x00|\xac\x00h\xa0\x1f\x9b" + // 0x01F2B 0x00345: 0x01F9B + "\x00|\xb0\x00h\xa0\x1f\x9c" + // 0x01F2C 0x00345: 0x01F9C + "\x00|\xb4\x00h\xa0\x1f\x9d" + // 0x01F2D 0x00345: 0x01F9D + "\x00|\xb8\x00h\xa0\x1f\x9e" + // 0x01F2E 0x00345: 0x01F9E + "\x00|\xbc\x00h\xa0\x1f\x9f" + // 0x01F2F 0x00345: 0x01F9F + "\x00}\x80\x00h\xa0\x1f\xa0" + // 0x01F60 0x00345: 0x01FA0 + "\x00}\x84\x00h\xa0\x1f\xa1" + // 0x01F61 0x00345: 0x01FA1 + "\x00}\x88\x00h\xa0\x1f\xa2" + // 0x01F62 0x00345: 0x01FA2 + "\x00}\x8c\x00h\xa0\x1f\xa3" + // 0x01F63 0x00345: 0x01FA3 + "\x00}\x90\x00h\xa0\x1f\xa4" + // 0x01F64 0x00345: 0x01FA4 + "\x00}\x94\x00h\xa0\x1f\xa5" + // 0x01F65 0x00345: 0x01FA5 + "\x00}\x98\x00h\xa0\x1f\xa6" + // 0x01F66 0x00345: 0x01FA6 + "\x00}\x9c\x00h\xa0\x1f\xa7" + // 0x01F67 0x00345: 0x01FA7 + "\x00}\xa0\x00h\xa0\x1f\xa8" + // 0x01F68 0x00345: 0x01FA8 + "\x00}\xa4\x00h\xa0\x1f\xa9" + // 0x01F69 0x00345: 0x01FA9 + "\x00}\xa8\x00h\xa0\x1f\xaa" + // 0x01F6A 0x00345: 0x01FAA + "\x00}\xac\x00h\xa0\x1f\xab" + // 0x01F6B 0x00345: 0x01FAB + "\x00}\xb0\x00h\xa0\x1f\xac" + // 0x01F6C 0x00345: 0x01FAC + "\x00}\xb4\x00h\xa0\x1f\xad" + // 0x01F6D 0x00345: 0x01FAD + "\x00}\xb8\x00h\xa0\x1f\xae" + // 0x01F6E 0x00345: 0x01FAE + "\x00}\xbc\x00h\xa0\x1f\xaf" + // 0x01F6F 0x00345: 0x01FAF + "\x00\x0e\xc4\x00`\xc0\x1f\xb0" + // 0x003B1 0x00306: 0x01FB0 + "\x00\x0e\xc4\x00`\x80\x1f\xb1" + // 0x003B1 0x00304: 0x01FB1 + "\x00}\xc0\x00h\xa0\x1f\xb2" + // 0x01F70 0x00345: 0x01FB2 + "\x00\x0e\xc4\x00h\xa0\x1f\xb3" + // 0x003B1 0x00345: 0x01FB3 + "\x00\x0e\xb0\x00h\xa0\x1f\xb4" + // 0x003AC 0x00345: 0x01FB4 + "\x00\x0e\xc4\x00h@\x1f\xb6" + // 0x003B1 0x00342: 0x01FB6 + "\x00~\xd8\x00h\xa0\x1f\xb7" + // 0x01FB6 0x00345: 0x01FB7 + "\x00\x0eD\x00`\xc0\x1f\xb8" + // 0x00391 0x00306: 0x01FB8 + "\x00\x0eD\x00`\x80\x1f\xb9" + // 0x00391 0x00304: 0x01FB9 + "\x00\x0eD\x00`\x00\x1f\xba" + // 0x00391 0x00300: 0x01FBA + "\x00\x0eD\x00h\xa0\x1f\xbc" + // 0x00391 0x00345: 0x01FBC + "\x00\x02\xa0\x00h@\x1f\xc1" + // 0x000A8 0x00342: 0x01FC1 + "\x00}\xd0\x00h\xa0\x1f\xc2" + // 0x01F74 0x00345: 0x01FC2 + "\x00\x0e\xdc\x00h\xa0\x1f\xc3" + // 0x003B7 0x00345: 0x01FC3 + "\x00\x0e\xb8\x00h\xa0\x1f\xc4" + // 0x003AE 0x00345: 0x01FC4 + "\x00\x0e\xdc\x00h@\x1f\xc6" + // 0x003B7 0x00342: 0x01FC6 + "\x00\x7f\x18\x00h\xa0\x1f\xc7" + // 0x01FC6 0x00345: 0x01FC7 + "\x00\x0eT\x00`\x00\x1f\xc8" + // 0x00395 0x00300: 0x01FC8 + "\x00\x0e\\\x00`\x00\x1f\xca" + // 0x00397 0x00300: 0x01FCA + "\x00\x0e\\\x00h\xa0\x1f\xcc" + // 0x00397 0x00345: 0x01FCC + "\x00~\xfc\x00`\x00\x1f\xcd" + // 0x01FBF 0x00300: 0x01FCD + "\x00~\xfc\x00` \x1f\xce" + // 0x01FBF 0x00301: 0x01FCE + "\x00~\xfc\x00h@\x1f\xcf" + // 0x01FBF 0x00342: 0x01FCF + "\x00\x0e\xe4\x00`\xc0\x1f\xd0" + // 0x003B9 0x00306: 0x01FD0 + "\x00\x0e\xe4\x00`\x80\x1f\xd1" + // 0x003B9 0x00304: 0x01FD1 + "\x00\x0f(\x00`\x00\x1f\xd2" + // 0x003CA 0x00300: 0x01FD2 + "\x00\x0e\xe4\x00h@\x1f\xd6" + // 0x003B9 0x00342: 0x01FD6 + "\x00\x0f(\x00h@\x1f\xd7" + // 0x003CA 0x00342: 0x01FD7 + "\x00\x0ed\x00`\xc0\x1f\xd8" + // 0x00399 0x00306: 0x01FD8 + "\x00\x0ed\x00`\x80\x1f\xd9" + // 0x00399 0x00304: 0x01FD9 + "\x00\x0ed\x00`\x00\x1f\xda" + // 0x00399 0x00300: 0x01FDA + "\x00\x7f\xf8\x00`\x00\x1f\xdd" + // 0x01FFE 0x00300: 0x01FDD + "\x00\x7f\xf8\x00` \x1f\xde" + // 0x01FFE 0x00301: 0x01FDE + "\x00\x7f\xf8\x00h@\x1f\xdf" + // 0x01FFE 0x00342: 0x01FDF + "\x00\x0f\x14\x00`\xc0\x1f\xe0" + // 0x003C5 0x00306: 0x01FE0 + "\x00\x0f\x14\x00`\x80\x1f\xe1" + // 0x003C5 0x00304: 0x01FE1 + "\x00\x0f,\x00`\x00\x1f\xe2" + // 0x003CB 0x00300: 0x01FE2 + "\x00\x0f\x04\x00b`\x1f\xe4" + // 0x003C1 0x00313: 0x01FE4 + "\x00\x0f\x04\x00b\x80\x1f\xe5" + // 0x003C1 0x00314: 0x01FE5 + "\x00\x0f\x14\x00h@\x1f\xe6" + // 0x003C5 0x00342: 0x01FE6 + "\x00\x0f,\x00h@\x1f\xe7" + // 0x003CB 0x00342: 0x01FE7 + "\x00\x0e\x94\x00`\xc0\x1f\xe8" + // 0x003A5 0x00306: 0x01FE8 + "\x00\x0e\x94\x00`\x80\x1f\xe9" + // 0x003A5 0x00304: 0x01FE9 + "\x00\x0e\x94\x00`\x00\x1f\xea" + // 0x003A5 0x00300: 0x01FEA + "\x00\x0e\x84\x00b\x80\x1f\xec" + // 0x003A1 0x00314: 0x01FEC + "\x00\x02\xa0\x00`\x00\x1f\xed" + // 0x000A8 0x00300: 0x01FED + "\x00}\xf0\x00h\xa0\x1f\xf2" + // 0x01F7C 0x00345: 0x01FF2 + "\x00\x0f$\x00h\xa0\x1f\xf3" + // 0x003C9 0x00345: 0x01FF3 + "\x00\x0f8\x00h\xa0\x1f\xf4" + // 0x003CE 0x00345: 0x01FF4 + "\x00\x0f$\x00h@\x1f\xf6" + // 0x003C9 0x00342: 0x01FF6 + "\x00\x7f\xd8\x00h\xa0\x1f\xf7" + // 0x01FF6 0x00345: 0x01FF7 + "\x00\x0e|\x00`\x00\x1f\xf8" + // 0x0039F 0x00300: 0x01FF8 + "\x00\x0e\xa4\x00`\x00\x1f\xfa" + // 0x003A9 0x00300: 0x01FFA + "\x00\x0e\xa4\x00h\xa0\x1f\xfc" + // 0x003A9 0x00345: 0x01FFC + "\x00\x86@\x00g\x00!\x9a" + // 0x02190 0x00338: 0x0219A + "\x00\x86H\x00g\x00!\x9b" + // 0x02192 0x00338: 0x0219B + "\x00\x86P\x00g\x00!\xae" + // 0x02194 0x00338: 0x021AE + "\x00\x87@\x00g\x00!\xcd" + // 0x021D0 0x00338: 0x021CD + "\x00\x87P\x00g\x00!\xce" + // 0x021D4 0x00338: 0x021CE + "\x00\x87H\x00g\x00!\xcf" + // 0x021D2 0x00338: 0x021CF + "\x00\x88\f\x00g\x00\"\x04" + // 0x02203 0x00338: 0x02204 + "\x00\x88 \x00g\x00\"\t" + // 0x02208 0x00338: 0x02209 + "\x00\x88,\x00g\x00\"\f" + // 0x0220B 0x00338: 0x0220C + "\x00\x88\x8c\x00g\x00\"$" + // 0x02223 0x00338: 0x02224 + "\x00\x88\x94\x00g\x00\"&" + // 0x02225 0x00338: 0x02226 + "\x00\x88\xf0\x00g\x00\"A" + // 0x0223C 0x00338: 0x02241 + "\x00\x89\f\x00g\x00\"D" + // 0x02243 0x00338: 0x02244 + "\x00\x89\x14\x00g\x00\"G" + // 0x02245 0x00338: 0x02247 + "\x00\x89 \x00g\x00\"I" + // 0x02248 0x00338: 0x02249 + "\x00\x00\xf4\x00g\x00\"`" + // 0x0003D 0x00338: 0x02260 + "\x00\x89\x84\x00g\x00\"b" + // 0x02261 0x00338: 0x02262 + "\x00\x894\x00g\x00\"m" + // 0x0224D 0x00338: 0x0226D + "\x00\x00\xf0\x00g\x00\"n" + // 0x0003C 0x00338: 0x0226E + "\x00\x00\xf8\x00g\x00\"o" + // 0x0003E 0x00338: 0x0226F + "\x00\x89\x90\x00g\x00\"p" + // 0x02264 0x00338: 0x02270 + "\x00\x89\x94\x00g\x00\"q" + // 0x02265 0x00338: 0x02271 + "\x00\x89\xc8\x00g\x00\"t" + // 0x02272 0x00338: 0x02274 + "\x00\x89\xcc\x00g\x00\"u" + // 0x02273 0x00338: 0x02275 + "\x00\x89\xd8\x00g\x00\"x" + // 0x02276 0x00338: 0x02278 + "\x00\x89\xdc\x00g\x00\"y" + // 0x02277 0x00338: 0x02279 + "\x00\x89\xe8\x00g\x00\"\x80" + // 0x0227A 0x00338: 0x02280 + "\x00\x89\xec\x00g\x00\"\x81" + // 0x0227B 0x00338: 0x02281 + "\x00\x8a\b\x00g\x00\"\x84" + // 0x02282 0x00338: 0x02284 + "\x00\x8a\f\x00g\x00\"\x85" + // 0x02283 0x00338: 0x02285 + "\x00\x8a\x18\x00g\x00\"\x88" + // 0x02286 0x00338: 0x02288 + "\x00\x8a\x1c\x00g\x00\"\x89" + // 0x02287 0x00338: 0x02289 + "\x00\x8a\x88\x00g\x00\"\xac" + // 0x022A2 0x00338: 0x022AC + "\x00\x8a\xa0\x00g\x00\"\xad" + // 0x022A8 0x00338: 0x022AD + "\x00\x8a\xa4\x00g\x00\"\xae" + // 0x022A9 0x00338: 0x022AE + "\x00\x8a\xac\x00g\x00\"\xaf" + // 0x022AB 0x00338: 0x022AF + "\x00\x89\xf0\x00g\x00\"\xe0" + // 0x0227C 0x00338: 0x022E0 + "\x00\x89\xf4\x00g\x00\"\xe1" + // 0x0227D 0x00338: 0x022E1 + "\x00\x8aD\x00g\x00\"\xe2" + // 0x02291 0x00338: 0x022E2 + "\x00\x8aH\x00g\x00\"\xe3" + // 0x02292 0x00338: 0x022E3 + "\x00\x8a\xc8\x00g\x00\"\xea" + // 0x022B2 0x00338: 0x022EA + "\x00\x8a\xcc\x00g\x00\"\xeb" + // 0x022B3 0x00338: 0x022EB + "\x00\x8a\xd0\x00g\x00\"\xec" + // 0x022B4 0x00338: 0x022EC + "\x00\x8a\xd4\x00g\x00\"\xed" + // 0x022B5 0x00338: 0x022ED + "\x00\xc1,\x06\x13 0L" + // 0x0304B 0x03099: 0x0304C + "\x00\xc14\x06\x13 0N" + // 0x0304D 0x03099: 0x0304E + "\x00\xc1<\x06\x13 0P" + // 0x0304F 0x03099: 0x03050 + "\x00\xc1D\x06\x13 0R" + // 0x03051 0x03099: 0x03052 + "\x00\xc1L\x06\x13 0T" + // 0x03053 0x03099: 0x03054 + "\x00\xc1T\x06\x13 0V" + // 0x03055 0x03099: 0x03056 + "\x00\xc1\\\x06\x13 0X" + // 0x03057 0x03099: 0x03058 + "\x00\xc1d\x06\x13 0Z" + // 0x03059 0x03099: 0x0305A + "\x00\xc1l\x06\x13 0\\" + // 0x0305B 0x03099: 0x0305C + "\x00\xc1t\x06\x13 0^" + // 0x0305D 0x03099: 0x0305E + "\x00\xc1|\x06\x13 0`" + // 0x0305F 0x03099: 0x03060 + "\x00\xc1\x84\x06\x13 0b" + // 0x03061 0x03099: 0x03062 + "\x00\xc1\x90\x06\x13 0e" + // 0x03064 0x03099: 0x03065 + "\x00\xc1\x98\x06\x13 0g" + // 0x03066 0x03099: 0x03067 + "\x00\xc1\xa0\x06\x13 0i" + // 0x03068 0x03099: 0x03069 + "\x00\xc1\xbc\x06\x13 0p" + // 0x0306F 0x03099: 0x03070 + "\x00\xc1\xbc\x06\x13@0q" + // 0x0306F 0x0309A: 0x03071 + "\x00\xc1\xc8\x06\x13 0s" + // 0x03072 0x03099: 0x03073 + "\x00\xc1\xc8\x06\x13@0t" + // 0x03072 0x0309A: 0x03074 + "\x00\xc1\xd4\x06\x13 0v" + // 0x03075 0x03099: 0x03076 + "\x00\xc1\xd4\x06\x13@0w" + // 0x03075 0x0309A: 0x03077 + "\x00\xc1\xe0\x06\x13 0y" + // 0x03078 0x03099: 0x03079 + "\x00\xc1\xe0\x06\x13@0z" + // 0x03078 0x0309A: 0x0307A + "\x00\xc1\xec\x06\x13 0|" + // 0x0307B 0x03099: 0x0307C + "\x00\xc1\xec\x06\x13@0}" + // 0x0307B 0x0309A: 0x0307D + "\x00\xc1\x18\x06\x13 0\x94" + // 0x03046 0x03099: 0x03094 + "\x00\xc2t\x06\x13 0\x9e" + // 0x0309D 0x03099: 0x0309E + "\x00¬\x06\x13 0\xac" + // 0x030AB 0x03099: 0x030AC + "\x00´\x06\x13 0\xae" + // 0x030AD 0x03099: 0x030AE + "\x00¼\x06\x13 0\xb0" + // 0x030AF 0x03099: 0x030B0 + "\x00\xc2\xc4\x06\x13 0\xb2" + // 0x030B1 0x03099: 0x030B2 + "\x00\xc2\xcc\x06\x13 0\xb4" + // 0x030B3 0x03099: 0x030B4 + "\x00\xc2\xd4\x06\x13 0\xb6" + // 0x030B5 0x03099: 0x030B6 + "\x00\xc2\xdc\x06\x13 0\xb8" + // 0x030B7 0x03099: 0x030B8 + "\x00\xc2\xe4\x06\x13 0\xba" + // 0x030B9 0x03099: 0x030BA + "\x00\xc2\xec\x06\x13 0\xbc" + // 0x030BB 0x03099: 0x030BC + "\x00\xc2\xf4\x06\x13 0\xbe" + // 0x030BD 0x03099: 0x030BE + "\x00\xc2\xfc\x06\x13 0\xc0" + // 0x030BF 0x03099: 0x030C0 + "\x00\xc3\x04\x06\x13 0\xc2" + // 0x030C1 0x03099: 0x030C2 + "\x00\xc3\x10\x06\x13 0\xc5" + // 0x030C4 0x03099: 0x030C5 + "\x00\xc3\x18\x06\x13 0\xc7" + // 0x030C6 0x03099: 0x030C7 + "\x00\xc3 \x06\x13 0\xc9" + // 0x030C8 0x03099: 0x030C9 + "\x00\xc3<\x06\x13 0\xd0" + // 0x030CF 0x03099: 0x030D0 + "\x00\xc3<\x06\x13@0\xd1" + // 0x030CF 0x0309A: 0x030D1 + "\x00\xc3H\x06\x13 0\xd3" + // 0x030D2 0x03099: 0x030D3 + "\x00\xc3H\x06\x13@0\xd4" + // 0x030D2 0x0309A: 0x030D4 + "\x00\xc3T\x06\x13 0\xd6" + // 0x030D5 0x03099: 0x030D6 + "\x00\xc3T\x06\x13@0\xd7" + // 0x030D5 0x0309A: 0x030D7 + "\x00\xc3`\x06\x13 0\xd9" + // 0x030D8 0x03099: 0x030D9 + "\x00\xc3`\x06\x13@0\xda" + // 0x030D8 0x0309A: 0x030DA + "\x00\xc3l\x06\x13 0\xdc" + // 0x030DB 0x03099: 0x030DC + "\x00\xc3l\x06\x13@0\xdd" + // 0x030DB 0x0309A: 0x030DD + "\x00\u0098\x06\x13 0\xf4" + // 0x030A6 0x03099: 0x030F4 + "\x00ü\x06\x13 0\xf7" + // 0x030EF 0x03099: 0x030F7 + "\x00\xc3\xc0\x06\x13 0\xf8" + // 0x030F0 0x03099: 0x030F8 + "\x00\xc3\xc4\x06\x13 0\xf9" + // 0x030F1 0x03099: 0x030F9 + "\x00\xc3\xc8\x06\x13 0\xfa" + // 0x030F2 0x03099: 0x030FA + "\x00\xc3\xf4\x06\x13 0\xfe" + // 0x030FD 0x03099: 0x030FE + "\x04Bd\"\x17A\x10\x9a" + // 0x11099 0x110BA: 0x1109A + "\x04Bl\"\x17A\x10\x9c" + // 0x1109B 0x110BA: 0x1109C + "\x04B\x94\"\x17A\x10\xab" + // 0x110A5 0x110BA: 0x110AB + "\x04D\xc4\"$\xe1\x11." + // 0x11131 0x11127: 0x1112E + "\x04D\xc8\"$\xe1\x11/" + // 0x11132 0x11127: 0x1112F + "\x04M\x1c\"g\xc1\x13K" + // 0x11347 0x1133E: 0x1134B + "\x04M\x1c\"j\xe1\x13L" + // 0x11347 0x11357: 0x1134C + "\x04R\xe4\"\x97A\x14\xbb" + // 0x114B9 0x114BA: 0x114BB + "\x04R\xe4\"\x96\x01\x14\xbc" + // 0x114B9 0x114B0: 0x114BC + "\x04R\xe4\"\x97\xa1\x14\xbe" + // 0x114B9 0x114BD: 0x114BE + "\x04V\xe0\"\xb5\xe1\x15\xba" + // 0x115B8 0x115AF: 0x115BA + "\x04V\xe4\"\xb5\xe1\x15\xbb" + // 0x115B9 0x115AF: 0x115BB + "\x04d\xd4#&\x01\x198" + // 0x11935 0x11930: 0x11938 "" // Total size of tables: 56KB (57068 bytes) diff --git a/vendor/golang.org/x/text/unicode/norm/tables17.0.0.go b/vendor/golang.org/x/text/unicode/norm/tables17.0.0.go index dfd555fc1b5..c3231891205 100644 --- a/vendor/golang.org/x/text/unicode/norm/tables17.0.0.go +++ b/vendor/golang.org/x/text/unicode/norm/tables17.0.0.go @@ -7135,970 +7135,970 @@ var nfkcSparseValues = [980]valueRange{ } // recompMap: 7688 bytes (entries only) -var recompMap map[uint32]rune +var recompMap map[uint64]rune var recompMapOnce sync.Once const recompMapPacked = "" + - "\x00A\x03\x00\x00\x00\x00\xc0" + // 0x00410300: 0x000000C0 - "\x00A\x03\x01\x00\x00\x00\xc1" + // 0x00410301: 0x000000C1 - "\x00A\x03\x02\x00\x00\x00\xc2" + // 0x00410302: 0x000000C2 - "\x00A\x03\x03\x00\x00\x00\xc3" + // 0x00410303: 0x000000C3 - "\x00A\x03\b\x00\x00\x00\xc4" + // 0x00410308: 0x000000C4 - "\x00A\x03\n\x00\x00\x00\xc5" + // 0x0041030A: 0x000000C5 - "\x00C\x03'\x00\x00\x00\xc7" + // 0x00430327: 0x000000C7 - "\x00E\x03\x00\x00\x00\x00\xc8" + // 0x00450300: 0x000000C8 - "\x00E\x03\x01\x00\x00\x00\xc9" + // 0x00450301: 0x000000C9 - "\x00E\x03\x02\x00\x00\x00\xca" + // 0x00450302: 0x000000CA - "\x00E\x03\b\x00\x00\x00\xcb" + // 0x00450308: 0x000000CB - "\x00I\x03\x00\x00\x00\x00\xcc" + // 0x00490300: 0x000000CC - "\x00I\x03\x01\x00\x00\x00\xcd" + // 0x00490301: 0x000000CD - "\x00I\x03\x02\x00\x00\x00\xce" + // 0x00490302: 0x000000CE - "\x00I\x03\b\x00\x00\x00\xcf" + // 0x00490308: 0x000000CF - "\x00N\x03\x03\x00\x00\x00\xd1" + // 0x004E0303: 0x000000D1 - "\x00O\x03\x00\x00\x00\x00\xd2" + // 0x004F0300: 0x000000D2 - "\x00O\x03\x01\x00\x00\x00\xd3" + // 0x004F0301: 0x000000D3 - "\x00O\x03\x02\x00\x00\x00\xd4" + // 0x004F0302: 0x000000D4 - "\x00O\x03\x03\x00\x00\x00\xd5" + // 0x004F0303: 0x000000D5 - "\x00O\x03\b\x00\x00\x00\xd6" + // 0x004F0308: 0x000000D6 - "\x00U\x03\x00\x00\x00\x00\xd9" + // 0x00550300: 0x000000D9 - "\x00U\x03\x01\x00\x00\x00\xda" + // 0x00550301: 0x000000DA - "\x00U\x03\x02\x00\x00\x00\xdb" + // 0x00550302: 0x000000DB - "\x00U\x03\b\x00\x00\x00\xdc" + // 0x00550308: 0x000000DC - "\x00Y\x03\x01\x00\x00\x00\xdd" + // 0x00590301: 0x000000DD - "\x00a\x03\x00\x00\x00\x00\xe0" + // 0x00610300: 0x000000E0 - "\x00a\x03\x01\x00\x00\x00\xe1" + // 0x00610301: 0x000000E1 - "\x00a\x03\x02\x00\x00\x00\xe2" + // 0x00610302: 0x000000E2 - "\x00a\x03\x03\x00\x00\x00\xe3" + // 0x00610303: 0x000000E3 - "\x00a\x03\b\x00\x00\x00\xe4" + // 0x00610308: 0x000000E4 - "\x00a\x03\n\x00\x00\x00\xe5" + // 0x0061030A: 0x000000E5 - "\x00c\x03'\x00\x00\x00\xe7" + // 0x00630327: 0x000000E7 - "\x00e\x03\x00\x00\x00\x00\xe8" + // 0x00650300: 0x000000E8 - "\x00e\x03\x01\x00\x00\x00\xe9" + // 0x00650301: 0x000000E9 - "\x00e\x03\x02\x00\x00\x00\xea" + // 0x00650302: 0x000000EA - "\x00e\x03\b\x00\x00\x00\xeb" + // 0x00650308: 0x000000EB - "\x00i\x03\x00\x00\x00\x00\xec" + // 0x00690300: 0x000000EC - "\x00i\x03\x01\x00\x00\x00\xed" + // 0x00690301: 0x000000ED - "\x00i\x03\x02\x00\x00\x00\xee" + // 0x00690302: 0x000000EE - "\x00i\x03\b\x00\x00\x00\xef" + // 0x00690308: 0x000000EF - "\x00n\x03\x03\x00\x00\x00\xf1" + // 0x006E0303: 0x000000F1 - "\x00o\x03\x00\x00\x00\x00\xf2" + // 0x006F0300: 0x000000F2 - "\x00o\x03\x01\x00\x00\x00\xf3" + // 0x006F0301: 0x000000F3 - "\x00o\x03\x02\x00\x00\x00\xf4" + // 0x006F0302: 0x000000F4 - "\x00o\x03\x03\x00\x00\x00\xf5" + // 0x006F0303: 0x000000F5 - "\x00o\x03\b\x00\x00\x00\xf6" + // 0x006F0308: 0x000000F6 - "\x00u\x03\x00\x00\x00\x00\xf9" + // 0x00750300: 0x000000F9 - "\x00u\x03\x01\x00\x00\x00\xfa" + // 0x00750301: 0x000000FA - "\x00u\x03\x02\x00\x00\x00\xfb" + // 0x00750302: 0x000000FB - "\x00u\x03\b\x00\x00\x00\xfc" + // 0x00750308: 0x000000FC - "\x00y\x03\x01\x00\x00\x00\xfd" + // 0x00790301: 0x000000FD - "\x00y\x03\b\x00\x00\x00\xff" + // 0x00790308: 0x000000FF - "\x00A\x03\x04\x00\x00\x01\x00" + // 0x00410304: 0x00000100 - "\x00a\x03\x04\x00\x00\x01\x01" + // 0x00610304: 0x00000101 - "\x00A\x03\x06\x00\x00\x01\x02" + // 0x00410306: 0x00000102 - "\x00a\x03\x06\x00\x00\x01\x03" + // 0x00610306: 0x00000103 - "\x00A\x03(\x00\x00\x01\x04" + // 0x00410328: 0x00000104 - "\x00a\x03(\x00\x00\x01\x05" + // 0x00610328: 0x00000105 - "\x00C\x03\x01\x00\x00\x01\x06" + // 0x00430301: 0x00000106 - "\x00c\x03\x01\x00\x00\x01\a" + // 0x00630301: 0x00000107 - "\x00C\x03\x02\x00\x00\x01\b" + // 0x00430302: 0x00000108 - "\x00c\x03\x02\x00\x00\x01\t" + // 0x00630302: 0x00000109 - "\x00C\x03\a\x00\x00\x01\n" + // 0x00430307: 0x0000010A - "\x00c\x03\a\x00\x00\x01\v" + // 0x00630307: 0x0000010B - "\x00C\x03\f\x00\x00\x01\f" + // 0x0043030C: 0x0000010C - "\x00c\x03\f\x00\x00\x01\r" + // 0x0063030C: 0x0000010D - "\x00D\x03\f\x00\x00\x01\x0e" + // 0x0044030C: 0x0000010E - "\x00d\x03\f\x00\x00\x01\x0f" + // 0x0064030C: 0x0000010F - "\x00E\x03\x04\x00\x00\x01\x12" + // 0x00450304: 0x00000112 - "\x00e\x03\x04\x00\x00\x01\x13" + // 0x00650304: 0x00000113 - "\x00E\x03\x06\x00\x00\x01\x14" + // 0x00450306: 0x00000114 - "\x00e\x03\x06\x00\x00\x01\x15" + // 0x00650306: 0x00000115 - "\x00E\x03\a\x00\x00\x01\x16" + // 0x00450307: 0x00000116 - "\x00e\x03\a\x00\x00\x01\x17" + // 0x00650307: 0x00000117 - "\x00E\x03(\x00\x00\x01\x18" + // 0x00450328: 0x00000118 - "\x00e\x03(\x00\x00\x01\x19" + // 0x00650328: 0x00000119 - "\x00E\x03\f\x00\x00\x01\x1a" + // 0x0045030C: 0x0000011A - "\x00e\x03\f\x00\x00\x01\x1b" + // 0x0065030C: 0x0000011B - "\x00G\x03\x02\x00\x00\x01\x1c" + // 0x00470302: 0x0000011C - "\x00g\x03\x02\x00\x00\x01\x1d" + // 0x00670302: 0x0000011D - "\x00G\x03\x06\x00\x00\x01\x1e" + // 0x00470306: 0x0000011E - "\x00g\x03\x06\x00\x00\x01\x1f" + // 0x00670306: 0x0000011F - "\x00G\x03\a\x00\x00\x01 " + // 0x00470307: 0x00000120 - "\x00g\x03\a\x00\x00\x01!" + // 0x00670307: 0x00000121 - "\x00G\x03'\x00\x00\x01\"" + // 0x00470327: 0x00000122 - "\x00g\x03'\x00\x00\x01#" + // 0x00670327: 0x00000123 - "\x00H\x03\x02\x00\x00\x01$" + // 0x00480302: 0x00000124 - "\x00h\x03\x02\x00\x00\x01%" + // 0x00680302: 0x00000125 - "\x00I\x03\x03\x00\x00\x01(" + // 0x00490303: 0x00000128 - "\x00i\x03\x03\x00\x00\x01)" + // 0x00690303: 0x00000129 - "\x00I\x03\x04\x00\x00\x01*" + // 0x00490304: 0x0000012A - "\x00i\x03\x04\x00\x00\x01+" + // 0x00690304: 0x0000012B - "\x00I\x03\x06\x00\x00\x01," + // 0x00490306: 0x0000012C - "\x00i\x03\x06\x00\x00\x01-" + // 0x00690306: 0x0000012D - "\x00I\x03(\x00\x00\x01." + // 0x00490328: 0x0000012E - "\x00i\x03(\x00\x00\x01/" + // 0x00690328: 0x0000012F - "\x00I\x03\a\x00\x00\x010" + // 0x00490307: 0x00000130 - "\x00J\x03\x02\x00\x00\x014" + // 0x004A0302: 0x00000134 - "\x00j\x03\x02\x00\x00\x015" + // 0x006A0302: 0x00000135 - "\x00K\x03'\x00\x00\x016" + // 0x004B0327: 0x00000136 - "\x00k\x03'\x00\x00\x017" + // 0x006B0327: 0x00000137 - "\x00L\x03\x01\x00\x00\x019" + // 0x004C0301: 0x00000139 - "\x00l\x03\x01\x00\x00\x01:" + // 0x006C0301: 0x0000013A - "\x00L\x03'\x00\x00\x01;" + // 0x004C0327: 0x0000013B - "\x00l\x03'\x00\x00\x01<" + // 0x006C0327: 0x0000013C - "\x00L\x03\f\x00\x00\x01=" + // 0x004C030C: 0x0000013D - "\x00l\x03\f\x00\x00\x01>" + // 0x006C030C: 0x0000013E - "\x00N\x03\x01\x00\x00\x01C" + // 0x004E0301: 0x00000143 - "\x00n\x03\x01\x00\x00\x01D" + // 0x006E0301: 0x00000144 - "\x00N\x03'\x00\x00\x01E" + // 0x004E0327: 0x00000145 - "\x00n\x03'\x00\x00\x01F" + // 0x006E0327: 0x00000146 - "\x00N\x03\f\x00\x00\x01G" + // 0x004E030C: 0x00000147 - "\x00n\x03\f\x00\x00\x01H" + // 0x006E030C: 0x00000148 - "\x00O\x03\x04\x00\x00\x01L" + // 0x004F0304: 0x0000014C - "\x00o\x03\x04\x00\x00\x01M" + // 0x006F0304: 0x0000014D - "\x00O\x03\x06\x00\x00\x01N" + // 0x004F0306: 0x0000014E - "\x00o\x03\x06\x00\x00\x01O" + // 0x006F0306: 0x0000014F - "\x00O\x03\v\x00\x00\x01P" + // 0x004F030B: 0x00000150 - "\x00o\x03\v\x00\x00\x01Q" + // 0x006F030B: 0x00000151 - "\x00R\x03\x01\x00\x00\x01T" + // 0x00520301: 0x00000154 - "\x00r\x03\x01\x00\x00\x01U" + // 0x00720301: 0x00000155 - "\x00R\x03'\x00\x00\x01V" + // 0x00520327: 0x00000156 - "\x00r\x03'\x00\x00\x01W" + // 0x00720327: 0x00000157 - "\x00R\x03\f\x00\x00\x01X" + // 0x0052030C: 0x00000158 - "\x00r\x03\f\x00\x00\x01Y" + // 0x0072030C: 0x00000159 - "\x00S\x03\x01\x00\x00\x01Z" + // 0x00530301: 0x0000015A - "\x00s\x03\x01\x00\x00\x01[" + // 0x00730301: 0x0000015B - "\x00S\x03\x02\x00\x00\x01\\" + // 0x00530302: 0x0000015C - "\x00s\x03\x02\x00\x00\x01]" + // 0x00730302: 0x0000015D - "\x00S\x03'\x00\x00\x01^" + // 0x00530327: 0x0000015E - "\x00s\x03'\x00\x00\x01_" + // 0x00730327: 0x0000015F - "\x00S\x03\f\x00\x00\x01`" + // 0x0053030C: 0x00000160 - "\x00s\x03\f\x00\x00\x01a" + // 0x0073030C: 0x00000161 - "\x00T\x03'\x00\x00\x01b" + // 0x00540327: 0x00000162 - "\x00t\x03'\x00\x00\x01c" + // 0x00740327: 0x00000163 - "\x00T\x03\f\x00\x00\x01d" + // 0x0054030C: 0x00000164 - "\x00t\x03\f\x00\x00\x01e" + // 0x0074030C: 0x00000165 - "\x00U\x03\x03\x00\x00\x01h" + // 0x00550303: 0x00000168 - "\x00u\x03\x03\x00\x00\x01i" + // 0x00750303: 0x00000169 - "\x00U\x03\x04\x00\x00\x01j" + // 0x00550304: 0x0000016A - "\x00u\x03\x04\x00\x00\x01k" + // 0x00750304: 0x0000016B - "\x00U\x03\x06\x00\x00\x01l" + // 0x00550306: 0x0000016C - "\x00u\x03\x06\x00\x00\x01m" + // 0x00750306: 0x0000016D - "\x00U\x03\n\x00\x00\x01n" + // 0x0055030A: 0x0000016E - "\x00u\x03\n\x00\x00\x01o" + // 0x0075030A: 0x0000016F - "\x00U\x03\v\x00\x00\x01p" + // 0x0055030B: 0x00000170 - "\x00u\x03\v\x00\x00\x01q" + // 0x0075030B: 0x00000171 - "\x00U\x03(\x00\x00\x01r" + // 0x00550328: 0x00000172 - "\x00u\x03(\x00\x00\x01s" + // 0x00750328: 0x00000173 - "\x00W\x03\x02\x00\x00\x01t" + // 0x00570302: 0x00000174 - "\x00w\x03\x02\x00\x00\x01u" + // 0x00770302: 0x00000175 - "\x00Y\x03\x02\x00\x00\x01v" + // 0x00590302: 0x00000176 - "\x00y\x03\x02\x00\x00\x01w" + // 0x00790302: 0x00000177 - "\x00Y\x03\b\x00\x00\x01x" + // 0x00590308: 0x00000178 - "\x00Z\x03\x01\x00\x00\x01y" + // 0x005A0301: 0x00000179 - "\x00z\x03\x01\x00\x00\x01z" + // 0x007A0301: 0x0000017A - "\x00Z\x03\a\x00\x00\x01{" + // 0x005A0307: 0x0000017B - "\x00z\x03\a\x00\x00\x01|" + // 0x007A0307: 0x0000017C - "\x00Z\x03\f\x00\x00\x01}" + // 0x005A030C: 0x0000017D - "\x00z\x03\f\x00\x00\x01~" + // 0x007A030C: 0x0000017E - "\x00O\x03\x1b\x00\x00\x01\xa0" + // 0x004F031B: 0x000001A0 - "\x00o\x03\x1b\x00\x00\x01\xa1" + // 0x006F031B: 0x000001A1 - "\x00U\x03\x1b\x00\x00\x01\xaf" + // 0x0055031B: 0x000001AF - "\x00u\x03\x1b\x00\x00\x01\xb0" + // 0x0075031B: 0x000001B0 - "\x00A\x03\f\x00\x00\x01\xcd" + // 0x0041030C: 0x000001CD - "\x00a\x03\f\x00\x00\x01\xce" + // 0x0061030C: 0x000001CE - "\x00I\x03\f\x00\x00\x01\xcf" + // 0x0049030C: 0x000001CF - "\x00i\x03\f\x00\x00\x01\xd0" + // 0x0069030C: 0x000001D0 - "\x00O\x03\f\x00\x00\x01\xd1" + // 0x004F030C: 0x000001D1 - "\x00o\x03\f\x00\x00\x01\xd2" + // 0x006F030C: 0x000001D2 - "\x00U\x03\f\x00\x00\x01\xd3" + // 0x0055030C: 0x000001D3 - "\x00u\x03\f\x00\x00\x01\xd4" + // 0x0075030C: 0x000001D4 - "\x00\xdc\x03\x04\x00\x00\x01\xd5" + // 0x00DC0304: 0x000001D5 - "\x00\xfc\x03\x04\x00\x00\x01\xd6" + // 0x00FC0304: 0x000001D6 - "\x00\xdc\x03\x01\x00\x00\x01\xd7" + // 0x00DC0301: 0x000001D7 - "\x00\xfc\x03\x01\x00\x00\x01\xd8" + // 0x00FC0301: 0x000001D8 - "\x00\xdc\x03\f\x00\x00\x01\xd9" + // 0x00DC030C: 0x000001D9 - "\x00\xfc\x03\f\x00\x00\x01\xda" + // 0x00FC030C: 0x000001DA - "\x00\xdc\x03\x00\x00\x00\x01\xdb" + // 0x00DC0300: 0x000001DB - "\x00\xfc\x03\x00\x00\x00\x01\xdc" + // 0x00FC0300: 0x000001DC - "\x00\xc4\x03\x04\x00\x00\x01\xde" + // 0x00C40304: 0x000001DE - "\x00\xe4\x03\x04\x00\x00\x01\xdf" + // 0x00E40304: 0x000001DF - "\x02&\x03\x04\x00\x00\x01\xe0" + // 0x02260304: 0x000001E0 - "\x02'\x03\x04\x00\x00\x01\xe1" + // 0x02270304: 0x000001E1 - "\x00\xc6\x03\x04\x00\x00\x01\xe2" + // 0x00C60304: 0x000001E2 - "\x00\xe6\x03\x04\x00\x00\x01\xe3" + // 0x00E60304: 0x000001E3 - "\x00G\x03\f\x00\x00\x01\xe6" + // 0x0047030C: 0x000001E6 - "\x00g\x03\f\x00\x00\x01\xe7" + // 0x0067030C: 0x000001E7 - "\x00K\x03\f\x00\x00\x01\xe8" + // 0x004B030C: 0x000001E8 - "\x00k\x03\f\x00\x00\x01\xe9" + // 0x006B030C: 0x000001E9 - "\x00O\x03(\x00\x00\x01\xea" + // 0x004F0328: 0x000001EA - "\x00o\x03(\x00\x00\x01\xeb" + // 0x006F0328: 0x000001EB - "\x01\xea\x03\x04\x00\x00\x01\xec" + // 0x01EA0304: 0x000001EC - "\x01\xeb\x03\x04\x00\x00\x01\xed" + // 0x01EB0304: 0x000001ED - "\x01\xb7\x03\f\x00\x00\x01\xee" + // 0x01B7030C: 0x000001EE - "\x02\x92\x03\f\x00\x00\x01\xef" + // 0x0292030C: 0x000001EF - "\x00j\x03\f\x00\x00\x01\xf0" + // 0x006A030C: 0x000001F0 - "\x00G\x03\x01\x00\x00\x01\xf4" + // 0x00470301: 0x000001F4 - "\x00g\x03\x01\x00\x00\x01\xf5" + // 0x00670301: 0x000001F5 - "\x00N\x03\x00\x00\x00\x01\xf8" + // 0x004E0300: 0x000001F8 - "\x00n\x03\x00\x00\x00\x01\xf9" + // 0x006E0300: 0x000001F9 - "\x00\xc5\x03\x01\x00\x00\x01\xfa" + // 0x00C50301: 0x000001FA - "\x00\xe5\x03\x01\x00\x00\x01\xfb" + // 0x00E50301: 0x000001FB - "\x00\xc6\x03\x01\x00\x00\x01\xfc" + // 0x00C60301: 0x000001FC - "\x00\xe6\x03\x01\x00\x00\x01\xfd" + // 0x00E60301: 0x000001FD - "\x00\xd8\x03\x01\x00\x00\x01\xfe" + // 0x00D80301: 0x000001FE - "\x00\xf8\x03\x01\x00\x00\x01\xff" + // 0x00F80301: 0x000001FF - "\x00A\x03\x0f\x00\x00\x02\x00" + // 0x0041030F: 0x00000200 - "\x00a\x03\x0f\x00\x00\x02\x01" + // 0x0061030F: 0x00000201 - "\x00A\x03\x11\x00\x00\x02\x02" + // 0x00410311: 0x00000202 - "\x00a\x03\x11\x00\x00\x02\x03" + // 0x00610311: 0x00000203 - "\x00E\x03\x0f\x00\x00\x02\x04" + // 0x0045030F: 0x00000204 - "\x00e\x03\x0f\x00\x00\x02\x05" + // 0x0065030F: 0x00000205 - "\x00E\x03\x11\x00\x00\x02\x06" + // 0x00450311: 0x00000206 - "\x00e\x03\x11\x00\x00\x02\a" + // 0x00650311: 0x00000207 - "\x00I\x03\x0f\x00\x00\x02\b" + // 0x0049030F: 0x00000208 - "\x00i\x03\x0f\x00\x00\x02\t" + // 0x0069030F: 0x00000209 - "\x00I\x03\x11\x00\x00\x02\n" + // 0x00490311: 0x0000020A - "\x00i\x03\x11\x00\x00\x02\v" + // 0x00690311: 0x0000020B - "\x00O\x03\x0f\x00\x00\x02\f" + // 0x004F030F: 0x0000020C - "\x00o\x03\x0f\x00\x00\x02\r" + // 0x006F030F: 0x0000020D - "\x00O\x03\x11\x00\x00\x02\x0e" + // 0x004F0311: 0x0000020E - "\x00o\x03\x11\x00\x00\x02\x0f" + // 0x006F0311: 0x0000020F - "\x00R\x03\x0f\x00\x00\x02\x10" + // 0x0052030F: 0x00000210 - "\x00r\x03\x0f\x00\x00\x02\x11" + // 0x0072030F: 0x00000211 - "\x00R\x03\x11\x00\x00\x02\x12" + // 0x00520311: 0x00000212 - "\x00r\x03\x11\x00\x00\x02\x13" + // 0x00720311: 0x00000213 - "\x00U\x03\x0f\x00\x00\x02\x14" + // 0x0055030F: 0x00000214 - "\x00u\x03\x0f\x00\x00\x02\x15" + // 0x0075030F: 0x00000215 - "\x00U\x03\x11\x00\x00\x02\x16" + // 0x00550311: 0x00000216 - "\x00u\x03\x11\x00\x00\x02\x17" + // 0x00750311: 0x00000217 - "\x00S\x03&\x00\x00\x02\x18" + // 0x00530326: 0x00000218 - "\x00s\x03&\x00\x00\x02\x19" + // 0x00730326: 0x00000219 - "\x00T\x03&\x00\x00\x02\x1a" + // 0x00540326: 0x0000021A - "\x00t\x03&\x00\x00\x02\x1b" + // 0x00740326: 0x0000021B - "\x00H\x03\f\x00\x00\x02\x1e" + // 0x0048030C: 0x0000021E - "\x00h\x03\f\x00\x00\x02\x1f" + // 0x0068030C: 0x0000021F - "\x00A\x03\a\x00\x00\x02&" + // 0x00410307: 0x00000226 - "\x00a\x03\a\x00\x00\x02'" + // 0x00610307: 0x00000227 - "\x00E\x03'\x00\x00\x02(" + // 0x00450327: 0x00000228 - "\x00e\x03'\x00\x00\x02)" + // 0x00650327: 0x00000229 - "\x00\xd6\x03\x04\x00\x00\x02*" + // 0x00D60304: 0x0000022A - "\x00\xf6\x03\x04\x00\x00\x02+" + // 0x00F60304: 0x0000022B - "\x00\xd5\x03\x04\x00\x00\x02," + // 0x00D50304: 0x0000022C - "\x00\xf5\x03\x04\x00\x00\x02-" + // 0x00F50304: 0x0000022D - "\x00O\x03\a\x00\x00\x02." + // 0x004F0307: 0x0000022E - "\x00o\x03\a\x00\x00\x02/" + // 0x006F0307: 0x0000022F - "\x02.\x03\x04\x00\x00\x020" + // 0x022E0304: 0x00000230 - "\x02/\x03\x04\x00\x00\x021" + // 0x022F0304: 0x00000231 - "\x00Y\x03\x04\x00\x00\x022" + // 0x00590304: 0x00000232 - "\x00y\x03\x04\x00\x00\x023" + // 0x00790304: 0x00000233 - "\x00\xa8\x03\x01\x00\x00\x03\x85" + // 0x00A80301: 0x00000385 - "\x03\x91\x03\x01\x00\x00\x03\x86" + // 0x03910301: 0x00000386 - "\x03\x95\x03\x01\x00\x00\x03\x88" + // 0x03950301: 0x00000388 - "\x03\x97\x03\x01\x00\x00\x03\x89" + // 0x03970301: 0x00000389 - "\x03\x99\x03\x01\x00\x00\x03\x8a" + // 0x03990301: 0x0000038A - "\x03\x9f\x03\x01\x00\x00\x03\x8c" + // 0x039F0301: 0x0000038C - "\x03\xa5\x03\x01\x00\x00\x03\x8e" + // 0x03A50301: 0x0000038E - "\x03\xa9\x03\x01\x00\x00\x03\x8f" + // 0x03A90301: 0x0000038F - "\x03\xca\x03\x01\x00\x00\x03\x90" + // 0x03CA0301: 0x00000390 - "\x03\x99\x03\b\x00\x00\x03\xaa" + // 0x03990308: 0x000003AA - "\x03\xa5\x03\b\x00\x00\x03\xab" + // 0x03A50308: 0x000003AB - "\x03\xb1\x03\x01\x00\x00\x03\xac" + // 0x03B10301: 0x000003AC - "\x03\xb5\x03\x01\x00\x00\x03\xad" + // 0x03B50301: 0x000003AD - "\x03\xb7\x03\x01\x00\x00\x03\xae" + // 0x03B70301: 0x000003AE - "\x03\xb9\x03\x01\x00\x00\x03\xaf" + // 0x03B90301: 0x000003AF - "\x03\xcb\x03\x01\x00\x00\x03\xb0" + // 0x03CB0301: 0x000003B0 - "\x03\xb9\x03\b\x00\x00\x03\xca" + // 0x03B90308: 0x000003CA - "\x03\xc5\x03\b\x00\x00\x03\xcb" + // 0x03C50308: 0x000003CB - "\x03\xbf\x03\x01\x00\x00\x03\xcc" + // 0x03BF0301: 0x000003CC - "\x03\xc5\x03\x01\x00\x00\x03\xcd" + // 0x03C50301: 0x000003CD - "\x03\xc9\x03\x01\x00\x00\x03\xce" + // 0x03C90301: 0x000003CE - "\x03\xd2\x03\x01\x00\x00\x03\xd3" + // 0x03D20301: 0x000003D3 - "\x03\xd2\x03\b\x00\x00\x03\xd4" + // 0x03D20308: 0x000003D4 - "\x04\x15\x03\x00\x00\x00\x04\x00" + // 0x04150300: 0x00000400 - "\x04\x15\x03\b\x00\x00\x04\x01" + // 0x04150308: 0x00000401 - "\x04\x13\x03\x01\x00\x00\x04\x03" + // 0x04130301: 0x00000403 - "\x04\x06\x03\b\x00\x00\x04\a" + // 0x04060308: 0x00000407 - "\x04\x1a\x03\x01\x00\x00\x04\f" + // 0x041A0301: 0x0000040C - "\x04\x18\x03\x00\x00\x00\x04\r" + // 0x04180300: 0x0000040D - "\x04#\x03\x06\x00\x00\x04\x0e" + // 0x04230306: 0x0000040E - "\x04\x18\x03\x06\x00\x00\x04\x19" + // 0x04180306: 0x00000419 - "\x048\x03\x06\x00\x00\x049" + // 0x04380306: 0x00000439 - "\x045\x03\x00\x00\x00\x04P" + // 0x04350300: 0x00000450 - "\x045\x03\b\x00\x00\x04Q" + // 0x04350308: 0x00000451 - "\x043\x03\x01\x00\x00\x04S" + // 0x04330301: 0x00000453 - "\x04V\x03\b\x00\x00\x04W" + // 0x04560308: 0x00000457 - "\x04:\x03\x01\x00\x00\x04\\" + // 0x043A0301: 0x0000045C - "\x048\x03\x00\x00\x00\x04]" + // 0x04380300: 0x0000045D - "\x04C\x03\x06\x00\x00\x04^" + // 0x04430306: 0x0000045E - "\x04t\x03\x0f\x00\x00\x04v" + // 0x0474030F: 0x00000476 - "\x04u\x03\x0f\x00\x00\x04w" + // 0x0475030F: 0x00000477 - "\x04\x16\x03\x06\x00\x00\x04\xc1" + // 0x04160306: 0x000004C1 - "\x046\x03\x06\x00\x00\x04\xc2" + // 0x04360306: 0x000004C2 - "\x04\x10\x03\x06\x00\x00\x04\xd0" + // 0x04100306: 0x000004D0 - "\x040\x03\x06\x00\x00\x04\xd1" + // 0x04300306: 0x000004D1 - "\x04\x10\x03\b\x00\x00\x04\xd2" + // 0x04100308: 0x000004D2 - "\x040\x03\b\x00\x00\x04\xd3" + // 0x04300308: 0x000004D3 - "\x04\x15\x03\x06\x00\x00\x04\xd6" + // 0x04150306: 0x000004D6 - "\x045\x03\x06\x00\x00\x04\xd7" + // 0x04350306: 0x000004D7 - "\x04\xd8\x03\b\x00\x00\x04\xda" + // 0x04D80308: 0x000004DA - "\x04\xd9\x03\b\x00\x00\x04\xdb" + // 0x04D90308: 0x000004DB - "\x04\x16\x03\b\x00\x00\x04\xdc" + // 0x04160308: 0x000004DC - "\x046\x03\b\x00\x00\x04\xdd" + // 0x04360308: 0x000004DD - "\x04\x17\x03\b\x00\x00\x04\xde" + // 0x04170308: 0x000004DE - "\x047\x03\b\x00\x00\x04\xdf" + // 0x04370308: 0x000004DF - "\x04\x18\x03\x04\x00\x00\x04\xe2" + // 0x04180304: 0x000004E2 - "\x048\x03\x04\x00\x00\x04\xe3" + // 0x04380304: 0x000004E3 - "\x04\x18\x03\b\x00\x00\x04\xe4" + // 0x04180308: 0x000004E4 - "\x048\x03\b\x00\x00\x04\xe5" + // 0x04380308: 0x000004E5 - "\x04\x1e\x03\b\x00\x00\x04\xe6" + // 0x041E0308: 0x000004E6 - "\x04>\x03\b\x00\x00\x04\xe7" + // 0x043E0308: 0x000004E7 - "\x04\xe8\x03\b\x00\x00\x04\xea" + // 0x04E80308: 0x000004EA - "\x04\xe9\x03\b\x00\x00\x04\xeb" + // 0x04E90308: 0x000004EB - "\x04-\x03\b\x00\x00\x04\xec" + // 0x042D0308: 0x000004EC - "\x04M\x03\b\x00\x00\x04\xed" + // 0x044D0308: 0x000004ED - "\x04#\x03\x04\x00\x00\x04\xee" + // 0x04230304: 0x000004EE - "\x04C\x03\x04\x00\x00\x04\xef" + // 0x04430304: 0x000004EF - "\x04#\x03\b\x00\x00\x04\xf0" + // 0x04230308: 0x000004F0 - "\x04C\x03\b\x00\x00\x04\xf1" + // 0x04430308: 0x000004F1 - "\x04#\x03\v\x00\x00\x04\xf2" + // 0x0423030B: 0x000004F2 - "\x04C\x03\v\x00\x00\x04\xf3" + // 0x0443030B: 0x000004F3 - "\x04'\x03\b\x00\x00\x04\xf4" + // 0x04270308: 0x000004F4 - "\x04G\x03\b\x00\x00\x04\xf5" + // 0x04470308: 0x000004F5 - "\x04+\x03\b\x00\x00\x04\xf8" + // 0x042B0308: 0x000004F8 - "\x04K\x03\b\x00\x00\x04\xf9" + // 0x044B0308: 0x000004F9 - "\x06'\x06S\x00\x00\x06\"" + // 0x06270653: 0x00000622 - "\x06'\x06T\x00\x00\x06#" + // 0x06270654: 0x00000623 - "\x06H\x06T\x00\x00\x06$" + // 0x06480654: 0x00000624 - "\x06'\x06U\x00\x00\x06%" + // 0x06270655: 0x00000625 - "\x06J\x06T\x00\x00\x06&" + // 0x064A0654: 0x00000626 - "\x06\xd5\x06T\x00\x00\x06\xc0" + // 0x06D50654: 0x000006C0 - "\x06\xc1\x06T\x00\x00\x06\xc2" + // 0x06C10654: 0x000006C2 - "\x06\xd2\x06T\x00\x00\x06\xd3" + // 0x06D20654: 0x000006D3 - "\t(\t<\x00\x00\t)" + // 0x0928093C: 0x00000929 - "\t0\t<\x00\x00\t1" + // 0x0930093C: 0x00000931 - "\t3\t<\x00\x00\t4" + // 0x0933093C: 0x00000934 - "\t\xc7\t\xbe\x00\x00\t\xcb" + // 0x09C709BE: 0x000009CB - "\t\xc7\t\xd7\x00\x00\t\xcc" + // 0x09C709D7: 0x000009CC - "\vG\vV\x00\x00\vH" + // 0x0B470B56: 0x00000B48 - "\vG\v>\x00\x00\vK" + // 0x0B470B3E: 0x00000B4B - "\vG\vW\x00\x00\vL" + // 0x0B470B57: 0x00000B4C - "\v\x92\v\xd7\x00\x00\v\x94" + // 0x0B920BD7: 0x00000B94 - "\v\xc6\v\xbe\x00\x00\v\xca" + // 0x0BC60BBE: 0x00000BCA - "\v\xc7\v\xbe\x00\x00\v\xcb" + // 0x0BC70BBE: 0x00000BCB - "\v\xc6\v\xd7\x00\x00\v\xcc" + // 0x0BC60BD7: 0x00000BCC - "\fF\fV\x00\x00\fH" + // 0x0C460C56: 0x00000C48 - "\f\xbf\f\xd5\x00\x00\f\xc0" + // 0x0CBF0CD5: 0x00000CC0 - "\f\xc6\f\xd5\x00\x00\f\xc7" + // 0x0CC60CD5: 0x00000CC7 - "\f\xc6\f\xd6\x00\x00\f\xc8" + // 0x0CC60CD6: 0x00000CC8 - "\f\xc6\f\xc2\x00\x00\f\xca" + // 0x0CC60CC2: 0x00000CCA - "\f\xca\f\xd5\x00\x00\f\xcb" + // 0x0CCA0CD5: 0x00000CCB - "\rF\r>\x00\x00\rJ" + // 0x0D460D3E: 0x00000D4A - "\rG\r>\x00\x00\rK" + // 0x0D470D3E: 0x00000D4B - "\rF\rW\x00\x00\rL" + // 0x0D460D57: 0x00000D4C - "\r\xd9\r\xca\x00\x00\r\xda" + // 0x0DD90DCA: 0x00000DDA - "\r\xd9\r\xcf\x00\x00\r\xdc" + // 0x0DD90DCF: 0x00000DDC - "\r\xdc\r\xca\x00\x00\r\xdd" + // 0x0DDC0DCA: 0x00000DDD - "\r\xd9\r\xdf\x00\x00\r\xde" + // 0x0DD90DDF: 0x00000DDE - "\x10%\x10.\x00\x00\x10&" + // 0x1025102E: 0x00001026 - "\x1b\x05\x1b5\x00\x00\x1b\x06" + // 0x1B051B35: 0x00001B06 - "\x1b\a\x1b5\x00\x00\x1b\b" + // 0x1B071B35: 0x00001B08 - "\x1b\t\x1b5\x00\x00\x1b\n" + // 0x1B091B35: 0x00001B0A - "\x1b\v\x1b5\x00\x00\x1b\f" + // 0x1B0B1B35: 0x00001B0C - "\x1b\r\x1b5\x00\x00\x1b\x0e" + // 0x1B0D1B35: 0x00001B0E - "\x1b\x11\x1b5\x00\x00\x1b\x12" + // 0x1B111B35: 0x00001B12 - "\x1b:\x1b5\x00\x00\x1b;" + // 0x1B3A1B35: 0x00001B3B - "\x1b<\x1b5\x00\x00\x1b=" + // 0x1B3C1B35: 0x00001B3D - "\x1b>\x1b5\x00\x00\x1b@" + // 0x1B3E1B35: 0x00001B40 - "\x1b?\x1b5\x00\x00\x1bA" + // 0x1B3F1B35: 0x00001B41 - "\x1bB\x1b5\x00\x00\x1bC" + // 0x1B421B35: 0x00001B43 - "\x00A\x03%\x00\x00\x1e\x00" + // 0x00410325: 0x00001E00 - "\x00a\x03%\x00\x00\x1e\x01" + // 0x00610325: 0x00001E01 - "\x00B\x03\a\x00\x00\x1e\x02" + // 0x00420307: 0x00001E02 - "\x00b\x03\a\x00\x00\x1e\x03" + // 0x00620307: 0x00001E03 - "\x00B\x03#\x00\x00\x1e\x04" + // 0x00420323: 0x00001E04 - "\x00b\x03#\x00\x00\x1e\x05" + // 0x00620323: 0x00001E05 - "\x00B\x031\x00\x00\x1e\x06" + // 0x00420331: 0x00001E06 - "\x00b\x031\x00\x00\x1e\a" + // 0x00620331: 0x00001E07 - "\x00\xc7\x03\x01\x00\x00\x1e\b" + // 0x00C70301: 0x00001E08 - "\x00\xe7\x03\x01\x00\x00\x1e\t" + // 0x00E70301: 0x00001E09 - "\x00D\x03\a\x00\x00\x1e\n" + // 0x00440307: 0x00001E0A - "\x00d\x03\a\x00\x00\x1e\v" + // 0x00640307: 0x00001E0B - "\x00D\x03#\x00\x00\x1e\f" + // 0x00440323: 0x00001E0C - "\x00d\x03#\x00\x00\x1e\r" + // 0x00640323: 0x00001E0D - "\x00D\x031\x00\x00\x1e\x0e" + // 0x00440331: 0x00001E0E - "\x00d\x031\x00\x00\x1e\x0f" + // 0x00640331: 0x00001E0F - "\x00D\x03'\x00\x00\x1e\x10" + // 0x00440327: 0x00001E10 - "\x00d\x03'\x00\x00\x1e\x11" + // 0x00640327: 0x00001E11 - "\x00D\x03-\x00\x00\x1e\x12" + // 0x0044032D: 0x00001E12 - "\x00d\x03-\x00\x00\x1e\x13" + // 0x0064032D: 0x00001E13 - "\x01\x12\x03\x00\x00\x00\x1e\x14" + // 0x01120300: 0x00001E14 - "\x01\x13\x03\x00\x00\x00\x1e\x15" + // 0x01130300: 0x00001E15 - "\x01\x12\x03\x01\x00\x00\x1e\x16" + // 0x01120301: 0x00001E16 - "\x01\x13\x03\x01\x00\x00\x1e\x17" + // 0x01130301: 0x00001E17 - "\x00E\x03-\x00\x00\x1e\x18" + // 0x0045032D: 0x00001E18 - "\x00e\x03-\x00\x00\x1e\x19" + // 0x0065032D: 0x00001E19 - "\x00E\x030\x00\x00\x1e\x1a" + // 0x00450330: 0x00001E1A - "\x00e\x030\x00\x00\x1e\x1b" + // 0x00650330: 0x00001E1B - "\x02(\x03\x06\x00\x00\x1e\x1c" + // 0x02280306: 0x00001E1C - "\x02)\x03\x06\x00\x00\x1e\x1d" + // 0x02290306: 0x00001E1D - "\x00F\x03\a\x00\x00\x1e\x1e" + // 0x00460307: 0x00001E1E - "\x00f\x03\a\x00\x00\x1e\x1f" + // 0x00660307: 0x00001E1F - "\x00G\x03\x04\x00\x00\x1e " + // 0x00470304: 0x00001E20 - "\x00g\x03\x04\x00\x00\x1e!" + // 0x00670304: 0x00001E21 - "\x00H\x03\a\x00\x00\x1e\"" + // 0x00480307: 0x00001E22 - "\x00h\x03\a\x00\x00\x1e#" + // 0x00680307: 0x00001E23 - "\x00H\x03#\x00\x00\x1e$" + // 0x00480323: 0x00001E24 - "\x00h\x03#\x00\x00\x1e%" + // 0x00680323: 0x00001E25 - "\x00H\x03\b\x00\x00\x1e&" + // 0x00480308: 0x00001E26 - "\x00h\x03\b\x00\x00\x1e'" + // 0x00680308: 0x00001E27 - "\x00H\x03'\x00\x00\x1e(" + // 0x00480327: 0x00001E28 - "\x00h\x03'\x00\x00\x1e)" + // 0x00680327: 0x00001E29 - "\x00H\x03.\x00\x00\x1e*" + // 0x0048032E: 0x00001E2A - "\x00h\x03.\x00\x00\x1e+" + // 0x0068032E: 0x00001E2B - "\x00I\x030\x00\x00\x1e," + // 0x00490330: 0x00001E2C - "\x00i\x030\x00\x00\x1e-" + // 0x00690330: 0x00001E2D - "\x00\xcf\x03\x01\x00\x00\x1e." + // 0x00CF0301: 0x00001E2E - "\x00\xef\x03\x01\x00\x00\x1e/" + // 0x00EF0301: 0x00001E2F - "\x00K\x03\x01\x00\x00\x1e0" + // 0x004B0301: 0x00001E30 - "\x00k\x03\x01\x00\x00\x1e1" + // 0x006B0301: 0x00001E31 - "\x00K\x03#\x00\x00\x1e2" + // 0x004B0323: 0x00001E32 - "\x00k\x03#\x00\x00\x1e3" + // 0x006B0323: 0x00001E33 - "\x00K\x031\x00\x00\x1e4" + // 0x004B0331: 0x00001E34 - "\x00k\x031\x00\x00\x1e5" + // 0x006B0331: 0x00001E35 - "\x00L\x03#\x00\x00\x1e6" + // 0x004C0323: 0x00001E36 - "\x00l\x03#\x00\x00\x1e7" + // 0x006C0323: 0x00001E37 - "\x1e6\x03\x04\x00\x00\x1e8" + // 0x1E360304: 0x00001E38 - "\x1e7\x03\x04\x00\x00\x1e9" + // 0x1E370304: 0x00001E39 - "\x00L\x031\x00\x00\x1e:" + // 0x004C0331: 0x00001E3A - "\x00l\x031\x00\x00\x1e;" + // 0x006C0331: 0x00001E3B - "\x00L\x03-\x00\x00\x1e<" + // 0x004C032D: 0x00001E3C - "\x00l\x03-\x00\x00\x1e=" + // 0x006C032D: 0x00001E3D - "\x00M\x03\x01\x00\x00\x1e>" + // 0x004D0301: 0x00001E3E - "\x00m\x03\x01\x00\x00\x1e?" + // 0x006D0301: 0x00001E3F - "\x00M\x03\a\x00\x00\x1e@" + // 0x004D0307: 0x00001E40 - "\x00m\x03\a\x00\x00\x1eA" + // 0x006D0307: 0x00001E41 - "\x00M\x03#\x00\x00\x1eB" + // 0x004D0323: 0x00001E42 - "\x00m\x03#\x00\x00\x1eC" + // 0x006D0323: 0x00001E43 - "\x00N\x03\a\x00\x00\x1eD" + // 0x004E0307: 0x00001E44 - "\x00n\x03\a\x00\x00\x1eE" + // 0x006E0307: 0x00001E45 - "\x00N\x03#\x00\x00\x1eF" + // 0x004E0323: 0x00001E46 - "\x00n\x03#\x00\x00\x1eG" + // 0x006E0323: 0x00001E47 - "\x00N\x031\x00\x00\x1eH" + // 0x004E0331: 0x00001E48 - "\x00n\x031\x00\x00\x1eI" + // 0x006E0331: 0x00001E49 - "\x00N\x03-\x00\x00\x1eJ" + // 0x004E032D: 0x00001E4A - "\x00n\x03-\x00\x00\x1eK" + // 0x006E032D: 0x00001E4B - "\x00\xd5\x03\x01\x00\x00\x1eL" + // 0x00D50301: 0x00001E4C - "\x00\xf5\x03\x01\x00\x00\x1eM" + // 0x00F50301: 0x00001E4D - "\x00\xd5\x03\b\x00\x00\x1eN" + // 0x00D50308: 0x00001E4E - "\x00\xf5\x03\b\x00\x00\x1eO" + // 0x00F50308: 0x00001E4F - "\x01L\x03\x00\x00\x00\x1eP" + // 0x014C0300: 0x00001E50 - "\x01M\x03\x00\x00\x00\x1eQ" + // 0x014D0300: 0x00001E51 - "\x01L\x03\x01\x00\x00\x1eR" + // 0x014C0301: 0x00001E52 - "\x01M\x03\x01\x00\x00\x1eS" + // 0x014D0301: 0x00001E53 - "\x00P\x03\x01\x00\x00\x1eT" + // 0x00500301: 0x00001E54 - "\x00p\x03\x01\x00\x00\x1eU" + // 0x00700301: 0x00001E55 - "\x00P\x03\a\x00\x00\x1eV" + // 0x00500307: 0x00001E56 - "\x00p\x03\a\x00\x00\x1eW" + // 0x00700307: 0x00001E57 - "\x00R\x03\a\x00\x00\x1eX" + // 0x00520307: 0x00001E58 - "\x00r\x03\a\x00\x00\x1eY" + // 0x00720307: 0x00001E59 - "\x00R\x03#\x00\x00\x1eZ" + // 0x00520323: 0x00001E5A - "\x00r\x03#\x00\x00\x1e[" + // 0x00720323: 0x00001E5B - "\x1eZ\x03\x04\x00\x00\x1e\\" + // 0x1E5A0304: 0x00001E5C - "\x1e[\x03\x04\x00\x00\x1e]" + // 0x1E5B0304: 0x00001E5D - "\x00R\x031\x00\x00\x1e^" + // 0x00520331: 0x00001E5E - "\x00r\x031\x00\x00\x1e_" + // 0x00720331: 0x00001E5F - "\x00S\x03\a\x00\x00\x1e`" + // 0x00530307: 0x00001E60 - "\x00s\x03\a\x00\x00\x1ea" + // 0x00730307: 0x00001E61 - "\x00S\x03#\x00\x00\x1eb" + // 0x00530323: 0x00001E62 - "\x00s\x03#\x00\x00\x1ec" + // 0x00730323: 0x00001E63 - "\x01Z\x03\a\x00\x00\x1ed" + // 0x015A0307: 0x00001E64 - "\x01[\x03\a\x00\x00\x1ee" + // 0x015B0307: 0x00001E65 - "\x01`\x03\a\x00\x00\x1ef" + // 0x01600307: 0x00001E66 - "\x01a\x03\a\x00\x00\x1eg" + // 0x01610307: 0x00001E67 - "\x1eb\x03\a\x00\x00\x1eh" + // 0x1E620307: 0x00001E68 - "\x1ec\x03\a\x00\x00\x1ei" + // 0x1E630307: 0x00001E69 - "\x00T\x03\a\x00\x00\x1ej" + // 0x00540307: 0x00001E6A - "\x00t\x03\a\x00\x00\x1ek" + // 0x00740307: 0x00001E6B - "\x00T\x03#\x00\x00\x1el" + // 0x00540323: 0x00001E6C - "\x00t\x03#\x00\x00\x1em" + // 0x00740323: 0x00001E6D - "\x00T\x031\x00\x00\x1en" + // 0x00540331: 0x00001E6E - "\x00t\x031\x00\x00\x1eo" + // 0x00740331: 0x00001E6F - "\x00T\x03-\x00\x00\x1ep" + // 0x0054032D: 0x00001E70 - "\x00t\x03-\x00\x00\x1eq" + // 0x0074032D: 0x00001E71 - "\x00U\x03$\x00\x00\x1er" + // 0x00550324: 0x00001E72 - "\x00u\x03$\x00\x00\x1es" + // 0x00750324: 0x00001E73 - "\x00U\x030\x00\x00\x1et" + // 0x00550330: 0x00001E74 - "\x00u\x030\x00\x00\x1eu" + // 0x00750330: 0x00001E75 - "\x00U\x03-\x00\x00\x1ev" + // 0x0055032D: 0x00001E76 - "\x00u\x03-\x00\x00\x1ew" + // 0x0075032D: 0x00001E77 - "\x01h\x03\x01\x00\x00\x1ex" + // 0x01680301: 0x00001E78 - "\x01i\x03\x01\x00\x00\x1ey" + // 0x01690301: 0x00001E79 - "\x01j\x03\b\x00\x00\x1ez" + // 0x016A0308: 0x00001E7A - "\x01k\x03\b\x00\x00\x1e{" + // 0x016B0308: 0x00001E7B - "\x00V\x03\x03\x00\x00\x1e|" + // 0x00560303: 0x00001E7C - "\x00v\x03\x03\x00\x00\x1e}" + // 0x00760303: 0x00001E7D - "\x00V\x03#\x00\x00\x1e~" + // 0x00560323: 0x00001E7E - "\x00v\x03#\x00\x00\x1e\x7f" + // 0x00760323: 0x00001E7F - "\x00W\x03\x00\x00\x00\x1e\x80" + // 0x00570300: 0x00001E80 - "\x00w\x03\x00\x00\x00\x1e\x81" + // 0x00770300: 0x00001E81 - "\x00W\x03\x01\x00\x00\x1e\x82" + // 0x00570301: 0x00001E82 - "\x00w\x03\x01\x00\x00\x1e\x83" + // 0x00770301: 0x00001E83 - "\x00W\x03\b\x00\x00\x1e\x84" + // 0x00570308: 0x00001E84 - "\x00w\x03\b\x00\x00\x1e\x85" + // 0x00770308: 0x00001E85 - "\x00W\x03\a\x00\x00\x1e\x86" + // 0x00570307: 0x00001E86 - "\x00w\x03\a\x00\x00\x1e\x87" + // 0x00770307: 0x00001E87 - "\x00W\x03#\x00\x00\x1e\x88" + // 0x00570323: 0x00001E88 - "\x00w\x03#\x00\x00\x1e\x89" + // 0x00770323: 0x00001E89 - "\x00X\x03\a\x00\x00\x1e\x8a" + // 0x00580307: 0x00001E8A - "\x00x\x03\a\x00\x00\x1e\x8b" + // 0x00780307: 0x00001E8B - "\x00X\x03\b\x00\x00\x1e\x8c" + // 0x00580308: 0x00001E8C - "\x00x\x03\b\x00\x00\x1e\x8d" + // 0x00780308: 0x00001E8D - "\x00Y\x03\a\x00\x00\x1e\x8e" + // 0x00590307: 0x00001E8E - "\x00y\x03\a\x00\x00\x1e\x8f" + // 0x00790307: 0x00001E8F - "\x00Z\x03\x02\x00\x00\x1e\x90" + // 0x005A0302: 0x00001E90 - "\x00z\x03\x02\x00\x00\x1e\x91" + // 0x007A0302: 0x00001E91 - "\x00Z\x03#\x00\x00\x1e\x92" + // 0x005A0323: 0x00001E92 - "\x00z\x03#\x00\x00\x1e\x93" + // 0x007A0323: 0x00001E93 - "\x00Z\x031\x00\x00\x1e\x94" + // 0x005A0331: 0x00001E94 - "\x00z\x031\x00\x00\x1e\x95" + // 0x007A0331: 0x00001E95 - "\x00h\x031\x00\x00\x1e\x96" + // 0x00680331: 0x00001E96 - "\x00t\x03\b\x00\x00\x1e\x97" + // 0x00740308: 0x00001E97 - "\x00w\x03\n\x00\x00\x1e\x98" + // 0x0077030A: 0x00001E98 - "\x00y\x03\n\x00\x00\x1e\x99" + // 0x0079030A: 0x00001E99 - "\x01\x7f\x03\a\x00\x00\x1e\x9b" + // 0x017F0307: 0x00001E9B - "\x00A\x03#\x00\x00\x1e\xa0" + // 0x00410323: 0x00001EA0 - "\x00a\x03#\x00\x00\x1e\xa1" + // 0x00610323: 0x00001EA1 - "\x00A\x03\t\x00\x00\x1e\xa2" + // 0x00410309: 0x00001EA2 - "\x00a\x03\t\x00\x00\x1e\xa3" + // 0x00610309: 0x00001EA3 - "\x00\xc2\x03\x01\x00\x00\x1e\xa4" + // 0x00C20301: 0x00001EA4 - "\x00\xe2\x03\x01\x00\x00\x1e\xa5" + // 0x00E20301: 0x00001EA5 - "\x00\xc2\x03\x00\x00\x00\x1e\xa6" + // 0x00C20300: 0x00001EA6 - "\x00\xe2\x03\x00\x00\x00\x1e\xa7" + // 0x00E20300: 0x00001EA7 - "\x00\xc2\x03\t\x00\x00\x1e\xa8" + // 0x00C20309: 0x00001EA8 - "\x00\xe2\x03\t\x00\x00\x1e\xa9" + // 0x00E20309: 0x00001EA9 - "\x00\xc2\x03\x03\x00\x00\x1e\xaa" + // 0x00C20303: 0x00001EAA - "\x00\xe2\x03\x03\x00\x00\x1e\xab" + // 0x00E20303: 0x00001EAB - "\x1e\xa0\x03\x02\x00\x00\x1e\xac" + // 0x1EA00302: 0x00001EAC - "\x1e\xa1\x03\x02\x00\x00\x1e\xad" + // 0x1EA10302: 0x00001EAD - "\x01\x02\x03\x01\x00\x00\x1e\xae" + // 0x01020301: 0x00001EAE - "\x01\x03\x03\x01\x00\x00\x1e\xaf" + // 0x01030301: 0x00001EAF - "\x01\x02\x03\x00\x00\x00\x1e\xb0" + // 0x01020300: 0x00001EB0 - "\x01\x03\x03\x00\x00\x00\x1e\xb1" + // 0x01030300: 0x00001EB1 - "\x01\x02\x03\t\x00\x00\x1e\xb2" + // 0x01020309: 0x00001EB2 - "\x01\x03\x03\t\x00\x00\x1e\xb3" + // 0x01030309: 0x00001EB3 - "\x01\x02\x03\x03\x00\x00\x1e\xb4" + // 0x01020303: 0x00001EB4 - "\x01\x03\x03\x03\x00\x00\x1e\xb5" + // 0x01030303: 0x00001EB5 - "\x1e\xa0\x03\x06\x00\x00\x1e\xb6" + // 0x1EA00306: 0x00001EB6 - "\x1e\xa1\x03\x06\x00\x00\x1e\xb7" + // 0x1EA10306: 0x00001EB7 - "\x00E\x03#\x00\x00\x1e\xb8" + // 0x00450323: 0x00001EB8 - "\x00e\x03#\x00\x00\x1e\xb9" + // 0x00650323: 0x00001EB9 - "\x00E\x03\t\x00\x00\x1e\xba" + // 0x00450309: 0x00001EBA - "\x00e\x03\t\x00\x00\x1e\xbb" + // 0x00650309: 0x00001EBB - "\x00E\x03\x03\x00\x00\x1e\xbc" + // 0x00450303: 0x00001EBC - "\x00e\x03\x03\x00\x00\x1e\xbd" + // 0x00650303: 0x00001EBD - "\x00\xca\x03\x01\x00\x00\x1e\xbe" + // 0x00CA0301: 0x00001EBE - "\x00\xea\x03\x01\x00\x00\x1e\xbf" + // 0x00EA0301: 0x00001EBF - "\x00\xca\x03\x00\x00\x00\x1e\xc0" + // 0x00CA0300: 0x00001EC0 - "\x00\xea\x03\x00\x00\x00\x1e\xc1" + // 0x00EA0300: 0x00001EC1 - "\x00\xca\x03\t\x00\x00\x1e\xc2" + // 0x00CA0309: 0x00001EC2 - "\x00\xea\x03\t\x00\x00\x1e\xc3" + // 0x00EA0309: 0x00001EC3 - "\x00\xca\x03\x03\x00\x00\x1e\xc4" + // 0x00CA0303: 0x00001EC4 - "\x00\xea\x03\x03\x00\x00\x1e\xc5" + // 0x00EA0303: 0x00001EC5 - "\x1e\xb8\x03\x02\x00\x00\x1e\xc6" + // 0x1EB80302: 0x00001EC6 - "\x1e\xb9\x03\x02\x00\x00\x1e\xc7" + // 0x1EB90302: 0x00001EC7 - "\x00I\x03\t\x00\x00\x1e\xc8" + // 0x00490309: 0x00001EC8 - "\x00i\x03\t\x00\x00\x1e\xc9" + // 0x00690309: 0x00001EC9 - "\x00I\x03#\x00\x00\x1e\xca" + // 0x00490323: 0x00001ECA - "\x00i\x03#\x00\x00\x1e\xcb" + // 0x00690323: 0x00001ECB - "\x00O\x03#\x00\x00\x1e\xcc" + // 0x004F0323: 0x00001ECC - "\x00o\x03#\x00\x00\x1e\xcd" + // 0x006F0323: 0x00001ECD - "\x00O\x03\t\x00\x00\x1e\xce" + // 0x004F0309: 0x00001ECE - "\x00o\x03\t\x00\x00\x1e\xcf" + // 0x006F0309: 0x00001ECF - "\x00\xd4\x03\x01\x00\x00\x1e\xd0" + // 0x00D40301: 0x00001ED0 - "\x00\xf4\x03\x01\x00\x00\x1e\xd1" + // 0x00F40301: 0x00001ED1 - "\x00\xd4\x03\x00\x00\x00\x1e\xd2" + // 0x00D40300: 0x00001ED2 - "\x00\xf4\x03\x00\x00\x00\x1e\xd3" + // 0x00F40300: 0x00001ED3 - "\x00\xd4\x03\t\x00\x00\x1e\xd4" + // 0x00D40309: 0x00001ED4 - "\x00\xf4\x03\t\x00\x00\x1e\xd5" + // 0x00F40309: 0x00001ED5 - "\x00\xd4\x03\x03\x00\x00\x1e\xd6" + // 0x00D40303: 0x00001ED6 - "\x00\xf4\x03\x03\x00\x00\x1e\xd7" + // 0x00F40303: 0x00001ED7 - "\x1e\xcc\x03\x02\x00\x00\x1e\xd8" + // 0x1ECC0302: 0x00001ED8 - "\x1e\xcd\x03\x02\x00\x00\x1e\xd9" + // 0x1ECD0302: 0x00001ED9 - "\x01\xa0\x03\x01\x00\x00\x1e\xda" + // 0x01A00301: 0x00001EDA - "\x01\xa1\x03\x01\x00\x00\x1e\xdb" + // 0x01A10301: 0x00001EDB - "\x01\xa0\x03\x00\x00\x00\x1e\xdc" + // 0x01A00300: 0x00001EDC - "\x01\xa1\x03\x00\x00\x00\x1e\xdd" + // 0x01A10300: 0x00001EDD - "\x01\xa0\x03\t\x00\x00\x1e\xde" + // 0x01A00309: 0x00001EDE - "\x01\xa1\x03\t\x00\x00\x1e\xdf" + // 0x01A10309: 0x00001EDF - "\x01\xa0\x03\x03\x00\x00\x1e\xe0" + // 0x01A00303: 0x00001EE0 - "\x01\xa1\x03\x03\x00\x00\x1e\xe1" + // 0x01A10303: 0x00001EE1 - "\x01\xa0\x03#\x00\x00\x1e\xe2" + // 0x01A00323: 0x00001EE2 - "\x01\xa1\x03#\x00\x00\x1e\xe3" + // 0x01A10323: 0x00001EE3 - "\x00U\x03#\x00\x00\x1e\xe4" + // 0x00550323: 0x00001EE4 - "\x00u\x03#\x00\x00\x1e\xe5" + // 0x00750323: 0x00001EE5 - "\x00U\x03\t\x00\x00\x1e\xe6" + // 0x00550309: 0x00001EE6 - "\x00u\x03\t\x00\x00\x1e\xe7" + // 0x00750309: 0x00001EE7 - "\x01\xaf\x03\x01\x00\x00\x1e\xe8" + // 0x01AF0301: 0x00001EE8 - "\x01\xb0\x03\x01\x00\x00\x1e\xe9" + // 0x01B00301: 0x00001EE9 - "\x01\xaf\x03\x00\x00\x00\x1e\xea" + // 0x01AF0300: 0x00001EEA - "\x01\xb0\x03\x00\x00\x00\x1e\xeb" + // 0x01B00300: 0x00001EEB - "\x01\xaf\x03\t\x00\x00\x1e\xec" + // 0x01AF0309: 0x00001EEC - "\x01\xb0\x03\t\x00\x00\x1e\xed" + // 0x01B00309: 0x00001EED - "\x01\xaf\x03\x03\x00\x00\x1e\xee" + // 0x01AF0303: 0x00001EEE - "\x01\xb0\x03\x03\x00\x00\x1e\xef" + // 0x01B00303: 0x00001EEF - "\x01\xaf\x03#\x00\x00\x1e\xf0" + // 0x01AF0323: 0x00001EF0 - "\x01\xb0\x03#\x00\x00\x1e\xf1" + // 0x01B00323: 0x00001EF1 - "\x00Y\x03\x00\x00\x00\x1e\xf2" + // 0x00590300: 0x00001EF2 - "\x00y\x03\x00\x00\x00\x1e\xf3" + // 0x00790300: 0x00001EF3 - "\x00Y\x03#\x00\x00\x1e\xf4" + // 0x00590323: 0x00001EF4 - "\x00y\x03#\x00\x00\x1e\xf5" + // 0x00790323: 0x00001EF5 - "\x00Y\x03\t\x00\x00\x1e\xf6" + // 0x00590309: 0x00001EF6 - "\x00y\x03\t\x00\x00\x1e\xf7" + // 0x00790309: 0x00001EF7 - "\x00Y\x03\x03\x00\x00\x1e\xf8" + // 0x00590303: 0x00001EF8 - "\x00y\x03\x03\x00\x00\x1e\xf9" + // 0x00790303: 0x00001EF9 - "\x03\xb1\x03\x13\x00\x00\x1f\x00" + // 0x03B10313: 0x00001F00 - "\x03\xb1\x03\x14\x00\x00\x1f\x01" + // 0x03B10314: 0x00001F01 - "\x1f\x00\x03\x00\x00\x00\x1f\x02" + // 0x1F000300: 0x00001F02 - "\x1f\x01\x03\x00\x00\x00\x1f\x03" + // 0x1F010300: 0x00001F03 - "\x1f\x00\x03\x01\x00\x00\x1f\x04" + // 0x1F000301: 0x00001F04 - "\x1f\x01\x03\x01\x00\x00\x1f\x05" + // 0x1F010301: 0x00001F05 - "\x1f\x00\x03B\x00\x00\x1f\x06" + // 0x1F000342: 0x00001F06 - "\x1f\x01\x03B\x00\x00\x1f\a" + // 0x1F010342: 0x00001F07 - "\x03\x91\x03\x13\x00\x00\x1f\b" + // 0x03910313: 0x00001F08 - "\x03\x91\x03\x14\x00\x00\x1f\t" + // 0x03910314: 0x00001F09 - "\x1f\b\x03\x00\x00\x00\x1f\n" + // 0x1F080300: 0x00001F0A - "\x1f\t\x03\x00\x00\x00\x1f\v" + // 0x1F090300: 0x00001F0B - "\x1f\b\x03\x01\x00\x00\x1f\f" + // 0x1F080301: 0x00001F0C - "\x1f\t\x03\x01\x00\x00\x1f\r" + // 0x1F090301: 0x00001F0D - "\x1f\b\x03B\x00\x00\x1f\x0e" + // 0x1F080342: 0x00001F0E - "\x1f\t\x03B\x00\x00\x1f\x0f" + // 0x1F090342: 0x00001F0F - "\x03\xb5\x03\x13\x00\x00\x1f\x10" + // 0x03B50313: 0x00001F10 - "\x03\xb5\x03\x14\x00\x00\x1f\x11" + // 0x03B50314: 0x00001F11 - "\x1f\x10\x03\x00\x00\x00\x1f\x12" + // 0x1F100300: 0x00001F12 - "\x1f\x11\x03\x00\x00\x00\x1f\x13" + // 0x1F110300: 0x00001F13 - "\x1f\x10\x03\x01\x00\x00\x1f\x14" + // 0x1F100301: 0x00001F14 - "\x1f\x11\x03\x01\x00\x00\x1f\x15" + // 0x1F110301: 0x00001F15 - "\x03\x95\x03\x13\x00\x00\x1f\x18" + // 0x03950313: 0x00001F18 - "\x03\x95\x03\x14\x00\x00\x1f\x19" + // 0x03950314: 0x00001F19 - "\x1f\x18\x03\x00\x00\x00\x1f\x1a" + // 0x1F180300: 0x00001F1A - "\x1f\x19\x03\x00\x00\x00\x1f\x1b" + // 0x1F190300: 0x00001F1B - "\x1f\x18\x03\x01\x00\x00\x1f\x1c" + // 0x1F180301: 0x00001F1C - "\x1f\x19\x03\x01\x00\x00\x1f\x1d" + // 0x1F190301: 0x00001F1D - "\x03\xb7\x03\x13\x00\x00\x1f " + // 0x03B70313: 0x00001F20 - "\x03\xb7\x03\x14\x00\x00\x1f!" + // 0x03B70314: 0x00001F21 - "\x1f \x03\x00\x00\x00\x1f\"" + // 0x1F200300: 0x00001F22 - "\x1f!\x03\x00\x00\x00\x1f#" + // 0x1F210300: 0x00001F23 - "\x1f \x03\x01\x00\x00\x1f$" + // 0x1F200301: 0x00001F24 - "\x1f!\x03\x01\x00\x00\x1f%" + // 0x1F210301: 0x00001F25 - "\x1f \x03B\x00\x00\x1f&" + // 0x1F200342: 0x00001F26 - "\x1f!\x03B\x00\x00\x1f'" + // 0x1F210342: 0x00001F27 - "\x03\x97\x03\x13\x00\x00\x1f(" + // 0x03970313: 0x00001F28 - "\x03\x97\x03\x14\x00\x00\x1f)" + // 0x03970314: 0x00001F29 - "\x1f(\x03\x00\x00\x00\x1f*" + // 0x1F280300: 0x00001F2A - "\x1f)\x03\x00\x00\x00\x1f+" + // 0x1F290300: 0x00001F2B - "\x1f(\x03\x01\x00\x00\x1f," + // 0x1F280301: 0x00001F2C - "\x1f)\x03\x01\x00\x00\x1f-" + // 0x1F290301: 0x00001F2D - "\x1f(\x03B\x00\x00\x1f." + // 0x1F280342: 0x00001F2E - "\x1f)\x03B\x00\x00\x1f/" + // 0x1F290342: 0x00001F2F - "\x03\xb9\x03\x13\x00\x00\x1f0" + // 0x03B90313: 0x00001F30 - "\x03\xb9\x03\x14\x00\x00\x1f1" + // 0x03B90314: 0x00001F31 - "\x1f0\x03\x00\x00\x00\x1f2" + // 0x1F300300: 0x00001F32 - "\x1f1\x03\x00\x00\x00\x1f3" + // 0x1F310300: 0x00001F33 - "\x1f0\x03\x01\x00\x00\x1f4" + // 0x1F300301: 0x00001F34 - "\x1f1\x03\x01\x00\x00\x1f5" + // 0x1F310301: 0x00001F35 - "\x1f0\x03B\x00\x00\x1f6" + // 0x1F300342: 0x00001F36 - "\x1f1\x03B\x00\x00\x1f7" + // 0x1F310342: 0x00001F37 - "\x03\x99\x03\x13\x00\x00\x1f8" + // 0x03990313: 0x00001F38 - "\x03\x99\x03\x14\x00\x00\x1f9" + // 0x03990314: 0x00001F39 - "\x1f8\x03\x00\x00\x00\x1f:" + // 0x1F380300: 0x00001F3A - "\x1f9\x03\x00\x00\x00\x1f;" + // 0x1F390300: 0x00001F3B - "\x1f8\x03\x01\x00\x00\x1f<" + // 0x1F380301: 0x00001F3C - "\x1f9\x03\x01\x00\x00\x1f=" + // 0x1F390301: 0x00001F3D - "\x1f8\x03B\x00\x00\x1f>" + // 0x1F380342: 0x00001F3E - "\x1f9\x03B\x00\x00\x1f?" + // 0x1F390342: 0x00001F3F - "\x03\xbf\x03\x13\x00\x00\x1f@" + // 0x03BF0313: 0x00001F40 - "\x03\xbf\x03\x14\x00\x00\x1fA" + // 0x03BF0314: 0x00001F41 - "\x1f@\x03\x00\x00\x00\x1fB" + // 0x1F400300: 0x00001F42 - "\x1fA\x03\x00\x00\x00\x1fC" + // 0x1F410300: 0x00001F43 - "\x1f@\x03\x01\x00\x00\x1fD" + // 0x1F400301: 0x00001F44 - "\x1fA\x03\x01\x00\x00\x1fE" + // 0x1F410301: 0x00001F45 - "\x03\x9f\x03\x13\x00\x00\x1fH" + // 0x039F0313: 0x00001F48 - "\x03\x9f\x03\x14\x00\x00\x1fI" + // 0x039F0314: 0x00001F49 - "\x1fH\x03\x00\x00\x00\x1fJ" + // 0x1F480300: 0x00001F4A - "\x1fI\x03\x00\x00\x00\x1fK" + // 0x1F490300: 0x00001F4B - "\x1fH\x03\x01\x00\x00\x1fL" + // 0x1F480301: 0x00001F4C - "\x1fI\x03\x01\x00\x00\x1fM" + // 0x1F490301: 0x00001F4D - "\x03\xc5\x03\x13\x00\x00\x1fP" + // 0x03C50313: 0x00001F50 - "\x03\xc5\x03\x14\x00\x00\x1fQ" + // 0x03C50314: 0x00001F51 - "\x1fP\x03\x00\x00\x00\x1fR" + // 0x1F500300: 0x00001F52 - "\x1fQ\x03\x00\x00\x00\x1fS" + // 0x1F510300: 0x00001F53 - "\x1fP\x03\x01\x00\x00\x1fT" + // 0x1F500301: 0x00001F54 - "\x1fQ\x03\x01\x00\x00\x1fU" + // 0x1F510301: 0x00001F55 - "\x1fP\x03B\x00\x00\x1fV" + // 0x1F500342: 0x00001F56 - "\x1fQ\x03B\x00\x00\x1fW" + // 0x1F510342: 0x00001F57 - "\x03\xa5\x03\x14\x00\x00\x1fY" + // 0x03A50314: 0x00001F59 - "\x1fY\x03\x00\x00\x00\x1f[" + // 0x1F590300: 0x00001F5B - "\x1fY\x03\x01\x00\x00\x1f]" + // 0x1F590301: 0x00001F5D - "\x1fY\x03B\x00\x00\x1f_" + // 0x1F590342: 0x00001F5F - "\x03\xc9\x03\x13\x00\x00\x1f`" + // 0x03C90313: 0x00001F60 - "\x03\xc9\x03\x14\x00\x00\x1fa" + // 0x03C90314: 0x00001F61 - "\x1f`\x03\x00\x00\x00\x1fb" + // 0x1F600300: 0x00001F62 - "\x1fa\x03\x00\x00\x00\x1fc" + // 0x1F610300: 0x00001F63 - "\x1f`\x03\x01\x00\x00\x1fd" + // 0x1F600301: 0x00001F64 - "\x1fa\x03\x01\x00\x00\x1fe" + // 0x1F610301: 0x00001F65 - "\x1f`\x03B\x00\x00\x1ff" + // 0x1F600342: 0x00001F66 - "\x1fa\x03B\x00\x00\x1fg" + // 0x1F610342: 0x00001F67 - "\x03\xa9\x03\x13\x00\x00\x1fh" + // 0x03A90313: 0x00001F68 - "\x03\xa9\x03\x14\x00\x00\x1fi" + // 0x03A90314: 0x00001F69 - "\x1fh\x03\x00\x00\x00\x1fj" + // 0x1F680300: 0x00001F6A - "\x1fi\x03\x00\x00\x00\x1fk" + // 0x1F690300: 0x00001F6B - "\x1fh\x03\x01\x00\x00\x1fl" + // 0x1F680301: 0x00001F6C - "\x1fi\x03\x01\x00\x00\x1fm" + // 0x1F690301: 0x00001F6D - "\x1fh\x03B\x00\x00\x1fn" + // 0x1F680342: 0x00001F6E - "\x1fi\x03B\x00\x00\x1fo" + // 0x1F690342: 0x00001F6F - "\x03\xb1\x03\x00\x00\x00\x1fp" + // 0x03B10300: 0x00001F70 - "\x03\xb5\x03\x00\x00\x00\x1fr" + // 0x03B50300: 0x00001F72 - "\x03\xb7\x03\x00\x00\x00\x1ft" + // 0x03B70300: 0x00001F74 - "\x03\xb9\x03\x00\x00\x00\x1fv" + // 0x03B90300: 0x00001F76 - "\x03\xbf\x03\x00\x00\x00\x1fx" + // 0x03BF0300: 0x00001F78 - "\x03\xc5\x03\x00\x00\x00\x1fz" + // 0x03C50300: 0x00001F7A - "\x03\xc9\x03\x00\x00\x00\x1f|" + // 0x03C90300: 0x00001F7C - "\x1f\x00\x03E\x00\x00\x1f\x80" + // 0x1F000345: 0x00001F80 - "\x1f\x01\x03E\x00\x00\x1f\x81" + // 0x1F010345: 0x00001F81 - "\x1f\x02\x03E\x00\x00\x1f\x82" + // 0x1F020345: 0x00001F82 - "\x1f\x03\x03E\x00\x00\x1f\x83" + // 0x1F030345: 0x00001F83 - "\x1f\x04\x03E\x00\x00\x1f\x84" + // 0x1F040345: 0x00001F84 - "\x1f\x05\x03E\x00\x00\x1f\x85" + // 0x1F050345: 0x00001F85 - "\x1f\x06\x03E\x00\x00\x1f\x86" + // 0x1F060345: 0x00001F86 - "\x1f\a\x03E\x00\x00\x1f\x87" + // 0x1F070345: 0x00001F87 - "\x1f\b\x03E\x00\x00\x1f\x88" + // 0x1F080345: 0x00001F88 - "\x1f\t\x03E\x00\x00\x1f\x89" + // 0x1F090345: 0x00001F89 - "\x1f\n\x03E\x00\x00\x1f\x8a" + // 0x1F0A0345: 0x00001F8A - "\x1f\v\x03E\x00\x00\x1f\x8b" + // 0x1F0B0345: 0x00001F8B - "\x1f\f\x03E\x00\x00\x1f\x8c" + // 0x1F0C0345: 0x00001F8C - "\x1f\r\x03E\x00\x00\x1f\x8d" + // 0x1F0D0345: 0x00001F8D - "\x1f\x0e\x03E\x00\x00\x1f\x8e" + // 0x1F0E0345: 0x00001F8E - "\x1f\x0f\x03E\x00\x00\x1f\x8f" + // 0x1F0F0345: 0x00001F8F - "\x1f \x03E\x00\x00\x1f\x90" + // 0x1F200345: 0x00001F90 - "\x1f!\x03E\x00\x00\x1f\x91" + // 0x1F210345: 0x00001F91 - "\x1f\"\x03E\x00\x00\x1f\x92" + // 0x1F220345: 0x00001F92 - "\x1f#\x03E\x00\x00\x1f\x93" + // 0x1F230345: 0x00001F93 - "\x1f$\x03E\x00\x00\x1f\x94" + // 0x1F240345: 0x00001F94 - "\x1f%\x03E\x00\x00\x1f\x95" + // 0x1F250345: 0x00001F95 - "\x1f&\x03E\x00\x00\x1f\x96" + // 0x1F260345: 0x00001F96 - "\x1f'\x03E\x00\x00\x1f\x97" + // 0x1F270345: 0x00001F97 - "\x1f(\x03E\x00\x00\x1f\x98" + // 0x1F280345: 0x00001F98 - "\x1f)\x03E\x00\x00\x1f\x99" + // 0x1F290345: 0x00001F99 - "\x1f*\x03E\x00\x00\x1f\x9a" + // 0x1F2A0345: 0x00001F9A - "\x1f+\x03E\x00\x00\x1f\x9b" + // 0x1F2B0345: 0x00001F9B - "\x1f,\x03E\x00\x00\x1f\x9c" + // 0x1F2C0345: 0x00001F9C - "\x1f-\x03E\x00\x00\x1f\x9d" + // 0x1F2D0345: 0x00001F9D - "\x1f.\x03E\x00\x00\x1f\x9e" + // 0x1F2E0345: 0x00001F9E - "\x1f/\x03E\x00\x00\x1f\x9f" + // 0x1F2F0345: 0x00001F9F - "\x1f`\x03E\x00\x00\x1f\xa0" + // 0x1F600345: 0x00001FA0 - "\x1fa\x03E\x00\x00\x1f\xa1" + // 0x1F610345: 0x00001FA1 - "\x1fb\x03E\x00\x00\x1f\xa2" + // 0x1F620345: 0x00001FA2 - "\x1fc\x03E\x00\x00\x1f\xa3" + // 0x1F630345: 0x00001FA3 - "\x1fd\x03E\x00\x00\x1f\xa4" + // 0x1F640345: 0x00001FA4 - "\x1fe\x03E\x00\x00\x1f\xa5" + // 0x1F650345: 0x00001FA5 - "\x1ff\x03E\x00\x00\x1f\xa6" + // 0x1F660345: 0x00001FA6 - "\x1fg\x03E\x00\x00\x1f\xa7" + // 0x1F670345: 0x00001FA7 - "\x1fh\x03E\x00\x00\x1f\xa8" + // 0x1F680345: 0x00001FA8 - "\x1fi\x03E\x00\x00\x1f\xa9" + // 0x1F690345: 0x00001FA9 - "\x1fj\x03E\x00\x00\x1f\xaa" + // 0x1F6A0345: 0x00001FAA - "\x1fk\x03E\x00\x00\x1f\xab" + // 0x1F6B0345: 0x00001FAB - "\x1fl\x03E\x00\x00\x1f\xac" + // 0x1F6C0345: 0x00001FAC - "\x1fm\x03E\x00\x00\x1f\xad" + // 0x1F6D0345: 0x00001FAD - "\x1fn\x03E\x00\x00\x1f\xae" + // 0x1F6E0345: 0x00001FAE - "\x1fo\x03E\x00\x00\x1f\xaf" + // 0x1F6F0345: 0x00001FAF - "\x03\xb1\x03\x06\x00\x00\x1f\xb0" + // 0x03B10306: 0x00001FB0 - "\x03\xb1\x03\x04\x00\x00\x1f\xb1" + // 0x03B10304: 0x00001FB1 - "\x1fp\x03E\x00\x00\x1f\xb2" + // 0x1F700345: 0x00001FB2 - "\x03\xb1\x03E\x00\x00\x1f\xb3" + // 0x03B10345: 0x00001FB3 - "\x03\xac\x03E\x00\x00\x1f\xb4" + // 0x03AC0345: 0x00001FB4 - "\x03\xb1\x03B\x00\x00\x1f\xb6" + // 0x03B10342: 0x00001FB6 - "\x1f\xb6\x03E\x00\x00\x1f\xb7" + // 0x1FB60345: 0x00001FB7 - "\x03\x91\x03\x06\x00\x00\x1f\xb8" + // 0x03910306: 0x00001FB8 - "\x03\x91\x03\x04\x00\x00\x1f\xb9" + // 0x03910304: 0x00001FB9 - "\x03\x91\x03\x00\x00\x00\x1f\xba" + // 0x03910300: 0x00001FBA - "\x03\x91\x03E\x00\x00\x1f\xbc" + // 0x03910345: 0x00001FBC - "\x00\xa8\x03B\x00\x00\x1f\xc1" + // 0x00A80342: 0x00001FC1 - "\x1ft\x03E\x00\x00\x1f\xc2" + // 0x1F740345: 0x00001FC2 - "\x03\xb7\x03E\x00\x00\x1f\xc3" + // 0x03B70345: 0x00001FC3 - "\x03\xae\x03E\x00\x00\x1f\xc4" + // 0x03AE0345: 0x00001FC4 - "\x03\xb7\x03B\x00\x00\x1f\xc6" + // 0x03B70342: 0x00001FC6 - "\x1f\xc6\x03E\x00\x00\x1f\xc7" + // 0x1FC60345: 0x00001FC7 - "\x03\x95\x03\x00\x00\x00\x1f\xc8" + // 0x03950300: 0x00001FC8 - "\x03\x97\x03\x00\x00\x00\x1f\xca" + // 0x03970300: 0x00001FCA - "\x03\x97\x03E\x00\x00\x1f\xcc" + // 0x03970345: 0x00001FCC - "\x1f\xbf\x03\x00\x00\x00\x1f\xcd" + // 0x1FBF0300: 0x00001FCD - "\x1f\xbf\x03\x01\x00\x00\x1f\xce" + // 0x1FBF0301: 0x00001FCE - "\x1f\xbf\x03B\x00\x00\x1f\xcf" + // 0x1FBF0342: 0x00001FCF - "\x03\xb9\x03\x06\x00\x00\x1f\xd0" + // 0x03B90306: 0x00001FD0 - "\x03\xb9\x03\x04\x00\x00\x1f\xd1" + // 0x03B90304: 0x00001FD1 - "\x03\xca\x03\x00\x00\x00\x1f\xd2" + // 0x03CA0300: 0x00001FD2 - "\x03\xb9\x03B\x00\x00\x1f\xd6" + // 0x03B90342: 0x00001FD6 - "\x03\xca\x03B\x00\x00\x1f\xd7" + // 0x03CA0342: 0x00001FD7 - "\x03\x99\x03\x06\x00\x00\x1f\xd8" + // 0x03990306: 0x00001FD8 - "\x03\x99\x03\x04\x00\x00\x1f\xd9" + // 0x03990304: 0x00001FD9 - "\x03\x99\x03\x00\x00\x00\x1f\xda" + // 0x03990300: 0x00001FDA - "\x1f\xfe\x03\x00\x00\x00\x1f\xdd" + // 0x1FFE0300: 0x00001FDD - "\x1f\xfe\x03\x01\x00\x00\x1f\xde" + // 0x1FFE0301: 0x00001FDE - "\x1f\xfe\x03B\x00\x00\x1f\xdf" + // 0x1FFE0342: 0x00001FDF - "\x03\xc5\x03\x06\x00\x00\x1f\xe0" + // 0x03C50306: 0x00001FE0 - "\x03\xc5\x03\x04\x00\x00\x1f\xe1" + // 0x03C50304: 0x00001FE1 - "\x03\xcb\x03\x00\x00\x00\x1f\xe2" + // 0x03CB0300: 0x00001FE2 - "\x03\xc1\x03\x13\x00\x00\x1f\xe4" + // 0x03C10313: 0x00001FE4 - "\x03\xc1\x03\x14\x00\x00\x1f\xe5" + // 0x03C10314: 0x00001FE5 - "\x03\xc5\x03B\x00\x00\x1f\xe6" + // 0x03C50342: 0x00001FE6 - "\x03\xcb\x03B\x00\x00\x1f\xe7" + // 0x03CB0342: 0x00001FE7 - "\x03\xa5\x03\x06\x00\x00\x1f\xe8" + // 0x03A50306: 0x00001FE8 - "\x03\xa5\x03\x04\x00\x00\x1f\xe9" + // 0x03A50304: 0x00001FE9 - "\x03\xa5\x03\x00\x00\x00\x1f\xea" + // 0x03A50300: 0x00001FEA - "\x03\xa1\x03\x14\x00\x00\x1f\xec" + // 0x03A10314: 0x00001FEC - "\x00\xa8\x03\x00\x00\x00\x1f\xed" + // 0x00A80300: 0x00001FED - "\x1f|\x03E\x00\x00\x1f\xf2" + // 0x1F7C0345: 0x00001FF2 - "\x03\xc9\x03E\x00\x00\x1f\xf3" + // 0x03C90345: 0x00001FF3 - "\x03\xce\x03E\x00\x00\x1f\xf4" + // 0x03CE0345: 0x00001FF4 - "\x03\xc9\x03B\x00\x00\x1f\xf6" + // 0x03C90342: 0x00001FF6 - "\x1f\xf6\x03E\x00\x00\x1f\xf7" + // 0x1FF60345: 0x00001FF7 - "\x03\x9f\x03\x00\x00\x00\x1f\xf8" + // 0x039F0300: 0x00001FF8 - "\x03\xa9\x03\x00\x00\x00\x1f\xfa" + // 0x03A90300: 0x00001FFA - "\x03\xa9\x03E\x00\x00\x1f\xfc" + // 0x03A90345: 0x00001FFC - "!\x90\x038\x00\x00!\x9a" + // 0x21900338: 0x0000219A - "!\x92\x038\x00\x00!\x9b" + // 0x21920338: 0x0000219B - "!\x94\x038\x00\x00!\xae" + // 0x21940338: 0x000021AE - "!\xd0\x038\x00\x00!\xcd" + // 0x21D00338: 0x000021CD - "!\xd4\x038\x00\x00!\xce" + // 0x21D40338: 0x000021CE - "!\xd2\x038\x00\x00!\xcf" + // 0x21D20338: 0x000021CF - "\"\x03\x038\x00\x00\"\x04" + // 0x22030338: 0x00002204 - "\"\b\x038\x00\x00\"\t" + // 0x22080338: 0x00002209 - "\"\v\x038\x00\x00\"\f" + // 0x220B0338: 0x0000220C - "\"#\x038\x00\x00\"$" + // 0x22230338: 0x00002224 - "\"%\x038\x00\x00\"&" + // 0x22250338: 0x00002226 - "\"<\x038\x00\x00\"A" + // 0x223C0338: 0x00002241 - "\"C\x038\x00\x00\"D" + // 0x22430338: 0x00002244 - "\"E\x038\x00\x00\"G" + // 0x22450338: 0x00002247 - "\"H\x038\x00\x00\"I" + // 0x22480338: 0x00002249 - "\x00=\x038\x00\x00\"`" + // 0x003D0338: 0x00002260 - "\"a\x038\x00\x00\"b" + // 0x22610338: 0x00002262 - "\"M\x038\x00\x00\"m" + // 0x224D0338: 0x0000226D - "\x00<\x038\x00\x00\"n" + // 0x003C0338: 0x0000226E - "\x00>\x038\x00\x00\"o" + // 0x003E0338: 0x0000226F - "\"d\x038\x00\x00\"p" + // 0x22640338: 0x00002270 - "\"e\x038\x00\x00\"q" + // 0x22650338: 0x00002271 - "\"r\x038\x00\x00\"t" + // 0x22720338: 0x00002274 - "\"s\x038\x00\x00\"u" + // 0x22730338: 0x00002275 - "\"v\x038\x00\x00\"x" + // 0x22760338: 0x00002278 - "\"w\x038\x00\x00\"y" + // 0x22770338: 0x00002279 - "\"z\x038\x00\x00\"\x80" + // 0x227A0338: 0x00002280 - "\"{\x038\x00\x00\"\x81" + // 0x227B0338: 0x00002281 - "\"\x82\x038\x00\x00\"\x84" + // 0x22820338: 0x00002284 - "\"\x83\x038\x00\x00\"\x85" + // 0x22830338: 0x00002285 - "\"\x86\x038\x00\x00\"\x88" + // 0x22860338: 0x00002288 - "\"\x87\x038\x00\x00\"\x89" + // 0x22870338: 0x00002289 - "\"\xa2\x038\x00\x00\"\xac" + // 0x22A20338: 0x000022AC - "\"\xa8\x038\x00\x00\"\xad" + // 0x22A80338: 0x000022AD - "\"\xa9\x038\x00\x00\"\xae" + // 0x22A90338: 0x000022AE - "\"\xab\x038\x00\x00\"\xaf" + // 0x22AB0338: 0x000022AF - "\"|\x038\x00\x00\"\xe0" + // 0x227C0338: 0x000022E0 - "\"}\x038\x00\x00\"\xe1" + // 0x227D0338: 0x000022E1 - "\"\x91\x038\x00\x00\"\xe2" + // 0x22910338: 0x000022E2 - "\"\x92\x038\x00\x00\"\xe3" + // 0x22920338: 0x000022E3 - "\"\xb2\x038\x00\x00\"\xea" + // 0x22B20338: 0x000022EA - "\"\xb3\x038\x00\x00\"\xeb" + // 0x22B30338: 0x000022EB - "\"\xb4\x038\x00\x00\"\xec" + // 0x22B40338: 0x000022EC - "\"\xb5\x038\x00\x00\"\xed" + // 0x22B50338: 0x000022ED - "0K0\x99\x00\x000L" + // 0x304B3099: 0x0000304C - "0M0\x99\x00\x000N" + // 0x304D3099: 0x0000304E - "0O0\x99\x00\x000P" + // 0x304F3099: 0x00003050 - "0Q0\x99\x00\x000R" + // 0x30513099: 0x00003052 - "0S0\x99\x00\x000T" + // 0x30533099: 0x00003054 - "0U0\x99\x00\x000V" + // 0x30553099: 0x00003056 - "0W0\x99\x00\x000X" + // 0x30573099: 0x00003058 - "0Y0\x99\x00\x000Z" + // 0x30593099: 0x0000305A - "0[0\x99\x00\x000\\" + // 0x305B3099: 0x0000305C - "0]0\x99\x00\x000^" + // 0x305D3099: 0x0000305E - "0_0\x99\x00\x000`" + // 0x305F3099: 0x00003060 - "0a0\x99\x00\x000b" + // 0x30613099: 0x00003062 - "0d0\x99\x00\x000e" + // 0x30643099: 0x00003065 - "0f0\x99\x00\x000g" + // 0x30663099: 0x00003067 - "0h0\x99\x00\x000i" + // 0x30683099: 0x00003069 - "0o0\x99\x00\x000p" + // 0x306F3099: 0x00003070 - "0o0\x9a\x00\x000q" + // 0x306F309A: 0x00003071 - "0r0\x99\x00\x000s" + // 0x30723099: 0x00003073 - "0r0\x9a\x00\x000t" + // 0x3072309A: 0x00003074 - "0u0\x99\x00\x000v" + // 0x30753099: 0x00003076 - "0u0\x9a\x00\x000w" + // 0x3075309A: 0x00003077 - "0x0\x99\x00\x000y" + // 0x30783099: 0x00003079 - "0x0\x9a\x00\x000z" + // 0x3078309A: 0x0000307A - "0{0\x99\x00\x000|" + // 0x307B3099: 0x0000307C - "0{0\x9a\x00\x000}" + // 0x307B309A: 0x0000307D - "0F0\x99\x00\x000\x94" + // 0x30463099: 0x00003094 - "0\x9d0\x99\x00\x000\x9e" + // 0x309D3099: 0x0000309E - "0\xab0\x99\x00\x000\xac" + // 0x30AB3099: 0x000030AC - "0\xad0\x99\x00\x000\xae" + // 0x30AD3099: 0x000030AE - "0\xaf0\x99\x00\x000\xb0" + // 0x30AF3099: 0x000030B0 - "0\xb10\x99\x00\x000\xb2" + // 0x30B13099: 0x000030B2 - "0\xb30\x99\x00\x000\xb4" + // 0x30B33099: 0x000030B4 - "0\xb50\x99\x00\x000\xb6" + // 0x30B53099: 0x000030B6 - "0\xb70\x99\x00\x000\xb8" + // 0x30B73099: 0x000030B8 - "0\xb90\x99\x00\x000\xba" + // 0x30B93099: 0x000030BA - "0\xbb0\x99\x00\x000\xbc" + // 0x30BB3099: 0x000030BC - "0\xbd0\x99\x00\x000\xbe" + // 0x30BD3099: 0x000030BE - "0\xbf0\x99\x00\x000\xc0" + // 0x30BF3099: 0x000030C0 - "0\xc10\x99\x00\x000\xc2" + // 0x30C13099: 0x000030C2 - "0\xc40\x99\x00\x000\xc5" + // 0x30C43099: 0x000030C5 - "0\xc60\x99\x00\x000\xc7" + // 0x30C63099: 0x000030C7 - "0\xc80\x99\x00\x000\xc9" + // 0x30C83099: 0x000030C9 - "0\xcf0\x99\x00\x000\xd0" + // 0x30CF3099: 0x000030D0 - "0\xcf0\x9a\x00\x000\xd1" + // 0x30CF309A: 0x000030D1 - "0\xd20\x99\x00\x000\xd3" + // 0x30D23099: 0x000030D3 - "0\xd20\x9a\x00\x000\xd4" + // 0x30D2309A: 0x000030D4 - "0\xd50\x99\x00\x000\xd6" + // 0x30D53099: 0x000030D6 - "0\xd50\x9a\x00\x000\xd7" + // 0x30D5309A: 0x000030D7 - "0\xd80\x99\x00\x000\xd9" + // 0x30D83099: 0x000030D9 - "0\xd80\x9a\x00\x000\xda" + // 0x30D8309A: 0x000030DA - "0\xdb0\x99\x00\x000\xdc" + // 0x30DB3099: 0x000030DC - "0\xdb0\x9a\x00\x000\xdd" + // 0x30DB309A: 0x000030DD - "0\xa60\x99\x00\x000\xf4" + // 0x30A63099: 0x000030F4 - "0\xef0\x99\x00\x000\xf7" + // 0x30EF3099: 0x000030F7 - "0\xf00\x99\x00\x000\xf8" + // 0x30F03099: 0x000030F8 - "0\xf10\x99\x00\x000\xf9" + // 0x30F13099: 0x000030F9 - "0\xf20\x99\x00\x000\xfa" + // 0x30F23099: 0x000030FA - "0\xfd0\x99\x00\x000\xfe" + // 0x30FD3099: 0x000030FE - "\x05\xd2\x03\a\x00\x01\x05\xc9" + // 0x05D20307: 0x000105C9 - "\x05\xda\x03\a\x00\x01\x05\xe4" + // 0x05DA0307: 0x000105E4 - "\x10\x99\x10\xba\x00\x01\x10\x9a" + // 0x109910BA: 0x0001109A - "\x10\x9b\x10\xba\x00\x01\x10\x9c" + // 0x109B10BA: 0x0001109C - "\x10\xa5\x10\xba\x00\x01\x10\xab" + // 0x10A510BA: 0x000110AB - "\x111\x11'\x00\x01\x11." + // 0x11311127: 0x0001112E - "\x112\x11'\x00\x01\x11/" + // 0x11321127: 0x0001112F - "\x13G\x13>\x00\x01\x13K" + // 0x1347133E: 0x0001134B - "\x13G\x13W\x00\x01\x13L" + // 0x13471357: 0x0001134C - "\x13\x82\x13\xc9\x00\x01\x13\x83" + // 0x138213C9: 0x00011383 - "\x13\x84\x13\xbb\x00\x01\x13\x85" + // 0x138413BB: 0x00011385 - "\x13\x8b\x13\xc2\x00\x01\x13\x8e" + // 0x138B13C2: 0x0001138E - "\x13\x90\x13\xc9\x00\x01\x13\x91" + // 0x139013C9: 0x00011391 - "\x13\xc2\x13\xc2\x00\x01\x13\xc5" + // 0x13C213C2: 0x000113C5 - "\x13\xc2\x13\xb8\x00\x01\x13\xc7" + // 0x13C213B8: 0x000113C7 - "\x13\xc2\x13\xc9\x00\x01\x13\xc8" + // 0x13C213C9: 0x000113C8 - "\x14\xb9\x14\xba\x00\x01\x14\xbb" + // 0x14B914BA: 0x000114BB - "\x14\xb9\x14\xb0\x00\x01\x14\xbc" + // 0x14B914B0: 0x000114BC - "\x14\xb9\x14\xbd\x00\x01\x14\xbe" + // 0x14B914BD: 0x000114BE - "\x15\xb8\x15\xaf\x00\x01\x15\xba" + // 0x15B815AF: 0x000115BA - "\x15\xb9\x15\xaf\x00\x01\x15\xbb" + // 0x15B915AF: 0x000115BB - "\x195\x190\x00\x01\x198" + // 0x19351930: 0x00011938 - "a\x1ea\x1e\x00\x01a!" + // 0x611E611E: 0x00016121 - "a\x1ea)\x00\x01a\"" + // 0x611E6129: 0x00016122 - "a\x1ea\x1f\x00\x01a#" + // 0x611E611F: 0x00016123 - "a)a\x1f\x00\x01a$" + // 0x6129611F: 0x00016124 - "a\x1ea \x00\x01a%" + // 0x611E6120: 0x00016125 - "a!a\x1f\x00\x01a&" + // 0x6121611F: 0x00016126 - "a\"a\x1f\x00\x01a'" + // 0x6122611F: 0x00016127 - "a!a \x00\x01a(" + // 0x61216120: 0x00016128 - "mgmg\x00\x01mh" + // 0x6D676D67: 0x00016D68 - "mcmg\x00\x01mi" + // 0x6D636D67: 0x00016D69 - "mimg\x00\x01mj" + // 0x6D696D67: 0x00016D6A + "\x00\x01\x04\x00`\x00\x00\xc0" + // 0x00041 0x00300: 0x000C0 + "\x00\x01\x04\x00` \x00\xc1" + // 0x00041 0x00301: 0x000C1 + "\x00\x01\x04\x00`@\x00\xc2" + // 0x00041 0x00302: 0x000C2 + "\x00\x01\x04\x00``\x00\xc3" + // 0x00041 0x00303: 0x000C3 + "\x00\x01\x04\x00a\x00\x00\xc4" + // 0x00041 0x00308: 0x000C4 + "\x00\x01\x04\x00a@\x00\xc5" + // 0x00041 0x0030A: 0x000C5 + "\x00\x01\f\x00d\xe0\x00\xc7" + // 0x00043 0x00327: 0x000C7 + "\x00\x01\x14\x00`\x00\x00\xc8" + // 0x00045 0x00300: 0x000C8 + "\x00\x01\x14\x00` \x00\xc9" + // 0x00045 0x00301: 0x000C9 + "\x00\x01\x14\x00`@\x00\xca" + // 0x00045 0x00302: 0x000CA + "\x00\x01\x14\x00a\x00\x00\xcb" + // 0x00045 0x00308: 0x000CB + "\x00\x01$\x00`\x00\x00\xcc" + // 0x00049 0x00300: 0x000CC + "\x00\x01$\x00` \x00\xcd" + // 0x00049 0x00301: 0x000CD + "\x00\x01$\x00`@\x00\xce" + // 0x00049 0x00302: 0x000CE + "\x00\x01$\x00a\x00\x00\xcf" + // 0x00049 0x00308: 0x000CF + "\x00\x018\x00``\x00\xd1" + // 0x0004E 0x00303: 0x000D1 + "\x00\x01<\x00`\x00\x00\xd2" + // 0x0004F 0x00300: 0x000D2 + "\x00\x01<\x00` \x00\xd3" + // 0x0004F 0x00301: 0x000D3 + "\x00\x01<\x00`@\x00\xd4" + // 0x0004F 0x00302: 0x000D4 + "\x00\x01<\x00``\x00\xd5" + // 0x0004F 0x00303: 0x000D5 + "\x00\x01<\x00a\x00\x00\xd6" + // 0x0004F 0x00308: 0x000D6 + "\x00\x01T\x00`\x00\x00\xd9" + // 0x00055 0x00300: 0x000D9 + "\x00\x01T\x00` \x00\xda" + // 0x00055 0x00301: 0x000DA + "\x00\x01T\x00`@\x00\xdb" + // 0x00055 0x00302: 0x000DB + "\x00\x01T\x00a\x00\x00\xdc" + // 0x00055 0x00308: 0x000DC + "\x00\x01d\x00` \x00\xdd" + // 0x00059 0x00301: 0x000DD + "\x00\x01\x84\x00`\x00\x00\xe0" + // 0x00061 0x00300: 0x000E0 + "\x00\x01\x84\x00` \x00\xe1" + // 0x00061 0x00301: 0x000E1 + "\x00\x01\x84\x00`@\x00\xe2" + // 0x00061 0x00302: 0x000E2 + "\x00\x01\x84\x00``\x00\xe3" + // 0x00061 0x00303: 0x000E3 + "\x00\x01\x84\x00a\x00\x00\xe4" + // 0x00061 0x00308: 0x000E4 + "\x00\x01\x84\x00a@\x00\xe5" + // 0x00061 0x0030A: 0x000E5 + "\x00\x01\x8c\x00d\xe0\x00\xe7" + // 0x00063 0x00327: 0x000E7 + "\x00\x01\x94\x00`\x00\x00\xe8" + // 0x00065 0x00300: 0x000E8 + "\x00\x01\x94\x00` \x00\xe9" + // 0x00065 0x00301: 0x000E9 + "\x00\x01\x94\x00`@\x00\xea" + // 0x00065 0x00302: 0x000EA + "\x00\x01\x94\x00a\x00\x00\xeb" + // 0x00065 0x00308: 0x000EB + "\x00\x01\xa4\x00`\x00\x00\xec" + // 0x00069 0x00300: 0x000EC + "\x00\x01\xa4\x00` \x00\xed" + // 0x00069 0x00301: 0x000ED + "\x00\x01\xa4\x00`@\x00\xee" + // 0x00069 0x00302: 0x000EE + "\x00\x01\xa4\x00a\x00\x00\xef" + // 0x00069 0x00308: 0x000EF + "\x00\x01\xb8\x00``\x00\xf1" + // 0x0006E 0x00303: 0x000F1 + "\x00\x01\xbc\x00`\x00\x00\xf2" + // 0x0006F 0x00300: 0x000F2 + "\x00\x01\xbc\x00` \x00\xf3" + // 0x0006F 0x00301: 0x000F3 + "\x00\x01\xbc\x00`@\x00\xf4" + // 0x0006F 0x00302: 0x000F4 + "\x00\x01\xbc\x00``\x00\xf5" + // 0x0006F 0x00303: 0x000F5 + "\x00\x01\xbc\x00a\x00\x00\xf6" + // 0x0006F 0x00308: 0x000F6 + "\x00\x01\xd4\x00`\x00\x00\xf9" + // 0x00075 0x00300: 0x000F9 + "\x00\x01\xd4\x00` \x00\xfa" + // 0x00075 0x00301: 0x000FA + "\x00\x01\xd4\x00`@\x00\xfb" + // 0x00075 0x00302: 0x000FB + "\x00\x01\xd4\x00a\x00\x00\xfc" + // 0x00075 0x00308: 0x000FC + "\x00\x01\xe4\x00` \x00\xfd" + // 0x00079 0x00301: 0x000FD + "\x00\x01\xe4\x00a\x00\x00\xff" + // 0x00079 0x00308: 0x000FF + "\x00\x01\x04\x00`\x80\x01\x00" + // 0x00041 0x00304: 0x00100 + "\x00\x01\x84\x00`\x80\x01\x01" + // 0x00061 0x00304: 0x00101 + "\x00\x01\x04\x00`\xc0\x01\x02" + // 0x00041 0x00306: 0x00102 + "\x00\x01\x84\x00`\xc0\x01\x03" + // 0x00061 0x00306: 0x00103 + "\x00\x01\x04\x00e\x00\x01\x04" + // 0x00041 0x00328: 0x00104 + "\x00\x01\x84\x00e\x00\x01\x05" + // 0x00061 0x00328: 0x00105 + "\x00\x01\f\x00` \x01\x06" + // 0x00043 0x00301: 0x00106 + "\x00\x01\x8c\x00` \x01\a" + // 0x00063 0x00301: 0x00107 + "\x00\x01\f\x00`@\x01\b" + // 0x00043 0x00302: 0x00108 + "\x00\x01\x8c\x00`@\x01\t" + // 0x00063 0x00302: 0x00109 + "\x00\x01\f\x00`\xe0\x01\n" + // 0x00043 0x00307: 0x0010A + "\x00\x01\x8c\x00`\xe0\x01\v" + // 0x00063 0x00307: 0x0010B + "\x00\x01\f\x00a\x80\x01\f" + // 0x00043 0x0030C: 0x0010C + "\x00\x01\x8c\x00a\x80\x01\r" + // 0x00063 0x0030C: 0x0010D + "\x00\x01\x10\x00a\x80\x01\x0e" + // 0x00044 0x0030C: 0x0010E + "\x00\x01\x90\x00a\x80\x01\x0f" + // 0x00064 0x0030C: 0x0010F + "\x00\x01\x14\x00`\x80\x01\x12" + // 0x00045 0x00304: 0x00112 + "\x00\x01\x94\x00`\x80\x01\x13" + // 0x00065 0x00304: 0x00113 + "\x00\x01\x14\x00`\xc0\x01\x14" + // 0x00045 0x00306: 0x00114 + "\x00\x01\x94\x00`\xc0\x01\x15" + // 0x00065 0x00306: 0x00115 + "\x00\x01\x14\x00`\xe0\x01\x16" + // 0x00045 0x00307: 0x00116 + "\x00\x01\x94\x00`\xe0\x01\x17" + // 0x00065 0x00307: 0x00117 + "\x00\x01\x14\x00e\x00\x01\x18" + // 0x00045 0x00328: 0x00118 + "\x00\x01\x94\x00e\x00\x01\x19" + // 0x00065 0x00328: 0x00119 + "\x00\x01\x14\x00a\x80\x01\x1a" + // 0x00045 0x0030C: 0x0011A + "\x00\x01\x94\x00a\x80\x01\x1b" + // 0x00065 0x0030C: 0x0011B + "\x00\x01\x1c\x00`@\x01\x1c" + // 0x00047 0x00302: 0x0011C + "\x00\x01\x9c\x00`@\x01\x1d" + // 0x00067 0x00302: 0x0011D + "\x00\x01\x1c\x00`\xc0\x01\x1e" + // 0x00047 0x00306: 0x0011E + "\x00\x01\x9c\x00`\xc0\x01\x1f" + // 0x00067 0x00306: 0x0011F + "\x00\x01\x1c\x00`\xe0\x01 " + // 0x00047 0x00307: 0x00120 + "\x00\x01\x9c\x00`\xe0\x01!" + // 0x00067 0x00307: 0x00121 + "\x00\x01\x1c\x00d\xe0\x01\"" + // 0x00047 0x00327: 0x00122 + "\x00\x01\x9c\x00d\xe0\x01#" + // 0x00067 0x00327: 0x00123 + "\x00\x01 \x00`@\x01$" + // 0x00048 0x00302: 0x00124 + "\x00\x01\xa0\x00`@\x01%" + // 0x00068 0x00302: 0x00125 + "\x00\x01$\x00``\x01(" + // 0x00049 0x00303: 0x00128 + "\x00\x01\xa4\x00``\x01)" + // 0x00069 0x00303: 0x00129 + "\x00\x01$\x00`\x80\x01*" + // 0x00049 0x00304: 0x0012A + "\x00\x01\xa4\x00`\x80\x01+" + // 0x00069 0x00304: 0x0012B + "\x00\x01$\x00`\xc0\x01," + // 0x00049 0x00306: 0x0012C + "\x00\x01\xa4\x00`\xc0\x01-" + // 0x00069 0x00306: 0x0012D + "\x00\x01$\x00e\x00\x01." + // 0x00049 0x00328: 0x0012E + "\x00\x01\xa4\x00e\x00\x01/" + // 0x00069 0x00328: 0x0012F + "\x00\x01$\x00`\xe0\x010" + // 0x00049 0x00307: 0x00130 + "\x00\x01(\x00`@\x014" + // 0x0004A 0x00302: 0x00134 + "\x00\x01\xa8\x00`@\x015" + // 0x0006A 0x00302: 0x00135 + "\x00\x01,\x00d\xe0\x016" + // 0x0004B 0x00327: 0x00136 + "\x00\x01\xac\x00d\xe0\x017" + // 0x0006B 0x00327: 0x00137 + "\x00\x010\x00` \x019" + // 0x0004C 0x00301: 0x00139 + "\x00\x01\xb0\x00` \x01:" + // 0x0006C 0x00301: 0x0013A + "\x00\x010\x00d\xe0\x01;" + // 0x0004C 0x00327: 0x0013B + "\x00\x01\xb0\x00d\xe0\x01<" + // 0x0006C 0x00327: 0x0013C + "\x00\x010\x00a\x80\x01=" + // 0x0004C 0x0030C: 0x0013D + "\x00\x01\xb0\x00a\x80\x01>" + // 0x0006C 0x0030C: 0x0013E + "\x00\x018\x00` \x01C" + // 0x0004E 0x00301: 0x00143 + "\x00\x01\xb8\x00` \x01D" + // 0x0006E 0x00301: 0x00144 + "\x00\x018\x00d\xe0\x01E" + // 0x0004E 0x00327: 0x00145 + "\x00\x01\xb8\x00d\xe0\x01F" + // 0x0006E 0x00327: 0x00146 + "\x00\x018\x00a\x80\x01G" + // 0x0004E 0x0030C: 0x00147 + "\x00\x01\xb8\x00a\x80\x01H" + // 0x0006E 0x0030C: 0x00148 + "\x00\x01<\x00`\x80\x01L" + // 0x0004F 0x00304: 0x0014C + "\x00\x01\xbc\x00`\x80\x01M" + // 0x0006F 0x00304: 0x0014D + "\x00\x01<\x00`\xc0\x01N" + // 0x0004F 0x00306: 0x0014E + "\x00\x01\xbc\x00`\xc0\x01O" + // 0x0006F 0x00306: 0x0014F + "\x00\x01<\x00a`\x01P" + // 0x0004F 0x0030B: 0x00150 + "\x00\x01\xbc\x00a`\x01Q" + // 0x0006F 0x0030B: 0x00151 + "\x00\x01H\x00` \x01T" + // 0x00052 0x00301: 0x00154 + "\x00\x01\xc8\x00` \x01U" + // 0x00072 0x00301: 0x00155 + "\x00\x01H\x00d\xe0\x01V" + // 0x00052 0x00327: 0x00156 + "\x00\x01\xc8\x00d\xe0\x01W" + // 0x00072 0x00327: 0x00157 + "\x00\x01H\x00a\x80\x01X" + // 0x00052 0x0030C: 0x00158 + "\x00\x01\xc8\x00a\x80\x01Y" + // 0x00072 0x0030C: 0x00159 + "\x00\x01L\x00` \x01Z" + // 0x00053 0x00301: 0x0015A + "\x00\x01\xcc\x00` \x01[" + // 0x00073 0x00301: 0x0015B + "\x00\x01L\x00`@\x01\\" + // 0x00053 0x00302: 0x0015C + "\x00\x01\xcc\x00`@\x01]" + // 0x00073 0x00302: 0x0015D + "\x00\x01L\x00d\xe0\x01^" + // 0x00053 0x00327: 0x0015E + "\x00\x01\xcc\x00d\xe0\x01_" + // 0x00073 0x00327: 0x0015F + "\x00\x01L\x00a\x80\x01`" + // 0x00053 0x0030C: 0x00160 + "\x00\x01\xcc\x00a\x80\x01a" + // 0x00073 0x0030C: 0x00161 + "\x00\x01P\x00d\xe0\x01b" + // 0x00054 0x00327: 0x00162 + "\x00\x01\xd0\x00d\xe0\x01c" + // 0x00074 0x00327: 0x00163 + "\x00\x01P\x00a\x80\x01d" + // 0x00054 0x0030C: 0x00164 + "\x00\x01\xd0\x00a\x80\x01e" + // 0x00074 0x0030C: 0x00165 + "\x00\x01T\x00``\x01h" + // 0x00055 0x00303: 0x00168 + "\x00\x01\xd4\x00``\x01i" + // 0x00075 0x00303: 0x00169 + "\x00\x01T\x00`\x80\x01j" + // 0x00055 0x00304: 0x0016A + "\x00\x01\xd4\x00`\x80\x01k" + // 0x00075 0x00304: 0x0016B + "\x00\x01T\x00`\xc0\x01l" + // 0x00055 0x00306: 0x0016C + "\x00\x01\xd4\x00`\xc0\x01m" + // 0x00075 0x00306: 0x0016D + "\x00\x01T\x00a@\x01n" + // 0x00055 0x0030A: 0x0016E + "\x00\x01\xd4\x00a@\x01o" + // 0x00075 0x0030A: 0x0016F + "\x00\x01T\x00a`\x01p" + // 0x00055 0x0030B: 0x00170 + "\x00\x01\xd4\x00a`\x01q" + // 0x00075 0x0030B: 0x00171 + "\x00\x01T\x00e\x00\x01r" + // 0x00055 0x00328: 0x00172 + "\x00\x01\xd4\x00e\x00\x01s" + // 0x00075 0x00328: 0x00173 + "\x00\x01\\\x00`@\x01t" + // 0x00057 0x00302: 0x00174 + "\x00\x01\xdc\x00`@\x01u" + // 0x00077 0x00302: 0x00175 + "\x00\x01d\x00`@\x01v" + // 0x00059 0x00302: 0x00176 + "\x00\x01\xe4\x00`@\x01w" + // 0x00079 0x00302: 0x00177 + "\x00\x01d\x00a\x00\x01x" + // 0x00059 0x00308: 0x00178 + "\x00\x01h\x00` \x01y" + // 0x0005A 0x00301: 0x00179 + "\x00\x01\xe8\x00` \x01z" + // 0x0007A 0x00301: 0x0017A + "\x00\x01h\x00`\xe0\x01{" + // 0x0005A 0x00307: 0x0017B + "\x00\x01\xe8\x00`\xe0\x01|" + // 0x0007A 0x00307: 0x0017C + "\x00\x01h\x00a\x80\x01}" + // 0x0005A 0x0030C: 0x0017D + "\x00\x01\xe8\x00a\x80\x01~" + // 0x0007A 0x0030C: 0x0017E + "\x00\x01<\x00c`\x01\xa0" + // 0x0004F 0x0031B: 0x001A0 + "\x00\x01\xbc\x00c`\x01\xa1" + // 0x0006F 0x0031B: 0x001A1 + "\x00\x01T\x00c`\x01\xaf" + // 0x00055 0x0031B: 0x001AF + "\x00\x01\xd4\x00c`\x01\xb0" + // 0x00075 0x0031B: 0x001B0 + "\x00\x01\x04\x00a\x80\x01\xcd" + // 0x00041 0x0030C: 0x001CD + "\x00\x01\x84\x00a\x80\x01\xce" + // 0x00061 0x0030C: 0x001CE + "\x00\x01$\x00a\x80\x01\xcf" + // 0x00049 0x0030C: 0x001CF + "\x00\x01\xa4\x00a\x80\x01\xd0" + // 0x00069 0x0030C: 0x001D0 + "\x00\x01<\x00a\x80\x01\xd1" + // 0x0004F 0x0030C: 0x001D1 + "\x00\x01\xbc\x00a\x80\x01\xd2" + // 0x0006F 0x0030C: 0x001D2 + "\x00\x01T\x00a\x80\x01\xd3" + // 0x00055 0x0030C: 0x001D3 + "\x00\x01\xd4\x00a\x80\x01\xd4" + // 0x00075 0x0030C: 0x001D4 + "\x00\x03p\x00`\x80\x01\xd5" + // 0x000DC 0x00304: 0x001D5 + "\x00\x03\xf0\x00`\x80\x01\xd6" + // 0x000FC 0x00304: 0x001D6 + "\x00\x03p\x00` \x01\xd7" + // 0x000DC 0x00301: 0x001D7 + "\x00\x03\xf0\x00` \x01\xd8" + // 0x000FC 0x00301: 0x001D8 + "\x00\x03p\x00a\x80\x01\xd9" + // 0x000DC 0x0030C: 0x001D9 + "\x00\x03\xf0\x00a\x80\x01\xda" + // 0x000FC 0x0030C: 0x001DA + "\x00\x03p\x00`\x00\x01\xdb" + // 0x000DC 0x00300: 0x001DB + "\x00\x03\xf0\x00`\x00\x01\xdc" + // 0x000FC 0x00300: 0x001DC + "\x00\x03\x10\x00`\x80\x01\xde" + // 0x000C4 0x00304: 0x001DE + "\x00\x03\x90\x00`\x80\x01\xdf" + // 0x000E4 0x00304: 0x001DF + "\x00\b\x98\x00`\x80\x01\xe0" + // 0x00226 0x00304: 0x001E0 + "\x00\b\x9c\x00`\x80\x01\xe1" + // 0x00227 0x00304: 0x001E1 + "\x00\x03\x18\x00`\x80\x01\xe2" + // 0x000C6 0x00304: 0x001E2 + "\x00\x03\x98\x00`\x80\x01\xe3" + // 0x000E6 0x00304: 0x001E3 + "\x00\x01\x1c\x00a\x80\x01\xe6" + // 0x00047 0x0030C: 0x001E6 + "\x00\x01\x9c\x00a\x80\x01\xe7" + // 0x00067 0x0030C: 0x001E7 + "\x00\x01,\x00a\x80\x01\xe8" + // 0x0004B 0x0030C: 0x001E8 + "\x00\x01\xac\x00a\x80\x01\xe9" + // 0x0006B 0x0030C: 0x001E9 + "\x00\x01<\x00e\x00\x01\xea" + // 0x0004F 0x00328: 0x001EA + "\x00\x01\xbc\x00e\x00\x01\xeb" + // 0x0006F 0x00328: 0x001EB + "\x00\a\xa8\x00`\x80\x01\xec" + // 0x001EA 0x00304: 0x001EC + "\x00\a\xac\x00`\x80\x01\xed" + // 0x001EB 0x00304: 0x001ED + "\x00\x06\xdc\x00a\x80\x01\xee" + // 0x001B7 0x0030C: 0x001EE + "\x00\nH\x00a\x80\x01\xef" + // 0x00292 0x0030C: 0x001EF + "\x00\x01\xa8\x00a\x80\x01\xf0" + // 0x0006A 0x0030C: 0x001F0 + "\x00\x01\x1c\x00` \x01\xf4" + // 0x00047 0x00301: 0x001F4 + "\x00\x01\x9c\x00` \x01\xf5" + // 0x00067 0x00301: 0x001F5 + "\x00\x018\x00`\x00\x01\xf8" + // 0x0004E 0x00300: 0x001F8 + "\x00\x01\xb8\x00`\x00\x01\xf9" + // 0x0006E 0x00300: 0x001F9 + "\x00\x03\x14\x00` \x01\xfa" + // 0x000C5 0x00301: 0x001FA + "\x00\x03\x94\x00` \x01\xfb" + // 0x000E5 0x00301: 0x001FB + "\x00\x03\x18\x00` \x01\xfc" + // 0x000C6 0x00301: 0x001FC + "\x00\x03\x98\x00` \x01\xfd" + // 0x000E6 0x00301: 0x001FD + "\x00\x03`\x00` \x01\xfe" + // 0x000D8 0x00301: 0x001FE + "\x00\x03\xe0\x00` \x01\xff" + // 0x000F8 0x00301: 0x001FF + "\x00\x01\x04\x00a\xe0\x02\x00" + // 0x00041 0x0030F: 0x00200 + "\x00\x01\x84\x00a\xe0\x02\x01" + // 0x00061 0x0030F: 0x00201 + "\x00\x01\x04\x00b \x02\x02" + // 0x00041 0x00311: 0x00202 + "\x00\x01\x84\x00b \x02\x03" + // 0x00061 0x00311: 0x00203 + "\x00\x01\x14\x00a\xe0\x02\x04" + // 0x00045 0x0030F: 0x00204 + "\x00\x01\x94\x00a\xe0\x02\x05" + // 0x00065 0x0030F: 0x00205 + "\x00\x01\x14\x00b \x02\x06" + // 0x00045 0x00311: 0x00206 + "\x00\x01\x94\x00b \x02\a" + // 0x00065 0x00311: 0x00207 + "\x00\x01$\x00a\xe0\x02\b" + // 0x00049 0x0030F: 0x00208 + "\x00\x01\xa4\x00a\xe0\x02\t" + // 0x00069 0x0030F: 0x00209 + "\x00\x01$\x00b \x02\n" + // 0x00049 0x00311: 0x0020A + "\x00\x01\xa4\x00b \x02\v" + // 0x00069 0x00311: 0x0020B + "\x00\x01<\x00a\xe0\x02\f" + // 0x0004F 0x0030F: 0x0020C + "\x00\x01\xbc\x00a\xe0\x02\r" + // 0x0006F 0x0030F: 0x0020D + "\x00\x01<\x00b \x02\x0e" + // 0x0004F 0x00311: 0x0020E + "\x00\x01\xbc\x00b \x02\x0f" + // 0x0006F 0x00311: 0x0020F + "\x00\x01H\x00a\xe0\x02\x10" + // 0x00052 0x0030F: 0x00210 + "\x00\x01\xc8\x00a\xe0\x02\x11" + // 0x00072 0x0030F: 0x00211 + "\x00\x01H\x00b \x02\x12" + // 0x00052 0x00311: 0x00212 + "\x00\x01\xc8\x00b \x02\x13" + // 0x00072 0x00311: 0x00213 + "\x00\x01T\x00a\xe0\x02\x14" + // 0x00055 0x0030F: 0x00214 + "\x00\x01\xd4\x00a\xe0\x02\x15" + // 0x00075 0x0030F: 0x00215 + "\x00\x01T\x00b \x02\x16" + // 0x00055 0x00311: 0x00216 + "\x00\x01\xd4\x00b \x02\x17" + // 0x00075 0x00311: 0x00217 + "\x00\x01L\x00d\xc0\x02\x18" + // 0x00053 0x00326: 0x00218 + "\x00\x01\xcc\x00d\xc0\x02\x19" + // 0x00073 0x00326: 0x00219 + "\x00\x01P\x00d\xc0\x02\x1a" + // 0x00054 0x00326: 0x0021A + "\x00\x01\xd0\x00d\xc0\x02\x1b" + // 0x00074 0x00326: 0x0021B + "\x00\x01 \x00a\x80\x02\x1e" + // 0x00048 0x0030C: 0x0021E + "\x00\x01\xa0\x00a\x80\x02\x1f" + // 0x00068 0x0030C: 0x0021F + "\x00\x01\x04\x00`\xe0\x02&" + // 0x00041 0x00307: 0x00226 + "\x00\x01\x84\x00`\xe0\x02'" + // 0x00061 0x00307: 0x00227 + "\x00\x01\x14\x00d\xe0\x02(" + // 0x00045 0x00327: 0x00228 + "\x00\x01\x94\x00d\xe0\x02)" + // 0x00065 0x00327: 0x00229 + "\x00\x03X\x00`\x80\x02*" + // 0x000D6 0x00304: 0x0022A + "\x00\x03\xd8\x00`\x80\x02+" + // 0x000F6 0x00304: 0x0022B + "\x00\x03T\x00`\x80\x02," + // 0x000D5 0x00304: 0x0022C + "\x00\x03\xd4\x00`\x80\x02-" + // 0x000F5 0x00304: 0x0022D + "\x00\x01<\x00`\xe0\x02." + // 0x0004F 0x00307: 0x0022E + "\x00\x01\xbc\x00`\xe0\x02/" + // 0x0006F 0x00307: 0x0022F + "\x00\b\xb8\x00`\x80\x020" + // 0x0022E 0x00304: 0x00230 + "\x00\b\xbc\x00`\x80\x021" + // 0x0022F 0x00304: 0x00231 + "\x00\x01d\x00`\x80\x022" + // 0x00059 0x00304: 0x00232 + "\x00\x01\xe4\x00`\x80\x023" + // 0x00079 0x00304: 0x00233 + "\x00\x02\xa0\x00` \x03\x85" + // 0x000A8 0x00301: 0x00385 + "\x00\x0eD\x00` \x03\x86" + // 0x00391 0x00301: 0x00386 + "\x00\x0eT\x00` \x03\x88" + // 0x00395 0x00301: 0x00388 + "\x00\x0e\\\x00` \x03\x89" + // 0x00397 0x00301: 0x00389 + "\x00\x0ed\x00` \x03\x8a" + // 0x00399 0x00301: 0x0038A + "\x00\x0e|\x00` \x03\x8c" + // 0x0039F 0x00301: 0x0038C + "\x00\x0e\x94\x00` \x03\x8e" + // 0x003A5 0x00301: 0x0038E + "\x00\x0e\xa4\x00` \x03\x8f" + // 0x003A9 0x00301: 0x0038F + "\x00\x0f(\x00` \x03\x90" + // 0x003CA 0x00301: 0x00390 + "\x00\x0ed\x00a\x00\x03\xaa" + // 0x00399 0x00308: 0x003AA + "\x00\x0e\x94\x00a\x00\x03\xab" + // 0x003A5 0x00308: 0x003AB + "\x00\x0e\xc4\x00` \x03\xac" + // 0x003B1 0x00301: 0x003AC + "\x00\x0e\xd4\x00` \x03\xad" + // 0x003B5 0x00301: 0x003AD + "\x00\x0e\xdc\x00` \x03\xae" + // 0x003B7 0x00301: 0x003AE + "\x00\x0e\xe4\x00` \x03\xaf" + // 0x003B9 0x00301: 0x003AF + "\x00\x0f,\x00` \x03\xb0" + // 0x003CB 0x00301: 0x003B0 + "\x00\x0e\xe4\x00a\x00\x03\xca" + // 0x003B9 0x00308: 0x003CA + "\x00\x0f\x14\x00a\x00\x03\xcb" + // 0x003C5 0x00308: 0x003CB + "\x00\x0e\xfc\x00` \x03\xcc" + // 0x003BF 0x00301: 0x003CC + "\x00\x0f\x14\x00` \x03\xcd" + // 0x003C5 0x00301: 0x003CD + "\x00\x0f$\x00` \x03\xce" + // 0x003C9 0x00301: 0x003CE + "\x00\x0fH\x00` \x03\xd3" + // 0x003D2 0x00301: 0x003D3 + "\x00\x0fH\x00a\x00\x03\xd4" + // 0x003D2 0x00308: 0x003D4 + "\x00\x10T\x00`\x00\x04\x00" + // 0x00415 0x00300: 0x00400 + "\x00\x10T\x00a\x00\x04\x01" + // 0x00415 0x00308: 0x00401 + "\x00\x10L\x00` \x04\x03" + // 0x00413 0x00301: 0x00403 + "\x00\x10\x18\x00a\x00\x04\a" + // 0x00406 0x00308: 0x00407 + "\x00\x10h\x00` \x04\f" + // 0x0041A 0x00301: 0x0040C + "\x00\x10`\x00`\x00\x04\r" + // 0x00418 0x00300: 0x0040D + "\x00\x10\x8c\x00`\xc0\x04\x0e" + // 0x00423 0x00306: 0x0040E + "\x00\x10`\x00`\xc0\x04\x19" + // 0x00418 0x00306: 0x00419 + "\x00\x10\xe0\x00`\xc0\x049" + // 0x00438 0x00306: 0x00439 + "\x00\x10\xd4\x00`\x00\x04P" + // 0x00435 0x00300: 0x00450 + "\x00\x10\xd4\x00a\x00\x04Q" + // 0x00435 0x00308: 0x00451 + "\x00\x10\xcc\x00` \x04S" + // 0x00433 0x00301: 0x00453 + "\x00\x11X\x00a\x00\x04W" + // 0x00456 0x00308: 0x00457 + "\x00\x10\xe8\x00` \x04\\" + // 0x0043A 0x00301: 0x0045C + "\x00\x10\xe0\x00`\x00\x04]" + // 0x00438 0x00300: 0x0045D + "\x00\x11\f\x00`\xc0\x04^" + // 0x00443 0x00306: 0x0045E + "\x00\x11\xd0\x00a\xe0\x04v" + // 0x00474 0x0030F: 0x00476 + "\x00\x11\xd4\x00a\xe0\x04w" + // 0x00475 0x0030F: 0x00477 + "\x00\x10X\x00`\xc0\x04\xc1" + // 0x00416 0x00306: 0x004C1 + "\x00\x10\xd8\x00`\xc0\x04\xc2" + // 0x00436 0x00306: 0x004C2 + "\x00\x10@\x00`\xc0\x04\xd0" + // 0x00410 0x00306: 0x004D0 + "\x00\x10\xc0\x00`\xc0\x04\xd1" + // 0x00430 0x00306: 0x004D1 + "\x00\x10@\x00a\x00\x04\xd2" + // 0x00410 0x00308: 0x004D2 + "\x00\x10\xc0\x00a\x00\x04\xd3" + // 0x00430 0x00308: 0x004D3 + "\x00\x10T\x00`\xc0\x04\xd6" + // 0x00415 0x00306: 0x004D6 + "\x00\x10\xd4\x00`\xc0\x04\xd7" + // 0x00435 0x00306: 0x004D7 + "\x00\x13`\x00a\x00\x04\xda" + // 0x004D8 0x00308: 0x004DA + "\x00\x13d\x00a\x00\x04\xdb" + // 0x004D9 0x00308: 0x004DB + "\x00\x10X\x00a\x00\x04\xdc" + // 0x00416 0x00308: 0x004DC + "\x00\x10\xd8\x00a\x00\x04\xdd" + // 0x00436 0x00308: 0x004DD + "\x00\x10\\\x00a\x00\x04\xde" + // 0x00417 0x00308: 0x004DE + "\x00\x10\xdc\x00a\x00\x04\xdf" + // 0x00437 0x00308: 0x004DF + "\x00\x10`\x00`\x80\x04\xe2" + // 0x00418 0x00304: 0x004E2 + "\x00\x10\xe0\x00`\x80\x04\xe3" + // 0x00438 0x00304: 0x004E3 + "\x00\x10`\x00a\x00\x04\xe4" + // 0x00418 0x00308: 0x004E4 + "\x00\x10\xe0\x00a\x00\x04\xe5" + // 0x00438 0x00308: 0x004E5 + "\x00\x10x\x00a\x00\x04\xe6" + // 0x0041E 0x00308: 0x004E6 + "\x00\x10\xf8\x00a\x00\x04\xe7" + // 0x0043E 0x00308: 0x004E7 + "\x00\x13\xa0\x00a\x00\x04\xea" + // 0x004E8 0x00308: 0x004EA + "\x00\x13\xa4\x00a\x00\x04\xeb" + // 0x004E9 0x00308: 0x004EB + "\x00\x10\xb4\x00a\x00\x04\xec" + // 0x0042D 0x00308: 0x004EC + "\x00\x114\x00a\x00\x04\xed" + // 0x0044D 0x00308: 0x004ED + "\x00\x10\x8c\x00`\x80\x04\xee" + // 0x00423 0x00304: 0x004EE + "\x00\x11\f\x00`\x80\x04\xef" + // 0x00443 0x00304: 0x004EF + "\x00\x10\x8c\x00a\x00\x04\xf0" + // 0x00423 0x00308: 0x004F0 + "\x00\x11\f\x00a\x00\x04\xf1" + // 0x00443 0x00308: 0x004F1 + "\x00\x10\x8c\x00a`\x04\xf2" + // 0x00423 0x0030B: 0x004F2 + "\x00\x11\f\x00a`\x04\xf3" + // 0x00443 0x0030B: 0x004F3 + "\x00\x10\x9c\x00a\x00\x04\xf4" + // 0x00427 0x00308: 0x004F4 + "\x00\x11\x1c\x00a\x00\x04\xf5" + // 0x00447 0x00308: 0x004F5 + "\x00\x10\xac\x00a\x00\x04\xf8" + // 0x0042B 0x00308: 0x004F8 + "\x00\x11,\x00a\x00\x04\xf9" + // 0x0044B 0x00308: 0x004F9 + "\x00\x18\x9c\x00\xca`\x06\"" + // 0x00627 0x00653: 0x00622 + "\x00\x18\x9c\x00ʀ\x06#" + // 0x00627 0x00654: 0x00623 + "\x00\x19 \x00ʀ\x06$" + // 0x00648 0x00654: 0x00624 + "\x00\x18\x9c\x00ʠ\x06%" + // 0x00627 0x00655: 0x00625 + "\x00\x19(\x00ʀ\x06&" + // 0x0064A 0x00654: 0x00626 + "\x00\x1bT\x00ʀ\x06\xc0" + // 0x006D5 0x00654: 0x006C0 + "\x00\x1b\x04\x00ʀ\x06\xc2" + // 0x006C1 0x00654: 0x006C2 + "\x00\x1bH\x00ʀ\x06\xd3" + // 0x006D2 0x00654: 0x006D3 + "\x00$\xa0\x01'\x80\t)" + // 0x00928 0x0093C: 0x00929 + "\x00$\xc0\x01'\x80\t1" + // 0x00930 0x0093C: 0x00931 + "\x00$\xcc\x01'\x80\t4" + // 0x00933 0x0093C: 0x00934 + "\x00'\x1c\x017\xc0\t\xcb" + // 0x009C7 0x009BE: 0x009CB + "\x00'\x1c\x01:\xe0\t\xcc" + // 0x009C7 0x009D7: 0x009CC + "\x00-\x1c\x01j\xc0\vH" + // 0x00B47 0x00B56: 0x00B48 + "\x00-\x1c\x01g\xc0\vK" + // 0x00B47 0x00B3E: 0x00B4B + "\x00-\x1c\x01j\xe0\vL" + // 0x00B47 0x00B57: 0x00B4C + "\x00.H\x01z\xe0\v\x94" + // 0x00B92 0x00BD7: 0x00B94 + "\x00/\x18\x01w\xc0\v\xca" + // 0x00BC6 0x00BBE: 0x00BCA + "\x00/\x1c\x01w\xc0\v\xcb" + // 0x00BC7 0x00BBE: 0x00BCB + "\x00/\x18\x01z\xe0\v\xcc" + // 0x00BC6 0x00BD7: 0x00BCC + "\x001\x18\x01\x8a\xc0\fH" + // 0x00C46 0x00C56: 0x00C48 + "\x002\xfc\x01\x9a\xa0\f\xc0" + // 0x00CBF 0x00CD5: 0x00CC0 + "\x003\x18\x01\x9a\xa0\f\xc7" + // 0x00CC6 0x00CD5: 0x00CC7 + "\x003\x18\x01\x9a\xc0\f\xc8" + // 0x00CC6 0x00CD6: 0x00CC8 + "\x003\x18\x01\x98@\f\xca" + // 0x00CC6 0x00CC2: 0x00CCA + "\x003(\x01\x9a\xa0\f\xcb" + // 0x00CCA 0x00CD5: 0x00CCB + "\x005\x18\x01\xa7\xc0\rJ" + // 0x00D46 0x00D3E: 0x00D4A + "\x005\x1c\x01\xa7\xc0\rK" + // 0x00D47 0x00D3E: 0x00D4B + "\x005\x18\x01\xaa\xe0\rL" + // 0x00D46 0x00D57: 0x00D4C + "\x007d\x01\xb9@\r\xda" + // 0x00DD9 0x00DCA: 0x00DDA + "\x007d\x01\xb9\xe0\r\xdc" + // 0x00DD9 0x00DCF: 0x00DDC + "\x007p\x01\xb9@\r\xdd" + // 0x00DDC 0x00DCA: 0x00DDD + "\x007d\x01\xbb\xe0\r\xde" + // 0x00DD9 0x00DDF: 0x00DDE + "\x00@\x94\x02\x05\xc0\x10&" + // 0x01025 0x0102E: 0x01026 + "\x00l\x14\x03f\xa0\x1b\x06" + // 0x01B05 0x01B35: 0x01B06 + "\x00l\x1c\x03f\xa0\x1b\b" + // 0x01B07 0x01B35: 0x01B08 + "\x00l$\x03f\xa0\x1b\n" + // 0x01B09 0x01B35: 0x01B0A + "\x00l,\x03f\xa0\x1b\f" + // 0x01B0B 0x01B35: 0x01B0C + "\x00l4\x03f\xa0\x1b\x0e" + // 0x01B0D 0x01B35: 0x01B0E + "\x00lD\x03f\xa0\x1b\x12" + // 0x01B11 0x01B35: 0x01B12 + "\x00l\xe8\x03f\xa0\x1b;" + // 0x01B3A 0x01B35: 0x01B3B + "\x00l\xf0\x03f\xa0\x1b=" + // 0x01B3C 0x01B35: 0x01B3D + "\x00l\xf8\x03f\xa0\x1b@" + // 0x01B3E 0x01B35: 0x01B40 + "\x00l\xfc\x03f\xa0\x1bA" + // 0x01B3F 0x01B35: 0x01B41 + "\x00m\b\x03f\xa0\x1bC" + // 0x01B42 0x01B35: 0x01B43 + "\x00\x01\x04\x00d\xa0\x1e\x00" + // 0x00041 0x00325: 0x01E00 + "\x00\x01\x84\x00d\xa0\x1e\x01" + // 0x00061 0x00325: 0x01E01 + "\x00\x01\b\x00`\xe0\x1e\x02" + // 0x00042 0x00307: 0x01E02 + "\x00\x01\x88\x00`\xe0\x1e\x03" + // 0x00062 0x00307: 0x01E03 + "\x00\x01\b\x00d`\x1e\x04" + // 0x00042 0x00323: 0x01E04 + "\x00\x01\x88\x00d`\x1e\x05" + // 0x00062 0x00323: 0x01E05 + "\x00\x01\b\x00f \x1e\x06" + // 0x00042 0x00331: 0x01E06 + "\x00\x01\x88\x00f \x1e\a" + // 0x00062 0x00331: 0x01E07 + "\x00\x03\x1c\x00` \x1e\b" + // 0x000C7 0x00301: 0x01E08 + "\x00\x03\x9c\x00` \x1e\t" + // 0x000E7 0x00301: 0x01E09 + "\x00\x01\x10\x00`\xe0\x1e\n" + // 0x00044 0x00307: 0x01E0A + "\x00\x01\x90\x00`\xe0\x1e\v" + // 0x00064 0x00307: 0x01E0B + "\x00\x01\x10\x00d`\x1e\f" + // 0x00044 0x00323: 0x01E0C + "\x00\x01\x90\x00d`\x1e\r" + // 0x00064 0x00323: 0x01E0D + "\x00\x01\x10\x00f \x1e\x0e" + // 0x00044 0x00331: 0x01E0E + "\x00\x01\x90\x00f \x1e\x0f" + // 0x00064 0x00331: 0x01E0F + "\x00\x01\x10\x00d\xe0\x1e\x10" + // 0x00044 0x00327: 0x01E10 + "\x00\x01\x90\x00d\xe0\x1e\x11" + // 0x00064 0x00327: 0x01E11 + "\x00\x01\x10\x00e\xa0\x1e\x12" + // 0x00044 0x0032D: 0x01E12 + "\x00\x01\x90\x00e\xa0\x1e\x13" + // 0x00064 0x0032D: 0x01E13 + "\x00\x04H\x00`\x00\x1e\x14" + // 0x00112 0x00300: 0x01E14 + "\x00\x04L\x00`\x00\x1e\x15" + // 0x00113 0x00300: 0x01E15 + "\x00\x04H\x00` \x1e\x16" + // 0x00112 0x00301: 0x01E16 + "\x00\x04L\x00` \x1e\x17" + // 0x00113 0x00301: 0x01E17 + "\x00\x01\x14\x00e\xa0\x1e\x18" + // 0x00045 0x0032D: 0x01E18 + "\x00\x01\x94\x00e\xa0\x1e\x19" + // 0x00065 0x0032D: 0x01E19 + "\x00\x01\x14\x00f\x00\x1e\x1a" + // 0x00045 0x00330: 0x01E1A + "\x00\x01\x94\x00f\x00\x1e\x1b" + // 0x00065 0x00330: 0x01E1B + "\x00\b\xa0\x00`\xc0\x1e\x1c" + // 0x00228 0x00306: 0x01E1C + "\x00\b\xa4\x00`\xc0\x1e\x1d" + // 0x00229 0x00306: 0x01E1D + "\x00\x01\x18\x00`\xe0\x1e\x1e" + // 0x00046 0x00307: 0x01E1E + "\x00\x01\x98\x00`\xe0\x1e\x1f" + // 0x00066 0x00307: 0x01E1F + "\x00\x01\x1c\x00`\x80\x1e " + // 0x00047 0x00304: 0x01E20 + "\x00\x01\x9c\x00`\x80\x1e!" + // 0x00067 0x00304: 0x01E21 + "\x00\x01 \x00`\xe0\x1e\"" + // 0x00048 0x00307: 0x01E22 + "\x00\x01\xa0\x00`\xe0\x1e#" + // 0x00068 0x00307: 0x01E23 + "\x00\x01 \x00d`\x1e$" + // 0x00048 0x00323: 0x01E24 + "\x00\x01\xa0\x00d`\x1e%" + // 0x00068 0x00323: 0x01E25 + "\x00\x01 \x00a\x00\x1e&" + // 0x00048 0x00308: 0x01E26 + "\x00\x01\xa0\x00a\x00\x1e'" + // 0x00068 0x00308: 0x01E27 + "\x00\x01 \x00d\xe0\x1e(" + // 0x00048 0x00327: 0x01E28 + "\x00\x01\xa0\x00d\xe0\x1e)" + // 0x00068 0x00327: 0x01E29 + "\x00\x01 \x00e\xc0\x1e*" + // 0x00048 0x0032E: 0x01E2A + "\x00\x01\xa0\x00e\xc0\x1e+" + // 0x00068 0x0032E: 0x01E2B + "\x00\x01$\x00f\x00\x1e," + // 0x00049 0x00330: 0x01E2C + "\x00\x01\xa4\x00f\x00\x1e-" + // 0x00069 0x00330: 0x01E2D + "\x00\x03<\x00` \x1e." + // 0x000CF 0x00301: 0x01E2E + "\x00\x03\xbc\x00` \x1e/" + // 0x000EF 0x00301: 0x01E2F + "\x00\x01,\x00` \x1e0" + // 0x0004B 0x00301: 0x01E30 + "\x00\x01\xac\x00` \x1e1" + // 0x0006B 0x00301: 0x01E31 + "\x00\x01,\x00d`\x1e2" + // 0x0004B 0x00323: 0x01E32 + "\x00\x01\xac\x00d`\x1e3" + // 0x0006B 0x00323: 0x01E33 + "\x00\x01,\x00f \x1e4" + // 0x0004B 0x00331: 0x01E34 + "\x00\x01\xac\x00f \x1e5" + // 0x0006B 0x00331: 0x01E35 + "\x00\x010\x00d`\x1e6" + // 0x0004C 0x00323: 0x01E36 + "\x00\x01\xb0\x00d`\x1e7" + // 0x0006C 0x00323: 0x01E37 + "\x00x\xd8\x00`\x80\x1e8" + // 0x01E36 0x00304: 0x01E38 + "\x00x\xdc\x00`\x80\x1e9" + // 0x01E37 0x00304: 0x01E39 + "\x00\x010\x00f \x1e:" + // 0x0004C 0x00331: 0x01E3A + "\x00\x01\xb0\x00f \x1e;" + // 0x0006C 0x00331: 0x01E3B + "\x00\x010\x00e\xa0\x1e<" + // 0x0004C 0x0032D: 0x01E3C + "\x00\x01\xb0\x00e\xa0\x1e=" + // 0x0006C 0x0032D: 0x01E3D + "\x00\x014\x00` \x1e>" + // 0x0004D 0x00301: 0x01E3E + "\x00\x01\xb4\x00` \x1e?" + // 0x0006D 0x00301: 0x01E3F + "\x00\x014\x00`\xe0\x1e@" + // 0x0004D 0x00307: 0x01E40 + "\x00\x01\xb4\x00`\xe0\x1eA" + // 0x0006D 0x00307: 0x01E41 + "\x00\x014\x00d`\x1eB" + // 0x0004D 0x00323: 0x01E42 + "\x00\x01\xb4\x00d`\x1eC" + // 0x0006D 0x00323: 0x01E43 + "\x00\x018\x00`\xe0\x1eD" + // 0x0004E 0x00307: 0x01E44 + "\x00\x01\xb8\x00`\xe0\x1eE" + // 0x0006E 0x00307: 0x01E45 + "\x00\x018\x00d`\x1eF" + // 0x0004E 0x00323: 0x01E46 + "\x00\x01\xb8\x00d`\x1eG" + // 0x0006E 0x00323: 0x01E47 + "\x00\x018\x00f \x1eH" + // 0x0004E 0x00331: 0x01E48 + "\x00\x01\xb8\x00f \x1eI" + // 0x0006E 0x00331: 0x01E49 + "\x00\x018\x00e\xa0\x1eJ" + // 0x0004E 0x0032D: 0x01E4A + "\x00\x01\xb8\x00e\xa0\x1eK" + // 0x0006E 0x0032D: 0x01E4B + "\x00\x03T\x00` \x1eL" + // 0x000D5 0x00301: 0x01E4C + "\x00\x03\xd4\x00` \x1eM" + // 0x000F5 0x00301: 0x01E4D + "\x00\x03T\x00a\x00\x1eN" + // 0x000D5 0x00308: 0x01E4E + "\x00\x03\xd4\x00a\x00\x1eO" + // 0x000F5 0x00308: 0x01E4F + "\x00\x050\x00`\x00\x1eP" + // 0x0014C 0x00300: 0x01E50 + "\x00\x054\x00`\x00\x1eQ" + // 0x0014D 0x00300: 0x01E51 + "\x00\x050\x00` \x1eR" + // 0x0014C 0x00301: 0x01E52 + "\x00\x054\x00` \x1eS" + // 0x0014D 0x00301: 0x01E53 + "\x00\x01@\x00` \x1eT" + // 0x00050 0x00301: 0x01E54 + "\x00\x01\xc0\x00` \x1eU" + // 0x00070 0x00301: 0x01E55 + "\x00\x01@\x00`\xe0\x1eV" + // 0x00050 0x00307: 0x01E56 + "\x00\x01\xc0\x00`\xe0\x1eW" + // 0x00070 0x00307: 0x01E57 + "\x00\x01H\x00`\xe0\x1eX" + // 0x00052 0x00307: 0x01E58 + "\x00\x01\xc8\x00`\xe0\x1eY" + // 0x00072 0x00307: 0x01E59 + "\x00\x01H\x00d`\x1eZ" + // 0x00052 0x00323: 0x01E5A + "\x00\x01\xc8\x00d`\x1e[" + // 0x00072 0x00323: 0x01E5B + "\x00yh\x00`\x80\x1e\\" + // 0x01E5A 0x00304: 0x01E5C + "\x00yl\x00`\x80\x1e]" + // 0x01E5B 0x00304: 0x01E5D + "\x00\x01H\x00f \x1e^" + // 0x00052 0x00331: 0x01E5E + "\x00\x01\xc8\x00f \x1e_" + // 0x00072 0x00331: 0x01E5F + "\x00\x01L\x00`\xe0\x1e`" + // 0x00053 0x00307: 0x01E60 + "\x00\x01\xcc\x00`\xe0\x1ea" + // 0x00073 0x00307: 0x01E61 + "\x00\x01L\x00d`\x1eb" + // 0x00053 0x00323: 0x01E62 + "\x00\x01\xcc\x00d`\x1ec" + // 0x00073 0x00323: 0x01E63 + "\x00\x05h\x00`\xe0\x1ed" + // 0x0015A 0x00307: 0x01E64 + "\x00\x05l\x00`\xe0\x1ee" + // 0x0015B 0x00307: 0x01E65 + "\x00\x05\x80\x00`\xe0\x1ef" + // 0x00160 0x00307: 0x01E66 + "\x00\x05\x84\x00`\xe0\x1eg" + // 0x00161 0x00307: 0x01E67 + "\x00y\x88\x00`\xe0\x1eh" + // 0x01E62 0x00307: 0x01E68 + "\x00y\x8c\x00`\xe0\x1ei" + // 0x01E63 0x00307: 0x01E69 + "\x00\x01P\x00`\xe0\x1ej" + // 0x00054 0x00307: 0x01E6A + "\x00\x01\xd0\x00`\xe0\x1ek" + // 0x00074 0x00307: 0x01E6B + "\x00\x01P\x00d`\x1el" + // 0x00054 0x00323: 0x01E6C + "\x00\x01\xd0\x00d`\x1em" + // 0x00074 0x00323: 0x01E6D + "\x00\x01P\x00f \x1en" + // 0x00054 0x00331: 0x01E6E + "\x00\x01\xd0\x00f \x1eo" + // 0x00074 0x00331: 0x01E6F + "\x00\x01P\x00e\xa0\x1ep" + // 0x00054 0x0032D: 0x01E70 + "\x00\x01\xd0\x00e\xa0\x1eq" + // 0x00074 0x0032D: 0x01E71 + "\x00\x01T\x00d\x80\x1er" + // 0x00055 0x00324: 0x01E72 + "\x00\x01\xd4\x00d\x80\x1es" + // 0x00075 0x00324: 0x01E73 + "\x00\x01T\x00f\x00\x1et" + // 0x00055 0x00330: 0x01E74 + "\x00\x01\xd4\x00f\x00\x1eu" + // 0x00075 0x00330: 0x01E75 + "\x00\x01T\x00e\xa0\x1ev" + // 0x00055 0x0032D: 0x01E76 + "\x00\x01\xd4\x00e\xa0\x1ew" + // 0x00075 0x0032D: 0x01E77 + "\x00\x05\xa0\x00` \x1ex" + // 0x00168 0x00301: 0x01E78 + "\x00\x05\xa4\x00` \x1ey" + // 0x00169 0x00301: 0x01E79 + "\x00\x05\xa8\x00a\x00\x1ez" + // 0x0016A 0x00308: 0x01E7A + "\x00\x05\xac\x00a\x00\x1e{" + // 0x0016B 0x00308: 0x01E7B + "\x00\x01X\x00``\x1e|" + // 0x00056 0x00303: 0x01E7C + "\x00\x01\xd8\x00``\x1e}" + // 0x00076 0x00303: 0x01E7D + "\x00\x01X\x00d`\x1e~" + // 0x00056 0x00323: 0x01E7E + "\x00\x01\xd8\x00d`\x1e\x7f" + // 0x00076 0x00323: 0x01E7F + "\x00\x01\\\x00`\x00\x1e\x80" + // 0x00057 0x00300: 0x01E80 + "\x00\x01\xdc\x00`\x00\x1e\x81" + // 0x00077 0x00300: 0x01E81 + "\x00\x01\\\x00` \x1e\x82" + // 0x00057 0x00301: 0x01E82 + "\x00\x01\xdc\x00` \x1e\x83" + // 0x00077 0x00301: 0x01E83 + "\x00\x01\\\x00a\x00\x1e\x84" + // 0x00057 0x00308: 0x01E84 + "\x00\x01\xdc\x00a\x00\x1e\x85" + // 0x00077 0x00308: 0x01E85 + "\x00\x01\\\x00`\xe0\x1e\x86" + // 0x00057 0x00307: 0x01E86 + "\x00\x01\xdc\x00`\xe0\x1e\x87" + // 0x00077 0x00307: 0x01E87 + "\x00\x01\\\x00d`\x1e\x88" + // 0x00057 0x00323: 0x01E88 + "\x00\x01\xdc\x00d`\x1e\x89" + // 0x00077 0x00323: 0x01E89 + "\x00\x01`\x00`\xe0\x1e\x8a" + // 0x00058 0x00307: 0x01E8A + "\x00\x01\xe0\x00`\xe0\x1e\x8b" + // 0x00078 0x00307: 0x01E8B + "\x00\x01`\x00a\x00\x1e\x8c" + // 0x00058 0x00308: 0x01E8C + "\x00\x01\xe0\x00a\x00\x1e\x8d" + // 0x00078 0x00308: 0x01E8D + "\x00\x01d\x00`\xe0\x1e\x8e" + // 0x00059 0x00307: 0x01E8E + "\x00\x01\xe4\x00`\xe0\x1e\x8f" + // 0x00079 0x00307: 0x01E8F + "\x00\x01h\x00`@\x1e\x90" + // 0x0005A 0x00302: 0x01E90 + "\x00\x01\xe8\x00`@\x1e\x91" + // 0x0007A 0x00302: 0x01E91 + "\x00\x01h\x00d`\x1e\x92" + // 0x0005A 0x00323: 0x01E92 + "\x00\x01\xe8\x00d`\x1e\x93" + // 0x0007A 0x00323: 0x01E93 + "\x00\x01h\x00f \x1e\x94" + // 0x0005A 0x00331: 0x01E94 + "\x00\x01\xe8\x00f \x1e\x95" + // 0x0007A 0x00331: 0x01E95 + "\x00\x01\xa0\x00f \x1e\x96" + // 0x00068 0x00331: 0x01E96 + "\x00\x01\xd0\x00a\x00\x1e\x97" + // 0x00074 0x00308: 0x01E97 + "\x00\x01\xdc\x00a@\x1e\x98" + // 0x00077 0x0030A: 0x01E98 + "\x00\x01\xe4\x00a@\x1e\x99" + // 0x00079 0x0030A: 0x01E99 + "\x00\x05\xfc\x00`\xe0\x1e\x9b" + // 0x0017F 0x00307: 0x01E9B + "\x00\x01\x04\x00d`\x1e\xa0" + // 0x00041 0x00323: 0x01EA0 + "\x00\x01\x84\x00d`\x1e\xa1" + // 0x00061 0x00323: 0x01EA1 + "\x00\x01\x04\x00a \x1e\xa2" + // 0x00041 0x00309: 0x01EA2 + "\x00\x01\x84\x00a \x1e\xa3" + // 0x00061 0x00309: 0x01EA3 + "\x00\x03\b\x00` \x1e\xa4" + // 0x000C2 0x00301: 0x01EA4 + "\x00\x03\x88\x00` \x1e\xa5" + // 0x000E2 0x00301: 0x01EA5 + "\x00\x03\b\x00`\x00\x1e\xa6" + // 0x000C2 0x00300: 0x01EA6 + "\x00\x03\x88\x00`\x00\x1e\xa7" + // 0x000E2 0x00300: 0x01EA7 + "\x00\x03\b\x00a \x1e\xa8" + // 0x000C2 0x00309: 0x01EA8 + "\x00\x03\x88\x00a \x1e\xa9" + // 0x000E2 0x00309: 0x01EA9 + "\x00\x03\b\x00``\x1e\xaa" + // 0x000C2 0x00303: 0x01EAA + "\x00\x03\x88\x00``\x1e\xab" + // 0x000E2 0x00303: 0x01EAB + "\x00z\x80\x00`@\x1e\xac" + // 0x01EA0 0x00302: 0x01EAC + "\x00z\x84\x00`@\x1e\xad" + // 0x01EA1 0x00302: 0x01EAD + "\x00\x04\b\x00` \x1e\xae" + // 0x00102 0x00301: 0x01EAE + "\x00\x04\f\x00` \x1e\xaf" + // 0x00103 0x00301: 0x01EAF + "\x00\x04\b\x00`\x00\x1e\xb0" + // 0x00102 0x00300: 0x01EB0 + "\x00\x04\f\x00`\x00\x1e\xb1" + // 0x00103 0x00300: 0x01EB1 + "\x00\x04\b\x00a \x1e\xb2" + // 0x00102 0x00309: 0x01EB2 + "\x00\x04\f\x00a \x1e\xb3" + // 0x00103 0x00309: 0x01EB3 + "\x00\x04\b\x00``\x1e\xb4" + // 0x00102 0x00303: 0x01EB4 + "\x00\x04\f\x00``\x1e\xb5" + // 0x00103 0x00303: 0x01EB5 + "\x00z\x80\x00`\xc0\x1e\xb6" + // 0x01EA0 0x00306: 0x01EB6 + "\x00z\x84\x00`\xc0\x1e\xb7" + // 0x01EA1 0x00306: 0x01EB7 + "\x00\x01\x14\x00d`\x1e\xb8" + // 0x00045 0x00323: 0x01EB8 + "\x00\x01\x94\x00d`\x1e\xb9" + // 0x00065 0x00323: 0x01EB9 + "\x00\x01\x14\x00a \x1e\xba" + // 0x00045 0x00309: 0x01EBA + "\x00\x01\x94\x00a \x1e\xbb" + // 0x00065 0x00309: 0x01EBB + "\x00\x01\x14\x00``\x1e\xbc" + // 0x00045 0x00303: 0x01EBC + "\x00\x01\x94\x00``\x1e\xbd" + // 0x00065 0x00303: 0x01EBD + "\x00\x03(\x00` \x1e\xbe" + // 0x000CA 0x00301: 0x01EBE + "\x00\x03\xa8\x00` \x1e\xbf" + // 0x000EA 0x00301: 0x01EBF + "\x00\x03(\x00`\x00\x1e\xc0" + // 0x000CA 0x00300: 0x01EC0 + "\x00\x03\xa8\x00`\x00\x1e\xc1" + // 0x000EA 0x00300: 0x01EC1 + "\x00\x03(\x00a \x1e\xc2" + // 0x000CA 0x00309: 0x01EC2 + "\x00\x03\xa8\x00a \x1e\xc3" + // 0x000EA 0x00309: 0x01EC3 + "\x00\x03(\x00``\x1e\xc4" + // 0x000CA 0x00303: 0x01EC4 + "\x00\x03\xa8\x00``\x1e\xc5" + // 0x000EA 0x00303: 0x01EC5 + "\x00z\xe0\x00`@\x1e\xc6" + // 0x01EB8 0x00302: 0x01EC6 + "\x00z\xe4\x00`@\x1e\xc7" + // 0x01EB9 0x00302: 0x01EC7 + "\x00\x01$\x00a \x1e\xc8" + // 0x00049 0x00309: 0x01EC8 + "\x00\x01\xa4\x00a \x1e\xc9" + // 0x00069 0x00309: 0x01EC9 + "\x00\x01$\x00d`\x1e\xca" + // 0x00049 0x00323: 0x01ECA + "\x00\x01\xa4\x00d`\x1e\xcb" + // 0x00069 0x00323: 0x01ECB + "\x00\x01<\x00d`\x1e\xcc" + // 0x0004F 0x00323: 0x01ECC + "\x00\x01\xbc\x00d`\x1e\xcd" + // 0x0006F 0x00323: 0x01ECD + "\x00\x01<\x00a \x1e\xce" + // 0x0004F 0x00309: 0x01ECE + "\x00\x01\xbc\x00a \x1e\xcf" + // 0x0006F 0x00309: 0x01ECF + "\x00\x03P\x00` \x1e\xd0" + // 0x000D4 0x00301: 0x01ED0 + "\x00\x03\xd0\x00` \x1e\xd1" + // 0x000F4 0x00301: 0x01ED1 + "\x00\x03P\x00`\x00\x1e\xd2" + // 0x000D4 0x00300: 0x01ED2 + "\x00\x03\xd0\x00`\x00\x1e\xd3" + // 0x000F4 0x00300: 0x01ED3 + "\x00\x03P\x00a \x1e\xd4" + // 0x000D4 0x00309: 0x01ED4 + "\x00\x03\xd0\x00a \x1e\xd5" + // 0x000F4 0x00309: 0x01ED5 + "\x00\x03P\x00``\x1e\xd6" + // 0x000D4 0x00303: 0x01ED6 + "\x00\x03\xd0\x00``\x1e\xd7" + // 0x000F4 0x00303: 0x01ED7 + "\x00{0\x00`@\x1e\xd8" + // 0x01ECC 0x00302: 0x01ED8 + "\x00{4\x00`@\x1e\xd9" + // 0x01ECD 0x00302: 0x01ED9 + "\x00\x06\x80\x00` \x1e\xda" + // 0x001A0 0x00301: 0x01EDA + "\x00\x06\x84\x00` \x1e\xdb" + // 0x001A1 0x00301: 0x01EDB + "\x00\x06\x80\x00`\x00\x1e\xdc" + // 0x001A0 0x00300: 0x01EDC + "\x00\x06\x84\x00`\x00\x1e\xdd" + // 0x001A1 0x00300: 0x01EDD + "\x00\x06\x80\x00a \x1e\xde" + // 0x001A0 0x00309: 0x01EDE + "\x00\x06\x84\x00a \x1e\xdf" + // 0x001A1 0x00309: 0x01EDF + "\x00\x06\x80\x00``\x1e\xe0" + // 0x001A0 0x00303: 0x01EE0 + "\x00\x06\x84\x00``\x1e\xe1" + // 0x001A1 0x00303: 0x01EE1 + "\x00\x06\x80\x00d`\x1e\xe2" + // 0x001A0 0x00323: 0x01EE2 + "\x00\x06\x84\x00d`\x1e\xe3" + // 0x001A1 0x00323: 0x01EE3 + "\x00\x01T\x00d`\x1e\xe4" + // 0x00055 0x00323: 0x01EE4 + "\x00\x01\xd4\x00d`\x1e\xe5" + // 0x00075 0x00323: 0x01EE5 + "\x00\x01T\x00a \x1e\xe6" + // 0x00055 0x00309: 0x01EE6 + "\x00\x01\xd4\x00a \x1e\xe7" + // 0x00075 0x00309: 0x01EE7 + "\x00\x06\xbc\x00` \x1e\xe8" + // 0x001AF 0x00301: 0x01EE8 + "\x00\x06\xc0\x00` \x1e\xe9" + // 0x001B0 0x00301: 0x01EE9 + "\x00\x06\xbc\x00`\x00\x1e\xea" + // 0x001AF 0x00300: 0x01EEA + "\x00\x06\xc0\x00`\x00\x1e\xeb" + // 0x001B0 0x00300: 0x01EEB + "\x00\x06\xbc\x00a \x1e\xec" + // 0x001AF 0x00309: 0x01EEC + "\x00\x06\xc0\x00a \x1e\xed" + // 0x001B0 0x00309: 0x01EED + "\x00\x06\xbc\x00``\x1e\xee" + // 0x001AF 0x00303: 0x01EEE + "\x00\x06\xc0\x00``\x1e\xef" + // 0x001B0 0x00303: 0x01EEF + "\x00\x06\xbc\x00d`\x1e\xf0" + // 0x001AF 0x00323: 0x01EF0 + "\x00\x06\xc0\x00d`\x1e\xf1" + // 0x001B0 0x00323: 0x01EF1 + "\x00\x01d\x00`\x00\x1e\xf2" + // 0x00059 0x00300: 0x01EF2 + "\x00\x01\xe4\x00`\x00\x1e\xf3" + // 0x00079 0x00300: 0x01EF3 + "\x00\x01d\x00d`\x1e\xf4" + // 0x00059 0x00323: 0x01EF4 + "\x00\x01\xe4\x00d`\x1e\xf5" + // 0x00079 0x00323: 0x01EF5 + "\x00\x01d\x00a \x1e\xf6" + // 0x00059 0x00309: 0x01EF6 + "\x00\x01\xe4\x00a \x1e\xf7" + // 0x00079 0x00309: 0x01EF7 + "\x00\x01d\x00``\x1e\xf8" + // 0x00059 0x00303: 0x01EF8 + "\x00\x01\xe4\x00``\x1e\xf9" + // 0x00079 0x00303: 0x01EF9 + "\x00\x0e\xc4\x00b`\x1f\x00" + // 0x003B1 0x00313: 0x01F00 + "\x00\x0e\xc4\x00b\x80\x1f\x01" + // 0x003B1 0x00314: 0x01F01 + "\x00|\x00\x00`\x00\x1f\x02" + // 0x01F00 0x00300: 0x01F02 + "\x00|\x04\x00`\x00\x1f\x03" + // 0x01F01 0x00300: 0x01F03 + "\x00|\x00\x00` \x1f\x04" + // 0x01F00 0x00301: 0x01F04 + "\x00|\x04\x00` \x1f\x05" + // 0x01F01 0x00301: 0x01F05 + "\x00|\x00\x00h@\x1f\x06" + // 0x01F00 0x00342: 0x01F06 + "\x00|\x04\x00h@\x1f\a" + // 0x01F01 0x00342: 0x01F07 + "\x00\x0eD\x00b`\x1f\b" + // 0x00391 0x00313: 0x01F08 + "\x00\x0eD\x00b\x80\x1f\t" + // 0x00391 0x00314: 0x01F09 + "\x00| \x00`\x00\x1f\n" + // 0x01F08 0x00300: 0x01F0A + "\x00|$\x00`\x00\x1f\v" + // 0x01F09 0x00300: 0x01F0B + "\x00| \x00` \x1f\f" + // 0x01F08 0x00301: 0x01F0C + "\x00|$\x00` \x1f\r" + // 0x01F09 0x00301: 0x01F0D + "\x00| \x00h@\x1f\x0e" + // 0x01F08 0x00342: 0x01F0E + "\x00|$\x00h@\x1f\x0f" + // 0x01F09 0x00342: 0x01F0F + "\x00\x0e\xd4\x00b`\x1f\x10" + // 0x003B5 0x00313: 0x01F10 + "\x00\x0e\xd4\x00b\x80\x1f\x11" + // 0x003B5 0x00314: 0x01F11 + "\x00|@\x00`\x00\x1f\x12" + // 0x01F10 0x00300: 0x01F12 + "\x00|D\x00`\x00\x1f\x13" + // 0x01F11 0x00300: 0x01F13 + "\x00|@\x00` \x1f\x14" + // 0x01F10 0x00301: 0x01F14 + "\x00|D\x00` \x1f\x15" + // 0x01F11 0x00301: 0x01F15 + "\x00\x0eT\x00b`\x1f\x18" + // 0x00395 0x00313: 0x01F18 + "\x00\x0eT\x00b\x80\x1f\x19" + // 0x00395 0x00314: 0x01F19 + "\x00|`\x00`\x00\x1f\x1a" + // 0x01F18 0x00300: 0x01F1A + "\x00|d\x00`\x00\x1f\x1b" + // 0x01F19 0x00300: 0x01F1B + "\x00|`\x00` \x1f\x1c" + // 0x01F18 0x00301: 0x01F1C + "\x00|d\x00` \x1f\x1d" + // 0x01F19 0x00301: 0x01F1D + "\x00\x0e\xdc\x00b`\x1f " + // 0x003B7 0x00313: 0x01F20 + "\x00\x0e\xdc\x00b\x80\x1f!" + // 0x003B7 0x00314: 0x01F21 + "\x00|\x80\x00`\x00\x1f\"" + // 0x01F20 0x00300: 0x01F22 + "\x00|\x84\x00`\x00\x1f#" + // 0x01F21 0x00300: 0x01F23 + "\x00|\x80\x00` \x1f$" + // 0x01F20 0x00301: 0x01F24 + "\x00|\x84\x00` \x1f%" + // 0x01F21 0x00301: 0x01F25 + "\x00|\x80\x00h@\x1f&" + // 0x01F20 0x00342: 0x01F26 + "\x00|\x84\x00h@\x1f'" + // 0x01F21 0x00342: 0x01F27 + "\x00\x0e\\\x00b`\x1f(" + // 0x00397 0x00313: 0x01F28 + "\x00\x0e\\\x00b\x80\x1f)" + // 0x00397 0x00314: 0x01F29 + "\x00|\xa0\x00`\x00\x1f*" + // 0x01F28 0x00300: 0x01F2A + "\x00|\xa4\x00`\x00\x1f+" + // 0x01F29 0x00300: 0x01F2B + "\x00|\xa0\x00` \x1f," + // 0x01F28 0x00301: 0x01F2C + "\x00|\xa4\x00` \x1f-" + // 0x01F29 0x00301: 0x01F2D + "\x00|\xa0\x00h@\x1f." + // 0x01F28 0x00342: 0x01F2E + "\x00|\xa4\x00h@\x1f/" + // 0x01F29 0x00342: 0x01F2F + "\x00\x0e\xe4\x00b`\x1f0" + // 0x003B9 0x00313: 0x01F30 + "\x00\x0e\xe4\x00b\x80\x1f1" + // 0x003B9 0x00314: 0x01F31 + "\x00|\xc0\x00`\x00\x1f2" + // 0x01F30 0x00300: 0x01F32 + "\x00|\xc4\x00`\x00\x1f3" + // 0x01F31 0x00300: 0x01F33 + "\x00|\xc0\x00` \x1f4" + // 0x01F30 0x00301: 0x01F34 + "\x00|\xc4\x00` \x1f5" + // 0x01F31 0x00301: 0x01F35 + "\x00|\xc0\x00h@\x1f6" + // 0x01F30 0x00342: 0x01F36 + "\x00|\xc4\x00h@\x1f7" + // 0x01F31 0x00342: 0x01F37 + "\x00\x0ed\x00b`\x1f8" + // 0x00399 0x00313: 0x01F38 + "\x00\x0ed\x00b\x80\x1f9" + // 0x00399 0x00314: 0x01F39 + "\x00|\xe0\x00`\x00\x1f:" + // 0x01F38 0x00300: 0x01F3A + "\x00|\xe4\x00`\x00\x1f;" + // 0x01F39 0x00300: 0x01F3B + "\x00|\xe0\x00` \x1f<" + // 0x01F38 0x00301: 0x01F3C + "\x00|\xe4\x00` \x1f=" + // 0x01F39 0x00301: 0x01F3D + "\x00|\xe0\x00h@\x1f>" + // 0x01F38 0x00342: 0x01F3E + "\x00|\xe4\x00h@\x1f?" + // 0x01F39 0x00342: 0x01F3F + "\x00\x0e\xfc\x00b`\x1f@" + // 0x003BF 0x00313: 0x01F40 + "\x00\x0e\xfc\x00b\x80\x1fA" + // 0x003BF 0x00314: 0x01F41 + "\x00}\x00\x00`\x00\x1fB" + // 0x01F40 0x00300: 0x01F42 + "\x00}\x04\x00`\x00\x1fC" + // 0x01F41 0x00300: 0x01F43 + "\x00}\x00\x00` \x1fD" + // 0x01F40 0x00301: 0x01F44 + "\x00}\x04\x00` \x1fE" + // 0x01F41 0x00301: 0x01F45 + "\x00\x0e|\x00b`\x1fH" + // 0x0039F 0x00313: 0x01F48 + "\x00\x0e|\x00b\x80\x1fI" + // 0x0039F 0x00314: 0x01F49 + "\x00} \x00`\x00\x1fJ" + // 0x01F48 0x00300: 0x01F4A + "\x00}$\x00`\x00\x1fK" + // 0x01F49 0x00300: 0x01F4B + "\x00} \x00` \x1fL" + // 0x01F48 0x00301: 0x01F4C + "\x00}$\x00` \x1fM" + // 0x01F49 0x00301: 0x01F4D + "\x00\x0f\x14\x00b`\x1fP" + // 0x003C5 0x00313: 0x01F50 + "\x00\x0f\x14\x00b\x80\x1fQ" + // 0x003C5 0x00314: 0x01F51 + "\x00}@\x00`\x00\x1fR" + // 0x01F50 0x00300: 0x01F52 + "\x00}D\x00`\x00\x1fS" + // 0x01F51 0x00300: 0x01F53 + "\x00}@\x00` \x1fT" + // 0x01F50 0x00301: 0x01F54 + "\x00}D\x00` \x1fU" + // 0x01F51 0x00301: 0x01F55 + "\x00}@\x00h@\x1fV" + // 0x01F50 0x00342: 0x01F56 + "\x00}D\x00h@\x1fW" + // 0x01F51 0x00342: 0x01F57 + "\x00\x0e\x94\x00b\x80\x1fY" + // 0x003A5 0x00314: 0x01F59 + "\x00}d\x00`\x00\x1f[" + // 0x01F59 0x00300: 0x01F5B + "\x00}d\x00` \x1f]" + // 0x01F59 0x00301: 0x01F5D + "\x00}d\x00h@\x1f_" + // 0x01F59 0x00342: 0x01F5F + "\x00\x0f$\x00b`\x1f`" + // 0x003C9 0x00313: 0x01F60 + "\x00\x0f$\x00b\x80\x1fa" + // 0x003C9 0x00314: 0x01F61 + "\x00}\x80\x00`\x00\x1fb" + // 0x01F60 0x00300: 0x01F62 + "\x00}\x84\x00`\x00\x1fc" + // 0x01F61 0x00300: 0x01F63 + "\x00}\x80\x00` \x1fd" + // 0x01F60 0x00301: 0x01F64 + "\x00}\x84\x00` \x1fe" + // 0x01F61 0x00301: 0x01F65 + "\x00}\x80\x00h@\x1ff" + // 0x01F60 0x00342: 0x01F66 + "\x00}\x84\x00h@\x1fg" + // 0x01F61 0x00342: 0x01F67 + "\x00\x0e\xa4\x00b`\x1fh" + // 0x003A9 0x00313: 0x01F68 + "\x00\x0e\xa4\x00b\x80\x1fi" + // 0x003A9 0x00314: 0x01F69 + "\x00}\xa0\x00`\x00\x1fj" + // 0x01F68 0x00300: 0x01F6A + "\x00}\xa4\x00`\x00\x1fk" + // 0x01F69 0x00300: 0x01F6B + "\x00}\xa0\x00` \x1fl" + // 0x01F68 0x00301: 0x01F6C + "\x00}\xa4\x00` \x1fm" + // 0x01F69 0x00301: 0x01F6D + "\x00}\xa0\x00h@\x1fn" + // 0x01F68 0x00342: 0x01F6E + "\x00}\xa4\x00h@\x1fo" + // 0x01F69 0x00342: 0x01F6F + "\x00\x0e\xc4\x00`\x00\x1fp" + // 0x003B1 0x00300: 0x01F70 + "\x00\x0e\xd4\x00`\x00\x1fr" + // 0x003B5 0x00300: 0x01F72 + "\x00\x0e\xdc\x00`\x00\x1ft" + // 0x003B7 0x00300: 0x01F74 + "\x00\x0e\xe4\x00`\x00\x1fv" + // 0x003B9 0x00300: 0x01F76 + "\x00\x0e\xfc\x00`\x00\x1fx" + // 0x003BF 0x00300: 0x01F78 + "\x00\x0f\x14\x00`\x00\x1fz" + // 0x003C5 0x00300: 0x01F7A + "\x00\x0f$\x00`\x00\x1f|" + // 0x003C9 0x00300: 0x01F7C + "\x00|\x00\x00h\xa0\x1f\x80" + // 0x01F00 0x00345: 0x01F80 + "\x00|\x04\x00h\xa0\x1f\x81" + // 0x01F01 0x00345: 0x01F81 + "\x00|\b\x00h\xa0\x1f\x82" + // 0x01F02 0x00345: 0x01F82 + "\x00|\f\x00h\xa0\x1f\x83" + // 0x01F03 0x00345: 0x01F83 + "\x00|\x10\x00h\xa0\x1f\x84" + // 0x01F04 0x00345: 0x01F84 + "\x00|\x14\x00h\xa0\x1f\x85" + // 0x01F05 0x00345: 0x01F85 + "\x00|\x18\x00h\xa0\x1f\x86" + // 0x01F06 0x00345: 0x01F86 + "\x00|\x1c\x00h\xa0\x1f\x87" + // 0x01F07 0x00345: 0x01F87 + "\x00| \x00h\xa0\x1f\x88" + // 0x01F08 0x00345: 0x01F88 + "\x00|$\x00h\xa0\x1f\x89" + // 0x01F09 0x00345: 0x01F89 + "\x00|(\x00h\xa0\x1f\x8a" + // 0x01F0A 0x00345: 0x01F8A + "\x00|,\x00h\xa0\x1f\x8b" + // 0x01F0B 0x00345: 0x01F8B + "\x00|0\x00h\xa0\x1f\x8c" + // 0x01F0C 0x00345: 0x01F8C + "\x00|4\x00h\xa0\x1f\x8d" + // 0x01F0D 0x00345: 0x01F8D + "\x00|8\x00h\xa0\x1f\x8e" + // 0x01F0E 0x00345: 0x01F8E + "\x00|<\x00h\xa0\x1f\x8f" + // 0x01F0F 0x00345: 0x01F8F + "\x00|\x80\x00h\xa0\x1f\x90" + // 0x01F20 0x00345: 0x01F90 + "\x00|\x84\x00h\xa0\x1f\x91" + // 0x01F21 0x00345: 0x01F91 + "\x00|\x88\x00h\xa0\x1f\x92" + // 0x01F22 0x00345: 0x01F92 + "\x00|\x8c\x00h\xa0\x1f\x93" + // 0x01F23 0x00345: 0x01F93 + "\x00|\x90\x00h\xa0\x1f\x94" + // 0x01F24 0x00345: 0x01F94 + "\x00|\x94\x00h\xa0\x1f\x95" + // 0x01F25 0x00345: 0x01F95 + "\x00|\x98\x00h\xa0\x1f\x96" + // 0x01F26 0x00345: 0x01F96 + "\x00|\x9c\x00h\xa0\x1f\x97" + // 0x01F27 0x00345: 0x01F97 + "\x00|\xa0\x00h\xa0\x1f\x98" + // 0x01F28 0x00345: 0x01F98 + "\x00|\xa4\x00h\xa0\x1f\x99" + // 0x01F29 0x00345: 0x01F99 + "\x00|\xa8\x00h\xa0\x1f\x9a" + // 0x01F2A 0x00345: 0x01F9A + "\x00|\xac\x00h\xa0\x1f\x9b" + // 0x01F2B 0x00345: 0x01F9B + "\x00|\xb0\x00h\xa0\x1f\x9c" + // 0x01F2C 0x00345: 0x01F9C + "\x00|\xb4\x00h\xa0\x1f\x9d" + // 0x01F2D 0x00345: 0x01F9D + "\x00|\xb8\x00h\xa0\x1f\x9e" + // 0x01F2E 0x00345: 0x01F9E + "\x00|\xbc\x00h\xa0\x1f\x9f" + // 0x01F2F 0x00345: 0x01F9F + "\x00}\x80\x00h\xa0\x1f\xa0" + // 0x01F60 0x00345: 0x01FA0 + "\x00}\x84\x00h\xa0\x1f\xa1" + // 0x01F61 0x00345: 0x01FA1 + "\x00}\x88\x00h\xa0\x1f\xa2" + // 0x01F62 0x00345: 0x01FA2 + "\x00}\x8c\x00h\xa0\x1f\xa3" + // 0x01F63 0x00345: 0x01FA3 + "\x00}\x90\x00h\xa0\x1f\xa4" + // 0x01F64 0x00345: 0x01FA4 + "\x00}\x94\x00h\xa0\x1f\xa5" + // 0x01F65 0x00345: 0x01FA5 + "\x00}\x98\x00h\xa0\x1f\xa6" + // 0x01F66 0x00345: 0x01FA6 + "\x00}\x9c\x00h\xa0\x1f\xa7" + // 0x01F67 0x00345: 0x01FA7 + "\x00}\xa0\x00h\xa0\x1f\xa8" + // 0x01F68 0x00345: 0x01FA8 + "\x00}\xa4\x00h\xa0\x1f\xa9" + // 0x01F69 0x00345: 0x01FA9 + "\x00}\xa8\x00h\xa0\x1f\xaa" + // 0x01F6A 0x00345: 0x01FAA + "\x00}\xac\x00h\xa0\x1f\xab" + // 0x01F6B 0x00345: 0x01FAB + "\x00}\xb0\x00h\xa0\x1f\xac" + // 0x01F6C 0x00345: 0x01FAC + "\x00}\xb4\x00h\xa0\x1f\xad" + // 0x01F6D 0x00345: 0x01FAD + "\x00}\xb8\x00h\xa0\x1f\xae" + // 0x01F6E 0x00345: 0x01FAE + "\x00}\xbc\x00h\xa0\x1f\xaf" + // 0x01F6F 0x00345: 0x01FAF + "\x00\x0e\xc4\x00`\xc0\x1f\xb0" + // 0x003B1 0x00306: 0x01FB0 + "\x00\x0e\xc4\x00`\x80\x1f\xb1" + // 0x003B1 0x00304: 0x01FB1 + "\x00}\xc0\x00h\xa0\x1f\xb2" + // 0x01F70 0x00345: 0x01FB2 + "\x00\x0e\xc4\x00h\xa0\x1f\xb3" + // 0x003B1 0x00345: 0x01FB3 + "\x00\x0e\xb0\x00h\xa0\x1f\xb4" + // 0x003AC 0x00345: 0x01FB4 + "\x00\x0e\xc4\x00h@\x1f\xb6" + // 0x003B1 0x00342: 0x01FB6 + "\x00~\xd8\x00h\xa0\x1f\xb7" + // 0x01FB6 0x00345: 0x01FB7 + "\x00\x0eD\x00`\xc0\x1f\xb8" + // 0x00391 0x00306: 0x01FB8 + "\x00\x0eD\x00`\x80\x1f\xb9" + // 0x00391 0x00304: 0x01FB9 + "\x00\x0eD\x00`\x00\x1f\xba" + // 0x00391 0x00300: 0x01FBA + "\x00\x0eD\x00h\xa0\x1f\xbc" + // 0x00391 0x00345: 0x01FBC + "\x00\x02\xa0\x00h@\x1f\xc1" + // 0x000A8 0x00342: 0x01FC1 + "\x00}\xd0\x00h\xa0\x1f\xc2" + // 0x01F74 0x00345: 0x01FC2 + "\x00\x0e\xdc\x00h\xa0\x1f\xc3" + // 0x003B7 0x00345: 0x01FC3 + "\x00\x0e\xb8\x00h\xa0\x1f\xc4" + // 0x003AE 0x00345: 0x01FC4 + "\x00\x0e\xdc\x00h@\x1f\xc6" + // 0x003B7 0x00342: 0x01FC6 + "\x00\x7f\x18\x00h\xa0\x1f\xc7" + // 0x01FC6 0x00345: 0x01FC7 + "\x00\x0eT\x00`\x00\x1f\xc8" + // 0x00395 0x00300: 0x01FC8 + "\x00\x0e\\\x00`\x00\x1f\xca" + // 0x00397 0x00300: 0x01FCA + "\x00\x0e\\\x00h\xa0\x1f\xcc" + // 0x00397 0x00345: 0x01FCC + "\x00~\xfc\x00`\x00\x1f\xcd" + // 0x01FBF 0x00300: 0x01FCD + "\x00~\xfc\x00` \x1f\xce" + // 0x01FBF 0x00301: 0x01FCE + "\x00~\xfc\x00h@\x1f\xcf" + // 0x01FBF 0x00342: 0x01FCF + "\x00\x0e\xe4\x00`\xc0\x1f\xd0" + // 0x003B9 0x00306: 0x01FD0 + "\x00\x0e\xe4\x00`\x80\x1f\xd1" + // 0x003B9 0x00304: 0x01FD1 + "\x00\x0f(\x00`\x00\x1f\xd2" + // 0x003CA 0x00300: 0x01FD2 + "\x00\x0e\xe4\x00h@\x1f\xd6" + // 0x003B9 0x00342: 0x01FD6 + "\x00\x0f(\x00h@\x1f\xd7" + // 0x003CA 0x00342: 0x01FD7 + "\x00\x0ed\x00`\xc0\x1f\xd8" + // 0x00399 0x00306: 0x01FD8 + "\x00\x0ed\x00`\x80\x1f\xd9" + // 0x00399 0x00304: 0x01FD9 + "\x00\x0ed\x00`\x00\x1f\xda" + // 0x00399 0x00300: 0x01FDA + "\x00\x7f\xf8\x00`\x00\x1f\xdd" + // 0x01FFE 0x00300: 0x01FDD + "\x00\x7f\xf8\x00` \x1f\xde" + // 0x01FFE 0x00301: 0x01FDE + "\x00\x7f\xf8\x00h@\x1f\xdf" + // 0x01FFE 0x00342: 0x01FDF + "\x00\x0f\x14\x00`\xc0\x1f\xe0" + // 0x003C5 0x00306: 0x01FE0 + "\x00\x0f\x14\x00`\x80\x1f\xe1" + // 0x003C5 0x00304: 0x01FE1 + "\x00\x0f,\x00`\x00\x1f\xe2" + // 0x003CB 0x00300: 0x01FE2 + "\x00\x0f\x04\x00b`\x1f\xe4" + // 0x003C1 0x00313: 0x01FE4 + "\x00\x0f\x04\x00b\x80\x1f\xe5" + // 0x003C1 0x00314: 0x01FE5 + "\x00\x0f\x14\x00h@\x1f\xe6" + // 0x003C5 0x00342: 0x01FE6 + "\x00\x0f,\x00h@\x1f\xe7" + // 0x003CB 0x00342: 0x01FE7 + "\x00\x0e\x94\x00`\xc0\x1f\xe8" + // 0x003A5 0x00306: 0x01FE8 + "\x00\x0e\x94\x00`\x80\x1f\xe9" + // 0x003A5 0x00304: 0x01FE9 + "\x00\x0e\x94\x00`\x00\x1f\xea" + // 0x003A5 0x00300: 0x01FEA + "\x00\x0e\x84\x00b\x80\x1f\xec" + // 0x003A1 0x00314: 0x01FEC + "\x00\x02\xa0\x00`\x00\x1f\xed" + // 0x000A8 0x00300: 0x01FED + "\x00}\xf0\x00h\xa0\x1f\xf2" + // 0x01F7C 0x00345: 0x01FF2 + "\x00\x0f$\x00h\xa0\x1f\xf3" + // 0x003C9 0x00345: 0x01FF3 + "\x00\x0f8\x00h\xa0\x1f\xf4" + // 0x003CE 0x00345: 0x01FF4 + "\x00\x0f$\x00h@\x1f\xf6" + // 0x003C9 0x00342: 0x01FF6 + "\x00\x7f\xd8\x00h\xa0\x1f\xf7" + // 0x01FF6 0x00345: 0x01FF7 + "\x00\x0e|\x00`\x00\x1f\xf8" + // 0x0039F 0x00300: 0x01FF8 + "\x00\x0e\xa4\x00`\x00\x1f\xfa" + // 0x003A9 0x00300: 0x01FFA + "\x00\x0e\xa4\x00h\xa0\x1f\xfc" + // 0x003A9 0x00345: 0x01FFC + "\x00\x86@\x00g\x00!\x9a" + // 0x02190 0x00338: 0x0219A + "\x00\x86H\x00g\x00!\x9b" + // 0x02192 0x00338: 0x0219B + "\x00\x86P\x00g\x00!\xae" + // 0x02194 0x00338: 0x021AE + "\x00\x87@\x00g\x00!\xcd" + // 0x021D0 0x00338: 0x021CD + "\x00\x87P\x00g\x00!\xce" + // 0x021D4 0x00338: 0x021CE + "\x00\x87H\x00g\x00!\xcf" + // 0x021D2 0x00338: 0x021CF + "\x00\x88\f\x00g\x00\"\x04" + // 0x02203 0x00338: 0x02204 + "\x00\x88 \x00g\x00\"\t" + // 0x02208 0x00338: 0x02209 + "\x00\x88,\x00g\x00\"\f" + // 0x0220B 0x00338: 0x0220C + "\x00\x88\x8c\x00g\x00\"$" + // 0x02223 0x00338: 0x02224 + "\x00\x88\x94\x00g\x00\"&" + // 0x02225 0x00338: 0x02226 + "\x00\x88\xf0\x00g\x00\"A" + // 0x0223C 0x00338: 0x02241 + "\x00\x89\f\x00g\x00\"D" + // 0x02243 0x00338: 0x02244 + "\x00\x89\x14\x00g\x00\"G" + // 0x02245 0x00338: 0x02247 + "\x00\x89 \x00g\x00\"I" + // 0x02248 0x00338: 0x02249 + "\x00\x00\xf4\x00g\x00\"`" + // 0x0003D 0x00338: 0x02260 + "\x00\x89\x84\x00g\x00\"b" + // 0x02261 0x00338: 0x02262 + "\x00\x894\x00g\x00\"m" + // 0x0224D 0x00338: 0x0226D + "\x00\x00\xf0\x00g\x00\"n" + // 0x0003C 0x00338: 0x0226E + "\x00\x00\xf8\x00g\x00\"o" + // 0x0003E 0x00338: 0x0226F + "\x00\x89\x90\x00g\x00\"p" + // 0x02264 0x00338: 0x02270 + "\x00\x89\x94\x00g\x00\"q" + // 0x02265 0x00338: 0x02271 + "\x00\x89\xc8\x00g\x00\"t" + // 0x02272 0x00338: 0x02274 + "\x00\x89\xcc\x00g\x00\"u" + // 0x02273 0x00338: 0x02275 + "\x00\x89\xd8\x00g\x00\"x" + // 0x02276 0x00338: 0x02278 + "\x00\x89\xdc\x00g\x00\"y" + // 0x02277 0x00338: 0x02279 + "\x00\x89\xe8\x00g\x00\"\x80" + // 0x0227A 0x00338: 0x02280 + "\x00\x89\xec\x00g\x00\"\x81" + // 0x0227B 0x00338: 0x02281 + "\x00\x8a\b\x00g\x00\"\x84" + // 0x02282 0x00338: 0x02284 + "\x00\x8a\f\x00g\x00\"\x85" + // 0x02283 0x00338: 0x02285 + "\x00\x8a\x18\x00g\x00\"\x88" + // 0x02286 0x00338: 0x02288 + "\x00\x8a\x1c\x00g\x00\"\x89" + // 0x02287 0x00338: 0x02289 + "\x00\x8a\x88\x00g\x00\"\xac" + // 0x022A2 0x00338: 0x022AC + "\x00\x8a\xa0\x00g\x00\"\xad" + // 0x022A8 0x00338: 0x022AD + "\x00\x8a\xa4\x00g\x00\"\xae" + // 0x022A9 0x00338: 0x022AE + "\x00\x8a\xac\x00g\x00\"\xaf" + // 0x022AB 0x00338: 0x022AF + "\x00\x89\xf0\x00g\x00\"\xe0" + // 0x0227C 0x00338: 0x022E0 + "\x00\x89\xf4\x00g\x00\"\xe1" + // 0x0227D 0x00338: 0x022E1 + "\x00\x8aD\x00g\x00\"\xe2" + // 0x02291 0x00338: 0x022E2 + "\x00\x8aH\x00g\x00\"\xe3" + // 0x02292 0x00338: 0x022E3 + "\x00\x8a\xc8\x00g\x00\"\xea" + // 0x022B2 0x00338: 0x022EA + "\x00\x8a\xcc\x00g\x00\"\xeb" + // 0x022B3 0x00338: 0x022EB + "\x00\x8a\xd0\x00g\x00\"\xec" + // 0x022B4 0x00338: 0x022EC + "\x00\x8a\xd4\x00g\x00\"\xed" + // 0x022B5 0x00338: 0x022ED + "\x00\xc1,\x06\x13 0L" + // 0x0304B 0x03099: 0x0304C + "\x00\xc14\x06\x13 0N" + // 0x0304D 0x03099: 0x0304E + "\x00\xc1<\x06\x13 0P" + // 0x0304F 0x03099: 0x03050 + "\x00\xc1D\x06\x13 0R" + // 0x03051 0x03099: 0x03052 + "\x00\xc1L\x06\x13 0T" + // 0x03053 0x03099: 0x03054 + "\x00\xc1T\x06\x13 0V" + // 0x03055 0x03099: 0x03056 + "\x00\xc1\\\x06\x13 0X" + // 0x03057 0x03099: 0x03058 + "\x00\xc1d\x06\x13 0Z" + // 0x03059 0x03099: 0x0305A + "\x00\xc1l\x06\x13 0\\" + // 0x0305B 0x03099: 0x0305C + "\x00\xc1t\x06\x13 0^" + // 0x0305D 0x03099: 0x0305E + "\x00\xc1|\x06\x13 0`" + // 0x0305F 0x03099: 0x03060 + "\x00\xc1\x84\x06\x13 0b" + // 0x03061 0x03099: 0x03062 + "\x00\xc1\x90\x06\x13 0e" + // 0x03064 0x03099: 0x03065 + "\x00\xc1\x98\x06\x13 0g" + // 0x03066 0x03099: 0x03067 + "\x00\xc1\xa0\x06\x13 0i" + // 0x03068 0x03099: 0x03069 + "\x00\xc1\xbc\x06\x13 0p" + // 0x0306F 0x03099: 0x03070 + "\x00\xc1\xbc\x06\x13@0q" + // 0x0306F 0x0309A: 0x03071 + "\x00\xc1\xc8\x06\x13 0s" + // 0x03072 0x03099: 0x03073 + "\x00\xc1\xc8\x06\x13@0t" + // 0x03072 0x0309A: 0x03074 + "\x00\xc1\xd4\x06\x13 0v" + // 0x03075 0x03099: 0x03076 + "\x00\xc1\xd4\x06\x13@0w" + // 0x03075 0x0309A: 0x03077 + "\x00\xc1\xe0\x06\x13 0y" + // 0x03078 0x03099: 0x03079 + "\x00\xc1\xe0\x06\x13@0z" + // 0x03078 0x0309A: 0x0307A + "\x00\xc1\xec\x06\x13 0|" + // 0x0307B 0x03099: 0x0307C + "\x00\xc1\xec\x06\x13@0}" + // 0x0307B 0x0309A: 0x0307D + "\x00\xc1\x18\x06\x13 0\x94" + // 0x03046 0x03099: 0x03094 + "\x00\xc2t\x06\x13 0\x9e" + // 0x0309D 0x03099: 0x0309E + "\x00¬\x06\x13 0\xac" + // 0x030AB 0x03099: 0x030AC + "\x00´\x06\x13 0\xae" + // 0x030AD 0x03099: 0x030AE + "\x00¼\x06\x13 0\xb0" + // 0x030AF 0x03099: 0x030B0 + "\x00\xc2\xc4\x06\x13 0\xb2" + // 0x030B1 0x03099: 0x030B2 + "\x00\xc2\xcc\x06\x13 0\xb4" + // 0x030B3 0x03099: 0x030B4 + "\x00\xc2\xd4\x06\x13 0\xb6" + // 0x030B5 0x03099: 0x030B6 + "\x00\xc2\xdc\x06\x13 0\xb8" + // 0x030B7 0x03099: 0x030B8 + "\x00\xc2\xe4\x06\x13 0\xba" + // 0x030B9 0x03099: 0x030BA + "\x00\xc2\xec\x06\x13 0\xbc" + // 0x030BB 0x03099: 0x030BC + "\x00\xc2\xf4\x06\x13 0\xbe" + // 0x030BD 0x03099: 0x030BE + "\x00\xc2\xfc\x06\x13 0\xc0" + // 0x030BF 0x03099: 0x030C0 + "\x00\xc3\x04\x06\x13 0\xc2" + // 0x030C1 0x03099: 0x030C2 + "\x00\xc3\x10\x06\x13 0\xc5" + // 0x030C4 0x03099: 0x030C5 + "\x00\xc3\x18\x06\x13 0\xc7" + // 0x030C6 0x03099: 0x030C7 + "\x00\xc3 \x06\x13 0\xc9" + // 0x030C8 0x03099: 0x030C9 + "\x00\xc3<\x06\x13 0\xd0" + // 0x030CF 0x03099: 0x030D0 + "\x00\xc3<\x06\x13@0\xd1" + // 0x030CF 0x0309A: 0x030D1 + "\x00\xc3H\x06\x13 0\xd3" + // 0x030D2 0x03099: 0x030D3 + "\x00\xc3H\x06\x13@0\xd4" + // 0x030D2 0x0309A: 0x030D4 + "\x00\xc3T\x06\x13 0\xd6" + // 0x030D5 0x03099: 0x030D6 + "\x00\xc3T\x06\x13@0\xd7" + // 0x030D5 0x0309A: 0x030D7 + "\x00\xc3`\x06\x13 0\xd9" + // 0x030D8 0x03099: 0x030D9 + "\x00\xc3`\x06\x13@0\xda" + // 0x030D8 0x0309A: 0x030DA + "\x00\xc3l\x06\x13 0\xdc" + // 0x030DB 0x03099: 0x030DC + "\x00\xc3l\x06\x13@0\xdd" + // 0x030DB 0x0309A: 0x030DD + "\x00\u0098\x06\x13 0\xf4" + // 0x030A6 0x03099: 0x030F4 + "\x00ü\x06\x13 0\xf7" + // 0x030EF 0x03099: 0x030F7 + "\x00\xc3\xc0\x06\x13 0\xf8" + // 0x030F0 0x03099: 0x030F8 + "\x00\xc3\xc4\x06\x13 0\xf9" + // 0x030F1 0x03099: 0x030F9 + "\x00\xc3\xc8\x06\x13 0\xfa" + // 0x030F2 0x03099: 0x030FA + "\x00\xc3\xf4\x06\x13 0\xfe" + // 0x030FD 0x03099: 0x030FE + "\x04\x17H\x00`\xe1\x05\xc9" + // 0x105D2 0x00307: 0x105C9 + "\x04\x17h\x00`\xe1\x05\xe4" + // 0x105DA 0x00307: 0x105E4 + "\x04Bd\"\x17A\x10\x9a" + // 0x11099 0x110BA: 0x1109A + "\x04Bl\"\x17A\x10\x9c" + // 0x1109B 0x110BA: 0x1109C + "\x04B\x94\"\x17A\x10\xab" + // 0x110A5 0x110BA: 0x110AB + "\x04D\xc4\"$\xe1\x11." + // 0x11131 0x11127: 0x1112E + "\x04D\xc8\"$\xe1\x11/" + // 0x11132 0x11127: 0x1112F + "\x04M\x1c\"g\xc1\x13K" + // 0x11347 0x1133E: 0x1134B + "\x04M\x1c\"j\xe1\x13L" + // 0x11347 0x11357: 0x1134C + "\x04N\b\"y!\x13\x83" + // 0x11382 0x113C9: 0x11383 + "\x04N\x10\"wa\x13\x85" + // 0x11384 0x113BB: 0x11385 + "\x04N,\"xA\x13\x8e" + // 0x1138B 0x113C2: 0x1138E + "\x04N@\"y!\x13\x91" + // 0x11390 0x113C9: 0x11391 + "\x04O\b\"xA\x13\xc5" + // 0x113C2 0x113C2: 0x113C5 + "\x04O\b\"w\x01\x13\xc7" + // 0x113C2 0x113B8: 0x113C7 + "\x04O\b\"y!\x13\xc8" + // 0x113C2 0x113C9: 0x113C8 + "\x04R\xe4\"\x97A\x14\xbb" + // 0x114B9 0x114BA: 0x114BB + "\x04R\xe4\"\x96\x01\x14\xbc" + // 0x114B9 0x114B0: 0x114BC + "\x04R\xe4\"\x97\xa1\x14\xbe" + // 0x114B9 0x114BD: 0x114BE + "\x04V\xe0\"\xb5\xe1\x15\xba" + // 0x115B8 0x115AF: 0x115BA + "\x04V\xe4\"\xb5\xe1\x15\xbb" + // 0x115B9 0x115AF: 0x115BB + "\x04d\xd4#&\x01\x198" + // 0x11935 0x11930: 0x11938 + "\x05\x84x,#\xc1a!" + // 0x1611E 0x1611E: 0x16121 + "\x05\x84x,%!a\"" + // 0x1611E 0x16129: 0x16122 + "\x05\x84x,#\xe1a#" + // 0x1611E 0x1611F: 0x16123 + "\x05\x84\xa4,#\xe1a$" + // 0x16129 0x1611F: 0x16124 + "\x05\x84x,$\x01a%" + // 0x1611E 0x16120: 0x16125 + "\x05\x84\x84,#\xe1a&" + // 0x16121 0x1611F: 0x16126 + "\x05\x84\x88,#\xe1a'" + // 0x16122 0x1611F: 0x16127 + "\x05\x84\x84,$\x01a(" + // 0x16121 0x16120: 0x16128 + "\x05\xb5\x9c-\xac\xe1mh" + // 0x16D67 0x16D67: 0x16D68 + "\x05\xb5\x8c-\xac\xe1mi" + // 0x16D63 0x16D67: 0x16D69 + "\x05\xb5\xa4-\xac\xe1mj" + // 0x16D69 0x16D67: 0x16D6A "" // Total size of tables: 57KB (58086 bytes) diff --git a/vendor/golang.org/x/text/unicode/norm/transform.go b/vendor/golang.org/x/text/unicode/norm/transform.go index a1d366ae487..583230d4dfa 100644 --- a/vendor/golang.org/x/text/unicode/norm/transform.go +++ b/vendor/golang.org/x/text/unicode/norm/transform.go @@ -33,7 +33,7 @@ func (f Form) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) return nDst + n, nSrc + n, err } - if err == nil && n < len(src) && !atEOF { + if err == nil && n < len(src) { err = transform.ErrShortSrc } return n, n, err @@ -67,6 +67,7 @@ func (f Form) transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) nSrc = end // Next quickSpan. + var err error end = rb.nsrc eof := atEOF if n := nSrc + len(dst) - nDst; n < end { @@ -79,7 +80,7 @@ func (f Form) transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) nSrc += n nDst += n if ok { - if err == nil && n < rb.nsrc && !atEOF { + if err == nil && nSrc < rb.nsrc { err = transform.ErrShortSrc } return nDst, nSrc, err diff --git a/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go b/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go index 018b4bce3c5..163bc755df9 100644 --- a/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go +++ b/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go @@ -18,27 +18,25 @@ // If you need a standalone tool, use multichecker, // which supports this mode but can also load packages // from source using go/packages. +// +// This tool must be run on the entire transitive closure of +// dependencies, in bottom-up order. package unitchecker -// TODO(adonovan): -// - with gccgo, go build does not build standard library, -// so we will not get to analyze it. Yet we must in order -// to create base facts for, say, the fmt package for the -// printf checker. - import ( "archive/zip" + "bytes" + "encoding/binary" "encoding/gob" "encoding/json" "flag" "fmt" "go/ast" "go/build" - "go/importer" "go/parser" + "go/scanner" "go/token" "go/types" - "io" "log" "os" "path/filepath" @@ -48,10 +46,12 @@ import ( "sync" "time" + "golang.org/x/sync/errgroup" "golang.org/x/tools/go/analysis" "golang.org/x/tools/go/analysis/internal/analysisflags" "golang.org/x/tools/internal/analysis/driverutil" "golang.org/x/tools/internal/facts" + "golang.org/x/tools/internal/gcimporter" ) // A Config describes a compilation unit to be analyzed. @@ -59,7 +59,7 @@ import ( // whose name ends with ".cfg". type Config struct { ID string // e.g. "fmt [fmt.test]" - Compiler string // gc or gccgo, provided to makeTypesImporter + Compiler string // (unused) Dir string // (unused) ImportPath string // package path GoVersion string // minimum required Go version, such as "go1.21.0" @@ -70,14 +70,14 @@ type Config struct { ModuleVersion string // Deprecated: redundant w.r.t. Module.Version in go1.27; remove after go1.28. Module *analysis.Module // module information, if any ImportMap map[string]string // maps import path to package path - PackageFile map[string]string // maps package path to file of type information + PackageFile map[string]string // (unused) Standard map[string]bool // package belongs to standard library PackageVetx map[string]string // maps package path to file of fact information VetxOnly bool // run analysis only for facts, not diagnostics VetxOutput string // where to write file of fact information Stdout string // write stdout (e.g. JSON, unified diff) to this file FixArchive string // write fixed files to this zip archive, if non-empty - SucceedOnTypecheckFailure bool // obsolete awful hack; see #18395 and below + SucceedOnTypecheckFailure bool // (unused) } // Main is the main function of a vet-like analysis tool that must be @@ -149,6 +149,16 @@ func Run(configFile string, analyzers []*analysis.Analyzer) { fset := token.NewFileSet() results, err := run(fset, cfg, analyzers) if err != nil { + if cfg.VetxOnly { + os.Exit(1) + } + // Print known diagnostic error types without the log prefix. + // (See go.dev/issue/34142.) + switch err := err.(type) { + case types.Error, *scanner.Error, scanner.ErrorList: + fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } log.Fatal(err) } @@ -272,74 +282,46 @@ func processResults(fset *token.FileSet, id, fixArchive string, results []result return } -type factImporter = func(pkgPath string) ([]byte, error) - -// These four hook variables are a proof of concept of a future -// parameterization of a unitchecker API that allows the client to -// determine how and where facts and types are produced and consumed. -// (Note that the eventual API will likely be quite different.) -// -// The defaults honor a Config in a manner compatible with 'go vet'. -var ( - makeTypesImporter = func(cfg *Config, fset *token.FileSet) types.Importer { - compilerImporter := importer.ForCompiler(fset, cfg.Compiler, func(path string) (io.ReadCloser, error) { - // path is a resolved package path, not an import path. - file, ok := cfg.PackageFile[path] - if !ok { - if cfg.Compiler == "gccgo" && cfg.Standard[path] { - return nil, nil // fall back to default gccgo lookup - } - return nil, fmt.Errorf("no package file for %q", path) - } - return os.Open(file) - }) - return importerFunc(func(importPath string) (*types.Package, error) { - path, ok := cfg.ImportMap[importPath] // resolve vendoring, etc - if !ok { - return nil, fmt.Errorf("can't resolve import %q", importPath) - } - return compilerImporter.Import(path) - }) - } - - exportTypes = func(*Config, *token.FileSet, *types.Package) error { - // By default this is a no-op, because "go vet" - // makes the compiler produce type information. - return nil - } - - makeFactImporter = func(cfg *Config) factImporter { - return func(pkgPath string) ([]byte, error) { - if vetx, ok := cfg.PackageVetx[pkgPath]; ok { - return os.ReadFile(vetx) - } - return nil, nil // no .vetx file, no facts - } - } - - exportFacts = func(cfg *Config, data []byte) error { - return os.WriteFile(cfg.VetxOutput, data, 0666) - } -) - func run(fset *token.FileSet, cfg *Config, analyzers []*analysis.Analyzer) ([]result, error) { // Load, parse, typecheck. var files []*ast.File for _, name := range cfg.GoFiles { f, err := parser.ParseFile(fset, name, nil, parser.ParseComments) if err != nil { - if cfg.SucceedOnTypecheckFailure { - // Silently succeed; let the compiler - // report parse errors. - err = nil - } return nil, err } files = append(files, f) } + + // Read all direct imports' vetx files (for types and facts). + vetxEntries, err := readVetxFiles(cfg.PackageVetx) + if err != nil { + return nil, err + } + + // Construct the type importer. + imports := make(map[string]*types.Package) + importer := importerFunc(func(importPath string) (*types.Package, error) { + path, ok := cfg.ImportMap[importPath] // resolve vendoring, etc + if !ok { + return nil, fmt.Errorf("can't resolve import %q", importPath) + } + if path == "unsafe" { + return types.Unsafe, nil + } + if pkg, ok := imports[path]; ok && pkg.Complete() { + return pkg, nil + } + entry, ok := vetxEntries[path] + if !ok { + return nil, fmt.Errorf("no package vetx file for %q", path) + } + return gcimporter.IImportData(fset, imports, entry.types, path) + }) + tc := &types.Config{ - Importer: makeTypesImporter(cfg, fset), - Sizes: types.SizesFor("gc", build.Default.GOARCH), // TODO(adonovan): use cfg.Compiler + Importer: importer, + Sizes: types.SizesFor("gc", build.Default.GOARCH), GoVersion: cfg.GoVersion, } info := &types.Info{ @@ -355,11 +337,6 @@ func run(fset *token.FileSet, cfg *Config, analyzers []*analysis.Analyzer) ([]re pkg, err := tc.Check(cfg.ImportPath, fset, files, info) if err != nil { - if cfg.SucceedOnTypecheckFailure { - // Silently succeed; let the compiler - // report type errors. - err = nil - } return nil, err } @@ -408,8 +385,20 @@ func run(fset *token.FileSet, cfg *Config, analyzers []*analysis.Analyzer) ([]re } analyzers = filtered + readFacts := func(pkgPath string) ([]byte, error) { + entry, ok := vetxEntries[pkgPath] + if !ok { + // no .vetx file, no facts + if pkgPath == "unsafe" { + return nil, nil + } + return nil, fmt.Errorf("missing facts for %q", pkgPath) + } + return entry.facts, nil + } + // Read facts from imported packages. - facts, err := facts.NewDecoder(pkg).Decode(makeFactImporter(cfg)) + facts, err := facts.NewDecoder(pkg).Decode(readFacts) if err != nil { return nil, err } @@ -527,12 +516,11 @@ func run(fset *token.FileSet, cfg *Config, analyzers []*analysis.Analyzer) ([]re results[i] = result{pkg, files, a, act.diagnostics, act.err} } - data := facts.Encode() - if err := exportFacts(cfg, data); err != nil { - return nil, fmt.Errorf("failed to export analysis facts: %v", err) - } - if err := exportTypes(cfg, fset, pkg); err != nil { - return nil, fmt.Errorf("failed to export type information: %v", err) + // Export types and facts. + if cfg.VetxOutput != "" { + if err := writeVetxFile(fset, pkg, cfg.VetxOutput, facts); err != nil { + return nil, fmt.Errorf("type+fact export failed: %v", err) + } } return results, nil @@ -549,3 +537,80 @@ type result struct { type importerFunc func(path string) (*types.Package, error) func (f importerFunc) Import(path string) (*types.Package, error) { return f(path) } + +// -- vetx file -- + +const vetxMagic = "vetx" + +type vetxEntry struct { + types, facts []byte +} + +func readVetxFiles(packageVetx map[string]string) (map[string]*vetxEntry, error) { + var ( + entriesMu sync.Mutex + entries = make(map[string]*vetxEntry, len(packageVetx)) + g errgroup.Group + ) + for pkgPath, file := range packageVetx { + g.Go(func() error { + entry, err := readVetxFile(file) + if err != nil { + return fmt.Errorf("invalid vetx file for %q: %v", pkgPath, err) + } + entriesMu.Lock() + entries[pkgPath] = entry + entriesMu.Unlock() + + return nil + }) + } + err := g.Wait() + return entries, err +} + +func readVetxFile(filename string) (*vetxEntry, error) { + data, err := os.ReadFile(filename) + if err != nil { + return nil, err + } + if len(data) < 12 { + return nil, fmt.Errorf("vetx file %s too short", filename) + } + if magic := string(data[:4]); magic != vetxMagic { + return nil, fmt.Errorf("vetx files %s has bad magic: %04x", filename, magic) + } + typesLen := binary.LittleEndian.Uint32(data[4:8]) + factsLen := binary.LittleEndian.Uint32(data[8:12]) + if uint64(12)+uint64(typesLen)+uint64(factsLen) > uint64(len(data)) { + return nil, fmt.Errorf("invalid vetx file lengths (header claims 12+%d+%d bytes, got %d)", typesLen, factsLen, len(data)) + } + return &vetxEntry{ + types: data[12 : 12+typesLen], + facts: data[12+typesLen : 12+typesLen+factsLen], + }, nil +} + +func writeVetxFile(fset *token.FileSet, pkg *types.Package, filename string, facts *facts.Set) error { + var buf bytes.Buffer + buf.WriteString(vetxMagic) + buf.Write(make([]byte, 8)) // placeholder for (types, facts) length fields + + // types + startTypes := buf.Len() + if err := gcimporter.IExportData(&buf, fset, pkg); err != nil { + return err + } + typesLen := buf.Len() - startTypes + + // facts + factsData := facts.Encode() + buf.Write(factsData) + factsLen := len(factsData) + + // Patch the length fields and write it out. + data := buf.Bytes() + binary.LittleEndian.PutUint32(data[4:8], uint32(typesLen)) + binary.LittleEndian.PutUint32(data[8:12], uint32(factsLen)) + return os.WriteFile(filename, data, 0666) +} diff --git a/vendor/golang.org/x/tools/go/ast/astutil/imports.go b/vendor/golang.org/x/tools/go/ast/astutil/imports.go index adb47110190..6121bdd5f7e 100644 --- a/vendor/golang.org/x/tools/go/ast/astutil/imports.go +++ b/vendor/golang.org/x/tools/go/ast/astutil/imports.go @@ -9,7 +9,6 @@ import ( "fmt" "go/ast" "go/token" - "reflect" "slices" "strconv" "strings" @@ -473,15 +472,10 @@ func Imports(fset *token.FileSet, f *ast.File) [][]*ast.ImportSpec { } // updateBasicLitPos updates lit.Pos, -// ensuring that lit.End (if set) is displaced by the same amount. +// ensuring that lit.End is displaced by the same amount. // (See https://go.dev/issue/76395.) func updateBasicLitPos(lit *ast.BasicLit, pos token.Pos) { len := lit.End() - lit.Pos() lit.ValuePos = pos - // TODO(adonovan): after go1.26, simplify to: - // lit.ValueEnd = pos + len - v := reflect.ValueOf(lit).Elem().FieldByName("ValueEnd") - if v.IsValid() && v.Int() != 0 { - v.SetInt(int64(pos + len)) - } + lit.ValueEnd = pos + len } diff --git a/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go b/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go index 7b90bc92353..e6159d71253 100644 --- a/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go +++ b/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go @@ -2,63 +2,44 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Package gcexportdata provides functions for reading and writing -// export data, which is a serialized description of the API of a Go -// package including the names, kinds, types, and locations of all -// exported declarations. -// -// The standard Go compiler (cmd/compile) writes an export data file -// for each package it compiles, which it later reads when compiling -// packages that import the earlier one. The compiler must thus -// contain logic to both write and read export data. -// (See the "Export" section in the cmd/compile/README file.) -// -// The [Read] function in this package can read files produced by the -// compiler, producing [go/types] data structures. As a matter of -// policy, Read supports export data files produced by only the last -// two Go releases plus tip; see https://go.dev/issue/68898. The -// export data files produced by the compiler contain additional -// details related to generics, inlining, and other optimizations that -// cannot be decoded by the [Read] function. -// -// In files written by the compiler, the export data is not at the -// start of the file. Before calling Read, use [NewReader] to locate -// the desired portion of the file. -// -// The [Write] function in this package encodes the exported API of a -// Go package ([types.Package]) as a file. Such files can be later -// decoded by Read, but cannot be consumed by the compiler. -// -// # Future changes -// -// Although Read supports the formats written by both Write and the -// compiler, the two are quite different, and there is an open -// proposal (https://go.dev/issue/69491) to separate these APIs. -// -// Under that proposal, this package would ultimately provide only the -// Read operation for compiler export data, which must be defined in -// this module (golang.org/x/tools), not in the standard library, to -// avoid version skew for developer tools that need to read compiler -// export data both before and after a Go release, such as from Go -// 1.23 to Go 1.24. Because this package lives in the tools module, -// clients can update their version of the module some time before the -// Go 1.24 release and rebuild and redeploy their tools, which will -// then be able to consume both Go 1.23 and Go 1.24 export data files, -// so they will work before and after the Go update. (See discussion -// at https://go.dev/issue/15651.) -// -// The operations to import and export [go/types] data structures -// would be defined in the go/types package as Import and Export. -// [Write] would (eventually) delegate to Export, -// and [Read], when it detects a file produced by Export, -// would delegate to Import. +// Package gcexportdata provides functions for writing and reading +// export data, a serialized representation of a [types.Package]. +// It describes the API of a Go package, including the names, +// kinds, types, and locations of all exported declarations. +// +// Files may be written and read using the [Write] and [Read] +// functions. +// Alternatively, files may be produced by the "go list -export" command. +// This command runs the type checker on each specified Go package and +// writes export data for each package into a file named by the Export +// field of go list's -json output. +// The [Read] function may then be used to read those files. +// +// The export data format evolves with each Go release. As a matter of +// policy, [Read] supports reading files produced by only the last two +// Go releases plus tip; see https://go.dev/issue/68898. +// +// The name of this package reflects its origins at a time when +// cmd/compile was named gc, and [Read] parsed export data +// from .a archives produced by the Go compiler. +// However, starting with go1.28, the format of the files +// produced by "go list -export" will diverge from the format +// used by the standard Go compiler. +// Consequently, this package will eventually stop being +// capable of reading those files. +// In the meantime, when using [Read] on a .a file written by the +// compiler, be aware that export data is not at the start of the file. +// Before calling Read, one must use [NewReader] to locate the export +// data section of the file. +// For more information on the compiler's export data, see the +// "Export" section in the GOROOT/src/cmd/compile/README file. // // # Deprecations // -// The [NewImporter] and [Find] functions are deprecated and should -// not be used in new code. The [WriteBundle] and [ReadBundle] -// functions are experimental, and there is an open proposal to -// deprecate them (https://go.dev/issue/69573). +// The [NewImporter], [Find], and [NewReader] functions are deprecated +// and should not be used in new code. +// The [WriteBundle] and [ReadBundle] functions are experimental, and +// there is an open proposal to deprecate them (https://go.dev/issue/69573). package gcexportdata import ( @@ -104,6 +85,9 @@ func Find(importPath, srcDir string) (filename, path string) { // NewReader returns a reader for the export data section of an object // (.o) or archive (.a) file read from r. The new reader may provide // additional trailing data beyond the end of the export data. +// +// Deprecated: This package will stop supporting the reading of export +// data from compiler-produced archive files in Go 1.29. func NewReader(r io.Reader) (io.Reader, error) { buf := bufio.NewReader(r) size, err := gcimporter.FindExportData(buf) @@ -176,16 +160,7 @@ func Read(in io.Reader, fset *token.FileSet, imports map[string]*types.Package, case 'i': // indexed, produced by cmd/compile till go1.19, // and also by [Write]. - // - // If proposal #69491 is accepted, go/types - // serialization will be implemented by - // types.Export, to which Write would eventually - // delegate (explicitly dropping any pretence at - // inter-version Write-Read compatibility). - // This [Read] function would delegate to types.Import - // when it detects that the file was produced by Export. - _, pkg, err := gcimporter.IImportData(fset, imports, data[1:], path) - return pkg, err + return gcimporter.IImportData(fset, imports, data[1:], path) case 'u': // unified, produced by cmd/compile since go1.20 diff --git a/vendor/golang.org/x/tools/internal/gcimporter/iexport.go b/vendor/golang.org/x/tools/internal/gcimporter/iexport.go index 686f171d3bd..1dc51b7f947 100644 --- a/vendor/golang.org/x/tools/internal/gcimporter/iexport.go +++ b/vendor/golang.org/x/tools/internal/gcimporter/iexport.go @@ -712,7 +712,7 @@ func (p *iexporter) doDecl(obj types.Object) { w.typ(obj.Type(), obj.Pkg()) case *types.Func: - sig, _ := obj.Type().(*types.Signature) + sig := obj.Type().(*types.Signature) if sig.Recv() != nil { // We shouldn't see methods in the package scope, // but the type checker may repair "func () F() {}" @@ -745,7 +745,7 @@ func (p *iexporter) doDecl(obj types.Object) { case *types.Const: w.tag(constTag) w.pos(obj.Pos()) - w.value(obj.Type(), obj.Val()) + w.value(obj.Type(), obj.Val(), obj.Pkg()) case *types.TypeName: t := obj.Type() @@ -822,7 +822,7 @@ func (p *iexporter) doDecl(obj types.Object) { m := named.Method(i) w.pos(m.Pos()) w.string(m.Name()) - sig, _ := m.Type().(*types.Signature) + sig := m.Type().(*types.Signature) if w.p.version >= iexportVersionGenericMethods && w.bool(sig.TypeParams().Len() > 0) { w.tparamList(obj.Name()+"."+m.Name(), sig.TypeParams(), obj.Pkg()) } @@ -970,9 +970,11 @@ func (w *exportWriter) qualifiedType(obj *types.TypeName) { // typ emits the specified type. // // Objects within the type (struct fields and interface methods) are -// qualified by pkg. It may be nil if the type cannot contain objects, -// such as the type of a constant. +// qualified by pkg. func (w *exportWriter) typ(t types.Type, pkg *types.Package) { + if pkg == nil { + pkg = w.p.localpkg + } w.data.uint64(w.p.typOff(t, pkg)) } @@ -1148,7 +1150,7 @@ func (w *exportWriter) doTyp(t types.Type, pkg *types.Package) { } w.pos(m.Pos()) w.string(m.Name()) - sig, _ := m.Type().(*types.Signature) + sig := m.Type().(*types.Signature) w.signature(sig) } @@ -1295,8 +1297,12 @@ func (w *exportWriter) param(obj types.Object) { w.typ(obj.Type(), obj.Pkg()) } -func (w *exportWriter) value(typ types.Type, v constant.Value) { - w.typ(typ, nil) +// only called for constants +func (w *exportWriter) value(typ types.Type, v constant.Value, pkg *types.Package) { + if pkg == nil { + pkg = w.p.localpkg + } + w.typ(typ, pkg) if w.p.version >= iexportVersionGo1_18 { w.int64(int64(v.Kind())) } diff --git a/vendor/golang.org/x/tools/internal/gcimporter/iimport.go b/vendor/golang.org/x/tools/internal/gcimporter/iimport.go index 7b1723e0fc7..06f07bc3b0e 100644 --- a/vendor/golang.org/x/tools/internal/gcimporter/iimport.go +++ b/vendor/golang.org/x/tools/internal/gcimporter/iimport.go @@ -30,14 +30,6 @@ type intReader struct { path string } -func (r *intReader) int64() int64 { - i, err := binary.ReadVarint(r.Reader) - if err != nil { - errorf("import %q: read varint error: %v", r.path, err) - } - return i -} - func (r *intReader) uint64() uint64 { i, err := binary.ReadUvarint(r.Reader) if err != nil { @@ -101,12 +93,12 @@ const ( // and returns 0 and a reference to the package. // If the export data version is not recognized or the format is otherwise // compromised, an error is returned. -func IImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (int, *types.Package, error) { +func IImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (*types.Package, error) { pkgs, err := iimportCommon(fset, GetPackagesFromMap(imports), data, false, path, false, nil) if err != nil { - return 0, nil, err + return nil, err } - return 0, pkgs[0], nil + return pkgs[0], nil } // IImportBundle imports a set of packages from the serialized package bundle. diff --git a/vendor/golang.org/x/tools/internal/gcimporter/ureader.go b/vendor/golang.org/x/tools/internal/gcimporter/ureader.go index 5d3b7c867a3..3c258c2e85b 100644 --- a/vendor/golang.org/x/tools/internal/gcimporter/ureader.go +++ b/vendor/golang.org/x/tools/internal/gcimporter/ureader.go @@ -629,11 +629,26 @@ func (pr *pkgReader) objIdx(idx pkgbits.Index) (*types.Package, string) { }) } - for i, n := 0, r.Len(); i < n; i++ { - named.AddMethod(r.method()) - } - if r.Version().Has(pkgbits.GenericMethods) { + // V4 (go1.27.0) emitted all non-generic methods + // before all generic ones, discarding source + // order: a bug (go.dev/issue/81188). + // V5 (go1.27.x) fixes it by emitting an explicit + // index along with each method. + type indexedMethod struct { + index int // (or -1 in V4) + fn *types.Func + } + + var methods []indexedMethod + + // ordinary methods + for range r.Len() { + idx, m := r.method() + methods = append(methods, indexedMethod{idx, m}) + } + + // generic methods for range r.Len() { // Careful: objIdx is used to read in package-scoped declarations, which // methods are not. Instead, decode it here. This makes it easier to @@ -648,11 +663,31 @@ func (pr *pkgReader) objIdx(idx pkgbits.Index) (*types.Package, string) { pkg, name := r.selector() rtparams := r.typeParamNames(true) recv := r.param() + methodIdx := -1 + if r.Version().Has(pkgbits.PreserveMethodOrder) { + methodIdx = r.Len() + } tparams := r.typeParamNames(false) sig := r.signature(recv, rtparams, tparams) pr.retireReader(r) - named.AddMethod(types.NewFunc(pos, pkg, name, sig)) + methods = append(methods, indexedMethod{methodIdx, types.NewFunc(pos, pkg, name, sig)}) + } + + if r.Version().Has(pkgbits.PreserveMethodOrder) { + sort.Slice(methods, func(i, j int) bool { + return methods[i].index < methods[j].index + }) + } + + for _, m := range methods { + named.AddMethod(m.fn) + } + + } else { + for range r.Len() { + _, m := r.method() + named.AddMethod(m) } } @@ -766,8 +801,12 @@ func (r *reader) typeParamNames(isGenMeth bool) []*types.TypeParam { return tparams } -func (r *reader) method() *types.Func { +func (r *reader) method() (int, *types.Func) { r.Sync(pkgbits.SyncMethod) + idx := -1 + if r.Version().Has(pkgbits.PreserveMethodOrder) { + idx = r.Len() + } pos := r.pos() pkg, name := r.selector() @@ -775,7 +814,7 @@ func (r *reader) method() *types.Func { sig := r.signature(r.param(), rparams, nil) _ = r.pos() // TODO(mdempsky): Remove; this is a hacker for linker.go. - return types.NewFunc(pos, pkg, name, sig) + return idx, types.NewFunc(pos, pkg, name, sig) } func (r *reader) qualifiedIdent() (*types.Package, string) { return r.ident(pkgbits.SyncSym) } diff --git a/vendor/golang.org/x/tools/internal/pkgbits/version.go b/vendor/golang.org/x/tools/internal/pkgbits/version.go index 0db96527480..684b471753d 100644 --- a/vendor/golang.org/x/tools/internal/pkgbits/version.go +++ b/vendor/golang.org/x/tools/internal/pkgbits/version.go @@ -37,6 +37,10 @@ const ( // V4: encodes generic methods as standalone function objects V4 + // V5: encodes the index of methods to preserve relative order + // of nongeneric and generic methods (go.dev/issue/81188). + V5 + numVersions = iota ) @@ -76,6 +80,10 @@ const ( // Generic methods may appear as standalone function objects. GenericMethods + // Method index is encoded to preserve relative order of + // nongeneric and generic methods. + PreserveMethodOrder + numFields = iota ) @@ -85,6 +93,7 @@ var introduced = [numFields]Version{ AliasTypeParamNames: V2, CompactCompLiterals: V3, GenericMethods: V4, + PreserveMethodOrder: V5, } // removed is the version a field was removed in or 0 for fields diff --git a/vendor/golang.org/x/tools/internal/stdlib/deps.go b/vendor/golang.org/x/tools/internal/stdlib/deps.go index b049e5f9775..abd3c8754b4 100644 --- a/vendor/golang.org/x/tools/internal/stdlib/deps.go +++ b/vendor/golang.org/x/tools/internal/stdlib/deps.go @@ -44,7 +44,7 @@ var deps = [...]pkginfo{ {"crypto/internal/boring/bcache", "\xcf\x02\x14"}, {"crypto/internal/boring/sig", ""}, {"crypto/internal/constanttime", ""}, - {"crypto/internal/cryptotest", "\x03\r\v\n%\x11\x1a\r\x12\x12!\x04\x06\n\x19\x01\x11\x11\x1d\x01\a\x03\x02\b\x02\x01\x05\f"}, + {"crypto/internal/cryptotest", "\x03\r\v\n%\x11\x1a\r\x12\x12!\x04\x06\n\x19\x01\x11\x11\x1d\x01\a\x03\x02\b\x02\x01\x04\x01\f"}, {"crypto/internal/cryptotest/wycheproof", "\x0e\x12T\x01\f\x01r@\x05\x03\x15\x10"}, {"crypto/internal/cryptotest/x509limbo", "u\n\x03\xba\x01\x03\x1e"}, {"crypto/internal/entropy", "M"}, @@ -122,7 +122,7 @@ var deps = [...]pkginfo{ {"embed/internal/embedtest", ""}, {"encoding", ""}, {"encoding/ascii85", "\x86\x02E"}, - {"encoding/asn1", "\x03|\x03h(\x01)\r\x02\x01\x11\x03\x01"}, + {"encoding/asn1", "\x03|\x03h(\x01)\x05\b\x02\x01\x11\x03\x01"}, {"encoding/base32", "\x86\x02C\x02"}, {"encoding/base64", "\xaa\x01\\C\x02"}, {"encoding/binary", "\x7f\x87\x01\f*\r\x05"}, @@ -319,7 +319,7 @@ var deps = [...]pkginfo{ {"net/rpc/jsonrpc", "u\n\x03\x84\x01\x16\x13\x1f"}, {"net/smtp", "\x196\r\x14\x0f\x03\x84\x01\x16\x16\x1a"}, {"net/textproto", "\x02\x01|\x03\x84\x01\f\n/\x01\x02\x15"}, - {"net/url", "\x7f\x03Ff\v\x10\x02\x01\x17"}, + {"net/url", "\x03|\x03Ff\v\x10\x02\x01\x17"}, {"os", "\x7f*\x01\x19\x04\x11\x14\x01\x03\x01\x05\x10\x01:\b\x05\x01\x01\r\x06"}, {"os/exec", "\x03\nrI(\x01\x15\x01-\x06\a\n\x01\x03\x01\r"}, {"os/exec/internal/fdtest", "\xd0\x02"}, diff --git a/vendor/golang.org/x/tools/internal/typesinternal/types.go b/vendor/golang.org/x/tools/internal/typesinternal/types.go index 9fd48b088f8..3e4c7c3bd66 100644 --- a/vendor/golang.org/x/tools/internal/typesinternal/types.go +++ b/vendor/golang.org/x/tools/internal/typesinternal/types.go @@ -271,6 +271,8 @@ func ImplicitFieldSelections(seln types.Selection) iter.Seq2[*types.Var, bool] { } } +// TupleOf returns a tuple type with the specified list of (unnamed) +// var types. Neither the zero nor one cases are special. func TupleOf(elems ...types.Type) *types.Tuple { params := make([]*types.Var, len(elems)) for i, elem := range elems { diff --git a/vendor/google.golang.org/api/iamcredentials/v1/iamcredentials-api.json b/vendor/google.golang.org/api/iamcredentials/v1/iamcredentials-api.json index 3694e4aebb3..b3b17530c03 100644 --- a/vendor/google.golang.org/api/iamcredentials/v1/iamcredentials-api.json +++ b/vendor/google.golang.org/api/iamcredentials/v1/iamcredentials-api.json @@ -267,7 +267,7 @@ ], "parameters": { "name": { - "description": "Required. Resource name of service account.", + "description": "Required. Resource name of service account. Format: `projects/-/serviceAccounts/{service_account_email}`", "location": "path", "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", "required": true, @@ -340,7 +340,7 @@ } } }, - "revision": "20251022", + "revision": "20260604", "rootUrl": "https://iamcredentials.googleapis.com/", "schemas": { "GenerateAccessTokenRequest": { diff --git a/vendor/google.golang.org/api/iamcredentials/v1/iamcredentials-gen.go b/vendor/google.golang.org/api/iamcredentials/v1/iamcredentials-gen.go index e9885ea2a40..acee41c9005 100644 --- a/vendor/google.golang.org/api/iamcredentials/v1/iamcredentials-gen.go +++ b/vendor/google.golang.org/api/iamcredentials/v1/iamcredentials-gen.go @@ -1046,7 +1046,8 @@ type ProjectsServiceAccountsGetAllowedLocationsCall struct { // GetAllowedLocations: Returns the trust boundary info for a given service // account. // -// - name: Resource name of service account. +// - name: Resource name of service account. Format: +// `projects/-/serviceAccounts/{service_account_email}`. func (r *ProjectsServiceAccountsService) GetAllowedLocations(name string) *ProjectsServiceAccountsGetAllowedLocationsCall { c := &ProjectsServiceAccountsGetAllowedLocationsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name diff --git a/vendor/google.golang.org/api/internal/gensupport/media.go b/vendor/google.golang.org/api/internal/gensupport/media.go index ec3bf1baec7..4aa05f905df 100644 --- a/vendor/google.golang.org/api/internal/gensupport/media.go +++ b/vendor/google.golang.org/api/internal/gensupport/media.go @@ -198,6 +198,22 @@ func (mi *MediaInfo) UploadType() string { return "resumable" } +// ChecksumEnabled returns if auto checksum is enabled in buffer. +func (mi *MediaInfo) ChecksumEnabled() bool { + return mi.buffer != nil && mi.buffer.enableAutoChecksum +} + +// GetAutoChecksum returns the computed auto checksum from buffer (if enabled). +// Make sure whole data is written and read from the buffer before calling this +// function to get correct checksum of the data. +func (mi *MediaInfo) GetAutoChecksum() string { + if mi.buffer != nil && + mi.buffer.enableAutoChecksum { + return encodeUint32(mi.buffer.fullObjectChecksum) + } + return "" +} + // UploadRequest sets up an HTTP request for media upload. It adds headers // as necessary, and returns a replacement for the body and a function for http.Request.GetBody. func (mi *MediaInfo) UploadRequest(reqHeaders http.Header, body io.Reader) (newBody io.Reader, getBody func() (io.ReadCloser, error), cleanup func()) { diff --git a/vendor/google.golang.org/api/internal/gensupport/send.go b/vendor/google.golang.org/api/internal/gensupport/send.go index 1c91f147abe..86b9ac0e1f3 100644 --- a/vendor/google.golang.org/api/internal/gensupport/send.go +++ b/vendor/google.golang.org/api/internal/gensupport/send.go @@ -40,36 +40,50 @@ func (e wrappedCallErr) Is(target error) bool { return errors.Is(e.ctxErr, target) || errors.Is(e.wrappedErr, target) } +// addContextHeaders adds headers set in context metadata. +// x-goog-api-client and x-goog-request-params are merged properly. +func addContextHeaders(ctx context.Context, req *http.Request) { + if ctx == nil { + return + } + headers := callctx.HeadersFromContext(ctx) + for k, vals := range headers { + if strings.EqualFold(k, "x-goog-api-client") { + mergeHeader(req.Header, k, vals, ' ') + } else if strings.EqualFold(k, "x-goog-request-params") { + mergeHeader(req.Header, k, vals, '&') + } else { + for _, v := range vals { + req.Header.Add(k, v) + } + } + } +} + +// mergeHeader merges multiple values into a single header. +func mergeHeader(header http.Header, key string, vals []string, separator rune) { + var mergedVal strings.Builder + baseHeader := header.Get(key) + if baseHeader != "" { + mergedVal.WriteString(baseHeader) + mergedVal.WriteRune(separator) + } + for _, v := range vals { + mergedVal.WriteString(v) + mergedVal.WriteRune(separator) + } + if mergedVal.Len() > 0 { + // Remove the last separator and replace the header on the request. + header.Set(key, mergedVal.String()[:mergedVal.Len()-1]) + } +} + // SendRequest sends a single HTTP request using the given client. // If ctx is non-nil, it calls all hooks, then sends the request with // req.WithContext, then calls any functions returned by the hooks in // reverse order. func SendRequest(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) { - // Add headers set in context metadata. - if ctx != nil { - headers := callctx.HeadersFromContext(ctx) - for k, vals := range headers { - if k == "x-goog-api-client" { - // Merge all values into a single "x-goog-api-client" header. - var mergedVal strings.Builder - baseXGoogHeader := req.Header.Get("X-Goog-Api-Client") - if baseXGoogHeader != "" { - mergedVal.WriteString(baseXGoogHeader) - mergedVal.WriteRune(' ') - } - for _, v := range vals { - mergedVal.WriteString(v) - mergedVal.WriteRune(' ') - } - // Remove the last space and replace the header on the request. - req.Header.Set(k, mergedVal.String()[:mergedVal.Len()-1]) - } else { - for _, v := range vals { - req.Header.Add(k, v) - } - } - } - } + addContextHeaders(ctx, req) // Disallow Accept-Encoding because it interferes with the automatic gzip handling // done by the default http.Transport. See https://github.com/google/google-api-go-client/issues/219. @@ -105,15 +119,7 @@ func send(ctx context.Context, client *http.Client, req *http.Request) (*http.Re // req.WithContext, then calls any functions returned by the hooks in // reverse order. func SendRequestWithRetry(ctx context.Context, client *http.Client, req *http.Request, retry *RetryConfig) (*http.Response, error) { - // Add headers set in context metadata. - if ctx != nil { - headers := callctx.HeadersFromContext(ctx) - for k, vals := range headers { - for _, v := range vals { - req.Header.Add(k, v) - } - } - } + addContextHeaders(ctx, req) // Disallow Accept-Encoding because it interferes with the automatic gzip handling // done by the default http.Transport. See https://github.com/google/google-api-go-client/issues/219. diff --git a/vendor/google.golang.org/api/internal/version.go b/vendor/google.golang.org/api/internal/version.go index 277a76fa7f9..5babd63645f 100644 --- a/vendor/google.golang.org/api/internal/version.go +++ b/vendor/google.golang.org/api/internal/version.go @@ -5,4 +5,4 @@ package internal // Version is the current tagged release of the library. -const Version = "0.264.0" +const Version = "0.287.0" diff --git a/vendor/google.golang.org/api/option/internaloption/unsaferesolver.go b/vendor/google.golang.org/api/option/internaloption/unsaferesolver.go new file mode 100644 index 00000000000..51a98c5a87b --- /dev/null +++ b/vendor/google.golang.org/api/option/internaloption/unsaferesolver.go @@ -0,0 +1,106 @@ +// Copyright 2026 Google LLC. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package internaloption + +import ( + "google.golang.org/api/internal" + "google.golang.org/api/option" +) + +// UnsafeResolver provides a mechanism for introspecting values passed through +// during client instantiations, which are defined as functional options. It +// is by its nature not meant for general use, as it requires understanding of +// internal implementations. It is intended for use solely by internal Google +// client code, and provides no stability contract. +// +// This is an EXPERIMENTAL API and may be changed or removed in the future. +type UnsafeResolver struct { + ds *internal.DialSettings +} + +// NewUnsafeResolver instantiates a new ClientOption resolver. It is intended +// for user solely by internal Google client code. See the corresponding +// UnsafeResolver type for more details. +// +// This is an EXPERIMENTAL API and may be changed or removed in the future. +func NewUnsafeResolver(opts ...option.ClientOption) (*UnsafeResolver, error) { + ds := new(internal.DialSettings) + for _, o := range opts { + o.Apply(ds) + } + return &UnsafeResolver{ + ds: ds, + }, nil +} + +// ResolvedWithAPIKeyIsCustom returns whether the option to supply an API key was +// populate. This corresponds to the WithAPIKey ClientOption in +// google.golang.org/option. +// +// This is an EXPERIMENTAL API and may be changed or removed in the future. +func (ur *UnsafeResolver) ResolvedWithAPIKeyIsCustom() bool { + return ur.ds.APIKey != "" +} + +// ResolvedGRPCConnPoolSize provides the passed in value correspnding to the +// WithGRPCConnectionPool option in google.golang.org/option. +// +// This is an EXPERIMENTAL API and may be changed or removed in the future. +func (ur *UnsafeResolver) ResolvedGRPCConnPoolSize() int { + return ur.ds.GRPCConnPoolSize +} + +// ResolvedGRPCEndpoint returns the resolved endpoint address used for +// establishing gRPC connections. +// +// This is an EXPERIMENTAL API and may be changed or removed in the future. +func (ur *UnsafeResolver) ResolvedGRPCEndpoint() (string, error) { + _, addr, err := internal.GetGRPCTransportConfigAndEndpoint(ur.ds) + return addr, err +} + +// ResolvedGRPCConnIsCustom exposes whether the provided options included +// directives for providing a customized transport, corresponding to the +// WithGRPCConn option. +// +// This is an EXPERIMENTAL API and may be changed or removed in the future. +func (ur *UnsafeResolver) ResolvedGRPCConnIsCustom() bool { + return ur.ds.GRPCConn != nil +} + +// ResolvedHTTPClientIsCustom returns whether the option to supply an API key was +// populate. This corresponds to the WithHTTPClient ClientOption in +// google.golang.org/option. +// +// This is an EXPERIMENTAL API and may be changed or removed in the future. +func (ur *UnsafeResolver) ResolvedHTTPClientIsCustom() bool { + return ur.ds.HTTPClient != nil +} + +// ResolvedEnableDirectPath returns whether DirectPath was explicitly enabled. +// This corresponds to the EnableDirectPath option in this package. +// +// This is an EXPERIMENTAL API and may be changed or removed in the future. +func (ur *UnsafeResolver) ResolvedEnableDirectPath() bool { + return ur.ds.EnableDirectPath +} + +// ResolvedEnableDirectPathXds returns whether extensible directory service (xDS) +// support was requested as part of direct path enablement. This corresponds to the +// EnableDirectPathXds option in this package. +// +// This is an EXPERIMENTAL API and may be changed or removed in the future. +func (ur *UnsafeResolver) ResolvedEnableDirectPathXds() bool { + return ur.ds.EnableDirectPathXds +} + +// ResolvedWithoutAuthentication returns whether the option to explicitly disable +// authentication was requested. This corresponds to the WithoutAuthentication +// ClientOption in google.golang.org/option. +// +// This is an EXPERIMENTAL API and may be changed or removed in the future. +func (ur *UnsafeResolver) ResolvedWithoutAuthentication() bool { + return ur.ds.NoAuth +} diff --git a/vendor/google.golang.org/api/storage/v1/storage-api.json b/vendor/google.golang.org/api/storage/v1/storage-api.json index d12c35e6e51..e3761497454 100644 --- a/vendor/google.golang.org/api/storage/v1/storage-api.json +++ b/vendor/google.golang.org/api/storage/v1/storage-api.json @@ -253,7 +253,7 @@ "location": "northamerica-south1" } ], - "etag": "\"38343338383939303739323735363535323137\"", + "etag": "\"3137393330363130333534383930343731333832\"", "icons": { "x16": "https://www.google.com/images/icons/product/cloud_storage-16.png", "x32": "https://www.google.com/images/icons/product/cloud_storage-32.png" @@ -521,7 +521,7 @@ ] }, "update": { - "description": "Updates the config(ttl and admissionPolicy) of an Anywhere Cache instance.", + "description": "Updates the config of an Anywhere Cache instance.", "httpMethod": "PATCH", "id": "storage.anywhereCaches.update", "parameterOrder": [ @@ -1784,6 +1784,50 @@ "https://www.googleapis.com/auth/devstorage.read_write" ] }, + "deleteRecursive": { + "description": "Deletes a folder recursively. Only applicable to buckets with hierarchical namespace enabled.", + "httpMethod": "POST", + "id": "storage.folders.deleteRecursive", + "parameterOrder": [ + "bucket", + "folder" + ], + "parameters": { + "bucket": { + "description": "Name of the bucket in which the folder resides.", + "location": "path", + "required": true, + "type": "string" + }, + "folder": { + "description": "Name of a folder.", + "location": "path", + "required": true, + "type": "string" + }, + "ifMetagenerationMatch": { + "description": "If set, only deletes the folder if its metageneration matches this value.", + "format": "int64", + "location": "query", + "type": "string" + }, + "ifMetagenerationNotMatch": { + "description": "If set, only deletes the folder if its metageneration does not match this value.", + "format": "int64", + "location": "query", + "type": "string" + } + }, + "path": "b/{bucket}/folders/{folder}/deleteRecursive", + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, "get": { "description": "Returns metadata for the specified folder. Only applicable to buckets with hierarchical namespace enabled.", "httpMethod": "GET", @@ -2779,6 +2823,12 @@ "location": "query", "type": "string" }, + "dropContextGroups": { + "description": "Specifies which groups of Object Contexts from the source object(s) should be dropped from the destination object.", + "location": "query", + "repeated": true, + "type": "string" + }, "ifGenerationMatch": { "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", "format": "int64", @@ -3749,6 +3799,12 @@ "location": "query", "type": "string" }, + "dropContextGroups": { + "description": "Specifies which groups of Object Contexts from the source object should be dropped from the destination object.", + "location": "query", + "repeated": true, + "type": "string" + }, "ifGenerationMatch": { "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", "format": "int64", @@ -4064,99 +4120,6 @@ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/devstorage.full_control" ] - }, - "watchAll": { - "description": "Watch for changes on all objects in a bucket.", - "httpMethod": "POST", - "id": "storage.objects.watchAll", - "parameterOrder": [ - "bucket" - ], - "parameters": { - "bucket": { - "description": "Name of the bucket in which to look for objects.", - "location": "path", - "required": true, - "type": "string" - }, - "delimiter": { - "description": "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.", - "location": "query", - "type": "string" - }, - "endOffset": { - "description": "Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", - "location": "query", - "type": "string" - }, - "includeTrailingDelimiter": { - "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.", - "location": "query", - "type": "boolean" - }, - "maxResults": { - "default": "1000", - "description": "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.", - "format": "uint32", - "location": "query", - "minimum": "0", - "type": "integer" - }, - "pageToken": { - "description": "A previously-returned page token representing part of the larger set of results to view.", - "location": "query", - "type": "string" - }, - "prefix": { - "description": "Filter results to objects whose names begin with this prefix.", - "location": "query", - "type": "string" - }, - "projection": { - "description": "Set of properties to return. Defaults to noAcl.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit the owner, acl property." - ], - "location": "query", - "type": "string" - }, - "startOffset": { - "description": "Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - }, - "versions": { - "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see [Object Versioning](https://cloud.google.com/storage/docs/object-versioning).", - "location": "query", - "type": "boolean" - } - }, - "path": "b/{bucket}/o/watch", - "request": { - "$ref": "Channel", - "parameterName": "resource" - }, - "response": { - "$ref": "Channel" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ], - "supportsSubscription": true } } }, @@ -4549,7 +4512,7 @@ } } }, - "revision": "20260111", + "revision": "20260625", "rootUrl": "https://storage.googleapis.com/", "schemas": { "AdvanceRelocateBucketOperationRequest": { @@ -4594,6 +4557,10 @@ "description": "The ID of the resource, including the project number, bucket name and anywhere cache ID.", "type": "string" }, + "ingestOnWrite": { + "description": "Specifies whether objects are ingested into the cache upon write.", + "type": "boolean" + }, "kind": { "default": "storage#anywhereCache", "description": "The kind of item this is. For Anywhere Cache, this is always storage#anywhereCache.", @@ -5058,6 +5025,16 @@ "description": "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.", "format": "int32", "type": "integer" + }, + "sizeAboveBytes": { + "description": "Objects having a size greater than this value in bytes will be matched.", + "format": "int64", + "type": "string" + }, + "sizeBelowBytes": { + "description": "Objects having a size less than this value in bytes will be matched.", + "format": "int64", + "type": "string" } }, "type": "object" diff --git a/vendor/google.golang.org/api/storage/v1/storage-gen.go b/vendor/google.golang.org/api/storage/v1/storage-gen.go index e53d630967a..632149c51e6 100644 --- a/vendor/google.golang.org/api/storage/v1/storage-gen.go +++ b/vendor/google.golang.org/api/storage/v1/storage-gen.go @@ -384,6 +384,9 @@ type AnywhereCache struct { // Id: The ID of the resource, including the project number, bucket name and // anywhere cache ID. Id string `json:"id,omitempty"` + // IngestOnWrite: Specifies whether objects are ingested into the cache upon + // write. + IngestOnWrite bool `json:"ingestOnWrite,omitempty"` // Kind: The kind of item this is. For Anywhere Cache, this is always // storage#anywhereCache. Kind string `json:"kind,omitempty"` @@ -1192,6 +1195,12 @@ type BucketLifecycleRuleCondition struct { // this condition is satisfied when there are at least N versions (including // the live version) newer than this version of the object. NumNewerVersions int64 `json:"numNewerVersions,omitempty"` + // SizeAboveBytes: Objects having a size greater than this value in bytes will + // be matched. + SizeAboveBytes int64 `json:"sizeAboveBytes,omitempty,string"` + // SizeBelowBytes: Objects having a size less than this value in bytes will be + // matched. + SizeBelowBytes int64 `json:"sizeBelowBytes,omitempty,string"` // ForceSendFields is a list of field names (e.g. "Age") to unconditionally // include in API requests. By default, fields with empty or default values are // omitted from API requests. See @@ -1709,9 +1718,6 @@ type Channel struct { Token string `json:"token,omitempty"` // Type: The type of delivery mechanism used for this channel. Type string `json:"type,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the server. - googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "Address") to unconditionally // include in API requests. By default, fields with empty or default values are // omitted from API requests. See @@ -3726,8 +3732,7 @@ type AnywhereCachesUpdateCall struct { header_ http.Header } -// Update: Updates the config(ttl and admissionPolicy) of an Anywhere Cache -// instance. +// Update: Updates the config of an Anywhere Cache instance. // // - anywhereCacheId: The ID of requested Anywhere Cache instance. // - bucket: Name of the parent bucket. @@ -7173,6 +7178,124 @@ func (c *FoldersDeleteCall) Do(opts ...googleapi.CallOption) error { return nil } +type FoldersDeleteRecursiveCall struct { + s *Service + bucket string + folder string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// DeleteRecursive: Deletes a folder recursively. Only applicable to buckets +// with hierarchical namespace enabled. +// +// - bucket: Name of the bucket in which the folder resides. +// - folder: Name of a folder. +func (r *FoldersService) DeleteRecursive(bucket string, folder string) *FoldersDeleteRecursiveCall { + c := &FoldersDeleteRecursiveCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.bucket = bucket + c.folder = folder + return c +} + +// IfMetagenerationMatch sets the optional parameter "ifMetagenerationMatch": +// If set, only deletes the folder if its metageneration matches this value. +func (c *FoldersDeleteRecursiveCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *FoldersDeleteRecursiveCall { + c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) + return c +} + +// IfMetagenerationNotMatch sets the optional parameter +// "ifMetagenerationNotMatch": If set, only deletes the folder if its +// metageneration does not match this value. +func (c *FoldersDeleteRecursiveCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *FoldersDeleteRecursiveCall { + c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *FoldersDeleteRecursiveCall) Fields(s ...googleapi.Field) *FoldersDeleteRecursiveCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *FoldersDeleteRecursiveCall) Context(ctx context.Context) *FoldersDeleteRecursiveCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *FoldersDeleteRecursiveCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *FoldersDeleteRecursiveCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/folders/{folder}/deleteRecursive") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "folder": c.folder, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "storage.folders.deleteRecursive", "request", internallog.HTTPRequest(req, nil)) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "storage.folders.deleteRecursive" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FoldersDeleteRecursiveCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "storage.folders.deleteRecursive", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + type FoldersGetCall struct { s *Service bucket string @@ -9919,6 +10042,14 @@ func (c *ObjectsComposeCall) DestinationPredefinedAcl(destinationPredefinedAcl s return c } +// DropContextGroups sets the optional parameter "dropContextGroups": Specifies +// which groups of Object Contexts from the source object(s) should be dropped +// from the destination object. +func (c *ObjectsComposeCall) DropContextGroups(dropContextGroups ...string) *ObjectsComposeCall { + c.urlParams_.SetMulti("dropContextGroups", append([]string{}, dropContextGroups...)) + return c +} + // IfGenerationMatch sets the optional parameter "ifGenerationMatch": Makes the // operation conditional on whether the object's current generation matches the // given value. Setting to 0 makes the operation succeed only if there are no @@ -11000,6 +11131,14 @@ func (c *ObjectsInsertCall) Header() http.Header { func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + // Set auto checksum in case of a single chunk upload if enabled. + if c.object != nil && + c.object.Crc32c == "" && + c.mediaInfo_ != nil && + c.mediaInfo_.UploadType() == "multipart" && + c.mediaInfo_.ChecksumEnabled() { + c.object.Crc32c = c.mediaInfo_.GetAutoChecksum() + } body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.object) if err != nil { return nil, err @@ -12015,6 +12154,14 @@ func (c *ObjectsRewriteCall) DestinationPredefinedAcl(destinationPredefinedAcl s return c } +// DropContextGroups sets the optional parameter "dropContextGroups": Specifies +// which groups of Object Contexts from the source object should be dropped +// from the destination object. +func (c *ObjectsRewriteCall) DropContextGroups(dropContextGroups ...string) *ObjectsRewriteCall { + c.urlParams_.SetMulti("dropContextGroups", append([]string{}, dropContextGroups...)) + return c +} + // IfGenerationMatch sets the optional parameter "ifGenerationMatch": Makes the // operation conditional on whether the object's current generation matches the // given value. Setting to 0 makes the operation succeed only if there are no @@ -12689,197 +12836,6 @@ func (c *ObjectsUpdateCall) Do(opts ...googleapi.CallOption) (*Object, error) { return ret, nil } -type ObjectsWatchAllCall struct { - s *Service - bucket string - channel *Channel - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// WatchAll: Watch for changes on all objects in a bucket. -// -// - bucket: Name of the bucket in which to look for objects. -func (r *ObjectsService) WatchAll(bucket string, channel *Channel) *ObjectsWatchAllCall { - c := &ObjectsWatchAllCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.channel = channel - return c -} - -// Delimiter sets the optional parameter "delimiter": 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. -func (c *ObjectsWatchAllCall) Delimiter(delimiter string) *ObjectsWatchAllCall { - c.urlParams_.Set("delimiter", delimiter) - return c -} - -// EndOffset sets the optional parameter "endOffset": Filter results to objects -// whose names are lexicographically before endOffset. If startOffset is also -// set, the objects listed will have names between startOffset (inclusive) and -// endOffset (exclusive). -func (c *ObjectsWatchAllCall) EndOffset(endOffset string) *ObjectsWatchAllCall { - c.urlParams_.Set("endOffset", endOffset) - return c -} - -// IncludeTrailingDelimiter sets the optional parameter -// "includeTrailingDelimiter": If true, objects that end in exactly one -// instance of delimiter will have their metadata included in items in addition -// to prefixes. -func (c *ObjectsWatchAllCall) IncludeTrailingDelimiter(includeTrailingDelimiter bool) *ObjectsWatchAllCall { - c.urlParams_.Set("includeTrailingDelimiter", fmt.Sprint(includeTrailingDelimiter)) - return c -} - -// MaxResults sets the optional parameter "maxResults": 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. -func (c *ObjectsWatchAllCall) MaxResults(maxResults int64) *ObjectsWatchAllCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// PageToken sets the optional parameter "pageToken": A previously-returned -// page token representing part of the larger set of results to view. -func (c *ObjectsWatchAllCall) PageToken(pageToken string) *ObjectsWatchAllCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// Prefix sets the optional parameter "prefix": Filter results to objects whose -// names begin with this prefix. -func (c *ObjectsWatchAllCall) Prefix(prefix string) *ObjectsWatchAllCall { - c.urlParams_.Set("prefix", prefix) - return c -} - -// Projection sets the optional parameter "projection": Set of properties to -// return. Defaults to noAcl. -// -// Possible values: -// -// "full" - Include all properties. -// "noAcl" - Omit the owner, acl property. -func (c *ObjectsWatchAllCall) Projection(projection string) *ObjectsWatchAllCall { - c.urlParams_.Set("projection", projection) - return c -} - -// StartOffset sets the optional parameter "startOffset": Filter results to -// objects whose names are lexicographically equal to or after startOffset. If -// endOffset is also set, the objects listed will have names between -// startOffset (inclusive) and endOffset (exclusive). -func (c *ObjectsWatchAllCall) StartOffset(startOffset string) *ObjectsWatchAllCall { - c.urlParams_.Set("startOffset", startOffset) - return c -} - -// UserProject sets the optional parameter "userProject": The project to be -// billed for this request. Required for Requester Pays buckets. -func (c *ObjectsWatchAllCall) UserProject(userProject string) *ObjectsWatchAllCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Versions sets the optional parameter "versions": If true, lists all versions -// of an object as distinct results. The default is false. For more -// information, see Object Versioning -// (https://cloud.google.com/storage/docs/object-versioning). -func (c *ObjectsWatchAllCall) Versions(versions bool) *ObjectsWatchAllCall { - c.urlParams_.Set("versions", fmt.Sprint(versions)) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *ObjectsWatchAllCall) Fields(s ...googleapi.Field) *ObjectsWatchAllCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *ObjectsWatchAllCall) Context(ctx context.Context) *ObjectsWatchAllCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *ObjectsWatchAllCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ObjectsWatchAllCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel) - if err != nil { - return nil, err - } - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/watch") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - }) - c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "storage.objects.watchAll", "request", internallog.HTTPRequest(req, body.Bytes())) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.objects.watchAll" call. -// Any non-2xx status code is an error. Response headers are in either -// *Channel.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *ObjectsWatchAllCall) Do(opts ...googleapi.CallOption) (*Channel, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &Channel{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - b, err := gensupport.DecodeResponseBytes(target, res) - if err != nil { - return nil, err - } - c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "storage.objects.watchAll", "response", internallog.HTTPResponse(res, b)) - return ret, nil -} - type OperationsAdvanceRelocateBucketCall struct { s *Service bucket string diff --git a/vendor/google.golang.org/genproto/googleapis/type/calendarperiod/calendar_period.pb.go b/vendor/google.golang.org/genproto/googleapis/type/calendarperiod/calendar_period.pb.go index 25617f09e75..5dce5bc396a 100644 --- a/vendor/google.golang.org/genproto/googleapis/type/calendarperiod/calendar_period.pb.go +++ b/vendor/google.golang.org/genproto/googleapis/type/calendarperiod/calendar_period.pb.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/google.golang.org/genproto/googleapis/type/date/date.pb.go b/vendor/google.golang.org/genproto/googleapis/type/date/date.pb.go index c9ffca9611b..fb3c7f257a7 100644 --- a/vendor/google.golang.org/genproto/googleapis/type/date/date.pb.go +++ b/vendor/google.golang.org/genproto/googleapis/type/date/date.pb.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,14 +40,17 @@ const ( // date is relative to the Gregorian Calendar. This can represent one of the // following: // -// * A full date, with non-zero year, month, and day values -// * A month and day value, with a zero year, such as an anniversary -// * A year on its own, with zero month and day values -// * A year and month value, with a zero day, such as a credit card expiration -// date +// - A full date, with non-zero year, month, and day values. +// - A month and day, with a zero year (for example, an anniversary). +// - A year on its own, with a zero month and a zero day. +// - A year and month, with a zero day (for example, a credit card expiration +// date). // -// Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and -// `google.protobuf.Timestamp`. +// Related types: +// +// * [google.type.TimeOfDay][google.type.TimeOfDay] +// * [google.type.DateTime][google.type.DateTime] +// * [google.protobuf.Timestamp][google.protobuf.Timestamp] type Date struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -127,13 +130,13 @@ var file_google_type_date_proto_rawDesc = []byte{ 0x04, 0x79, 0x65, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x79, 0x65, 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x61, 0x79, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x64, 0x61, 0x79, 0x42, 0x5d, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x64, 0x61, 0x79, 0x42, 0x5a, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x42, 0x09, 0x44, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, - 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3b, 0x64, 0x61, 0x74, 0x65, 0xf8, - 0x01, 0x01, 0xa2, 0x02, 0x03, 0x47, 0x54, 0x50, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3b, 0x64, 0x61, 0x74, 0x65, 0xa2, + 0x02, 0x03, 0x47, 0x54, 0x50, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/vendor/google.golang.org/genproto/googleapis/type/expr/expr.pb.go b/vendor/google.golang.org/genproto/googleapis/type/expr/expr.pb.go index dd2fb5fb41c..547b4e3b4a9 100644 --- a/vendor/google.golang.org/genproto/googleapis/type/expr/expr.pb.go +++ b/vendor/google.golang.org/genproto/googleapis/type/expr/expr.pb.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/google.golang.org/genproto/googleapis/type/timeofday/timeofday.pb.go b/vendor/google.golang.org/genproto/googleapis/type/timeofday/timeofday.pb.go index 5e8fdc571ae..a02316fe5f3 100644 --- a/vendor/google.golang.org/genproto/googleapis/type/timeofday/timeofday.pb.go +++ b/vendor/google.golang.org/genproto/googleapis/type/timeofday/timeofday.pb.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -44,15 +44,19 @@ type TimeOfDay struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Hours of day in 24 hour format. Should be from 0 to 23. An API may choose - // to allow the value "24:00:00" for scenarios like business closing time. + // Hours of a day in 24 hour format. Must be greater than or equal to 0 and + // typically must be less than or equal to 23. An API may choose to allow the + // value "24:00:00" for scenarios like business closing time. Hours int32 `protobuf:"varint,1,opt,name=hours,proto3" json:"hours,omitempty"` - // Minutes of hour of day. Must be from 0 to 59. + // Minutes of an hour. Must be greater than or equal to 0 and less than or + // equal to 59. Minutes int32 `protobuf:"varint,2,opt,name=minutes,proto3" json:"minutes,omitempty"` - // Seconds of minutes of the time. Must normally be from 0 to 59. An API may - // allow the value 60 if it allows leap-seconds. + // Seconds of a minute. Must be greater than or equal to 0 and typically must + // be less than or equal to 59. An API may allow the value 60 if it allows + // leap-seconds. Seconds int32 `protobuf:"varint,3,opt,name=seconds,proto3" json:"seconds,omitempty"` - // Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. + // Fractions of seconds, in nanoseconds. Must be greater than or equal to 0 + // and less than or equal to 999,999,999. Nanos int32 `protobuf:"varint,4,opt,name=nanos,proto3" json:"nanos,omitempty"` } @@ -128,14 +132,14 @@ var file_google_type_timeofday_proto_rawDesc = []byte{ 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x05, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x42, 0x6c, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x67, + 0x52, 0x05, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x42, 0x69, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x42, 0x0e, 0x54, 0x69, 0x6d, 0x65, 0x4f, 0x66, 0x44, 0x61, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x66, 0x64, - 0x61, 0x79, 0x3b, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x66, 0x64, 0x61, 0x79, 0xf8, 0x01, 0x01, 0xa2, - 0x02, 0x03, 0x47, 0x54, 0x50, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x79, 0x3b, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x66, 0x64, 0x61, 0x79, 0xa2, 0x02, 0x03, 0x47, + 0x54, 0x50, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/vendor/google.golang.org/grpc/balancer/endpointsharding/endpointsharding.go b/vendor/google.golang.org/grpc/balancer/endpointsharding/endpointsharding.go index 12479f69851..22dbc52287a 100644 --- a/vendor/google.golang.org/grpc/balancer/endpointsharding/endpointsharding.go +++ b/vendor/google.golang.org/grpc/balancer/endpointsharding/endpointsharding.go @@ -39,27 +39,14 @@ import ( var randIntN = rand.IntN -// ChildState is the balancer state of a child along with the endpoint which -// identifies the child balancer. +// ChildState is the state of a child balancer. type ChildState struct { - Endpoint resolver.Endpoint - State balancer.State - - // Balancer exposes only the ExitIdler interface of the child LB policy. - // Other methods of the child policy are called only by endpointsharding. - Balancer ExitIdler -} - -// ExitIdler provides access to only the ExitIdle method of the child balancer. -type ExitIdler interface { - // ExitIdle instructs the LB policy to reconnect to backends / exit the - // IDLE state, if appropriate and possible. Note that SubConns that enter - // the IDLE state will not reconnect until SubConn.Connect is called. - ExitIdle() + Endpoint resolver.Endpoint // Endpoint of the child balancer. + State balancer.State // State of the child balancer. + ExitIdle func() // Function to exit the child balancer from IDLE state. } -// Options are the options to configure the behaviour of the -// endpointsharding balancer. +// Options configure the behaviour of the endpointsharding balancer. type Options struct { // DisableAutoReconnect allows the balancer to keep child balancer in the // IDLE state until they are explicitly triggered to exit using the @@ -77,14 +64,13 @@ type ChildBuilderFunc func(cc balancer.ClientConn, opts balancer.BuildOptions) b // policies each owning a single endpoint. The endpointsharding balancer // forwards the LoadBalancingConfig in ClientConn state updates to its children. func NewBalancer(cc balancer.ClientConn, opts balancer.BuildOptions, childBuilder ChildBuilderFunc, esOpts Options) balancer.Balancer { - es := &endpointSharding{ + return &endpointSharding{ cc: cc, bOpts: opts, esOpts: esOpts, childBuilder: childBuilder, + endpoints: resolver.NewEndpointMap[*endpointState](), } - es.children.Store(resolver.NewEndpointMap[*balancerWrapper]()) - return es } // endpointSharding is a balancer that wraps child balancers. It creates a child @@ -96,124 +82,129 @@ type endpointSharding struct { esOpts Options childBuilder ChildBuilderFunc - // childMu synchronizes calls to any single child. It must be held for all - // calls into a child. To avoid deadlocks, do not acquire childMu while - // holding mu. - childMu sync.Mutex - children atomic.Pointer[resolver.EndpointMap[*balancerWrapper]] - - // inhibitChildUpdates is set during UpdateClientConnState/ResolverError - // calls (calls to children will each produce an update, only want one - // update). - inhibitChildUpdates atomic.Bool - - // mu synchronizes access to the state stored in balancerWrappers in the - // children field. mu must not be held during calls into a child since - // synchronous calls back from the child may require taking mu, causing a - // deadlock. To avoid deadlocks, do not acquire childMu while holding mu. - mu sync.Mutex + // mu guards access to the below fields and guarantees mutual exclusion + // between top-down methods (like UpdateClientConnState, ResolverError etc, + // which are already serialized) and bottom-up methods (like UpdateState) + // that can be called concurrently. + // + // Lock ordering & deadlock prevention: + // Child callbacks (like UpdateState) acquire this mutex to push state updates + // to the parent. This establishes a strict lock ordering: + // [endpointState.childMu] -> [endpointSharding.mu] + // + // To prevent deadlocks, we must never invert this order. Therefore, we must + // never call any methods on a child balancer while holding this mutex. If we + // did, and that child balancer invoked UpdateState synchronously, it would + // attempt to re-acquire this mutex, causing a deadlock. + // + // Concurrency: + // Top-down operations need to iterate over all children. To ensure a + // single, clean aggregated update at the end of such operations, we inhibit + // intermediate updates from children. We grab this mutex briefly to set + // `inhibitChildUpdates = true` and immediately release it. This allows us + // to perform the potentially slow, top-down child updates without holding + // any parent locks. Once finished, we grab the mutex again to unset the + // flag and push the final aggregated state. An update from a child during + // this time will *only* update the child state, and will not access the + // endpoints map or push an aggregated state to the parent. + mu sync.Mutex + endpoints *resolver.EndpointMap[*endpointState] + inhibitChildUpdates bool } // rotateEndpoints returns a slice of all the input endpoints rotated a random // amount. func rotateEndpoints(es []resolver.Endpoint) []resolver.Endpoint { - les := len(es) - if les == 0 { + n := len(es) + if n == 0 { return es } - r := randIntN(les) + r := randIntN(n) + // Make a copy to avoid mutating data beyond the end of es. - ret := make([]resolver.Endpoint, les) + ret := make([]resolver.Endpoint, n) copy(ret, es[r:]) - copy(ret[les-r:], es[:r]) + copy(ret[n-r:], es[:r]) return ret } // UpdateClientConnState creates a child for new endpoints and deletes children // for endpoints that are no longer present. It also updates all the children, // and sends a single synchronous update of the childrens' aggregated state at -// the end of the UpdateClientConnState operation. If any endpoint has no -// addresses it will ignore that endpoint. Otherwise, returns first error found -// from a child, but fully processes the new update. +// the end of the UpdateClientConnState operation. +// +// Returns the first error found from a child, but fully processes the update. func (es *endpointSharding) UpdateClientConnState(state balancer.ClientConnState) error { - es.childMu.Lock() - defer es.childMu.Unlock() - - es.inhibitChildUpdates.Store(true) - defer func() { - es.inhibitChildUpdates.Store(false) - es.updateState() - }() - var ret error - - children := es.children.Load() - newChildren := resolver.NewEndpointMap[*balancerWrapper]() + es.inhibitUpdatesFromChildren() - // Update/Create new children. + // Update/create child balancers for each endpoint in the update. Note that we + // don't hold the mutex here, but this is fine because inhibitChildUpdates is + // true, and therefore UpdateState will not access es.endpoints. + var retErr error + newEndpoints := resolver.NewEndpointMap[*endpointState]() for _, endpoint := range rotateEndpoints(state.ResolverState.Endpoints) { - if _, ok := newChildren.Get(endpoint); ok { - // Endpoint child was already created, continue to avoid duplicate - // update. + if _, ok := newEndpoints.Get(endpoint); ok { + // Skip duplicate endpoints. continue } - childBalancer, ok := children.Get(endpoint) + epState, ok := es.endpoints.Get(endpoint) if ok { - // Endpoint attributes may have changed, update the stored endpoint. - es.mu.Lock() - childBalancer.childState.Endpoint = endpoint - es.mu.Unlock() + // Endpoint child already exists, update the stored endpoint. + epState.endpoint = endpoint } else { - childBalancer = &balancerWrapper{ - childState: ChildState{Endpoint: endpoint}, - ClientConn: es.cc, - es: es, + // Endpoint child does not exist, create a new one. + epState = &endpointState{ + ClientConn: es.cc, + parent: es, + endpoint: endpoint, + disableAutoReconnect: es.esOpts.DisableAutoReconnect, } - childBalancer.childState.Balancer = childBalancer - childBalancer.child = es.childBuilder(childBalancer, es.bOpts) + epState.childLB = es.childBuilder(epState, es.bOpts) } - newChildren.Set(endpoint, childBalancer) - if err := childBalancer.updateClientConnStateLocked(balancer.ClientConnState{ + // Update the endpoint state for the endpoint. + newEndpoints.Set(endpoint, epState) + + if err := epState.updateClientConnState(balancer.ClientConnState{ BalancerConfig: state.BalancerConfig, ResolverState: resolver.State{ Endpoints: []resolver.Endpoint{endpoint}, Attributes: state.ResolverState.Attributes, }, - }); err != nil && ret == nil { - // Return first error found, and always commit full processing of - // updating children. If desired to process more specific errors - // across all endpoints, caller should make these specific - // validations, this is a current limitation for simplicity sake. - ret = err + }); err != nil && retErr == nil { + // Keep the first error found from any child. + retErr = err } } + // Delete old children that are no longer present. - for e, child := range children.All() { - if _, ok := newChildren.Get(e); !ok { - child.closeLocked() + for e, child := range es.endpoints.All() { + if _, ok := newEndpoints.Get(e); !ok { + child.close() } } - es.children.Store(newChildren) - if newChildren.Len() == 0 { - return balancer.ErrBadResolverState + + if newEndpoints.Len() == 0 { + retErr = balancer.ErrBadResolverState } - return ret + + es.mu.Lock() + es.endpoints = newEndpoints + es.inhibitChildUpdates = false + es.updateStateLocked() + es.mu.Unlock() + + return retErr } // ResolverError forwards the resolver error to all of the endpointSharding's // children and sends a single synchronous update of the childStates at the end // of the ResolverError operation. func (es *endpointSharding) ResolverError(err error) { - es.childMu.Lock() - defer es.childMu.Unlock() - es.inhibitChildUpdates.Store(true) - defer func() { - es.inhibitChildUpdates.Store(false) - es.updateState() - }() - children := es.children.Load() - for _, child := range children.All() { - child.resolverErrorLocked(err) + es.inhibitUpdatesFromChildren() + for _, child := range es.endpoints.All() { + child.resolverError(err) } + es.allowUpdatesFromChildren() } func (es *endpointSharding) UpdateSubConnState(balancer.SubConn, balancer.SubConnState) { @@ -221,41 +212,49 @@ func (es *endpointSharding) UpdateSubConnState(balancer.SubConn, balancer.SubCon } func (es *endpointSharding) Close() { - es.childMu.Lock() - defer es.childMu.Unlock() - children := es.children.Load() - for _, child := range children.All() { - child.closeLocked() + es.inhibitUpdatesFromChildren() + for _, child := range es.endpoints.All() { + child.close() } } func (es *endpointSharding) ExitIdle() { - es.childMu.Lock() - defer es.childMu.Unlock() - for _, bw := range es.children.Load().All() { - if !bw.isClosed { - bw.child.ExitIdle() - } + es.inhibitUpdatesFromChildren() + for _, child := range es.endpoints.All() { + child.exitIdle() } + es.allowUpdatesFromChildren() } -// updateState updates this component's state. It sends the aggregated state, -// and a picker with round robin behavior with all the child states present if -// needed. -func (es *endpointSharding) updateState() { - if es.inhibitChildUpdates.Load() { - return - } - var readyPickers, connectingPickers, idlePickers, transientFailurePickers []balancer.Picker +func (es *endpointSharding) inhibitUpdatesFromChildren() { + es.mu.Lock() + es.inhibitChildUpdates = true + es.mu.Unlock() +} +func (es *endpointSharding) allowUpdatesFromChildren() { es.mu.Lock() - defer es.mu.Unlock() + es.inhibitChildUpdates = false + es.updateStateLocked() + es.mu.Unlock() +} - children := es.children.Load() - childStates := make([]ChildState, 0, children.Len()) +// updateStateLocked updates this component's state. It sends the aggregated +// state, and a picker with round robin behavior with all the child states +// present if needed. This method must only be called when inhibitChildUpdates +// is false. +// +// Caller must hold es.mu. +func (es *endpointSharding) updateStateLocked() { + var readyPickers, connectingPickers, idlePickers, transientFailurePickers []balancer.Picker - for _, child := range children.All() { - childState := child.childState + childStates := make([]ChildState, 0, es.endpoints.Len()) + for _, epState := range es.endpoints.All() { + childState := ChildState{ + Endpoint: epState.endpoint, + State: epState.state, + ExitIdle: func() { go epState.exitIdle() }, + } childStates = append(childStates, childState) childPicker := childState.State.Picker switch childState.State.ConnectivityState { @@ -292,14 +291,14 @@ func (es *endpointSharding) updateState() { aggState = connectivity.TransientFailure pickers = []balancer.Picker{base.NewErrPicker(errors.New("no children to pick from"))} } // No children (resolver error before valid update). - p := &pickerWithChildStates{ - pickers: pickers, - childStates: childStates, - next: uint32(randIntN(len(pickers))), - } + es.cc.UpdateState(balancer.State{ ConnectivityState: aggState, - Picker: p, + Picker: &pickerWithChildStates{ + pickers: pickers, + childStates: childStates, + next: uint32(randIntN(len(pickers))), + }, }) } @@ -328,61 +327,59 @@ func ChildStatesFromPicker(picker balancer.Picker) []ChildState { return p.childStates } -// balancerWrapper is a wrapper of a balancer. It ID's a child balancer by -// endpoint, and persists recent child balancer state. -type balancerWrapper struct { - // The following fields are initialized at build time and read-only after - // that and therefore do not need to be guarded by a mutex. - - // child contains the wrapped balancer. Access its methods only through - // methods on balancerWrapper to ensure proper synchronization - child balancer.Balancer - balancer.ClientConn // embed to intercept UpdateState, doesn't deal with SubConns +// endpointState is the internal state maintained for each endpoint. +type endpointState struct { + balancer.ClientConn // Embedded to intercept UpdateState - es *endpointSharding + parent *endpointSharding // Parent endpointsharding balancer. + endpoint resolver.Endpoint // Endpoint of the child balancer. + state balancer.State // State of the child balancer. + disableAutoReconnect bool // Whether to disable auto reconnect for this child. - // Access to the following fields is guarded by es.mu. - - childState ChildState - isClosed bool + childMu sync.Mutex // Guarantees mutual exclusion for Balancer API calls to the child balancer. + childLB balancer.Balancer // Child balancer. + closed bool // Tracks closure of the child balancer to ensure ExitIdle is not called after Close(). } -func (bw *balancerWrapper) UpdateState(state balancer.State) { - bw.es.mu.Lock() - bw.childState.State = state - bw.es.mu.Unlock() - if state.ConnectivityState == connectivity.Idle && !bw.es.esOpts.DisableAutoReconnect { - bw.ExitIdle() +func (es *endpointState) UpdateState(state balancer.State) { + es.parent.mu.Lock() + es.state = state + if !es.parent.inhibitChildUpdates { + es.parent.updateStateLocked() + } + es.parent.mu.Unlock() + + if state.ConnectivityState == connectivity.Idle && !es.disableAutoReconnect { + go es.exitIdle() } - bw.es.updateState() } -// ExitIdle pings an IDLE child balancer to exit idle in a new goroutine to -// avoid deadlocks due to synchronous balancer state updates. -func (bw *balancerWrapper) ExitIdle() { - go func() { - bw.es.childMu.Lock() - if !bw.isClosed { - bw.child.ExitIdle() - } - bw.es.childMu.Unlock() - }() +func (es *endpointState) updateClientConnState(state balancer.ClientConnState) error { + es.childMu.Lock() + err := es.childLB.UpdateClientConnState(state) + es.childMu.Unlock() + return err } -// updateClientConnStateLocked delivers the ClientConnState to the child -// balancer. Callers must hold the child mutex of the parent endpointsharding -// balancer. -func (bw *balancerWrapper) updateClientConnStateLocked(ccs balancer.ClientConnState) error { - return bw.child.UpdateClientConnState(ccs) +func (es *endpointState) resolverError(err error) { + es.childMu.Lock() + es.childLB.ResolverError(err) + es.childMu.Unlock() } -// closeLocked closes the child balancer. Callers must hold the child mutext of -// the parent endpointsharding balancer. -func (bw *balancerWrapper) closeLocked() { - bw.child.Close() - bw.isClosed = true +func (es *endpointState) close() { + es.childMu.Lock() + if !es.closed { + es.closed = true + es.childLB.Close() + } + es.childMu.Unlock() } -func (bw *balancerWrapper) resolverErrorLocked(err error) { - bw.child.ResolverError(err) +func (es *endpointState) exitIdle() { + es.childMu.Lock() + if !es.closed { + es.childLB.ExitIdle() + } + es.childMu.Unlock() } diff --git a/vendor/google.golang.org/grpc/balancer/pickfirst/pickfirst.go b/vendor/google.golang.org/grpc/balancer/pickfirst/pickfirst.go index d48bc304c2b..ddd08f5373c 100644 --- a/vendor/google.golang.org/grpc/balancer/pickfirst/pickfirst.go +++ b/vendor/google.golang.org/grpc/balancer/pickfirst/pickfirst.go @@ -36,7 +36,6 @@ import ( "google.golang.org/grpc/balancer/pickfirst/internal" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/experimental/balancer/weight" - expstats "google.golang.org/grpc/experimental/stats" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/internal/envconfig" internalgrpclog "google.golang.org/grpc/internal/grpclog" @@ -56,30 +55,7 @@ const Name = "pick_first" // attributes to indicate whether the health listener usage is enabled. type enableHealthListenerKeyType struct{} -var ( - logger = grpclog.Component("pick-first-leaf-lb") - disconnectionsMetric = expstats.RegisterInt64Count(expstats.MetricDescriptor{ - Name: "grpc.lb.pick_first.disconnections", - Description: "EXPERIMENTAL. Number of times the selected subchannel becomes disconnected.", - Unit: "{disconnection}", - Labels: []string{"grpc.target"}, - Default: false, - }) - connectionAttemptsSucceededMetric = expstats.RegisterInt64Count(expstats.MetricDescriptor{ - Name: "grpc.lb.pick_first.connection_attempts_succeeded", - Description: "EXPERIMENTAL. Number of successful connection attempts.", - Unit: "{attempt}", - Labels: []string{"grpc.target"}, - Default: false, - }) - connectionAttemptsFailedMetric = expstats.RegisterInt64Count(expstats.MetricDescriptor{ - Name: "grpc.lb.pick_first.connection_attempts_failed", - Description: "EXPERIMENTAL. Number of failed connection attempts.", - Unit: "{attempt}", - Labels: []string{"grpc.target"}, - Default: false, - }) -) +var logger = grpclog.Component("pick-first-leaf-lb") const ( // TODO: change to pick-first when this becomes the default pick_first policy. @@ -101,11 +77,9 @@ const ( type pickfirstBuilder struct{} -func (pickfirstBuilder) Build(cc balancer.ClientConn, bo balancer.BuildOptions) balancer.Balancer { +func (pickfirstBuilder) Build(cc balancer.ClientConn, _ balancer.BuildOptions) balancer.Balancer { b := &pickfirstBalancer{ - cc: cc, - target: bo.Target.String(), - metricsRecorder: cc.MetricsRecorder(), + cc: cc, subConns: resolver.NewAddressMapV2[*scData](), state: connectivity.Connecting, @@ -185,10 +159,8 @@ func (b *pickfirstBalancer) newSCData(addr resolver.Address) (*scData, error) { type pickfirstBalancer struct { // The following fields are initialized at build time and read-only after // that and therefore do not need to be guarded by a mutex. - logger *internalgrpclog.PrefixLogger - cc balancer.ClientConn - target string - metricsRecorder expstats.MetricsRecorder // guaranteed to be non nil + logger *internalgrpclog.PrefixLogger + cc balancer.ClientConn // The mutex is used to ensure synchronization of updates triggered // from the idle picker and the already serialized resolver, @@ -633,14 +605,11 @@ func (b *pickfirstBalancer) updateSubConnState(sd *scData, newState balancer.Sub return } - // Record a connection attempt when exiting CONNECTING. if newState.ConnectivityState == connectivity.TransientFailure { sd.connectionFailedInFirstPass = true - connectionAttemptsFailedMetric.Record(b.metricsRecorder, 1, b.target) } if newState.ConnectivityState == connectivity.Ready { - connectionAttemptsSucceededMetric.Record(b.metricsRecorder, 1, b.target) b.shutdownRemainingLocked(sd) if !b.addressList.seekTo(sd.addr) { // This should not fail as we should have only one SubConn after @@ -689,15 +658,6 @@ func (b *pickfirstBalancer) updateSubConnState(sd *scData, newState balancer.Sub // the first address when the picker is used. b.shutdownRemainingLocked(sd) sd.effectiveState = newState.ConnectivityState - // READY SubConn interspliced in between CONNECTING and IDLE, need to - // account for that. - if oldState == connectivity.Connecting { - // A known issue (https://github.com/grpc/grpc-go/issues/7862) - // causes a race that prevents the READY state change notification. - // This works around it. - connectionAttemptsSucceededMetric.Record(b.metricsRecorder, 1, b.target) - } - disconnectionsMetric.Record(b.metricsRecorder, 1, b.target) b.addressList.reset() b.updateBalancerState(balancer.State{ ConnectivityState: connectivity.Idle, diff --git a/vendor/google.golang.org/grpc/balancer/ringhash/picker.go b/vendor/google.golang.org/grpc/balancer/ringhash/picker.go index 96f72905ec9..3f769170690 100644 --- a/vendor/google.golang.org/grpc/balancer/ringhash/picker.go +++ b/vendor/google.golang.org/grpc/balancer/ringhash/picker.go @@ -107,7 +107,7 @@ func (p *picker) Pick(info balancer.PickInfo) (balancer.PickResult, error) { // If the SubChannel is in idle state, initiate a connection but // continue to check other pickers to see if there is one in // ready state. - es.balancer.ExitIdle() + es.exitIdle() } } if requestedConnection { diff --git a/vendor/google.golang.org/grpc/balancer/ringhash/ringhash.go b/vendor/google.golang.org/grpc/balancer/ringhash/ringhash.go index 171cdd96477..384dedb3b05 100644 --- a/vendor/google.golang.org/grpc/balancer/ringhash/ringhash.go +++ b/vendor/google.golang.org/grpc/balancer/ringhash/ringhash.go @@ -142,10 +142,10 @@ func (b *ringhashBalancer) UpdateState(state balancer.State) { es, ok := b.endpointStates.Get(endpoint) if !ok { es := &endpointState{ - balancer: childState.Balancer, hashKey: hk, weight: newWeight, state: childState.State, + exitIdle: childState.ExitIdle, } b.endpointStates.Set(endpoint, es) b.shouldRegenerateRing = true @@ -261,26 +261,28 @@ func (b *ringhashBalancer) updatePickerLocked() { // non-deterministic, the list of `endpointState`s must be sorted to // ensure `ExitIdle` is called on the same child, preventing unnecessary // connections. - var endpointStates = make([]*endpointState, 0, b.endpointStates.Len()) + endpointStates := make([]*endpointState, 0, b.endpointStates.Len()) for _, s := range b.endpointStates.All() { endpointStates = append(endpointStates, s) } sort.Slice(endpointStates, func(i, j int) bool { return endpointStates[i].hashKey < endpointStates[j].hashKey }) - var idleBalancer endpointsharding.ExitIdler + + // Store the function to ExitIdle on the first IDLE endpoint. + var exitIdle func() for _, es := range endpointStates { connState := es.state.ConnectivityState if connState == connectivity.Connecting { - idleBalancer = nil + exitIdle = nil break } - if idleBalancer == nil && connState == connectivity.Idle { - idleBalancer = es.balancer + if exitIdle == nil && connState == connectivity.Idle { + exitIdle = es.exitIdle } } - if idleBalancer != nil { - idleBalancer.ExitIdle() + if exitIdle != nil { + exitIdle() } } @@ -399,7 +401,7 @@ type endpointState struct { // overridden, for example based on EDS endpoint metadata. hashKey string weight uint32 - balancer endpointsharding.ExitIdler + exitIdle func() // state is updated by the balancer while receiving resolver updates from // the channel and picker updates from its children. Access to it is guarded diff --git a/vendor/google.golang.org/grpc/balancer/rls/balancer.go b/vendor/google.golang.org/grpc/balancer/rls/balancer.go index 3e3c6fba9f1..6d414dddf9e 100644 --- a/vendor/google.golang.org/grpc/balancer/rls/balancer.go +++ b/vendor/google.golang.org/grpc/balancer/rls/balancer.go @@ -140,7 +140,7 @@ func (rlsBB) Build(cc balancer.ClientConn, opts balancer.BuildOptions) balancer. lbCfg: &lbConfig{}, pendingMap: make(map[cacheKey]*backoffState), childPolicies: make(map[string]*childPolicyWrapper), - updateCh: buffer.NewUnbounded(), + updateCh: buffer.NewUnbounded[any](), } lb.logger = internalgrpclog.NewPrefixLogger(logger, fmt.Sprintf("[rls-experimental-lb %p] ", lb)) lb.dataCache = newDataCache(maxCacheSize, lb.logger, opts.Target.String()) @@ -204,7 +204,7 @@ type rlsBalancer struct { inhibitPickerUpdates bool // Channel on which all updates are pushed. Processed in run(). - updateCh *buffer.Unbounded + updateCh *buffer.Unbounded[any] } type resumePickerUpdates struct { diff --git a/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go b/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go index 296123e20d4..6c249fdaf24 100644 --- a/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go +++ b/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go @@ -679,7 +679,7 @@ func (x *Message) GetData() []byte { // A list of metadata pairs, used in the payload of client header, // server header, and server trailer. // Implementations may omit some entries to honor the header limits -// of GRPC_BINARY_LOG_CONFIG. +// of GRPC_BINARY_LOG_FILTER. // // Header keys added by gRPC are omitted. To be more specific, // implementations will not log the following entries, and this is @@ -689,7 +689,9 @@ func (x *Message) GetData() []byte { // or keys like 'lb-token' // - transport specific entries, including but not limited to: // ':path', ':authority', 'content-encoding', 'user-agent', 'te', etc -// - entries added for call credentials +// - entries added for call credentials (on client side, excludes all +// such headers; on server side, excludes only the "authorization" +// header) // // Implementations must always log grpc-trace-bin if it is present. // Practically speaking it will only be visible on server side because diff --git a/vendor/google.golang.org/grpc/call.go b/vendor/google.golang.org/grpc/call.go index 788c89c16f9..2079bf4ed75 100644 --- a/vendor/google.golang.org/grpc/call.go +++ b/vendor/google.golang.org/grpc/call.go @@ -20,6 +20,10 @@ package grpc import ( "context" + "io" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" ) // Invoke sends the RPC request on the wire and returns after response is @@ -67,8 +71,27 @@ func invoke(ctx context.Context, method string, req, reply any, cc *ClientConn, if err != nil { return err } - if err := cs.SendMsg(req); err != nil { + // In case of nil or io.EOF error, call RecvMsg. + if err := cs.SendMsg(req); err != nil && err != io.EOF { + return err + } + // CloseSend is needed because in some scenarios (e.g., xDS), the same + // interceptors are used to process both unary and streaming RPCs. Calling + // CloseSend signals to those interceptors that no more messages are on the + // way. + if err := cs.CloseSend(); err != nil && err != io.EOF { return err } - return cs.RecvMsg(reply) + if err := cs.RecvMsg(reply); err != nil { + return err + } + // Call RecvMsg again to get the trailers. + err = cs.RecvMsg(reply) + if err == io.EOF { + return nil + } + if err == nil { + return status.Error(codes.Internal, "cardinality violation: expected for non server-streaming RPCs, but received another message") + } + return err } diff --git a/vendor/google.golang.org/grpc/clientconn.go b/vendor/google.golang.org/grpc/clientconn.go index b27c7e84a3d..f5ce0719705 100644 --- a/vendor/google.golang.org/grpc/clientconn.go +++ b/vendor/google.golang.org/grpc/clientconn.go @@ -553,6 +553,7 @@ func chainStreamClientInterceptors(cc *ClientConn) { if cc.dopts.streamInt != nil { interceptors = append([]StreamClientInterceptor{cc.dopts.streamInt}, interceptors...) } + interceptors = append(interceptors, defaultStreamInterceptor) var chainedInt StreamClientInterceptor if len(interceptors) == 0 { chainedInt = nil diff --git a/vendor/google.golang.org/grpc/credentials/alts/internal/conn/record.go b/vendor/google.golang.org/grpc/credentials/alts/internal/conn/record.go index 022416b2607..bf33b7511d7 100644 --- a/vendor/google.golang.org/grpc/credentials/alts/internal/conn/record.go +++ b/vendor/google.golang.org/grpc/credentials/alts/internal/conn/record.go @@ -65,8 +65,7 @@ const ( altsRecordDefaultLength = 4 * 1024 // 4KiB // Message type value included in ALTS record framing. altsRecordMsgType = uint32(0x06) - // The maximum write buffer size. This *must* be multiple of - // altsRecordDefaultLength. + // The maximum write buffer size, which can hold multiple ALTS frames. altsWriteBufferMaxSize = 512 * 1024 // 512KiB // The initial buffer used to read from the network. // It includes an additional 512 Bytes to hold two 16KiB records plus @@ -137,6 +136,12 @@ type conn struct { // NewConn creates a new secure channel instance given the other party role and // handshaking result. func NewConn(c net.Conn, side core.Side, recordProtocol string, key []byte, protected []byte) (net.Conn, error) { + return NewConnWithMaxFrameSize(c, side, recordProtocol, key, protected, 0) +} + +// NewConnWithMaxFrameSize creates a new secure channel instance given the +// other party role, handshaking result, and negotiated maximum frame size. +func NewConnWithMaxFrameSize(c net.Conn, side core.Side, recordProtocol string, key []byte, protected []byte, negotiatedMaxFrameSize int) (net.Conn, error) { newCrypto := protocols[recordProtocol] if newCrypto == nil { return nil, fmt.Errorf("negotiated unknown next_protocol %q", recordProtocol) @@ -146,7 +151,10 @@ func NewConn(c net.Conn, side core.Side, recordProtocol string, key []byte, prot return nil, fmt.Errorf("protocol %q: %v", recordProtocol, err) } overhead := MsgLenFieldSize + msgTypeFieldSize + crypto.EncryptionOverhead() - payloadLengthLimit := altsRecordDefaultLength - overhead + + // Clamp maxRecordLen to be at least altsRecordDefaultLength. + maxRecordLen := max(altsRecordDefaultLength, negotiatedMaxFrameSize) + payloadLengthLimit := maxRecordLen - overhead // We pre-allocate protected to be of size 32KB during initialization. // We increase the size of the buffer by the required amount if it can't // hold a complete encrypted record. @@ -321,7 +329,8 @@ func (p *conn) Write(b []byte) (n int, err error) { partialBSize := len(b) if size > altsWriteBufferMaxSize { size = altsWriteBufferMaxSize - const numOfFramesInMaxWriteBuf = altsWriteBufferMaxSize / altsRecordDefaultLength + frameLen := p.payloadLengthLimit + p.overhead + numOfFramesInMaxWriteBuf := altsWriteBufferMaxSize / frameLen partialBSize = numOfFramesInMaxWriteBuf * p.payloadLengthLimit } // Get a writeBuf of the required length. @@ -363,7 +372,7 @@ func (p *conn) Write(b []byte) (n int, err error) { // written. This means we need to remove header, // encryption overheads, and any partially-written // frame data. - numOfWrittenFrames := int(math.Floor(float64(nn) / float64(altsRecordDefaultLength))) + numOfWrittenFrames := int(math.Floor(float64(nn) / float64(p.payloadLengthLimit+p.overhead))) return partialBStart + numOfWrittenFrames*p.payloadLengthLimit, err } } diff --git a/vendor/google.golang.org/grpc/credentials/alts/internal/handshaker/handshaker.go b/vendor/google.golang.org/grpc/credentials/alts/internal/handshaker/handshaker.go index f4974b504b5..f2a1e36f738 100644 --- a/vendor/google.golang.org/grpc/credentials/alts/internal/handshaker/handshaker.go +++ b/vendor/google.golang.org/grpc/credentials/alts/internal/handshaker/handshaker.go @@ -289,7 +289,11 @@ func (h *altsHandshaker) doHandshake(req *altspb.HandshakerReq) (net.Conn, *alts if !ok { return nil, nil, fmt.Errorf("unknown resulted record protocol %v", result.RecordProtocol) } - sc, err := conn.NewConn(h.conn, h.side, result.GetRecordProtocol(), result.KeyData[:keyLen], extra) + maxFrameSize := int(envconfig.ALTSMaxFrameSize) + if peerMax := int(result.GetMaxFrameSize()); peerMax > 0 { + maxFrameSize = min(peerMax, maxFrameSize) + } + sc, err := conn.NewConnWithMaxFrameSize(h.conn, h.side, result.GetRecordProtocol(), result.KeyData[:keyLen], extra, maxFrameSize) if err != nil { return nil, nil, err } diff --git a/vendor/google.golang.org/grpc/internal/buffer/unbounded.go b/vendor/google.golang.org/grpc/internal/buffer/unbounded.go index 467392b8d45..d1f4b634b91 100644 --- a/vendor/google.golang.org/grpc/internal/buffer/unbounded.go +++ b/vendor/google.golang.org/grpc/internal/buffer/unbounded.go @@ -27,32 +27,29 @@ import ( // extra goroutines. This is typically used for passing updates from one entity // to another within gRPC. // +// To avoid extra memory allocations and type assertions, using any on +// performance-critical code paths is discouraged. Use concrete types wherever +// possible when instantiating Unbounded. +// // All methods on this type are thread-safe and don't block on anything except // the underlying mutex used for synchronization. -// -// Unbounded supports values of any type to be stored in it by using a channel -// of `any`. This means that a call to Put() incurs an extra memory allocation, -// and also that users need a type assertion while reading. For performance -// critical code paths, using Unbounded is strongly discouraged and defining a -// new type specific implementation of this buffer is preferred. See -// internal/transport/transport.go for an example of this. -type Unbounded struct { - c chan any +type Unbounded[T any] struct { + c chan T closed bool closing bool mu sync.Mutex - backlog []any + backlog []T } // NewUnbounded returns a new instance of Unbounded. -func NewUnbounded() *Unbounded { - return &Unbounded{c: make(chan any, 1)} +func NewUnbounded[T any]() *Unbounded[T] { + return &Unbounded[T]{c: make(chan T, 1)} } var errBufferClosed = errors.New("Put called on closed buffer.Unbounded") // Put adds t to the unbounded buffer. -func (b *Unbounded) Put(t any) error { +func (b *Unbounded[T]) Put(t T) error { b.mu.Lock() defer b.mu.Unlock() if b.closing { @@ -72,13 +69,14 @@ func (b *Unbounded) Put(t any) error { // Load sends the earliest buffered data, if any, onto the read channel returned // by Get(). Users are expected to call this every time they successfully read a // value from the read channel. -func (b *Unbounded) Load() { +func (b *Unbounded[T]) Load() { b.mu.Lock() defer b.mu.Unlock() if len(b.backlog) > 0 { select { case b.c <- b.backlog[0]: - b.backlog[0] = nil + var zero T + b.backlog[0] = zero b.backlog = b.backlog[1:] default: } @@ -96,14 +94,14 @@ func (b *Unbounded) Load() { // // If the unbounded buffer is closed, the read channel returned by this method // is closed after all data is drained. -func (b *Unbounded) Get() <-chan any { +func (b *Unbounded[T]) Get() <-chan T { return b.c } // Close closes the unbounded buffer. No subsequent data may be Put(), and the // channel returned from Get() will be closed after all the data is read and // Load() is called for the final time. -func (b *Unbounded) Close() { +func (b *Unbounded[T]) Close() { b.mu.Lock() defer b.mu.Unlock() if b.closing { diff --git a/vendor/google.golang.org/grpc/internal/credentials/xds/handshake_info.go b/vendor/google.golang.org/grpc/internal/credentials/xds/handshake_info.go index 404b9cc9e2d..dd4cdb9bfee 100644 --- a/vendor/google.golang.org/grpc/internal/credentials/xds/handshake_info.go +++ b/vendor/google.golang.org/grpc/internal/credentials/xds/handshake_info.go @@ -33,6 +33,7 @@ import ( "google.golang.org/grpc/internal" "google.golang.org/grpc/internal/credentials/spiffe" "google.golang.org/grpc/internal/envconfig" + "google.golang.org/grpc/internal/grpcsync" "google.golang.org/grpc/internal/xds/matcher" "google.golang.org/grpc/resolver" ) @@ -66,42 +67,18 @@ func Hostname(attr *attributes.Attributes) string { return hn } -// Equal reports whether the handshake info structs are identical. -func (hi *HandshakeInfo) Equal(other *HandshakeInfo) bool { - if hi == nil && other == nil { - return true - } - if hi == nil || other == nil { - return false - } - if hi.rootProvider != other.rootProvider || - hi.identityProvider != other.identityProvider || - hi.requireClientCert != other.requireClientCert || - hi.sni != other.sni || - hi.validateSANUsingSNI != other.validateSANUsingSNI || - hi.useAutoHostSNI != other.useAutoHostSNI || - len(hi.sanMatchers) != len(other.sanMatchers) { - return false - } - for i := range hi.sanMatchers { - if !hi.sanMatchers[i].Equal(other.sanMatchers[i]) { - return false - } - } - return true -} - // SetHandshakeInfo returns a copy of addr in which the Attributes field is // updated with hiPtr. -func SetHandshakeInfo(addr resolver.Address, hiPtr *atomic.Pointer[HandshakeInfo]) resolver.Address { +func SetHandshakeInfo(addr resolver.Address, hiPtr *atomic.Pointer[grpcsync.RefCounted[*HandshakeInfo]]) resolver.Address { addr.Attributes = addr.Attributes.WithValue(handshakeAttrKey{}, hiPtr) return addr } -// HandshakeInfoFromAttributes returns a pointer to the *HandshakeInfo stored in attr. -func HandshakeInfoFromAttributes(attr *attributes.Attributes) *atomic.Pointer[HandshakeInfo] { +// HandshakeInfoFromAttributes returns the atomic pointer to the +// reference-counted HandshakeInfo stored in attr. +func HandshakeInfoFromAttributes(attr *attributes.Attributes) *atomic.Pointer[grpcsync.RefCounted[*HandshakeInfo]] { v := attr.Value(handshakeAttrKey{}) - hi, _ := v.(*atomic.Pointer[HandshakeInfo]) + hi, _ := v.(*atomic.Pointer[grpcsync.RefCounted[*HandshakeInfo]]) return hi } @@ -109,29 +86,98 @@ func HandshakeInfoFromAttributes(attr *attributes.Attributes) *atomic.Pointer[Ha // server handshake methods in xds credentials. The xDS implementation will be // responsible for populating these fields. type HandshakeInfo struct { - // All fields written at init time and read only after that, so no - // synchronization needed. - rootProvider certprovider.Provider - identityProvider certprovider.Provider + // The fields below are initialized when the HandshakeInfo is created, and are + // not changed thereafter. sanMatchers []matcher.StringMatcher // Only on the client side. requireClientCert bool // Only on server side. sni string // Only on client side, used for Server Name Indication in TLS handshake. validateSANUsingSNI bool // Only on client side, indicates whether to perform validation of SANs based on SNI value. useAutoHostSNI bool // Only on client side, indicates whether to use endpoint hostname as SNI. + + rootProvider certprovider.Provider + identityProvider certprovider.Provider } -// NewHandshakeInfo returns a new handshake info configured with the provided -// options. -func NewHandshakeInfo(rootProvider certprovider.Provider, identityProvider certprovider.Provider, sanMatchers []matcher.StringMatcher, requireClientCert bool, sni string, validateSANUsingSNI bool, useAutoHostSNI bool) *HandshakeInfo { - return &HandshakeInfo{ +// NewHandshakeInfo returns a new reference counted HandshakeInfo configured +// with the provided options. +func NewHandshakeInfo(rootProvider, identityProvider certprovider.Provider, sanMatchers []matcher.StringMatcher, sni string, requireClientCert, validateSANUsingSNI, useAutoHostSNI bool) *grpcsync.RefCounted[*HandshakeInfo] { + hi := &HandshakeInfo{ rootProvider: rootProvider, identityProvider: identityProvider, sanMatchers: sanMatchers, - requireClientCert: requireClientCert, sni: sni, + requireClientCert: requireClientCert, validateSANUsingSNI: validateSANUsingSNI, useAutoHostSNI: useAutoHostSNI, } + + return grpcsync.NewRefCounted(hi, hi.close) +} + +func (hi *HandshakeInfo) close() { + if hi.rootProvider != nil { + hi.rootProvider.Close() + } + if hi.identityProvider != nil { + hi.identityProvider.Close() + } +} + +// ClientSideTLSConfig loads the HandshakeInfo from hiPtr, marks it as in-use, +// and returns the tls.Config along with a done callback that MUST be invoked +// when the handshake completes. If no HandshakeInfo is stored in hiPtr or if +// fallback credentials should be used, useFallback returns true. +func ClientSideTLSConfig(ctx context.Context, hiPtr *atomic.Pointer[grpcsync.RefCounted[*HandshakeInfo]], hostname string) (cfg *tls.Config, useFallback bool, done func(), err error) { + if hiPtr == nil { + return nil, true, func() {}, nil + } + for { + hiRC := hiPtr.Load() + if hiRC == nil { + return nil, false, func() {}, errors.New("xds: connection closed or HandshakeInfo dead") + } + if !hiRC.TryIncrement() { + if hiPtr.Load() != hiRC { + continue + } + return nil, false, func() {}, errors.New("xds: connection closed or HandshakeInfo dead") + } + + hi := hiRC.Value() + if hi == nil || hi.UseFallbackCreds() { + hiRC.Decrement() + return nil, true, func() {}, nil + } + cfg, err := hi.clientSideTLSConfigInternal(ctx, hostname) + if err != nil { + hiRC.Decrement() + return nil, false, func() {}, err + } + return cfg, false, hiRC.Decrement, nil + } +} + +// ServerSideTLSConfig checks if hi is configured and marks it as in-use, +// returning the tls.Config along with a done callback that MUST be invoked when +// the handshake completes. If hi is nil or fallback credentials should be used, +// useFallback returns true. +func ServerSideTLSConfig(ctx context.Context, hiRC *grpcsync.RefCounted[*HandshakeInfo]) (cfg *tls.Config, useFallback bool, done func(), err error) { + if hiRC == nil { + return nil, true, func() {}, nil + } + hi := hiRC.Value() + if hi == nil || hi.UseFallbackCreds() { + return nil, true, func() {}, nil + } + if !hiRC.TryIncrement() { + return nil, false, func() {}, errors.New("xds: connection closed or HandshakeInfo dead") + } + cfg, err = hi.serverSideTLSConfigInternal(ctx) + if err != nil { + hiRC.Decrement() + return nil, false, func() {}, err + } + return cfg, false, hiRC.Decrement, nil } // UseFallbackCreds returns true when fallback credentials are to be used based @@ -149,23 +195,20 @@ func (hi *HandshakeInfo) GetSANMatchersForTesting() []matcher.StringMatcher { return append([]matcher.StringMatcher{}, hi.sanMatchers...) } -// ClientSideTLSConfig constructs a tls.Config to be used in a client-side -// handshake based on the contents of the HandshakeInfo. +// clientSideTLSConfigInternal constructs a tls.Config to be used in a +// client-side handshake based on the contents of the HandshakeInfo. // // hostname is passed as a parameter here instead of being part of the // HandshakeInfo because HandshakeInfo contains cluster-level security // configuration that applies to all endpoints in the cluster, while hostname is // specific to each endpoint. This allows sharing a single HandshakeInfo // instance across multiple endpoints in the same cluster. -func (hi *HandshakeInfo) ClientSideTLSConfig(ctx context.Context, hostname string) (*tls.Config, error) { +func (hi *HandshakeInfo) clientSideTLSConfigInternal(ctx context.Context, hostname string) (*tls.Config, error) { // On the client side, rootProvider is mandatory. IdentityProvider is // optional based on whether the client is doing TLS or mTLS. if hi.rootProvider == nil { return nil, errors.New("xds: CertificateProvider to fetch trusted roots is missing, cannot perform TLS handshake. Please check configuration on the management server") } - // Since the call to KeyMaterial() can block, we read the providers under - // the lock but call the actual function after releasing the lock. - rootProv, idProv := hi.rootProvider, hi.identityProvider // InsecureSkipVerify needs to be set to true because we need to perform // custom verification to check the SAN on the received certificate. @@ -177,7 +220,7 @@ func (hi *HandshakeInfo) ClientSideTLSConfig(ctx context.Context, hostname strin NextProtos: []string{"h2"}, } - km, err := rootProv.KeyMaterial(ctx) + km, err := hi.rootProvider.KeyMaterial(ctx) if err != nil { return nil, fmt.Errorf("xds: fetching trusted roots from CertificateProvider failed: %v", err) } @@ -194,8 +237,8 @@ func (hi *HandshakeInfo) ClientSideTLSConfig(ctx context.Context, hostname strin cfg.VerifyPeerCertificate = hi.buildVerifyFunc(km, true, sni) - if idProv != nil { - km, err := idProv.KeyMaterial(ctx) + if hi.identityProvider != nil { + km, err := hi.identityProvider.KeyMaterial(ctx) if err != nil { return nil, fmt.Errorf("xds: fetching identity certificates from CertificateProvider failed: %v", err) } @@ -279,9 +322,9 @@ func (hi *HandshakeInfo) buildVerifyFunc(km *certprovider.KeyMaterial, isClient } } -// ServerSideTLSConfig constructs a tls.Config to be used in a server-side -// handshake based on the contents of the HandshakeInfo. -func (hi *HandshakeInfo) ServerSideTLSConfig(ctx context.Context) (*tls.Config, error) { +// serverSideTLSConfigInternal constructs a tls.Config to be used in a +// server-side handshake based on the contents of the HandshakeInfo. +func (hi *HandshakeInfo) serverSideTLSConfigInternal(ctx context.Context) (*tls.Config, error) { cfg := &tls.Config{ ClientAuth: tls.NoClientCert, NextProtos: []string{"h2"}, @@ -291,22 +334,19 @@ func (hi *HandshakeInfo) ServerSideTLSConfig(ctx context.Context) (*tls.Config, if hi.identityProvider == nil { return nil, errors.New("xds: CertificateProvider to fetch identity certificate is missing, cannot perform TLS handshake. Please check configuration on the management server") } - // Since the call to KeyMaterial() can block, we read the providers under - // the lock but call the actual function after releasing the lock. - rootProv, idProv := hi.rootProvider, hi.identityProvider if hi.requireClientCert { cfg.ClientAuth = tls.RequireAndVerifyClientCert } // identityProvider is mandatory on the server side. - km, err := idProv.KeyMaterial(ctx) + km, err := hi.identityProvider.KeyMaterial(ctx) if err != nil { return nil, fmt.Errorf("xds: fetching identity certificates from CertificateProvider failed: %v", err) } cfg.Certificates = km.Certs - if rootProv != nil { - km, err := rootProv.KeyMaterial(ctx) + if hi.rootProvider != nil { + km, err := hi.rootProvider.KeyMaterial(ctx) if err != nil { return nil, fmt.Errorf("xds: fetching trusted roots from CertificateProvider failed: %v", err) } diff --git a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go index 33344812746..dc6fc0c4cbe 100644 --- a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go +++ b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go @@ -153,6 +153,13 @@ var ( // TODO: Remove this env var once v1.83.0 is released. ControlBufferThrottleLimit = uint64FromEnv("GRPC_GO_EXPERIMENTAL_CONTROL_BUFFER_THROTTLE_LIMIT", 100, 1, 10000) + // ALTSMaxFrameSize is the maximum frame size for ALTS in bytes. + // This can be overridden by setting the environment variable + // "GRPC_GO_EXPERIMENTAL_ALTS_MAX_FRAME_SIZE" (min: 4096, max: 512*1024, capped at + // 512KiB to match altsWriteBufferMaxSize in + // credentials/alts/internal/conn/record.go). + ALTSMaxFrameSize = uint64FromEnv("GRPC_GO_EXPERIMENTAL_ALTS_MAX_FRAME_SIZE", 4096, 4096, 512*1024) + // EnableReceiveBufferCompaction enables the compaction of data buffers // to reduce the number of buffers in the receive buffer. // diff --git a/vendor/google.golang.org/grpc/internal/envconfig/xds.go b/vendor/google.golang.org/grpc/internal/envconfig/xds.go index e4b69191382..5ec39bd7569 100644 --- a/vendor/google.golang.org/grpc/internal/envconfig/xds.go +++ b/vendor/google.golang.org/grpc/internal/envconfig/xds.go @@ -98,4 +98,9 @@ var ( // filter. For more details, see: // https://github.com/grpc/proposal/blob/master/A83-xds-gcp-authn-filter.md GCPAuthenticationFilterEnabled = boolFromEnv("GRPC_EXPERIMENTAL_XDS_GCP_AUTHENTICATION_FILTER", false) + + // XDSClientExtAuthzEnabled indicates whether the external authorization + // filter is enabled on the client side. For more details, see: + // https://github.com/grpc/proposal/blob/master/A92-xds-ext-authz.md + XDSClientExtAuthzEnabled = boolFromEnv("GRPC_EXPERIMENTAL_XDS_EXT_AUTHZ_ON_CLIENT", false) ) diff --git a/vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go b/vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go index d4999fcca83..caa9dd68eae 100644 --- a/vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go +++ b/vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go @@ -41,7 +41,7 @@ type CallbackSerializer struct { // its resources. done chan struct{} - callbacks *buffer.Unbounded + callbacks *buffer.Unbounded[func(context.Context)] } // NewCallbackSerializer returns a new CallbackSerializer instance. The provided @@ -52,7 +52,7 @@ type CallbackSerializer struct { func NewCallbackSerializer(ctx context.Context) *CallbackSerializer { cs := &CallbackSerializer{ done: make(chan struct{}), - callbacks: buffer.NewUnbounded(), + callbacks: buffer.NewUnbounded[func(context.Context)](), } go cs.run(ctx) return cs @@ -113,7 +113,7 @@ func (cs *CallbackSerializer) run(ctx context.Context) { // Run all callbacks. for cb := range cs.callbacks.Get() { cs.callbacks.Load() - cb.(func(context.Context))(ctx) + cb(ctx) } } diff --git a/vendor/google.golang.org/grpc/internal/grpcsync/refcounted.go b/vendor/google.golang.org/grpc/internal/grpcsync/refcounted.go new file mode 100644 index 00000000000..bca9b83754d --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/grpcsync/refcounted.go @@ -0,0 +1,109 @@ +/* + * + * Copyright 2026 gRPC authors. + * + * 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 grpcsync + +import ( + "sync/atomic" + + "google.golang.org/grpc/grpclog" +) + +var logger = grpclog.Component("grpcsync") + +// RefCounted is a reference counted wrapper of type T. It tracks the number of +// active references and runs a cleanup when the last reference is released. +type RefCounted[T any] struct { + val T + refCount atomic.Int32 + onZero func() +} + +// NewRefCounted creates a new RefCounted instance wrapping the given value with +// initial refcount of one. +// +// The value should typically be a pointer, interface, or handle rather than a +// plain value type (such as a struct or primitive value). +// +// The provided onZero callback must not be nil, and is executed exactly once +// when the reference count drops to zero. Panics if onZero is nil. +// +// WARNING: onZero runs synchronously inside Decrement; it must not acquire +// locks held by Decrement callers. +func NewRefCounted[T any](val T, onZero func()) *RefCounted[T] { + if onZero == nil { + panic("grpcsync: onZero callback cannot be nil") + } + rc := &RefCounted[T]{ + val: val, + onZero: onZero, + } + rc.refCount.Store(1) + return rc +} + +// Value returns the encapsulated resource. +func (rc *RefCounted[T]) Value() T { + return rc.val +} + +// TryIncrement attempts to increment the reference count, returning true if +// successful. It returns false if the count has already reached 0, indicating +// the resource has been cleaned up and cannot be resurrected. +// +// WARNING: Avoid calling TryIncrement on hot paths when an active reference is +// already guaranteed by the caller; use Increment instead to bypass the +// CompareAndSwap loop overhead. TryIncrement should be reserved for speculative +// lookups (such as fetching from a cache or map) where the resource might be +// dead. +func (rc *RefCounted[T]) TryIncrement() bool { + // Utilize a CompareAndSwap loop to prevent race conditions where a concurrent + // decrement could drop the count to zero between the read and the increment + // operation, which would otherwise inadvertently resurrect a closed resource. + for { + count := rc.refCount.Load() + if count <= 0 { + return false // Already dead or dying + } + if rc.refCount.CompareAndSwap(count, count+1) { + return true + } + } +} + +// Increment increments the reference count. +// +// WARNING: Call Increment only when there is a guarantee that an active +// reference is already present, ensuring the resource is not dead. If there is +// a possibility that the resource is dead or its reference count might have +// reached zero, call TryIncrement instead. +func (rc *RefCounted[T]) Increment() { + if rc.refCount.Add(1) <= 1 { + logger.Errorf("Resource already closed or dead") + } +} + +// Decrement decrements the reference count. If it drops to zero, the onZero +// callback is executed synchronously before this method returns. +func (rc *RefCounted[T]) Decrement() { + if v := rc.refCount.Add(-1); v < 0 { + logger.Errorf("Refcount cannot be negative") + } else if v == 0 { + rc.onZero() + } +} diff --git a/vendor/google.golang.org/grpc/internal/internal.go b/vendor/google.golang.org/grpc/internal/internal.go index 4b3d563f8d7..2b7fa6b08b2 100644 --- a/vendor/google.golang.org/grpc/internal/internal.go +++ b/vendor/google.golang.org/grpc/internal/internal.go @@ -245,6 +245,10 @@ var ( AsyncReporterCleanupDelegate = func(cleanup func()) func() { return cleanup } + + // XDSFilterWrapperOption returns a ServerOption that sets the internal + // stream wrapper used for server-side xDS HTTP filters. + XDSFilterWrapperOption any // func(func(grpc.ServerStream) (grpc.ServerStream, error)) grpc.ServerOption ) // HealthChecker defines the signature of the client-side LB channel health diff --git a/vendor/google.golang.org/grpc/internal/optional/optional.go b/vendor/google.golang.org/grpc/internal/optional/optional.go new file mode 100644 index 00000000000..218794af6ac --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/optional/optional.go @@ -0,0 +1,47 @@ +/* + * + * Copyright 2026 gRPC authors. + * + * 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 optional implements a generic optional type. +package optional + +// Optional represents an optional value of type T. The zero value is usable and +// indicates that no value is set. This type is not safe for concurrent access. +type Optional[T any] struct { + val T + set bool +} + +// New creates a new Optional type with the provided value. +func New[T any](value T) Optional[T] { + return Optional[T]{ + val: value, + set: true, + } +} + +// Value returns the underlying value and a boolean indicating if the value is +// set. If the value is not set, it returns the zero value of T and false. +func (o *Optional[T]) Value() (T, bool) { + return o.val, o.set +} + +// SetValue updates or adds the value to Optional. +func (o *Optional[T]) SetValue(v T) { + o.val = v + o.set = true +} diff --git a/vendor/google.golang.org/grpc/internal/resolver/config_selector.go b/vendor/google.golang.org/grpc/internal/resolver/config_selector.go index 238950bbbf9..ead6dda4e99 100644 --- a/vendor/google.golang.org/grpc/internal/resolver/config_selector.go +++ b/vendor/google.golang.org/grpc/internal/resolver/config_selector.go @@ -42,6 +42,10 @@ type RPCInfo struct { // efficiency reasons. SelectConfig should not be blocking. Context context.Context Method string // i.e. "/Service/Method" + // Authority is the target authority (host) name of the RPC. This is required + // for HTTP filters (such as external processing) to populate request + // attributes. + Authority string } // RPCConfig describes the configuration to use for each RPC. @@ -54,17 +58,6 @@ type RPCConfig struct { Interceptor any } -// ServerInterceptor is an interceptor for incoming RPC's on gRPC server side. -type ServerInterceptor interface { - // AllowRPC checks if an incoming RPC is allowed to proceed based on - // information about connection RPC was received on, and HTTP Headers. This - // information will be piped into context. - AllowRPC(ctx context.Context) error // TODO: Make this a real interceptor for filters such as rate limiting. - // Close closes the interceptor. Once called, no new calls to NewStream are - // accepted. Ongoing calls to NewStream are allowed to complete. - Close() -} - type csKeyType string const csKey = csKeyType("grpc.internal.resolver.configSelector") diff --git a/vendor/google.golang.org/grpc/internal/transport/controlbuf.go b/vendor/google.golang.org/grpc/internal/transport/controlbuf.go index b9bae02498e..89c938fdb51 100644 --- a/vendor/google.golang.org/grpc/internal/transport/controlbuf.go +++ b/vendor/google.golang.org/grpc/internal/transport/controlbuf.go @@ -219,6 +219,17 @@ type outFlowControlSizeRequest struct { resp chan uint32 } +// outStreamRequestForTesting is used by tests to retrieve a pointer to an outStream +// safely inside the loopyWriter goroutine without racing on loopyWriter.estdStreams. +// By holding the *outStream pointer while streams and transports close down, tests +// can inspect settled accounting values (such as bytesOutStanding) after loopyWriter +// has run to completion without any data races. +type outStreamRequestForTesting struct { + throttledItem + streamID uint32 + resp chan *outStream +} + // closeConnection is an instruction to tell the loopy writer to flush the // framer and exit, which will cause the transport's connection to be closed // (by the client or server). The transport itself will close after the reader @@ -799,6 +810,10 @@ func (l *loopyWriter) outFlowControlSizeRequestHandler(o *outFlowControlSizeRequ o.resp <- l.sendQuota } +func (l *loopyWriter) outStreamRequestHandler(o *outStreamRequestForTesting) { + o.resp <- l.estdStreams[o.streamID] +} + func (l *loopyWriter) cleanupStreamHandler(c *cleanupStream) error { c.onWrite() if str, ok := l.estdStreams[c.streamID]; ok { @@ -896,6 +911,8 @@ func (l *loopyWriter) handle(i any) error { return l.goAwayHandler(i) case *outFlowControlSizeRequest: l.outFlowControlSizeRequestHandler(i) + case *outStreamRequestForTesting: + l.outStreamRequestHandler(i) case closeConnection: // Just return a non-I/O error and run() will flush and close the // connection. diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_client.go b/vendor/google.golang.org/grpc/internal/transport/http2_client.go index 10d19774159..720fc4e5b0d 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_client.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_client.go @@ -554,8 +554,6 @@ func (t *http2Client) createHeaderFields(ctx context.Context, callHdr *CallHdr) if err != nil { return nil, err } - // TODO(mmukhi): Benchmark if the performance gets better if count the metadata and other header fields - // first and create a slice of that exact size. // Make the slice of certain predictable size to reduce allocations made by append. hfLen := 7 // :method, :scheme, :path, :authority, content-type, user-agent, te hfLen += len(authData) + len(callAuthData) @@ -575,6 +573,21 @@ func (t *http2Client) createHeaderFields(ctx context.Context, callHdr *CallHdr) if _, ok := ctx.Deadline(); ok { hfLen++ } + // Count the metadata header fields as well so the slice is not reallocated + // while they are appended below. Reserved headers are dropped when writing, + // so this may slightly over-count, which is preferable to growing the slice. + md, added, mdOK := metadataFromOutgoingContextRaw(ctx) + if mdOK { + for _, vv := range md { + hfLen += len(vv) + } + for _, vv := range added { + hfLen += len(vv) / 2 + } + } + for _, vv := range t.md { + hfLen += len(vv) + } headerFields := make([]hpack.HeaderField, 0, hfLen) headerFields = append(headerFields, hpack.HeaderField{Name: ":method", Value: "POST"}) headerFields = append(headerFields, hpack.HeaderField{Name: ":scheme", Value: t.scheme}) @@ -619,7 +632,7 @@ func (t *http2Client) createHeaderFields(ctx context.Context, callHdr *CallHdr) headerFields = append(headerFields, hpack.HeaderField{Name: k, Value: encodeMetadataHeader(k, v)}) } - if md, added, ok := metadataFromOutgoingContextRaw(ctx); ok { + if mdOK { var k string for k, vv := range md { // HTTP doesn't allow you to set pseudoheaders after non pseudoheaders were set. @@ -648,6 +661,9 @@ func (t *http2Client) createHeaderFields(ctx context.Context, callHdr *CallHdr) if isReservedHeader(k) { continue } + if err := imetadata.ValidatePair(k, vv...); err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } for _, v := range vv { headerFields = append(headerFields, hpack.HeaderField{Name: k, Value: encodeMetadataHeader(k, v)}) } @@ -691,6 +707,9 @@ func (t *http2Client) getTrAuthData(ctx context.Context, audience string) (map[s for k, v := range data { // Capital header names are illegal in HTTP/2. k = strings.ToLower(k) + if err := imetadata.ValidatePair(k, v); err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } authData[k] = v } } @@ -724,6 +743,9 @@ func (t *http2Client) getCallAuthData(ctx context.Context, audience string, call for k, v := range data { // Capital header names are illegal in HTTP/2 k = strings.ToLower(k) + if err := imetadata.ValidatePair(k, v); err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } callAuthData[k] = v } } @@ -1226,23 +1248,26 @@ func (t *http2Client) handleData(f *parsedDataFrame) { t.closeStream(s, io.EOF, true, http2.ErrCodeFlowControl, status.New(codes.Internal, err.Error()), nil, false) return } + } - if s.nonGRPCStatus != nil { - // The frame should be handled as a non-gRPC response body - st := s.handleNonGRPCData(f) - if st != nil { - t.closeStream(s, st.Err(), true, http2.ErrCodeProtocol, st, nil, true) - return - } - if w := s.fc.onRead(size); w > 0 { - t.controlBuf.put(&outgoingWindowUpdate{ - streamID: s.id, - increment: w, - }) - } + if s.nonGRPCStatus != nil { + // The frame should be handled as a non-gRPC response body. A non-nil + // status also covers END_STREAM, so no separate handling is needed below. + st := s.handleNonGRPCData(f) + if st != nil { + t.closeStream(s, st.Err(), true, http2.ErrCodeProtocol, st, nil, true) return } + if w := s.fc.onRead(size); w > 0 { + t.controlBuf.put(&outgoingWindowUpdate{ + streamID: s.id, + increment: w, + }) + } + return + } + if size > 0 { dataLen := f.data.Len() if f.Header().Flags.Has(http2.FlagDataPadded) { if w := s.fc.onRead(size - uint32(dataLen)); w > 0 { diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_server.go b/vendor/google.golang.org/grpc/internal/transport/http2_server.go index 63c6539a3d3..f11e88cc5b6 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_server.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_server.go @@ -522,9 +522,16 @@ func (t *http2Server) operateHeaders(ctx context.Context, frame *http2.MetaHeade delete(mdata, "host") } + // If :authority is still missing, i.e. no host or :authority header is + // present, reject the request as invalid. + if len(mdata[":authority"]) == 0 { + t.writeEarlyAbort(streamID, s.contentSubtype, status.New(codes.Internal, "no host or :authority header present"), http.StatusBadRequest, !frame.StreamEnded()) + return nil + } if frame.StreamEnded() { // s is just created by the caller. No lock needed. s.state = streamReadDone + s.write(recvMsg{err: io.EOF}) } if timeoutSet { s.ctx, s.cancel = context.WithTimeout(ctx, timeout) diff --git a/vendor/google.golang.org/grpc/internal/transport/http_util.go b/vendor/google.golang.org/grpc/internal/transport/http_util.go index c34975ffefd..faa42f8cad5 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http_util.go +++ b/vendor/google.golang.org/grpc/internal/transport/http_util.go @@ -300,24 +300,29 @@ func decodeGrpcMessageUnchecked(msg string) string { type bufWriter struct { pool *imem.SimpleBufferPool - buf []byte + bufHandle *[]byte offset int batchSize int conn io.Writer err error } +// unsharedBufWriter keeps the unshared slice header in the writer allocation. +type unsharedBufWriter struct { + bufWriter + buf []byte +} + func newBufWriter(conn io.Writer, batchSize int, pool *imem.SimpleBufferPool) *bufWriter { - w := &bufWriter{ - batchSize: batchSize, - conn: conn, - pool: pool, - } - // this indicates that we should use non shared buf - if pool == nil { - w.buf = make([]byte, batchSize) + if pool == nil && batchSize > 0 { + w := &unsharedBufWriter{ + bufWriter: bufWriter{batchSize: batchSize, conn: conn}, + buf: make([]byte, batchSize), + } + w.bufHandle = &w.buf + return &w.bufWriter } - return w + return &bufWriter{batchSize: batchSize, conn: conn, pool: pool} } func (w *bufWriter) Write(b []byte) (int, error) { @@ -328,13 +333,13 @@ func (w *bufWriter) Write(b []byte) (int, error) { n, err := w.conn.Write(b) return n, toIOError(err) } - if w.buf == nil { - b := w.pool.Get(w.batchSize) - w.buf = *b + if w.bufHandle == nil { + w.bufHandle = w.pool.Get(w.batchSize) } + buf := *w.bufHandle written := 0 for len(b) > 0 { - copied := copy(w.buf[w.offset:], b) + copied := copy(buf[w.offset:], b) b = b[copied:] written += copied w.offset += copied @@ -350,15 +355,17 @@ func (w *bufWriter) Write(b []byte) (int, error) { func (w *bufWriter) Flush() error { err := w.flushKeepBuffer() - // Only release the buffer if we are in a "shared" mode - if w.buf != nil && w.pool != nil { - b := w.buf - w.pool.Put(&b) - w.buf = nil - } + w.releaseBuffer() return err } +func (w *bufWriter) releaseBuffer() { + if w.pool != nil && w.bufHandle != nil { + w.pool.Put(w.bufHandle) + w.bufHandle = nil + } +} + func (w *bufWriter) flushKeepBuffer() error { if w.err != nil { return w.err @@ -366,9 +373,13 @@ func (w *bufWriter) flushKeepBuffer() error { if w.offset == 0 { return nil } - _, w.err = w.conn.Write(w.buf[:w.offset]) + buf := *w.bufHandle + _, w.err = w.conn.Write(buf[:w.offset]) w.err = toIOError(w.err) w.offset = 0 + if w.err != nil { + w.releaseBuffer() + } return w.err } diff --git a/vendor/google.golang.org/grpc/internal/transport/transport.go b/vendor/google.golang.org/grpc/internal/transport/transport.go index 5fc901e5cf1..fc656b36c9b 100644 --- a/vendor/google.golang.org/grpc/internal/transport/transport.go +++ b/vendor/google.golang.org/grpc/internal/transport/transport.go @@ -89,10 +89,10 @@ type recvMsg struct { // recvBuffer is an unbounded channel of recvMsg structs. // -// Note: recvBuffer differs from buffer.Unbounded only in the fact that it -// holds a channel of recvMsg structs instead of objects implementing "item" -// interface. recvBuffer is written to much more often and using strict recvMsg -// structs helps avoid allocation in "recvBuffer.put" +// Note: recvBuffer differs from buffer.Unbounded in that it provides in-place +// value initialization (via init) to avoid struct pointer allocations on +// streams, and automatically frees pooled mem.Buffer payloads when stream +// errors occur. type recvBuffer struct { c chan recvMsg mu sync.Mutex @@ -466,15 +466,18 @@ func (s *Stream) ReadMessageHeader(header []byte) (err error) { return er } s.readRequester.requestRead(len(header)) + bytesRead := 0 for len(header) != 0 { n, err := s.trReader.ReadMessageHeader(header) + bytesRead += n header = header[n:] if len(header) == 0 { err = nil } if err != nil { - if n > 0 && err == io.EOF { + if bytesRead > 0 && err == io.EOF { err = io.ErrUnexpectedEOF + s.trReader.er = err } return err } @@ -505,19 +508,22 @@ func (s *Stream) read(n int) (data mem.BufferSlice, err error) { allocCap := min(ceil(n, http2MaxFrameLen), 128) data = make(mem.BufferSlice, 0, allocCap) s.readRequester.requestRead(n) + bytesRead := 0 for n != 0 { buf, err := s.trReader.Read(n) var bufLen int if buf != nil { bufLen = buf.Len() } + bytesRead += bufLen n -= bufLen if n == 0 { err = nil } if err != nil { - if bufLen > 0 && err == io.EOF { + if bytesRead > 0 && err == io.EOF { err = io.ErrUnexpectedEOF + s.trReader.er = err } data.Free() return nil, err diff --git a/vendor/google.golang.org/grpc/internal/xds/balancer/clusterimpl/clusterimpl.go b/vendor/google.golang.org/grpc/internal/xds/balancer/clusterimpl/clusterimpl.go index 73247d4d00a..36b84c049c9 100644 --- a/vendor/google.golang.org/grpc/internal/xds/balancer/clusterimpl/clusterimpl.go +++ b/vendor/google.golang.org/grpc/internal/xds/balancer/clusterimpl/clusterimpl.go @@ -41,6 +41,7 @@ import ( "google.golang.org/grpc/internal/balancer/gracefulswitch" "google.golang.org/grpc/internal/credentials/xds" "google.golang.org/grpc/internal/grpclog" + "google.golang.org/grpc/internal/grpcsync" "google.golang.org/grpc/internal/pretty" xdsinternal "google.golang.org/grpc/internal/xds" @@ -82,7 +83,7 @@ func (bb) Build(cc balancer.ClientConn, bOpts balancer.BuildOptions) balancer.Ba loadWrapper: loadstore.NewWrapper(), requestCountMax: defaultRequestCountMax, } - b.xdsHIPtr.Store(xds.NewHandshakeInfo(nil, nil, nil, false, "", false, false)) + b.xdsHIPtr.Store(xds.NewHandshakeInfo(nil, nil, nil, "", false, false, false)) b.logger = prefixLogger(b) b.child = gracefulswitch.NewBalancer(b, bOpts) b.logger.Infof("Created") @@ -127,13 +128,11 @@ type clusterImplBalancer struct { lrsServer *bootstrap.ServerConfig // Load reporting server configuration. dropCategories []DropConfig // The categories for drops. child *gracefulswitch.Balancer - xdsHIPtr atomic.Pointer[xds.HandshakeInfo] // Accessed atomically as it is shared between the balancer and the transport. + xdsHIPtr atomic.Pointer[grpcsync.RefCounted[*xds.HandshakeInfo]] // Accessed atomically as it is shared between the balancer and the transport. xdsCredsInUse bool - // The certificate providers are cached here to that they can be closed when - // a new provider is to be created. - cachedRoot certprovider.Provider - cachedIdentity certprovider.Provider + // The active security configuration received from the control plane. + securityConfig *xdsresource.SecurityConfig // The following fields are protected by mu, since they are accessed in // balancer API methods and in methods called from the child policy. @@ -151,6 +150,19 @@ type clusterImplBalancer struct { lrsReportEndpointMetrics *xdsresource.LRSReportEndpointMetricsConfig // LRS metrics to propagate. } +// dropRequestsPerMillion scales a drop overload's numerator and denominator to +// a number of requests to drop per million. numerator can be as large as a +// million (a 100% drop), so the multiplication is done in uint64 to avoid +// overflowing a uint32, and the result is capped at a million because a drop +// ratio above 100% is treated as 100%. +func dropRequestsPerMillion(numerator, denominator uint32) uint32 { + rpm := uint64(numerator) * million / uint64(denominator) + if rpm > million { + rpm = million + } + return uint32(rpm) +} + // handleClusterConfigLocked updates the internal state of the balancer with the // new cluster configuration. It returns true if a new picker needs to be // generated as a result of these changes. It must be called with b.mu held. @@ -172,7 +184,7 @@ func (b *clusterImplBalancer) handleClusterConfigLocked(clusterConfig xdsresourc for _, d := range edsUpdate.Drops { newDrops = append(newDrops, DropConfig{ Category: d.Category, - RequestsPerMillion: d.Numerator * million / d.Denominator, + RequestsPerMillion: dropRequestsPerMillion(d.Numerator, d.Denominator), }) } if !slices.Equal(b.dropCategories, newDrops) { @@ -313,6 +325,33 @@ func buildProviderFunc(configs map[string]*certprovider.BuildableConfig, instanc return provider, nil } +func (b *clusterImplBalancer) buildProviders(config *xdsresource.SecurityConfig) (certprovider.Provider, certprovider.Provider, error) { + cpc := b.xdsClient.BootstrapConfig().CertProviderConfigs() + var rootProvider certprovider.Provider + if config.UseSystemRootCerts { + rootProvider = systemRootCertsProvider{} + } else { + rp, err := buildProvider(cpc, config.RootInstanceName, config.RootCertName, false, true) + if err != nil { + return nil, nil, err + } + rootProvider = rp + } + + var identityProvider certprovider.Provider + if name, cert := config.IdentityInstanceName, config.IdentityCertName; name != "" { + ip, err := buildProvider(cpc, name, cert, true, false) + if err != nil { + if rootProvider != nil { + rootProvider.Close() + } + return nil, nil, err + } + identityProvider = ip + } + return rootProvider, identityProvider, nil +} + // handleSecurityConfig processes the security configuration received from the // management server, creates appropriate certificate provider plugins, and // updates the HandshakeInfo which is added as an address attribute in @@ -321,7 +360,7 @@ func (b *clusterImplBalancer) handleSecurityConfig(config *xdsresource.SecurityC // If xdsCredentials are not in use, i.e, the user did not want to get // security configuration from an xDS server, we should not be acting on the // received security config here. Doing so poses a security threat. - if !b.xdsCredsInUse { + if !b.xdsCredsInUse || config.Equal(b.securityConfig) { return nil } @@ -329,48 +368,25 @@ func (b *clusterImplBalancer) handleSecurityConfig(config *xdsresource.SecurityC // not sent any security configuration. The xdsCredentials implementation // handles this by delegating to its fallback credentials. if config == nil { - // We need to explicitly set the fields to nil here since this might be - // a case of switching from a good security configuration to an empty - // one where fallback credentials are to be used. - b.xdsHIPtr.Store(xds.NewHandshakeInfo(nil, nil, nil, false, "", false, false)) - return nil - - } - - // A root provider is required whether we are using TLS or mTLS. - cpc := b.xdsClient.BootstrapConfig().CertProviderConfigs() - var rootProvider certprovider.Provider - if config.UseSystemRootCerts { - rootProvider = systemRootCertsProvider{} - } else { - rp, err := buildProvider(cpc, config.RootInstanceName, config.RootCertName, false, true) - if err != nil { - return err + b.securityConfig = nil + oldHI := b.xdsHIPtr.Swap(xds.NewHandshakeInfo(nil, nil, nil, "", false, false, false)) + if oldHI != nil { + oldHI.Decrement() } - rootProvider = rp + return nil } - // The identity provider is only present when using mTLS. - var identityProvider certprovider.Provider - if name, cert := config.IdentityInstanceName, config.IdentityCertName; name != "" { - var err error - identityProvider, err = buildProvider(cpc, name, cert, true, false) - if err != nil { - return err - } + rootProvider, identityProvider, err := b.buildProviders(config) + if err != nil { + return err } - // Close the old providers and cache the new ones. - if b.cachedRoot != nil { - b.cachedRoot.Close() - } - if b.cachedIdentity != nil { - b.cachedIdentity.Close() + newHI := xds.NewHandshakeInfo(rootProvider, identityProvider, config.SubjectAltNameMatchers, config.SNI, false, config.AutoSNISANValidation, config.UseAutoHostSNI) + b.securityConfig = config + oldHI := b.xdsHIPtr.Swap(newHI) + if oldHI != nil { + oldHI.Decrement() } - b.cachedRoot = rootProvider - b.cachedIdentity = identityProvider - - b.xdsHIPtr.Store(xds.NewHandshakeInfo(rootProvider, identityProvider, config.SubjectAltNameMatchers, false, config.SNI, config.AutoSNISANValidation, config.UseAutoHostSNI)) return nil } @@ -499,12 +515,11 @@ func (b *clusterImplBalancer) Close() { b.cancelLoadReport(stopCtx) b.cancelLoadReport = nil } - if b.cachedRoot != nil { - b.cachedRoot.Close() - } - if b.cachedIdentity != nil { - b.cachedIdentity.Close() + oldHI := b.xdsHIPtr.Swap(nil) + if oldHI != nil { + oldHI.Decrement() } + b.securityConfig = nil b.logger.Infof("Shutdown") } diff --git a/vendor/google.golang.org/grpc/internal/xds/balancer/outlierdetection/balancer.go b/vendor/google.golang.org/grpc/internal/xds/balancer/outlierdetection/balancer.go index e47ac406716..0904c5d6b49 100644 --- a/vendor/google.golang.org/grpc/internal/xds/balancer/outlierdetection/balancer.go +++ b/vendor/google.golang.org/grpc/internal/xds/balancer/outlierdetection/balancer.go @@ -83,8 +83,8 @@ func (bb) Build(cc balancer.ClientConn, bOpts balancer.BuildOptions) balancer.Ba closed: grpcsync.NewEvent(), done: grpcsync.NewEvent(), addrs: make(map[string]*endpointInfo), - scUpdateCh: buffer.NewUnbounded(), - pickerUpdateCh: buffer.NewUnbounded(), + scUpdateCh: buffer.NewUnbounded[any](), + pickerUpdateCh: buffer.NewUnbounded[any](), channelzParent: bOpts.ChannelzParent, endpoints: resolver.NewEndpointMap[*endpointInfo](), metricsRecorder: cc.MetricsRecorder(), // we use an explicit field instead of using cc.MetricsRecorder() so we can override the metric recorder in tests. @@ -229,8 +229,8 @@ type outlierDetectionBalancer struct { updateUnconditionally bool numEndpointsEjected int // For fast calculations of percentage of endpoints ejected - scUpdateCh *buffer.Unbounded - pickerUpdateCh *buffer.Unbounded + scUpdateCh *buffer.Unbounded[any] + pickerUpdateCh *buffer.Unbounded[any] } // noopConfig returns whether this balancer is configured with a logical no-op diff --git a/vendor/google.golang.org/grpc/internal/xds/balancer/outlierdetection/subconn_wrapper.go b/vendor/google.golang.org/grpc/internal/xds/balancer/outlierdetection/subconn_wrapper.go index bff67741991..ed9d963f974 100644 --- a/vendor/google.golang.org/grpc/internal/xds/balancer/outlierdetection/subconn_wrapper.go +++ b/vendor/google.golang.org/grpc/internal/xds/balancer/outlierdetection/subconn_wrapper.go @@ -40,7 +40,7 @@ type subConnWrapper struct { listener func(balancer.SubConnState) - scUpdateCh *buffer.Unbounded + scUpdateCh *buffer.Unbounded[any] // The following fields are only referenced in the context of a work // serializing buffer and don't need to be protected by a mutex. diff --git a/vendor/google.golang.org/grpc/internal/xds/balancer/priority/balancer.go b/vendor/google.golang.org/grpc/internal/xds/balancer/priority/balancer.go index e842920ffce..7ce430eb285 100644 --- a/vendor/google.golang.org/grpc/internal/xds/balancer/priority/balancer.go +++ b/vendor/google.golang.org/grpc/internal/xds/balancer/priority/balancer.go @@ -61,7 +61,7 @@ func (bb) Build(cc balancer.ClientConn, bOpts balancer.BuildOptions) balancer.Ba cc: cc, done: grpcsync.NewEvent(), children: make(map[string]*childBalancer), - childBalancerStateUpdate: buffer.NewUnbounded(), + childBalancerStateUpdate: buffer.NewUnbounded[any](), } b.logger = prefixLogger(b) @@ -97,7 +97,7 @@ type priorityBalancer struct { cc balancer.ClientConn bg *balancergroup.BalancerGroup done *grpcsync.Event - childBalancerStateUpdate *buffer.Unbounded + childBalancerStateUpdate *buffer.Unbounded[any] mu sync.Mutex childInUse string diff --git a/vendor/google.golang.org/grpc/internal/xds/bootstrap/bootstrap.go b/vendor/google.golang.org/grpc/internal/xds/bootstrap/bootstrap.go index 79fb79020cf..f866da0e8e7 100644 --- a/vendor/google.golang.org/grpc/internal/xds/bootstrap/bootstrap.go +++ b/vendor/google.golang.org/grpc/internal/xds/bootstrap/bootstrap.go @@ -120,6 +120,176 @@ func (ccs CallCredsConfigs) String() string { return strings.Join(creds, ",") } +// AllowedGRPCService contains credentials config for an allowed gRPC service. +type AllowedGRPCService struct { + // targetURI is the fully-qualified side-channel target this entry + // applies to. It is the map key under which the service is stored, + // copied in during parsing so the service is self-describing. + targetURI string + // channelCreds is the list of channel-credential configs from the + // bootstrap JSON. Kept for Equal and MarshalJSON. + channelCreds []ChannelCreds + // callCredsConfigs is the list of call-credential configs from the + // bootstrap JSON. Kept for Equal and MarshalJSON. + callCredsConfigs []CallCredsConfig + // selectedChannelCreds is the first channel-creds entry whose type the + // client supports; it is the one used to build the side channel. + selectedChannelCreds ChannelCreds + // dialOptions are built from the selected channel and call credentials + // and passed to grpc.NewClient when creating the side channel. + dialOptions []grpc.DialOption + // cleanups release resources (credential bundles, file watchers) built + // for this service; run when the owning Config is no longer needed. + cleanups []func() +} + +// TargetURI returns the fully-qualified target URI this service applies to. +func (a *AllowedGRPCService) TargetURI() string { + return a.targetURI +} + +// DialOptions returns the dial options built from this service's selected +// channel and call credentials, for use when creating the side channel. +func (a *AllowedGRPCService) DialOptions() []grpc.DialOption { + return a.dialOptions +} + +// Cleanups returns cleanups to run when the service is no longer needed. +func (a *AllowedGRPCService) Cleanups() []func() { + return a.cleanups +} + +// Equal reports whether a and other are considered equal. +func (a *AllowedGRPCService) Equal(other *AllowedGRPCService) bool { + if a == nil && other == nil { + return true + } + if a == nil || other == nil { + return false + } + if a.targetURI != other.targetURI { + return false + } + if !slices.EqualFunc(a.channelCreds, other.channelCreds, ChannelCreds.Equal) { + return false + } + return slices.EqualFunc(a.callCredsConfigs, other.callCredsConfigs, CallCredsConfig.Equal) +} + +type allowedGRPCServiceJSON struct { + ChannelCreds []ChannelCreds `json:"channel_creds,omitempty"` + CallCredsConfigs []CallCredsConfig `json:"call_creds,omitempty"` +} + +// allowedGRPCServicesEnabled reports whether any feature that consumes the +// allowed_grpc_services field is enabled. Per gRFC A102 the field has no +// dedicated env var; it is guarded by the env vars of its consuming features +// (currently only ext_proc on the client; OR in ext_authz/RLQS guards as +// those features are implemented). +func allowedGRPCServicesEnabled() bool { + return envconfig.XDSClientExtProcEnabled +} + +// AllowedGRPCServices maps a target URI to the credentials gRPC may use for +// that side channel when the xDS server that configured it is untrusted +// (gRFC A102). +type AllowedGRPCServices map[string]*AllowedGRPCService + +// UnmarshalJSON parses and validates the allowed_grpc_services field. The +// field is parsed only when a consuming feature is enabled, so a disabled +// feature can neither build credentials nor fail bootstrap. +func (s *AllowedGRPCServices) UnmarshalJSON(data []byte) error { + if !allowedGRPCServicesEnabled() { + return nil + } + services := make(map[string]*AllowedGRPCService) + if err := json.Unmarshal(data, &services); err != nil { + return err + } + // A JSON null decodes to a nil entry without calling UnmarshalJSON; reject + // it since channel_creds is required, and stamp the target on each service. + for target, svc := range services { + if svc == nil { + return fmt.Errorf("xds: allowed_grpc_services entry %q has no configuration in bootstrap config", target) + } + svc.targetURI = target + } + *s = services + return nil +} + +// UnmarshalJSON parses the JSON data and validates its credentials. +func (a *AllowedGRPCService) UnmarshalJSON(data []byte) (err error) { + var jsonS allowedGRPCServiceJSON + if err := json.Unmarshal(data, &jsonS); err != nil { + return err + } + + // Build into locals and assign the receiver only on success, so a + // mid-parse error never leaves the receiver partially mutated. Credentials + // built before a failure are released by this deferred cleanup. + var cleanups []func() + defer func() { + if err != nil { + for _, f := range cleanups { + f() + } + } + }() + + var credsDialOption grpc.DialOption + var selectedChannelCreds ChannelCreds + for _, cc := range jsonS.ChannelCreds { + c := bootstrap.GetChannelCredentials(cc.Type) + if c == nil { + continue + } + bundle, cancel, err := c.Build(cc.Config) + if err != nil { + return fmt.Errorf("xds: failed to build credentials bundle from bootstrap for allowed grpc service: type %q, err: %v", cc.Type, err) + } + selectedChannelCreds = cc + credsDialOption = grpc.WithCredentialsBundle(bundle) + cleanups = append(cleanups, cancel) + break + } + + // If no channel-creds type in the list was supported, credsDialOption is + // still nil after the loop; that is a validation error. + if credsDialOption == nil { + return fmt.Errorf("xds: no supported channel credentials found for allowed grpc service in config:\n%s", string(data)) + } + dialOptions := []grpc.DialOption{credsDialOption} + + for _, cfg := range jsonS.CallCredsConfigs { + c := bootstrap.GetCallCredentials(cfg.Type) + if c == nil { + continue + } + callCreds, cancel, err := c.Build(cfg.Config) + if err != nil { + return fmt.Errorf("xds: failed to build call credentials from bootstrap for allowed grpc service: type %q, err: %v", cfg.Type, err) + } + dialOptions = append(dialOptions, grpc.WithPerRPCCredentials(callCreds)) + cleanups = append(cleanups, cancel) + } + + a.channelCreds = jsonS.ChannelCreds + a.callCredsConfigs = jsonS.CallCredsConfigs + a.selectedChannelCreds = selectedChannelCreds + a.dialOptions = dialOptions + a.cleanups = cleanups + return nil +} + +// MarshalJSON marshals the allowed gRPC service into JSON format. +func (a *AllowedGRPCService) MarshalJSON() ([]byte, error) { + return json.Marshal(allowedGRPCServiceJSON{ + ChannelCreds: a.channelCreds, + CallCredsConfigs: a.callCredsConfigs, + }) +} + // ServerConfigs represents a collection of server configurations. type ServerConfigs []*ServerConfig @@ -461,6 +631,16 @@ type Config struct { // A map from certprovider instance names to parsed buildable configs. certProviderConfigs map[string]*certprovider.BuildableConfig + + // allowedGRPCServices is the side-channel allowlist parsed from the + // allowed_grpc_services field (gRFC A102). + allowedGRPCServices AllowedGRPCServices +} + +// AllowedGRPCServices returns the allowlist of gRPC services. +// Callers must not modify the returned map. +func (c *Config) AllowedGRPCServices() AllowedGRPCServices { + return c.allowedGRPCServices } // XDSServers returns the top-level list of management servers to connect to, @@ -550,7 +730,9 @@ func (c *Config) Equal(other *Config) bool { return false case c.clientDefaultListenerResourceNameTemplate != other.clientDefaultListenerResourceNameTemplate: return false - case !maps.EqualFunc(c.authorities, other.authorities, func(a, b *Authority) bool { return a.Equal(b) }): + case !maps.EqualFunc(c.authorities, other.authorities, (*Authority).Equal): + return false + case !maps.EqualFunc(c.allowedGRPCServices, other.allowedGRPCServices, (*AllowedGRPCService).Equal): return false case !c.node.Equal(other.node): return false @@ -572,6 +754,7 @@ type configJSON struct { ClientDefaultListenerResourceNameTemplate string `json:"client_default_listener_resource_name_template,omitempty"` Authorities map[string]*Authority `json:"authorities,omitempty"` Node node `json:"node,omitempty"` + AllowedGRPCServices AllowedGRPCServices `json:"allowed_grpc_services,omitempty"` } // MarshalJSON returns marshaled JSON bytes corresponding to this config. @@ -583,6 +766,7 @@ func (c *Config) MarshalJSON() ([]byte, error) { ClientDefaultListenerResourceNameTemplate: c.clientDefaultListenerResourceNameTemplate, Authorities: c.authorities, Node: c.node, + AllowedGRPCServices: c.allowedGRPCServices, } return json.MarshalIndent(config, " ", " ") } @@ -594,6 +778,12 @@ func (c *Config) UnmarshalJSON(data []byte) error { // even if the bootstrap configuration did not contain the node field, we // will have a node field with client controlled fields alone. config := configJSON{Node: newNode()} + + // Credentials (bundles, file watchers) eagerly built during unmarshaling + // are intentionally not released if parsing fails below: a failed + // bootstrap is parsed once per process (the xDS client pool memoizes + // GetConfiguration via sync.OnceValues) and is treated as fatal, so the + // leak is bounded and one-time. if err := json.Unmarshal(data, &config); err != nil { return fmt.Errorf("xds: json.Unmarshal(%s) failed during bootstrap: %v", string(data), err) } @@ -604,6 +794,7 @@ func (c *Config) UnmarshalJSON(data []byte) error { c.clientDefaultListenerResourceNameTemplate = config.ClientDefaultListenerResourceNameTemplate c.authorities = config.Authorities c.node = config.Node + c.allowedGRPCServices = config.AllowedGRPCServices // Build the certificate providers configuration to ensure that it is valid. cpcCfgs := make(map[string]*certprovider.BuildableConfig) @@ -723,6 +914,8 @@ type ConfigOptionsForTesting struct { // Node identifies the gRPC client/server node in the // proxyless service mesh. Node json.RawMessage + // AllowedGRPCServices is the allowlist of gRPC services. + AllowedGRPCServices json.RawMessage } // NewContentsForTesting creates a new bootstrap configuration from the passed in @@ -754,6 +947,23 @@ func NewContentsForTesting(opts ConfigOptionsForTesting) ([]byte, error) { if err := json.Unmarshal(opts.Node, &node); err != nil { return nil, fmt.Errorf("failed to unmarshal node configuration %s: %v", string(opts.Node), err) } + allowedGRPCServices := make(AllowedGRPCServices) + if len(opts.AllowedGRPCServices) > 0 { + if err := json.Unmarshal(opts.AllowedGRPCServices, &allowedGRPCServices); err != nil { + return nil, fmt.Errorf("failed to unmarshal allowed_grpc_services configuration: %v", err) + } + // Only the parsed config is needed to marshal the bootstrap JSON below; + // release the credentials built during unmarshal so this test helper + // does not leak file watchers. + for _, svc := range allowedGRPCServices { + if svc == nil { + continue + } + for _, cleanup := range svc.Cleanups() { + cleanup() + } + } + } cfgJSON := configJSON{ XDSServers: servers, CertificateProviders: certProviders, @@ -761,6 +971,7 @@ func NewContentsForTesting(opts ConfigOptionsForTesting) ([]byte, error) { ClientDefaultListenerResourceNameTemplate: opts.ClientDefaultListenerResourceNameTemplate, Authorities: authorities, Node: node, + AllowedGRPCServices: allowedGRPCServices, } contents, err := json.MarshalIndent(cfgJSON, " ", " ") if err != nil { diff --git a/vendor/google.golang.org/grpc/internal/xds/clients/internal/buffer/unbounded.go b/vendor/google.golang.org/grpc/internal/xds/clients/internal/buffer/unbounded.go index 52b8dab892b..4d3527d596e 100644 --- a/vendor/google.golang.org/grpc/internal/xds/clients/internal/buffer/unbounded.go +++ b/vendor/google.golang.org/grpc/internal/xds/clients/internal/buffer/unbounded.go @@ -27,32 +27,29 @@ import ( // extra goroutines. This is typically used for passing updates from one entity // to another within gRPC. // +// To avoid extra memory allocations and type assertions, using any on +// performance-critical code paths is discouraged. Use concrete types wherever +// possible when instantiating Unbounded. +// // All methods on this type are thread-safe and don't block on anything except // the underlying mutex used for synchronization. -// -// Unbounded supports values of any type to be stored in it by using a channel -// of `any`. This means that a call to Put() incurs an extra memory allocation, -// and also that users need a type assertion while reading. For performance -// critical code paths, using Unbounded is strongly discouraged and defining a -// new type specific implementation of this buffer is preferred. See -// internal/transport/transport.go for an example of this. -type Unbounded struct { - c chan any +type Unbounded[T any] struct { + c chan T closed bool closing bool mu sync.Mutex - backlog []any + backlog []T } // NewUnbounded returns a new instance of Unbounded. -func NewUnbounded() *Unbounded { - return &Unbounded{c: make(chan any, 1)} +func NewUnbounded[T any]() *Unbounded[T] { + return &Unbounded[T]{c: make(chan T, 1)} } var errBufferClosed = errors.New("Put() called on closed buffer.Unbounded") // Put adds t to the unbounded buffer. -func (b *Unbounded) Put(t any) error { +func (b *Unbounded[T]) Put(t T) error { b.mu.Lock() defer b.mu.Unlock() if b.closing { @@ -72,13 +69,14 @@ func (b *Unbounded) Put(t any) error { // Load sends the earliest buffered data, if any, onto the read channel returned // by Get(). Users are expected to call this every time they successfully read a // value from the read channel. -func (b *Unbounded) Load() { +func (b *Unbounded[T]) Load() { b.mu.Lock() defer b.mu.Unlock() if len(b.backlog) > 0 { select { case b.c <- b.backlog[0]: - b.backlog[0] = nil + var zero T + b.backlog[0] = zero b.backlog = b.backlog[1:] default: } @@ -96,14 +94,14 @@ func (b *Unbounded) Load() { // // If the unbounded buffer is closed, the read channel returned by this method // is closed after all data is drained. -func (b *Unbounded) Get() <-chan any { +func (b *Unbounded[T]) Get() <-chan T { return b.c } // Close closes the unbounded buffer. No subsequent data may be Put(), and the // channel returned from Get() will be closed after all the data is read and // Load() is called for the final time. -func (b *Unbounded) Close() { +func (b *Unbounded[T]) Close() { b.mu.Lock() defer b.mu.Unlock() if b.closing { diff --git a/vendor/google.golang.org/grpc/internal/xds/clients/internal/syncutil/callback_serializer.go b/vendor/google.golang.org/grpc/internal/xds/clients/internal/syncutil/callback_serializer.go index baab133f244..54dc6e4746e 100644 --- a/vendor/google.golang.org/grpc/internal/xds/clients/internal/syncutil/callback_serializer.go +++ b/vendor/google.golang.org/grpc/internal/xds/clients/internal/syncutil/callback_serializer.go @@ -36,7 +36,7 @@ type CallbackSerializer struct { // its resources. done chan struct{} - callbacks *buffer.Unbounded + callbacks *buffer.Unbounded[func(context.Context)] } // NewCallbackSerializer returns a new CallbackSerializer instance. The provided @@ -47,7 +47,7 @@ type CallbackSerializer struct { func NewCallbackSerializer(ctx context.Context) *CallbackSerializer { cs := &CallbackSerializer{ done: make(chan struct{}), - callbacks: buffer.NewUnbounded(), + callbacks: buffer.NewUnbounded[func(context.Context)](), } go cs.run(ctx) return cs @@ -87,7 +87,7 @@ func (cs *CallbackSerializer) run(ctx context.Context) { // Run all callbacks. for cb := range cs.callbacks.Get() { cs.callbacks.Load() - cb.(func(context.Context))(ctx) + cb(ctx) } } diff --git a/vendor/google.golang.org/grpc/internal/xds/clients/xdsclient/authority.go b/vendor/google.golang.org/grpc/internal/xds/clients/xdsclient/authority.go index 3b5666bf1bb..f5d78eb0948 100644 --- a/vendor/google.golang.org/grpc/internal/xds/clients/xdsclient/authority.go +++ b/vendor/google.golang.org/grpc/internal/xds/clients/xdsclient/authority.go @@ -347,7 +347,7 @@ func (a *authority) handleADSResourceUpdate(serverConfig *ServerConfig, rType Re onDone() } } - funcsToSchedule := []func(context.Context){} + var funcsToSchedule []func(context.Context) defer func() { if len(funcsToSchedule) == 0 { // When there are no watchers for the resources received as part of @@ -368,26 +368,35 @@ func (a *authority) handleADSResourceUpdate(serverConfig *ServerConfig, rType Re continue } - // On error, keep previous version of the resource. But update status - // and error. - if uErr.Err != nil { + if err := uErr.Err; err != nil { if a.metricsReporter != nil { a.metricsReporter.ReportMetric(&metrics.ResourceUpdateInvalid{ ServerURI: serverConfig.ServerIdentifier.ServerURI, ResourceType: rType.TypeName, }) } - state.md.ErrState = md.ErrState - state.md.Status = md.Status - for watcher := range state.watchers { - watcher := watcher - err := uErr.Err - watcherCnt.Add(1) - if state.cache == nil { - funcsToSchedule = append(funcsToSchedule, func(context.Context) { watcher.ResourceError(err, done) }) - } else { - funcsToSchedule = append(funcsToSchedule, func(context.Context) { watcher.AmbientError(err, done) }) + + // Notify watchers only if this is not a duplicated error from the previous update. + if errState := state.md.ErrState; errState == nil || errState.Err == nil || state.md.ErrState.Err.Error() != err.Error() { + for watcher := range state.watchers { + watcherCnt.Add(1) + if state.cache == nil { + funcsToSchedule = append(funcsToSchedule, func(context.Context) { watcher.ResourceError(err, done) }) + } else { + funcsToSchedule = append(funcsToSchedule, func(context.Context) { watcher.AmbientError(err, done) }) + } } } + + // On error, keep previous version of the resource. But update + // status to NACKed and capture the specific per-resource error (and + // not the overall error for the update) in the ErrState field. + state.md.Status = xdsresource.ServiceStatusNACKed + state.md.ErrState = &xdsresource.UpdateErrorMetadata{ + Version: md.ErrState.Version, + Err: err, + Timestamp: md.ErrState.Timestamp, + } + continue } @@ -414,7 +423,6 @@ func (a *authority) handleADSResourceUpdate(serverConfig *ServerConfig, rType Re state.cache = uErr.Resource for watcher := range state.watchers { - watcher := watcher resource := uErr.Resource watcherCnt.Add(1) funcsToSchedule = append(funcsToSchedule, func(context.Context) { watcher.ResourceChanged(resource, done) }) @@ -492,7 +500,6 @@ func (a *authority) handleADSResourceUpdate(serverConfig *ServerConfig, rType Re state.cache = nil state.md = xdsresource.UpdateMetadata{Status: xdsresource.ServiceStatusNotExist} for watcher := range state.watchers { - watcher := watcher watcherCnt.Add(1) funcsToSchedule = append(funcsToSchedule, func(context.Context) { watcher.ResourceError(xdsresource.NewErrorf(xdsresource.ErrorTypeResourceNotFound, "xds: resource %q of type %q has been removed", name, rType.TypeName), done) diff --git a/vendor/google.golang.org/grpc/internal/xds/httpfilter/extconfig.go b/vendor/google.golang.org/grpc/internal/xds/httpfilter/extconfig.go index f93ab5bfa17..cd68714b2a4 100644 --- a/vendor/google.golang.org/grpc/internal/xds/httpfilter/extconfig.go +++ b/vendor/google.golang.org/grpc/internal/xds/httpfilter/extconfig.go @@ -19,15 +19,24 @@ package httpfilter import ( + "encoding/base64" "fmt" "regexp" + "strings" + imetadata "google.golang.org/grpc/internal/metadata" "google.golang.org/grpc/internal/xds/matcher" + "google.golang.org/grpc/metadata" v3mutationpb "github.com/envoyproxy/go-control-plane/envoy/config/common/mutation_rules/v3" + v3corepb "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" v3matcherpb "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3" ) +// maxHeaderSize is the maximum length, in bytes, of a header key or value in a +// mutation received from an external processing server. +const maxHeaderSize = 16384 + // HeaderMutationRules specifies the rules for what modifications an external // processing server may make to headers sent on the data plane RPC. type HeaderMutationRules struct { @@ -86,3 +95,232 @@ func HeaderMutationRulesFromProto(mr *v3mutationpb.HeaderMutationRules) (HeaderM rules.DisallowIsError = mr.GetDisallowIsError().GetValue() return rules, nil } + +// ApplyAdditions takes a set of header mutations (for additions and +// modifications) received from an external server and applies them to the +// provided metadata, subject to the rules defined in hmr. +// +// If the DisallowAll field is true, no mutations are performed, and the input +// metadata is returned unmodified. +// +// It iterates through each header mutation, performs validation on the header +// key and value, and checks if the mutation is permitted by the AllowExpr and +// DisallowExpr regular expressions. +// +// A mutation for any of the following headers fails validation and an error is +// returned: +// - Pseudo-headers (keys starting with ':'). +// - The 'host' header. +// - Headers with keys in the reserved 'grpc-' space. +// - Headers with non-lowercase keys. +// - Headers with keys or values exceeding 16384 bytes. +// - Headers with an invalid gRPC header name or header value. +// +// If a mutation is disallowed by the mutation rules and DisallowIsError is +// true, an error is returned. Otherwise, the disallowed mutation is silently +// ignored. +// +// The input metadata must not be nil. +func (hmr *HeaderMutationRules) ApplyAdditions(hvos []*v3corepb.HeaderValueOption, input metadata.MD) error { + if hmr == nil { + hmr = &HeaderMutationRules{} + } + if input == nil { + return fmt.Errorf("input metadata is nil") + } + if hmr.DisallowAll { + return nil + } + + for _, hvo := range hvos { + header := hvo.GetHeader() + key := header.GetKey() + if err := validateHeaderKey(key); err != nil { + return fmt.Errorf("invalid header mutation: %v", err) + } + + value := header.GetValue() + if strings.HasSuffix(key, "-bin") { + value = string(header.GetRawValue()) + } + if len(value) > maxHeaderSize { + return fmt.Errorf("invalid header mutation: value for header key %q exceeds the maximum length of %d bytes", key, maxHeaderSize) + } + // ValidatePair rejects values carrying bytes outside %x20-%x7E. It + // skips the value check for "-bin" keys, whose values the transport + // base64 encodes. + if err := imetadata.ValidatePair(key, value); err != nil { + return fmt.Errorf("invalid header mutation: %v", err) + } + + if !hmr.allow(key) { + if hmr.DisallowIsError { + return fmt.Errorf("header mutation disallowed by headerMutationRules for header key %q", key) + } + continue + } + + // Perform the mutation on output metadata using the append_action + // field from the header value option. + switch hvo.GetAppendAction() { + case v3corepb.HeaderValueOption_APPEND_IF_EXISTS_OR_ADD: + input.Append(key, value) + case v3corepb.HeaderValueOption_ADD_IF_ABSENT: + if input.Get(key) == nil { + input.Set(key, value) + } + case v3corepb.HeaderValueOption_OVERWRITE_IF_EXISTS_OR_ADD: + input.Set(key, value) + case v3corepb.HeaderValueOption_OVERWRITE_IF_EXISTS: + if input.Get(key) != nil { + input.Set(key, value) + } + } + } + return nil +} + +// ApplyRemovals takes a set of headers (for removal) received from an external +// processing server and applies them to the provided metadata, subject to the +// rules defined in hmr. +// +// This method is very similar to ApplyAdditions, except that headers are +// removed here instead of added or mutated as is the case in the latter. See +// ApplyAdditions for more details. +// +// The input metadata must not be nil. +func (hmr *HeaderMutationRules) ApplyRemovals(headersToRemove []string, input metadata.MD) error { + if hmr == nil { + hmr = &HeaderMutationRules{} + } + if input == nil { + return fmt.Errorf("input metadata is nil") + } + if hmr.DisallowAll { + return nil + } + + for _, header := range headersToRemove { + if err := validateHeaderKey(header); err != nil { + return fmt.Errorf("invalid header mutation: %v", err) + } + if !hmr.allow(header) { + if hmr.DisallowIsError { + return fmt.Errorf("header mutation disallowed by headerMutationRules for header %q", header) + } + continue + } + input.Delete(header) + } + return nil +} + +// validateHeaderKey returns a non-nil error if key may not be mutated by an +// external processing server, either because the key is reserved or because it +// is not a valid gRPC header name. +func validateHeaderKey(key string) error { + switch { + case len(key) == 0: + return fmt.Errorf("header key is empty") + case key[0] == ':': + return fmt.Errorf("header key %q is a pseudo-header", key) + case key == "host": + return fmt.Errorf("header key %q is reserved", key) + case strings.HasPrefix(key, "grpc-"): + return fmt.Errorf("header key %q is in the reserved 'grpc-' space", key) + case key != strings.ToLower(key): + return fmt.Errorf("header key %q is not lowercase", key) + case len(key) > maxHeaderSize: + return fmt.Errorf("header key exceeds the maximum length of %d bytes", maxHeaderSize) + } + return imetadata.ValidateKey(key) +} + +func (hmr *HeaderMutationRules) allow(key string) bool { + if hmr.DisallowExpr != nil && hmr.DisallowExpr.MatchString(key) { + return false + } + if hmr.AllowExpr != nil && hmr.AllowExpr.MatchString(key) { + return true + } + if hmr.AllowExpr != nil { + return false + } + return true +} + +// ConstructHeaderMap constructs a HeaderMap from the given metadata and raw +// appended metadata slice, using the following rules: +// - if the header is matched by the disallowed_headers config field, it will +// not be added to the map, otherwise, +// - if the allowed_headers config field is unset or matches the header, the +// header will be added to the map, otherwise, +// - the header will be excluded from the map. +func ConstructHeaderMap(md metadata.MD, added [][]string, allowedHeaders, disallowedHeaders []matcher.StringMatcher) *v3corepb.HeaderMap { + headerMap := &v3corepb.HeaderMap{} + // Process the base metadata map. + for key, values := range md { + if isDisallowedHeader(key, disallowedHeaders) { + continue + } + if isAllowedHeader(key, allowedHeaders) { + for _, value := range values { + headerMap.Headers = append(headerMap.Headers, constructHeader(key, value)) + } + } + } + // Process the raw appended metadata slice. + for _, kvs := range added { + for i := 0; i < len(kvs); i += 2 { + key := strings.ToLower(kvs[i]) + if isDisallowedHeader(key, disallowedHeaders) { + continue + } + if isAllowedHeader(key, allowedHeaders) { + headerMap.Headers = append(headerMap.Headers, constructHeader(key, kvs[i+1])) + } + } + } + if len(headerMap.Headers) == 0 { + return nil + } + return headerMap +} + +func constructHeader(key, value string) *v3corepb.HeaderValue { + rawValue := []byte(value) + if strings.HasSuffix(key, "-bin") { + encoded := make([]byte, base64.StdEncoding.EncodedLen(len(rawValue))) + base64.StdEncoding.Encode(encoded, rawValue) + rawValue = encoded + } + return &v3corepb.HeaderValue{ + Key: key, + RawValue: rawValue, + } +} + +// isDisallowedHeader returns true if the given header key matches any of the +// provided disallowed header matchers. +func isDisallowedHeader(key string, matchers []matcher.StringMatcher) bool { + for _, m := range matchers { + if m.Match(key) { + return true + } + } + return false +} + +// isAllowedHeader returns true if the allowed header matchers list is empty, or +// if the given header key matches any of the provided allowed header matchers. +func isAllowedHeader(key string, matchers []matcher.StringMatcher) bool { + if len(matchers) == 0 { + return true + } + for _, m := range matchers { + if m.Match(key) { + return true + } + } + return false +} diff --git a/vendor/google.golang.org/grpc/internal/xds/httpfilter/extproc/config.go b/vendor/google.golang.org/grpc/internal/xds/httpfilter/extproc/config.go new file mode 100644 index 00000000000..e3300d3c1d4 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/xds/httpfilter/extproc/config.go @@ -0,0 +1,184 @@ +/* + * + * Copyright 2026 gRPC authors. + * + * 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 extproc + +import ( + "time" + + "google.golang.org/grpc/internal/optional" + "google.golang.org/grpc/internal/xds/httpfilter" + "google.golang.org/grpc/internal/xds/matcher" + "google.golang.org/grpc/internal/xds/xdsclient/xdsresource" + + v3procfilterpb "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3" +) + +// baseConfig contains the configuration for the external processing +// interceptor. +type baseConfig struct { + httpfilter.FilterConfig + + // The following fields can be set either in the filter config or the override + // config. If both are set, the override config will be used. + + // server is the configuration for the external processing server. + server xdsresource.GRPCServiceConfig + // processingModes specifies the processing mode for each dataplane event. + processingModes processingModes + // failureModeAllow specifies the behavior when the RPC to the external + // processing server fails. If true, the dataplane RPC will be allowed to + // continue. If false, the data plane RPC will be failed with a grpc status + // code of INTERNAL. + failureModeAllow bool + // Attributes to be sent to the external processing server along with the + // request and response dataplane events. + requestAttributes []string + responseAttributes []string + + // The following fields can only be set in the base config. + + // mutationRules specifies the rules for what modifications an external + // processing server may make to headers/trailers sent to it. + mutationRules httpfilter.HeaderMutationRules + // allowedHeaders specifies the headers that are allowed to be sent to the + // external processing server. If unset, all headers are allowed. + allowedHeaders []matcher.StringMatcher + // disallowedHeaders specifies the headers that will not be sent to the + // external processing server. This overrides the above allowedHeaders if a + // header matches both. + disallowedHeaders []matcher.StringMatcher + // disableImmediateResponse specifies whether to disable immediate responses + // from the external processing server. When true, any immediate response + // received from the server is treated as an error (causing the stream to fail + // with an Internal error, or to be bypassed if failureModeAllow is true). + // When false, the immediate response is honored, and the stream is aborted + // with the specified status code and details provided by the external + // processing server. + disableImmediateResponse bool + // observabilityMode determines if the filter waits for the external + // processing server. If true, events are sent to the server in + // "observation-only" mode; the filter does not wait for a response. If false, + // the filter waits for a response, allowing the server to modify events + // before they reach the dataplane. + observabilityMode bool + // deferredCloseTimeout is the duration the filter waits before closing the + // external processing stream after the dataplane RPC completes. This is only + // applicable when observabilityMode is true; otherwise, it is ignored. The + // default value is 5 seconds. + deferredCloseTimeout time.Duration +} + +// overrideConfig contains the configuration for the external processing +// interceptor used for overriding the base config. If a particular field is +// set, that will be used instead of the base config. The fields are similar to +// base config. +type overrideConfig struct { + httpfilter.FilterConfig + server optional.Optional[xdsresource.GRPCServiceConfig] + processingModes optional.Optional[processingModes] + failureModeAllow optional.Optional[bool] + requestAttributes []string + responseAttributes []string +} + +// processingMode defines how headers, trailers, and bodies are handled in +// relation to the external processing server. +type processingMode int + +const ( + // modeSkip indicates that the header/trailer/body should not be sent. + modeSkip processingMode = iota + // modeSend indicates that the header/trailer/body should be sent. + modeSend +) + +type processingModes struct { + requestHeaderMode processingMode + requestBodyMode processingMode + responseHeaderMode processingMode + responseTrailerMode processingMode + responseBodyMode processingMode +} + +// resolveHeaderMode resolves the processing mode for headers based on the +// protobuf enum value. If the mode is not set or set to Default processing +// mode, it returns the provided defaultMode. +func resolveHeaderMode(mode v3procfilterpb.ProcessingMode_HeaderSendMode, defaultMode processingMode) processingMode { + switch mode { + case v3procfilterpb.ProcessingMode_SEND: + return modeSend + case v3procfilterpb.ProcessingMode_SKIP: + return modeSkip + case v3procfilterpb.ProcessingMode_DEFAULT: + return defaultMode + default: + return defaultMode + } +} + +// resolveBodyMode resolves the processing mode for body based on the protobuf +// enum value. If the mode is not set (i.e., default), it returns modeSkip, as +// the default for body is to skip. +func resolveBodyMode(mode v3procfilterpb.ProcessingMode_BodySendMode) processingMode { + switch mode { + case v3procfilterpb.ProcessingMode_GRPC: + return modeSend + case v3procfilterpb.ProcessingMode_NONE: + return modeSkip + default: + return modeSkip + } +} + +// processingModesFromProto converts a protobuf ProcessingMode message +// to a processingModes struct. +func processingModesFromProto(pm *v3procfilterpb.ProcessingMode) processingModes { + return processingModes{ + requestHeaderMode: resolveHeaderMode(pm.GetRequestHeaderMode(), modeSend), + requestBodyMode: resolveBodyMode(pm.GetRequestBodyMode()), + responseHeaderMode: resolveHeaderMode(pm.GetResponseHeaderMode(), modeSend), + responseBodyMode: resolveBodyMode(pm.GetResponseBodyMode()), + responseTrailerMode: resolveHeaderMode(pm.GetResponseTrailerMode(), modeSkip), + } +} + +// newInterceptorConfig creates the interceptor config from the base and +// override filter configs. If a field is set in both the base and override +// configs, the value from the override config will be used. +func newInterceptorConfig(base baseConfig, override overrideConfig) baseConfig { + ic := base + + // Apply overrides if present. + if val, ok := override.server.Value(); ok { + ic.server = val + } + if val, ok := override.failureModeAllow.Value(); ok { + ic.failureModeAllow = val + } + if override.requestAttributes != nil { + ic.requestAttributes = override.requestAttributes + } + if override.responseAttributes != nil { + ic.responseAttributes = override.responseAttributes + } + if val, ok := override.processingModes.Value(); ok { + ic.processingModes = val + } + return ic +} diff --git a/vendor/google.golang.org/grpc/internal/xds/httpfilter/extproc/ext_proc.go b/vendor/google.golang.org/grpc/internal/xds/httpfilter/extproc/ext_proc.go new file mode 100644 index 00000000000..2afe59b2935 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/xds/httpfilter/extproc/ext_proc.go @@ -0,0 +1,2012 @@ +/* + * + * Copyright 2026 gRPC authors. + * + * 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 extproc implements the Envoy external processing HTTP filter. +package extproc + +import ( + "context" + "errors" + "fmt" + "io" + "strings" + "sync" + "sync/atomic" + "time" + + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + estats "google.golang.org/grpc/experimental/stats" + "google.golang.org/grpc/internal" + "google.golang.org/grpc/internal/buffer" + "google.golang.org/grpc/internal/envconfig" + "google.golang.org/grpc/internal/grpcsync" + "google.golang.org/grpc/internal/optional" + "google.golang.org/grpc/internal/resolver" + "google.golang.org/grpc/internal/xds/httpfilter" + iextproc "google.golang.org/grpc/internal/xds/httpfilter/extproc/internal" + "google.golang.org/grpc/internal/xds/matcher" + "google.golang.org/grpc/internal/xds/xdsclient/xdsresource" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/types/known/anypb" + "google.golang.org/protobuf/types/known/structpb" + + v3procfilterpb "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3" + v3procservicegrpc "github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3" + v3procservicepb "github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3" +) + +func init() { + if envconfig.XDSClientExtProcEnabled { + httpfilter.Register(builder{}) + } + iextproc.RegisterForTesting = func() { + httpfilter.Register(builder{}) + } + iextproc.UnregisterForTesting = func() { + for _, typeURL := range builder.TypeURLs(builder{}) { + httpfilter.UnregisterForTesting(typeURL) + } + } + iextproc.TimeNowFunc = time.Now + iextproc.TimeSinceFunc = time.Since +} + +var metadataFromOutgoingContextRaw = internal.FromOutgoingContextRaw.(func(context.Context) (metadata.MD, [][]string, bool)) + +const defaultDeferredCloseTimeout = 5 * time.Second + +func timeNow() time.Time { + return iextproc.TimeNowFunc() +} + +func timeSince(t time.Time) time.Duration { + return iextproc.TimeSinceFunc(t) +} + +type builder struct{} + +func (builder) TypeURLs() []string { + return []string{ + "type.googleapis.com/envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor", + "type.googleapis.com/envoy.extensions.filters.http.ext_proc.v3.ExtProcPerRoute", + } +} + +// validateBodyProcessingMode ensures that the body processing mode is either +// NONE or GRPC. Also ensures that if response body mode is GRPC then response +// trailer mode must be SEND. +func validateBodyProcessingMode(mode *v3procfilterpb.ProcessingMode) error { + if m := mode.GetRequestBodyMode(); m != v3procfilterpb.ProcessingMode_NONE && m != v3procfilterpb.ProcessingMode_GRPC { + return fmt.Errorf("extproc: invalid request body mode %v: want %q or %q", m, "NONE", "GRPC") + } + if m := mode.GetResponseBodyMode(); m != v3procfilterpb.ProcessingMode_NONE && m != v3procfilterpb.ProcessingMode_GRPC { + return fmt.Errorf("extproc: invalid response body mode %v: want %q or %q", m, "NONE", "GRPC") + } + if mode.GetResponseBodyMode() == v3procfilterpb.ProcessingMode_GRPC && mode.GetResponseTrailerMode() != v3procfilterpb.ProcessingMode_SEND { + return fmt.Errorf("extproc: invalid response trailer mode %v: must be %q when response body mode is %q", mode.GetResponseTrailerMode(), "SEND", "GRPC") + } + return nil +} + +func (builder) ParseFilterConfig(cfg proto.Message, _ httpfilter.ParseOptions) (httpfilter.FilterConfig, error) { + m, ok := cfg.(*anypb.Any) + if !ok { + return nil, fmt.Errorf("extproc: error parsing config %v: unknown type %T, want *anypb.Any", cfg, cfg) + } + msg := new(v3procfilterpb.ExternalProcessor) + if err := m.UnmarshalTo(msg); err != nil { + return nil, fmt.Errorf("extproc: failed to unmarshal config %v: %v", cfg, err) + } + if msg.GetProcessingMode() == nil { + return nil, fmt.Errorf("extproc: missing processing_mode in config %v", cfg) + } + if err := validateBodyProcessingMode(msg.GetProcessingMode()); err != nil { + return nil, err + } + + if msg.GetGrpcService() == nil { + return nil, fmt.Errorf("extproc: empty grpc_service provided in config %v", cfg) + } + server, err := iextproc.ParseGRPCServiceConfig(msg.GetGrpcService()) + if err != nil { + return nil, fmt.Errorf("extproc: failed to parse grpc_service %v", err) + } + + mutationRules, err := httpfilter.HeaderMutationRulesFromProto(msg.GetMutationRules()) + if err != nil { + return nil, err + } + + var allowedHeaders, disallowedHeaders []matcher.StringMatcher + if allowed := msg.GetForwardRules().GetAllowedHeaders(); allowed != nil { + allowedHeaders, err = httpfilter.ConvertStringMatchers(allowed.GetPatterns()) + if err != nil { + return nil, err + } + } + + if disallowed := msg.GetForwardRules().GetDisallowedHeaders(); disallowed != nil { + disallowedHeaders, err = httpfilter.ConvertStringMatchers(disallowed.GetPatterns()) + if err != nil { + return nil, err + } + } + + deferredCloseTimeout := defaultDeferredCloseTimeout + if msg.GetDeferredCloseTimeout() != nil { + deferredCloseTimeout = msg.GetDeferredCloseTimeout().AsDuration() + } + + return baseConfig{ + processingModes: processingModesFromProto(msg.GetProcessingMode()), + requestAttributes: msg.GetRequestAttributes(), + responseAttributes: msg.GetResponseAttributes(), + disableImmediateResponse: msg.GetDisableImmediateResponse(), + observabilityMode: msg.GetObservabilityMode(), + failureModeAllow: msg.GetFailureModeAllow(), + server: server, + mutationRules: mutationRules, + allowedHeaders: allowedHeaders, + disallowedHeaders: disallowedHeaders, + deferredCloseTimeout: deferredCloseTimeout, + }, nil +} + +func (builder) ParseFilterConfigOverride(ov proto.Message, _ httpfilter.ParseOptions) (httpfilter.FilterConfig, error) { + m, ok := ov.(*anypb.Any) + if !ok { + return nil, fmt.Errorf("extproc: error parsing override %v: unknown type %T, want *anypb.Any", ov, ov) + } + msg := new(v3procfilterpb.ExtProcPerRoute) + if err := m.UnmarshalTo(msg); err != nil { + return nil, fmt.Errorf("extproc: failed to unmarshal override %v: %v", ov, err) + } + override := msg.GetOverrides() + + var processingModesOpt optional.Optional[processingModes] + if pm := override.GetProcessingMode(); pm != nil { + if err := validateBodyProcessingMode(pm); err != nil { + return nil, err + } + processingModesOpt = optional.New(processingModesFromProto(pm)) + } + + var serverOpt optional.Optional[xdsresource.GRPCServiceConfig] + if override.GetGrpcService() != nil { + server, err := iextproc.ParseGRPCServiceConfig(override.GetGrpcService()) + if err != nil { + return nil, fmt.Errorf("extproc: failed to parse grpc_service: %v", err) + } + serverOpt = optional.New(server) + } + + var failureModeAllowOpt optional.Optional[bool] + if override.GetFailureModeAllow() != nil { + failureModeAllowOpt = optional.New(override.GetFailureModeAllow().GetValue()) + } + + return overrideConfig{ + server: serverOpt, + processingModes: processingModesOpt, + failureModeAllow: failureModeAllowOpt, + requestAttributes: override.GetRequestAttributes(), + responseAttributes: override.GetResponseAttributes(), + }, nil +} + +func (builder) IsTerminal() bool { + return false +} + +func (builder) BuildClientFilter(opts httpfilter.ClientFilterOptions) httpfilter.ClientFilter { + return &clientFilter{ + metricsRecorder: opts.MetricsRecorder, + target: opts.Target, + procChannels: make(map[grpcServiceKey]*grpcsync.RefCounted[v3procservicegrpc.ExternalProcessorClient]), + } +} + +var _ httpfilter.ClientFilterBuilder = builder{} + +// grpcServiceKey uniquely identifies an external processor server configuration +// by its target URI, channel credentials, and call credentials. It is used as a +// map key in clientFilter to share and reuse the external processor channels. +type grpcServiceKey struct { + targetURI string + channelCredentials string + callCredentials string +} + +type clientFilter struct { + metricsRecorder estats.MetricsRecorder + target string + + mu sync.Mutex + procChannels map[grpcServiceKey]*grpcsync.RefCounted[v3procservicegrpc.ExternalProcessorClient] +} + +func (*clientFilter) Close() {} + +// getProcChannel returns an existing refcounted client from the map if present +// and its refcount is incremented successfully. +func (cf *clientFilter) getProcChannel(key grpcServiceKey) *grpcsync.RefCounted[v3procservicegrpc.ExternalProcessorClient] { + cf.mu.Lock() + defer cf.mu.Unlock() + if rc, ok := cf.procChannels[key]; ok && rc.TryIncrement() { + return rc + } + return nil +} + +// storeProcChannel stores the created channel in the map if no valid channel +// exists for the key. If another goroutine already stored a channel while +// unlocked, it increments the existing channel's refcount and returns it. +func (cf *clientFilter) storeProcChannel(key grpcServiceKey, rc *grpcsync.RefCounted[v3procservicegrpc.ExternalProcessorClient]) *grpcsync.RefCounted[v3procservicegrpc.ExternalProcessorClient] { + cf.mu.Lock() + defer cf.mu.Unlock() + if existing, ok := cf.procChannels[key]; ok && existing.TryIncrement() { + return existing + } + cf.procChannels[key] = rc + return rc +} + +// removeProcChannel removes rc from the map if it is still associated with key. +// +// We check (cf.procChannels[key] == rc) before deleting because: +// 1. When a channel's reference count drops to 0, this cleanup callback runs +// asynchronously on a background goroutine. +// 2. Before this callback acquires cf.mu, a subsequent call to +// getOrCreateExtProcChannel could see that the old channel has refcount 0, +// ignore it, and store a newly created channel in cf.procChannels[key]. +// 3. The equality check ensures we only delete from the map if it still points +// to this expiring channel, preventing us from accidentally deleting a new +// replacement channel. +func (cf *clientFilter) removeProcChannel(key grpcServiceKey, rc *grpcsync.RefCounted[v3procservicegrpc.ExternalProcessorClient]) { + cf.mu.Lock() + defer cf.mu.Unlock() + // Only delete from the map if it hasn't already been replaced by a newer channel. + if cf.procChannels[key] == rc { + delete(cf.procChannels, key) + } +} + +// getOrCreateExtProcChannel retrieves an existing refcounted external processor +// client from the procChannels map and increases its refcount or creates a new +// one if it doesn't exist. +func (cf *clientFilter) getOrCreateExtProcChannel(server xdsresource.GRPCServiceConfig) (*grpcsync.RefCounted[v3procservicegrpc.ExternalProcessorClient], error) { + // Create the grpcServiceKey. + key := grpcServiceKey{ + targetURI: server.TargetURI, + channelCredentials: server.ChannelCredentials, + callCredentials: server.CallCredentials, + } + + // If the channel for the key is present in the map and its refcount is + // greater than 0, increment the refcount and return the channel. + if rc := cf.getProcChannel(key); rc != nil { + return rc, nil + } + + // Create the external processor channel without holding the lock. + cc, cancel, err := iextproc.CreateExtProcChannel(server) + if err != nil { + return nil, fmt.Errorf("extproc: failed to create channel to the external processor server %q: %v", server.TargetURI, err) + } + + client := v3procservicegrpc.NewExternalProcessorClient(cc) + // Create a new refcounted client. The onZero cleanup function will remove the + // client from the map and close the underlying channel. + var rc *grpcsync.RefCounted[v3procservicegrpc.ExternalProcessorClient] + rc = grpcsync.NewRefCounted(client, func() { + cf.removeProcChannel(key, rc) + cancel() + }) + + // Double-check if another goroutine created and stored a channel for this + // key while we were unlocked. + if existing := cf.storeProcChannel(key, rc); existing != rc { + rc.Decrement() + return existing, nil + } + return rc, nil +} + +func (cf *clientFilter) BuildClientInterceptor(base, override httpfilter.FilterConfig) (httpfilter.ClientInterceptor, error) { + b, ok := base.(baseConfig) + if !ok { + return nil, fmt.Errorf("extproc: incorrect config type provided (%T): %v", base, base) + } + + var ov overrideConfig + if override != nil { + ov, ok = override.(overrideConfig) + if !ok { + return nil, fmt.Errorf("extproc: incorrect override config type provided (%T): %v", override, override) + } + } + + config := newInterceptorConfig(b, ov) + + // Create or reuse a refcounted channel to the external processor server. + rc, err := cf.getOrCreateExtProcChannel(config.server) + if err != nil { + return nil, err + } + return &clientInterceptor{ + config: config, + procClient: rc, + metricsRecorder: cf.metricsRecorder, + target: cf.target, + }, nil +} + +type clientInterceptor struct { + config baseConfig + procClient *grpcsync.RefCounted[v3procservicegrpc.ExternalProcessorClient] + metricsRecorder estats.MetricsRecorder + target string +} + +func (i *clientInterceptor) Close() { + i.procClient.Decrement() +} + +// createProcContext creates a new child context for the RPC to the external +// processor server to be able to cancel it independently. This context has a +// deadline of the timeout specified in the config, if present, and contains the +// initial metadata specified in the config. +func createProcContext(ctx context.Context, server xdsresource.GRPCServiceConfig) (procCtx context.Context, cancel context.CancelFunc) { + if server.Timeout != 0 { + procCtx, cancel = context.WithTimeout(ctx, server.Timeout) + } else { + procCtx, cancel = context.WithCancel(ctx) + } + procCtx = metadata.NewOutgoingContext(procCtx, server.InitialMetadata) + return procCtx, cancel +} + +func (i *clientInterceptor) NewStream(ctx context.Context, ri resolver.RPCInfo, newStream func(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStream, error), opts ...grpc.CallOption) (grpc.ClientStream, error) { + // Increment procClient's refcount so this RPC stream keeps the connection + // open even if the interceptor is closed. Decremented when the Process + // stream finishes (via grpc.OnFinish) or fails to start. + i.procClient.Increment() + outgoingMD, added, _ := metadataFromOutgoingContextRaw(ctx) + // Create a cancelable context to cancel the dataplane stream and close any + // goroutines in case of error. + cancelCtx, cancel := context.WithCancel(ctx) + procCtx, procCancel := createProcContext(cancelCtx, i.config.server) + + // Collect OnFinishCallOption functions from the call options. + var onFinish []func(error) + for _, o := range opts { + if onFinishOpt, ok := o.(grpc.OnFinishCallOption); ok && onFinishOpt.OnFinish != nil { + onFinish = append(onFinish, onFinishOpt.OnFinish) + } + } + + csCommon := &commonStream{ + ctx: cancelCtx, + cancel: cancel, + procCancel: procCancel, + config: i.config, + metricsRecorder: i.metricsRecorder, + target: i.target, + clientHeadersStartTime: timeNow(), + // Construct request attributes once during stream initialization to capture + // the original, unmutated request metadata and RPC info. For streaming + // RPCs, where stream creation and message transmission are separable, + // initializing attributes upfront avoids repeated protobuf construction on + // subsequent SendMsg and RecvMsg calls. + reqAttrs: constructRequestAttributes(ri, outgoingMD, added, i.config.requestAttributes), + onFinish: onFinish, + } + + // In the ClientStream API, outgoing headers are sent immediately when the + // stream is created. Because we need to send or mutate these headers before + // they go over the wire, we must establish the ext_proc stream now rather + // than deferring it. + var err error + procClient := i.procClient.Value() + if csCommon.procStream, err = procClient.Process(procCtx, grpc.OnFinish(func(error) { + i.procClient.Decrement() + })); err != nil { + return csCommon.handleInitError(fmt.Errorf("failed to create a stream to external processor: %w", err), newStream, opts...) + } + + // Observability mode. + if i.config.observabilityMode { + ocs := &observabilityClientStream{ + commonStream: csCommon, + procRecvDone: make(chan struct{}), + } + + // Defer the closing of ext proc stream by the defined deferred close + // timeout to allow the server to read all messages from the proc stream. + onFinishFunc := func(error) { + time.AfterFunc(ocs.config.deferredCloseTimeout, ocs.procCancel) + } + newOpts := append(opts, grpc.OnFinish(onFinishFunc)) + + if ocs.dataplaneStream, err = newStream(ocs.ctx, newOpts...); err != nil { + ocs.cancel() + return nil, ocs.streamError(err) + } + ocs.recordMetric(clientHeadersDurationMetric, timeSince(ocs.clientHeadersStartTime).Seconds()) + // Start background goroutine to receive any messages from the external + // processor server and discard them. + go ocs.discardProcessorResponsesLoop() + + // If the request header processing mode is set to "Send", forward the + // headers to the external processor server. + if i.config.processingModes.requestHeaderMode == modeSend { + if err = ocs.sendToProcessor(ocs.requestHeaders(outgoingMD, added)); err != nil { + return ocs.handleInitError(fmt.Errorf("failed to send client headers to external processor server: %w", err), newStream, opts...) + } + } + + return ocs, nil + } + + // Normal mode. + cs := &clientStream{ + commonStream: csCommon, + procStreamFailed: grpcsync.NewEvent(), + procStreamBypass: grpcsync.NewEvent(), + mutatedReqBuffer: buffer.NewUnbounded[*v3procservicepb.StreamedBodyResponse](), + mutatedRespBuffer: buffer.NewUnbounded[*v3procservicepb.StreamedBodyResponse](), + responseHeadersReady: grpcsync.NewEvent(), + responseTrailerReady: grpcsync.NewEvent(), + dataplaneSetup: make(chan struct{}), + procSendCh: make(chan *v3procservicepb.ProcessingRequest), + requestForwardLoopDoneCh: make(chan struct{}), + procRecvLoopDone: grpcsync.NewEvent(), + } + + // When request header processing is "Send", defer creating the dataplane + // stream until the external processor responds, because gRPC transmits + // outgoing headers immediately upon stream creation and we must apply any + // header mutations first. If header processing is skipped, create the + // dataplane stream immediately. + if i.config.processingModes.requestHeaderMode == modeSend { + if err = cs.procStream.Send(cs.requestHeaders(outgoingMD, added)); err != nil { + if err == io.EOF { + _, err = cs.procStream.Recv() + } + return cs.handleInitError(fmt.Errorf("failed to send client headers to external processor server: %w", err), newStream, opts...) + } + } else { + if err = cs.createDataplaneStream(cs.ctx, newStream, opts); err != nil { + return nil, err + } + } + + // Start a background loop for sending messages to the external processor + // server. Use a single goroutine to ensure no concurrent sends. + go cs.sendToProcServerLoop() + + // Start a background loop to receive messages from the external processor + // server and send them on the dataplane stream in either direction. + go cs.recvFromProcServerLoop(newStream, opts) + + return cs, nil +} + +// commonStream contains state and synchronization primitives shared between the +// normal and observability mode client stream implementations. +type commonStream struct { + // ctx is stored to allow blocking ClientStream interface methods (which do + // not accept context parameters) to respect context cancellation/timeout and + // retrieve ctx.Err() for returning the correct gRPC status error. This + // context is directly derived from the dataplane RPC's context. + ctx context.Context + cancel context.CancelFunc + procCancel context.CancelFunc + config baseConfig + + dataplaneStream grpc.ClientStream // underlying gRPC stream to the backend + procStream v3procservicegrpc.ExternalProcessor_ProcessClient // bidirectional stream to the external processor + procStreamClosed atomic.Bool // ensures the stream closure logic is executed exactly once + procStreamErr atomic.Value // holds the terminal error causing the external processor stream to fail + + reqAttrs map[string]*structpb.Struct // attributes to be sent to proc server with client message + reqAttrsSent atomic.Bool // tracks whether the first client message has been sent to ensure request attributes are sent only once + protocolConfigSent atomic.Bool // tracks whether the protocol configuration has been sent to the processor + trailersOnly bool // tracks whether the backend response is trailers-only + responseHeaderOnce atomic.Bool // ensures response headers are forwarded to the external processor only once + responseTrailerOnce atomic.Bool // ensures response trailers are forwarded to the external processor only once + + metricsRecorder estats.MetricsRecorder + target string + clientHeadersStartTime time.Time // holds the start time of client headers processing for metrics and relative timestamp calculations + + // onFinish stores OnFinishCallOption callbacks to execute if calling the + // delegate (newStream) fails or if the RPC fails before delegating. + onFinish []func(err error) + dataplaneRecvCalled atomic.Bool // tracks if RecvMsg has been called on dataplaneStream by the application +} + +func (cs *commonStream) recordMetric(handle *estats.Float64HistoHandle, duration float64) { + if cs.metricsRecorder == nil { + return + } + handle.Record(cs.metricsRecorder, duration, cs.target) +} + +// handleInitError handles failures during the initialization of the external +// processor stream in NewStream. In deny mode, it returns an internal error. In +// allow mode, it bypasses the external processor and creates and returns the +// dataplane stream directly. +// +// The error passed into handleInitError is a wrapped error and must not be +// returned directly to the caller to avoid exposing it as part of the public +// API. +func (cs *commonStream) handleInitError(err error, newStream func(context.Context, ...grpc.CallOption) (grpc.ClientStream, error), opts ...grpc.CallOption) (grpc.ClientStream, error) { + cs.procCancel() + + if !errors.Is(err, io.EOF) && !cs.config.failureModeAllow { + cs.cancel() + return nil, status.Errorf(codes.Internal, "extproc: %v", err) + } + cs.recordMetric(clientHeadersDurationMetric, timeSince(cs.clientHeadersStartTime).Seconds()) + if cs.dataplaneStream, err = newStream(cs.ctx, opts...); err != nil { + cs.cancel() + return nil, err + } + cs.recordMetric(clientHeadersDurationMetric, timeSince(cs.clientHeadersStartTime).Seconds()) + return cs.dataplaneStream, nil +} + +// callOnFinish executes all registered OnFinish CallOption callbacks. +func (cs *commonStream) callOnFinish(err error) { + for _, f := range cs.onFinish { + f(err) + } +} + +// cleanupDataplane cancels the dataplane stream's context to immediately tear +// down the active dataplane connection and unblock any pending client I/O. +// +// Additionally, after context cancellation, if the application has not called +// RecvMsg on the dataplane stream, it invokes a dummy RecvMsg on it. In +// gRPC-Go, unary RPCs do not start a background goroutine waiting for context +// expiration to call cs.finish(err). If an application or interceptor layer +// abandons an RPC after NewStream without calling SendMsg, CloseSend, or +// RecvMsg on the dataplane stream, calling RecvMsg on the canceled stream +// forces gRPC-Go's internal clientStream to encounter context.Canceled and +// execute cleanup. This guarantees that all registered OnFinish CallOption +// callbacks are executed and reference counts are decremented so that channels +// do not leak. +// +// For streaming RPCs where RecvMsg has already been called by the application, +// we avoid invoking a dummy RecvMsg because ClientStream.RecvMsg is not safe +// for concurrent calls by multiple goroutines on the same stream. Multiple +// goroutines may enter here concurrently; mutual exclusion is not required +// because cs.cancel() makes subsequent RecvMsg calls after context cancellation +// are idempotent. +func (cs *commonStream) cleanupDataplane() { + cs.cancel() + if cs.dataplaneStream != nil && !cs.dataplaneRecvCalled.Load() { + cs.dataplaneStream.RecvMsg(new(any)) + } +} + +// newProcessingRequest creates a new ProcessingRequest with ObservabilityMode, +// ProtocolConfig, and Attributes fields initialized. +func (cs *commonStream) newProcessingRequest(isClientMessage bool) *v3procservicepb.ProcessingRequest { + req := &v3procservicepb.ProcessingRequest{ + ObservabilityMode: cs.config.observabilityMode, + } + + if cs.protocolConfigSent.CompareAndSwap(false, true) { + req.ProtocolConfig = &v3procservicepb.ProtocolConfiguration{ + RequestBodyMode: convertBodyMode(cs.config.processingModes.requestBodyMode), + ResponseBodyMode: convertBodyMode(cs.config.processingModes.responseBodyMode), + } + } + + if isClientMessage && cs.reqAttrsSent.CompareAndSwap(false, true) { + req.Attributes = cs.reqAttrs + } + return req +} + +// requestHeaders creates a ProcessingRequest for sending request headers. +func (cs *commonStream) requestHeaders(md metadata.MD, added [][]string) *v3procservicepb.ProcessingRequest { + req := cs.newProcessingRequest(true) + req.Request = &v3procservicepb.ProcessingRequest_RequestHeaders{ + RequestHeaders: &v3procservicepb.HttpHeaders{ + Headers: httpfilter.ConstructHeaderMap(md, added, cs.config.allowedHeaders, cs.config.disallowedHeaders), + }, + } + return req +} + +// responseHeaders creates a ProcessingRequest for sending response +// headers. +func (cs *commonStream) responseHeaders(header metadata.MD) *v3procservicepb.ProcessingRequest { + req := cs.newProcessingRequest(false) + req.Request = &v3procservicepb.ProcessingRequest_ResponseHeaders{ResponseHeaders: &v3procservicepb.HttpHeaders{ + Headers: httpfilter.ConstructHeaderMap(header, nil, cs.config.allowedHeaders, cs.config.disallowedHeaders), + EndOfStream: cs.trailersOnly, + }} + return req +} + +// responseTrailers creates a ProcessingRequest for sending response +// trailers. +func (cs *commonStream) responseTrailers(trailers metadata.MD) *v3procservicepb.ProcessingRequest { + req := cs.newProcessingRequest(false) + req.Request = &v3procservicepb.ProcessingRequest_ResponseTrailers{ResponseTrailers: &v3procservicepb.HttpTrailers{ + Trailers: httpfilter.ConstructHeaderMap(trailers, nil, cs.config.allowedHeaders, cs.config.disallowedHeaders), + }} + return req +} + +// halfClose creates a ProcessingRequest indicating end of stream without +// a message body. +func (cs *commonStream) halfClose() *v3procservicepb.ProcessingRequest { + req := cs.newProcessingRequest(true) + req.Request = &v3procservicepb.ProcessingRequest_RequestBody{ + RequestBody: &v3procservicepb.HttpBody{ + EndOfStreamWithoutMessage: true, + EndOfStream: true, + }, + } + return req +} + +// marshalAndCreateBodyReq marshals the message and creates a request or +// response body ProcessingRequest. +func (cs *commonStream) marshalAndCreateBodyReq(m any, isClientMessage bool) (*v3procservicepb.ProcessingRequest, error) { + msg, ok := m.(proto.Message) + if !ok { + return nil, status.Errorf(codes.Internal, "extproc: message does not implement proto.Message") + } + bodyBytes, err := proto.Marshal(msg) + if err != nil { + return nil, status.Errorf(codes.Internal, "extproc: failed to marshal message: %v", err) + } + + req := cs.newProcessingRequest(isClientMessage) + if isClientMessage { + req.Request = &v3procservicepb.ProcessingRequest_RequestBody{ + RequestBody: &v3procservicepb.HttpBody{Body: bodyBytes}, + } + return req, nil + } + req.Request = &v3procservicepb.ProcessingRequest_ResponseBody{ + ResponseBody: &v3procservicepb.HttpBody{Body: bodyBytes}, + } + return req, nil +} + +// observabilityClientStream implements resolver.ClientStream to coordinate +// message exchanges between the application client, the external processor, and +// the backend dataplane in observability mode. +type observabilityClientStream struct { + *commonStream + + procStreamBypass atomic.Bool // set to true when the external processor stream should be bypassed + procRecvDone chan struct{} // closed when discardProcessorResponsesLoop detects stream closure/failure + + responseRecvStarted bool // tracks whether RecvMsg has started processing response messages + responseHeader metadata.MD // stores response headers received from dataplane + responseHeaderErr error // stores response header error received from dataplane + mu sync.Mutex // guards concurrent writes to the external processor stream +} + +// streamError returns the appropriate error when a stream operation fails. +// It prioritizes the external processor stream's terminal error. +func (ocs *observabilityClientStream) streamError(err error) error { + if fatalErr, ok := ocs.procStreamErr.Load().(error); ok { + return fatalErr + } + return err +} + +func (ocs *observabilityClientStream) Header() (metadata.MD, error) { + if fatalErr, ok := ocs.procStreamErr.Load().(error); ok { + return nil, fatalErr + } + return ocs.initiateResponseHeaderProcessing() +} + +func (ocs *observabilityClientStream) Trailer() metadata.MD { + if _, ok := ocs.procStreamErr.Load().(error); ok { + return nil + } + + // If trailer is not yet ready, return nil. This may happen when Trailer() is + // called before the server sends trailers, or before the entire response has + // been received. + if tr := ocs.dataplaneStream.Trailer(); tr != nil { + ocs.initiateResponseTrailerProcessing(tr) + return tr + } + return nil +} + +func (ocs *observabilityClientStream) CloseSend() error { + if fatalErr, ok := ocs.procStreamErr.Load().(error); ok { + return fatalErr + } + startTime := timeNow() + if !ocs.procStreamBypass.Load() && ocs.config.processingModes.requestBodyMode == modeSend { + if err := ocs.sendToProcessor(ocs.halfClose()); err != nil { + return err + } + } + err := ocs.dataplaneStream.CloseSend() + ocs.recordMetric(clientHalfCloseDurationMetric, timeSince(startTime).Seconds()) + return ocs.streamError(err) +} + +func (ocs *observabilityClientStream) Context() context.Context { + return ocs.dataplaneStream.Context() +} + +func (ocs *observabilityClientStream) SendMsg(m any) error { + if fatalErr, ok := ocs.procStreamErr.Load().(error); ok { + return fatalErr + } + if ocs.config.processingModes.requestBodyMode == modeSend && !ocs.procStreamBypass.Load() { + if err := ocs.sendBodyToProcessor(m, true); err != nil { + return err + } + } + err := ocs.dataplaneStream.SendMsg(m) + return ocs.streamError(err) +} + +func (ocs *observabilityClientStream) RecvMsg(m any) error { + if fatalErr, ok := ocs.procStreamErr.Load().(error); ok { + return fatalErr + } + + // If this is the first time RecvMsg is called, initiate response header + // processing. + if !ocs.responseRecvStarted { + ocs.responseRecvStarted = true + if _, err := ocs.initiateResponseHeaderProcessing(); err != nil { + return err + } + } + + if !ocs.dataplaneRecvCalled.Load() { + ocs.dataplaneRecvCalled.Store(true) + } + if err := ocs.dataplaneStream.RecvMsg(m); err != nil { + if trerr := ocs.initiateResponseTrailerProcessing(ocs.dataplaneStream.Trailer()); trerr != nil { + return trerr + } + return ocs.streamError(err) + } + + if ocs.config.processingModes.responseBodyMode == modeSend && !ocs.procStreamBypass.Load() { + if err := ocs.sendBodyToProcessor(m, false); err != nil { + return err + } + } + return ocs.streamError(nil) +} + +// sendBodyToProcessor marshals the given message and forwards it as a request +// or response body ProcessingRequest to the external processor stream. +func (ocs *observabilityClientStream) sendBodyToProcessor(m any, isClientMessage bool) error { + req, err := ocs.marshalAndCreateBodyReq(m, isClientMessage) + if err != nil { + return err + } + return ocs.sendToProcessor(req) +} + +// initiateResponseTrailerProcessing fetches response trailers from the +// dataplane stream and forwards them to the external processor if configured. +// It is guarded by responseTrailerOnce to run at most once. +func (ocs *observabilityClientStream) initiateResponseTrailerProcessing(trailers metadata.MD) error { + if ocs.responseTrailerOnce.Load() || !ocs.responseTrailerOnce.CompareAndSwap(false, true) { + return nil + } + startTime := timeNow() + if ocs.config.processingModes.responseTrailerMode == modeSend && !ocs.procStreamBypass.Load() && !ocs.trailersOnly { + if err := ocs.sendToProcessor(ocs.responseTrailers(trailers)); err != nil { + return err + } + } + ocs.recordMetric(serverTrailersDurationMetric, timeSince(startTime).Seconds()) + + // Half-close the external processor stream immediately so the server can + // shut down gracefully. + if !ocs.procStreamBypass.Load() { + ocs.mu.Lock() + ocs.procStream.CloseSend() + ocs.mu.Unlock() + } + return nil +} + +// initiateResponseHeaderProcessing fetches response headers from the dataplane +// stream, detects if the response is trailers-only, and forwards the response +// headers to the external processor if configured. It is guarded by +// responseHeaderOnce to run at most once. +func (ocs *observabilityClientStream) initiateResponseHeaderProcessing() (metadata.MD, error) { + if ocs.responseHeaderOnce.Load() || !ocs.responseHeaderOnce.CompareAndSwap(false, true) { + return ocs.responseHeader, ocs.streamError(ocs.responseHeaderErr) + } + ocs.responseHeader, ocs.responseHeaderErr = ocs.dataplaneStream.Header() + if ocs.responseHeaderErr != nil { + return nil, ocs.streamError(ocs.responseHeaderErr) + } + startTime := timeNow() + // A trailers-only response returns nil from dataplaneStream.Header(). + procHeader := ocs.responseHeader + if ocs.responseHeader == nil { + procHeader = ocs.dataplaneStream.Trailer() + if len(procHeader) > 0 { + ocs.trailersOnly = true + } + } + + if ocs.config.processingModes.responseHeaderMode == modeSend && !ocs.procStreamBypass.Load() { + if err := ocs.sendToProcessor(ocs.responseHeaders(procHeader)); err != nil { + return nil, err + } + } + ocs.recordMetric(serverHeadersDurationMetric, timeSince(startTime).Seconds()) + return ocs.responseHeader, nil +} + +// sendToProcessor sends a ProcessingRequest to the external processor stream. +// If the write fails, it waits for the receive background loop to process the +// closure and returns the resulting error. +func (ocs *observabilityClientStream) sendToProcessor(req *v3procservicepb.ProcessingRequest) error { + ocs.mu.Lock() + err := ocs.procStream.Send(req) + ocs.mu.Unlock() + if err != nil { + select { + case <-ocs.procRecvDone: + case <-ocs.ctx.Done(): + } + if fatalErr, ok := ocs.procStreamErr.Load().(error); ok { + return fatalErr + } + if ocs.procStreamBypass.Load() { + return nil + } + return err + } + return nil +} + +// discardProcessorResponsesLoop runs in a background goroutine to continuously +// read and discard messages from the external processor server, while also +// monitoring the stream for closure or failure. +// +// Per the Envoy ExtProc protobuf specification for observability mode, +// "External processor should not send back processing response, as any +// responses will be ignored." +func (ocs *observabilityClientStream) discardProcessorResponsesLoop() { + for { + if _, err := ocs.procStream.Recv(); err != nil { + ocs.failObsProcStream(err) + return + } + } +} + +// failObsProcStream handles proc stream closure or failure by updating the +// stream state. If the failure is a non-EOF error and failure mode is deny, it +// stores the error to fail the dataplane RPC. Otherwise, it enables bypass +// mode. +func (ocs *observabilityClientStream) failObsProcStream(err error) { + if !ocs.procStreamClosed.CompareAndSwap(false, true) { + return + } + defer close(ocs.procRecvDone) + ocs.procCancel() + if err != io.EOF && !ocs.config.failureModeAllow { + ocs.procStreamErr.Store(status.Errorf(codes.Internal, "extproc: external processor RPC failed: %v", err)) + ocs.cleanupDataplane() + return + } + ocs.procStreamBypass.Store(true) +} + +// clientStream implements resolver.ClientStream to coordinate bidirectional +// message exchanges between the application client, the external processor, and +// the backend dataplane. +type clientStream struct { + *commonStream + + procStreamFailed *grpcsync.Event // fired when external processor stream has closed and RPC should be failed + procStreamBypass *grpcsync.Event // fired when the external processor stream should be bypassed or drained + + ignoreFailureMode atomic.Bool // tracks whether the failureModeAllow setting should be ignored (e.g. after sending body messages) + discardRequests atomic.Bool // set when ext_proc server signals end_of_stream to stop client sends + mutatedReqBuffer *buffer.Unbounded[*v3procservicepb.StreamedBodyResponse] // buffers mutated request body messages from the ext_proc server + reqForwardingStarted bool // tracks whether request forwarding loop to the dataplane has started + procSendCh chan *v3procservicepb.ProcessingRequest // serializes writes to the external processor stream to ensure thread-safety + + responseHeader metadata.MD // stores headers received from the dataplane stream + responseHeadersReady *grpcsync.Event // signals that response headers are ready for client + responseHeaderSent atomic.Bool // tracks whether response headers have been dispatched to external processor + responseTrailers metadata.MD // stores trailers received from the dataplane stream + responseTrailerReady *grpcsync.Event // signals that response trailers are ready for client + trailerSent atomic.Bool // tracks whether response trailers have been dispatched + trailerErr atomic.Value // holds any terminal status returned upon processing response trailers (e.g. ImmediateResponse) + mutatedRespBuffer *buffer.Unbounded[*v3procservicepb.StreamedBodyResponse] // buffers mutated response body messages from the ext_proc server + responseDrained atomic.Bool // tracks whether all buffered response body messages from the ext_proc server have been drained + dataplaneSetup chan struct{} // closed once dataplaneStream creation attempt is complete + dataplaneCreationErr error // stores the error from the dataplane stream creation attempt + respForwardingStarted bool // tracks whether response forwarding loop to the external processor has started + + requestForwardLoopDoneCh chan struct{} // closed when request forwarding loop finishes draining + procRecvLoopDone *grpcsync.Event // fires when external processor stream receive loop finishes + + // The following start times are accessed concurrently across goroutines + // during the stream lifetime. We store them as atomic.Int64 nanosecond + // offsets from clientHeadersStartTime instead of time.Time because time.Time + // cannot be accessed atomically without a mutex and atomic.Int64 provides + // lock-free atomic operations. + clientHalfCloseStartTime atomic.Int64 + serverHeadersStartTime atomic.Int64 + serverTrailersStartTime atomic.Int64 +} + +// recordDuration records the elapsed time since the event start timestamp +// stored in val to the histogram metric. val holds the start timestamp as a +// nanosecond offset from cs.clientHeadersStartTime. It is a no-op if val has +// not been set (value is 0). +func (cs *clientStream) recordDuration(handle *estats.Float64HistoHandle, val *atomic.Int64) { + if offsetNs := val.Load(); offsetNs != 0 { + startTime := cs.clientHeadersStartTime.Add(time.Duration(offsetNs)) + cs.recordMetric(handle, timeSince(startTime).Seconds()) + } +} + +// fireResponseHeadersReady fires the responseHeadersReady event, and records +// the server_headers_duration metric exactly once upon firing. +func (cs *clientStream) fireResponseHeadersReady() { + if cs.responseHeadersReady.Fire() { + cs.recordDuration(serverHeadersDurationMetric, &cs.serverHeadersStartTime) + } +} + +// fireResponseTrailerReady fires the responseTrailerReady event, and records +// the server_trailers_duration metric exactly once upon firing. +func (cs *clientStream) fireResponseTrailerReady() { + if cs.responseTrailerReady.Fire() { + cs.recordDuration(serverTrailersDurationMetric, &cs.serverTrailersStartTime) + } +} + +// Header returns the response headers received from the backend, potentially +// modified by the external processor if configured. It blocks until header +// processing is complete, or returns nil if the response is trailers-only. +func (cs *clientStream) Header() (metadata.MD, error) { + if err := cs.initiateResponseHeaderProcessing(); err != nil { + return nil, err + } + // Wait for the response headers to be modified. + select { + case <-cs.responseHeadersReady.Done(): + if cs.trailersOnly { + return nil, nil + } + return cs.responseHeader, nil + case <-cs.procStreamFailed.Done(): + return nil, cs.streamError() + case <-cs.ctx.Done(): + return nil, cs.streamError() + } +} + +// Trailer returns the trailer metadata received from the server, potentially +// modified by the external processor if configured. It returns nil or empty map +// immediately if trailers are not yet received from the backend. If backend +// trailers are available, it blocks until any configured trailer processing by +// the external processor completes. +func (cs *clientStream) Trailer() metadata.MD { + // If trailers are already modified and ready, return them immediately. + if cs.responseTrailerReady.HasFired() { + return cs.responseTrailers + } + // Checking if backend stream has trailers ready now. + s, err := cs.waitForDataplaneStream(cs.ctx) + // Since Trailer is not supposed to be a blocking function and should be + // called after CloseRecv or after Recv() returns an error, it should have the + // dataplane stream created. If it does not, then Trailer has been called + // prematurely, which means we need to return nil and not block here. + if err != nil { + return nil + } + // If no backend trailers are ready yet, return nil to preserve standard + // non-blocking behaviour. + if len(s.Trailer()) == 0 { + return nil + } + + cs.initiateResponseTrailerProcessing() + select { + case <-cs.responseTrailerReady.Done(): + return cs.responseTrailers + case <-cs.procStreamFailed.Done(): + return nil + case <-cs.ctx.Done(): + return nil + } +} + +func (cs *clientStream) CloseSend() error { + if cs.discardRequests.Load() { + return nil + } + if cs.clientHalfCloseStartTime.Load() == 0 { + offset := timeSince(cs.clientHeadersStartTime) + cs.clientHalfCloseStartTime.CompareAndSwap(0, int64(offset)) + } + + s, err := cs.bypassProcStreamForClientMsg() + if err != nil { + return err + } + if s != nil { + cs.recordDuration(clientHalfCloseDurationMetric, &cs.clientHalfCloseStartTime) + err = s.CloseSend() + return err + } + // If external processor stream is active, client CloseSend is sent to the + // processor server as request message with `EndOfStreamWithoutMessage` set. + s, err = cs.sendClientReqToProcServer(cs.halfClose()) + if s != nil { + cs.recordDuration(clientHalfCloseDurationMetric, &cs.clientHalfCloseStartTime) + err = s.CloseSend() + return err + } + return err +} + +func (cs *clientStream) Context() context.Context { + s, err := cs.waitForDataplaneStream(cs.ctx) + if err != nil { + return cs.ctx + } + return s.Context() +} + +func (cs *clientStream) RecvMsg(m any) error { + // Initiate response header processing because external processor requires the + // events to be sent in the correct order, i.e. response header before + // response message. And if Header() has not already been called, send the + // response headers to external processor server first. + if err := cs.initiateResponseHeaderProcessing(); err != nil { + return err + } + + // If all the responses from external processor server have been drained or if + // the external processor is bypassed, or if the response body mode is skip, + // then receive directly from the dataplane stream. + if cs.responseDrained.Load() || (cs.procStreamBypass.HasFired() && !cs.respForwardingStarted) || cs.config.processingModes.responseBodyMode == modeSkip { + return cs.recvFromDataplane(m) + } + + msg, ok := m.(proto.Message) + if !ok { + return fmt.Errorf("extproc: response message does not implement proto.Message") + } + + // Start the background receiving loop on the first RecvMsg call to capture + // the type of message to be received. + if !cs.respForwardingStarted { + cs.respForwardingStarted = true + go cs.responseForwardingToProcServerLoop(msg.ProtoReflect().Type()) + } + + // Pull response messages from mutatedRespBuffer. + select { + case streamedResp, ok := <-cs.mutatedRespBuffer.Get(): + cs.mutatedRespBuffer.Load() + if !ok { + // Closed channel implies that all messages from the external processor + // have been received. Start receiving directly from dataplane stream. + cs.responseDrained.Store(true) + return cs.recvFromDataplane(m) + } + return proto.Unmarshal(streamedResp.GetBody(), msg) + case <-cs.ctx.Done(): + return cs.streamError() + case <-cs.procStreamFailed.Done(): + return cs.streamError() + } +} + +func (cs *clientStream) SendMsg(m any) error { + s, err := cs.bypassProcStreamForClientMsg() + if err != nil { + return err + } + if s != nil { + return s.SendMsg(m) + } + + req, err := cs.marshalAndCreateBodyReq(m, true) + if err != nil { + return err + } + msg := m.(proto.Message) + + // Start request forwarding loop on the first send because we need the message + // type to send the data to the dataplane server. + if !cs.reqForwardingStarted { + cs.reqForwardingStarted = true + go cs.requestForwardingToDataplaneLoop(msg.ProtoReflect().Type()) + } + + // If the ExtProc server has already signaled end_of_stream, discard any + // subsequent client messages. + if cs.discardRequests.Load() { + return nil + } + + s, err = cs.sendClientReqToProcServer(req) + if s != nil { + return s.SendMsg(m) + } + return err +} + +// recvFromDataplane receives directly from the dataplane stream. If the +// dataplane stream returns an error, it initiates and waits for response +// trailers. +func (cs *clientStream) recvFromDataplane(m any) error { + if cs.procStreamFailed.HasFired() { + return cs.procStreamErr.Load().(error) + } + s, err := cs.waitForDataplaneStream(cs.ctx) + if err != nil { + return err + } + if !cs.dataplaneRecvCalled.Load() { + cs.dataplaneRecvCalled.Store(true) + } + if err := s.RecvMsg(m); err != nil { + // If RecvMsg returns error, fail the RPC in case external processor stream + // has failed. Otherwise process the trailers. + if cs.procStreamFailed.HasFired() { + return cs.procStreamErr.Load().(error) + } + cs.initiateResponseTrailerProcessing() + // Wait for trailer processing to be done to make sure we are able to return + // correct error and fail RPC if the trailer processing fails. This needs to + // be done because Trailer() does not return an error. TODO: Verify if the + // wait is acceptable. + return cs.waitForTrailerProcessing(err) + } + return nil +} + +// sendClientReqToProcServer attempts to send the given request for client to +// server msg to the external processor. If the processor stream is bypassed +// while waiting, it blocks until all queued messages are forwarded, and returns +// the dataplane stream so the caller can send the message directly to the +// dataplane stream instead. +func (cs *clientStream) sendClientReqToProcServer(req *v3procservicepb.ProcessingRequest) (grpc.ClientStream, error) { + // Ignoring the failureMode as we will be sending the request to proc server. + if !cs.ignoreFailureMode.Load() { + cs.ignoreFailureMode.Store(true) + } + + select { + case cs.procSendCh <- req: + return nil, nil + case <-cs.procStreamBypass.Done(): + if cs.reqForwardingStarted { + // When the drain is triggered, wait for all the queued requests to be sent + // to dataplane server before forwarding current request directly to + // dataplane server. + if err := cs.waitChannel(cs.requestForwardLoopDoneCh); err != nil { + return nil, err + } + } + return cs.waitForDataplaneStream(cs.ctx) + case <-cs.procStreamFailed.Done(): + return nil, cs.streamError() + case <-cs.ctx.Done(): + return nil, cs.streamError() + } +} + +// bypassProcStreamForClientMsg checks if the external processor should be +// bypassed for the current request message or CloseSend. If so, it returns the +// dataplane stream to be used directly. It blocks until all client messages +// received from the proc server are forwarded to ensure correct sequence. It +// also blocks to wait for stream creation if necessary. If the message needs to +// be sent to the external processor server, it returns (nil, nil). +func (cs *clientStream) bypassProcStreamForClientMsg() (grpc.ClientStream, error) { + if cs.procStreamFailed.HasFired() { + return nil, cs.procStreamErr.Load().(error) + } + + bypass := cs.procStreamBypass.HasFired() + if bypass && cs.reqForwardingStarted { + // We started forwarding messages to the proc server and then it + // initiated a drain. We must wait until all messages received from + // the proc server are sent on the dataplane stream, before + // unblocking the application's Send() or CloseSend(), to ensure + // correct message sequencing. + if err := cs.waitChannel(cs.requestForwardLoopDoneCh); err != nil { + return nil, err + } + } + + if bypass || cs.config.processingModes.requestBodyMode == modeSkip { + return cs.waitForDataplaneStream(cs.ctx) + } + + return nil, nil // Do not bypass. +} + +// responseForwardingToProcServerLoop continuously receives response messages +// from the underlying dataplane stream, marshals them, and forwards them to the +// external processor server via procSendCh. +func (cs *clientStream) responseForwardingToProcServerLoop(msgType protoreflect.MessageType) { + defer func() { + // Once the external processor server receive loop finishes, close the + // buffer to signal end of processed responses. + cs.waitChannel(cs.procRecvLoopDone.Done()) + cs.mutatedRespBuffer.Close() + }() + + dataplaneStream, err := cs.waitForDataplaneStream(cs.ctx) + if err != nil { + return + } + + for { + // If the processor stream has closed or the receive loop finishes, we can + // stop receiving messages in the background and Recv should now directly be + // called from the cs.RecvMsg() function. + if cs.procStreamBypass.HasFired() || cs.procRecvLoopDone.HasFired() { + return + } + + newMsg := msgType.New().Interface() + if !cs.dataplaneRecvCalled.Load() { + cs.dataplaneRecvCalled.Store(true) + } + if err := dataplaneStream.RecvMsg(newMsg); err != nil { + cs.initiateResponseTrailerProcessing() + return + } + + req, err := cs.marshalAndCreateBodyReq(newMsg, false) + if err != nil { + cs.failProcStream(err) + return + } + + if !cs.ignoreFailureMode.Load() { + cs.ignoreFailureMode.Store(true) + } + + select { + case cs.procSendCh <- req: + case <-cs.procStreamBypass.Done(): + // If drain is triggered, wait for external processor server receive loop + // to finish before pushing this message on the mutatedRespBuffer + // to ensure correct order of messages. + if err := cs.waitChannel(cs.procRecvLoopDone.Done()); err != nil { + return + } + resp := &v3procservicepb.StreamedBodyResponse{Body: req.GetResponseBody().GetBody()} + cs.mutatedRespBuffer.Put(resp) + return + case <-cs.procStreamFailed.Done(): + return + case <-cs.ctx.Done(): + return + } + } +} + +// requestForwardingToDataplaneLoop continuously consumes mutated request body +// from mutatedReqBuffer (populated by the external processor server), +// unmarshals them, and forwards the final messages to the backend server. +func (cs *clientStream) requestForwardingToDataplaneLoop(msgType protoreflect.MessageType) { + defer close(cs.requestForwardLoopDoneCh) + dataplaneStream, err := cs.waitForDataplaneStream(cs.ctx) + if err != nil { + return + } + for { + select { + case streamedResp, ok := <-cs.mutatedReqBuffer.Get(): + if !ok { + return + } + cs.mutatedReqBuffer.Load() + + // As per gRFC A93, ignore `end_of_stream_without_message` if + // `end_of_stream` is false. + if streamedResp.GetEndOfStream() && streamedResp.GetEndOfStreamWithoutMessage() { + cs.recordDuration(clientHalfCloseDurationMetric, &cs.clientHalfCloseStartTime) + dataplaneStream.CloseSend() + return + } + + newMsg := msgType.New().Interface() + if err := proto.Unmarshal(streamedResp.GetBody(), newMsg); err != nil { + cs.failProcStream(err) + return + } + if err := dataplaneStream.SendMsg(newMsg); err != nil { + cs.cancelStream(err) + return + } + + if streamedResp.GetEndOfStream() { + cs.recordDuration(clientHalfCloseDurationMetric, &cs.clientHalfCloseStartTime) + dataplaneStream.CloseSend() + return + } + case <-cs.ctx.Done(): + return + case <-cs.procStreamFailed.Done(): + return + } + } +} + +// recvFromProcServerLoop continuously receives messages from the external +// processor server and redirects them according to the response type. +func (cs *clientStream) recvFromProcServerLoop(newStream func(context.Context, ...grpc.CallOption) (grpc.ClientStream, error), opts []grpc.CallOption) { + defer func() { + cs.procRecvLoopDone.Fire() + // Close mutatedReqBuffer to indicate completion of receiving + // the mutated requests. Do not close mutatedResponseBuffer because we + // might push the message that has been read when drain is triggered. + cs.mutatedReqBuffer.Close() + }() + + // If request header mode is send, the first response should be the mutation + // for request header. Create the dataplane stream using the mutated header. + if cs.config.processingModes.requestHeaderMode == modeSend { + if !cs.processInitialHeaders(cs.ctx, newStream, opts) { + return + } + } + + // If header mode is not send or if we receive the header and create the + // dataplane stream, start receiving from the external processor server. + for { + resp, err := cs.procStream.Recv() + if err != nil { + cs.failProcStream(err) + return + } + if resp.GetRequestDrain() { + // Trigger the drain but continue receiving the drained messages until we + // get io.EOF. + cs.triggerBypass() + } + + if resp.GetImmediateResponse() != nil { + cs.handleImmediateResponse(resp.GetImmediateResponse(), newStream, opts) + return + } + + switch { + case resp.GetRequestBody() != nil: + if cs.config.processingModes.requestBodyMode == modeSkip { + cs.failProcStream(fmt.Errorf("external processor unexpectedly sent request body when request body processing is disabled")) + return + } + + streamedResp, ok := cs.validateBodyResponse(resp.GetRequestBody()) + if !ok { + return + } + if streamedResp.GetEndOfStream() { + cs.discardRequests.Store(true) + } + cs.mutatedReqBuffer.Put(streamedResp) + + case resp.GetResponseBody() != nil: + if cs.config.processingModes.responseBodyMode == modeSkip { + cs.failProcStream(fmt.Errorf("external processor unexpectedly sent response body when response body processing is disabled")) + return + } + + // If response headers have been sent and mutated response headers have + // not been received before receiving the response body message, fail the + // RPC. + if cs.config.processingModes.responseHeaderMode == modeSend && !cs.responseHeadersReady.HasFired() { + cs.failProcStream(fmt.Errorf("external processor sent response body before sending response headers")) + return + } + + // If mutated response trailers have been received before receiving the + // response body message, fail the RPC. + if cs.config.processingModes.responseTrailerMode == modeSend && cs.responseTrailerReady.HasFired() { + cs.failProcStream(fmt.Errorf("external processor sent response body after response trailers were already processed")) + return + } + + streamedResp, ok := cs.validateBodyResponse(resp.GetResponseBody()) + if !ok { + return + } + if streamedResp.GetEndOfStream() { + cs.failProcStream(fmt.Errorf("external processor unexpectedly set end of stream in response body mutation")) + return + } + cs.mutatedRespBuffer.Put(streamedResp) + + case resp.GetResponseHeaders() != nil: + if cs.config.processingModes.responseHeaderMode == modeSkip { + cs.failProcStream(fmt.Errorf("external processor unexpectedly sent response headers when response header processing is disabled")) + return + } + if !cs.responseHeaderSent.Load() { + cs.failProcStream(fmt.Errorf("external processor sent response headers before response headers were sent to it")) + return + } + if cs.responseHeadersReady.HasFired() { + cs.failProcStream(fmt.Errorf("external processor unexpectedly sent duplicate response headers after response headers were already processed")) + return + } + + header := resp.GetResponseHeaders() + // Check if the status in the header response is CONTINUE; if not, fail + // the stream. + if status := header.GetResponse().GetStatus(); status != v3procservicepb.CommonResponse_CONTINUE { + cs.failProcStream(fmt.Errorf("external processor returned unexpected status %v for response headers, expected %v", status, v3procservicepb.CommonResponse_CONTINUE)) + return + } + if err = cs.applyMutations(header.GetResponse().GetHeaderMutation(), cs.responseHeader); err != nil { + cs.failProcStream(err) + return + } + // Signal that the response header is modified and ready to be sent to the + // client, so that if there is any buffered response body, it can be sent + // after the header. + cs.fireResponseHeadersReady() + + case resp.GetResponseTrailers() != nil: + if cs.config.processingModes.responseTrailerMode == modeSkip { + cs.failProcStream(fmt.Errorf("external processor unexpectedly sent response trailers when response trailer processing is disabled")) + return + } + if !cs.trailerSent.Load() { + cs.failProcStream(fmt.Errorf("external processor sent response trailers before response trailers were sent to it")) + return + } + if cs.responseTrailerReady.HasFired() { + cs.failProcStream(fmt.Errorf("external processor unexpectedly sent duplicate response trailers after response trailers were already processed")) + return + } + trailer := resp.GetResponseTrailers() + if err = cs.applyMutations(trailer.GetHeaderMutation(), cs.responseTrailers); err != nil { + cs.failProcStream(err) + return + } + // Signal that the response trailer is modified and ready to be sent to + // the client. + cs.fireResponseTrailerReady() + } + } +} + +func (cs *clientStream) validateBodyResponse(bodyResp *v3procservicepb.BodyResponse) (*v3procservicepb.StreamedBodyResponse, bool) { + if status := bodyResp.GetResponse().GetStatus(); status != v3procservicepb.CommonResponse_CONTINUE { + cs.failProcStream(fmt.Errorf("external processor returned unexpected status %v for body response, expected %v", status, v3procservicepb.CommonResponse_CONTINUE)) + return nil, false + } + streamedResp := bodyResp.GetResponse().GetBodyMutation().GetStreamedResponse() + if streamedResp == nil { + cs.failProcStream(fmt.Errorf("external processor returned invalid body mutation in body response")) + return nil, false + } + if streamedResp.GetGrpcMessageCompressed() { + cs.failProcStream(fmt.Errorf("external processor returned compressed grpc message which is not supported")) + return nil, false + } + return streamedResp, true +} + +func (cs *clientStream) applyMutations(mutation *v3procservicepb.HeaderMutation, md metadata.MD) error { + if mutation == nil { + return nil + } + if err := cs.config.mutationRules.ApplyAdditions(mutation.GetSetHeaders(), md); err != nil { + return err + } + return cs.config.mutationRules.ApplyRemovals(mutation.GetRemoveHeaders(), md) +} + +// closeProcSend gracefully half-closes the external processor stream across the +// background send goroutine by pushing a nil sentinel onto procSendCh. +func (cs *clientStream) closeProcSend() { + select { + case cs.procSendCh <- nil: + case <-cs.ctx.Done(): + case <-cs.procStreamFailed.Done(): + case <-cs.procStreamBypass.Done(): + } +} + +// sendToProcServer runs as a dedicated background goroutine that serializes all +// outbound messages to the external processor server. It listens on procSendCh +// for messages to forward. It actively monitors stream lifecycle events: +// - Drain/Bypass: If procStreamBypass fires, it initiates a graceful shutdown +// by sending a half-close (CloseSend) to the external processor server and +// returning so that no more messages can be sent to the external processor. +// - Cancellation/Failure: It aborts immediately if the context is canceled or +// the underlying stream fails. +func (cs *clientStream) sendToProcServerLoop() { + for { + select { + case req := <-cs.procSendCh: + if req == nil { + // A nil request is used as a sentinel message to gracefully half-close + // the processor stream from this background thread. This ensures that + // CloseSend is called sequentially after all preceding requests in the + // channel are successfully sent, avoiding out-of-order data races. + cs.procStream.CloseSend() + return + } + if req.GetResponseHeaders() != nil { + cs.responseHeaderSent.Store(true) + } + if req.GetResponseTrailers() != nil { + cs.trailerSent.Store(true) + } + if err := cs.procStream.Send(req); err != nil { + if err != io.EOF { + // For non-EOF client-side send errors, fail the stream immediately. + cs.failProcStream(err) + } + // If Send returned io.EOF, the server closed the stream early. Let + // the Recv loop retrieve the actual status error from the server and + // propagate it. + return + } + case <-cs.procStreamBypass.Done(): + cs.procStream.CloseSend() + return + case <-cs.procStreamFailed.Done(): + return + case <-cs.ctx.Done(): + return + } + } +} + +// streamError returns the appropriate error when a stream operation is +// preempted by a stream failure or context cancellation. It prioritizes the +// external processor stream's terminal error over the context error. +func (cs *clientStream) streamError() error { + if cs.procStreamFailed.HasFired() { + return cs.procStreamErr.Load().(error) + } + return status.FromContextError(cs.ctx.Err()).Err() +} + +// waitChannel waits for the provided channel to be closed, while also +// respecting context cancellation and stream failures. +func (cs *clientStream) waitChannel(ch <-chan struct{}) error { + select { + case <-ch: + return nil + case <-cs.ctx.Done(): + return cs.streamError() + case <-cs.procStreamFailed.Done(): + return cs.streamError() + } +} + +// createDataplaneStream initializes the underlying gRPC dataplane stream using +// the provided newStream function. If dataplane stream creation fails, the +// top-level context used by the extproc filter is canceled and thereby all +// spawned goroutines terminate. +func (cs *clientStream) createDataplaneStream(ctx context.Context, newStream func(context.Context, ...grpc.CallOption) (grpc.ClientStream, error), opts []grpc.CallOption) error { + defer close(cs.dataplaneSetup) + cs.dataplaneStream, cs.dataplaneCreationErr = newStream(ctx, opts...) + if cs.dataplaneCreationErr != nil { + // Execute the OnFinish call options if the delegate failed. + cs.callOnFinish(cs.dataplaneCreationErr) + cs.cancel() + return cs.dataplaneCreationErr + } + cs.recordMetric(clientHeadersDurationMetric, timeSince(cs.clientHeadersStartTime).Seconds()) + return nil +} + +// failProcStream handles stream failures, recording errors or bypassing the +// external processor based on failureModeAllow configuration. It returns true +// if the stream is bypassed, and false if the connection is torn down. +func (cs *clientStream) failProcStream(err error) bool { + if !cs.procStreamClosed.CompareAndSwap(false, true) { + return cs.procStreamBypass.HasFired() + } + cs.procCancel() + if err != io.EOF && (cs.ignoreFailureMode.Load() || !cs.config.failureModeAllow) { + // Execute the OnFinish call options if the delegate is never called. + if cs.dataplaneStream == nil { + cs.callOnFinish(err) + } + cs.procStreamErr.Store(status.Errorf(codes.Internal, "extproc: %v", err)) + cs.procStreamFailed.Fire() + cs.cleanupDataplane() + return false + } + cs.triggerBypass() + return true +} + +// cancelStream immediately terminates the stream with the specified error and +// fires the failure event. It does not respect the failure mode. +func (cs *clientStream) cancelStream(err error) { + if !cs.procStreamClosed.CompareAndSwap(false, true) { + return + } + // Execute the OnFinish call options if the delegate is never called. + if cs.dataplaneStream == nil { + cs.callOnFinish(err) + } + cs.procStreamErr.Store(err) + cs.procStreamFailed.Fire() + cs.cleanupDataplane() +} + +// handleHeaderError handles failures that occur during receiving or processing +// the initial request headers. If the failure mode allows it, the external +// processor is bypassed and the direct dataplane stream is created. +func (cs *clientStream) handleHeaderError(err error, newStream func(context.Context, ...grpc.CallOption) (grpc.ClientStream, error), opts []grpc.CallOption) { + if cs.failProcStream(err) { + cs.createDataplaneStream(cs.ctx, newStream, opts) + } +} + +// processInitialHeaders waits for the initial header response from the external +// processor server, applies any requested header mutations to the outgoing +// context, and initializes the data plane stream. It returns true if the +// headers were processed successfully and dataplane stream was created. It +// returns false if the proc stream needs to be bypassed, or failed due to an +// error, or aborted early by a processor-initiated immediate response. +func (cs *clientStream) processInitialHeaders(ctx context.Context, newStream func(context.Context, ...grpc.CallOption) (grpc.ClientStream, error), opts []grpc.CallOption) bool { + resp, err := cs.procStream.Recv() + if err != nil { + cs.handleHeaderError(err, newStream, opts) + return false + } + if resp.GetRequestDrain() { + cs.triggerBypass() + } + if resp.GetImmediateResponse() != nil { + cs.handleImmediateResponse(resp.GetImmediateResponse(), newStream, opts) + return false + } + + header := resp.GetRequestHeaders() + if header == nil { + err := fmt.Errorf("external processor returned an unexpected message type %T, expected request headers response", resp.GetResponse()) + cs.handleHeaderError(err, newStream, opts) + return false + } + // Check if status in header response is CONTINUE; if not, fail the stream. + if status := header.GetResponse().GetStatus(); status != v3procservicepb.CommonResponse_CONTINUE { + cs.handleHeaderError(fmt.Errorf("external processor returned unexpected status %v for request headers, expected %v", status, v3procservicepb.CommonResponse_CONTINUE), newStream, opts) + return false + } + // Mutate the outgoing headers with additions and removals received from the + // external processor. + outgoingMD, _ := metadata.FromOutgoingContext(ctx) + if outgoingMD == nil { + outgoingMD = metadata.MD{} + } + if err = cs.applyMutations(header.GetResponse().GetHeaderMutation(), outgoingMD); err != nil { + cs.handleHeaderError(err, newStream, opts) + return false + } + dataplaneCtx := metadata.NewOutgoingContext(ctx, outgoingMD) + if err = cs.createDataplaneStream(dataplaneCtx, newStream, opts); err != nil { + return false + } + return true +} + +func (cs *clientStream) handleImmediateResponse(imm *v3procservicepb.ImmediateResponse, newStream func(context.Context, ...grpc.CallOption) (grpc.ClientStream, error), opts []grpc.CallOption) { + if cs.config.disableImmediateResponse { + err := fmt.Errorf("external processor sent an immediate response but immediate responses are disabled in configuration") + if cs.dataplaneStream == nil { + cs.handleHeaderError(err, newStream, opts) + } else { + cs.failProcStream(err) + } + return + } + + statusCode := codes.Internal + if imm.GetGrpcStatus() != nil { + statusCode = codes.Code(imm.GetGrpcStatus().GetStatus()) + if statusCode > codes.Code(16) { + statusCode = codes.Unknown + } + } + err := status.Error(statusCode, imm.GetDetails()) + + if cs.trailerSent.Load() { + if mutation := imm.GetHeaders(); mutation != nil { + cs.applyMutations(mutation, cs.responseTrailers) + } + cs.trailerErr.Store(err) + cs.fireResponseTrailerReady() + } else { + cs.cancelStream(err) + } +} + +func (cs *clientStream) triggerBypass() { + if cs.procStreamBypass.Fire() { + cs.fireResponseHeadersReady() + cs.fireResponseTrailerReady() + } +} + +// waitForDataplaneStream waits for the dataplane stream to be created or for +// the context to be done. It also checks if the processor stream has not ended +// abruptly with a non-io.EOF error. +func (cs *clientStream) waitForDataplaneStream(ctx context.Context) (grpc.ClientStream, error) { + select { + case <-cs.dataplaneSetup: + if cs.dataplaneCreationErr != nil { + return nil, cs.dataplaneCreationErr + } + return cs.dataplaneStream, nil + case <-ctx.Done(): + // Prioritize returning the underlying dataplane creation failure or + // external processor error over the context cancellation error. + if cs.dataplaneCreationErr != nil { + return nil, cs.dataplaneCreationErr + } + return nil, cs.streamError() + case <-cs.procStreamFailed.Done(): + return nil, cs.procStreamErr.Load().(error) + } +} + +// initiateResponseHeaderProcessing receives initial response headers exactly +// once, forwards them to the external processor if configured, or unblocks +// readers immediately. +func (cs *clientStream) initiateResponseHeaderProcessing() error { + if cs.procStreamFailed.HasFired() { + return cs.procStreamErr.Load().(error) + } + if cs.responseHeaderOnce.Load() || !cs.responseHeaderOnce.CompareAndSwap(false, true) { + return nil + } + dataplaneStream, err := cs.waitForDataplaneStream(cs.ctx) + if err != nil { + return err + } + header, err := dataplaneStream.Header() + if err != nil { + // If the processor stream failed first and canceled cs.ctx, prefer + // that root error over the secondary dataplaneStream.Header() failure. + if cs.procStreamFailed.HasFired() { + return cs.procStreamErr.Load().(error) + } + return err + } + // Capture the start time for response headers after they have been + // successfully retrieved from the dataplane stream. + cs.serverHeadersStartTime.Store(int64(timeSince(cs.clientHeadersStartTime))) + + if header == nil { + // A trailers-only response returns nil from dataplaneStream.Header(). + header = dataplaneStream.Trailer() + if len(header) > 0 { + cs.trailersOnly = true + // For trailers-only, the trailers are retrieved during the header + // phase. Start timing them now since they will be processed as part + // of the header phase. + cs.serverTrailersStartTime.Store(int64(timeSince(cs.clientHeadersStartTime))) + } + } + cs.responseHeader = header + if cs.config.processingModes.responseHeaderMode != modeSend || cs.procStreamBypass.HasFired() { + // If header does not need to be sent to the external processor, unblock + // the functions waiting on header modifications. + cs.fireResponseHeadersReady() + return nil + } + + select { + case cs.procSendCh <- cs.responseHeaders(header): + return nil + case <-cs.procStreamBypass.Done(): + return nil + case <-cs.procStreamFailed.Done(): + return cs.streamError() + case <-cs.ctx.Done(): + return cs.streamError() + } +} + +func (cs *clientStream) initiateResponseTrailerProcessing() { + if cs.responseTrailerOnce.Load() || !cs.responseTrailerOnce.CompareAndSwap(false, true) { + return + } + if cs.trailersOnly { + // For trailers-only response, the trailers metadata map is processed and + // mutated during the response header phase. Wait for those mutations to + // be received and applied. + select { + case <-cs.responseHeadersReady.Done(): + case <-cs.procStreamFailed.Done(): + case <-cs.ctx.Done(): + } + cs.responseTrailers = cs.responseHeader + cs.fireResponseTrailerReady() + // Gracefully half-close the external processor stream for trailers-only + // responses once header modifications finish. + cs.closeProcSend() + return + } + cs.responseTrailers = cs.dataplaneStream.Trailer() + // Capture the start time for response trailers after they have been + // successfully retrieved from the dataplane stream. + offset := timeSince(cs.clientHeadersStartTime) + cs.serverTrailersStartTime.Store(int64(offset)) + + if cs.config.processingModes.responseTrailerMode == modeSend && !cs.procStreamBypass.HasFired() { + select { + case cs.procSendCh <- cs.commonStream.responseTrailers(cs.responseTrailers): + case <-cs.ctx.Done(): + case <-cs.procStreamFailed.Done(): + case <-cs.procStreamBypass.Done(): + } + } else { + cs.fireResponseTrailerReady() + } + // Gracefully half-close the external processor stream after forwarding response + // trailers to signal that all responses have completely processed. + cs.closeProcSend() +} + +func (cs *clientStream) waitForTrailerProcessing(recvErr error) error { + select { + case <-cs.responseTrailerReady.Done(): + if val := cs.trailerErr.Load(); val != nil { + return val.(error) + } + if cs.procStreamFailed.HasFired() { + return cs.procStreamErr.Load().(error) + } + return recvErr + case <-cs.procStreamBypass.Done(): + return recvErr + case <-cs.procStreamFailed.Done(): + return cs.streamError() + case <-cs.ctx.Done(): + return cs.streamError() + } +} + +// convertBodyMode converts the body mode from processingMode to +// v3procfilterpb.ProcessingMode_BodySendMode. +func convertBodyMode(mode processingMode) v3procfilterpb.ProcessingMode_BodySendMode { + if mode == modeSend { + return v3procfilterpb.ProcessingMode_GRPC + } + return v3procfilterpb.ProcessingMode_NONE +} + +func getHeader(md metadata.MD, added [][]string, key string) string { + var vals []string + if md != nil { + vals = append(vals, md.Get(key)...) + } + for _, kvs := range added { + for i := 0; i < len(kvs); i += 2 { + if strings.EqualFold(kvs[i], key) { + vals = append(vals, kvs[i+1]) + } + } + } + return strings.Join(vals, ",") +} + +// constructRequestAttributes builds a map of request attributes specified in +// the interceptor config. +func constructRequestAttributes(rpcInfo resolver.RPCInfo, md metadata.MD, added [][]string, requestedAttributes []string) map[string]*structpb.Struct { + if len(requestedAttributes) == 0 { + return nil + } + + reqFields := make(map[string]any) + for _, attr := range requestedAttributes { + switch attr { + case "request.path", "request.url_path": + reqFields[attr] = rpcInfo.Method + case "request.host": + reqFields[attr] = rpcInfo.Authority + case "request.method": + reqFields[attr] = "POST" + case "request.headers": + headers := make(map[string]any) + for k, values := range md { + headers[strings.ToLower(k)] = strings.Join(values, ",") + } + for _, kvs := range added { + for i := 0; i < len(kvs); i += 2 { + k := strings.ToLower(kvs[i]) + v := kvs[i+1] + if prev, ok := headers[k].(string); ok { + headers[k] = prev + "," + v + } else { + headers[k] = v + } + } + } + reqFields[attr] = headers + case "request.referer": + if val := getHeader(md, added, "referer"); val != "" { + reqFields[attr] = val + } + case "request.useragent": + if val := getHeader(md, added, "user-agent"); val != "" { + reqFields[attr] = val + } + case "request.id": + if val := getHeader(md, added, "x-request-id"); val != "" { + reqFields[attr] = val + } + case "request.query": + reqFields[attr] = "" + default: + // Unknown/unsupported attributes are ignored. + } + } + + reqStruct := &structpb.Struct{Fields: make(map[string]*structpb.Value)} + for k, v := range reqFields { + val, err := structpb.NewValue(v) + if err != nil { + // Skip values that cannot be represented in a structpb.Value to + // match Envoy's behavior of encoding as many attributes as possible. + continue + } + reqStruct.Fields[k] = val + } + + if len(reqStruct.Fields) == 0 { + return nil + } + + return map[string]*structpb.Struct{ + "envoy.filters.http.ext_proc": reqStruct, + } +} diff --git a/vendor/google.golang.org/grpc/internal/xds/httpfilter/extproc/internal/internal.go b/vendor/google.golang.org/grpc/internal/xds/httpfilter/extproc/internal/internal.go new file mode 100644 index 00000000000..a6812f01d31 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/xds/httpfilter/extproc/internal/internal.go @@ -0,0 +1,59 @@ +/* + * + * Copyright 2026 gRPC authors. + * + * 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 internal contains functionality internal to the extproc package. +package internal + +import ( + "fmt" + "time" + + v3corepb "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" + "google.golang.org/grpc" + "google.golang.org/grpc/internal/xds/xdsclient/xdsresource" +) + +var ( + // RegisterForTesting registers the external processor HTTP Filter for testing + // purposes. + RegisterForTesting func() + + // UnregisterForTesting unregisters the external processor HTTP Filter for + // testing purposes. + UnregisterForTesting func() + + // ParseGRPCServiceConfig parses the gRPC service configuration from the given + // protobuf message. + ParseGRPCServiceConfig = func(*v3corepb.GrpcService) (xdsresource.GRPCServiceConfig, error) { + return xdsresource.GRPCServiceConfig{}, fmt.Errorf("extproc: ParseGRPCServiceConfig not implemented") + } + + // CreateExtProcChannel creates a gRPC client channel to the external + // processing server. + CreateExtProcChannel = func(xdsresource.GRPCServiceConfig) (grpc.ClientConnInterface, func() error, error) { + return nil, nil, fmt.Errorf("extproc: dialing external processor server not implemented") + } + + // TimeNowFunc returns the current time.Time, and can be overridden for + // testing purposes. + TimeNowFunc func() time.Time + + // TimeSinceFunc returns the time elapsed, and can be overridden for testing + // purposes. + TimeSinceFunc func(t time.Time) time.Duration +) diff --git a/vendor/google.golang.org/grpc/internal/xds/httpfilter/extproc/metrics.go b/vendor/google.golang.org/grpc/internal/xds/httpfilter/extproc/metrics.go new file mode 100644 index 00000000000..40dd49e9ded --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/xds/httpfilter/extproc/metrics.go @@ -0,0 +1,54 @@ +/* + * + * Copyright 2026 gRPC authors. + * + * 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 extproc + +import ( + estats "google.golang.org/grpc/experimental/stats" +) + +var ( + clientHeadersDurationMetric = estats.RegisterFloat64Histo(estats.MetricDescriptor{ + Name: "grpc.client_ext_proc.client_headers_duration", + Description: "Time between when the ext_proc filter sees the client's headers and when it allows those headers to continue on to the next filter.", + Unit: "s", + Labels: []string{"grpc.target"}, + Default: false, + }) + clientHalfCloseDurationMetric = estats.RegisterFloat64Histo(estats.MetricDescriptor{ + Name: "grpc.client_ext_proc.client_half_close_duration", + Description: "Time between when the ext_proc filter sees the client's half-close and when it allows that half-close to continue on to the next filter.", + Unit: "s", + Labels: []string{"grpc.target"}, + Default: false, + }) + serverHeadersDurationMetric = estats.RegisterFloat64Histo(estats.MetricDescriptor{ + Name: "grpc.client_ext_proc.server_headers_duration", + Description: "Time between when the ext_proc filter sees the server's headers and when it allows those headers to continue on to the next filter.", + Unit: "s", + Labels: []string{"grpc.target"}, + Default: false, + }) + serverTrailersDurationMetric = estats.RegisterFloat64Histo(estats.MetricDescriptor{ + Name: "grpc.client_ext_proc.server_trailers_duration", + Description: "Time between when the ext_proc filter sees the server's trailers and when it allows those trailers to continue on to the next filter.", + Unit: "s", + Labels: []string{"grpc.target"}, + Default: false, + }) +) diff --git a/vendor/google.golang.org/grpc/internal/xds/httpfilter/fault/fault.go b/vendor/google.golang.org/grpc/internal/xds/httpfilter/fault/fault.go index 58f34863698..3bb7aa5e6c2 100644 --- a/vendor/google.golang.org/grpc/internal/xds/httpfilter/fault/fault.go +++ b/vendor/google.golang.org/grpc/internal/xds/httpfilter/fault/fault.go @@ -93,11 +93,11 @@ func parseConfig(cfg proto.Message) (httpfilter.FilterConfig, error) { return config{config: msg}, nil } -func (builder) ParseFilterConfig(cfg proto.Message) (httpfilter.FilterConfig, error) { +func (builder) ParseFilterConfig(cfg proto.Message, _ httpfilter.ParseOptions) (httpfilter.FilterConfig, error) { return parseConfig(cfg) } -func (builder) ParseFilterConfigOverride(override proto.Message) (httpfilter.FilterConfig, error) { +func (builder) ParseFilterConfigOverride(override proto.Message, _ httpfilter.ParseOptions) (httpfilter.FilterConfig, error) { return parseConfig(override) } diff --git a/vendor/google.golang.org/grpc/internal/xds/httpfilter/httpfilter.go b/vendor/google.golang.org/grpc/internal/xds/httpfilter/httpfilter.go index cc31e755eaf..0a0f259e360 100644 --- a/vendor/google.golang.org/grpc/internal/xds/httpfilter/httpfilter.go +++ b/vendor/google.golang.org/grpc/internal/xds/httpfilter/httpfilter.go @@ -24,7 +24,9 @@ import ( "context" "google.golang.org/grpc" + estats "google.golang.org/grpc/experimental/stats" iresolver "google.golang.org/grpc/internal/resolver" + "google.golang.org/grpc/internal/xds/bootstrap" "google.golang.org/protobuf/proto" ) @@ -34,6 +36,17 @@ type FilterConfig interface { isFilterConfig() } +// ParseOptions contains additional information passed to the HTTP filter's +// config parsing methods. +type ParseOptions struct { + // BootstrapConfig contains the complete bootstrap configuration used by the + // xDS client that received the resource being parsed. + BootstrapConfig *bootstrap.Config + // ServerConfig contains the configuration of the xDS management server that + // sent the resource being parsed. + ServerConfig *bootstrap.ServerConfig +} + // DisabledFilterConfig represents a disabled filter override. It implements the // FilterConfig interface and can be returned by ParseFilterConfigOverride to // indicate that the filter should be disabled. It is not used as a config for @@ -57,13 +70,13 @@ type Builder interface { // udpa.type.v1.TypedStruct, or an xds.type.v3.TypedStruct for filters that // do not accept a custom type. The resulting FilterConfig will later be // passed to Build. - ParseFilterConfig(proto.Message) (FilterConfig, error) + ParseFilterConfig(proto.Message, ParseOptions) (FilterConfig, error) // ParseFilterConfigOverride parses the provided override configuration // proto.Message from the RDS override configuration of this filter. This // may be an anypb.Any, a udpa.type.v1.TypedStruct, or an // xds.type.v3.TypedStruct for filters that do not accept a custom type. // The resulting FilterConfig will later be passed to Build. - ParseFilterConfigOverride(proto.Message) (FilterConfig, error) + ParseFilterConfigOverride(proto.Message, ParseOptions) (FilterConfig, error) // IsTerminal returns whether this Filter is terminal or not (i.e. it must // be last filter in the filter chain). IsTerminal() bool @@ -82,14 +95,16 @@ type ClientInterceptor interface { // Note: RPCInfo.Context is currently unused and will be nil. NewStream(ctx context.Context, ri iresolver.RPCInfo, newStream func(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStream, error), opts ...grpc.CallOption) (grpc.ClientStream, error) - // Close closes the interceptor. Once called, no new calls to NewStream are - // accepted. Ongoing calls to NewStream are allowed to complete. + // Close closes the interceptor. No new RPCs will be dispatched to this + // interceptor, but ongoing calls to NewStream are allowed to complete. Close() } // ClientFilterOptions contains options for building a client filter. type ClientFilterOptions struct { - FilterName string // FilterName is the filter name from the xDS configuration. + FilterName string // FilterName is the filter name from the xDS configuration. + MetricsRecorder estats.MetricsRecorder // MetricsRecorder is the metrics recorder to capture metrics for the filter. + Target string // Target is the target string of the channel. } // ClientFilterBuilder is an optional interface that a Builder can implement to @@ -116,6 +131,25 @@ type ClientFilter interface { Close() } +// ServerInterceptor is an interceptor for incoming RPC's on gRPC server side. +type ServerInterceptor interface { + // InterceptRPC intercepts an incoming RPC on the server side. + // + // On success, implementations must return either the original ServerStream + // or a wrapped ServerStream, with a nil error. + // + // Returning a non-nil error will terminate the RPC with that error. + // Implementations are expected to return an error created using the status + // package; otherwise, the RPC will fail with an UNKNOWN status code. + // + // Implementations should never return (nil, nil). + InterceptRPC(ss grpc.ServerStream) (grpc.ServerStream, error) + + // Close closes the interceptor. No new RPCs will be dispatched to this + // interceptor, but ongoing calls to InterceptRPC are allowed to complete. + Close() +} + // ServerFilterBuilder is an optional interface that a Builder can implement to // indicate its capability to build server-side filters. type ServerFilterBuilder interface { @@ -134,7 +168,7 @@ type ServerFilter interface { // // It is valid for this method to return a nil Interceptor and a nil error. // In this case, the RPC will not be intercepted by this filter. - BuildServerInterceptor(config, override FilterConfig) (iresolver.ServerInterceptor, error) + BuildServerInterceptor(config, override FilterConfig) (ServerInterceptor, error) // Close is called when the filter is no longer needed. Close() diff --git a/vendor/google.golang.org/grpc/internal/xds/httpfilter/rbac/rbac.go b/vendor/google.golang.org/grpc/internal/xds/httpfilter/rbac/rbac.go index 1af2c2065ba..761eb3b77b1 100644 --- a/vendor/google.golang.org/grpc/internal/xds/httpfilter/rbac/rbac.go +++ b/vendor/google.golang.org/grpc/internal/xds/httpfilter/rbac/rbac.go @@ -20,12 +20,11 @@ package rbac import ( - "context" "errors" "fmt" "strings" - "google.golang.org/grpc/internal/resolver" + "google.golang.org/grpc" "google.golang.org/grpc/internal/xds/httpfilter" "google.golang.org/grpc/internal/xds/rbac" "google.golang.org/protobuf/proto" @@ -192,7 +191,7 @@ func normalizeHeaderMatcher(header *v3routepb.HeaderMatcher) error { return nil } -func (builder) ParseFilterConfig(cfg proto.Message) (httpfilter.FilterConfig, error) { +func (builder) ParseFilterConfig(cfg proto.Message, _ httpfilter.ParseOptions) (httpfilter.FilterConfig, error) { if cfg == nil { return nil, fmt.Errorf("rbac: nil configuration message provided") } @@ -207,7 +206,7 @@ func (builder) ParseFilterConfig(cfg proto.Message) (httpfilter.FilterConfig, er return parseConfig(msg) } -func (builder) ParseFilterConfigOverride(override proto.Message) (httpfilter.FilterConfig, error) { +func (builder) ParseFilterConfigOverride(override proto.Message, _ httpfilter.ParseOptions) (httpfilter.FilterConfig, error) { if override == nil { return nil, fmt.Errorf("rbac: nil configuration message provided") } @@ -236,7 +235,7 @@ type serverFilter struct{} func (serverFilter) Close() {} -func (serverFilter) BuildServerInterceptor(cfg httpfilter.FilterConfig, override httpfilter.FilterConfig) (resolver.ServerInterceptor, error) { +func (serverFilter) BuildServerInterceptor(cfg httpfilter.FilterConfig, override httpfilter.FilterConfig) (httpfilter.ServerInterceptor, error) { if cfg == nil { return nil, fmt.Errorf("rbac: nil config provided") } @@ -270,8 +269,11 @@ type interceptor struct { chainEngine *rbac.ChainEngine } -func (i *interceptor) AllowRPC(ctx context.Context) error { - return i.chainEngine.IsAuthorized(ctx) +func (i *interceptor) InterceptRPC(ss grpc.ServerStream) (grpc.ServerStream, error) { + if err := i.chainEngine.IsAuthorized(ss.Context()); err != nil { + return nil, err + } + return ss, nil } func (i *interceptor) Close() {} diff --git a/vendor/google.golang.org/grpc/internal/xds/httpfilter/router/router.go b/vendor/google.golang.org/grpc/internal/xds/httpfilter/router/router.go index 954528227a6..4864197fefd 100644 --- a/vendor/google.golang.org/grpc/internal/xds/httpfilter/router/router.go +++ b/vendor/google.golang.org/grpc/internal/xds/httpfilter/router/router.go @@ -22,7 +22,6 @@ package router import ( "fmt" - iresolver "google.golang.org/grpc/internal/resolver" "google.golang.org/grpc/internal/xds/httpfilter" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/anypb" @@ -48,7 +47,7 @@ type builder struct { func (builder) TypeURLs() []string { return []string{TypeURL} } -func (builder) ParseFilterConfig(cfg proto.Message) (httpfilter.FilterConfig, error) { +func (builder) ParseFilterConfig(cfg proto.Message, _ httpfilter.ParseOptions) (httpfilter.FilterConfig, error) { // The gRPC router filter does not currently use any fields from the // config. Verify type only. if cfg == nil { @@ -65,7 +64,7 @@ func (builder) ParseFilterConfig(cfg proto.Message) (httpfilter.FilterConfig, er return config{}, nil } -func (builder) ParseFilterConfigOverride(override proto.Message) (httpfilter.FilterConfig, error) { +func (builder) ParseFilterConfigOverride(override proto.Message, _ httpfilter.ParseOptions) (httpfilter.FilterConfig, error) { if override != nil { return nil, fmt.Errorf("router: unexpected config override specified: %v", override) } @@ -104,7 +103,7 @@ func (filter) BuildClientInterceptor(cfg, override httpfilter.FilterConfig) (htt return nil, nil } -func (filter) BuildServerInterceptor(cfg, override httpfilter.FilterConfig) (iresolver.ServerInterceptor, error) { +func (filter) BuildServerInterceptor(cfg, override httpfilter.FilterConfig) (httpfilter.ServerInterceptor, error) { if _, ok := cfg.(config); !ok { return nil, fmt.Errorf("router: incorrect config type provided (%T): %v", cfg, cfg) } diff --git a/vendor/google.golang.org/grpc/internal/xds/rbac/matchers.go b/vendor/google.golang.org/grpc/internal/xds/rbac/matchers.go index cf6fbcead4c..f5b064d5260 100644 --- a/vendor/google.golang.org/grpc/internal/xds/rbac/matchers.go +++ b/vendor/google.golang.org/grpc/internal/xds/rbac/matchers.go @@ -365,7 +365,7 @@ type remoteIPMatcher struct { func newRemoteIPMatcher(cidrRange *v3corepb.CidrRange) (*remoteIPMatcher, error) { // Convert configuration to a cidrRangeString, as Go standard library has // methods that parse cidr string. - cidrRangeString := fmt.Sprintf("%s/%d", cidrRange.AddressPrefix, cidrRange.PrefixLen.Value) + cidrRangeString := fmt.Sprintf("%s/%d", cidrRange.GetAddressPrefix(), cidrRange.GetPrefixLen().GetValue()) ipNet, err := netip.ParsePrefix(cidrRangeString) if err != nil { return nil, err @@ -391,7 +391,7 @@ type localIPMatcher struct { } func newLocalIPMatcher(cidrRange *v3corepb.CidrRange) (*localIPMatcher, error) { - cidrRangeString := fmt.Sprintf("%s/%d", cidrRange.AddressPrefix, cidrRange.PrefixLen.Value) + cidrRangeString := fmt.Sprintf("%s/%d", cidrRange.GetAddressPrefix(), cidrRange.GetPrefixLen().GetValue()) ipNet, err := netip.ParsePrefix(cidrRangeString) if err != nil { return nil, err diff --git a/vendor/google.golang.org/grpc/internal/xds/resolver/serviceconfig.go b/vendor/google.golang.org/grpc/internal/xds/resolver/serviceconfig.go index 94801b77de0..bdbaea69995 100644 --- a/vendor/google.golang.org/grpc/internal/xds/resolver/serviceconfig.go +++ b/vendor/google.golang.org/grpc/internal/xds/resolver/serviceconfig.go @@ -24,10 +24,12 @@ import ( "math/bits" rand "math/rand/v2" "strings" + "sync" "time" xxhash "github.com/cespare/xxhash/v2" "google.golang.org/grpc/codes" + "google.golang.org/grpc/internal/grpcsync" "google.golang.org/grpc/internal/grpcutil" iresolver "google.golang.org/grpc/internal/resolver" iringhash "google.golang.org/grpc/internal/ringhash" @@ -110,10 +112,10 @@ type routeCluster struct { } type route struct { - m *xdsresource.CompositeMatcher // converted from route matchers - actionType xdsresource.RouteActionType // holds route action type - clusters wrr.WRR // holds *routeCluster entries - interceptors []httpfilter.ClientInterceptor // Interceptors across clusters belonging to this route + m *xdsresource.CompositeMatcher // converted from route matchers + actionType xdsresource.RouteActionType // holds route action type + clusters wrr.WRR // holds *routeCluster entries + routeClusters []*grpcsync.RefCounted[*routeCluster] // Route clusters belonging to this route maxStreamDuration time.Duration retryConfig *xdsresource.RetryConfig hashPolicies []*xdsresource.HashPolicy @@ -175,9 +177,20 @@ func annotateErrorWithNodeID(err error, nodeID string) error { func (cs *configSelector) SelectConfig(rpcInfo iresolver.RPCInfo) (*iresolver.RPCConfig, error) { var rt *route + md, _ := metadata.FromOutgoingContext(rpcInfo.Context) + if extraMD, ok := grpcutil.ExtraMetadata(rpcInfo.Context); ok { + md = metadata.Join(md, extraMD) + // Remove all binary headers. They are hard to match with. May need + // to add back if asked by users. + for k := range md { + if strings.HasSuffix(k, "-bin") { + delete(md, k) + } + } + } // Loop through routes in order and select first match. for _, r := range cs.routes { - if r.m.Match(rpcInfo) { + if r.m.Match(rpcInfo.Method, md) { rt = &r break } @@ -191,19 +204,11 @@ func (cs *configSelector) SelectConfig(rpcInfo iresolver.RPCInfo) (*iresolver.RP return nil, annotateErrorWithNodeID(errUnsupportedClientRouteAction, cs.xdsNodeID) } - cluster, ok := rt.clusters.Next().(*routeCluster) + rc, ok := rt.clusters.Next().(*grpcsync.RefCounted[*routeCluster]) if !ok { - return nil, annotateErrorWithNodeID(status.Errorf(codes.Internal, "error retrieving cluster for match: %v (%T)", cluster, cluster), cs.xdsNodeID) - } - - // Add a ref to the selected cluster/plugin, as this RPC needs this - // cluster/plugin until it is committed. - if info, ok := cs.clusters[cluster.name]; ok { - info.refCount.Add(1) - } else if info, ok := cs.plugins[cluster.name]; ok { - info.refCount.Add(1) + return nil, annotateErrorWithNodeID(status.Errorf(codes.Internal, "error retrieving cluster for match: %v (%T)", rc, rc), cs.xdsNodeID) } - + cluster := rc.Value() lbCtx := clustermanager.SetPickedCluster(rpcInfo.Context, cluster.name) lbCtx = xdsresource.NewContextWithXDSConfig(lbCtx, cs.xdsConfig) lbCtx = iringhash.SetXDSRequestHash(lbCtx, cs.generateHash(rpcInfo, rt.hashPolicies)) @@ -212,31 +217,48 @@ func (cs *configSelector) SelectConfig(rpcInfo iresolver.RPCInfo) (*iresolver.RP } config := &iresolver.RPCConfig{ - // Communicate to the LB policy the chosen cluster and request hash, if Ring Hash LB policy. - Context: lbCtx, - OnCommitted: func() { - // When the RPC is committed, the cluster is no longer required. - // Decrease its ref. - if info, ok := cs.clusters[cluster.name]; ok { - if v := info.refCount.Add(-1); v == 0 { - // We call unsubscribe rather than sendNewServiceConfig to - // prevent redundant updates. If the reference count in the - // dependency manager drops to zero, it will automatically - // trigger a service config update with this cluster - // removed. Calling unsubscribe allows the dependency - // manager to handle the update flow once and for all. - info.unsubscribe() - } + Context: lbCtx, + Interceptor: cluster.interceptor, + } + // Add a ref to the selected cluster to keep the interceptors alive until RPC + // is committed. + rc.Increment() + if info, ok := cs.clusters[cluster.name]; ok { + // Add a ref to the selected cluster, as this RPC needs this + // cluster until it is committed. + info.refCount.Add(1) + config.OnCommitted = sync.OnceFunc(func() { + if v := info.refCount.Add(-1); v == 0 { + // We call unsubscribe rather than sendNewServiceConfig to + // prevent redundant updates. If the reference count in the + // dependency manager drops to zero, it will automatically + // trigger a service config update with this cluster + // removed. Calling unsubscribe allows the dependency + // manager to handle the update flow once and for all. + info.unsubscribe() } - if info, ok := cs.plugins[cluster.name]; ok { - if v := info.refCount.Add(-1); v == 0 { - // This entry will be removed from activePlugins when - // producing a new service config update. - cs.sendNewServiceConfig() - } + // Decrement the refcount of the route cluster and close the interceptor + // if refcount goes to zero. + rc.Decrement() + }) + } else if info, ok := cs.plugins[cluster.name]; ok { + // Add a ref to the selected plugin, as this RPC needs this + // plugin until it is committed. + info.refCount.Add(1) + config.OnCommitted = sync.OnceFunc(func() { + if v := info.refCount.Add(-1); v == 0 { + // This entry will be removed from activePlugins when + // producing a new service config update. + cs.sendNewServiceConfig() } - }, - Interceptor: cluster.interceptor, + // Decrement the refcount of the route cluster and close the interceptor + // if refcount goes to zero. + rc.Decrement() + }) + } else { + // This should be unreachable because all route clusters are normalized + // into cs.clusters or cs.plugins during config selector creation. + panic(fmt.Sprintf("matched cluster %q not found in ConfigSelector", cluster.name)) } if rt.maxStreamDuration != 0 { @@ -333,10 +355,12 @@ func (cs *configSelector) stop() { return } - // Stop all interceptors associated with this config selector. + // Decrement the refcount of all the route clusters associated with this + // config selector and close the interceptors of the route cluster if it's + // refcount goes to zero. for _, r := range cs.routes { - for _, i := range r.interceptors { - i.Close() + for _, rc := range r.routeClusters { + rc.Decrement() } } diff --git a/vendor/google.golang.org/grpc/internal/xds/resolver/xds_resolver.go b/vendor/google.golang.org/grpc/internal/xds/resolver/xds_resolver.go index 8dfa684a5fb..b9feb55bc8a 100644 --- a/vendor/google.golang.org/grpc/internal/xds/resolver/xds_resolver.go +++ b/vendor/google.golang.org/grpc/internal/xds/resolver/xds_resolver.go @@ -142,6 +142,8 @@ func (b *xdsResolverBuilder) Build(target resolver.Target, cc resolver.ClientCon httpFilters: make(map[clientFilterKey]httpfilter.ClientFilter), channelID: rand.Uint64(), ldsResourceName: ldsResourceName, + target: target.String(), + metricsRecorder: opts.MetricsRecorder, // serializer used to synchronize the following: // - updates from the dependency manager. This could lead to generation @@ -233,6 +235,9 @@ type xdsResolver struct { xdsClient xdsclient.XDSClient xdsClientClose func() channelID uint64 // Unique random ID for the channel owning this resolver. + target string + metricsRecorder estats.MetricsRecorder + // All methods on the xdsResolver type except for the ones invoked by gRPC, // i.e ResolveNow() and Close(), are guaranteed to execute in the context of // this serializer's callback. We use the serializer because these shared @@ -312,13 +317,7 @@ func (r *xdsResolver) Update(config *xdsresource.XDSConfig) { r.onResourceError(err) return } - if !r.sendNewServiceConfig(cs) { - // Channel didn't like the update we provided (unexpected); erase - // this config selector and ignore this update, continuing with - // the previous config selector. - cs.stop() - return - } + r.sendNewServiceConfig(cs) if r.curConfigSelector != nil { r.curConfigSelector.stop() @@ -335,11 +334,12 @@ func (r *xdsResolver) Error(err error) { // sendNewServiceConfig prunes active clusters, generates a new service config // based on the current set of active clusters, and sends an update to the -// channel with that service config and the provided config selector. Returns -// false if an error occurs while sending an update to the channel. +// channel with that service config and the provided config selector. It is safe +// to ignore the error from `cc.UpdateState` because the clientconn uses the +// given configSelector even if it returns an error. // // Only executed in the context of a serializer callback. -func (r *xdsResolver) sendNewServiceConfig(cs stoppableConfigSelector) bool { +func (r *xdsResolver) sendNewServiceConfig(cs stoppableConfigSelector) { // Delete entries from r.activeClusters with zero references; // otherwise serviceConfigJSON will generate a config including // them. @@ -357,7 +357,7 @@ func (r *xdsResolver) sendNewServiceConfig(cs stoppableConfigSelector) bool { // more meaningful error, as opposed to one that says that pick_first // received no addresses. r.cc.ReportError(errCS.err) - return true + return } sc := serviceConfigJSON(r.activeClusters, r.activePlugins) @@ -371,13 +371,7 @@ func (r *xdsResolver) sendNewServiceConfig(cs stoppableConfigSelector) bool { }, cs) state = xdsresource.SetXDSConfig(state, r.xdsConfig) state = xdsdepmgr.SetXDSClusterSubscriber(state, r.dm) - if err := r.cc.UpdateState(xdsclient.SetClient(state, r.xdsClient)); err != nil { - if r.logger.V(2) { - r.logger.Infof("Channel rejected new state: %+v with error: %v", state, err) - } - return false - } - return true + r.cc.UpdateState(xdsclient.SetClient(state, r.xdsClient)) } // newConfigSelector creates a new config selector using the most recently @@ -431,11 +425,13 @@ func (r *xdsResolver) newConfigSelector() (_ *configSelector, err error) { } return nil, err } - clusters.Add(&routeCluster{ + routeCluster := &routeCluster{ name: clusterName, interceptor: interceptor, - }, 1) - interceptors = append(interceptors, interceptor) + } + rc := grpcsync.NewRefCounted(routeCluster, func() { interceptor.Close() }) + cs.routes[i].routeClusters = append(cs.routes[i].routeClusters, rc) + clusters.Add(rc, 1) ci := r.addOrGetActiveClusterInfo(clusterName, "") ci.cfg = xdsChildConfig{ChildPolicy: balancerConfig(r.xdsConfig.RouteConfig.ClusterSpecifierPlugins[rt.ClusterSpecifierPlugin])} cs.plugins[clusterName] = ci @@ -453,18 +449,19 @@ func (r *xdsResolver) newConfigSelector() (_ *configSelector, err error) { } return nil, err } - clusters.Add(&routeCluster{ + routeCluster := &routeCluster{ name: clusterName, interceptor: interceptor, - }, int64(wc.Weight)) - interceptors = append(interceptors, interceptor) + } + rc := grpcsync.NewRefCounted(routeCluster, func() { interceptor.Close() }) + cs.routes[i].routeClusters = append(cs.routes[i].routeClusters, rc) + clusters.Add(rc, int64(wc.Weight)) ci := r.addOrGetActiveClusterInfo(clusterName, wc.Name) ci.cfg = xdsChildConfig{ChildPolicy: newBalancerConfig(cdsName, cdsBalancerConfig{Cluster: wc.Name})} cs.clusters[clusterName] = ci } } cs.routes[i].clusters = clusters - cs.routes[i].interceptors = interceptors cs.routes[i].m = xdsresource.RouteToMatcher(rt) cs.routes[i].actionType = rt.ActionType if rt.MaxStreamDuration == nil { @@ -685,7 +682,11 @@ func (r *xdsResolver) getOrCreateClientFilter(builder httpfilter.ClientFilterBui return clientFilter } - cf := builder.BuildClientFilter(httpfilter.ClientFilterOptions{FilterName: key.name}) + cf := builder.BuildClientFilter(httpfilter.ClientFilterOptions{ + FilterName: key.name, + MetricsRecorder: r.metricsRecorder, + Target: r.target, + }) r.httpFilters[key] = cf return cf } diff --git a/vendor/google.golang.org/grpc/internal/xds/server/conn_wrapper.go b/vendor/google.golang.org/grpc/internal/xds/server/conn_wrapper.go index b2f707fabee..104e6f82356 100644 --- a/vendor/google.golang.org/grpc/internal/xds/server/conn_wrapper.go +++ b/vendor/google.golang.org/grpc/internal/xds/server/conn_wrapper.go @@ -26,7 +26,8 @@ import ( "time" "google.golang.org/grpc/credentials/tls/certprovider" - xdsinternal "google.golang.org/grpc/internal/credentials/xds" + "google.golang.org/grpc/internal/credentials/xds" + "google.golang.org/grpc/internal/grpcsync" "google.golang.org/grpc/internal/transport" ) @@ -49,9 +50,6 @@ type connWrapper struct { // A reference to the listenerWrapper on which this connection was accepted. parent *listenerWrapper - // The certificate providers created for this connection. - rootProvider, identityProvider certprovider.Provider - // The connection deadline as configured by the grpc.Server on the rawConn // that is returned by a call to Accept(). This is set to the connection // timeout value configured by the user (or to a default value) before @@ -63,6 +61,8 @@ type connWrapper struct { mu sync.Mutex st transport.ServerTransport draining bool + closed bool + hi *grpcsync.RefCounted[*xds.HandshakeInfo] // The virtual hosts with matchable routes and instantiated HTTP Filters per // route, or an error. @@ -91,13 +91,13 @@ func (c *connWrapper) GetDeadline() time.Time { // XDSHandshakeInfo returns a HandshakeInfo with appropriate security // configuration for this connection. This method is invoked by the // ServerHandshake() method of the XdsCredentials. -func (c *connWrapper) XDSHandshakeInfo() (*xdsinternal.HandshakeInfo, error) { +func (c *connWrapper) XDSHandshakeInfo() (*grpcsync.RefCounted[*xds.HandshakeInfo], error) { if c.filterChain.securityCfg == nil { // If the security config is empty, this means that the control plane // did not provide any security configuration and therefore we should - // return an empty HandshakeInfo here so that the xdsCreds can use the - // configured fallback credentials. - return xdsinternal.NewHandshakeInfo(nil, nil, nil, false, "", false, false), nil + // return nil here so that the xdsCreds can use the configured fallback + // credentials. + return nil, nil } cpc := c.parent.xdsC.BootstrapConfig().CertProviderConfigs() @@ -113,13 +113,27 @@ func (c *connWrapper) XDSHandshakeInfo() (*xdsinternal.HandshakeInfo, error) { if instance, cert := secCfg.RootInstanceName, secCfg.RootCertName; instance != "" { rp, err = buildProviderFunc(cpc, instance, cert, false, true) if err != nil { + ip.Close() return nil, err } } - c.identityProvider = ip - c.rootProvider = rp - return xdsinternal.NewHandshakeInfo(c.rootProvider, c.identityProvider, nil, secCfg.RequireClientCert, "", false, false), nil + // Note that this method is invoked when a connection is accepted, and the + // xdsCredentials are doing a handshake on it. This can only ever be called + // once per connection. So, we do not need to worry about decrementing the + // reference count for the existing HandshakeInfo, which will always be nil. + // The reference count will be decremented when the connection is closed. + c.mu.Lock() + defer c.mu.Unlock() + if c.closed { + if rp != nil { + rp.Close() + } + ip.Close() + return nil, fmt.Errorf("xds: connection closed") + } + c.hi = xds.NewHandshakeInfo(rp, ip, nil, "", secCfg.RequireClientCert, false, false) + return c.hi, nil } // PassServerTransport drains the passed in ServerTransport if draining is set, @@ -148,12 +162,19 @@ func (c *connWrapper) Drain() { // Close closes the providers and the underlying connection. func (c *connWrapper) Close() error { - if c.identityProvider != nil { - c.identityProvider.Close() + c.mu.Lock() + if c.closed { + c.mu.Unlock() + return nil } - if c.rootProvider != nil { - c.rootProvider.Close() + c.closed = true + hi := c.hi + c.mu.Unlock() + + if hi != nil { + hi.Decrement() } + c.parent.removeConn(c) return c.Conn.Close() } diff --git a/vendor/google.golang.org/grpc/internal/xds/server/filter_chain_manager.go b/vendor/google.golang.org/grpc/internal/xds/server/filter_chain_manager.go index f3d0143c244..88c648e119b 100644 --- a/vendor/google.golang.org/grpc/internal/xds/server/filter_chain_manager.go +++ b/vendor/google.golang.org/grpc/internal/xds/server/filter_chain_manager.go @@ -18,7 +18,6 @@ package server import ( - "context" "errors" "fmt" "net/netip" @@ -26,8 +25,8 @@ import ( "strings" "sync/atomic" + "google.golang.org/grpc" "google.golang.org/grpc/codes" - "google.golang.org/grpc/internal/resolver" "google.golang.org/grpc/internal/xds/httpfilter" "google.golang.org/grpc/internal/xds/xdsclient/xdsresource" "google.golang.org/grpc/status" @@ -209,7 +208,7 @@ type virtualHostWithInterceptors struct { type routeWithInterceptors struct { matcher *xdsresource.CompositeMatcher actionType xdsresource.RouteActionType - interceptor resolver.ServerInterceptor + interceptor httpfilter.ServerInterceptor } type lookupParams struct { @@ -500,9 +499,9 @@ func (rc *usableRouteConfiguration) statusErrWithNodeID(c codes.Code, msg string return status.Error(c, fmt.Sprintf("[xDS node id: %v]: %s", rc.nodeID, fmt.Sprintf(msg, args...))) } -func (fc *filterChain) newInterceptor(routeOverride, virtualHostOverride map[string]httpfilter.FilterConfig, provider serverFilterProvider) (_ resolver.ServerInterceptor, _ []httpfilter.ServerFilter, err error) { +func (fc *filterChain) newInterceptor(routeOverride, virtualHostOverride map[string]httpfilter.FilterConfig, provider serverFilterProvider) (_ httpfilter.ServerInterceptor, _ []httpfilter.ServerFilter, err error) { serverFilters := []httpfilter.ServerFilter{} - interceptors := make([]resolver.ServerInterceptor, 0, len(fc.httpFilters)) + interceptors := make([]httpfilter.ServerInterceptor, 0, len(fc.httpFilters)) defer func() { if err != nil { for _, sf := range serverFilters { @@ -549,16 +548,18 @@ func (fc *filterChain) newInterceptor(routeOverride, virtualHostOverride map[str } type interceptorList struct { - interceptors []resolver.ServerInterceptor + interceptors []httpfilter.ServerInterceptor } -func (il *interceptorList) AllowRPC(ctx context.Context) error { +func (il *interceptorList) InterceptRPC(ss grpc.ServerStream) (grpc.ServerStream, error) { + var err error for _, i := range il.interceptors { - if err := i.AllowRPC(ctx); err != nil { - return err + ss, err = i.InterceptRPC(ss) + if err != nil { + return nil, err } } - return nil + return ss, nil } func (il *interceptorList) Close() { diff --git a/vendor/google.golang.org/grpc/internal/xds/server/routing.go b/vendor/google.golang.org/grpc/internal/xds/server/routing.go index 67dd7609e1f..36f4af1d457 100644 --- a/vendor/google.golang.org/grpc/internal/xds/server/routing.go +++ b/vendor/google.golang.org/grpc/internal/xds/server/routing.go @@ -19,28 +19,25 @@ package server import ( - "context" "errors" - "fmt" "strings" "google.golang.org/grpc" "google.golang.org/grpc/codes" - iresolver "google.golang.org/grpc/internal/resolver" "google.golang.org/grpc/internal/transport" "google.golang.org/grpc/internal/xds/xdsclient/xdsresource" "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" ) // RouteAndProcess routes the incoming RPC to a configured route in the route // table and also processes the RPC by running the incoming RPC through any HTTP // Filters configured. -func RouteAndProcess(ctx context.Context) error { +func RouteAndProcess(ss grpc.ServerStream) (grpc.ServerStream, error) { + ctx := ss.Context() conn := transport.GetConnection(ctx) cw, ok := conn.(*connWrapper) if !ok { - return errors.New("missing virtual hosts in incoming context") + return nil, errors.New("missing virtual hosts in incoming context") } rc := cw.urc.Load() @@ -51,51 +48,50 @@ func RouteAndProcess(ctx context.Context) error { if logger.V(2) { logger.Infof("RPC on connection with xDS Configuration error: %v", rc.err) } - return status.Error(codes.Unavailable, fmt.Sprintf("error from xDS configuration for matched route configuration: %v", rc.err)) + return nil, rc.statusErrWithNodeID(codes.Unavailable, "error from xDS configuration for matched route configuration: %v", rc.err) } mn, ok := grpc.Method(ctx) if !ok { - return errors.New("missing method name in incoming context") + return nil, rc.statusErrWithNodeID(codes.Internal, "missing method name in incoming context") } md, ok := metadata.FromIncomingContext(ctx) if !ok { - return errors.New("missing metadata in incoming context") + return nil, rc.statusErrWithNodeID(codes.Internal, "missing metadata in incoming context") } - // A41 added logic to the core grpc implementation to guarantee that once - // the RPC gets to this point, there will be a single, unambiguous authority - // present in the header map. + // A41 added logic to the core grpc implementation to guarantee that once the + // RPC gets to this point, there will be a single, unambiguous authority + // present in the header map. But add a defensive check to ensure authority + // header is present. authority := md.Get(":authority") - // authority[0] is safe because of the guarantee mentioned above. + if len(authority) == 0 { + return nil, rc.statusErrWithNodeID(codes.Internal, "no :authority header present") + } vh := findBestMatchingVirtualHostServer(authority[0], rc.vhs) if vh == nil { - return rc.statusErrWithNodeID(codes.Unavailable, "the incoming RPC did not match a configured Virtual Host") + return nil, rc.statusErrWithNodeID(codes.Unavailable, "the incoming RPC did not match a configured Virtual Host") } var rwi *routeWithInterceptors - rpcInfo := iresolver.RPCInfo{ - Context: ctx, - Method: mn, - } for _, r := range vh.routes { - if r.matcher.Match(rpcInfo) { + if r.matcher.Match(mn, md) { // "NonForwardingAction is expected for all Routes used on // server-side; a route with an inappropriate action causes RPCs // matching that route to fail with UNAVAILABLE." - A36 if r.actionType != xdsresource.RouteActionNonForwardingAction { - return rc.statusErrWithNodeID(codes.Unavailable, "the incoming RPC matched to a route that was not of action type non forwarding") + return nil, rc.statusErrWithNodeID(codes.Unavailable, "the incoming RPC matched to a route that was not of action type non forwarding") } rwi = &r break } } if rwi == nil { - return rc.statusErrWithNodeID(codes.Unavailable, "the incoming RPC did not match a configured Route") + return nil, rc.statusErrWithNodeID(codes.Unavailable, "the incoming RPC did not match a configured Route") } - if err := rwi.interceptor.AllowRPC(ctx); err != nil { - return rc.statusErrWithNodeID(codes.PermissionDenied, "Incoming RPC is not allowed: %v", err) + if rwi.interceptor != nil { + return rwi.interceptor.InterceptRPC(ss) } - return nil + return ss, nil } // findBestMatchingVirtualHostServer returns the virtual host whose domains field best diff --git a/vendor/google.golang.org/grpc/internal/xds/xdsclient/resource_types.go b/vendor/google.golang.org/grpc/internal/xds/xdsclient/resource_types.go index 29d1ed4cbf4..547e2a4b25b 100644 --- a/vendor/google.golang.org/grpc/internal/xds/xdsclient/resource_types.go +++ b/vendor/google.golang.org/grpc/internal/xds/xdsclient/resource_types.go @@ -30,13 +30,13 @@ func supportedResourceTypes(config *bootstrap.Config, gServerCfgMap map[xdsclien TypeURL: version.V3ListenerURL, TypeName: xdsresource.ListenerResourceTypeName, AllResourcesRequiredInSotW: true, - Decoder: xdsresource.NewListenerResourceTypeDecoder(config), + Decoder: xdsresource.NewListenerResourceTypeDecoder(config, gServerCfgMap), }, version.V3RouteConfigURL: { TypeURL: version.V3RouteConfigURL, TypeName: xdsresource.RouteConfigTypeName, AllResourcesRequiredInSotW: false, - Decoder: xdsresource.NewRouteConfigResourceTypeDecoder(config), + Decoder: xdsresource.NewRouteConfigResourceTypeDecoder(config, gServerCfgMap), }, version.V3ClusterURL: { TypeURL: version.V3ClusterURL, diff --git a/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/filter_chain.go b/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/filter_chain.go index 8d69422d2e3..fdf87d3235e 100644 --- a/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/filter_chain.go +++ b/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/filter_chain.go @@ -21,6 +21,7 @@ import ( "fmt" "net/netip" + "google.golang.org/grpc/internal/xds/bootstrap" "google.golang.org/grpc/internal/xds/xdsclient/xdsresource/version" v3listenerpb "github.com/envoyproxy/go-control-plane/envoy/config/listener/v3" @@ -80,7 +81,7 @@ func (n NetworkFilterChainConfig) IsEmpty() bool { return n.SecurityCfg == nil && n.HTTPConnMgr == nil } -func processNetworkFilters(filters []*v3listenerpb.Filter) (*HTTPConnectionManagerConfig, error) { +func processNetworkFilters(filters []*v3listenerpb.Filter, bc *bootstrap.Config, sc *bootstrap.ServerConfig) (*HTTPConnectionManagerConfig, error) { hcmConfig := &HTTPConnectionManagerConfig{} seenNames := make(map[string]bool, len(filters)) seenHCM := false @@ -120,7 +121,7 @@ func processNetworkFilters(filters []*v3listenerpb.Filter) (*HTTPConnectionManag // "Any filters after HttpConnectionManager should be ignored during // connection processing but still be considered for validity. // HTTPConnectionManager must have valid http_filters." - A36 - filters, err := processHTTPFilters(hcm.GetHttpFilters(), true) + filters, err := processHTTPFilters(hcm.GetHttpFilters(), true, bc, sc) if err != nil { return nil, fmt.Errorf("network filters {%+v} had invalid server side HTTP Filters {%+v}: %v", filters, hcm.GetHttpFilters(), err) } @@ -157,7 +158,7 @@ func processNetworkFilters(filters []*v3listenerpb.Filter) (*HTTPConnectionManag // server-side." - A36 // Can specify v3 here, as will never get to this function // if v2. - routeU, err := generateRDSUpdateFromRouteConfiguration(hcm.GetRouteConfig(), nil) + routeU, err := generateRDSUpdateFromRouteConfiguration(hcm.GetRouteConfig(), bc, sc) if err != nil { return nil, fmt.Errorf("failed to parse inline RDS resp: %v", err) } diff --git a/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/listener_resource_type.go b/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/listener_resource_type.go index 71d529f92f2..b694ba7d11d 100644 --- a/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/listener_resource_type.go +++ b/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/listener_resource_type.go @@ -33,10 +33,15 @@ const ListenerResourceTypeName = "ListenerResource" // interface for listener resources. type listenerResourceDecoder struct { bootstrapConfig *bootstrap.Config + serverConfigs map[xdsclient.ServerConfig]*bootstrap.ServerConfig } func (d *listenerResourceDecoder) Decode(resource *xdsclient.AnyProto, opts xdsclient.DecodeOptions) (*xdsclient.DecodeResult, error) { - name, listener, err := unmarshalListenerResource(resource.ToAny(), &opts) + var serverCfg *bootstrap.ServerConfig + if opts.ServerConfig != nil { + serverCfg = d.serverConfigs[*opts.ServerConfig] + } + name, listener, err := unmarshalListenerResource(resource.ToAny(), d.bootstrapConfig, serverCfg) if name == "" { // Name is unset only when protobuf deserialization fails. return nil, err @@ -175,6 +180,6 @@ func WatchListener(p Producer, name string, w ListenerWatcher) (cancel func()) { // NewListenerResourceTypeDecoder returns a xdsclient.Decoder that wraps // the xdsresource.listenerType. -func NewListenerResourceTypeDecoder(bc *bootstrap.Config) xdsclient.Decoder { - return &listenerResourceDecoder{bootstrapConfig: bc} +func NewListenerResourceTypeDecoder(bc *bootstrap.Config, gServerCfgMap map[xdsclient.ServerConfig]*bootstrap.ServerConfig) xdsclient.Decoder { + return &listenerResourceDecoder{bootstrapConfig: bc, serverConfigs: gServerCfgMap} } diff --git a/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/matcher.go b/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/matcher.go index 3eef12f23cb..a1c15c21e80 100644 --- a/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/matcher.go +++ b/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/matcher.go @@ -22,8 +22,6 @@ import ( rand "math/rand/v2" "strings" - "google.golang.org/grpc/internal/grpcutil" - iresolver "google.golang.org/grpc/internal/resolver" "google.golang.org/grpc/internal/xds/matcher" "google.golang.org/grpc/metadata" ) @@ -84,27 +82,11 @@ func newCompositeMatcher(pm pathMatcher, hms []matcher.HeaderMatcher, fm *fracti } // Match returns true if all matchers return true. -func (a *CompositeMatcher) Match(info iresolver.RPCInfo) bool { - if a.pm != nil && !a.pm.match(info.Method) { +func (a *CompositeMatcher) Match(method string, md metadata.MD) bool { + if a.pm != nil && !a.pm.match(method) { return false } - // Call headerMatchers even if md is nil, because routes may match - // non-presence of some headers. - var md metadata.MD - if info.Context != nil { - md, _ = metadata.FromOutgoingContext(info.Context) - if extraMD, ok := grpcutil.ExtraMetadata(info.Context); ok { - md = metadata.Join(md, extraMD) - // Remove all binary headers. They are hard to match with. May need - // to add back if asked by users. - for k := range md { - if strings.HasSuffix(k, "-bin") { - delete(md, k) - } - } - } - } for _, m := range a.hms { if !m.Match(md) { return false diff --git a/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/route_config_resource_type.go b/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/route_config_resource_type.go index 1104fe9f2b4..2b392b831be 100644 --- a/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/route_config_resource_type.go +++ b/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/route_config_resource_type.go @@ -35,10 +35,15 @@ const ( // interface for route configuration resources. type routeConfigResourceDecoder struct { bootstrapConfig *bootstrap.Config + serverConfigs map[xdsclient.ServerConfig]*bootstrap.ServerConfig } func (d *routeConfigResourceDecoder) Decode(resource *xdsclient.AnyProto, opts xdsclient.DecodeOptions) (*xdsclient.DecodeResult, error) { - name, rc, err := unmarshalRouteConfigResource(resource.ToAny(), &opts) + var serverCfg *bootstrap.ServerConfig + if opts.ServerConfig != nil { + serverCfg = d.serverConfigs[*opts.ServerConfig] + } + name, rc, err := unmarshalRouteConfigResource(resource.ToAny(), d.bootstrapConfig, serverCfg) if name == "" { // Name is unset only when protobuf deserialization fails. return nil, err @@ -122,6 +127,6 @@ func WatchRouteConfig(p Producer, name string, w RouteConfigWatcher) (cancel fun // NewRouteConfigResourceTypeDecoder returns a xdsclient.Decoder that wraps // the xdsresource.routeConfigType. -func NewRouteConfigResourceTypeDecoder(bc *bootstrap.Config) xdsclient.Decoder { - return &routeConfigResourceDecoder{bootstrapConfig: bc} +func NewRouteConfigResourceTypeDecoder(bc *bootstrap.Config, gServerCfgMap map[xdsclient.ServerConfig]*bootstrap.ServerConfig) xdsclient.Decoder { + return &routeConfigResourceDecoder{bootstrapConfig: bc, serverConfigs: gServerCfgMap} } diff --git a/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_eds.go b/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_eds.go index 22eb8500db7..3327d6751ee 100644 --- a/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_eds.go +++ b/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_eds.go @@ -77,7 +77,7 @@ func parseAddress(socketAddress *v3corepb.SocketAddress) string { return net.JoinHostPort(socketAddress.GetAddress(), strconv.Itoa(int(socketAddress.GetPortValue()))) } -func parseDropPolicy(dropPolicy *v3endpointpb.ClusterLoadAssignment_Policy_DropOverload) OverloadDropConfig { +func parseDropPolicy(dropPolicy *v3endpointpb.ClusterLoadAssignment_Policy_DropOverload) (OverloadDropConfig, error) { percentage := dropPolicy.GetDropPercentage() var ( numerator = percentage.GetNumerator() @@ -90,12 +90,14 @@ func parseDropPolicy(dropPolicy *v3endpointpb.ClusterLoadAssignment_Policy_DropO denominator = 10000 case v3typepb.FractionalPercent_MILLION: denominator = 1000000 + default: + return OverloadDropConfig{}, fmt.Errorf("EDS response contains a drop policy with unsupported denominator: %v", percentage.GetDenominator()) } return OverloadDropConfig{ Category: dropPolicy.GetCategory(), Numerator: numerator, Denominator: denominator, - } + }, nil } func parseEndpoints(lbEndpoints []*v3endpointpb.LbEndpoint, uniqueEndpointAddrs map[string]bool) ([]Endpoint, error) { @@ -179,7 +181,11 @@ func hashKeyFromMetadata(metadata map[string]any) string { func parseEDSRespProto(m *v3endpointpb.ClusterLoadAssignment) (EndpointsUpdate, error) { ret := EndpointsUpdate{} for _, dropPolicy := range m.GetPolicy().GetDropOverloads() { - ret.Drops = append(ret.Drops, parseDropPolicy(dropPolicy)) + drop, err := parseDropPolicy(dropPolicy) + if err != nil { + return EndpointsUpdate{}, err + } + ret.Drops = append(ret.Drops, drop) } priorities := make(map[uint32]map[string]bool) sumOfWeights := make(map[uint32]uint64) diff --git a/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_lds.go b/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_lds.go index e4c8bfd5c77..9994d7a6a6d 100644 --- a/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_lds.go +++ b/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_lds.go @@ -31,14 +31,14 @@ import ( v3httppb "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3" v3tlspb "github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/tls/v3" "google.golang.org/grpc/internal/envconfig" - "google.golang.org/grpc/internal/xds/clients/xdsclient" + "google.golang.org/grpc/internal/xds/bootstrap" "google.golang.org/grpc/internal/xds/httpfilter" "google.golang.org/grpc/internal/xds/xdsclient/xdsresource/version" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/anypb" ) -func unmarshalListenerResource(r *anypb.Any, opts *xdsclient.DecodeOptions) (string, ListenerUpdate, error) { +func unmarshalListenerResource(r *anypb.Any, bc *bootstrap.Config, sc *bootstrap.ServerConfig) (string, ListenerUpdate, error) { r, err := UnwrapResource(r) if err != nil { return "", ListenerUpdate{}, fmt.Errorf("failed to unwrap resource: %v", err) @@ -56,7 +56,7 @@ func unmarshalListenerResource(r *anypb.Any, opts *xdsclient.DecodeOptions) (str return "", ListenerUpdate{}, fmt.Errorf("empty resource name in listener resource") } - lu, err := processListener(lis, opts) + lu, err := processListener(lis, bc, sc) if err != nil { return lis.GetName(), ListenerUpdate{}, err } @@ -65,16 +65,16 @@ func unmarshalListenerResource(r *anypb.Any, opts *xdsclient.DecodeOptions) (str return lis.GetName(), *lu, nil } -func processListener(lis *v3listenerpb.Listener, opts *xdsclient.DecodeOptions) (*ListenerUpdate, error) { +func processListener(lis *v3listenerpb.Listener, bc *bootstrap.Config, sc *bootstrap.ServerConfig) (*ListenerUpdate, error) { if lis.GetApiListener() != nil { - return processClientSideListener(lis, opts) + return processClientSideListener(lis, bc, sc) } - return processServerSideListener(lis) + return processServerSideListener(lis, bc, sc) } // processClientSideListener checks if the provided Listener proto meets // the expected criteria. If so, it returns a non-empty routeConfigName. -func processClientSideListener(lis *v3listenerpb.Listener, opts *xdsclient.DecodeOptions) (*ListenerUpdate, error) { +func processClientSideListener(lis *v3listenerpb.Listener, bc *bootstrap.Config, sc *bootstrap.ServerConfig) (*ListenerUpdate, error) { apiLisAny := lis.GetApiListener().GetApiListener() if !IsHTTPConnManagerResource(apiLisAny.GetTypeUrl()) { return nil, fmt.Errorf("unexpected http connection manager resource type: %q", apiLisAny.GetTypeUrl()) @@ -105,7 +105,7 @@ func processClientSideListener(lis *v3listenerpb.Listener, opts *xdsclient.Decod } hcm.RouteConfigName = name case *v3httppb.HttpConnectionManager_RouteConfig: - routeU, err := generateRDSUpdateFromRouteConfiguration(apiLis.GetRouteConfig(), opts) + routeU, err := generateRDSUpdateFromRouteConfiguration(apiLis.GetRouteConfig(), bc, sc) if err != nil { return nil, fmt.Errorf("failed to parse inline RDS resp: %v", err) } @@ -121,7 +121,7 @@ func processClientSideListener(lis *v3listenerpb.Listener, opts *xdsclient.Decod hcm.MaxStreamDuration = apiLis.GetCommonHttpProtocolOptions().GetMaxStreamDuration().AsDuration() var err error - if hcm.HTTPFilters, err = processHTTPFilters(apiLis.GetHttpFilters(), false); err != nil { + if hcm.HTTPFilters, err = processHTTPFilters(apiLis.GetHttpFilters(), false, bc, sc); err != nil { return nil, err } @@ -149,7 +149,7 @@ func unwrapHTTPFilterConfig(config *anypb.Any) (proto.Message, string, error) { } } -func validateHTTPFilterConfig(cfg *anypb.Any, lds, optional bool) (httpfilter.Builder, httpfilter.FilterConfig, error) { +func validateHTTPFilterConfig(cfg *anypb.Any, lds, optional bool, bc *bootstrap.Config, sc *bootstrap.ServerConfig) (httpfilter.Builder, httpfilter.FilterConfig, error) { config, typeURL, err := unwrapHTTPFilterConfig(cfg) if err != nil { return nil, nil, err @@ -165,14 +165,14 @@ func validateHTTPFilterConfig(cfg *anypb.Any, lds, optional bool) (httpfilter.Bu if !lds { parseFunc = filterBuilder.ParseFilterConfigOverride } - filterConfig, err := parseFunc(config) + filterConfig, err := parseFunc(config, httpfilter.ParseOptions{BootstrapConfig: bc, ServerConfig: sc}) if err != nil { return nil, nil, fmt.Errorf("error parsing config for filter %q: %v", typeURL, err) } return filterBuilder, filterConfig, nil } -func processHTTPFilterOverrides(cfgs map[string]*anypb.Any) (map[string]httpfilter.FilterConfig, error) { +func processHTTPFilterOverrides(cfgs map[string]*anypb.Any, bc *bootstrap.Config, sc *bootstrap.ServerConfig) (map[string]httpfilter.FilterConfig, error) { if len(cfgs) == 0 { return nil, nil } @@ -187,7 +187,7 @@ func processHTTPFilterOverrides(cfgs map[string]*anypb.Any) (map[string]httpfilt } cfg = s.GetConfig() optional = s.GetIsOptional() - if envconfig.XDSClientExtProcEnabled { + if envconfig.XDSClientExtProcEnabled || envconfig.XDSClientExtAuthzEnabled { disabled = s.GetDisabled() } } @@ -197,7 +197,7 @@ func processHTTPFilterOverrides(cfgs map[string]*anypb.Any) (map[string]httpfilt continue } - httpFilter, config, err := validateHTTPFilterConfig(cfg, false, optional) + httpFilter, config, err := validateHTTPFilterConfig(cfg, false, optional, bc, sc) if err != nil { return nil, fmt.Errorf("filter override %q: %v", name, err) } @@ -210,7 +210,7 @@ func processHTTPFilterOverrides(cfgs map[string]*anypb.Any) (map[string]httpfilt return m, nil } -func processHTTPFilters(filters []*v3httppb.HttpFilter, server bool) ([]HTTPFilter, error) { +func processHTTPFilters(filters []*v3httppb.HttpFilter, server bool, bc *bootstrap.Config, sc *bootstrap.ServerConfig) ([]HTTPFilter, error) { ret := make([]HTTPFilter, 0, len(filters)) seenNames := make(map[string]bool, len(filters)) for _, filter := range filters { @@ -223,7 +223,7 @@ func processHTTPFilters(filters []*v3httppb.HttpFilter, server bool) ([]HTTPFilt } seenNames[name] = true - httpFilter, config, err := validateHTTPFilterConfig(filter.GetTypedConfig(), true, filter.GetIsOptional()) + httpFilter, config, err := validateHTTPFilterConfig(filter.GetTypedConfig(), true, filter.GetIsOptional(), bc, sc) if err != nil { return nil, err } @@ -246,7 +246,7 @@ func processHTTPFilters(filters []*v3httppb.HttpFilter, server bool) ([]HTTPFilt } disabled := false - if envconfig.XDSClientExtProcEnabled { + if envconfig.XDSClientExtProcEnabled || envconfig.XDSClientExtAuthzEnabled { disabled = filter.GetDisabled() } // Save name/config @@ -269,7 +269,7 @@ func processHTTPFilters(filters []*v3httppb.HttpFilter, server bool) ([]HTTPFilt return ret, nil } -func processServerSideListener(lis *v3listenerpb.Listener) (*ListenerUpdate, error) { +func processServerSideListener(lis *v3listenerpb.Listener, bc *bootstrap.Config, sc *bootstrap.ServerConfig) (*ListenerUpdate, error) { if n := len(lis.ListenerFilters); n != 0 { return nil, fmt.Errorf("unsupported field 'listener_filters' contains %d entries", n) } @@ -293,7 +293,7 @@ func processServerSideListener(lis *v3listenerpb.Listener) (*ListenerUpdate, err // Populate the default filter chain. if dfc := lis.GetDefaultFilterChain(); dfc != nil { - fc, err := filterChainFromProto(dfc) + fc, err := filterChainFromProto(dfc, bc, sc) if err != nil { return nil, fmt.Errorf("failed to unmarshal default filter chain: %v", err) } @@ -301,7 +301,7 @@ func processServerSideListener(lis *v3listenerpb.Listener) (*ListenerUpdate, err } // Populated the filter chain map. - fcm, err := buildFilterChainMap(lis.GetFilterChains()) + fcm, err := buildFilterChainMap(lis.GetFilterChains(), bc, sc) if err != nil { return nil, fmt.Errorf("failed to unmarshal filter chains: %v", err) } @@ -316,10 +316,10 @@ func processServerSideListener(lis *v3listenerpb.Listener) (*ListenerUpdate, err return lu, nil } -func filterChainFromProto(fc *v3listenerpb.FilterChain) (NetworkFilterChainConfig, error) { +func filterChainFromProto(fc *v3listenerpb.FilterChain, bc *bootstrap.Config, sc *bootstrap.ServerConfig) (NetworkFilterChainConfig, error) { var emptyFilterChain NetworkFilterChainConfig - hcmConfig, err := processNetworkFilters(fc.GetFilters()) + hcmConfig, err := processNetworkFilters(fc.GetFilters(), bc, sc) if err != nil { return emptyFilterChain, err } @@ -353,16 +353,16 @@ func filterChainFromProto(fc *v3listenerpb.FilterChain) (NetworkFilterChainConfi if downstreamCtx.GetCommonTlsContext() == nil { return emptyFilterChain, errors.New("DownstreamTlsContext in LDS response does not contain a CommonTlsContext") } - sc, err := securityConfigFromCommonTLSContext(downstreamCtx.GetCommonTlsContext(), true) + secCfg, err := securityConfigFromCommonTLSContext(downstreamCtx.GetCommonTlsContext(), true) if err != nil { return emptyFilterChain, err } - if sc != nil { - sc.RequireClientCert = downstreamCtx.GetRequireClientCertificate().GetValue() - if sc.RequireClientCert && sc.RootInstanceName == "" { + if secCfg != nil { + secCfg.RequireClientCert = downstreamCtx.GetRequireClientCertificate().GetValue() + if secCfg.RequireClientCert && secCfg.RootInstanceName == "" { return emptyFilterChain, errors.New("security configuration on the server-side does not contain root certificate provider instance name, but require_client_cert field is set") } - fcc.SecurityCfg = sc + fcc.SecurityCfg = secCfg } return fcc, nil } @@ -373,7 +373,7 @@ type dstPrefixEntry struct { rawBufferSeen bool } -func buildFilterChainMap(fcs []*v3listenerpb.FilterChain) (NetworkFilterChainMap, error) { +func buildFilterChainMap(fcs []*v3listenerpb.FilterChain, bc *bootstrap.Config, sc *bootstrap.ServerConfig) (NetworkFilterChainMap, error) { dstPrefixEntries := []*dstPrefixEntry{} for _, fc := range fcs { fcMatch := fc.GetFilterChainMatch() @@ -385,7 +385,7 @@ func buildFilterChainMap(fcs []*v3listenerpb.FilterChain) (NetworkFilterChainMap } var err error - dstPrefixEntries, err = addFilterChainsForDestPrefixes(dstPrefixEntries, fc) + dstPrefixEntries, err = addFilterChainsForDestPrefixes(dstPrefixEntries, fc, bc, sc) if err != nil { return NetworkFilterChainMap{}, err } @@ -413,7 +413,7 @@ func buildFilterChainMap(fcs []*v3listenerpb.FilterChain) (NetworkFilterChainMap return NetworkFilterChainMap{DstPrefixes: entries}, nil } -func addFilterChainsForDestPrefixes(dstPrefixEntries []*dstPrefixEntry, fc *v3listenerpb.FilterChain) ([]*dstPrefixEntry, error) { +func addFilterChainsForDestPrefixes(dstPrefixEntries []*dstPrefixEntry, fc *v3listenerpb.FilterChain, bc *bootstrap.Config, sc *bootstrap.ServerConfig) ([]*dstPrefixEntry, error) { ranges := fc.GetFilterChainMatch().GetPrefixRanges() dstPrefixes, err := parsePrefixRanges(ranges) if err != nil { @@ -425,14 +425,14 @@ func addFilterChainsForDestPrefixes(dstPrefixEntries []*dstPrefixEntry, fc *v3li // Use the unspecified entry when destination prefix is unspecified, and // set the `prefix` field to nil. dstPrefixEntries, entry = getOrCreateDestPrefixEntry(dstPrefixEntries, netip.Prefix{}) - if err := addFilterChainsForServerNames(entry, fc); err != nil { + if err := addFilterChainsForServerNames(entry, fc, bc, sc); err != nil { return nil, err } return dstPrefixEntries, nil } for _, prefix := range dstPrefixes { dstPrefixEntries, entry = getOrCreateDestPrefixEntry(dstPrefixEntries, prefix) - if err := addFilterChainsForServerNames(entry, fc); err != nil { + if err := addFilterChainsForServerNames(entry, fc, bc, sc); err != nil { return nil, err } } @@ -454,7 +454,7 @@ func getOrCreateDestPrefixEntry(dstPrefixEntries []*dstPrefixEntry, prefix netip return dstPrefixEntries, entry } -func addFilterChainsForServerNames(dstEntry *dstPrefixEntry, fc *v3listenerpb.FilterChain) error { +func addFilterChainsForServerNames(dstEntry *dstPrefixEntry, fc *v3listenerpb.FilterChain, bc *bootstrap.Config, sc *bootstrap.ServerConfig) error { // Filter chains specifying server names in their match criteria always fail // a match at connection time. So, these filter chains can be dropped now. if len(fc.GetFilterChainMatch().GetServerNames()) != 0 { @@ -462,10 +462,10 @@ func addFilterChainsForServerNames(dstEntry *dstPrefixEntry, fc *v3listenerpb.Fi return nil } - return addFilterChainsForTransportProtocols(dstEntry, fc) + return addFilterChainsForTransportProtocols(dstEntry, fc, bc, sc) } -func addFilterChainsForTransportProtocols(dstEntry *dstPrefixEntry, fc *v3listenerpb.FilterChain) error { +func addFilterChainsForTransportProtocols(dstEntry *dstPrefixEntry, fc *v3listenerpb.FilterChain, bc *bootstrap.Config, sc *bootstrap.ServerConfig) error { tp := fc.GetFilterChainMatch().GetTransportProtocol() switch { case tp != "" && tp != "raw_buffer": @@ -486,15 +486,15 @@ func addFilterChainsForTransportProtocols(dstEntry *dstPrefixEntry, fc *v3listen dstEntry.rawBufferSeen = true dstEntry.entry.SourceTypeArr = [3]SourcePrefixes{} } - return addFilterChainsForApplicationProtocols(dstEntry, fc) + return addFilterChainsForApplicationProtocols(dstEntry, fc, bc, sc) } -func addFilterChainsForApplicationProtocols(dstEntry *dstPrefixEntry, fc *v3listenerpb.FilterChain) error { +func addFilterChainsForApplicationProtocols(dstEntry *dstPrefixEntry, fc *v3listenerpb.FilterChain, bc *bootstrap.Config, sc *bootstrap.ServerConfig) error { if len(fc.GetFilterChainMatch().GetApplicationProtocols()) != 0 { logger.Warningf("Dropping filter chain %q since it contains unsupported application_protocols match field", fc.GetName()) return nil } - return addFilterChainsForSourceType(&dstEntry.entry, fc) + return addFilterChainsForSourceType(&dstEntry.entry, fc, bc, sc) } // sourceType specifies the connection source IP match type. @@ -509,7 +509,7 @@ const ( sourceTypeExternal ) -func addFilterChainsForSourceType(entry *DestinationPrefixEntry, fc *v3listenerpb.FilterChain) error { +func addFilterChainsForSourceType(entry *DestinationPrefixEntry, fc *v3listenerpb.FilterChain, bc *bootstrap.Config, sc *bootstrap.ServerConfig) error { var srcType sourceType switch st := fc.GetFilterChainMatch().GetSourceType(); st { case v3listenerpb.FilterChainMatch_ANY: @@ -522,10 +522,10 @@ func addFilterChainsForSourceType(entry *DestinationPrefixEntry, fc *v3listenerp return fmt.Errorf("unsupported source type: %v", st) } - return addFilterChainsForSourcePrefixes(&entry.SourceTypeArr[srcType], fc) + return addFilterChainsForSourcePrefixes(&entry.SourceTypeArr[srcType], fc, bc, sc) } -func addFilterChainsForSourcePrefixes(srcPrefixes *SourcePrefixes, fc *v3listenerpb.FilterChain) error { +func addFilterChainsForSourcePrefixes(srcPrefixes *SourcePrefixes, fc *v3listenerpb.FilterChain, bc *bootstrap.Config, sc *bootstrap.ServerConfig) error { ranges := fc.GetFilterChainMatch().GetSourcePrefixRanges() prefixes, err := parsePrefixRanges(ranges) if err != nil { @@ -533,10 +533,10 @@ func addFilterChainsForSourcePrefixes(srcPrefixes *SourcePrefixes, fc *v3listene } if len(prefixes) == 0 { - return getOrCreateSourcePrefixEntry(srcPrefixes, netip.Prefix{}, fc) + return getOrCreateSourcePrefixEntry(srcPrefixes, netip.Prefix{}, fc, bc, sc) } for _, prefix := range prefixes { - if err := getOrCreateSourcePrefixEntry(srcPrefixes, prefix, fc); err != nil { + if err := getOrCreateSourcePrefixEntry(srcPrefixes, prefix, fc, bc, sc); err != nil { return err } } @@ -571,10 +571,10 @@ func parsePrefixRanges(ranges []*v3corepb.CidrRange) ([]netip.Prefix, error) { // SourcePrefixes, the provided filter chain is added to the new entry, and nil // is returned. If there are multiple filter chains with overlapping matching // rules, an error is returned. -func getOrCreateSourcePrefixEntry(srcPrefixes *SourcePrefixes, prefix netip.Prefix, fc *v3listenerpb.FilterChain) error { +func getOrCreateSourcePrefixEntry(srcPrefixes *SourcePrefixes, prefix netip.Prefix, fc *v3listenerpb.FilterChain, bc *bootstrap.Config, sc *bootstrap.ServerConfig) error { for i := range srcPrefixes.Entries { if srcPrefixes.Entries[i].Prefix == prefix { - return addFilterChainsForSourcePorts(&srcPrefixes.Entries[i], fc) + return addFilterChainsForSourcePorts(&srcPrefixes.Entries[i], fc, bc, sc) } } @@ -583,10 +583,10 @@ func getOrCreateSourcePrefixEntry(srcPrefixes *SourcePrefixes, prefix netip.Pref Prefix: prefix, PortMap: make(map[int]NetworkFilterChainConfig), }) - return addFilterChainsForSourcePorts(&srcPrefixes.Entries[len(srcPrefixes.Entries)-1], fc) + return addFilterChainsForSourcePorts(&srcPrefixes.Entries[len(srcPrefixes.Entries)-1], fc, bc, sc) } -func addFilterChainsForSourcePorts(entry *SourcePrefixEntry, fc *v3listenerpb.FilterChain) error { +func addFilterChainsForSourcePorts(entry *SourcePrefixEntry, fc *v3listenerpb.FilterChain, bc *bootstrap.Config, sc *bootstrap.ServerConfig) error { ports := fc.GetFilterChainMatch().GetSourcePorts() srcPorts := make([]int, 0, len(ports)) for _, port := range ports { @@ -597,7 +597,7 @@ func addFilterChainsForSourcePorts(entry *SourcePrefixEntry, fc *v3listenerpb.Fi if !entry.PortMap[0].IsEmpty() { return errors.New("multiple filter chains with overlapping matching rules are defined") } - fcc, err := filterChainFromProto(fc) + fcc, err := filterChainFromProto(fc, bc, sc) if err != nil { return err } @@ -608,7 +608,7 @@ func addFilterChainsForSourcePorts(entry *SourcePrefixEntry, fc *v3listenerpb.Fi if !entry.PortMap[port].IsEmpty() { return errors.New("multiple filter chains with overlapping matching rules are defined") } - fcc, err := filterChainFromProto(fc) + fcc, err := filterChainFromProto(fc, bc, sc) if err != nil { return err } diff --git a/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_rds.go b/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_rds.go index a053db22350..865cc24ed4f 100644 --- a/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_rds.go +++ b/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_rds.go @@ -26,7 +26,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/internal/envconfig" - "google.golang.org/grpc/internal/xds/clients/xdsclient" + "google.golang.org/grpc/internal/xds/bootstrap" "google.golang.org/grpc/internal/xds/clusterspecifier" "google.golang.org/grpc/internal/xds/matcher" "google.golang.org/protobuf/proto" @@ -37,7 +37,7 @@ import ( v3typepb "github.com/envoyproxy/go-control-plane/envoy/type/v3" ) -func unmarshalRouteConfigResource(r *anypb.Any, opts *xdsclient.DecodeOptions) (string, RouteConfigUpdate, error) { +func unmarshalRouteConfigResource(r *anypb.Any, bc *bootstrap.Config, sc *bootstrap.ServerConfig) (string, RouteConfigUpdate, error) { r, err := UnwrapResource(r) if err != nil { return "", RouteConfigUpdate{}, fmt.Errorf("failed to unwrap resource: %v", err) @@ -55,7 +55,7 @@ func unmarshalRouteConfigResource(r *anypb.Any, opts *xdsclient.DecodeOptions) ( return "", RouteConfigUpdate{}, fmt.Errorf("empty resource name in route config resource") } - u, err := generateRDSUpdateFromRouteConfiguration(rc, opts) + u, err := generateRDSUpdateFromRouteConfiguration(rc, bc, sc) if err != nil { return rc.GetName(), RouteConfigUpdate{}, err } @@ -80,7 +80,7 @@ func unmarshalRouteConfigResource(r *anypb.Any, opts *xdsclient.DecodeOptions) ( // field must be empty and whose route field must be set. Inside that route // message, the cluster field will contain the clusterName or weighted clusters // we are looking for. -func generateRDSUpdateFromRouteConfiguration(rc *v3routepb.RouteConfiguration, opts *xdsclient.DecodeOptions) (RouteConfigUpdate, error) { +func generateRDSUpdateFromRouteConfiguration(rc *v3routepb.RouteConfiguration, bc *bootstrap.Config, sc *bootstrap.ServerConfig) (RouteConfigUpdate, error) { vhs := make([]*VirtualHost, 0, len(rc.GetVirtualHosts())) csps, err := processClusterSpecifierPlugins(rc.ClusterSpecifierPlugins) if err != nil { @@ -91,7 +91,7 @@ func generateRDSUpdateFromRouteConfiguration(rc *v3routepb.RouteConfiguration, o // ignored and not emitted by the xdsclient. var cspNames = make(map[string]bool) for _, vh := range rc.GetVirtualHosts() { - routes, cspNs, err := routesProtoToSlice(vh.Routes, csps, opts) + routes, cspNs, err := routesProtoToSlice(vh.Routes, csps, bc, sc) if err != nil { return RouteConfigUpdate{}, fmt.Errorf("received route is invalid: %v", err) } @@ -107,7 +107,7 @@ func generateRDSUpdateFromRouteConfiguration(rc *v3routepb.RouteConfiguration, o Routes: routes, RetryConfig: rc, } - cfgs, err := processHTTPFilterOverrides(vh.GetTypedPerFilterConfig()) + cfgs, err := processHTTPFilterOverrides(vh.GetTypedPerFilterConfig(), bc, sc) if err != nil { return RouteConfigUpdate{}, fmt.Errorf("virtual host %+v: %v", vh, err) } @@ -214,7 +214,7 @@ func generateRetryConfig(rp *v3routepb.RetryPolicy) (*RetryConfig, error) { return cfg, nil } -func routesProtoToSlice(routes []*v3routepb.Route, csps map[string]clusterspecifier.BalancerConfig, opts *xdsclient.DecodeOptions) ([]*Route, map[string]bool, error) { +func routesProtoToSlice(routes []*v3routepb.Route, csps map[string]clusterspecifier.BalancerConfig, bc *bootstrap.Config, sc *bootstrap.ServerConfig) ([]*Route, map[string]bool, error) { var routesRet []*Route var cspNames = make(map[string]bool) for _, r := range routes { @@ -323,7 +323,7 @@ func routesProtoToSlice(routes []*v3routepb.Route, csps map[string]clusterspecif action := r.GetRoute() if envconfig.XDSAuthorityRewrite { - if opts != nil && opts.ServerConfig != nil && opts.ServerConfig.SupportsServerFeature(xdsclient.ServerFeatureTrustedXDSServer) { + if sc != nil && sc.ServerFeaturesTrustedXDSServer() { route.AutoHostRewrite = action.GetAutoHostRewrite().GetValue() } } @@ -351,7 +351,7 @@ func routesProtoToSlice(routes []*v3routepb.Route, csps map[string]clusterspecif return nil, nil, fmt.Errorf("xds: total weight of clusters exceeds MaxUint32") } wc := WeightedCluster{Name: c.GetName(), Weight: w} - cfgs, err := processHTTPFilterOverrides(c.GetTypedPerFilterConfig()) + cfgs, err := processHTTPFilterOverrides(c.GetTypedPerFilterConfig(), bc, sc) if err != nil { return nil, nil, fmt.Errorf("route %+v, action %+v: %v", r, a, err) } @@ -417,7 +417,7 @@ func routesProtoToSlice(routes []*v3routepb.Route, csps map[string]clusterspecif route.ActionType = RouteActionUnsupported } - cfgs, err := processHTTPFilterOverrides(r.GetTypedPerFilterConfig()) + cfgs, err := processHTTPFilterOverrides(r.GetTypedPerFilterConfig(), bc, sc) if err != nil { return nil, nil, fmt.Errorf("route %+v: %v", r, err) } diff --git a/vendor/google.golang.org/grpc/metadata/metadata.go b/vendor/google.golang.org/grpc/metadata/metadata.go index d2e15253bbf..2b79204b482 100644 --- a/vendor/google.golang.org/grpc/metadata/metadata.go +++ b/vendor/google.golang.org/grpc/metadata/metadata.go @@ -24,6 +24,7 @@ package metadata // import "google.golang.org/grpc/metadata" import ( "context" "fmt" + "sort" "strings" "google.golang.org/grpc/internal" @@ -90,6 +91,76 @@ func Pairs(kv ...string) MD { return md } +// loggableMetadataKeys is the set of metadata keys whose values are known not +// to carry credentials or other sensitive data, and are therefore safe to print +// verbatim in String. Values for any key not in this set are redacted. Keys are +// in metadata's canonical lowercase form. +// +// The list is intentionally restricted to standardized gRPC and HTTP/2 protocol +// headers. Everything else, including all application-defined keys, is +// censored. +// Note that this list might change as we add/remove support for +// metadata types. +var loggableMetadataKeys = map[string]bool{ + "content-type": true, + "te": true, + "user-agent": true, + "grpc-encoding": true, + "grpc-accept-encoding": true, + "grpc-timeout": true, + "grpc-status": true, + "grpc-message-type": true, + "grpc-previous-rpc-attempts": true, + "grpc-retry-pushback-ms": true, +} + +// String implements fmt.Stringer to allow metadata to be printed when stored in +// a context. +// +// To avoid accidentally leaking credentials or other sensitive data (for +// example via log(md), or by logging a value that happens to contain metadata), +// String reports only keys on an allowlist of standardized, non-sensitive +// protocol headers (see loggableMetadataKeys). Every other key is omitted +// entirely, along with its values, because a key name may itself be sensitive; +// only the number of omitted keys is reported, as "". This is a +// best-effort guard against accidents, not a security boundary: a caller that +// genuinely wants the full contents can still print map[string][]string(md) +// directly. +// +// Note that this only affects verbs that use the Stringer, such as %v and %s. +// The %#v verb prints the underlying map with all values and is not redacted. +// Users should not rely on the output of this method to be stable +// # Experimental +// +// Notice: This API is EXPERIMENTAL and may be changed or removed in a later +// release. +func (md MD) String() string { + keys := make([]string, 0, len(md)) + for k := range md { + if loggableMetadataKeys[strings.ToLower(k)] { + keys = append(keys, k) + } + } + sort.Strings(keys) + + var sb strings.Builder + sb.WriteString("map[") + for i, k := range keys { + if i > 0 { + sb.WriteByte(' ') + } + fmt.Fprintf(&sb, "%s:%v", k, md[k]) + } + if redacted := len(md) - len(keys); redacted > 0 { + if len(keys) > 0 { + sb.WriteByte(' ') + } + fmt.Fprintf(&sb, "<%d redacted>", redacted) + } + sb.WriteByte(']') + return sb.String() +} + // Len returns the number of items in md. func (md MD) Len() int { return len(md) diff --git a/vendor/google.golang.org/grpc/resolver_wrapper.go b/vendor/google.golang.org/grpc/resolver_wrapper.go index 6e613764372..f8b0fd38fd5 100644 --- a/vendor/google.golang.org/grpc/resolver_wrapper.go +++ b/vendor/google.golang.org/grpc/resolver_wrapper.go @@ -188,7 +188,7 @@ func (ccr *ccResolverWrapper) ParseServiceConfig(scJSON string) *serviceconfig.P // addChannelzTraceEvent adds a channelz trace event containing the new // state received from resolver implementations. func (ccr *ccResolverWrapper) addChannelzTraceEvent(s resolver.State) { - if !logger.V(0) && !channelz.IsOn() { + if !logger.V(2) && !channelz.IsOn() { return } var updates []string diff --git a/vendor/google.golang.org/grpc/server.go b/vendor/google.golang.org/grpc/server.go index cf0a2067190..4ab54115b4b 100644 --- a/vendor/google.golang.org/grpc/server.go +++ b/vendor/google.golang.org/grpc/server.go @@ -89,6 +89,7 @@ func init() { internal.MetricsRecorderForServer = func(srv *Server) estats.MetricsRecorder { return istats.NewMetricsRecorderList(srv.opts.statsHandlers) } + internal.XDSFilterWrapperOption = xdsFilterWrapperOption } var statusOK = status.New(codes.OK, "") @@ -117,10 +118,8 @@ type ServiceDesc struct { // serviceInfo wraps information about a service. It is very similar to // ServiceDesc and is constructed from it for internal purposes. type serviceInfo struct { - // Contains the implementation for the methods in this service. - serviceImpl any - methods map[string]*MethodDesc - streams map[string]*StreamDesc + serviceImpl any // Implementation for the methods in this service. + streams map[string]*StreamDesc // Streaming descriptors and wrapped unary descriptors for this service. mdata any } @@ -183,6 +182,7 @@ type serverOptions struct { bufferPool mem.BufferPool waitForHandlers bool staticWindowSize bool + streamWrapper func(ServerStream) (ServerStream, error) } var defaultServerOptions = serverOptions{ @@ -663,6 +663,14 @@ func bufferPool(bufferPool mem.BufferPool) ServerOption { }) } +// xdsFilterWrapperOption returns a ServerOption that sets the server-level +// stream wrapper (used internally by xDS server filters). +func xdsFilterWrapperOption(w func(ServerStream) (ServerStream, error)) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + o.streamWrapper = w + }) +} + // serverWorkerResetThreshold defines how often the stack must be reset. Every // N requests, by spawning a new goroutine in its place, a worker can reset its // stack so that large stacks don't live in memory forever. 2^16 should allow @@ -790,18 +798,22 @@ func (s *Server) register(sd *ServiceDesc, ss any) { } info := &serviceInfo{ serviceImpl: ss, - methods: make(map[string]*MethodDesc), streams: make(map[string]*StreamDesc), mdata: sd.Metadata, } - for i := range sd.Methods { - d := &sd.Methods[i] - info.methods[d.MethodName] = d - } for i := range sd.Streams { d := &sd.Streams[i] info.streams[d.StreamName] = d } + for i := range sd.Methods { + d := &sd.Methods[i] + info.streams[d.MethodName] = &StreamDesc{ + StreamName: d.MethodName, + Handler: s.wrapUnaryHandler(d), + ServerStreams: false, + ClientStreams: false, + } + } s.services[sd.ServiceName] = info } @@ -827,20 +839,26 @@ type ServiceInfo struct { func (s *Server) GetServiceInfo() map[string]ServiceInfo { ret := make(map[string]ServiceInfo) for n, srv := range s.services { - methods := make([]MethodInfo, 0, len(srv.methods)+len(srv.streams)) - for m := range srv.methods { - methods = append(methods, MethodInfo{ - Name: m, - IsClientStream: false, - IsServerStream: false, - }) + methods := make([]MethodInfo, 0, len(srv.streams)) + // Iterate over unary methods first to maintain backward compatibility of order. + for m, d := range srv.streams { + if !d.ClientStreams && !d.ServerStreams { + methods = append(methods, MethodInfo{ + Name: m, + IsClientStream: false, + IsServerStream: false, + }) + } } + // Iterate over streaming methods. for m, d := range srv.streams { - methods = append(methods, MethodInfo{ - Name: m, - IsClientStream: d.ClientStreams, - IsServerStream: d.ServerStreams, - }) + if d.ClientStreams || d.ServerStreams { + methods = append(methods, MethodInfo{ + Name: m, + IsClientStream: d.ClientStreams, + IsServerStream: d.ServerStreams, + }) + } } ret[n] = ServiceInfo{ @@ -1185,42 +1203,6 @@ func (s *Server) incrCallsFailed() { s.channelz.ServerMetrics.CallsFailed.Add(1) } -func (s *Server) sendResponse(ctx context.Context, stream *transport.ServerStream, msg any, cp Compressor, opts *transport.WriteOptions, comp encoding.Compressor) error { - data, err := encode(s.getCodec(stream.ContentSubtype()), msg) - if err != nil { - channelz.Error(logger, s.channelz, "grpc: server failed to encode response: ", err) - return err - } - - compData, pf, err := compress(data, cp, comp, s.opts.bufferPool) - if err != nil { - data.Free() - channelz.Error(logger, s.channelz, "grpc: server failed to compress response: ", err) - return err - } - - hdr, payload := msgHeader(data, compData, pf) - - defer func() { - compData.Free() - data.Free() - // payload does not need to be freed here, it is either data or compData, both of - // which are already freed. - }() - - dataLen := data.Len() - payloadLen := payload.Len() - // TODO(dfawley): should we be checking len(data) instead? - if payloadLen > s.opts.maxSendMessageSize { - return status.Errorf(codes.ResourceExhausted, "grpc: trying to send message larger than max (%d vs. %d)", payloadLen, s.opts.maxSendMessageSize) - } - err = stream.Write(hdr, payload, opts) - if err == nil && s.statsHandler != nil { - s.statsHandler.HandleRPC(ctx, outPayload(false, msg, dataLen, payloadLen, time.Now())) - } - return err -} - // chainUnaryServerInterceptors chains all unary server interceptors into one. func chainUnaryServerInterceptors(s *Server) { // Prepend opts.unaryInt to the chaining interceptors if it exists, since unaryInt will @@ -1257,300 +1239,6 @@ func getChainUnaryHandler(interceptors []UnaryServerInterceptor, curr int, info } } -func (s *Server) processUnaryRPC(ctx context.Context, stream *transport.ServerStream, info *serviceInfo, md *MethodDesc, trInfo *traceInfo) (err error) { - sh := s.statsHandler - if sh != nil || trInfo != nil || channelz.IsOn() { - if channelz.IsOn() { - s.incrCallsStarted() - } - var statsBegin *stats.Begin - if sh != nil { - statsBegin = &stats.Begin{ - BeginTime: time.Now(), - IsClientStream: false, - IsServerStream: false, - } - sh.HandleRPC(ctx, statsBegin) - } - if trInfo != nil { - trInfo.tr.LazyLog(&trInfo.firstLine, false) - } - // The deferred error handling for tracing, stats handler and channelz are - // combined into one function to reduce stack usage -- a defer takes ~56-64 - // bytes on the stack, so overflowing the stack will require a stack - // re-allocation, which is expensive. - // - // To maintain behavior similar to separate deferred statements, statements - // should be executed in the reverse order. That is, tracing first, stats - // handler second, and channelz last. Note that panics *within* defers will - // lead to different behavior, but that's an acceptable compromise; that - // would be undefined behavior territory anyway. - defer func() { - if trInfo != nil { - if err != nil && err != io.EOF { - trInfo.tr.LazyLog(&fmtStringer{"%v", []any{err}}, true) - trInfo.tr.SetError() - } - trInfo.tr.Finish() - } - - if sh != nil { - end := &stats.End{ - BeginTime: statsBegin.BeginTime, - EndTime: time.Now(), - } - if err != nil && err != io.EOF { - end.Error = toRPCErr(err) - } - sh.HandleRPC(ctx, end) - } - - if channelz.IsOn() { - if err != nil && err != io.EOF { - s.incrCallsFailed() - } else { - s.incrCallsSucceeded() - } - } - }() - } - var binlogs []binarylog.MethodLogger - if ml := binarylog.GetMethodLogger(stream.Method()); ml != nil { - binlogs = append(binlogs, ml) - } - if s.opts.binaryLogger != nil { - if ml := s.opts.binaryLogger.GetMethodLogger(stream.Method()); ml != nil { - binlogs = append(binlogs, ml) - } - } - if len(binlogs) != 0 { - md, _ := metadata.FromIncomingContext(ctx) - logEntry := &binarylog.ClientHeader{ - Header: md, - MethodName: stream.Method(), - PeerAddr: nil, - } - if deadline, ok := ctx.Deadline(); ok { - logEntry.Timeout = time.Until(deadline) - if logEntry.Timeout < 0 { - logEntry.Timeout = 0 - } - } - if a := md[":authority"]; len(a) > 0 { - logEntry.Authority = a[0] - } - if peer, ok := peer.FromContext(ctx); ok { - logEntry.PeerAddr = peer.Addr - } - for _, binlog := range binlogs { - binlog.Log(ctx, logEntry) - } - } - - // comp and cp are used for compression. decomp and dc are used for - // decompression. If comp and decomp are both set, they are the same; - // however they are kept separate to ensure that at most one of the - // compressor/decompressor variable pairs are set for use later. - var comp, decomp encoding.Compressor - var cp Compressor - var dc Decompressor - var sendCompressorName string - - // If dc is set and matches the stream's compression, use it. Otherwise, try - // to find a matching registered compressor for decomp. - if rc := stream.RecvCompress(); s.opts.dc != nil && s.opts.dc.Type() == rc { - dc = s.opts.dc - } else if rc != "" && rc != encoding.Identity { - decomp = encoding.GetCompressor(rc) - if decomp == nil { - st := status.Newf(codes.Unimplemented, "grpc: Decompressor is not installed for grpc-encoding %q", rc) - stream.WriteStatus(st) - return st.Err() - } - } - - // If cp is set, use it. Otherwise, attempt to compress the response using - // the incoming message compression method. - // - // NOTE: this needs to be ahead of all handling, https://github.com/grpc/grpc-go/issues/686. - if s.opts.cp != nil { - cp = s.opts.cp - sendCompressorName = cp.Type() - } else if rc := stream.RecvCompress(); rc != "" && rc != encoding.Identity { - // Legacy compressor not specified; attempt to respond with same encoding. - comp = encoding.GetCompressor(rc) - if comp != nil { - sendCompressorName = comp.Name() - } - } - - if sendCompressorName != "" { - if err := stream.SetSendCompress(sendCompressorName); err != nil { - return status.Errorf(codes.Internal, "grpc: failed to set send compressor: %v", err) - } - } - - var payInfo *payloadInfo - if sh != nil || len(binlogs) != 0 { - payInfo = &payloadInfo{} - defer payInfo.free() - } - - d, err := recvAndDecompress(&parser{r: stream, bufferPool: s.opts.bufferPool}, stream, dc, s.opts.maxReceiveMessageSize, payInfo, decomp, true) - if err != nil { - if e := stream.WriteStatus(status.Convert(err)); e != nil { - channelz.Warningf(logger, s.channelz, "grpc: Server.processUnaryRPC failed to write status: %v", e) - } - return err - } - freed := false - dataFree := func() { - if !freed { - d.Free() - freed = true - } - } - defer dataFree() - df := func(v any) error { - defer dataFree() - if err := s.getCodec(stream.ContentSubtype()).Unmarshal(d, v); err != nil { - return status.Errorf(codes.Internal, "grpc: error unmarshalling request: %v", err) - } - - if sh != nil { - sh.HandleRPC(ctx, &stats.InPayload{ - RecvTime: time.Now(), - Payload: v, - Length: d.Len(), - WireLength: payInfo.compressedLength + headerLen, - CompressedLength: payInfo.compressedLength, - }) - } - if len(binlogs) != 0 { - cm := &binarylog.ClientMessage{ - Message: d.Materialize(), - } - for _, binlog := range binlogs { - binlog.Log(ctx, cm) - } - } - if trInfo != nil { - trInfo.tr.LazyLog(&payload{sent: false, msg: v}, true) - } - return nil - } - ctx = NewContextWithServerTransportStream(ctx, stream) - reply, appErr := md.Handler(info.serviceImpl, ctx, df, s.opts.unaryInt) - if appErr != nil { - appStatus, ok := status.FromError(appErr) - if !ok { - // Convert non-status application error to a status error with code - // Unknown, but handle context errors specifically. - appStatus = status.FromContextError(appErr) - appErr = appStatus.Err() - } - if trInfo != nil { - trInfo.tr.LazyLog(stringer(appStatus.Message()), true) - trInfo.tr.SetError() - } - if e := stream.WriteStatus(appStatus); e != nil { - channelz.Warningf(logger, s.channelz, "grpc: Server.processUnaryRPC failed to write status: %v", e) - } - if len(binlogs) != 0 { - if h, _ := stream.Header(); h.Len() > 0 { - // Only log serverHeader if there was header. Otherwise it can - // be trailer only. - sh := &binarylog.ServerHeader{ - Header: h, - } - for _, binlog := range binlogs { - binlog.Log(ctx, sh) - } - } - st := &binarylog.ServerTrailer{ - Trailer: stream.Trailer(), - Err: appErr, - } - for _, binlog := range binlogs { - binlog.Log(ctx, st) - } - } - return appErr - } - if trInfo != nil { - trInfo.tr.LazyLog(stringer("OK"), false) - } - opts := &transport.WriteOptions{Last: true} - - // Server handler could have set new compressor by calling SetSendCompressor. - // In case it is set, we need to use it for compressing outbound message. - if stream.SendCompress() != sendCompressorName { - comp = encoding.GetCompressor(stream.SendCompress()) - } - if err := s.sendResponse(ctx, stream, reply, cp, opts, comp); err != nil { - if err == io.EOF { - // The entire stream is done (for unary RPC only). - return err - } - if sts, ok := status.FromError(err); ok { - if e := stream.WriteStatus(sts); e != nil { - channelz.Warningf(logger, s.channelz, "grpc: Server.processUnaryRPC failed to write status: %v", e) - } - } else { - switch st := err.(type) { - case transport.ConnectionError: - // Nothing to do here. - default: - panic(fmt.Sprintf("grpc: Unexpected error (%T) from sendResponse: %v", st, st)) - } - } - if len(binlogs) != 0 { - h, _ := stream.Header() - sh := &binarylog.ServerHeader{ - Header: h, - } - st := &binarylog.ServerTrailer{ - Trailer: stream.Trailer(), - Err: appErr, - } - for _, binlog := range binlogs { - binlog.Log(ctx, sh) - binlog.Log(ctx, st) - } - } - return err - } - if len(binlogs) != 0 { - h, _ := stream.Header() - sh := &binarylog.ServerHeader{ - Header: h, - } - sm := &binarylog.ServerMessage{ - Message: reply, - } - for _, binlog := range binlogs { - binlog.Log(ctx, sh) - binlog.Log(ctx, sm) - } - } - if trInfo != nil { - trInfo.tr.LazyLog(&payload{sent: true, msg: reply}, true) - } - // TODO: Should we be logging if writing status failed here, like above? - // Should the logging be in WriteStatus? Should we ignore the WriteStatus - // error or allow the stats handler to see it? - if len(binlogs) != 0 { - st := &binarylog.ServerTrailer{ - Trailer: stream.Trailer(), - Err: appErr, - } - for _, binlog := range binlogs { - binlog.Log(ctx, st) - } - } - return stream.WriteStatus(statusOK) -} - // chainStreamServerInterceptors chains all stream server interceptors into one. func chainStreamServerInterceptors(s *Server) { // Prepend opts.streamInt to the chaining interceptors if it exists, since streamInt will @@ -1587,7 +1275,21 @@ func getChainStreamHandler(interceptors []StreamServerInterceptor, curr int, inf } } -func (s *Server) processStreamingRPC(ctx context.Context, stream *transport.ServerStream, info *serviceInfo, sd *StreamDesc, trInfo *traceInfo) (err error) { +// wrapUnaryHandler converts a standard Unary Method Descriptor into a +// StreamHandler, allowing Unary RPCs to be processed via the same unified +// pipeline as Streaming RPCs. +func (s *Server) wrapUnaryHandler(md *MethodDesc) StreamHandler { + return func(srv any, stream ServerStream) error { + df := func(v any) error { return stream.RecvMsg(v) } + reply, err := md.Handler(srv, stream.Context(), df, s.opts.unaryInt) + if err != nil { + return err + } + return stream.SendMsg(reply) + } +} + +func (s *Server) processRPC(ctx context.Context, stream *transport.ServerStream, info *serviceInfo, sd *StreamDesc, trInfo *traceInfo) (err error) { if channelz.IsOn() { s.incrCallsStarted() } @@ -1615,7 +1317,16 @@ func (s *Server) processStreamingRPC(ctx context.Context, stream *transport.Serv } if sh != nil || trInfo != nil || channelz.IsOn() { - // See comment in processUnaryRPC on defers. + // The deferred error handling for tracing, stats handler and channelz are + // combined into one function to reduce stack usage -- a defer takes ~56-64 + // bytes on the stack, so overflowing the stack will require a stack + // re-allocation, which is expensive. + // + // To maintain behavior similar to separate deferred statements, statements + // should be executed in the reverse order. That is, tracing first, stats + // handler second, and channelz last. Note that panics *within* defers will + // lead to different behavior, but that's an acceptable compromise; that + // would be undefined behavior territory anyway. defer func() { if trInfo != nil { ss.mu.Lock() @@ -1689,7 +1400,7 @@ func (s *Server) processStreamingRPC(ctx context.Context, stream *transport.Serv ss.decompressorV1 = encoding.GetCompressor(rc) if ss.decompressorV1 == nil { st := status.Newf(codes.Unimplemented, "grpc: Decompressor is not installed for grpc-encoding %q", rc) - ss.s.WriteStatus(st) + ss.writeStatus(st) return st.Err() } } @@ -1717,23 +1428,34 @@ func (s *Server) processStreamingRPC(ctx context.Context, stream *transport.Serv ss.ctx = newContextWithRPCInfo(ss.ctx, false, ss.codec, ss.compressorV0, ss.compressorV1) - if trInfo != nil { - trInfo.tr.LazyLog(&trInfo.firstLine, false) - } + // Execute the xDS HTTP filter interceptors. var appErr error - var server any - if info != nil { - server = info.serviceImpl + var wrappedStream ServerStream = ss + if s.opts.streamWrapper != nil { + wrappedStream, appErr = s.opts.streamWrapper(ss) } - if s.opts.streamInt == nil { - appErr = sd.Handler(server, ss) - } else { - info := &StreamServerInfo{ - FullMethod: stream.Method(), - IsClientStream: sd.ClientStreams, - IsServerStream: sd.ServerStreams, + + if appErr == nil { + if trInfo != nil { + trInfo.tr.LazyLog(&trInfo.firstLine, false) + } + var server any + if info != nil { + server = info.serviceImpl + } + if s.opts.streamInt == nil || (!sd.ClientStreams && !sd.ServerStreams) { + // If there is no stream interceptor, or if this is a unary RPC, call + // the handler directly. The wrapped unary handler will call the unary + // interceptor if it exists. + appErr = sd.Handler(server, wrappedStream) + } else { + info := &StreamServerInfo{ + FullMethod: stream.Method(), + IsClientStream: sd.ClientStreams, + IsServerStream: sd.ServerStreams, + } + appErr = s.opts.streamInt(server, wrappedStream, info, sd.Handler) } - appErr = s.opts.streamInt(server, ss, info, sd.Handler) } if appErr != nil { appStatus, ok := status.FromError(appErr) @@ -1750,6 +1472,17 @@ func (s *Server) processStreamingRPC(ctx context.Context, stream *transport.Serv ss.mu.Unlock() } if len(ss.binlogs) != 0 { + if !ss.serverHeaderBinlogged { + if h, _ := ss.s.Header(); h.Len() > 0 { + sh := &binarylog.ServerHeader{ + Header: h, + } + ss.serverHeaderBinlogged = true + for _, binlog := range ss.binlogs { + binlog.Log(ctx, sh) + } + } + } st := &binarylog.ServerTrailer{ Trailer: ss.s.Trailer(), Err: appErr, @@ -1758,8 +1491,9 @@ func (s *Server) processStreamingRPC(ctx context.Context, stream *transport.Serv binlog.Log(ctx, st) } } - ss.s.WriteStatus(appStatus) - // TODO: Should we log an error from WriteStatus here and below? + if err := ss.writeStatus(appStatus); err != nil { + channelz.Warningf(logger, s.channelz, "grpc: Server.processRPC failed to write status: %v", err) + } return appErr } if trInfo != nil { @@ -1776,7 +1510,10 @@ func (s *Server) processStreamingRPC(ctx context.Context, stream *transport.Serv binlog.Log(ctx, st) } } - return ss.s.WriteStatus(statusOK) + if err := ss.writeStatus(statusOK); err != nil { + channelz.Warningf(logger, s.channelz, "grpc: Server.processRPC failed to write status: %v", err) + } + return err } func (s *Server) handleMalformedMethodName(stream *transport.ServerStream, ti *traceInfo) { @@ -1854,18 +1591,14 @@ func (s *Server) handleStream(t transport.ServerTransport, stream *transport.Ser srv, knownService := s.services[service] if knownService { - if md, ok := srv.methods[method]; ok { - s.processUnaryRPC(ctx, stream, srv, md, ti) - return - } if sd, ok := srv.streams[method]; ok { - s.processStreamingRPC(ctx, stream, srv, sd, ti) + s.processRPC(ctx, stream, srv, sd, ti) return } } // Unknown service, or known server unknown method. if unknownDesc := s.opts.unknownStreamDesc; unknownDesc != nil { - s.processStreamingRPC(ctx, stream, nil, unknownDesc, ti) + s.processRPC(ctx, stream, nil, unknownDesc, ti) return } var errDesc string @@ -2069,9 +1802,6 @@ func (s *Server) isRegisteredMethod(serviceMethod string) bool { method := serviceMethod[pos+1:] srv, knownService := s.services[service] if knownService { - if _, ok := srv.methods[method]; ok { - return true - } if _, ok := srv.streams[method]; ok { return true } diff --git a/vendor/google.golang.org/grpc/stats/opentelemetry/client_metrics.go b/vendor/google.golang.org/grpc/stats/opentelemetry/client_metrics.go index fb07704ffd9..3ec48e0e3b4 100644 --- a/vendor/google.golang.org/grpc/stats/opentelemetry/client_metrics.go +++ b/vendor/google.golang.org/grpc/stats/opentelemetry/client_metrics.go @@ -160,28 +160,14 @@ func (h *clientMetricsHandler) HandleConn(context.Context, stats.ConnStats) {} // TagRPC implements per RPC attempt context management for metrics. func (h *clientMetricsHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context { - ctx, ri := getOrCreateClientRPCInfo(ctx) - ai := ri.ai - if ai.xdsLabels == nil { - ai.xdsLabels = map[string]string{ - // The defaults for all the per call labels from a plugin that - // executes on the callpath that this OpenTelemetry component - // currently supports. - "grpc.lb.locality": "", - "grpc.lb.backend_service": "", - } - } - + ctx, ri := getOrCreateClientRPCInfo(ctx, info) // Numerous stats handlers can be used for the same channel. This callback // ensures that all label updates are propagated to the rpc attempt info across // derived contexts. ctx = istats.RegisterTelemetryLabelCallback(ctx, func(labels map[string]string) { - maps.Copy(ai.xdsLabels, labels) + maps.Copy(ri.ai.xdsLabels, labels) }) - ai.startTime = time.Now() - ai.method = removeLeadingSlash(info.FullMethodName) - return ctx } diff --git a/vendor/google.golang.org/grpc/stats/opentelemetry/client_tracing.go b/vendor/google.golang.org/grpc/stats/opentelemetry/client_tracing.go index cffdb969764..64cda94411a 100644 --- a/vendor/google.golang.org/grpc/stats/opentelemetry/client_tracing.go +++ b/vendor/google.golang.org/grpc/stats/opentelemetry/client_tracing.go @@ -124,7 +124,7 @@ func (h *clientTracingHandler) HandleConn(context.Context, stats.ConnStats) {} // TagRPC implements per RPC attempt context management for traces. func (h *clientTracingHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context { - ctx, ri := getOrCreateClientRPCInfo(ctx) + ctx, ri := getOrCreateClientRPCInfo(ctx, info) ci := getCallInfo(ctx) if ci == nil { logger.Error("context passed into client side stats handler (TagRPC) has no call info") diff --git a/vendor/google.golang.org/grpc/stats/opentelemetry/opentelemetry.go b/vendor/google.golang.org/grpc/stats/opentelemetry/opentelemetry.go index b9b0c7af570..878e4eb9ecf 100644 --- a/vendor/google.golang.org/grpc/stats/opentelemetry/opentelemetry.go +++ b/vendor/google.golang.org/grpc/stats/opentelemetry/opentelemetry.go @@ -216,21 +216,55 @@ func serverRPCInfo(ctx context.Context) *rpcInfo { return ri } -func getOrCreateClientRPCInfo(ctx context.Context) (context.Context, *rpcInfo) { +func getOrCreateClientRPCInfo(ctx context.Context, info *stats.RPCTagInfo) (context.Context, *rpcInfo) { ri := clientRPCInfo(ctx) if ri != nil { return ctx, ri } - ri = &rpcInfo{ai: &attemptInfo{}} + ri = &rpcInfo{ + ai: &attemptInfo{ + startTime: time.Now(), + method: removeLeadingSlash(info.FullMethodName), + xdsLabels: map[string]string{ + // The defaults for all the per call labels from a plugin that + // executes on the callpath that this OpenTelemetry component + // currently supports. + "grpc.lb.locality": "", + "grpc.lb.backend_service": "", + }, + }, + } return context.WithValue(ctx, clientRPCInfoKey{}, ri), ri } -func getOrCreateServerRPCInfo(ctx context.Context) (context.Context, *rpcInfo) { +func getOrCreateServerRPCInfo(ctx context.Context, info *stats.RPCTagInfo, options MetricsOptions) (context.Context, *rpcInfo) { ri := serverRPCInfo(ctx) if ri != nil { return ctx, ri } - ri = &rpcInfo{ai: &attemptInfo{}} + method := info.FullMethodName + if options.MethodAttributeFilter != nil { + if !options.MethodAttributeFilter(method) { + method = "other" + } + } + server := internal.ServerFromContext.(func(context.Context) *grpc.Server)(ctx) + if server == nil { // Shouldn't happen, defensive programming. + logger.Error("ctx passed into server side stats handler has no grpc server ref") + method = "other" + } else { + isRegisteredMethod := internal.IsRegisteredMethod.(func(*grpc.Server, string) bool) + if !isRegisteredMethod(server, method) { + method = "other" + } + } + + ri = &rpcInfo{ + ai: &attemptInfo{ + startTime: time.Now(), + method: removeLeadingSlash(method), + }, + } return context.WithValue(ctx, serverRPCInfoKey{}, ri), ri } diff --git a/vendor/google.golang.org/grpc/stats/opentelemetry/server_metrics.go b/vendor/google.golang.org/grpc/stats/opentelemetry/server_metrics.go index 4db79780340..7ec0e4b2d1b 100644 --- a/vendor/google.golang.org/grpc/stats/opentelemetry/server_metrics.go +++ b/vendor/google.golang.org/grpc/stats/opentelemetry/server_metrics.go @@ -26,7 +26,6 @@ import ( "google.golang.org/grpc" estats "google.golang.org/grpc/experimental/stats" - "google.golang.org/grpc/internal" "google.golang.org/grpc/metadata" "google.golang.org/grpc/stats" "google.golang.org/grpc/status" @@ -180,27 +179,7 @@ func (h *serverMetricsHandler) HandleConn(context.Context, stats.ConnStats) {} // TagRPC implements per RPC context management for metrics. func (h *serverMetricsHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context { - method := info.FullMethodName - if h.options.MetricsOptions.MethodAttributeFilter != nil { - if !h.options.MetricsOptions.MethodAttributeFilter(method) { - method = "other" - } - } - server := internal.ServerFromContext.(func(context.Context) *grpc.Server)(ctx) - if server == nil { // Shouldn't happen, defensive programming. - logger.Error("ctx passed into server side stats handler has no grpc server ref") - method = "other" - } else { - isRegisteredMethod := internal.IsRegisteredMethod.(func(*grpc.Server, string) bool) - if !isRegisteredMethod(server, method) { - method = "other" - } - } - ctx, ri := getOrCreateServerRPCInfo(ctx) - ai := ri.ai - ai.startTime = time.Now() - ai.method = removeLeadingSlash(method) - + ctx, _ = getOrCreateServerRPCInfo(ctx, info, h.options.MetricsOptions) return ctx } diff --git a/vendor/google.golang.org/grpc/stats/opentelemetry/server_tracing.go b/vendor/google.golang.org/grpc/stats/opentelemetry/server_tracing.go index c267ba1ed0a..952e787b205 100644 --- a/vendor/google.golang.org/grpc/stats/opentelemetry/server_tracing.go +++ b/vendor/google.golang.org/grpc/stats/opentelemetry/server_tracing.go @@ -39,8 +39,8 @@ func (h *serverTracingHandler) initializeTraces() { } // TagRPC implements per RPC attempt context management for traces. -func (h *serverTracingHandler) TagRPC(ctx context.Context, _ *stats.RPCTagInfo) context.Context { - ctx, ri := getOrCreateServerRPCInfo(ctx) +func (h *serverTracingHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context { + ctx, ri := getOrCreateServerRPCInfo(ctx, info, h.options.MetricsOptions) ctx, _ = h.traceTagRPC(ctx, ri.ai) return ctx } diff --git a/vendor/google.golang.org/grpc/stream.go b/vendor/google.golang.org/grpc/stream.go index 51aff85dfba..52e59f2c5ed 100644 --- a/vendor/google.golang.org/grpc/stream.go +++ b/vendor/google.golang.org/grpc/stream.go @@ -28,6 +28,7 @@ import ( "strconv" "strings" "sync" + "sync/atomic" "time" "google.golang.org/grpc/balancer" @@ -148,6 +149,94 @@ type ClientStream interface { RecvMsg(m any) error } +// clientStreamWrapper wraps a ClientStream and handles SendMsg, CloseSend, and +// RecvMsg parities based on the nature of stream. +type clientStreamWrapper struct { + ClientStream + desc *StreamDesc + closeSendCalled atomic.Bool +} + +// CloseSend closes the send direction of the stream. The implementation ensures +// that CloseSend is only called once on the underlying ClientStream, even if +// CloseSend is called multiple times on the wrapper. +func (w *clientStreamWrapper) CloseSend() error { + if w.closeSendCalled.Swap(true) { + return nil + } + return w.ClientStream.CloseSend() +} + +// SendMsg sends message m across the stream. For RPCs where client can call +// SendMsg only once, i.e. only server-streaming RPCs, it converts io.EOF to nil +// and immediately calls CloseSend to trigger any interceptor hooks. +func (w *clientStreamWrapper) SendMsg(m any) error { + err := w.ClientStream.SendMsg(m) + // If the RPC is a client-streaming RPC, the client can send multiple + // messages. In this case, the client should handle any type of + // error,including io.EOF and call CloseSend once it is done sending messages. + if w.desc.ClientStreams { + return err + } + + if err == io.EOF { + // For non-client-streaming RPCs, we return nil instead of EOF on error + // because the generated code requires it. finish is not called; RecvMsg() + // will call it with the stream's status independently. + return nil + } + if err != nil { + return err + } + // In some scenarios (e.g., xDS), the same interceptors process both unary and + // streaming RPCs, relying on CloseSend to signal that no more messages are on + // the way. Although protobuf-generated stubs already invoke CloseSend for + // server-streaming RPCs, it is explicitly called here to ensure downstream + // interceptors are also notified when callers interact with the ClientStream + // API directly. + if err := w.CloseSend(); err != nil && err != io.EOF { + return err + } + return nil + +} + +// RecvMsg receives message m from the stream. For RPCs that call RecvMsg only +// once i.e. only client streaming RPCs, it calls the underlying RecvMsg a +// second time after receiving the first message to get the trailers. +func (w *clientStreamWrapper) RecvMsg(m any) error { + err := w.ClientStream.RecvMsg(m) + if err != nil { + return err + } + if w.desc.ServerStreams { + return nil + } + // Call RecvMsg again for non-server streaming RPCs to get the trailers and + // ensure RPC has completed successfully. + err = w.ClientStream.RecvMsg(m) + if err == io.EOF { + return nil + } + if err == nil { + return status.Error(codes.Internal, "cardinality violation: expected for non server-streaming RPCs, but received another message") + } + return err +} + +// defaultStreamInterceptor is a StreamClientInterceptor which wraps the +// ClientStream and is always invoked as the first interceptor. It consolidates +// behavior for different RPC types at the level closest to the application, +// which simplifies the underlying stream implementation and other interceptors +// by avoiding duplicate or scattered handling. +func defaultStreamInterceptor(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, streamer Streamer, opts ...CallOption) (ClientStream, error) { + cs, err := streamer(ctx, desc, cc, method, opts...) + if err != nil { + return nil, err + } + return &clientStreamWrapper{ClientStream: cs, desc: desc}, nil +} + // NewStream creates a new Stream for the client side. This is typically // called by generated code. ctx is used for the lifetime of the stream. // @@ -253,14 +342,11 @@ func newClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth mc := &emptyMethodConfig var onCommit func() - newStream := func(ctx context.Context, filterOpts ...CallOption) (ClientStream, error) { - if filterOpts != nil { - opts = combine(opts, filterOpts) - } + newStream := func(ctx context.Context, opts ...CallOption) (ClientStream, error) { return newClientStreamWithParams(ctx, desc, cc, method, mc, onCommit, nameResolutionDelayed, opts...) } - rpcInfo := iresolver.RPCInfo{Context: ctx, Method: method} + rpcInfo := iresolver.RPCInfo{Context: ctx, Method: method, Authority: cc.authority} rpcConfig, err := cc.safeConfigSelector.SelectConfig(rpcInfo) if err != nil { if st, ok := status.FromError(err); ok { @@ -278,13 +364,23 @@ func newClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth ctx = rpcConfig.Context } mc = &rpcConfig.MethodConfig - onCommit = rpcConfig.OnCommitted + + if rpcConfig.OnCommitted != nil { + onCommit = rpcConfig.OnCommitted + // Register an OnFinish CallOption with the OnCommitted callback to + // ensure it is invoked on stream termination, even if the stream + // fails early before committing. Implementations of OnCommitted are + // expected to be idempotent (e.g., guarded by sync.Once), since both + // onCommit and OnFinish may run for a single RPC. + opts = append(opts, OnFinish(func(error) { rpcConfig.OnCommitted() })) + } + if rpcConfig.Interceptor != nil { rpcInfo.Context = nil ns := newStream if interceptor, ok := rpcConfig.Interceptor.(clientInterceptor); ok { - newStream = func(ctx context.Context, filterOpts ...CallOption) (ClientStream, error) { - cs, err := interceptor.NewStream(ctx, rpcInfo, ns, filterOpts...) + newStream = func(ctx context.Context, opts ...CallOption) (ClientStream, error) { + cs, err := interceptor.NewStream(ctx, rpcInfo, ns, opts...) if err != nil { return nil, toRPCErr(err) } @@ -296,7 +392,7 @@ func newClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth } } - return newStream(ctx) + return newStream(ctx, opts...) } func newClientStreamWithParams(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, mc *serviceconfig.MethodConfig, onCommit func(), nameResolutionDelayed bool, opts ...CallOption) (_ ClientStream, err error) { @@ -543,6 +639,9 @@ func (a *csAttempt) newStream() error { // maintained in it are local to the attempt. When the attempt has to be // retried, a new instance of csAttempt will be created. if a.pickResult.Metadata != nil { + if err := imetadata.Validate(a.pickResult.Metadata); err != nil { + return status.Error(codes.Internal, err.Error()) + } // We currently do not have a function it the metadata package which // merges given metadata with existing metadata in a context. Existing // function `AppendToOutgoingContext()` takes a variadic argument of key @@ -1044,8 +1143,8 @@ func (cs *clientStream) RecvMsg(m any) error { binlog.Log(cs.ctx, sm) } } - if err != nil || !cs.desc.ServerStreams { - // err != nil or non-server-streaming indicates end of stream. + if err != nil { + // err != nil indicates end of stream. cs.finish(err) } return err @@ -1093,7 +1192,8 @@ func (cs *clientStream) finish(err error) { } cs.finished = true cs.commitAttemptLocked() - if cs.attempt != nil { + attemptCreated := cs.attempt != nil + if attemptCreated { cs.attempt.finish(err) // after functions all rely upon having a stream. if cs.attempt.transportStream != nil { @@ -1131,7 +1231,13 @@ func (cs *clientStream) finish(err error) { if err == nil { cs.retryThrottler.successfulRPC() } - endOfClientStream(cs.cc, err, cs.opts...) + // If no attempt was ever created, stream creation has failed, and the + // cleanup is left to newClientStream, whose deferred cleanup invokes + // endOfClientStream if the call fails. Invoking it here as well would + // run the cleanup twice for the same call. + if attemptCreated { + endOfClientStream(cs.cc, err, cs.opts...) + } cs.cancel() } @@ -1145,12 +1251,6 @@ func (a *csAttempt) sendMsg(m any, hdr []byte, payld mem.BufferSlice, dataLength a.mu.Unlock() } if err := a.transportStream.Write(hdr, payld, &transport.WriteOptions{Last: !cs.desc.ClientStreams}); err != nil { - if !cs.desc.ClientStreams { - // For non-client-streaming RPCs, we return nil instead of EOF on error - // because the generated code requires it. finish is not called; RecvMsg() - // will call it with the stream's status independently. - return nil - } return io.EOF } if a.statsHandler != nil { @@ -1218,18 +1318,7 @@ func (a *csAttempt) recvMsg(m any, payInfo *payloadInfo) (err error) { Length: payInfo.uncompressedBytes.Len(), }) } - if cs.desc.ServerStreams { - // Subsequent messages should be received by subsequent RecvMsg calls. - return nil - } - // Special handling for non-server-stream rpcs. - // This recv expects EOF or errors, so we don't collect inPayload. - if err := recv(&a.parser, cs.codec, a.transportStream, a.decompressorV0, m, *cs.callInfo.maxReceiveMessageSize, nil, a.decompressorV1, false); err == io.EOF { - return a.transportStream.Status().Err() // non-server streaming Recv returns nil on success - } else if err != nil { - return toRPCErr(err) - } - return status.Error(codes.Internal, "cardinality violation: expected for non server-streaming RPCs, but received another message") + return nil } func (a *csAttempt) finish(err error) { @@ -1399,7 +1488,7 @@ func newNonRetryClientStream(ctx context.Context, desc *StreamDesc, method strin } }() } - return as, nil + return &clientStreamWrapper{ClientStream: as, desc: desc}, nil } type addrConnStream struct { @@ -1497,12 +1586,6 @@ func (as *addrConnStream) SendMsg(m any) (err error) { } if err := as.transportStream.Write(hdr, payload, &transport.WriteOptions{Last: !as.desc.ClientStreams}); err != nil { - if !as.desc.ClientStreams { - // For non-client-streaming RPCs, we return nil instead of EOF on error - // because the generated code requires it. finish is not called; RecvMsg() - // will call it with the stream's status independently. - return nil - } return io.EOF } @@ -1511,8 +1594,8 @@ func (as *addrConnStream) SendMsg(m any) (err error) { func (as *addrConnStream) RecvMsg(m any) (err error) { defer func() { - if err != nil || !as.desc.ServerStreams { - // err != nil or non-server-streaming indicates end of stream. + if err != nil { + // err != nil indicates end of stream. as.finish(err) } }() @@ -1551,20 +1634,7 @@ func (as *addrConnStream) RecvMsg(m any) (err error) { return toRPCErr(err) } as.receivedFirstMsg = true - - if as.desc.ServerStreams { - // Subsequent messages should be received by subsequent RecvMsg calls. - return nil - } - - // Special handling for non-server-stream rpcs. - // This recv expects EOF or errors, so we don't collect inPayload. - if err := recv(&as.parser, as.codec, as.transportStream, as.decompressorV0, m, *as.callInfo.maxReceiveMessageSize, nil, as.decompressorV1, false); err == io.EOF { - return as.transportStream.Status().Err() // non-server streaming Recv returns nil on success - } else if err != nil { - return toRPCErr(err) - } - return status.Error(codes.Internal, "cardinality violation: expected for non server-streaming RPCs, but received another message") + return nil } func (as *addrConnStream) finish(err error) { @@ -1675,6 +1745,8 @@ type serverStream struct { // synchronized. serverHeaderBinlogged bool + statusWritten atomic.Bool // True if status has been written to the transport. + mu sync.Mutex // protects trInfo.tr after the service handler runs. } @@ -1723,6 +1795,16 @@ func (ss *serverStream) SetTrailer(md metadata.MD) { ss.s.SetTrailer(md) } +// writeStatus sends the status of a stream to the client. It uses an atomic +// CAS to guarantee that the status is written to the transport exactly once, +// even if called concurrently. +func (ss *serverStream) writeStatus(st *status.Status) error { + if !ss.statusWritten.CompareAndSwap(false, true) { + return nil + } + return ss.s.WriteStatus(st) +} + func (ss *serverStream) SendMsg(m any) (err error) { defer func() { if ss.trInfo != nil { @@ -1739,7 +1821,7 @@ func (ss *serverStream) SendMsg(m any) (err error) { } if err != nil && err != io.EOF { st, _ := status.FromError(toRPCErr(err)) - ss.s.WriteStatus(st) + ss.writeStatus(st) // Non-user specified status was sent out. This should be an error // case (as a server side Cancel maybe). // @@ -1822,7 +1904,7 @@ func (ss *serverStream) RecvMsg(m any) (err error) { } if err != nil && err != io.EOF { st, _ := status.FromError(toRPCErr(err)) - ss.s.WriteStatus(st) + ss.writeStatus(st) // Non-user specified status was sent out. This should be an error // case (as a server side Cancel maybe). // diff --git a/vendor/google.golang.org/grpc/version.go b/vendor/google.golang.org/grpc/version.go index 64ec3b3cfd0..75f8ef50d49 100644 --- a/vendor/google.golang.org/grpc/version.go +++ b/vendor/google.golang.org/grpc/version.go @@ -19,4 +19,4 @@ package grpc // Version is the current grpc version. -const Version = "1.83.1" +const Version = "1.84.0" diff --git a/vendor/google.golang.org/grpc/xds/server.go b/vendor/google.golang.org/grpc/xds/server.go index e48f809d02b..f820062f611 100644 --- a/vendor/google.golang.org/grpc/xds/server.go +++ b/vendor/google.golang.org/grpc/xds/server.go @@ -19,7 +19,6 @@ package xds import ( - "context" "errors" "fmt" "net" @@ -73,11 +72,16 @@ type GRPCServer struct { // The underlying gRPC server has no service registered and has not started to // accept requests yet. func NewGRPCServer(opts ...grpc.ServerOption) (*GRPCServer, error) { - newOpts := []grpc.ServerOption{ - grpc.ChainUnaryInterceptor(xdsUnaryInterceptor), - grpc.ChainStreamInterceptor(xdsStreamInterceptor), - } - newOpts = append(newOpts, opts...) + // xdsFilterWrapper is a callback passed to the underlying gRPC server. + // It adapts the generic stream parameter and delegates to RouteAndProcess + // to execute xDS HTTP filter interceptors for each incoming RPC. + xDSFilterWrapper := func(ss grpc.ServerStream) (grpc.ServerStream, error) { + return server.RouteAndProcess(ss) + } + // Construct a grpc.ServerOption that registers xDSFilterWrapper on + // the server. + xDSFilterWrapperOption := internal.XDSFilterWrapperOption.(func(func(grpc.ServerStream) (grpc.ServerStream, error)) grpc.ServerOption) + newOpts := append([]grpc.ServerOption{xDSFilterWrapperOption(xDSFilterWrapper)}, opts...) s := &GRPCServer{ gs: newGRPCServer(newOpts...), quit: grpcsync.NewEvent(), @@ -229,21 +233,3 @@ func (s *GRPCServer) GracefulStop() { s.xdsClientClose() } } - -// xdsUnaryInterceptor is the unary interceptor added to the gRPC server to -// perform any xDS specific functionality on unary RPCs. -func xdsUnaryInterceptor(ctx context.Context, req any, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp any, err error) { - if err := server.RouteAndProcess(ctx); err != nil { - return nil, err - } - return handler(ctx, req) -} - -// xdsStreamInterceptor is the stream interceptor added to the gRPC server to -// perform any xDS specific functionality on streaming RPCs. -func xdsStreamInterceptor(srv any, ss grpc.ServerStream, _ *grpc.StreamServerInfo, handler grpc.StreamHandler) error { - if err := server.RouteAndProcess(ss.Context()); err != nil { - return err - } - return handler(srv, ss) -} diff --git a/vendor/google.golang.org/grpc/xds/xds.go b/vendor/google.golang.org/grpc/xds/xds.go index c6a1f25f7aa..182c32dfede 100644 --- a/vendor/google.golang.org/grpc/xds/xds.go +++ b/vendor/google.golang.org/grpc/xds/xds.go @@ -40,6 +40,7 @@ import ( _ "google.golang.org/grpc/credentials/tls/certprovider/pemfile" // Register the file watcher certificate provider plugin. _ "google.golang.org/grpc/internal/xds/balancer" // Register the balancers. _ "google.golang.org/grpc/internal/xds/clusterspecifier/rls" // Register the RLS cluster specifier plugin. Note that this does not register the RLS LB policy. + _ "google.golang.org/grpc/internal/xds/httpfilter/extproc" // Register the extproc filter. _ "google.golang.org/grpc/internal/xds/httpfilter/fault" // Register the fault injection filter. _ "google.golang.org/grpc/internal/xds/httpfilter/rbac" // Register the RBAC filter. _ "google.golang.org/grpc/internal/xds/httpfilter/router" // Register the router filter. diff --git a/vendor/google.golang.org/protobuf/encoding/protodelim/protodelim.go b/vendor/google.golang.org/protobuf/encoding/protodelim/protodelim.go index 2ef36bbcf92..ec63689e725 100644 --- a/vendor/google.golang.org/protobuf/encoding/protodelim/protodelim.go +++ b/vendor/google.golang.org/protobuf/encoding/protodelim/protodelim.go @@ -10,6 +10,7 @@ import ( "encoding/binary" "fmt" "io" + "math" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/errors" @@ -117,7 +118,13 @@ func (o UnmarshalOptions) UnmarshalFrom(r Reader, m proto.Message) error { if maxSize == 0 { maxSize = defaultMaxSize } - if maxSize != -1 && size > uint64(maxSize) { + if maxSize == -1 { + // No limit specified: Just check that size fits into an integer, + // otherwise the make([]byte, size) call below will panic. + if size > math.MaxInt { + return errors.Wrap(&SizeTooLargeError{Size: size, MaxSize: math.MaxInt}, "") + } + } else if size > uint64(maxSize) { return errors.Wrap(&SizeTooLargeError{Size: size, MaxSize: uint64(maxSize)}, "") } diff --git a/vendor/google.golang.org/protobuf/encoding/protojson/decode.go b/vendor/google.golang.org/protobuf/encoding/protojson/decode.go index 737d6876d5e..1d6608dc7d5 100644 --- a/vendor/google.golang.org/protobuf/encoding/protojson/decode.go +++ b/vendor/google.golang.org/protobuf/encoding/protojson/decode.go @@ -365,6 +365,10 @@ func unmarshalInt(tok json.Token, bitSize int) (protoreflect.Value, bool) { if err != nil { return protoreflect.Value{}, false } + // Ensure there is no non-number content in this string. + if next, err := dec.Read(); err != nil || next.Kind() != json.EOF { + return protoreflect.Value{}, false + } return getInt(tok, bitSize) } return protoreflect.Value{}, false @@ -397,6 +401,10 @@ func unmarshalUint(tok json.Token, bitSize int) (protoreflect.Value, bool) { if err != nil { return protoreflect.Value{}, false } + // Ensure there is no non-number content in this string. + if next, err := dec.Read(); err != nil || next.Kind() != json.EOF { + return protoreflect.Value{}, false + } return getUint(tok, bitSize) } return protoreflect.Value{}, false @@ -447,6 +455,10 @@ func unmarshalFloat(tok json.Token, bitSize int) (protoreflect.Value, bool) { if err != nil { return protoreflect.Value{}, false } + // Ensure there is no non-number content in this string. + if next, err := dec.Read(); err != nil || next.Kind() != json.EOF { + return protoreflect.Value{}, false + } return getFloat(tok, bitSize) } return protoreflect.Value{}, false diff --git a/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go b/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go index e9fe1039437..d2eab469474 100644 --- a/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go +++ b/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go @@ -52,7 +52,10 @@ func wellKnownTypeMarshaler(name protoreflect.FullName) marshalFunc { case genid.FieldMask_message_name: return encoder.marshalFieldMask case genid.Empty_message_name: - return encoder.marshalEmpty + // The spec explicitly specifies that the Empty message + // is not considered to have any special JSON mapping: + // https://protobuf.dev/programming-guides/json/#any + return nil } } return nil diff --git a/vendor/google.golang.org/protobuf/encoding/prototext/decode.go b/vendor/google.golang.org/protobuf/encoding/prototext/decode.go index b53805056a9..20ec09e1948 100644 --- a/vendor/google.golang.org/protobuf/encoding/prototext/decode.go +++ b/vendor/google.golang.org/protobuf/encoding/prototext/decode.go @@ -8,6 +8,7 @@ import ( "fmt" "unicode/utf8" + "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/encoding/messageset" "google.golang.org/protobuf/internal/encoding/text" "google.golang.org/protobuf/internal/errors" @@ -49,12 +50,19 @@ type UnmarshalOptions struct { protoregistry.MessageTypeResolver protoregistry.ExtensionTypeResolver } + + // RecursionLimit limits how deeply messages may be nested. + // If zero, a default limit is applied. + RecursionLimit int } // Unmarshal reads the given []byte and populates the given [proto.Message] // using options in the UnmarshalOptions object. // The provided message must be mutable (e.g., a non-nil pointer to a message). func (o UnmarshalOptions) Unmarshal(b []byte, m proto.Message) error { + if o.RecursionLimit == 0 { + o.RecursionLimit = protowire.DefaultRecursionLimit + } return o.unmarshal(b, m) } @@ -102,8 +110,14 @@ func (d decoder) syntaxError(pos int, f string, x ...any) error { return errors.New(head+f, x...) } +var errRecursionDepth = errors.New("exceeded maximum recursion depth") + // unmarshalMessage unmarshals into the given protoreflect.Message. func (d decoder) unmarshalMessage(m protoreflect.Message, checkDelims bool) error { + if d.opts.RecursionLimit--; d.opts.RecursionLimit < 0 { + return errRecursionDepth + } + messageDesc := m.Descriptor() if !flags.ProtoLegacy && messageset.IsMessageSet(messageDesc) { return errors.New("no support for proto1 MessageSets") @@ -437,6 +451,10 @@ func (d decoder) unmarshalList(fd protoreflect.FieldDescriptor, list protoreflec // unmarshalMap unmarshals into given protoreflect.Map. A map value is a // textproto message containing {key: , value: }. func (d decoder) unmarshalMap(fd protoreflect.FieldDescriptor, mmap protoreflect.Map) error { + if d.opts.RecursionLimit--; d.opts.RecursionLimit < 0 { + return errRecursionDepth + } + // Determine ahead whether map entry is a scalar type or a message type in // order to call the appropriate unmarshalMapValue func inside // unmarshalMapEntry. diff --git a/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go b/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go index 87e46bd4dfb..0b0dfacbe5a 100644 --- a/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go +++ b/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go @@ -83,12 +83,13 @@ func formatListOpt(vs list, isRoot, allowMulti bool) string { case protoreflect.FileImports: for i := 0; i < vs.Len(); i++ { var rs records - rv := reflect.ValueOf(vs.Get(i)) - rs.Append(rv, []methodAndName{ - {rv.MethodByName("Path"), "Path"}, - {rv.MethodByName("Package"), "Package"}, - {rv.MethodByName("IsPublic"), "IsPublic"}, - {rv.MethodByName("IsWeak"), "IsWeak"}, + fi := vs.Get(i) + rv := reflect.ValueOf(fi) + rs.Append(rv, []attrAndName{ + {fi.Path(), "Path"}, + {fi.Package(), "Package"}, + {fi.IsPublic, "IsPublic"}, + {fi.IsWeak, "IsWeak"}, }...) ss = append(ss, "{"+rs.Join()+"}") } @@ -104,9 +105,9 @@ func formatListOpt(vs list, isRoot, allowMulti bool) string { } } -type methodAndName struct { - method reflect.Value - name string +type attrAndName struct { + attr any + name string } func FormatDesc(s fmt.State, r rune, t protoreflect.Descriptor) { @@ -126,58 +127,58 @@ func formatDescOpt(t protoreflect.Descriptor, isRoot, allowMulti bool, record fu start = rt.Name() + "{" } - _, isFile := t.(protoreflect.FileDescriptor) + fd, isFile := t.(protoreflect.FileDescriptor) rs := records{ allowMulti: allowMulti, record: record, } if t.IsPlaceholder() { if isFile { - rs.Append(rv, []methodAndName{ - {rv.MethodByName("Path"), "Path"}, - {rv.MethodByName("Package"), "Package"}, - {rv.MethodByName("IsPlaceholder"), "IsPlaceholder"}, + rs.Append(rv, []attrAndName{ + {fd.Path(), "Path"}, + {fd.Package(), "Package"}, + {fd.IsPlaceholder(), "IsPlaceholder"}, }...) } else { - rs.Append(rv, []methodAndName{ - {rv.MethodByName("FullName"), "FullName"}, - {rv.MethodByName("IsPlaceholder"), "IsPlaceholder"}, + rs.Append(rv, []attrAndName{ + {t.FullName(), "FullName"}, + {t.IsPlaceholder(), "IsPlaceholder"}, }...) } } else { switch { case isFile: - rs.Append(rv, methodAndName{rv.MethodByName("Syntax"), "Syntax"}) + rs.Append(rv, attrAndName{fd.Syntax(), "Syntax"}) case isRoot: - rs.Append(rv, []methodAndName{ - {rv.MethodByName("Syntax"), "Syntax"}, - {rv.MethodByName("FullName"), "FullName"}, + rs.Append(rv, []attrAndName{ + {t.Syntax(), "Syntax"}, + {t.FullName(), "FullName"}, }...) default: - rs.Append(rv, methodAndName{rv.MethodByName("Name"), "Name"}) + rs.Append(rv, attrAndName{t.Name(), "Name"}) } switch t := t.(type) { case protoreflect.FieldDescriptor: - accessors := []methodAndName{ - {rv.MethodByName("Number"), "Number"}, - {rv.MethodByName("Cardinality"), "Cardinality"}, - {rv.MethodByName("Kind"), "Kind"}, - {rv.MethodByName("HasJSONName"), "HasJSONName"}, - {rv.MethodByName("JSONName"), "JSONName"}, - {rv.MethodByName("HasPresence"), "HasPresence"}, - {rv.MethodByName("IsExtension"), "IsExtension"}, - {rv.MethodByName("IsPacked"), "IsPacked"}, - {rv.MethodByName("IsWeak"), "IsWeak"}, - {rv.MethodByName("IsList"), "IsList"}, - {rv.MethodByName("IsMap"), "IsMap"}, - {rv.MethodByName("MapKey"), "MapKey"}, - {rv.MethodByName("MapValue"), "MapValue"}, - {rv.MethodByName("HasDefault"), "HasDefault"}, - {rv.MethodByName("Default"), "Default"}, - {rv.MethodByName("ContainingOneof"), "ContainingOneof"}, - {rv.MethodByName("ContainingMessage"), "ContainingMessage"}, - {rv.MethodByName("Message"), "Message"}, - {rv.MethodByName("Enum"), "Enum"}, + accessors := []attrAndName{ + {t.Number(), "Number"}, + {t.Cardinality(), "Cardinality"}, + {t.Kind(), "Kind"}, + {t.HasJSONName(), "HasJSONName"}, + {t.JSONName(), "JSONName"}, + {t.HasPresence(), "HasPresence"}, + {t.IsExtension(), "IsExtension"}, + {t.IsPacked(), "IsPacked"}, + {t.IsWeak(), "IsWeak"}, + {t.IsList(), "IsList"}, + {t.IsMap(), "IsMap"}, + {t.MapKey(), "MapKey"}, + {t.MapValue(), "MapValue"}, + {t.HasDefault(), "HasDefault"}, + {t.Default(), "Default"}, + {t.ContainingOneof(), "ContainingOneof"}, + {t.ContainingMessage(), "ContainingMessage"}, + {t.Message(), "Message"}, + {t.Enum(), "Enum"}, } for _, s := range accessors { switch s.name { @@ -223,58 +224,54 @@ func formatDescOpt(t protoreflect.Descriptor, isRoot, allowMulti bool, record fu } case protoreflect.FileDescriptor: - rs.Append(rv, []methodAndName{ - {rv.MethodByName("Path"), "Path"}, - {rv.MethodByName("Package"), "Package"}, - {rv.MethodByName("Imports"), "Imports"}, - {rv.MethodByName("Messages"), "Messages"}, - {rv.MethodByName("Enums"), "Enums"}, - {rv.MethodByName("Extensions"), "Extensions"}, - {rv.MethodByName("Services"), "Services"}, + rs.Append(rv, []attrAndName{ + {t.Path(), "Path"}, + {t.Package(), "Package"}, + {t.Imports(), "Imports"}, + {t.Messages(), "Messages"}, + {t.Enums(), "Enums"}, + {t.Extensions(), "Extensions"}, + {t.Services(), "Services"}, }...) case protoreflect.MessageDescriptor: - rs.Append(rv, []methodAndName{ - {rv.MethodByName("IsMapEntry"), "IsMapEntry"}, - {rv.MethodByName("Fields"), "Fields"}, - {rv.MethodByName("Oneofs"), "Oneofs"}, - {rv.MethodByName("ReservedNames"), "ReservedNames"}, - {rv.MethodByName("ReservedRanges"), "ReservedRanges"}, - {rv.MethodByName("RequiredNumbers"), "RequiredNumbers"}, - {rv.MethodByName("ExtensionRanges"), "ExtensionRanges"}, - {rv.MethodByName("Messages"), "Messages"}, - {rv.MethodByName("Enums"), "Enums"}, - {rv.MethodByName("Extensions"), "Extensions"}, + rs.Append(rv, []attrAndName{ + {t.IsMapEntry(), "IsMapEntry"}, + {t.Fields(), "Fields"}, + {t.Oneofs(), "Oneofs"}, + {t.ReservedNames(), "ReservedNames"}, + {t.ReservedRanges(), "ReservedRanges"}, + {t.RequiredNumbers(), "RequiredNumbers"}, + {t.ExtensionRanges(), "ExtensionRanges"}, + {t.Messages(), "Messages"}, + {t.Enums(), "Enums"}, + {t.Extensions(), "Extensions"}, }...) case protoreflect.EnumDescriptor: - rs.Append(rv, []methodAndName{ - {rv.MethodByName("Values"), "Values"}, - {rv.MethodByName("ReservedNames"), "ReservedNames"}, - {rv.MethodByName("ReservedRanges"), "ReservedRanges"}, - {rv.MethodByName("IsClosed"), "IsClosed"}, + rs.Append(rv, []attrAndName{ + {t.Values(), "Values"}, + {t.ReservedNames(), "ReservedNames"}, + {t.ReservedRanges(), "ReservedRanges"}, + {t.IsClosed(), "IsClosed"}, }...) case protoreflect.EnumValueDescriptor: - rs.Append(rv, []methodAndName{ - {rv.MethodByName("Number"), "Number"}, - }...) + rs.Append(rv, attrAndName{t.Number(), "Number"}) case protoreflect.ServiceDescriptor: - rs.Append(rv, []methodAndName{ - {rv.MethodByName("Methods"), "Methods"}, - }...) + rs.Append(rv, attrAndName{t.Methods(), "Methods"}) case protoreflect.MethodDescriptor: - rs.Append(rv, []methodAndName{ - {rv.MethodByName("Input"), "Input"}, - {rv.MethodByName("Output"), "Output"}, - {rv.MethodByName("IsStreamingClient"), "IsStreamingClient"}, - {rv.MethodByName("IsStreamingServer"), "IsStreamingServer"}, + rs.Append(rv, []attrAndName{ + {t.Input(), "Input"}, + {t.Output(), "Output"}, + {t.IsStreamingClient(), "IsStreamingClient"}, + {t.IsStreamingServer(), "IsStreamingServer"}, }...) } - if m := rv.MethodByName("GoType"); m.IsValid() { - rs.Append(rv, methodAndName{m, "GoType"}) + if m, ok := t.(interface{ GoType() reflect.Type }); ok { + rs.Append(rv, attrAndName{m.GoType(), "GoType"}) } } return start + rs.Join() + end @@ -297,68 +294,66 @@ func (rs *records) AppendRecs(fieldName string, newRecs [2]string) { rs.recs = append(rs.recs, newRecs) } -func (rs *records) Append(v reflect.Value, accessors ...methodAndName) { - for _, a := range accessors { - if rs.record != nil { - rs.record(a.name) - } - var rv reflect.Value - if a.method.IsValid() { - rv = a.method.Call(nil)[0] - } - if v.Kind() == reflect.Struct && !rv.IsValid() { - rv = v.FieldByName(a.name) - } - if !rv.IsValid() { - panic(fmt.Sprintf("unknown accessor: %v.%s", v.Type(), a.name)) - } - if _, ok := rv.Interface().(protoreflect.Value); ok { - rv = rv.MethodByName("Interface").Call(nil)[0] - if !rv.IsNil() { - rv = rv.Elem() - } - } +func (rs *records) Append(v reflect.Value, results ...attrAndName) { + for _, r := range results { + rs.appendAttribute(v, r.name, r.attr) + } +} - // Ignore zero values. - var isZero bool - switch rv.Kind() { - case reflect.Interface, reflect.Slice: - isZero = rv.IsNil() - case reflect.Bool: - isZero = rv.Bool() == false - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - isZero = rv.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - isZero = rv.Uint() == 0 - case reflect.String: - isZero = rv.String() == "" - } - if n, ok := rv.Interface().(list); ok { - isZero = n.Len() == 0 - } - if isZero { - continue +func (rs *records) appendAttribute(val reflect.Value, name string, attrVal any) { + if rs.record != nil { + rs.record(name) + } + if attrVal == nil { + return + } + rv := reflect.ValueOf(attrVal) + if _, ok := rv.Interface().(protoreflect.Value); ok { + rv = rv.MethodByName("Interface").Call(nil)[0] + if !rv.IsNil() { + rv = rv.Elem() } + } - // Format the value. - var s string - v := rv.Interface() - switch v := v.(type) { - case list: - s = formatListOpt(v, false, rs.allowMulti) - case protoreflect.FieldDescriptor, protoreflect.OneofDescriptor, protoreflect.EnumValueDescriptor, protoreflect.MethodDescriptor: - s = string(v.(protoreflect.Descriptor).Name()) - case protoreflect.Descriptor: - s = string(v.FullName()) - case string: - s = strconv.Quote(v) - case []byte: - s = fmt.Sprintf("%q", v) - default: - s = fmt.Sprint(v) - } - rs.recs = append(rs.recs, [2]string{a.name, s}) + // Ignore zero values. + var isZero bool + switch rv.Kind() { + case reflect.Interface, reflect.Slice: + isZero = rv.IsNil() + case reflect.Bool: + isZero = rv.Bool() == false + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + isZero = rv.Int() == 0 + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + isZero = rv.Uint() == 0 + case reflect.String: + isZero = rv.String() == "" + } + if n, ok := rv.Interface().(list); ok { + isZero = n.Len() == 0 + } + if isZero { + return + } + + // Format the value. + var s string + v := rv.Interface() + switch v := v.(type) { + case list: + s = formatListOpt(v, false, rs.allowMulti) + case protoreflect.FieldDescriptor, protoreflect.OneofDescriptor, protoreflect.EnumValueDescriptor, protoreflect.MethodDescriptor: + s = string(v.(protoreflect.Descriptor).Name()) + case protoreflect.Descriptor: + s = string(v.FullName()) + case string: + s = strconv.Quote(v) + case []byte: + s = fmt.Sprintf("%q", v) + default: + s = fmt.Sprint(v) } + rs.recs = append(rs.recs, [2]string{name, s}) } func (rs *records) Join() string { diff --git a/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb b/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb index 04696351eeeef14cbbd69fd1f4250530b1fbfd56..ad35ea4c449a6b23a78974a905b3fcba120223c6 100644 GIT binary patch delta 50 zcmbQmxSw&t6m2eLiGDvNNe)H>4lG0U`MWs{jB1 diff --git a/vendor/google.golang.org/protobuf/internal/encoding/defval/default.go b/vendor/google.golang.org/protobuf/internal/encoding/defval/default.go index 328dc733b04..079a53dd15a 100644 --- a/vendor/google.golang.org/protobuf/internal/encoding/defval/default.go +++ b/vendor/google.golang.org/protobuf/internal/encoding/defval/default.go @@ -69,19 +69,19 @@ func Unmarshal(s string, k protoreflect.Kind, evs protoreflect.EnumValueDescript } } case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: - if v, err := strconv.ParseInt(s, 10, 32); err == nil { + if v, err := strconv.ParseInt(s, 0, 32); err == nil { return protoreflect.ValueOfInt32(int32(v)), nil, nil } case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: - if v, err := strconv.ParseInt(s, 10, 64); err == nil { + if v, err := strconv.ParseInt(s, 0, 64); err == nil { return protoreflect.ValueOfInt64(int64(v)), nil, nil } case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: - if v, err := strconv.ParseUint(s, 10, 32); err == nil { + if v, err := strconv.ParseUint(s, 0, 32); err == nil { return protoreflect.ValueOfUint32(uint32(v)), nil, nil } case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: - if v, err := strconv.ParseUint(s, 10, 64); err == nil { + if v, err := strconv.ParseUint(s, 0, 64); err == nil { return protoreflect.ValueOfUint64(uint64(v)), nil, nil } case protoreflect.FloatKind, protoreflect.DoubleKind: diff --git a/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go b/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go index 65aaf4d210a..58aeff8456d 100644 --- a/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go +++ b/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go @@ -26,6 +26,7 @@ const ( Edition_EDITION_PROTO3_enum_value = 999 Edition_EDITION_2023_enum_value = 1000 Edition_EDITION_2024_enum_value = 1001 + Edition_EDITION_2026_enum_value = 1002 Edition_EDITION_UNSTABLE_enum_value = 9999 Edition_EDITION_1_TEST_ONLY_enum_value = 1 Edition_EDITION_2_TEST_ONLY_enum_value = 2 @@ -806,11 +807,13 @@ const ( FieldOptions_FeatureSupport_EditionDeprecated_field_name protoreflect.Name = "edition_deprecated" FieldOptions_FeatureSupport_DeprecationWarning_field_name protoreflect.Name = "deprecation_warning" FieldOptions_FeatureSupport_EditionRemoved_field_name protoreflect.Name = "edition_removed" + FieldOptions_FeatureSupport_RemovalError_field_name protoreflect.Name = "removal_error" FieldOptions_FeatureSupport_EditionIntroduced_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.edition_introduced" FieldOptions_FeatureSupport_EditionDeprecated_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.edition_deprecated" FieldOptions_FeatureSupport_DeprecationWarning_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.deprecation_warning" FieldOptions_FeatureSupport_EditionRemoved_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.edition_removed" + FieldOptions_FeatureSupport_RemovalError_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.removal_error" ) // Field numbers for google.protobuf.FieldOptions.FeatureSupport. @@ -819,6 +822,7 @@ const ( FieldOptions_FeatureSupport_EditionDeprecated_field_number protoreflect.FieldNumber = 2 FieldOptions_FeatureSupport_DeprecationWarning_field_number protoreflect.FieldNumber = 3 FieldOptions_FeatureSupport_EditionRemoved_field_number protoreflect.FieldNumber = 4 + FieldOptions_FeatureSupport_RemovalError_field_number protoreflect.FieldNumber = 5 ) // Names for google.protobuf.OneofOptions. @@ -1152,6 +1156,7 @@ const ( FeatureSet_ENFORCE_NAMING_STYLE_UNKNOWN_enum_value = 0 FeatureSet_STYLE2024_enum_value = 1 FeatureSet_STYLE_LEGACY_enum_value = 2 + FeatureSet_STYLE2026_enum_value = 3 ) // Names for google.protobuf.FeatureSet.VisibilityFeature. diff --git a/vendor/google.golang.org/protobuf/internal/version/version.go b/vendor/google.golang.org/protobuf/internal/version/version.go index 763fd82841c..58ff0e24644 100644 --- a/vendor/google.golang.org/protobuf/internal/version/version.go +++ b/vendor/google.golang.org/protobuf/internal/version/version.go @@ -52,7 +52,7 @@ import ( const ( Major = 1 Minor = 36 - Patch = 11 + Patch = 12 PreRelease = "" ) diff --git a/vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go b/vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go index c826ad04303..84a3228edb4 100644 --- a/vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go +++ b/vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go @@ -201,6 +201,7 @@ func (r descsByName) initExtensionDeclarations(xds []*descriptorpb.FieldDescript return nil, err } x.L1.EditionFeatures = mergeEditionFeatures(parent, xd.GetOptions().GetFeatures()) + x.L2.IsProto3Optional = xd.GetProto3Optional() if opts := xd.GetOptions(); opts != nil { opts = proto.Clone(opts).(*descriptorpb.FieldOptions) x.L2.Options = func() protoreflect.ProtoMessage { return opts } diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go index 730331e6668..86f0d092620 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go @@ -546,6 +546,8 @@ func (p *SourcePath) appendFieldOptions_FeatureSupport(b []byte) []byte { b = p.appendSingularField(b, "deprecation_warning", nil) case 4: b = p.appendSingularField(b, "edition_removed", nil) + case 5: + b = p.appendSingularField(b, "removal_error", nil) } return b } diff --git a/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go b/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go index 0b23faa957c..a51cb1e546c 100644 --- a/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go +++ b/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go @@ -1,32 +1,9 @@ // Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ +// Copyright 2008 Google LLC. All rights reserved. // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file or at +// https://developers.google.com/open-source/licenses/bsd // Author: kenton@google.com (Kenton Varda) // Based on original Protocol Buffers design by @@ -69,6 +46,7 @@ const ( // comparison. Edition_EDITION_2023 Edition = 1000 Edition_EDITION_2024 Edition = 1001 + Edition_EDITION_2026 Edition = 1002 // A placeholder edition for developing and testing unscheduled features. Edition_EDITION_UNSTABLE Edition = 9999 // Placeholder editions for testing feature resolution. These should not be @@ -93,6 +71,7 @@ var ( 999: "EDITION_PROTO3", 1000: "EDITION_2023", 1001: "EDITION_2024", + 1002: "EDITION_2026", 9999: "EDITION_UNSTABLE", 1: "EDITION_1_TEST_ONLY", 2: "EDITION_2_TEST_ONLY", @@ -108,6 +87,7 @@ var ( "EDITION_PROTO3": 999, "EDITION_2023": 1000, "EDITION_2024": 1001, + "EDITION_2026": 1002, "EDITION_UNSTABLE": 9999, "EDITION_1_TEST_ONLY": 1, "EDITION_2_TEST_ONLY": 2, @@ -1213,6 +1193,7 @@ const ( FeatureSet_ENFORCE_NAMING_STYLE_UNKNOWN FeatureSet_EnforceNamingStyle = 0 FeatureSet_STYLE2024 FeatureSet_EnforceNamingStyle = 1 FeatureSet_STYLE_LEGACY FeatureSet_EnforceNamingStyle = 2 + FeatureSet_STYLE2026 FeatureSet_EnforceNamingStyle = 3 ) // Enum value maps for FeatureSet_EnforceNamingStyle. @@ -1221,11 +1202,13 @@ var ( 0: "ENFORCE_NAMING_STYLE_UNKNOWN", 1: "STYLE2024", 2: "STYLE_LEGACY", + 3: "STYLE2026", } FeatureSet_EnforceNamingStyle_value = map[string]int32{ "ENFORCE_NAMING_STYLE_UNKNOWN": 0, "STYLE2024": 1, "STYLE_LEGACY": 2, + "STYLE2026": 3, } ) @@ -4204,8 +4187,11 @@ type FieldOptions_FeatureSupport struct { // this one, the last default assigned will be used, and proto files will // not be able to override it. EditionRemoved *Edition `protobuf:"varint,4,opt,name=edition_removed,json=editionRemoved,enum=google.protobuf.Edition" json:"edition_removed,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + // The removal error text if this feature is used after the edition it was + // removed in. + RemovalError *string `protobuf:"bytes,5,opt,name=removal_error,json=removalError" json:"removal_error,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *FieldOptions_FeatureSupport) Reset() { @@ -4266,6 +4252,13 @@ func (x *FieldOptions_FeatureSupport) GetEditionRemoved() Edition { return Edition_EDITION_UNKNOWN } +func (x *FieldOptions_FeatureSupport) GetRemovalError() string { + if x != nil && x.RemovalError != nil { + return *x.RemovalError + } + return "" +} + // The name of the uninterpreted option. Each string represents a segment in // a dot-separated name. is_extension is true iff a segment represents an // extension (denoted with parentheses in options specs in .proto files). @@ -4719,7 +4712,7 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\aoptions\x18\x03 \x01(\v2&.google.protobuf.ExtensionRangeOptionsR\aoptions\x1a7\n" + "\rReservedRange\x12\x14\n" + "\x05start\x18\x01 \x01(\x05R\x05start\x12\x10\n" + - "\x03end\x18\x02 \x01(\x05R\x03end\"\xcc\x04\n" + + "\x03end\x18\x02 \x01(\x05R\x03end\"\xd4\x04\n" + "\x15ExtensionRangeOptions\x12X\n" + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption\x12Y\n" + "\vdeclaration\x18\x02 \x03(\v22.google.protobuf.ExtensionRangeOptions.DeclarationB\x03\x88\x01\x02R\vdeclaration\x127\n" + @@ -4735,7 +4728,7 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\x11VerificationState\x12\x0f\n" + "\vDECLARATION\x10\x00\x12\x0e\n" + "\n" + - "UNVERIFIED\x10\x01*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xc1\x06\n" + + "UNVERIFIED\x10\x01*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xc1\x06\n" + "\x14FieldDescriptorProto\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n" + "\x06number\x18\x03 \x01(\x05R\x06number\x12A\n" + @@ -4810,12 +4803,13 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "outputType\x128\n" + "\aoptions\x18\x04 \x01(\v2\x1e.google.protobuf.MethodOptionsR\aoptions\x120\n" + "\x10client_streaming\x18\x05 \x01(\b:\x05falseR\x0fclientStreaming\x120\n" + - "\x10server_streaming\x18\x06 \x01(\b:\x05falseR\x0fserverStreaming\"\xad\t\n" + + "\x10server_streaming\x18\x06 \x01(\b:\x05falseR\x0fserverStreaming\"\xfa\n" + + "\n" + "\vFileOptions\x12!\n" + "\fjava_package\x18\x01 \x01(\tR\vjavaPackage\x120\n" + - "\x14java_outer_classname\x18\b \x01(\tR\x12javaOuterClassname\x125\n" + + "\x14java_outer_classname\x18\b \x01(\tR\x12javaOuterClassname\x12\xf9\x01\n" + "\x13java_multiple_files\x18\n" + - " \x01(\b:\x05falseR\x11javaMultipleFiles\x12D\n" + + " \x01(\b:\x05falseB\xc1\x01\xb2\x01\xbd\x01\b\xe6\a \xe9\a*\xb4\x01This behavior is enabled by default in editions 2024 and above. To disable it, you can set `features.(pb.java).nest_in_file_class = YES` on individual messages, enums, or services.R\x11javaMultipleFiles\x12D\n" + "\x1djava_generate_equals_and_hash\x18\x14 \x01(\bB\x02\x18\x01R\x19javaGenerateEqualsAndHash\x12:\n" + "\x16java_string_check_utf8\x18\x1b \x01(\b:\x05falseR\x13javaStringCheckUtf8\x12S\n" + "\foptimize_for\x18\t \x01(\x0e2).google.protobuf.FileOptions.OptimizeMode:\x05SPEEDR\voptimizeFor\x12\x1d\n" + @@ -4840,7 +4834,7 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\fOptimizeMode\x12\t\n" + "\x05SPEED\x10\x01\x12\r\n" + "\tCODE_SIZE\x10\x02\x12\x10\n" + - "\fLITE_RUNTIME\x10\x03*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b*\x10+J\x04\b&\x10'R\x14php_generic_services\"\xf4\x03\n" + + "\fLITE_RUNTIME\x10\x03*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b*\x10+J\x04\b&\x10'R\x14php_generic_services\"\xfc\x03\n" + "\x0eMessageOptions\x12<\n" + "\x17message_set_wire_format\x18\x01 \x01(\b:\x05falseR\x14messageSetWireFormat\x12L\n" + "\x1fno_standard_descriptor_accessor\x18\x02 \x01(\b:\x05falseR\x1cnoStandardDescriptorAccessor\x12%\n" + @@ -4850,8 +4844,8 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\tmap_entry\x18\a \x01(\bR\bmapEntry\x12V\n" + "&deprecated_legacy_json_field_conflicts\x18\v \x01(\bB\x02\x18\x01R\"deprecatedLegacyJsonFieldConflicts\x127\n" + "\bfeatures\x18\f \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12X\n" + - "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b\x04\x10\x05J\x04\b\x05\x10\x06J\x04\b\x06\x10\aJ\x04\b\b\x10\tJ\x04\b\t\x10\n" + - "\"\xa1\r\n" + + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b\x04\x10\x05J\x04\b\x05\x10\x06J\x04\b\x06\x10\aJ\x04\b\b\x10\tJ\x04\b\t\x10\n" + + "\"\xce\r\n" + "\fFieldOptions\x12A\n" + "\x05ctype\x18\x01 \x01(\x0e2#.google.protobuf.FieldOptions.CType:\x06STRINGR\x05ctype\x12\x16\n" + "\x06packed\x18\x02 \x01(\bR\x06packed\x12G\n" + @@ -4872,12 +4866,13 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption\x1aZ\n" + "\x0eEditionDefault\x122\n" + "\aedition\x18\x03 \x01(\x0e2\x18.google.protobuf.EditionR\aedition\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value\x1a\x96\x02\n" + + "\x05value\x18\x02 \x01(\tR\x05value\x1a\xbb\x02\n" + "\x0eFeatureSupport\x12G\n" + "\x12edition_introduced\x18\x01 \x01(\x0e2\x18.google.protobuf.EditionR\x11editionIntroduced\x12G\n" + "\x12edition_deprecated\x18\x02 \x01(\x0e2\x18.google.protobuf.EditionR\x11editionDeprecated\x12/\n" + "\x13deprecation_warning\x18\x03 \x01(\tR\x12deprecationWarning\x12A\n" + - "\x0fedition_removed\x18\x04 \x01(\x0e2\x18.google.protobuf.EditionR\x0eeditionRemoved\"/\n" + + "\x0fedition_removed\x18\x04 \x01(\x0e2\x18.google.protobuf.EditionR\x0eeditionRemoved\x12#\n" + + "\rremoval_error\x18\x05 \x01(\tR\fremovalError\"/\n" + "\x05CType\x12\n" + "\n" + "\x06STRING\x10\x00\x12\b\n" + @@ -4901,10 +4896,10 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\x10TARGET_TYPE_ENUM\x10\x06\x12\x1a\n" + "\x16TARGET_TYPE_ENUM_ENTRY\x10\a\x12\x17\n" + "\x13TARGET_TYPE_SERVICE\x10\b\x12\x16\n" + - "\x12TARGET_TYPE_METHOD\x10\t*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b\x04\x10\x05J\x04\b\x12\x10\x13\"\xac\x01\n" + + "\x12TARGET_TYPE_METHOD\x10\t*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b\x04\x10\x05J\x04\b\x12\x10\x13\"\xb4\x01\n" + "\fOneofOptions\x127\n" + "\bfeatures\x18\x01 \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12X\n" + - "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xd1\x02\n" + + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xd9\x02\n" + "\vEnumOptions\x12\x1f\n" + "\vallow_alias\x18\x02 \x01(\bR\n" + "allowAlias\x12%\n" + @@ -4913,7 +4908,7 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "deprecated\x12V\n" + "&deprecated_legacy_json_field_conflicts\x18\x06 \x01(\bB\x02\x18\x01R\"deprecatedLegacyJsonFieldConflicts\x127\n" + "\bfeatures\x18\a \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12X\n" + - "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b\x05\x10\x06\"\xd8\x02\n" + + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b\x05\x10\x06\"\xe0\x02\n" + "\x10EnumValueOptions\x12%\n" + "\n" + "deprecated\x18\x01 \x01(\b:\x05falseR\n" + @@ -4921,13 +4916,13 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\bfeatures\x18\x02 \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12(\n" + "\fdebug_redact\x18\x03 \x01(\b:\x05falseR\vdebugRedact\x12U\n" + "\x0ffeature_support\x18\x04 \x01(\v2,.google.protobuf.FieldOptions.FeatureSupportR\x0efeatureSupport\x12X\n" + - "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xd5\x01\n" + + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xdd\x01\n" + "\x0eServiceOptions\x127\n" + "\bfeatures\x18\" \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12%\n" + "\n" + "deprecated\x18! \x01(\b:\x05falseR\n" + "deprecated\x12X\n" + - "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\x99\x03\n" + + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xa1\x03\n" + "\rMethodOptions\x12%\n" + "\n" + "deprecated\x18! \x01(\b:\x05falseR\n" + @@ -4939,7 +4934,7 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\x13IDEMPOTENCY_UNKNOWN\x10\x00\x12\x13\n" + "\x0fNO_SIDE_EFFECTS\x10\x01\x12\x0e\n" + "\n" + - "IDEMPOTENT\x10\x02*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\x9a\x03\n" + + "IDEMPOTENT\x10\x02*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\x9a\x03\n" + "\x13UninterpretedOption\x12A\n" + "\x04name\x18\x02 \x03(\v2-.google.protobuf.UninterpretedOption.NamePartR\x04name\x12)\n" + "\x10identifier_value\x18\x03 \x01(\tR\x0fidentifierValue\x12,\n" + @@ -4950,7 +4945,7 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\x0faggregate_value\x18\b \x01(\tR\x0eaggregateValue\x1aJ\n" + "\bNamePart\x12\x1b\n" + "\tname_part\x18\x01 \x02(\tR\bnamePart\x12!\n" + - "\fis_extension\x18\x02 \x02(\bR\visExtension\"\x8e\x0f\n" + + "\fis_extension\x18\x02 \x02(\bR\visExtension\"\xae\x0f\n" + "\n" + "FeatureSet\x12\x91\x01\n" + "\x0efield_presence\x18\x01 \x01(\x0e2).google.protobuf.FeatureSet.FieldPresenceB?\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\r\x12\bEXPLICIT\x18\x84\a\xa2\x01\r\x12\bIMPLICIT\x18\xe7\a\xa2\x01\r\x12\bEXPLICIT\x18\xe8\a\xb2\x01\x03\b\xe8\aR\rfieldPresence\x12l\n" + @@ -4960,8 +4955,8 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\x10message_encoding\x18\x05 \x01(\x0e2+.google.protobuf.FeatureSet.MessageEncodingB&\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\x14\x12\x0fLENGTH_PREFIXED\x18\x84\a\xb2\x01\x03\b\xe8\aR\x0fmessageEncoding\x12\x82\x01\n" + "\vjson_format\x18\x06 \x01(\x0e2&.google.protobuf.FeatureSet.JsonFormatB9\x88\x01\x01\x98\x01\x03\x98\x01\x06\x98\x01\x01\xa2\x01\x17\x12\x12LEGACY_BEST_EFFORT\x18\x84\a\xa2\x01\n" + "\x12\x05ALLOW\x18\xe7\a\xb2\x01\x03\b\xe8\aR\n" + - "jsonFormat\x12\xab\x01\n" + - "\x14enforce_naming_style\x18\a \x01(\x0e2..google.protobuf.FeatureSet.EnforceNamingStyleBI\x88\x01\x02\x98\x01\x01\x98\x01\x02\x98\x01\x03\x98\x01\x04\x98\x01\x05\x98\x01\x06\x98\x01\a\x98\x01\b\x98\x01\t\xa2\x01\x11\x12\fSTYLE_LEGACY\x18\x84\a\xa2\x01\x0e\x12\tSTYLE2024\x18\xe9\a\xb2\x01\x03\b\xe9\aR\x12enforceNamingStyle\x12\xb9\x01\n" + + "jsonFormat\x12\xbc\x01\n" + + "\x14enforce_naming_style\x18\a \x01(\x0e2..google.protobuf.FeatureSet.EnforceNamingStyleBZ\x88\x01\x02\x98\x01\x01\x98\x01\x02\x98\x01\x03\x98\x01\x04\x98\x01\x05\x98\x01\x06\x98\x01\a\x98\x01\b\x98\x01\t\xa2\x01\x11\x12\fSTYLE_LEGACY\x18\x84\a\xa2\x01\x0e\x12\tSTYLE2024\x18\xe9\a\xa2\x01\x0e\x12\tSTYLE2026\x18\x8fN\xb2\x01\x03\b\xe9\aR\x12enforceNamingStyle\x12\xb9\x01\n" + "\x19default_symbol_visibility\x18\b \x01(\x0e2E.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibilityB6\x88\x01\x02\x98\x01\x01\xa2\x01\x0f\x12\n" + "EXPORT_ALL\x18\x84\a\xa2\x01\x15\x12\x10EXPORT_TOP_LEVEL\x18\xe9\a\xb2\x01\x03\b\xe9\aR\x17defaultSymbolVisibility\x1a\xa1\x01\n" + "\x11VisibilityFeature\"\x81\x01\n" + @@ -5001,11 +4996,12 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "JsonFormat\x12\x17\n" + "\x13JSON_FORMAT_UNKNOWN\x10\x00\x12\t\n" + "\x05ALLOW\x10\x01\x12\x16\n" + - "\x12LEGACY_BEST_EFFORT\x10\x02\"W\n" + + "\x12LEGACY_BEST_EFFORT\x10\x02\"f\n" + "\x12EnforceNamingStyle\x12 \n" + "\x1cENFORCE_NAMING_STYLE_UNKNOWN\x10\x00\x12\r\n" + "\tSTYLE2024\x10\x01\x12\x10\n" + - "\fSTYLE_LEGACY\x10\x02*\x06\b\xe8\a\x10\x8bN*\x06\b\x8bN\x10\x90N*\x06\b\x90N\x10\x91NJ\x06\b\xe7\a\x10\xe8\a\"\xef\x03\n" + + "\fSTYLE_LEGACY\x10\x02\x12\r\n" + + "\tSTYLE2026\x10\x03*\x06\b\xe8\a\x10\x8bN*\x06\b\x8bN\x10\x90N*\x06\b\x90N\x10\x91NJ\x06\b\xe7\a\x10\xe8\a\"\xef\x03\n" + "\x12FeatureSetDefaults\x12X\n" + "\bdefaults\x18\x01 \x03(\v2<.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefaultR\bdefaults\x12A\n" + "\x0fminimum_edition\x18\x04 \x01(\x0e2\x18.google.protobuf.EditionR\x0eminimumEdition\x12A\n" + @@ -5037,14 +5033,15 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\bSemantic\x12\b\n" + "\x04NONE\x10\x00\x12\a\n" + "\x03SET\x10\x01\x12\t\n" + - "\x05ALIAS\x10\x02*\xbe\x02\n" + + "\x05ALIAS\x10\x02*\xd1\x02\n" + "\aEdition\x12\x13\n" + "\x0fEDITION_UNKNOWN\x10\x00\x12\x13\n" + "\x0eEDITION_LEGACY\x10\x84\a\x12\x13\n" + "\x0eEDITION_PROTO2\x10\xe6\a\x12\x13\n" + "\x0eEDITION_PROTO3\x10\xe7\a\x12\x11\n" + "\fEDITION_2023\x10\xe8\a\x12\x11\n" + - "\fEDITION_2024\x10\xe9\a\x12\x15\n" + + "\fEDITION_2024\x10\xe9\a\x12\x11\n" + + "\fEDITION_2026\x10\xea\a\x12\x15\n" + "\x10EDITION_UNSTABLE\x10\x8fN\x12\x17\n" + "\x13EDITION_1_TEST_ONLY\x10\x01\x12\x17\n" + "\x13EDITION_2_TEST_ONLY\x10\x02\x12\x1d\n" + diff --git a/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go b/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go index 1ff0d1494d4..510894f2b0d 100644 --- a/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go +++ b/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go @@ -128,120 +128,66 @@ import ( // `Any` contains an arbitrary serialized protocol buffer message along with a // URL that describes the type of the serialized message. // -// Protobuf library provides support to pack/unpack Any values in the form -// of utility functions or additional generated methods of the Any type. -// -// Example 1: Pack and unpack a message in C++. -// -// Foo foo = ...; -// Any any; -// any.PackFrom(foo); -// ... -// if (any.UnpackTo(&foo)) { -// ... -// } -// -// Example 2: Pack and unpack a message in Java. -// -// Foo foo = ...; -// Any any = Any.pack(foo); -// ... -// if (any.is(Foo.class)) { -// foo = any.unpack(Foo.class); -// } -// // or ... -// if (any.isSameTypeAs(Foo.getDefaultInstance())) { -// foo = any.unpack(Foo.getDefaultInstance()); -// } -// -// Example 3: Pack and unpack a message in Python. -// -// foo = Foo(...) -// any = Any() -// any.Pack(foo) -// ... -// if any.Is(Foo.DESCRIPTOR): -// any.Unpack(foo) -// ... -// -// Example 4: Pack and unpack a message in Go -// -// foo := &pb.Foo{...} -// any, err := anypb.New(foo) -// if err != nil { -// ... -// } -// ... -// foo := &pb.Foo{} -// if err := any.UnmarshalTo(foo); err != nil { -// ... -// } -// -// The pack methods provided by protobuf library will by default use -// 'type.googleapis.com/full.type.name' as the type URL and the unpack -// methods only use the fully qualified type name after the last '/' -// in the type URL, for example "foo.bar.com/x/y.z" will yield type -// name "y.z". -// -// JSON -// ==== -// The JSON representation of an `Any` value uses the regular -// representation of the deserialized, embedded message, with an -// additional field `@type` which contains the type URL. Example: -// -// package google.profile; -// message Person { -// string first_name = 1; -// string last_name = 2; -// } -// -// { -// "@type": "type.googleapis.com/google.profile.Person", -// "firstName": , -// "lastName": -// } -// -// If the embedded message type is well-known and has a custom JSON -// representation, that representation will be embedded adding a field -// `value` which holds the custom JSON in addition to the `@type` -// field. Example (for message [google.protobuf.Duration][]): -// -// { -// "@type": "type.googleapis.com/google.protobuf.Duration", -// "value": "1.212s" -// } +// In its binary encoding, an `Any` is an ordinary message; but in other wire +// forms like JSON, it has a special encoding. The format of the type URL is +// described on the `type_url` field. +// +// Protobuf APIs provide utilities to interact with `Any` values: +// +// - A 'pack' operation accepts a message and constructs a generic `Any` wrapper +// around it. +// - An 'unpack' operation reads the content of an `Any` message, either into an +// existing message or a new one. Unpack operations must check the type of the +// value they unpack against the declared `type_url`. +// - An 'is' operation decides whether an `Any` contains a message of the given +// type, i.e. whether it can 'unpack' that type. +// +// The JSON format representation of an `Any` follows one of these cases: +// +// - For types without special-cased JSON encodings, the JSON format +// representation of the `Any` is the same as that of the message, with an +// additional `@type` field which contains the type URL. +// - For types with special-cased JSON encodings (typically called 'well-known' +// types, listed in https://protobuf.dev/programming-guides/json/#any), the +// JSON format representation has a key `@type` which contains the type URL +// and a key `value` which contains the JSON-serialized value. +// +// The text format representation of an `Any` is like a message with one field +// whose name is the type URL in brackets. For example, an `Any` containing a +// `foo.Bar` message may be written `[type.googleapis.com/foo.Bar] { a: 2 }`. type Any struct { state protoimpl.MessageState `protogen:"open.v1"` - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). + // Identifies the type of the serialized Protobuf message with a URI reference + // consisting of a prefix ending in a slash and the fully-qualified type name. + // + // Example: type.googleapis.com/google.protobuf.StringValue // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: + // This string must contain at least one `/` character, and the content after + // the last `/` must be the fully-qualified name of the type in canonical + // form, without a leading dot. Do not write a scheme on these URI references + // so that clients do not attempt to contact them. // - // - If no scheme is provided, `https` is assumed. - // - An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // - Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) + // The prefix is arbitrary and Protobuf implementations are expected to + // simply strip off everything up to and including the last `/` to identify + // the type. `type.googleapis.com/` is a common default prefix that some + // legacy implementations require. This prefix does not indicate the origin of + // the type, and URIs containing it are not expected to respond to any + // requests. // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. + // All type URL strings must be legal URI references with the additional + // restriction (for the text format) that the content of the reference + // must consist only of alphanumeric characters, percent-encoded escapes, and + // characters in the following set (not including the outer backticks): + // `/-.~_!$&()*+,;=`. Despite our allowing percent encodings, implementations + // should not unescape them to prevent confusion with existing parsers. For + // example, `type.googleapis.com%2FFoo` should be rejected. // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. + // In the original design of `Any`, the possibility of launching a type + // resolution service at these type URLs was considered but Protobuf never + // implemented one and considers contacting these URLs to be problematic and + // a potential security issue. Do not attempt to contact type URLs. TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"` - // Must be a valid serialized protocol buffer of the above specified type. + // Holds a Protobuf serialization of the type described by type_url. Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache diff --git a/vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go b/vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go index 91ee89a5cd9..4a0437911d9 100644 --- a/vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go +++ b/vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go @@ -197,24 +197,22 @@ import ( // An implementation may provide options to override this default behavior for // repeated and message fields. // -// In order to reset a field's value to the default, the field must -// be in the mask and set to the default value in the provided resource. -// Hence, in order to reset all fields of a resource, provide a default -// instance of the resource and set all fields in the mask, or do -// not provide a mask as described below. -// -// If a field mask is not present on update, the operation applies to -// all fields (as if a field mask of all fields has been specified). -// Note that in the presence of schema evolution, this may mean that -// fields the client does not know and has therefore not filled into -// the request will be reset to their default. If this is unwanted -// behavior, a specific service may require a client to always specify -// a field mask, producing an error if not. -// -// As with get operations, the location of the resource which -// describes the updated values in the request message depends on the -// operation kind. In any case, the effect of the field mask is -// required to be honored by the API. +// Note that libraries which implement FieldMask resolution have various +// different behaviors in the face of empty masks or the special "*" mask. +// When implementing a service you should confirm these cases have the +// appropriate behavior in the underlying FieldMask library that you desire, +// and you may need to special case those cases in your application code if +// the underlying field mask library behavior differs from your intended +// service semantics. +// +// Update methods implementing https://google.aip.dev/134 +// - MUST support the special value * meaning "full replace" +// - MUST treat an omitted field mask as "replace fields which are present". +// +// Other methods implementing https://google.aip.dev/157 +// - SHOULD support the special value "*" to mean "get all". +// - MUST treat an omitted field mask to mean "get all", unless otherwise +// documented. // // ## Considerations for HTTP REST // diff --git a/vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go b/vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go index 30411b72838..8325a504892 100644 --- a/vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go +++ b/vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go @@ -131,10 +131,15 @@ import ( unsafe "unsafe" ) -// `NullValue` is a singleton enumeration to represent the null value for the -// `Value` type union. +// Represents a JSON `null`. // -// The JSON representation for `NullValue` is JSON `null`. +// `NullValue` is a sentinel, using an enum with only one value to represent +// the null value for the `Value` type union. +// +// A field of type `NullValue` with any value other than `0` is considered +// invalid. Most ProtoJSON serializers will emit a Value with a `null_value` set +// as a JSON `null` regardless of the integer value, and so will round trip to +// a `0` value. type NullValue int32 const ( @@ -179,14 +184,19 @@ func (NullValue) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_struct_proto_rawDescGZIP(), []int{0} } -// `Struct` represents a structured data value, consisting of fields -// which map to dynamically typed values. In some languages, `Struct` -// might be supported by a native representation. For example, in -// scripting languages like JS a struct is represented as an -// object. The details of that representation are described together -// with the proto support for the language. +// Represents a JSON object. +// +// An unordered key-value map, intending to perfectly capture the semantics of a +// JSON object. This enables parsing any arbitrary JSON payload as a message +// field in ProtoJSON format. +// +// This follows RFC 8259 guidelines for interoperable JSON: notably this type +// cannot represent large Int64 values or `NaN`/`Infinity` numbers, +// since the JSON format generally does not support those values in its number +// type. // -// The JSON representation for `Struct` is JSON object. +// If you do not intend to parse arbitrary JSON into your message, a custom +// typed message should be preferred instead of using this type. type Struct struct { state protoimpl.MessageState `protogen:"open.v1"` // Unordered map of dynamically typed values. @@ -269,12 +279,12 @@ func (x *Struct) GetFields() map[string]*Value { return nil } +// Represents a JSON value. +// // `Value` represents a dynamically typed value which can be either // null, a number, a string, a boolean, a recursive struct value, or a // list of values. A producer of value is expected to set one of these -// variants. Absence of any variant indicates an error. -// -// The JSON representation for `Value` is JSON value. +// variants. Absence of any variant is an invalid state. type Value struct { state protoimpl.MessageState `protogen:"open.v1"` // The kind of value. @@ -548,32 +558,35 @@ type isValue_Kind interface { } type Value_NullValue struct { - // Represents a null value. + // Represents a JSON `null`. NullValue NullValue `protobuf:"varint,1,opt,name=null_value,json=nullValue,proto3,enum=google.protobuf.NullValue,oneof"` } type Value_NumberValue struct { - // Represents a double value. + // Represents a JSON number. Must not be `NaN`, `Infinity` or + // `-Infinity`, since those are not supported in JSON. This also cannot + // represent large Int64 values, since JSON format generally does not + // support them in its number type. NumberValue float64 `protobuf:"fixed64,2,opt,name=number_value,json=numberValue,proto3,oneof"` } type Value_StringValue struct { - // Represents a string value. + // Represents a JSON string. StringValue string `protobuf:"bytes,3,opt,name=string_value,json=stringValue,proto3,oneof"` } type Value_BoolValue struct { - // Represents a boolean value. + // Represents a JSON boolean (`true` or `false` literal in JSON). BoolValue bool `protobuf:"varint,4,opt,name=bool_value,json=boolValue,proto3,oneof"` } type Value_StructValue struct { - // Represents a structured value. + // Represents a JSON object. StructValue *Struct `protobuf:"bytes,5,opt,name=struct_value,json=structValue,proto3,oneof"` } type Value_ListValue struct { - // Represents a repeated `Value`. + // Represents a JSON array. ListValue *ListValue `protobuf:"bytes,6,opt,name=list_value,json=listValue,proto3,oneof"` } @@ -589,9 +602,7 @@ func (*Value_StructValue) isValue_Kind() {} func (*Value_ListValue) isValue_Kind() {} -// `ListValue` is a wrapper around a repeated field of values. -// -// The JSON representation for `ListValue` is JSON array. +// Represents a JSON array. type ListValue struct { state protoimpl.MessageState `protogen:"open.v1"` // Repeated field of dynamically typed values. diff --git a/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go b/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go index 484c21fd536..2cd60946cf0 100644 --- a/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go +++ b/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go @@ -153,8 +153,8 @@ import ( // {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional // seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), // are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone -// is required. A proto3 JSON serializer should always use UTC (as indicated by -// "Z") when printing the Timestamp type and a proto3 JSON parser should be +// is required. A ProtoJSON serializer should always use UTC (as indicated by +// "Z") when printing the Timestamp type and a ProtoJSON parser should be // able to accept both UTC and other timezones (as indicated by an offset). // // For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past @@ -173,7 +173,7 @@ import ( type Timestamp struct { state protoimpl.MessageState `protogen:"open.v1"` // Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must - // be between -315576000000 and 315576000000 inclusive (which corresponds to + // be between -62135596800 and 253402300799 inclusive (which corresponds to // 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z). Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"` // Non-negative fractions of a second at nanosecond resolution. This field is diff --git a/vendor/gopkg.in/ini.v1/key.go b/vendor/gopkg.in/ini.v1/key.go index b1ef5c96d7f..800d04a473b 100644 --- a/vendor/gopkg.in/ini.v1/key.go +++ b/vendor/gopkg.in/ini.v1/key.go @@ -15,12 +15,12 @@ package ini import ( - "bytes" "errors" "fmt" "strconv" "strings" "time" + "unicode/utf8" ) // Key represents a key under a section. @@ -495,31 +495,38 @@ func (k *Key) Strings(delim string) []string { return []string{} } - runes := []rune(str) - vals := make([]string, 0, 2) - var buf bytes.Buffer - escape := false - idx := 0 + maxParts := strings.Count(str, delim) + 1 + vals := make([]string, 0, maxParts) + + var buf strings.Builder + buf.Grow(len(str)) + + i := 0 for { - if escape { - escape = false - if runes[idx] != '\\' && !strings.HasPrefix(string(runes[idx:]), delim) { + if str[i] == '\\' { + i++ + if i >= len(str) { + break + } + + if str[i] != '\\' && !strings.HasPrefix(str[i:], delim) { buf.WriteRune('\\') } - buf.WriteRune(runes[idx]) + + r, size := utf8.DecodeRuneInString(str[i:]) + i += size + buf.WriteRune(r) + } else if strings.HasPrefix(str[i:], delim) { + i += len(delim) + vals = append(vals, strings.TrimSpace(buf.String())) + buf.Reset() } else { - if runes[idx] == '\\' { - escape = true - } else if strings.HasPrefix(string(runes[idx:]), delim) { - idx += len(delim) - 1 - vals = append(vals, strings.TrimSpace(buf.String())) - buf.Reset() - } else { - buf.WriteRune(runes[idx]) - } + r, size := utf8.DecodeRuneInString(str[i:]) + i += size + buf.WriteRune(r) } - idx++ - if idx == len(runes) { + + if i >= len(str) { break } } diff --git a/vendor/modules.txt b/vendor/modules.txt index 9375d1824b6..4a7f153a5bb 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,14 +1,14 @@ # cel.dev/expr v0.25.2 ## explicit; go 1.23.0 cel.dev/expr -# cloud.google.com/go v0.121.6 -## explicit; go 1.23.0 +# cloud.google.com/go v0.123.0 +## explicit; go 1.24.0 cloud.google.com/go/internal cloud.google.com/go/internal/optional cloud.google.com/go/internal/trace cloud.google.com/go/internal/version -# cloud.google.com/go/auth v0.18.2 -## explicit; go 1.24.0 +# cloud.google.com/go/auth v0.20.0 +## explicit; go 1.25.0 cloud.google.com/go/auth cloud.google.com/go/auth/credentials cloud.google.com/go/auth/credentials/idtoken @@ -35,12 +35,12 @@ cloud.google.com/go/auth/oauth2adapt # cloud.google.com/go/compute/metadata v0.9.0 ## explicit; go 1.24.0 cloud.google.com/go/compute/metadata -# cloud.google.com/go/iam v1.5.3 -## explicit; go 1.24.0 +# cloud.google.com/go/iam v1.11.0 +## explicit; go 1.25.0 cloud.google.com/go/iam cloud.google.com/go/iam/apiv1/iampb -# cloud.google.com/go/monitoring v1.24.3 -## explicit; go 1.24.0 +# cloud.google.com/go/monitoring v1.29.0 +## explicit; go 1.25.0 cloud.google.com/go/monitoring/apiv3/v2 cloud.google.com/go/monitoring/apiv3/v2/monitoringpb cloud.google.com/go/monitoring/internal @@ -128,7 +128,7 @@ github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/shared github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/version github.com/AzureAD/microsoft-authentication-library-for-go/apps/managedidentity github.com/AzureAD/microsoft-authentication-library-for-go/apps/public -# github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.33.0 +# github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.34.0 ## explicit; go 1.25.0 github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp # github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.53.0 @@ -152,7 +152,7 @@ github.com/alecthomas/kingpin/v2 # github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b ## explicit; go 1.15 github.com/alecthomas/units -# github.com/alicebob/miniredis/v2 v2.38.0 +# github.com/alicebob/miniredis/v2 v2.40.0 ## explicit; go 1.17 github.com/alicebob/miniredis/v2 github.com/alicebob/miniredis/v2/fpconv @@ -173,7 +173,7 @@ github.com/andybalholm/brotli/matchfinder # github.com/armon/go-metrics v0.4.1 ## explicit; go 1.12 github.com/armon/go-metrics -# github.com/aws/aws-sdk-go-v2 v1.43.2 +# github.com/aws/aws-sdk-go-v2 v1.47.3 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/aws github.com/aws/aws-sdk-go-v2/aws/defaults @@ -199,11 +199,12 @@ github.com/aws/aws-sdk-go-v2/internal/shareddefaults github.com/aws/aws-sdk-go-v2/internal/strings github.com/aws/aws-sdk-go-v2/internal/sync/singleflight github.com/aws/aws-sdk-go-v2/internal/timeconv -# github.com/aws/aws-sdk-go-v2/config v1.32.33 +github.com/aws/aws-sdk-go-v2/internal/timeouts +# github.com/aws/aws-sdk-go-v2/config v1.33.9 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/config github.com/aws/aws-sdk-go-v2/config/internal/ini -# github.com/aws/aws-sdk-go-v2/credentials v1.19.32 +# github.com/aws/aws-sdk-go-v2/credentials v1.20.9 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/credentials github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds @@ -213,37 +214,38 @@ 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 v1.18.33 +# github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.3 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/feature/ec2/imds github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config -# github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.33 +# github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/internal/configsources -# github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.33 +# github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 -# github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.34 +# github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/internal/v4a github.com/aws/aws-sdk-go-v2/internal/v4a/internal/crypto github.com/aws/aws-sdk-go-v2/internal/v4a/internal/v4 -# github.com/aws/aws-sdk-go-v2/service/dynamodb v1.59.1 +# github.com/aws/aws-sdk-go-v2/service/dynamodb v1.70.3 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/service/dynamodb github.com/aws/aws-sdk-go-v2/service/dynamodb/internal/customizations github.com/aws/aws-sdk-go-v2/service/dynamodb/internal/endpoints +github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas github.com/aws/aws-sdk-go-v2/service/dynamodb/types -# github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.14 +# github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding -# github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.12.6 +# github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.13.6 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery -# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.33 +# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/service/internal/presigned-url -# github.com/aws/aws-sdk-go-v2/service/signin v1.5.2 +# github.com/aws/aws-sdk-go-v2/service/signin v1.10.4 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/service/signin github.com/aws/aws-sdk-go-v2/service/signin/internal/endpoints @@ -253,28 +255,30 @@ github.com/aws/aws-sdk-go-v2/service/signin/types github.com/aws/aws-sdk-go-v2/service/sns github.com/aws/aws-sdk-go-v2/service/sns/internal/endpoints github.com/aws/aws-sdk-go-v2/service/sns/types -# github.com/aws/aws-sdk-go-v2/service/sso v1.33.2 +# github.com/aws/aws-sdk-go-v2/service/sso v1.38.4 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/service/sso github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints github.com/aws/aws-sdk-go-v2/service/sso/types -# github.com/aws/aws-sdk-go-v2/service/ssooidc v1.38.2 +# github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.4 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/service/ssooidc github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints github.com/aws/aws-sdk-go-v2/service/ssooidc/types -# github.com/aws/aws-sdk-go-v2/service/sts v1.45.2 +# github.com/aws/aws-sdk-go-v2/service/sts v1.51.4 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/service/sts github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints github.com/aws/aws-sdk-go-v2/service/sts/types -# github.com/aws/smithy-go v1.27.5 +# github.com/aws/smithy-go v1.28.5 ## explicit; go 1.24 github.com/aws/smithy-go github.com/aws/smithy-go/auth github.com/aws/smithy-go/auth/bearer github.com/aws/smithy-go/context github.com/aws/smithy-go/document +github.com/aws/smithy-go/document/internal/serde +github.com/aws/smithy-go/document/json github.com/aws/smithy-go/encoding github.com/aws/smithy-go/encoding/httpbinding github.com/aws/smithy-go/encoding/json @@ -283,11 +287,16 @@ github.com/aws/smithy-go/endpoints github.com/aws/smithy-go/endpoints/private/bdd github.com/aws/smithy-go/endpoints/private/rulesfn github.com/aws/smithy-go/eventstream +github.com/aws/smithy-go/internal/errors +github.com/aws/smithy-go/internal/eventstream +github.com/aws/smithy-go/internal/serde +github.com/aws/smithy-go/internal/sync github.com/aws/smithy-go/internal/sync/singleflight github.com/aws/smithy-go/io github.com/aws/smithy-go/logging github.com/aws/smithy-go/metrics github.com/aws/smithy-go/middleware +github.com/aws/smithy-go/prelude github.com/aws/smithy-go/private/requestcompression github.com/aws/smithy-go/ptr github.com/aws/smithy-go/rand @@ -297,8 +306,11 @@ github.com/aws/smithy-go/tracing github.com/aws/smithy-go/traits github.com/aws/smithy-go/transport/http github.com/aws/smithy-go/transport/http/internal/io +github.com/aws/smithy-go/transport/http/protocol/awsjson +github.com/aws/smithy-go/transport/http/protocol/internal/json +github.com/aws/smithy-go/transport/http/protocol/internal/json/internal/stdlib github.com/aws/smithy-go/waiter -# github.com/axiomhq/hyperloglog v0.2.6 +# github.com/axiomhq/hyperloglog v0.3.0 ## explicit; go 1.23 github.com/axiomhq/hyperloglog # github.com/baidubce/bce-sdk-go v0.9.230 @@ -374,8 +386,8 @@ github.com/dgryski/go-rendezvous # github.com/docker/go-units v0.5.0 ## explicit github.com/docker/go-units -# github.com/dustin/go-humanize v1.0.1 -## explicit; go 1.16 +# github.com/dustin/go-humanize v1.1.0 +## explicit; go 1.21 github.com/dustin/go-humanize # github.com/edsrzf/mmap-go v1.2.0 ## explicit; go 1.17 @@ -412,6 +424,7 @@ github.com/envoyproxy/go-control-plane/envoy/config/trace/v3 github.com/envoyproxy/go-control-plane/envoy/data/accesslog/v3 github.com/envoyproxy/go-control-plane/envoy/extensions/clusters/aggregate/v3 github.com/envoyproxy/go-control-plane/envoy/extensions/filters/common/fault/v3 +github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3 github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/fault/v3 github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/gcp_authn/v3 github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/rbac/v3 @@ -427,6 +440,7 @@ github.com/envoyproxy/go-control-plane/envoy/extensions/rbac/audit_loggers/strea github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/http_11_proxy/v3 github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/tls/v3 github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3 +github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3 github.com/envoyproxy/go-control-plane/envoy/service/load_stats/v3 github.com/envoyproxy/go-control-plane/envoy/service/status/v3 github.com/envoyproxy/go-control-plane/envoy/type/http/v3 @@ -450,8 +464,8 @@ github.com/fatih/faillint/faillint # github.com/felixge/fgprof v0.9.5 ## explicit; go 1.14 github.com/felixge/fgprof -# github.com/felixge/httpsnoop v1.0.4 -## explicit; go 1.13 +# github.com/felixge/httpsnoop v1.1.0 +## explicit; go 1.25 github.com/felixge/httpsnoop # github.com/fsnotify/fsnotify v1.10.1 ## explicit; go 1.23 @@ -488,8 +502,8 @@ github.com/go-openapi/analysis/internal/flatten/operations github.com/go-openapi/analysis/internal/flatten/replace github.com/go-openapi/analysis/internal/flatten/schutils github.com/go-openapi/analysis/internal/flatten/sortref -# github.com/go-openapi/errors v0.22.8 -## explicit; go 1.25.0 +# github.com/go-openapi/errors v0.22.9 +## explicit; go 1.26.0 github.com/go-openapi/errors # github.com/go-openapi/jsonpointer v1.0.0 ## explicit; go 1.25.0 @@ -523,8 +537,8 @@ github.com/go-openapi/runtime/server-middleware/negotiate/header # github.com/go-openapi/spec v0.22.9 ## explicit; go 1.25.0 github.com/go-openapi/spec -# github.com/go-openapi/strfmt v0.27.0 -## explicit; go 1.25.0 +# github.com/go-openapi/strfmt v0.27.3 +## explicit; go 1.26.0 github.com/go-openapi/strfmt github.com/go-openapi/strfmt/internal/bsonlite github.com/go-openapi/strfmt/internal/countries @@ -534,14 +548,14 @@ github.com/go-openapi/swag # github.com/go-openapi/swag/cmdutils v0.28.0 ## explicit; go 1.25.0 github.com/go-openapi/swag/cmdutils -# github.com/go-openapi/swag/conv v0.28.0 -## explicit; go 1.25.0 +# github.com/go-openapi/swag/conv v0.29.2 +## explicit; go 1.26.0 github.com/go-openapi/swag/conv # github.com/go-openapi/swag/fileutils v0.28.0 ## explicit; go 1.25.0 github.com/go-openapi/swag/fileutils -# github.com/go-openapi/swag/jsonutils v0.28.0 -## explicit; go 1.25.0 +# github.com/go-openapi/swag/jsonutils v0.29.2 +## explicit; go 1.26.0 github.com/go-openapi/swag/jsonutils github.com/go-openapi/swag/jsonutils/adapters github.com/go-openapi/swag/jsonutils/adapters/ifaces @@ -555,14 +569,14 @@ github.com/go-openapi/swag/mangling # github.com/go-openapi/swag/netutils v0.28.0 ## explicit; go 1.25.0 github.com/go-openapi/swag/netutils -# github.com/go-openapi/swag/pools v0.28.0 -## explicit; go 1.25.0 +# github.com/go-openapi/swag/pools v0.29.2 +## explicit; go 1.26.0 github.com/go-openapi/swag/pools # github.com/go-openapi/swag/stringutils v0.28.0 ## explicit; go 1.25.0 github.com/go-openapi/swag/stringutils -# github.com/go-openapi/swag/typeutils v0.28.0 -## explicit; go 1.25.0 +# github.com/go-openapi/swag/typeutils v0.29.2 +## explicit; go 1.26.0 github.com/go-openapi/swag/typeutils # github.com/go-openapi/swag/yamlutils v0.28.0 ## explicit; go 1.25.0 @@ -594,8 +608,8 @@ github.com/gobwas/glob/syntax/ast github.com/gobwas/glob/syntax/lexer github.com/gobwas/glob/util/runes github.com/gobwas/glob/util/strings -# github.com/gofrs/flock v0.13.0 -## explicit; go 1.24.0 +# github.com/gofrs/flock v0.13.1 +## explicit; go 1.25.0 github.com/gofrs/flock # github.com/gogo/googleapis v1.4.1 ## explicit; go 1.12 @@ -614,8 +628,8 @@ github.com/gogo/status # github.com/golang-jwt/jwt/v5 v5.3.1 ## explicit; go 1.21 github.com/golang-jwt/jwt/v5 -# github.com/golang-migrate/migrate/v4 v4.19.1 -## explicit; go 1.24.0 +# github.com/golang-migrate/migrate/v4 v4.20.1 +## explicit; go 1.25.11 github.com/golang-migrate/migrate/v4 github.com/golang-migrate/migrate/v4/database github.com/golang-migrate/migrate/v4/database/multistmt @@ -679,12 +693,12 @@ github.com/google/s2a-go/stream # github.com/google/uuid v1.6.0 ## explicit github.com/google/uuid -# github.com/googleapis/enterprise-certificate-proxy v0.3.11 -## explicit; go 1.24.0 +# github.com/googleapis/enterprise-certificate-proxy v0.3.17 +## explicit; go 1.25.0 github.com/googleapis/enterprise-certificate-proxy/client github.com/googleapis/enterprise-certificate-proxy/client/util -# github.com/googleapis/gax-go/v2 v2.17.0 -## explicit; go 1.24.0 +# github.com/googleapis/gax-go/v2 v2.22.0 +## explicit; go 1.25.0 github.com/googleapis/gax-go/v2 github.com/googleapis/gax-go/v2/apierror github.com/googleapis/gax-go/v2/apierror/internal/proto @@ -709,13 +723,13 @@ github.com/grpc-ecosystem/go-grpc-middleware github.com/grpc-ecosystem/go-grpc-middleware/v2 github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/logging -# github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 +# github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 ## explicit; go 1.25.0 github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule github.com/grpc-ecosystem/grpc-gateway/v2/runtime github.com/grpc-ecosystem/grpc-gateway/v2/utilities -# github.com/hashicorp/consul/api v1.34.3 -## explicit; go 1.26 +# github.com/hashicorp/consul/api v1.34.5 +## explicit; go 1.26.7 github.com/hashicorp/consul/api # github.com/hashicorp/errwrap v1.1.0 ## explicit @@ -732,6 +746,7 @@ github.com/hashicorp/go-immutable-radix # github.com/hashicorp/go-metrics v0.6.0 ## explicit; go 1.25 github.com/hashicorp/go-metrics +github.com/hashicorp/go-metrics/compat github.com/hashicorp/go-metrics/prometheus # github.com/hashicorp/go-msgpack v0.5.5 ## explicit @@ -748,7 +763,7 @@ github.com/hashicorp/go-sockaddr # github.com/hashicorp/go-version v1.9.0 ## explicit github.com/hashicorp/go-version -# github.com/hashicorp/golang-lru v0.6.0 +# github.com/hashicorp/golang-lru v1.0.2 ## explicit; go 1.12 github.com/hashicorp/golang-lru/simplelru # github.com/hashicorp/golang-lru/v2 v2.0.7 @@ -760,8 +775,8 @@ github.com/hashicorp/golang-lru/v2/simplelru # github.com/hashicorp/memberlist v0.6.0 => github.com/grafana/memberlist v0.3.1-0.20220714140823-09ffed8adbbe ## explicit; go 1.12 github.com/hashicorp/memberlist -# github.com/hashicorp/serf v0.10.1 -## explicit; go 1.12 +# github.com/hashicorp/serf v0.10.4 +## explicit; go 1.25.0 github.com/hashicorp/serf/coordinate # github.com/huaweicloud/huaweicloud-sdk-go-obs v3.25.4+incompatible ## explicit @@ -781,8 +796,8 @@ github.com/julienschmidt/httprouter # github.com/kamstrup/intmap v0.5.2 ## explicit; go 1.23 github.com/kamstrup/intmap -# github.com/klauspost/compress v1.19.1 -## explicit; go 1.24 +# github.com/klauspost/compress v1.20.3 +## explicit; go 1.25 github.com/klauspost/compress github.com/klauspost/compress/flate github.com/klauspost/compress/fse @@ -795,14 +810,15 @@ github.com/klauspost/compress/huff0 github.com/klauspost/compress/internal/cpuinfo github.com/klauspost/compress/internal/le github.com/klauspost/compress/internal/race +github.com/klauspost/compress/internal/regmask github.com/klauspost/compress/internal/snapref github.com/klauspost/compress/s2 github.com/klauspost/compress/snappy github.com/klauspost/compress/zlib github.com/klauspost/compress/zstd github.com/klauspost/compress/zstd/internal/xxhash -# github.com/klauspost/cpuid/v2 v2.2.11 -## explicit; go 1.22 +# github.com/klauspost/cpuid/v2 v2.4.0 +## explicit; go 1.24.0 github.com/klauspost/cpuid/v2 # github.com/klauspost/crc32 v1.3.0 ## explicit; go 1.23.0 @@ -835,11 +851,11 @@ github.com/lib/pq/internal/pqutil github.com/lib/pq/internal/proto github.com/lib/pq/oid github.com/lib/pq/scram -# github.com/mattn/go-colorable v0.1.14 +# github.com/mattn/go-colorable v0.1.15 ## explicit; go 1.18 github.com/mattn/go-colorable -# github.com/mattn/go-isatty v0.0.20 -## explicit; go 1.15 +# github.com/mattn/go-isatty v0.0.22 +## explicit; go 1.21 github.com/mattn/go-isatty # github.com/mdlayher/socket v0.6.0 ## explicit; go 1.25.0 @@ -859,8 +875,8 @@ github.com/minio/crc64nvme # github.com/minio/md5-simd v1.1.2 ## explicit; go 1.14 github.com/minio/md5-simd -# github.com/minio/minio-go/v7 v7.2.1 -## explicit; go 1.25.0 +# github.com/minio/minio-go/v7 v7.4.1 +## explicit; go 1.26.0 github.com/minio/minio-go/v7 github.com/minio/minio-go/v7/pkg/cors github.com/minio/minio-go/v7/pkg/credentials @@ -868,6 +884,7 @@ github.com/minio/minio-go/v7/pkg/encrypt github.com/minio/minio-go/v7/pkg/kvcache github.com/minio/minio-go/v7/pkg/lifecycle github.com/minio/minio-go/v7/pkg/notification +github.com/minio/minio-go/v7/pkg/policy github.com/minio/minio-go/v7/pkg/replication github.com/minio/minio-go/v7/pkg/s3utils github.com/minio/minio-go/v7/pkg/set @@ -963,7 +980,7 @@ github.com/parquet-go/bitpack/unsafecast # github.com/parquet-go/jsonlite v1.0.0 ## explicit; go 1.23 github.com/parquet-go/jsonlite -# github.com/parquet-go/parquet-go v0.30.1 +# github.com/parquet-go/parquet-go v0.32.0 ## explicit; go 1.24.9 github.com/parquet-go/parquet-go github.com/parquet-go/parquet-go/bloom @@ -1018,9 +1035,6 @@ github.com/planetscale/vtprotobuf/types/known/emptypb github.com/planetscale/vtprotobuf/types/known/structpb github.com/planetscale/vtprotobuf/types/known/timestamppb github.com/planetscale/vtprotobuf/types/known/wrapperspb -# github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 -## explicit -github.com/pmezard/go-difflib/difflib # github.com/prometheus-community/parquet-common v0.0.0-20260614025832-5f32460b5373 ## explicit; go 1.24.0 github.com/prometheus-community/parquet-common/convert @@ -1118,8 +1132,8 @@ github.com/prometheus/client_golang/prometheus/testutil/promlint/validations ## explicit; go 1.24.0 github.com/prometheus/client_golang/exp/api/remote github.com/prometheus/client_golang/exp/internal/github.com/efficientgo/core/backoff -# github.com/prometheus/client_model v0.6.2 -## explicit; go 1.22.0 +# github.com/prometheus/client_model v0.6.3 +## explicit; go 1.23 github.com/prometheus/client_model/go # github.com/prometheus/common v0.70.1 ## explicit; go 1.25.0 @@ -1239,8 +1253,8 @@ github.com/seiflotfy/cuckoofilter # github.com/sercand/kuberesolver/v5 v5.1.1 ## explicit; go 1.18 github.com/sercand/kuberesolver/v5 -# github.com/sirupsen/logrus v1.9.4 -## explicit; go 1.17 +# github.com/sirupsen/logrus v1.10.2 +## explicit; go 1.23 github.com/sirupsen/logrus # github.com/soheilhy/cmux v0.1.5 ## explicit; go 1.11 @@ -1253,7 +1267,7 @@ github.com/sony/gobreaker github.com/spf13/afero github.com/spf13/afero/internal/common github.com/spf13/afero/mem -# github.com/spiffe/go-spiffe/v2 v2.7.0 +# github.com/spiffe/go-spiffe/v2 v2.8.1 ## explicit; go 1.24.0 github.com/spiffe/go-spiffe/v2/bundle/jwtbundle github.com/spiffe/go-spiffe/v2/bundle/spiffebundle @@ -1264,13 +1278,15 @@ github.com/spiffe/go-spiffe/v2/internal/jwtutil github.com/spiffe/go-spiffe/v2/internal/pemutil github.com/spiffe/go-spiffe/v2/internal/x509util github.com/spiffe/go-spiffe/v2/spiffeid -# github.com/stretchr/objx v0.5.2 +# github.com/stretchr/objx v0.5.3 ## explicit; go 1.20 github.com/stretchr/objx -# github.com/stretchr/testify v1.11.1 +# github.com/stretchr/testify v1.12.1 ## explicit; go 1.17 github.com/stretchr/testify/assert github.com/stretchr/testify/assert/yaml +github.com/stretchr/testify/internal/difflib +github.com/stretchr/testify/internal/spew github.com/stretchr/testify/mock github.com/stretchr/testify/require # github.com/tencentyun/cos-go-sdk-v5 v0.7.66 @@ -1379,7 +1395,7 @@ github.com/thanos-io/thanos/pkg/tracing/interceptors github.com/thanos-io/thanos/pkg/tracing/migration github.com/thanos-io/thanos/pkg/tracing/tracing_middleware github.com/thanos-io/thanos/pkg/tracing/util/metautils -# github.com/tinylib/msgp v1.6.1 +# github.com/tinylib/msgp v1.6.4 ## explicit; go 1.24 github.com/tinylib/msgp/msgp github.com/tinylib/msgp/msgp/setof @@ -1530,11 +1546,11 @@ go.opentelemetry.io/collector/confmap/xconfmap ## explicit; go 1.24.0 go.opentelemetry.io/collector/consumer go.opentelemetry.io/collector/consumer/internal -# go.opentelemetry.io/collector/featuregate v1.61.0 -## explicit; go 1.25.0 +# go.opentelemetry.io/collector/featuregate v1.69.0 +## explicit; go 1.26.0 go.opentelemetry.io/collector/featuregate -# go.opentelemetry.io/collector/pdata v1.61.0 -## explicit; go 1.25.0 +# go.opentelemetry.io/collector/pdata v1.69.0 +## explicit; go 1.26.0 go.opentelemetry.io/collector/pdata/internal go.opentelemetry.io/collector/pdata/internal/json go.opentelemetry.io/collector/pdata/internal/metadata @@ -1560,15 +1576,15 @@ go.opentelemetry.io/collector/semconv/v1.6.1 # go.opentelemetry.io/contrib/detectors/gcp v1.44.0 ## explicit; go 1.25.0 go.opentelemetry.io/contrib/detectors/gcp -# go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 -## explicit; go 1.23.0 +# go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.70.0 +## explicit; go 1.25.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal # go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.69.0 ## explicit; go 1.25.0 go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace/internal/semconv -# go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0 +# go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0 ## explicit; go 1.25.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request @@ -1576,8 +1592,8 @@ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv # go.opentelemetry.io/contrib/propagators/autoprop v0.61.0 ## explicit; go 1.23.0 go.opentelemetry.io/contrib/propagators/autoprop -# go.opentelemetry.io/contrib/propagators/aws v1.44.0 -## explicit; go 1.25.0 +# go.opentelemetry.io/contrib/propagators/aws v1.47.0 +## explicit; go 1.26.0 go.opentelemetry.io/contrib/propagators/aws/xray # go.opentelemetry.io/contrib/propagators/b3 v1.36.0 ## explicit; go 1.23.0 @@ -1588,8 +1604,8 @@ go.opentelemetry.io/contrib/propagators/jaeger # go.opentelemetry.io/contrib/propagators/ot v1.36.0 ## explicit; go 1.23.0 go.opentelemetry.io/contrib/propagators/ot -# go.opentelemetry.io/otel v1.45.0 -## explicit; go 1.25.0 +# go.opentelemetry.io/otel v1.47.0 +## explicit; go 1.26.0 go.opentelemetry.io/otel go.opentelemetry.io/otel/attribute go.opentelemetry.io/otel/attribute/internal @@ -1600,26 +1616,30 @@ go.opentelemetry.io/otel/internal/baggage go.opentelemetry.io/otel/internal/errorhandler go.opentelemetry.io/otel/internal/global go.opentelemetry.io/otel/propagation +go.opentelemetry.io/otel/propagation/internal/hextable go.opentelemetry.io/otel/semconv/internal/metricpool go.opentelemetry.io/otel/semconv/v1.17.0 go.opentelemetry.io/otel/semconv/v1.21.0 go.opentelemetry.io/otel/semconv/v1.24.0 -go.opentelemetry.io/otel/semconv/v1.30.0 go.opentelemetry.io/otel/semconv/v1.37.0 +go.opentelemetry.io/otel/semconv/v1.37.0/rpcconv go.opentelemetry.io/otel/semconv/v1.41.0 go.opentelemetry.io/otel/semconv/v1.41.0/httpconv go.opentelemetry.io/otel/semconv/v1.41.0/otelconv go.opentelemetry.io/otel/semconv/v1.43.0 -# go.opentelemetry.io/otel/bridge/opentracing v1.45.0 -## explicit; go 1.25.0 +go.opentelemetry.io/otel/semconv/v1.43.0/httpconv +go.opentelemetry.io/otel/semconv/v1.43.0/otelconv +go.opentelemetry.io/otel/semconv/v1.43.0/rpcconv +# go.opentelemetry.io/otel/bridge/opentracing v1.47.0 +## explicit; go 1.26.0 go.opentelemetry.io/otel/bridge/opentracing go.opentelemetry.io/otel/bridge/opentracing/migration -# go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.44.0 -## explicit; go 1.25.0 +# go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 +## explicit; go 1.26.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform -# go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.44.0 -## explicit; go 1.25.0 +# go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.47.0 +## explicit; go 1.26.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/counter @@ -1638,44 +1658,50 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/observ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/retry go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/x -# go.opentelemetry.io/otel/metric v1.45.0 -## explicit; go 1.25.0 +# go.opentelemetry.io/otel/log v1.47.0 +## explicit; go 1.26.0 +go.opentelemetry.io/otel/log +go.opentelemetry.io/otel/log/embedded +# go.opentelemetry.io/otel/metric v1.47.0 +## explicit; go 1.26.0 go.opentelemetry.io/otel/metric go.opentelemetry.io/otel/metric/embedded go.opentelemetry.io/otel/metric/noop -# go.opentelemetry.io/otel/sdk v1.44.0 -## explicit; go 1.25.0 +# go.opentelemetry.io/otel/sdk v1.47.0 +## explicit; go 1.26.0 go.opentelemetry.io/otel/sdk go.opentelemetry.io/otel/sdk/instrumentation +go.opentelemetry.io/otel/sdk/internal/attrnorm go.opentelemetry.io/otel/sdk/internal/x go.opentelemetry.io/otel/sdk/resource go.opentelemetry.io/otel/sdk/trace go.opentelemetry.io/otel/sdk/trace/internal/env go.opentelemetry.io/otel/sdk/trace/internal/observ go.opentelemetry.io/otel/sdk/trace/tracetest -# go.opentelemetry.io/otel/sdk/metric v1.44.0 -## explicit; go 1.25.0 +# go.opentelemetry.io/otel/sdk/metric v1.47.0 +## explicit; go 1.26.0 go.opentelemetry.io/otel/sdk/metric go.opentelemetry.io/otel/sdk/metric/exemplar go.opentelemetry.io/otel/sdk/metric/internal go.opentelemetry.io/otel/sdk/metric/internal/aggregate +go.opentelemetry.io/otel/sdk/metric/internal/attrnorm +go.opentelemetry.io/otel/sdk/metric/internal/finish go.opentelemetry.io/otel/sdk/metric/internal/observ go.opentelemetry.io/otel/sdk/metric/internal/reservoir -go.opentelemetry.io/otel/sdk/metric/internal/x go.opentelemetry.io/otel/sdk/metric/metricdata -# go.opentelemetry.io/otel/trace v1.45.0 -## explicit; go 1.25.0 +# go.opentelemetry.io/otel/trace v1.47.0 +## explicit; go 1.26.0 go.opentelemetry.io/otel/trace go.opentelemetry.io/otel/trace/embedded go.opentelemetry.io/otel/trace/internal/telemetry go.opentelemetry.io/otel/trace/noop -# go.opentelemetry.io/proto/otlp v1.10.0 -## explicit; go 1.24.0 +# go.opentelemetry.io/proto/otlp v1.11.0 +## explicit; go 1.25.0 go.opentelemetry.io/proto/otlp/collector/trace/v1 go.opentelemetry.io/proto/otlp/common/v1 go.opentelemetry.io/proto/otlp/resource/v1 go.opentelemetry.io/proto/otlp/trace/v1 -# go.uber.org/atomic v1.11.0 +# go.uber.org/atomic v1.12.0 ## explicit; go 1.18 go.uber.org/atomic # go.uber.org/automaxprocs v1.6.0 @@ -1706,11 +1732,11 @@ go.uber.org/zap/zapgrpc # go.yaml.in/yaml/v2 v2.4.4 ## explicit; go 1.15 go.yaml.in/yaml/v2 -# go.yaml.in/yaml/v3 v3.0.4 +# go.yaml.in/yaml/v3 v3.0.5 ## explicit; go 1.16 go.yaml.in/yaml/v3 -# golang.org/x/crypto v0.55.0 -## explicit; go 1.25.0 +# golang.org/x/crypto v0.57.0 +## explicit; go 1.26.0 golang.org/x/crypto/argon2 golang.org/x/crypto/bcrypt golang.org/x/crypto/blake2b @@ -1730,11 +1756,11 @@ golang.org/x/crypto/scrypt ## explicit; go 1.25.0 golang.org/x/exp/constraints golang.org/x/exp/slices -# golang.org/x/mod v0.40.0 -## explicit; go 1.25.0 +# golang.org/x/mod v0.41.0 +## explicit; go 1.26.0 golang.org/x/mod/semver -# golang.org/x/net v0.58.0 -## explicit; go 1.25.0 +# golang.org/x/net v0.60.0 +## explicit; go 1.26.0 golang.org/x/net/bpf golang.org/x/net/context golang.org/x/net/context/ctxhttp @@ -1766,19 +1792,19 @@ golang.org/x/oauth2/google/internal/stsexchange golang.org/x/oauth2/internal golang.org/x/oauth2/jws golang.org/x/oauth2/jwt -# golang.org/x/sync v0.22.0 -## explicit; go 1.25.0 +# golang.org/x/sync v0.23.0 +## explicit; go 1.26.0 golang.org/x/sync/errgroup golang.org/x/sync/semaphore golang.org/x/sync/singleflight -# golang.org/x/sys v0.47.0 -## explicit; go 1.25.0 +# golang.org/x/sys v0.48.0 +## explicit; go 1.26.0 golang.org/x/sys/cpu golang.org/x/sys/unix golang.org/x/sys/windows golang.org/x/sys/windows/registry -# golang.org/x/text v0.41.0 -## explicit; go 1.25.0 +# golang.org/x/text v0.42.0 +## explicit; go 1.26.0 golang.org/x/text/cases golang.org/x/text/currency golang.org/x/text/internal @@ -1794,11 +1820,11 @@ golang.org/x/text/secure/bidirule golang.org/x/text/transform golang.org/x/text/unicode/bidi golang.org/x/text/unicode/norm -# golang.org/x/time v0.15.0 -## explicit; go 1.25.0 +# golang.org/x/time v0.16.0 +## explicit; go 1.26.0 golang.org/x/time/rate -# golang.org/x/tools v0.49.0 -## explicit; go 1.25.0 +# golang.org/x/tools v0.50.0 +## explicit; go 1.26.0 golang.org/x/tools/go/analysis golang.org/x/tools/go/analysis/checker golang.org/x/tools/go/analysis/internal @@ -1835,8 +1861,8 @@ golang.org/x/tools/internal/versions gonum.org/v1/gonum/floats gonum.org/v1/gonum/floats/scalar gonum.org/v1/gonum/internal/asm/f64 -# google.golang.org/api v0.264.0 -## explicit; go 1.24.0 +# google.golang.org/api v0.287.0 +## explicit; go 1.25.8 google.golang.org/api/googleapi google.golang.org/api/googleapi/transport google.golang.org/api/iamcredentials/v1 @@ -1853,14 +1879,14 @@ google.golang.org/api/storage/v1 google.golang.org/api/transport google.golang.org/api/transport/grpc google.golang.org/api/transport/http -# google.golang.org/genproto v0.0.0-20260128011058-8636f8732409 -## explicit; go 1.24.0 +# google.golang.org/genproto v0.0.0-20260630182238-925bb5da69e7 +## explicit; go 1.25.8 google.golang.org/genproto/googleapis/type/calendarperiod google.golang.org/genproto/googleapis/type/date google.golang.org/genproto/googleapis/type/expr google.golang.org/genproto/googleapis/type/timeofday -# google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa -## explicit; go 1.25.0 +# google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc +## explicit; go 1.26.0 google.golang.org/genproto/googleapis/api google.golang.org/genproto/googleapis/api/annotations google.golang.org/genproto/googleapis/api/distribution @@ -1869,12 +1895,12 @@ google.golang.org/genproto/googleapis/api/httpbody google.golang.org/genproto/googleapis/api/label google.golang.org/genproto/googleapis/api/metric google.golang.org/genproto/googleapis/api/monitoredres -# google.golang.org/genproto/googleapis/rpc v0.0.0-20260803160001-6ac0973c030d -## explicit; go 1.25.0 +# google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc +## explicit; go 1.26.0 google.golang.org/genproto/googleapis/rpc/code google.golang.org/genproto/googleapis/rpc/errdetails google.golang.org/genproto/googleapis/rpc/status -# google.golang.org/grpc v1.83.1 +# google.golang.org/grpc v1.84.0 ## explicit; go 1.25.0 google.golang.org/grpc google.golang.org/grpc/attributes @@ -1956,6 +1982,7 @@ google.golang.org/grpc/internal/hierarchy google.golang.org/grpc/internal/idle google.golang.org/grpc/internal/mem google.golang.org/grpc/internal/metadata +google.golang.org/grpc/internal/optional google.golang.org/grpc/internal/pretty google.golang.org/grpc/internal/proto/grpc_lookup_v1 google.golang.org/grpc/internal/proxyattributes @@ -2004,6 +2031,8 @@ google.golang.org/grpc/internal/xds/clients/xdsclient/metrics google.golang.org/grpc/internal/xds/clusterspecifier google.golang.org/grpc/internal/xds/clusterspecifier/rls google.golang.org/grpc/internal/xds/httpfilter +google.golang.org/grpc/internal/xds/httpfilter/extproc +google.golang.org/grpc/internal/xds/httpfilter/extproc/internal google.golang.org/grpc/internal/xds/httpfilter/fault google.golang.org/grpc/internal/xds/httpfilter/rbac google.golang.org/grpc/internal/xds/httpfilter/router @@ -2040,7 +2069,7 @@ google.golang.org/grpc/xds google.golang.org/grpc/xds/bootstrap google.golang.org/grpc/xds/csds google.golang.org/grpc/xds/googledirectpath -# google.golang.org/protobuf v1.36.11 +# google.golang.org/protobuf v1.36.12 ## explicit; go 1.23 google.golang.org/protobuf/encoding/protodelim google.golang.org/protobuf/encoding/protojson @@ -2084,7 +2113,7 @@ google.golang.org/protobuf/types/known/fieldmaskpb google.golang.org/protobuf/types/known/structpb google.golang.org/protobuf/types/known/timestamppb google.golang.org/protobuf/types/known/wrapperspb -# gopkg.in/ini.v1 v1.67.2 +# gopkg.in/ini.v1 v1.67.3 ## explicit; go 1.13 gopkg.in/ini.v1 # gopkg.in/telebot.v3 v3.3.8