From ddadfd6d58a45d4195f1c60f0be889a2a4916585 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Sun, 3 Aug 2025 22:10:54 +0200 Subject: [PATCH] vendor: run `make vendor-update` --- go.mod | 98 +- go.sum | 203 +-- vendor/cloud.google.com/go/auth/CHANGES.md | 7 + vendor/cloud.google.com/go/auth/auth.go | 4 +- .../go/internal/.repo-metadata-full.json | 20 + .../azure-sdk-for-go/sdk/azcore/CHANGELOG.md | 6 + .../sdk/azcore/internal/shared/constants.go | 2 +- .../sdk/azcore/runtime/policy_bearer_token.go | 4 +- .../sdk/internal/errorinfo/errorinfo.go | 12 +- .../sdk/storage/azblob/CHANGELOG.md | 15 + .../sdk/storage/azblob/appendblob/models.go | 3 + .../sdk/storage/azblob/blob/constants.go | 14 + .../sdk/storage/azblob/blob/models.go | 3 + .../sdk/storage/azblob/blockblob/models.go | 8 + .../azblob/internal/exported/version.go | 2 +- .../azblob/internal/generated/autorest.md | 6 +- .../azblob/internal/generated/constants.go | 2 +- .../generated/zz_appendblob_client.go | 19 +- .../internal/generated/zz_blob_client.go | 99 +- .../internal/generated/zz_blockblob_client.go | 30 +- .../azblob/internal/generated/zz_constants.go | 13 + .../internal/generated/zz_container_client.go | 72 +- .../azblob/internal/generated/zz_options.go | 177 +- .../internal/generated/zz_pageblob_client.go | 39 +- .../internal/generated/zz_service_client.go | 32 +- .../sdk/storage/azblob/pageblob/models.go | 3 + .../sdk/storage/azblob/sas/service.go | 2 + .../aws/protocol/eventstream/CHANGELOG.md | 4 + .../eventstream/go_module_metadata.go | 2 +- .../feature/ec2/imds/CHANGELOG.md | 17 + .../feature/ec2/imds/api_client.go | 8 +- .../feature/ec2/imds/go_module_metadata.go | 2 +- .../internal/configsources/CHANGELOG.md | 13 + .../configsources/go_module_metadata.go | 2 +- .../internal/endpoints/v2/CHANGELOG.md | 13 + .../endpoints/v2/go_module_metadata.go | 2 +- .../aws-sdk-go-v2/internal/v4a/CHANGELOG.md | 13 + .../internal/v4a/go_module_metadata.go | 2 +- .../internal/accept-encoding/CHANGELOG.md | 4 + .../accept-encoding/go_module_metadata.go | 2 +- .../internal/presigned-url/CHANGELOG.md | 13 + .../presigned-url/go_module_metadata.go | 2 +- .../service/internal/s3shared/CHANGELOG.md | 13 + .../internal/s3shared/go_module_metadata.go | 2 +- vendor/github.com/aws/smithy-go/CHANGELOG.md | 10 + vendor/github.com/aws/smithy-go/README.md | 4 +- .../aws/smithy-go/endpoints/endpoint.go | 2 +- .../aws/smithy-go/go_module_metadata.go | 2 +- .../smithy-go/transport/http/interceptor.go | 321 ++++ .../transport/http/interceptor_middleware.go | 325 ++++ .../github.com/bmatcuk/doublestar/v4/match.go | 29 +- .../go-viper/mapstructure/v2/.golangci.yaml | 9 + .../go-viper/mapstructure/v2/README.md | 2 +- .../go-viper/mapstructure/v2/decode_hooks.go | 214 ++- .../go-viper/mapstructure/v2/errors.go | 170 ++ .../go-viper/mapstructure/v2/mapstructure.go | 98 +- .../github.com/gogo/protobuf/jsonpb/jsonpb.go | 1435 ----------------- .../golang-jwt/jwt/v5/MIGRATION_GUIDE.md | 2 +- vendor/github.com/golang-jwt/jwt/v5/ecdsa.go | 4 +- .../golang-jwt/jwt/v5/ecdsa_utils.go | 4 +- .../github.com/golang-jwt/jwt/v5/ed25519.go | 4 +- .../golang-jwt/jwt/v5/ed25519_utils.go | 4 +- vendor/github.com/golang-jwt/jwt/v5/errors.go | 40 + .../golang-jwt/jwt/v5/errors_go1_20.go | 47 - .../golang-jwt/jwt/v5/errors_go_other.go | 78 - vendor/github.com/golang-jwt/jwt/v5/hmac.go | 4 +- .../golang-jwt/jwt/v5/map_claims.go | 8 +- vendor/github.com/golang-jwt/jwt/v5/none.go | 4 +- .../golang-jwt/jwt/v5/parser_option.go | 25 +- vendor/github.com/golang-jwt/jwt/v5/rsa.go | 4 +- .../github.com/golang-jwt/jwt/v5/rsa_pss.go | 7 +- .../github.com/golang-jwt/jwt/v5/rsa_utils.go | 6 +- .../golang-jwt/jwt/v5/signing_method.go | 6 +- vendor/github.com/golang-jwt/jwt/v5/token.go | 20 +- vendor/github.com/golang-jwt/jwt/v5/types.go | 4 +- .../github.com/golang-jwt/jwt/v5/validator.go | 50 +- .../modern-go/reflect2/safe_type.go | 22 +- .../internal/data/add.go | 6 +- .../internal/metrics/data.go | 4 +- .../deltatocumulativeprocessor/processor.go | 16 +- .../prometheus/internal/difflib.go | 4 +- .../client_golang/prometheus/metric.go | 25 +- .../prometheus/process_collector_darwin.go | 6 +- .../process_collector_mem_nocgo_darwin.go | 2 +- .../process_collector_procfsenabled.go | 8 +- .../client_golang/prometheus/vec.go | 10 +- .../client_golang/prometheus/wrap.go | 36 +- .../collector/component/identifiable.go | 2 +- .../collector/confmap/README.md | 6 +- .../collector/confmap/xconfmap/config.go | 21 +- .../collector/featuregate/registry.go | 2 +- .../componentattribute/logger_zap.go | 124 +- .../componentattribute/tracer_provider.go | 10 +- .../collector/pdata/internal/data/bytesid.go | 37 +- .../pdata/internal/data/profileid.go | 21 +- .../collector/pdata/internal/data/spanid.go | 19 +- .../collector/pdata/internal/data/traceid.go | 23 +- .../internal/generated_wrapper_byteslice.go | 34 +- .../internal/generated_wrapper_entityref.go | 25 +- .../generated_wrapper_entityrefslice.go | 25 +- .../generated_wrapper_float64slice.go | 37 +- .../generated_wrapper_instrumentationscope.go | 25 +- .../internal/generated_wrapper_int32slice.go | 37 +- .../internal/generated_wrapper_int64slice.go | 37 +- .../internal/generated_wrapper_intslice.go | 34 - .../internal/generated_wrapper_resource.go | 21 +- .../internal/generated_wrapper_stringslice.go | 37 +- .../internal/generated_wrapper_uint64slice.go | 37 +- .../pdata/internal/json/attribute.go | 110 -- .../collector/pdata/internal/json/enum.go | 29 - .../collector/pdata/internal/json/iterator.go | 211 +++ .../collector/pdata/internal/json/json.go | 22 - .../collector/pdata/internal/json/number.go | 103 -- .../collector/pdata/internal/json/resource.go | 27 - .../collector/pdata/internal/json/scope.go | 31 - .../collector/pdata/internal/json/stream.go | 93 ++ .../pdata/internal/wrapper_entityref.go | 26 + .../internal/wrapper_instrumentationscope.go | 26 + .../collector/pdata/internal/wrapper_map.go | 58 +- .../pdata/internal/wrapper_resource.go | 24 + .../collector/pdata/internal/wrapper_slice.go | 22 + .../pdata/internal/wrapper_tracestate.go | 9 + .../collector/pdata/internal/wrapper_value.go | 108 ++ .../pdata/pcommon/generated_byteslice.go | 2 +- .../pdata/pcommon/generated_float64slice.go | 2 +- .../pcommon/generated_instrumentationscope.go | 18 +- .../pdata/pcommon/generated_int32slice.go | 2 +- .../pdata/pcommon/generated_int64slice.go | 2 +- .../pdata/pcommon/generated_intslice.go | 108 -- .../pdata/pcommon/generated_resource.go | 18 +- .../pdata/pcommon/generated_stringslice.go | 2 +- .../pdata/pcommon/generated_uint64slice.go | 2 +- .../pdata/plog/generated_logrecord.go | 51 +- .../pdata/plog/generated_logrecordslice.go | 25 +- .../pdata/plog/generated_resourcelogs.go | 19 +- .../pdata/plog/generated_resourcelogsslice.go | 25 +- .../pdata/plog/generated_scopelogs.go | 19 +- .../pdata/plog/generated_scopelogsslice.go | 25 +- .../collector/pdata/plog/json.go | 89 +- .../collector/pdata/plog/logs.go | 20 + .../collector/pdata/plog/severity_number.go | 6 + .../pdata/pmetric/aggregation_temporality.go | 6 + .../pdata/pmetric/generated_exemplar.go | 33 +- .../pdata/pmetric/generated_exemplarslice.go | 25 +- .../pmetric/generated_exponentialhistogram.go | 17 +- ...generated_exponentialhistogramdatapoint.go | 61 +- ...ed_exponentialhistogramdatapointbuckets.go | 15 +- ...ated_exponentialhistogramdatapointslice.go | 25 +- .../pdata/pmetric/generated_gauge.go | 13 +- .../pdata/pmetric/generated_histogram.go | 17 +- .../pmetric/generated_histogramdatapoint.go | 49 +- .../generated_histogramdatapointslice.go | 25 +- .../pdata/pmetric/generated_metric.go | 42 +- .../pdata/pmetric/generated_metricslice.go | 25 +- .../pmetric/generated_numberdatapoint.go | 37 +- .../pmetric/generated_numberdatapointslice.go | 25 +- .../pmetric/generated_resourcemetrics.go | 19 +- .../pmetric/generated_resourcemetricsslice.go | 25 +- .../pdata/pmetric/generated_scopemetrics.go | 19 +- .../pmetric/generated_scopemetricsslice.go | 25 +- .../collector/pdata/pmetric/generated_sum.go | 21 +- .../pdata/pmetric/generated_summary.go | 13 +- .../pmetric/generated_summarydatapoint.go | 37 +- .../generated_summarydatapointslice.go | 25 +- ...nerated_summarydatapointvalueatquantile.go | 17 +- ...ed_summarydatapointvalueatquantileslice.go | 25 +- .../collector/pdata/pmetric/json.go | 290 ++-- .../collector/pdata/pmetric/metrics.go | 23 + .../generated_exportpartialsuccess.go | 17 +- .../pdata/pmetric/pmetricotlp/request.go | 14 +- .../pdata/pmetric/pmetricotlp/response.go | 36 +- .../pdata/ptrace/generated_resourcespans.go | 19 +- .../ptrace/generated_resourcespansslice.go | 25 +- .../pdata/ptrace/generated_scopespans.go | 19 +- .../pdata/ptrace/generated_scopespansslice.go | 25 +- .../collector/pdata/ptrace/generated_span.go | 71 +- .../pdata/ptrace/generated_spanevent.go | 25 +- .../pdata/ptrace/generated_spaneventslice.go | 25 +- .../pdata/ptrace/generated_spanlink.go | 33 +- .../pdata/ptrace/generated_spanlinkslice.go | 25 +- .../pdata/ptrace/generated_spanslice.go | 25 +- .../pdata/ptrace/generated_status.go | 17 +- .../collector/pdata/ptrace/json.go | 157 +- .../collector/pdata/ptrace/span_kind.go | 5 + .../collector/pdata/ptrace/status_code.go | 5 + .../collector/pdata/ptrace/traces.go | 20 + .../iamcredentials/v1/iamcredentials-api.json | 22 +- .../api/internal/gensupport/resumable.go | 252 ++- .../google.golang.org/api/internal/version.go | 2 +- .../api/storage/v1/storage-api.json | 73 +- .../api/storage/v1/storage-gen.go | 140 +- .../grpc/balancer/balancer.go | 8 +- .../endpointsharding/endpointsharding.go | 36 +- .../grpc_lb_v1/load_balancer_grpc.pb.go | 2 +- .../pickfirst/pickfirstleaf/pickfirstleaf.go | 27 +- .../grpc/balancer/roundrobin/roundrobin.go | 7 - .../proto/grpc_gcp/handshaker_grpc.pb.go | 2 +- vendor/google.golang.org/grpc/dialoptions.go | 21 + .../balancer/gracefulswitch/gracefulswitch.go | 10 +- .../grpc/internal/envconfig/envconfig.go | 4 - .../grpc/internal/transport/controlbuf.go | 68 +- .../grpc/internal/transport/http2_client.go | 20 +- .../grpc/internal/transport/http2_server.go | 44 +- .../grpc/internal/transport/http_util.go | 3 - .../grpc/internal/transport/transport.go | 3 + .../grpc/mem/buffer_slice.go | 11 + vendor/google.golang.org/grpc/server.go | 26 + vendor/google.golang.org/grpc/stream.go | 4 +- vendor/google.golang.org/grpc/version.go | 2 +- vendor/modules.txt | 103 +- 210 files changed, 4845 insertions(+), 3600 deletions(-) create mode 100644 vendor/github.com/aws/smithy-go/transport/http/interceptor.go create mode 100644 vendor/github.com/aws/smithy-go/transport/http/interceptor_middleware.go delete mode 100644 vendor/github.com/gogo/protobuf/jsonpb/jsonpb.go delete mode 100644 vendor/github.com/golang-jwt/jwt/v5/errors_go1_20.go delete mode 100644 vendor/github.com/golang-jwt/jwt/v5/errors_go_other.go delete mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_intslice.go delete mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/json/attribute.go delete mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/json/enum.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/json/iterator.go delete mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/json/json.go delete mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/json/number.go delete mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/json/resource.go delete mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/json/scope.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/json/stream.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_entityref.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_instrumentationscope.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_resource.go delete mode 100644 vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_intslice.go diff --git a/go.mod b/go.mod index edbe5e163e..b927da9272 100644 --- a/go.mod +++ b/go.mod @@ -28,20 +28,20 @@ replace ( ) require ( - cloud.google.com/go/storage v1.55.0 - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.1 + cloud.google.com/go/storage v1.56.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.2 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.1 - github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.1 + github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.2 github.com/VictoriaMetrics/VictoriaLogs v0.0.0-20250728123024-98593029b5aa github.com/VictoriaMetrics/easyproto v0.1.4 github.com/VictoriaMetrics/fastcache v1.12.5 github.com/VictoriaMetrics/metrics v1.39.1 github.com/VictoriaMetrics/metricsql v0.84.6 - github.com/aws/aws-sdk-go-v2 v1.36.5 - github.com/aws/aws-sdk-go-v2/config v1.29.17 - github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.83 - github.com/aws/aws-sdk-go-v2/service/s3 v1.83.0 - github.com/bmatcuk/doublestar/v4 v4.9.0 + github.com/aws/aws-sdk-go-v2 v1.37.1 + github.com/aws/aws-sdk-go-v2/config v1.30.2 + github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.18.2 + github.com/aws/aws-sdk-go-v2/service/s3 v1.85.1 + github.com/bmatcuk/doublestar/v4 v4.9.1 github.com/cespare/xxhash/v2 v2.3.0 github.com/cheggaaa/pb/v3 v3.1.7 github.com/gogo/protobuf v1.3.2 @@ -61,35 +61,35 @@ require ( golang.org/x/net v0.42.0 golang.org/x/oauth2 v0.30.0 golang.org/x/sys v0.34.0 - google.golang.org/api v0.241.0 + google.golang.org/api v0.244.0 gopkg.in/yaml.v2 v2.4.0 ) require ( - cloud.google.com/go v0.121.3 // indirect - cloud.google.com/go/auth v0.16.2 // indirect + cloud.google.com/go v0.121.4 // indirect + cloud.google.com/go/auth v0.16.3 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect cloud.google.com/go/compute/metadata v0.7.0 // indirect cloud.google.com/go/iam v1.5.2 // indirect - github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect github.com/VividCortex/ewma v1.2.0 // indirect github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.11 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.17.70 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.32 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.36 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.36 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.0 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.18.2 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.1 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.1 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.1 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.36 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.4 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.7.4 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.17 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.17 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.25.5 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.3 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.34.0 // indirect - github.com/aws/smithy-go v1.22.4 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.0 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.1 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.26.1 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.31.1 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.35.1 // indirect + github.com/aws/smithy-go v1.22.5 // indirect github.com/bboreham/go-loser v0.0.0-20230920113527-fcc2c21820a3 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect @@ -99,9 +99,9 @@ require ( github.com/felixge/httpsnoop v1.0.4 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-viper/mapstructure/v2 v2.3.0 // indirect + github.com/go-viper/mapstructure/v2 v2.4.0 // indirect github.com/gobwas/glob v0.2.3 // indirect - github.com/golang-jwt/jwt/v5 v5.2.2 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect github.com/google/s2a-go v0.1.9 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.6 // indirect @@ -119,16 +119,16 @@ require ( github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect github.com/oklog/ulid/v2 v2.1.1 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics v0.130.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.130.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor v0.130.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics v0.131.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.131.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor v0.131.0 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.22.0 // indirect + github.com/prometheus/client_golang v1.23.0 // indirect github.com/prometheus/client_model v0.6.2 // indirect github.com/prometheus/common v0.65.0 // indirect github.com/prometheus/procfs v0.17.0 // indirect @@ -140,15 +140,15 @@ require ( github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect - go.opentelemetry.io/collector/component v1.36.0 // indirect - go.opentelemetry.io/collector/confmap v1.36.0 // indirect - go.opentelemetry.io/collector/confmap/xconfmap v0.130.0 // indirect - go.opentelemetry.io/collector/consumer v1.36.0 // indirect - go.opentelemetry.io/collector/featuregate v1.36.0 // indirect - go.opentelemetry.io/collector/internal/telemetry v0.130.0 // indirect - go.opentelemetry.io/collector/pdata v1.36.0 // indirect - go.opentelemetry.io/collector/pipeline v0.130.0 // indirect - go.opentelemetry.io/collector/processor v1.36.0 // indirect + go.opentelemetry.io/collector/component v1.37.0 // indirect + go.opentelemetry.io/collector/confmap v1.37.0 // indirect + go.opentelemetry.io/collector/confmap/xconfmap v0.131.0 // indirect + go.opentelemetry.io/collector/consumer v1.37.0 // indirect + go.opentelemetry.io/collector/featuregate v1.37.0 // indirect + go.opentelemetry.io/collector/internal/telemetry v0.131.0 // indirect + go.opentelemetry.io/collector/pdata v1.37.0 // indirect + go.opentelemetry.io/collector/pipeline v0.131.0 // indirect + go.opentelemetry.io/collector/processor v1.37.0 // indirect go.opentelemetry.io/collector/semconv v0.128.0 // indirect go.opentelemetry.io/contrib/bridges/otelzap v0.12.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.62.0 // indirect @@ -165,18 +165,18 @@ require ( go.uber.org/zap v1.27.0 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/crypto v0.40.0 // indirect - golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc // indirect + golang.org/x/exp v0.0.0-20250718183923-645b1fa84792 // indirect golang.org/x/sync v0.16.0 // indirect golang.org/x/text v0.27.0 // indirect golang.org/x/time v0.12.0 // indirect - google.golang.org/genproto v0.0.0-20250707201910-8d1bb00bc6a7 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20250707201910-8d1bb00bc6a7 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7 // indirect - google.golang.org/grpc v1.73.0 // indirect + google.golang.org/genproto v0.0.0-20250728155136-f173205681a0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250728155136-f173205681a0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250728155136-f173205681a0 // indirect + google.golang.org/grpc v1.74.2 // indirect google.golang.org/protobuf v1.36.6 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apimachinery v0.33.2 // indirect - k8s.io/client-go v0.33.2 // indirect + k8s.io/apimachinery v0.33.3 // indirect + k8s.io/client-go v0.33.3 // indirect k8s.io/klog/v2 v2.130.1 // indirect k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect sigs.k8s.io/yaml v1.5.0 // indirect diff --git a/go.sum b/go.sum index 663a387789..4516d33013 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ -cloud.google.com/go v0.121.3 h1:84RD+hQXNdY5Sw/MWVAx5O9Aui/rd5VQ9HEcdN19afo= -cloud.google.com/go v0.121.3/go.mod h1:6vWF3nJWRrEUv26mMB3FEIU/o1MQNVPG1iHdisa2SJc= -cloud.google.com/go/auth v0.16.2 h1:QvBAGFPLrDeoiNjyfVunhQ10HKNYuOwZ5noee0M5df4= -cloud.google.com/go/auth v0.16.2/go.mod h1:sRBas2Y1fB1vZTdurouM0AzuYQBMZinrUYL8EufhtEA= +cloud.google.com/go v0.121.4 h1:cVvUiY0sX0xwyxPwdSU2KsF9knOVmtRyAMt8xou0iTs= +cloud.google.com/go v0.121.4/go.mod h1:XEBchUiHFJbz4lKBZwYBDHV/rSyfFktk737TLDU089s= +cloud.google.com/go/auth v0.16.3 h1:kabzoQ9/bobUmnseYnBO6qQG7q4a/CffFRlJSxv2wCc= +cloud.google.com/go/auth v0.16.3/go.mod h1:NucRGjaXfzP1ltpcQ7On/VTZ0H4kWB5Jy+Y9Dnm76fA= 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/compute/metadata v0.7.0 h1:PBWF+iiAerVNe8UCHxdOt6eHLVc3ydFeOCw78U8ytSU= @@ -12,22 +12,22 @@ cloud.google.com/go/longrunning v0.6.7 h1:IGtfDWHhQCgCjwQjV9iiLnUta9LBCo8R9QmAFs cloud.google.com/go/longrunning v0.6.7/go.mod h1:EAFV3IZAKmM56TyiE6VAP3VoTzhZzySwI/YI1s/nRsY= cloud.google.com/go/storage v1.43.0 h1:CcxnSohZwizt4LCzQHWvBf1/kvtHUn7gk9QERXPyXFs= cloud.google.com/go/storage v1.43.0/go.mod h1:ajvxEa7WmZS1PxvKRq4bq0tFT3vMd502JwstCcYv0Q0= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.1 h1:Wc1ml6QlJs2BHQ/9Bqu1jiyggbsSjramq2oUmp5WeIo= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.1/go.mod h1:Ot/6aikWnKWi4l9QB7qVSwa8iMphQNqkWALMoNT3rzM= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.2 h1:Hr5FTipp7SL07o2FvoVOX9HRiRH3CR3Mj8pxqCcdD5A= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.2/go.mod h1:QyVsSSN64v5TGltphKLQ2sQxe4OBQg0J1eKRcVBnfgE= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.1 h1:B+blDbyVIG3WaikNxPnhPiJ1MThR03b3vKGtER95TP4= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.1/go.mod h1:JdM5psgjfBf5fo2uWOZhflPWyDBZ/O/CNAH9CtsuZE4= github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY= github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2/go.mod h1:Pa9ZNPuoNu/GztvBSKk9J1cDJW6vk/n0zLtV4mgd8N8= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 h1:FPKJS1T+clwv+OLGt13a8UjqeRuh0O4SJ3lUriThc+4= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1/go.mod h1:j2chePtV91HrC22tGoRX3sGY42uF13WzmmV80/OdVAA= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 h1:9iefClla7iYpfYWdzPCRDozdmndjTm8DXdpCzPajMgA= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2/go.mod h1:XtLgD3ZD34DAaVIIAyG3objl5DynM3CQ/vMcbBNJZGI= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.7.0 h1:LkHbJbgF3YyvC53aqYGR+wWQDn2Rdp9AQdGndf9QvY4= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.7.0/go.mod h1:QyiQdW4f4/BIfB8ZutZ2s+28RAgfa/pT+zS++ZHyM1I= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4 v4.3.0 h1:bXwSugBiSbgtz7rOtbfGf+woewp4f06orW9OP5BjHLA= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4 v4.3.0/go.mod h1:Y/HgrePTmGy9HjdSGTqZNa+apUpTVIEVKXJyARP2lrk= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.8.0 h1:LR0kAX9ykz8G4YgLCaRDVJ3+n43R8MneB5dTy2konZo= -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/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.8.1 h1:/Zt+cDPnpC3OVDm/JKLOs7M2DKmLRIIp3XIx9pHHiig= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.8.1/go.mod h1:Ng3urmn6dYe8gnbCMoHHVl5APYz2txho3koEkV2o2HA= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.2 h1:FwladfywkNirM+FZYLBR2kBz5C8Tg0fw5w5Y7meRXWI= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.2/go.mod h1:vv5Ad0RrIoT1lJFdWBZwt4mB1+j+V8DUroixmKDTCdk= 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.4.2 h1:oygO0locgZJe7PpYPXT5A29ZkwJaPqcva7BVeemZOZs= @@ -58,32 +58,32 @@ github.com/aws/aws-sdk-go v1.55.6 h1:cSg4pvZ3m8dgYcgqB97MrcdjUmZ1BeMYKUxMMB89IPk github.com/aws/aws-sdk-go v1.55.6/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= github.com/aws/aws-sdk-go-v2 v1.32.8 h1:cZV+NUS/eGxKXMtmyhtYPJ7Z4YLoI/V8bkTdRZfYhGo= github.com/aws/aws-sdk-go-v2 v1.32.8/go.mod h1:P5WJBrYqqbWVaOxgH0X/FYYD47/nooaPOZPlQdmiN2U= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.11 h1:12SpdwU8Djs+YGklkinSSlcrPyj3H4VifVsKf78KbwA= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.11/go.mod h1:dd+Lkp6YmMryke+qxW/VnKyhMBDTYP41Q2Bb+6gNZgY= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.0 h1:6GMWV6CNpA/6fbFHnoAjrv4+LGfyTqZz2LtCHnspgDg= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.0/go.mod h1:/mXlTIVG9jbxkqDnr5UQNQxW1HRYxeGklkM9vAFeabg= github.com/aws/aws-sdk-go-v2/config v1.28.11 h1:7Ekru0IkRHRnSRWGQLnLN6i0o1Jncd0rHo2T130+tEQ= github.com/aws/aws-sdk-go-v2/config v1.28.11/go.mod h1:x78TpPvBfHH16hi5tE3OCWQ0pzNfyXA349p5/Wp82Yo= github.com/aws/aws-sdk-go-v2/credentials v1.17.52 h1:I4ymSk35LHogx2Re2Wu6LOHNTRaRWkLVoJgWS5Wd40M= github.com/aws/aws-sdk-go-v2/credentials v1.17.52/go.mod h1:vAkqKbMNUcher8fDXP2Ge2qFXKMkcD74qvk1lJRMemM= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.32 h1:KAXP9JSHO1vKGCr5f4O6WmlVKLFFXgWYAGoJosorxzU= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.32/go.mod h1:h4Sg6FQdexC1yYG9RDnOvLbW1a/P986++/Y/a+GyEM8= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.1 h1:owmNBboeA0kHKDcdF8KiSXmrIuXZustfMGGytv6OMkM= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.1/go.mod h1:Bg1miN59SGxrZqlP8vJZSmXW+1N8Y1MjQDq1OfuNod8= github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.48 h1:XnXVe2zRyPf0+fAW5L05esmngvBpC6DQZK7oZB/z/Co= github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.48/go.mod h1:S3wey90OrS4f7kYxH6PT175YyEcHTORY07++HurMaRM= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.36 h1:SsytQyTMHMDPspp+spo7XwXTP44aJZZAC7fBV2C5+5s= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.36/go.mod h1:Q1lnJArKRXkenyog6+Y+zr7WDpk4e6XlR6gs20bbeNo= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.36 h1:i2vNHQiXUvKhs3quBR6aqlgJaiaexz/aNvdCktW/kAM= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.36/go.mod h1:UdyGa7Q91id/sdyHPwth+043HhmP6yP9MBHgbZM0xo8= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.1 h1:ksZXBYv80EFTcgc8OJO48aQ8XDWXIQL7gGasPeCoTzI= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.1/go.mod h1:HSksQyyJETVZS7uM54cir0IgxttTD+8aEoJMPGepHBI= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.1 h1:+dn/xF/05utS7tUhjIcndbuaPjfll2LhbH1cCDGLYUQ= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.1/go.mod h1:hyAGz30LHdm5KBZDI58MXx5lDVZ5CUfvfTZvMu4HCZo= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 h1:bIqFDwgGXXN1Kpp99pDOdKMTTb5d2KyU5X/BZxjOkRo= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3/go.mod h1:H5O/EsxDWyU+LP/V8i5sm8cxoZgc2fdNR9bxlOFrQTo= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.36 h1:GMYy2EOWfzdP3wfVAGXBNKY5vK4K8vMET4sYOYltmqs= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.36/go.mod h1:gDhdAV6wL3PmPqBhiPbnlS447GoWs8HTTOYef9/9Inw= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.4 h1:CXV68E2dNqhuynZJPB80bhPQwAKqBWVer887figW6Jc= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.4/go.mod h1:/xFi9KtvBXP97ppCz1TAEvU1Uf66qvid89rbem3wCzQ= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.1 h1:4HbnOGE9491a9zYJ9VpPh1ApgEq6ZlD4Kuv1PJenFpc= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.1/go.mod h1:Z6QnHC6TmpJWUxAy8FI4JzA7rTwl6EIANkyK9OR5z5w= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.0 h1:6+lZi2JeGKtCraAj1rpoZfKqnQ9SptseRZioejfUOLM= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.0/go.mod h1:eb3gfbVIxIoGgJsi9pGne19dhCBpK6opTYpQqAmdy44= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.8 h1:iwYS40JnrBeA9e9aI5S6KKN4EB2zR4iUVYN0nwVivz4= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.8/go.mod h1:Fm9Mi+ApqmFiknZtGpohVcBGvpTu542VC4XO9YudRi0= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.17 h1:t0E6FzREdtCsiLIoLCWsYliNsRBgyGD/MCK571qk4MI= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.17/go.mod h1:ygpklyoaypuyDvOM5ujWGrYWpAK3h7ugnmKCU/76Ys4= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.17 h1:qcLWgdhq45sDM9na4cvXax9dyLitn8EYBRl8Ak4XtG4= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.17/go.mod h1:M+jkjBFZ2J6DJrjMv2+vkBbuht6kxJYtJiwoVgX4p4U= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.1 h1:ky79ysLMxhwk5rxJtS+ILd3Mc8kC5fhsLBrP27r6h4I= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.1/go.mod h1:+2MmkvFvPYM1vsozBWduoLJUi5maxFk5B7KJFECujhY= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.1 h1:MdVYlN5pcQu1t1OYx4Ajo3fKl1IEhzgdPQbYFCRjYS8= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.1/go.mod h1:iikmNLrvHm2p4a3/4BPeix2S9P+nW8yM1IZW73x8bFA= github.com/aws/aws-sdk-go-v2/service/s3 v1.72.3 h1:WZOmJfCDV+4tYacLxpiojoAdT5sxTfB3nTqQNtZu+J4= github.com/aws/aws-sdk-go-v2/service/s3 v1.72.3/go.mod h1:xMekrnhmJ5aqmyxtmALs7mlvXw5xRh+eYjOjvrIIFJ4= github.com/aws/aws-sdk-go-v2/service/sso v1.24.9 h1:YqtxripbjWb2QLyzRK9pByfEDvgg95gpC2AyDq4hFE8= @@ -92,20 +92,20 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.8 h1:6dBT1Lz8fK11m22R+AqfRsFn github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.8/go.mod h1:/kiBvRQXBc6xeJTYzhSdGvJ5vm1tjaDEjH+MSeRJnlY= github.com/aws/aws-sdk-go-v2/service/sts v1.33.7 h1:qwGa9MA8G7mBq2YphHFaygdPe5t9OA7SvaJdwWTlEds= github.com/aws/aws-sdk-go-v2/service/sts v1.33.7/go.mod h1:+8h7PZb3yY5ftmVLD7ocEoE98hdc8PoKS0H3wfx1dlc= -github.com/aws/smithy-go v1.22.4 h1:uqXzVZNuNexwc/xrh6Tb56u89WDlJY6HS+KC0S4QSjw= -github.com/aws/smithy-go v1.22.4/go.mod h1:t1ufH5HMublsJYulve2RKmHDC15xu1f26kHCp/HgceI= +github.com/aws/smithy-go v1.22.5 h1:P9ATCXPMb2mPjYBgueqJNCA5S9UfktsW0tTxi+a7eqw= +github.com/aws/smithy-go v1.22.5/go.mod h1:t1ufH5HMublsJYulve2RKmHDC15xu1f26kHCp/HgceI= github.com/bboreham/go-loser v0.0.0-20230920113527-fcc2c21820a3 h1:6df1vn4bBlDDo4tARvBm7l6KA9iVMnE3NWizDeWSrps= github.com/bboreham/go-loser v0.0.0-20230920113527-fcc2c21820a3/go.mod h1:CIWtjkly68+yqLPbvwwR/fjNJA/idrtULjZWh2v1ys0= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bmatcuk/doublestar/v4 v4.9.0 h1:DBvuZxjdKkRP/dr4GVV4w2fnmrk5Hxc90T51LZjv0JA= -github.com/bmatcuk/doublestar/v4 v4.9.0/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= +github.com/bmatcuk/doublestar/v4 v4.9.1 h1:X8jg9rRZmJd4yRy7ZeNDRnM+T3ZfHv15JiBJ/avrEXE= +github.com/bmatcuk/doublestar/v4 v4.9.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheggaaa/pb/v3 v3.1.7 h1:2FsIW307kt7A/rz/ZI2lvPO+v3wKazzE4K/0LtTWsOI= github.com/cheggaaa/pb/v3 v3.1.7/go.mod h1:/Ji89zfVPeC/u5j8ukD0MBPHt2bzTYp74lQ7KlgFWTQ= -github.com/cncf/xds/go v0.0.0-20250326154945-ae57f3c0d45f h1:C5bqEmzEPLsHm9Mv73lSE9e9bKV23aB1vxOsmZrkl3k= -github.com/cncf/xds/go v0.0.0-20250326154945-ae57f3c0d45f/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= +github.com/cncf/xds/go v0.0.0-20250501225837-2ac532fd4443 h1:aQ3y1lwWyqYPiWZThqv1aFbZMiM9vblcSArJRf2Irls= +github.com/cncf/xds/go v0.0.0-20250501225837-2ac532fd4443/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo= github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -158,16 +158,16 @@ github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+Gr github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/go-resty/resty/v2 v2.16.3 h1:zacNT7lt4b8M/io2Ahj6yPypL7bqx9n1iprfQuodV+E= github.com/go-resty/resty/v2 v2.16.3/go.mod h1:hkJtXbA2iKHzJheXYvQ8snQES5ZLGKMwQ07xAwp/fiA= -github.com/go-viper/mapstructure/v2 v2.3.0 h1:27XbWsHIqhbdR5TIC911OfYvgSaW93HM+dX7970Q7jk= -github.com/go-viper/mapstructure/v2 v2.3.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs= +github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/go-zookeeper/zk v1.0.4 h1:DPzxraQx7OrPyXq2phlGlNSIyWEsAox0RJmjTseMV6I= github.com/go-zookeeper/zk v1.0.4/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= -github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo= +github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v1.0.0 h1:Oy607GVXHs7RtbggtPBnr2RmDArIsAefDwvrdWvRhGs= @@ -280,22 +280,23 @@ github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6U 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= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8= +github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/oklog/ulid/v2 v2.1.1 h1:suPZ4ARWLOJLegGFiZZ1dFAkqzhMjL3J1TzI+5wHz8s= github.com/oklog/ulid/v2 v2.1.1/go.mod h1:rcEKHmBBKfef9DhnvX7y1HZBYxjXb0cP5ExxNsTT1QQ= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics v0.130.0 h1:uj6ai6KVAY0KFeXn0tTTfvnFCF+WCMM7jfSMk7uZa3g= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics v0.130.0/go.mod h1:vggHY5WvnwKCuPW0hEIkWtctseFY6MjRLC+x7C2eN4k= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.130.0 h1:090RkesBp0ZPPkW87wzEybW6yr5iOQhaYhEvQYjDdBY= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.130.0/go.mod h1:zXiPlI3Nd/3Jbk48LhryjJMF9UGHMMz4kRQjSq7iIOQ= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.130.0 h1:edJA3qW9ks+8Nu4jOOZmfN7gSWcqV/dcRaQMtKAlcYI= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.130.0/go.mod h1:RHN0+zoQFqqvBN8Q5/gTNSQSz1lJQTQRvPfgODTR/jw= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor v0.130.0 h1:SV46o2HapBmJGpwFhOrppa9qqijMewbayW14lkoiGoQ= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor v0.130.0/go.mod h1:f9Uf3Em5DITSQ6MTxBb60GYmFwErIPp+006jYPPG9BI= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics v0.131.0 h1:NSZ6VRg3mJ8hA/fBeF7qKHXpZYoEbwIjAnlkiqxOaFg= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics v0.131.0/go.mod h1:NmxQfeMHjGxy7/u8baex+hmkLsOw+7EpM+0hqGkb6H0= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.131.0 h1:FkcLP8lqQv1oHAgUJb9O250Gf5EGaKURJ9rFLa5LBAs= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.131.0/go.mod h1:29C3uJZWtRu6wM4xqm023BcN6SpYge2eJs/5bAq2dGU= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.131.0 h1:lb0PuWuVEQPafzYBhrS8AX0sugKjG7RDi9+DRStjJhE= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.131.0/go.mod h1:PmUOI9ZjJpUXFp8V6NE/r0mnmJAmHU/x9A+N7YYMJ1o= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor v0.131.0 h1:TD8etQYC10vX+NO2BL073nmF3h/ekucqdDcCdfLNsxE= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor v0.131.0/go.mod h1:49KE/fgPP1c3IIUHaL7qzVZFkYyNZl1TUCPc/QmINtw= 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.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= @@ -312,8 +313,8 @@ github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.22.0 h1:rb93p9lokFEsctTys46VnV1kLCDpVZ0a/Y92Vm0Zc6Q= -github.com/prometheus/client_golang v1.22.0/go.mod h1:R7ljNsLXhuQXYZYtw6GAE9AZg8Y7vEW5scdCXrWRXC0= +github.com/prometheus/client_golang v1.23.0 h1:ust4zpdl9r4trLY/gSjlm07PuiBq2ynaXXlptpfy8Uc= +github.com/prometheus/client_golang v1.23.0/go.mod h1:i/o0R9ByOnHX0McrTMTyhYvKE4haaf2mW08I+jGAjEE= 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/common v0.65.0 h1:QDwzd+G1twt//Kwj/Ww6E9FQq1iVMmODnILtW1t2VzE= @@ -377,40 +378,40 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= -go.opentelemetry.io/collector/component v1.36.0 h1:otxzkZrnkxxVrMKzxOQH8zOE+ZLJ5fdK2/zgd4Srxgc= -go.opentelemetry.io/collector/component v1.36.0/go.mod h1:fFcw3K1tXMf6PEIapPKcHAV+9/lMz4dcma6x9BjfVLc= -go.opentelemetry.io/collector/component/componentstatus v0.130.0 h1:tplML7bGhjHFEgF8A5HtNBov9ODHnWDw43rIsWEYUKk= -go.opentelemetry.io/collector/component/componentstatus v0.130.0/go.mod h1:s+rSsbXBa4EmT92O3rVUPsVwjQACisyMf4ntY+Ab8zs= -go.opentelemetry.io/collector/component/componenttest v0.130.0 h1:ptRTZvuMNpzT70o0+OQxkDclsFUwJaeEgU7TtD5YtWs= -go.opentelemetry.io/collector/component/componenttest v0.130.0/go.mod h1:Y3nIkIqECWbWDF6DkpY+c//98AH1lh31/8OD8ljOnmk= -go.opentelemetry.io/collector/confmap v1.36.0 h1:LrUUklsOvZTt333Wj8Mz9O9d5Qe2sFQjKt6MPnKUmOs= -go.opentelemetry.io/collector/confmap v1.36.0/go.mod h1:JHdEV7t379ocHp1YyNCFj8CqKYFYnT6/H458Ayx27uo= -go.opentelemetry.io/collector/confmap/xconfmap v0.130.0 h1:boN+LmcqKrW66fplmpUymLfFq9jBGaAa47+Rgb2FpJQ= -go.opentelemetry.io/collector/confmap/xconfmap v0.130.0/go.mod h1:KxfbZesw380GWFIs40pk1goB9e5w3y3K/ZmkS5+A9/Q= -go.opentelemetry.io/collector/consumer v1.36.0 h1:TzdIY+fo2ha5XI819n/YJrpGOVMc0oIgKMlzHsC2lY8= -go.opentelemetry.io/collector/consumer v1.36.0/go.mod h1:Br5NrQUHSAhY9Zk0BwaOwq7wAuNxG/ypxB4V1vGOF84= -go.opentelemetry.io/collector/consumer/consumertest v0.130.0 h1:Vk69HJ/SjTwpGHk+jddMxmVk/SOah8oolAAUXgYRHCc= -go.opentelemetry.io/collector/consumer/consumertest v0.130.0/go.mod h1:0VuaVYSXzzSn2zg3U0vw6qXEegmryyAKBeujTSXBQfU= -go.opentelemetry.io/collector/consumer/xconsumer v0.130.0 h1:Mc+xoW5IpdOZCX4T7WZwc6R/HqF8utoJioj3btTVpCU= -go.opentelemetry.io/collector/consumer/xconsumer v0.130.0/go.mod h1:zEvGS3hulrM8HGIjGVdTIbhcsISuOZWLMimrh7bEJI4= -go.opentelemetry.io/collector/featuregate v1.36.0 h1:rK5a4C05RuvGCvlWRFU35Zb/4V6eTNWUNTZv2mhi4bs= -go.opentelemetry.io/collector/featuregate v1.36.0/go.mod h1:Y/KsHbvREENKvvN9RlpiWk/IGBK+CATBYzIIpU7nccc= -go.opentelemetry.io/collector/internal/telemetry v0.130.0 h1:w3yrCfoHA29qm6NlQnxw8LIPyg09nCzHWjx3xF+S9aI= -go.opentelemetry.io/collector/internal/telemetry v0.130.0/go.mod h1:Yf6I/iw4EPWw+W6YRMKXU1QzVVMM7j0wUPjipfKuMLE= -go.opentelemetry.io/collector/pdata v1.36.0 h1:jg7s08dKxWaA/o5NHiFW7Hjyxp1n4xEOMQpoCztiyJk= -go.opentelemetry.io/collector/pdata v1.36.0/go.mod h1:pttpb089864qG1k0DMeXLgwwTFLk+o3fAW9I6MF9tzw= -go.opentelemetry.io/collector/pdata/pprofile v0.130.0 h1:2iSFVJlrZ5sVEvb3hvSyG5QJlW0jz1MDox4/B5BNQfU= -go.opentelemetry.io/collector/pdata/pprofile v0.130.0/go.mod h1:HB7W9u+Wn4+2U9hPXK/0Mqzu/gaxFbwln59fM0Tkcb0= -go.opentelemetry.io/collector/pdata/testdata v0.130.0 h1:AwHz3z+rWzRbh720KjMxprnB7WSe6CBE4IizuhRKD50= -go.opentelemetry.io/collector/pdata/testdata v0.130.0/go.mod h1:QYqBQJq0duCalwvPr8rSe3vC6sXAMbNtsC4166Gx208= -go.opentelemetry.io/collector/pipeline v0.130.0 h1:vl4IeMZuPGZg7lSk9ewoNLFl2Wk8t5ld3pYL0T6pKUE= -go.opentelemetry.io/collector/pipeline v0.130.0/go.mod h1:TO02zju/K6E+oFIOdi372Wk0MXd+Szy72zcTsFQwXl4= -go.opentelemetry.io/collector/processor v1.36.0 h1:lPznjCa1r2euVcgkMYRwP0tG2MukXGQlvpX8cTNLrx8= -go.opentelemetry.io/collector/processor v1.36.0/go.mod h1:7Bzn5sB31d8Bzw2IFsx3Ay1tgH4uIlVoLUT0to9wTu8= -go.opentelemetry.io/collector/processor/processortest v0.130.0 h1:fI+upRSdb/FfcuSf0MqEh9WM0tH5l91GbUjbL0j+O+Q= -go.opentelemetry.io/collector/processor/processortest v0.130.0/go.mod h1:IxVVbJQLBRX+O49UblqZ+5yGyloiVdoWDM/z+cuBtaI= -go.opentelemetry.io/collector/processor/xprocessor v0.130.0 h1:SeZF5FfLKc2UrrSrt1wbfYUgTs6vEQMMQsGPVhqjles= -go.opentelemetry.io/collector/processor/xprocessor v0.130.0/go.mod h1:nx5wDjP5hvIPEpISHELYP/j7wUwLsAdGNx+2p+GaZQI= +go.opentelemetry.io/collector/component v1.37.0 h1:yc5X0WhZwlpJ+W8Sg1fpRRjiUu3nByLe1wVOKWWRWRQ= +go.opentelemetry.io/collector/component v1.37.0/go.mod h1:SYHTXOzZLFwX075LEU6FMVBT15reVrwKHNB2En2URro= +go.opentelemetry.io/collector/component/componentstatus v0.131.0 h1:IVsyN0melBQU3QAabLj3ey1QQ+K2e8PhIcPRXH+LfiI= +go.opentelemetry.io/collector/component/componentstatus v0.131.0/go.mod h1:DotgEZNwPF9Ug2YKk2+zBlmGW4hRTJ7k7YBkZoM4xL4= +go.opentelemetry.io/collector/component/componenttest v0.131.0 h1:pvBENFUdOSIikdIExUP2+2B4K3LbZIqdUI7Kh7jNGxI= +go.opentelemetry.io/collector/component/componenttest v0.131.0/go.mod h1:5RdiTb/UaiCp1RvKH2+B6SyggGNvcY8Yd5799lJcEe4= +go.opentelemetry.io/collector/confmap v1.37.0 h1:3UJJXkd6cokRXa9SMQIeBYPXKXDRTL++1buE4T9ysss= +go.opentelemetry.io/collector/confmap v1.37.0/go.mod h1:Hno1lY2UsPUJNo6C6+kCt6ye+P+gF5+TxGdwvZQDEQ0= +go.opentelemetry.io/collector/confmap/xconfmap v0.131.0 h1:PwshpYOYticpkke6j9Dl+iN4Y2CvvaSE7G+24CVA6SY= +go.opentelemetry.io/collector/confmap/xconfmap v0.131.0/go.mod h1:DVInObn+ksNFxgYouJ7RlGBtZ4hDYTfEEe0bNsD2xMQ= +go.opentelemetry.io/collector/consumer v1.37.0 h1:RqTqEcc95Fg7T3MRPPjUX2nxzn1X88yfFUQV+AjdMK0= +go.opentelemetry.io/collector/consumer v1.37.0/go.mod h1:vDA1JDXeb7vnQ02PXIjjR6dI9LTaya+Qr89Nyt2Gl7Y= +go.opentelemetry.io/collector/consumer/consumertest v0.131.0 h1:+lgAblWlItsaWhUW10mKCmt3vTrmwvAWRSTrvrPgN/Q= +go.opentelemetry.io/collector/consumer/consumertest v0.131.0/go.mod h1:t7eH0dWqxAeIPtyvzT7mOJTKM9km2YEMjFCtaIeIl/w= +go.opentelemetry.io/collector/consumer/xconsumer v0.131.0 h1:PgCoBVF5FN87Ef2wDqLpRU7QxxIDs8dNiy9jKNdpWzk= +go.opentelemetry.io/collector/consumer/xconsumer v0.131.0/go.mod h1:xh1XRXcwk4Hxm3KSUCw/IOA0dyEoZr7Q/h0gzLnYaQo= +go.opentelemetry.io/collector/featuregate v1.37.0 h1:CjsHzjktiqq/dxid4Xkhuf3yD6oB/c7yRBWhokBJqpE= +go.opentelemetry.io/collector/featuregate v1.37.0/go.mod h1:Y/KsHbvREENKvvN9RlpiWk/IGBK+CATBYzIIpU7nccc= +go.opentelemetry.io/collector/internal/telemetry v0.131.0 h1:dqKbiGpcO8V31aWq2GRQLO/eNCs2B1IGS+qbkPFkmyc= +go.opentelemetry.io/collector/internal/telemetry v0.131.0/go.mod h1:TzNVIkIolnk/Jq/3qc4uWhL0bOeaP56jpyrMlUOeA/Y= +go.opentelemetry.io/collector/pdata v1.37.0 h1:aEEpd03GgAS352xntcYMsaxYvRXvzqEWqdrSro+TSh4= +go.opentelemetry.io/collector/pdata v1.37.0/go.mod h1:aE9l1Lcdsg7nmSoiucnWHuPYIk6T0RKzOjPepNJC5AQ= +go.opentelemetry.io/collector/pdata/pprofile v0.131.0 h1:eQ2Yq1g6wOWHjRXum9Fm0dZax/klNmjtpL7UPsEXrPo= +go.opentelemetry.io/collector/pdata/pprofile v0.131.0/go.mod h1:g4IuRFVGC89n/2bTdw0CuMJkkCY4zDb0Hu37wCKlx0c= +go.opentelemetry.io/collector/pdata/testdata v0.131.0 h1:ARWgM7MMg5D4qwp1hLTfd8BS3H1tUWwQ9iVCMeAoJ+o= +go.opentelemetry.io/collector/pdata/testdata v0.131.0/go.mod h1:cagnzOua8bdn2m4zz0DQSehR5vVe7M5JazkZs8J5nMo= +go.opentelemetry.io/collector/pipeline v0.131.0 h1:D2PhrZdXxYTVm3fOL6hZMKOhne8wI+2MsgyJNp7TTlk= +go.opentelemetry.io/collector/pipeline v0.131.0/go.mod h1:TO02zju/K6E+oFIOdi372Wk0MXd+Szy72zcTsFQwXl4= +go.opentelemetry.io/collector/processor v1.37.0 h1:yUQfHHZFs94BZNCamYx+WoN0VoN7MVEDwlU1H/pHISU= +go.opentelemetry.io/collector/processor v1.37.0/go.mod h1:TdCjl4QiiQ/JIcvonAGbXB7/cU1Sb8O7KrkN0sBmW3s= +go.opentelemetry.io/collector/processor/processortest v0.131.0 h1:Yj5LHMHjpd795k6KR0iyRWOZ+/LT6un4IVh41xgFsr4= +go.opentelemetry.io/collector/processor/processortest v0.131.0/go.mod h1:CNdxqDm+QOEpgovxOG2YrFZ5ldqe5R5lTOUMAByl5wI= +go.opentelemetry.io/collector/processor/xprocessor v0.131.0 h1:l2BjdmCr+1H7dat42fhxq45Um5Tbq7BQqjCIVTD5nyU= +go.opentelemetry.io/collector/processor/xprocessor v0.131.0/go.mod h1:uNo0JRtxJNepop+QB105ASX8MkvyusoIZYIUTm00epE= go.opentelemetry.io/collector/semconv v0.128.0 h1:MzYOz7Vgb3Kf5D7b49pqqgeUhEmOCuT10bIXb/Cc+k4= go.opentelemetry.io/collector/semconv v0.128.0/go.mod h1:OPXer4l43X23cnjLXIZnRj/qQOjSuq4TgBLI76P9hns= go.opentelemetry.io/contrib/bridges/otelzap v0.12.0 h1:FGre0nZh5BSw7G73VpT3xs38HchsfPsa2aZtMp0NPOs= @@ -452,8 +453,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM= golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc h1:TS73t7x3KarrNd5qAipmspBDS1rkMcgVG/fS1aRb4Rc= -golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc/go.mod h1:A+z0yzpGtvnG90cToK5n2tu8UJVP2XUATh+r+sfOOOc= +golang.org/x/exp v0.0.0-20250718183923-645b1fa84792 h1:R9PFI6EUdfVKgwKjZef7QIwGcBKu86OEFpJ9nUEP2l4= +golang.org/x/exp v0.0.0-20250718183923-645b1fa84792/go.mod h1:A+z0yzpGtvnG90cToK5n2tu8UJVP2XUATh+r+sfOOOc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.26.0 h1:EGMPT//Ezu+ylkCijjPc+f4Aih7sZvaAr+O3EHBxvZg= @@ -496,16 +497,16 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.241.0 h1:QKwqWQlkc6O895LchPEDUSYr22Xp3NCxpQRiWTB6avE= -google.golang.org/api v0.241.0/go.mod h1:cOVEm2TpdAGHL2z+UwyS+kmlGr3bVWQQ6sYEqkKje50= -google.golang.org/genproto v0.0.0-20250707201910-8d1bb00bc6a7 h1:FGOcxvKlJgRBVbXeugjljCfCgfKWhC42FBoYmTCWVBs= -google.golang.org/genproto v0.0.0-20250707201910-8d1bb00bc6a7/go.mod h1:249YoW4b1INqFTEop2T4aJgiO7UBYJrpejsaLvjWfI8= -google.golang.org/genproto/googleapis/api v0.0.0-20250707201910-8d1bb00bc6a7 h1:FiusG7LWj+4byqhbvmB+Q93B/mOxJLN2DTozDuZm4EU= -google.golang.org/genproto/googleapis/api v0.0.0-20250707201910-8d1bb00bc6a7/go.mod h1:kXqgZtrWaf6qS3jZOCnCH7WYfrvFjkC51bM8fz3RsCA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7 h1:pFyd6EwwL2TqFf8emdthzeX+gZE1ElRq3iM8pui4KBY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= -google.golang.org/grpc v1.73.0 h1:VIWSmpI2MegBtTuFt5/JWy2oXxtjJ/e89Z70ImfD2ok= -google.golang.org/grpc v1.73.0/go.mod h1:50sbHOUqWoCQGI8V2HQLJM0B+LMlIUjNSZmow7EVBQc= +google.golang.org/api v0.244.0 h1:lpkP8wVibSKr++NCD36XzTk/IzeKJ3klj7vbj+XU5pE= +google.golang.org/api v0.244.0/go.mod h1:dMVhVcylamkirHdzEBAIQWUCgqY885ivNeZYd7VAVr8= +google.golang.org/genproto v0.0.0-20250728155136-f173205681a0 h1:btBcgujH2+KIWEfz0s7Cdtt9R7hpwM4SAEXAdXf/ddw= +google.golang.org/genproto v0.0.0-20250728155136-f173205681a0/go.mod h1:Q4yZQ3kmmIyg6HsMjCGx2vQ8gzN+dntaPmFWz6Zj0fo= +google.golang.org/genproto/googleapis/api v0.0.0-20250728155136-f173205681a0 h1:0UOBWO4dC+e51ui0NFKSPbkHHiQ4TmrEfEZMLDyRmY8= +google.golang.org/genproto/googleapis/api v0.0.0-20250728155136-f173205681a0/go.mod h1:8ytArBbtOy2xfht+y2fqKd5DRDJRUQhqbyEnQ4bDChs= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250728155136-f173205681a0 h1:MAKi5q709QWfnkkpNQ0M12hYJ1+e8qYVDyowc4U1XZM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250728155136-f173205681a0/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= +google.golang.org/grpc v1.74.2 h1:WoosgB65DlWVC9FqI82dGsZhWFNBSLjQ84bjROOpMu4= +google.golang.org/grpc v1.74.2/go.mod h1:CtQ+BGjaAIXHs/5YS3i473GqwBBa1zGQNevxdeBEXrM= google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -522,12 +523,12 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.33.2 h1:YgwIS5jKfA+BZg//OQhkJNIfie/kmRsO0BmNaVSimvY= -k8s.io/api v0.33.2/go.mod h1:fhrbphQJSM2cXzCWgqU29xLDuks4mu7ti9vveEnpSXs= -k8s.io/apimachinery v0.33.2 h1:IHFVhqg59mb8PJWTLi8m1mAoepkUNYmptHsV+Z1m5jY= -k8s.io/apimachinery v0.33.2/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM= -k8s.io/client-go v0.33.2 h1:z8CIcc0P581x/J1ZYf4CNzRKxRvQAwoAolYPbtQes+E= -k8s.io/client-go v0.33.2/go.mod h1:9mCgT4wROvL948w6f6ArJNb7yQd7QsvqavDeZHvNmHo= +k8s.io/api v0.33.3 h1:SRd5t//hhkI1buzxb288fy2xvjubstenEKL9K51KBI8= +k8s.io/api v0.33.3/go.mod h1:01Y/iLUjNBM3TAvypct7DIj0M0NIZc+PzAHCIo0CYGE= +k8s.io/apimachinery v0.33.3 h1:4ZSrmNa0c/ZpZJhAgRdcsFcZOw1PQU1bALVQ0B3I5LA= +k8s.io/apimachinery v0.33.3/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM= +k8s.io/client-go v0.33.3 h1:M5AfDnKfYmVJif92ngN532gFqakcGi6RvaOF16efrpA= +k8s.io/client-go v0.33.3/go.mod h1:luqKBQggEf3shbxHY4uVENAxrDISLOarxpTKMiUuujg= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff h1:/usPimJzUKKu+m+TE36gUyGcf03XZEP0ZIKgKj35LS4= diff --git a/vendor/cloud.google.com/go/auth/CHANGES.md b/vendor/cloud.google.com/go/auth/CHANGES.md index 66131916eb..cbee128167 100644 --- a/vendor/cloud.google.com/go/auth/CHANGES.md +++ b/vendor/cloud.google.com/go/auth/CHANGES.md @@ -1,5 +1,12 @@ # Changelog +## [0.16.3](https://github.com/googleapis/google-cloud-go/compare/auth/v0.16.2...auth/v0.16.3) (2025-07-17) + + +### Bug Fixes + +* **auth:** Fix race condition in cachedTokenProvider.tokenAsync ([#12586](https://github.com/googleapis/google-cloud-go/issues/12586)) ([73867cc](https://github.com/googleapis/google-cloud-go/commit/73867ccc1e9808d65361bcfc0776bd95fe34dbb3)) + ## [0.16.2](https://github.com/googleapis/google-cloud-go/compare/auth/v0.16.1...auth/v0.16.2) (2025-06-04) diff --git a/vendor/cloud.google.com/go/auth/auth.go b/vendor/cloud.google.com/go/auth/auth.go index cd5e988684..fb24c43eb5 100644 --- a/vendor/cloud.google.com/go/auth/auth.go +++ b/vendor/cloud.google.com/go/auth/auth.go @@ -362,9 +362,6 @@ func (c *cachedTokenProvider) tokenState() tokenState { // blocking call to Token should likely return the same error on the main goroutine. func (c *cachedTokenProvider) tokenAsync(ctx context.Context) { fn := func() { - c.mu.Lock() - c.isRefreshRunning = true - c.mu.Unlock() t, err := c.tp.Token(ctx) c.mu.Lock() defer c.mu.Unlock() @@ -380,6 +377,7 @@ func (c *cachedTokenProvider) tokenAsync(ctx context.Context) { c.mu.Lock() defer c.mu.Unlock() if !c.isRefreshRunning && !c.isRefreshErr { + c.isRefreshRunning = true go fn() } } diff --git a/vendor/cloud.google.com/go/internal/.repo-metadata-full.json b/vendor/cloud.google.com/go/internal/.repo-metadata-full.json index 1e27fba89e..655773bf1e 100644 --- a/vendor/cloud.google.com/go/internal/.repo-metadata-full.json +++ b/vendor/cloud.google.com/go/internal/.repo-metadata-full.json @@ -239,6 +239,16 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/apps/events/subscriptions/apiv1beta": { + "api_shortname": "workspaceevents", + "distribution_name": "cloud.google.com/go/apps/events/subscriptions/apiv1beta", + "description": "Google Workspace Events API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/apps/latest/events/subscriptions/apiv1beta", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/apps/meet/apiv2": { "api_shortname": "meet", "distribution_name": "cloud.google.com/go/apps/meet/apiv2", @@ -2239,6 +2249,16 @@ "release_level": "stable", "library_type": "GAPIC_MANUAL" }, + "cloud.google.com/go/pubsub/v2": { + "api_shortname": "pubsub", + "distribution_name": "cloud.google.com/go/pubsub/v2", + "description": "Cloud Pub/Sub API", + "language": "go", + "client_library_type": "manual", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/pubsub/latest/v2", + "release_level": "stable", + "library_type": "GAPIC_MANUAL" + }, "cloud.google.com/go/pubsub/v2/apiv1": { "api_shortname": "pubsub", "distribution_name": "cloud.google.com/go/pubsub/v2/apiv1", diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md index d99d530934..a2261b7a3d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +## 1.18.2 (2025-07-31) + +### Bugs Fixed + +* Fixed a case in which `BearerTokenPolicy` didn't ensure an authentication error is non-retriable + ## 1.18.1 (2025-07-10) ### Bugs Fixed diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go index 23788b14d9..ccca7b769d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go @@ -40,5 +40,5 @@ const ( Module = "azcore" // Version is the semantic version (see http://semver.org) of this module. - Version = "v1.18.1" + Version = "v1.18.2" ) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_bearer_token.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_bearer_token.go index 1950a2e5b3..547e5a327f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_bearer_token.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_bearer_token.go @@ -97,7 +97,9 @@ func (b *BearerTokenPolicy) authenticateAndAuthorize(req *policy.Request) func(p as := acquiringResourceState{p: b, req: req, tro: tro} tk, err := b.mainResource.Get(as) if err != nil { - return err + // consider this error non-retriable because if it could be resolved by + // retrying authentication, the credential would have done so already + return errorinfo.NonRetriableError(err) } req.Raw().Header.Set(shared.HeaderAuthorization, shared.BearerTokenPrefix+tk.Token) return nil diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/errorinfo/errorinfo.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/errorinfo/errorinfo.go index 8ee66b5267..779657b23b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/errorinfo/errorinfo.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/errorinfo/errorinfo.go @@ -6,6 +6,8 @@ package errorinfo +import "errors" + // NonRetriable represents a non-transient error. This works in // conjunction with the retry policy, indicating that the error condition // is idempotent, so no retries will be attempted. @@ -15,10 +17,14 @@ type NonRetriable interface { NonRetriable() } -// NonRetriableError marks the specified error as non-retriable. -// This function takes an error as input and returns a new error that is marked as non-retriable. +// NonRetriableError ensures the specified error is [NonRetriable]. If +// the error is already [NonRetriable], it returns that error unchanged. +// Otherwise, it returns a new, [NonRetriable] error. func NonRetriableError(err error) error { - return &nonRetriableError{err} + if !errors.As(err, new(NonRetriable)) { + err = &nonRetriableError{err} + } + return err } // nonRetriableError is a struct that embeds the error interface. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/CHANGELOG.md index 0056d11241..5794101aed 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/CHANGELOG.md +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/CHANGELOG.md @@ -1,5 +1,20 @@ # Release History +## 1.6.2 (2025-07-23) + +### Other Changes +* Updated `azcore` version to `1.18.1` + +## 1.6.2-beta.2 (2025-07-08) + +### Other Changes +* Updated `azidentity` version to `1.10.1` + +## 1.6.2-beta.1 (2025-05-08) + +### Features Added +* Add support for x-ms-file-request-intent header for blob copy APIs. + ## 1.6.1 (2025-04-16) ### Bugs Fixed diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/appendblob/models.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/appendblob/models.go index 0834743f0c..33a6a516ba 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/appendblob/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/appendblob/models.go @@ -112,6 +112,8 @@ type AppendBlockFromURLOptions struct { CPKScopeInfo *blob.CPKScopeInfo + FileRequestIntent *blob.FileRequestIntentType + SourceModifiedAccessConditions *blob.SourceModifiedAccessConditions AccessConditions *blob.AccessConditions @@ -130,6 +132,7 @@ func (o *AppendBlockFromURLOptions) format() (*generated.AppendBlobClientAppendB options := &generated.AppendBlobClientAppendBlockFromURLOptions{ SourceRange: exported.FormatHTTPRange(o.Range), CopySourceAuthorization: o.CopySourceAuthorization, + FileRequestIntent: o.FileRequestIntent, } if o.SourceContentValidation != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blob/constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blob/constants.go index daef800ed0..eec8e971a2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blob/constants.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blob/constants.go @@ -233,3 +233,17 @@ func (s SourceContentValidationTypeMD5) Apply(src generated.SourceContentSetter) func (SourceContentValidationTypeMD5) notPubliclyImplementable() {} var _ SourceContentValidationType = (SourceContentValidationTypeMD5)(nil) + +// FileRequestIntentType is file request intent with valid value as Backup +type FileRequestIntentType = generated.FileShareTokenIntent + +const ( + FileRequestIntentTypeBackup FileRequestIntentType = "backup" +) + +// PossibleFileRequestIntentTypeValues returns the possible values for the FileRequestIntentType const type. +func PossibleFileRequestIntentTypeValues() []FileRequestIntentType { + return []FileRequestIntentType{ + FileRequestIntentTypeBackup, + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blob/models.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blob/models.go index d733468894..ce52da0286 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blob/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blob/models.go @@ -523,6 +523,8 @@ type CopyFromURLOptions struct { BlobTags map[string]string // Only Bearer type is supported. Credentials should be a valid OAuth access token to copy source. CopySourceAuthorization *string + // File request Intent. Valid value is backup. + FileRequestIntent *FileRequestIntentType // Specifies the date time when the blobs immutability policy is set to expire. ImmutabilityPolicyExpiry *time.Time // Specifies the immutability policy mode to set on the blob. @@ -558,6 +560,7 @@ func (o *CopyFromURLOptions) format() (*generated.BlobClientCopyFromURLOptions, CopySourceAuthorization: o.CopySourceAuthorization, ImmutabilityPolicyExpiry: o.ImmutabilityPolicyExpiry, ImmutabilityPolicyMode: o.ImmutabilityPolicyMode, + FileRequestIntent: o.FileRequestIntent, LegalHold: o.LegalHold, Metadata: o.Metadata, SourceContentMD5: o.SourceContentMD5, diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blockblob/models.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blockblob/models.go index 453d569e5d..bd5ac4d0ef 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blockblob/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blockblob/models.go @@ -82,6 +82,9 @@ type UploadBlobFromURLOptions struct { // Only Bearer type is supported. Credentials should be a valid OAuth access token to copy source. CopySourceAuthorization *string + // Valid value is backup + FileRequestIntent *blob.FileRequestIntentType + // Optional, default is true. Indicates if properties from the source blob should be copied. CopySourceBlobProperties *bool @@ -115,6 +118,7 @@ func (o *UploadBlobFromURLOptions) format() (*generated.BlockBlobClientPutBlobFr options := generated.BlockBlobClientPutBlobFromURLOptions{ BlobTagsString: shared.SerializeBlobTagsToStrPtr(o.Tags), CopySourceAuthorization: o.CopySourceAuthorization, + FileRequestIntent: o.FileRequestIntent, CopySourceBlobProperties: o.CopySourceBlobProperties, CopySourceTags: o.CopySourceTags, Metadata: o.Metadata, @@ -164,6 +168,9 @@ type StageBlockFromURLOptions struct { // SourceContentValidation contains the validation mechanism used on the range of bytes read from the source. SourceContentValidation blob.SourceContentValidationType + // File request Intent. Valid value is backup. + FileRequestIntent *blob.FileRequestIntentType + // Range specifies a range of bytes. The default value is all bytes. Range blob.HTTPRange @@ -180,6 +187,7 @@ func (o *StageBlockFromURLOptions) format() (*generated.BlockBlobClientStageBloc options := &generated.BlockBlobClientStageBlockFromURLOptions{ CopySourceAuthorization: o.CopySourceAuthorization, SourceRange: exported.FormatHTTPRange(o.Range), + FileRequestIntent: o.FileRequestIntent, } if o.SourceContentValidation != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/exported/version.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/exported/version.go index a18d0c670d..0f463a46aa 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/exported/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/exported/version.go @@ -8,5 +8,5 @@ package exported const ( ModuleName = "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob" - ModuleVersion = "v1.6.1" + ModuleVersion = "v1.6.2" ) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/autorest.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/autorest.md index 96d47c4adf..b31e81b9ca 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/autorest.md +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/autorest.md @@ -7,7 +7,7 @@ go: true clear-output-folder: false version: "^3.0.0" license-header: MICROSOFT_MIT_NO_VERSION -input-file: "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/ae95eb6a4701d844bada7d1c4f5ecf4a7444e5b8/specification/storage/data-plane/Microsoft.BlobStorage/stable/2025-01-05/blob.json" +input-file: "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/07c350e6126e53f3a25fe75536c4b3324f91475b/specification/storage/data-plane/Microsoft.BlobStorage/stable/2025-11-05/blob.json" credential-scope: "https://storage.azure.com/.default" output-folder: ../generated file-prefix: "zz_" @@ -67,7 +67,7 @@ directive: $.items.enum.push("permissions"); ``` -### Updating service version to 2025-05-05 +### Updating service version to 2025-11-05 ```yaml directive: - from: @@ -80,7 +80,7 @@ directive: where: $ transform: >- return $. - replaceAll(`[]string{"2025-01-05"}`, `[]string{ServiceVersion}`); + replaceAll(`[]string{"2025-07-05"}`, `[]string{ServiceVersion}`); ``` ### Fix CRC Response Header in PutBlob response diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/constants.go index 553cd227ef..858ac83f98 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/constants.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/constants.go @@ -6,4 +6,4 @@ package generated -const ServiceVersion = "2025-05-05" +const ServiceVersion = "2025-11-05" diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_appendblob_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_appendblob_client.go index 9f9e145b58..91969efd40 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_appendblob_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_appendblob_client.go @@ -29,7 +29,7 @@ type AppendBlobClient struct { // AppendBlob. Append Block is supported only on version 2015-02-21 version or later. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - contentLength - The length of the request. // - body - Initial data // - options - AppendBlobClientAppendBlockOptions contains the optional parameters for the AppendBlobClient.AppendBlock method. @@ -122,7 +122,7 @@ func (client *AppendBlobClient) appendBlockCreateRequest(ctx context.Context, co if options != nil && options.StructuredContentLength != nil { req.Raw().Header["x-ms-structured-content-length"] = []string{strconv.FormatInt(*options.StructuredContentLength, 10)} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} if err := req.SetBody(body, "application/octet-stream"); err != nil { return nil, err } @@ -207,7 +207,7 @@ func (client *AppendBlobClient) appendBlockHandleResponse(resp *http.Response) ( // created with x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - sourceURL - Specify a URL to the copy source. // - contentLength - The length of the request. // - options - AppendBlobClientAppendBlockFromURLOptions contains the optional parameters for the AppendBlobClient.AppendBlockFromURL @@ -292,6 +292,9 @@ func (client *AppendBlobClient) appendBlockFromURLCreateRequest(ctx context.Cont if cpkScopeInfo != nil && cpkScopeInfo.EncryptionScope != nil { req.Raw().Header["x-ms-encryption-scope"] = []string{*cpkScopeInfo.EncryptionScope} } + if options != nil && options.FileRequestIntent != nil { + req.Raw().Header["x-ms-file-request-intent"] = []string{string(*options.FileRequestIntent)} + } if modifiedAccessConditions != nil && modifiedAccessConditions.IfTags != nil { req.Raw().Header["x-ms-if-tags"] = []string{*modifiedAccessConditions.IfTags} } @@ -319,7 +322,7 @@ func (client *AppendBlobClient) appendBlockFromURLCreateRequest(ctx context.Cont if options != nil && options.SourceRange != nil { req.Raw().Header["x-ms-source-range"] = []string{*options.SourceRange} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -393,7 +396,7 @@ func (client *AppendBlobClient) appendBlockFromURLHandleResponse(resp *http.Resp // Create - The Create Append Blob operation creates a new append blob. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - contentLength - The length of the request. // - options - AppendBlobClientCreateOptions contains the optional parameters for the AppendBlobClient.Create method. // - BlobHTTPHeaders - BlobHTTPHeaders contains a group of parameters for the BlobClient.SetHTTPHeaders method. @@ -503,7 +506,7 @@ func (client *AppendBlobClient) createCreateRequest(ctx context.Context, content if options != nil && options.BlobTagsString != nil { req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -566,7 +569,7 @@ func (client *AppendBlobClient) createHandleResponse(resp *http.Response) (Appen // or later. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - AppendBlobClientSealOptions contains the optional parameters for the AppendBlobClient.Seal method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -624,7 +627,7 @@ func (client *AppendBlobClient) sealCreateRequest(ctx context.Context, options * if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_blob_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_blob_client.go index 54b2999894..b0dd56bb7b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_blob_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_blob_client.go @@ -29,7 +29,7 @@ type BlobClient struct { // blob with zero length and full metadata. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - copyID - The copy identifier provided in the x-ms-copy-id header of the original Copy Blob operation. // - options - BlobClientAbortCopyFromURLOptions contains the optional parameters for the BlobClient.AbortCopyFromURL method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. @@ -72,7 +72,7 @@ func (client *BlobClient) abortCopyFromURLCreateRequest(ctx context.Context, cop if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -101,7 +101,7 @@ func (client *BlobClient) abortCopyFromURLHandleResponse(resp *http.Response) (B // AcquireLease - [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - duration - Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. A non-infinite // lease can be between 15 and 60 seconds. A lease duration cannot be changed using // renew or change. @@ -161,7 +161,7 @@ func (client *BlobClient) acquireLeaseCreateRequest(ctx context.Context, duratio if options != nil && options.ProposedLeaseID != nil { req.Raw().Header["x-ms-proposed-lease-id"] = []string{*options.ProposedLeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -203,7 +203,7 @@ func (client *BlobClient) acquireLeaseHandleResponse(resp *http.Response) (BlobC // BreakLease - [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - BlobClientBreakLeaseOptions contains the optional parameters for the BlobClient.BreakLease method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. func (client *BlobClient) BreakLease(ctx context.Context, options *BlobClientBreakLeaseOptions, modifiedAccessConditions *ModifiedAccessConditions) (BlobClientBreakLeaseResponse, error) { @@ -259,7 +259,7 @@ func (client *BlobClient) breakLeaseCreateRequest(ctx context.Context, options * if options != nil && options.BreakPeriod != nil { req.Raw().Header["x-ms-lease-break-period"] = []string{strconv.FormatInt(int64(*options.BreakPeriod), 10)} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -306,7 +306,7 @@ func (client *BlobClient) breakLeaseHandleResponse(resp *http.Response) (BlobCli // ChangeLease - [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - leaseID - Specifies the current lease ID on the resource. // - proposedLeaseID - Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) if the proposed // lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID @@ -365,7 +365,7 @@ func (client *BlobClient) changeLeaseCreateRequest(ctx context.Context, leaseID req.Raw().Header["x-ms-lease-action"] = []string{"change"} req.Raw().Header["x-ms-lease-id"] = []string{leaseID} req.Raw().Header["x-ms-proposed-lease-id"] = []string{proposedLeaseID} - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -408,7 +408,7 @@ func (client *BlobClient) changeLeaseHandleResponse(resp *http.Response) (BlobCl // until the copy is complete. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - copySource - Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in length that specifies // a page blob snapshot. The value should be URL-encoded as it would appear in a request // URI. The source blob must either be public or must be authenticated via a shared access signature. @@ -476,6 +476,9 @@ func (client *BlobClient) copyFromURLCreateRequest(ctx context.Context, copySour if cpkScopeInfo != nil && cpkScopeInfo.EncryptionScope != nil { req.Raw().Header["x-ms-encryption-scope"] = []string{*cpkScopeInfo.EncryptionScope} } + if options != nil && options.FileRequestIntent != nil { + req.Raw().Header["x-ms-file-request-intent"] = []string{string(*options.FileRequestIntent)} + } if modifiedAccessConditions != nil && modifiedAccessConditions.IfTags != nil { req.Raw().Header["x-ms-if-tags"] = []string{*modifiedAccessConditions.IfTags} } @@ -517,7 +520,7 @@ func (client *BlobClient) copyFromURLCreateRequest(ctx context.Context, copySour if options != nil && options.BlobTagsString != nil { req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -582,7 +585,7 @@ func (client *BlobClient) copyFromURLHandleResponse(resp *http.Response) (BlobCl // CreateSnapshot - The Create Snapshot operation creates a read-only snapshot of a blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - BlobClientCreateSnapshotOptions contains the optional parameters for the BlobClient.CreateSnapshot method. // - CPKInfo - CPKInfo contains a group of parameters for the BlobClient.Download method. // - CPKScopeInfo - CPKScopeInfo contains a group of parameters for the BlobClient.SetMetadata method. @@ -659,7 +662,7 @@ func (client *BlobClient) createSnapshotCreateRequest(ctx context.Context, optio } } } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -721,7 +724,7 @@ func (client *BlobClient) createSnapshotHandleResponse(resp *http.Response) (Blo // return an HTTP status code of 404 (ResourceNotFound). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - BlobClientDeleteOptions contains the optional parameters for the BlobClient.Delete method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -788,7 +791,7 @@ func (client *BlobClient) deleteCreateRequest(ctx context.Context, options *Blob if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -817,7 +820,7 @@ func (client *BlobClient) deleteHandleResponse(resp *http.Response) (BlobClientD // DeleteImmutabilityPolicy - The Delete Immutability Policy operation deletes the immutability policy on the blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - BlobClientDeleteImmutabilityPolicyOptions contains the optional parameters for the BlobClient.DeleteImmutabilityPolicy // method. func (client *BlobClient) DeleteImmutabilityPolicy(ctx context.Context, options *BlobClientDeleteImmutabilityPolicyOptions) (BlobClientDeleteImmutabilityPolicyResponse, error) { @@ -860,7 +863,7 @@ func (client *BlobClient) deleteImmutabilityPolicyCreateRequest(ctx context.Cont if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -890,7 +893,7 @@ func (client *BlobClient) deleteImmutabilityPolicyHandleResponse(resp *http.Resp // can also call Download to read a snapshot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - BlobClientDownloadOptions contains the optional parameters for the BlobClient.Download method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. // - CPKInfo - CPKInfo contains a group of parameters for the BlobClient.Download method. @@ -974,7 +977,7 @@ func (client *BlobClient) downloadCreateRequest(ctx context.Context, options *Bl if options != nil && options.StructuredBodyType != nil { req.Raw().Header["x-ms-structured-body"] = []string{*options.StructuredBodyType} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -1211,7 +1214,7 @@ func (client *BlobClient) downloadHandleResponse(resp *http.Response) (BlobClien // GetAccountInfo - Returns the sku name and account kind // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - BlobClientGetAccountInfoOptions contains the optional parameters for the BlobClient.GetAccountInfo method. func (client *BlobClient) GetAccountInfo(ctx context.Context, options *BlobClientGetAccountInfoOptions) (BlobClientGetAccountInfoResponse, error) { var err error @@ -1248,7 +1251,7 @@ func (client *BlobClient) getAccountInfoCreateRequest(ctx context.Context, optio if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -1291,7 +1294,7 @@ func (client *BlobClient) getAccountInfoHandleResponse(resp *http.Response) (Blo // for the blob. It does not return the content of the blob. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - BlobClientGetPropertiesOptions contains the optional parameters for the BlobClient.GetProperties method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. // - CPKInfo - CPKInfo contains a group of parameters for the BlobClient.Download method. @@ -1362,7 +1365,7 @@ func (client *BlobClient) getPropertiesCreateRequest(ctx context.Context, option if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -1609,7 +1612,7 @@ func (client *BlobClient) getPropertiesHandleResponse(resp *http.Response) (Blob // GetTags - The Get Tags operation enables users to get the tags associated with a blob. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - BlobClientGetTagsOptions contains the optional parameters for the BlobClient.GetTags method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. @@ -1659,7 +1662,7 @@ func (client *BlobClient) getTagsCreateRequest(ctx context.Context, options *Blo if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -1691,7 +1694,7 @@ func (client *BlobClient) getTagsHandleResponse(resp *http.Response) (BlobClient // Query - The Query operation enables users to select/project on blob data by providing simple query expressions. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - BlobClientQueryOptions contains the optional parameters for the BlobClient.Query method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. // - CPKInfo - CPKInfo contains a group of parameters for the BlobClient.Download method. @@ -1761,7 +1764,7 @@ func (client *BlobClient) queryCreateRequest(ctx context.Context, options *BlobC if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} if options != nil && options.QueryRequest != nil { if err := runtime.MarshalAsXML(req, *options.QueryRequest); err != nil { return nil, err @@ -1925,7 +1928,7 @@ func (client *BlobClient) queryHandleResponse(resp *http.Response) (BlobClientQu // ReleaseLease - [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - leaseID - Specifies the current lease ID on the resource. // - options - BlobClientReleaseLeaseOptions contains the optional parameters for the BlobClient.ReleaseLease method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -1980,7 +1983,7 @@ func (client *BlobClient) releaseLeaseCreateRequest(ctx context.Context, leaseID } req.Raw().Header["x-ms-lease-action"] = []string{"release"} req.Raw().Header["x-ms-lease-id"] = []string{leaseID} - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -2019,7 +2022,7 @@ func (client *BlobClient) releaseLeaseHandleResponse(resp *http.Response) (BlobC // RenewLease - [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - leaseID - Specifies the current lease ID on the resource. // - options - BlobClientRenewLeaseOptions contains the optional parameters for the BlobClient.RenewLease method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -2074,7 +2077,7 @@ func (client *BlobClient) renewLeaseCreateRequest(ctx context.Context, leaseID s } req.Raw().Header["x-ms-lease-action"] = []string{"renew"} req.Raw().Header["x-ms-lease-id"] = []string{leaseID} - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -2116,7 +2119,7 @@ func (client *BlobClient) renewLeaseHandleResponse(resp *http.Response) (BlobCli // SetExpiry - Sets the time a blob will expire and be deleted. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - expiryOptions - Required. Indicates mode of the expiry time // - options - BlobClientSetExpiryOptions contains the optional parameters for the BlobClient.SetExpiry method. func (client *BlobClient) SetExpiry(ctx context.Context, expiryOptions ExpiryOptions, options *BlobClientSetExpiryOptions) (BlobClientSetExpiryResponse, error) { @@ -2157,7 +2160,7 @@ func (client *BlobClient) setExpiryCreateRequest(ctx context.Context, expiryOpti if options != nil && options.ExpiresOn != nil { req.Raw().Header["x-ms-expiry-time"] = []string{*options.ExpiresOn} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -2196,7 +2199,7 @@ func (client *BlobClient) setExpiryHandleResponse(resp *http.Response) (BlobClie // SetHTTPHeaders - The Set HTTP Headers operation sets system properties on the blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - BlobClientSetHTTPHeadersOptions contains the optional parameters for the BlobClient.SetHTTPHeaders method. // - BlobHTTPHeaders - BlobHTTPHeaders contains a group of parameters for the BlobClient.SetHTTPHeaders method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. @@ -2271,7 +2274,7 @@ func (client *BlobClient) setHTTPHeadersCreateRequest(ctx context.Context, optio if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -2317,7 +2320,7 @@ func (client *BlobClient) setHTTPHeadersHandleResponse(resp *http.Response) (Blo // SetImmutabilityPolicy - The Set Immutability Policy operation sets the immutability policy on the blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - BlobClientSetImmutabilityPolicyOptions contains the optional parameters for the BlobClient.SetImmutabilityPolicy // method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -2370,7 +2373,7 @@ func (client *BlobClient) setImmutabilityPolicyCreateRequest(ctx context.Context if options != nil && options.ImmutabilityPolicyExpiry != nil { req.Raw().Header["x-ms-immutability-policy-until-date"] = []string{(*options.ImmutabilityPolicyExpiry).In(gmt).Format(time.RFC1123)} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -2409,7 +2412,7 @@ func (client *BlobClient) setImmutabilityPolicyHandleResponse(resp *http.Respons // SetLegalHold - The Set Legal Hold operation sets a legal hold on the blob. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - legalHold - Specified if a legal hold should be set on the blob. // - options - BlobClientSetLegalHoldOptions contains the optional parameters for the BlobClient.SetLegalHold method. func (client *BlobClient) SetLegalHold(ctx context.Context, legalHold bool, options *BlobClientSetLegalHoldOptions) (BlobClientSetLegalHoldResponse, error) { @@ -2453,7 +2456,7 @@ func (client *BlobClient) setLegalHoldCreateRequest(ctx context.Context, legalHo req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } req.Raw().Header["x-ms-legal-hold"] = []string{strconv.FormatBool(legalHold)} - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -2490,7 +2493,7 @@ func (client *BlobClient) setLegalHoldHandleResponse(resp *http.Response) (BlobC // pairs // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - BlobClientSetMetadataOptions contains the optional parameters for the BlobClient.SetMetadata method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. // - CPKInfo - CPKInfo contains a group of parameters for the BlobClient.Download method. @@ -2567,7 +2570,7 @@ func (client *BlobClient) setMetadataCreateRequest(ctx context.Context, options } } } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -2622,7 +2625,7 @@ func (client *BlobClient) setMetadataHandleResponse(resp *http.Response) (BlobCl // SetTags - The Set Tags operation enables users to set tags on a blob. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - tags - Blob tags // - options - BlobClientSetTagsOptions contains the optional parameters for the BlobClient.SetTags method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -2676,7 +2679,7 @@ func (client *BlobClient) setTagsCreateRequest(ctx context.Context, tags BlobTag if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} if err := runtime.MarshalAsXML(req, tags); err != nil { return nil, err } @@ -2711,7 +2714,7 @@ func (client *BlobClient) setTagsHandleResponse(resp *http.Response) (BlobClient // storage type. This operation does not update the blob's ETag. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - tier - Indicates the tier to be set on the blob. // - options - BlobClientSetTierOptions contains the optional parameters for the BlobClient.SetTier method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. @@ -2766,7 +2769,7 @@ func (client *BlobClient) setTierCreateRequest(ctx context.Context, tier AccessT if options != nil && options.RehydratePriority != nil { req.Raw().Header["x-ms-rehydrate-priority"] = []string{string(*options.RehydratePriority)} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -2788,7 +2791,7 @@ func (client *BlobClient) setTierHandleResponse(resp *http.Response) (BlobClient // StartCopyFromURL - The Start Copy From URL operation copies a blob or an internet resource to a new blob. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - copySource - Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in length that specifies // a page blob snapshot. The value should be URL-encoded as it would appear in a request // URI. The source blob must either be public or must be authenticated via a shared access signature. @@ -2892,7 +2895,7 @@ func (client *BlobClient) startCopyFromURLCreateRequest(ctx context.Context, cop if options != nil && options.BlobTagsString != nil { req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -2940,7 +2943,7 @@ func (client *BlobClient) startCopyFromURLHandleResponse(resp *http.Response) (B // Undelete - Undelete a blob that was previously soft deleted // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - BlobClientUndeleteOptions contains the optional parameters for the BlobClient.Undelete method. func (client *BlobClient) Undelete(ctx context.Context, options *BlobClientUndeleteOptions) (BlobClientUndeleteResponse, error) { var err error @@ -2976,7 +2979,7 @@ func (client *BlobClient) undeleteCreateRequest(ctx context.Context, options *Bl if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_blockblob_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_blockblob_client.go index 324db7651d..e61d6f55b1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_blockblob_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_blockblob_client.go @@ -33,7 +33,7 @@ type BlockBlobClient struct { // belong to. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - blocks - Blob Blocks. // - options - BlockBlobClientCommitBlockListOptions contains the optional parameters for the BlockBlobClient.CommitBlockList // method. @@ -152,7 +152,7 @@ func (client *BlockBlobClient) commitBlockListCreateRequest(ctx context.Context, if options != nil && options.BlobTagsString != nil { req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} if err := runtime.MarshalAsXML(req, blocks); err != nil { return nil, err } @@ -224,7 +224,7 @@ func (client *BlockBlobClient) commitBlockListHandleResponse(resp *http.Response // GetBlockList - The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - listType - Specifies whether to return the list of committed blocks, the list of uncommitted blocks, or both lists together. // - options - BlockBlobClientGetBlockListOptions contains the optional parameters for the BlockBlobClient.GetBlockList method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. @@ -273,7 +273,7 @@ func (client *BlockBlobClient) getBlockListCreateRequest(ctx context.Context, li if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -329,7 +329,7 @@ func (client *BlockBlobClient) getBlockListHandleResponse(resp *http.Response) ( // Block from URL API in conjunction with Put Block List. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - contentLength - The length of the request. // - copySource - Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in length that specifies // a page blob snapshot. The value should be URL-encoded as it would appear in a request @@ -436,6 +436,9 @@ func (client *BlockBlobClient) putBlobFromURLCreateRequest(ctx context.Context, if cpkScopeInfo != nil && cpkScopeInfo.EncryptionScope != nil { req.Raw().Header["x-ms-encryption-scope"] = []string{*cpkScopeInfo.EncryptionScope} } + if options != nil && options.FileRequestIntent != nil { + req.Raw().Header["x-ms-file-request-intent"] = []string{string(*options.FileRequestIntent)} + } if modifiedAccessConditions != nil && modifiedAccessConditions.IfTags != nil { req.Raw().Header["x-ms-if-tags"] = []string{*modifiedAccessConditions.IfTags} } @@ -470,7 +473,7 @@ func (client *BlockBlobClient) putBlobFromURLCreateRequest(ctx context.Context, if options != nil && options.BlobTagsString != nil { req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -532,7 +535,7 @@ func (client *BlockBlobClient) putBlobFromURLHandleResponse(resp *http.Response) // StageBlock - The Stage Block operation creates a new block to be committed as part of a blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - blockID - A valid Base64 string value that identifies the block. Prior to encoding, the string must be less than or equal // to 64 bytes in size. For a given blob, the length of the value specified for the blockid // parameter must be the same size for each block. @@ -605,7 +608,7 @@ func (client *BlockBlobClient) stageBlockCreateRequest(ctx context.Context, bloc if options != nil && options.StructuredContentLength != nil { req.Raw().Header["x-ms-structured-content-length"] = []string{strconv.FormatInt(*options.StructuredContentLength, 10)} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} if err := req.SetBody(body, "application/octet-stream"); err != nil { return nil, err } @@ -668,7 +671,7 @@ func (client *BlockBlobClient) stageBlockHandleResponse(resp *http.Response) (Bl // are read from a URL. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - blockID - A valid Base64 string value that identifies the block. Prior to encoding, the string must be less than or equal // to 64 bytes in size. For a given blob, the length of the value specified for the blockid // parameter must be the same size for each block. @@ -733,6 +736,9 @@ func (client *BlockBlobClient) stageBlockFromURLCreateRequest(ctx context.Contex if cpkScopeInfo != nil && cpkScopeInfo.EncryptionScope != nil { req.Raw().Header["x-ms-encryption-scope"] = []string{*cpkScopeInfo.EncryptionScope} } + if options != nil && options.FileRequestIntent != nil { + req.Raw().Header["x-ms-file-request-intent"] = []string{string(*options.FileRequestIntent)} + } if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } @@ -757,7 +763,7 @@ func (client *BlockBlobClient) stageBlockFromURLCreateRequest(ctx context.Contex if options != nil && options.SourceRange != nil { req.Raw().Header["x-ms-source-range"] = []string{*options.SourceRange} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -816,7 +822,7 @@ func (client *BlockBlobClient) stageBlockFromURLHandleResponse(resp *http.Respon // the content of a block blob, use the Put Block List operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - contentLength - The length of the request. // - body - Initial data // - options - BlockBlobClientUploadOptions contains the optional parameters for the BlockBlobClient.Upload method. @@ -942,7 +948,7 @@ func (client *BlockBlobClient) uploadCreateRequest(ctx context.Context, contentL if options != nil && options.BlobTagsString != nil { req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} if err := req.SetBody(body, "application/octet-stream"); err != nil { return nil, err } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_constants.go index 48724a4ce4..e48dc71908 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_constants.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_constants.go @@ -236,6 +236,19 @@ func PossibleExpiryOptionsValues() []ExpiryOptions { } } +type FileShareTokenIntent string + +const ( + FileShareTokenIntentBackup FileShareTokenIntent = "backup" +) + +// PossibleFileShareTokenIntentValues returns the possible values for the FileShareTokenIntent const type. +func PossibleFileShareTokenIntentValues() []FileShareTokenIntent { + return []FileShareTokenIntent{ + FileShareTokenIntentBackup, + } +} + type FilterBlobsIncludeItem string const ( diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_container_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_container_client.go index 61ddc6695c..238971dd87 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_container_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_container_client.go @@ -31,7 +31,7 @@ type ContainerClient struct { // to 60 seconds, or can be infinite // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - duration - Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. A non-infinite // lease can be between 15 and 60 seconds. A lease duration cannot be changed using // renew or change. @@ -83,7 +83,7 @@ func (client *ContainerClient) acquireLeaseCreateRequest(ctx context.Context, du if options != nil && options.ProposedLeaseID != nil { req.Raw().Header["x-ms-proposed-lease-id"] = []string{*options.ProposedLeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -126,7 +126,7 @@ func (client *ContainerClient) acquireLeaseHandleResponse(resp *http.Response) ( // to 60 seconds, or can be infinite // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - ContainerClientBreakLeaseOptions contains the optional parameters for the ContainerClient.BreakLease method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. func (client *ContainerClient) BreakLease(ctx context.Context, options *ContainerClientBreakLeaseOptions, modifiedAccessConditions *ModifiedAccessConditions) (ContainerClientBreakLeaseResponse, error) { @@ -174,7 +174,7 @@ func (client *ContainerClient) breakLeaseCreateRequest(ctx context.Context, opti if options != nil && options.BreakPeriod != nil { req.Raw().Header["x-ms-lease-break-period"] = []string{strconv.FormatInt(int64(*options.BreakPeriod), 10)} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -222,7 +222,7 @@ func (client *ContainerClient) breakLeaseHandleResponse(resp *http.Response) (Co // to 60 seconds, or can be infinite // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - leaseID - Specifies the current lease ID on the resource. // - proposedLeaseID - Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) if the proposed // lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID @@ -273,7 +273,7 @@ func (client *ContainerClient) changeLeaseCreateRequest(ctx context.Context, lea req.Raw().Header["x-ms-lease-action"] = []string{"change"} req.Raw().Header["x-ms-lease-id"] = []string{leaseID} req.Raw().Header["x-ms-proposed-lease-id"] = []string{proposedLeaseID} - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -316,7 +316,7 @@ func (client *ContainerClient) changeLeaseHandleResponse(resp *http.Response) (C // fails // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - ContainerClientCreateOptions contains the optional parameters for the ContainerClient.Create method. // - ContainerCPKScopeInfo - ContainerCPKScopeInfo contains a group of parameters for the ContainerClient.Create method. func (client *ContainerClient) Create(ctx context.Context, options *ContainerClientCreateOptions, containerCPKScopeInfo *ContainerCPKScopeInfo) (ContainerClientCreateResponse, error) { @@ -369,7 +369,7 @@ func (client *ContainerClient) createCreateRequest(ctx context.Context, options } } } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -409,7 +409,7 @@ func (client *ContainerClient) createHandleResponse(resp *http.Response) (Contai // deleted during garbage collection // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - ContainerClientDeleteOptions contains the optional parameters for the ContainerClient.Delete method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -456,7 +456,7 @@ func (client *ContainerClient) deleteCreateRequest(ctx context.Context, options if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -486,7 +486,7 @@ func (client *ContainerClient) deleteHandleResponse(resp *http.Response) (Contai // Filter blobs searches within the given container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - where - Filters the results to return only to return only blobs whose tags match the specified expression. // - options - ContainerClientFilterBlobsOptions contains the optional parameters for the ContainerClient.FilterBlobs method. func (client *ContainerClient) FilterBlobs(ctx context.Context, where string, options *ContainerClientFilterBlobsOptions) (ContainerClientFilterBlobsResponse, error) { @@ -534,7 +534,7 @@ func (client *ContainerClient) filterBlobsCreateRequest(ctx context.Context, whe if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -567,7 +567,7 @@ func (client *ContainerClient) filterBlobsHandleResponse(resp *http.Response) (C // be accessed publicly. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - ContainerClientGetAccessPolicyOptions contains the optional parameters for the ContainerClient.GetAccessPolicy // method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. @@ -609,7 +609,7 @@ func (client *ContainerClient) getAccessPolicyCreateRequest(ctx context.Context, if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -654,7 +654,7 @@ func (client *ContainerClient) getAccessPolicyHandleResponse(resp *http.Response // GetAccountInfo - Returns the sku name and account kind // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - ContainerClientGetAccountInfoOptions contains the optional parameters for the ContainerClient.GetAccountInfo // method. func (client *ContainerClient) GetAccountInfo(ctx context.Context, options *ContainerClientGetAccountInfoOptions) (ContainerClientGetAccountInfoResponse, error) { @@ -692,7 +692,7 @@ func (client *ContainerClient) getAccountInfoCreateRequest(ctx context.Context, if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -735,7 +735,7 @@ func (client *ContainerClient) getAccountInfoHandleResponse(resp *http.Response) // does not include the container's list of blobs // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - ContainerClientGetPropertiesOptions contains the optional parameters for the ContainerClient.GetProperties method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. func (client *ContainerClient) GetProperties(ctx context.Context, options *ContainerClientGetPropertiesOptions, leaseAccessConditions *LeaseAccessConditions) (ContainerClientGetPropertiesResponse, error) { @@ -775,7 +775,7 @@ func (client *ContainerClient) getPropertiesCreateRequest(ctx context.Context, o if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -864,7 +864,7 @@ func (client *ContainerClient) getPropertiesHandleResponse(resp *http.Response) // NewListBlobFlatSegmentPager - [Update] The List Blobs operation returns a list of the blobs under the specified container // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - ContainerClientListBlobFlatSegmentOptions contains the optional parameters for the ContainerClient.NewListBlobFlatSegmentPager // method. // @@ -897,7 +897,7 @@ func (client *ContainerClient) ListBlobFlatSegmentCreateRequest(ctx context.Cont if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -931,7 +931,7 @@ func (client *ContainerClient) ListBlobFlatSegmentHandleResponse(resp *http.Resp // NewListBlobHierarchySegmentPager - [Update] The List Blobs operation returns a list of the blobs under the specified container // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - delimiter - When the request includes this parameter, the operation returns a BlobPrefix element in the response body that // acts as a placeholder for all blobs whose names begin with the same substring up to the // appearance of the delimiter character. The delimiter may be a single character or a string. @@ -988,7 +988,7 @@ func (client *ContainerClient) ListBlobHierarchySegmentCreateRequest(ctx context if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -1024,7 +1024,7 @@ func (client *ContainerClient) ListBlobHierarchySegmentHandleResponse(resp *http // to 60 seconds, or can be infinite // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - leaseID - Specifies the current lease ID on the resource. // - options - ContainerClientReleaseLeaseOptions contains the optional parameters for the ContainerClient.ReleaseLease method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -1071,7 +1071,7 @@ func (client *ContainerClient) releaseLeaseCreateRequest(ctx context.Context, le } req.Raw().Header["x-ms-lease-action"] = []string{"release"} req.Raw().Header["x-ms-lease-id"] = []string{leaseID} - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -1110,7 +1110,7 @@ func (client *ContainerClient) releaseLeaseHandleResponse(resp *http.Response) ( // Rename - Renames an existing container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - sourceContainerName - Required. Specifies the name of the container to rename. // - options - ContainerClientRenameOptions contains the optional parameters for the ContainerClient.Rename method. func (client *ContainerClient) Rename(ctx context.Context, sourceContainerName string, options *ContainerClientRenameOptions) (ContainerClientRenameResponse, error) { @@ -1152,7 +1152,7 @@ func (client *ContainerClient) renameCreateRequest(ctx context.Context, sourceCo if options != nil && options.SourceLeaseID != nil { req.Raw().Header["x-ms-source-lease-id"] = []string{*options.SourceLeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -1182,7 +1182,7 @@ func (client *ContainerClient) renameHandleResponse(resp *http.Response) (Contai // to 60 seconds, or can be infinite // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - leaseID - Specifies the current lease ID on the resource. // - options - ContainerClientRenewLeaseOptions contains the optional parameters for the ContainerClient.RenewLease method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -1229,7 +1229,7 @@ func (client *ContainerClient) renewLeaseCreateRequest(ctx context.Context, leas } req.Raw().Header["x-ms-lease-action"] = []string{"renew"} req.Raw().Header["x-ms-lease-id"] = []string{leaseID} - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -1271,7 +1271,7 @@ func (client *ContainerClient) renewLeaseHandleResponse(resp *http.Response) (Co // Restore - Restores a previously-deleted container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - ContainerClientRestoreOptions contains the optional parameters for the ContainerClient.Restore method. func (client *ContainerClient) Restore(ctx context.Context, options *ContainerClientRestoreOptions) (ContainerClientRestoreResponse, error) { var err error @@ -1314,7 +1314,7 @@ func (client *ContainerClient) restoreCreateRequest(ctx context.Context, options if options != nil && options.DeletedContainerVersion != nil { req.Raw().Header["x-ms-deleted-container-version"] = []string{*options.DeletedContainerVersion} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -1344,7 +1344,7 @@ func (client *ContainerClient) restoreHandleResponse(resp *http.Response) (Conta // may be accessed publicly. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - containerACL - the acls for the container // - options - ContainerClientSetAccessPolicyOptions contains the optional parameters for the ContainerClient.SetAccessPolicy // method. @@ -1397,7 +1397,7 @@ func (client *ContainerClient) setAccessPolicyCreateRequest(ctx context.Context, if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} type wrapper struct { XMLName xml.Name `xml:"SignedIdentifiers"` ContainerACL *[]*SignedIdentifier `xml:"SignedIdentifier"` @@ -1443,7 +1443,7 @@ func (client *ContainerClient) setAccessPolicyHandleResponse(resp *http.Response // SetMetadata - operation sets one or more user-defined name-value pairs for the specified container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - ContainerClientSetMetadataOptions contains the optional parameters for the ContainerClient.SetMetadata method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -1495,7 +1495,7 @@ func (client *ContainerClient) setMetadataCreateRequest(ctx context.Context, opt } } } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -1534,7 +1534,7 @@ func (client *ContainerClient) setMetadataHandleResponse(resp *http.Response) (C // SubmitBatch - The Batch operation allows multiple API calls to be embedded into a single HTTP request. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - contentLength - The length of the request. // - multipartContentType - Required. The value of this header must be multipart/mixed with a batch boundary. Example header // value: multipart/mixed; boundary=batch_ @@ -1578,7 +1578,7 @@ func (client *ContainerClient) submitBatchCreateRequest(ctx context.Context, con if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} if err := req.SetBody(body, multipartContentType); err != nil { return nil, err } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_options.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_options.go index 01d1422d02..290c9e1cf3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_options.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_options.go @@ -16,6 +16,9 @@ type AppendBlobClientAppendBlockFromURLOptions struct { // Only Bearer type is supported. Credentials should be a valid OAuth access token to copy source. CopySourceAuthorization *string + // Valid value is backup + FileRequestIntent *FileShareTokenIntent + // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage // analytics logging is enabled. RequestID *string @@ -30,7 +33,7 @@ type AppendBlobClientAppendBlockFromURLOptions struct { SourceRange *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 // Specify the transactional md5 for the body, to be validated by the service. @@ -51,7 +54,7 @@ type AppendBlobClientAppendBlockOptions struct { StructuredContentLength *int64 // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 // Specify the transactional crc64 for the body, to be validated by the service. @@ -88,7 +91,7 @@ type AppendBlobClientCreateOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -99,7 +102,7 @@ type AppendBlobClientSealOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -124,7 +127,7 @@ type BlobClientAbortCopyFromURLOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -140,7 +143,7 @@ type BlobClientAcquireLeaseOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -159,7 +162,7 @@ type BlobClientBreakLeaseOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -170,7 +173,7 @@ type BlobClientChangeLeaseOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -185,6 +188,9 @@ type BlobClientCopyFromURLOptions struct { // Optional, default 'replace'. Indicates if source tags should be copied or replaced with the tags specified by x-ms-tags. CopySourceTags *BlobCopySourceTags + // Valid value is backup + FileRequestIntent *FileShareTokenIntent + // Specifies the date time when the blobs immutability policy is set to expire. ImmutabilityPolicyExpiry *time.Time @@ -213,7 +219,7 @@ type BlobClientCopyFromURLOptions struct { Tier *AccessTier // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -232,7 +238,7 @@ type BlobClientCreateSnapshotOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -245,11 +251,11 @@ type BlobClientDeleteImmutabilityPolicyOptions struct { // The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more // information on working with blob snapshots, see Creating a Snapshot of a Blob. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob] + // [https://learn.microsoft.com/rest/api/storageservices/creating-a-snapshot-of-a-blob] Snapshot *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 // The version id parameter is an opaque DateTime value that, when present, specifies the version of the blob to operate on. @@ -273,11 +279,11 @@ type BlobClientDeleteOptions struct { // The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more // information on working with blob snapshots, see Creating a Snapshot of a Blob. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob] + // [https://learn.microsoft.com/rest/api/storageservices/creating-a-snapshot-of-a-blob] Snapshot *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 // The version id parameter is an opaque DateTime value that, when present, specifies the version of the blob to operate on. @@ -304,7 +310,7 @@ type BlobClientDownloadOptions struct { // The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more // information on working with blob snapshots, see Creating a Snapshot of a Blob. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob] + // [https://learn.microsoft.com/rest/api/storageservices/creating-a-snapshot-of-a-blob] Snapshot *string // Specifies the response content should be returned as a structured message and specifies the message schema version and @@ -312,7 +318,7 @@ type BlobClientDownloadOptions struct { StructuredBodyType *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 // The version id parameter is an opaque DateTime value that, when present, specifies the version of the blob to operate on. @@ -327,7 +333,7 @@ type BlobClientGetAccountInfoOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -339,11 +345,11 @@ type BlobClientGetPropertiesOptions struct { // The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more // information on working with blob snapshots, see Creating a Snapshot of a Blob. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob] + // [https://learn.microsoft.com/rest/api/storageservices/creating-a-snapshot-of-a-blob] Snapshot *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 // The version id parameter is an opaque DateTime value that, when present, specifies the version of the blob to operate on. @@ -359,11 +365,11 @@ type BlobClientGetTagsOptions struct { // The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more // information on working with blob snapshots, see Creating a Snapshot of a Blob. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob] + // [https://learn.microsoft.com/rest/api/storageservices/creating-a-snapshot-of-a-blob] Snapshot *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 // The version id parameter is an opaque DateTime value that, when present, specifies the version of the blob to operate on. @@ -382,11 +388,11 @@ type BlobClientQueryOptions struct { // The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more // information on working with blob snapshots, see Creating a Snapshot of a Blob. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob] + // [https://learn.microsoft.com/rest/api/storageservices/creating-a-snapshot-of-a-blob] Snapshot *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -397,7 +403,7 @@ type BlobClientReleaseLeaseOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -408,7 +414,7 @@ type BlobClientRenewLeaseOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -422,7 +428,7 @@ type BlobClientSetExpiryOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -433,7 +439,7 @@ type BlobClientSetHTTPHeadersOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -451,11 +457,11 @@ type BlobClientSetImmutabilityPolicyOptions struct { // The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more // information on working with blob snapshots, see Creating a Snapshot of a Blob. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob] + // [https://learn.microsoft.com/rest/api/storageservices/creating-a-snapshot-of-a-blob] Snapshot *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 // The version id parameter is an opaque DateTime value that, when present, specifies the version of the blob to operate on. @@ -471,11 +477,11 @@ type BlobClientSetLegalHoldOptions struct { // The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more // information on working with blob snapshots, see Creating a Snapshot of a Blob. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob] + // [https://learn.microsoft.com/rest/api/storageservices/creating-a-snapshot-of-a-blob] Snapshot *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 // The version id parameter is an opaque DateTime value that, when present, specifies the version of the blob to operate on. @@ -498,7 +504,7 @@ type BlobClientSetMetadataOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -509,7 +515,7 @@ type BlobClientSetTagsOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 // Specify the transactional crc64 for the body, to be validated by the service. @@ -534,11 +540,11 @@ type BlobClientSetTierOptions struct { // The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more // information on working with blob snapshots, see Creating a Snapshot of a Blob. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob] + // [https://learn.microsoft.com/rest/api/storageservices/creating-a-snapshot-of-a-blob] Snapshot *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 // The version id parameter is an opaque DateTime value that, when present, specifies the version of the blob to operate on. @@ -582,7 +588,7 @@ type BlobClientStartCopyFromURLOptions struct { Tier *AccessTier // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -593,7 +599,7 @@ type BlobClientUndeleteOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -651,7 +657,7 @@ type BlockBlobClientCommitBlockListOptions struct { Tier *AccessTier // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 // Specify the transactional crc64 for the body, to be validated by the service. @@ -669,11 +675,11 @@ type BlockBlobClientGetBlockListOptions struct { // The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more // information on working with blob snapshots, see Creating a Snapshot of a Blob. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob] + // [https://learn.microsoft.com/rest/api/storageservices/creating-a-snapshot-of-a-blob] Snapshot *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -691,6 +697,9 @@ type BlockBlobClientPutBlobFromURLOptions struct { // Optional, default 'replace'. Indicates if source tags should be copied or replaced with the tags specified by x-ms-tags. CopySourceTags *BlobCopySourceTags + // Valid value is backup + FileRequestIntent *FileShareTokenIntent + // Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value pairs are specified, the // operation will copy the metadata from the source blob or file to the destination // blob. If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and metadata @@ -710,7 +719,7 @@ type BlockBlobClientPutBlobFromURLOptions struct { Tier *AccessTier // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 // Specify the transactional md5 for the body, to be validated by the service. @@ -722,6 +731,9 @@ type BlockBlobClientStageBlockFromURLOptions struct { // Only Bearer type is supported. Credentials should be a valid OAuth access token to copy source. CopySourceAuthorization *string + // Valid value is backup + FileRequestIntent *FileShareTokenIntent + // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage // analytics logging is enabled. RequestID *string @@ -736,7 +748,7 @@ type BlockBlobClientStageBlockFromURLOptions struct { SourceRange *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -754,7 +766,7 @@ type BlockBlobClientStageBlockOptions struct { StructuredContentLength *int64 // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 // Specify the transactional crc64 for the body, to be validated by the service. @@ -801,7 +813,7 @@ type BlockBlobClientUploadOptions struct { Tier *AccessTier // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 // Specify the transactional crc64 for the body, to be validated by the service. @@ -823,7 +835,7 @@ type ContainerClientAcquireLeaseOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -842,7 +854,7 @@ type ContainerClientBreakLeaseOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -853,7 +865,7 @@ type ContainerClientChangeLeaseOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -875,7 +887,7 @@ type ContainerClientCreateOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -886,7 +898,7 @@ type ContainerClientDeleteOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -914,7 +926,7 @@ type ContainerClientFilterBlobsOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -925,7 +937,7 @@ type ContainerClientGetAccessPolicyOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -936,7 +948,7 @@ type ContainerClientGetAccountInfoOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -947,7 +959,7 @@ type ContainerClientGetPropertiesOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -979,7 +991,7 @@ type ContainerClientListBlobFlatSegmentOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -1011,7 +1023,7 @@ type ContainerClientListBlobHierarchySegmentOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -1022,7 +1034,7 @@ type ContainerClientReleaseLeaseOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -1036,7 +1048,7 @@ type ContainerClientRenameOptions struct { SourceLeaseID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -1047,7 +1059,7 @@ type ContainerClientRenewLeaseOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -1064,7 +1076,7 @@ type ContainerClientRestoreOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -1078,7 +1090,7 @@ type ContainerClientSetAccessPolicyOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -1097,7 +1109,7 @@ type ContainerClientSetMetadataOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -1108,7 +1120,7 @@ type ContainerClientSubmitBatchOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -1180,7 +1192,7 @@ type PageBlobClientClearPagesOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -1191,7 +1203,7 @@ type PageBlobClientCopyIncrementalOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -1229,7 +1241,7 @@ type PageBlobClientCreateOptions struct { Tier *PremiumPageBlobAccessTier // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -1271,11 +1283,11 @@ type PageBlobClientGetPageRangesDiffOptions struct { // The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more // information on working with blob snapshots, see Creating a Snapshot of a Blob. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob] + // [https://learn.microsoft.com/rest/api/storageservices/creating-a-snapshot-of-a-blob] Snapshot *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -1304,11 +1316,11 @@ type PageBlobClientGetPageRangesOptions struct { // The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more // information on working with blob snapshots, see Creating a Snapshot of a Blob. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob] + // [https://learn.microsoft.com/rest/api/storageservices/creating-a-snapshot-of-a-blob] Snapshot *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -1319,7 +1331,7 @@ type PageBlobClientResizeOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -1335,7 +1347,7 @@ type PageBlobClientUpdateSequenceNumberOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -1344,6 +1356,9 @@ type PageBlobClientUploadPagesFromURLOptions struct { // Only Bearer type is supported. Credentials should be a valid OAuth access token to copy source. CopySourceAuthorization *string + // Valid value is backup + FileRequestIntent *FileShareTokenIntent + // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage // analytics logging is enabled. RequestID *string @@ -1355,7 +1370,7 @@ type PageBlobClientUploadPagesFromURLOptions struct { SourceContentcrc64 []byte // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -1376,7 +1391,7 @@ type PageBlobClientUploadPagesOptions struct { StructuredContentLength *int64 // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 // Specify the transactional crc64 for the body, to be validated by the service. @@ -1422,7 +1437,7 @@ type ServiceClientFilterBlobsOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -1433,7 +1448,7 @@ type ServiceClientGetAccountInfoOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -1444,7 +1459,7 @@ type ServiceClientGetPropertiesOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -1455,7 +1470,7 @@ type ServiceClientGetStatisticsOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -1466,7 +1481,7 @@ type ServiceClientGetUserDelegationKeyOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -1498,7 +1513,7 @@ type ServiceClientListContainersSegmentOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -1509,7 +1524,7 @@ type ServiceClientSetPropertiesOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } @@ -1520,7 +1535,7 @@ type ServiceClientSubmitBatchOptions struct { RequestID *string // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. - // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + // [https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations] Timeout *int32 } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_pageblob_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_pageblob_client.go index 8d8c953473..4f2d45213b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_pageblob_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_pageblob_client.go @@ -27,7 +27,7 @@ type PageBlobClient struct { // ClearPages - The Clear Pages operation clears a set of pages from a page blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - contentLength - The length of the request. // - options - PageBlobClientClearPagesOptions contains the optional parameters for the PageBlobClient.ClearPages method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. @@ -114,7 +114,7 @@ func (client *PageBlobClient) clearPagesCreateRequest(ctx context.Context, conte if options != nil && options.Range != nil { req.Raw().Header["x-ms-range"] = []string{*options.Range} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -178,7 +178,7 @@ func (client *PageBlobClient) clearPagesHandleResponse(resp *http.Response) (Pag // 2016-05-31. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - copySource - Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in length that specifies // a page blob snapshot. The value should be URL-encoded as it would appear in a request // URI. The source blob must either be public or must be authenticated via a shared access signature. @@ -235,7 +235,7 @@ func (client *PageBlobClient) copyIncrementalCreateRequest(ctx context.Context, if modifiedAccessConditions != nil && modifiedAccessConditions.IfTags != nil { req.Raw().Header["x-ms-if-tags"] = []string{*modifiedAccessConditions.IfTags} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -280,7 +280,7 @@ func (client *PageBlobClient) copyIncrementalHandleResponse(resp *http.Response) // Create - The Create operation creates a new page blob. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - contentLength - The length of the request. // - blobContentLength - This header specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned // to a 512-byte boundary. @@ -399,7 +399,7 @@ func (client *PageBlobClient) createCreateRequest(ctx context.Context, contentLe if options != nil && options.BlobTagsString != nil { req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -461,7 +461,7 @@ func (client *PageBlobClient) createHandleResponse(resp *http.Response) (PageBlo // NewGetPageRangesPager - The Get Page Ranges operation returns the list of valid page ranges for a page blob or snapshot // of a page blob // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - PageBlobClientGetPageRangesOptions contains the optional parameters for the PageBlobClient.NewGetPageRangesPager // method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. @@ -533,7 +533,7 @@ func (client *PageBlobClient) GetPageRangesCreateRequest(ctx context.Context, op if options != nil && options.Range != nil { req.Raw().Header["x-ms-range"] = []string{*options.Range} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -582,7 +582,7 @@ func (client *PageBlobClient) GetPageRangesHandleResponse(resp *http.Response) ( // NewGetPageRangesDiffPager - The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that // were changed between target blob and previous snapshot. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - PageBlobClientGetPageRangesDiffOptions contains the optional parameters for the PageBlobClient.NewGetPageRangesDiffPager // method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. @@ -660,7 +660,7 @@ func (client *PageBlobClient) GetPageRangesDiffCreateRequest(ctx context.Context if options != nil && options.Range != nil { req.Raw().Header["x-ms-range"] = []string{*options.Range} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -709,7 +709,7 @@ func (client *PageBlobClient) GetPageRangesDiffHandleResponse(resp *http.Respons // Resize - Resize the Blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - blobContentLength - This header specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned // to a 512-byte boundary. // - options - PageBlobClientResizeOptions contains the optional parameters for the PageBlobClient.Resize method. @@ -782,7 +782,7 @@ func (client *PageBlobClient) resizeCreateRequest(ctx context.Context, blobConte if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -828,7 +828,7 @@ func (client *PageBlobClient) resizeHandleResponse(resp *http.Response) (PageBlo // UpdateSequenceNumber - Update the sequence number of the blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - sequenceNumberAction - Required if the x-ms-blob-sequence-number header is set for the request. This property applies to // page blobs only. This property indicates how the service should modify the blob's sequence number // - options - PageBlobClientUpdateSequenceNumberOptions contains the optional parameters for the PageBlobClient.UpdateSequenceNumber @@ -891,7 +891,7 @@ func (client *PageBlobClient) updateSequenceNumberCreateRequest(ctx context.Cont req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } req.Raw().Header["x-ms-sequence-number-action"] = []string{string(sequenceNumberAction)} - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -937,7 +937,7 @@ func (client *PageBlobClient) updateSequenceNumberHandleResponse(resp *http.Resp // UploadPages - The Upload Pages operation writes a range of pages to a page blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - contentLength - The length of the request. // - body - Initial data // - options - PageBlobClientUploadPagesOptions contains the optional parameters for the PageBlobClient.UploadPages method. @@ -1037,7 +1037,7 @@ func (client *PageBlobClient) uploadPagesCreateRequest(ctx context.Context, cont if options != nil && options.StructuredContentLength != nil { req.Raw().Header["x-ms-structured-content-length"] = []string{strconv.FormatInt(*options.StructuredContentLength, 10)} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} if err := req.SetBody(body, "application/octet-stream"); err != nil { return nil, err } @@ -1117,7 +1117,7 @@ func (client *PageBlobClient) uploadPagesHandleResponse(resp *http.Response) (Pa // a URL // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - sourceURL - Specify a URL to the copy source. // - sourceRange - Bytes of source data in the specified range. The length of this range should match the ContentLength header // and x-ms-range/Range destination range header. @@ -1197,6 +1197,9 @@ func (client *PageBlobClient) uploadPagesFromURLCreateRequest(ctx context.Contex if cpkScopeInfo != nil && cpkScopeInfo.EncryptionScope != nil { req.Raw().Header["x-ms-encryption-scope"] = []string{*cpkScopeInfo.EncryptionScope} } + if options != nil && options.FileRequestIntent != nil { + req.Raw().Header["x-ms-file-request-intent"] = []string{string(*options.FileRequestIntent)} + } if sequenceNumberAccessConditions != nil && sequenceNumberAccessConditions.IfSequenceNumberEqualTo != nil { req.Raw().Header["x-ms-if-sequence-number-eq"] = []string{strconv.FormatInt(*sequenceNumberAccessConditions.IfSequenceNumberEqualTo, 10)} } @@ -1233,7 +1236,7 @@ func (client *PageBlobClient) uploadPagesFromURLCreateRequest(ctx context.Contex req.Raw().Header["x-ms-source-if-unmodified-since"] = []string{(*sourceModifiedAccessConditions.SourceIfUnmodifiedSince).In(gmt).Format(time.RFC1123)} } req.Raw().Header["x-ms-source-range"] = []string{sourceRange} - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_service_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_service_client.go index 8764591b30..3a3565e2b4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_service_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_service_client.go @@ -30,7 +30,7 @@ type ServiceClient struct { // be scoped within the expression to a single container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - where - Filters the results to return only to return only blobs whose tags match the specified expression. // - options - ServiceClientFilterBlobsOptions contains the optional parameters for the ServiceClient.FilterBlobs method. func (client *ServiceClient) FilterBlobs(ctx context.Context, where string, options *ServiceClientFilterBlobsOptions) (ServiceClientFilterBlobsResponse, error) { @@ -77,7 +77,7 @@ func (client *ServiceClient) filterBlobsCreateRequest(ctx context.Context, where if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -109,7 +109,7 @@ func (client *ServiceClient) filterBlobsHandleResponse(resp *http.Response) (Ser // GetAccountInfo - Returns the sku name and account kind // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - ServiceClientGetAccountInfoOptions contains the optional parameters for the ServiceClient.GetAccountInfo method. func (client *ServiceClient) GetAccountInfo(ctx context.Context, options *ServiceClientGetAccountInfoOptions) (ServiceClientGetAccountInfoResponse, error) { var err error @@ -146,7 +146,7 @@ func (client *ServiceClient) getAccountInfoCreateRequest(ctx context.Context, op if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -189,7 +189,7 @@ func (client *ServiceClient) getAccountInfoHandleResponse(resp *http.Response) ( // CORS (Cross-Origin Resource Sharing) rules. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - ServiceClientGetPropertiesOptions contains the optional parameters for the ServiceClient.GetProperties method. func (client *ServiceClient) GetProperties(ctx context.Context, options *ServiceClientGetPropertiesOptions) (ServiceClientGetPropertiesResponse, error) { var err error @@ -226,7 +226,7 @@ func (client *ServiceClient) getPropertiesCreateRequest(ctx context.Context, opt if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -252,7 +252,7 @@ func (client *ServiceClient) getPropertiesHandleResponse(resp *http.Response) (S // location endpoint when read-access geo-redundant replication is enabled for the storage account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - ServiceClientGetStatisticsOptions contains the optional parameters for the ServiceClient.GetStatistics method. func (client *ServiceClient) GetStatistics(ctx context.Context, options *ServiceClientGetStatisticsOptions) (ServiceClientGetStatisticsResponse, error) { var err error @@ -289,7 +289,7 @@ func (client *ServiceClient) getStatisticsCreateRequest(ctx context.Context, opt if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -322,7 +322,7 @@ func (client *ServiceClient) getStatisticsHandleResponse(resp *http.Response) (S // bearer token authentication. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - keyInfo - Key information // - options - ServiceClientGetUserDelegationKeyOptions contains the optional parameters for the ServiceClient.GetUserDelegationKey // method. @@ -361,7 +361,7 @@ func (client *ServiceClient) getUserDelegationKeyCreateRequest(ctx context.Conte if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} if err := runtime.MarshalAsXML(req, keyInfo); err != nil { return nil, err } @@ -396,7 +396,7 @@ func (client *ServiceClient) getUserDelegationKeyHandleResponse(resp *http.Respo // NewListContainersSegmentPager - The List Containers Segment operation returns a list of the containers under the specified // account // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - options - ServiceClientListContainersSegmentOptions contains the optional parameters for the ServiceClient.NewListContainersSegmentPager // method. // @@ -428,7 +428,7 @@ func (client *ServiceClient) ListContainersSegmentCreateRequest(ctx context.Cont if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} return req, nil } @@ -454,7 +454,7 @@ func (client *ServiceClient) ListContainersSegmentHandleResponse(resp *http.Resp // and CORS (Cross-Origin Resource Sharing) rules // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - storageServiceProperties - The StorageService properties. // - options - ServiceClientSetPropertiesOptions contains the optional parameters for the ServiceClient.SetProperties method. func (client *ServiceClient) SetProperties(ctx context.Context, storageServiceProperties StorageServiceProperties, options *ServiceClientSetPropertiesOptions) (ServiceClientSetPropertiesResponse, error) { @@ -492,7 +492,7 @@ func (client *ServiceClient) setPropertiesCreateRequest(ctx context.Context, sto if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} if err := runtime.MarshalAsXML(req, storageServiceProperties); err != nil { return nil, err } @@ -517,7 +517,7 @@ func (client *ServiceClient) setPropertiesHandleResponse(resp *http.Response) (S // SubmitBatch - The Batch operation allows multiple API calls to be embedded into a single HTTP request. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-01-05 +// Generated from API version 2025-11-05 // - contentLength - The length of the request. // - multipartContentType - Required. The value of this header must be multipart/mixed with a batch boundary. Example header // value: multipart/mixed; boundary=batch_ @@ -560,7 +560,7 @@ func (client *ServiceClient) submitBatchCreateRequest(ctx context.Context, conte if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2025-11-05"} if err := req.SetBody(body, multipartContentType); err != nil { return nil, err } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/pageblob/models.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/pageblob/models.go index 39aef20ff5..f327fae6de 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/pageblob/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/pageblob/models.go @@ -120,6 +120,8 @@ type UploadPagesFromURLOptions struct { CPKScopeInfo *blob.CPKScopeInfo + FileRequestIntent *blob.FileRequestIntentType + SequenceNumberAccessConditions *SequenceNumberAccessConditions SourceModifiedAccessConditions *blob.SourceModifiedAccessConditions @@ -135,6 +137,7 @@ func (o *UploadPagesFromURLOptions) format() (*generated.PageBlobClientUploadPag options := &generated.PageBlobClientUploadPagesFromURLOptions{ CopySourceAuthorization: o.CopySourceAuthorization, + FileRequestIntent: o.FileRequestIntent, } if o.SourceContentValidation != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/sas/service.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/sas/service.go index 813fa77a9e..64133458d4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/sas/service.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/sas/service.go @@ -210,6 +210,8 @@ func (v BlobSignatureValues) SignWithUserDelegation(userDelegationCredential *Us v.AuthorizedObjectID, v.UnauthorizedObjectID, v.CorrelationID, + "", // Placeholder for SignedKeyDelegatedUserTenantId (future field) + "", // Placeholder for SignedDelegatedUserObjectId (future field) v.IPRange.String(), string(v.Protocol), v.Version, diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/CHANGELOG.md index 755e75e42a..73d112597f 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.7.0 (2025-07-28) + +* **Feature**: Add support for HTTP interceptors. + # v1.6.11 (2025-06-17) * **Dependency Update**: Update to smithy-go v1.22.4. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/go_module_metadata.go index 588e8404b2..7b63c27631 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/go_module_metadata.go @@ -3,4 +3,4 @@ package eventstream // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.6.11" +const goModuleVersion = "1.7.0" 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 b204386b53..293fe8d2b5 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,20 @@ +# v1.18.1 (2025-07-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.0 (2025-07-29) + +* **Feature**: Add config switch `DisableDefaultMaxBackoff` that allows you to disable the default maximum backoff (1 second) for IMDS calls retry attempt + +# v1.17.0 (2025-07-28) + +* **Feature**: Add support for HTTP interceptors. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.33 (2025-07-19) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.16.32 (2025-06-17) * **Dependency Update**: Update to smithy-go v1.22.4. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_client.go index 3f4a10e2c1..75edc4e9d6 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_client.go @@ -75,7 +75,9 @@ func New(options Options, optFns ...func(*Options)) *Client { if options.Retryer == nil { options.Retryer = retry.NewStandard() } - options.Retryer = retry.AddWithMaxBackoffDelay(options.Retryer, 1*time.Second) + if !options.DisableDefaultMaxBackoff { + options.Retryer = retry.AddWithMaxBackoffDelay(options.Retryer, 1*time.Second) + } if options.ClientEnableState == ClientDefaultEnableState { if v := os.Getenv(disableClientEnvVar); strings.EqualFold(v, "true") { @@ -189,6 +191,10 @@ type Options struct { // can disable that behavior with this setting. DisableDefaultTimeout bool + // By default all IMDS client operations enforce a 1-second retry delay at maximum. + // You can disable that behavior with this setting. + DisableDefaultMaxBackoff bool + // provides the caching of API tokens used for operation calls. If unset, // the API token will not be retrieved for the operation. tokenProvider *tokenProvider 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 ebd98386e0..e85c146734 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.16.32" +const goModuleVersion = "1.18.1" 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 a9d68c515b..538475c26b 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,16 @@ +# v1.4.1 (2025-07-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.0 (2025-07-28) + +* **Feature**: Add support for HTTP interceptors. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.37 (2025-07-19) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.3.36 (2025-06-17) * **Dependency Update**: Update to smithy-go v1.22.4. 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 dfc815100b..7292b353b5 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.3.36" +const goModuleVersion = "1.4.1" 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 01dc55c873..ff649898f1 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,16 @@ +# v2.7.1 (2025-07-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.7.0 (2025-07-28) + +* **Feature**: Add support for HTTP interceptors. +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.6.37 (2025-07-19) + +* **Dependency Update**: Updated to the latest SDK module versions + # v2.6.36 (2025-06-17) * **Dependency Update**: Update to smithy-go v1.22.4. 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 44c39bc0ac..78a71f6cef 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.6.36" +const goModuleVersion = "2.7.1" 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 f9c9381b4b..bc15b7b4b9 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,16 @@ +# v1.4.1 (2025-07-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.0 (2025-07-28) + +* **Feature**: Add support for HTTP interceptors. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.37 (2025-07-19) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.3.36 (2025-06-17) * **Dependency Update**: Update to smithy-go v1.22.4. 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 dc5e66d731..8612bcbdb3 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.3.36" +const goModuleVersion = "1.4.1" 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 899b3db39f..32c9d51574 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,7 @@ +# v1.13.0 (2025-07-28) + +* **Feature**: Add support for HTTP interceptors. + # v1.12.4 (2025-06-17) * **Dependency Update**: Update to smithy-go v1.22.4. 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 c20427da9e..f4b9f0b948 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.12.4" +const goModuleVersion = "1.13.0" 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 9bbbf0eb43..0d5a82b646 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,16 @@ +# v1.13.1 (2025-07-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.0 (2025-07-28) + +* **Feature**: Add support for HTTP interceptors. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.18 (2025-07-19) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.12.17 (2025-06-17) * **Dependency Update**: Update to smithy-go v1.22.4. 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 72de22c689..89b8f34ffa 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.12.17" +const goModuleVersion = "1.13.1" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/CHANGELOG.md index 3258f4135b..11948a4b6b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/CHANGELOG.md @@ -1,3 +1,16 @@ +# v1.19.1 (2025-07-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.0 (2025-07-28) + +* **Feature**: Add support for HTTP interceptors. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.18 (2025-07-19) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.18.17 (2025-06-17) * **Dependency Update**: Update to smithy-go v1.22.4. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/go_module_metadata.go index 4bd7619b20..1825b5d38b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/go_module_metadata.go @@ -3,4 +3,4 @@ package s3shared // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.18.17" +const goModuleVersion = "1.19.1" diff --git a/vendor/github.com/aws/smithy-go/CHANGELOG.md b/vendor/github.com/aws/smithy-go/CHANGELOG.md index 84ef0dad8c..1d60def6d1 100644 --- a/vendor/github.com/aws/smithy-go/CHANGELOG.md +++ b/vendor/github.com/aws/smithy-go/CHANGELOG.md @@ -1,3 +1,13 @@ +# Release (2025-07-24) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/smithy-go`: v1.22.5 + * **Bug Fix**: Fix HTTP metrics data race. + * **Bug Fix**: Replace usages of deprecated ioutil package. + # Release (2025-06-16) ## General Highlights diff --git a/vendor/github.com/aws/smithy-go/README.md b/vendor/github.com/aws/smithy-go/README.md index 08df74589a..c9ba5ea5e4 100644 --- a/vendor/github.com/aws/smithy-go/README.md +++ b/vendor/github.com/aws/smithy-go/README.md @@ -4,7 +4,7 @@ [Smithy](https://smithy.io/) code generators for Go and the accompanying smithy-go runtime. -The smithy-go runtime requires a minimum version of Go 1.20. +The smithy-go runtime requires a minimum version of Go 1.22. **WARNING: All interfaces are subject to change.** @@ -77,7 +77,7 @@ example created from `smithy init`: "service": "example.weather#Weather", "module": "github.com/example/weather", "generateGoMod": true, - "goDirective": "1.20" + "goDirective": "1.22" } } } diff --git a/vendor/github.com/aws/smithy-go/endpoints/endpoint.go b/vendor/github.com/aws/smithy-go/endpoints/endpoint.go index a935283974..f778272be3 100644 --- a/vendor/github.com/aws/smithy-go/endpoints/endpoint.go +++ b/vendor/github.com/aws/smithy-go/endpoints/endpoint.go @@ -9,7 +9,7 @@ import ( // Endpoint is the endpoint object returned by Endpoint resolution V2 type Endpoint struct { - // The complete URL minimally specfiying the scheme and host. + // The complete URL minimally specifying the scheme and host. // May optionally specify the port and base path component. URI url.URL 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 c566c83377..cbbaabee9e 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.22.4" +const goModuleVersion = "1.22.5" diff --git a/vendor/github.com/aws/smithy-go/transport/http/interceptor.go b/vendor/github.com/aws/smithy-go/transport/http/interceptor.go new file mode 100644 index 0000000000..e21f2632a6 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/transport/http/interceptor.go @@ -0,0 +1,321 @@ +package http + +import ( + "context" +) + +func icopy[T any](v []T) []T { + s := make([]T, len(v)) + copy(s, v) + return s +} + +// InterceptorContext is all the information available in different +// interceptors. +// +// Not all information is available in each interceptor, see each interface +// definition for more details. +type InterceptorContext struct { + Input any + Request *Request + + Output any + Response *Response +} + +// InterceptorRegistry holds a list of operation interceptors. +// +// Interceptors allow callers to insert custom behavior at well-defined points +// within a client's operation lifecycle. +// +// # Interceptor context +// +// All interceptors are invoked with a context object that contains input and +// output containers for the operation. The individual fields that are +// available will depend on what the interceptor is and, in certain +// interceptors, how far the operation was able to progress. See the +// documentation for each interface definition for more information about field +// availability. +// +// Implementations MUST NOT directly mutate the values of the fields in the +// interceptor context. They are free to mutate the existing values _pointed +// to_ by those fields, however. +// +// # Returning errors +// +// All interceptors can return errors. If an interceptor returns an error +// _before_ the client's retry loop, the operation will fail immediately. If +// one returns an error _within_ the retry loop, the error WILL be considered +// according to the client's retry policy. +// +// # Adding interceptors +// +// Idiomatically you will simply use one of the Add() receiver methods to +// register interceptors as desired. However, the list for each interface is +// exported on the registry struct and the caller is free to manipulate it +// directly, for example, to register a number of interceptors all at once, or +// to remove one that was previously registered. +// +// The base SDK client WILL NOT add any interceptors. SDK operations and +// customizations are implemented in terms of middleware. +// +// Modifications to the registry will not persist across operation calls when +// using per-operation functional options. This means you can register +// interceptors on a per-operation basis without affecting other operations. +type InterceptorRegistry struct { + BeforeExecution []BeforeExecutionInterceptor + BeforeSerialization []BeforeSerializationInterceptor + AfterSerialization []AfterSerializationInterceptor + BeforeRetryLoop []BeforeRetryLoopInterceptor + BeforeAttempt []BeforeAttemptInterceptor + BeforeSigning []BeforeSigningInterceptor + AfterSigning []AfterSigningInterceptor + BeforeTransmit []BeforeTransmitInterceptor + AfterTransmit []AfterTransmitInterceptor + BeforeDeserialization []BeforeDeserializationInterceptor + AfterDeserialization []AfterDeserializationInterceptor + AfterAttempt []AfterAttemptInterceptor + AfterExecution []AfterExecutionInterceptor +} + +// Copy returns a deep copy of the registry. This is used by SDK clients on +// each operation call in order to prevent per-op config mutation from +// persisting. +func (i *InterceptorRegistry) Copy() InterceptorRegistry { + return InterceptorRegistry{ + BeforeExecution: icopy(i.BeforeExecution), + BeforeSerialization: icopy(i.BeforeSerialization), + AfterSerialization: icopy(i.AfterSerialization), + BeforeRetryLoop: icopy(i.BeforeRetryLoop), + BeforeAttempt: icopy(i.BeforeAttempt), + BeforeSigning: icopy(i.BeforeSigning), + AfterSigning: icopy(i.AfterSigning), + BeforeTransmit: icopy(i.BeforeTransmit), + AfterTransmit: icopy(i.AfterTransmit), + BeforeDeserialization: icopy(i.BeforeDeserialization), + AfterDeserialization: icopy(i.AfterDeserialization), + AfterAttempt: icopy(i.AfterAttempt), + AfterExecution: icopy(i.AfterExecution), + } +} + +// AddBeforeExecution registers the provided BeforeExecutionInterceptor. +func (i *InterceptorRegistry) AddBeforeExecution(v BeforeExecutionInterceptor) { + i.BeforeExecution = append(i.BeforeExecution, v) +} + +// AddBeforeSerialization registers the provided BeforeSerializationInterceptor. +func (i *InterceptorRegistry) AddBeforeSerialization(v BeforeSerializationInterceptor) { + i.BeforeSerialization = append(i.BeforeSerialization, v) +} + +// AddAfterSerialization registers the provided AfterSerializationInterceptor. +func (i *InterceptorRegistry) AddAfterSerialization(v AfterSerializationInterceptor) { + i.AfterSerialization = append(i.AfterSerialization, v) +} + +// AddBeforeRetryLoop registers the provided BeforeRetryLoopInterceptor. +func (i *InterceptorRegistry) AddBeforeRetryLoop(v BeforeRetryLoopInterceptor) { + i.BeforeRetryLoop = append(i.BeforeRetryLoop, v) +} + +// AddBeforeAttempt registers the provided BeforeAttemptInterceptor. +func (i *InterceptorRegistry) AddBeforeAttempt(v BeforeAttemptInterceptor) { + i.BeforeAttempt = append(i.BeforeAttempt, v) +} + +// AddBeforeSigning registers the provided BeforeSigningInterceptor. +func (i *InterceptorRegistry) AddBeforeSigning(v BeforeSigningInterceptor) { + i.BeforeSigning = append(i.BeforeSigning, v) +} + +// AddAfterSigning registers the provided AfterSigningInterceptor. +func (i *InterceptorRegistry) AddAfterSigning(v AfterSigningInterceptor) { + i.AfterSigning = append(i.AfterSigning, v) +} + +// AddBeforeTransmit registers the provided BeforeTransmitInterceptor. +func (i *InterceptorRegistry) AddBeforeTransmit(v BeforeTransmitInterceptor) { + i.BeforeTransmit = append(i.BeforeTransmit, v) +} + +// AddAfterTransmit registers the provided AfterTransmitInterceptor. +func (i *InterceptorRegistry) AddAfterTransmit(v AfterTransmitInterceptor) { + i.AfterTransmit = append(i.AfterTransmit, v) +} + +// AddBeforeDeserialization registers the provided BeforeDeserializationInterceptor. +func (i *InterceptorRegistry) AddBeforeDeserialization(v BeforeDeserializationInterceptor) { + i.BeforeDeserialization = append(i.BeforeDeserialization, v) +} + +// AddAfterDeserialization registers the provided AfterDeserializationInterceptor. +func (i *InterceptorRegistry) AddAfterDeserialization(v AfterDeserializationInterceptor) { + i.AfterDeserialization = append(i.AfterDeserialization, v) +} + +// AddAfterAttempt registers the provided AfterAttemptInterceptor. +func (i *InterceptorRegistry) AddAfterAttempt(v AfterAttemptInterceptor) { + i.AfterAttempt = append(i.AfterAttempt, v) +} + +// AddAfterExecution registers the provided AfterExecutionInterceptor. +func (i *InterceptorRegistry) AddAfterExecution(v AfterExecutionInterceptor) { + i.AfterExecution = append(i.AfterExecution, v) +} + +// BeforeExecutionInterceptor runs before anything else in the operation +// lifecycle. +// +// Available InterceptorContext fields: +// - Input +type BeforeExecutionInterceptor interface { + BeforeExecution(ctx context.Context, in *InterceptorContext) error +} + +// BeforeSerializationInterceptor runs before the operation input is serialized +// into its transport request. +// +// Serialization occurs before the operation's retry loop. +// +// Available InterceptorContext fields: +// - Input +type BeforeSerializationInterceptor interface { + BeforeSerialization(ctx context.Context, in *InterceptorContext) error +} + +// AfterSerializationInterceptor runs after the operation input is serialized +// into its transport request. +// +// Available InterceptorContext fields: +// - Input +// - Request +type AfterSerializationInterceptor interface { + AfterSerialization(ctx context.Context, in *InterceptorContext) error +} + +// BeforeRetryLoopInterceptor runs right before the operation enters the retry loop. +// +// Available InterceptorContext fields: +// - Input +// - Request +type BeforeRetryLoopInterceptor interface { + BeforeRetryLoop(ctx context.Context, in *InterceptorContext) error +} + +// BeforeAttemptInterceptor runs right before every attempt in the retry loop. +// +// If this interceptor returns an error, AfterAttempt interceptors WILL NOT be +// invoked. +// +// Available InterceptorContext fields: +// - Input +// - Request +type BeforeAttemptInterceptor interface { + BeforeAttempt(ctx context.Context, in *InterceptorContext) error +} + +// BeforeSigningInterceptor runs right before the request is signed. +// +// Signing occurs within the operation's retry loop. +// +// Available InterceptorContext fields: +// - Input +// - Request +type BeforeSigningInterceptor interface { + BeforeSigning(ctx context.Context, in *InterceptorContext) error +} + +// AfterSigningInterceptor runs right after the request is signed. +// +// It is unsafe to modify the outgoing HTTP request at or past this hook, since +// doing so may invalidate the signature of the request. +// +// Available InterceptorContext fields: +// - Input +// - Request +type AfterSigningInterceptor interface { + AfterSigning(ctx context.Context, in *InterceptorContext) error +} + +// BeforeTransmitInterceptor runs right before the HTTP request is sent. +// +// HTTP transmit occurs within the operation's retry loop. +// +// Available InterceptorContext fields: +// - Input +// - Request +type BeforeTransmitInterceptor interface { + BeforeTransmit(ctx context.Context, in *InterceptorContext) error +} + +// AfterTransmitInterceptor runs right after the HTTP response is received. +// +// It will always be invoked when a response is received, regardless of its +// status code. Conversely, it WILL NOT be invoked if the HTTP round-trip was +// not successful, e.g. because of a DNS resolution error +// +// Available InterceptorContext fields: +// - Input +// - Request +// - Response +type AfterTransmitInterceptor interface { + AfterTransmit(ctx context.Context, in *InterceptorContext) error +} + +// BeforeDeserializationInterceptor runs right before the incoming HTTP response +// is deserialized. +// +// This interceptor IS NOT invoked if the HTTP round-trip was not successful. +// +// Deserialization occurs within the operation's retry loop. +// +// Available InterceptorContext fields: +// - Input +// - Request +// - Response +type BeforeDeserializationInterceptor interface { + BeforeDeserialization(ctx context.Context, in *InterceptorContext) error +} + +// AfterDeserializationInterceptor runs right after the incoming HTTP response +// is deserialized. This hook is invoked regardless of whether the deserialized +// result was an error. +// +// This interceptor IS NOT invoked if the HTTP round-trip was not successful. +// +// Available InterceptorContext fields: +// - Input +// - Output (IF the operation had a success-level response) +// - Request +// - Response +type AfterDeserializationInterceptor interface { + AfterDeserialization(ctx context.Context, in *InterceptorContext) error +} + +// AfterAttemptInterceptor runs right after the incoming HTTP response +// is deserialized. This hook is invoked regardless of whether the deserialized +// result was an error, or if another interceptor within the retry loop +// returned an error. +// +// Available InterceptorContext fields: +// - Input +// - Output (IF the operation had a success-level response) +// - Request (IF the operation did not return an error during serialization) +// - Response (IF the operation was able to transmit the HTTP request) +type AfterAttemptInterceptor interface { + AfterAttempt(ctx context.Context, in *InterceptorContext) error +} + +// AfterExecutionInterceptor runs after everything else. It runs regardless of +// how far the operation progressed in its lifecycle, and regardless of whether +// the operation succeeded or failed. +// +// Available InterceptorContext fields: +// - Input +// - Output (IF the operation had a success-level response) +// - Request (IF the operation did not return an error during serialization) +// - Response (IF the operation was able to transmit the HTTP request) +type AfterExecutionInterceptor interface { + AfterExecution(ctx context.Context, in *InterceptorContext) error +} diff --git a/vendor/github.com/aws/smithy-go/transport/http/interceptor_middleware.go b/vendor/github.com/aws/smithy-go/transport/http/interceptor_middleware.go new file mode 100644 index 0000000000..2cc4b57f89 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/transport/http/interceptor_middleware.go @@ -0,0 +1,325 @@ +package http + +import ( + "context" + "errors" + + "github.com/aws/smithy-go/middleware" +) + +type ictxKey struct{} + +func withIctx(ctx context.Context) context.Context { + return middleware.WithStackValue(ctx, ictxKey{}, &InterceptorContext{}) +} + +func getIctx(ctx context.Context) *InterceptorContext { + return middleware.GetStackValue(ctx, ictxKey{}).(*InterceptorContext) +} + +// InterceptExecution runs Before/AfterExecutionInterceptors. +type InterceptExecution struct { + BeforeExecution []BeforeExecutionInterceptor + AfterExecution []AfterExecutionInterceptor +} + +// ID identifies the middleware. +func (m *InterceptExecution) ID() string { + return "InterceptExecution" +} + +// HandleInitialize runs the interceptors. +func (m *InterceptExecution) HandleInitialize( + ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, +) ( + out middleware.InitializeOutput, md middleware.Metadata, err error, +) { + ctx = withIctx(ctx) + getIctx(ctx).Input = in.Parameters + + for _, i := range m.BeforeExecution { + if err := i.BeforeExecution(ctx, getIctx(ctx)); err != nil { + return out, md, err + } + } + + out, md, err = next.HandleInitialize(ctx, in) + + for _, i := range m.AfterExecution { + if err := i.AfterExecution(ctx, getIctx(ctx)); err != nil { + return out, md, err + } + } + + return out, md, err +} + +// InterceptBeforeSerialization runs BeforeSerializationInterceptors. +type InterceptBeforeSerialization struct { + Interceptors []BeforeSerializationInterceptor +} + +// ID identifies the middleware. +func (m *InterceptBeforeSerialization) ID() string { + return "InterceptBeforeSerialization" +} + +// HandleSerialize runs the interceptors. +func (m *InterceptBeforeSerialization) HandleSerialize( + ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, +) ( + out middleware.SerializeOutput, md middleware.Metadata, err error, +) { + for _, i := range m.Interceptors { + if err := i.BeforeSerialization(ctx, getIctx(ctx)); err != nil { + return out, md, err + } + } + + return next.HandleSerialize(ctx, in) +} + +// InterceptAfterSerialization runs AfterSerializationInterceptors. +type InterceptAfterSerialization struct { + Interceptors []AfterSerializationInterceptor +} + +// ID identifies the middleware. +func (m *InterceptAfterSerialization) ID() string { + return "InterceptAfterSerialization" +} + +// HandleSerialize runs the interceptors. +func (m *InterceptAfterSerialization) HandleSerialize( + ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, +) ( + out middleware.SerializeOutput, md middleware.Metadata, err error, +) { + getIctx(ctx).Request = in.Request.(*Request) + + for _, i := range m.Interceptors { + if err := i.AfterSerialization(ctx, getIctx(ctx)); err != nil { + return out, md, err + } + } + + return next.HandleSerialize(ctx, in) +} + +// InterceptBeforeRetryLoop runs BeforeRetryLoopInterceptors. +type InterceptBeforeRetryLoop struct { + Interceptors []BeforeRetryLoopInterceptor +} + +// ID identifies the middleware. +func (m *InterceptBeforeRetryLoop) ID() string { + return "InterceptBeforeRetryLoop" +} + +// HandleFinalize runs the interceptors. +func (m *InterceptBeforeRetryLoop) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, +) ( + out middleware.FinalizeOutput, md middleware.Metadata, err error, +) { + for _, i := range m.Interceptors { + if err := i.BeforeRetryLoop(ctx, getIctx(ctx)); err != nil { + return out, md, err + } + } + + return next.HandleFinalize(ctx, in) +} + +// InterceptBeforeSigning runs BeforeSigningInterceptors. +type InterceptBeforeSigning struct { + Interceptors []BeforeSigningInterceptor +} + +// ID identifies the middleware. +func (m *InterceptBeforeSigning) ID() string { + return "InterceptBeforeSigning" +} + +// HandleFinalize runs the interceptors. +func (m *InterceptBeforeSigning) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, +) ( + out middleware.FinalizeOutput, md middleware.Metadata, err error, +) { + for _, i := range m.Interceptors { + if err := i.BeforeSigning(ctx, getIctx(ctx)); err != nil { + return out, md, err + } + } + + return next.HandleFinalize(ctx, in) +} + +// InterceptAfterSigning runs AfterSigningInterceptors. +type InterceptAfterSigning struct { + Interceptors []AfterSigningInterceptor +} + +// ID identifies the middleware. +func (m *InterceptAfterSigning) ID() string { + return "InterceptAfterSigning" +} + +// HandleFinalize runs the interceptors. +func (m *InterceptAfterSigning) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, +) ( + out middleware.FinalizeOutput, md middleware.Metadata, err error, +) { + for _, i := range m.Interceptors { + if err := i.AfterSigning(ctx, getIctx(ctx)); err != nil { + return out, md, err + } + } + + return next.HandleFinalize(ctx, in) +} + +// InterceptTransmit runs BeforeTransmitInterceptors and AfterTransmitInterceptors. +type InterceptTransmit struct { + BeforeTransmit []BeforeTransmitInterceptor + AfterTransmit []AfterTransmitInterceptor +} + +// ID identifies the middleware. +func (m *InterceptTransmit) ID() string { + return "InterceptTransmit" +} + +// HandleDeserialize runs the interceptors. +func (m *InterceptTransmit) HandleDeserialize( + ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler, +) ( + out middleware.DeserializeOutput, md middleware.Metadata, err error, +) { + for _, i := range m.BeforeTransmit { + if err := i.BeforeTransmit(ctx, getIctx(ctx)); err != nil { + return out, md, err + } + } + + out, md, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, md, err + } + + // the root of the decorated middleware guarantees this will be here + // (client.go: ClientHandler.Handle) + getIctx(ctx).Response = out.RawResponse.(*Response) + + for _, i := range m.AfterTransmit { + if err := i.AfterTransmit(ctx, getIctx(ctx)); err != nil { + return out, md, err + } + } + + return out, md, err +} + +// InterceptBeforeDeserialization runs BeforeDeserializationInterceptors. +type InterceptBeforeDeserialization struct { + Interceptors []BeforeDeserializationInterceptor +} + +// ID identifies the middleware. +func (m *InterceptBeforeDeserialization) ID() string { + return "InterceptBeforeDeserialization" +} + +// HandleDeserialize runs the interceptors. +func (m *InterceptBeforeDeserialization) HandleDeserialize( + ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler, +) ( + out middleware.DeserializeOutput, md middleware.Metadata, err error, +) { + out, md, err = next.HandleDeserialize(ctx, in) + if err != nil { + var terr *RequestSendError + if errors.As(err, &terr) { + return out, md, err + } + } + + for _, i := range m.Interceptors { + if err := i.BeforeDeserialization(ctx, getIctx(ctx)); err != nil { + return out, md, err + } + } + + return out, md, err +} + +// InterceptAfterDeserialization runs AfterDeserializationInterceptors. +type InterceptAfterDeserialization struct { + Interceptors []AfterDeserializationInterceptor +} + +// ID identifies the middleware. +func (m *InterceptAfterDeserialization) ID() string { + return "InterceptAfterDeserialization" +} + +// HandleDeserialize runs the interceptors. +func (m *InterceptAfterDeserialization) HandleDeserialize( + ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler, +) ( + out middleware.DeserializeOutput, md middleware.Metadata, err error, +) { + out, md, err = next.HandleDeserialize(ctx, in) + if err != nil { + var terr *RequestSendError + if errors.As(err, &terr) { + return out, md, err + } + } + + getIctx(ctx).Output = out.Result + + for _, i := range m.Interceptors { + if err := i.AfterDeserialization(ctx, getIctx(ctx)); err != nil { + return out, md, err + } + } + + return out, md, err +} + +// InterceptAttempt runs AfterAttemptInterceptors. +type InterceptAttempt struct { + BeforeAttempt []BeforeAttemptInterceptor + AfterAttempt []AfterAttemptInterceptor +} + +// ID identifies the middleware. +func (m *InterceptAttempt) ID() string { + return "InterceptAttempt" +} + +// HandleFinalize runs the interceptors. +func (m *InterceptAttempt) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, +) ( + out middleware.FinalizeOutput, md middleware.Metadata, err error, +) { + for _, i := range m.BeforeAttempt { + if err := i.BeforeAttempt(ctx, getIctx(ctx)); err != nil { + return out, md, err + } + } + + out, md, err = next.HandleFinalize(ctx, in) + + for _, i := range m.AfterAttempt { + if err := i.AfterAttempt(ctx, getIctx(ctx)); err != nil { + return out, md, err + } + } + + return out, md, err +} diff --git a/vendor/github.com/bmatcuk/doublestar/v4/match.go b/vendor/github.com/bmatcuk/doublestar/v4/match.go index 3aa10f384c..1ff50f6172 100644 --- a/vendor/github.com/bmatcuk/doublestar/v4/match.go +++ b/vendor/github.com/bmatcuk/doublestar/v4/match.go @@ -325,14 +325,29 @@ func matchRune(a, b rune, caseInsensitive bool) bool { func isZeroLengthPattern(pattern string, separator rune, validate bool) (ret bool, err error) { // `/**`, `**/`, and `/**/` are special cases - a pattern such as `path/to/a/**` or `path/to/a/**/` - // *should* match `path/to/a` because `a` might be a directory - if pattern == "" || - pattern == "*" || - pattern == "**" || - pattern == string(separator)+"**" || - pattern == "**"+string(separator) || - pattern == string(separator)+"**"+string(separator) { + // *should* match `path/to/a` because `a` might be a directory. + // This code is optimized to avoid string concatenation, giving a little performance bump. + switch len(pattern) { + case 0: return true, nil + case 1: + if pattern == "*" { + return true, nil + } + case 2: + if pattern == "**" { + return true, nil + } + case 3: + if pattern[1:] == "**" && rune(pattern[0]) == separator { + return true, nil + } else if pattern[:2] == "**" && rune(pattern[2]) == separator { + return true, nil + } + case 4: + if pattern[1:3] == "**" && rune(pattern[0]) == separator && rune(pattern[3]) == separator { + return true, nil + } } if pattern[0] == '{' { diff --git a/vendor/github.com/go-viper/mapstructure/v2/.golangci.yaml b/vendor/github.com/go-viper/mapstructure/v2/.golangci.yaml index ec1680b3a6..bda9625668 100644 --- a/vendor/github.com/go-viper/mapstructure/v2/.golangci.yaml +++ b/vendor/github.com/go-viper/mapstructure/v2/.golangci.yaml @@ -37,3 +37,12 @@ formatters: - standard - default - localmodule + gofmt: + simplify: true + rewrite-rules: + - pattern: interface{} + replacement: any + + exclusions: + paths: + - internal/ diff --git a/vendor/github.com/go-viper/mapstructure/v2/README.md b/vendor/github.com/go-viper/mapstructure/v2/README.md index bc4be08e6a..45db719755 100644 --- a/vendor/github.com/go-viper/mapstructure/v2/README.md +++ b/vendor/github.com/go-viper/mapstructure/v2/README.md @@ -1,7 +1,7 @@ # mapstructure [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/go-viper/mapstructure/ci.yaml?style=flat-square)](https://github.com/go-viper/mapstructure/actions/workflows/ci.yaml) -[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/mod/github.com/go-viper/mapstructure) +[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/mod/github.com/go-viper/mapstructure/v2) ![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/go-viper/mapstructure?style=flat-square&color=61CFDD) [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/go-viper/mapstructure/badge?style=flat-square)](https://deps.dev/go/github.com%252Fgo-viper%252Fmapstructure%252Fv2) diff --git a/vendor/github.com/go-viper/mapstructure/v2/decode_hooks.go b/vendor/github.com/go-viper/mapstructure/v2/decode_hooks.go index 57c6de69d7..a852a0a04c 100644 --- a/vendor/github.com/go-viper/mapstructure/v2/decode_hooks.go +++ b/vendor/github.com/go-viper/mapstructure/v2/decode_hooks.go @@ -13,7 +13,7 @@ import ( "time" ) -// typedDecodeHook takes a raw DecodeHookFunc (an interface{}) and turns +// typedDecodeHook takes a raw DecodeHookFunc (an any) and turns // it into the proper DecodeHookFunc type, such as DecodeHookFuncType. func typedDecodeHook(h DecodeHookFunc) DecodeHookFunc { // Create variables here so we can reference them with the reflect pkg @@ -23,7 +23,7 @@ func typedDecodeHook(h DecodeHookFunc) DecodeHookFunc { // Fill in the variables into this interface and the rest is done // automatically using the reflect package. - potential := []interface{}{f1, f2, f3} + potential := []any{f1, f2, f3} v := reflect.ValueOf(h) vt := v.Type() @@ -37,25 +37,25 @@ func typedDecodeHook(h DecodeHookFunc) DecodeHookFunc { return nil } -// cachedDecodeHook takes a raw DecodeHookFunc (an interface{}) and turns +// cachedDecodeHook takes a raw DecodeHookFunc (an any) and turns // it into a closure to be used directly // if the type fails to convert we return a closure always erroring to keep the previous behaviour -func cachedDecodeHook(raw DecodeHookFunc) func(from reflect.Value, to reflect.Value) (interface{}, error) { +func cachedDecodeHook(raw DecodeHookFunc) func(from reflect.Value, to reflect.Value) (any, error) { switch f := typedDecodeHook(raw).(type) { case DecodeHookFuncType: - return func(from reflect.Value, to reflect.Value) (interface{}, error) { + return func(from reflect.Value, to reflect.Value) (any, error) { return f(from.Type(), to.Type(), from.Interface()) } case DecodeHookFuncKind: - return func(from reflect.Value, to reflect.Value) (interface{}, error) { + return func(from reflect.Value, to reflect.Value) (any, error) { return f(from.Kind(), to.Kind(), from.Interface()) } case DecodeHookFuncValue: - return func(from reflect.Value, to reflect.Value) (interface{}, error) { + return func(from reflect.Value, to reflect.Value) (any, error) { return f(from, to) } default: - return func(from reflect.Value, to reflect.Value) (interface{}, error) { + return func(from reflect.Value, to reflect.Value) (any, error) { return nil, errors.New("invalid decode hook signature") } } @@ -67,7 +67,7 @@ func cachedDecodeHook(raw DecodeHookFunc) func(from reflect.Value, to reflect.Va func DecodeHookExec( raw DecodeHookFunc, from reflect.Value, to reflect.Value, -) (interface{}, error) { +) (any, error) { switch f := typedDecodeHook(raw).(type) { case DecodeHookFuncType: return f(from.Type(), to.Type(), from.Interface()) @@ -86,11 +86,11 @@ func DecodeHookExec( // The composed funcs are called in order, with the result of the // previous transformation. func ComposeDecodeHookFunc(fs ...DecodeHookFunc) DecodeHookFunc { - cached := make([]func(from reflect.Value, to reflect.Value) (interface{}, error), 0, len(fs)) + cached := make([]func(from reflect.Value, to reflect.Value) (any, error), 0, len(fs)) for _, f := range fs { cached = append(cached, cachedDecodeHook(f)) } - return func(f reflect.Value, t reflect.Value) (interface{}, error) { + return func(f reflect.Value, t reflect.Value) (any, error) { var err error data := f.Interface() @@ -114,13 +114,13 @@ func ComposeDecodeHookFunc(fs ...DecodeHookFunc) DecodeHookFunc { // OrComposeDecodeHookFunc executes all input hook functions until one of them returns no error. In that case its value is returned. // If all hooks return an error, OrComposeDecodeHookFunc returns an error concatenating all error messages. func OrComposeDecodeHookFunc(ff ...DecodeHookFunc) DecodeHookFunc { - cached := make([]func(from reflect.Value, to reflect.Value) (interface{}, error), 0, len(ff)) + cached := make([]func(from reflect.Value, to reflect.Value) (any, error), 0, len(ff)) for _, f := range ff { cached = append(cached, cachedDecodeHook(f)) } - return func(a, b reflect.Value) (interface{}, error) { + return func(a, b reflect.Value) (any, error) { var allErrs string - var out interface{} + var out any var err error for _, c := range cached { @@ -143,8 +143,8 @@ func StringToSliceHookFunc(sep string) DecodeHookFunc { return func( f reflect.Type, t reflect.Type, - data interface{}, - ) (interface{}, error) { + data any, + ) (any, error) { if f.Kind() != reflect.String { return data, nil } @@ -161,14 +161,37 @@ func StringToSliceHookFunc(sep string) DecodeHookFunc { } } +// StringToWeakSliceHookFunc brings back the old (pre-v2) behavior of [StringToSliceHookFunc]. +// +// As of mapstructure v2.0.0 [StringToSliceHookFunc] checks if the return type is a string slice. +// This function removes that check. +func StringToWeakSliceHookFunc(sep string) DecodeHookFunc { + return func( + f reflect.Type, + t reflect.Type, + data any, + ) (any, error) { + if f.Kind() != reflect.String || t.Kind() != reflect.Slice { + return data, nil + } + + raw := data.(string) + if raw == "" { + return []string{}, nil + } + + return strings.Split(raw, sep), nil + } +} + // StringToTimeDurationHookFunc returns a DecodeHookFunc that converts // strings to time.Duration. func StringToTimeDurationHookFunc() DecodeHookFunc { return func( f reflect.Type, t reflect.Type, - data interface{}, - ) (interface{}, error) { + data any, + ) (any, error) { if f.Kind() != reflect.String { return data, nil } @@ -177,7 +200,29 @@ func StringToTimeDurationHookFunc() DecodeHookFunc { } // Convert it by parsing - return time.ParseDuration(data.(string)) + d, err := time.ParseDuration(data.(string)) + + return d, wrapTimeParseDurationError(err) + } +} + +// StringToTimeLocationHookFunc returns a DecodeHookFunc that converts +// strings to *time.Location. +func StringToTimeLocationHookFunc() DecodeHookFunc { + return func( + f reflect.Type, + t reflect.Type, + data any, + ) (any, error) { + if f.Kind() != reflect.String { + return data, nil + } + if t != reflect.TypeOf(time.Local) { + return data, nil + } + d, err := time.LoadLocation(data.(string)) + + return d, wrapTimeParseLocationError(err) } } @@ -187,8 +232,8 @@ func StringToURLHookFunc() DecodeHookFunc { return func( f reflect.Type, t reflect.Type, - data interface{}, - ) (interface{}, error) { + data any, + ) (any, error) { if f.Kind() != reflect.String { return data, nil } @@ -197,7 +242,9 @@ func StringToURLHookFunc() DecodeHookFunc { } // Convert it by parsing - return url.Parse(data.(string)) + u, err := url.Parse(data.(string)) + + return u, wrapUrlError(err) } } @@ -207,8 +254,8 @@ func StringToIPHookFunc() DecodeHookFunc { return func( f reflect.Type, t reflect.Type, - data interface{}, - ) (interface{}, error) { + data any, + ) (any, error) { if f.Kind() != reflect.String { return data, nil } @@ -219,7 +266,7 @@ func StringToIPHookFunc() DecodeHookFunc { // Convert it by parsing ip := net.ParseIP(data.(string)) if ip == nil { - return net.IP{}, fmt.Errorf("failed parsing ip %v", data) + return net.IP{}, fmt.Errorf("failed parsing ip") } return ip, nil @@ -232,8 +279,8 @@ func StringToIPNetHookFunc() DecodeHookFunc { return func( f reflect.Type, t reflect.Type, - data interface{}, - ) (interface{}, error) { + data any, + ) (any, error) { if f.Kind() != reflect.String { return data, nil } @@ -243,7 +290,7 @@ func StringToIPNetHookFunc() DecodeHookFunc { // Convert it by parsing _, net, err := net.ParseCIDR(data.(string)) - return net, err + return net, wrapNetParseError(err) } } @@ -253,8 +300,8 @@ func StringToTimeHookFunc(layout string) DecodeHookFunc { return func( f reflect.Type, t reflect.Type, - data interface{}, - ) (interface{}, error) { + data any, + ) (any, error) { if f.Kind() != reflect.String { return data, nil } @@ -263,7 +310,9 @@ func StringToTimeHookFunc(layout string) DecodeHookFunc { } // Convert it by parsing - return time.Parse(layout, data.(string)) + ti, err := time.Parse(layout, data.(string)) + + return ti, wrapTimeParseError(err) } } @@ -275,8 +324,8 @@ func StringToTimeHookFunc(layout string) DecodeHookFunc { func WeaklyTypedHook( f reflect.Kind, t reflect.Kind, - data interface{}, -) (interface{}, error) { + data any, +) (any, error) { dataVal := reflect.ValueOf(data) switch t { case reflect.String: @@ -305,17 +354,17 @@ func WeaklyTypedHook( } func RecursiveStructToMapHookFunc() DecodeHookFunc { - return func(f reflect.Value, t reflect.Value) (interface{}, error) { + return func(f reflect.Value, t reflect.Value) (any, error) { if f.Kind() != reflect.Struct { return f.Interface(), nil } - var i interface{} = struct{}{} + var i any = struct{}{} if t.Type() != reflect.TypeOf(&i).Elem() { return f.Interface(), nil } - m := make(map[string]interface{}) + m := make(map[string]any) t.Set(reflect.ValueOf(m)) return f.Interface(), nil @@ -329,8 +378,8 @@ func TextUnmarshallerHookFunc() DecodeHookFuncType { return func( f reflect.Type, t reflect.Type, - data interface{}, - ) (interface{}, error) { + data any, + ) (any, error) { if f.Kind() != reflect.String { return data, nil } @@ -356,8 +405,8 @@ func StringToNetIPAddrHookFunc() DecodeHookFunc { return func( f reflect.Type, t reflect.Type, - data interface{}, - ) (interface{}, error) { + data any, + ) (any, error) { if f.Kind() != reflect.String { return data, nil } @@ -366,7 +415,9 @@ func StringToNetIPAddrHookFunc() DecodeHookFunc { } // Convert it by parsing - return netip.ParseAddr(data.(string)) + addr, err := netip.ParseAddr(data.(string)) + + return addr, wrapNetIPParseAddrError(err) } } @@ -376,8 +427,8 @@ func StringToNetIPAddrPortHookFunc() DecodeHookFunc { return func( f reflect.Type, t reflect.Type, - data interface{}, - ) (interface{}, error) { + data any, + ) (any, error) { if f.Kind() != reflect.String { return data, nil } @@ -386,7 +437,9 @@ func StringToNetIPAddrPortHookFunc() DecodeHookFunc { } // Convert it by parsing - return netip.ParseAddrPort(data.(string)) + addrPort, err := netip.ParseAddrPort(data.(string)) + + return addrPort, wrapNetIPParseAddrPortError(err) } } @@ -396,8 +449,8 @@ func StringToNetIPPrefixHookFunc() DecodeHookFunc { return func( f reflect.Type, t reflect.Type, - data interface{}, - ) (interface{}, error) { + data any, + ) (any, error) { if f.Kind() != reflect.String { return data, nil } @@ -406,7 +459,9 @@ func StringToNetIPPrefixHookFunc() DecodeHookFunc { } // Convert it by parsing - return netip.ParsePrefix(data.(string)) + prefix, err := netip.ParsePrefix(data.(string)) + + return prefix, wrapNetIPParsePrefixError(err) } } @@ -439,178 +494,182 @@ func StringToBasicTypeHookFunc() DecodeHookFunc { // StringToInt8HookFunc returns a DecodeHookFunc that converts // strings to int8. func StringToInt8HookFunc() DecodeHookFunc { - return func(f reflect.Type, t reflect.Type, data interface{}) (interface{}, error) { + return func(f reflect.Type, t reflect.Type, data any) (any, error) { if f.Kind() != reflect.String || t.Kind() != reflect.Int8 { return data, nil } // Convert it by parsing i64, err := strconv.ParseInt(data.(string), 0, 8) - return int8(i64), err + return int8(i64), wrapStrconvNumError(err) } } // StringToUint8HookFunc returns a DecodeHookFunc that converts // strings to uint8. func StringToUint8HookFunc() DecodeHookFunc { - return func(f reflect.Type, t reflect.Type, data interface{}) (interface{}, error) { + return func(f reflect.Type, t reflect.Type, data any) (any, error) { if f.Kind() != reflect.String || t.Kind() != reflect.Uint8 { return data, nil } // Convert it by parsing u64, err := strconv.ParseUint(data.(string), 0, 8) - return uint8(u64), err + return uint8(u64), wrapStrconvNumError(err) } } // StringToInt16HookFunc returns a DecodeHookFunc that converts // strings to int16. func StringToInt16HookFunc() DecodeHookFunc { - return func(f reflect.Type, t reflect.Type, data interface{}) (interface{}, error) { + return func(f reflect.Type, t reflect.Type, data any) (any, error) { if f.Kind() != reflect.String || t.Kind() != reflect.Int16 { return data, nil } // Convert it by parsing i64, err := strconv.ParseInt(data.(string), 0, 16) - return int16(i64), err + return int16(i64), wrapStrconvNumError(err) } } // StringToUint16HookFunc returns a DecodeHookFunc that converts // strings to uint16. func StringToUint16HookFunc() DecodeHookFunc { - return func(f reflect.Type, t reflect.Type, data interface{}) (interface{}, error) { + return func(f reflect.Type, t reflect.Type, data any) (any, error) { if f.Kind() != reflect.String || t.Kind() != reflect.Uint16 { return data, nil } // Convert it by parsing u64, err := strconv.ParseUint(data.(string), 0, 16) - return uint16(u64), err + return uint16(u64), wrapStrconvNumError(err) } } // StringToInt32HookFunc returns a DecodeHookFunc that converts // strings to int32. func StringToInt32HookFunc() DecodeHookFunc { - return func(f reflect.Type, t reflect.Type, data interface{}) (interface{}, error) { + return func(f reflect.Type, t reflect.Type, data any) (any, error) { if f.Kind() != reflect.String || t.Kind() != reflect.Int32 { return data, nil } // Convert it by parsing i64, err := strconv.ParseInt(data.(string), 0, 32) - return int32(i64), err + return int32(i64), wrapStrconvNumError(err) } } // StringToUint32HookFunc returns a DecodeHookFunc that converts // strings to uint32. func StringToUint32HookFunc() DecodeHookFunc { - return func(f reflect.Type, t reflect.Type, data interface{}) (interface{}, error) { + return func(f reflect.Type, t reflect.Type, data any) (any, error) { if f.Kind() != reflect.String || t.Kind() != reflect.Uint32 { return data, nil } // Convert it by parsing u64, err := strconv.ParseUint(data.(string), 0, 32) - return uint32(u64), err + return uint32(u64), wrapStrconvNumError(err) } } // StringToInt64HookFunc returns a DecodeHookFunc that converts // strings to int64. func StringToInt64HookFunc() DecodeHookFunc { - return func(f reflect.Type, t reflect.Type, data interface{}) (interface{}, error) { + return func(f reflect.Type, t reflect.Type, data any) (any, error) { if f.Kind() != reflect.String || t.Kind() != reflect.Int64 { return data, nil } // Convert it by parsing - return strconv.ParseInt(data.(string), 0, 64) + i64, err := strconv.ParseInt(data.(string), 0, 64) + return int64(i64), wrapStrconvNumError(err) } } // StringToUint64HookFunc returns a DecodeHookFunc that converts // strings to uint64. func StringToUint64HookFunc() DecodeHookFunc { - return func(f reflect.Type, t reflect.Type, data interface{}) (interface{}, error) { + return func(f reflect.Type, t reflect.Type, data any) (any, error) { if f.Kind() != reflect.String || t.Kind() != reflect.Uint64 { return data, nil } // Convert it by parsing - return strconv.ParseUint(data.(string), 0, 64) + u64, err := strconv.ParseUint(data.(string), 0, 64) + return uint64(u64), wrapStrconvNumError(err) } } // StringToIntHookFunc returns a DecodeHookFunc that converts // strings to int. func StringToIntHookFunc() DecodeHookFunc { - return func(f reflect.Type, t reflect.Type, data interface{}) (interface{}, error) { + return func(f reflect.Type, t reflect.Type, data any) (any, error) { if f.Kind() != reflect.String || t.Kind() != reflect.Int { return data, nil } // Convert it by parsing i64, err := strconv.ParseInt(data.(string), 0, 0) - return int(i64), err + return int(i64), wrapStrconvNumError(err) } } // StringToUintHookFunc returns a DecodeHookFunc that converts // strings to uint. func StringToUintHookFunc() DecodeHookFunc { - return func(f reflect.Type, t reflect.Type, data interface{}) (interface{}, error) { + return func(f reflect.Type, t reflect.Type, data any) (any, error) { if f.Kind() != reflect.String || t.Kind() != reflect.Uint { return data, nil } // Convert it by parsing u64, err := strconv.ParseUint(data.(string), 0, 0) - return uint(u64), err + return uint(u64), wrapStrconvNumError(err) } } // StringToFloat32HookFunc returns a DecodeHookFunc that converts // strings to float32. func StringToFloat32HookFunc() DecodeHookFunc { - return func(f reflect.Type, t reflect.Type, data interface{}) (interface{}, error) { + return func(f reflect.Type, t reflect.Type, data any) (any, error) { if f.Kind() != reflect.String || t.Kind() != reflect.Float32 { return data, nil } // Convert it by parsing f64, err := strconv.ParseFloat(data.(string), 32) - return float32(f64), err + return float32(f64), wrapStrconvNumError(err) } } // StringToFloat64HookFunc returns a DecodeHookFunc that converts // strings to float64. func StringToFloat64HookFunc() DecodeHookFunc { - return func(f reflect.Type, t reflect.Type, data interface{}) (interface{}, error) { + return func(f reflect.Type, t reflect.Type, data any) (any, error) { if f.Kind() != reflect.String || t.Kind() != reflect.Float64 { return data, nil } // Convert it by parsing - return strconv.ParseFloat(data.(string), 64) + f64, err := strconv.ParseFloat(data.(string), 64) + return f64, wrapStrconvNumError(err) } } // StringToBoolHookFunc returns a DecodeHookFunc that converts // strings to bool. func StringToBoolHookFunc() DecodeHookFunc { - return func(f reflect.Type, t reflect.Type, data interface{}) (interface{}, error) { + return func(f reflect.Type, t reflect.Type, data any) (any, error) { if f.Kind() != reflect.String || t.Kind() != reflect.Bool { return data, nil } // Convert it by parsing - return strconv.ParseBool(data.(string)) + b, err := strconv.ParseBool(data.(string)) + return b, wrapStrconvNumError(err) } } @@ -629,26 +688,27 @@ func StringToRuneHookFunc() DecodeHookFunc { // StringToComplex64HookFunc returns a DecodeHookFunc that converts // strings to complex64. func StringToComplex64HookFunc() DecodeHookFunc { - return func(f reflect.Type, t reflect.Type, data interface{}) (interface{}, error) { + return func(f reflect.Type, t reflect.Type, data any) (any, error) { if f.Kind() != reflect.String || t.Kind() != reflect.Complex64 { return data, nil } // Convert it by parsing c128, err := strconv.ParseComplex(data.(string), 64) - return complex64(c128), err + return complex64(c128), wrapStrconvNumError(err) } } // StringToComplex128HookFunc returns a DecodeHookFunc that converts // strings to complex128. func StringToComplex128HookFunc() DecodeHookFunc { - return func(f reflect.Type, t reflect.Type, data interface{}) (interface{}, error) { + return func(f reflect.Type, t reflect.Type, data any) (any, error) { if f.Kind() != reflect.String || t.Kind() != reflect.Complex128 { return data, nil } // Convert it by parsing - return strconv.ParseComplex(data.(string), 128) + c128, err := strconv.ParseComplex(data.(string), 128) + return c128, wrapStrconvNumError(err) } } diff --git a/vendor/github.com/go-viper/mapstructure/v2/errors.go b/vendor/github.com/go-viper/mapstructure/v2/errors.go index 31a3edfb04..07d31c22aa 100644 --- a/vendor/github.com/go-viper/mapstructure/v2/errors.go +++ b/vendor/github.com/go-viper/mapstructure/v2/errors.go @@ -1,8 +1,14 @@ package mapstructure import ( + "errors" "fmt" + "net" + "net/url" "reflect" + "strconv" + "strings" + "time" ) // Error interface is implemented by all errors emitted by mapstructure. @@ -72,3 +78,167 @@ func (e *UnconvertibleTypeError) Error() string { } func (*UnconvertibleTypeError) mapstructure() {} + +func wrapStrconvNumError(err error) error { + if err == nil { + return nil + } + + if err, ok := err.(*strconv.NumError); ok { + return &strconvNumError{Err: err} + } + + return err +} + +type strconvNumError struct { + Err *strconv.NumError +} + +func (e *strconvNumError) Error() string { + return "strconv." + e.Err.Func + ": " + e.Err.Err.Error() +} + +func (e *strconvNumError) Unwrap() error { return e.Err } + +func wrapUrlError(err error) error { + if err == nil { + return nil + } + + if err, ok := err.(*url.Error); ok { + return &urlError{Err: err} + } + + return err +} + +type urlError struct { + Err *url.Error +} + +func (e *urlError) Error() string { + return fmt.Sprintf("%s", e.Err.Err) +} + +func (e *urlError) Unwrap() error { return e.Err } + +func wrapNetParseError(err error) error { + if err == nil { + return nil + } + + if err, ok := err.(*net.ParseError); ok { + return &netParseError{Err: err} + } + + return err +} + +type netParseError struct { + Err *net.ParseError +} + +func (e *netParseError) Error() string { + return "invalid " + e.Err.Type +} + +func (e *netParseError) Unwrap() error { return e.Err } + +func wrapTimeParseError(err error) error { + if err == nil { + return nil + } + + if err, ok := err.(*time.ParseError); ok { + return &timeParseError{Err: err} + } + + return err +} + +type timeParseError struct { + Err *time.ParseError +} + +func (e *timeParseError) Error() string { + if e.Err.Message == "" { + return fmt.Sprintf("parsing time as %q: cannot parse as %q", e.Err.Layout, e.Err.LayoutElem) + } + + return "parsing time " + e.Err.Message +} + +func (e *timeParseError) Unwrap() error { return e.Err } + +func wrapNetIPParseAddrError(err error) error { + if err == nil { + return nil + } + + if errMsg := err.Error(); strings.HasPrefix(errMsg, "ParseAddr") { + errPieces := strings.Split(errMsg, ": ") + + return fmt.Errorf("ParseAddr: %s", errPieces[len(errPieces)-1]) + } + + return err +} + +func wrapNetIPParseAddrPortError(err error) error { + if err == nil { + return nil + } + + errMsg := err.Error() + if strings.HasPrefix(errMsg, "invalid port ") { + return errors.New("invalid port") + } else if strings.HasPrefix(errMsg, "invalid ip:port ") { + return errors.New("invalid ip:port") + } + + return err +} + +func wrapNetIPParsePrefixError(err error) error { + if err == nil { + return nil + } + + if errMsg := err.Error(); strings.HasPrefix(errMsg, "netip.ParsePrefix") { + errPieces := strings.Split(errMsg, ": ") + + return fmt.Errorf("netip.ParsePrefix: %s", errPieces[len(errPieces)-1]) + } + + return err +} + +func wrapTimeParseDurationError(err error) error { + if err == nil { + return nil + } + + errMsg := err.Error() + if strings.HasPrefix(errMsg, "time: unknown unit ") { + return errors.New("time: unknown unit") + } else if strings.HasPrefix(errMsg, "time: ") { + idx := strings.LastIndex(errMsg, " ") + + return errors.New(errMsg[:idx]) + } + + return err +} + +func wrapTimeParseLocationError(err error) error { + if err == nil { + return nil + } + errMsg := err.Error() + if strings.Contains(errMsg, "unknown time zone") || strings.HasPrefix(errMsg, "time: unknown format") { + return fmt.Errorf("invalid time zone format: %w", err) + } + + return err +} diff --git a/vendor/github.com/go-viper/mapstructure/v2/mapstructure.go b/vendor/github.com/go-viper/mapstructure/v2/mapstructure.go index 4b738a3a97..7c35bce020 100644 --- a/vendor/github.com/go-viper/mapstructure/v2/mapstructure.go +++ b/vendor/github.com/go-viper/mapstructure/v2/mapstructure.go @@ -1,5 +1,5 @@ // Package mapstructure exposes functionality to convert one arbitrary -// Go type into another, typically to convert a map[string]interface{} +// Go type into another, typically to convert a map[string]any // into a native Go structure. // // The Go structure can be arbitrarily complex, containing slices, @@ -54,8 +54,8 @@ // // This would require an input that looks like below: // -// map[string]interface{}{ -// "person": map[string]interface{}{"name": "alice"}, +// map[string]any{ +// "person": map[string]any{"name": "alice"}, // } // // If your "person" value is NOT nested, then you can append ",squash" to @@ -68,7 +68,7 @@ // // Now the following input would be accepted: // -// map[string]interface{}{ +// map[string]any{ // "name": "alice", // } // @@ -79,7 +79,7 @@ // // Will be decoded into a map: // -// map[string]interface{}{ +// map[string]any{ // "name": "alice", // } // @@ -95,18 +95,18 @@ // // You can also use the ",remain" suffix on your tag to collect all unused // values in a map. The field with this tag MUST be a map type and should -// probably be a "map[string]interface{}" or "map[interface{}]interface{}". +// probably be a "map[string]any" or "map[any]any". // See example below: // // type Friend struct { // Name string -// Other map[string]interface{} `mapstructure:",remain"` +// Other map[string]any `mapstructure:",remain"` // } // // Given the input below, Other would be populated with the other // values that weren't used (everything but "name"): // -// map[string]interface{}{ +// map[string]any{ // "name": "bob", // "address": "123 Maple St.", // } @@ -161,7 +161,7 @@ // // Using this map as input: // -// map[string]interface{}{ +// map[string]any{ // "private": "I will be ignored", // "Public": "I made it through!", // } @@ -204,19 +204,19 @@ import ( // we started with Kinds and then realized Types were the better solution, // but have a promise to not break backwards compat so we now support // both. -type DecodeHookFunc interface{} +type DecodeHookFunc any // DecodeHookFuncType is a DecodeHookFunc which has complete information about // the source and target types. -type DecodeHookFuncType func(reflect.Type, reflect.Type, interface{}) (interface{}, error) +type DecodeHookFuncType func(reflect.Type, reflect.Type, any) (any, error) // DecodeHookFuncKind is a DecodeHookFunc which knows only the Kinds of the // source and target types. -type DecodeHookFuncKind func(reflect.Kind, reflect.Kind, interface{}) (interface{}, error) +type DecodeHookFuncKind func(reflect.Kind, reflect.Kind, any) (any, error) // DecodeHookFuncValue is a DecodeHookFunc which has complete access to both the source and target // values. -type DecodeHookFuncValue func(from reflect.Value, to reflect.Value) (interface{}, error) +type DecodeHookFuncValue func(from reflect.Value, to reflect.Value) (any, error) // DecoderConfig is the configuration that is used to create a new decoder // and allows customization of various aspects of decoding. @@ -287,7 +287,7 @@ type DecoderConfig struct { // Result is a pointer to the struct that will contain the decoded // value. - Result interface{} + Result any // The tag name that mapstructure reads for field names. This // defaults to "mapstructure" @@ -319,7 +319,7 @@ type DecoderConfig struct { // up the most basic Decoder. type Decoder struct { config *DecoderConfig - cachedDecodeHook func(from reflect.Value, to reflect.Value) (interface{}, error) + cachedDecodeHook func(from reflect.Value, to reflect.Value) (any, error) } // Metadata contains information about decoding a structure that @@ -340,7 +340,7 @@ type Metadata struct { // Decode takes an input structure and uses reflection to translate it to // the output structure. output must be a pointer to a map or struct. -func Decode(input interface{}, output interface{}) error { +func Decode(input any, output any) error { config := &DecoderConfig{ Metadata: nil, Result: output, @@ -356,7 +356,7 @@ func Decode(input interface{}, output interface{}) error { // WeakDecode is the same as Decode but is shorthand to enable // WeaklyTypedInput. See DecoderConfig for more info. -func WeakDecode(input, output interface{}) error { +func WeakDecode(input, output any) error { config := &DecoderConfig{ Metadata: nil, Result: output, @@ -373,7 +373,7 @@ func WeakDecode(input, output interface{}) error { // DecodeMetadata is the same as Decode, but is shorthand to // enable metadata collection. See DecoderConfig for more info. -func DecodeMetadata(input interface{}, output interface{}, metadata *Metadata) error { +func DecodeMetadata(input any, output any, metadata *Metadata) error { config := &DecoderConfig{ Metadata: metadata, Result: output, @@ -390,7 +390,7 @@ func DecodeMetadata(input interface{}, output interface{}, metadata *Metadata) e // WeakDecodeMetadata is the same as Decode, but is shorthand to // enable both WeaklyTypedInput and metadata collection. See // DecoderConfig for more info. -func WeakDecodeMetadata(input interface{}, output interface{}, metadata *Metadata) error { +func WeakDecodeMetadata(input any, output any, metadata *Metadata) error { config := &DecoderConfig{ Metadata: metadata, Result: output, @@ -457,7 +457,7 @@ func NewDecoder(config *DecoderConfig) (*Decoder, error) { // Decode decodes the given raw interface to the target pointer specified // by the configuration. -func (d *Decoder) Decode(input interface{}) error { +func (d *Decoder) Decode(input any) error { err := d.decode("", input, reflect.ValueOf(d.config.Result).Elem()) // Retain some of the original behavior when multiple errors ocurr @@ -470,7 +470,7 @@ func (d *Decoder) Decode(input interface{}) error { } // isNil returns true if the input is nil or a typed nil pointer. -func isNil(input interface{}) bool { +func isNil(input any) bool { if input == nil { return true } @@ -479,7 +479,7 @@ func isNil(input interface{}) bool { } // Decodes an unknown data type into a specific reflection value. -func (d *Decoder) decode(name string, input interface{}, outVal reflect.Value) error { +func (d *Decoder) decode(name string, input any, outVal reflect.Value) error { var ( inputVal = reflect.ValueOf(input) outputKind = getKind(outVal) @@ -516,10 +516,10 @@ func (d *Decoder) decode(name string, input interface{}, outVal reflect.Value) e // Hooks need a valid inputVal, so reset it to zero value of outVal type. switch outputKind { case reflect.Struct, reflect.Map: - var mapVal map[string]interface{} + var mapVal map[string]any inputVal = reflect.ValueOf(mapVal) // create nil map pointer case reflect.Slice, reflect.Array: - var sliceVal []interface{} + var sliceVal []any inputVal = reflect.ValueOf(sliceVal) // create nil slice pointer default: inputVal = reflect.Zero(outVal.Type()) @@ -583,7 +583,7 @@ func (d *Decoder) decode(name string, input interface{}, outVal reflect.Value) e // This decodes a basic type (bool, int, string, etc.) and sets the // value to "data" of that type. -func (d *Decoder) decodeBasic(name string, data interface{}, val reflect.Value) error { +func (d *Decoder) decodeBasic(name string, data any, val reflect.Value) error { if val.IsValid() && val.Elem().IsValid() { elem := val.Elem() @@ -640,7 +640,7 @@ func (d *Decoder) decodeBasic(name string, data interface{}, val reflect.Value) return nil } -func (d *Decoder) decodeString(name string, data interface{}, val reflect.Value) error { +func (d *Decoder) decodeString(name string, data any, val reflect.Value) error { dataVal := reflect.Indirect(reflect.ValueOf(data)) dataKind := getKind(dataVal) @@ -693,7 +693,7 @@ func (d *Decoder) decodeString(name string, data interface{}, val reflect.Value) return nil } -func (d *Decoder) decodeInt(name string, data interface{}, val reflect.Value) error { +func (d *Decoder) decodeInt(name string, data any, val reflect.Value) error { dataVal := reflect.Indirect(reflect.ValueOf(data)) dataKind := getKind(dataVal) dataType := dataVal.Type() @@ -724,7 +724,7 @@ func (d *Decoder) decodeInt(name string, data interface{}, val reflect.Value) er return newDecodeError(name, &ParseError{ Expected: val, Value: data, - Err: err, + Err: wrapStrconvNumError(err), }) } case dataType.PkgPath() == "encoding/json" && dataType.Name() == "Number": @@ -748,7 +748,7 @@ func (d *Decoder) decodeInt(name string, data interface{}, val reflect.Value) er return nil } -func (d *Decoder) decodeUint(name string, data interface{}, val reflect.Value) error { +func (d *Decoder) decodeUint(name string, data any, val reflect.Value) error { dataVal := reflect.Indirect(reflect.ValueOf(data)) dataKind := getKind(dataVal) dataType := dataVal.Type() @@ -795,7 +795,7 @@ func (d *Decoder) decodeUint(name string, data interface{}, val reflect.Value) e return newDecodeError(name, &ParseError{ Expected: val, Value: data, - Err: err, + Err: wrapStrconvNumError(err), }) } case dataType.PkgPath() == "encoding/json" && dataType.Name() == "Number": @@ -805,7 +805,7 @@ func (d *Decoder) decodeUint(name string, data interface{}, val reflect.Value) e return newDecodeError(name, &ParseError{ Expected: val, Value: data, - Err: err, + Err: wrapStrconvNumError(err), }) } val.SetUint(i) @@ -819,7 +819,7 @@ func (d *Decoder) decodeUint(name string, data interface{}, val reflect.Value) e return nil } -func (d *Decoder) decodeBool(name string, data interface{}, val reflect.Value) error { +func (d *Decoder) decodeBool(name string, data any, val reflect.Value) error { dataVal := reflect.Indirect(reflect.ValueOf(data)) dataKind := getKind(dataVal) @@ -842,7 +842,7 @@ func (d *Decoder) decodeBool(name string, data interface{}, val reflect.Value) e return newDecodeError(name, &ParseError{ Expected: val, Value: data, - Err: err, + Err: wrapStrconvNumError(err), }) } default: @@ -855,7 +855,7 @@ func (d *Decoder) decodeBool(name string, data interface{}, val reflect.Value) e return nil } -func (d *Decoder) decodeFloat(name string, data interface{}, val reflect.Value) error { +func (d *Decoder) decodeFloat(name string, data any, val reflect.Value) error { dataVal := reflect.Indirect(reflect.ValueOf(data)) dataKind := getKind(dataVal) dataType := dataVal.Type() @@ -886,7 +886,7 @@ func (d *Decoder) decodeFloat(name string, data interface{}, val reflect.Value) return newDecodeError(name, &ParseError{ Expected: val, Value: data, - Err: err, + Err: wrapStrconvNumError(err), }) } case dataType.PkgPath() == "encoding/json" && dataType.Name() == "Number": @@ -910,7 +910,7 @@ func (d *Decoder) decodeFloat(name string, data interface{}, val reflect.Value) return nil } -func (d *Decoder) decodeComplex(name string, data interface{}, val reflect.Value) error { +func (d *Decoder) decodeComplex(name string, data any, val reflect.Value) error { dataVal := reflect.Indirect(reflect.ValueOf(data)) dataKind := getKind(dataVal) @@ -927,7 +927,7 @@ func (d *Decoder) decodeComplex(name string, data interface{}, val reflect.Value return nil } -func (d *Decoder) decodeMap(name string, data interface{}, val reflect.Value) error { +func (d *Decoder) decodeMap(name string, data any, val reflect.Value) error { valType := val.Type() valKeyType := valType.Key() valElemType := valType.Elem() @@ -1176,7 +1176,7 @@ func (d *Decoder) decodeMapFromStruct(name string, dataVal reflect.Value, val re return nil } -func (d *Decoder) decodePtr(name string, data interface{}, val reflect.Value) (bool, error) { +func (d *Decoder) decodePtr(name string, data any, val reflect.Value) (bool, error) { // If the input data is nil, then we want to just set the output // pointer to be nil as well. isNil := data == nil @@ -1223,7 +1223,7 @@ func (d *Decoder) decodePtr(name string, data interface{}, val reflect.Value) (b return false, nil } -func (d *Decoder) decodeFunc(name string, data interface{}, val reflect.Value) error { +func (d *Decoder) decodeFunc(name string, data any, val reflect.Value) error { // Create an element of the concrete (non pointer) type and decode // into that. Then set the value of the pointer to this type. dataVal := reflect.Indirect(reflect.ValueOf(data)) @@ -1237,7 +1237,7 @@ func (d *Decoder) decodeFunc(name string, data interface{}, val reflect.Value) e return nil } -func (d *Decoder) decodeSlice(name string, data interface{}, val reflect.Value) error { +func (d *Decoder) decodeSlice(name string, data any, val reflect.Value) error { dataVal := reflect.Indirect(reflect.ValueOf(data)) dataValKind := dataVal.Kind() valType := val.Type() @@ -1259,7 +1259,7 @@ func (d *Decoder) decodeSlice(name string, data interface{}, val reflect.Value) return nil } // Create slice of maps of other sizes - return d.decodeSlice(name, []interface{}{data}, val) + return d.decodeSlice(name, []any{data}, val) case dataValKind == reflect.String && valElemType.Kind() == reflect.Uint8: return d.decodeSlice(name, []byte(dataVal.String()), val) @@ -1268,7 +1268,7 @@ func (d *Decoder) decodeSlice(name string, data interface{}, val reflect.Value) // and "lift" it into it. i.e. a string becomes a string slice. default: // Just re-try this function with data as a slice. - return d.decodeSlice(name, []interface{}{data}, val) + return d.decodeSlice(name, []any{data}, val) } } @@ -1311,7 +1311,7 @@ func (d *Decoder) decodeSlice(name string, data interface{}, val reflect.Value) return errors.Join(errs...) } -func (d *Decoder) decodeArray(name string, data interface{}, val reflect.Value) error { +func (d *Decoder) decodeArray(name string, data any, val reflect.Value) error { dataVal := reflect.Indirect(reflect.ValueOf(data)) dataValKind := dataVal.Kind() valType := val.Type() @@ -1336,7 +1336,7 @@ func (d *Decoder) decodeArray(name string, data interface{}, val reflect.Value) // and "lift" it into it. i.e. a string becomes a string array. default: // Just re-try this function with data as a slice. - return d.decodeArray(name, []interface{}{data}, val) + return d.decodeArray(name, []any{data}, val) } } @@ -1372,7 +1372,7 @@ func (d *Decoder) decodeArray(name string, data interface{}, val reflect.Value) return errors.Join(errs...) } -func (d *Decoder) decodeStruct(name string, data interface{}, val reflect.Value) error { +func (d *Decoder) decodeStruct(name string, data any, val reflect.Value) error { dataVal := reflect.Indirect(reflect.ValueOf(data)) // If the type of the value to write to and the data match directly, @@ -1393,7 +1393,7 @@ func (d *Decoder) decodeStruct(name string, data interface{}, val reflect.Value) // as an intermediary. // Make a new map to hold our result - mapType := reflect.TypeOf((map[string]interface{})(nil)) + mapType := reflect.TypeOf((map[string]any)(nil)) mval := reflect.MakeMap(mapType) // Creating a pointer to a map so that other methods can completely @@ -1424,13 +1424,13 @@ func (d *Decoder) decodeStructFromMap(name string, dataVal, val reflect.Value) e } dataValKeys := make(map[reflect.Value]struct{}) - dataValKeysUnused := make(map[interface{}]struct{}) + dataValKeysUnused := make(map[any]struct{}) for _, dataValKey := range dataVal.MapKeys() { dataValKeys[dataValKey] = struct{}{} dataValKeysUnused[dataValKey.Interface()] = struct{}{} } - targetValKeysUnused := make(map[interface{}]struct{}) + targetValKeysUnused := make(map[any]struct{}) var errs []error @@ -1583,7 +1583,7 @@ func (d *Decoder) decodeStructFromMap(name string, dataVal, val reflect.Value) e // we put the unused keys directly into the remain field. if remainField != nil && len(dataValKeysUnused) > 0 { // Build a map of only the unused values - remain := map[interface{}]interface{}{} + remain := map[any]any{} for key := range dataValKeysUnused { remain[key] = dataVal.MapIndex(reflect.ValueOf(key)).Interface() } diff --git a/vendor/github.com/gogo/protobuf/jsonpb/jsonpb.go b/vendor/github.com/gogo/protobuf/jsonpb/jsonpb.go deleted file mode 100644 index e8134ec8ba..0000000000 --- a/vendor/github.com/gogo/protobuf/jsonpb/jsonpb.go +++ /dev/null @@ -1,1435 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2015 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// 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 jsonpb provides marshaling and unmarshaling between protocol buffers and JSON. -It follows the specification at https://developers.google.com/protocol-buffers/docs/proto3#json. - -This package produces a different output than the standard "encoding/json" package, -which does not operate correctly on protocol buffers. -*/ -package jsonpb - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - "io" - "math" - "reflect" - "sort" - "strconv" - "strings" - "time" - - "github.com/gogo/protobuf/proto" - "github.com/gogo/protobuf/types" -) - -const secondInNanos = int64(time.Second / time.Nanosecond) -const maxSecondsInDuration = 315576000000 - -// Marshaler is a configurable object for converting between -// protocol buffer objects and a JSON representation for them. -type Marshaler struct { - // Whether to render enum values as integers, as opposed to string values. - EnumsAsInts bool - - // Whether to render fields with zero values. - EmitDefaults bool - - // A string to indent each level by. The presence of this field will - // also cause a space to appear between the field separator and - // value, and for newlines to be appear between fields and array - // elements. - Indent string - - // Whether to use the original (.proto) name for fields. - OrigName bool - - // A custom URL resolver to use when marshaling Any messages to JSON. - // If unset, the default resolution strategy is to extract the - // fully-qualified type name from the type URL and pass that to - // proto.MessageType(string). - AnyResolver AnyResolver -} - -// AnyResolver takes a type URL, present in an Any message, and resolves it into -// an instance of the associated message. -type AnyResolver interface { - Resolve(typeUrl string) (proto.Message, error) -} - -func defaultResolveAny(typeUrl string) (proto.Message, error) { - // Only the part of typeUrl after the last slash is relevant. - mname := typeUrl - if slash := strings.LastIndex(mname, "/"); slash >= 0 { - mname = mname[slash+1:] - } - mt := proto.MessageType(mname) - if mt == nil { - return nil, fmt.Errorf("unknown message type %q", mname) - } - return reflect.New(mt.Elem()).Interface().(proto.Message), nil -} - -// JSONPBMarshaler is implemented by protobuf messages that customize the -// way they are marshaled to JSON. Messages that implement this should -// also implement JSONPBUnmarshaler so that the custom format can be -// parsed. -// -// The JSON marshaling must follow the proto to JSON specification: -// https://developers.google.com/protocol-buffers/docs/proto3#json -type JSONPBMarshaler interface { - MarshalJSONPB(*Marshaler) ([]byte, error) -} - -// JSONPBUnmarshaler is implemented by protobuf messages that customize -// the way they are unmarshaled from JSON. Messages that implement this -// should also implement JSONPBMarshaler so that the custom format can be -// produced. -// -// The JSON unmarshaling must follow the JSON to proto specification: -// https://developers.google.com/protocol-buffers/docs/proto3#json -type JSONPBUnmarshaler interface { - UnmarshalJSONPB(*Unmarshaler, []byte) error -} - -// Marshal marshals a protocol buffer into JSON. -func (m *Marshaler) Marshal(out io.Writer, pb proto.Message) error { - v := reflect.ValueOf(pb) - if pb == nil || (v.Kind() == reflect.Ptr && v.IsNil()) { - return errors.New("Marshal called with nil") - } - // Check for unset required fields first. - if err := checkRequiredFields(pb); err != nil { - return err - } - writer := &errWriter{writer: out} - return m.marshalObject(writer, pb, "", "") -} - -// MarshalToString converts a protocol buffer object to JSON string. -func (m *Marshaler) MarshalToString(pb proto.Message) (string, error) { - var buf bytes.Buffer - if err := m.Marshal(&buf, pb); err != nil { - return "", err - } - return buf.String(), nil -} - -type int32Slice []int32 - -var nonFinite = map[string]float64{ - `"NaN"`: math.NaN(), - `"Infinity"`: math.Inf(1), - `"-Infinity"`: math.Inf(-1), -} - -// For sorting extensions ids to ensure stable output. -func (s int32Slice) Len() int { return len(s) } -func (s int32Slice) Less(i, j int) bool { return s[i] < s[j] } -func (s int32Slice) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -type isWkt interface { - XXX_WellKnownType() string -} - -var ( - wktType = reflect.TypeOf((*isWkt)(nil)).Elem() - messageType = reflect.TypeOf((*proto.Message)(nil)).Elem() -) - -// marshalObject writes a struct to the Writer. -func (m *Marshaler) marshalObject(out *errWriter, v proto.Message, indent, typeURL string) error { - if jsm, ok := v.(JSONPBMarshaler); ok { - b, err := jsm.MarshalJSONPB(m) - if err != nil { - return err - } - if typeURL != "" { - // we are marshaling this object to an Any type - var js map[string]*json.RawMessage - if err = json.Unmarshal(b, &js); err != nil { - return fmt.Errorf("type %T produced invalid JSON: %v", v, err) - } - turl, err := json.Marshal(typeURL) - if err != nil { - return fmt.Errorf("failed to marshal type URL %q to JSON: %v", typeURL, err) - } - js["@type"] = (*json.RawMessage)(&turl) - if m.Indent != "" { - b, err = json.MarshalIndent(js, indent, m.Indent) - } else { - b, err = json.Marshal(js) - } - if err != nil { - return err - } - } - - out.write(string(b)) - return out.err - } - - s := reflect.ValueOf(v).Elem() - - // Handle well-known types. - if wkt, ok := v.(isWkt); ok { - switch wkt.XXX_WellKnownType() { - case "DoubleValue", "FloatValue", "Int64Value", "UInt64Value", - "Int32Value", "UInt32Value", "BoolValue", "StringValue", "BytesValue": - // "Wrappers use the same representation in JSON - // as the wrapped primitive type, ..." - sprop := proto.GetProperties(s.Type()) - return m.marshalValue(out, sprop.Prop[0], s.Field(0), indent) - case "Any": - // Any is a bit more involved. - return m.marshalAny(out, v, indent) - case "Duration": - s, ns := s.Field(0).Int(), s.Field(1).Int() - if s < -maxSecondsInDuration || s > maxSecondsInDuration { - return fmt.Errorf("seconds out of range %v", s) - } - if ns <= -secondInNanos || ns >= secondInNanos { - return fmt.Errorf("ns out of range (%v, %v)", -secondInNanos, secondInNanos) - } - if (s > 0 && ns < 0) || (s < 0 && ns > 0) { - return errors.New("signs of seconds and nanos do not match") - } - // Generated output always contains 0, 3, 6, or 9 fractional digits, - // depending on required precision, followed by the suffix "s". - f := "%d.%09d" - if ns < 0 { - ns = -ns - if s == 0 { - f = "-%d.%09d" - } - } - x := fmt.Sprintf(f, s, ns) - x = strings.TrimSuffix(x, "000") - x = strings.TrimSuffix(x, "000") - x = strings.TrimSuffix(x, ".000") - out.write(`"`) - out.write(x) - out.write(`s"`) - return out.err - case "Struct", "ListValue": - // Let marshalValue handle the `Struct.fields` map or the `ListValue.values` slice. - // TODO: pass the correct Properties if needed. - return m.marshalValue(out, &proto.Properties{}, s.Field(0), indent) - case "Timestamp": - // "RFC 3339, where generated output will always be Z-normalized - // and uses 0, 3, 6 or 9 fractional digits." - s, ns := s.Field(0).Int(), s.Field(1).Int() - if ns < 0 || ns >= secondInNanos { - return fmt.Errorf("ns out of range [0, %v)", secondInNanos) - } - t := time.Unix(s, ns).UTC() - // time.RFC3339Nano isn't exactly right (we need to get 3/6/9 fractional digits). - x := t.Format("2006-01-02T15:04:05.000000000") - x = strings.TrimSuffix(x, "000") - x = strings.TrimSuffix(x, "000") - x = strings.TrimSuffix(x, ".000") - out.write(`"`) - out.write(x) - out.write(`Z"`) - return out.err - case "Value": - // Value has a single oneof. - kind := s.Field(0) - if kind.IsNil() { - // "absence of any variant indicates an error" - return errors.New("nil Value") - } - // oneof -> *T -> T -> T.F - x := kind.Elem().Elem().Field(0) - // TODO: pass the correct Properties if needed. - return m.marshalValue(out, &proto.Properties{}, x, indent) - } - } - - out.write("{") - if m.Indent != "" { - out.write("\n") - } - - firstField := true - - if typeURL != "" { - if err := m.marshalTypeURL(out, indent, typeURL); err != nil { - return err - } - firstField = false - } - - for i := 0; i < s.NumField(); i++ { - value := s.Field(i) - valueField := s.Type().Field(i) - if strings.HasPrefix(valueField.Name, "XXX_") { - continue - } - - //this is not a protobuf field - if valueField.Tag.Get("protobuf") == "" && valueField.Tag.Get("protobuf_oneof") == "" { - continue - } - - // IsNil will panic on most value kinds. - switch value.Kind() { - case reflect.Chan, reflect.Func, reflect.Interface: - if value.IsNil() { - continue - } - } - - if !m.EmitDefaults { - switch value.Kind() { - case reflect.Bool: - if !value.Bool() { - continue - } - case reflect.Int32, reflect.Int64: - if value.Int() == 0 { - continue - } - case reflect.Uint32, reflect.Uint64: - if value.Uint() == 0 { - continue - } - case reflect.Float32, reflect.Float64: - if value.Float() == 0 { - continue - } - case reflect.String: - if value.Len() == 0 { - continue - } - case reflect.Map, reflect.Ptr, reflect.Slice: - if value.IsNil() { - continue - } - } - } - - // Oneof fields need special handling. - if valueField.Tag.Get("protobuf_oneof") != "" { - // value is an interface containing &T{real_value}. - sv := value.Elem().Elem() // interface -> *T -> T - value = sv.Field(0) - valueField = sv.Type().Field(0) - } - prop := jsonProperties(valueField, m.OrigName) - if !firstField { - m.writeSep(out) - } - // If the map value is a cast type, it may not implement proto.Message, therefore - // allow the struct tag to declare the underlying message type. Change the property - // of the child types, use CustomType as a passer. CastType currently property is - // not used in json encoding. - if value.Kind() == reflect.Map { - if tag := valueField.Tag.Get("protobuf"); tag != "" { - for _, v := range strings.Split(tag, ",") { - if !strings.HasPrefix(v, "castvaluetype=") { - continue - } - v = strings.TrimPrefix(v, "castvaluetype=") - prop.MapValProp.CustomType = v - break - } - } - } - if err := m.marshalField(out, prop, value, indent); err != nil { - return err - } - firstField = false - } - - // Handle proto2 extensions. - if ep, ok := v.(proto.Message); ok { - extensions := proto.RegisteredExtensions(v) - // Sort extensions for stable output. - ids := make([]int32, 0, len(extensions)) - for id, desc := range extensions { - if !proto.HasExtension(ep, desc) { - continue - } - ids = append(ids, id) - } - sort.Sort(int32Slice(ids)) - for _, id := range ids { - desc := extensions[id] - if desc == nil { - // unknown extension - continue - } - ext, extErr := proto.GetExtension(ep, desc) - if extErr != nil { - return extErr - } - value := reflect.ValueOf(ext) - var prop proto.Properties - prop.Parse(desc.Tag) - prop.JSONName = fmt.Sprintf("[%s]", desc.Name) - if !firstField { - m.writeSep(out) - } - if err := m.marshalField(out, &prop, value, indent); err != nil { - return err - } - firstField = false - } - - } - - if m.Indent != "" { - out.write("\n") - out.write(indent) - } - out.write("}") - return out.err -} - -func (m *Marshaler) writeSep(out *errWriter) { - if m.Indent != "" { - out.write(",\n") - } else { - out.write(",") - } -} - -func (m *Marshaler) marshalAny(out *errWriter, any proto.Message, indent string) error { - // "If the Any contains a value that has a special JSON mapping, - // it will be converted as follows: {"@type": xxx, "value": yyy}. - // Otherwise, the value will be converted into a JSON object, - // and the "@type" field will be inserted to indicate the actual data type." - v := reflect.ValueOf(any).Elem() - turl := v.Field(0).String() - val := v.Field(1).Bytes() - - var msg proto.Message - var err error - if m.AnyResolver != nil { - msg, err = m.AnyResolver.Resolve(turl) - } else { - msg, err = defaultResolveAny(turl) - } - if err != nil { - return err - } - - if err := proto.Unmarshal(val, msg); err != nil { - return err - } - - if _, ok := msg.(isWkt); ok { - out.write("{") - if m.Indent != "" { - out.write("\n") - } - if err := m.marshalTypeURL(out, indent, turl); err != nil { - return err - } - m.writeSep(out) - if m.Indent != "" { - out.write(indent) - out.write(m.Indent) - out.write(`"value": `) - } else { - out.write(`"value":`) - } - if err := m.marshalObject(out, msg, indent+m.Indent, ""); err != nil { - return err - } - if m.Indent != "" { - out.write("\n") - out.write(indent) - } - out.write("}") - return out.err - } - - return m.marshalObject(out, msg, indent, turl) -} - -func (m *Marshaler) marshalTypeURL(out *errWriter, indent, typeURL string) error { - if m.Indent != "" { - out.write(indent) - out.write(m.Indent) - } - out.write(`"@type":`) - if m.Indent != "" { - out.write(" ") - } - b, err := json.Marshal(typeURL) - if err != nil { - return err - } - out.write(string(b)) - return out.err -} - -// marshalField writes field description and value to the Writer. -func (m *Marshaler) marshalField(out *errWriter, prop *proto.Properties, v reflect.Value, indent string) error { - if m.Indent != "" { - out.write(indent) - out.write(m.Indent) - } - out.write(`"`) - out.write(prop.JSONName) - out.write(`":`) - if m.Indent != "" { - out.write(" ") - } - if err := m.marshalValue(out, prop, v, indent); err != nil { - return err - } - return nil -} - -// marshalValue writes the value to the Writer. -func (m *Marshaler) marshalValue(out *errWriter, prop *proto.Properties, v reflect.Value, indent string) error { - - v = reflect.Indirect(v) - - // Handle nil pointer - if v.Kind() == reflect.Invalid { - out.write("null") - return out.err - } - - // Handle repeated elements. - if v.Kind() == reflect.Slice && v.Type().Elem().Kind() != reflect.Uint8 { - out.write("[") - comma := "" - for i := 0; i < v.Len(); i++ { - sliceVal := v.Index(i) - out.write(comma) - if m.Indent != "" { - out.write("\n") - out.write(indent) - out.write(m.Indent) - out.write(m.Indent) - } - if err := m.marshalValue(out, prop, sliceVal, indent+m.Indent); err != nil { - return err - } - comma = "," - } - if m.Indent != "" { - out.write("\n") - out.write(indent) - out.write(m.Indent) - } - out.write("]") - return out.err - } - - // Handle well-known types. - // Most are handled up in marshalObject (because 99% are messages). - if v.Type().Implements(wktType) { - wkt := v.Interface().(isWkt) - switch wkt.XXX_WellKnownType() { - case "NullValue": - out.write("null") - return out.err - } - } - - if t, ok := v.Interface().(time.Time); ok { - ts, err := types.TimestampProto(t) - if err != nil { - return err - } - return m.marshalValue(out, prop, reflect.ValueOf(ts), indent) - } - - if d, ok := v.Interface().(time.Duration); ok { - dur := types.DurationProto(d) - return m.marshalValue(out, prop, reflect.ValueOf(dur), indent) - } - - // Handle enumerations. - if !m.EnumsAsInts && prop.Enum != "" { - // Unknown enum values will are stringified by the proto library as their - // value. Such values should _not_ be quoted or they will be interpreted - // as an enum string instead of their value. - enumStr := v.Interface().(fmt.Stringer).String() - var valStr string - if v.Kind() == reflect.Ptr { - valStr = strconv.Itoa(int(v.Elem().Int())) - } else { - valStr = strconv.Itoa(int(v.Int())) - } - - if m, ok := v.Interface().(interface { - MarshalJSON() ([]byte, error) - }); ok { - data, err := m.MarshalJSON() - if err != nil { - return err - } - enumStr = string(data) - enumStr, err = strconv.Unquote(enumStr) - if err != nil { - return err - } - } - - isKnownEnum := enumStr != valStr - - if isKnownEnum { - out.write(`"`) - } - out.write(enumStr) - if isKnownEnum { - out.write(`"`) - } - return out.err - } - - // Handle nested messages. - if v.Kind() == reflect.Struct { - i := v - if v.CanAddr() { - i = v.Addr() - } else { - i = reflect.New(v.Type()) - i.Elem().Set(v) - } - iface := i.Interface() - if iface == nil { - out.write(`null`) - return out.err - } - - if m, ok := v.Interface().(interface { - MarshalJSON() ([]byte, error) - }); ok { - data, err := m.MarshalJSON() - if err != nil { - return err - } - out.write(string(data)) - return nil - } - - pm, ok := iface.(proto.Message) - if !ok { - if prop.CustomType == "" { - return fmt.Errorf("%v does not implement proto.Message", v.Type()) - } - t := proto.MessageType(prop.CustomType) - if t == nil || !i.Type().ConvertibleTo(t) { - return fmt.Errorf("%v declared custom type %s but it is not convertible to %v", v.Type(), prop.CustomType, t) - } - pm = i.Convert(t).Interface().(proto.Message) - } - return m.marshalObject(out, pm, indent+m.Indent, "") - } - - // Handle maps. - // Since Go randomizes map iteration, we sort keys for stable output. - if v.Kind() == reflect.Map { - out.write(`{`) - keys := v.MapKeys() - sort.Sort(mapKeys(keys)) - for i, k := range keys { - if i > 0 { - out.write(`,`) - } - if m.Indent != "" { - out.write("\n") - out.write(indent) - out.write(m.Indent) - out.write(m.Indent) - } - - // TODO handle map key prop properly - b, err := json.Marshal(k.Interface()) - if err != nil { - return err - } - s := string(b) - - // If the JSON is not a string value, encode it again to make it one. - if !strings.HasPrefix(s, `"`) { - b, err := json.Marshal(s) - if err != nil { - return err - } - s = string(b) - } - - out.write(s) - out.write(`:`) - if m.Indent != "" { - out.write(` `) - } - - vprop := prop - if prop != nil && prop.MapValProp != nil { - vprop = prop.MapValProp - } - if err := m.marshalValue(out, vprop, v.MapIndex(k), indent+m.Indent); err != nil { - return err - } - } - if m.Indent != "" { - out.write("\n") - out.write(indent) - out.write(m.Indent) - } - out.write(`}`) - return out.err - } - - // Handle non-finite floats, e.g. NaN, Infinity and -Infinity. - if v.Kind() == reflect.Float32 || v.Kind() == reflect.Float64 { - f := v.Float() - var sval string - switch { - case math.IsInf(f, 1): - sval = `"Infinity"` - case math.IsInf(f, -1): - sval = `"-Infinity"` - case math.IsNaN(f): - sval = `"NaN"` - } - if sval != "" { - out.write(sval) - return out.err - } - } - - // Default handling defers to the encoding/json library. - b, err := json.Marshal(v.Interface()) - if err != nil { - return err - } - needToQuote := string(b[0]) != `"` && (v.Kind() == reflect.Int64 || v.Kind() == reflect.Uint64) - if needToQuote { - out.write(`"`) - } - out.write(string(b)) - if needToQuote { - out.write(`"`) - } - return out.err -} - -// Unmarshaler is a configurable object for converting from a JSON -// representation to a protocol buffer object. -type Unmarshaler struct { - // Whether to allow messages to contain unknown fields, as opposed to - // failing to unmarshal. - AllowUnknownFields bool - - // A custom URL resolver to use when unmarshaling Any messages from JSON. - // If unset, the default resolution strategy is to extract the - // fully-qualified type name from the type URL and pass that to - // proto.MessageType(string). - AnyResolver AnyResolver -} - -// UnmarshalNext unmarshals the next protocol buffer from a JSON object stream. -// This function is lenient and will decode any options permutations of the -// related Marshaler. -func (u *Unmarshaler) UnmarshalNext(dec *json.Decoder, pb proto.Message) error { - inputValue := json.RawMessage{} - if err := dec.Decode(&inputValue); err != nil { - return err - } - if err := u.unmarshalValue(reflect.ValueOf(pb).Elem(), inputValue, nil); err != nil { - return err - } - return checkRequiredFields(pb) -} - -// Unmarshal unmarshals a JSON object stream into a protocol -// buffer. This function is lenient and will decode any options -// permutations of the related Marshaler. -func (u *Unmarshaler) Unmarshal(r io.Reader, pb proto.Message) error { - dec := json.NewDecoder(r) - return u.UnmarshalNext(dec, pb) -} - -// UnmarshalNext unmarshals the next protocol buffer from a JSON object stream. -// This function is lenient and will decode any options permutations of the -// related Marshaler. -func UnmarshalNext(dec *json.Decoder, pb proto.Message) error { - return new(Unmarshaler).UnmarshalNext(dec, pb) -} - -// Unmarshal unmarshals a JSON object stream into a protocol -// buffer. This function is lenient and will decode any options -// permutations of the related Marshaler. -func Unmarshal(r io.Reader, pb proto.Message) error { - return new(Unmarshaler).Unmarshal(r, pb) -} - -// UnmarshalString will populate the fields of a protocol buffer based -// on a JSON string. This function is lenient and will decode any options -// permutations of the related Marshaler. -func UnmarshalString(str string, pb proto.Message) error { - return new(Unmarshaler).Unmarshal(strings.NewReader(str), pb) -} - -// unmarshalValue converts/copies a value into the target. -// prop may be nil. -func (u *Unmarshaler) unmarshalValue(target reflect.Value, inputValue json.RawMessage, prop *proto.Properties) error { - targetType := target.Type() - - // Allocate memory for pointer fields. - if targetType.Kind() == reflect.Ptr { - // If input value is "null" and target is a pointer type, then the field should be treated as not set - // UNLESS the target is structpb.Value, in which case it should be set to structpb.NullValue. - _, isJSONPBUnmarshaler := target.Interface().(JSONPBUnmarshaler) - if string(inputValue) == "null" && targetType != reflect.TypeOf(&types.Value{}) && !isJSONPBUnmarshaler { - return nil - } - target.Set(reflect.New(targetType.Elem())) - - return u.unmarshalValue(target.Elem(), inputValue, prop) - } - - if jsu, ok := target.Addr().Interface().(JSONPBUnmarshaler); ok { - return jsu.UnmarshalJSONPB(u, []byte(inputValue)) - } - - // Handle well-known types that are not pointers. - if w, ok := target.Addr().Interface().(isWkt); ok { - switch w.XXX_WellKnownType() { - case "DoubleValue", "FloatValue", "Int64Value", "UInt64Value", - "Int32Value", "UInt32Value", "BoolValue", "StringValue", "BytesValue": - return u.unmarshalValue(target.Field(0), inputValue, prop) - case "Any": - // Use json.RawMessage pointer type instead of value to support pre-1.8 version. - // 1.8 changed RawMessage.MarshalJSON from pointer type to value type, see - // https://github.com/golang/go/issues/14493 - var jsonFields map[string]*json.RawMessage - if err := json.Unmarshal(inputValue, &jsonFields); err != nil { - return err - } - - val, ok := jsonFields["@type"] - if !ok || val == nil { - return errors.New("Any JSON doesn't have '@type'") - } - - var turl string - if err := json.Unmarshal([]byte(*val), &turl); err != nil { - return fmt.Errorf("can't unmarshal Any's '@type': %q", *val) - } - target.Field(0).SetString(turl) - - var m proto.Message - var err error - if u.AnyResolver != nil { - m, err = u.AnyResolver.Resolve(turl) - } else { - m, err = defaultResolveAny(turl) - } - if err != nil { - return err - } - - if _, ok := m.(isWkt); ok { - val, ok := jsonFields["value"] - if !ok { - return errors.New("Any JSON doesn't have 'value'") - } - - if err = u.unmarshalValue(reflect.ValueOf(m).Elem(), *val, nil); err != nil { - return fmt.Errorf("can't unmarshal Any nested proto %T: %v", m, err) - } - } else { - delete(jsonFields, "@type") - nestedProto, uerr := json.Marshal(jsonFields) - if uerr != nil { - return fmt.Errorf("can't generate JSON for Any's nested proto to be unmarshaled: %v", uerr) - } - - if err = u.unmarshalValue(reflect.ValueOf(m).Elem(), nestedProto, nil); err != nil { - return fmt.Errorf("can't unmarshal Any nested proto %T: %v", m, err) - } - } - - b, err := proto.Marshal(m) - if err != nil { - return fmt.Errorf("can't marshal proto %T into Any.Value: %v", m, err) - } - target.Field(1).SetBytes(b) - - return nil - case "Duration": - unq, err := unquote(string(inputValue)) - if err != nil { - return err - } - - d, err := time.ParseDuration(unq) - if err != nil { - return fmt.Errorf("bad Duration: %v", err) - } - - ns := d.Nanoseconds() - s := ns / 1e9 - ns %= 1e9 - target.Field(0).SetInt(s) - target.Field(1).SetInt(ns) - return nil - case "Timestamp": - unq, err := unquote(string(inputValue)) - if err != nil { - return err - } - - t, err := time.Parse(time.RFC3339Nano, unq) - if err != nil { - return fmt.Errorf("bad Timestamp: %v", err) - } - - target.Field(0).SetInt(t.Unix()) - target.Field(1).SetInt(int64(t.Nanosecond())) - return nil - case "Struct": - var m map[string]json.RawMessage - if err := json.Unmarshal(inputValue, &m); err != nil { - return fmt.Errorf("bad StructValue: %v", err) - } - target.Field(0).Set(reflect.ValueOf(map[string]*types.Value{})) - for k, jv := range m { - pv := &types.Value{} - if err := u.unmarshalValue(reflect.ValueOf(pv).Elem(), jv, prop); err != nil { - return fmt.Errorf("bad value in StructValue for key %q: %v", k, err) - } - target.Field(0).SetMapIndex(reflect.ValueOf(k), reflect.ValueOf(pv)) - } - return nil - case "ListValue": - var s []json.RawMessage - if err := json.Unmarshal(inputValue, &s); err != nil { - return fmt.Errorf("bad ListValue: %v", err) - } - - target.Field(0).Set(reflect.ValueOf(make([]*types.Value, len(s)))) - for i, sv := range s { - if err := u.unmarshalValue(target.Field(0).Index(i), sv, prop); err != nil { - return err - } - } - return nil - case "Value": - ivStr := string(inputValue) - if ivStr == "null" { - target.Field(0).Set(reflect.ValueOf(&types.Value_NullValue{})) - } else if v, err := strconv.ParseFloat(ivStr, 0); err == nil { - target.Field(0).Set(reflect.ValueOf(&types.Value_NumberValue{NumberValue: v})) - } else if v, err := unquote(ivStr); err == nil { - target.Field(0).Set(reflect.ValueOf(&types.Value_StringValue{StringValue: v})) - } else if v, err := strconv.ParseBool(ivStr); err == nil { - target.Field(0).Set(reflect.ValueOf(&types.Value_BoolValue{BoolValue: v})) - } else if err := json.Unmarshal(inputValue, &[]json.RawMessage{}); err == nil { - lv := &types.ListValue{} - target.Field(0).Set(reflect.ValueOf(&types.Value_ListValue{ListValue: lv})) - return u.unmarshalValue(reflect.ValueOf(lv).Elem(), inputValue, prop) - } else if err := json.Unmarshal(inputValue, &map[string]json.RawMessage{}); err == nil { - sv := &types.Struct{} - target.Field(0).Set(reflect.ValueOf(&types.Value_StructValue{StructValue: sv})) - return u.unmarshalValue(reflect.ValueOf(sv).Elem(), inputValue, prop) - } else { - return fmt.Errorf("unrecognized type for Value %q", ivStr) - } - return nil - } - } - - if t, ok := target.Addr().Interface().(*time.Time); ok { - ts := &types.Timestamp{} - if err := u.unmarshalValue(reflect.ValueOf(ts).Elem(), inputValue, prop); err != nil { - return err - } - tt, err := types.TimestampFromProto(ts) - if err != nil { - return err - } - *t = tt - return nil - } - - if d, ok := target.Addr().Interface().(*time.Duration); ok { - dur := &types.Duration{} - if err := u.unmarshalValue(reflect.ValueOf(dur).Elem(), inputValue, prop); err != nil { - return err - } - dd, err := types.DurationFromProto(dur) - if err != nil { - return err - } - *d = dd - return nil - } - - // Handle enums, which have an underlying type of int32, - // and may appear as strings. - // The case of an enum appearing as a number is handled - // at the bottom of this function. - if inputValue[0] == '"' && prop != nil && prop.Enum != "" { - vmap := proto.EnumValueMap(prop.Enum) - // Don't need to do unquoting; valid enum names - // are from a limited character set. - s := inputValue[1 : len(inputValue)-1] - n, ok := vmap[string(s)] - if !ok { - return fmt.Errorf("unknown value %q for enum %s", s, prop.Enum) - } - if target.Kind() == reflect.Ptr { // proto2 - target.Set(reflect.New(targetType.Elem())) - target = target.Elem() - } - if targetType.Kind() != reflect.Int32 { - return fmt.Errorf("invalid target %q for enum %s", targetType.Kind(), prop.Enum) - } - target.SetInt(int64(n)) - return nil - } - - if prop != nil && len(prop.CustomType) > 0 && target.CanAddr() { - if m, ok := target.Addr().Interface().(interface { - UnmarshalJSON([]byte) error - }); ok { - return json.Unmarshal(inputValue, m) - } - } - - // Handle nested messages. - if targetType.Kind() == reflect.Struct { - var jsonFields map[string]json.RawMessage - if err := json.Unmarshal(inputValue, &jsonFields); err != nil { - return err - } - - consumeField := func(prop *proto.Properties) (json.RawMessage, bool) { - // Be liberal in what names we accept; both orig_name and camelName are okay. - fieldNames := acceptedJSONFieldNames(prop) - - vOrig, okOrig := jsonFields[fieldNames.orig] - vCamel, okCamel := jsonFields[fieldNames.camel] - if !okOrig && !okCamel { - return nil, false - } - // If, for some reason, both are present in the data, favour the camelName. - var raw json.RawMessage - if okOrig { - raw = vOrig - delete(jsonFields, fieldNames.orig) - } - if okCamel { - raw = vCamel - delete(jsonFields, fieldNames.camel) - } - return raw, true - } - - sprops := proto.GetProperties(targetType) - for i := 0; i < target.NumField(); i++ { - ft := target.Type().Field(i) - if strings.HasPrefix(ft.Name, "XXX_") { - continue - } - valueForField, ok := consumeField(sprops.Prop[i]) - if !ok { - continue - } - - if err := u.unmarshalValue(target.Field(i), valueForField, sprops.Prop[i]); err != nil { - return err - } - } - // Check for any oneof fields. - if len(jsonFields) > 0 { - for _, oop := range sprops.OneofTypes { - raw, ok := consumeField(oop.Prop) - if !ok { - continue - } - nv := reflect.New(oop.Type.Elem()) - target.Field(oop.Field).Set(nv) - if err := u.unmarshalValue(nv.Elem().Field(0), raw, oop.Prop); err != nil { - return err - } - } - } - // Handle proto2 extensions. - if len(jsonFields) > 0 { - if ep, ok := target.Addr().Interface().(proto.Message); ok { - for _, ext := range proto.RegisteredExtensions(ep) { - name := fmt.Sprintf("[%s]", ext.Name) - raw, ok := jsonFields[name] - if !ok { - continue - } - delete(jsonFields, name) - nv := reflect.New(reflect.TypeOf(ext.ExtensionType).Elem()) - if err := u.unmarshalValue(nv.Elem(), raw, nil); err != nil { - return err - } - if err := proto.SetExtension(ep, ext, nv.Interface()); err != nil { - return err - } - } - } - } - if !u.AllowUnknownFields && len(jsonFields) > 0 { - // Pick any field to be the scapegoat. - var f string - for fname := range jsonFields { - f = fname - break - } - return fmt.Errorf("unknown field %q in %v", f, targetType) - } - return nil - } - - // Handle arrays - if targetType.Kind() == reflect.Slice { - if targetType.Elem().Kind() == reflect.Uint8 { - outRef := reflect.New(targetType) - outVal := outRef.Interface() - //CustomType with underlying type []byte - if _, ok := outVal.(interface { - UnmarshalJSON([]byte) error - }); ok { - if err := json.Unmarshal(inputValue, outVal); err != nil { - return err - } - target.Set(outRef.Elem()) - return nil - } - // Special case for encoded bytes. Pre-go1.5 doesn't support unmarshalling - // strings into aliased []byte types. - // https://github.com/golang/go/commit/4302fd0409da5e4f1d71471a6770dacdc3301197 - // https://github.com/golang/go/commit/c60707b14d6be26bf4213114d13070bff00d0b0a - var out []byte - if err := json.Unmarshal(inputValue, &out); err != nil { - return err - } - target.SetBytes(out) - return nil - } - - var slc []json.RawMessage - if err := json.Unmarshal(inputValue, &slc); err != nil { - return err - } - if slc != nil { - l := len(slc) - target.Set(reflect.MakeSlice(targetType, l, l)) - for i := 0; i < l; i++ { - if err := u.unmarshalValue(target.Index(i), slc[i], prop); err != nil { - return err - } - } - } - return nil - } - - // Handle maps (whose keys are always strings) - if targetType.Kind() == reflect.Map { - var mp map[string]json.RawMessage - if err := json.Unmarshal(inputValue, &mp); err != nil { - return err - } - if mp != nil { - target.Set(reflect.MakeMap(targetType)) - for ks, raw := range mp { - // Unmarshal map key. The core json library already decoded the key into a - // string, so we handle that specially. Other types were quoted post-serialization. - var k reflect.Value - if targetType.Key().Kind() == reflect.String { - k = reflect.ValueOf(ks) - } else { - k = reflect.New(targetType.Key()).Elem() - var kprop *proto.Properties - if prop != nil && prop.MapKeyProp != nil { - kprop = prop.MapKeyProp - } - if err := u.unmarshalValue(k, json.RawMessage(ks), kprop); err != nil { - return err - } - } - - if !k.Type().AssignableTo(targetType.Key()) { - k = k.Convert(targetType.Key()) - } - - // Unmarshal map value. - v := reflect.New(targetType.Elem()).Elem() - var vprop *proto.Properties - if prop != nil && prop.MapValProp != nil { - vprop = prop.MapValProp - } - if err := u.unmarshalValue(v, raw, vprop); err != nil { - return err - } - target.SetMapIndex(k, v) - } - } - return nil - } - - // Non-finite numbers can be encoded as strings. - isFloat := targetType.Kind() == reflect.Float32 || targetType.Kind() == reflect.Float64 - if isFloat { - if num, ok := nonFinite[string(inputValue)]; ok { - target.SetFloat(num) - return nil - } - } - - // integers & floats can be encoded as strings. In this case we drop - // the quotes and proceed as normal. - isNum := targetType.Kind() == reflect.Int64 || targetType.Kind() == reflect.Uint64 || - targetType.Kind() == reflect.Int32 || targetType.Kind() == reflect.Uint32 || - targetType.Kind() == reflect.Float32 || targetType.Kind() == reflect.Float64 - if isNum && strings.HasPrefix(string(inputValue), `"`) { - inputValue = inputValue[1 : len(inputValue)-1] - } - - // Use the encoding/json for parsing other value types. - return json.Unmarshal(inputValue, target.Addr().Interface()) -} - -func unquote(s string) (string, error) { - var ret string - err := json.Unmarshal([]byte(s), &ret) - return ret, err -} - -// jsonProperties returns parsed proto.Properties for the field and corrects JSONName attribute. -func jsonProperties(f reflect.StructField, origName bool) *proto.Properties { - var prop proto.Properties - prop.Init(f.Type, f.Name, f.Tag.Get("protobuf"), &f) - if origName || prop.JSONName == "" { - prop.JSONName = prop.OrigName - } - return &prop -} - -type fieldNames struct { - orig, camel string -} - -func acceptedJSONFieldNames(prop *proto.Properties) fieldNames { - opts := fieldNames{orig: prop.OrigName, camel: prop.OrigName} - if prop.JSONName != "" { - opts.camel = prop.JSONName - } - return opts -} - -// Writer wrapper inspired by https://blog.golang.org/errors-are-values -type errWriter struct { - writer io.Writer - err error -} - -func (w *errWriter) write(str string) { - if w.err != nil { - return - } - _, w.err = w.writer.Write([]byte(str)) -} - -// Map fields may have key types of non-float scalars, strings and enums. -// The easiest way to sort them in some deterministic order is to use fmt. -// If this turns out to be inefficient we can always consider other options, -// such as doing a Schwartzian transform. -// -// Numeric keys are sorted in numeric order per -// https://developers.google.com/protocol-buffers/docs/proto#maps. -type mapKeys []reflect.Value - -func (s mapKeys) Len() int { return len(s) } -func (s mapKeys) Swap(i, j int) { s[i], s[j] = s[j], s[i] } -func (s mapKeys) Less(i, j int) bool { - if k := s[i].Kind(); k == s[j].Kind() { - switch k { - case reflect.String: - return s[i].String() < s[j].String() - case reflect.Int32, reflect.Int64: - return s[i].Int() < s[j].Int() - case reflect.Uint32, reflect.Uint64: - return s[i].Uint() < s[j].Uint() - } - } - return fmt.Sprint(s[i].Interface()) < fmt.Sprint(s[j].Interface()) -} - -// checkRequiredFields returns an error if any required field in the given proto message is not set. -// This function is used by both Marshal and Unmarshal. While required fields only exist in a -// proto2 message, a proto3 message can contain proto2 message(s). -func checkRequiredFields(pb proto.Message) error { - // Most well-known type messages do not contain required fields. The "Any" type may contain - // a message that has required fields. - // - // When an Any message is being marshaled, the code will invoked proto.Unmarshal on Any.Value - // field in order to transform that into JSON, and that should have returned an error if a - // required field is not set in the embedded message. - // - // When an Any message is being unmarshaled, the code will have invoked proto.Marshal on the - // embedded message to store the serialized message in Any.Value field, and that should have - // returned an error if a required field is not set. - if _, ok := pb.(isWkt); ok { - return nil - } - - v := reflect.ValueOf(pb) - // Skip message if it is not a struct pointer. - if v.Kind() != reflect.Ptr { - return nil - } - v = v.Elem() - if v.Kind() != reflect.Struct { - return nil - } - - for i := 0; i < v.NumField(); i++ { - field := v.Field(i) - sfield := v.Type().Field(i) - - if sfield.PkgPath != "" { - // blank PkgPath means the field is exported; skip if not exported - continue - } - - if strings.HasPrefix(sfield.Name, "XXX_") { - continue - } - - // Oneof field is an interface implemented by wrapper structs containing the actual oneof - // field, i.e. an interface containing &T{real_value}. - if sfield.Tag.Get("protobuf_oneof") != "" { - if field.Kind() != reflect.Interface { - continue - } - v := field.Elem() - if v.Kind() != reflect.Ptr || v.IsNil() { - continue - } - v = v.Elem() - if v.Kind() != reflect.Struct || v.NumField() < 1 { - continue - } - field = v.Field(0) - sfield = v.Type().Field(0) - } - - protoTag := sfield.Tag.Get("protobuf") - if protoTag == "" { - continue - } - var prop proto.Properties - prop.Init(sfield.Type, sfield.Name, protoTag, &sfield) - - switch field.Kind() { - case reflect.Map: - if field.IsNil() { - continue - } - // Check each map value. - keys := field.MapKeys() - for _, k := range keys { - v := field.MapIndex(k) - if err := checkRequiredFieldsInValue(v); err != nil { - return err - } - } - case reflect.Slice: - // Handle non-repeated type, e.g. bytes. - if !prop.Repeated { - if prop.Required && field.IsNil() { - return fmt.Errorf("required field %q is not set", prop.Name) - } - continue - } - - // Handle repeated type. - if field.IsNil() { - continue - } - // Check each slice item. - for i := 0; i < field.Len(); i++ { - v := field.Index(i) - if err := checkRequiredFieldsInValue(v); err != nil { - return err - } - } - case reflect.Ptr: - if field.IsNil() { - if prop.Required { - return fmt.Errorf("required field %q is not set", prop.Name) - } - continue - } - if err := checkRequiredFieldsInValue(field); err != nil { - return err - } - } - } - - // Handle proto2 extensions. - for _, ext := range proto.RegisteredExtensions(pb) { - if !proto.HasExtension(pb, ext) { - continue - } - ep, err := proto.GetExtension(pb, ext) - if err != nil { - return err - } - err = checkRequiredFieldsInValue(reflect.ValueOf(ep)) - if err != nil { - return err - } - } - - return nil -} - -func checkRequiredFieldsInValue(v reflect.Value) error { - if v.Type().Implements(messageType) { - return checkRequiredFields(v.Interface().(proto.Message)) - } - return nil -} diff --git a/vendor/github.com/golang-jwt/jwt/v5/MIGRATION_GUIDE.md b/vendor/github.com/golang-jwt/jwt/v5/MIGRATION_GUIDE.md index ff9c57e1d8..b3178e7519 100644 --- a/vendor/github.com/golang-jwt/jwt/v5/MIGRATION_GUIDE.md +++ b/vendor/github.com/golang-jwt/jwt/v5/MIGRATION_GUIDE.md @@ -155,7 +155,7 @@ stored in base64 encoded form, which was redundant with the information in the type Token struct { Raw string // Raw contains the raw token Method SigningMethod // Method is the signing method used or to be used - Header map[string]interface{} // Header is the first segment of the token in decoded form + Header map[string]any // Header is the first segment of the token in decoded form Claims Claims // Claims is the second segment of the token in decoded form Signature []byte // Signature is the third segment of the token in decoded form Valid bool // Valid specifies if the token is valid diff --git a/vendor/github.com/golang-jwt/jwt/v5/ecdsa.go b/vendor/github.com/golang-jwt/jwt/v5/ecdsa.go index c929e4a02f..06cd94d232 100644 --- a/vendor/github.com/golang-jwt/jwt/v5/ecdsa.go +++ b/vendor/github.com/golang-jwt/jwt/v5/ecdsa.go @@ -55,7 +55,7 @@ func (m *SigningMethodECDSA) Alg() string { // Verify implements token verification for the SigningMethod. // For this verify method, key must be an ecdsa.PublicKey struct -func (m *SigningMethodECDSA) Verify(signingString string, sig []byte, key interface{}) error { +func (m *SigningMethodECDSA) Verify(signingString string, sig []byte, key any) error { // Get the key var ecdsaKey *ecdsa.PublicKey switch k := key.(type) { @@ -89,7 +89,7 @@ func (m *SigningMethodECDSA) Verify(signingString string, sig []byte, key interf // Sign implements token signing for the SigningMethod. // For this signing method, key must be an ecdsa.PrivateKey struct -func (m *SigningMethodECDSA) Sign(signingString string, key interface{}) ([]byte, error) { +func (m *SigningMethodECDSA) Sign(signingString string, key any) ([]byte, error) { // Get the key var ecdsaKey *ecdsa.PrivateKey switch k := key.(type) { diff --git a/vendor/github.com/golang-jwt/jwt/v5/ecdsa_utils.go b/vendor/github.com/golang-jwt/jwt/v5/ecdsa_utils.go index 5700636d35..44a3b7a1c2 100644 --- a/vendor/github.com/golang-jwt/jwt/v5/ecdsa_utils.go +++ b/vendor/github.com/golang-jwt/jwt/v5/ecdsa_utils.go @@ -23,7 +23,7 @@ func ParseECPrivateKeyFromPEM(key []byte) (*ecdsa.PrivateKey, error) { } // Parse the key - var parsedKey interface{} + var parsedKey any if parsedKey, err = x509.ParseECPrivateKey(block.Bytes); err != nil { if parsedKey, err = x509.ParsePKCS8PrivateKey(block.Bytes); err != nil { return nil, err @@ -50,7 +50,7 @@ func ParseECPublicKeyFromPEM(key []byte) (*ecdsa.PublicKey, error) { } // Parse the key - var parsedKey interface{} + var parsedKey any if parsedKey, err = x509.ParsePKIXPublicKey(block.Bytes); err != nil { if cert, err := x509.ParseCertificate(block.Bytes); err == nil { parsedKey = cert.PublicKey diff --git a/vendor/github.com/golang-jwt/jwt/v5/ed25519.go b/vendor/github.com/golang-jwt/jwt/v5/ed25519.go index c2138119e5..4159e57bfe 100644 --- a/vendor/github.com/golang-jwt/jwt/v5/ed25519.go +++ b/vendor/github.com/golang-jwt/jwt/v5/ed25519.go @@ -33,7 +33,7 @@ func (m *SigningMethodEd25519) Alg() string { // Verify implements token verification for the SigningMethod. // For this verify method, key must be an ed25519.PublicKey -func (m *SigningMethodEd25519) Verify(signingString string, sig []byte, key interface{}) error { +func (m *SigningMethodEd25519) Verify(signingString string, sig []byte, key any) error { var ed25519Key ed25519.PublicKey var ok bool @@ -55,7 +55,7 @@ func (m *SigningMethodEd25519) Verify(signingString string, sig []byte, key inte // Sign implements token signing for the SigningMethod. // For this signing method, key must be an ed25519.PrivateKey -func (m *SigningMethodEd25519) Sign(signingString string, key interface{}) ([]byte, error) { +func (m *SigningMethodEd25519) Sign(signingString string, key any) ([]byte, error) { var ed25519Key crypto.Signer var ok bool diff --git a/vendor/github.com/golang-jwt/jwt/v5/ed25519_utils.go b/vendor/github.com/golang-jwt/jwt/v5/ed25519_utils.go index cdb5e68e87..6f46e88605 100644 --- a/vendor/github.com/golang-jwt/jwt/v5/ed25519_utils.go +++ b/vendor/github.com/golang-jwt/jwt/v5/ed25519_utils.go @@ -24,7 +24,7 @@ func ParseEdPrivateKeyFromPEM(key []byte) (crypto.PrivateKey, error) { } // Parse the key - var parsedKey interface{} + var parsedKey any if parsedKey, err = x509.ParsePKCS8PrivateKey(block.Bytes); err != nil { return nil, err } @@ -49,7 +49,7 @@ func ParseEdPublicKeyFromPEM(key []byte) (crypto.PublicKey, error) { } // Parse the key - var parsedKey interface{} + var parsedKey any if parsedKey, err = x509.ParsePKIXPublicKey(block.Bytes); err != nil { return nil, err } diff --git a/vendor/github.com/golang-jwt/jwt/v5/errors.go b/vendor/github.com/golang-jwt/jwt/v5/errors.go index 23bb616ddd..14e007516a 100644 --- a/vendor/github.com/golang-jwt/jwt/v5/errors.go +++ b/vendor/github.com/golang-jwt/jwt/v5/errors.go @@ -2,6 +2,7 @@ package jwt import ( "errors" + "fmt" "strings" ) @@ -47,3 +48,42 @@ func joinErrors(errs ...error) error { errs: errs, } } + +// Unwrap implements the multiple error unwrapping for this error type, which is +// possible in Go 1.20. +func (je joinedError) Unwrap() []error { + return je.errs +} + +// newError creates a new error message with a detailed error message. The +// message will be prefixed with the contents of the supplied error type. +// Additionally, more errors, that provide more context can be supplied which +// will be appended to the message. This makes use of Go 1.20's possibility to +// include more than one %w formatting directive in [fmt.Errorf]. +// +// For example, +// +// newError("no keyfunc was provided", ErrTokenUnverifiable) +// +// will produce the error string +// +// "token is unverifiable: no keyfunc was provided" +func newError(message string, err error, more ...error) error { + var format string + var args []any + if message != "" { + format = "%w: %s" + args = []any{err, message} + } else { + format = "%w" + args = []any{err} + } + + for _, e := range more { + format += ": %w" + args = append(args, e) + } + + err = fmt.Errorf(format, args...) + return err +} diff --git a/vendor/github.com/golang-jwt/jwt/v5/errors_go1_20.go b/vendor/github.com/golang-jwt/jwt/v5/errors_go1_20.go deleted file mode 100644 index a893d355e1..0000000000 --- a/vendor/github.com/golang-jwt/jwt/v5/errors_go1_20.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.20 -// +build go1.20 - -package jwt - -import ( - "fmt" -) - -// Unwrap implements the multiple error unwrapping for this error type, which is -// possible in Go 1.20. -func (je joinedError) Unwrap() []error { - return je.errs -} - -// newError creates a new error message with a detailed error message. The -// message will be prefixed with the contents of the supplied error type. -// Additionally, more errors, that provide more context can be supplied which -// will be appended to the message. This makes use of Go 1.20's possibility to -// include more than one %w formatting directive in [fmt.Errorf]. -// -// For example, -// -// newError("no keyfunc was provided", ErrTokenUnverifiable) -// -// will produce the error string -// -// "token is unverifiable: no keyfunc was provided" -func newError(message string, err error, more ...error) error { - var format string - var args []any - if message != "" { - format = "%w: %s" - args = []any{err, message} - } else { - format = "%w" - args = []any{err} - } - - for _, e := range more { - format += ": %w" - args = append(args, e) - } - - err = fmt.Errorf(format, args...) - return err -} diff --git a/vendor/github.com/golang-jwt/jwt/v5/errors_go_other.go b/vendor/github.com/golang-jwt/jwt/v5/errors_go_other.go deleted file mode 100644 index 2ad542f00c..0000000000 --- a/vendor/github.com/golang-jwt/jwt/v5/errors_go_other.go +++ /dev/null @@ -1,78 +0,0 @@ -//go:build !go1.20 -// +build !go1.20 - -package jwt - -import ( - "errors" - "fmt" -) - -// Is implements checking for multiple errors using [errors.Is], since multiple -// error unwrapping is not possible in versions less than Go 1.20. -func (je joinedError) Is(err error) bool { - for _, e := range je.errs { - if errors.Is(e, err) { - return true - } - } - - return false -} - -// wrappedErrors is a workaround for wrapping multiple errors in environments -// where Go 1.20 is not available. It basically uses the already implemented -// functionality of joinedError to handle multiple errors with supplies a -// custom error message that is identical to the one we produce in Go 1.20 using -// multiple %w directives. -type wrappedErrors struct { - msg string - joinedError -} - -// Error returns the stored error string -func (we wrappedErrors) Error() string { - return we.msg -} - -// newError creates a new error message with a detailed error message. The -// message will be prefixed with the contents of the supplied error type. -// Additionally, more errors, that provide more context can be supplied which -// will be appended to the message. Since we cannot use of Go 1.20's possibility -// to include more than one %w formatting directive in [fmt.Errorf], we have to -// emulate that. -// -// For example, -// -// newError("no keyfunc was provided", ErrTokenUnverifiable) -// -// will produce the error string -// -// "token is unverifiable: no keyfunc was provided" -func newError(message string, err error, more ...error) error { - // We cannot wrap multiple errors here with %w, so we have to be a little - // bit creative. Basically, we are using %s instead of %w to produce the - // same error message and then throw the result into a custom error struct. - var format string - var args []any - if message != "" { - format = "%s: %s" - args = []any{err, message} - } else { - format = "%s" - args = []any{err} - } - errs := []error{err} - - for _, e := range more { - format += ": %s" - args = append(args, e) - errs = append(errs, e) - } - - err = &wrappedErrors{ - msg: fmt.Sprintf(format, args...), - joinedError: joinedError{errs: errs}, - } - return err -} diff --git a/vendor/github.com/golang-jwt/jwt/v5/hmac.go b/vendor/github.com/golang-jwt/jwt/v5/hmac.go index aca600ce1b..1bef138c38 100644 --- a/vendor/github.com/golang-jwt/jwt/v5/hmac.go +++ b/vendor/github.com/golang-jwt/jwt/v5/hmac.go @@ -55,7 +55,7 @@ func (m *SigningMethodHMAC) Alg() string { // about this, and why we intentionally are not supporting string as a key can // be found on our usage guide // https://golang-jwt.github.io/jwt/usage/signing_methods/#signing-methods-and-key-types. -func (m *SigningMethodHMAC) Verify(signingString string, sig []byte, key interface{}) error { +func (m *SigningMethodHMAC) Verify(signingString string, sig []byte, key any) error { // Verify the key is the right type keyBytes, ok := key.([]byte) if !ok { @@ -88,7 +88,7 @@ func (m *SigningMethodHMAC) Verify(signingString string, sig []byte, key interfa // cryptographically random source, e.g. crypto/rand. Additional information // about this, and why we intentionally are not supporting string as a key can // be found on our usage guide https://golang-jwt.github.io/jwt/usage/signing_methods/. -func (m *SigningMethodHMAC) Sign(signingString string, key interface{}) ([]byte, error) { +func (m *SigningMethodHMAC) Sign(signingString string, key any) ([]byte, error) { if keyBytes, ok := key.([]byte); ok { if !m.Hash.Available() { return nil, ErrHashUnavailable diff --git a/vendor/github.com/golang-jwt/jwt/v5/map_claims.go b/vendor/github.com/golang-jwt/jwt/v5/map_claims.go index b2b51a1f80..3b9205272f 100644 --- a/vendor/github.com/golang-jwt/jwt/v5/map_claims.go +++ b/vendor/github.com/golang-jwt/jwt/v5/map_claims.go @@ -5,9 +5,9 @@ import ( "fmt" ) -// MapClaims is a claims type that uses the map[string]interface{} for JSON +// MapClaims is a claims type that uses the map[string]any for JSON // decoding. This is the default claims type if you don't supply one -type MapClaims map[string]interface{} +type MapClaims map[string]any // GetExpirationTime implements the Claims interface. func (m MapClaims) GetExpirationTime() (*NumericDate, error) { @@ -73,7 +73,7 @@ func (m MapClaims) parseClaimsString(key string) (ClaimStrings, error) { cs = append(cs, v) case []string: cs = v - case []interface{}: + case []any: for _, a := range v { vs, ok := a.(string) if !ok { @@ -92,7 +92,7 @@ func (m MapClaims) parseClaimsString(key string) (ClaimStrings, error) { func (m MapClaims) parseString(key string) (string, error) { var ( ok bool - raw interface{} + raw any iss string ) raw, ok = m[key] diff --git a/vendor/github.com/golang-jwt/jwt/v5/none.go b/vendor/github.com/golang-jwt/jwt/v5/none.go index 685c2ea306..624ad55e87 100644 --- a/vendor/github.com/golang-jwt/jwt/v5/none.go +++ b/vendor/github.com/golang-jwt/jwt/v5/none.go @@ -25,7 +25,7 @@ func (m *signingMethodNone) Alg() string { } // Only allow 'none' alg type if UnsafeAllowNoneSignatureType is specified as the key -func (m *signingMethodNone) Verify(signingString string, sig []byte, key interface{}) (err error) { +func (m *signingMethodNone) Verify(signingString string, sig []byte, key any) (err error) { // Key must be UnsafeAllowNoneSignatureType to prevent accidentally // accepting 'none' signing method if _, ok := key.(unsafeNoneMagicConstant); !ok { @@ -41,7 +41,7 @@ func (m *signingMethodNone) Verify(signingString string, sig []byte, key interfa } // Only allow 'none' signing if UnsafeAllowNoneSignatureType is specified as the key -func (m *signingMethodNone) Sign(signingString string, key interface{}) ([]byte, error) { +func (m *signingMethodNone) Sign(signingString string, key any) ([]byte, error) { if _, ok := key.(unsafeNoneMagicConstant); ok { return []byte{}, nil } diff --git a/vendor/github.com/golang-jwt/jwt/v5/parser_option.go b/vendor/github.com/golang-jwt/jwt/v5/parser_option.go index 88a780fbd4..431573557b 100644 --- a/vendor/github.com/golang-jwt/jwt/v5/parser_option.go +++ b/vendor/github.com/golang-jwt/jwt/v5/parser_option.go @@ -66,20 +66,37 @@ func WithExpirationRequired() ParserOption { } } -// WithAudience configures the validator to require the specified audience in -// the `aud` claim. Validation will fail if the audience is not listed in the -// token or the `aud` claim is missing. +// WithAudience configures the validator to require any of the specified +// audiences in the `aud` claim. Validation will fail if the audience is not +// listed in the token or the `aud` claim is missing. // // NOTE: While the `aud` claim is OPTIONAL in a JWT, the handling of it is // application-specific. Since this validation API is helping developers in // writing secure application, we decided to REQUIRE the existence of the claim, // if an audience is expected. -func WithAudience(aud string) ParserOption { +func WithAudience(aud ...string) ParserOption { return func(p *Parser) { p.validator.expectedAud = aud } } +// WithAllAudiences configures the validator to require all the specified +// audiences in the `aud` claim. Validation will fail if the specified audiences +// are not listed in the token or the `aud` claim is missing. Duplicates within +// the list are de-duplicated since internally, we use a map to look up the +// audiences. +// +// NOTE: While the `aud` claim is OPTIONAL in a JWT, the handling of it is +// application-specific. Since this validation API is helping developers in +// writing secure application, we decided to REQUIRE the existence of the claim, +// if an audience is expected. +func WithAllAudiences(aud ...string) ParserOption { + return func(p *Parser) { + p.validator.expectedAud = aud + p.validator.expectAllAud = true + } +} + // WithIssuer configures the validator to require the specified issuer in the // `iss` claim. Validation will fail if a different issuer is specified in the // token or the `iss` claim is missing. diff --git a/vendor/github.com/golang-jwt/jwt/v5/rsa.go b/vendor/github.com/golang-jwt/jwt/v5/rsa.go index 83cbee6ae2..98b960a783 100644 --- a/vendor/github.com/golang-jwt/jwt/v5/rsa.go +++ b/vendor/github.com/golang-jwt/jwt/v5/rsa.go @@ -46,7 +46,7 @@ func (m *SigningMethodRSA) Alg() string { // Verify implements token verification for the SigningMethod // For this signing method, must be an *rsa.PublicKey structure. -func (m *SigningMethodRSA) Verify(signingString string, sig []byte, key interface{}) error { +func (m *SigningMethodRSA) Verify(signingString string, sig []byte, key any) error { var rsaKey *rsa.PublicKey var ok bool @@ -67,7 +67,7 @@ func (m *SigningMethodRSA) Verify(signingString string, sig []byte, key interfac // Sign implements token signing for the SigningMethod // For this signing method, must be an *rsa.PrivateKey structure. -func (m *SigningMethodRSA) Sign(signingString string, key interface{}) ([]byte, error) { +func (m *SigningMethodRSA) Sign(signingString string, key any) ([]byte, error) { var rsaKey *rsa.PrivateKey var ok bool diff --git a/vendor/github.com/golang-jwt/jwt/v5/rsa_pss.go b/vendor/github.com/golang-jwt/jwt/v5/rsa_pss.go index 28c386ec43..f17590cc4a 100644 --- a/vendor/github.com/golang-jwt/jwt/v5/rsa_pss.go +++ b/vendor/github.com/golang-jwt/jwt/v5/rsa_pss.go @@ -1,6 +1,3 @@ -//go:build go1.4 -// +build go1.4 - package jwt import ( @@ -82,7 +79,7 @@ func init() { // Verify implements token verification for the SigningMethod. // For this verify method, key must be an rsa.PublicKey struct -func (m *SigningMethodRSAPSS) Verify(signingString string, sig []byte, key interface{}) error { +func (m *SigningMethodRSAPSS) Verify(signingString string, sig []byte, key any) error { var rsaKey *rsa.PublicKey switch k := key.(type) { case *rsa.PublicKey: @@ -108,7 +105,7 @@ func (m *SigningMethodRSAPSS) Verify(signingString string, sig []byte, key inter // Sign implements token signing for the SigningMethod. // For this signing method, key must be an rsa.PrivateKey struct -func (m *SigningMethodRSAPSS) Sign(signingString string, key interface{}) ([]byte, error) { +func (m *SigningMethodRSAPSS) Sign(signingString string, key any) ([]byte, error) { var rsaKey *rsa.PrivateKey switch k := key.(type) { diff --git a/vendor/github.com/golang-jwt/jwt/v5/rsa_utils.go b/vendor/github.com/golang-jwt/jwt/v5/rsa_utils.go index b3aeebbe11..f22c3d0685 100644 --- a/vendor/github.com/golang-jwt/jwt/v5/rsa_utils.go +++ b/vendor/github.com/golang-jwt/jwt/v5/rsa_utils.go @@ -23,7 +23,7 @@ func ParseRSAPrivateKeyFromPEM(key []byte) (*rsa.PrivateKey, error) { return nil, ErrKeyMustBePEMEncoded } - var parsedKey interface{} + var parsedKey any if parsedKey, err = x509.ParsePKCS1PrivateKey(block.Bytes); err != nil { if parsedKey, err = x509.ParsePKCS8PrivateKey(block.Bytes); err != nil { return nil, err @@ -53,7 +53,7 @@ func ParseRSAPrivateKeyFromPEMWithPassword(key []byte, password string) (*rsa.Pr return nil, ErrKeyMustBePEMEncoded } - var parsedKey interface{} + var parsedKey any var blockDecrypted []byte if blockDecrypted, err = x509.DecryptPEMBlock(block, []byte(password)); err != nil { @@ -86,7 +86,7 @@ func ParseRSAPublicKeyFromPEM(key []byte) (*rsa.PublicKey, error) { } // Parse the key - var parsedKey interface{} + var parsedKey any if parsedKey, err = x509.ParsePKIXPublicKey(block.Bytes); err != nil { if cert, err := x509.ParseCertificate(block.Bytes); err == nil { parsedKey = cert.PublicKey diff --git a/vendor/github.com/golang-jwt/jwt/v5/signing_method.go b/vendor/github.com/golang-jwt/jwt/v5/signing_method.go index 0d73631c1b..096d0ed4ca 100644 --- a/vendor/github.com/golang-jwt/jwt/v5/signing_method.go +++ b/vendor/github.com/golang-jwt/jwt/v5/signing_method.go @@ -12,9 +12,9 @@ var signingMethodLock = new(sync.RWMutex) // signature in Sign. The signature is then usually base64 encoded as part of a // JWT. type SigningMethod interface { - Verify(signingString string, sig []byte, key interface{}) error // Returns nil if signature is valid - Sign(signingString string, key interface{}) ([]byte, error) // Returns signature or error - Alg() string // returns the alg identifier for this method (example: 'HS256') + Verify(signingString string, sig []byte, key any) error // Returns nil if signature is valid + Sign(signingString string, key any) ([]byte, error) // Returns signature or error + Alg() string // returns the alg identifier for this method (example: 'HS256') } // RegisterSigningMethod registers the "alg" name and a factory function for signing method. diff --git a/vendor/github.com/golang-jwt/jwt/v5/token.go b/vendor/github.com/golang-jwt/jwt/v5/token.go index 9c7f4ab010..3f71558888 100644 --- a/vendor/github.com/golang-jwt/jwt/v5/token.go +++ b/vendor/github.com/golang-jwt/jwt/v5/token.go @@ -11,9 +11,9 @@ import ( // Token. This allows you to use properties in the Header of the token (such as // `kid`) to identify which key to use. // -// The returned interface{} may be a single key or a VerificationKeySet containing +// The returned any may be a single key or a VerificationKeySet containing // multiple keys. -type Keyfunc func(*Token) (interface{}, error) +type Keyfunc func(*Token) (any, error) // VerificationKey represents a public or secret key for verifying a token's signature. type VerificationKey interface { @@ -28,12 +28,12 @@ type VerificationKeySet struct { // Token represents a JWT Token. Different fields will be used depending on // whether you're creating or parsing/verifying a token. type Token struct { - Raw string // Raw contains the raw token. Populated when you [Parse] a token - Method SigningMethod // Method is the signing method used or to be used - Header map[string]interface{} // Header is the first segment of the token in decoded form - Claims Claims // Claims is the second segment of the token in decoded form - Signature []byte // Signature is the third segment of the token in decoded form. Populated when you Parse a token - Valid bool // Valid specifies if the token is valid. Populated when you Parse/Verify a token + Raw string // Raw contains the raw token. Populated when you [Parse] a token + Method SigningMethod // Method is the signing method used or to be used + Header map[string]any // Header is the first segment of the token in decoded form + Claims Claims // Claims is the second segment of the token in decoded form + Signature []byte // Signature is the third segment of the token in decoded form. Populated when you Parse a token + Valid bool // Valid specifies if the token is valid. Populated when you Parse/Verify a token } // New creates a new [Token] with the specified signing method and an empty map @@ -46,7 +46,7 @@ func New(method SigningMethod, opts ...TokenOption) *Token { // claims. Additional options can be specified, but are currently unused. func NewWithClaims(method SigningMethod, claims Claims, opts ...TokenOption) *Token { return &Token{ - Header: map[string]interface{}{ + Header: map[string]any{ "typ": "JWT", "alg": method.Alg(), }, @@ -60,7 +60,7 @@ func NewWithClaims(method SigningMethod, claims Claims, opts ...TokenOption) *To // https://golang-jwt.github.io/jwt/usage/signing_methods/#signing-methods-and-key-types // for an overview of the different signing methods and their respective key // types. -func (t *Token) SignedString(key interface{}) (string, error) { +func (t *Token) SignedString(key any) (string, error) { sstr, err := t.SigningString() if err != nil { return "", err diff --git a/vendor/github.com/golang-jwt/jwt/v5/types.go b/vendor/github.com/golang-jwt/jwt/v5/types.go index b2655a9e6d..a3e0ef1212 100644 --- a/vendor/github.com/golang-jwt/jwt/v5/types.go +++ b/vendor/github.com/golang-jwt/jwt/v5/types.go @@ -103,7 +103,7 @@ func (date *NumericDate) UnmarshalJSON(b []byte) (err error) { type ClaimStrings []string func (s *ClaimStrings) UnmarshalJSON(data []byte) (err error) { - var value interface{} + var value any if err = json.Unmarshal(data, &value); err != nil { return err @@ -116,7 +116,7 @@ func (s *ClaimStrings) UnmarshalJSON(data []byte) (err error) { aud = append(aud, v) case []string: aud = ClaimStrings(v) - case []interface{}: + case []any: for _, vv := range v { vs, ok := vv.(string) if !ok { diff --git a/vendor/github.com/golang-jwt/jwt/v5/validator.go b/vendor/github.com/golang-jwt/jwt/v5/validator.go index 008ecd8712..92b5c057cd 100644 --- a/vendor/github.com/golang-jwt/jwt/v5/validator.go +++ b/vendor/github.com/golang-jwt/jwt/v5/validator.go @@ -1,8 +1,8 @@ package jwt import ( - "crypto/subtle" "fmt" + "slices" "time" ) @@ -52,8 +52,12 @@ type Validator struct { verifyIat bool // expectedAud contains the audience this token expects. Supplying an empty - // string will disable aud checking. - expectedAud string + // slice will disable aud checking. + expectedAud []string + + // expectAllAud specifies whether all expected audiences must be present in + // the token. If false, only one of the expected audiences must be present. + expectAllAud bool // expectedIss contains the issuer this token expects. Supplying an empty // string will disable iss checking. @@ -88,7 +92,7 @@ func NewValidator(opts ...ParserOption) *Validator { func (v *Validator) Validate(claims Claims) error { var ( now time.Time - errs []error = make([]error, 0, 6) + errs = make([]error, 0, 6) err error ) @@ -120,8 +124,8 @@ func (v *Validator) Validate(claims Claims) error { } // If we have an expected audience, we also require the audience claim - if v.expectedAud != "" { - if err = v.verifyAudience(claims, v.expectedAud, true); err != nil { + if len(v.expectedAud) > 0 { + if err = v.verifyAudience(claims, v.expectedAud, v.expectAllAud); err != nil { errs = append(errs, err) } } @@ -226,33 +230,39 @@ func (v *Validator) verifyNotBefore(claims Claims, cmp time.Time, required bool) // // Additionally, if any error occurs while retrieving the claim, e.g., when its // the wrong type, an ErrTokenUnverifiable error will be returned. -func (v *Validator) verifyAudience(claims Claims, cmp string, required bool) error { +func (v *Validator) verifyAudience(claims Claims, cmp []string, expectAllAud bool) error { aud, err := claims.GetAudience() if err != nil { return err } - if len(aud) == 0 { + // Check that aud exists and is not empty. We only require the aud claim + // if we expect at least one audience to be present. + if len(aud) == 0 || len(aud) == 1 && aud[0] == "" { + required := len(v.expectedAud) > 0 return errorIfRequired(required, "aud") } - // use a var here to keep constant time compare when looping over a number of claims - result := false - - var stringClaims string - for _, a := range aud { - if subtle.ConstantTimeCompare([]byte(a), []byte(cmp)) != 0 { - result = true + if !expectAllAud { + for _, a := range aud { + // If we only expect one match, we can stop early if we find a match + if slices.Contains(cmp, a) { + return nil + } } - stringClaims = stringClaims + a + + return ErrTokenInvalidAudience } - // case where "" is sent in one or many aud claims - if stringClaims == "" { - return errorIfRequired(required, "aud") + // Note that we are looping cmp here to ensure that all expected audiences + // are present in the aud claim. + for _, a := range cmp { + if !slices.Contains(aud, a) { + return ErrTokenInvalidAudience + } } - return errorIfFalse(result, ErrTokenInvalidAudience) + return nil } // verifyIssuer compares the iss claim in claims against cmp. diff --git a/vendor/github.com/modern-go/reflect2/safe_type.go b/vendor/github.com/modern-go/reflect2/safe_type.go index ee4e7bb6ed..5646309e09 100644 --- a/vendor/github.com/modern-go/reflect2/safe_type.go +++ b/vendor/github.com/modern-go/reflect2/safe_type.go @@ -6,10 +6,12 @@ import ( ) type safeType struct { - reflect.Type - cfg *frozenConfig + Type reflect.Type + cfg *frozenConfig } +var _ Type = &safeType{} + func (type2 *safeType) New() interface{} { return reflect.New(type2.Type).Interface() } @@ -18,6 +20,22 @@ func (type2 *safeType) UnsafeNew() unsafe.Pointer { panic("does not support unsafe operation") } +func (type2 *safeType) Kind() reflect.Kind { + return type2.Type.Kind() +} + +func (type2 *safeType) Len() int { + return type2.Type.Len() +} + +func (type2 *safeType) NumField() int { + return type2.Type.NumField() +} + +func (type2 *safeType) String() string { + return type2.Type.String() +} + func (type2 *safeType) Elem() Type { return type2.cfg.Type2(type2.Type.Elem()) } diff --git a/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor/internal/data/add.go b/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor/internal/data/add.go index 1da69b6c62..30f1bdd3bd 100644 --- a/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor/internal/data/add.go +++ b/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor/internal/data/add.go @@ -31,7 +31,7 @@ type Adder struct{} var maxBuckets = 160 -func (add Adder) Numbers(state, dp pmetric.NumberDataPoint) error { +func (Adder) Numbers(state, dp pmetric.NumberDataPoint) error { switch dp.ValueType() { case pmetric.NumberDataPointValueTypeDouble: v := state.DoubleValue() + dp.DoubleValue() @@ -43,7 +43,7 @@ func (add Adder) Numbers(state, dp pmetric.NumberDataPoint) error { return nil } -func (add Adder) Histograms(state, dp pmetric.HistogramDataPoint) error { +func (Adder) Histograms(state, dp pmetric.HistogramDataPoint) error { // bounds different: no way to merge, so reset observation to new boundaries if !pslice.Equal(state.ExplicitBounds(), dp.ExplicitBounds()) { dp.CopyTo(state) @@ -82,7 +82,7 @@ func (add Adder) Histograms(state, dp pmetric.HistogramDataPoint) error { return nil } -func (add Adder) Exponential(state, dp pmetric.ExponentialHistogramDataPoint) error { +func (Adder) Exponential(state, dp pmetric.ExponentialHistogramDataPoint) error { type H = pmetric.ExponentialHistogramDataPoint if state.Scale() != dp.Scale() { diff --git a/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor/internal/metrics/data.go b/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor/internal/metrics/data.go index cb9b2c0ef7..dccd5e31fb 100644 --- a/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor/internal/metrics/data.go +++ b/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor/internal/metrics/data.go @@ -59,7 +59,7 @@ func (s Gauge) Ident() Ident { return (*Metric)(&s).Ident() } -func (s Gauge) SetAggregationTemporality(pmetric.AggregationTemporality) {} +func (Gauge) SetAggregationTemporality(pmetric.AggregationTemporality) {} type Summary Metric @@ -71,4 +71,4 @@ func (s Summary) Ident() Ident { return (*Metric)(&s).Ident() } -func (s Summary) SetAggregationTemporality(pmetric.AggregationTemporality) {} +func (Summary) SetAggregationTemporality(pmetric.AggregationTemporality) {} diff --git a/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor/processor.go b/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor/processor.go index 5fd061355d..849873b709 100644 --- a/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor/processor.go +++ b/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor/processor.go @@ -22,9 +22,9 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor/internal/telemetry" ) -var _ processor.Metrics = (*Processor)(nil) +var _ processor.Metrics = (*deltaToCumulativeProcessor)(nil) -type Processor struct { +type deltaToCumulativeProcessor struct { next consumer.Metrics cfg Config @@ -38,11 +38,11 @@ type Processor struct { tel telemetry.Metrics } -func newProcessor(cfg *Config, tel telemetry.Metrics, next consumer.Metrics) *Processor { +func newProcessor(cfg *Config, tel telemetry.Metrics, next consumer.Metrics) *deltaToCumulativeProcessor { ctx, cancel := context.WithCancel(context.Background()) limit := maps.Limit(int64(cfg.MaxStreams)) - proc := Processor{ + proc := deltaToCumulativeProcessor{ next: next, cfg: *cfg, last: state{ @@ -71,7 +71,7 @@ type vals struct { expo *mutex[pmetric.ExponentialHistogramDataPoint] } -func (p *Processor) ConsumeMetrics(ctx context.Context, md pmetric.Metrics) error { +func (p *deltaToCumulativeProcessor) ConsumeMetrics(ctx context.Context, md pmetric.Metrics) error { now := time.Now() const ( @@ -184,7 +184,7 @@ func (p *Processor) ConsumeMetrics(ctx context.Context, md pmetric.Metrics) erro return p.next.ConsumeMetrics(ctx, md) } -func (p *Processor) Start(_ context.Context, _ component.Host) error { +func (p *deltaToCumulativeProcessor) Start(_ context.Context, _ component.Host) error { if p.cfg.MaxStale != 0 { // delete stale streams once per minute go func() { @@ -213,12 +213,12 @@ func (p *Processor) Start(_ context.Context, _ component.Host) error { return nil } -func (p *Processor) Shutdown(_ context.Context) error { +func (p *deltaToCumulativeProcessor) Shutdown(_ context.Context) error { p.cancel() return nil } -func (p *Processor) Capabilities() consumer.Capabilities { +func (*deltaToCumulativeProcessor) Capabilities() consumer.Capabilities { return consumer.Capabilities{MutatesData: true} } diff --git a/vendor/github.com/prometheus/client_golang/prometheus/internal/difflib.go b/vendor/github.com/prometheus/client_golang/prometheus/internal/difflib.go index 8b016355ad..7bac0da33d 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/internal/difflib.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/internal/difflib.go @@ -453,7 +453,7 @@ func (m *SequenceMatcher) GetGroupedOpCodes(n int) [][]OpCode { } group = append(group, OpCode{c.Tag, i1, i2, j1, j2}) } - if len(group) > 0 && !(len(group) == 1 && group[0].Tag == 'e') { + if len(group) > 0 && (len(group) != 1 || group[0].Tag != 'e') { groups = append(groups, group) } return groups @@ -568,7 +568,7 @@ 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...)) + _, err := fmt.Fprintf(buf, format, args...) return err } ws := func(s string) error { diff --git a/vendor/github.com/prometheus/client_golang/prometheus/metric.go b/vendor/github.com/prometheus/client_golang/prometheus/metric.go index 592eec3e24..76e59f1288 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/metric.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/metric.go @@ -186,21 +186,31 @@ func (m *withExemplarsMetric) Write(pb *dto.Metric) error { case pb.Counter != nil: pb.Counter.Exemplar = m.exemplars[len(m.exemplars)-1] case pb.Histogram != nil: + h := pb.Histogram for _, e := range m.exemplars { - // pb.Histogram.Bucket are sorted by UpperBound. - i := sort.Search(len(pb.Histogram.Bucket), func(i int) bool { - return pb.Histogram.Bucket[i].GetUpperBound() >= e.GetValue() + if (h.GetZeroThreshold() != 0 || h.GetZeroCount() != 0 || + len(h.PositiveSpan) != 0 || len(h.NegativeSpan) != 0) && + e.GetTimestamp() != nil { + h.Exemplars = append(h.Exemplars, e) + if len(h.Bucket) == 0 { + // Don't proceed to classic buckets if there are none. + continue + } + } + // h.Bucket are sorted by UpperBound. + i := sort.Search(len(h.Bucket), func(i int) bool { + return h.Bucket[i].GetUpperBound() >= e.GetValue() }) - if i < len(pb.Histogram.Bucket) { - pb.Histogram.Bucket[i].Exemplar = e + if i < len(h.Bucket) { + h.Bucket[i].Exemplar = e } else { // The +Inf bucket should be explicitly added if there is an exemplar for it, similar to non-const histogram logic in https://github.com/prometheus/client_golang/blob/main/prometheus/histogram.go#L357-L365. b := &dto.Bucket{ - CumulativeCount: proto.Uint64(pb.Histogram.GetSampleCount()), + CumulativeCount: proto.Uint64(h.GetSampleCount()), UpperBound: proto.Float64(math.Inf(1)), Exemplar: e, } - pb.Histogram.Bucket = append(pb.Histogram.Bucket, b) + h.Bucket = append(h.Bucket, b) } } default: @@ -227,6 +237,7 @@ type Exemplar struct { // Only last applicable exemplar is injected from the list. // For example for Counter it means last exemplar is injected. // For Histogram, it means last applicable exemplar for each bucket is injected. +// For a Native Histogram, all valid exemplars are injected. // // NewMetricWithExemplars works best with MustNewConstMetric and // MustNewConstHistogram, see example. diff --git a/vendor/github.com/prometheus/client_golang/prometheus/process_collector_darwin.go b/vendor/github.com/prometheus/client_golang/prometheus/process_collector_darwin.go index 0a61b98461..b32c95fa3f 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/process_collector_darwin.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/process_collector_darwin.go @@ -25,9 +25,9 @@ import ( "golang.org/x/sys/unix" ) -// notImplementedErr is returned by stub functions that replace cgo functions, when cgo +// errNotImplemented is returned by stub functions that replace cgo functions, when cgo // isn't available. -var notImplementedErr = errors.New("not implemented") +var errNotImplemented = errors.New("not implemented") type memoryInfo struct { vsize uint64 // Virtual memory size in bytes @@ -101,7 +101,7 @@ func (c *processCollector) processCollect(ch chan<- Metric) { if memInfo, err := getMemory(); err == nil { ch <- MustNewConstMetric(c.rss, GaugeValue, float64(memInfo.rss)) ch <- MustNewConstMetric(c.vsize, GaugeValue, float64(memInfo.vsize)) - } else if !errors.Is(err, notImplementedErr) { + } else if !errors.Is(err, errNotImplemented) { // Don't report an error when support is not compiled in. c.reportError(ch, c.rss, err) c.reportError(ch, c.vsize, err) diff --git a/vendor/github.com/prometheus/client_golang/prometheus/process_collector_mem_nocgo_darwin.go b/vendor/github.com/prometheus/client_golang/prometheus/process_collector_mem_nocgo_darwin.go index 8ddb0995d6..378865129b 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/process_collector_mem_nocgo_darwin.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/process_collector_mem_nocgo_darwin.go @@ -16,7 +16,7 @@ package prometheus func getMemory() (*memoryInfo, error) { - return nil, notImplementedErr + return nil, errNotImplemented } // describe returns all descriptions of the collector for Darwin. diff --git a/vendor/github.com/prometheus/client_golang/prometheus/process_collector_procfsenabled.go b/vendor/github.com/prometheus/client_golang/prometheus/process_collector_procfsenabled.go index 9f4b130bef..8074f70f5d 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/process_collector_procfsenabled.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/process_collector_procfsenabled.go @@ -66,11 +66,11 @@ func (c *processCollector) processCollect(ch chan<- Metric) { if netstat, err := p.Netstat(); err == nil { var inOctets, outOctets float64 - if netstat.IpExt.InOctets != nil { - inOctets = *netstat.IpExt.InOctets + if netstat.InOctets != nil { + inOctets = *netstat.InOctets } - if netstat.IpExt.OutOctets != nil { - outOctets = *netstat.IpExt.OutOctets + if netstat.OutOctets != nil { + outOctets = *netstat.OutOctets } ch <- MustNewConstMetric(c.inBytes, CounterValue, inOctets) ch <- MustNewConstMetric(c.outBytes, CounterValue, outOctets) diff --git a/vendor/github.com/prometheus/client_golang/prometheus/vec.go b/vendor/github.com/prometheus/client_golang/prometheus/vec.go index 2c808eece0..487b466563 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/vec.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/vec.go @@ -79,7 +79,7 @@ func (m *MetricVec) DeleteLabelValues(lvs ...string) bool { return false } - return m.metricMap.deleteByHashWithLabelValues(h, lvs, m.curry) + return m.deleteByHashWithLabelValues(h, lvs, m.curry) } // Delete deletes the metric where the variable labels are the same as those @@ -101,7 +101,7 @@ func (m *MetricVec) Delete(labels Labels) bool { return false } - return m.metricMap.deleteByHashWithLabels(h, labels, m.curry) + return m.deleteByHashWithLabels(h, labels, m.curry) } // DeletePartialMatch deletes all metrics where the variable labels contain all of those @@ -114,7 +114,7 @@ func (m *MetricVec) DeletePartialMatch(labels Labels) int { labels, closer := constrainLabels(m.desc, labels) defer closer() - return m.metricMap.deleteByLabels(labels, m.curry) + return m.deleteByLabels(labels, m.curry) } // Without explicit forwarding of Describe, Collect, Reset, those methods won't @@ -216,7 +216,7 @@ func (m *MetricVec) GetMetricWithLabelValues(lvs ...string) (Metric, error) { return nil, err } - return m.metricMap.getOrCreateMetricWithLabelValues(h, lvs, m.curry), nil + return m.getOrCreateMetricWithLabelValues(h, lvs, m.curry), nil } // GetMetricWith returns the Metric for the given Labels map (the label names @@ -244,7 +244,7 @@ func (m *MetricVec) GetMetricWith(labels Labels) (Metric, error) { return nil, err } - return m.metricMap.getOrCreateMetricWithLabels(h, labels, m.curry), nil + return m.getOrCreateMetricWithLabels(h, labels, m.curry), nil } func (m *MetricVec) hashLabelValues(vals []string) (uint64, error) { diff --git a/vendor/github.com/prometheus/client_golang/prometheus/wrap.go b/vendor/github.com/prometheus/client_golang/prometheus/wrap.go index 25da157f15..2ed1285068 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/wrap.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/wrap.go @@ -63,7 +63,7 @@ func WrapRegistererWith(labels Labels, reg Registerer) Registerer { // metric names that are standardized across applications, as that would break // horizontal monitoring, for example the metrics provided by the Go collector // (see NewGoCollector) and the process collector (see NewProcessCollector). (In -// fact, those metrics are already prefixed with “go_” or “process_”, +// fact, those metrics are already prefixed with "go_" or "process_", // respectively.) // // Conflicts between Collectors registered through the original Registerer with @@ -78,6 +78,40 @@ func WrapRegistererWithPrefix(prefix string, reg Registerer) Registerer { } } +// WrapCollectorWith returns a Collector wrapping the provided Collector. The +// wrapped Collector will add the provided Labels to all Metrics it collects (as +// ConstLabels). The Metrics collected by the unmodified Collector must not +// duplicate any of those labels. +// +// WrapCollectorWith can be useful to work with multiple instances of a third +// party library that does not expose enough flexibility on the lifecycle of its +// registered metrics. +// For example, let's say you have a foo.New(reg Registerer) constructor that +// registers metrics but never unregisters them, and you want to create multiple +// instances of foo.Foo with different labels. +// The way to achieve that, is to create a new Registry, pass it to foo.New, +// then use WrapCollectorWith to wrap that Registry with the desired labels and +// register that as a collector in your main Registry. +// Then you can un-register the wrapped collector effectively un-registering the +// metrics registered by foo.New. +func WrapCollectorWith(labels Labels, c Collector) Collector { + return &wrappingCollector{ + wrappedCollector: c, + labels: labels, + } +} + +// WrapCollectorWithPrefix returns a Collector wrapping the provided Collector. The +// wrapped Collector will add the provided prefix to the name of all Metrics it collects. +// +// See the documentation of WrapCollectorWith for more details on the use case. +func WrapCollectorWithPrefix(prefix string, c Collector) Collector { + return &wrappingCollector{ + wrappedCollector: c, + prefix: prefix, + } +} + type wrappingRegisterer struct { wrappedRegisterer Registerer prefix string diff --git a/vendor/go.opentelemetry.io/collector/component/identifiable.go b/vendor/go.opentelemetry.io/collector/component/identifiable.go index 6b81476816..d85e49aa23 100644 --- a/vendor/go.opentelemetry.io/collector/component/identifiable.go +++ b/vendor/go.opentelemetry.io/collector/component/identifiable.go @@ -49,7 +49,7 @@ func (t Type) MarshalText() ([]byte, error) { // - start with an ASCII alphabetic character and // - can only contain ASCII alphanumeric characters and '_'. func NewType(ty string) (Type, error) { - if len(ty) == 0 { + if ty == "" { return Type{}, errors.New("id must not be empty") } if !typeRegexp.MatchString(ty) { diff --git a/vendor/go.opentelemetry.io/collector/confmap/README.md b/vendor/go.opentelemetry.io/collector/confmap/README.md index ca11a97295..237615c875 100644 --- a/vendor/go.opentelemetry.io/collector/confmap/README.md +++ b/vendor/go.opentelemetry.io/collector/confmap/README.md @@ -129,8 +129,6 @@ service: ```yaml # extra_extension.yaml -processors: - batch: extensions: healthcheckv2: @@ -138,7 +136,6 @@ service: extensions: [ healthcheckv2 ] pipelines: traces: - processors: [ batch ] ``` If you run the Collector with following command, @@ -157,7 +154,6 @@ processors: - key: key value: "value" action: upsert - batch: exporters: otlp/out: extensions: @@ -168,7 +164,7 @@ service: pipelines: traces: receivers: [ otlp/in ] - processors: [ attributes/example, batch ] + processors: [ attributes/example ] exporters: [ otlp/out ] extensions: [ file_storage, healthcheckv2 ] ``` diff --git a/vendor/go.opentelemetry.io/collector/confmap/xconfmap/config.go b/vendor/go.opentelemetry.io/collector/confmap/xconfmap/config.go index b9e8edbbaa..ba90b54bc2 100644 --- a/vendor/go.opentelemetry.io/collector/confmap/xconfmap/config.go +++ b/vendor/go.opentelemetry.io/collector/confmap/xconfmap/config.go @@ -172,7 +172,7 @@ func fieldName(field reflect.StructField) string { } // Even if the mapstructure tag exists, the field name may not // be available, so set it if it is still blank. - if len(fieldName) == 0 { + if fieldName == "" { fieldName = strings.ToLower(field.Name) } @@ -180,20 +180,17 @@ func fieldName(field reflect.StructField) string { } func stringifyMapKey(val reflect.Value) string { - var key string - - if str, ok := val.Interface().(string); ok { - key = str - } else if stringer, ok := val.Interface().(fmt.Stringer); ok { - key = stringer.String() - } else { + switch v := val.Interface().(type) { + case string: + return v + case fmt.Stringer: + return v.String() + default: switch val.Kind() { case reflect.Ptr, reflect.Interface, reflect.Struct, reflect.Slice, reflect.Array, reflect.Map: - key = fmt.Sprintf("[%T key]", val.Interface()) + return fmt.Sprintf("[%T key]", val.Interface()) default: - key = fmt.Sprintf("%v", val.Interface()) + return fmt.Sprintf("%v", val.Interface()) } } - - return key } diff --git a/vendor/go.opentelemetry.io/collector/featuregate/registry.go b/vendor/go.opentelemetry.io/collector/featuregate/registry.go index 9309024c38..00e6ec2151 100644 --- a/vendor/go.opentelemetry.io/collector/featuregate/registry.go +++ b/vendor/go.opentelemetry.io/collector/featuregate/registry.go @@ -20,7 +20,7 @@ var ( // idRegexp is used to validate the ID of a Gate. // IDs' characters must be alphanumeric or dots. - idRegexp = regexp.MustCompile(`^[0-9a-zA-Z\.]*$`) + idRegexp = regexp.MustCompile(`^[0-9a-zA-Z.]*$`) ) // ErrAlreadyRegistered is returned when adding a Gate that is already registered. diff --git a/vendor/go.opentelemetry.io/collector/internal/telemetry/componentattribute/logger_zap.go b/vendor/go.opentelemetry.io/collector/internal/telemetry/componentattribute/logger_zap.go index bf499ddb03..ad979adbef 100644 --- a/vendor/go.opentelemetry.io/collector/internal/telemetry/componentattribute/logger_zap.go +++ b/vendor/go.opentelemetry.io/collector/internal/telemetry/componentattribute/logger_zap.go @@ -4,19 +4,17 @@ package componentattribute // import "go.opentelemetry.io/collector/internal/telemetry/componentattribute" import ( - "reflect" - "time" - "go.opentelemetry.io/contrib/bridges/otelzap" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/log" + "go.uber.org/multierr" "go.uber.org/zap" "go.uber.org/zap/zapcore" ) // Interface for Zap cores that support setting and resetting a set of component attributes. // -// There are three wrappers that implement this interface: +// There are two wrappers that implement this interface: // // - [NewConsoleCoreWithAttributes] injects component attributes as Zap fields. // @@ -26,12 +24,6 @@ import ( // copied logs, component attributes are injected as instrumentation scope attributes. // // This is used when service::telemetry::logs::processors is configured. -// -// - [NewWrapperCoreWithAttributes] applies a wrapper function to a core, similar to -// [zap.WrapCore]. It allows setting component attributes on the inner core and reapplying the -// wrapper function when needed. -// -// This is used when adding [zapcore.NewSamplerWithOptions] to our logger stack. type coreWithAttributes interface { zapcore.Core withAttributeSet(attribute.Set) zapcore.Core @@ -74,94 +66,74 @@ func (ccwa *consoleCoreWithAttributes) withAttributeSet(attrs attribute.Set) zap } type otelTeeCoreWithAttributes struct { - zapcore.Core - consoleCore zapcore.Core - lp log.LoggerProvider - scopeName string - level zapcore.Level + sourceCore zapcore.Core + otelCore zapcore.Core + lp log.LoggerProvider + scopeName string } var _ coreWithAttributes = (*otelTeeCoreWithAttributes)(nil) -// NewOTelTeeCoreWithAttributes wraps a Zap core in order to copy logs to a [log.LoggerProvider] using [otelzap]. For the copied -// logs, component attributes are injected as instrumentation scope attributes. +// NewOTelTeeCoreWithAttributes wraps a Zap core in order to copy logs to a [log.LoggerProvider] using [otelzap]. +// For the copied logs, component attributes are injected as instrumentation scope attributes. // -// This is used when service::telemetry::logs::processors is configured. -func NewOTelTeeCoreWithAttributes(consoleCore zapcore.Core, lp log.LoggerProvider, scopeName string, level zapcore.Level, attrs attribute.Set) zapcore.Core { - otelCore, err := zapcore.NewIncreaseLevelCore(otelzap.NewCore( +// Note that we intentionally do not use zapcore.NewTee here, because it will simply duplicate all log entries +// to each core. The provided Zap core may have sampling or a minimum log level applied to it, so in order to +// maintain consistency we need to ensure that only the logs accepted by the provided core are copied to the +// log.LoggerProvider. +func NewOTelTeeCoreWithAttributes(core zapcore.Core, lp log.LoggerProvider, scopeName string, attrs attribute.Set) zapcore.Core { + otelCore := otelzap.NewCore( scopeName, otelzap.WithLoggerProvider(lp), otelzap.WithAttributes(attrs.ToSlice()...), - ), zap.NewAtomicLevelAt(level)) - if err != nil { - panic(err) - } - + ) return &otelTeeCoreWithAttributes{ - Core: zapcore.NewTee(consoleCore, otelCore), - consoleCore: consoleCore, - lp: lp, - scopeName: scopeName, - level: level, + sourceCore: core, + otelCore: otelCore, + lp: lp, + scopeName: scopeName, } } func (ocwa *otelTeeCoreWithAttributes) withAttributeSet(attrs attribute.Set) zapcore.Core { - return NewOTelTeeCoreWithAttributes(tryWithAttributeSet(ocwa.consoleCore, attrs), ocwa.lp, ocwa.scopeName, ocwa.level, attrs) + return NewOTelTeeCoreWithAttributes( + tryWithAttributeSet(ocwa.sourceCore, attrs), + ocwa.lp, ocwa.scopeName, attrs, + ) } -type samplerCoreWithAttributes struct { - zapcore.Core - from zapcore.Core -} - -var _ coreWithAttributes = (*samplerCoreWithAttributes)(nil) - -func NewSamplerCoreWithAttributes(inner zapcore.Core, tick time.Duration, first int, thereafter int) zapcore.Core { - return &samplerCoreWithAttributes{ - Core: zapcore.NewSamplerWithOptions(inner, tick, first, thereafter), - from: inner, +func (ocwa *otelTeeCoreWithAttributes) With(fields []zapcore.Field) zapcore.Core { + sourceCoreWith := ocwa.sourceCore.With(fields) + otelCoreWith := ocwa.otelCore.With(fields) + return &otelTeeCoreWithAttributes{ + sourceCore: sourceCoreWith, + otelCore: otelCoreWith, + lp: ocwa.lp, + scopeName: ocwa.scopeName, } } -func checkSamplerType(ty reflect.Type) bool { - if ty.Kind() != reflect.Pointer { - return false - } - ty = ty.Elem() - if ty.Kind() != reflect.Struct { - return false - } - innerField, ok := ty.FieldByName("Core") - if !ok { - return false - } - return reflect.TypeFor[zapcore.Core]().AssignableTo(innerField.Type) +func (ocwa *otelTeeCoreWithAttributes) Enabled(level zapcore.Level) bool { + return ocwa.sourceCore.Enabled(level) } -func (ssc *samplerCoreWithAttributes) withAttributeSet(attrs attribute.Set) zapcore.Core { - newInner := tryWithAttributeSet(ssc.from, attrs) - - // Relevant Zap code: https://github.com/uber-go/zap/blob/fcf8ee58669e358bbd6460bef5c2ee7a53c0803a/zapcore/sampler.go#L168 - // We need to create a new Zap sampler core with the same settings but with a new inner core, - // while reusing the very RAM-intensive `counters` data structure. - // The `With` method does something similar, but it only replaces pre-set fields, not the Core. - // However, we can use `reflect` to accomplish this. - // This hack can be removed once Zap supports this use case. - // Tracking issue: https://github.com/uber-go/zap/issues/1498 - val1 := reflect.ValueOf(ssc.Core) - if !checkSamplerType(val1.Type()) { // To avoid a more esoteric panic message below - panic("Unexpected Zap sampler type; see github.com/open-telemetry/opentelemetry-collector/issues/13014") +func (ocwa *otelTeeCoreWithAttributes) Check(entry zapcore.Entry, ce *zapcore.CheckedEntry) *zapcore.CheckedEntry { + ce = ocwa.sourceCore.Check(entry, ce) + if ce != nil { + // Only log to the otelzap core if the input core accepted the log entry. + ce = ce.AddCore(entry, ocwa.otelCore) } - val2 := reflect.New(val1.Type().Elem()) // core2 := new(sampler) - val2.Elem().Set(val1.Elem()) // *core2 = *core1 - val2.Elem().FieldByName("Core").Set(reflect.ValueOf(newInner)) // core2.Core = newInner - newSampler := val2.Interface().(zapcore.Core) + return ce +} - return samplerCoreWithAttributes{ - Core: newSampler, - from: newInner, - } +func (ocwa *otelTeeCoreWithAttributes) Write(entry zapcore.Entry, fields []zapcore.Field) error { + err := ocwa.sourceCore.Write(entry, fields) + return multierr.Append(err, ocwa.otelCore.Write(entry, fields)) +} + +func (ocwa *otelTeeCoreWithAttributes) Sync() error { + err := ocwa.sourceCore.Sync() + return multierr.Append(err, ocwa.otelCore.Sync()) } // ZapLoggerWithAttributes creates a Zap Logger with a new set of injected component attributes. diff --git a/vendor/go.opentelemetry.io/collector/internal/telemetry/componentattribute/tracer_provider.go b/vendor/go.opentelemetry.io/collector/internal/telemetry/componentattribute/tracer_provider.go index de77ab0eed..b2cb69404b 100644 --- a/vendor/go.opentelemetry.io/collector/internal/telemetry/componentattribute/tracer_provider.go +++ b/vendor/go.opentelemetry.io/collector/internal/telemetry/componentattribute/tracer_provider.go @@ -24,14 +24,14 @@ type tracerProviderWithAttributesSdk struct { // TracerProviderWithAttributes creates a TracerProvider with a new set of injected instrumentation scope attributes. func TracerProviderWithAttributes(tp trace.TracerProvider, attrs attribute.Set) trace.TracerProvider { - if tpwa, ok := tp.(tracerProviderWithAttributesSdk); ok { + switch tpwa := tp.(type) { + case tracerProviderWithAttributesSdk: tp = tpwa.TracerProvider - } else if tpwa, ok := tp.(tracerProviderWithAttributes); ok { + case tracerProviderWithAttributes: tp = tpwa.TracerProvider - } - if tpSdk, ok := tp.(*sdkTrace.TracerProvider); ok { + case *sdkTrace.TracerProvider: return tracerProviderWithAttributesSdk{ - TracerProvider: tpSdk, + TracerProvider: tpwa, attrs: attrs.ToSlice(), } } diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/data/bytesid.go b/vendor/go.opentelemetry.io/collector/pdata/internal/data/bytesid.go index ca86912af9..239adaf6c0 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/data/bytesid.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/data/bytesid.go @@ -5,41 +5,26 @@ package data // import "go.opentelemetry.io/collector/pdata/internal/data" import ( "encoding/hex" - "errors" - "fmt" + + "go.opentelemetry.io/collector/pdata/internal/json" ) -// marshalJSON converts trace id into a hex string enclosed in quotes. -// Called by Protobuf JSON deserialization. -func marshalJSON(id []byte) ([]byte, error) { - // Plus 2 quote chars at the start and end. - hexLen := hex.EncodedLen(len(id)) + 2 - - b := make([]byte, hexLen) - hex.Encode(b[1:hexLen-1], id) - b[0], b[hexLen-1] = '"', '"' - - return b, nil -} - // unmarshalJSON inflates trace id from hex string, possibly enclosed in quotes. // Called by Protobuf JSON deserialization. -func unmarshalJSON(dst []byte, src []byte) error { - if l := len(src); l >= 2 && src[0] == '"' && src[l-1] == '"' { - src = src[1 : l-1] - } - nLen := len(src) - if nLen == 0 { - return nil +func unmarshalJSON(dst []byte, iter *json.Iterator) { + src := iter.ReadStringAsSlice() + if len(src) == 0 { + return } - if len(dst) != hex.DecodedLen(nLen) { - return errors.New("invalid length for ID") + if len(dst) != hex.DecodedLen(len(src)) { + iter.ReportError("ID.UnmarshalJSONIter", "length mismatch") + return } _, err := hex.Decode(dst, src) if err != nil { - return fmt.Errorf("cannot unmarshal ID from string '%s': %w", string(src), err) + iter.ReportError("ID.UnmarshalJSONIter", err.Error()) + return } - return nil } diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/data/profileid.go b/vendor/go.opentelemetry.io/collector/pdata/internal/data/profileid.go index 5b4e6f53ce..72b5f5752e 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/data/profileid.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/data/profileid.go @@ -4,9 +4,12 @@ package data // import "go.opentelemetry.io/collector/pdata/internal/data" import ( + "encoding/hex" "errors" "github.com/gogo/protobuf/proto" + + "go.opentelemetry.io/collector/pdata/internal/json" ) const profileIDSize = 16 @@ -20,7 +23,7 @@ var ( // Protobuf messages. type ProfileID [profileIDSize]byte -var _ proto.Sizer = (*SpanID)(nil) +var _ proto.Sizer = (*ProfileID)(nil) // Size returns the size of the data to serialize. func (tid ProfileID) Size() int { @@ -63,17 +66,13 @@ func (tid *ProfileID) Unmarshal(data []byte) error { return nil } -// MarshalJSON converts profile id into a hex string enclosed in quotes. -func (tid ProfileID) MarshalJSON() ([]byte, error) { - if tid.IsEmpty() { - return []byte(`""`), nil - } - return marshalJSON(tid[:]) +// MarshalJSONStream converts ProfileID into a hex string. +func (tid ProfileID) MarshalJSONStream(dest *json.Stream) { + dest.WriteString(hex.EncodeToString(tid[:])) } -// UnmarshalJSON inflates profile id from hex string, possibly enclosed in quotes. -// Called by Protobuf JSON deserialization. -func (tid *ProfileID) UnmarshalJSON(data []byte) error { +// UnmarshalJSONIter decodes ProfileID from hex string. +func (tid *ProfileID) UnmarshalJSONIter(iter *json.Iterator) { *tid = [profileIDSize]byte{} - return unmarshalJSON(tid[:], data) + unmarshalJSON(tid[:], iter) } diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/data/spanid.go b/vendor/go.opentelemetry.io/collector/pdata/internal/data/spanid.go index 25110f8b44..597e071dda 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/data/spanid.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/data/spanid.go @@ -4,9 +4,12 @@ package data // import "go.opentelemetry.io/collector/pdata/internal/data" import ( + "encoding/hex" "errors" "github.com/gogo/protobuf/proto" + + "go.opentelemetry.io/collector/pdata/internal/json" ) const spanIDSize = 8 @@ -63,17 +66,13 @@ func (sid *SpanID) Unmarshal(data []byte) error { return nil } -// MarshalJSON converts SpanID into a hex string enclosed in quotes. -func (sid SpanID) MarshalJSON() ([]byte, error) { - if sid.IsEmpty() { - return []byte(`""`), nil - } - return marshalJSON(sid[:]) +// MarshalJSONStream converts SpanID into a hex string. +func (sid SpanID) MarshalJSONStream(dest *json.Stream) { + dest.WriteString(hex.EncodeToString(sid[:])) } -// UnmarshalJSON decodes SpanID from hex string, possibly enclosed in quotes. -// Called by Protobuf JSON deserialization. -func (sid *SpanID) UnmarshalJSON(data []byte) error { +// UnmarshalJSONIter decodes SpanID from hex string. +func (sid *SpanID) UnmarshalJSONIter(iter *json.Iterator) { *sid = [spanIDSize]byte{} - return unmarshalJSON(sid[:], data) + unmarshalJSON(sid[:], iter) } diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/data/traceid.go b/vendor/go.opentelemetry.io/collector/pdata/internal/data/traceid.go index 4828ee02bd..0e7c98ac91 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/data/traceid.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/data/traceid.go @@ -4,9 +4,12 @@ package data // import "go.opentelemetry.io/collector/pdata/internal/data" import ( + "encoding/hex" "errors" "github.com/gogo/protobuf/proto" + + "go.opentelemetry.io/collector/pdata/internal/json" ) const traceIDSize = 16 @@ -20,7 +23,7 @@ var ( // Protobuf messages. type TraceID [traceIDSize]byte -var _ proto.Sizer = (*SpanID)(nil) +var _ proto.Sizer = (*TraceID)(nil) // Size returns the size of the data to serialize. func (tid TraceID) Size() int { @@ -63,17 +66,13 @@ func (tid *TraceID) Unmarshal(data []byte) error { return nil } -// MarshalJSON converts trace id into a hex string enclosed in quotes. -func (tid TraceID) MarshalJSON() ([]byte, error) { - if tid.IsEmpty() { - return []byte(`""`), nil - } - return marshalJSON(tid[:]) +// MarshalJSONStream converts TraceID into a hex string. +func (tid TraceID) MarshalJSONStream(dest *json.Stream) { + dest.WriteString(hex.EncodeToString(tid[:])) } -// UnmarshalJSON inflates trace id from hex string, possibly enclosed in quotes. -// Called by Protobuf JSON deserialization. -func (tid *TraceID) UnmarshalJSON(data []byte) error { - *tid = [traceIDSize]byte{} - return unmarshalJSON(tid[:], data) +// UnmarshalJSONIter decodes TraceID from hex string. +func (tid *TraceID) UnmarshalJSONIter(iter *json.Iterator) { + *tid = [profileIDSize]byte{} + unmarshalJSON(tid[:], iter) } diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_byteslice.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_byteslice.go index 0d6214c20f..a4c6dbddcd 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_byteslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_byteslice.go @@ -1,11 +1,17 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package internal +import ( + "encoding/base64" + + "go.opentelemetry.io/collector/pdata/internal/json" +) + type ByteSlice struct { orig *[]byte state *State @@ -28,12 +34,30 @@ func CopyOrigByteSlice(dst, src []byte) []byte { return append(dst, src...) } -func FillTestByteSlice(tv ByteSlice) { +func FillTestByteSlice(ms ByteSlice) { + *ms.orig = []byte{1, 2, 3} } func GenerateTestByteSlice() ByteSlice { + orig := []byte(nil) state := StateMutable - var orig []byte = nil - - return ByteSlice{&orig, &state} + ms := NewByteSlice(&orig, &state) + FillTestByteSlice(ms) + return ms +} + +// MarshalJSONStreamByteSlice marshals all properties from the current struct to the destination stream. +func MarshalJSONStreamByteSlice(ms ByteSlice, dest *json.Stream) { + dest.WriteString(base64.StdEncoding.EncodeToString(*ms.orig)) +} + +// UnmarshalJSONIterByteSlice unmarshals all properties from the current struct from the source iterator. +func UnmarshalJSONIterByteSlice(ms ByteSlice, iter *json.Iterator) { + buf := iter.ReadStringAsSlice() + *ms.orig = make([]byte, base64.StdEncoding.DecodedLen(len(buf))) + n, err := base64.StdEncoding.Decode(*ms.orig, buf) + if err != nil { + iter.ReportError("base64.Decode", err.Error()) + } + *ms.orig = (*ms.orig)[:n] } diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_entityref.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_entityref.go index ce7f7ffe3a..5ccf61837d 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_entityref.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_entityref.go @@ -1,13 +1,14 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package internal import ( otlpcommon "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) type EntityRef struct { @@ -48,3 +49,25 @@ func FillTestEntityRef(tv EntityRef) { FillTestStringSlice(NewStringSlice(&tv.orig.IdKeys, tv.state)) FillTestStringSlice(NewStringSlice(&tv.orig.DescriptionKeys, tv.state)) } + +// MarshalJSONStream marshals all properties from the current struct to the destination stream. +func MarshalJSONStreamEntityRef(ms EntityRef, dest *json.Stream) { + dest.WriteObjectStart() + if ms.orig.SchemaUrl != "" { + dest.WriteObjectField("schemaUrl") + dest.WriteString(ms.orig.SchemaUrl) + } + if ms.orig.Type != "" { + dest.WriteObjectField("type") + dest.WriteString(ms.orig.Type) + } + if len(ms.orig.IdKeys) > 0 { + dest.WriteObjectField("idKeys") + MarshalJSONStreamStringSlice(NewStringSlice(&ms.orig.IdKeys, ms.state), dest) + } + if len(ms.orig.DescriptionKeys) > 0 { + dest.WriteObjectField("descriptionKeys") + MarshalJSONStreamStringSlice(NewStringSlice(&ms.orig.DescriptionKeys, ms.state), dest) + } + dest.WriteObjectEnd() +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_entityrefslice.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_entityrefslice.go index 1e3af887a0..a85e656545 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_entityrefslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_entityrefslice.go @@ -1,13 +1,14 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package internal import ( otlpcommon "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) type EntityRefSlice struct { @@ -57,3 +58,25 @@ func FillTestEntityRefSlice(es EntityRefSlice) { FillTestEntityRef(NewEntityRef((*es.orig)[i], es.state)) } } + +// MarshalJSONStreamEntityRefSlice marshals all properties from the current struct to the destination stream. +func MarshalJSONStreamEntityRefSlice(ms EntityRefSlice, dest *json.Stream) { + dest.WriteArrayStart() + if len(*ms.orig) > 0 { + MarshalJSONStreamEntityRef(NewEntityRef((*ms.orig)[0], ms.state), dest) + } + for i := 1; i < len((*ms.orig)); i++ { + dest.WriteMore() + MarshalJSONStreamEntityRef(NewEntityRef((*ms.orig)[i], ms.state), dest) + } + dest.WriteArrayEnd() +} + +// UnmarshalJSONStreamEntityRefSlice unmarshals all properties from the current struct from the source iterator. +func UnmarshalJSONIterEntityRefSlice(ms EntityRefSlice, iter *json.Iterator) { + iter.ReadArrayCB(func(iter *json.Iterator) bool { + *ms.orig = append(*ms.orig, &otlpcommon.EntityRef{}) + UnmarshalJSONIterEntityRef(NewEntityRef((*ms.orig)[len(*ms.orig)-1], ms.state), iter) + return true + }) +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_float64slice.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_float64slice.go index 2ca007b5f0..d530e67747 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_float64slice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_float64slice.go @@ -1,11 +1,15 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package internal +import ( + "go.opentelemetry.io/collector/pdata/internal/json" +) + type Float64Slice struct { orig *[]float64 state *State @@ -28,12 +32,35 @@ func CopyOrigFloat64Slice(dst, src []float64) []float64 { return append(dst, src...) } -func FillTestFloat64Slice(tv Float64Slice) { +func FillTestFloat64Slice(ms Float64Slice) { + *ms.orig = []float64{1.1, 2.2, 3.3} } func GenerateTestFloat64Slice() Float64Slice { + orig := []float64(nil) state := StateMutable - var orig []float64 = nil - - return Float64Slice{&orig, &state} + ms := NewFloat64Slice(&orig, &state) + FillTestFloat64Slice(ms) + return ms +} + +// MarshalJSONStreamFloat64Slice marshals all properties from the current struct to the destination stream. +func MarshalJSONStreamFloat64Slice(ms Float64Slice, dest *json.Stream) { + dest.WriteArrayStart() + if len(*ms.orig) > 0 { + dest.WriteFloat64((*ms.orig)[0]) + } + for i := 1; i < len((*ms.orig)); i++ { + dest.WriteMore() + dest.WriteFloat64((*ms.orig)[i]) + } + dest.WriteArrayEnd() +} + +// UnmarshalJSONIterFloat64Slice unmarshals all properties from the current struct from the source iterator. +func UnmarshalJSONIterFloat64Slice(ms Float64Slice, iter *json.Iterator) { + iter.ReadArrayCB(func(iter *json.Iterator) bool { + *ms.orig = append(*ms.orig, iter.ReadFloat64()) + return true + }) } diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_instrumentationscope.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_instrumentationscope.go index 5483272a96..db6800a206 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_instrumentationscope.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_instrumentationscope.go @@ -1,13 +1,14 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package internal import ( otlpcommon "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) type InstrumentationScope struct { @@ -48,3 +49,25 @@ func FillTestInstrumentationScope(tv InstrumentationScope) { FillTestMap(NewMap(&tv.orig.Attributes, tv.state)) tv.orig.DroppedAttributesCount = uint32(17) } + +// MarshalJSONStream marshals all properties from the current struct to the destination stream. +func MarshalJSONStreamInstrumentationScope(ms InstrumentationScope, dest *json.Stream) { + dest.WriteObjectStart() + if ms.orig.Name != "" { + dest.WriteObjectField("name") + dest.WriteString(ms.orig.Name) + } + if ms.orig.Version != "" { + dest.WriteObjectField("version") + dest.WriteString(ms.orig.Version) + } + if len(ms.orig.Attributes) > 0 { + dest.WriteObjectField("attributes") + MarshalJSONStreamMap(NewMap(&ms.orig.Attributes, ms.state), dest) + } + if ms.orig.DroppedAttributesCount != uint32(0) { + dest.WriteObjectField("droppedAttributesCount") + dest.WriteUint32(ms.orig.DroppedAttributesCount) + } + dest.WriteObjectEnd() +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_int32slice.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_int32slice.go index c4fe994f9a..77d4c4e9c4 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_int32slice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_int32slice.go @@ -1,11 +1,15 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package internal +import ( + "go.opentelemetry.io/collector/pdata/internal/json" +) + type Int32Slice struct { orig *[]int32 state *State @@ -28,12 +32,35 @@ func CopyOrigInt32Slice(dst, src []int32) []int32 { return append(dst, src...) } -func FillTestInt32Slice(tv Int32Slice) { +func FillTestInt32Slice(ms Int32Slice) { + *ms.orig = []int32{1, 2, 3} } func GenerateTestInt32Slice() Int32Slice { + orig := []int32(nil) state := StateMutable - var orig []int32 = nil - - return Int32Slice{&orig, &state} + ms := NewInt32Slice(&orig, &state) + FillTestInt32Slice(ms) + return ms +} + +// MarshalJSONStreamInt32Slice marshals all properties from the current struct to the destination stream. +func MarshalJSONStreamInt32Slice(ms Int32Slice, dest *json.Stream) { + dest.WriteArrayStart() + if len(*ms.orig) > 0 { + dest.WriteInt32((*ms.orig)[0]) + } + for i := 1; i < len((*ms.orig)); i++ { + dest.WriteMore() + dest.WriteInt32((*ms.orig)[i]) + } + dest.WriteArrayEnd() +} + +// UnmarshalJSONIterInt32Slice unmarshals all properties from the current struct from the source iterator. +func UnmarshalJSONIterInt32Slice(ms Int32Slice, iter *json.Iterator) { + iter.ReadArrayCB(func(iter *json.Iterator) bool { + *ms.orig = append(*ms.orig, iter.ReadInt32()) + return true + }) } diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_int64slice.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_int64slice.go index 19e49e71ff..02b976f382 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_int64slice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_int64slice.go @@ -1,11 +1,15 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package internal +import ( + "go.opentelemetry.io/collector/pdata/internal/json" +) + type Int64Slice struct { orig *[]int64 state *State @@ -28,12 +32,35 @@ func CopyOrigInt64Slice(dst, src []int64) []int64 { return append(dst, src...) } -func FillTestInt64Slice(tv Int64Slice) { +func FillTestInt64Slice(ms Int64Slice) { + *ms.orig = []int64{1, 2, 3} } func GenerateTestInt64Slice() Int64Slice { + orig := []int64(nil) state := StateMutable - var orig []int64 = nil - - return Int64Slice{&orig, &state} + ms := NewInt64Slice(&orig, &state) + FillTestInt64Slice(ms) + return ms +} + +// MarshalJSONStreamInt64Slice marshals all properties from the current struct to the destination stream. +func MarshalJSONStreamInt64Slice(ms Int64Slice, dest *json.Stream) { + dest.WriteArrayStart() + if len(*ms.orig) > 0 { + dest.WriteInt64((*ms.orig)[0]) + } + for i := 1; i < len((*ms.orig)); i++ { + dest.WriteMore() + dest.WriteInt64((*ms.orig)[i]) + } + dest.WriteArrayEnd() +} + +// UnmarshalJSONIterInt64Slice unmarshals all properties from the current struct from the source iterator. +func UnmarshalJSONIterInt64Slice(ms Int64Slice, iter *json.Iterator) { + iter.ReadArrayCB(func(iter *json.Iterator) bool { + *ms.orig = append(*ms.orig, iter.ReadInt64()) + return true + }) } diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_intslice.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_intslice.go deleted file mode 100644 index 5f3fe569ba..0000000000 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_intslice.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. -// To regenerate this file run "make genpdata". - -package internal - -type IntSlice struct { - orig *[]int - state *State -} - -func GetOrigIntSlice(ms IntSlice) *[]int { - return ms.orig -} - -func GetIntSliceState(ms IntSlice) *State { - return ms.state -} - -func NewIntSlice(orig *[]int, state *State) IntSlice { - return IntSlice{orig: orig, state: state} -} - -func FillTestIntSlice(tv IntSlice) { -} - -func GenerateTestIntSlice() IntSlice { - state := StateMutable - var orig []int = nil - - return IntSlice{&orig, &state} -} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_resource.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_resource.go index c462952ecf..e84d477662 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_resource.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_resource.go @@ -1,13 +1,14 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package internal import ( otlpresource "go.opentelemetry.io/collector/pdata/internal/data/protogen/resource/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) type Resource struct { @@ -46,3 +47,21 @@ func FillTestResource(tv Resource) { tv.orig.DroppedAttributesCount = uint32(17) FillTestEntityRefSlice(NewEntityRefSlice(&tv.orig.EntityRefs, tv.state)) } + +// MarshalJSONStream marshals all properties from the current struct to the destination stream. +func MarshalJSONStreamResource(ms Resource, dest *json.Stream) { + dest.WriteObjectStart() + if len(ms.orig.Attributes) > 0 { + dest.WriteObjectField("attributes") + MarshalJSONStreamMap(NewMap(&ms.orig.Attributes, ms.state), dest) + } + if ms.orig.DroppedAttributesCount != uint32(0) { + dest.WriteObjectField("droppedAttributesCount") + dest.WriteUint32(ms.orig.DroppedAttributesCount) + } + if len(ms.orig.EntityRefs) > 0 { + dest.WriteObjectField("entityRefs") + MarshalJSONStreamEntityRefSlice(NewEntityRefSlice(&ms.orig.EntityRefs, ms.state), dest) + } + dest.WriteObjectEnd() +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_stringslice.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_stringslice.go index a05b216f7c..2e5c7d5102 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_stringslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_stringslice.go @@ -1,11 +1,15 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package internal +import ( + "go.opentelemetry.io/collector/pdata/internal/json" +) + type StringSlice struct { orig *[]string state *State @@ -28,12 +32,35 @@ func CopyOrigStringSlice(dst, src []string) []string { return append(dst, src...) } -func FillTestStringSlice(tv StringSlice) { +func FillTestStringSlice(ms StringSlice) { + *ms.orig = []string{"a", "b", "c"} } func GenerateTestStringSlice() StringSlice { + orig := []string(nil) state := StateMutable - var orig []string = nil - - return StringSlice{&orig, &state} + ms := NewStringSlice(&orig, &state) + FillTestStringSlice(ms) + return ms +} + +// MarshalJSONStreamStringSlice marshals all properties from the current struct to the destination stream. +func MarshalJSONStreamStringSlice(ms StringSlice, dest *json.Stream) { + dest.WriteArrayStart() + if len(*ms.orig) > 0 { + dest.WriteString((*ms.orig)[0]) + } + for i := 1; i < len((*ms.orig)); i++ { + dest.WriteMore() + dest.WriteString((*ms.orig)[i]) + } + dest.WriteArrayEnd() +} + +// UnmarshalJSONIterStringSlice unmarshals all properties from the current struct from the source iterator. +func UnmarshalJSONIterStringSlice(ms StringSlice, iter *json.Iterator) { + iter.ReadArrayCB(func(iter *json.Iterator) bool { + *ms.orig = append(*ms.orig, iter.ReadString()) + return true + }) } diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_uint64slice.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_uint64slice.go index dbbe25fe96..099eb7c4be 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_uint64slice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_uint64slice.go @@ -1,11 +1,15 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package internal +import ( + "go.opentelemetry.io/collector/pdata/internal/json" +) + type UInt64Slice struct { orig *[]uint64 state *State @@ -28,12 +32,35 @@ func CopyOrigUInt64Slice(dst, src []uint64) []uint64 { return append(dst, src...) } -func FillTestUInt64Slice(tv UInt64Slice) { +func FillTestUInt64Slice(ms UInt64Slice) { + *ms.orig = []uint64{1, 2, 3} } func GenerateTestUInt64Slice() UInt64Slice { + orig := []uint64(nil) state := StateMutable - var orig []uint64 = nil - - return UInt64Slice{&orig, &state} + ms := NewUInt64Slice(&orig, &state) + FillTestUInt64Slice(ms) + return ms +} + +// MarshalJSONStreamUInt64Slice marshals all properties from the current struct to the destination stream. +func MarshalJSONStreamUInt64Slice(ms UInt64Slice, dest *json.Stream) { + dest.WriteArrayStart() + if len(*ms.orig) > 0 { + dest.WriteUint64((*ms.orig)[0]) + } + for i := 1; i < len((*ms.orig)); i++ { + dest.WriteMore() + dest.WriteUint64((*ms.orig)[i]) + } + dest.WriteArrayEnd() +} + +// UnmarshalJSONIterUInt64Slice unmarshals all properties from the current struct from the source iterator. +func UnmarshalJSONIterUInt64Slice(ms UInt64Slice, iter *json.Iterator) { + iter.ReadArrayCB(func(iter *json.Iterator) bool { + *ms.orig = append(*ms.orig, iter.ReadUint64()) + return true + }) } diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/json/attribute.go b/vendor/go.opentelemetry.io/collector/pdata/internal/json/attribute.go deleted file mode 100644 index 89d957a653..0000000000 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/json/attribute.go +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package json // import "go.opentelemetry.io/collector/pdata/internal/json" - -import ( - "encoding/base64" - "fmt" - - jsoniter "github.com/json-iterator/go" - - otlpcommon "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" -) - -// ReadAttribute Unmarshal JSON data and return otlpcommon.KeyValue -func ReadAttribute(iter *jsoniter.Iterator) otlpcommon.KeyValue { - kv := otlpcommon.KeyValue{} - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { - switch f { - case "key": - kv.Key = iter.ReadString() - case "value": - ReadValue(iter, &kv.Value) - default: - iter.Skip() - } - return true - }) - return kv -} - -// ReadValue Unmarshal JSON data and return otlpcommon.AnyValue -func ReadValue(iter *jsoniter.Iterator, val *otlpcommon.AnyValue) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { - switch f { - case "stringValue", "string_value": - val.Value = &otlpcommon.AnyValue_StringValue{ - StringValue: iter.ReadString(), - } - - case "boolValue", "bool_value": - val.Value = &otlpcommon.AnyValue_BoolValue{ - BoolValue: iter.ReadBool(), - } - case "intValue", "int_value": - val.Value = &otlpcommon.AnyValue_IntValue{ - IntValue: ReadInt64(iter), - } - case "doubleValue", "double_value": - val.Value = &otlpcommon.AnyValue_DoubleValue{ - DoubleValue: ReadFloat64(iter), - } - case "bytesValue", "bytes_value": - v, err := base64.StdEncoding.DecodeString(iter.ReadString()) - if err != nil { - iter.ReportError("bytesValue", fmt.Sprintf("base64 decode:%v", err)) - break - } - val.Value = &otlpcommon.AnyValue_BytesValue{ - BytesValue: v, - } - case "arrayValue", "array_value": - val.Value = &otlpcommon.AnyValue_ArrayValue{ - ArrayValue: readArray(iter), - } - case "kvlistValue", "kvlist_value": - val.Value = &otlpcommon.AnyValue_KvlistValue{ - KvlistValue: readKvlistValue(iter), - } - default: - iter.Skip() - } - return true - }) -} - -func readArray(iter *jsoniter.Iterator) *otlpcommon.ArrayValue { - v := &otlpcommon.ArrayValue{} - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { - switch f { - case "values": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - v.Values = append(v.Values, otlpcommon.AnyValue{}) - ReadValue(iter, &v.Values[len(v.Values)-1]) - return true - }) - default: - iter.Skip() - } - return true - }) - return v -} - -func readKvlistValue(iter *jsoniter.Iterator) *otlpcommon.KeyValueList { - v := &otlpcommon.KeyValueList{} - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { - switch f { - case "values": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - v.Values = append(v.Values, ReadAttribute(iter)) - return true - }) - default: - iter.Skip() - } - return true - }) - return v -} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/json/enum.go b/vendor/go.opentelemetry.io/collector/pdata/internal/json/enum.go deleted file mode 100644 index 02dd2b7768..0000000000 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/json/enum.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package json // import "go.opentelemetry.io/collector/pdata/internal/json" - -import ( - jsoniter "github.com/json-iterator/go" -) - -// ReadEnumValue returns the enum integer value representation. Accepts both enum names and enum integer values. -// See https://developers.google.com/protocol-buffers/docs/proto3#json. -func ReadEnumValue(iter *jsoniter.Iterator, valueMap map[string]int32) int32 { - switch iter.WhatIsNext() { - case jsoniter.NumberValue: - return iter.ReadInt32() - case jsoniter.StringValue: - val, ok := valueMap[iter.ReadString()] - // Same behavior with official protobuf JSON decoder, - // see https://github.com/open-telemetry/opentelemetry-proto-go/pull/81 - if !ok { - iter.ReportError("ReadEnumValue", "unknown string value") - return 0 - } - return val - default: - iter.ReportError("ReadEnumValue", "unsupported value type") - return 0 - } -} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/json/iterator.go b/vendor/go.opentelemetry.io/collector/pdata/internal/json/iterator.go new file mode 100644 index 0000000000..8b6086e934 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/json/iterator.go @@ -0,0 +1,211 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package json // import "go.opentelemetry.io/collector/pdata/internal/json" +import ( + "strconv" + + jsoniter "github.com/json-iterator/go" +) + +func BorrowIterator(data []byte) *Iterator { + return &Iterator{ + delegate: jsoniter.ConfigFastest.BorrowIterator(data), + } +} + +func ReturnIterator(s *Iterator) { + jsoniter.ConfigFastest.ReturnIterator(s.delegate) +} + +type Iterator struct { + delegate *jsoniter.Iterator +} + +// ReadInt32 unmarshalls JSON data into an int32. Accepts both numbers and strings decimal. +// See https://developers.google.com/protocol-buffers/docs/proto3#json. +func (iter *Iterator) ReadInt32() int32 { + switch iter.delegate.WhatIsNext() { + case jsoniter.NumberValue: + return iter.delegate.ReadInt32() + case jsoniter.StringValue: + val, err := strconv.ParseInt(iter.ReadString(), 10, 32) + if err != nil { + iter.ReportError("ReadInt32", err.Error()) + return 0 + } + return int32(val) + default: + iter.ReportError("ReadInt32", "unsupported value type") + return 0 + } +} + +// ReadUint32 unmarshalls JSON data into an uint32. Accepts both numbers and strings decimal. +// See https://developers.google.com/protocol-buffers/docs/proto3#json. +func (iter *Iterator) ReadUint32() uint32 { + switch iter.delegate.WhatIsNext() { + case jsoniter.NumberValue: + return iter.delegate.ReadUint32() + case jsoniter.StringValue: + val, err := strconv.ParseUint(iter.ReadString(), 10, 32) + if err != nil { + iter.ReportError("ReadUint32", err.Error()) + return 0 + } + return uint32(val) + default: + iter.ReportError("ReadUint32", "unsupported value type") + return 0 + } +} + +// ReadInt64 unmarshalls JSON data into an int64. Accepts both numbers and strings decimal. +// See https://developers.google.com/protocol-buffers/docs/proto3#json. +func (iter *Iterator) ReadInt64() int64 { + switch iter.delegate.WhatIsNext() { + case jsoniter.NumberValue: + return iter.delegate.ReadInt64() + case jsoniter.StringValue: + val, err := strconv.ParseInt(iter.ReadString(), 10, 64) + if err != nil { + iter.ReportError("ReadInt64", err.Error()) + return 0 + } + return val + default: + iter.ReportError("ReadInt64", "unsupported value type") + return 0 + } +} + +// ReadUint64 unmarshalls JSON data into an uint64. Accepts both numbers and strings decimal. +// See https://developers.google.com/protocol-buffers/docs/proto3#json. +func (iter *Iterator) ReadUint64() uint64 { + switch iter.delegate.WhatIsNext() { + case jsoniter.NumberValue: + return iter.delegate.ReadUint64() + case jsoniter.StringValue: + val, err := strconv.ParseUint(iter.ReadString(), 10, 64) + if err != nil { + iter.ReportError("ReadUint64", err.Error()) + return 0 + } + return val + default: + iter.ReportError("ReadUint64", "unsupported value type") + return 0 + } +} + +func (iter *Iterator) ReadFloat32() float32 { + switch iter.delegate.WhatIsNext() { + case jsoniter.NumberValue: + return iter.delegate.ReadFloat32() + case jsoniter.StringValue: + val, err := strconv.ParseFloat(iter.ReadString(), 32) + if err != nil { + iter.ReportError("ReadUint64", err.Error()) + return 0 + } + return float32(val) + default: + iter.ReportError("ReadUint64", "unsupported value type") + return 0 + } +} + +func (iter *Iterator) ReadFloat64() float64 { + switch iter.delegate.WhatIsNext() { + case jsoniter.NumberValue: + return iter.delegate.ReadFloat64() + case jsoniter.StringValue: + val, err := strconv.ParseFloat(iter.ReadString(), 64) + if err != nil { + iter.ReportError("ReadUint64", err.Error()) + return 0 + } + return val + default: + iter.ReportError("ReadUint64", "unsupported value type") + return 0 + } +} + +// ReadBool reads a json object as BoolValue +func (iter *Iterator) ReadBool() bool { + return iter.delegate.ReadBool() +} + +// ReadString read string from iterator +func (iter *Iterator) ReadString() string { + return iter.delegate.ReadString() +} + +// ReadStringAsSlice read string from iterator without copying into string form. +// The []byte cannot be kept, as it will change after next iterator call. +func (iter *Iterator) ReadStringAsSlice() []byte { + return iter.delegate.ReadStringAsSlice() +} + +// ReportError record a error in iterator instance with current position. +func (iter *Iterator) ReportError(operation string, msg string) { + iter.delegate.ReportError(operation, msg) +} + +// Error returns any recorded error if any otherwise it returns nil. +func (iter *Iterator) Error() error { + return iter.delegate.Error +} + +// Skip skips a json object and positions to relatively the next json object +func (iter *Iterator) Skip() { + iter.delegate.Skip() +} + +// ReadArrayCB read array with callback +func (iter *Iterator) ReadArrayCB(fn func(iter *Iterator) bool) { + iter.delegate.ReadArrayCB(func(iterator *jsoniter.Iterator) bool { + newIter := Iterator{ + delegate: iterator, + } + return fn(&newIter) + }) +} + +// ReadObjectCB read object with callback, the key is ascii only and field name not copied +func (iter *Iterator) ReadObjectCB(fn func(iter *Iterator, f string) bool) { + iter.delegate.ReadObjectCB(func(iterator *jsoniter.Iterator, f string) bool { + newIter := Iterator{ + delegate: iterator, + } + return fn(&newIter, f) + }) +} + +// ReadEnumValue returns the enum integer value representation. Accepts both enum names and enum integer values. +// See https://developers.google.com/protocol-buffers/docs/proto3#json. +func (iter *Iterator) ReadEnumValue(valueMap map[string]int32) int32 { + switch iter.delegate.WhatIsNext() { + case jsoniter.NumberValue: + return iter.ReadInt32() + case jsoniter.StringValue: + val, ok := valueMap[iter.ReadString()] + // Same behavior with official protobuf JSON decoder, + // see https://github.com/open-telemetry/opentelemetry-proto-go/pull/81 + if !ok { + iter.ReportError("ReadEnumValue", "unknown string value") + return 0 + } + return val + default: + iter.ReportError("ReadEnumValue", "unsupported value type") + return 0 + } +} + +// ResetBytes reuse iterator instance by specifying another byte array as input +func (iter *Iterator) ResetBytes(input []byte) *Iterator { + iter.delegate.ResetBytes(input) + return iter +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/json/json.go b/vendor/go.opentelemetry.io/collector/pdata/internal/json/json.go deleted file mode 100644 index b77d934b69..0000000000 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/json/json.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package json // import "go.opentelemetry.io/collector/pdata/internal/json" - -import ( - "io" - - "github.com/gogo/protobuf/jsonpb" - "github.com/gogo/protobuf/proto" -) - -var marshaler = &jsonpb.Marshaler{ - // https://github.com/open-telemetry/opentelemetry-specification/pull/2758 - EnumsAsInts: true, - // https://github.com/open-telemetry/opentelemetry-specification/pull/2829 - OrigName: false, -} - -func Marshal(out io.Writer, pb proto.Message) error { - return marshaler.Marshal(out, pb) -} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/json/number.go b/vendor/go.opentelemetry.io/collector/pdata/internal/json/number.go deleted file mode 100644 index 23830b9713..0000000000 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/json/number.go +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package json // import "go.opentelemetry.io/collector/pdata/internal/json" - -import ( - "strconv" - - jsoniter "github.com/json-iterator/go" -) - -// ReadInt32 unmarshalls JSON data into an int32. Accepts both numbers and strings decimal. -// See https://developers.google.com/protocol-buffers/docs/proto3#json. -func ReadInt32(iter *jsoniter.Iterator) int32 { - switch iter.WhatIsNext() { - case jsoniter.NumberValue: - return iter.ReadInt32() - case jsoniter.StringValue: - val, err := strconv.ParseInt(iter.ReadString(), 10, 32) - if err != nil { - iter.ReportError("ReadInt32", err.Error()) - return 0 - } - return int32(val) - default: - iter.ReportError("ReadInt32", "unsupported value type") - return 0 - } -} - -// ReadUint32 unmarshalls JSON data into an uint32. Accepts both numbers and strings decimal. -// See https://developers.google.com/protocol-buffers/docs/proto3#json. -func ReadUint32(iter *jsoniter.Iterator) uint32 { - switch iter.WhatIsNext() { - case jsoniter.NumberValue: - return iter.ReadUint32() - case jsoniter.StringValue: - val, err := strconv.ParseUint(iter.ReadString(), 10, 32) - if err != nil { - iter.ReportError("ReadUint32", err.Error()) - return 0 - } - return uint32(val) - default: - iter.ReportError("ReadUint32", "unsupported value type") - return 0 - } -} - -// ReadInt64 unmarshalls JSON data into an int64. Accepts both numbers and strings decimal. -// See https://developers.google.com/protocol-buffers/docs/proto3#json. -func ReadInt64(iter *jsoniter.Iterator) int64 { - switch iter.WhatIsNext() { - case jsoniter.NumberValue: - return iter.ReadInt64() - case jsoniter.StringValue: - val, err := strconv.ParseInt(iter.ReadString(), 10, 64) - if err != nil { - iter.ReportError("ReadInt64", err.Error()) - return 0 - } - return val - default: - iter.ReportError("ReadInt64", "unsupported value type") - return 0 - } -} - -// ReadUint64 unmarshalls JSON data into an uint64. Accepts both numbers and strings decimal. -// See https://developers.google.com/protocol-buffers/docs/proto3#json. -func ReadUint64(iter *jsoniter.Iterator) uint64 { - switch iter.WhatIsNext() { - case jsoniter.NumberValue: - return iter.ReadUint64() - case jsoniter.StringValue: - val, err := strconv.ParseUint(iter.ReadString(), 10, 64) - if err != nil { - iter.ReportError("ReadUint64", err.Error()) - return 0 - } - return val - default: - iter.ReportError("ReadUint64", "unsupported value type") - return 0 - } -} - -func ReadFloat64(iter *jsoniter.Iterator) float64 { - switch iter.WhatIsNext() { - case jsoniter.NumberValue: - return iter.ReadFloat64() - case jsoniter.StringValue: - val, err := strconv.ParseFloat(iter.ReadString(), 64) - if err != nil { - iter.ReportError("ReadUint64", err.Error()) - return 0 - } - return val - default: - iter.ReportError("ReadUint64", "unsupported value type") - return 0 - } -} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/json/resource.go b/vendor/go.opentelemetry.io/collector/pdata/internal/json/resource.go deleted file mode 100644 index 302033bc44..0000000000 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/json/resource.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package json // import "go.opentelemetry.io/collector/pdata/internal/json" - -import ( - jsoniter "github.com/json-iterator/go" - - otlpresource "go.opentelemetry.io/collector/pdata/internal/data/protogen/resource/v1" -) - -func ReadResource(iter *jsoniter.Iterator, resource *otlpresource.Resource) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { - switch f { - case "attributes": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - resource.Attributes = append(resource.Attributes, ReadAttribute(iter)) - return true - }) - case "droppedAttributesCount", "dropped_attributes_count": - resource.DroppedAttributesCount = ReadUint32(iter) - default: - iter.Skip() - } - return true - }) -} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/json/scope.go b/vendor/go.opentelemetry.io/collector/pdata/internal/json/scope.go deleted file mode 100644 index 40ad41b15b..0000000000 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/json/scope.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package json // import "go.opentelemetry.io/collector/pdata/internal/json" - -import ( - jsoniter "github.com/json-iterator/go" - - otlpcommon "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" -) - -func ReadScope(iter *jsoniter.Iterator, scope *otlpcommon.InstrumentationScope) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { - switch f { - case "name": - scope.Name = iter.ReadString() - case "version": - scope.Version = iter.ReadString() - case "attributes": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - scope.Attributes = append(scope.Attributes, ReadAttribute(iter)) - return true - }) - case "droppedAttributesCount", "dropped_attributes_count": - scope.DroppedAttributesCount = ReadUint32(iter) - default: - iter.Skip() - } - return true - }) -} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/json/stream.go b/vendor/go.opentelemetry.io/collector/pdata/internal/json/stream.go new file mode 100644 index 0000000000..09ba30f4f4 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/json/stream.go @@ -0,0 +1,93 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package json // import "go.opentelemetry.io/collector/pdata/internal/json" + +import ( + "errors" + "io" + "math" + "strconv" + + jsoniter "github.com/json-iterator/go" +) + +func BorrowStream(writer io.Writer) *Stream { + return &Stream{ + Stream: jsoniter.ConfigFastest.BorrowStream(writer), + wmTracker: make([]bool, 32), + } +} + +func ReturnStream(s *Stream) { + jsoniter.ConfigFastest.ReturnStream(s.Stream) +} + +// Stream avoids the need to explicitly call the `Stream.WriteMore` method while marshaling objects by +// checking if a field was previously written inside the current object and automatically appending a "," +// if so before writing the next field. +type Stream struct { + *jsoniter.Stream + // wmTracker acts like a stack which pushes a new value when an object is started and removes the + // top when it is ended. The value added for every object tracks if there is any written field + // already for that object, and if it is then automatically add a "," before any new field. + wmTracker []bool +} + +func (ots *Stream) WriteObjectStart() { + ots.Stream.WriteObjectStart() + ots.wmTracker = append(ots.wmTracker, false) +} + +func (ots *Stream) WriteObjectField(field string) { + if ots.wmTracker[len(ots.wmTracker)-1] { + ots.WriteMore() + } + + ots.Stream.WriteObjectField(field) + ots.wmTracker[len(ots.wmTracker)-1] = true +} + +func (ots *Stream) WriteObjectEnd() { + ots.Stream.WriteObjectEnd() + ots.wmTracker = ots.wmTracker[:len(ots.wmTracker)-1] +} + +// 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)) +} + +// 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)) +} + +// WriteFloat64 writes the JSON value that will be a number or one of the special string +// values "NaN", "Infinity", and "-Infinity". Either numbers or strings are accepted. +// Empty strings are invalid. Exponent notation is also accepted. +// See https://protobuf.dev/programming-guides/json/. +func (ots *Stream) WriteFloat64(val float64) { + if math.IsNaN(val) { + ots.WriteString("NaN") + return + } + if math.IsInf(val, 1) { + ots.WriteString("Infinity") + return + } + if math.IsInf(val, -1) { + ots.WriteString("-Infinity") + return + } + + ots.Stream.WriteFloat64(val) +} + +func (ots *Stream) ReportError(err error) { + ots.Stream.Error = errors.Join(ots.Stream.Error, err) +} + +func (ots *Stream) Error() error { + return ots.Stream.Error +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_entityref.go b/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_entityref.go new file mode 100644 index 0000000000..5fabc83160 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_entityref.go @@ -0,0 +1,26 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package internal // import "go.opentelemetry.io/collector/pdata/internal" + +import ( + "go.opentelemetry.io/collector/pdata/internal/json" +) + +func UnmarshalJSONIterEntityRef(ms EntityRef, iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { + switch f { + case "schemaUrl", "schema_url": + ms.orig.SchemaUrl = iter.ReadString() + case "type": + ms.orig.Type = iter.ReadString() + case "idKeys", "id_keys": + UnmarshalJSONIterStringSlice(NewStringSlice(&ms.orig.IdKeys, ms.state), iter) + case "descriptionKeys", "description_keys": + UnmarshalJSONIterStringSlice(NewStringSlice(&ms.orig.DescriptionKeys, ms.state), iter) + default: + iter.Skip() + } + return true + }) +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_instrumentationscope.go b/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_instrumentationscope.go new file mode 100644 index 0000000000..8bcb6d5712 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_instrumentationscope.go @@ -0,0 +1,26 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package internal // import "go.opentelemetry.io/collector/pdata/internal" + +import ( + "go.opentelemetry.io/collector/pdata/internal/json" +) + +func UnmarshalJSONIterInstrumentationScope(ms InstrumentationScope, iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { + switch f { + case "name": + ms.orig.Name = iter.ReadString() + case "version": + ms.orig.Version = iter.ReadString() + case "attributes": + UnmarshalJSONIterMap(NewMap(&ms.orig.Attributes, ms.state), iter) + case "droppedAttributesCount", "dropped_attributes_count": + ms.orig.DroppedAttributesCount = iter.ReadUint32() + default: + iter.Skip() + } + return true + }) +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_map.go b/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_map.go index 131ed01fcd..09346a4771 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_map.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_map.go @@ -5,6 +5,7 @@ package internal // import "go.opentelemetry.io/collector/pdata/internal" import ( otlpcommon "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) type Map struct { @@ -45,6 +46,59 @@ func GenerateTestMap() Map { } func FillTestMap(dest Map) { - *dest.orig = nil - *dest.orig = append(*dest.orig, otlpcommon.KeyValue{Key: "k", Value: otlpcommon.AnyValue{Value: &otlpcommon.AnyValue_StringValue{StringValue: "v"}}}) + *dest.orig = []otlpcommon.KeyValue{ + {Key: "str", Value: otlpcommon.AnyValue{Value: &otlpcommon.AnyValue_StringValue{StringValue: "value"}}}, + {Key: "bool", Value: otlpcommon.AnyValue{Value: &otlpcommon.AnyValue_BoolValue{BoolValue: true}}}, + {Key: "double", Value: otlpcommon.AnyValue{Value: &otlpcommon.AnyValue_DoubleValue{DoubleValue: 3.14}}}, + {Key: "int", Value: otlpcommon.AnyValue{Value: &otlpcommon.AnyValue_IntValue{IntValue: 123}}}, + {Key: "bytes", Value: otlpcommon.AnyValue{Value: &otlpcommon.AnyValue_BytesValue{BytesValue: []byte{1, 2, 3}}}}, + {Key: "array", Value: otlpcommon.AnyValue{Value: &otlpcommon.AnyValue_ArrayValue{ + ArrayValue: &otlpcommon.ArrayValue{Values: []otlpcommon.AnyValue{{Value: &otlpcommon.AnyValue_IntValue{IntValue: 321}}}}, + }}}, + {Key: "map", Value: otlpcommon.AnyValue{Value: &otlpcommon.AnyValue_KvlistValue{ + KvlistValue: &otlpcommon.KeyValueList{Values: []otlpcommon.KeyValue{{Key: "key", Value: otlpcommon.AnyValue{Value: &otlpcommon.AnyValue_StringValue{StringValue: "value"}}}}}, + }}}, + } +} + +// MarshalJSONStreamMap marshals all properties from the current struct to the destination stream. +func MarshalJSONStreamMap(ms Map, dest *json.Stream) { + dest.WriteArrayStart() + if len(*ms.orig) > 0 { + writeAttribute(&(*ms.orig)[0], ms.state, dest) + } + for i := 1; i < len(*ms.orig); i++ { + dest.WriteMore() + writeAttribute(&(*ms.orig)[i], ms.state, dest) + } + dest.WriteArrayEnd() +} + +func writeAttribute(attr *otlpcommon.KeyValue, state *State, dest *json.Stream) { + dest.WriteObjectStart() + if attr.Key != "" { + dest.WriteObjectField("key") + dest.WriteString(attr.Key) + } + dest.WriteObjectField("value") + MarshalJSONStreamValue(NewValue(&attr.Value, state), dest) + dest.WriteObjectEnd() +} + +func UnmarshalJSONIterMap(ms Map, iter *json.Iterator) { + iter.ReadArrayCB(func(iter *json.Iterator) bool { + *ms.orig = append(*ms.orig, otlpcommon.KeyValue{}) + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { + switch f { + case "key": + (*ms.orig)[len(*ms.orig)-1].Key = iter.ReadString() + case "value": + UnmarshalJSONIterValue(NewValue(&(*ms.orig)[len(*ms.orig)-1].Value, nil), iter) + default: + iter.Skip() + } + return true + }) + return true + }) } diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_resource.go b/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_resource.go new file mode 100644 index 0000000000..44b6417236 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_resource.go @@ -0,0 +1,24 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package internal // import "go.opentelemetry.io/collector/pdata/internal" + +import ( + "go.opentelemetry.io/collector/pdata/internal/json" +) + +func UnmarshalJSONIterResource(ms Resource, iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { + switch f { + case "attributes": + UnmarshalJSONIterMap(NewMap(&ms.orig.Attributes, ms.state), iter) + case "droppedAttributesCount", "dropped_attributes_count": + ms.orig.DroppedAttributesCount = iter.ReadUint32() + case "entityRefs", "entity_refs": + UnmarshalJSONIterEntityRefSlice(NewEntityRefSlice(&ms.orig.EntityRefs, ms.state), iter) + default: + iter.Skip() + } + return true + }) +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_slice.go b/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_slice.go index 5105cc6f3a..a1f2a9780b 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_slice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_slice.go @@ -5,6 +5,7 @@ package internal // import "go.opentelemetry.io/collector/pdata/internal" import ( otlpcommon "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) type Slice struct { @@ -50,3 +51,24 @@ func FillTestSlice(tv Slice) { FillTestValue(NewValue(&(*tv.orig)[i], &state)) } } + +// MarshalJSONStreamSlice marshals all properties from the current struct to the destination stream. +func MarshalJSONStreamSlice(ms Slice, dest *json.Stream) { + dest.WriteArrayStart() + if len(*ms.orig) > 0 { + MarshalJSONStreamValue(NewValue(&(*ms.orig)[0], ms.state), dest) + } + for i := 1; i < len(*ms.orig); i++ { + dest.WriteMore() + MarshalJSONStreamValue(NewValue(&(*ms.orig)[i], ms.state), dest) + } + dest.WriteArrayEnd() +} + +func UnmarshalJSONIterSlice(ms Slice, iter *json.Iterator) { + iter.ReadArrayCB(func(iter *json.Iterator) bool { + *ms.orig = append(*ms.orig, otlpcommon.AnyValue{}) + UnmarshalJSONIterValue(NewValue(&(*ms.orig)[len(*ms.orig)-1], ms.state), iter) + return true + }) +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_tracestate.go b/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_tracestate.go index d1d5c3cf86..d210b99692 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_tracestate.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_tracestate.go @@ -3,6 +3,10 @@ package internal // import "go.opentelemetry.io/collector/pdata/internal" +import ( + "go.opentelemetry.io/collector/pdata/internal/json" +) + type TraceState struct { orig *string state *State @@ -35,3 +39,8 @@ func GenerateTestTraceState() TraceState { func FillTestTraceState(dest TraceState) { *dest.orig = "rojo=00f067aa0ba902b7" } + +// MarshalJSONStreamTraceState marshals all properties from the current struct to the destination stream. +func MarshalJSONStreamTraceState(ms TraceState, dest *json.Stream) { + dest.WriteString(*ms.orig) +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_value.go b/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_value.go index c0e0497d59..72c3c0bec4 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_value.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_value.go @@ -4,7 +4,10 @@ package internal // import "go.opentelemetry.io/collector/pdata/internal" import ( + "fmt" + otlpcommon "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) type Value struct { @@ -73,3 +76,108 @@ func GenerateTestValue() Value { FillTestValue(ms) return ms } + +// MarshalJSONStreamValue marshals all properties from the current struct to the destination stream. +func MarshalJSONStreamValue(ms Value, dest *json.Stream) { + dest.WriteObjectStart() + switch v := ms.orig.Value.(type) { + case nil: + // Do nothing, return an empty object. + case *otlpcommon.AnyValue_StringValue: + dest.WriteObjectField("stringValue") + dest.WriteString(v.StringValue) + case *otlpcommon.AnyValue_BoolValue: + dest.WriteObjectField("boolValue") + dest.WriteBool(v.BoolValue) + case *otlpcommon.AnyValue_IntValue: + dest.WriteObjectField("intValue") + dest.WriteInt64(v.IntValue) + case *otlpcommon.AnyValue_DoubleValue: + dest.WriteObjectField("doubleValue") + dest.WriteFloat64(v.DoubleValue) + case *otlpcommon.AnyValue_BytesValue: + dest.WriteObjectField("bytesValue") + MarshalJSONStreamByteSlice(NewByteSlice(&v.BytesValue, ms.state), dest) + case *otlpcommon.AnyValue_ArrayValue: + dest.WriteObjectField("arrayValue") + dest.WriteObjectStart() + dest.WriteObjectField("values") + MarshalJSONStreamSlice(NewSlice(&v.ArrayValue.Values, ms.state), dest) + dest.WriteObjectEnd() + case *otlpcommon.AnyValue_KvlistValue: + dest.WriteObjectField("kvlistValue") + dest.WriteObjectStart() + dest.WriteObjectField("values") + MarshalJSONStreamMap(NewMap(&v.KvlistValue.Values, ms.state), dest) + dest.WriteObjectEnd() + default: + dest.ReportError(fmt.Errorf("invalid value type in the passed attribute value: %T", ms.orig.Value)) + } + dest.WriteObjectEnd() +} + +// UnmarshalJSONIterValue Unmarshal JSON data and return otlpcommon.AnyValue +func UnmarshalJSONIterValue(val Value, iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { + switch f { + case "stringValue", "string_value": + val.orig.Value = &otlpcommon.AnyValue_StringValue{ + StringValue: iter.ReadString(), + } + case "boolValue", "bool_value": + val.orig.Value = &otlpcommon.AnyValue_BoolValue{ + BoolValue: iter.ReadBool(), + } + case "intValue", "int_value": + val.orig.Value = &otlpcommon.AnyValue_IntValue{ + IntValue: iter.ReadInt64(), + } + case "doubleValue", "double_value": + val.orig.Value = &otlpcommon.AnyValue_DoubleValue{ + DoubleValue: iter.ReadFloat64(), + } + case "bytesValue", "bytes_value": + val.orig.Value = &otlpcommon.AnyValue_BytesValue{} + UnmarshalJSONIterByteSlice(NewByteSlice(&val.orig.Value.(*otlpcommon.AnyValue_BytesValue).BytesValue, val.state), iter) + case "arrayValue", "array_value": + val.orig.Value = &otlpcommon.AnyValue_ArrayValue{ + ArrayValue: readArray(iter), + } + case "kvlistValue", "kvlist_value": + val.orig.Value = &otlpcommon.AnyValue_KvlistValue{ + KvlistValue: readKvlistValue(iter), + } + default: + iter.Skip() + } + return true + }) +} + +func readArray(iter *json.Iterator) *otlpcommon.ArrayValue { + v := &otlpcommon.ArrayValue{} + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { + switch f { + case "values": + UnmarshalJSONIterSlice(NewSlice(&v.Values, nil), iter) + default: + iter.Skip() + } + return true + }) + return v +} + +func readKvlistValue(iter *json.Iterator) *otlpcommon.KeyValueList { + v := &otlpcommon.KeyValueList{} + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { + switch f { + case "values": + UnmarshalJSONIterMap(NewMap(&v.Values, nil), iter) + default: + iter.Skip() + } + return true + }) + return v +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_byteslice.go b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_byteslice.go index 9423fa0f1a..5dac879c88 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_byteslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_byteslice.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pcommon diff --git a/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_float64slice.go b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_float64slice.go index 957460aa43..7f0d95721a 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_float64slice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_float64slice.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pcommon diff --git a/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_instrumentationscope.go b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_instrumentationscope.go index d6e27851ce..833facca56 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_instrumentationscope.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_instrumentationscope.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pcommon @@ -46,14 +46,6 @@ func (ms InstrumentationScope) MoveTo(dest InstrumentationScope) { *ms.getOrig() = otlpcommon.InstrumentationScope{} } -func (ms InstrumentationScope) getOrig() *otlpcommon.InstrumentationScope { - return internal.GetOrigInstrumentationScope(internal.InstrumentationScope(ms)) -} - -func (ms InstrumentationScope) getState() *internal.State { - return internal.GetInstrumentationScopeState(internal.InstrumentationScope(ms)) -} - // Name returns the name associated with this InstrumentationScope. func (ms InstrumentationScope) Name() string { return ms.getOrig().Name @@ -97,3 +89,11 @@ func (ms InstrumentationScope) CopyTo(dest InstrumentationScope) { dest.getState().AssertMutable() internal.CopyOrigInstrumentationScope(dest.getOrig(), ms.getOrig()) } + +func (ms InstrumentationScope) getOrig() *otlpcommon.InstrumentationScope { + return internal.GetOrigInstrumentationScope(internal.InstrumentationScope(ms)) +} + +func (ms InstrumentationScope) getState() *internal.State { + return internal.GetInstrumentationScopeState(internal.InstrumentationScope(ms)) +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_int32slice.go b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_int32slice.go index 23c07b9e33..cc6e5d62bf 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_int32slice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_int32slice.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pcommon diff --git a/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_int64slice.go b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_int64slice.go index 6364eae37b..5260574338 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_int64slice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_int64slice.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pcommon diff --git a/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_intslice.go b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_intslice.go deleted file mode 100644 index 1a72889d55..0000000000 --- a/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_intslice.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. -// To regenerate this file run "make genpdata". - -package pcommon - -import ( - "go.opentelemetry.io/collector/pdata/internal" -) - -// IntSlice represents a []int slice. -// The instance of IntSlice can be assigned to multiple objects since it's immutable. -// -// Must use NewIntSlice function to create new instances. -// Important: zero-initialized instance is not valid for use. -type IntSlice internal.IntSlice - -func (ms IntSlice) getOrig() *[]int { - return internal.GetOrigIntSlice(internal.IntSlice(ms)) -} - -func (ms IntSlice) getState() *internal.State { - return internal.GetIntSliceState(internal.IntSlice(ms)) -} - -// NewIntSlice creates a new empty IntSlice. -func NewIntSlice() IntSlice { - orig := []int(nil) - state := internal.StateMutable - return IntSlice(internal.NewIntSlice(&orig, &state)) -} - -// AsRaw returns a copy of the []int slice. -func (ms IntSlice) AsRaw() []int { - return copyIntSlice(nil, *ms.getOrig()) -} - -// FromRaw copies raw []int into the slice IntSlice. -func (ms IntSlice) FromRaw(val []int) { - ms.getState().AssertMutable() - *ms.getOrig() = copyIntSlice(*ms.getOrig(), val) -} - -// Len returns length of the []int slice value. -// Equivalent of len(intSlice). -func (ms IntSlice) Len() int { - return len(*ms.getOrig()) -} - -// At returns an item from particular index. -// Equivalent of intSlice[i]. -func (ms IntSlice) At(i int) int { - return (*ms.getOrig())[i] -} - -// SetAt sets int item at particular index. -// Equivalent of intSlice[i] = val -func (ms IntSlice) SetAt(i int, val int) { - ms.getState().AssertMutable() - (*ms.getOrig())[i] = val -} - -// EnsureCapacity ensures IntSlice has at least the specified capacity. -// 1. If the newCap <= cap, then is no change in capacity. -// 2. If the newCap > cap, then the slice capacity will be expanded to the provided value which will be equivalent of: -// buf := make([]int, len(intSlice), newCap) -// copy(buf, intSlice) -// intSlice = buf -func (ms IntSlice) EnsureCapacity(newCap int) { - ms.getState().AssertMutable() - oldCap := cap(*ms.getOrig()) - if newCap <= oldCap { - return - } - - newOrig := make([]int, len(*ms.getOrig()), newCap) - copy(newOrig, *ms.getOrig()) - *ms.getOrig() = newOrig -} - -// Append appends extra elements to IntSlice. -// Equivalent of intSlice = append(intSlice, elms...) -func (ms IntSlice) Append(elms ...int) { - ms.getState().AssertMutable() - *ms.getOrig() = append(*ms.getOrig(), elms...) -} - -// MoveTo moves all elements from the current slice overriding the destination and -// resetting the current instance to its zero value. -func (ms IntSlice) MoveTo(dest IntSlice) { - ms.getState().AssertMutable() - dest.getState().AssertMutable() - *dest.getOrig() = *ms.getOrig() - *ms.getOrig() = nil -} - -// CopyTo copies all elements from the current slice overriding the destination. -func (ms IntSlice) CopyTo(dest IntSlice) { - dest.getState().AssertMutable() - *dest.getOrig() = copyIntSlice(*dest.getOrig(), *ms.getOrig()) -} - -func copyIntSlice(dst, src []int) []int { - dst = dst[:0] - return append(dst, src...) -} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_resource.go b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_resource.go index 4d829e049d..0d3536b78b 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_resource.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_resource.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pcommon @@ -46,14 +46,6 @@ func (ms Resource) MoveTo(dest Resource) { *ms.getOrig() = otlpresource.Resource{} } -func (ms Resource) getOrig() *otlpresource.Resource { - return internal.GetOrigResource(internal.Resource(ms)) -} - -func (ms Resource) getState() *internal.State { - return internal.GetResourceState(internal.Resource(ms)) -} - // Attributes returns the Attributes associated with this Resource. func (ms Resource) Attributes() Map { return Map(internal.NewMap(&ms.getOrig().Attributes, internal.GetResourceState(internal.Resource(ms)))) @@ -75,3 +67,11 @@ func (ms Resource) CopyTo(dest Resource) { dest.getState().AssertMutable() internal.CopyOrigResource(dest.getOrig(), ms.getOrig()) } + +func (ms Resource) getOrig() *otlpresource.Resource { + return internal.GetOrigResource(internal.Resource(ms)) +} + +func (ms Resource) getState() *internal.State { + return internal.GetResourceState(internal.Resource(ms)) +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_stringslice.go b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_stringslice.go index 22c318e7a5..565509caa5 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_stringslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_stringslice.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pcommon diff --git a/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_uint64slice.go b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_uint64slice.go index df58ff360a..a04ddc1e6b 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_uint64slice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_uint64slice.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pcommon diff --git a/vendor/go.opentelemetry.io/collector/pdata/plog/generated_logrecord.go b/vendor/go.opentelemetry.io/collector/pdata/plog/generated_logrecord.go index e9d8fa3daf..f93ca78669 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/plog/generated_logrecord.go +++ b/vendor/go.opentelemetry.io/collector/pdata/plog/generated_logrecord.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package plog @@ -10,6 +10,7 @@ import ( "go.opentelemetry.io/collector/pdata/internal" "go.opentelemetry.io/collector/pdata/internal/data" otlplogs "go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1" + "go.opentelemetry.io/collector/pdata/internal/json" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -166,6 +167,54 @@ func (ms LogRecord) CopyTo(dest LogRecord) { copyOrigLogRecord(dest.orig, ms.orig) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms LogRecord) marshalJSONStream(dest *json.Stream) { + dest.WriteObjectStart() + if ms.orig.ObservedTimeUnixNano != 0 { + dest.WriteObjectField("observedTimeUnixNano") + dest.WriteUint64(ms.orig.ObservedTimeUnixNano) + } + if ms.orig.TimeUnixNano != 0 { + dest.WriteObjectField("timeUnixNano") + dest.WriteUint64(ms.orig.TimeUnixNano) + } + if ms.orig.TraceId != data.TraceID([16]byte{}) { + dest.WriteObjectField("traceId") + ms.orig.TraceId.MarshalJSONStream(dest) + } + if ms.orig.SpanId != data.SpanID([8]byte{}) { + dest.WriteObjectField("spanId") + ms.orig.SpanId.MarshalJSONStream(dest) + } + if ms.orig.Flags != 0 { + dest.WriteObjectField("flags") + dest.WriteUint32(ms.orig.Flags) + } + if ms.orig.EventName != "" { + dest.WriteObjectField("eventName") + dest.WriteString(ms.orig.EventName) + } + if ms.orig.SeverityText != "" { + dest.WriteObjectField("severityText") + dest.WriteString(ms.orig.SeverityText) + } + if ms.orig.SeverityNumber != otlplogs.SeverityNumber(0) { + dest.WriteObjectField("severityNumber") + ms.SeverityNumber().marshalJSONStream(dest) + } + dest.WriteObjectField("body") + internal.MarshalJSONStreamValue(internal.NewValue(&ms.orig.Body, ms.state), dest) + if len(ms.orig.Attributes) > 0 { + dest.WriteObjectField("attributes") + internal.MarshalJSONStreamMap(internal.NewMap(&ms.orig.Attributes, ms.state), dest) + } + if ms.orig.DroppedAttributesCount != uint32(0) { + dest.WriteObjectField("droppedAttributesCount") + dest.WriteUint32(ms.orig.DroppedAttributesCount) + } + dest.WriteObjectEnd() +} + func copyOrigLogRecord(dest, src *otlplogs.LogRecord) { dest.ObservedTimeUnixNano = src.ObservedTimeUnixNano dest.TimeUnixNano = src.TimeUnixNano diff --git a/vendor/go.opentelemetry.io/collector/pdata/plog/generated_logrecordslice.go b/vendor/go.opentelemetry.io/collector/pdata/plog/generated_logrecordslice.go index bdd40031b3..63e04e1416 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/plog/generated_logrecordslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/plog/generated_logrecordslice.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package plog @@ -12,6 +12,7 @@ import ( "go.opentelemetry.io/collector/pdata/internal" otlplogs "go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // LogRecordSlice logically represents a slice of LogRecord. @@ -156,6 +157,28 @@ func (es LogRecordSlice) Sort(less func(a, b LogRecord) bool) { sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms LogRecordSlice) marshalJSONStream(dest *json.Stream) { + dest.WriteArrayStart() + if len(*ms.orig) > 0 { + ms.At(0).marshalJSONStream(dest) + } + for i := 1; i < len(*ms.orig); i++ { + dest.WriteMore() + ms.At(i).marshalJSONStream(dest) + } + dest.WriteArrayEnd() +} + +// unmarshalJSONIter unmarshals all properties from the current struct from the source iterator. +func (ms LogRecordSlice) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadArrayCB(func(iter *json.Iterator) bool { + *ms.orig = append(*ms.orig, &otlplogs.LogRecord{}) + ms.At(ms.Len() - 1).unmarshalJSONIter(iter) + return true + }) +} + func copyOrigLogRecordSlice(dest, src []*otlplogs.LogRecord) []*otlplogs.LogRecord { if cap(dest) < len(src) { dest = make([]*otlplogs.LogRecord, len(src)) diff --git a/vendor/go.opentelemetry.io/collector/pdata/plog/generated_resourcelogs.go b/vendor/go.opentelemetry.io/collector/pdata/plog/generated_resourcelogs.go index bf2c916329..290380b570 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/plog/generated_resourcelogs.go +++ b/vendor/go.opentelemetry.io/collector/pdata/plog/generated_resourcelogs.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package plog @@ -9,6 +9,7 @@ package plog import ( "go.opentelemetry.io/collector/pdata/internal" otlplogs "go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1" + "go.opentelemetry.io/collector/pdata/internal/json" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -77,6 +78,22 @@ func (ms ResourceLogs) CopyTo(dest ResourceLogs) { copyOrigResourceLogs(dest.orig, ms.orig) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms ResourceLogs) marshalJSONStream(dest *json.Stream) { + dest.WriteObjectStart() + dest.WriteObjectField("resource") + internal.MarshalJSONStreamResource(internal.NewResource(&ms.orig.Resource, ms.state), dest) + if ms.orig.SchemaUrl != "" { + dest.WriteObjectField("schemaUrl") + dest.WriteString(ms.orig.SchemaUrl) + } + if len(ms.orig.ScopeLogs) > 0 { + dest.WriteObjectField("scopeLogs") + ms.ScopeLogs().marshalJSONStream(dest) + } + dest.WriteObjectEnd() +} + func copyOrigResourceLogs(dest, src *otlplogs.ResourceLogs) { internal.CopyOrigResource(&dest.Resource, &src.Resource) dest.SchemaUrl = src.SchemaUrl diff --git a/vendor/go.opentelemetry.io/collector/pdata/plog/generated_resourcelogsslice.go b/vendor/go.opentelemetry.io/collector/pdata/plog/generated_resourcelogsslice.go index b016f7cdf8..2c40c893da 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/plog/generated_resourcelogsslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/plog/generated_resourcelogsslice.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package plog @@ -12,6 +12,7 @@ import ( "go.opentelemetry.io/collector/pdata/internal" otlplogs "go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // ResourceLogsSlice logically represents a slice of ResourceLogs. @@ -156,6 +157,28 @@ func (es ResourceLogsSlice) Sort(less func(a, b ResourceLogs) bool) { sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms ResourceLogsSlice) marshalJSONStream(dest *json.Stream) { + dest.WriteArrayStart() + if len(*ms.orig) > 0 { + ms.At(0).marshalJSONStream(dest) + } + for i := 1; i < len(*ms.orig); i++ { + dest.WriteMore() + ms.At(i).marshalJSONStream(dest) + } + dest.WriteArrayEnd() +} + +// unmarshalJSONIter unmarshals all properties from the current struct from the source iterator. +func (ms ResourceLogsSlice) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadArrayCB(func(iter *json.Iterator) bool { + *ms.orig = append(*ms.orig, &otlplogs.ResourceLogs{}) + ms.At(ms.Len() - 1).unmarshalJSONIter(iter) + return true + }) +} + func copyOrigResourceLogsSlice(dest, src []*otlplogs.ResourceLogs) []*otlplogs.ResourceLogs { if cap(dest) < len(src) { dest = make([]*otlplogs.ResourceLogs, len(src)) diff --git a/vendor/go.opentelemetry.io/collector/pdata/plog/generated_scopelogs.go b/vendor/go.opentelemetry.io/collector/pdata/plog/generated_scopelogs.go index 857cc92186..b4dcee0527 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/plog/generated_scopelogs.go +++ b/vendor/go.opentelemetry.io/collector/pdata/plog/generated_scopelogs.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package plog @@ -9,6 +9,7 @@ package plog import ( "go.opentelemetry.io/collector/pdata/internal" otlplogs "go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1" + "go.opentelemetry.io/collector/pdata/internal/json" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -77,6 +78,22 @@ func (ms ScopeLogs) CopyTo(dest ScopeLogs) { copyOrigScopeLogs(dest.orig, ms.orig) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms ScopeLogs) marshalJSONStream(dest *json.Stream) { + dest.WriteObjectStart() + dest.WriteObjectField("scope") + internal.MarshalJSONStreamInstrumentationScope(internal.NewInstrumentationScope(&ms.orig.Scope, ms.state), dest) + if ms.orig.SchemaUrl != "" { + dest.WriteObjectField("schemaUrl") + dest.WriteString(ms.orig.SchemaUrl) + } + if len(ms.orig.LogRecords) > 0 { + dest.WriteObjectField("logRecords") + ms.LogRecords().marshalJSONStream(dest) + } + dest.WriteObjectEnd() +} + func copyOrigScopeLogs(dest, src *otlplogs.ScopeLogs) { internal.CopyOrigInstrumentationScope(&dest.Scope, &src.Scope) dest.SchemaUrl = src.SchemaUrl diff --git a/vendor/go.opentelemetry.io/collector/pdata/plog/generated_scopelogsslice.go b/vendor/go.opentelemetry.io/collector/pdata/plog/generated_scopelogsslice.go index 1eff72908b..0981027796 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/plog/generated_scopelogsslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/plog/generated_scopelogsslice.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package plog @@ -12,6 +12,7 @@ import ( "go.opentelemetry.io/collector/pdata/internal" otlplogs "go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // ScopeLogsSlice logically represents a slice of ScopeLogs. @@ -156,6 +157,28 @@ func (es ScopeLogsSlice) Sort(less func(a, b ScopeLogs) bool) { sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms ScopeLogsSlice) marshalJSONStream(dest *json.Stream) { + dest.WriteArrayStart() + if len(*ms.orig) > 0 { + ms.At(0).marshalJSONStream(dest) + } + for i := 1; i < len(*ms.orig); i++ { + dest.WriteMore() + ms.At(i).marshalJSONStream(dest) + } + dest.WriteArrayEnd() +} + +// unmarshalJSONIter unmarshals all properties from the current struct from the source iterator. +func (ms ScopeLogsSlice) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadArrayCB(func(iter *json.Iterator) bool { + *ms.orig = append(*ms.orig, &otlplogs.ScopeLogs{}) + ms.At(ms.Len() - 1).unmarshalJSONIter(iter) + return true + }) +} + func copyOrigScopeLogsSlice(dest, src []*otlplogs.ScopeLogs) []*otlplogs.ScopeLogs { if cap(dest) < len(src) { dest = make([]*otlplogs.ScopeLogs, len(src)) diff --git a/vendor/go.opentelemetry.io/collector/pdata/plog/json.go b/vendor/go.opentelemetry.io/collector/pdata/plog/json.go index 5e1cdd70d5..e7ac2b8f5f 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/plog/json.go +++ b/vendor/go.opentelemetry.io/collector/pdata/plog/json.go @@ -4,10 +4,7 @@ package plog // import "go.opentelemetry.io/collector/pdata/plog" import ( - "bytes" - "fmt" - - jsoniter "github.com/json-iterator/go" + "slices" "go.opentelemetry.io/collector/pdata/internal" otlplogs "go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1" @@ -20,10 +17,10 @@ type JSONMarshaler struct{} // MarshalLogs to the OTLP/JSON format. func (*JSONMarshaler) MarshalLogs(ld Logs) ([]byte, error) { - buf := bytes.Buffer{} - pb := internal.LogsToProto(internal.Logs(ld)) - err := json.Marshal(&buf, &pb) - return buf.Bytes(), err + dest := json.BorrowStream(nil) + defer json.ReturnStream(dest) + ld.marshalJSONStream(dest) + return slices.Clone(dest.Buffer()), dest.Error() } var _ Unmarshaler = (*JSONUnmarshaler)(nil) @@ -33,42 +30,24 @@ type JSONUnmarshaler struct{} // UnmarshalLogs from OTLP/JSON format into pdata.Logs. func (*JSONUnmarshaler) UnmarshalLogs(buf []byte) (Logs, error) { - iter := jsoniter.ConfigFastest.BorrowIterator(buf) - defer jsoniter.ConfigFastest.ReturnIterator(iter) + iter := json.BorrowIterator(buf) + defer json.ReturnIterator(iter) ld := NewLogs() - ld.unmarshalJsoniter(iter) - if iter.Error != nil { - return Logs{}, iter.Error + ld.unmarshalJSONIter(iter) + if iter.Error() != nil { + return Logs{}, iter.Error() } otlp.MigrateLogs(ld.getOrig().ResourceLogs) return ld, nil } -func (ms Logs) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { - switch f { - case "resource_logs", "resourceLogs": - iter.ReadArrayCB(func(*jsoniter.Iterator) bool { - ms.ResourceLogs().AppendEmpty().unmarshalJsoniter(iter) - return true - }) - default: - iter.Skip() - } - return true - }) -} - -func (ms ResourceLogs) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { +func (ms ResourceLogs) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { switch f { case "resource": - json.ReadResource(iter, &ms.orig.Resource) + internal.UnmarshalJSONIterResource(internal.NewResource(&ms.orig.Resource, ms.state), iter) case "scope_logs", "scopeLogs": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - ms.ScopeLogs().AppendEmpty().unmarshalJsoniter(iter) - return true - }) + ms.ScopeLogs().unmarshalJSONIter(iter) case "schemaUrl", "schema_url": ms.orig.SchemaUrl = iter.ReadString() default: @@ -78,16 +57,13 @@ func (ms ResourceLogs) unmarshalJsoniter(iter *jsoniter.Iterator) { }) } -func (ms ScopeLogs) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { +func (ms ScopeLogs) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { switch f { case "scope": - json.ReadScope(iter, &ms.orig.Scope) + internal.UnmarshalJSONIterInstrumentationScope(internal.NewInstrumentationScope(&ms.orig.Scope, ms.state), iter) case "log_records", "logRecords": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - ms.LogRecords().AppendEmpty().unmarshalJsoniter(iter) - return true - }) + ms.LogRecords().unmarshalJSONIter(iter) case "schemaUrl", "schema_url": ms.orig.SchemaUrl = iter.ReadString() default: @@ -97,38 +73,31 @@ func (ms ScopeLogs) unmarshalJsoniter(iter *jsoniter.Iterator) { }) } -func (ms LogRecord) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { +func (ms LogRecord) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { switch f { case "timeUnixNano", "time_unix_nano": - ms.orig.TimeUnixNano = json.ReadUint64(iter) + ms.orig.TimeUnixNano = iter.ReadUint64() case "observed_time_unix_nano", "observedTimeUnixNano": - ms.orig.ObservedTimeUnixNano = json.ReadUint64(iter) + ms.orig.ObservedTimeUnixNano = iter.ReadUint64() case "severity_number", "severityNumber": - ms.orig.SeverityNumber = otlplogs.SeverityNumber(json.ReadEnumValue(iter, otlplogs.SeverityNumber_value)) + ms.orig.SeverityNumber = otlplogs.SeverityNumber(iter.ReadEnumValue(otlplogs.SeverityNumber_value)) case "severity_text", "severityText": ms.orig.SeverityText = iter.ReadString() case "event_name", "eventName": ms.orig.EventName = iter.ReadString() case "body": - json.ReadValue(iter, &ms.orig.Body) + internal.UnmarshalJSONIterValue(internal.NewValue(&ms.orig.Body, ms.state), iter) case "attributes": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - ms.orig.Attributes = append(ms.orig.Attributes, json.ReadAttribute(iter)) - return true - }) + internal.UnmarshalJSONIterMap(internal.NewMap(&ms.orig.Attributes, ms.state), iter) case "droppedAttributesCount", "dropped_attributes_count": - ms.orig.DroppedAttributesCount = json.ReadUint32(iter) + ms.orig.DroppedAttributesCount = iter.ReadUint32() case "flags": - ms.orig.Flags = json.ReadUint32(iter) + ms.orig.Flags = iter.ReadUint32() case "traceId", "trace_id": - if err := ms.orig.TraceId.UnmarshalJSON([]byte(iter.ReadString())); err != nil { - iter.ReportError("readLog.traceId", fmt.Sprintf("parse trace_id:%v", err)) - } + ms.orig.TraceId.UnmarshalJSONIter(iter) case "spanId", "span_id": - if err := ms.orig.SpanId.UnmarshalJSON([]byte(iter.ReadString())); err != nil { - iter.ReportError("readLog.spanId", fmt.Sprintf("parse span_id:%v", err)) - } + ms.orig.SpanId.UnmarshalJSONIter(iter) default: iter.Skip() } diff --git a/vendor/go.opentelemetry.io/collector/pdata/plog/logs.go b/vendor/go.opentelemetry.io/collector/pdata/plog/logs.go index 490526090f..cb8c38c9b0 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/plog/logs.go +++ b/vendor/go.opentelemetry.io/collector/pdata/plog/logs.go @@ -6,6 +6,7 @@ package plog // import "go.opentelemetry.io/collector/pdata/plog" import ( "go.opentelemetry.io/collector/pdata/internal" otlpcollectorlog "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/logs/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // Logs is the top-level struct that is propagated through the logs pipeline. @@ -64,3 +65,22 @@ func (ms Logs) ResourceLogs() ResourceLogsSlice { func (ms Logs) MarkReadOnly() { internal.SetLogsState(internal.Logs(ms), internal.StateReadOnly) } + +func (ms Logs) marshalJSONStream(dest *json.Stream) { + dest.WriteObjectStart() + dest.WriteObjectField("resourceLogs") + ms.ResourceLogs().marshalJSONStream(dest) + dest.WriteObjectEnd() +} + +func (ms Logs) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { + switch f { + case "resource_logs", "resourceLogs": + ms.ResourceLogs().unmarshalJSONIter(iter) + default: + iter.Skip() + } + return true + }) +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/plog/severity_number.go b/vendor/go.opentelemetry.io/collector/pdata/plog/severity_number.go index 53a9d4179c..d460ed2511 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/plog/severity_number.go +++ b/vendor/go.opentelemetry.io/collector/pdata/plog/severity_number.go @@ -5,6 +5,7 @@ package plog // import "go.opentelemetry.io/collector/pdata/plog" import ( otlplogs "go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // SeverityNumber represents severity number of a log record. @@ -94,3 +95,8 @@ func (sn SeverityNumber) String() string { } return "" } + +// MarshalJSONStream converts trace id into a hex string enclosed in quotes. +func (sn SeverityNumber) marshalJSONStream(dest *json.Stream) { + dest.WriteInt32(int32(sn)) +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/aggregation_temporality.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/aggregation_temporality.go index 0ba2b28c29..5028136f4f 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/aggregation_temporality.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/aggregation_temporality.go @@ -5,6 +5,7 @@ package pmetric // import "go.opentelemetry.io/collector/pdata/pmetric" import ( otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // AggregationTemporality defines how a metric aggregator reports aggregated values. @@ -32,3 +33,8 @@ func (at AggregationTemporality) String() string { } return "" } + +// MarshalJSONStream converts trace id into a hex string enclosed in quotes. +func (at AggregationTemporality) marshalJSONStream(dest *json.Stream) { + dest.WriteInt32(int32(at)) +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_exemplar.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_exemplar.go index f8f6168b20..943d583b26 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_exemplar.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_exemplar.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pmetric @@ -10,6 +10,7 @@ import ( "go.opentelemetry.io/collector/pdata/internal" "go.opentelemetry.io/collector/pdata/internal/data" otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/json" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -136,6 +137,36 @@ func (ms Exemplar) CopyTo(dest Exemplar) { copyOrigExemplar(dest.orig, ms.orig) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms Exemplar) marshalJSONStream(dest *json.Stream) { + dest.WriteObjectStart() + if ms.orig.TimeUnixNano != 0 { + dest.WriteObjectField("timeUnixNano") + dest.WriteUint64(ms.orig.TimeUnixNano) + } + switch ov := ms.orig.Value.(type) { + case *otlpmetrics.Exemplar_AsDouble: + dest.WriteObjectField("asDouble") + dest.WriteFloat64(ov.AsDouble) + case *otlpmetrics.Exemplar_AsInt: + dest.WriteObjectField("asInt") + dest.WriteInt64(ov.AsInt) + } + if len(ms.orig.FilteredAttributes) > 0 { + dest.WriteObjectField("filteredAttributes") + internal.MarshalJSONStreamMap(internal.NewMap(&ms.orig.FilteredAttributes, ms.state), dest) + } + if ms.orig.TraceId != data.TraceID([16]byte{}) { + dest.WriteObjectField("traceId") + ms.orig.TraceId.MarshalJSONStream(dest) + } + if ms.orig.SpanId != data.SpanID([8]byte{}) { + dest.WriteObjectField("spanId") + ms.orig.SpanId.MarshalJSONStream(dest) + } + dest.WriteObjectEnd() +} + func copyOrigExemplar(dest, src *otlpmetrics.Exemplar) { dest.TimeUnixNano = src.TimeUnixNano switch t := src.Value.(type) { diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_exemplarslice.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_exemplarslice.go index 49dd8db254..2c398fdab4 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_exemplarslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_exemplarslice.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pmetric @@ -11,6 +11,7 @@ import ( "go.opentelemetry.io/collector/pdata/internal" otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // ExemplarSlice logically represents a slice of Exemplar. @@ -147,6 +148,28 @@ func (es ExemplarSlice) CopyTo(dest ExemplarSlice) { *dest.orig = copyOrigExemplarSlice(*dest.orig, *es.orig) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms ExemplarSlice) marshalJSONStream(dest *json.Stream) { + dest.WriteArrayStart() + if len(*ms.orig) > 0 { + ms.At(0).marshalJSONStream(dest) + } + for i := 1; i < len(*ms.orig); i++ { + dest.WriteMore() + ms.At(i).marshalJSONStream(dest) + } + dest.WriteArrayEnd() +} + +// unmarshalJSONIter unmarshals all properties from the current struct from the source iterator. +func (ms ExemplarSlice) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadArrayCB(func(iter *json.Iterator) bool { + *ms.orig = append(*ms.orig, otlpmetrics.Exemplar{}) + ms.At(ms.Len() - 1).unmarshalJSONIter(iter) + return true + }) +} + func copyOrigExemplarSlice(dest, src []otlpmetrics.Exemplar) []otlpmetrics.Exemplar { if cap(dest) < len(src) { dest = make([]otlpmetrics.Exemplar, len(src)) diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_exponentialhistogram.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_exponentialhistogram.go index ceddeacc35..227519bf00 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_exponentialhistogram.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_exponentialhistogram.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pmetric @@ -9,6 +9,7 @@ package pmetric import ( "go.opentelemetry.io/collector/pdata/internal" otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // ExponentialHistogram represents the type of a metric that is calculated by aggregating @@ -72,6 +73,20 @@ func (ms ExponentialHistogram) CopyTo(dest ExponentialHistogram) { copyOrigExponentialHistogram(dest.orig, ms.orig) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms ExponentialHistogram) marshalJSONStream(dest *json.Stream) { + dest.WriteObjectStart() + if ms.orig.AggregationTemporality != otlpmetrics.AggregationTemporality(0) { + dest.WriteObjectField("aggregationTemporality") + ms.AggregationTemporality().marshalJSONStream(dest) + } + if len(ms.orig.DataPoints) > 0 { + dest.WriteObjectField("dataPoints") + ms.DataPoints().marshalJSONStream(dest) + } + dest.WriteObjectEnd() +} + func copyOrigExponentialHistogram(dest, src *otlpmetrics.ExponentialHistogram) { dest.AggregationTemporality = src.AggregationTemporality dest.DataPoints = copyOrigExponentialHistogramDataPointSlice(dest.DataPoints, src.DataPoints) diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_exponentialhistogramdatapoint.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_exponentialhistogramdatapoint.go index 37c94cd6b8..6929795208 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_exponentialhistogramdatapoint.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_exponentialhistogramdatapoint.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pmetric @@ -9,6 +9,7 @@ package pmetric import ( "go.opentelemetry.io/collector/pdata/internal" otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/json" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -225,6 +226,64 @@ func (ms ExponentialHistogramDataPoint) CopyTo(dest ExponentialHistogramDataPoin copyOrigExponentialHistogramDataPoint(dest.orig, ms.orig) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms ExponentialHistogramDataPoint) marshalJSONStream(dest *json.Stream) { + dest.WriteObjectStart() + if len(ms.orig.Attributes) > 0 { + dest.WriteObjectField("attributes") + internal.MarshalJSONStreamMap(internal.NewMap(&ms.orig.Attributes, ms.state), dest) + } + if ms.orig.StartTimeUnixNano != 0 { + dest.WriteObjectField("startTimeUnixNano") + dest.WriteUint64(ms.orig.StartTimeUnixNano) + } + if ms.orig.TimeUnixNano != 0 { + dest.WriteObjectField("timeUnixNano") + dest.WriteUint64(ms.orig.TimeUnixNano) + } + if ms.orig.Count != uint64(0) { + dest.WriteObjectField("count") + dest.WriteUint64(ms.orig.Count) + } + if ms.orig.Scale != int32(0) { + dest.WriteObjectField("scale") + dest.WriteInt32(ms.orig.Scale) + } + if ms.orig.ZeroCount != uint64(0) { + dest.WriteObjectField("zeroCount") + dest.WriteUint64(ms.orig.ZeroCount) + } + dest.WriteObjectField("positive") + ms.Positive().marshalJSONStream(dest) + dest.WriteObjectField("negative") + ms.Negative().marshalJSONStream(dest) + if len(ms.orig.Exemplars) > 0 { + dest.WriteObjectField("exemplars") + ms.Exemplars().marshalJSONStream(dest) + } + if ms.orig.Flags != 0 { + dest.WriteObjectField("flags") + dest.WriteUint32(ms.orig.Flags) + } + if ms.HasSum() { + dest.WriteObjectField("sum") + dest.WriteFloat64(ms.Sum()) + } + if ms.HasMin() { + dest.WriteObjectField("min") + dest.WriteFloat64(ms.Min()) + } + if ms.HasMax() { + dest.WriteObjectField("max") + dest.WriteFloat64(ms.Max()) + } + if ms.orig.ZeroThreshold != float64(0.0) { + dest.WriteObjectField("zeroThreshold") + dest.WriteFloat64(ms.orig.ZeroThreshold) + } + dest.WriteObjectEnd() +} + func copyOrigExponentialHistogramDataPoint(dest, src *otlpmetrics.ExponentialHistogramDataPoint) { dest.Attributes = internal.CopyOrigMap(dest.Attributes, src.Attributes) dest.StartTimeUnixNano = src.StartTimeUnixNano diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_exponentialhistogramdatapointbuckets.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_exponentialhistogramdatapointbuckets.go index b4d0666ae5..eb65664cf6 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_exponentialhistogramdatapointbuckets.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_exponentialhistogramdatapointbuckets.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pmetric @@ -9,6 +9,7 @@ package pmetric import ( "go.opentelemetry.io/collector/pdata/internal" otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/json" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -72,6 +73,18 @@ func (ms ExponentialHistogramDataPointBuckets) CopyTo(dest ExponentialHistogramD copyOrigExponentialHistogramDataPointBuckets(dest.orig, ms.orig) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms ExponentialHistogramDataPointBuckets) marshalJSONStream(dest *json.Stream) { + dest.WriteObjectStart() + if ms.orig.Offset != int32(0) { + dest.WriteObjectField("offset") + dest.WriteInt32(ms.orig.Offset) + } + dest.WriteObjectField("bucketCounts") + internal.MarshalJSONStreamUInt64Slice(internal.NewUInt64Slice(&ms.orig.BucketCounts, ms.state), dest) + dest.WriteObjectEnd() +} + func copyOrigExponentialHistogramDataPointBuckets(dest, src *otlpmetrics.ExponentialHistogramDataPoint_Buckets) { dest.Offset = src.Offset dest.BucketCounts = internal.CopyOrigUInt64Slice(dest.BucketCounts, src.BucketCounts) diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_exponentialhistogramdatapointslice.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_exponentialhistogramdatapointslice.go index 41c194d772..b7859d4281 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_exponentialhistogramdatapointslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_exponentialhistogramdatapointslice.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pmetric @@ -12,6 +12,7 @@ import ( "go.opentelemetry.io/collector/pdata/internal" otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // ExponentialHistogramDataPointSlice logically represents a slice of ExponentialHistogramDataPoint. @@ -156,6 +157,28 @@ func (es ExponentialHistogramDataPointSlice) Sort(less func(a, b ExponentialHist sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms ExponentialHistogramDataPointSlice) marshalJSONStream(dest *json.Stream) { + dest.WriteArrayStart() + if len(*ms.orig) > 0 { + ms.At(0).marshalJSONStream(dest) + } + for i := 1; i < len(*ms.orig); i++ { + dest.WriteMore() + ms.At(i).marshalJSONStream(dest) + } + dest.WriteArrayEnd() +} + +// unmarshalJSONIter unmarshals all properties from the current struct from the source iterator. +func (ms ExponentialHistogramDataPointSlice) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadArrayCB(func(iter *json.Iterator) bool { + *ms.orig = append(*ms.orig, &otlpmetrics.ExponentialHistogramDataPoint{}) + ms.At(ms.Len() - 1).unmarshalJSONIter(iter) + return true + }) +} + func copyOrigExponentialHistogramDataPointSlice(dest, src []*otlpmetrics.ExponentialHistogramDataPoint) []*otlpmetrics.ExponentialHistogramDataPoint { if cap(dest) < len(src) { dest = make([]*otlpmetrics.ExponentialHistogramDataPoint, len(src)) diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_gauge.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_gauge.go index 46ca09fd1b..433cb5d838 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_gauge.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_gauge.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pmetric @@ -9,6 +9,7 @@ package pmetric import ( "go.opentelemetry.io/collector/pdata/internal" otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // Gauge represents the type of a numeric metric that always exports the "current value" for every data point. @@ -60,6 +61,16 @@ func (ms Gauge) CopyTo(dest Gauge) { copyOrigGauge(dest.orig, ms.orig) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms Gauge) marshalJSONStream(dest *json.Stream) { + dest.WriteObjectStart() + if len(ms.orig.DataPoints) > 0 { + dest.WriteObjectField("dataPoints") + ms.DataPoints().marshalJSONStream(dest) + } + dest.WriteObjectEnd() +} + func copyOrigGauge(dest, src *otlpmetrics.Gauge) { dest.DataPoints = copyOrigNumberDataPointSlice(dest.DataPoints, src.DataPoints) } diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_histogram.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_histogram.go index 8926bf6983..67b20c7f74 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_histogram.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_histogram.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pmetric @@ -9,6 +9,7 @@ package pmetric import ( "go.opentelemetry.io/collector/pdata/internal" otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // Histogram represents the type of a metric that is calculated by aggregating as a Histogram of all reported measurements over a time interval. @@ -71,6 +72,20 @@ func (ms Histogram) CopyTo(dest Histogram) { copyOrigHistogram(dest.orig, ms.orig) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms Histogram) marshalJSONStream(dest *json.Stream) { + dest.WriteObjectStart() + if ms.orig.AggregationTemporality != otlpmetrics.AggregationTemporality(0) { + dest.WriteObjectField("aggregationTemporality") + ms.AggregationTemporality().marshalJSONStream(dest) + } + if len(ms.orig.DataPoints) > 0 { + dest.WriteObjectField("dataPoints") + ms.DataPoints().marshalJSONStream(dest) + } + dest.WriteObjectEnd() +} + func copyOrigHistogram(dest, src *otlpmetrics.Histogram) { dest.AggregationTemporality = src.AggregationTemporality dest.DataPoints = copyOrigHistogramDataPointSlice(dest.DataPoints, src.DataPoints) diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_histogramdatapoint.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_histogramdatapoint.go index ab6725139c..e6d52cc0fa 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_histogramdatapoint.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_histogramdatapoint.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pmetric @@ -9,6 +9,7 @@ package pmetric import ( "go.opentelemetry.io/collector/pdata/internal" otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/json" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -189,6 +190,52 @@ func (ms HistogramDataPoint) CopyTo(dest HistogramDataPoint) { copyOrigHistogramDataPoint(dest.orig, ms.orig) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms HistogramDataPoint) marshalJSONStream(dest *json.Stream) { + dest.WriteObjectStart() + if len(ms.orig.Attributes) > 0 { + dest.WriteObjectField("attributes") + internal.MarshalJSONStreamMap(internal.NewMap(&ms.orig.Attributes, ms.state), dest) + } + if ms.orig.StartTimeUnixNano != 0 { + dest.WriteObjectField("startTimeUnixNano") + dest.WriteUint64(ms.orig.StartTimeUnixNano) + } + if ms.orig.TimeUnixNano != 0 { + dest.WriteObjectField("timeUnixNano") + dest.WriteUint64(ms.orig.TimeUnixNano) + } + if ms.orig.Count != uint64(0) { + dest.WriteObjectField("count") + dest.WriteUint64(ms.orig.Count) + } + dest.WriteObjectField("bucketCounts") + internal.MarshalJSONStreamUInt64Slice(internal.NewUInt64Slice(&ms.orig.BucketCounts, ms.state), dest) + dest.WriteObjectField("explicitBounds") + internal.MarshalJSONStreamFloat64Slice(internal.NewFloat64Slice(&ms.orig.ExplicitBounds, ms.state), dest) + if len(ms.orig.Exemplars) > 0 { + dest.WriteObjectField("exemplars") + ms.Exemplars().marshalJSONStream(dest) + } + if ms.orig.Flags != 0 { + dest.WriteObjectField("flags") + dest.WriteUint32(ms.orig.Flags) + } + if ms.HasSum() { + dest.WriteObjectField("sum") + dest.WriteFloat64(ms.Sum()) + } + if ms.HasMin() { + dest.WriteObjectField("min") + dest.WriteFloat64(ms.Min()) + } + if ms.HasMax() { + dest.WriteObjectField("max") + dest.WriteFloat64(ms.Max()) + } + dest.WriteObjectEnd() +} + func copyOrigHistogramDataPoint(dest, src *otlpmetrics.HistogramDataPoint) { dest.Attributes = internal.CopyOrigMap(dest.Attributes, src.Attributes) dest.StartTimeUnixNano = src.StartTimeUnixNano diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_histogramdatapointslice.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_histogramdatapointslice.go index 0268cc4a35..85112ded60 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_histogramdatapointslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_histogramdatapointslice.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pmetric @@ -12,6 +12,7 @@ import ( "go.opentelemetry.io/collector/pdata/internal" otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // HistogramDataPointSlice logically represents a slice of HistogramDataPoint. @@ -156,6 +157,28 @@ func (es HistogramDataPointSlice) Sort(less func(a, b HistogramDataPoint) bool) sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms HistogramDataPointSlice) marshalJSONStream(dest *json.Stream) { + dest.WriteArrayStart() + if len(*ms.orig) > 0 { + ms.At(0).marshalJSONStream(dest) + } + for i := 1; i < len(*ms.orig); i++ { + dest.WriteMore() + ms.At(i).marshalJSONStream(dest) + } + dest.WriteArrayEnd() +} + +// unmarshalJSONIter unmarshals all properties from the current struct from the source iterator. +func (ms HistogramDataPointSlice) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadArrayCB(func(iter *json.Iterator) bool { + *ms.orig = append(*ms.orig, &otlpmetrics.HistogramDataPoint{}) + ms.At(ms.Len() - 1).unmarshalJSONIter(iter) + return true + }) +} + func copyOrigHistogramDataPointSlice(dest, src []*otlpmetrics.HistogramDataPoint) []*otlpmetrics.HistogramDataPoint { if cap(dest) < len(src) { dest = make([]*otlpmetrics.HistogramDataPoint, len(src)) diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_metric.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_metric.go index 70b282a46d..6002a76b9f 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_metric.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_metric.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pmetric @@ -9,6 +9,7 @@ package pmetric import ( "go.opentelemetry.io/collector/pdata/internal" otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/json" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -243,6 +244,45 @@ func (ms Metric) CopyTo(dest Metric) { copyOrigMetric(dest.orig, ms.orig) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms Metric) marshalJSONStream(dest *json.Stream) { + dest.WriteObjectStart() + if ms.orig.Name != "" { + dest.WriteObjectField("name") + dest.WriteString(ms.orig.Name) + } + if ms.orig.Description != "" { + dest.WriteObjectField("description") + dest.WriteString(ms.orig.Description) + } + if ms.orig.Unit != "" { + dest.WriteObjectField("unit") + dest.WriteString(ms.orig.Unit) + } + if len(ms.orig.Metadata) > 0 { + dest.WriteObjectField("metadata") + internal.MarshalJSONStreamMap(internal.NewMap(&ms.orig.Metadata, ms.state), dest) + } + switch ov := ms.orig.Data.(type) { + case *otlpmetrics.Metric_Gauge: + dest.WriteObjectField("gauge") + newGauge(ov.Gauge, ms.state).marshalJSONStream(dest) + case *otlpmetrics.Metric_Sum: + dest.WriteObjectField("sum") + newSum(ov.Sum, ms.state).marshalJSONStream(dest) + case *otlpmetrics.Metric_Histogram: + dest.WriteObjectField("histogram") + newHistogram(ov.Histogram, ms.state).marshalJSONStream(dest) + case *otlpmetrics.Metric_ExponentialHistogram: + dest.WriteObjectField("exponentialHistogram") + newExponentialHistogram(ov.ExponentialHistogram, ms.state).marshalJSONStream(dest) + case *otlpmetrics.Metric_Summary: + dest.WriteObjectField("summary") + newSummary(ov.Summary, ms.state).marshalJSONStream(dest) + } + dest.WriteObjectEnd() +} + func copyOrigMetric(dest, src *otlpmetrics.Metric) { dest.Name = src.Name dest.Description = src.Description diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_metricslice.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_metricslice.go index f57ae00170..fcd213a5dc 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_metricslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_metricslice.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pmetric @@ -12,6 +12,7 @@ import ( "go.opentelemetry.io/collector/pdata/internal" otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // MetricSlice logically represents a slice of Metric. @@ -156,6 +157,28 @@ func (es MetricSlice) Sort(less func(a, b Metric) bool) { sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms MetricSlice) marshalJSONStream(dest *json.Stream) { + dest.WriteArrayStart() + if len(*ms.orig) > 0 { + ms.At(0).marshalJSONStream(dest) + } + for i := 1; i < len(*ms.orig); i++ { + dest.WriteMore() + ms.At(i).marshalJSONStream(dest) + } + dest.WriteArrayEnd() +} + +// unmarshalJSONIter unmarshals all properties from the current struct from the source iterator. +func (ms MetricSlice) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadArrayCB(func(iter *json.Iterator) bool { + *ms.orig = append(*ms.orig, &otlpmetrics.Metric{}) + ms.At(ms.Len() - 1).unmarshalJSONIter(iter) + return true + }) +} + func copyOrigMetricSlice(dest, src []*otlpmetrics.Metric) []*otlpmetrics.Metric { if cap(dest) < len(src) { dest = make([]*otlpmetrics.Metric, len(src)) diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_numberdatapoint.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_numberdatapoint.go index d1dbc66c45..1e1c12f748 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_numberdatapoint.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_numberdatapoint.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pmetric @@ -9,6 +9,7 @@ package pmetric import ( "go.opentelemetry.io/collector/pdata/internal" otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/json" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -137,6 +138,40 @@ func (ms NumberDataPoint) CopyTo(dest NumberDataPoint) { copyOrigNumberDataPoint(dest.orig, ms.orig) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms NumberDataPoint) marshalJSONStream(dest *json.Stream) { + dest.WriteObjectStart() + if len(ms.orig.Attributes) > 0 { + dest.WriteObjectField("attributes") + internal.MarshalJSONStreamMap(internal.NewMap(&ms.orig.Attributes, ms.state), dest) + } + if ms.orig.StartTimeUnixNano != 0 { + dest.WriteObjectField("startTimeUnixNano") + dest.WriteUint64(ms.orig.StartTimeUnixNano) + } + if ms.orig.TimeUnixNano != 0 { + dest.WriteObjectField("timeUnixNano") + dest.WriteUint64(ms.orig.TimeUnixNano) + } + switch ov := ms.orig.Value.(type) { + case *otlpmetrics.NumberDataPoint_AsDouble: + dest.WriteObjectField("asDouble") + dest.WriteFloat64(ov.AsDouble) + case *otlpmetrics.NumberDataPoint_AsInt: + dest.WriteObjectField("asInt") + dest.WriteInt64(ov.AsInt) + } + if len(ms.orig.Exemplars) > 0 { + dest.WriteObjectField("exemplars") + ms.Exemplars().marshalJSONStream(dest) + } + if ms.orig.Flags != 0 { + dest.WriteObjectField("flags") + dest.WriteUint32(ms.orig.Flags) + } + dest.WriteObjectEnd() +} + func copyOrigNumberDataPoint(dest, src *otlpmetrics.NumberDataPoint) { dest.Attributes = internal.CopyOrigMap(dest.Attributes, src.Attributes) dest.StartTimeUnixNano = src.StartTimeUnixNano diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_numberdatapointslice.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_numberdatapointslice.go index ff7f0f9c95..a8bc871220 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_numberdatapointslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_numberdatapointslice.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pmetric @@ -12,6 +12,7 @@ import ( "go.opentelemetry.io/collector/pdata/internal" otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // NumberDataPointSlice logically represents a slice of NumberDataPoint. @@ -156,6 +157,28 @@ func (es NumberDataPointSlice) Sort(less func(a, b NumberDataPoint) bool) { sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms NumberDataPointSlice) marshalJSONStream(dest *json.Stream) { + dest.WriteArrayStart() + if len(*ms.orig) > 0 { + ms.At(0).marshalJSONStream(dest) + } + for i := 1; i < len(*ms.orig); i++ { + dest.WriteMore() + ms.At(i).marshalJSONStream(dest) + } + dest.WriteArrayEnd() +} + +// unmarshalJSONIter unmarshals all properties from the current struct from the source iterator. +func (ms NumberDataPointSlice) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadArrayCB(func(iter *json.Iterator) bool { + *ms.orig = append(*ms.orig, &otlpmetrics.NumberDataPoint{}) + ms.At(ms.Len() - 1).unmarshalJSONIter(iter) + return true + }) +} + func copyOrigNumberDataPointSlice(dest, src []*otlpmetrics.NumberDataPoint) []*otlpmetrics.NumberDataPoint { if cap(dest) < len(src) { dest = make([]*otlpmetrics.NumberDataPoint, len(src)) diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_resourcemetrics.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_resourcemetrics.go index 23803d13e2..eb6ec27177 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_resourcemetrics.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_resourcemetrics.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pmetric @@ -9,6 +9,7 @@ package pmetric import ( "go.opentelemetry.io/collector/pdata/internal" otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/json" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -77,6 +78,22 @@ func (ms ResourceMetrics) CopyTo(dest ResourceMetrics) { copyOrigResourceMetrics(dest.orig, ms.orig) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms ResourceMetrics) marshalJSONStream(dest *json.Stream) { + dest.WriteObjectStart() + dest.WriteObjectField("resource") + internal.MarshalJSONStreamResource(internal.NewResource(&ms.orig.Resource, ms.state), dest) + if ms.orig.SchemaUrl != "" { + dest.WriteObjectField("schemaUrl") + dest.WriteString(ms.orig.SchemaUrl) + } + if len(ms.orig.ScopeMetrics) > 0 { + dest.WriteObjectField("scopeMetrics") + ms.ScopeMetrics().marshalJSONStream(dest) + } + dest.WriteObjectEnd() +} + func copyOrigResourceMetrics(dest, src *otlpmetrics.ResourceMetrics) { internal.CopyOrigResource(&dest.Resource, &src.Resource) dest.SchemaUrl = src.SchemaUrl diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_resourcemetricsslice.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_resourcemetricsslice.go index b46d0c3e27..41c5ff0d0a 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_resourcemetricsslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_resourcemetricsslice.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pmetric @@ -12,6 +12,7 @@ import ( "go.opentelemetry.io/collector/pdata/internal" otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // ResourceMetricsSlice logically represents a slice of ResourceMetrics. @@ -156,6 +157,28 @@ func (es ResourceMetricsSlice) Sort(less func(a, b ResourceMetrics) bool) { sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms ResourceMetricsSlice) marshalJSONStream(dest *json.Stream) { + dest.WriteArrayStart() + if len(*ms.orig) > 0 { + ms.At(0).marshalJSONStream(dest) + } + for i := 1; i < len(*ms.orig); i++ { + dest.WriteMore() + ms.At(i).marshalJSONStream(dest) + } + dest.WriteArrayEnd() +} + +// unmarshalJSONIter unmarshals all properties from the current struct from the source iterator. +func (ms ResourceMetricsSlice) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadArrayCB(func(iter *json.Iterator) bool { + *ms.orig = append(*ms.orig, &otlpmetrics.ResourceMetrics{}) + ms.At(ms.Len() - 1).unmarshalJSONIter(iter) + return true + }) +} + func copyOrigResourceMetricsSlice(dest, src []*otlpmetrics.ResourceMetrics) []*otlpmetrics.ResourceMetrics { if cap(dest) < len(src) { dest = make([]*otlpmetrics.ResourceMetrics, len(src)) diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_scopemetrics.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_scopemetrics.go index d13626f061..f503fe48df 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_scopemetrics.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_scopemetrics.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pmetric @@ -9,6 +9,7 @@ package pmetric import ( "go.opentelemetry.io/collector/pdata/internal" otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/json" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -77,6 +78,22 @@ func (ms ScopeMetrics) CopyTo(dest ScopeMetrics) { copyOrigScopeMetrics(dest.orig, ms.orig) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms ScopeMetrics) marshalJSONStream(dest *json.Stream) { + dest.WriteObjectStart() + dest.WriteObjectField("scope") + internal.MarshalJSONStreamInstrumentationScope(internal.NewInstrumentationScope(&ms.orig.Scope, ms.state), dest) + if ms.orig.SchemaUrl != "" { + dest.WriteObjectField("schemaUrl") + dest.WriteString(ms.orig.SchemaUrl) + } + if len(ms.orig.Metrics) > 0 { + dest.WriteObjectField("metrics") + ms.Metrics().marshalJSONStream(dest) + } + dest.WriteObjectEnd() +} + func copyOrigScopeMetrics(dest, src *otlpmetrics.ScopeMetrics) { internal.CopyOrigInstrumentationScope(&dest.Scope, &src.Scope) dest.SchemaUrl = src.SchemaUrl diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_scopemetricsslice.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_scopemetricsslice.go index 2a1fc16c67..6a3a83a69a 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_scopemetricsslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_scopemetricsslice.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pmetric @@ -12,6 +12,7 @@ import ( "go.opentelemetry.io/collector/pdata/internal" otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // ScopeMetricsSlice logically represents a slice of ScopeMetrics. @@ -156,6 +157,28 @@ func (es ScopeMetricsSlice) Sort(less func(a, b ScopeMetrics) bool) { sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms ScopeMetricsSlice) marshalJSONStream(dest *json.Stream) { + dest.WriteArrayStart() + if len(*ms.orig) > 0 { + ms.At(0).marshalJSONStream(dest) + } + for i := 1; i < len(*ms.orig); i++ { + dest.WriteMore() + ms.At(i).marshalJSONStream(dest) + } + dest.WriteArrayEnd() +} + +// unmarshalJSONIter unmarshals all properties from the current struct from the source iterator. +func (ms ScopeMetricsSlice) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadArrayCB(func(iter *json.Iterator) bool { + *ms.orig = append(*ms.orig, &otlpmetrics.ScopeMetrics{}) + ms.At(ms.Len() - 1).unmarshalJSONIter(iter) + return true + }) +} + func copyOrigScopeMetricsSlice(dest, src []*otlpmetrics.ScopeMetrics) []*otlpmetrics.ScopeMetrics { if cap(dest) < len(src) { dest = make([]*otlpmetrics.ScopeMetrics, len(src)) diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_sum.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_sum.go index 6b9c01d08d..e8c3155f50 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_sum.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_sum.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pmetric @@ -9,6 +9,7 @@ package pmetric import ( "go.opentelemetry.io/collector/pdata/internal" otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // Sum represents the type of a numeric metric that is calculated as a sum of all reported measurements over a time interval. @@ -82,6 +83,24 @@ func (ms Sum) CopyTo(dest Sum) { copyOrigSum(dest.orig, ms.orig) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms Sum) marshalJSONStream(dest *json.Stream) { + dest.WriteObjectStart() + if ms.orig.AggregationTemporality != otlpmetrics.AggregationTemporality(0) { + dest.WriteObjectField("aggregationTemporality") + ms.AggregationTemporality().marshalJSONStream(dest) + } + if ms.orig.IsMonotonic != false { + dest.WriteObjectField("isMonotonic") + dest.WriteBool(ms.orig.IsMonotonic) + } + if len(ms.orig.DataPoints) > 0 { + dest.WriteObjectField("dataPoints") + ms.DataPoints().marshalJSONStream(dest) + } + dest.WriteObjectEnd() +} + func copyOrigSum(dest, src *otlpmetrics.Sum) { dest.AggregationTemporality = src.AggregationTemporality dest.IsMonotonic = src.IsMonotonic diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_summary.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_summary.go index 85c119fc7c..01534f2170 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_summary.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_summary.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pmetric @@ -9,6 +9,7 @@ package pmetric import ( "go.opentelemetry.io/collector/pdata/internal" otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // Summary represents the type of a metric that is calculated by aggregating as a Summary of all reported double measurements over a time interval. @@ -60,6 +61,16 @@ func (ms Summary) CopyTo(dest Summary) { copyOrigSummary(dest.orig, ms.orig) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms Summary) marshalJSONStream(dest *json.Stream) { + dest.WriteObjectStart() + if len(ms.orig.DataPoints) > 0 { + dest.WriteObjectField("dataPoints") + ms.DataPoints().marshalJSONStream(dest) + } + dest.WriteObjectEnd() +} + func copyOrigSummary(dest, src *otlpmetrics.Summary) { dest.DataPoints = copyOrigSummaryDataPointSlice(dest.DataPoints, src.DataPoints) } diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_summarydatapoint.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_summarydatapoint.go index afdc32c3f5..968c415065 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_summarydatapoint.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_summarydatapoint.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pmetric @@ -9,6 +9,7 @@ package pmetric import ( "go.opentelemetry.io/collector/pdata/internal" otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/json" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -121,6 +122,40 @@ func (ms SummaryDataPoint) CopyTo(dest SummaryDataPoint) { copyOrigSummaryDataPoint(dest.orig, ms.orig) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms SummaryDataPoint) marshalJSONStream(dest *json.Stream) { + dest.WriteObjectStart() + if len(ms.orig.Attributes) > 0 { + dest.WriteObjectField("attributes") + internal.MarshalJSONStreamMap(internal.NewMap(&ms.orig.Attributes, ms.state), dest) + } + if ms.orig.StartTimeUnixNano != 0 { + dest.WriteObjectField("startTimeUnixNano") + dest.WriteUint64(ms.orig.StartTimeUnixNano) + } + if ms.orig.TimeUnixNano != 0 { + dest.WriteObjectField("timeUnixNano") + dest.WriteUint64(ms.orig.TimeUnixNano) + } + if ms.orig.Count != uint64(0) { + dest.WriteObjectField("count") + dest.WriteUint64(ms.orig.Count) + } + if ms.orig.Sum != float64(0.0) { + dest.WriteObjectField("sum") + dest.WriteFloat64(ms.orig.Sum) + } + if len(ms.orig.QuantileValues) > 0 { + dest.WriteObjectField("quantileValues") + ms.QuantileValues().marshalJSONStream(dest) + } + if ms.orig.Flags != 0 { + dest.WriteObjectField("flags") + dest.WriteUint32(ms.orig.Flags) + } + dest.WriteObjectEnd() +} + func copyOrigSummaryDataPoint(dest, src *otlpmetrics.SummaryDataPoint) { dest.Attributes = internal.CopyOrigMap(dest.Attributes, src.Attributes) dest.StartTimeUnixNano = src.StartTimeUnixNano diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_summarydatapointslice.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_summarydatapointslice.go index fc2652c3a7..0bd836b1fb 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_summarydatapointslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_summarydatapointslice.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pmetric @@ -12,6 +12,7 @@ import ( "go.opentelemetry.io/collector/pdata/internal" otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // SummaryDataPointSlice logically represents a slice of SummaryDataPoint. @@ -156,6 +157,28 @@ func (es SummaryDataPointSlice) Sort(less func(a, b SummaryDataPoint) bool) { sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms SummaryDataPointSlice) marshalJSONStream(dest *json.Stream) { + dest.WriteArrayStart() + if len(*ms.orig) > 0 { + ms.At(0).marshalJSONStream(dest) + } + for i := 1; i < len(*ms.orig); i++ { + dest.WriteMore() + ms.At(i).marshalJSONStream(dest) + } + dest.WriteArrayEnd() +} + +// unmarshalJSONIter unmarshals all properties from the current struct from the source iterator. +func (ms SummaryDataPointSlice) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadArrayCB(func(iter *json.Iterator) bool { + *ms.orig = append(*ms.orig, &otlpmetrics.SummaryDataPoint{}) + ms.At(ms.Len() - 1).unmarshalJSONIter(iter) + return true + }) +} + func copyOrigSummaryDataPointSlice(dest, src []*otlpmetrics.SummaryDataPoint) []*otlpmetrics.SummaryDataPoint { if cap(dest) < len(src) { dest = make([]*otlpmetrics.SummaryDataPoint, len(src)) diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_summarydatapointvalueatquantile.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_summarydatapointvalueatquantile.go index aad8eb56c6..68b6db5271 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_summarydatapointvalueatquantile.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_summarydatapointvalueatquantile.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pmetric @@ -9,6 +9,7 @@ package pmetric import ( "go.opentelemetry.io/collector/pdata/internal" otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // SummaryDataPointValueAtQuantile is a quantile value within a Summary data point. @@ -77,6 +78,20 @@ func (ms SummaryDataPointValueAtQuantile) CopyTo(dest SummaryDataPointValueAtQua copyOrigSummaryDataPointValueAtQuantile(dest.orig, ms.orig) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms SummaryDataPointValueAtQuantile) marshalJSONStream(dest *json.Stream) { + dest.WriteObjectStart() + if ms.orig.Quantile != float64(0.0) { + dest.WriteObjectField("quantile") + dest.WriteFloat64(ms.orig.Quantile) + } + if ms.orig.Value != float64(0.0) { + dest.WriteObjectField("value") + dest.WriteFloat64(ms.orig.Value) + } + dest.WriteObjectEnd() +} + func copyOrigSummaryDataPointValueAtQuantile(dest, src *otlpmetrics.SummaryDataPoint_ValueAtQuantile) { dest.Quantile = src.Quantile dest.Value = src.Value diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_summarydatapointvalueatquantileslice.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_summarydatapointvalueatquantileslice.go index 32b812c66c..5b31ec588f 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_summarydatapointvalueatquantileslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_summarydatapointvalueatquantileslice.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pmetric @@ -12,6 +12,7 @@ import ( "go.opentelemetry.io/collector/pdata/internal" otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // SummaryDataPointValueAtQuantileSlice logically represents a slice of SummaryDataPointValueAtQuantile. @@ -156,6 +157,28 @@ func (es SummaryDataPointValueAtQuantileSlice) Sort(less func(a, b SummaryDataPo sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms SummaryDataPointValueAtQuantileSlice) marshalJSONStream(dest *json.Stream) { + dest.WriteArrayStart() + if len(*ms.orig) > 0 { + ms.At(0).marshalJSONStream(dest) + } + for i := 1; i < len(*ms.orig); i++ { + dest.WriteMore() + ms.At(i).marshalJSONStream(dest) + } + dest.WriteArrayEnd() +} + +// unmarshalJSONIter unmarshals all properties from the current struct from the source iterator. +func (ms SummaryDataPointValueAtQuantileSlice) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadArrayCB(func(iter *json.Iterator) bool { + *ms.orig = append(*ms.orig, &otlpmetrics.SummaryDataPoint_ValueAtQuantile{}) + ms.At(ms.Len() - 1).unmarshalJSONIter(iter) + return true + }) +} + func copyOrigSummaryDataPointValueAtQuantileSlice(dest, src []*otlpmetrics.SummaryDataPoint_ValueAtQuantile) []*otlpmetrics.SummaryDataPoint_ValueAtQuantile { if cap(dest) < len(src) { dest = make([]*otlpmetrics.SummaryDataPoint_ValueAtQuantile, len(src)) diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/json.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/json.go index 394b8af7c6..7df308be07 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/json.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/json.go @@ -4,10 +4,7 @@ package pmetric // import "go.opentelemetry.io/collector/pdata/pmetric" import ( - "bytes" - "fmt" - - jsoniter "github.com/json-iterator/go" + "slices" "go.opentelemetry.io/collector/pdata/internal" otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" @@ -22,10 +19,10 @@ type JSONMarshaler struct{} // MarshalMetrics to the OTLP/JSON format. func (*JSONMarshaler) MarshalMetrics(md Metrics) ([]byte, error) { - buf := bytes.Buffer{} - pb := internal.MetricsToProto(internal.Metrics(md)) - err := json.Marshal(&buf, &pb) - return buf.Bytes(), err + dest := json.BorrowStream(nil) + defer json.ReturnStream(dest) + md.marshalJSONStream(dest) + return slices.Clone(dest.Buffer()), dest.Error() } // JSONUnmarshaler unmarshals OTLP/JSON formatted-bytes to pdata.Metrics. @@ -33,42 +30,24 @@ type JSONUnmarshaler struct{} // UnmarshalMetrics from OTLP/JSON format into pdata.Metrics. func (*JSONUnmarshaler) UnmarshalMetrics(buf []byte) (Metrics, error) { - iter := jsoniter.ConfigFastest.BorrowIterator(buf) - defer jsoniter.ConfigFastest.ReturnIterator(iter) + iter := json.BorrowIterator(buf) + defer json.ReturnIterator(iter) md := NewMetrics() - md.unmarshalJsoniter(iter) - if iter.Error != nil { - return Metrics{}, iter.Error + md.unmarshalJSONIter(iter) + if iter.Error() != nil { + return Metrics{}, iter.Error() } otlp.MigrateMetrics(md.getOrig().ResourceMetrics) return md, nil } -func (ms Metrics) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { - switch f { - case "resource_metrics", "resourceMetrics": - iter.ReadArrayCB(func(*jsoniter.Iterator) bool { - ms.ResourceMetrics().AppendEmpty().unmarshalJsoniter(iter) - return true - }) - default: - iter.Skip() - } - return true - }) -} - -func (ms ResourceMetrics) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { +func (ms ResourceMetrics) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { switch f { case "resource": - json.ReadResource(iter, &ms.orig.Resource) + internal.UnmarshalJSONIterResource(internal.NewResource(&ms.orig.Resource, ms.state), iter) case "scopeMetrics", "scope_metrics": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - ms.ScopeMetrics().AppendEmpty().unmarshalJsoniter(iter) - return true - }) + ms.ScopeMetrics().unmarshalJSONIter(iter) case "schemaUrl", "schema_url": ms.orig.SchemaUrl = iter.ReadString() default: @@ -78,16 +57,13 @@ func (ms ResourceMetrics) unmarshalJsoniter(iter *jsoniter.Iterator) { }) } -func (ms ScopeMetrics) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { +func (ms ScopeMetrics) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { switch f { case "scope": - json.ReadScope(iter, &ms.orig.Scope) + internal.UnmarshalJSONIterInstrumentationScope(internal.NewInstrumentationScope(&ms.orig.Scope, ms.state), iter) case "metrics": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - ms.Metrics().AppendEmpty().unmarshalJsoniter(iter) - return true - }) + ms.Metrics().unmarshalJSONIter(iter) case "schemaUrl", "schema_url": ms.orig.SchemaUrl = iter.ReadString() default: @@ -97,8 +73,8 @@ func (ms ScopeMetrics) unmarshalJsoniter(iter *jsoniter.Iterator) { }) } -func (ms Metric) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { +func (ms Metric) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { switch f { case "name": ms.orig.Name = iter.ReadString() @@ -107,20 +83,17 @@ func (ms Metric) unmarshalJsoniter(iter *jsoniter.Iterator) { case "unit": ms.orig.Unit = iter.ReadString() case "metadata": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - ms.orig.Metadata = append(ms.orig.Metadata, json.ReadAttribute(iter)) - return true - }) + internal.UnmarshalJSONIterMap(internal.NewMap(&ms.orig.Metadata, ms.state), iter) case "sum": - ms.SetEmptySum().unmarshalJsoniter(iter) + ms.SetEmptySum().unmarshalJSONIter(iter) case "gauge": - ms.SetEmptyGauge().unmarshalJsoniter(iter) + ms.SetEmptyGauge().unmarshalJSONIter(iter) case "histogram": - ms.SetEmptyHistogram().unmarshalJsoniter(iter) + ms.SetEmptyHistogram().unmarshalJSONIter(iter) case "exponential_histogram", "exponentialHistogram": - ms.SetEmptyExponentialHistogram().unmarshalJsoniter(iter) + ms.SetEmptyExponentialHistogram().unmarshalJSONIter(iter) case "summary": - ms.SetEmptySummary().unmarshalJsoniter(iter) + ms.SetEmptySummary().unmarshalJSONIter(iter) default: iter.Skip() } @@ -128,18 +101,15 @@ func (ms Metric) unmarshalJsoniter(iter *jsoniter.Iterator) { }) } -func (ms Sum) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { +func (ms Sum) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { switch f { case "aggregation_temporality", "aggregationTemporality": ms.orig.AggregationTemporality = readAggregationTemporality(iter) case "is_monotonic", "isMonotonic": ms.orig.IsMonotonic = iter.ReadBool() case "data_points", "dataPoints": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - ms.DataPoints().AppendEmpty().unmarshalJsoniter(iter) - return true - }) + ms.DataPoints().unmarshalJSONIter(iter) default: iter.Skip() } @@ -147,14 +117,11 @@ func (ms Sum) unmarshalJsoniter(iter *jsoniter.Iterator) { }) } -func (ms Gauge) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { +func (ms Gauge) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { switch f { case "data_points", "dataPoints": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - ms.DataPoints().AppendEmpty().unmarshalJsoniter(iter) - return true - }) + ms.DataPoints().unmarshalJSONIter(iter) default: iter.Skip() } @@ -162,14 +129,11 @@ func (ms Gauge) unmarshalJsoniter(iter *jsoniter.Iterator) { }) } -func (ms Histogram) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { +func (ms Histogram) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { switch f { case "data_points", "dataPoints": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - ms.DataPoints().AppendEmpty().unmarshalJsoniter(iter) - return true - }) + ms.DataPoints().unmarshalJSONIter(iter) case "aggregation_temporality", "aggregationTemporality": ms.orig.AggregationTemporality = readAggregationTemporality(iter) default: @@ -179,14 +143,11 @@ func (ms Histogram) unmarshalJsoniter(iter *jsoniter.Iterator) { }) } -func (ms ExponentialHistogram) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { +func (ms ExponentialHistogram) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { switch f { case "data_points", "dataPoints": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - ms.DataPoints().AppendEmpty().unmarshalJsoniter(iter) - return true - }) + ms.DataPoints().unmarshalJSONIter(iter) case "aggregation_temporality", "aggregationTemporality": ms.orig.AggregationTemporality = readAggregationTemporality(iter) default: @@ -196,14 +157,11 @@ func (ms ExponentialHistogram) unmarshalJsoniter(iter *jsoniter.Iterator) { }) } -func (ms Summary) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { +func (ms Summary) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { switch f { case "data_points", "dataPoints": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - ms.DataPoints().AppendEmpty().unmarshalJsoniter(iter) - return true - }) + ms.DataPoints().unmarshalJSONIter(iter) default: iter.Skip() } @@ -211,33 +169,27 @@ func (ms Summary) unmarshalJsoniter(iter *jsoniter.Iterator) { }) } -func (ms NumberDataPoint) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { +func (ms NumberDataPoint) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { switch f { case "timeUnixNano", "time_unix_nano": - ms.orig.TimeUnixNano = json.ReadUint64(iter) + ms.orig.TimeUnixNano = iter.ReadUint64() case "start_time_unix_nano", "startTimeUnixNano": - ms.orig.StartTimeUnixNano = json.ReadUint64(iter) + ms.orig.StartTimeUnixNano = iter.ReadUint64() case "as_int", "asInt": ms.orig.Value = &otlpmetrics.NumberDataPoint_AsInt{ - AsInt: json.ReadInt64(iter), + AsInt: iter.ReadInt64(), } case "as_double", "asDouble": ms.orig.Value = &otlpmetrics.NumberDataPoint_AsDouble{ - AsDouble: json.ReadFloat64(iter), + AsDouble: iter.ReadFloat64(), } case "attributes": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - ms.orig.Attributes = append(ms.orig.Attributes, json.ReadAttribute(iter)) - return true - }) + internal.UnmarshalJSONIterMap(internal.NewMap(&ms.orig.Attributes, ms.state), iter) case "exemplars": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - ms.Exemplars().AppendEmpty().unmarshalJsoniter(iter) - return true - }) + ms.Exemplars().unmarshalJSONIter(iter) case "flags": - ms.orig.Flags = json.ReadUint32(iter) + ms.orig.Flags = iter.ReadUint32() default: iter.Skip() } @@ -245,46 +197,34 @@ func (ms NumberDataPoint) unmarshalJsoniter(iter *jsoniter.Iterator) { }) } -func (ms HistogramDataPoint) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { +func (ms HistogramDataPoint) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { switch f { case "timeUnixNano", "time_unix_nano": - ms.orig.TimeUnixNano = json.ReadUint64(iter) + ms.orig.TimeUnixNano = iter.ReadUint64() case "start_time_unix_nano", "startTimeUnixNano": - ms.orig.StartTimeUnixNano = json.ReadUint64(iter) + ms.orig.StartTimeUnixNano = iter.ReadUint64() case "attributes": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - ms.orig.Attributes = append(ms.orig.Attributes, json.ReadAttribute(iter)) - return true - }) + internal.UnmarshalJSONIterMap(internal.NewMap(&ms.orig.Attributes, ms.state), iter) case "count": - ms.orig.Count = json.ReadUint64(iter) + ms.orig.Count = iter.ReadUint64() case "sum": - ms.orig.Sum_ = &otlpmetrics.HistogramDataPoint_Sum{Sum: json.ReadFloat64(iter)} + ms.orig.Sum_ = &otlpmetrics.HistogramDataPoint_Sum{Sum: iter.ReadFloat64()} case "bucket_counts", "bucketCounts": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - ms.orig.BucketCounts = append(ms.orig.BucketCounts, json.ReadUint64(iter)) - return true - }) + internal.UnmarshalJSONIterUInt64Slice(internal.NewUInt64Slice(&ms.orig.BucketCounts, ms.state), iter) case "explicit_bounds", "explicitBounds": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - ms.orig.ExplicitBounds = append(ms.orig.ExplicitBounds, json.ReadFloat64(iter)) - return true - }) + internal.UnmarshalJSONIterFloat64Slice(internal.NewFloat64Slice(&ms.orig.ExplicitBounds, ms.state), iter) case "exemplars": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - ms.Exemplars().AppendEmpty().unmarshalJsoniter(iter) - return true - }) + ms.Exemplars().unmarshalJSONIter(iter) case "flags": - ms.orig.Flags = json.ReadUint32(iter) + ms.orig.Flags = iter.ReadUint32() case "max": ms.orig.Max_ = &otlpmetrics.HistogramDataPoint_Max{ - Max: json.ReadFloat64(iter), + Max: iter.ReadFloat64(), } case "min": ms.orig.Min_ = &otlpmetrics.HistogramDataPoint_Min{ - Min: json.ReadFloat64(iter), + Min: iter.ReadFloat64(), } default: iter.Skip() @@ -293,47 +233,43 @@ func (ms HistogramDataPoint) unmarshalJsoniter(iter *jsoniter.Iterator) { }) } -func (ms ExponentialHistogramDataPoint) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { +func (ms ExponentialHistogramDataPoint) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { switch f { case "timeUnixNano", "time_unix_nano": - ms.orig.TimeUnixNano = json.ReadUint64(iter) + ms.orig.TimeUnixNano = iter.ReadUint64() case "start_time_unix_nano", "startTimeUnixNano": - ms.orig.StartTimeUnixNano = json.ReadUint64(iter) + ms.orig.StartTimeUnixNano = iter.ReadUint64() case "attributes": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - ms.orig.Attributes = append(ms.orig.Attributes, json.ReadAttribute(iter)) - return true - }) + internal.UnmarshalJSONIterMap(internal.NewMap(&ms.orig.Attributes, ms.state), iter) case "count": - ms.orig.Count = json.ReadUint64(iter) + ms.orig.Count = iter.ReadUint64() case "sum": ms.orig.Sum_ = &otlpmetrics.ExponentialHistogramDataPoint_Sum{ - Sum: json.ReadFloat64(iter), + Sum: iter.ReadFloat64(), } case "scale": ms.orig.Scale = iter.ReadInt32() case "zero_count", "zeroCount": - ms.orig.ZeroCount = json.ReadUint64(iter) + ms.orig.ZeroCount = iter.ReadUint64() case "positive": - ms.Positive().unmarshalJsoniter(iter) + ms.Positive().unmarshalJSONIter(iter) case "negative": - ms.Negative().unmarshalJsoniter(iter) + ms.Negative().unmarshalJSONIter(iter) case "exemplars": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - ms.Exemplars().AppendEmpty().unmarshalJsoniter(iter) - return true - }) + ms.Exemplars().unmarshalJSONIter(iter) case "flags": - ms.orig.Flags = json.ReadUint32(iter) + ms.orig.Flags = iter.ReadUint32() case "max": ms.orig.Max_ = &otlpmetrics.ExponentialHistogramDataPoint_Max{ - Max: json.ReadFloat64(iter), + Max: iter.ReadFloat64(), } case "min": ms.orig.Min_ = &otlpmetrics.ExponentialHistogramDataPoint_Min{ - Min: json.ReadFloat64(iter), + Min: iter.ReadFloat64(), } + case "zeroThreshold", "zero_threshold": + ms.orig.ZeroThreshold = iter.ReadFloat64() default: iter.Skip() } @@ -341,29 +277,23 @@ func (ms ExponentialHistogramDataPoint) unmarshalJsoniter(iter *jsoniter.Iterato }) } -func (ms SummaryDataPoint) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { +func (ms SummaryDataPoint) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { switch f { case "timeUnixNano", "time_unix_nano": - ms.orig.TimeUnixNano = json.ReadUint64(iter) + ms.orig.TimeUnixNano = iter.ReadUint64() case "start_time_unix_nano", "startTimeUnixNano": - ms.orig.StartTimeUnixNano = json.ReadUint64(iter) + ms.orig.StartTimeUnixNano = iter.ReadUint64() case "attributes": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - ms.orig.Attributes = append(ms.orig.Attributes, json.ReadAttribute(iter)) - return true - }) + internal.UnmarshalJSONIterMap(internal.NewMap(&ms.orig.Attributes, ms.state), iter) case "count": - ms.orig.Count = json.ReadUint64(iter) + ms.orig.Count = iter.ReadUint64() case "sum": - ms.orig.Sum = json.ReadFloat64(iter) + ms.orig.Sum = iter.ReadFloat64() case "quantile_values", "quantileValues": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - ms.QuantileValues().AppendEmpty().unmarshalJsoniter(iter) - return true - }) + ms.QuantileValues().unmarshalJSONIter(iter) case "flags": - ms.orig.Flags = json.ReadUint32(iter) + ms.orig.Flags = iter.ReadUint32() default: iter.Skip() } @@ -371,14 +301,11 @@ func (ms SummaryDataPoint) unmarshalJsoniter(iter *jsoniter.Iterator) { }) } -func (ms ExponentialHistogramDataPointBuckets) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { +func (ms ExponentialHistogramDataPointBuckets) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { switch f { case "bucket_counts", "bucketCounts": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - ms.orig.BucketCounts = append(ms.orig.BucketCounts, json.ReadUint64(iter)) - return true - }) + internal.UnmarshalJSONIterUInt64Slice(internal.NewUInt64Slice(&ms.orig.BucketCounts, ms.state), iter) case "offset": ms.orig.Offset = iter.ReadInt32() default: @@ -388,13 +315,13 @@ func (ms ExponentialHistogramDataPointBuckets) unmarshalJsoniter(iter *jsoniter. }) } -func (ms SummaryDataPointValueAtQuantile) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { +func (ms SummaryDataPointValueAtQuantile) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { switch f { case "quantile": - ms.orig.Quantile = json.ReadFloat64(iter) + ms.orig.Quantile = iter.ReadFloat64() case "value": - ms.orig.Value = json.ReadFloat64(iter) + ms.orig.Value = iter.ReadFloat64() default: iter.Skip() } @@ -402,32 +329,25 @@ func (ms SummaryDataPointValueAtQuantile) unmarshalJsoniter(iter *jsoniter.Itera }) } -func (ms Exemplar) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { +func (ms Exemplar) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { switch f { case "filtered_attributes", "filteredAttributes": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - ms.orig.FilteredAttributes = append(ms.orig.FilteredAttributes, json.ReadAttribute(iter)) - return true - }) + internal.UnmarshalJSONIterMap(internal.NewMap(&ms.orig.FilteredAttributes, ms.state), iter) case "timeUnixNano", "time_unix_nano": - ms.orig.TimeUnixNano = json.ReadUint64(iter) + ms.orig.TimeUnixNano = iter.ReadUint64() case "as_int", "asInt": ms.orig.Value = &otlpmetrics.Exemplar_AsInt{ - AsInt: json.ReadInt64(iter), + AsInt: iter.ReadInt64(), } case "as_double", "asDouble": ms.orig.Value = &otlpmetrics.Exemplar_AsDouble{ - AsDouble: json.ReadFloat64(iter), + AsDouble: iter.ReadFloat64(), } case "traceId", "trace_id": - if err := ms.orig.TraceId.UnmarshalJSON([]byte(iter.ReadString())); err != nil { - iter.ReportError("exemplar.traceId", fmt.Sprintf("parse trace_id:%v", err)) - } + ms.orig.TraceId.UnmarshalJSONIter(iter) case "spanId", "span_id": - if err := ms.orig.SpanId.UnmarshalJSON([]byte(iter.ReadString())); err != nil { - iter.ReportError("exemplar.spanId", fmt.Sprintf("parse span_id:%v", err)) - } + ms.orig.SpanId.UnmarshalJSONIter(iter) default: iter.Skip() } @@ -435,6 +355,6 @@ func (ms Exemplar) unmarshalJsoniter(iter *jsoniter.Iterator) { }) } -func readAggregationTemporality(iter *jsoniter.Iterator) otlpmetrics.AggregationTemporality { - return otlpmetrics.AggregationTemporality(json.ReadEnumValue(iter, otlpmetrics.AggregationTemporality_value)) +func readAggregationTemporality(iter *json.Iterator) otlpmetrics.AggregationTemporality { + return otlpmetrics.AggregationTemporality(iter.ReadEnumValue(otlpmetrics.AggregationTemporality_value)) } diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/metrics.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/metrics.go index 91195ca4df..50c2b06e8e 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/metrics.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/metrics.go @@ -6,6 +6,7 @@ package pmetric // import "go.opentelemetry.io/collector/pdata/pmetric" import ( "go.opentelemetry.io/collector/pdata/internal" otlpcollectormetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // Metrics is the top-level struct that is propagated through the metrics pipeline. @@ -93,3 +94,25 @@ func (ms Metrics) DataPointCount() (dataPointCount int) { func (ms Metrics) MarkReadOnly() { internal.SetMetricsState(internal.Metrics(ms), internal.StateReadOnly) } + +func (ms Metrics) marshalJSONStream(dest *json.Stream) { + dest.WriteObjectStart() + dest.WriteObjectField("resourceMetrics") + ms.ResourceMetrics().marshalJSONStream(dest) + dest.WriteObjectEnd() +} + +func (ms Metrics) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { + switch f { + case "resource_metrics", "resourceMetrics": + iter.ReadArrayCB(func(iter *json.Iterator) bool { + ms.ResourceMetrics().AppendEmpty().unmarshalJSONIter(iter) + return true + }) + default: + iter.Skip() + } + return true + }) +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/generated_exportpartialsuccess.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/generated_exportpartialsuccess.go index 70b1735efe..d256c379f3 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/generated_exportpartialsuccess.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/generated_exportpartialsuccess.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package pmetricotlp @@ -9,6 +9,7 @@ package pmetricotlp import ( "go.opentelemetry.io/collector/pdata/internal" otlpcollectormetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // ExportPartialSuccess represents the details of a partially successful export request. @@ -77,6 +78,20 @@ func (ms ExportPartialSuccess) CopyTo(dest ExportPartialSuccess) { copyOrigExportPartialSuccess(dest.orig, ms.orig) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms ExportPartialSuccess) marshalJSONStream(dest *json.Stream) { + dest.WriteObjectStart() + if ms.orig.RejectedDataPoints != int64(0) { + dest.WriteObjectField("rejectedDataPoints") + dest.WriteInt64(ms.orig.RejectedDataPoints) + } + if ms.orig.ErrorMessage != "" { + dest.WriteObjectField("errorMessage") + dest.WriteString(ms.orig.ErrorMessage) + } + dest.WriteObjectEnd() +} + func copyOrigExportPartialSuccess(dest, src *otlpcollectormetrics.ExportMetricsPartialSuccess) { dest.RejectedDataPoints = src.RejectedDataPoints dest.ErrorMessage = src.ErrorMessage diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/request.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/request.go index 4cca31a609..619d1cd59d 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/request.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/request.go @@ -4,15 +4,15 @@ package pmetricotlp // import "go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp" import ( - "bytes" - "go.opentelemetry.io/collector/pdata/internal" otlpcollectormetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/metrics/v1" - "go.opentelemetry.io/collector/pdata/internal/json" "go.opentelemetry.io/collector/pdata/pmetric" ) -var jsonUnmarshaler = &pmetric.JSONUnmarshaler{} +var ( + jsonMarshaler = &pmetric.JSONMarshaler{} + jsonUnmarshaler = &pmetric.JSONUnmarshaler{} +) // ExportRequest represents the request for gRPC/HTTP client/server. // It's a wrapper for pmetric.Metrics data. @@ -52,11 +52,7 @@ func (ms ExportRequest) UnmarshalProto(data []byte) error { // MarshalJSON marshals ExportRequest into JSON bytes. func (ms ExportRequest) MarshalJSON() ([]byte, error) { - var buf bytes.Buffer - if err := json.Marshal(&buf, ms.orig); err != nil { - return nil, err - } - return buf.Bytes(), nil + return jsonMarshaler.MarshalMetrics(pmetric.Metrics(internal.NewMetrics(ms.orig, nil))) } // UnmarshalJSON unmarshalls ExportRequest from JSON bytes. diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/response.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/response.go index 5942568ddb..17fa35d9d1 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/response.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/response.go @@ -4,9 +4,7 @@ package pmetricotlp // import "go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp" import ( - "bytes" - - jsoniter "github.com/json-iterator/go" + "slices" "go.opentelemetry.io/collector/pdata/internal" otlpcollectormetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/metrics/v1" @@ -40,19 +38,21 @@ func (ms ExportResponse) UnmarshalProto(data []byte) error { // MarshalJSON marshals ExportResponse into JSON bytes. func (ms ExportResponse) MarshalJSON() ([]byte, error) { - var buf bytes.Buffer - if err := json.Marshal(&buf, ms.orig); err != nil { - return nil, err - } - return buf.Bytes(), nil + dest := json.BorrowStream(nil) + defer json.ReturnStream(dest) + dest.WriteObjectStart() + dest.WriteObjectField("partialSuccess") + ms.PartialSuccess().marshalJSONStream(dest) + dest.WriteObjectEnd() + return slices.Clone(dest.Buffer()), dest.Error() } // UnmarshalJSON unmarshalls ExportResponse from JSON bytes. func (ms ExportResponse) UnmarshalJSON(data []byte) error { - iter := jsoniter.ConfigFastest.BorrowIterator(data) - defer jsoniter.ConfigFastest.ReturnIterator(iter) - ms.unmarshalJsoniter(iter) - return iter.Error + iter := json.BorrowIterator(data) + defer json.ReturnIterator(iter) + ms.unmarshalJSONIter(iter) + return iter.Error() } // PartialSuccess returns the ExportLogsPartialSuccess associated with this ExportResponse. @@ -60,11 +60,11 @@ func (ms ExportResponse) PartialSuccess() ExportPartialSuccess { return newExportPartialSuccess(&ms.orig.PartialSuccess, ms.state) } -func (ms ExportResponse) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { +func (ms ExportResponse) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { switch f { case "partial_success", "partialSuccess": - ms.PartialSuccess().unmarshalJsoniter(iter) + ms.PartialSuccess().unmarshalJSONIter(iter) default: iter.Skip() } @@ -72,11 +72,11 @@ func (ms ExportResponse) unmarshalJsoniter(iter *jsoniter.Iterator) { }) } -func (ms ExportPartialSuccess) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(_ *jsoniter.Iterator, f string) bool { +func (ms ExportPartialSuccess) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(_ *json.Iterator, f string) bool { switch f { case "rejected_data_points", "rejectedDataPoints": - ms.orig.RejectedDataPoints = json.ReadInt64(iter) + ms.orig.RejectedDataPoints = iter.ReadInt64() case "error_message", "errorMessage": ms.orig.ErrorMessage = iter.ReadString() default: diff --git a/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_resourcespans.go b/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_resourcespans.go index 9663d33f03..8cf3b7a37d 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_resourcespans.go +++ b/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_resourcespans.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package ptrace @@ -9,6 +9,7 @@ package ptrace import ( "go.opentelemetry.io/collector/pdata/internal" otlptrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1" + "go.opentelemetry.io/collector/pdata/internal/json" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -77,6 +78,22 @@ func (ms ResourceSpans) CopyTo(dest ResourceSpans) { copyOrigResourceSpans(dest.orig, ms.orig) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms ResourceSpans) marshalJSONStream(dest *json.Stream) { + dest.WriteObjectStart() + dest.WriteObjectField("resource") + internal.MarshalJSONStreamResource(internal.NewResource(&ms.orig.Resource, ms.state), dest) + if ms.orig.SchemaUrl != "" { + dest.WriteObjectField("schemaUrl") + dest.WriteString(ms.orig.SchemaUrl) + } + if len(ms.orig.ScopeSpans) > 0 { + dest.WriteObjectField("scopeSpans") + ms.ScopeSpans().marshalJSONStream(dest) + } + dest.WriteObjectEnd() +} + func copyOrigResourceSpans(dest, src *otlptrace.ResourceSpans) { internal.CopyOrigResource(&dest.Resource, &src.Resource) dest.SchemaUrl = src.SchemaUrl diff --git a/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_resourcespansslice.go b/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_resourcespansslice.go index bf9776647a..857d5f52bb 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_resourcespansslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_resourcespansslice.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package ptrace @@ -12,6 +12,7 @@ import ( "go.opentelemetry.io/collector/pdata/internal" otlptrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // ResourceSpansSlice logically represents a slice of ResourceSpans. @@ -156,6 +157,28 @@ func (es ResourceSpansSlice) Sort(less func(a, b ResourceSpans) bool) { sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms ResourceSpansSlice) marshalJSONStream(dest *json.Stream) { + dest.WriteArrayStart() + if len(*ms.orig) > 0 { + ms.At(0).marshalJSONStream(dest) + } + for i := 1; i < len(*ms.orig); i++ { + dest.WriteMore() + ms.At(i).marshalJSONStream(dest) + } + dest.WriteArrayEnd() +} + +// unmarshalJSONIter unmarshals all properties from the current struct from the source iterator. +func (ms ResourceSpansSlice) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadArrayCB(func(iter *json.Iterator) bool { + *ms.orig = append(*ms.orig, &otlptrace.ResourceSpans{}) + ms.At(ms.Len() - 1).unmarshalJSONIter(iter) + return true + }) +} + func copyOrigResourceSpansSlice(dest, src []*otlptrace.ResourceSpans) []*otlptrace.ResourceSpans { if cap(dest) < len(src) { dest = make([]*otlptrace.ResourceSpans, len(src)) diff --git a/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_scopespans.go b/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_scopespans.go index 06837b2433..bbcdc3d764 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_scopespans.go +++ b/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_scopespans.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package ptrace @@ -9,6 +9,7 @@ package ptrace import ( "go.opentelemetry.io/collector/pdata/internal" otlptrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1" + "go.opentelemetry.io/collector/pdata/internal/json" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -77,6 +78,22 @@ func (ms ScopeSpans) CopyTo(dest ScopeSpans) { copyOrigScopeSpans(dest.orig, ms.orig) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms ScopeSpans) marshalJSONStream(dest *json.Stream) { + dest.WriteObjectStart() + dest.WriteObjectField("scope") + internal.MarshalJSONStreamInstrumentationScope(internal.NewInstrumentationScope(&ms.orig.Scope, ms.state), dest) + if ms.orig.SchemaUrl != "" { + dest.WriteObjectField("schemaUrl") + dest.WriteString(ms.orig.SchemaUrl) + } + if len(ms.orig.Spans) > 0 { + dest.WriteObjectField("spans") + ms.Spans().marshalJSONStream(dest) + } + dest.WriteObjectEnd() +} + func copyOrigScopeSpans(dest, src *otlptrace.ScopeSpans) { internal.CopyOrigInstrumentationScope(&dest.Scope, &src.Scope) dest.SchemaUrl = src.SchemaUrl diff --git a/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_scopespansslice.go b/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_scopespansslice.go index 63c526597f..a5ba641b44 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_scopespansslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_scopespansslice.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package ptrace @@ -12,6 +12,7 @@ import ( "go.opentelemetry.io/collector/pdata/internal" otlptrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // ScopeSpansSlice logically represents a slice of ScopeSpans. @@ -156,6 +157,28 @@ func (es ScopeSpansSlice) Sort(less func(a, b ScopeSpans) bool) { sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms ScopeSpansSlice) marshalJSONStream(dest *json.Stream) { + dest.WriteArrayStart() + if len(*ms.orig) > 0 { + ms.At(0).marshalJSONStream(dest) + } + for i := 1; i < len(*ms.orig); i++ { + dest.WriteMore() + ms.At(i).marshalJSONStream(dest) + } + dest.WriteArrayEnd() +} + +// unmarshalJSONIter unmarshals all properties from the current struct from the source iterator. +func (ms ScopeSpansSlice) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadArrayCB(func(iter *json.Iterator) bool { + *ms.orig = append(*ms.orig, &otlptrace.ScopeSpans{}) + ms.At(ms.Len() - 1).unmarshalJSONIter(iter) + return true + }) +} + func copyOrigScopeSpansSlice(dest, src []*otlptrace.ScopeSpans) []*otlptrace.ScopeSpans { if cap(dest) < len(src) { dest = make([]*otlptrace.ScopeSpans, len(src)) diff --git a/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_span.go b/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_span.go index 16e997ede9..416237a4d5 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_span.go +++ b/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_span.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package ptrace @@ -10,6 +10,7 @@ import ( "go.opentelemetry.io/collector/pdata/internal" "go.opentelemetry.io/collector/pdata/internal/data" otlptrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1" + "go.opentelemetry.io/collector/pdata/internal/json" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -204,6 +205,74 @@ func (ms Span) CopyTo(dest Span) { copyOrigSpan(dest.orig, ms.orig) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms Span) marshalJSONStream(dest *json.Stream) { + dest.WriteObjectStart() + if ms.orig.TraceId != data.TraceID([16]byte{}) { + dest.WriteObjectField("traceId") + ms.orig.TraceId.MarshalJSONStream(dest) + } + if ms.orig.SpanId != data.SpanID([8]byte{}) { + dest.WriteObjectField("spanId") + ms.orig.SpanId.MarshalJSONStream(dest) + } + if ms.orig.TraceState != "" { + dest.WriteObjectField("traceState") + internal.MarshalJSONStreamTraceState(internal.NewTraceState(&ms.orig.TraceState, ms.state), dest) + } + if ms.orig.ParentSpanId != data.SpanID([8]byte{}) { + dest.WriteObjectField("parentSpanId") + ms.orig.ParentSpanId.MarshalJSONStream(dest) + } + if ms.orig.Name != "" { + dest.WriteObjectField("name") + dest.WriteString(ms.orig.Name) + } + if ms.orig.Flags != uint32(0) { + dest.WriteObjectField("flags") + dest.WriteUint32(ms.orig.Flags) + } + if ms.orig.Kind != otlptrace.Span_SpanKind(0) { + dest.WriteObjectField("kind") + ms.Kind().marshalJSONStream(dest) + } + if ms.orig.StartTimeUnixNano != 0 { + dest.WriteObjectField("startTimeUnixNano") + dest.WriteUint64(ms.orig.StartTimeUnixNano) + } + if ms.orig.EndTimeUnixNano != 0 { + dest.WriteObjectField("endTimeUnixNano") + dest.WriteUint64(ms.orig.EndTimeUnixNano) + } + if len(ms.orig.Attributes) > 0 { + dest.WriteObjectField("attributes") + internal.MarshalJSONStreamMap(internal.NewMap(&ms.orig.Attributes, ms.state), dest) + } + if ms.orig.DroppedAttributesCount != uint32(0) { + dest.WriteObjectField("droppedAttributesCount") + dest.WriteUint32(ms.orig.DroppedAttributesCount) + } + if len(ms.orig.Events) > 0 { + dest.WriteObjectField("events") + ms.Events().marshalJSONStream(dest) + } + if ms.orig.DroppedEventsCount != uint32(0) { + dest.WriteObjectField("droppedEventsCount") + dest.WriteUint32(ms.orig.DroppedEventsCount) + } + if len(ms.orig.Links) > 0 { + dest.WriteObjectField("links") + ms.Links().marshalJSONStream(dest) + } + if ms.orig.DroppedLinksCount != uint32(0) { + dest.WriteObjectField("droppedLinksCount") + dest.WriteUint32(ms.orig.DroppedLinksCount) + } + dest.WriteObjectField("status") + ms.Status().marshalJSONStream(dest) + dest.WriteObjectEnd() +} + func copyOrigSpan(dest, src *otlptrace.Span) { dest.TraceId = src.TraceId dest.SpanId = src.SpanId diff --git a/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_spanevent.go b/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_spanevent.go index 337b5327d2..ff9951b95e 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_spanevent.go +++ b/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_spanevent.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package ptrace @@ -9,6 +9,7 @@ package ptrace import ( "go.opentelemetry.io/collector/pdata/internal" otlptrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1" + "go.opentelemetry.io/collector/pdata/internal/json" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -95,6 +96,28 @@ func (ms SpanEvent) CopyTo(dest SpanEvent) { copyOrigSpanEvent(dest.orig, ms.orig) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms SpanEvent) marshalJSONStream(dest *json.Stream) { + dest.WriteObjectStart() + if ms.orig.TimeUnixNano != 0 { + dest.WriteObjectField("timeUnixNano") + dest.WriteUint64(ms.orig.TimeUnixNano) + } + if ms.orig.Name != "" { + dest.WriteObjectField("name") + dest.WriteString(ms.orig.Name) + } + if len(ms.orig.Attributes) > 0 { + dest.WriteObjectField("attributes") + internal.MarshalJSONStreamMap(internal.NewMap(&ms.orig.Attributes, ms.state), dest) + } + if ms.orig.DroppedAttributesCount != uint32(0) { + dest.WriteObjectField("droppedAttributesCount") + dest.WriteUint32(ms.orig.DroppedAttributesCount) + } + dest.WriteObjectEnd() +} + func copyOrigSpanEvent(dest, src *otlptrace.Span_Event) { dest.TimeUnixNano = src.TimeUnixNano dest.Name = src.Name diff --git a/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_spaneventslice.go b/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_spaneventslice.go index cd98da1bb5..d87d14482b 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_spaneventslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_spaneventslice.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package ptrace @@ -12,6 +12,7 @@ import ( "go.opentelemetry.io/collector/pdata/internal" otlptrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // SpanEventSlice logically represents a slice of SpanEvent. @@ -156,6 +157,28 @@ func (es SpanEventSlice) Sort(less func(a, b SpanEvent) bool) { sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms SpanEventSlice) marshalJSONStream(dest *json.Stream) { + dest.WriteArrayStart() + if len(*ms.orig) > 0 { + ms.At(0).marshalJSONStream(dest) + } + for i := 1; i < len(*ms.orig); i++ { + dest.WriteMore() + ms.At(i).marshalJSONStream(dest) + } + dest.WriteArrayEnd() +} + +// unmarshalJSONIter unmarshals all properties from the current struct from the source iterator. +func (ms SpanEventSlice) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadArrayCB(func(iter *json.Iterator) bool { + *ms.orig = append(*ms.orig, &otlptrace.Span_Event{}) + ms.At(ms.Len() - 1).unmarshalJSONIter(iter) + return true + }) +} + func copyOrigSpanEventSlice(dest, src []*otlptrace.Span_Event) []*otlptrace.Span_Event { if cap(dest) < len(src) { dest = make([]*otlptrace.Span_Event, len(src)) diff --git a/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_spanlink.go b/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_spanlink.go index 85a5350b1e..47635b4c65 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_spanlink.go +++ b/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_spanlink.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package ptrace @@ -10,6 +10,7 @@ import ( "go.opentelemetry.io/collector/pdata/internal" "go.opentelemetry.io/collector/pdata/internal/data" otlptrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1" + "go.opentelemetry.io/collector/pdata/internal/json" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -113,6 +114,36 @@ func (ms SpanLink) CopyTo(dest SpanLink) { copyOrigSpanLink(dest.orig, ms.orig) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms SpanLink) marshalJSONStream(dest *json.Stream) { + dest.WriteObjectStart() + if ms.orig.TraceId != data.TraceID([16]byte{}) { + dest.WriteObjectField("traceId") + ms.orig.TraceId.MarshalJSONStream(dest) + } + if ms.orig.SpanId != data.SpanID([8]byte{}) { + dest.WriteObjectField("spanId") + ms.orig.SpanId.MarshalJSONStream(dest) + } + if ms.orig.TraceState != "" { + dest.WriteObjectField("traceState") + internal.MarshalJSONStreamTraceState(internal.NewTraceState(&ms.orig.TraceState, ms.state), dest) + } + if ms.orig.Flags != uint32(0) { + dest.WriteObjectField("flags") + dest.WriteUint32(ms.orig.Flags) + } + if len(ms.orig.Attributes) > 0 { + dest.WriteObjectField("attributes") + internal.MarshalJSONStreamMap(internal.NewMap(&ms.orig.Attributes, ms.state), dest) + } + if ms.orig.DroppedAttributesCount != uint32(0) { + dest.WriteObjectField("droppedAttributesCount") + dest.WriteUint32(ms.orig.DroppedAttributesCount) + } + dest.WriteObjectEnd() +} + func copyOrigSpanLink(dest, src *otlptrace.Span_Link) { dest.TraceId = src.TraceId dest.SpanId = src.SpanId diff --git a/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_spanlinkslice.go b/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_spanlinkslice.go index af205452e7..2aa1d2255a 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_spanlinkslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_spanlinkslice.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package ptrace @@ -12,6 +12,7 @@ import ( "go.opentelemetry.io/collector/pdata/internal" otlptrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // SpanLinkSlice logically represents a slice of SpanLink. @@ -156,6 +157,28 @@ func (es SpanLinkSlice) Sort(less func(a, b SpanLink) bool) { sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms SpanLinkSlice) marshalJSONStream(dest *json.Stream) { + dest.WriteArrayStart() + if len(*ms.orig) > 0 { + ms.At(0).marshalJSONStream(dest) + } + for i := 1; i < len(*ms.orig); i++ { + dest.WriteMore() + ms.At(i).marshalJSONStream(dest) + } + dest.WriteArrayEnd() +} + +// unmarshalJSONIter unmarshals all properties from the current struct from the source iterator. +func (ms SpanLinkSlice) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadArrayCB(func(iter *json.Iterator) bool { + *ms.orig = append(*ms.orig, &otlptrace.Span_Link{}) + ms.At(ms.Len() - 1).unmarshalJSONIter(iter) + return true + }) +} + func copyOrigSpanLinkSlice(dest, src []*otlptrace.Span_Link) []*otlptrace.Span_Link { if cap(dest) < len(src) { dest = make([]*otlptrace.Span_Link, len(src)) diff --git a/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_spanslice.go b/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_spanslice.go index 306e59158a..d0ce15fadf 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_spanslice.go +++ b/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_spanslice.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package ptrace @@ -12,6 +12,7 @@ import ( "go.opentelemetry.io/collector/pdata/internal" otlptrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // SpanSlice logically represents a slice of Span. @@ -156,6 +157,28 @@ func (es SpanSlice) Sort(less func(a, b Span) bool) { sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms SpanSlice) marshalJSONStream(dest *json.Stream) { + dest.WriteArrayStart() + if len(*ms.orig) > 0 { + ms.At(0).marshalJSONStream(dest) + } + for i := 1; i < len(*ms.orig); i++ { + dest.WriteMore() + ms.At(i).marshalJSONStream(dest) + } + dest.WriteArrayEnd() +} + +// unmarshalJSONIter unmarshals all properties from the current struct from the source iterator. +func (ms SpanSlice) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadArrayCB(func(iter *json.Iterator) bool { + *ms.orig = append(*ms.orig, &otlptrace.Span{}) + ms.At(ms.Len() - 1).unmarshalJSONIter(iter) + return true + }) +} + func copyOrigSpanSlice(dest, src []*otlptrace.Span) []*otlptrace.Span { if cap(dest) < len(src) { dest = make([]*otlptrace.Span, len(src)) diff --git a/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_status.go b/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_status.go index 2040674d6c..d21d9015ff 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_status.go +++ b/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_status.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "make genpdata". package ptrace @@ -9,6 +9,7 @@ package ptrace import ( "go.opentelemetry.io/collector/pdata/internal" otlptrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // Status is an optional final status for this span. Semantically, when Status was not @@ -78,6 +79,20 @@ func (ms Status) CopyTo(dest Status) { copyOrigStatus(dest.orig, ms.orig) } +// marshalJSONStream marshals all properties from the current struct to the destination stream. +func (ms Status) marshalJSONStream(dest *json.Stream) { + dest.WriteObjectStart() + if ms.orig.Code != 0 { + dest.WriteObjectField("code") + ms.Code().marshalJSONStream(dest) + } + if ms.orig.Message != "" { + dest.WriteObjectField("message") + dest.WriteString(ms.orig.Message) + } + dest.WriteObjectEnd() +} + func copyOrigStatus(dest, src *otlptrace.Status) { dest.Code = src.Code dest.Message = src.Message diff --git a/vendor/go.opentelemetry.io/collector/pdata/ptrace/json.go b/vendor/go.opentelemetry.io/collector/pdata/ptrace/json.go index 2e35a95913..0b20afc49f 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/ptrace/json.go +++ b/vendor/go.opentelemetry.io/collector/pdata/ptrace/json.go @@ -4,10 +4,7 @@ package ptrace // import "go.opentelemetry.io/collector/pdata/ptrace" import ( - "bytes" - "fmt" - - jsoniter "github.com/json-iterator/go" + "slices" "go.opentelemetry.io/collector/pdata/internal" otlptrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1" @@ -20,10 +17,10 @@ type JSONMarshaler struct{} // MarshalTraces to the OTLP/JSON format. func (*JSONMarshaler) MarshalTraces(td Traces) ([]byte, error) { - buf := bytes.Buffer{} - pb := internal.TracesToProto(internal.Traces(td)) - err := json.Marshal(&buf, &pb) - return buf.Bytes(), err + dest := json.BorrowStream(nil) + defer json.ReturnStream(dest) + td.marshalJSONStream(dest) + return slices.Clone(dest.Buffer()), dest.Error() } // JSONUnmarshaler unmarshals OTLP/JSON formatted-bytes to pdata.Traces. @@ -31,42 +28,24 @@ type JSONUnmarshaler struct{} // UnmarshalTraces from OTLP/JSON format into pdata.Traces. func (*JSONUnmarshaler) UnmarshalTraces(buf []byte) (Traces, error) { - iter := jsoniter.ConfigFastest.BorrowIterator(buf) - defer jsoniter.ConfigFastest.ReturnIterator(iter) + iter := json.BorrowIterator(buf) + defer json.ReturnIterator(iter) td := NewTraces() - td.unmarshalJsoniter(iter) - if iter.Error != nil { - return Traces{}, iter.Error + td.unmarshalJSONIter(iter) + if iter.Error() != nil { + return Traces{}, iter.Error() } otlp.MigrateTraces(td.getOrig().ResourceSpans) return td, nil } -func (ms Traces) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { - switch f { - case "resourceSpans", "resource_spans": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - ms.ResourceSpans().AppendEmpty().unmarshalJsoniter(iter) - return true - }) - default: - iter.Skip() - } - return true - }) -} - -func (ms ResourceSpans) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { +func (ms ResourceSpans) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { switch f { case "resource": - json.ReadResource(iter, internal.GetOrigResource(internal.Resource(ms.Resource()))) + internal.UnmarshalJSONIterResource(internal.NewResource(&ms.orig.Resource, ms.state), iter) case "scopeSpans", "scope_spans": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - ms.ScopeSpans().AppendEmpty().unmarshalJsoniter(iter) - return true - }) + ms.ScopeSpans().unmarshalJSONIter(iter) case "schemaUrl", "schema_url": ms.orig.SchemaUrl = iter.ReadString() default: @@ -76,16 +55,13 @@ func (ms ResourceSpans) unmarshalJsoniter(iter *jsoniter.Iterator) { }) } -func (ms ScopeSpans) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { +func (ms ScopeSpans) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { switch f { case "scope": - json.ReadScope(iter, &ms.orig.Scope) + internal.UnmarshalJSONIterInstrumentationScope(internal.NewInstrumentationScope(&ms.orig.Scope, ms.state), iter) case "spans": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - ms.Spans().AppendEmpty().unmarshalJsoniter(iter) - return true - }) + ms.Spans().unmarshalJSONIter(iter) case "schemaUrl", "schema_url": ms.orig.SchemaUrl = iter.ReadString() default: @@ -95,56 +71,41 @@ func (ms ScopeSpans) unmarshalJsoniter(iter *jsoniter.Iterator) { }) } -func (dest Span) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { +func (ms Span) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { switch f { case "traceId", "trace_id": - if err := dest.orig.TraceId.UnmarshalJSON([]byte(iter.ReadString())); err != nil { - iter.ReportError("readSpan.traceId", fmt.Sprintf("parse trace_id:%v", err)) - } + ms.orig.TraceId.UnmarshalJSONIter(iter) case "spanId", "span_id": - if err := dest.orig.SpanId.UnmarshalJSON([]byte(iter.ReadString())); err != nil { - iter.ReportError("readSpan.spanId", fmt.Sprintf("parse span_id:%v", err)) - } + ms.orig.SpanId.UnmarshalJSONIter(iter) case "traceState", "trace_state": - dest.TraceState().FromRaw(iter.ReadString()) + ms.TraceState().FromRaw(iter.ReadString()) case "parentSpanId", "parent_span_id": - if err := dest.orig.ParentSpanId.UnmarshalJSON([]byte(iter.ReadString())); err != nil { - iter.ReportError("readSpan.parentSpanId", fmt.Sprintf("parse parent_span_id:%v", err)) - } + ms.orig.ParentSpanId.UnmarshalJSONIter(iter) case "flags": - dest.orig.Flags = json.ReadUint32(iter) + ms.orig.Flags = iter.ReadUint32() case "name": - dest.orig.Name = iter.ReadString() + ms.orig.Name = iter.ReadString() case "kind": - dest.orig.Kind = otlptrace.Span_SpanKind(json.ReadEnumValue(iter, otlptrace.Span_SpanKind_value)) + ms.orig.Kind = otlptrace.Span_SpanKind(iter.ReadEnumValue(otlptrace.Span_SpanKind_value)) case "startTimeUnixNano", "start_time_unix_nano": - dest.orig.StartTimeUnixNano = json.ReadUint64(iter) + ms.orig.StartTimeUnixNano = iter.ReadUint64() case "endTimeUnixNano", "end_time_unix_nano": - dest.orig.EndTimeUnixNano = json.ReadUint64(iter) + ms.orig.EndTimeUnixNano = iter.ReadUint64() case "attributes": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - dest.orig.Attributes = append(dest.orig.Attributes, json.ReadAttribute(iter)) - return true - }) + internal.UnmarshalJSONIterMap(internal.NewMap(&ms.orig.Attributes, ms.state), iter) case "droppedAttributesCount", "dropped_attributes_count": - dest.orig.DroppedAttributesCount = json.ReadUint32(iter) + ms.orig.DroppedAttributesCount = iter.ReadUint32() case "events": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - dest.Events().AppendEmpty().unmarshalJsoniter(iter) - return true - }) + ms.Events().unmarshalJSONIter(iter) case "droppedEventsCount", "dropped_events_count": - dest.orig.DroppedEventsCount = json.ReadUint32(iter) + ms.orig.DroppedEventsCount = iter.ReadUint32() case "links": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - dest.Links().AppendEmpty().unmarshalJsoniter(iter) - return true - }) + ms.Links().unmarshalJSONIter(iter) case "droppedLinksCount", "dropped_links_count": - dest.orig.DroppedLinksCount = json.ReadUint32(iter) + ms.orig.DroppedLinksCount = iter.ReadUint32() case "status": - dest.Status().unmarshalJsoniter(iter) + ms.Status().unmarshalJSONIter(iter) default: iter.Skip() } @@ -152,13 +113,13 @@ func (dest Span) unmarshalJsoniter(iter *jsoniter.Iterator) { }) } -func (dest Status) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { +func (ms Status) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { switch f { case "message": - dest.orig.Message = iter.ReadString() + ms.orig.Message = iter.ReadString() case "code": - dest.orig.Code = otlptrace.Status_StatusCode(json.ReadEnumValue(iter, otlptrace.Status_StatusCode_value)) + ms.orig.Code = otlptrace.Status_StatusCode(iter.ReadEnumValue(otlptrace.Status_StatusCode_value)) default: iter.Skip() } @@ -166,28 +127,21 @@ func (dest Status) unmarshalJsoniter(iter *jsoniter.Iterator) { }) } -func (dest SpanLink) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { +func (ms SpanLink) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { switch f { case "traceId", "trace_id": - if err := dest.orig.TraceId.UnmarshalJSON([]byte(iter.ReadString())); err != nil { - iter.ReportError("readSpanLink", fmt.Sprintf("parse trace_id:%v", err)) - } + ms.orig.TraceId.UnmarshalJSONIter(iter) case "spanId", "span_id": - if err := dest.orig.SpanId.UnmarshalJSON([]byte(iter.ReadString())); err != nil { - iter.ReportError("readSpanLink", fmt.Sprintf("parse span_id:%v", err)) - } + ms.orig.SpanId.UnmarshalJSONIter(iter) case "traceState", "trace_state": - dest.orig.TraceState = iter.ReadString() + ms.orig.TraceState = iter.ReadString() case "attributes": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - dest.orig.Attributes = append(dest.orig.Attributes, json.ReadAttribute(iter)) - return true - }) + internal.UnmarshalJSONIterMap(internal.NewMap(&ms.orig.Attributes, ms.state), iter) case "droppedAttributesCount", "dropped_attributes_count": - dest.orig.DroppedAttributesCount = json.ReadUint32(iter) + ms.orig.DroppedAttributesCount = iter.ReadUint32() case "flags": - dest.orig.Flags = json.ReadUint32(iter) + ms.orig.Flags = iter.ReadUint32() default: iter.Skip() } @@ -195,20 +149,17 @@ func (dest SpanLink) unmarshalJsoniter(iter *jsoniter.Iterator) { }) } -func (dest SpanEvent) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { +func (ms SpanEvent) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { switch f { case "timeUnixNano", "time_unix_nano": - dest.orig.TimeUnixNano = json.ReadUint64(iter) + ms.orig.TimeUnixNano = iter.ReadUint64() case "name": - dest.orig.Name = iter.ReadString() + ms.orig.Name = iter.ReadString() case "attributes": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - dest.orig.Attributes = append(dest.orig.Attributes, json.ReadAttribute(iter)) - return true - }) + internal.UnmarshalJSONIterMap(internal.NewMap(&ms.orig.Attributes, ms.state), iter) case "droppedAttributesCount", "dropped_attributes_count": - dest.orig.DroppedAttributesCount = json.ReadUint32(iter) + ms.orig.DroppedAttributesCount = iter.ReadUint32() default: iter.Skip() } diff --git a/vendor/go.opentelemetry.io/collector/pdata/ptrace/span_kind.go b/vendor/go.opentelemetry.io/collector/pdata/ptrace/span_kind.go index 561d82cfff..202146fa65 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/ptrace/span_kind.go +++ b/vendor/go.opentelemetry.io/collector/pdata/ptrace/span_kind.go @@ -5,6 +5,7 @@ package ptrace // import "go.opentelemetry.io/collector/pdata/ptrace" import ( otlptrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // SpanKind is the type of span. Can be used to specify additional relationships between spans @@ -52,3 +53,7 @@ func (sk SpanKind) String() string { } return "" } + +func (sk SpanKind) marshalJSONStream(dest *json.Stream) { + dest.WriteInt32(int32(sk)) +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/ptrace/status_code.go b/vendor/go.opentelemetry.io/collector/pdata/ptrace/status_code.go index 18a21f56ba..65519f52f3 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/ptrace/status_code.go +++ b/vendor/go.opentelemetry.io/collector/pdata/ptrace/status_code.go @@ -5,6 +5,7 @@ package ptrace // import "go.opentelemetry.io/collector/pdata/ptrace" import ( otlptrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // StatusCode mirrors the codes defined at @@ -29,3 +30,7 @@ func (sc StatusCode) String() string { } return "" } + +func (sc StatusCode) marshalJSONStream(dest *json.Stream) { + dest.WriteInt32(int32(sc)) +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/ptrace/traces.go b/vendor/go.opentelemetry.io/collector/pdata/ptrace/traces.go index a4b71e1785..629729d7b9 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/ptrace/traces.go +++ b/vendor/go.opentelemetry.io/collector/pdata/ptrace/traces.go @@ -6,6 +6,7 @@ package ptrace // import "go.opentelemetry.io/collector/pdata/ptrace" import ( "go.opentelemetry.io/collector/pdata/internal" otlpcollectortrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/trace/v1" + "go.opentelemetry.io/collector/pdata/internal/json" ) // Traces is the top-level struct that is propagated through the traces pipeline. @@ -63,3 +64,22 @@ func (ms Traces) ResourceSpans() ResourceSpansSlice { func (ms Traces) MarkReadOnly() { internal.SetTracesState(internal.Traces(ms), internal.StateReadOnly) } + +func (ms Traces) marshalJSONStream(dest *json.Stream) { + dest.WriteObjectStart() + dest.WriteObjectField("resourceSpans") + ms.ResourceSpans().marshalJSONStream(dest) + dest.WriteObjectEnd() +} + +func (ms Traces) unmarshalJSONIter(iter *json.Iterator) { + iter.ReadObjectCB(func(iter *json.Iterator, f string) bool { + switch f { + case "resourceSpans", "resource_spans": + ms.ResourceSpans().unmarshalJSONIter(iter) + default: + iter.Skip() + } + return true + }) +} 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 1949c777bf..a841fc7cb9 100644 --- a/vendor/google.golang.org/api/iamcredentials/v1/iamcredentials-api.json +++ b/vendor/google.golang.org/api/iamcredentials/v1/iamcredentials-api.json @@ -16,6 +16,26 @@ "discoveryVersion": "v1", "documentationLink": "https://cloud.google.com/iam/docs/creating-short-lived-service-account-credentials", "endpoints": [ + { + "description": "Regional Endpoint", + "endpointUrl": "https://iamcredentials.asia-east1.rep.googleapis.com/", + "location": "asia-east1" + }, + { + "description": "Regional Endpoint", + "endpointUrl": "https://iamcredentials.europe-west1.rep.googleapis.com/", + "location": "europe-west1" + }, + { + "description": "Regional Endpoint", + "endpointUrl": "https://iamcredentials.us-central1.rep.googleapis.com/", + "location": "us-central1" + }, + { + "description": "Regional Endpoint", + "endpointUrl": "https://iamcredentials.us-east1.rep.googleapis.com/", + "location": "us-east1" + }, { "description": "Regional Endpoint", "endpointUrl": "https://iamcredentials.us-east7.rep.googleapis.com/", @@ -315,7 +335,7 @@ } } }, - "revision": "20250417", + "revision": "20250717", "rootUrl": "https://iamcredentials.googleapis.com/", "schemas": { "GenerateAccessTokenRequest": { diff --git a/vendor/google.golang.org/api/internal/gensupport/resumable.go b/vendor/google.golang.org/api/internal/gensupport/resumable.go index d74fe2a299..143a48923a 100644 --- a/vendor/google.golang.org/api/internal/gensupport/resumable.go +++ b/vendor/google.golang.org/api/internal/gensupport/resumable.go @@ -126,16 +126,21 @@ func (rx *ResumableUpload) reportProgress(old, updated int64) { } } -// transferChunk performs a single HTTP request to upload a single chunk from rx.Media. -func (rx *ResumableUpload) transferChunk(ctx context.Context) (*http.Response, error) { - chunk, off, size, err := rx.Media.Chunk() +// transferChunk performs a single HTTP request to upload a single chunk. +func (rx *ResumableUpload) transferChunk(ctx context.Context, chunk io.Reader, off, size int64, done bool) (*http.Response, error) { + // rCtx is derived from a context with a defined ChunkTransferTimeout with non-zero value. + // If a particular request exceeds this transfer time for getting response, the rCtx deadline will be exceeded, + // triggering a retry of the request. + var rCtx context.Context + var cancel context.CancelFunc - done := err == io.EOF - if !done && err != nil { - return nil, err + rCtx = ctx + if rx.ChunkTransferTimeout != 0 { + rCtx, cancel = context.WithTimeout(ctx, rx.ChunkTransferTimeout) + defer cancel() } - res, err := rx.doUploadRequest(ctx, chunk, off, int64(size), done) + res, err := rx.doUploadRequest(rCtx, chunk, off, size, done) if err != nil { return res, err } @@ -149,16 +154,98 @@ func (rx *ResumableUpload) transferChunk(ctx context.Context) (*http.Response, e if res.StatusCode == http.StatusOK { rx.reportProgress(off, off+int64(size)) } - - if statusResumeIncomplete(res) { - rx.Media.Next() - } return res, nil } +// uploadChunkWithRetries attempts to upload a single chunk, with retries +// within ChunkRetryDeadline if ChunkTransferTimeout is non-zero. +func (rx *ResumableUpload) uploadChunkWithRetries(ctx context.Context, chunk io.Reader, off, size int64, done bool) (*http.Response, error) { + // Configure error retryable criteria. + shouldRetry := rx.Retry.errorFunc() + + // Configure single chunk retry deadline. + retryDeadline := defaultRetryDeadline + if rx.ChunkRetryDeadline != 0 { + retryDeadline = rx.ChunkRetryDeadline + } + + // Each chunk gets its own initialized-at-zero backoff and invocation ID. + bo := rx.Retry.backoff() + quitAfterTimer := time.NewTimer(retryDeadline) + defer quitAfterTimer.Stop() + rx.attempts = 1 + rx.invocationID = uuid.New().String() + + var pause time.Duration + var resp *http.Response + var err error + + // Retry loop for a single chunk. + for { + // Wait for the backoff period, unless the context is canceled or the + // retry deadline is hit. + pauseTimer := time.NewTimer(pause) + select { + case <-ctx.Done(): + pauseTimer.Stop() + if err == nil { + err = ctx.Err() + } + return resp, err + case <-pauseTimer.C: + case <-quitAfterTimer.C: + pauseTimer.Stop() + return resp, err + } + pauseTimer.Stop() + + // Check for context cancellation or timeout once more. If more than one + // case in the select statement above was satisfied at the same time, Go + // will choose one arbitrarily. + // That can cause an operation to go through even if the context was + // canceled before or the timeout was reached. + select { + case <-ctx.Done(): + if err == nil { + err = ctx.Err() + } + return resp, err + case <-quitAfterTimer.C: + return resp, err + default: + } + + // We close the response's body here, since we definitely will not + // return `resp` now. If we close it before the select case above, a + // timer may fire and cause us to return a response with a closed body + // (in which case, the caller will not get the error message in the body). + if resp != nil && resp.Body != nil { + // Read the body to EOF - if the Body is not both read to EOF and closed, + // the Client's underlying RoundTripper may not be able to re-use the + // persistent TCP connection to the server for a subsequent "keep-alive" request. + // See https://pkg.go.dev/net/http#Client.Do + io.Copy(io.Discard, resp.Body) + resp.Body.Close() + } + + resp, err = rx.transferChunk(ctx, chunk, off, size, done) + status := 0 + if resp != nil { + status = resp.StatusCode + } + // Chunk upload should be retried if the ChunkTransferTimeout is non-zero and err is context deadline exceeded + // or we encounter a retryable error. + if (rx.ChunkTransferTimeout != 0 && errors.Is(err, context.DeadlineExceeded)) || shouldRetry(status, err) { + rx.attempts++ + pause = bo.Pause() + chunk, _, _, _ = rx.Media.Chunk() + continue + } + return resp, err + } +} + // Upload starts the process of a resumable upload with a cancellable context. -// It retries using the provided back off strategy until cancelled or the -// strategy indicates to stop retrying. // It is called from the auto-generated API code and is not visible to the user. // Before sending an HTTP request, Upload calls any registered hook functions, // and calls the returned functions after the request returns (see send.go). @@ -166,144 +253,47 @@ func (rx *ResumableUpload) transferChunk(ctx context.Context) (*http.Response, e // Exactly one of resp or err will be nil. If resp is non-nil, the caller must call resp.Body.Close. // Upload does not parse the response into the error on a non 200 response; // it is the caller's responsibility to call resp.Body.Close. -func (rx *ResumableUpload) Upload(ctx context.Context) (resp *http.Response, err error) { +func (rx *ResumableUpload) Upload(ctx context.Context) (*http.Response, error) { + for { + chunk, off, size, err := rx.Media.Chunk() + done := err == io.EOF + if !done && err != nil { + return nil, err + } - // There are a couple of cases where it's possible for err and resp to both - // be non-nil. However, we expose a simpler contract to our callers: exactly - // one of resp and err will be non-nil. This means that any response body - // must be closed here before returning a non-nil error. - var prepareReturn = func(resp *http.Response, err error) (*http.Response, error) { + resp, err := rx.uploadChunkWithRetries(ctx, chunk, off, int64(size), done) + // There are a couple of cases where it's possible for err and resp to both + // be non-nil. However, we expose a simpler contract to our callers: exactly + // one of resp and err will be non-nil. This means that any response body + // must be closed here before returning a non-nil error. if err != nil { if resp != nil && resp.Body != nil { resp.Body.Close() } // If there were retries, indicate this in the error message and wrap the final error. if rx.attempts > 1 { - return nil, fmt.Errorf("chunk upload failed after %d attempts;, final error: %w", rx.attempts, err) + return nil, fmt.Errorf("chunk upload failed after %d attempts, final error: %w", rx.attempts, err) } return nil, err } + // This case is very unlikely but possible only if rx.ChunkRetryDeadline is // set to a very small value, in which case no requests will be sent before // the deadline. Return an error to avoid causing a panic. if resp == nil { - return nil, fmt.Errorf("upload request to %v not sent, choose larger value for ChunkRetryDealine", rx.URI) + return nil, fmt.Errorf("upload request to %v not sent, choose larger value for ChunkRetryDeadline", rx.URI) } - return resp, nil - } - // Configure retryable error criteria. - errorFunc := rx.Retry.errorFunc() - // Configure per-chunk retry deadline. - var retryDeadline time.Duration - if rx.ChunkRetryDeadline != 0 { - retryDeadline = rx.ChunkRetryDeadline - } else { - retryDeadline = defaultRetryDeadline - } - - // Send all chunks. - for { - var pause time.Duration - - // Each chunk gets its own initialized-at-zero backoff and invocation ID. - bo := rx.Retry.backoff() - quitAfterTimer := time.NewTimer(retryDeadline) - rx.attempts = 1 - rx.invocationID = uuid.New().String() - - // Retry loop for a single chunk. - for { - pauseTimer := time.NewTimer(pause) - select { - case <-ctx.Done(): - quitAfterTimer.Stop() - pauseTimer.Stop() - if err == nil { - err = ctx.Err() - } - return prepareReturn(resp, err) - case <-pauseTimer.C: - case <-quitAfterTimer.C: - pauseTimer.Stop() - return prepareReturn(resp, err) - } - pauseTimer.Stop() - - // Check for context cancellation or timeout once more. If more than one - // case in the select statement above was satisfied at the same time, Go - // will choose one arbitrarily. - // That can cause an operation to go through even if the context was - // canceled before or the timeout was reached. - select { - case <-ctx.Done(): - quitAfterTimer.Stop() - if err == nil { - err = ctx.Err() - } - return prepareReturn(resp, err) - case <-quitAfterTimer.C: - return prepareReturn(resp, err) - default: - } - - // rCtx is derived from a context with a defined transferTimeout with non-zero value. - // If a particular request exceeds this transfer time for getting response, the rCtx deadline will be exceeded, - // triggering a retry of the request. - var rCtx context.Context - var cancel context.CancelFunc - - rCtx = ctx - if rx.ChunkTransferTimeout != 0 { - rCtx, cancel = context.WithTimeout(ctx, rx.ChunkTransferTimeout) - } - - // We close the response's body here, since we definitely will not - // return `resp` now. If we close it before the select case above, a - // timer may fire and cause us to return a response with a closed body - // (in which case, the caller will not get the error message in the body). - if resp != nil && resp.Body != nil { - // Read the body to EOF - if the Body is not both read to EOF and closed, - // the Client's underlying RoundTripper may not be able to re-use the - // persistent TCP connection to the server for a subsequent "keep-alive" request. - // See https://pkg.go.dev/net/http#Client.Do + if statusResumeIncomplete(resp) { + // The upload is not yet complete, but the server has acknowledged this chunk. + // We don't have anything to do with the response body. + if resp.Body != nil { io.Copy(io.Discard, resp.Body) resp.Body.Close() } - resp, err = rx.transferChunk(rCtx) - - var status int - if resp != nil { - status = resp.StatusCode - } - - // The upload should be retried if the rCtx is canceled due to a timeout. - select { - case <-rCtx.Done(): - if rx.ChunkTransferTimeout != 0 && errors.Is(rCtx.Err(), context.DeadlineExceeded) { - // Cancel the context for rCtx - cancel() - continue - } - default: - } - - // Check if we should retry the request. - if !errorFunc(status, err) { - quitAfterTimer.Stop() - break - } - - rx.attempts++ - pause = bo.Pause() - } - - // If the chunk was uploaded successfully, but there's still - // more to go, upload the next chunk without any delay. - if statusResumeIncomplete(resp) { + rx.Media.Next() continue } - - return prepareReturn(resp, err) + return resp, nil } } diff --git a/vendor/google.golang.org/api/internal/version.go b/vendor/google.golang.org/api/internal/version.go index f845cc7192..11a0db6e51 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.241.0" +const Version = "0.244.0" 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 8ad0d403bd..251396d495 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": "\"31353834363234393531343533373938353433\"", + "etag": "\"31383438373536343936353833383831333836\"", "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" @@ -4544,7 +4544,7 @@ } } }, - "revision": "20250629", + "revision": "20250718", "rootUrl": "https://storage.googleapis.com/", "schemas": { "AdvanceRelocateBucketOperationRequest": { @@ -4758,9 +4758,78 @@ "encryption": { "description": "Encryption configuration for a bucket.", "properties": { + "customerManagedEncryptionEnforcementConfig": { + "description": "If set, the new objects created in this bucket must comply with this enforcement config. Changing this has no effect on existing objects; it applies to new objects only. If omitted, the new objects are allowed to be encrypted with Customer Managed Encryption type by default.", + "properties": { + "effectiveTime": { + "description": "Server-determined value that indicates the time from which configuration was enforced and effective. This value is in RFC 3339 format.", + "format": "date-time", + "type": "string" + }, + "restrictionMode": { + "description": "Restriction mode for Customer-Managed Encryption Keys. Defaults to NotRestricted.", + "enum": [ + "NotRestricted", + "FullyRestricted" + ], + "enumDescriptions": [ + "Creation of new objects with Customer-Managed Encryption is not restricted.", + "Creation of new objects with Customer-Managed Encryption is fully restricted." + ], + "type": "string" + } + }, + "type": "object" + }, + "customerSuppliedEncryptionEnforcementConfig": { + "description": "If set, the new objects created in this bucket must comply with this enforcement config. Changing this has no effect on existing objects; it applies to new objects only. If omitted, the new objects are allowed to be encrypted with Customer Supplied Encryption type by default.", + "properties": { + "effectiveTime": { + "description": "Server-determined value that indicates the time from which configuration was enforced and effective. This value is in RFC 3339 format.", + "format": "date-time", + "type": "string" + }, + "restrictionMode": { + "description": "Restriction mode for Customer-Supplied Encryption Keys. Defaults to NotRestricted.", + "enum": [ + "NotRestricted", + "FullyRestricted" + ], + "enumDescriptions": [ + "Creation of new objects with Customer-Supplied Encryption is not restricted.", + "Creation of new objects with Customer-Supplied Encryption is fully restricted." + ], + "type": "string" + } + }, + "type": "object" + }, "defaultKmsKeyName": { "description": "A Cloud KMS key that will be used to encrypt objects inserted into this bucket, if no encryption method is specified.", "type": "string" + }, + "googleManagedEncryptionEnforcementConfig": { + "description": "If set, the new objects created in this bucket must comply with this enforcement config. Changing this has no effect on existing objects; it applies to new objects only. If omitted, the new objects are allowed to be encrypted with Google Managed Encryption type by default.", + "properties": { + "effectiveTime": { + "description": "Server-determined value that indicates the time from which configuration was enforced and effective. This value is in RFC 3339 format.", + "format": "date-time", + "type": "string" + }, + "restrictionMode": { + "description": "Restriction mode for Google-Managed Encryption Keys. Defaults to NotRestricted.", + "enum": [ + "NotRestricted", + "FullyRestricted" + ], + "enumDescriptions": [ + "Creation of new objects with Google Managed Encryption is not restricted.", + "Creation of new objects with Google Managed Encryption is fully restricted." + ], + "type": "string" + } + }, + "type": "object" } }, "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 0983dadf4b..0714b7e089 100644 --- a/vendor/google.golang.org/api/storage/v1/storage-gen.go +++ b/vendor/google.golang.org/api/storage/v1/storage-gen.go @@ -709,18 +709,38 @@ func (s BucketCustomPlacementConfig) MarshalJSON() ([]byte, error) { // BucketEncryption: Encryption configuration for a bucket. type BucketEncryption struct { + // CustomerManagedEncryptionEnforcementConfig: If set, the new objects created + // in this bucket must comply with this enforcement config. Changing this has + // no effect on existing objects; it applies to new objects only. If omitted, + // the new objects are allowed to be encrypted with Customer Managed Encryption + // type by default. + CustomerManagedEncryptionEnforcementConfig *BucketEncryptionCustomerManagedEncryptionEnforcementConfig `json:"customerManagedEncryptionEnforcementConfig,omitempty"` + // CustomerSuppliedEncryptionEnforcementConfig: If set, the new objects created + // in this bucket must comply with this enforcement config. Changing this has + // no effect on existing objects; it applies to new objects only. If omitted, + // the new objects are allowed to be encrypted with Customer Supplied + // Encryption type by default. + CustomerSuppliedEncryptionEnforcementConfig *BucketEncryptionCustomerSuppliedEncryptionEnforcementConfig `json:"customerSuppliedEncryptionEnforcementConfig,omitempty"` // DefaultKmsKeyName: A Cloud KMS key that will be used to encrypt objects // inserted into this bucket, if no encryption method is specified. DefaultKmsKeyName string `json:"defaultKmsKeyName,omitempty"` - // ForceSendFields is a list of field names (e.g. "DefaultKmsKeyName") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See + // GoogleManagedEncryptionEnforcementConfig: If set, the new objects created in + // this bucket must comply with this enforcement config. Changing this has no + // effect on existing objects; it applies to new objects only. If omitted, the + // new objects are allowed to be encrypted with Google Managed Encryption type + // by default. + GoogleManagedEncryptionEnforcementConfig *BucketEncryptionGoogleManagedEncryptionEnforcementConfig `json:"googleManagedEncryptionEnforcementConfig,omitempty"` + // ForceSendFields is a list of field names (e.g. + // "CustomerManagedEncryptionEnforcementConfig") to unconditionally include in + // API requests. By default, fields with empty or default values are omitted + // from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DefaultKmsKeyName") to include in - // API requests with the JSON null value. By default, fields with empty values - // are omitted from API requests. See + // NullFields is a list of field names (e.g. + // "CustomerManagedEncryptionEnforcementConfig") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` } @@ -730,6 +750,114 @@ func (s BucketEncryption) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) } +// BucketEncryptionCustomerManagedEncryptionEnforcementConfig: If set, the new +// objects created in this bucket must comply with this enforcement config. +// Changing this has no effect on existing objects; it applies to new objects +// only. If omitted, the new objects are allowed to be encrypted with Customer +// Managed Encryption type by default. +type BucketEncryptionCustomerManagedEncryptionEnforcementConfig struct { + // EffectiveTime: Server-determined value that indicates the time from which + // configuration was enforced and effective. This value is in RFC 3339 format. + EffectiveTime string `json:"effectiveTime,omitempty"` + // RestrictionMode: Restriction mode for Customer-Managed Encryption Keys. + // Defaults to NotRestricted. + // + // Possible values: + // "NotRestricted" - Creation of new objects with Customer-Managed Encryption + // is not restricted. + // "FullyRestricted" - Creation of new objects with Customer-Managed + // Encryption is fully restricted. + RestrictionMode string `json:"restrictionMode,omitempty"` + // ForceSendFields is a list of field names (e.g. "EffectiveTime") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "EffectiveTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s BucketEncryptionCustomerManagedEncryptionEnforcementConfig) MarshalJSON() ([]byte, error) { + type NoMethod BucketEncryptionCustomerManagedEncryptionEnforcementConfig + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// BucketEncryptionCustomerSuppliedEncryptionEnforcementConfig: If set, the new +// objects created in this bucket must comply with this enforcement config. +// Changing this has no effect on existing objects; it applies to new objects +// only. If omitted, the new objects are allowed to be encrypted with Customer +// Supplied Encryption type by default. +type BucketEncryptionCustomerSuppliedEncryptionEnforcementConfig struct { + // EffectiveTime: Server-determined value that indicates the time from which + // configuration was enforced and effective. This value is in RFC 3339 format. + EffectiveTime string `json:"effectiveTime,omitempty"` + // RestrictionMode: Restriction mode for Customer-Supplied Encryption Keys. + // Defaults to NotRestricted. + // + // Possible values: + // "NotRestricted" - Creation of new objects with Customer-Supplied + // Encryption is not restricted. + // "FullyRestricted" - Creation of new objects with Customer-Supplied + // Encryption is fully restricted. + RestrictionMode string `json:"restrictionMode,omitempty"` + // ForceSendFields is a list of field names (e.g. "EffectiveTime") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "EffectiveTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s BucketEncryptionCustomerSuppliedEncryptionEnforcementConfig) MarshalJSON() ([]byte, error) { + type NoMethod BucketEncryptionCustomerSuppliedEncryptionEnforcementConfig + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// BucketEncryptionGoogleManagedEncryptionEnforcementConfig: If set, the new +// objects created in this bucket must comply with this enforcement config. +// Changing this has no effect on existing objects; it applies to new objects +// only. If omitted, the new objects are allowed to be encrypted with Google +// Managed Encryption type by default. +type BucketEncryptionGoogleManagedEncryptionEnforcementConfig struct { + // EffectiveTime: Server-determined value that indicates the time from which + // configuration was enforced and effective. This value is in RFC 3339 format. + EffectiveTime string `json:"effectiveTime,omitempty"` + // RestrictionMode: Restriction mode for Google-Managed Encryption Keys. + // Defaults to NotRestricted. + // + // Possible values: + // "NotRestricted" - Creation of new objects with Google Managed Encryption + // is not restricted. + // "FullyRestricted" - Creation of new objects with Google Managed Encryption + // is fully restricted. + RestrictionMode string `json:"restrictionMode,omitempty"` + // ForceSendFields is a list of field names (e.g. "EffectiveTime") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "EffectiveTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s BucketEncryptionGoogleManagedEncryptionEnforcementConfig) MarshalJSON() ([]byte, error) { + type NoMethod BucketEncryptionGoogleManagedEncryptionEnforcementConfig + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + // BucketHierarchicalNamespace: The bucket's hierarchical namespace // configuration. type BucketHierarchicalNamespace struct { diff --git a/vendor/google.golang.org/grpc/balancer/balancer.go b/vendor/google.golang.org/grpc/balancer/balancer.go index c9b343c715..b1264017db 100644 --- a/vendor/google.golang.org/grpc/balancer/balancer.go +++ b/vendor/google.golang.org/grpc/balancer/balancer.go @@ -360,6 +360,10 @@ type Balancer interface { // call SubConn.Shutdown for its existing SubConns; however, this will be // required in a future release, so it is recommended. Close() + // 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() } // ExitIdler is an optional interface for balancers to implement. If @@ -367,8 +371,8 @@ type Balancer interface { // the ClientConn is idle. If unimplemented, ClientConn.Connect will cause // all SubConns to connect. // -// Notice: it will be required for all balancers to implement this in a future -// release. +// Deprecated: All balancers must implement this interface. This interface will +// be removed in a future release. 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 diff --git a/vendor/google.golang.org/grpc/balancer/endpointsharding/endpointsharding.go b/vendor/google.golang.org/grpc/balancer/endpointsharding/endpointsharding.go index cc606f4dae..0ad6bb1f22 100644 --- a/vendor/google.golang.org/grpc/balancer/endpointsharding/endpointsharding.go +++ b/vendor/google.golang.org/grpc/balancer/endpointsharding/endpointsharding.go @@ -45,7 +45,15 @@ type ChildState struct { // Balancer exposes only the ExitIdler interface of the child LB policy. // Other methods of the child policy are called only by endpointsharding. - Balancer balancer.ExitIdler + 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() } // Options are the options to configure the behaviour of the @@ -205,6 +213,16 @@ func (es *endpointSharding) Close() { } } +func (es *endpointSharding) ExitIdle() { + es.childMu.Lock() + defer es.childMu.Unlock() + for _, bw := range es.children.Load().Values() { + if !bw.isClosed { + bw.child.ExitIdle() + } + } +} + // 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. @@ -326,15 +344,13 @@ func (bw *balancerWrapper) UpdateState(state balancer.State) { // 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() { - if ei, ok := bw.child.(balancer.ExitIdler); ok { - go func() { - bw.es.childMu.Lock() - if !bw.isClosed { - ei.ExitIdle() - } - bw.es.childMu.Unlock() - }() - } + go func() { + bw.es.childMu.Lock() + if !bw.isClosed { + bw.child.ExitIdle() + } + bw.es.childMu.Unlock() + }() } // updateClientConnStateLocked delivers the ClientConnState to the child diff --git a/vendor/google.golang.org/grpc/balancer/grpclb/grpc_lb_v1/load_balancer_grpc.pb.go b/vendor/google.golang.org/grpc/balancer/grpclb/grpc_lb_v1/load_balancer_grpc.pb.go index 84e6a25056..c4ace87b26 100644 --- a/vendor/google.golang.org/grpc/balancer/grpclb/grpc_lb_v1/load_balancer_grpc.pb.go +++ b/vendor/google.golang.org/grpc/balancer/grpclb/grpc_lb_v1/load_balancer_grpc.pb.go @@ -86,7 +86,7 @@ type LoadBalancerServer interface { type UnimplementedLoadBalancerServer struct{} func (UnimplementedLoadBalancerServer) BalanceLoad(grpc.BidiStreamingServer[LoadBalanceRequest, LoadBalanceResponse]) error { - return status.Errorf(codes.Unimplemented, "method BalanceLoad not implemented") + return status.Error(codes.Unimplemented, "method BalanceLoad not implemented") } func (UnimplementedLoadBalancerServer) testEmbeddedByValue() {} diff --git a/vendor/google.golang.org/grpc/balancer/pickfirst/pickfirstleaf/pickfirstleaf.go b/vendor/google.golang.org/grpc/balancer/pickfirst/pickfirstleaf/pickfirstleaf.go index 494314f235..e62047256a 100644 --- a/vendor/google.golang.org/grpc/balancer/pickfirst/pickfirstleaf/pickfirstleaf.go +++ b/vendor/google.golang.org/grpc/balancer/pickfirst/pickfirstleaf/pickfirstleaf.go @@ -54,18 +54,9 @@ func init() { balancer.Register(pickfirstBuilder{}) } -type ( - // enableHealthListenerKeyType is a unique key type used in resolver - // attributes to indicate whether the health listener usage is enabled. - enableHealthListenerKeyType struct{} - // managedByPickfirstKeyType is an attribute key type to inform Outlier - // Detection that the generic health listener is being used. - // TODO: https://github.com/grpc/grpc-go/issues/7915 - Remove this when - // implementing the dualstack design. This is a hack. Once Dualstack is - // completed, outlier detection will stop sending ejection updates through - // the connectivity listener. - managedByPickfirstKeyType struct{} -) +// enableHealthListenerKeyType is a unique key type used in resolver +// attributes to indicate whether the health listener usage is enabled. +type enableHealthListenerKeyType struct{} var ( logger = grpclog.Component("pick-first-leaf-lb") @@ -149,17 +140,6 @@ func EnableHealthListener(state resolver.State) resolver.State { return state } -// IsManagedByPickfirst returns whether an address belongs to a SubConn -// managed by the pickfirst LB policy. -// TODO: https://github.com/grpc/grpc-go/issues/7915 - This is a hack to disable -// outlier_detection via the with connectivity listener when using pick_first. -// Once Dualstack changes are complete, all SubConns will be created by -// pick_first and outlier detection will only use the health listener for -// ejection. This hack can then be removed. -func IsManagedByPickfirst(addr resolver.Address) bool { - return addr.BalancerAttributes.Value(managedByPickfirstKeyType{}) != nil -} - type pfConfig struct { serviceconfig.LoadBalancingConfig `json:"-"` @@ -186,7 +166,6 @@ type scData struct { } func (b *pickfirstBalancer) newSCData(addr resolver.Address) (*scData, error) { - addr.BalancerAttributes = addr.BalancerAttributes.WithValue(managedByPickfirstKeyType{}, true) sd := &scData{ rawConnectivityState: connectivity.Idle, effectiveState: connectivity.Idle, diff --git a/vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go b/vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go index 35da5d1ec9..22045bf394 100644 --- a/vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go +++ b/vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go @@ -70,10 +70,3 @@ func (b *rrBalancer) UpdateClientConnState(ccs balancer.ClientConnState) error { ResolverState: pickfirstleaf.EnableHealthListener(ccs.ResolverState), }) } - -func (b *rrBalancer) ExitIdle() { - // Should always be ok, as child is endpoint sharding. - if ei, ok := b.Balancer.(balancer.ExitIdler); ok { - ei.ExitIdle() - } -} diff --git a/vendor/google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp/handshaker_grpc.pb.go b/vendor/google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp/handshaker_grpc.pb.go index 34443b1d2d..21cb01be66 100644 --- a/vendor/google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp/handshaker_grpc.pb.go +++ b/vendor/google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp/handshaker_grpc.pb.go @@ -95,7 +95,7 @@ type HandshakerServiceServer interface { type UnimplementedHandshakerServiceServer struct{} func (UnimplementedHandshakerServiceServer) DoHandshake(grpc.BidiStreamingServer[HandshakerReq, HandshakerResp]) error { - return status.Errorf(codes.Unimplemented, "method DoHandshake not implemented") + return status.Error(codes.Unimplemented, "method DoHandshake not implemented") } func (UnimplementedHandshakerServiceServer) mustEmbedUnimplementedHandshakerServiceServer() {} func (UnimplementedHandshakerServiceServer) testEmbeddedByValue() {} diff --git a/vendor/google.golang.org/grpc/dialoptions.go b/vendor/google.golang.org/grpc/dialoptions.go index 050ba0f161..ec0ca89ccd 100644 --- a/vendor/google.golang.org/grpc/dialoptions.go +++ b/vendor/google.golang.org/grpc/dialoptions.go @@ -213,6 +213,7 @@ func WithReadBufferSize(s int) DialOption { func WithInitialWindowSize(s int32) DialOption { return newFuncDialOption(func(o *dialOptions) { o.copts.InitialWindowSize = s + o.copts.StaticWindowSize = true }) } @@ -222,6 +223,26 @@ func WithInitialWindowSize(s int32) DialOption { func WithInitialConnWindowSize(s int32) DialOption { return newFuncDialOption(func(o *dialOptions) { o.copts.InitialConnWindowSize = s + o.copts.StaticWindowSize = true + }) +} + +// WithStaticStreamWindowSize returns a DialOption which sets the initial +// stream window size to the value provided and disables dynamic flow control. +func WithStaticStreamWindowSize(s int32) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.copts.InitialWindowSize = s + o.copts.StaticWindowSize = true + }) +} + +// WithStaticConnWindowSize returns a DialOption which sets the initial +// connection window size to the value provided and disables dynamic flow +// control. +func WithStaticConnWindowSize(s int32) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.copts.InitialConnWindowSize = s + o.copts.StaticWindowSize = true }) } diff --git a/vendor/google.golang.org/grpc/internal/balancer/gracefulswitch/gracefulswitch.go b/vendor/google.golang.org/grpc/internal/balancer/gracefulswitch/gracefulswitch.go index fbc1ca356a..ba25b89887 100644 --- a/vendor/google.golang.org/grpc/internal/balancer/gracefulswitch/gracefulswitch.go +++ b/vendor/google.golang.org/grpc/internal/balancer/gracefulswitch/gracefulswitch.go @@ -223,15 +223,7 @@ func (gsb *Balancer) ExitIdle() { // There is no need to protect this read with a mutex, as the write to the // Balancer field happens in SwitchTo, which completes before this can be // called. - if ei, ok := balToUpdate.Balancer.(balancer.ExitIdler); ok { - ei.ExitIdle() - return - } - gsb.mu.Lock() - defer gsb.mu.Unlock() - for sc := range balToUpdate.subconns { - sc.Connect() - } + balToUpdate.ExitIdle() } // updateSubConnState forwards the update to the appropriate child. diff --git a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go index f5f2bdeb86..2fdaed88db 100644 --- a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go +++ b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go @@ -33,10 +33,6 @@ var ( // "GRPC_RING_HASH_CAP". This does not override the default bounds // checking which NACKs configs specifying ring sizes > 8*1024*1024 (~8M). RingHashCap = uint64FromEnv("GRPC_RING_HASH_CAP", 4096, 1, 8*1024*1024) - // LeastRequestLB is set if we should support the least_request_experimental - // LB policy, which can be enabled by setting the environment variable - // "GRPC_EXPERIMENTAL_ENABLE_LEAST_REQUEST" to "true". - LeastRequestLB = boolFromEnv("GRPC_EXPERIMENTAL_ENABLE_LEAST_REQUEST", true) // ALTSMaxConcurrentHandshakes is the maximum number of concurrent ALTS // handshakes that can be performed. ALTSMaxConcurrentHandshakes = uint64FromEnv("GRPC_ALTS_MAX_CONCURRENT_HANDSHAKES", 100, 1, 100) diff --git a/vendor/google.golang.org/grpc/internal/transport/controlbuf.go b/vendor/google.golang.org/grpc/internal/transport/controlbuf.go index ef72fbb3a0..a2831e5d01 100644 --- a/vendor/google.golang.org/grpc/internal/transport/controlbuf.go +++ b/vendor/google.golang.org/grpc/internal/transport/controlbuf.go @@ -40,6 +40,13 @@ var updateHeaderTblSize = func(e *hpack.Encoder, v uint32) { e.SetMaxDynamicTableSizeLimit(v) } +// itemNodePool is used to reduce heap allocations. +var itemNodePool = sync.Pool{ + New: func() any { + return &itemNode{} + }, +} + type itemNode struct { it any next *itemNode @@ -51,7 +58,9 @@ type itemList struct { } func (il *itemList) enqueue(i any) { - n := &itemNode{it: i} + n := itemNodePool.Get().(*itemNode) + n.next = nil + n.it = i if il.tail == nil { il.head, il.tail = n, n return @@ -71,7 +80,9 @@ func (il *itemList) dequeue() any { return nil } i := il.head.it + temp := il.head il.head = il.head.next + itemNodePool.Put(temp) if il.head == nil { il.tail = nil } @@ -146,10 +157,11 @@ type earlyAbortStream struct { func (*earlyAbortStream) isTransportResponseFrame() bool { return false } type dataFrame struct { - streamID uint32 - endStream bool - h []byte - reader mem.Reader + streamID uint32 + endStream bool + h []byte + data mem.BufferSlice + processing bool // onEachWrite is called every time // a part of data is written out. onEachWrite func() @@ -234,6 +246,7 @@ type outStream struct { itl *itemList bytesOutStanding int wq *writeQuota + reader mem.Reader next *outStream prev *outStream @@ -461,7 +474,9 @@ func (c *controlBuffer) finish() { v.onOrphaned(ErrConnClosing) } case *dataFrame: - _ = v.reader.Close() + if !v.processing { + v.data.Free() + } } } @@ -650,10 +665,11 @@ func (l *loopyWriter) incomingSettingsHandler(s *incomingSettings) error { func (l *loopyWriter) registerStreamHandler(h *registerStream) { str := &outStream{ - id: h.streamID, - state: empty, - itl: &itemList{}, - wq: h.wq, + id: h.streamID, + state: empty, + itl: &itemList{}, + wq: h.wq, + reader: mem.BufferSlice{}.Reader(), } l.estdStreams[h.streamID] = str } @@ -685,10 +701,11 @@ func (l *loopyWriter) headerHandler(h *headerFrame) error { } // Case 2: Client wants to originate stream. str := &outStream{ - id: h.streamID, - state: empty, - itl: &itemList{}, - wq: h.wq, + id: h.streamID, + state: empty, + itl: &itemList{}, + wq: h.wq, + reader: mem.BufferSlice{}.Reader(), } return l.originateStream(str, h) } @@ -790,10 +807,13 @@ func (l *loopyWriter) cleanupStreamHandler(c *cleanupStream) error { // a RST_STREAM before stream initialization thus the stream might // not be established yet. delete(l.estdStreams, c.streamID) + str.reader.Close() str.deleteSelf() for head := str.itl.dequeueAll(); head != nil; head = head.next { if df, ok := head.it.(*dataFrame); ok { - _ = df.reader.Close() + if !df.processing { + df.data.Free() + } } } } @@ -928,7 +948,13 @@ func (l *loopyWriter) processData() (bool, error) { if str == nil { return true, nil } + reader := str.reader dataItem := str.itl.peek().(*dataFrame) // Peek at the first data item this stream. + if !dataItem.processing { + dataItem.processing = true + str.reader.Reset(dataItem.data) + dataItem.data.Free() + } // A data item is represented by a dataFrame, since it later translates into // multiple HTTP2 data frames. // Every dataFrame has two buffers; h that keeps grpc-message header and data @@ -936,13 +962,13 @@ func (l *loopyWriter) processData() (bool, error) { // from data is copied to h to make as big as the maximum possible HTTP2 frame // size. - if len(dataItem.h) == 0 && dataItem.reader.Remaining() == 0 { // Empty data frame + if len(dataItem.h) == 0 && reader.Remaining() == 0 { // Empty data frame // Client sends out empty data frame with endStream = true if err := l.framer.fr.WriteData(dataItem.streamID, dataItem.endStream, nil); err != nil { return false, err } str.itl.dequeue() // remove the empty data item from stream - _ = dataItem.reader.Close() + _ = reader.Close() if str.itl.isEmpty() { str.state = empty } else if trailer, ok := str.itl.peek().(*headerFrame); ok { // the next item is trailers. @@ -971,8 +997,8 @@ func (l *loopyWriter) processData() (bool, error) { } // Compute how much of the header and data we can send within quota and max frame length hSize := min(maxSize, len(dataItem.h)) - dSize := min(maxSize-hSize, dataItem.reader.Remaining()) - remainingBytes := len(dataItem.h) + dataItem.reader.Remaining() - hSize - dSize + dSize := min(maxSize-hSize, reader.Remaining()) + remainingBytes := len(dataItem.h) + reader.Remaining() - hSize - dSize size := hSize + dSize var buf *[]byte @@ -993,7 +1019,7 @@ func (l *loopyWriter) processData() (bool, error) { defer pool.Put(buf) copy((*buf)[:hSize], dataItem.h) - _, _ = dataItem.reader.Read((*buf)[hSize:]) + _, _ = reader.Read((*buf)[hSize:]) } // Now that outgoing flow controls are checked we can replenish str's write quota @@ -1014,7 +1040,7 @@ func (l *loopyWriter) processData() (bool, error) { dataItem.h = dataItem.h[hSize:] if remainingBytes == 0 { // All the data from that message was written out. - _ = dataItem.reader.Close() + _ = reader.Close() str.itl.dequeue() } if str.itl.isEmpty() { 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 ef56592b94..5467fe9715 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_client.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_client.go @@ -309,11 +309,9 @@ func NewHTTP2Client(connectCtx, ctx context.Context, addr resolver.Address, opts scheme = "https" } } - dynamicWindow := true icwz := int32(initialWindowSize) if opts.InitialConnWindowSize >= defaultWindowSize { icwz = opts.InitialConnWindowSize - dynamicWindow = false } writeBufSize := opts.WriteBufferSize readBufSize := opts.ReadBufferSize @@ -381,9 +379,8 @@ func NewHTTP2Client(connectCtx, ctx context.Context, addr resolver.Address, opts t.controlBuf = newControlBuffer(t.ctxDone) if opts.InitialWindowSize >= defaultWindowSize { t.initialWindowSize = opts.InitialWindowSize - dynamicWindow = false } - if dynamicWindow { + if !opts.StaticWindowSize { t.bdpEst = &bdpEstimator{ bdp: initialWindowSize, updateFlowControl: t.updateFlowControl, @@ -1091,32 +1088,29 @@ func (t *http2Client) GracefulClose() { // Write formats the data into HTTP2 data frame(s) and sends it out. The caller // should proceed only if Write returns nil. func (t *http2Client) write(s *ClientStream, hdr []byte, data mem.BufferSlice, opts *WriteOptions) error { - reader := data.Reader() - if opts.Last { // If it's the last message, update stream state. if !s.compareAndSwapState(streamActive, streamWriteDone) { - _ = reader.Close() return errStreamDone } } else if s.getState() != streamActive { - _ = reader.Close() return errStreamDone } df := &dataFrame{ streamID: s.id, endStream: opts.Last, h: hdr, - reader: reader, + data: data, } - if hdr != nil || df.reader.Remaining() != 0 { // If it's not an empty data frame, check quota. - if err := s.wq.get(int32(len(hdr) + df.reader.Remaining())); err != nil { - _ = reader.Close() + dataLen := data.Len() + if hdr != nil || dataLen != 0 { // If it's not an empty data frame, check quota. + if err := s.wq.get(int32(len(hdr) + dataLen)); err != nil { return err } } + data.Ref() if err := t.controlBuf.put(df); err != nil { - _ = reader.Close() + data.Free() return err } t.incrMsgSent() 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 e4c3731bdb..9f725e15a8 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_server.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_server.go @@ -132,6 +132,10 @@ type http2Server struct { maxStreamID uint32 // max stream ID ever seen logger *grpclog.PrefixLogger + // setResetPingStrikes is stored as a closure instead of making this a + // method on http2Server to avoid a heap allocation when converting a method + // to a closure for passing to frames objects. + setResetPingStrikes func() } // NewServerTransport creates a http2 transport with conn and configuration @@ -176,16 +180,13 @@ func NewServerTransport(conn net.Conn, config *ServerConfig) (_ ServerTransport, Val: config.MaxStreams, }) } - dynamicWindow := true iwz := int32(initialWindowSize) if config.InitialWindowSize >= defaultWindowSize { iwz = config.InitialWindowSize - dynamicWindow = false } icwz := int32(initialWindowSize) if config.InitialConnWindowSize >= defaultWindowSize { icwz = config.InitialConnWindowSize - dynamicWindow = false } if iwz != defaultWindowSize { isettings = append(isettings, http2.Setting{ @@ -266,6 +267,9 @@ func NewServerTransport(conn net.Conn, config *ServerConfig) (_ ServerTransport, initialWindowSize: iwz, bufferPool: config.BufferPool, } + t.setResetPingStrikes = func() { + atomic.StoreUint32(&t.resetPingStrikes, 1) + } var czSecurity credentials.ChannelzSecurityValue if au, ok := authInfo.(credentials.ChannelzSecurityInfo); ok { czSecurity = au.GetSecurityValue() @@ -285,7 +289,7 @@ func NewServerTransport(conn net.Conn, config *ServerConfig) (_ ServerTransport, t.logger = prefixLoggerForServerTransport(t) t.controlBuf = newControlBuffer(t.done) - if dynamicWindow { + if !config.StaticWindowSize { t.bdpEst = &bdpEstimator{ bdp: initialWindowSize, updateFlowControl: t.updateFlowControl, @@ -596,10 +600,25 @@ func (t *http2Server) operateHeaders(ctx context.Context, frame *http2.MetaHeade return nil } } + + if s.ctx.Err() != nil { + t.mu.Unlock() + // Early abort in case the timeout was zero or so low it already fired. + t.controlBuf.put(&earlyAbortStream{ + httpStatus: http.StatusOK, + streamID: s.id, + contentSubtype: s.contentSubtype, + status: status.New(codes.DeadlineExceeded, context.DeadlineExceeded.Error()), + rst: !frame.StreamEnded(), + }) + return nil + } + t.activeStreams[streamID] = s if len(t.activeStreams) == 1 { t.idle = time.Time{} } + // Start a timer to close the stream on reaching the deadline. if timeoutSet { // We need to wait for s.cancel to be updated before calling @@ -1016,10 +1035,6 @@ func (t *http2Server) writeHeader(s *ServerStream, md metadata.MD) error { return nil } -func (t *http2Server) setResetPingStrikes() { - atomic.StoreUint32(&t.resetPingStrikes, 1) -} - func (t *http2Server) writeHeaderLocked(s *ServerStream) error { // 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. @@ -1132,17 +1147,13 @@ func (t *http2Server) writeStatus(s *ServerStream, st *status.Status) error { // Write converts the data into HTTP2 data frame and sends it out. Non-nil error // is returns if it fails (e.g., framing error, transport error). func (t *http2Server) write(s *ServerStream, hdr []byte, data mem.BufferSlice, _ *WriteOptions) error { - reader := data.Reader() - if !s.isHeaderSent() { // Headers haven't been written yet. if err := t.writeHeader(s, nil); err != nil { - _ = reader.Close() return err } } else { // Writing headers checks for this condition. if s.getState() == streamDone { - _ = reader.Close() return t.streamContextErr(s) } } @@ -1150,15 +1161,16 @@ func (t *http2Server) write(s *ServerStream, hdr []byte, data mem.BufferSlice, _ df := &dataFrame{ streamID: s.id, h: hdr, - reader: reader, + data: data, onEachWrite: t.setResetPingStrikes, } - if err := s.wq.get(int32(len(hdr) + df.reader.Remaining())); err != nil { - _ = reader.Close() + dataLen := data.Len() + if err := s.wq.get(int32(len(hdr) + dataLen)); err != nil { return t.streamContextErr(s) } + data.Ref() if err := t.controlBuf.put(df); err != nil { - _ = reader.Close() + data.Free() return err } t.incrMsgSent() 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 607d2c4cee..e3663f87f3 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http_util.go +++ b/vendor/google.golang.org/grpc/internal/transport/http_util.go @@ -200,9 +200,6 @@ func decodeTimeout(s string) (time.Duration, error) { if err != nil { return 0, err } - if t == 0 { - return 0, fmt.Errorf("transport: timeout must be positive: %q", s) - } const maxHours = math.MaxInt64 / uint64(time.Hour) if d == time.Hour && t > maxHours { // This timeout would overflow math.MaxInt64; clamp it. diff --git a/vendor/google.golang.org/grpc/internal/transport/transport.go b/vendor/google.golang.org/grpc/internal/transport/transport.go index 1730a639f9..7dd53e80a7 100644 --- a/vendor/google.golang.org/grpc/internal/transport/transport.go +++ b/vendor/google.golang.org/grpc/internal/transport/transport.go @@ -466,6 +466,7 @@ type ServerConfig struct { MaxHeaderListSize *uint32 HeaderTableSize *uint32 BufferPool mem.BufferPool + StaticWindowSize bool } // ConnectOptions covers all relevant options for communicating with the server. @@ -504,6 +505,8 @@ type ConnectOptions struct { MaxHeaderListSize *uint32 // The mem.BufferPool to use when reading/writing to the wire. BufferPool mem.BufferPool + // StaticWindowSize controls whether dynamic window sizing is enabled. + StaticWindowSize bool } // WriteOptions provides additional hints and information for message diff --git a/vendor/google.golang.org/grpc/mem/buffer_slice.go b/vendor/google.golang.org/grpc/mem/buffer_slice.go index 65002e2cc8..af510d20c5 100644 --- a/vendor/google.golang.org/grpc/mem/buffer_slice.go +++ b/vendor/google.golang.org/grpc/mem/buffer_slice.go @@ -137,6 +137,9 @@ type Reader interface { Close() error // Remaining returns the number of unread bytes remaining in the slice. Remaining() int + // Reset frees the currently held buffer slice and starts reading from the + // provided slice. This allows reusing the reader object. + Reset(s BufferSlice) } type sliceReader struct { @@ -150,6 +153,14 @@ func (r *sliceReader) Remaining() int { return r.len } +func (r *sliceReader) Reset(s BufferSlice) { + r.data.Free() + s.Ref() + r.data = s + r.len = s.Len() + r.bufferIdx = 0 +} + func (r *sliceReader) Close() error { r.data.Free() r.data = nil diff --git a/vendor/google.golang.org/grpc/server.go b/vendor/google.golang.org/grpc/server.go index 976e70ae06..70fe23f550 100644 --- a/vendor/google.golang.org/grpc/server.go +++ b/vendor/google.golang.org/grpc/server.go @@ -179,6 +179,7 @@ type serverOptions struct { numServerWorkers uint32 bufferPool mem.BufferPool waitForHandlers bool + staticWindowSize bool } var defaultServerOptions = serverOptions{ @@ -279,6 +280,7 @@ func ReadBufferSize(s int) ServerOption { func InitialWindowSize(s int32) ServerOption { return newFuncServerOption(func(o *serverOptions) { o.initialWindowSize = s + o.staticWindowSize = true }) } @@ -287,6 +289,29 @@ func InitialWindowSize(s int32) ServerOption { func InitialConnWindowSize(s int32) ServerOption { return newFuncServerOption(func(o *serverOptions) { o.initialConnWindowSize = s + o.staticWindowSize = true + }) +} + +// StaticStreamWindowSize returns a ServerOption to set the initial stream +// window size to the value provided and disables dynamic flow control. +// The lower bound for window size is 64K and any value smaller than that +// will be ignored. +func StaticStreamWindowSize(s int32) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + o.initialWindowSize = s + o.staticWindowSize = true + }) +} + +// StaticConnWindowSize returns a ServerOption to set the initial connection +// window size to the value provided and disables dynamic flow control. +// The lower bound for window size is 64K and any value smaller than that +// will be ignored. +func StaticConnWindowSize(s int32) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + o.initialConnWindowSize = s + o.staticWindowSize = true }) } @@ -986,6 +1011,7 @@ func (s *Server) newHTTP2Transport(c net.Conn) transport.ServerTransport { MaxHeaderListSize: s.opts.maxHeaderListSize, HeaderTableSize: s.opts.headerTableSize, BufferPool: s.opts.bufferPool, + StaticWindowSize: s.opts.staticWindowSize, } st, err := transport.NewServerTransport(c, config) if err != nil { diff --git a/vendor/google.golang.org/grpc/stream.go b/vendor/google.golang.org/grpc/stream.go index d58bb6471a..ca6948926f 100644 --- a/vendor/google.golang.org/grpc/stream.go +++ b/vendor/google.golang.org/grpc/stream.go @@ -1171,7 +1171,7 @@ func (a *csAttempt) recvMsg(m any, payInfo *payloadInfo) (err error) { } else if err != nil { return toRPCErr(err) } - return toRPCErr(errors.New("grpc: client streaming protocol violation: get , want ")) + return status.Errorf(codes.Internal, "cardinality violation: expected for non server-streaming RPCs, but received another message") } func (a *csAttempt) finish(err error) { @@ -1495,7 +1495,7 @@ func (as *addrConnStream) RecvMsg(m any) (err error) { } else if err != nil { return toRPCErr(err) } - return toRPCErr(errors.New("grpc: client streaming protocol violation: get , want ")) + return status.Errorf(codes.Internal, "cardinality violation: expected for non server-streaming RPCs, but received another message") } func (as *addrConnStream) finish(err error) { diff --git a/vendor/google.golang.org/grpc/version.go b/vendor/google.golang.org/grpc/version.go index bd82673dc9..8b0e5f973d 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.73.0" +const Version = "1.74.2" diff --git a/vendor/modules.txt b/vendor/modules.txt index 48ea3cf9da..d93241ea97 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,10 +1,10 @@ -# cloud.google.com/go v0.121.3 +# cloud.google.com/go v0.121.4 ## explicit; go 1.23.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.16.2 +# cloud.google.com/go/auth v0.16.3 ## explicit; go 1.23.0 cloud.google.com/go/auth cloud.google.com/go/auth/credentials @@ -31,13 +31,13 @@ cloud.google.com/go/compute/metadata ## explicit; go 1.23.0 cloud.google.com/go/iam cloud.google.com/go/iam/apiv1/iampb -# cloud.google.com/go/storage v1.55.0 => cloud.google.com/go/storage v1.43.0 +# cloud.google.com/go/storage v1.56.0 => cloud.google.com/go/storage v1.43.0 ## explicit; go 1.20 cloud.google.com/go/storage cloud.google.com/go/storage/internal cloud.google.com/go/storage/internal/apiv2 cloud.google.com/go/storage/internal/apiv2/storagepb -# github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.1 +# github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.2 ## explicit; go 1.23.0 github.com/Azure/azure-sdk-for-go/sdk/azcore github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource @@ -63,7 +63,7 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing ## explicit; go 1.23.0 github.com/Azure/azure-sdk-for-go/sdk/azidentity github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal -# github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 +# github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 ## explicit; go 1.23.0 github.com/Azure/azure-sdk-for-go/sdk/internal/diag github.com/Azure/azure-sdk-for-go/sdk/internal/errorinfo @@ -72,7 +72,7 @@ github.com/Azure/azure-sdk-for-go/sdk/internal/log github.com/Azure/azure-sdk-for-go/sdk/internal/poller github.com/Azure/azure-sdk-for-go/sdk/internal/temporal github.com/Azure/azure-sdk-for-go/sdk/internal/uuid -# github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.1 +# github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.2 ## explicit; go 1.23.0 github.com/Azure/azure-sdk-for-go/sdk/storage/azblob github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/appendblob @@ -134,7 +134,7 @@ github.com/VividCortex/ewma # github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b ## explicit; go 1.15 github.com/alecthomas/units -# github.com/aws/aws-sdk-go-v2 v1.36.5 => github.com/aws/aws-sdk-go-v2 v1.32.8 +# github.com/aws/aws-sdk-go-v2 v1.37.1 => github.com/aws/aws-sdk-go-v2 v1.32.8 ## explicit; go 1.21 github.com/aws/aws-sdk-go-v2/aws github.com/aws/aws-sdk-go-v2/aws/arn @@ -162,14 +162,14 @@ 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/aws/protocol/eventstream v1.6.11 +# github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.0 ## explicit; go 1.22 github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi -# github.com/aws/aws-sdk-go-v2/config v1.29.17 => github.com/aws/aws-sdk-go-v2/config v1.28.11 +# github.com/aws/aws-sdk-go-v2/config v1.30.2 => github.com/aws/aws-sdk-go-v2/config v1.28.11 ## explicit; go 1.21 github.com/aws/aws-sdk-go-v2/config -# github.com/aws/aws-sdk-go-v2/credentials v1.17.70 => github.com/aws/aws-sdk-go-v2/credentials v1.17.52 +# github.com/aws/aws-sdk-go-v2/credentials v1.18.2 => github.com/aws/aws-sdk-go-v2/credentials v1.17.52 ## explicit; go 1.21 github.com/aws/aws-sdk-go-v2/credentials github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds @@ -178,64 +178,64 @@ github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client 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.16.32 +# github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.1 ## explicit; go 1.22 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/feature/s3/manager v1.17.83 => github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.48 +# github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.18.2 => github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.48 ## explicit; go 1.21 github.com/aws/aws-sdk-go-v2/feature/s3/manager -# github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.36 +# github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.1 ## explicit; go 1.22 github.com/aws/aws-sdk-go-v2/internal/configsources -# github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.36 +# github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.1 ## explicit; go 1.22 github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 # github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 ## explicit; go 1.22 github.com/aws/aws-sdk-go-v2/internal/ini -# github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.36 +# github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.1 ## explicit; go 1.22 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/internal/accept-encoding v1.12.4 +# github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.0 ## explicit; go 1.22 github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding -# github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.7.4 => github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.8 +# github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.1 => github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.8 ## explicit; go 1.21 github.com/aws/aws-sdk-go-v2/service/internal/checksum -# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.17 +# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.1 ## explicit; go 1.22 github.com/aws/aws-sdk-go-v2/service/internal/presigned-url -# github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.17 +# github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.1 ## explicit; go 1.22 github.com/aws/aws-sdk-go-v2/service/internal/s3shared github.com/aws/aws-sdk-go-v2/service/internal/s3shared/arn github.com/aws/aws-sdk-go-v2/service/internal/s3shared/config -# github.com/aws/aws-sdk-go-v2/service/s3 v1.83.0 => github.com/aws/aws-sdk-go-v2/service/s3 v1.72.3 +# github.com/aws/aws-sdk-go-v2/service/s3 v1.85.1 => github.com/aws/aws-sdk-go-v2/service/s3 v1.72.3 ## explicit; go 1.21 github.com/aws/aws-sdk-go-v2/service/s3 github.com/aws/aws-sdk-go-v2/service/s3/internal/arn github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations github.com/aws/aws-sdk-go-v2/service/s3/internal/endpoints github.com/aws/aws-sdk-go-v2/service/s3/types -# github.com/aws/aws-sdk-go-v2/service/sso v1.25.5 => github.com/aws/aws-sdk-go-v2/service/sso v1.24.9 +# github.com/aws/aws-sdk-go-v2/service/sso v1.26.1 => github.com/aws/aws-sdk-go-v2/service/sso v1.24.9 ## explicit; go 1.21 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.30.3 => github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.8 +# github.com/aws/aws-sdk-go-v2/service/ssooidc v1.31.1 => github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.8 ## explicit; go 1.21 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.34.0 => github.com/aws/aws-sdk-go-v2/service/sts v1.33.7 +# github.com/aws/aws-sdk-go-v2/service/sts v1.35.1 => github.com/aws/aws-sdk-go-v2/service/sts v1.33.7 ## explicit; go 1.21 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.22.4 +# github.com/aws/smithy-go v1.22.5 ## explicit; go 1.22 github.com/aws/smithy-go github.com/aws/smithy-go/auth @@ -270,7 +270,7 @@ github.com/bboreham/go-loser # github.com/beorn7/perks v1.0.1 ## explicit; go 1.11 github.com/beorn7/perks/quantile -# github.com/bmatcuk/doublestar/v4 v4.9.0 +# github.com/bmatcuk/doublestar/v4 v4.9.1 ## explicit; go 1.16 github.com/bmatcuk/doublestar/v4 # github.com/cespare/xxhash/v2 v2.3.0 @@ -302,7 +302,7 @@ github.com/go-logr/logr/funcr # github.com/go-logr/stdr v1.2.2 ## explicit; go 1.16 github.com/go-logr/stdr -# github.com/go-viper/mapstructure/v2 v2.3.0 +# github.com/go-viper/mapstructure/v2 v2.4.0 ## explicit; go 1.18 github.com/go-viper/mapstructure/v2 github.com/go-viper/mapstructure/v2/internal/errors @@ -319,13 +319,12 @@ github.com/gobwas/glob/util/strings # github.com/gogo/protobuf v1.3.2 ## explicit; go 1.15 github.com/gogo/protobuf/gogoproto -github.com/gogo/protobuf/jsonpb github.com/gogo/protobuf/proto github.com/gogo/protobuf/protoc-gen-gogo/descriptor github.com/gogo/protobuf/sortkeys github.com/gogo/protobuf/types -# github.com/golang-jwt/jwt/v5 v5.2.2 -## explicit; go 1.18 +# github.com/golang-jwt/jwt/v5 v5.3.0 +## explicit; go 1.21 github.com/golang-jwt/jwt/v5 # github.com/golang/snappy v1.0.0 ## explicit @@ -444,7 +443,7 @@ github.com/mitchellh/reflectwalk # github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd ## explicit github.com/modern-go/concurrent -# github.com/modern-go/reflect2 v1.0.2 +# github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee ## explicit; go 1.12 github.com/modern-go/reflect2 # github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 @@ -456,13 +455,13 @@ github.com/mwitkow/go-conntrack # github.com/oklog/ulid/v2 v2.1.1 ## explicit; go 1.15 github.com/oklog/ulid/v2 -# github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics v0.130.0 +# github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics v0.131.0 ## explicit; go 1.23.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics/identity -# github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.130.0 +# github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.131.0 ## explicit; go 1.23.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil -# github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor v0.130.0 +# github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor v0.131.0 ## explicit; go 1.23.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor/internal/data @@ -479,8 +478,8 @@ github.com/pkg/browser # github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 ## explicit github.com/pmezard/go-difflib/difflib -# github.com/prometheus/client_golang v1.22.0 -## explicit; go 1.22 +# github.com/prometheus/client_golang v1.23.0 +## explicit; go 1.23.0 github.com/prometheus/client_golang/prometheus github.com/prometheus/client_golang/prometheus/internal github.com/prometheus/client_golang/prometheus/promauto @@ -596,29 +595,29 @@ github.com/xrash/smetrics ## explicit; go 1.22.0 go.opentelemetry.io/auto/sdk go.opentelemetry.io/auto/sdk/internal/telemetry -# go.opentelemetry.io/collector/component v1.36.0 +# go.opentelemetry.io/collector/component v1.37.0 ## explicit; go 1.23.0 go.opentelemetry.io/collector/component -# go.opentelemetry.io/collector/confmap v1.36.0 +# go.opentelemetry.io/collector/confmap v1.37.0 ## explicit; go 1.23.0 go.opentelemetry.io/collector/confmap go.opentelemetry.io/collector/confmap/internal/mapstructure go.opentelemetry.io/collector/confmap/internal/third_party/composehook -# go.opentelemetry.io/collector/confmap/xconfmap v0.130.0 +# go.opentelemetry.io/collector/confmap/xconfmap v0.131.0 ## explicit; go 1.23.0 go.opentelemetry.io/collector/confmap/xconfmap -# go.opentelemetry.io/collector/consumer v1.36.0 +# go.opentelemetry.io/collector/consumer v1.37.0 ## explicit; go 1.23.0 go.opentelemetry.io/collector/consumer go.opentelemetry.io/collector/consumer/internal -# go.opentelemetry.io/collector/featuregate v1.36.0 +# go.opentelemetry.io/collector/featuregate v1.37.0 ## explicit; go 1.23.0 go.opentelemetry.io/collector/featuregate -# go.opentelemetry.io/collector/internal/telemetry v0.130.0 +# go.opentelemetry.io/collector/internal/telemetry v0.131.0 ## explicit; go 1.23.0 go.opentelemetry.io/collector/internal/telemetry go.opentelemetry.io/collector/internal/telemetry/componentattribute -# go.opentelemetry.io/collector/pdata v1.36.0 +# go.opentelemetry.io/collector/pdata v1.37.0 ## explicit; go 1.23.0 go.opentelemetry.io/collector/pdata/internal go.opentelemetry.io/collector/pdata/internal/data @@ -639,11 +638,11 @@ go.opentelemetry.io/collector/pdata/plog go.opentelemetry.io/collector/pdata/pmetric go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp go.opentelemetry.io/collector/pdata/ptrace -# go.opentelemetry.io/collector/pipeline v0.130.0 +# go.opentelemetry.io/collector/pipeline v0.131.0 ## explicit; go 1.23.0 go.opentelemetry.io/collector/pipeline go.opentelemetry.io/collector/pipeline/internal/globalsignal -# go.opentelemetry.io/collector/processor v1.36.0 +# go.opentelemetry.io/collector/processor v1.37.0 ## explicit; go 1.23.0 go.opentelemetry.io/collector/processor go.opentelemetry.io/collector/processor/internal @@ -744,7 +743,7 @@ golang.org/x/crypto/internal/alias golang.org/x/crypto/internal/poly1305 golang.org/x/crypto/pkcs12 golang.org/x/crypto/pkcs12/internal/rc2 -# golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc +# golang.org/x/exp v0.0.0-20250718183923-645b1fa84792 ## explicit; go 1.23.0 golang.org/x/exp/constraints # golang.org/x/net v0.42.0 @@ -791,7 +790,7 @@ golang.org/x/text/unicode/norm # golang.org/x/time v0.12.0 ## explicit; go 1.23.0 golang.org/x/time/rate -# google.golang.org/api v0.241.0 +# google.golang.org/api v0.244.0 ## explicit; go 1.23.0 google.golang.org/api/googleapi google.golang.org/api/googleapi/transport @@ -808,20 +807,20 @@ 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-20250707201910-8d1bb00bc6a7 +# google.golang.org/genproto v0.0.0-20250728155136-f173205681a0 ## explicit; go 1.23.0 google.golang.org/genproto/googleapis/type/date google.golang.org/genproto/googleapis/type/expr -# google.golang.org/genproto/googleapis/api v0.0.0-20250707201910-8d1bb00bc6a7 +# google.golang.org/genproto/googleapis/api v0.0.0-20250728155136-f173205681a0 ## explicit; go 1.23.0 google.golang.org/genproto/googleapis/api google.golang.org/genproto/googleapis/api/annotations -# google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7 +# google.golang.org/genproto/googleapis/rpc v0.0.0-20250728155136-f173205681a0 ## explicit; go 1.23.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.73.0 +# google.golang.org/grpc v1.74.2 ## explicit; go 1.23.0 google.golang.org/grpc google.golang.org/grpc/attributes @@ -942,10 +941,10 @@ gopkg.in/yaml.v2 # gopkg.in/yaml.v3 v3.0.1 ## explicit gopkg.in/yaml.v3 -# k8s.io/apimachinery v0.33.2 +# k8s.io/apimachinery v0.33.3 ## explicit; go 1.24.0 k8s.io/apimachinery/pkg/util/runtime -# k8s.io/client-go v0.33.2 +# k8s.io/client-go v0.33.3 ## explicit; go 1.24.0 k8s.io/client-go/tools/metrics k8s.io/client-go/util/workqueue