From 9ba6ebc3e3d607e364805fa2f1d6c51eb088e9c0 Mon Sep 17 00:00:00 2001 From: Jorge Turrado Date: Sun, 3 May 2026 17:37:02 +0200 Subject: [PATCH 1/2] bump deps Signed-off-by: Jorge Turrado --- go.mod | 126 +- go.sum | 259 +- pkg/scalers/azure/azure_data_explorer.go | 57 +- pkg/scalers/azure/azure_data_explorer_test.go | 30 +- pkg/scalers/azure_data_explorer_scaler.go | 4 +- vendor/cloud.google.com/go/iam/CHANGES.md | 2 + vendor/cloud.google.com/go/iam/README.md | 19 +- .../apiv3/v2/alert_policy_client.go | 56 + .../go/monitoring/apiv3/v2/group_client.go | 63 + .../go/monitoring/apiv3/v2/metric_client.go | 87 + .../apiv3/v2/monitoringpb/alert.pb.go | 2 +- .../apiv3/v2/monitoringpb/alert_service.pb.go | 2 +- .../v2/monitoringpb/alert_service_grpc.pb.go | 2 +- .../apiv3/v2/monitoringpb/common.pb.go | 2 +- .../v2/monitoringpb/dropped_labels.pb.go | 2 +- .../apiv3/v2/monitoringpb/group.pb.go | 2 +- .../apiv3/v2/monitoringpb/group_service.pb.go | 2 +- .../v2/monitoringpb/group_service_grpc.pb.go | 2 +- .../apiv3/v2/monitoringpb/metric.pb.go | 2 +- .../v2/monitoringpb/metric_service.pb.go | 2 +- .../v2/monitoringpb/metric_service_grpc.pb.go | 2 +- .../v2/monitoringpb/mutation_record.pb.go | 2 +- .../apiv3/v2/monitoringpb/notification.pb.go | 2 +- .../monitoringpb/notification_service.pb.go | 2 +- .../notification_service_grpc.pb.go | 2 +- .../apiv3/v2/monitoringpb/query_service.pb.go | 2 +- .../v2/monitoringpb/query_service_grpc.pb.go | 2 +- .../apiv3/v2/monitoringpb/service.pb.go | 2 +- .../v2/monitoringpb/service_service.pb.go | 2 +- .../monitoringpb/service_service_grpc.pb.go | 2 +- .../apiv3/v2/monitoringpb/snooze.pb.go | 2 +- .../v2/monitoringpb/snooze_service.pb.go | 2 +- .../v2/monitoringpb/snooze_service_grpc.pb.go | 2 +- .../apiv3/v2/monitoringpb/span_context.pb.go | 2 +- .../apiv3/v2/monitoringpb/uptime.pb.go | 2 +- .../v2/monitoringpb/uptime_service.pb.go | 2 +- .../v2/monitoringpb/uptime_service_grpc.pb.go | 2 +- .../apiv3/v2/notification_channel_client.go | 91 + .../go/monitoring/apiv3/v2/query_client.go | 28 + .../apiv3/v2/service_monitoring_client.go | 88 + .../go/monitoring/apiv3/v2/snooze_client.go | 49 + .../apiv3/v2/uptime_check_client.go | 60 + .../go/monitoring/internal/version.go | 2 +- .../apiv1/secret_manager_client.go | 279 +- .../apiv1/secretmanagerpb/resources.pb.go | 2 +- .../apiv1/secretmanagerpb/service.pb.go | 2 +- .../apiv1/secretmanagerpb/service_grpc.pb.go | 2 +- .../go/secretmanager/internal/version.go | 2 +- vendor/cloud.google.com/go/storage/CHANGES.md | 8 + .../go/storage/grpc_client.go | 15 + .../go/storage/grpc_dp_diag.go | 2 - .../go/storage/http_client.go | 2 + .../internal/apiv2/storagepb/storage.pb.go | 351 +- .../apiv2/storagepb/storage_grpc.pb.go | 2 +- .../go/storage/internal/version.go | 2 +- vendor/cloud.google.com/go/storage/invoke.go | 2 +- vendor/cloud.google.com/go/storage/pcu.go | 3 + vendor/cloud.google.com/go/storage/reader.go | 4 +- .../go/storage/tracked_features.go | 2 +- vendor/cloud.google.com/go/storage/tracker.go | 63 + vendor/filippo.io/edwards25519/README.md | 6 +- vendor/filippo.io/edwards25519/doc.go | 6 +- vendor/filippo.io/edwards25519/extra.go | 67 +- vendor/filippo.io/edwards25519/field/fe.go | 34 +- .../filippo.io/edwards25519/field/fe_amd64.go | 3 +- .../filippo.io/edwards25519/field/fe_amd64.s | 203 +- .../edwards25519/field/fe_amd64_noasm.go | 3 +- .../filippo.io/edwards25519/field/fe_arm64.go | 16 - .../filippo.io/edwards25519/field/fe_arm64.s | 42 - .../edwards25519/field/fe_arm64_noasm.go | 12 - .../edwards25519/field/fe_generic.go | 170 +- vendor/filippo.io/edwards25519/pull.sh | 53 + vendor/filippo.io/edwards25519/scalar.go | 27 +- vendor/filippo.io/edwards25519/tables.go | 4 +- .../azure-kusto-go/{ => azkustodata}/LICENSE | 0 .../{kusto => azkustodata}/client_details.go | 6 +- .../{kusto => azkustodata}/cloudinfo.go | 16 +- .../{kusto => azkustodata}/conn.go | 67 +- .../conn_streaming_ingest.go | 7 +- .../Azure/azure-kusto-go/azkustodata/doc.go | 71 + .../data => azkustodata}/errors/errors.go | 168 +- .../errors/kind_string.go | 0 .../data => azkustodata}/errors/op_string.go | 0 .../internal/response/response.go | 2 +- .../internal/version/version.go | 2 +- .../{kusto => azkustodata}/kcsb.go | 362 +- .../azkustodata/keywords/kcsb.json | 219 + .../azkustodata/keywords/keywords.go | 136 + .../{kusto => azkustodata}/kql/builder.go | 51 +- .../{kusto => azkustodata}/kql/identifier.go | 0 .../azkustodata/kql/query_parameters.go | 116 + .../kql/string_utils.go | 4 - .../azure-kusto-go/azkustodata/kql/value.go | 43 + .../Azure/azure-kusto-go/azkustodata/kusto.go | 303 + .../azkustodata/query/column.go | 15 + .../azkustodata/query/column_impl.go | 32 + .../azkustodata/query/dataset.go | 29 + .../azkustodata/query/dataset_impl.go | 49 + .../azkustodata/query/from_kusto.go | 74 + .../azure-kusto-go/azkustodata/query/row.go | 58 + .../azkustodata/query/row_impl.go | 297 + .../azkustodata/query/row_result.go | 33 + .../azure-kusto-go/azkustodata/query/table.go | 27 + .../azkustodata/query/table_impl.go | 87 + .../azkustodata/query/table_result.go | 37 + .../azkustodata/query/v1/dataset.go | 169 + .../azkustodata/query/v1/decode.go | 94 + .../azkustodata/query/v1/table.go | 77 + .../azkustodata/query/v2/error_frames.go | 47 + .../azkustodata/query/v2/fast_json.go | 320 + .../azkustodata/query/v2/fast_json_utils.go | 63 + .../azkustodata/query/v2/frame_reader.go | 98 + .../azkustodata/query/v2/frame_utils.go | 28 + .../azkustodata/query/v2/frames_defs.go | 72 + .../azkustodata/query/v2/iterative_dataset.go | 416 ++ .../azkustodata/query/v2/iterative_table.go | 101 + .../azkustodata/query/v2/secondary.go | 52 + .../azkustodata/query/v2/table.go | 59 + .../{kusto => azkustodata}/queryopts.go | 87 +- .../{kusto => azkustodata}/tokenprovider.go | 4 +- .../trusted_endpoints}/trusted_endpoints.go | 35 +- .../well_known_kusto_endpoints.json | 51 +- .../data => azkustodata}/types/types.go | 54 +- .../{kusto => azkustodata}/utils/once.go | 0 .../utils/transporter.go | 0 .../azure-kusto-go/azkustodata/value/bool.go | 59 + .../azkustodata/value/datetime.go | 70 + .../azkustodata/value/decimal.go | 87 + .../data => azkustodata}/value/dynamic.go | 53 +- .../azure-kusto-go/azkustodata/value/guid.go | 48 + .../azure-kusto-go/azkustodata/value/int.go | 77 + .../azure-kusto-go/azkustodata/value/long.go | 68 + .../azure-kusto-go/azkustodata/value/real.go | 73 + .../data => azkustodata}/value/string.go | 42 +- .../data => azkustodata}/value/timespan.go | 134 +- .../azure-kusto-go/azkustodata/value/value.go | 170 + .../kusto/data/table/from_kusto.go | 66 - .../azure-kusto-go/kusto/data/table/table.go | 174 - .../azure-kusto-go/kusto/data/value/bool.go | 71 - .../kusto/data/value/datetime.go | 81 - .../kusto/data/value/decimal.go | 82 - .../azure-kusto-go/kusto/data/value/guid.go | 71 - .../azure-kusto-go/kusto/data/value/int.go | 103 - .../azure-kusto-go/kusto/data/value/long.go | 86 - .../azure-kusto-go/kusto/data/value/real.go | 79 - .../azure-kusto-go/kusto/data/value/value.go | 50 - .../Azure/azure-kusto-go/kusto/doc.go | 355 - .../kusto/internal/frames/frames.go | 98 - .../internal/frames/unmarshal/json/README.md | 46 - .../internal/frames/unmarshal/json/decode.go | 1292 ---- .../internal/frames/unmarshal/json/encode.go | 1357 ---- .../internal/frames/unmarshal/json/fold.go | 142 - .../internal/frames/unmarshal/json/indent.go | 143 - .../internal/frames/unmarshal/json/scanner.go | 601 -- .../internal/frames/unmarshal/json/stream.go | 513 -- .../internal/frames/unmarshal/json/tables.go | 218 - .../internal/frames/unmarshal/json/tags.go | 44 - .../internal/frames/unmarshal/unmarshal.go | 120 - .../kusto/internal/frames/v1/decoder.go | 132 - .../kusto/internal/frames/v1/v1.go | 104 - .../kusto/internal/frames/v2/decoder.go | 211 - .../kusto/internal/frames/v2/v2.go | 238 - .../azure-kusto-go/kusto/internal/log/log.go | 31 - .../kusto/kql/query_parameters.go | 106 - .../Azure/azure-kusto-go/kusto/kql/value.go | 52 - .../Azure/azure-kusto-go/kusto/kusto.go | 374 - .../Azure/azure-kusto-go/kusto/mock.go | 161 - .../azure-kusto-go/kusto/query_builder.go | 622 -- .../Azure/azure-kusto-go/kusto/reader.go | 347 - .../azure-kusto-go/kusto/statemachine.go | 453 -- .../Azure/azure-kusto-go/kusto/to_kusto.go | 441 -- .../azure-kusto-go/kusto/unsafe/unsafe.go | 12 - .../azure-sdk-for-go/sdk/azcore/CHANGELOG.md | 13 + .../internal/exported/response_error.go | 2 +- .../sdk/azcore/internal/shared/constants.go | 2 +- .../sdk/azcore/runtime/policy_http_trace.go | 11 +- .../sdk/azcore/runtime/policy_logging.go | 23 +- .../sdk/azcore/runtime/request.go | 8 +- .../sdk/internal/diag/diag.go | 5 +- .../azure-sdk-for-go/sdk/internal/diag/doc.go | 3 - .../sdk/internal/errorinfo/doc.go | 3 - .../sdk/internal/errorinfo/errorinfo.go | 3 - .../sdk/internal/exported/exported.go | 13 +- .../azure-sdk-for-go/sdk/internal/log/doc.go | 3 - .../azure-sdk-for-go/sdk/internal/log/log.go | 3 - .../sdk/internal/poller/util.go | 3 - .../sdk/internal/temporal/resource.go | 5 +- .../azure-sdk-for-go/sdk/internal/uuid/doc.go | 3 - .../sdk/internal/uuid/uuid.go | 3 - vendor/github.com/IBM/sarama/Dockerfile.kafka | 2 +- vendor/github.com/IBM/sarama/README.md | 2 +- .../IBM/sarama/alter_configs_response.go | 4 + .../github.com/IBM/sarama/async_producer.go | 439 +- vendor/github.com/IBM/sarama/broker.go | 36 +- vendor/github.com/IBM/sarama/client.go | 34 + vendor/github.com/IBM/sarama/config.go | 3 +- vendor/github.com/IBM/sarama/consumer.go | 263 +- .../github.com/IBM/sarama/consumer_group.go | 7 - .../IBM/sarama/describe_configs_response.go | 4 + .../IBM/sarama/elect_leaders_request.go | 5 +- .../IBM/sarama/elect_leaders_response.go | 5 +- .../IBM/sarama/offset_fetch_response.go | 7 +- .../github.com/IBM/sarama/offset_manager.go | 14 +- vendor/github.com/IBM/sarama/produce_set.go | 65 +- vendor/github.com/IBM/sarama/sockopt_other.go | 9 + vendor/github.com/IBM/sarama/sockopt_posix.go | 36 + vendor/github.com/IBM/sarama/utils.go | 6 +- .../influxdb3-go/v2/influxdb3/client.go | 44 +- .../influxdb3-go/v2/influxdb3/config.go | 101 +- .../influxdb3-go/v2/influxdb3/gzip/gzip.go | 69 - .../influxdb3-go/v2/influxdb3/lineprotocol.go | 38 + .../influxdb3-go/v2/influxdb3/options.go | 78 +- .../v2/influxdb3/partial_write_error.go | 157 + .../influxdb3-go/v2/influxdb3/point.go | 341 +- .../influxdb3-go/v2/influxdb3/query.go | 4 +- .../v2/influxdb3/query_iterator.go | 1 + .../influxdb3-go/v2/influxdb3/version.go | 2 +- .../influxdb3-go/v2/influxdb3/write.go | 108 +- .../arrow-go/v18/arrow/array/bufferbuilder.go | 4 +- .../v18/arrow/array/numericbuilder.gen.go | 364 + .../arrow/array/numericbuilder.gen.go.tmpl | 103 + .../apache/arrow-go/v18/arrow/array/record.go | 21 +- .../arrow-go/v18/arrow/datatype_binary.go | 130 +- .../apache/arrow-go/v18/arrow/doc.go | 2 +- .../arrow-go/v18/arrow/ipc/file_reader.go | 7 +- .../apache/arrow-go/v18/arrow/ipc/metadata.go | 12 +- .../apache/arrow-go/v18/arrow/ipc/writer.go | 11 +- .../apache/arrow-go/v18/arrow/record.go | 8 + .../apache/arrow-go/v18/arrow/schema.go | 50 +- .../aws-sdk-go-v2/aws/go_module_metadata.go | 2 +- .../aws/protocol/eventstream/CHANGELOG.md | 8 + .../eventstream/go_module_metadata.go | 2 +- .../aws/aws-sdk-go-v2/config/CHANGELOG.md | 14 + .../config/go_module_metadata.go | 2 +- .../{ => config}/internal/ini/errors.go | 0 .../{ => config}/internal/ini/ini.go | 0 .../{ => config}/internal/ini/parse.go | 0 .../{ => config}/internal/ini/sections.go | 0 .../{ => config}/internal/ini/strings.go | 0 .../{ => config}/internal/ini/token.go | 0 .../{ => config}/internal/ini/tokenize.go | 0 .../{ => config}/internal/ini/value.go | 0 .../aws/aws-sdk-go-v2/config/shared_config.go | 2 +- .../aws-sdk-go-v2/credentials/CHANGELOG.md | 10 + .../credentials/go_module_metadata.go | 2 +- .../feature/ec2/imds/CHANGELOG.md | 10 + .../feature/ec2/imds/go_module_metadata.go | 2 +- .../internal/configsources/CHANGELOG.md | 10 + .../configsources/go_module_metadata.go | 2 +- .../internal/endpoints/v2/CHANGELOG.md | 10 + .../endpoints/v2/go_module_metadata.go | 2 +- .../aws-sdk-go-v2/internal/ini/CHANGELOG.md | 296 - .../aws-sdk-go-v2/internal/v4a/CHANGELOG.md | 460 ++ .../internal/{ini => v4a}/LICENSE.txt | 0 .../aws-sdk-go-v2/internal/v4a/credentials.go | 141 + .../aws/aws-sdk-go-v2/internal/v4a/error.go | 17 + .../{ini => v4a}/go_module_metadata.go | 4 +- .../internal/v4a/internal/crypto/compare.go | 30 + .../internal/v4a/internal/crypto/ecc.go | 113 + .../internal/v4a/internal/v4/const.go | 36 + .../internal/v4a/internal/v4/header_rules.go | 82 + .../internal/v4a/internal/v4/headers.go | 68 + .../internal/v4a/internal/v4/hmac.go | 13 + .../internal/v4a/internal/v4/host.go | 75 + .../internal/v4a/internal/v4/time.go | 36 + .../internal/v4a/internal/v4/util.go | 64 + .../aws-sdk-go-v2/internal/v4a/middleware.go | 118 + .../internal/v4a/presign_middleware.go | 117 + .../aws/aws-sdk-go-v2/internal/v4a/smithy.go | 92 + .../aws/aws-sdk-go-v2/internal/v4a/v4a.go | 520 ++ .../aws-sdk-go-v2/service/amp/CHANGELOG.md | 10 + .../service/amp/go_module_metadata.go | 2 +- .../service/cloudwatch/CHANGELOG.md | 18 + .../cloudwatch/api_op_DeleteDashboards.go | 3 +- .../cloudwatch/api_op_GetOTelEnrichment.go | 4 +- .../cloudwatch/api_op_ListTagsForResource.go | 10 +- .../cloudwatch/api_op_PutAlarmMuteRule.go | 16 +- .../service/cloudwatch/api_op_PutDashboard.go | 15 + .../cloudwatch/api_op_StartOTelEnrichment.go | 4 +- .../cloudwatch/api_op_StopOTelEnrichment.go | 4 +- .../service/cloudwatch/api_op_TagResource.go | 10 +- .../cloudwatch/api_op_UntagResource.go | 9 +- .../service/cloudwatch/deserializers.go | 12 - .../service/cloudwatch/go_module_metadata.go | 2 +- .../service/cloudwatch/serializers.go | 7 + .../service/cloudwatch/validators.go | 5 + .../service/dynamodb/CHANGELOG.md | 10 + .../service/dynamodb/go_module_metadata.go | 2 +- .../service/dynamodbstreams/CHANGELOG.md | 10 + .../dynamodbstreams/go_module_metadata.go | 2 +- .../internal/accept-encoding/CHANGELOG.md | 8 + .../accept-encoding/go_module_metadata.go | 2 +- .../internal/endpoint-discovery/CHANGELOG.md | 10 + .../endpoint-discovery/go_module_metadata.go | 2 +- .../internal/presigned-url/CHANGELOG.md | 10 + .../presigned-url/go_module_metadata.go | 2 +- .../service/kinesis/CHANGELOG.md | 10 + .../service/kinesis/go_module_metadata.go | 2 +- .../service/secretsmanager/CHANGELOG.md | 10 + .../secretsmanager/go_module_metadata.go | 2 +- .../aws-sdk-go-v2/service/signin/CHANGELOG.md | 10 + .../service/signin/go_module_metadata.go | 2 +- .../aws-sdk-go-v2/service/sqs/CHANGELOG.md | 10 + .../service/sqs/go_module_metadata.go | 2 +- .../aws-sdk-go-v2/service/sso/CHANGELOG.md | 10 + .../service/sso/go_module_metadata.go | 2 +- .../service/ssooidc/CHANGELOG.md | 10 + .../service/ssooidc/go_module_metadata.go | 2 +- .../aws-sdk-go-v2/service/sts/CHANGELOG.md | 11 + .../aws-sdk-go-v2/service/sts/api_client.go | 28 + .../aws/aws-sdk-go-v2/service/sts/auth.go | 10 + .../aws-sdk-go-v2/service/sts/generated.json | 1 + .../service/sts/go_module_metadata.go | 2 +- .../aws/aws-sdk-go-v2/service/sts/options.go | 48 + vendor/github.com/aws/smithy-go/AGENTS.md | 172 + vendor/github.com/aws/smithy-go/CHANGELOG.md | 31 +- .../endpoints/private/rulesfn/split.go | 16 + .../aws/smithy-go/go_module_metadata.go | 2 +- .../github.com/dgryski/go-rendezvous/LICENSE | 21 - .../github.com/dgryski/go-rendezvous/rdv.go | 79 - vendor/github.com/go-sql-driver/mysql/AUTHORS | 10 +- .../go-sql-driver/mysql/CHANGELOG.md | 19 +- .../github.com/go-sql-driver/mysql/README.md | 7 +- vendor/github.com/go-sql-driver/mysql/auth.go | 2 +- .../go-sql-driver/mysql/conncheck.go | 1 - .../go-sql-driver/mysql/conncheck_dummy.go | 1 - .../go-sql-driver/mysql/connection.go | 277 +- .../go-sql-driver/mysql/connector.go | 12 +- .../github.com/go-sql-driver/mysql/const.go | 21 +- vendor/github.com/go-sql-driver/mysql/dsn.go | 9 +- .../github.com/go-sql-driver/mysql/fields.go | 38 +- .../github.com/go-sql-driver/mysql/infile.go | 5 +- .../github.com/go-sql-driver/mysql/packets.go | 341 +- .../github.com/go-sql-driver/mysql/result.go | 6 +- vendor/github.com/go-sql-driver/mysql/rows.go | 10 +- .../go-sql-driver/mysql/statement.go | 34 +- .../github.com/go-sql-driver/mysql/utils.go | 151 +- .../googleapis/gax-go/v2/CHANGES.md | 2 + .../googleapis/gax-go/v2/internal/version.go | 2 +- .../klauspost/compress/.goreleaser.yml | 11 +- .../github.com/klauspost/compress/README.md | 7 + .../klauspost/compress/flate/huffman_code.go | 2 +- .../klauspost/compress/flate/regmask_other.go | 1 - .../compress/huff0/decompress_amd64.go | 1 - .../compress/huff0/decompress_generic.go | 1 - .../internal/cpuinfo/cpuinfo_amd64.go | 1 - .../klauspost/compress/s2/decode_other.go | 1 - .../klauspost/compress/s2/encode_amd64.go | 1 - .../klauspost/compress/s2/encode_go.go | 1 - .../klauspost/compress/zstd/blockenc.go | 1 + .../klauspost/compress/zstd/enc_base.go | 2 +- .../klauspost/compress/zstd/enc_best.go | 14 +- .../klauspost/compress/zstd/enc_better.go | 14 +- .../klauspost/compress/zstd/enc_dfast.go | 6 +- .../klauspost/compress/zstd/enc_fast.go | 6 +- .../klauspost/compress/zstd/encoder.go | 13 + .../compress/zstd/encoder_options.go | 1 + .../compress/zstd/fse_decoder_amd64.go | 1 - .../compress/zstd/fse_decoder_generic.go | 1 - .../zstd/internal/xxhash/xxhash_other.go | 1 - .../klauspost/compress/zstd/matchlen_amd64.go | 1 - .../compress/zstd/matchlen_generic.go | 1 - .../klauspost/compress/zstd/seqdec_amd64.go | 1 - .../klauspost/compress/zstd/seqdec_generic.go | 1 - .../v2/internal/version/version.go | 2 +- .../v2/pkg/alerts/policies.go | 2 + .../newrelic-client-go/v2/pkg/alerts/types.go | 2 + .../v2/pkg/fleetcontrol/fleetcontrol_api.go | 46 +- .../v2/pkg/fleetcontrol/types.go | 140 +- .../v2/pkg/notifications/notifications_api.go | 408 +- .../notifications_destination_scope.go | 960 --- .../v2/pkg/notifications/types.go | 392 +- .../v2/pkg/notifications/types_scope.go | 26 - .../v2/pkg/region/region_constants.go | 17 + vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md | 14 + vendor/github.com/onsi/ginkgo/v2/README.md | 2 +- .../onsi/ginkgo/v2/ginkgo/command/program.go | 164 + .../github.com/onsi/ginkgo/v2/ginkgo/main.go | 1 + .../github.com/onsi/ginkgo/v2/ginkgo_t_dsl.go | 4 + .../internal/testingtproxy/testing_t_proxy.go | 9 + .../github.com/onsi/ginkgo/v2/types/config.go | 3 + .../github.com/onsi/ginkgo/v2/types/flags.go | 18 + .../onsi/ginkgo/v2/types/version.go | 2 +- vendor/github.com/onsi/gomega/CHANGELOG.md | 8 + vendor/github.com/onsi/gomega/gomega_dsl.go | 2 +- vendor/github.com/pierrec/lz4/v4/reader.go | 1 + vendor/github.com/pierrec/lz4/v4/writer.go | 12 +- .../rabbitmq/amqp091-go/.golangci.yml | 39 + .../rabbitmq/amqp091-go/CHANGELOG.md | 52 + .../github.com/rabbitmq/amqp091-go/Makefile | 2 +- .../github.com/rabbitmq/amqp091-go/README.md | 2 +- .../rabbitmq/amqp091-go/allocator.go | 12 +- vendor/github.com/rabbitmq/amqp091-go/auth.go | 4 +- .../github.com/rabbitmq/amqp091-go/channel.go | 45 +- .../rabbitmq/amqp091-go/connection.go | 103 +- .../rabbitmq/amqp091-go/consumers.go | 6 +- .../rabbitmq/amqp091-go/delivery.go | 10 +- vendor/github.com/rabbitmq/amqp091-go/log.go | 7 +- vendor/github.com/rabbitmq/amqp091-go/read.go | 82 +- .../github.com/rabbitmq/amqp091-go/return.go | 2 +- .../github.com/rabbitmq/amqp091-go/spec091.go | 137 +- .../github.com/rabbitmq/amqp091-go/types.go | 81 +- vendor/github.com/rabbitmq/amqp091-go/uri.go | 8 +- .../github.com/rabbitmq/amqp091-go/write.go | 82 +- vendor/github.com/redis/go-redis/v9/Makefile | 10 +- vendor/github.com/redis/go-redis/v9/README.md | 28 +- .../redis/go-redis/v9/RELEASE-NOTES.md | 91 + .../github.com/redis/go-redis/v9/RELEASING.md | 141 +- .../github.com/redis/go-redis/v9/auth/auth.go | 18 + .../github.com/redis/go-redis/v9/command.go | 436 +- .../github.com/redis/go-redis/v9/commands.go | 22 + .../redis/go-redis/v9/dial_retry_backoff.go | 39 + .../redis/go-redis/v9/docker-compose.yml | 8 +- vendor/github.com/redis/go-redis/v9/error.go | 14 + .../redis/go-redis/v9/hash_commands.go | 7 + .../go-redis/v9/internal/hashtag/hashtag.go | 2 +- .../v9/internal/hashtag/rendezvous.go | 54 + .../go-redis/v9/internal/hscan/structmap.go | 2 + .../go-redis/v9/internal/otel/metrics.go | 19 + .../redis/go-redis/v9/internal/pool/conn.go | 50 +- .../go-redis/v9/internal/pool/conn_state.go | 25 +- .../redis/go-redis/v9/internal/pool/pool.go | 477 +- .../go-redis/v9/internal/pool/pool_single.go | 4 +- .../go-redis/v9/internal/pool/pool_sticky.go | 4 +- .../redis/go-redis/v9/internal/pool/pubsub.go | 26 +- .../go-redis/v9/internal/proto/reader.go | 200 +- .../v9/internal/proto/redis_errors.go | 20 +- .../go-redis/v9/maintnotifications/config.go | 133 +- .../github.com/redis/go-redis/v9/options.go | 19 +- .../redis/go-redis/v9/osscluster.go | 44 +- vendor/github.com/redis/go-redis/v9/otel.go | 31 + .../github.com/redis/go-redis/v9/pipeline.go | 2 +- vendor/github.com/redis/go-redis/v9/pubsub.go | 59 +- vendor/github.com/redis/go-redis/v9/redis.go | 209 +- vendor/github.com/redis/go-redis/v9/ring.go | 24 +- vendor/github.com/redis/go-redis/v9/script.go | 143 +- .../redis/go-redis/v9/scripting_commands.go | 5 + .../redis/go-redis/v9/search_builders.go | 97 +- .../redis/go-redis/v9/search_commands.go | 403 +- .../github.com/redis/go-redis/v9/sentinel.go | 31 +- .../redis/go-redis/v9/sortedset_commands.go | 29 +- .../redis/go-redis/v9/string_commands.go | 5 +- vendor/github.com/redis/go-redis/v9/tx.go | 5 +- .../github.com/redis/go-redis/v9/universal.go | 2 + .../redis/go-redis/v9/vectorset_commands.go | 59 +- .../github.com/redis/go-redis/v9/version.go | 2 +- .../segmentio/kafka-go/describegroups.go | 8 +- .../solarwinds/swo-sdk-go/swov1/RELEASES.md | 12 +- .../swo-sdk-go/swov1/cloudaccounts.go | 15 +- .../solarwinds/swo-sdk-go/swov1/dbo.go | 5 + .../solarwinds/swo-sdk-go/swov1/dem.go | 48 +- .../solarwinds/swo-sdk-go/swov1/entities.go | 8 +- .../swov1/internal/utils/headers.go | 35 +- .../swo-sdk-go/swov1/internal/utils/json.go | 31 +- .../swov1/internal/utils/requestbody.go | 4 +- .../swov1/internal/utils/retries.go | 11 +- .../swov1/internal/utils/security.go | 128 +- .../swo-sdk-go/swov1/internal/utils/utils.go | 17 +- .../solarwinds/swo-sdk-go/swov1/logs.go | 18 +- .../solarwinds/swo-sdk-go/swov1/metrics.go | 52 +- ...accountsawsmgmtaccountonboardingrequest.go | 2 +- .../swov1/models/components/commonentityid.go | 1 + .../models/components/commonkeyvaluepair.go | 4 +- .../swov1/models/components/commonlink.go | 7 +- .../swov1/models/components/commonpageinfo.go | 2 + .../swov1/models/components/commontag.go | 4 +- .../components/demgettransactionresponse.go | 8 +- .../models/components/demgeturiresponse.go | 8 +- .../components/demgetwebsiteresponse.go | 17 +- .../components/demtransactioncommandname.go | 3 + .../swov1/models/components/demwebsite.go | 4 +- .../swov1/models/components/entitiesentity.go | 63 - .../swov1/models/components/logsevent.go | 14 +- .../models/components/metricsgrouping.go | 1 + .../components/tokenscreatetokenrequest.go | 13 +- .../models/operations/createchangeevent.go | 1 + .../swov1/models/operations/deletedatabase.go | 1 + .../models/operations/deletetransaction.go | 1 + .../swov1/models/operations/deleteuri.go | 1 + .../swov1/models/operations/deletewebsite.go | 1 + .../models/operations/getpluginconfig.go | 1 + .../swov1/models/operations/getplugins.go | 1 + .../swov1/models/operations/gettransaction.go | 1 + .../swov1/models/operations/geturi.go | 1 + .../models/operations/geturioutagestatuses.go | 1 + .../models/operations/geturitestresults.go | 1 + .../swov1/models/operations/getwebsite.go | 1 + .../operations/getwebsiteoutagestatuses.go | 1 + .../operations/getwebsitetestresults.go | 1 + .../swov1/models/operations/listentities.go | 4 +- .../models/operations/listentitytypes.go | 1 + .../models/operations/listlogarchives.go | 6 +- .../models/operations/listmetricattributes.go | 4 +- .../operations/listmetricattributevalues.go | 7 +- .../operations/listmetricmeasurements.go | 20 +- .../swov1/models/operations/listmetrics.go | 4 +- .../operations/listmetricsforentitytype.go | 2 + .../operations/listmultimetricmeasurements.go | 9 +- .../models/operations/observedatabase.go | 1 + .../operations/pausetransactionmonitoring.go | 1 + .../models/operations/pauseurimonitoring.go | 1 + .../operations/pausewebsitemonitoring.go | 1 + .../models/operations/pluginoperation.go | 4 +- .../swov1/models/operations/searchlogs.go | 4 +- .../models/operations/unobservedatabase.go | 1 + .../unpausetransactionmonitoring.go | 1 + .../models/operations/unpauseurimonitoring.go | 1 + .../operations/unpausewebsitemonitoring.go | 1 + .../swov1/models/operations/updatedatabase.go | 4 +- .../models/operations/updatetransaction.go | 1 + .../swov1/models/operations/updateuri.go | 1 + .../swov1/models/operations/updatewebsite.go | 1 + .../validatemgmtaccountonboarding.go | 11 - .../swo-sdk-go/swov1/retry/config.go | 2 +- .../solarwinds/swo-sdk-go/swov1/swo.go | 8 +- .../go.etcd.io/etcd/api/v3/version/version.go | 2 +- .../api/activity/v1/message.go-helpers.pb.go | 37 + .../api/activity/v1/message.pb.go | 330 +- .../api/callback/v1/message.go-helpers.pb.go | 43 + .../api/callback/v1/message.pb.go | 211 + .../api/command/v1/message.pb.go | 56 +- .../api/common/v1/message.go-helpers.pb.go | 74 + .../api/common/v1/message.pb.go | 457 +- .../api/compute/v1/config.go-helpers.pb.go | 191 + .../api/compute/v1/config.pb.go | 400 + .../api/compute/v1/provider.go-helpers.pb.go | 43 + .../api/compute/v1/provider.pb.go | 161 + .../api/compute/v1/scaler.go-helpers.pb.go | 43 + .../api/compute/v1/scaler.pb.go | 146 + .../api/deployment/v1/message.pb.go | 187 +- .../api/enums/v1/deployment.go-helpers.pb.go | 1 + .../api/enums/v1/deployment.pb.go | 16 +- .../api/enums/v1/event_type.go-helpers.pb.go | 1 + .../api/enums/v1/event_type.pb.go | 11 +- .../api/enums/v1/nexus.go-helpers.pb.go | 81 + .../go.temporal.io/api/enums/v1/nexus.pb.go | 326 +- .../api/enums/v1/task_queue.go-helpers.pb.go | 7 +- .../api/enums/v1/task_queue.pb.go | 20 +- .../api/enums/v1/workflow.go-helpers.pb.go | 5 +- .../api/enums/v1/workflow.pb.go | 36 +- .../errordetails/v1/message.go-helpers.pb.go | 37 + .../api/errordetails/v1/message.pb.go | 97 +- .../api/failure/v1/message.pb.go | 32 +- .../api/history/v1/message.go-helpers.pb.go | 74 + .../api/history/v1/message.pb.go | 1301 ++-- .../api/namespace/v1/message.pb.go | 20 +- .../api/nexus/v1/message.go-helpers.pb.go | 111 + .../go.temporal.io/api/nexus/v1/message.pb.go | 772 +- .../protometa/v1/annotations.go-helpers.pb.go | 43 + .../api/protometa/v1/annotations.pb.go | 170 + .../go.temporal.io/api/proxy/interceptor.go | 3003 +++++++- .../api/proxy/request_header.go | 319 + vendor/go.temporal.io/api/proxy/service.go | 48 + .../activity_execution_already_started.go | 2 +- .../api/serviceerror/convert.go | 2 + ...xus_operation_execution_already_started.go | 67 + .../api/taskqueue/v1/message.go-helpers.pb.go | 37 + .../api/taskqueue/v1/message.pb.go | 167 +- .../api/worker/v1/message.go-helpers.pb.go | 222 + .../api/worker/v1/message.pb.go | 538 +- .../api/workflow/v1/message.go-helpers.pb.go | 37 + .../api/workflow/v1/message.pb.go | 623 +- .../v1/request_response.go-helpers.pb.go | 968 ++- .../workflowservice/v1/request_response.pb.go | 5070 +++++++++---- .../api/workflowservice/v1/service.pb.go | 998 +-- .../api/workflowservice/v1/service.pb.gw.go | 6548 +++++++++++------ .../api/workflowservice/v1/service_grpc.pb.go | 748 +- .../v1/service_grpc.pb.mock.go | 420 ++ vendor/go.temporal.io/sdk/client/client.go | 73 +- vendor/go.temporal.io/sdk/converter/codec.go | 77 +- .../go.temporal.io/sdk/converter/extstore.go | 74 + .../sdk/converter/payload_handler.go | 231 + .../sdk/converter/serialization_context.go | 113 + .../go.temporal.io/sdk/internal/activity.go | 10 + vendor/go.temporal.io/sdk/internal/client.go | 212 +- vendor/go.temporal.io/sdk/internal/error.go | 3 +- .../sdk/internal/extstore/extstore.go | 181 + .../internal/extstore/internal_extstore.go | 444 ++ .../sdk/internal/internal_activity.go | 30 +- .../sdk/internal/internal_activity_client.go | 38 +- .../internal_command_state_machine.go | 2 +- .../sdk/internal/internal_event_handlers.go | 77 +- .../sdk/internal/internal_logging_tags.go | 13 + .../internal/internal_nexus_task_handler.go | 1 + .../internal/internal_nexus_task_poller.go | 17 +- .../sdk/internal/internal_nexus_worker.go | 6 +- .../sdk/internal/internal_schedule_client.go | 61 +- .../sdk/internal/internal_task_handlers.go | 183 +- .../sdk/internal/internal_task_pollers.go | 404 +- .../sdk/internal/internal_update.go | 44 +- .../sdk/internal/internal_worker.go | 306 +- .../sdk/internal/internal_worker_base.go | 98 +- .../sdk/internal/internal_worker_heartbeat.go | 7 +- .../sdk/internal/internal_workflow.go | 34 +- .../sdk/internal/internal_workflow_client.go | 601 +- .../internal/internal_workflow_testsuite.go | 78 +- .../sdk/internal/log/memory_logger.go | 4 +- .../sdk/internal/nexus_operations.go | 32 +- .../sdk/internal/payload_limits.go | 302 + .../sdk/internal/payload_visitor.go | 91 + .../temporalapi/sdk/v1/external_storage.pb.go | 155 + .../temporalapi/sdk/v1/external_storage.proto | 15 + vendor/go.temporal.io/sdk/internal/version.go | 2 +- vendor/go.temporal.io/sdk/internal/worker.go | 38 + .../go.temporal.io/sdk/internal/workflow.go | 131 +- .../golang.org/x/net/http/httpproxy/proxy.go | 8 +- vendor/golang.org/x/net/http2/hpack/tables.go | 13 +- vendor/golang.org/x/net/http2/transport.go | 9 +- .../x/sys/cpu/cpu_darwin_arm64_other.go | 2 + .../golang.org/x/sys/cpu/cpu_other_arm64.go | 2 +- .../golang.org/x/sys/cpu/cpu_windows_arm64.go | 42 - .../golang.org/x/sys/windows/dll_windows.go | 37 +- .../x/sys/windows/security_windows.go | 6 +- .../x/tools/go/types/objectpath/objectpath.go | 2 +- .../gcimporter/{ureader_yes.go => ureader.go} | 110 +- .../x/tools/internal/gocommand/version.go | 3 + .../tools/internal/imports/source_modindex.go | 100 - .../x/tools/internal/modindex/directories.go | 131 - .../x/tools/internal/modindex/index.go | 292 - .../x/tools/internal/modindex/lookup.go | 184 - .../x/tools/internal/modindex/modindex.go | 119 - .../x/tools/internal/modindex/symbols.go | 244 - .../x/tools/internal/pkgbits/version.go | 17 + .../x/tools/internal/typeparams/coretype.go | 8 +- .../x/tools/internal/typesinternal/types.go | 48 + .../x/tools/internal/versions/features.go | 1 + .../google.golang.org/api/internal/version.go | 2 +- .../api/storage/v1/storage-api.json | 10 +- .../api/storage/v1/storage-gen.go | 6 +- vendor/modules.txt | 187 +- 630 files changed, 40109 insertions(+), 20929 deletions(-) create mode 100644 vendor/cloud.google.com/go/storage/tracker.go delete mode 100644 vendor/filippo.io/edwards25519/field/fe_arm64.go delete mode 100644 vendor/filippo.io/edwards25519/field/fe_arm64.s delete mode 100644 vendor/filippo.io/edwards25519/field/fe_arm64_noasm.go create mode 100644 vendor/filippo.io/edwards25519/pull.sh rename vendor/github.com/Azure/azure-kusto-go/{ => azkustodata}/LICENSE (100%) rename vendor/github.com/Azure/azure-kusto-go/{kusto => azkustodata}/client_details.go (96%) rename vendor/github.com/Azure/azure-kusto-go/{kusto => azkustodata}/cloudinfo.go (93%) rename vendor/github.com/Azure/azure-kusto-go/{kusto => azkustodata}/conn.go (74%) rename vendor/github.com/Azure/azure-kusto-go/{kusto => azkustodata}/conn_streaming_ingest.go (96%) create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/doc.go rename vendor/github.com/Azure/azure-kusto-go/{kusto/data => azkustodata}/errors/errors.go (75%) rename vendor/github.com/Azure/azure-kusto-go/{kusto/data => azkustodata}/errors/kind_string.go (100%) rename vendor/github.com/Azure/azure-kusto-go/{kusto/data => azkustodata}/errors/op_string.go (100%) rename vendor/github.com/Azure/azure-kusto-go/{kusto => azkustodata}/internal/response/response.go (95%) rename vendor/github.com/Azure/azure-kusto-go/{kusto => azkustodata}/internal/version/version.go (87%) rename vendor/github.com/Azure/azure-kusto-go/{kusto => azkustodata}/kcsb.go (64%) create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/keywords/kcsb.json create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/keywords/keywords.go rename vendor/github.com/Azure/azure-kusto-go/{kusto => azkustodata}/kql/builder.go (60%) rename vendor/github.com/Azure/azure-kusto-go/{kusto => azkustodata}/kql/identifier.go (100%) create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/kql/query_parameters.go rename vendor/github.com/Azure/azure-kusto-go/{kusto => azkustodata}/kql/string_utils.go (98%) create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/kql/value.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/kusto.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/query/column.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/query/column_impl.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/query/dataset.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/query/dataset_impl.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/query/from_kusto.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/query/row.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/query/row_impl.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/query/row_result.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/query/table.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/query/table_impl.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/query/table_result.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v1/dataset.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v1/decode.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v1/table.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/error_frames.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/fast_json.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/fast_json_utils.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/frame_reader.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/frame_utils.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/frames_defs.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/iterative_dataset.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/iterative_table.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/secondary.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/table.go rename vendor/github.com/Azure/azure-kusto-go/{kusto => azkustodata}/queryopts.go (89%) rename vendor/github.com/Azure/azure-kusto-go/{kusto => azkustodata}/tokenprovider.go (98%) rename vendor/github.com/Azure/azure-kusto-go/{kusto/trustedendpoints => azkustodata/trusted_endpoints}/trusted_endpoints.go (86%) rename vendor/github.com/Azure/azure-kusto-go/{kusto/trustedendpoints => azkustodata/trusted_endpoints}/well_known_kusto_endpoints.json (66%) rename vendor/github.com/Azure/azure-kusto-go/{kusto/data => azkustodata}/types/types.go (67%) rename vendor/github.com/Azure/azure-kusto-go/{kusto => azkustodata}/utils/once.go (100%) rename vendor/github.com/Azure/azure-kusto-go/{kusto => azkustodata}/utils/transporter.go (100%) create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/value/bool.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/value/datetime.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/value/decimal.go rename vendor/github.com/Azure/azure-kusto-go/{kusto/data => azkustodata}/value/dynamic.go (70%) create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/value/guid.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/value/int.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/value/long.go create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/value/real.go rename vendor/github.com/Azure/azure-kusto-go/{kusto/data => azkustodata}/value/string.go (62%) rename vendor/github.com/Azure/azure-kusto-go/{kusto/data => azkustodata}/value/timespan.go (68%) create mode 100644 vendor/github.com/Azure/azure-kusto-go/azkustodata/value/value.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/data/table/from_kusto.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/data/table/table.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/data/value/bool.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/data/value/datetime.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/data/value/decimal.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/data/value/guid.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/data/value/int.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/data/value/long.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/data/value/real.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/data/value/value.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/doc.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/internal/frames/frames.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/internal/frames/unmarshal/json/README.md delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/internal/frames/unmarshal/json/decode.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/internal/frames/unmarshal/json/encode.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/internal/frames/unmarshal/json/fold.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/internal/frames/unmarshal/json/indent.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/internal/frames/unmarshal/json/scanner.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/internal/frames/unmarshal/json/stream.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/internal/frames/unmarshal/json/tables.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/internal/frames/unmarshal/json/tags.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/internal/frames/unmarshal/unmarshal.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/internal/frames/v1/decoder.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/internal/frames/v1/v1.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/internal/frames/v2/decoder.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/internal/frames/v2/v2.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/internal/log/log.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/kql/query_parameters.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/kql/value.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/kusto.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/mock.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/query_builder.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/reader.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/statemachine.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/to_kusto.go delete mode 100644 vendor/github.com/Azure/azure-kusto-go/kusto/unsafe/unsafe.go create mode 100644 vendor/github.com/IBM/sarama/sockopt_other.go create mode 100644 vendor/github.com/IBM/sarama/sockopt_posix.go delete mode 100644 vendor/github.com/InfluxCommunity/influxdb3-go/v2/influxdb3/gzip/gzip.go create mode 100644 vendor/github.com/InfluxCommunity/influxdb3-go/v2/influxdb3/lineprotocol.go create mode 100644 vendor/github.com/InfluxCommunity/influxdb3-go/v2/influxdb3/partial_write_error.go rename vendor/github.com/aws/aws-sdk-go-v2/{ => config}/internal/ini/errors.go (100%) rename vendor/github.com/aws/aws-sdk-go-v2/{ => config}/internal/ini/ini.go (100%) rename vendor/github.com/aws/aws-sdk-go-v2/{ => config}/internal/ini/parse.go (100%) rename vendor/github.com/aws/aws-sdk-go-v2/{ => config}/internal/ini/sections.go (100%) rename vendor/github.com/aws/aws-sdk-go-v2/{ => config}/internal/ini/strings.go (100%) rename vendor/github.com/aws/aws-sdk-go-v2/{ => config}/internal/ini/token.go (100%) rename vendor/github.com/aws/aws-sdk-go-v2/{ => config}/internal/ini/tokenize.go (100%) rename vendor/github.com/aws/aws-sdk-go-v2/{ => config}/internal/ini/value.go (100%) delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/CHANGELOG.md rename vendor/github.com/aws/aws-sdk-go-v2/internal/{ini => v4a}/LICENSE.txt (100%) create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/credentials.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/error.go rename vendor/github.com/aws/aws-sdk-go-v2/internal/{ini => v4a}/go_module_metadata.go (74%) create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/internal/crypto/compare.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/internal/crypto/ecc.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/internal/v4/const.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/internal/v4/header_rules.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/internal/v4/headers.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/internal/v4/hmac.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/internal/v4/host.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/internal/v4/time.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/internal/v4/util.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/middleware.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/presign_middleware.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/smithy.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/v4a.go create mode 100644 vendor/github.com/aws/smithy-go/AGENTS.md create mode 100644 vendor/github.com/aws/smithy-go/endpoints/private/rulesfn/split.go delete mode 100644 vendor/github.com/dgryski/go-rendezvous/LICENSE delete mode 100644 vendor/github.com/dgryski/go-rendezvous/rdv.go delete mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/notifications/notifications_destination_scope.go delete mode 100644 vendor/github.com/newrelic/newrelic-client-go/v2/pkg/notifications/types_scope.go create mode 100644 vendor/github.com/redis/go-redis/v9/dial_retry_backoff.go create mode 100644 vendor/github.com/redis/go-redis/v9/internal/hashtag/rendezvous.go create mode 100644 vendor/go.temporal.io/api/callback/v1/message.go-helpers.pb.go create mode 100644 vendor/go.temporal.io/api/callback/v1/message.pb.go create mode 100644 vendor/go.temporal.io/api/compute/v1/config.go-helpers.pb.go create mode 100644 vendor/go.temporal.io/api/compute/v1/config.pb.go create mode 100644 vendor/go.temporal.io/api/compute/v1/provider.go-helpers.pb.go create mode 100644 vendor/go.temporal.io/api/compute/v1/provider.pb.go create mode 100644 vendor/go.temporal.io/api/compute/v1/scaler.go-helpers.pb.go create mode 100644 vendor/go.temporal.io/api/compute/v1/scaler.pb.go create mode 100644 vendor/go.temporal.io/api/protometa/v1/annotations.go-helpers.pb.go create mode 100644 vendor/go.temporal.io/api/protometa/v1/annotations.pb.go create mode 100644 vendor/go.temporal.io/api/proxy/request_header.go create mode 100644 vendor/go.temporal.io/api/serviceerror/nexus_operation_execution_already_started.go create mode 100644 vendor/go.temporal.io/sdk/converter/extstore.go create mode 100644 vendor/go.temporal.io/sdk/converter/payload_handler.go create mode 100644 vendor/go.temporal.io/sdk/converter/serialization_context.go create mode 100644 vendor/go.temporal.io/sdk/internal/extstore/extstore.go create mode 100644 vendor/go.temporal.io/sdk/internal/extstore/internal_extstore.go create mode 100644 vendor/go.temporal.io/sdk/internal/payload_limits.go create mode 100644 vendor/go.temporal.io/sdk/internal/payload_visitor.go create mode 100644 vendor/go.temporal.io/sdk/internal/temporalapi/sdk/v1/external_storage.pb.go create mode 100644 vendor/go.temporal.io/sdk/internal/temporalapi/sdk/v1/external_storage.proto delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_windows_arm64.go rename vendor/golang.org/x/tools/internal/gcimporter/{ureader_yes.go => ureader.go} (88%) delete mode 100644 vendor/golang.org/x/tools/internal/imports/source_modindex.go delete mode 100644 vendor/golang.org/x/tools/internal/modindex/directories.go delete mode 100644 vendor/golang.org/x/tools/internal/modindex/index.go delete mode 100644 vendor/golang.org/x/tools/internal/modindex/lookup.go delete mode 100644 vendor/golang.org/x/tools/internal/modindex/modindex.go delete mode 100644 vendor/golang.org/x/tools/internal/modindex/symbols.go diff --git a/go.mod b/go.mod index 39e3328c861..a5403d2bcef 100644 --- a/go.mod +++ b/go.mod @@ -24,13 +24,13 @@ replace ( require ( cloud.google.com/go/compute/metadata v0.9.0 - cloud.google.com/go/monitoring v1.25.0 - cloud.google.com/go/secretmanager v1.17.0 - cloud.google.com/go/storage v1.62.0 + cloud.google.com/go/monitoring v1.28.0 + cloud.google.com/go/secretmanager v1.20.0 + cloud.google.com/go/storage v1.62.1 dario.cat/mergo v1.0.2 github.com/Azure/azure-amqp-common-go/v4 v4.2.0 - github.com/Azure/azure-kusto-go v0.16.1 - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0 + github.com/Azure/azure-kusto-go/azkustodata v1.2.2 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.1 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventhubs/v2 v2.0.2 github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus v1.10.0 @@ -43,21 +43,21 @@ require ( github.com/AzureAD/microsoft-authentication-library-for-go v1.7.1 github.com/DataDog/datadog-api-client-go v1.16.0 github.com/Huawei/gophercloud v1.0.21 - github.com/IBM/sarama v1.47.0 - github.com/InfluxCommunity/influxdb3-go/v2 v2.13.0 + github.com/IBM/sarama v1.48.0 + github.com/InfluxCommunity/influxdb3-go/v2 v2.14.0 github.com/arangodb/go-driver v1.6.9 github.com/aws/aws-msk-iam-sasl-signer-go v1.0.4 - github.com/aws/aws-sdk-go-v2 v1.41.5 - github.com/aws/aws-sdk-go-v2/config v1.32.14 - github.com/aws/aws-sdk-go-v2/credentials v1.19.14 - github.com/aws/aws-sdk-go-v2/service/amp v1.42.9 - github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.56.0 - github.com/aws/aws-sdk-go-v2/service/dynamodb v1.57.1 - github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.32.14 - github.com/aws/aws-sdk-go-v2/service/kinesis v1.43.5 - github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.41.5 - github.com/aws/aws-sdk-go-v2/service/sqs v1.42.25 - github.com/aws/aws-sdk-go-v2/service/sts v1.41.10 + github.com/aws/aws-sdk-go-v2 v1.41.7 + github.com/aws/aws-sdk-go-v2/config v1.32.17 + github.com/aws/aws-sdk-go-v2/credentials v1.19.16 + github.com/aws/aws-sdk-go-v2/service/amp v1.42.11 + github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.57.0 + github.com/aws/aws-sdk-go-v2/service/dynamodb v1.57.3 + github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.32.16 + github.com/aws/aws-sdk-go-v2/service/kinesis v1.43.7 + github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.41.7 + github.com/aws/aws-sdk-go-v2/service/sqs v1.42.27 + github.com/aws/aws-sdk-go-v2/service/sts v1.42.1 github.com/beanstalkd/go-beanstalk v0.2.0 github.com/bradleyfalzon/ghinstallation/v2 v2.18.0 github.com/cloudevents/sdk-go/v2 v2.16.2 @@ -69,7 +69,7 @@ require ( github.com/go-kivik/kivik/v3 v3.2.4 github.com/go-logr/logr v1.4.3 github.com/go-playground/validator/v10 v10.30.2 - github.com/go-sql-driver/mysql v1.9.3 + github.com/go-sql-driver/mysql v1.10.0 github.com/gobwas/glob v0.2.3 github.com/gocql/gocql v1.7.0 github.com/google/go-cmp v0.7.0 @@ -86,9 +86,9 @@ require ( github.com/microsoft/azure-devops-go-api/azuredevops v1.0.0-b5 github.com/mitchellh/hashstructure v1.1.0 github.com/mitchellh/mapstructure v1.5.0 - github.com/newrelic/newrelic-client-go/v2 v2.82.0 - github.com/onsi/ginkgo/v2 v2.28.1 - github.com/onsi/gomega v1.39.1 + github.com/newrelic/newrelic-client-go/v2 v2.83.1 + github.com/onsi/ginkgo/v2 v2.28.3 + github.com/onsi/gomega v1.40.0 github.com/open-policy-agent/cert-controller v0.16.0 github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5 github.com/pkg/errors v0.9.1 @@ -96,34 +96,34 @@ require ( github.com/prometheus/client_model v0.6.2 github.com/prometheus/common v0.67.5 github.com/prometheus/prometheus v0.310.0 - github.com/rabbitmq/amqp091-go v1.10.0 + github.com/rabbitmq/amqp091-go v1.11.0 github.com/rcrowley/go-metrics v0.0.0-20250401214520-65e299d6c5c9 - github.com/redis/go-redis/v9 v9.18.0 + github.com/redis/go-redis/v9 v9.19.0 github.com/robfig/cron/v3 v3.0.1 - github.com/segmentio/kafka-go v0.4.50 + github.com/segmentio/kafka-go v0.4.51 github.com/segmentio/kafka-go/sasl/aws_msk_iam_v2 v0.1.0 github.com/signalfx/signalflow-client-go/v2 v2.3.0 - github.com/solarwinds/swo-sdk-go/swov1 v0.13.2 + github.com/solarwinds/swo-sdk-go/swov1 v0.14.0 github.com/spf13/pflag v1.0.10 github.com/stretchr/testify v1.11.1 github.com/tidwall/gjson v1.18.0 github.com/xdg-go/scram v1.2.0 github.com/xhit/go-str2duration/v2 v2.1.0 github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 - go.etcd.io/etcd/client/v3 v3.6.10 + go.etcd.io/etcd/client/v3 v3.6.11 go.mongodb.org/mongo-driver v1.17.9 go.opentelemetry.io/otel v1.43.0 go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.43.0 go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.43.0 go.opentelemetry.io/otel/metric v1.43.0 go.opentelemetry.io/otel/sdk/metric v1.43.0 - go.temporal.io/sdk v1.41.1 + go.temporal.io/sdk v1.43.0 go.uber.org/automaxprocs v1.6.0 go.uber.org/mock v0.6.0 - golang.org/x/crypto v0.49.0 + golang.org/x/crypto v0.50.0 golang.org/x/oauth2 v0.36.0 golang.org/x/sync v0.20.0 - google.golang.org/api v0.275.0 + google.golang.org/api v0.277.0 google.golang.org/grpc v1.80.0 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.6.1 google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af @@ -147,15 +147,17 @@ require ( sigs.k8s.io/kustomize/kustomize/v5 v5.8.1 ) +require github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.24 // indirect + require ( cel.dev/expr v0.25.1 // indirect cloud.google.com/go v0.123.0 // indirect cloud.google.com/go/auth v0.20.0 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect - cloud.google.com/go/iam v1.6.0 // indirect + cloud.google.com/go/iam v1.7.0 // indirect code.cloudfoundry.org/clock v1.59.0 // indirect - filippo.io/edwards25519 v1.1.1 // indirect - github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 // indirect + filippo.io/edwards25519 v1.2.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.12.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.2.0 // indirect github.com/Azure/go-amqp v1.5.1 // indirect github.com/DataDog/zstd v1.5.7 // indirect @@ -167,21 +169,20 @@ require ( github.com/ProtonMail/go-crypto v1.3.0 // indirect github.com/andybalholm/brotli v1.2.0 // indirect github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/apache/arrow-go/v18 v18.5.1 // indirect + github.com/apache/arrow-go/v18 v18.5.2 // indirect github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.8 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.21 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.21 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.8.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.7 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.21 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.21 // indirect - github.com/aws/aws-sdk-go-v2/service/signin v1.0.9 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.30.15 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.19 // indirect - github.com/aws/smithy-go v1.24.2 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.10 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.23 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.23 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.23 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.9 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.23 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.23 // indirect + github.com/aws/aws-sdk-go-v2/service/signin v1.0.11 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.30.17 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.21 // indirect + github.com/aws/smithy-go v1.25.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bitfield/gotestdox v0.2.2 // indirect github.com/blang/semver/v4 v4.0.0 // indirect @@ -196,7 +197,6 @@ require ( github.com/coreos/go-systemd/v22 v22.7.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dennwc/varint v1.0.0 // indirect - github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/dnephin/pflag v1.0.7 // indirect github.com/eapache/go-resiliency v1.7.0 // indirect github.com/eapache/queue v1.1.0 // indirect @@ -249,11 +249,11 @@ require ( github.com/google/gnostic-models v0.7.1 // indirect github.com/google/go-github/v84 v84.0.0 // indirect github.com/google/go-querystring v1.2.0 // indirect - github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 // indirect + github.com/google/pprof v0.0.0-20260402051712-545e8a4df936 // indirect github.com/google/s2a-go v0.1.9 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.3.14 // indirect - github.com/googleapis/gax-go/v2 v2.21.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.15 // indirect + github.com/googleapis/gax-go/v2 v2.22.0 // indirect github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect github.com/grafana/regexp v0.0.0-20250905093917-f7b3be9d1853 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect @@ -285,7 +285,7 @@ require ( github.com/jcmturner/rpc/v2 v2.0.3 // indirect github.com/jpillora/backoff v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.18.4 // indirect + github.com/klauspost/compress v1.18.5 // indirect github.com/klauspost/cpuid/v2 v2.3.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/leodido/go-urn v1.4.0 // indirect @@ -305,7 +305,7 @@ require ( github.com/nexus-rpc/sdk-go v0.6.0 // indirect github.com/oapi-codegen/runtime v1.1.2 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/pierrec/lz4/v4 v4.1.25 // indirect + github.com/pierrec/lz4/v4 v4.1.26 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect @@ -337,8 +337,8 @@ require ( github.com/xdg-go/stringprep v1.0.4 // indirect github.com/xlab/treeprint v1.2.0 // indirect github.com/zeebo/xxh3 v1.1.0 // indirect - go.etcd.io/etcd/api/v3 v3.6.10 // indirect - go.etcd.io/etcd/client/pkg/v3 v3.6.10 // indirect + go.etcd.io/etcd/api/v3 v3.6.11 // indirect + go.etcd.io/etcd/client/pkg/v3 v3.6.11 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/detectors/gcp v1.39.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.67.0 // indirect @@ -348,26 +348,26 @@ require ( go.opentelemetry.io/otel/sdk v1.43.0 // indirect go.opentelemetry.io/otel/trace v1.43.0 // indirect go.opentelemetry.io/proto/otlp v1.10.0 // indirect - go.temporal.io/api v1.62.2 // indirect + go.temporal.io/api v1.62.11 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.1 go.yaml.in/yaml/v2 v2.4.4 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/exp v0.0.0-20260112195511-716be5621a96 - golang.org/x/mod v0.34.0 // indirect - golang.org/x/net v0.52.0 // indirect - golang.org/x/sys v0.42.0 // indirect - golang.org/x/telemetry v0.0.0-20260311193753-579e4da9a98c // indirect - golang.org/x/term v0.41.0 // indirect - golang.org/x/text v0.35.0 // indirect + golang.org/x/mod v0.35.0 // indirect + golang.org/x/net v0.53.0 // indirect + golang.org/x/sys v0.43.0 // indirect + golang.org/x/telemetry v0.0.0-20260409153401-be6f6cb8b1fa // indirect + golang.org/x/term v0.42.0 // indirect + golang.org/x/text v0.36.0 // indirect golang.org/x/time v0.15.0 // indirect - golang.org/x/tools v0.43.0 // indirect + golang.org/x/tools v0.44.0 // indirect golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect google.golang.org/genproto v0.0.0-20260319201613-d00831a3d3e7 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260427160629-7cedc36a6bc4 // indirect gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect diff --git a/go.sum b/go.sum index 4a4b44adefc..1bfb4d81957 100644 --- a/go.sum +++ b/go.sum @@ -19,20 +19,20 @@ cloud.google.com/go/compute/metadata v0.9.0 h1:pDUj4QMoPejqq20dK0Pg2N4yG9zIkYGdB cloud.google.com/go/compute/metadata v0.9.0/go.mod h1:E0bWwX5wTnLPedCKqk3pJmVgCBSM6qQI1yTBdEb3C10= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/iam v1.6.0 h1:JiSIcEi38dWBKhB3BtfKCW+dMvCZJEhBA2BsaGJgoxs= -cloud.google.com/go/iam v1.6.0/go.mod h1:ZS6zEy7QHmcNO18mjO2viYv/n+wOUkhJqGNkPPGueGU= +cloud.google.com/go/iam v1.7.0 h1:JD3zh0C6LHl16aCn5Akff0+GELdp1+4hmh6ndoFLl8U= +cloud.google.com/go/iam v1.7.0/go.mod h1:tetWZW1PD/m6vcuY2Zj/aU0eCHNPuxedbnbRTyKXvdY= cloud.google.com/go/logging v1.13.2 h1:qqlHCBvieJT9Cdq4QqYx1KPadCQ2noD4FK02eNqHAjA= cloud.google.com/go/logging v1.13.2/go.mod h1:zaybliM3yun1J8mU2dVQ1/qDzjbOqEijZCn6hSBtKak= -cloud.google.com/go/longrunning v0.8.0 h1:LiKK77J3bx5gDLi4SMViHixjD2ohlkwBi+mKA7EhfW8= -cloud.google.com/go/longrunning v0.8.0/go.mod h1:UmErU2Onzi+fKDg2gR7dusz11Pe26aknR4kHmJJqIfk= -cloud.google.com/go/monitoring v1.25.0 h1:HnsTIOxTN6BCSkt1P/Im23r1m7MHTTpmSYCzPkW7NK4= -cloud.google.com/go/monitoring v1.25.0/go.mod h1:wlj6rX+JGyusw/8+2duW4cJ6kmDHGmde3zMTJuG3Jpc= +cloud.google.com/go/longrunning v0.9.0 h1:0EzbDEGsAvOZNbqXopgniY0w0a1phvu5IdUFq8grmqY= +cloud.google.com/go/longrunning v0.9.0/go.mod h1:pkTz846W7bF4o2SzdWJ40Hu0Re+UoNT6Q5t+igIcb8E= +cloud.google.com/go/monitoring v1.28.0 h1:jOe0Wkm+a56ptZnEeyHevXo7+KPWAPPP5wUTEJdP7GY= +cloud.google.com/go/monitoring v1.28.0/go.mod h1:72NOVjJXHY/HBfoLT0+qlCZBT059+9VXLeAnL2PeeVM= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/secretmanager v1.17.0 h1:rji2m9dikfOxUvYxgJ5XpSvDtwqjouqKFAPp4Hgfyto= -cloud.google.com/go/secretmanager v1.17.0/go.mod h1:ojzpR7KA2il9qcmBYaysgHsclj8nMcCL/Hc+WYxUsGA= +cloud.google.com/go/secretmanager v1.20.0 h1:GjE3NoyFXo7ipRPy26PMmg4oRX1Ra8fswH45r16rWV0= +cloud.google.com/go/secretmanager v1.20.0/go.mod h1:9OmSuOeiiUicANglrbdKWSnT3gYkRcXuUQDk7dDW0zU= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.62.0 h1:w2pQJhpUqVerMON45vatE2FpCYsNTf7OHjkn6ux5mMU= -cloud.google.com/go/storage v1.62.0/go.mod h1:T5hz3qzcpnxZ5LdKc7y8Tw7lh4v9zeeVyrD/cLJAzZU= +cloud.google.com/go/storage v1.62.1 h1:Os0G3XbUbjZumkpDUf2Y0rLoXJTCF1kU2kWUujKYXD8= +cloud.google.com/go/storage v1.62.1/go.mod h1:cpYz/kRVZ+UQAF1uHeea10/9ewcRbxGoGNKsS9daSXA= cloud.google.com/go/trace v1.11.7 h1:kDNDX8JkaAG3R2nq1lIdkb7FCSi1rCmsEtKVsty7p+U= cloud.google.com/go/trace v1.11.7/go.mod h1:TNn9d5V3fQVf6s4SCveVMIBS2LJUqo73GACmq/Tky0s= code.cloudfoundry.org/clock v0.0.0-20180518195852-02e53af36e6c/go.mod h1:QD9Lzhd/ux6eNQVUDVRJX/RKTigpewimNYBi7ivZKY8= @@ -41,21 +41,20 @@ code.cloudfoundry.org/clock v1.59.0/go.mod h1:M0p5X+TwhnApXGzFGs/sU8aD31LEHQILD8 dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8= dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.1.1 h1:YpjwWWlNmGIDyXOn8zLzqiD+9TyIlPhGFG96P39uBpw= -filippo.io/edwards25519 v1.1.1/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= +filippo.io/edwards25519 v1.2.0 h1:crnVqOiS4jqYleHd9vaKZ+HKtHfllngJIiOpNpoJsjo= +filippo.io/edwards25519 v1.2.0/go.mod h1:xzAOLCNug/yB62zG1bQ8uziwrIqIuxhctzJT18Q77mc= github.com/Azure/azure-amqp-common-go/v4 v4.2.0 h1:q/jLx1KJ8xeI8XGfkOWMN9XrXzAfVTkyvCxPvHCjd2I= github.com/Azure/azure-amqp-common-go/v4 v4.2.0/go.mod h1:GD3m/WPPma+621UaU6KNjKEo5Hl09z86viKwQjTpV0Q= -github.com/Azure/azure-kusto-go v0.16.1 h1:vCBWcQghmC1qIErUUgVNWHxGhZVStu1U/hki6iBA14k= -github.com/Azure/azure-kusto-go v0.16.1/go.mod h1:9F2zvXH8B6eWzgI1S4k1ZXAIufnBZ1bv1cW1kB1n3D0= -github.com/Azure/azure-sdk-for-go v68.0.0+incompatible h1:fcYLmCpyNYRnvJbPerq7U0hS+6+I79yEDJBqVNcqUzU= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0 h1:fou+2+WFTib47nS+nz/ozhEBnvU96bKHy6LjRsY4E28= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0/go.mod h1:t76Ruy8AHvUAC8GfMWJMa0ElSbuIcO03NLpynfbgsPA= +github.com/Azure/azure-kusto-go/azkustodata v1.2.2 h1:N0wIf3Yg5hy2ZFoJbQG2oSsZ9SaUkC28UuqdgOMiNEg= +github.com/Azure/azure-kusto-go/azkustodata v1.2.2/go.mod h1:nVZRkSE5p7eT2k9jMWSo9Uosi/H6Lig2pxtETP+rX/U= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.1 h1:jHb/wfvRikGdxMXYV3QG/SzUOPYN9KEUUuC0Yd0/vC0= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.1/go.mod h1:pzBXCYn05zvYIrwLgtK8Ap8QcjRg+0i76tMQdWN6wOk= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 h1:Hk5QBxZQC1jb2Fwj6mpzme37xbCDdNTxU7O9eb5+LB4= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1/go.mod h1:IYus9qsFobWIc2YVwe/WPjcnyCkPKtnHAqUYeebc8z0= 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.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/internal v1.12.0 h1:fhqpLE3UEXi9lPaBRpQ6XuRW0nU7hgg4zlmZZa+a9q4= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.12.0/go.mod h1:7dCRMLwisfRH3dBupKeNCioWYUZ4SS09Z14H+7i8ZoY= github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventhubs/v2 v2.0.2 h1:EBiOwZYJUMsjLGJ9x0oNY6ADf+5915P/jhhVcn42KXc= github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventhubs/v2 v2.0.2/go.mod h1:NjuxmUsBJ0Ya9Xxjhjo06bj3/QB4C8z838I5S88UtQQ= github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus v1.10.0 h1:kE5kpeiSqu4jcCQ/sWuyggMXJ/pT6oQ99+8hwPmyeJ0= @@ -104,10 +103,10 @@ github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapp github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.55.0/go.mod h1:Mf6O40IAyB9zR/1J8nGDDPirZQQPbYJni8Yisy7NTMc= github.com/Huawei/gophercloud v1.0.21 h1:HhtzZzRGZiVmLypqHlXrGAcdC1TJW99FLewfPSVktpY= github.com/Huawei/gophercloud v1.0.21/go.mod h1:TUtAO2PE+Nj7/QdfUXbhi5Xu0uFKVccyukPA7UCxD9w= -github.com/IBM/sarama v1.47.0 h1:GcQFEd12+KzfPYeLgN69Fh7vLCtYRhVIx0rO4TZO318= -github.com/IBM/sarama v1.47.0/go.mod h1:7gLLIU97nznOmA6TX++Qds+DRxH89P2XICY2KAQUzAY= -github.com/InfluxCommunity/influxdb3-go/v2 v2.13.0 h1:IQVpiJ0t92OsJXf/RJ0+HHoIbK3mgJaMntEfLRgxS9Q= -github.com/InfluxCommunity/influxdb3-go/v2 v2.13.0/go.mod h1:fXhSEgDgX7iv++4t5cFVKRB6kqqeLjRRf5d2IlUdiWw= +github.com/IBM/sarama v1.48.0 h1:9LJS0VNeg/boXxT/GLAMDKX6uSQ1mr/5F/j4v9gSeBQ= +github.com/IBM/sarama v1.48.0/go.mod h1:UhvwPF8zilmLOSd6O+ENzdycCJYwMww1U9DJOZpoCro= +github.com/InfluxCommunity/influxdb3-go/v2 v2.14.0 h1:Skq01dA9mg8t3hT6aXCOrLT8JXDkBlkKG6QHc00N0A4= +github.com/InfluxCommunity/influxdb3-go/v2 v2.14.0/go.mod h1:Z/06RuGqfH0pSRPNsKPJ8HwQcKJEtaNynZ4wUG+9OAo= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0= github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= @@ -124,8 +123,8 @@ github.com/andybalholm/brotli v1.2.0 h1:ukwgCxwYrmACq68yiUqwIWnGY0cTPox/M94sVwTo github.com/andybalholm/brotli v1.2.0/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY= github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= -github.com/apache/arrow-go/v18 v18.5.1 h1:yaQ6zxMGgf9YCYw4/oaeOU3AULySDlAYDOcnr4LdHdI= -github.com/apache/arrow-go/v18 v18.5.1/go.mod h1:OCCJsmdq8AsRm8FkBSSmYTwL/s4zHW9CqxeBxEytkNE= +github.com/apache/arrow-go/v18 v18.5.2 h1:3uoHjoaEie5eVsxx/Bt64hKwZx4STb+beAkqKOlq/lY= +github.com/apache/arrow-go/v18 v18.5.2/go.mod h1:yNoizNTT4peTciJ7V01d2EgOkE1d0fQ1vZcFOsVtFsw= github.com/apache/thrift v0.22.0 h1:r7mTJdj51TMDe6RtcmNdQxgn9XcyfGDOzegMDRg47uc= github.com/apache/thrift v0.22.0/go.mod h1:1e7J/O1Ae6ZQMTYdy9xa3w9k+XHWPfRvdPyJeynQ+/g= github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ= @@ -144,63 +143,63 @@ github.com/aws/aws-msk-iam-sasl-signer-go v1.0.4/go.mod h1:MVYeeOhILFFemC/XlYTCl github.com/aws/aws-sdk-go v1.55.7 h1:UJrkFq7es5CShfBwlWAC8DA077vp8PyVbQd3lqLiztE= github.com/aws/aws-sdk-go v1.55.7/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= github.com/aws/aws-sdk-go-v2 v1.16.12/go.mod h1:C+Ym0ag2LIghJbXhfXZ0YEEp49rBWowxKzJLUoob0ts= -github.com/aws/aws-sdk-go-v2 v1.41.5 h1:dj5kopbwUsVUVFgO4Fi5BIT3t4WyqIDjGKCangnV/yY= -github.com/aws/aws-sdk-go-v2 v1.41.5/go.mod h1:mwsPRE8ceUUpiTgF7QmQIJ7lgsKUPQOUl3o72QBrE1o= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.8 h1:eBMB84YGghSocM7PsjmmPffTa+1FBUeNvGvFou6V/4o= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.8/go.mod h1:lyw7GFp3qENLh7kwzf7iMzAxDn+NzjXEAGjKS2UOKqI= +github.com/aws/aws-sdk-go-v2 v1.41.7 h1:DWpAJt66FmnnaRIOT/8ASTucrvuDPZASqhhLey6tLY8= +github.com/aws/aws-sdk-go-v2 v1.41.7/go.mod h1:4LAfZOPHNVNQEckOACQx60Y8pSRjIkNZQz1w92xpMJc= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.10 h1:gx1AwW1Iyk9Z9dD9F4akX5gnN3QZwUB20GGKH/I+Rho= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.10/go.mod h1:qqY157uZoqm5OXq/amuaBJyC9hgBCBQnsaWnPe905GY= github.com/aws/aws-sdk-go-v2/config v1.17.2/go.mod h1:jumS/AMwul4WaG8vyXsF6kUndG9zndR+yfYBwl4i9ds= -github.com/aws/aws-sdk-go-v2/config v1.32.14 h1:opVIRo/ZbbI8OIqSOKmpFaY7IwfFUOCCXBsUpJOwDdI= -github.com/aws/aws-sdk-go-v2/config v1.32.14/go.mod h1:U4/V0uKxh0Tl5sxmCBZ3AecYny4UNlVmObYjKuuaiOo= +github.com/aws/aws-sdk-go-v2/config v1.32.17 h1:FpL4/758/diKwqbytU0prpuiu60fgXKUWCpDJtApclU= +github.com/aws/aws-sdk-go-v2/config v1.32.17/go.mod h1:OXqUMzgXytfoF9JaKkhrOYsyh72t9G+MJH8mMRaexOE= github.com/aws/aws-sdk-go-v2/credentials v1.12.15/go.mod h1:41zTC6U/78fUD7ZCa5NymTJANDjfqySg5YEAYVFl2Ic= -github.com/aws/aws-sdk-go-v2/credentials v1.19.14 h1:n+UcGWAIZHkXzYt87uMFBv/l8THYELoX6gVcUvgl6fI= -github.com/aws/aws-sdk-go-v2/credentials v1.19.14/go.mod h1:cJKuyWB59Mqi0jM3nFYQRmnHVQIcgoxjEMAbLkpr62w= +github.com/aws/aws-sdk-go-v2/credentials v1.19.16 h1:r3RJBuU7X9ibt8RHbMjWE6y60QbKBiII6wSrXnapxSU= +github.com/aws/aws-sdk-go-v2/credentials v1.19.16/go.mod h1:6cx7zqDENJDbBIIWX6P8s0h6hqHC8Avbjh9Dseo27ug= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.13/go.mod h1:y0eXmsNBFIVjUE8ZBjES8myOHlMsXDz7qGT93+MVdjk= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.21 h1:NUS3K4BTDArQqNu2ih7yeDLaS3bmHD0YndtA6UP884g= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.21/go.mod h1:YWNWJQNjKigKY1RHVJCuupeWDrrHjRqHm0N9rdrWzYI= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.23 h1:UuSfcORqNSz/ey3VPRS8TcVH2Ikf0/sC+Hdj400QI6U= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.23/go.mod h1:+G/OSGiOFnSOkYloKj/9M35s74LgVAdJBSD5lsFfqKg= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.19/go.mod h1:llxE6bwUZhuCas0K7qGiu5OgMis3N7kdWtFSxoHmJ7E= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21 h1:Rgg6wvjjtX8bNHcvi9OnXWwcE0a2vGpbwmtICOsvcf4= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21/go.mod h1:A/kJFst/nm//cyqonihbdpQZwiUhhzpqTsdbhDdRF9c= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.23 h1:GpT/TrnBYuE5gan2cZbTtvP+JlHsutdmlV2YfEyNde0= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.23/go.mod h1:xYWD6BS9ywC5bS3sz9Xh04whO/hzK2plt2Zkyrp4JuA= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.13/go.mod h1:lB12mkZqCSo5PsdBFLNqc2M/OOYgNAy8UtaktyuWvE8= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.21 h1:PEgGVtPoB6NTpPrBgqSE5hE/o47Ij9qk/SEZFbUOe9A= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.21/go.mod h1:p+hz+PRAYlY3zcpJhPwXlLC4C+kqn70WIHwnzAfs6ps= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.23 h1:bpd8vxhlQi2r1hiueOw02f/duEPTMK59Q4QMAoTTtTo= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.23/go.mod h1:15DfR2nw+CRHIk0tqNyifu3G1YdAOy68RftkhMDDwYk= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.20/go.mod h1:bfTcsThj5a9P5pIGRy0QudJ8k4+issxXX+O6Djnd5Cs= -github.com/aws/aws-sdk-go-v2/internal/ini v1.8.6 h1:qYQ4pzQ2Oz6WpQ8T3HvGHnZydA72MnLuFK9tJwmrbHw= -github.com/aws/aws-sdk-go-v2/internal/ini v1.8.6/go.mod h1:O3h0IK87yXci+kg6flUKzJnWeziQUKciKrLjcatSNcY= -github.com/aws/aws-sdk-go-v2/service/amp v1.42.9 h1:cVDX9HGWyTkO7Uyhob3F6437AchuWQHFXlw3PvyWbys= -github.com/aws/aws-sdk-go-v2/service/amp v1.42.9/go.mod h1:oJinOS13qQxDAolkDMtqj8s235f5IKCj4rgAm0pqj2M= -github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.56.0 h1:ud2A364lLBkhGAC7oYw/1xg9BF4acwJC+qdLykxy83o= -github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.56.0/go.mod h1:+bNfizG/fpRGctZuVeH8uWht/0BLD9wUyXOKM4VaCVA= -github.com/aws/aws-sdk-go-v2/service/dynamodb v1.57.1 h1:Vk+a1j2pXZHkkYqHmEdpwe8eX6NDtFSBGfzuauMEWYQ= -github.com/aws/aws-sdk-go-v2/service/dynamodb v1.57.1/go.mod h1:wHrWCwhXZrl2PuCP5t36UTacy9fCHDJ+vw1r3qxTL5M= -github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.32.14 h1:Cnlebj/RmCf/4O3q4suVLLB/SBhbQf4zCQre6Dav+4E= -github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.32.14/go.mod h1:lB9U9zBLviMTUHcHaaJ/vDBkRpHxV5775VJcdnm1DFk= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.7 h1:5EniKhLZe4xzL7a+fU3C2tfUN4nWIqlLesfrjkuPFTY= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.7/go.mod h1:x0nZssQ3qZSnIcePWLvcoFisRXJzcTVvYpAAdYX8+GI= -github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.21 h1:FTg+rVAPx1W21jsO57pxDS1ESy9a/JLFoaHeFubflJA= -github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.21/go.mod h1:92xP4VIS1yO3eF2NPBaHGF4cmyZow8TmFzSaz1nNgzo= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.24 h1:OQqn11BtaYv1WLUowvcA30MpzIu8Ti4pcLPIIyoKZrA= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.24/go.mod h1:X5ZJyfwVrWA96GzPmUCWFQaEARPR7gCrpq2E92PJwAE= +github.com/aws/aws-sdk-go-v2/service/amp v1.42.11 h1:HI9LlMarNX1Eg0ImXP4+360daUKPBahG58ux/GQGobI= +github.com/aws/aws-sdk-go-v2/service/amp v1.42.11/go.mod h1:ttMqUqrgELhbdkEGgstJ3ofCbXtLDrLml47v8jJdH8Y= +github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.57.0 h1:dlkFtYOrwOuM7IIBD6FPLtt0Xvnph+8hqmmbzyowkCk= +github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.57.0/go.mod h1:7900IH3EvTrwNGLNx3QDKnQwPF/Cw+pD9cuvBDQ4org= +github.com/aws/aws-sdk-go-v2/service/dynamodb v1.57.3 h1:XgjzLEE8CrNYnr4Xmi1W5PfKsKMjp4Pu1rWkJNO43JI= +github.com/aws/aws-sdk-go-v2/service/dynamodb v1.57.3/go.mod h1:r7sfLXEN8RUA89tAHy1E7lCtVOOWIkqVy/FbnUdxW1E= +github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.32.16 h1:nWMRNW3SFeJCdK7OsZ9lmbl1AAEAs8s6w5Gsa3MQqNo= +github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.32.16/go.mod h1:IMigEAstzWVC+mYsWLjZB/ZBJBLWON/Fl0zLHxZ18Qk= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.9 h1:FLudkZLt5ci0ozzgkVo8BJGwvqNaZbTWb3UcucAateA= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.9/go.mod h1:w7wZ/s9qK7c8g4al+UyoF1Sp/Z45UwMGcqIzLWVQHWk= +github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.23 h1:3Eo/PBBnjFi1+gYfaL286dpmFSW3mTfodBIybq36Qv4= +github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.23/go.mod h1:3oh+5xGSd1iuxonVb3Qbm+WJYlbhczT9kbzr6doJLzY= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.13/go.mod h1:V390DK4MQxLpDdXxFqizyz8KUxuWImkW/xzgXMz0yyk= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.21 h1:c31//R3xgIJMSC8S6hEVq+38DcvUlgFY0FM6mSI5oto= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.21/go.mod h1:r6+pf23ouCB718FUxaqzZdbpYFyDtehyZcmP5KL9FkA= -github.com/aws/aws-sdk-go-v2/service/kinesis v1.43.5 h1:LxgRVyuY+5DEPSX7kmin/V7toE8MWZ9U8n2dqRtX+RE= -github.com/aws/aws-sdk-go-v2/service/kinesis v1.43.5/go.mod h1:eUebEBEqVfOwEyDDDbGauH4PNqDCuepRvTaNbJeWr5w= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.41.5 h1:z2ayoK3pOvf8ODj/vPR0FgAS5ONruBq0F94SRoW/BIU= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.41.5/go.mod h1:mpZB5HAl4ZIISod9qCi12xZ170TbHX9CCJV5y7nb7QU= -github.com/aws/aws-sdk-go-v2/service/signin v1.0.9 h1:QKZH0S178gCmFEgst8hN0mCX1KxLgHBKKY/CLqwP8lg= -github.com/aws/aws-sdk-go-v2/service/signin v1.0.9/go.mod h1:7yuQJoT+OoH8aqIxw9vwF+8KpvLZ8AWmvmUWHsGQZvI= -github.com/aws/aws-sdk-go-v2/service/sqs v1.42.25 h1:8Bv3TQ1Cob6HLlpUbAnWxeHhAkYScJO9RIHh2WPXaxw= -github.com/aws/aws-sdk-go-v2/service/sqs v1.42.25/go.mod h1:eDstEbM0OEnBUnNQxIA7j74Jy61cCU1S4EMlCtdMwzs= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.23 h1:pbrxO/kuIwgEsOPLkaHu0O+m4fNgLU8B3vxQ+72jTPw= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.23/go.mod h1:/CMNUqoj46HpS3MNRDEDIwcgEnrtZlKRaHNaHxIFpNA= +github.com/aws/aws-sdk-go-v2/service/kinesis v1.43.7 h1:9FvrpWzkSPbm995UGQ4jOdRDuhQLmwgh/5t8UoosTdY= +github.com/aws/aws-sdk-go-v2/service/kinesis v1.43.7/go.mod h1:A7b/tv2nIcdfLY6EfH9fklY+L/wpVo6PtDJ6KA43PKg= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.41.7 h1:JUGKqUnJHbXpS8uyuICP/zpQ+vXUIXW2zTEqjMLCqrY= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.41.7/go.mod h1:l/cqI7ujYqBuTR6Ll13d9/gG/uUdlVzJ1UDltEEBTOo= +github.com/aws/aws-sdk-go-v2/service/signin v1.0.11 h1:TdJ+HdzOBhU8+iVAOGUTU63VXopcumCOF1paFulHWZc= +github.com/aws/aws-sdk-go-v2/service/signin v1.0.11/go.mod h1:R82ZRExE/nheo0N+T8zHPcLRTcH8MGsnR3BiVGX0TwI= +github.com/aws/aws-sdk-go-v2/service/sqs v1.42.27 h1:QgaWXVmNDxv/U/3UIHfGb7ohvtFgerf/bYcYylj4i8E= +github.com/aws/aws-sdk-go-v2/service/sqs v1.42.27/go.mod h1:8S6ExnLprS0oIeA8ZlHkJUJ0BMpKqnRPws/S0jegTqQ= github.com/aws/aws-sdk-go-v2/service/sso v1.11.18/go.mod h1:ytmEi5+qwcSNcV2pVA8PIb1DnKT/0Bu/K4nfJHwoM6c= -github.com/aws/aws-sdk-go-v2/service/sso v1.30.15 h1:lFd1+ZSEYJZYvv9d6kXzhkZu07si3f+GQ1AaYwa2LUM= -github.com/aws/aws-sdk-go-v2/service/sso v1.30.15/go.mod h1:WSvS1NLr7JaPunCXqpJnWk1Bjo7IxzZXrZi1QQCkuqM= +github.com/aws/aws-sdk-go-v2/service/sso v1.30.17 h1:7byT8HUWrgoRp6sXjxtZwgOKfhss5fW6SkLBtqzgRoE= +github.com/aws/aws-sdk-go-v2/service/sso v1.30.17/go.mod h1:xNWknVi4Ezm1vg1QsB/5EWpAJURq22uqd38U8qKvOJc= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.1/go.mod h1:NY+G+8PW0ISyJ7/6t5mgOe6qpJiwZa9Jix05WPscJjg= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.19 h1:dzztQ1YmfPrxdrOiuZRMF6fuOwWlWpD2StNLTceKpys= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.19/go.mod h1:YO8TrYtFdl5w/4vmjL8zaBSsiNp3w0L1FfKVKenZT7w= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.21 h1:+1Kl1zx6bWi4X7cKi3VYh29h8BvsCoHQEQ6ST9X8w7w= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.21/go.mod h1:4vIRDq+CJB2xFAXZ+YgGUTiEft7oAQlhIs71xcSeuVg= github.com/aws/aws-sdk-go-v2/service/sts v1.16.14/go.mod h1:Y+BUV19q3OmQVqNUlbZ40zVi3NM6Biuxwkx/qdSD/CY= -github.com/aws/aws-sdk-go-v2/service/sts v1.41.10 h1:p8ogvvLugcR/zLBXTXrTkj0RYBUdErbMnAFFp12Lm/U= -github.com/aws/aws-sdk-go-v2/service/sts v1.41.10/go.mod h1:60dv0eZJfeVXfbT1tFJinbHrDfSJ2GZl4Q//OSSNAVw= +github.com/aws/aws-sdk-go-v2/service/sts v1.42.1 h1:F/M5Y9I3nwr2IEpshZgh1GeHpOItExNM9L1euNuh/fk= +github.com/aws/aws-sdk-go-v2/service/sts v1.42.1/go.mod h1:mTNxImtovCOEEuD65mKW7DCsL+2gjEH+RPEAexAzAio= github.com/aws/smithy-go v1.13.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= -github.com/aws/smithy-go v1.24.2 h1:FzA3bu/nt/vDvmnkg+R8Xl46gmzEDam6mZ1hzmwXFng= -github.com/aws/smithy-go v1.24.2/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= +github.com/aws/smithy-go v1.25.1 h1:J8ERsGSU7d+aCmdQur5Txg6bVoYelvQJgtZehD12GkI= +github.com/aws/smithy-go v1.25.1/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= 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/beanstalkd/go-beanstalk v0.2.0 h1:6UOJugnu47uNB2jJO/lxyDgeD1Yds7owYi1USELqexA= @@ -265,8 +264,6 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8Yc github.com/dennwc/varint v1.0.0 h1:kGNFFSSw8ToIy3obO/kKr8U9GZYUAxQEVuix4zfDWzE= github.com/dennwc/varint v1.0.0/go.mod h1:hnItb35rvZvJrbTALZtY/iQfDs48JKRG1RPpgziApxA= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dnephin/pflag v1.0.7 h1:oxONGlWxhmUct0YzKTgrpQv9AUA1wtPBn7zuSjJqptk= github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= @@ -394,8 +391,8 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.30.2 h1:JiFIMtSSHb2/XBUbWM4i/MpeQm9ZK2xqPNk8vgvu5JQ= github.com/go-playground/validator/v10 v10.30.2/go.mod h1:mAf2pIOVXjTEBrwUMGKkCWKKPs9NheYGabeB04txQSc= -github.com/go-sql-driver/mysql v1.9.3 h1:U/N249h2WzJ3Ukj8SowVFjdtZKfu9vlLZxjPXV1aweo= -github.com/go-sql-driver/mysql v1.9.3/go.mod h1:qn46aNg1333BRMNU69Lq93t8du/dwxI64Gl8i5p1WMU= +github.com/go-sql-driver/mysql v1.10.0 h1:Q+1LV8DkHJvSYAdR83XzuhDaTykuDx0l6fkXxoWCWfw= +github.com/go-sql-driver/mysql v1.10.0/go.mod h1:M+cqaI7+xxXGG9swrdeUIoPG3Y3KCkF0pZej+SK+nWk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= @@ -477,8 +474,8 @@ github.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9 github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 h1:z2ogiKUYzX5Is6zr/vP9vJGqPwcdqsWjOt+V8J7+bTc= -github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83/go.mod h1:MxpfABSjhmINe3F1It9d+8exIHFvUqtLIRCdOGNXqiI= +github.com/google/pprof v0.0.0-20260402051712-545e8a4df936 h1:EwtI+Al+DeppwYX2oXJCETMO23COyaKGP6fHVpkpWpg= +github.com/google/pprof v0.0.0-20260402051712-545e8a4df936/go.mod h1:MxpfABSjhmINe3F1It9d+8exIHFvUqtLIRCdOGNXqiI= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.9 h1:LGD7gtMgezd8a/Xak7mEWL0PjoTQFvpRudN895yqKW0= github.com/google/s2a-go v0.1.9/go.mod h1:YA0Ei2ZQL3acow2O62kdp9UlnvMmU7kA6Eutn0dXayM= @@ -487,12 +484,12 @@ github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3 github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.3.14 h1:yh8ncqsbUY4shRD5dA6RlzjJaT4hi3kII+zYw8wmLb8= -github.com/googleapis/enterprise-certificate-proxy v0.3.14/go.mod h1:vqVt9yG9480NtzREnTlmGSBmFrA+bzb0yl0TxoBQXOg= +github.com/googleapis/enterprise-certificate-proxy v0.3.15 h1:xolVQTEXusUcAA5UgtyRLjelpFFHWlPQ4XfWGc7MBas= +github.com/googleapis/enterprise-certificate-proxy v0.3.15/go.mod h1:vqVt9yG9480NtzREnTlmGSBmFrA+bzb0yl0TxoBQXOg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.21.0 h1:h45NjjzEO3faG9Lg/cFrBh2PgegVVgzqKzuZl/wMbiI= -github.com/googleapis/gax-go/v2 v2.21.0/go.mod h1:But/NJU6TnZsrLai/xBAQLLz+Hc7fHZJt/hsCz3Fih4= +github.com/googleapis/gax-go/v2 v2.22.0 h1:PjIWBpgGIVKGoCXuiCoP64altEJCj3/Ei+kSU5vlZD4= +github.com/googleapis/gax-go/v2 v2.22.0/go.mod h1:irWBbALSr0Sk3qlqb9SyJ1h68WjgeFuiOzI4Rqw5+aY= github.com/gophercloud/gophercloud v1.14.1 h1:DTCNaTVGl8/cFu58O1JwWgis9gtISAFONqpMKNg/Vpw= github.com/gophercloud/gophercloud v1.14.1/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM= github.com/gopherjs/gopherjs v0.0.0-20180825215210-0210a2f0f73c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -632,8 +629,8 @@ github.com/klauspost/asmfmt v1.3.2 h1:4Ri7ox3EwapiOjCki+hw14RyKk201CN4rzyCJRFLpK github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= github.com/klauspost/compress v1.15.7/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= -github.com/klauspost/compress v1.18.4 h1:RPhnKRAQ4Fh8zU2FY/6ZFDwTVTxgJ/EMydqSTzE9a2c= -github.com/klauspost/compress v1.18.4/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4= +github.com/klauspost/compress v1.18.5 h1:/h1gH5Ce+VWNLSWqPzOVn6XBO+vJbCNGvjoaGBFW2IE= +github.com/klauspost/compress v1.18.5/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ= github.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y= github.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -719,8 +716,8 @@ github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= github.com/neelance/sourcemap v0.0.0-20200213170602-2833bce08e4c/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= -github.com/newrelic/newrelic-client-go/v2 v2.82.0 h1:PZohteCabktrjt2ByINWgNhnzaYQ0FYsXwhE3DJwjmw= -github.com/newrelic/newrelic-client-go/v2 v2.82.0/go.mod h1:kROngr/zeNyxbdOI3zPK4Al+ze32XjLEVUDzjxsKW9g= +github.com/newrelic/newrelic-client-go/v2 v2.83.1 h1:LnnMu7132WZ6LwtgfH+jgwdbuuWKgV5CisjAm3FiMNM= +github.com/newrelic/newrelic-client-go/v2 v2.83.1/go.mod h1:kROngr/zeNyxbdOI3zPK4Al+ze32XjLEVUDzjxsKW9g= github.com/nexus-rpc/sdk-go v0.6.0 h1:QRgnP2zTbxEbiyWG/aXH8uSC5LV/Mg1fqb19jb4DBlo= github.com/nexus-rpc/sdk-go v0.6.0/go.mod h1:FHdPfVQwRuJFZFTF0Y2GOAxCrbIBNrcPna9slkGKPYk= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= @@ -737,11 +734,11 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.28.1 h1:S4hj+HbZp40fNKuLUQOYLDgZLwNUVn19N3Atb98NCyI= -github.com/onsi/ginkgo/v2 v2.28.1/go.mod h1:CLtbVInNckU3/+gC8LzkGUb9oF+e8W8TdUsxPwvdOgE= +github.com/onsi/ginkgo/v2 v2.28.3 h1:4JvMdwtFU0imd8fHx25OJXoDMRexnf8v5NHKYSTTji4= +github.com/onsi/ginkgo/v2 v2.28.3/go.mod h1:+aXOY+vzZ5mu2iI2HpTZUPmM//oQfsNFX6gU9kNcA44= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.39.1 h1:1IJLAad4zjPn2PsnhH70V4DKRFlrCzGBNrNaru+Vf28= -github.com/onsi/gomega v1.39.1/go.mod h1:hL6yVALoTOxeWudERyfppUcZXjMwIMLnuSfruD2lcfg= +github.com/onsi/gomega v1.40.0 h1:Vtol0e1MghCD2ZVIilPDIg44XSL9l2QAn8ZNaljWcJc= +github.com/onsi/gomega v1.40.0/go.mod h1:M/Uqpu/8qTjtzCLUA2zJHX9Iilrau25x1PdoSRbWh5A= github.com/open-policy-agent/cert-controller v0.16.0 h1:/w+wAM9dylWGwhPnvfCgepyBLfyz19PIa8YeaThsQDg= github.com/open-policy-agent/cert-controller v0.16.0/go.mod h1:w5qBWYbc8HwyHI9VYAZ6YjWOcZtQ39A30I9W4X7pVVk= github.com/open-policy-agent/frameworks/constraint v0.0.0-20241101234656-e78c8abd754a h1:gQtOJ50XFyL2Xh3lDD9zP4KQ2PY4mZKQ9hDcWc81Sp8= @@ -758,8 +755,8 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9 github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5 h1:Ii+DKncOVM8Cu1Hc+ETb5K+23HdAMvESYE3ZJ5b5cMI= github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE= github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pierrec/lz4/v4 v4.1.25 h1:kocOqRffaIbU5djlIBr7Wh+cx82C0vtFb0fOurZHqD0= -github.com/pierrec/lz4/v4 v4.1.25/go.mod h1:EoQMVJgeeEOMsCqCzqFm2O0cJvljX2nGZjcRIPL34O4= +github.com/pierrec/lz4/v4 v4.1.26 h1:GrpZw1gZttORinvzBdXPUXATeqlJjqUG/D87TKMnhjY= +github.com/pierrec/lz4/v4 v4.1.26/go.mod h1:EoQMVJgeeEOMsCqCzqFm2O0cJvljX2nGZjcRIPL34O4= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= @@ -788,12 +785,12 @@ github.com/prometheus/prometheus v0.304.2 h1:HhjbaAwet87x8Be19PFI/5W96UMubGy3zt2 github.com/prometheus/prometheus v0.304.2/go.mod h1:ioGx2SGKTY+fLnJSQCdTHqARVldGNS8OlIe3kvp98so= github.com/prometheus/sigv4 v0.1.2 h1:R7570f8AoM5YnTUPFm3mjZH5q2k4D+I/phCWvZ4PXG8= github.com/prometheus/sigv4 v0.1.2/go.mod h1:GF9fwrvLgkQwDdQ5BXeV9XUSCH/IPNqzvAoaohfjqMU= -github.com/rabbitmq/amqp091-go v1.10.0 h1:STpn5XsHlHGcecLmMFCtg7mqq0RnD+zFr4uzukfVhBw= -github.com/rabbitmq/amqp091-go v1.10.0/go.mod h1:Hy4jKW5kQART1u+JkDTF9YYOQUHXqMuhrgxOEeS7G4o= +github.com/rabbitmq/amqp091-go v1.11.0 h1:HxIctVm9Gid/Vtn706necmZ7Wj6pgGI2eqplRbEY8O8= +github.com/rabbitmq/amqp091-go v1.11.0/go.mod h1:Hy4jKW5kQART1u+JkDTF9YYOQUHXqMuhrgxOEeS7G4o= github.com/rcrowley/go-metrics v0.0.0-20250401214520-65e299d6c5c9 h1:bsUq1dX0N8AOIL7EB/X911+m4EHsnWEHeJ0c+3TTBrg= github.com/rcrowley/go-metrics v0.0.0-20250401214520-65e299d6c5c9/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/redis/go-redis/v9 v9.18.0 h1:pMkxYPkEbMPwRdenAzUNyFNrDgHx9U+DrBabWNfSRQs= -github.com/redis/go-redis/v9 v9.18.0/go.mod h1:k3ufPphLU5YXwNTUcCRXGxUoF1fqxnhFQmscfkCoDA0= +github.com/redis/go-redis/v9 v9.19.0 h1:XPVaaPSnG6RhYf7p+rmSa9zZfeVAnWsH5h3lxthOm/k= +github.com/redis/go-redis/v9 v9.19.0/go.mod h1:v/M13XI1PVCDcm01VtPFOADfZtHf8YW3baQf57KlIkA= github.com/robertkrimen/otto v0.5.1 h1:avDI4ToRk8k1hppLdYFTuuzND41n37vPGJU7547dGf0= github.com/robertkrimen/otto v0.5.1/go.mod h1:bS433I4Q9p+E5pZLu7r17vP6FkE6/wLxBdmKjoqJXF8= github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ= @@ -815,8 +812,8 @@ github.com/samber/lo v1.52.0 h1:Rvi+3BFHES3A8meP33VPAxiBZX/Aws5RxrschYGjomw= github.com/samber/lo v1.52.0/go.mod h1:4+MXEGsJzbKGaUEQFKBq2xtfuznW9oz/WrgyzMzRoM0= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/segmentio/kafka-go v0.4.34/go.mod h1:GAjxBQJdQMB5zfNA21AhpaqOB2Mu+w3De4ni3Gbm8y0= -github.com/segmentio/kafka-go v0.4.50 h1:mcyC3tT5WeyWzrFbd6O374t+hmcu1NKt2Pu1L3QaXmc= -github.com/segmentio/kafka-go v0.4.50/go.mod h1:Y1gn60kzLEEaW28YshXyk2+VCUKbJ3Qr6DrnT3i4+9E= +github.com/segmentio/kafka-go v0.4.51 h1:JgDPPG75tC1rWIS2Me6MwcvXJ6f49UQ4HjAOef71Hno= +github.com/segmentio/kafka-go v0.4.51/go.mod h1:Y1gn60kzLEEaW28YshXyk2+VCUKbJ3Qr6DrnT3i4+9E= github.com/segmentio/kafka-go/sasl/aws_msk_iam_v2 v0.1.0 h1:Fjet4CFbGyWMbvwWb42PKZwKdpDksSB7eaPi9Ap6EKY= github.com/segmentio/kafka-go/sasl/aws_msk_iam_v2 v0.1.0/go.mod h1:zk5DCsbNtQ0BhooxFaVpLBns0tArkR/xE+4oq2MvCq0= github.com/sergi/go-diff v1.4.0 h1:n/SP9D5ad1fORl+llWyN+D6qoUETXNZARKjyY2/KVCw= @@ -839,8 +836,8 @@ github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9 github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= -github.com/solarwinds/swo-sdk-go/swov1 v0.13.2 h1:/IpJljWCxnGt11x4ZNzclLnm/LO+RUg1AzxI1gmisSw= -github.com/solarwinds/swo-sdk-go/swov1 v0.13.2/go.mod h1:ZgHJ5sJsKmck0rng34NZugA3cXPZ2jxcp2YYErYfsE4= +github.com/solarwinds/swo-sdk-go/swov1 v0.14.0 h1:ZilzluJoaAsTKHguS9icTno7307QWqPG4cCNt0bfXwU= +github.com/solarwinds/swo-sdk-go/swov1 v0.14.0/go.mod h1:ZgHJ5sJsKmck0rng34NZugA3cXPZ2jxcp2YYErYfsE4= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I= github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg= @@ -947,12 +944,12 @@ gitlab.com/flimzy/testy v0.11.0/go.mod h1:tcu652e6AyD5wS8q2JRUI+j5SlwIYsl3yq3ulH go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.4.2 h1:IrUHp260R8c+zYx/Tm8QZr04CX+qWS5PGfPdevhdm1I= go.etcd.io/bbolt v1.4.2/go.mod h1:Is8rSHO/b4f3XigBC0lL0+4FwAQv3HXEEIgFMuKHceM= -go.etcd.io/etcd/api/v3 v3.6.10 h1:jlwjtELjA8yi2VWpOFH+0w0lGr3K6mVDyn0RDB9aaAY= -go.etcd.io/etcd/api/v3 v3.6.10/go.mod h1:pdV4VeFmvhdNjB4LWRkC8ReLyRBAxUOze3GarMhE2sk= -go.etcd.io/etcd/client/pkg/v3 v3.6.10 h1:tBT7podcPhuVbCVkAEzx8bC5I+aqxfLwBN8/As1arrA= -go.etcd.io/etcd/client/pkg/v3 v3.6.10/go.mod h1:WEy3PpwbbEBVRdh1NVJYsuUe/8eyI21PNJRazeD8z/Y= -go.etcd.io/etcd/client/v3 v3.6.10 h1:J598zJ+C/ZPvImypmq5waj84+bovePrlZERHklf34y0= -go.etcd.io/etcd/client/v3 v3.6.10/go.mod h1:iHhUDUcEwaKs1YFq3MgmI9U4zhTVasp/vgdVbFf1RS8= +go.etcd.io/etcd/api/v3 v3.6.11 h1:XFGTgrJ8nak3kB4NgMG8t7NT+lEeuuvKQAqUHKVgkWQ= +go.etcd.io/etcd/api/v3 v3.6.11/go.mod h1:HYfTh0jyh+uFgp6gMbxJteIDYY97yMuYz85Rnw6Gy9o= +go.etcd.io/etcd/client/pkg/v3 v3.6.11 h1:e41mp315Yn3QMGPmEzCyLsMINgJXTY/dX8kM++1csxU= +go.etcd.io/etcd/client/pkg/v3 v3.6.11/go.mod h1:DysuMe/inqRyC/1tjRR6hReH/VV9Lufs27YKSKBWWJg= +go.etcd.io/etcd/client/v3 v3.6.11 h1:LAByD96VmmeuairkvdAcE0RZnrmGz/q3ceeWePo9bwc= +go.etcd.io/etcd/client/v3 v3.6.11/go.mod h1:vOTDMCo+fGPEClJqcFEFSqZ+8e7WKV7AyqJjX//HR2w= go.etcd.io/etcd/pkg/v3 v3.6.4 h1:fy8bmXIec1Q35/jRZ0KOes8vuFxbvdN0aAFqmEfJZWA= go.etcd.io/etcd/pkg/v3 v3.6.4/go.mod h1:kKcYWP8gHuBRcteyv6MXWSN0+bVMnfgqiHueIZnKMtE= go.etcd.io/etcd/server/v3 v3.6.4 h1:LsCA7CzjVt+8WGrdsnh6RhC0XqCsLkBly3ve5rTxMAU= @@ -981,8 +978,8 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.43.0 h1:88Y4s2C8oTui1LGM6bT go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.43.0/go.mod h1:Vl1/iaggsuRlrHf/hfPJPvVag77kKyvrLeD10kpMl+A= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.43.0 h1:RAE+JPfvEmvy+0LzyUA25/SGawPwIUbZ6u0Wug54sLc= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.43.0/go.mod h1:AGmbycVGEsRx9mXMZ75CsOyhSP6MFIcj/6dnG+vhVjk= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.42.0 h1:lSZHgNHfbmQTPfuTmWVkEu8J8qXaQwuV30pjCcAUvP8= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.42.0/go.mod h1:so9ounLcuoRDu033MW/E0AD4hhUjVqswrMF5FoZlBcw= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.43.0 h1:TC+BewnDpeiAmcscXbGMfxkO+mwYUwE/VySwvw88PfA= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.43.0/go.mod h1:J/ZyF4vfPwsSr9xJSPyQ4LqtcTPULFR64KwTikGLe+A= go.opentelemetry.io/otel/metric v1.43.0 h1:d7638QeInOnuwOONPp4JAOGfbCEpYb+K6DVWvdxGzgM= go.opentelemetry.io/otel/metric v1.43.0/go.mod h1:RDnPtIxvqlgO8GRW18W6Z/4P462ldprJtfxHxyKd2PY= go.opentelemetry.io/otel/sdk v1.43.0 h1:pi5mE86i5rTeLXqoF/hhiBtUNcrAGHLKQdhg4h4V9Dg= @@ -993,10 +990,10 @@ go.opentelemetry.io/otel/trace v1.43.0 h1:BkNrHpup+4k4w+ZZ86CZoHHEkohws8AY+WTX09 go.opentelemetry.io/otel/trace v1.43.0/go.mod h1:/QJhyVBUUswCphDVxq+8mld+AvhXZLhe+8WVFxiFff0= go.opentelemetry.io/proto/otlp v1.10.0 h1:IQRWgT5srOCYfiWnpqUYz9CVmbO8bFmKcwYxpuCSL2g= go.opentelemetry.io/proto/otlp v1.10.0/go.mod h1:/CV4QoCR/S9yaPj8utp3lvQPoqMtxXdzn7ozvvozVqk= -go.temporal.io/api v1.62.2 h1:jFhIzlqNyJsJZTiCRQmTIMv6OTQ5BZ57z8gbgLGMaoo= -go.temporal.io/api v1.62.2/go.mod h1:iaxoP/9OXMJcQkETTECfwYq4cw/bj4nwov8b3ZLVnXM= -go.temporal.io/sdk v1.41.1 h1:yOpvsHyDD1lNuwlGBv/SUodCPhjv9nDeC9lLHW/fJUA= -go.temporal.io/sdk v1.41.1/go.mod h1:/InXQT5guZ6AizYzpmzr5avQ/GMgq1ZObcKlKE2AhTc= +go.temporal.io/api v1.62.11 h1:MWDaooDvOJCIRb1atqeZX2ErDPNTsNc3/mMEVEvvaVU= +go.temporal.io/api v1.62.11/go.mod h1:iaxoP/9OXMJcQkETTECfwYq4cw/bj4nwov8b3ZLVnXM= +go.temporal.io/sdk v1.43.0 h1:jHX/T2ZyBVjAtpQ/69NoMS6a+J0CpJAe+naqSB1gkvY= +go.temporal.io/sdk v1.43.0/go.mod h1:w9XuJzV25JhnJqUzxJWJISpp5q/EyeCtRKHvhW3lIoQ= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= @@ -1037,8 +1034,8 @@ golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDf golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw= -golang.org/x/crypto v0.49.0 h1:+Ng2ULVvLHnJ/ZFEq4KdcDd/cfjrrjjNSXNzxg0Y4U4= -golang.org/x/crypto v0.49.0/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtCA= +golang.org/x/crypto v0.50.0 h1:zO47/JPrL6vsNkINmLoo/PH1gcxpls50DNogFvB5ZGI= +golang.org/x/crypto v0.50.0/go.mod h1:3muZ7vA7PBCE6xgPX7nkzzjiUq87kRItoJQM1Yo8S+Q= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1067,8 +1064,8 @@ golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI= -golang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY= +golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM= +golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1101,8 +1098,8 @@ golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds= -golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0= -golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw= +golang.org/x/net v0.53.0 h1:d+qAbo5L0orcWAr0a9JweQpjXF19LMXJE8Ey7hwOdUA= +golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1171,11 +1168,11 @@ golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo= -golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI= +golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= -golang.org/x/telemetry v0.0.0-20260311193753-579e4da9a98c h1:6a8FdnNk6bTXBjR4AGKFgUKuo+7GnR3FX5L7CbveeZc= -golang.org/x/telemetry v0.0.0-20260311193753-579e4da9a98c/go.mod h1:TpUTTEp9frx7rTdLpC9gFG9kdI7zVLFTFFlqaH2Cncw= +golang.org/x/telemetry v0.0.0-20260409153401-be6f6cb8b1fa h1:efT73AJZfAAUV7SOip6pWGkwJDzIGiKBZGVzHYa+ve4= +golang.org/x/telemetry v0.0.0-20260409153401-be6f6cb8b1fa/go.mod h1:kHjTxDEnAu6/Nl9lDkzjWpR+bmKfxeiRuSDlsMb70gE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= @@ -1185,8 +1182,8 @@ golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ= -golang.org/x/term v0.41.0 h1:QCgPso/Q3RTJx2Th4bDLqML4W6iJiaXFq2/ftQF13YU= -golang.org/x/term v0.41.0/go.mod h1:3pfBgksrReYfZ5lvYM0kSO0LIkAl4Yl2bXOkKP7Ec2A= +golang.org/x/term v0.42.0 h1:UiKe+zDFmJobeJ5ggPwOshJIVt6/Ft0rcfrXZDLWAWY= +golang.org/x/term v0.42.0/go.mod h1:Dq/D+snpsbazcBG5+F9Q1n2rXV8Ma+71xEjTRufARgY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -1201,8 +1198,8 @@ golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA= -golang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8= -golang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA= +golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg= +golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1236,8 +1233,8 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= -golang.org/x/tools v0.43.0 h1:12BdW9CeB3Z+J/I/wj34VMl8X+fEXBxVR90JeMX5E7s= -golang.org/x/tools v0.43.0/go.mod h1:uHkMso649BX2cZK6+RpuIPXS3ho2hZo4FVwfoy1vIk0= +golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c= +golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI= golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM= golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated h1:1h2MnaIAIXISqTFKdENegdpAgUXz6NrPEsbIeWaBRvM= @@ -1258,8 +1255,8 @@ google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.275.0 h1:vfY5d9vFVJeWEZT65QDd9hbndr7FyZ2+6mIzGAh71NI= -google.golang.org/api v0.275.0/go.mod h1:Fnag/EWUPIcJXuIkP1pjoTgS5vdxlk3eeemL7Do6bvw= +google.golang.org/api v0.277.0 h1:HJfyJUiNeBBUMai7ez8u14wkp/gH/I4wpGbbO9o+cSk= +google.golang.org/api v0.277.0/go.mod h1:B9TqLBwJqVjp1mtt7WeoQwWRwvu/400y5lETOql+giQ= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1278,8 +1275,8 @@ google.golang.org/genproto v0.0.0-20260319201613-d00831a3d3e7 h1:XzmzkmB14QhVhgn google.golang.org/genproto v0.0.0-20260319201613-d00831a3d3e7/go.mod h1:L43LFes82YgSonw6iTXTxXUX1OlULt4AQtkik4ULL/I= google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9 h1:VPWxll4HlMw1Vs/qXtN7BvhZqsS9cdAittCNvVENElA= google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9/go.mod h1:7QBABkRtR8z+TEnmXTqIqwJLlzrZKVfAUm7tY3yGv0M= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 h1:m8qni9SQFH0tJc1X0vmnpw/0t+AImlSvp30sEupozUg= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260427160629-7cedc36a6bc4 h1:tEkOQcXgF6dH1G+MVKZrfpYvozGrzb91k6ha7jireSM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260427160629-7cedc36a6bc4/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/pkg/scalers/azure/azure_data_explorer.go b/pkg/scalers/azure/azure_data_explorer.go index 846aa910fcc..0d8a3f7b24b 100644 --- a/pkg/scalers/azure/azure_data_explorer.go +++ b/pkg/scalers/azure/azure_data_explorer.go @@ -19,15 +19,15 @@ package azure import ( "context" "fmt" - "io" "net/http" "strconv" - "github.com/Azure/azure-kusto-go/kusto" - "github.com/Azure/azure-kusto-go/kusto/data/table" - "github.com/Azure/azure-kusto-go/kusto/kql" + "github.com/Azure/azure-kusto-go/azkustodata" + "github.com/Azure/azure-kusto-go/azkustodata/kql" + "github.com/Azure/azure-kusto-go/azkustodata/query" + "github.com/Azure/azure-kusto-go/azkustodata/types" + azcore "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" logf "sigs.k8s.io/controller-runtime/pkg/log" kedav1alpha1 "github.com/kedacore/keda/v2/apis/keda/v1alpha1" @@ -49,13 +49,13 @@ type DataExplorerMetadata struct { var azureDataExplorerLogger = logf.Log.WithName("azure_data_explorer_scaler") -func CreateAzureDataExplorerClient(metadata *DataExplorerMetadata, httpClient *http.Client) (*kusto.Client, error) { +func CreateAzureDataExplorerClient(metadata *DataExplorerMetadata, httpClient *http.Client) (*azkustodata.Client, error) { kcsb, err := getDataExplorerAuthConfig(metadata) if err != nil { return nil, fmt.Errorf("failed to get data explorer auth config: %w", err) } - client, err := kusto.New(kcsb, kusto.WithHttpClient(httpClient)) + client, err := azkustodata.New(kcsb, azkustodata.WithHttpClient(httpClient)) if err != nil { return nil, fmt.Errorf("failed to create kusto client: %w", err) } @@ -63,8 +63,8 @@ func CreateAzureDataExplorerClient(metadata *DataExplorerMetadata, httpClient *h return client, nil } -func getDataExplorerAuthConfig(metadata *DataExplorerMetadata) (*kusto.ConnectionStringBuilder, error) { - kcsb := kusto.NewConnectionStringBuilder(metadata.Endpoint) +func getDataExplorerAuthConfig(metadata *DataExplorerMetadata) (*azkustodata.ConnectionStringBuilder, error) { + kcsb := azkustodata.NewConnectionStringBuilder(metadata.Endpoint) switch metadata.PodIdentity.Provider { case "", kedav1alpha1.PodIdentityProviderNone: @@ -81,7 +81,7 @@ func getDataExplorerAuthConfig(metadata *DataExplorerMetadata) (*kusto.Connectio kcsb.WithAadAppKey(metadata.ClientID, metadata.ClientSecret, metadata.TenantID) // This should be here because internally the SDK resets the configuration // after calling `WithAadAppKey` - clientOptions := &policy.ClientOptions{ + clientOptions := &azcore.ClientOptions{ Cloud: cloud.Configuration{ ActiveDirectoryAuthorityHost: metadata.ActiveDirectoryEndpoint, Services: map[cloud.ServiceName]cloud.ServiceConfiguration{}, @@ -104,34 +104,25 @@ func getDataExplorerAuthConfig(metadata *DataExplorerMetadata) (*kusto.Connectio return kcsb, nil } -func GetAzureDataExplorerMetricValue(ctx context.Context, client *kusto.Client, db string, query string) (float64, error) { +func GetAzureDataExplorerMetricValue(ctx context.Context, client *azkustodata.Client, db string, query string) (float64, error) { azureDataExplorerLogger.V(1).Info("Querying Azure Data Explorer", "db", db, "query", query) - iter, err := client.Query(ctx, db, kql.New("").AddUnsafe(query)) + dataset, err := client.Query(ctx, db, kql.New("").AddUnsafe(query)) if err != nil { return -1, fmt.Errorf("failed to get azure data explorer metric result from query %s: %w", query, err) } - defer iter.Stop() - row, inlineError, err := iter.NextRowOrError() - if inlineError != nil { - return -1, fmt.Errorf("failed to get query %s result: %v", query, inlineError) - } - if err != nil { - return -1, fmt.Errorf("failed to get query %s result: %w", query, err) - } - - if !row.ColumnTypes[0].Type.Valid() { - return -1, fmt.Errorf("column type %s is not valid", row.ColumnTypes[0].Type) + tables := dataset.Tables() + if len(tables) == 0 || len(tables[0].Rows()) == 0 { + return -1, fmt.Errorf("query %s has no results", query) } - // Return error if there is more than one row. - _, _, err = iter.NextRowOrError() - if err != io.EOF { + rows := tables[0].Rows() + if len(rows) != 1 { return -1, fmt.Errorf("query %s result had more than a single result row", query) } - metricValue, err := extractDataExplorerMetricValue(row) + metricValue, err := extractDataExplorerMetricValue(rows[0]) if err != nil { return -1, fmt.Errorf("failed to extract value from query %s: %w", query, err) } @@ -139,20 +130,20 @@ func GetAzureDataExplorerMetricValue(ctx context.Context, client *kusto.Client, return metricValue, nil } -func extractDataExplorerMetricValue(row *table.Row) (float64, error) { - if row == nil || len(row.ColumnTypes) == 0 { +func extractDataExplorerMetricValue(row query.Row) (float64, error) { + if row == nil || len(row.Columns()) == 0 { return -1, fmt.Errorf("query has no results") } // Query result validation. - dataType := row.ColumnTypes[0].Type - if dataType != "real" && dataType != "int" && dataType != "long" { + dataType := row.Columns()[0].Type() + if dataType != types.Real && dataType != types.Int && dataType != types.Long { return -1, fmt.Errorf("data type %s is not valid", dataType) } - value, err := strconv.ParseFloat(row.Values[0].String(), 64) + value, err := strconv.ParseFloat(row.Values()[0].String(), 64) if err != nil { - return -1, fmt.Errorf("failed to convert result %s to int", row.Values[0].String()) + return -1, fmt.Errorf("failed to convert result %s to int", row.Values()[0].String()) } if value < 0 { return -1, fmt.Errorf("query result must be >= 0 but received: %f", value) diff --git a/pkg/scalers/azure/azure_data_explorer_test.go b/pkg/scalers/azure/azure_data_explorer_test.go index 3b6ede321a6..eb1bee87df8 100644 --- a/pkg/scalers/azure/azure_data_explorer_test.go +++ b/pkg/scalers/azure/azure_data_explorer_test.go @@ -19,16 +19,15 @@ package azure import ( "testing" - "github.com/Azure/azure-kusto-go/kusto/data/errors" - "github.com/Azure/azure-kusto-go/kusto/data/table" - "github.com/Azure/azure-kusto-go/kusto/data/types" - "github.com/Azure/azure-kusto-go/kusto/data/value" + "github.com/Azure/azure-kusto-go/azkustodata/query" + "github.com/Azure/azure-kusto-go/azkustodata/types" + "github.com/Azure/azure-kusto-go/azkustodata/value" kedav1alpha1 "github.com/kedacore/keda/v2/apis/keda/v1alpha1" ) type testExtractDataExplorerMetricValue struct { - testRow *table.Row + testRow query.Row isError bool } @@ -39,6 +38,7 @@ type testGetDataExplorerAuthConfig struct { var ( clientID = "test_client_id" + columns = query.Columns{query.NewColumn(0, rowName, rowType)} rowName = "result" rowType types.Column = "long" rowValue int64 = 3 @@ -46,19 +46,29 @@ var ( tenantID = "test_tenant_id" ) +func newTestRow(columnType types.Column, rowValue value.Kusto) query.Row { + rowColumns := query.Columns{query.NewColumn(0, rowName, columnType)} + return query.NewRowFromParts(rowColumns, func(name string) query.Column { + if name == rowName { + return rowColumns[0] + } + return nil + }, 0, value.Values{rowValue}) +} + var testExtractDataExplorerMetricValues = []testExtractDataExplorerMetricValue{ // pass - {testRow: &table.Row{ColumnTypes: table.Columns{{Name: rowName, Type: rowType}}, Values: value.Values{value.Long{Value: rowValue, Valid: true}}, Op: errors.OpQuery}, isError: false}, + {testRow: newTestRow(rowType, value.NewLong(rowValue)), isError: false}, // nil row - fail {testRow: nil, isError: true}, // Empty row - fail - {testRow: &table.Row{}, isError: true}, + {testRow: query.NewRowFromParts(nil, func(string) query.Column { return nil }, 0, nil), isError: true}, // Metric value is not bigger than 0 - fail - {testRow: &table.Row{ColumnTypes: table.Columns{{Name: rowName, Type: rowType}}, Values: value.Values{value.Long{Value: -1, Valid: true}}, Op: errors.OpQuery}, isError: true}, + {testRow: newTestRow(rowType, value.NewLong(-1)), isError: true}, // Metric result is invalid - fail - {testRow: &table.Row{ColumnTypes: table.Columns{{Name: rowName, Type: rowType}}, Values: value.Values{value.String{Value: "invalid", Valid: true}}, Op: errors.OpQuery}, isError: true}, + {testRow: newTestRow(rowType, value.NewString("invalid")), isError: true}, // Metric Type is not valid - fail - {testRow: &table.Row{ColumnTypes: table.Columns{{Name: rowName, Type: "String"}}, Values: value.Values{value.Long{Value: rowValue, Valid: true}}, Op: errors.OpQuery}, isError: true}, + {testRow: newTestRow(types.String, value.NewLong(rowValue)), isError: true}, } var testGetDataExplorerAuthConfigs = []testGetDataExplorerAuthConfig{ diff --git a/pkg/scalers/azure_data_explorer_scaler.go b/pkg/scalers/azure_data_explorer_scaler.go index 99c4c2041c2..7f05db5493a 100644 --- a/pkg/scalers/azure_data_explorer_scaler.go +++ b/pkg/scalers/azure_data_explorer_scaler.go @@ -20,7 +20,7 @@ import ( "context" "fmt" - "github.com/Azure/azure-kusto-go/kusto" + "github.com/Azure/azure-kusto-go/azkustodata" "github.com/go-logr/logr" v2 "k8s.io/api/autoscaling/v2" "k8s.io/metrics/pkg/apis/external_metrics" @@ -34,7 +34,7 @@ import ( type azureDataExplorerScaler struct { metricType v2.MetricTargetType metadata *azure.DataExplorerMetadata - client *kusto.Client + client *azkustodata.Client name string namespace string logger logr.Logger diff --git a/vendor/cloud.google.com/go/iam/CHANGES.md b/vendor/cloud.google.com/go/iam/CHANGES.md index 8b73fb4bf3a..69b2eaf6760 100644 --- a/vendor/cloud.google.com/go/iam/CHANGES.md +++ b/vendor/cloud.google.com/go/iam/CHANGES.md @@ -1,6 +1,8 @@ # Changes +## [1.7.0](https://github.com/googleapis/google-cloud-go/releases/tag/iam%2Fv1.7.0) (2026-04-02) + ## [1.6.0](https://github.com/googleapis/google-cloud-go/releases/tag/iam%2Fv1.6.0) (2026-03-26) ### Features diff --git a/vendor/cloud.google.com/go/iam/README.md b/vendor/cloud.google.com/go/iam/README.md index 0072cc9e294..5f525c59416 100644 --- a/vendor/cloud.google.com/go/iam/README.md +++ b/vendor/cloud.google.com/go/iam/README.md @@ -1,8 +1,8 @@ -# IAM API +# Identity and Access Management (IAM) API [![Go Reference](https://pkg.go.dev/badge/cloud.google.com/go/iam.svg)](https://pkg.go.dev/cloud.google.com/go/iam) -Go Client Library for IAM API. +Go Client Library for Identity and Access Management (IAM) API. ## Install @@ -19,6 +19,21 @@ However, a `v1+` module may have breaking changes in two scenarios: * Packages with `alpha` or `beta` in the import path * The GoDoc has an explicit stability disclaimer (for example, for an experimental feature). +### Which package to use? + +Generated client library surfaces can be found in packages whose import path +ends in `.../apivXXX`. The `XXX` could be something like `1` or `2` in the case +of a stable service backend or may be like `1beta2` or `2beta` in the case of a +more experimental service backend. Because of this fact, a given module can have +multiple clients for different service backends. In these cases it is generally +recommended to use clients with stable service backends, with import suffixes like +`apiv1`, unless you need to use features that are only present in a beta backend +or there is not yet a stable backend available. + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples?l=go). + ## Go Version Support See the [Go Versions Supported](https://github.com/googleapis/google-cloud-go#go-versions-supported) diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/alert_policy_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/alert_policy_client.go index a2682025043..0d6b7876603 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/alert_policy_client.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/alert_policy_client.go @@ -26,6 +26,7 @@ import ( monitoringpb "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb" gax "github.com/googleapis/gax-go/v2" + "github.com/googleapis/gax-go/v2/callctx" "google.golang.org/api/iterator" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" @@ -237,6 +238,16 @@ type alertPolicyGRPCClient struct { // Cloud console (at https://console.cloud.google.com/). func NewAlertPolicyClient(ctx context.Context, opts ...option.ClientOption) (*AlertPolicyClient, error) { clientOpts := defaultAlertPolicyGRPCClientOptions() + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{ + "gcp.client.service": "monitoring", + "gcp.client.version": getVersionClient(), + "gcp.client.repo": "googleapis/google-cloud-go", + "gcp.client.artifact": "cloud.google.com/go/monitoring/apiv3/v2", + "gcp.client.language": "go", + "url.domain": "monitoring.googleapis.com", + })) + } if newAlertPolicyClientHook != nil { hookOpts, err := newAlertPolicyClientHook(ctx, clientHookParams{}) if err != nil { @@ -258,6 +269,24 @@ func NewAlertPolicyClient(ctx context.Context, opts ...option.ClientOption) (*Al logger: internaloption.GetLogger(opts), } c.setGoogleClientInfo() + if gax.IsFeatureEnabled("METRICS") { + metrics := gax.NewClientMetrics( + gax.WithTelemetryLogger(c.logger), + gax.WithTelemetryAttributes(map[string]string{ + gax.ClientService: "monitoring", + gax.ClientVersion: getVersionClient(), + gax.ClientArtifact: "cloud.google.com/go/monitoring/apiv3/v2", + gax.RPCSystem: "grpc", + gax.URLDomain: "monitoring.googleapis.com", + }), + ) + + client.CallOptions.ListAlertPolicies = append(client.CallOptions.ListAlertPolicies, gax.WithClientMetrics(metrics)) + client.CallOptions.GetAlertPolicy = append(client.CallOptions.GetAlertPolicy, gax.WithClientMetrics(metrics)) + client.CallOptions.CreateAlertPolicy = append(client.CallOptions.CreateAlertPolicy, gax.WithClientMetrics(metrics)) + client.CallOptions.DeleteAlertPolicy = append(client.CallOptions.DeleteAlertPolicy, gax.WithClientMetrics(metrics)) + client.CallOptions.UpdateAlertPolicy = append(client.CallOptions.UpdateAlertPolicy, gax.WithClientMetrics(metrics)) + } client.internalClient = c @@ -294,6 +323,12 @@ func (c *alertPolicyGRPCClient) ListAlertPolicies(ctx context.Context, req *moni hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.AlertPolicyService/ListAlertPolicies") + } opts = append((*c.CallOptions).ListAlertPolicies[0:len((*c.CallOptions).ListAlertPolicies):len((*c.CallOptions).ListAlertPolicies)], opts...) it := &AlertPolicyIterator{} req = proto.Clone(req).(*monitoringpb.ListAlertPoliciesRequest) @@ -340,6 +375,12 @@ func (c *alertPolicyGRPCClient) GetAlertPolicy(ctx context.Context, req *monitor hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.AlertPolicyService/GetAlertPolicy") + } opts = append((*c.CallOptions).GetAlertPolicy[0:len((*c.CallOptions).GetAlertPolicy):len((*c.CallOptions).GetAlertPolicy)], opts...) var resp *monitoringpb.AlertPolicy err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -358,6 +399,12 @@ func (c *alertPolicyGRPCClient) CreateAlertPolicy(ctx context.Context, req *moni hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.AlertPolicyService/CreateAlertPolicy") + } opts = append((*c.CallOptions).CreateAlertPolicy[0:len((*c.CallOptions).CreateAlertPolicy):len((*c.CallOptions).CreateAlertPolicy)], opts...) var resp *monitoringpb.AlertPolicy err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -376,6 +423,12 @@ func (c *alertPolicyGRPCClient) DeleteAlertPolicy(ctx context.Context, req *moni hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.AlertPolicyService/DeleteAlertPolicy") + } opts = append((*c.CallOptions).DeleteAlertPolicy[0:len((*c.CallOptions).DeleteAlertPolicy):len((*c.CallOptions).DeleteAlertPolicy)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error @@ -390,6 +443,9 @@ func (c *alertPolicyGRPCClient) UpdateAlertPolicy(ctx context.Context, req *moni hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.AlertPolicyService/UpdateAlertPolicy") + } opts = append((*c.CallOptions).UpdateAlertPolicy[0:len((*c.CallOptions).UpdateAlertPolicy):len((*c.CallOptions).UpdateAlertPolicy)], opts...) var resp *monitoringpb.AlertPolicy err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/group_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/group_client.go index 17d5f9ac30f..e251b8ca765 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/group_client.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/group_client.go @@ -26,6 +26,7 @@ import ( monitoringpb "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb" gax "github.com/googleapis/gax-go/v2" + "github.com/googleapis/gax-go/v2/callctx" "google.golang.org/api/iterator" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" @@ -258,6 +259,16 @@ type groupGRPCClient struct { // from the infrastructure. func NewGroupClient(ctx context.Context, opts ...option.ClientOption) (*GroupClient, error) { clientOpts := defaultGroupGRPCClientOptions() + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{ + "gcp.client.service": "monitoring", + "gcp.client.version": getVersionClient(), + "gcp.client.repo": "googleapis/google-cloud-go", + "gcp.client.artifact": "cloud.google.com/go/monitoring/apiv3/v2", + "gcp.client.language": "go", + "url.domain": "monitoring.googleapis.com", + })) + } if newGroupClientHook != nil { hookOpts, err := newGroupClientHook(ctx, clientHookParams{}) if err != nil { @@ -279,6 +290,25 @@ func NewGroupClient(ctx context.Context, opts ...option.ClientOption) (*GroupCli logger: internaloption.GetLogger(opts), } c.setGoogleClientInfo() + if gax.IsFeatureEnabled("METRICS") { + metrics := gax.NewClientMetrics( + gax.WithTelemetryLogger(c.logger), + gax.WithTelemetryAttributes(map[string]string{ + gax.ClientService: "monitoring", + gax.ClientVersion: getVersionClient(), + gax.ClientArtifact: "cloud.google.com/go/monitoring/apiv3/v2", + gax.RPCSystem: "grpc", + gax.URLDomain: "monitoring.googleapis.com", + }), + ) + + client.CallOptions.ListGroups = append(client.CallOptions.ListGroups, gax.WithClientMetrics(metrics)) + client.CallOptions.GetGroup = append(client.CallOptions.GetGroup, gax.WithClientMetrics(metrics)) + client.CallOptions.CreateGroup = append(client.CallOptions.CreateGroup, gax.WithClientMetrics(metrics)) + client.CallOptions.UpdateGroup = append(client.CallOptions.UpdateGroup, gax.WithClientMetrics(metrics)) + client.CallOptions.DeleteGroup = append(client.CallOptions.DeleteGroup, gax.WithClientMetrics(metrics)) + client.CallOptions.ListGroupMembers = append(client.CallOptions.ListGroupMembers, gax.WithClientMetrics(metrics)) + } client.internalClient = c @@ -315,6 +345,12 @@ func (c *groupGRPCClient) ListGroups(ctx context.Context, req *monitoringpb.List hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.GroupService/ListGroups") + } opts = append((*c.CallOptions).ListGroups[0:len((*c.CallOptions).ListGroups):len((*c.CallOptions).ListGroups)], opts...) it := &GroupIterator{} req = proto.Clone(req).(*monitoringpb.ListGroupsRequest) @@ -361,6 +397,12 @@ func (c *groupGRPCClient) GetGroup(ctx context.Context, req *monitoringpb.GetGro hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.GroupService/GetGroup") + } opts = append((*c.CallOptions).GetGroup[0:len((*c.CallOptions).GetGroup):len((*c.CallOptions).GetGroup)], opts...) var resp *monitoringpb.Group err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -379,6 +421,12 @@ func (c *groupGRPCClient) CreateGroup(ctx context.Context, req *monitoringpb.Cre hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.GroupService/CreateGroup") + } opts = append((*c.CallOptions).CreateGroup[0:len((*c.CallOptions).CreateGroup):len((*c.CallOptions).CreateGroup)], opts...) var resp *monitoringpb.Group err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -397,6 +445,9 @@ func (c *groupGRPCClient) UpdateGroup(ctx context.Context, req *monitoringpb.Upd hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.GroupService/UpdateGroup") + } opts = append((*c.CallOptions).UpdateGroup[0:len((*c.CallOptions).UpdateGroup):len((*c.CallOptions).UpdateGroup)], opts...) var resp *monitoringpb.Group err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -415,6 +466,12 @@ func (c *groupGRPCClient) DeleteGroup(ctx context.Context, req *monitoringpb.Del hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.GroupService/DeleteGroup") + } opts = append((*c.CallOptions).DeleteGroup[0:len((*c.CallOptions).DeleteGroup):len((*c.CallOptions).DeleteGroup)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error @@ -429,6 +486,12 @@ func (c *groupGRPCClient) ListGroupMembers(ctx context.Context, req *monitoringp hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.GroupService/ListGroupMembers") + } opts = append((*c.CallOptions).ListGroupMembers[0:len((*c.CallOptions).ListGroupMembers):len((*c.CallOptions).ListGroupMembers)], opts...) it := &MonitoredResourceIterator{} req = proto.Clone(req).(*monitoringpb.ListGroupMembersRequest) diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/metric_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/metric_client.go index 25846983459..428f04f5b67 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/metric_client.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/metric_client.go @@ -26,6 +26,7 @@ import ( monitoringpb "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb" gax "github.com/googleapis/gax-go/v2" + "github.com/googleapis/gax-go/v2/callctx" "google.golang.org/api/iterator" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" @@ -296,6 +297,16 @@ type metricGRPCClient struct { // time series data. func NewMetricClient(ctx context.Context, opts ...option.ClientOption) (*MetricClient, error) { clientOpts := defaultMetricGRPCClientOptions() + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{ + "gcp.client.service": "monitoring", + "gcp.client.version": getVersionClient(), + "gcp.client.repo": "googleapis/google-cloud-go", + "gcp.client.artifact": "cloud.google.com/go/monitoring/apiv3/v2", + "gcp.client.language": "go", + "url.domain": "monitoring.googleapis.com", + })) + } if newMetricClientHook != nil { hookOpts, err := newMetricClientHook(ctx, clientHookParams{}) if err != nil { @@ -317,6 +328,28 @@ func NewMetricClient(ctx context.Context, opts ...option.ClientOption) (*MetricC logger: internaloption.GetLogger(opts), } c.setGoogleClientInfo() + if gax.IsFeatureEnabled("METRICS") { + metrics := gax.NewClientMetrics( + gax.WithTelemetryLogger(c.logger), + gax.WithTelemetryAttributes(map[string]string{ + gax.ClientService: "monitoring", + gax.ClientVersion: getVersionClient(), + gax.ClientArtifact: "cloud.google.com/go/monitoring/apiv3/v2", + gax.RPCSystem: "grpc", + gax.URLDomain: "monitoring.googleapis.com", + }), + ) + + client.CallOptions.ListMonitoredResourceDescriptors = append(client.CallOptions.ListMonitoredResourceDescriptors, gax.WithClientMetrics(metrics)) + client.CallOptions.GetMonitoredResourceDescriptor = append(client.CallOptions.GetMonitoredResourceDescriptor, gax.WithClientMetrics(metrics)) + client.CallOptions.ListMetricDescriptors = append(client.CallOptions.ListMetricDescriptors, gax.WithClientMetrics(metrics)) + client.CallOptions.GetMetricDescriptor = append(client.CallOptions.GetMetricDescriptor, gax.WithClientMetrics(metrics)) + client.CallOptions.CreateMetricDescriptor = append(client.CallOptions.CreateMetricDescriptor, gax.WithClientMetrics(metrics)) + client.CallOptions.DeleteMetricDescriptor = append(client.CallOptions.DeleteMetricDescriptor, gax.WithClientMetrics(metrics)) + client.CallOptions.ListTimeSeries = append(client.CallOptions.ListTimeSeries, gax.WithClientMetrics(metrics)) + client.CallOptions.CreateTimeSeries = append(client.CallOptions.CreateTimeSeries, gax.WithClientMetrics(metrics)) + client.CallOptions.CreateServiceTimeSeries = append(client.CallOptions.CreateServiceTimeSeries, gax.WithClientMetrics(metrics)) + } client.internalClient = c @@ -353,6 +386,12 @@ func (c *metricGRPCClient) ListMonitoredResourceDescriptors(ctx context.Context, hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.MetricService/ListMonitoredResourceDescriptors") + } opts = append((*c.CallOptions).ListMonitoredResourceDescriptors[0:len((*c.CallOptions).ListMonitoredResourceDescriptors):len((*c.CallOptions).ListMonitoredResourceDescriptors)], opts...) it := &MonitoredResourceDescriptorIterator{} req = proto.Clone(req).(*monitoringpb.ListMonitoredResourceDescriptorsRequest) @@ -399,6 +438,12 @@ func (c *metricGRPCClient) GetMonitoredResourceDescriptor(ctx context.Context, r hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.MetricService/GetMonitoredResourceDescriptor") + } opts = append((*c.CallOptions).GetMonitoredResourceDescriptor[0:len((*c.CallOptions).GetMonitoredResourceDescriptor):len((*c.CallOptions).GetMonitoredResourceDescriptor)], opts...) var resp *monitoredrespb.MonitoredResourceDescriptor err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -417,6 +462,12 @@ func (c *metricGRPCClient) ListMetricDescriptors(ctx context.Context, req *monit hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.MetricService/ListMetricDescriptors") + } opts = append((*c.CallOptions).ListMetricDescriptors[0:len((*c.CallOptions).ListMetricDescriptors):len((*c.CallOptions).ListMetricDescriptors)], opts...) it := &MetricDescriptorIterator{} req = proto.Clone(req).(*monitoringpb.ListMetricDescriptorsRequest) @@ -463,6 +514,12 @@ func (c *metricGRPCClient) GetMetricDescriptor(ctx context.Context, req *monitor hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.MetricService/GetMetricDescriptor") + } opts = append((*c.CallOptions).GetMetricDescriptor[0:len((*c.CallOptions).GetMetricDescriptor):len((*c.CallOptions).GetMetricDescriptor)], opts...) var resp *metricpb.MetricDescriptor err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -481,6 +538,12 @@ func (c *metricGRPCClient) CreateMetricDescriptor(ctx context.Context, req *moni hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.MetricService/CreateMetricDescriptor") + } opts = append((*c.CallOptions).CreateMetricDescriptor[0:len((*c.CallOptions).CreateMetricDescriptor):len((*c.CallOptions).CreateMetricDescriptor)], opts...) var resp *metricpb.MetricDescriptor err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -499,6 +562,12 @@ func (c *metricGRPCClient) DeleteMetricDescriptor(ctx context.Context, req *moni hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.MetricService/DeleteMetricDescriptor") + } opts = append((*c.CallOptions).DeleteMetricDescriptor[0:len((*c.CallOptions).DeleteMetricDescriptor):len((*c.CallOptions).DeleteMetricDescriptor)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error @@ -513,6 +582,12 @@ func (c *metricGRPCClient) ListTimeSeries(ctx context.Context, req *monitoringpb hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.MetricService/ListTimeSeries") + } opts = append((*c.CallOptions).ListTimeSeries[0:len((*c.CallOptions).ListTimeSeries):len((*c.CallOptions).ListTimeSeries)], opts...) it := &TimeSeriesIterator{} req = proto.Clone(req).(*monitoringpb.ListTimeSeriesRequest) @@ -559,6 +634,12 @@ func (c *metricGRPCClient) CreateTimeSeries(ctx context.Context, req *monitoring hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.MetricService/CreateTimeSeries") + } opts = append((*c.CallOptions).CreateTimeSeries[0:len((*c.CallOptions).CreateTimeSeries):len((*c.CallOptions).CreateTimeSeries)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error @@ -573,6 +654,12 @@ func (c *metricGRPCClient) CreateServiceTimeSeries(ctx context.Context, req *mon hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.MetricService/CreateServiceTimeSeries") + } opts = append((*c.CallOptions).CreateServiceTimeSeries[0:len((*c.CallOptions).CreateServiceTimeSeries):len((*c.CallOptions).CreateServiceTimeSeries)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert.pb.go index 9344c135756..0e0b0f58f84 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.7 +// protoc v6.33.2 // source: google/monitoring/v3/alert.proto package monitoringpb diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service.pb.go index 0bf780fe858..9db077f43d6 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.7 +// protoc v6.33.2 // source: google/monitoring/v3/alert_service.proto package monitoringpb diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service_grpc.pb.go index 861849e02aa..a9e32797c96 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service_grpc.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service_grpc.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.7 +// - protoc v6.33.2 // source: google/monitoring/v3/alert_service.proto package monitoringpb diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/common.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/common.pb.go index 1b0121c11a9..f09a3d95898 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/common.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/common.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.7 +// protoc v6.33.2 // source: google/monitoring/v3/common.proto package monitoringpb diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/dropped_labels.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/dropped_labels.pb.go index de6375fc001..ad8d2361ae6 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/dropped_labels.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/dropped_labels.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.7 +// protoc v6.33.2 // source: google/monitoring/v3/dropped_labels.proto package monitoringpb diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group.pb.go index 3b08e8af984..03c6fc298df 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.7 +// protoc v6.33.2 // source: google/monitoring/v3/group.proto package monitoringpb diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service.pb.go index a45505ad3ec..cb2af61ba50 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.7 +// protoc v6.33.2 // source: google/monitoring/v3/group_service.proto package monitoringpb diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service_grpc.pb.go index cc3402f1f5c..0d94d9a72a2 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service_grpc.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service_grpc.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.7 +// - protoc v6.33.2 // source: google/monitoring/v3/group_service.proto package monitoringpb diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric.pb.go index 2ad077940ee..de021e107d4 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.7 +// protoc v6.33.2 // source: google/monitoring/v3/metric.proto package monitoringpb diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service.pb.go index e6de1cd5334..fc6e03699ad 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.7 +// protoc v6.33.2 // source: google/monitoring/v3/metric_service.proto package monitoringpb diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service_grpc.pb.go index 96563523444..a2627fbd7ab 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service_grpc.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service_grpc.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.7 +// - protoc v6.33.2 // source: google/monitoring/v3/metric_service.proto package monitoringpb diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/mutation_record.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/mutation_record.pb.go index aa705ab7626..12d685d9101 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/mutation_record.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/mutation_record.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.7 +// protoc v6.33.2 // source: google/monitoring/v3/mutation_record.proto package monitoringpb diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification.pb.go index 4cff05f3503..e98909d56f9 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.7 +// protoc v6.33.2 // source: google/monitoring/v3/notification.proto package monitoringpb diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service.pb.go index c0d18163c92..93111711876 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.7 +// protoc v6.33.2 // source: google/monitoring/v3/notification_service.proto package monitoringpb diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service_grpc.pb.go index db17ffddd93..8adf4a88f62 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service_grpc.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service_grpc.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.7 +// - protoc v6.33.2 // source: google/monitoring/v3/notification_service.proto package monitoringpb diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service.pb.go index a652facf278..e175b33bf2f 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.7 +// protoc v6.33.2 // source: google/monitoring/v3/query_service.proto package monitoringpb diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service_grpc.pb.go index 9f520988107..7fef265221e 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service_grpc.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service_grpc.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.7 +// - protoc v6.33.2 // source: google/monitoring/v3/query_service.proto package monitoringpb diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service.pb.go index 87573d82ce9..b0448b0dbc2 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.7 +// protoc v6.33.2 // source: google/monitoring/v3/service.proto package monitoringpb diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service.pb.go index 6e0990dbfb9..446fa68e1a2 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.7 +// protoc v6.33.2 // source: google/monitoring/v3/service_service.proto package monitoringpb diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service_grpc.pb.go index 0bc80f64f71..96bfe0ab679 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service_grpc.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service_grpc.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.7 +// - protoc v6.33.2 // source: google/monitoring/v3/service_service.proto package monitoringpb diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze.pb.go index 3091de7629e..423d366af09 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.7 +// protoc v6.33.2 // source: google/monitoring/v3/snooze.proto package monitoringpb diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service.pb.go index daa14488db2..4cc87a48402 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.7 +// protoc v6.33.2 // source: google/monitoring/v3/snooze_service.proto package monitoringpb diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service_grpc.pb.go index aebe4703f61..fe198fddd17 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service_grpc.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service_grpc.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.7 +// - protoc v6.33.2 // source: google/monitoring/v3/snooze_service.proto package monitoringpb diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/span_context.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/span_context.pb.go index 7e4728d14f0..62e484ce6fe 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/span_context.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/span_context.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.7 +// protoc v6.33.2 // source: google/monitoring/v3/span_context.proto package monitoringpb diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime.pb.go index 754d0342214..b2b96799bc4 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.7 +// protoc v6.33.2 // source: google/monitoring/v3/uptime.proto package monitoringpb diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service.pb.go index f3c3b68f560..3196f0d285f 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.7 +// protoc v6.33.2 // source: google/monitoring/v3/uptime_service.proto package monitoringpb diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service_grpc.pb.go index d19e0846f3f..40727e4e8af 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service_grpc.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service_grpc.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.7 +// - protoc v6.33.2 // source: google/monitoring/v3/uptime_service.proto package monitoringpb diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/notification_channel_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/notification_channel_client.go index 4901db10452..3fbecb28b0e 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/notification_channel_client.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/notification_channel_client.go @@ -26,6 +26,7 @@ import ( monitoringpb "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb" gax "github.com/googleapis/gax-go/v2" + "github.com/googleapis/gax-go/v2/callctx" "google.golang.org/api/iterator" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" @@ -342,6 +343,16 @@ type notificationChannelGRPCClient struct { // controls how messages related to incidents are sent. func NewNotificationChannelClient(ctx context.Context, opts ...option.ClientOption) (*NotificationChannelClient, error) { clientOpts := defaultNotificationChannelGRPCClientOptions() + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{ + "gcp.client.service": "monitoring", + "gcp.client.version": getVersionClient(), + "gcp.client.repo": "googleapis/google-cloud-go", + "gcp.client.artifact": "cloud.google.com/go/monitoring/apiv3/v2", + "gcp.client.language": "go", + "url.domain": "monitoring.googleapis.com", + })) + } if newNotificationChannelClientHook != nil { hookOpts, err := newNotificationChannelClientHook(ctx, clientHookParams{}) if err != nil { @@ -363,6 +374,29 @@ func NewNotificationChannelClient(ctx context.Context, opts ...option.ClientOpti logger: internaloption.GetLogger(opts), } c.setGoogleClientInfo() + if gax.IsFeatureEnabled("METRICS") { + metrics := gax.NewClientMetrics( + gax.WithTelemetryLogger(c.logger), + gax.WithTelemetryAttributes(map[string]string{ + gax.ClientService: "monitoring", + gax.ClientVersion: getVersionClient(), + gax.ClientArtifact: "cloud.google.com/go/monitoring/apiv3/v2", + gax.RPCSystem: "grpc", + gax.URLDomain: "monitoring.googleapis.com", + }), + ) + + client.CallOptions.ListNotificationChannelDescriptors = append(client.CallOptions.ListNotificationChannelDescriptors, gax.WithClientMetrics(metrics)) + client.CallOptions.GetNotificationChannelDescriptor = append(client.CallOptions.GetNotificationChannelDescriptor, gax.WithClientMetrics(metrics)) + client.CallOptions.ListNotificationChannels = append(client.CallOptions.ListNotificationChannels, gax.WithClientMetrics(metrics)) + client.CallOptions.GetNotificationChannel = append(client.CallOptions.GetNotificationChannel, gax.WithClientMetrics(metrics)) + client.CallOptions.CreateNotificationChannel = append(client.CallOptions.CreateNotificationChannel, gax.WithClientMetrics(metrics)) + client.CallOptions.UpdateNotificationChannel = append(client.CallOptions.UpdateNotificationChannel, gax.WithClientMetrics(metrics)) + client.CallOptions.DeleteNotificationChannel = append(client.CallOptions.DeleteNotificationChannel, gax.WithClientMetrics(metrics)) + client.CallOptions.SendNotificationChannelVerificationCode = append(client.CallOptions.SendNotificationChannelVerificationCode, gax.WithClientMetrics(metrics)) + client.CallOptions.GetNotificationChannelVerificationCode = append(client.CallOptions.GetNotificationChannelVerificationCode, gax.WithClientMetrics(metrics)) + client.CallOptions.VerifyNotificationChannel = append(client.CallOptions.VerifyNotificationChannel, gax.WithClientMetrics(metrics)) + } client.internalClient = c @@ -399,6 +433,12 @@ func (c *notificationChannelGRPCClient) ListNotificationChannelDescriptors(ctx c hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/ListNotificationChannelDescriptors") + } opts = append((*c.CallOptions).ListNotificationChannelDescriptors[0:len((*c.CallOptions).ListNotificationChannelDescriptors):len((*c.CallOptions).ListNotificationChannelDescriptors)], opts...) it := &NotificationChannelDescriptorIterator{} req = proto.Clone(req).(*monitoringpb.ListNotificationChannelDescriptorsRequest) @@ -445,6 +485,12 @@ func (c *notificationChannelGRPCClient) GetNotificationChannelDescriptor(ctx con hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/GetNotificationChannelDescriptor") + } opts = append((*c.CallOptions).GetNotificationChannelDescriptor[0:len((*c.CallOptions).GetNotificationChannelDescriptor):len((*c.CallOptions).GetNotificationChannelDescriptor)], opts...) var resp *monitoringpb.NotificationChannelDescriptor err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -463,6 +509,12 @@ func (c *notificationChannelGRPCClient) ListNotificationChannels(ctx context.Con hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/ListNotificationChannels") + } opts = append((*c.CallOptions).ListNotificationChannels[0:len((*c.CallOptions).ListNotificationChannels):len((*c.CallOptions).ListNotificationChannels)], opts...) it := &NotificationChannelIterator{} req = proto.Clone(req).(*monitoringpb.ListNotificationChannelsRequest) @@ -509,6 +561,12 @@ func (c *notificationChannelGRPCClient) GetNotificationChannel(ctx context.Conte hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/GetNotificationChannel") + } opts = append((*c.CallOptions).GetNotificationChannel[0:len((*c.CallOptions).GetNotificationChannel):len((*c.CallOptions).GetNotificationChannel)], opts...) var resp *monitoringpb.NotificationChannel err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -527,6 +585,12 @@ func (c *notificationChannelGRPCClient) CreateNotificationChannel(ctx context.Co hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/CreateNotificationChannel") + } opts = append((*c.CallOptions).CreateNotificationChannel[0:len((*c.CallOptions).CreateNotificationChannel):len((*c.CallOptions).CreateNotificationChannel)], opts...) var resp *monitoringpb.NotificationChannel err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -545,6 +609,9 @@ func (c *notificationChannelGRPCClient) UpdateNotificationChannel(ctx context.Co hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/UpdateNotificationChannel") + } opts = append((*c.CallOptions).UpdateNotificationChannel[0:len((*c.CallOptions).UpdateNotificationChannel):len((*c.CallOptions).UpdateNotificationChannel)], opts...) var resp *monitoringpb.NotificationChannel err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -563,6 +630,12 @@ func (c *notificationChannelGRPCClient) DeleteNotificationChannel(ctx context.Co hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/DeleteNotificationChannel") + } opts = append((*c.CallOptions).DeleteNotificationChannel[0:len((*c.CallOptions).DeleteNotificationChannel):len((*c.CallOptions).DeleteNotificationChannel)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error @@ -577,6 +650,12 @@ func (c *notificationChannelGRPCClient) SendNotificationChannelVerificationCode( hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/SendNotificationChannelVerificationCode") + } opts = append((*c.CallOptions).SendNotificationChannelVerificationCode[0:len((*c.CallOptions).SendNotificationChannelVerificationCode):len((*c.CallOptions).SendNotificationChannelVerificationCode)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error @@ -591,6 +670,12 @@ func (c *notificationChannelGRPCClient) GetNotificationChannelVerificationCode(c hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/GetNotificationChannelVerificationCode") + } opts = append((*c.CallOptions).GetNotificationChannelVerificationCode[0:len((*c.CallOptions).GetNotificationChannelVerificationCode):len((*c.CallOptions).GetNotificationChannelVerificationCode)], opts...) var resp *monitoringpb.GetNotificationChannelVerificationCodeResponse err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -609,6 +694,12 @@ func (c *notificationChannelGRPCClient) VerifyNotificationChannel(ctx context.Co hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/VerifyNotificationChannel") + } opts = append((*c.CallOptions).VerifyNotificationChannel[0:len((*c.CallOptions).VerifyNotificationChannel):len((*c.CallOptions).VerifyNotificationChannel)], opts...) var resp *monitoringpb.NotificationChannel err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/query_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/query_client.go index 9160d216183..4b6cd13dc80 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/query_client.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/query_client.go @@ -25,6 +25,7 @@ import ( monitoringpb "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb" gax "github.com/googleapis/gax-go/v2" + "github.com/googleapis/gax-go/v2/callctx" "google.golang.org/api/iterator" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" @@ -144,6 +145,16 @@ type queryGRPCClient struct { // the time-varying values of a metric. func NewQueryClient(ctx context.Context, opts ...option.ClientOption) (*QueryClient, error) { clientOpts := defaultQueryGRPCClientOptions() + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{ + "gcp.client.service": "monitoring", + "gcp.client.version": getVersionClient(), + "gcp.client.repo": "googleapis/google-cloud-go", + "gcp.client.artifact": "cloud.google.com/go/monitoring/apiv3/v2", + "gcp.client.language": "go", + "url.domain": "monitoring.googleapis.com", + })) + } if newQueryClientHook != nil { hookOpts, err := newQueryClientHook(ctx, clientHookParams{}) if err != nil { @@ -165,6 +176,20 @@ func NewQueryClient(ctx context.Context, opts ...option.ClientOption) (*QueryCli logger: internaloption.GetLogger(opts), } c.setGoogleClientInfo() + if gax.IsFeatureEnabled("METRICS") { + metrics := gax.NewClientMetrics( + gax.WithTelemetryLogger(c.logger), + gax.WithTelemetryAttributes(map[string]string{ + gax.ClientService: "monitoring", + gax.ClientVersion: getVersionClient(), + gax.ClientArtifact: "cloud.google.com/go/monitoring/apiv3/v2", + gax.RPCSystem: "grpc", + gax.URLDomain: "monitoring.googleapis.com", + }), + ) + + client.CallOptions.QueryTimeSeries = append(client.CallOptions.QueryTimeSeries, gax.WithClientMetrics(metrics)) + } client.internalClient = c @@ -201,6 +226,9 @@ func (c *queryGRPCClient) QueryTimeSeries(ctx context.Context, req *monitoringpb hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.QueryService/QueryTimeSeries") + } opts = append((*c.CallOptions).QueryTimeSeries[0:len((*c.CallOptions).QueryTimeSeries):len((*c.CallOptions).QueryTimeSeries)], opts...) it := &TimeSeriesDataIterator{} req = proto.Clone(req).(*monitoringpb.QueryTimeSeriesRequest) diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/service_monitoring_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/service_monitoring_client.go index 39f5cf31d86..ccf3a12db04 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/service_monitoring_client.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/service_monitoring_client.go @@ -26,6 +26,7 @@ import ( monitoringpb "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb" gax "github.com/googleapis/gax-go/v2" + "github.com/googleapis/gax-go/v2/callctx" "google.golang.org/api/iterator" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" @@ -289,6 +290,16 @@ type serviceMonitoringGRPCClient struct { // taxonomy of categorized Health Metrics. func NewServiceMonitoringClient(ctx context.Context, opts ...option.ClientOption) (*ServiceMonitoringClient, error) { clientOpts := defaultServiceMonitoringGRPCClientOptions() + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{ + "gcp.client.service": "monitoring", + "gcp.client.version": getVersionClient(), + "gcp.client.repo": "googleapis/google-cloud-go", + "gcp.client.artifact": "cloud.google.com/go/monitoring/apiv3/v2", + "gcp.client.language": "go", + "url.domain": "monitoring.googleapis.com", + })) + } if newServiceMonitoringClientHook != nil { hookOpts, err := newServiceMonitoringClientHook(ctx, clientHookParams{}) if err != nil { @@ -310,6 +321,29 @@ func NewServiceMonitoringClient(ctx context.Context, opts ...option.ClientOption logger: internaloption.GetLogger(opts), } c.setGoogleClientInfo() + if gax.IsFeatureEnabled("METRICS") { + metrics := gax.NewClientMetrics( + gax.WithTelemetryLogger(c.logger), + gax.WithTelemetryAttributes(map[string]string{ + gax.ClientService: "monitoring", + gax.ClientVersion: getVersionClient(), + gax.ClientArtifact: "cloud.google.com/go/monitoring/apiv3/v2", + gax.RPCSystem: "grpc", + gax.URLDomain: "monitoring.googleapis.com", + }), + ) + + client.CallOptions.CreateService = append(client.CallOptions.CreateService, gax.WithClientMetrics(metrics)) + client.CallOptions.GetService = append(client.CallOptions.GetService, gax.WithClientMetrics(metrics)) + client.CallOptions.ListServices = append(client.CallOptions.ListServices, gax.WithClientMetrics(metrics)) + client.CallOptions.UpdateService = append(client.CallOptions.UpdateService, gax.WithClientMetrics(metrics)) + client.CallOptions.DeleteService = append(client.CallOptions.DeleteService, gax.WithClientMetrics(metrics)) + client.CallOptions.CreateServiceLevelObjective = append(client.CallOptions.CreateServiceLevelObjective, gax.WithClientMetrics(metrics)) + client.CallOptions.GetServiceLevelObjective = append(client.CallOptions.GetServiceLevelObjective, gax.WithClientMetrics(metrics)) + client.CallOptions.ListServiceLevelObjectives = append(client.CallOptions.ListServiceLevelObjectives, gax.WithClientMetrics(metrics)) + client.CallOptions.UpdateServiceLevelObjective = append(client.CallOptions.UpdateServiceLevelObjective, gax.WithClientMetrics(metrics)) + client.CallOptions.DeleteServiceLevelObjective = append(client.CallOptions.DeleteServiceLevelObjective, gax.WithClientMetrics(metrics)) + } client.internalClient = c @@ -346,6 +380,12 @@ func (c *serviceMonitoringGRPCClient) CreateService(ctx context.Context, req *mo hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetParent())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/CreateService") + } opts = append((*c.CallOptions).CreateService[0:len((*c.CallOptions).CreateService):len((*c.CallOptions).CreateService)], opts...) var resp *monitoringpb.Service err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -364,6 +404,12 @@ func (c *serviceMonitoringGRPCClient) GetService(ctx context.Context, req *monit hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/GetService") + } opts = append((*c.CallOptions).GetService[0:len((*c.CallOptions).GetService):len((*c.CallOptions).GetService)], opts...) var resp *monitoringpb.Service err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -382,6 +428,12 @@ func (c *serviceMonitoringGRPCClient) ListServices(ctx context.Context, req *mon hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetParent())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/ListServices") + } opts = append((*c.CallOptions).ListServices[0:len((*c.CallOptions).ListServices):len((*c.CallOptions).ListServices)], opts...) it := &ServiceIterator{} req = proto.Clone(req).(*monitoringpb.ListServicesRequest) @@ -428,6 +480,9 @@ func (c *serviceMonitoringGRPCClient) UpdateService(ctx context.Context, req *mo hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/UpdateService") + } opts = append((*c.CallOptions).UpdateService[0:len((*c.CallOptions).UpdateService):len((*c.CallOptions).UpdateService)], opts...) var resp *monitoringpb.Service err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -446,6 +501,12 @@ func (c *serviceMonitoringGRPCClient) DeleteService(ctx context.Context, req *mo hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/DeleteService") + } opts = append((*c.CallOptions).DeleteService[0:len((*c.CallOptions).DeleteService):len((*c.CallOptions).DeleteService)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error @@ -460,6 +521,12 @@ func (c *serviceMonitoringGRPCClient) CreateServiceLevelObjective(ctx context.Co hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetParent())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/CreateServiceLevelObjective") + } opts = append((*c.CallOptions).CreateServiceLevelObjective[0:len((*c.CallOptions).CreateServiceLevelObjective):len((*c.CallOptions).CreateServiceLevelObjective)], opts...) var resp *monitoringpb.ServiceLevelObjective err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -478,6 +545,12 @@ func (c *serviceMonitoringGRPCClient) GetServiceLevelObjective(ctx context.Conte hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/GetServiceLevelObjective") + } opts = append((*c.CallOptions).GetServiceLevelObjective[0:len((*c.CallOptions).GetServiceLevelObjective):len((*c.CallOptions).GetServiceLevelObjective)], opts...) var resp *monitoringpb.ServiceLevelObjective err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -496,6 +569,12 @@ func (c *serviceMonitoringGRPCClient) ListServiceLevelObjectives(ctx context.Con hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetParent())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/ListServiceLevelObjectives") + } opts = append((*c.CallOptions).ListServiceLevelObjectives[0:len((*c.CallOptions).ListServiceLevelObjectives):len((*c.CallOptions).ListServiceLevelObjectives)], opts...) it := &ServiceLevelObjectiveIterator{} req = proto.Clone(req).(*monitoringpb.ListServiceLevelObjectivesRequest) @@ -542,6 +621,9 @@ func (c *serviceMonitoringGRPCClient) UpdateServiceLevelObjective(ctx context.Co hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/UpdateServiceLevelObjective") + } opts = append((*c.CallOptions).UpdateServiceLevelObjective[0:len((*c.CallOptions).UpdateServiceLevelObjective):len((*c.CallOptions).UpdateServiceLevelObjective)], opts...) var resp *monitoringpb.ServiceLevelObjective err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -560,6 +642,12 @@ func (c *serviceMonitoringGRPCClient) DeleteServiceLevelObjective(ctx context.Co hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/DeleteServiceLevelObjective") + } opts = append((*c.CallOptions).DeleteServiceLevelObjective[0:len((*c.CallOptions).DeleteServiceLevelObjective):len((*c.CallOptions).DeleteServiceLevelObjective)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/snooze_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/snooze_client.go index a664900f495..fa9fc6ea9fe 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/snooze_client.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/snooze_client.go @@ -26,6 +26,7 @@ import ( monitoringpb "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb" gax "github.com/googleapis/gax-go/v2" + "github.com/googleapis/gax-go/v2/callctx" "google.golang.org/api/iterator" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" @@ -195,6 +196,16 @@ type snoozeGRPCClient struct { // or more alert policies should not fire alerts for the specified duration. func NewSnoozeClient(ctx context.Context, opts ...option.ClientOption) (*SnoozeClient, error) { clientOpts := defaultSnoozeGRPCClientOptions() + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{ + "gcp.client.service": "monitoring", + "gcp.client.version": getVersionClient(), + "gcp.client.repo": "googleapis/google-cloud-go", + "gcp.client.artifact": "cloud.google.com/go/monitoring/apiv3/v2", + "gcp.client.language": "go", + "url.domain": "monitoring.googleapis.com", + })) + } if newSnoozeClientHook != nil { hookOpts, err := newSnoozeClientHook(ctx, clientHookParams{}) if err != nil { @@ -216,6 +227,23 @@ func NewSnoozeClient(ctx context.Context, opts ...option.ClientOption) (*SnoozeC logger: internaloption.GetLogger(opts), } c.setGoogleClientInfo() + if gax.IsFeatureEnabled("METRICS") { + metrics := gax.NewClientMetrics( + gax.WithTelemetryLogger(c.logger), + gax.WithTelemetryAttributes(map[string]string{ + gax.ClientService: "monitoring", + gax.ClientVersion: getVersionClient(), + gax.ClientArtifact: "cloud.google.com/go/monitoring/apiv3/v2", + gax.RPCSystem: "grpc", + gax.URLDomain: "monitoring.googleapis.com", + }), + ) + + client.CallOptions.CreateSnooze = append(client.CallOptions.CreateSnooze, gax.WithClientMetrics(metrics)) + client.CallOptions.ListSnoozes = append(client.CallOptions.ListSnoozes, gax.WithClientMetrics(metrics)) + client.CallOptions.GetSnooze = append(client.CallOptions.GetSnooze, gax.WithClientMetrics(metrics)) + client.CallOptions.UpdateSnooze = append(client.CallOptions.UpdateSnooze, gax.WithClientMetrics(metrics)) + } client.internalClient = c @@ -252,6 +280,12 @@ func (c *snoozeGRPCClient) CreateSnooze(ctx context.Context, req *monitoringpb.C hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetParent())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.SnoozeService/CreateSnooze") + } opts = append((*c.CallOptions).CreateSnooze[0:len((*c.CallOptions).CreateSnooze):len((*c.CallOptions).CreateSnooze)], opts...) var resp *monitoringpb.Snooze err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -270,6 +304,12 @@ func (c *snoozeGRPCClient) ListSnoozes(ctx context.Context, req *monitoringpb.Li hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetParent())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.SnoozeService/ListSnoozes") + } opts = append((*c.CallOptions).ListSnoozes[0:len((*c.CallOptions).ListSnoozes):len((*c.CallOptions).ListSnoozes)], opts...) it := &SnoozeIterator{} req = proto.Clone(req).(*monitoringpb.ListSnoozesRequest) @@ -316,6 +356,12 @@ func (c *snoozeGRPCClient) GetSnooze(ctx context.Context, req *monitoringpb.GetS hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.SnoozeService/GetSnooze") + } opts = append((*c.CallOptions).GetSnooze[0:len((*c.CallOptions).GetSnooze):len((*c.CallOptions).GetSnooze)], opts...) var resp *monitoringpb.Snooze err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -334,6 +380,9 @@ func (c *snoozeGRPCClient) UpdateSnooze(ctx context.Context, req *monitoringpb.U hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.SnoozeService/UpdateSnooze") + } opts = append((*c.CallOptions).UpdateSnooze[0:len((*c.CallOptions).UpdateSnooze):len((*c.CallOptions).UpdateSnooze)], opts...) var resp *monitoringpb.Snooze err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/uptime_check_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/uptime_check_client.go index 427d508269b..5aa02ab4ab0 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/uptime_check_client.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/uptime_check_client.go @@ -26,6 +26,7 @@ import ( monitoringpb "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb" gax "github.com/googleapis/gax-go/v2" + "github.com/googleapis/gax-go/v2/callctx" "google.golang.org/api/iterator" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" @@ -245,6 +246,16 @@ type uptimeCheckGRPCClient struct { // Monitoring, and then clicking on “Uptime”. func NewUptimeCheckClient(ctx context.Context, opts ...option.ClientOption) (*UptimeCheckClient, error) { clientOpts := defaultUptimeCheckGRPCClientOptions() + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{ + "gcp.client.service": "monitoring", + "gcp.client.version": getVersionClient(), + "gcp.client.repo": "googleapis/google-cloud-go", + "gcp.client.artifact": "cloud.google.com/go/monitoring/apiv3/v2", + "gcp.client.language": "go", + "url.domain": "monitoring.googleapis.com", + })) + } if newUptimeCheckClientHook != nil { hookOpts, err := newUptimeCheckClientHook(ctx, clientHookParams{}) if err != nil { @@ -266,6 +277,25 @@ func NewUptimeCheckClient(ctx context.Context, opts ...option.ClientOption) (*Up logger: internaloption.GetLogger(opts), } c.setGoogleClientInfo() + if gax.IsFeatureEnabled("METRICS") { + metrics := gax.NewClientMetrics( + gax.WithTelemetryLogger(c.logger), + gax.WithTelemetryAttributes(map[string]string{ + gax.ClientService: "monitoring", + gax.ClientVersion: getVersionClient(), + gax.ClientArtifact: "cloud.google.com/go/monitoring/apiv3/v2", + gax.RPCSystem: "grpc", + gax.URLDomain: "monitoring.googleapis.com", + }), + ) + + client.CallOptions.ListUptimeCheckConfigs = append(client.CallOptions.ListUptimeCheckConfigs, gax.WithClientMetrics(metrics)) + client.CallOptions.GetUptimeCheckConfig = append(client.CallOptions.GetUptimeCheckConfig, gax.WithClientMetrics(metrics)) + client.CallOptions.CreateUptimeCheckConfig = append(client.CallOptions.CreateUptimeCheckConfig, gax.WithClientMetrics(metrics)) + client.CallOptions.UpdateUptimeCheckConfig = append(client.CallOptions.UpdateUptimeCheckConfig, gax.WithClientMetrics(metrics)) + client.CallOptions.DeleteUptimeCheckConfig = append(client.CallOptions.DeleteUptimeCheckConfig, gax.WithClientMetrics(metrics)) + client.CallOptions.ListUptimeCheckIps = append(client.CallOptions.ListUptimeCheckIps, gax.WithClientMetrics(metrics)) + } client.internalClient = c @@ -302,6 +332,12 @@ func (c *uptimeCheckGRPCClient) ListUptimeCheckConfigs(ctx context.Context, req hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetParent())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.UptimeCheckService/ListUptimeCheckConfigs") + } opts = append((*c.CallOptions).ListUptimeCheckConfigs[0:len((*c.CallOptions).ListUptimeCheckConfigs):len((*c.CallOptions).ListUptimeCheckConfigs)], opts...) it := &UptimeCheckConfigIterator{} req = proto.Clone(req).(*monitoringpb.ListUptimeCheckConfigsRequest) @@ -348,6 +384,12 @@ func (c *uptimeCheckGRPCClient) GetUptimeCheckConfig(ctx context.Context, req *m hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.UptimeCheckService/GetUptimeCheckConfig") + } opts = append((*c.CallOptions).GetUptimeCheckConfig[0:len((*c.CallOptions).GetUptimeCheckConfig):len((*c.CallOptions).GetUptimeCheckConfig)], opts...) var resp *monitoringpb.UptimeCheckConfig err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -366,6 +408,12 @@ func (c *uptimeCheckGRPCClient) CreateUptimeCheckConfig(ctx context.Context, req hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetParent())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.UptimeCheckService/CreateUptimeCheckConfig") + } opts = append((*c.CallOptions).CreateUptimeCheckConfig[0:len((*c.CallOptions).CreateUptimeCheckConfig):len((*c.CallOptions).CreateUptimeCheckConfig)], opts...) var resp *monitoringpb.UptimeCheckConfig err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -384,6 +432,9 @@ func (c *uptimeCheckGRPCClient) UpdateUptimeCheckConfig(ctx context.Context, req hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.UptimeCheckService/UpdateUptimeCheckConfig") + } opts = append((*c.CallOptions).UpdateUptimeCheckConfig[0:len((*c.CallOptions).UpdateUptimeCheckConfig):len((*c.CallOptions).UpdateUptimeCheckConfig)], opts...) var resp *monitoringpb.UptimeCheckConfig err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -402,6 +453,12 @@ func (c *uptimeCheckGRPCClient) DeleteUptimeCheckConfig(ctx context.Context, req hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.UptimeCheckService/DeleteUptimeCheckConfig") + } opts = append((*c.CallOptions).DeleteUptimeCheckConfig[0:len((*c.CallOptions).DeleteUptimeCheckConfig):len((*c.CallOptions).DeleteUptimeCheckConfig)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error @@ -413,6 +470,9 @@ func (c *uptimeCheckGRPCClient) DeleteUptimeCheckConfig(ctx context.Context, req func (c *uptimeCheckGRPCClient) ListUptimeCheckIps(ctx context.Context, req *monitoringpb.ListUptimeCheckIpsRequest, opts ...gax.CallOption) *UptimeCheckIpIterator { ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.UptimeCheckService/ListUptimeCheckIps") + } opts = append((*c.CallOptions).ListUptimeCheckIps[0:len((*c.CallOptions).ListUptimeCheckIps):len((*c.CallOptions).ListUptimeCheckIps)], opts...) it := &UptimeCheckIpIterator{} req = proto.Clone(req).(*monitoringpb.ListUptimeCheckIpsRequest) diff --git a/vendor/cloud.google.com/go/monitoring/internal/version.go b/vendor/cloud.google.com/go/monitoring/internal/version.go index e414f80c43f..1221fc49ad8 100644 --- a/vendor/cloud.google.com/go/monitoring/internal/version.go +++ b/vendor/cloud.google.com/go/monitoring/internal/version.go @@ -17,4 +17,4 @@ package internal // Version is the current tagged release of the library. -const Version = "1.25.0" +const Version = "1.28.0" diff --git a/vendor/cloud.google.com/go/secretmanager/apiv1/secret_manager_client.go b/vendor/cloud.google.com/go/secretmanager/apiv1/secret_manager_client.go index ec6839071d4..7494d4e0538 100644 --- a/vendor/cloud.google.com/go/secretmanager/apiv1/secret_manager_client.go +++ b/vendor/cloud.google.com/go/secretmanager/apiv1/secret_manager_client.go @@ -29,6 +29,7 @@ import ( iampb "cloud.google.com/go/iam/apiv1/iampb" secretmanagerpb "cloud.google.com/go/secretmanager/apiv1/secretmanagerpb" gax "github.com/googleapis/gax-go/v2" + "github.com/googleapis/gax-go/v2/callctx" "google.golang.org/api/iterator" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" @@ -427,6 +428,16 @@ type gRPCClient struct { // SecretVersion func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) { clientOpts := defaultGRPCClientOptions() + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{ + "gcp.client.service": "secretmanager", + "gcp.client.version": getVersionClient(), + "gcp.client.repo": "googleapis/google-cloud-go", + "gcp.client.artifact": "cloud.google.com/go/secretmanager/apiv1", + "gcp.client.language": "go", + "url.domain": "secretmanager.googleapis.com", + })) + } if newClientHook != nil { hookOpts, err := newClientHook(ctx, clientHookParams{}) if err != nil { @@ -449,6 +460,36 @@ func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error locationsClient: locationpb.NewLocationsClient(connPool), } c.setGoogleClientInfo() + if gax.IsFeatureEnabled("METRICS") { + metrics := gax.NewClientMetrics( + gax.WithTelemetryLogger(c.logger), + gax.WithTelemetryAttributes(map[string]string{ + gax.ClientService: "secretmanager", + gax.ClientVersion: getVersionClient(), + gax.ClientArtifact: "cloud.google.com/go/secretmanager/apiv1", + gax.RPCSystem: "grpc", + gax.URLDomain: "secretmanager.googleapis.com", + }), + ) + + client.CallOptions.ListSecrets = append(client.CallOptions.ListSecrets, gax.WithClientMetrics(metrics)) + client.CallOptions.CreateSecret = append(client.CallOptions.CreateSecret, gax.WithClientMetrics(metrics)) + client.CallOptions.AddSecretVersion = append(client.CallOptions.AddSecretVersion, gax.WithClientMetrics(metrics)) + client.CallOptions.GetSecret = append(client.CallOptions.GetSecret, gax.WithClientMetrics(metrics)) + client.CallOptions.UpdateSecret = append(client.CallOptions.UpdateSecret, gax.WithClientMetrics(metrics)) + client.CallOptions.DeleteSecret = append(client.CallOptions.DeleteSecret, gax.WithClientMetrics(metrics)) + client.CallOptions.ListSecretVersions = append(client.CallOptions.ListSecretVersions, gax.WithClientMetrics(metrics)) + client.CallOptions.GetSecretVersion = append(client.CallOptions.GetSecretVersion, gax.WithClientMetrics(metrics)) + client.CallOptions.AccessSecretVersion = append(client.CallOptions.AccessSecretVersion, gax.WithClientMetrics(metrics)) + client.CallOptions.DisableSecretVersion = append(client.CallOptions.DisableSecretVersion, gax.WithClientMetrics(metrics)) + client.CallOptions.EnableSecretVersion = append(client.CallOptions.EnableSecretVersion, gax.WithClientMetrics(metrics)) + client.CallOptions.DestroySecretVersion = append(client.CallOptions.DestroySecretVersion, gax.WithClientMetrics(metrics)) + client.CallOptions.SetIamPolicy = append(client.CallOptions.SetIamPolicy, gax.WithClientMetrics(metrics)) + client.CallOptions.GetIamPolicy = append(client.CallOptions.GetIamPolicy, gax.WithClientMetrics(metrics)) + client.CallOptions.TestIamPermissions = append(client.CallOptions.TestIamPermissions, gax.WithClientMetrics(metrics)) + client.CallOptions.GetLocation = append(client.CallOptions.GetLocation, gax.WithClientMetrics(metrics)) + client.CallOptions.ListLocations = append(client.CallOptions.ListLocations, gax.WithClientMetrics(metrics)) + } client.internalClient = c @@ -509,6 +550,16 @@ type restClient struct { // SecretVersion func NewRESTClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) { clientOpts := append(defaultRESTClientOptions(), opts...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{ + "gcp.client.service": "secretmanager", + "gcp.client.version": getVersionClient(), + "gcp.client.repo": "googleapis/google-cloud-go", + "gcp.client.artifact": "cloud.google.com/go/secretmanager/apiv1", + "gcp.client.language": "go", + "url.domain": "secretmanager.googleapis.com", + })) + } httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) if err != nil { return nil, err @@ -523,6 +574,37 @@ func NewRESTClient(ctx context.Context, opts ...option.ClientOption) (*Client, e } c.setGoogleClientInfo() + if gax.IsFeatureEnabled("METRICS") { + metrics := gax.NewClientMetrics( + gax.WithTelemetryLogger(c.logger), + gax.WithTelemetryAttributes(map[string]string{ + gax.ClientService: "secretmanager", + gax.ClientVersion: getVersionClient(), + gax.ClientArtifact: "cloud.google.com/go/secretmanager/apiv1", + gax.RPCSystem: "http", + gax.URLDomain: "secretmanager.googleapis.com", + }), + ) + + callOpts.ListSecrets = append(callOpts.ListSecrets, gax.WithClientMetrics(metrics)) + callOpts.CreateSecret = append(callOpts.CreateSecret, gax.WithClientMetrics(metrics)) + callOpts.AddSecretVersion = append(callOpts.AddSecretVersion, gax.WithClientMetrics(metrics)) + callOpts.GetSecret = append(callOpts.GetSecret, gax.WithClientMetrics(metrics)) + callOpts.UpdateSecret = append(callOpts.UpdateSecret, gax.WithClientMetrics(metrics)) + callOpts.DeleteSecret = append(callOpts.DeleteSecret, gax.WithClientMetrics(metrics)) + callOpts.ListSecretVersions = append(callOpts.ListSecretVersions, gax.WithClientMetrics(metrics)) + callOpts.GetSecretVersion = append(callOpts.GetSecretVersion, gax.WithClientMetrics(metrics)) + callOpts.AccessSecretVersion = append(callOpts.AccessSecretVersion, gax.WithClientMetrics(metrics)) + callOpts.DisableSecretVersion = append(callOpts.DisableSecretVersion, gax.WithClientMetrics(metrics)) + callOpts.EnableSecretVersion = append(callOpts.EnableSecretVersion, gax.WithClientMetrics(metrics)) + callOpts.DestroySecretVersion = append(callOpts.DestroySecretVersion, gax.WithClientMetrics(metrics)) + callOpts.SetIamPolicy = append(callOpts.SetIamPolicy, gax.WithClientMetrics(metrics)) + callOpts.GetIamPolicy = append(callOpts.GetIamPolicy, gax.WithClientMetrics(metrics)) + callOpts.TestIamPermissions = append(callOpts.TestIamPermissions, gax.WithClientMetrics(metrics)) + callOpts.GetLocation = append(callOpts.GetLocation, gax.WithClientMetrics(metrics)) + callOpts.ListLocations = append(callOpts.ListLocations, gax.WithClientMetrics(metrics)) + } + return &Client{internalClient: c, CallOptions: callOpts}, nil } @@ -568,9 +650,15 @@ func (c *gRPCClient) ListSecrets(ctx context.Context, req *secretmanagerpb.ListS hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//secretmanager.googleapis.com/%v", req.GetParent())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.secretmanager.v1.SecretManagerService/ListSecrets") + } opts = append((*c.CallOptions).ListSecrets[0:len((*c.CallOptions).ListSecrets):len((*c.CallOptions).ListSecrets)], opts...) it := &SecretIterator{} - req = proto.Clone(req).(*secretmanagerpb.ListSecretsRequest) + req = proto.CloneOf(req) it.InternalFetch = func(pageSize int, pageToken string) ([]*secretmanagerpb.Secret, string, error) { resp := &secretmanagerpb.ListSecretsResponse{} if pageToken != "" { @@ -614,6 +702,12 @@ func (c *gRPCClient) CreateSecret(ctx context.Context, req *secretmanagerpb.Crea hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//secretmanager.googleapis.com/%v", req.GetParent())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.secretmanager.v1.SecretManagerService/CreateSecret") + } opts = append((*c.CallOptions).CreateSecret[0:len((*c.CallOptions).CreateSecret):len((*c.CallOptions).CreateSecret)], opts...) var resp *secretmanagerpb.Secret err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -632,6 +726,12 @@ func (c *gRPCClient) AddSecretVersion(ctx context.Context, req *secretmanagerpb. hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//secretmanager.googleapis.com/%v", req.GetParent())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.secretmanager.v1.SecretManagerService/AddSecretVersion") + } opts = append((*c.CallOptions).AddSecretVersion[0:len((*c.CallOptions).AddSecretVersion):len((*c.CallOptions).AddSecretVersion)], opts...) var resp *secretmanagerpb.SecretVersion err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -650,6 +750,12 @@ func (c *gRPCClient) GetSecret(ctx context.Context, req *secretmanagerpb.GetSecr hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//secretmanager.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.secretmanager.v1.SecretManagerService/GetSecret") + } opts = append((*c.CallOptions).GetSecret[0:len((*c.CallOptions).GetSecret):len((*c.CallOptions).GetSecret)], opts...) var resp *secretmanagerpb.Secret err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -668,6 +774,9 @@ func (c *gRPCClient) UpdateSecret(ctx context.Context, req *secretmanagerpb.Upda hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.secretmanager.v1.SecretManagerService/UpdateSecret") + } opts = append((*c.CallOptions).UpdateSecret[0:len((*c.CallOptions).UpdateSecret):len((*c.CallOptions).UpdateSecret)], opts...) var resp *secretmanagerpb.Secret err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -686,6 +795,12 @@ func (c *gRPCClient) DeleteSecret(ctx context.Context, req *secretmanagerpb.Dele hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//secretmanager.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.secretmanager.v1.SecretManagerService/DeleteSecret") + } opts = append((*c.CallOptions).DeleteSecret[0:len((*c.CallOptions).DeleteSecret):len((*c.CallOptions).DeleteSecret)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error @@ -700,9 +815,15 @@ func (c *gRPCClient) ListSecretVersions(ctx context.Context, req *secretmanagerp hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//secretmanager.googleapis.com/%v", req.GetParent())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.secretmanager.v1.SecretManagerService/ListSecretVersions") + } opts = append((*c.CallOptions).ListSecretVersions[0:len((*c.CallOptions).ListSecretVersions):len((*c.CallOptions).ListSecretVersions)], opts...) it := &SecretVersionIterator{} - req = proto.Clone(req).(*secretmanagerpb.ListSecretVersionsRequest) + req = proto.CloneOf(req) it.InternalFetch = func(pageSize int, pageToken string) ([]*secretmanagerpb.SecretVersion, string, error) { resp := &secretmanagerpb.ListSecretVersionsResponse{} if pageToken != "" { @@ -746,6 +867,12 @@ func (c *gRPCClient) GetSecretVersion(ctx context.Context, req *secretmanagerpb. hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//secretmanager.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.secretmanager.v1.SecretManagerService/GetSecretVersion") + } opts = append((*c.CallOptions).GetSecretVersion[0:len((*c.CallOptions).GetSecretVersion):len((*c.CallOptions).GetSecretVersion)], opts...) var resp *secretmanagerpb.SecretVersion err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -764,6 +891,12 @@ func (c *gRPCClient) AccessSecretVersion(ctx context.Context, req *secretmanager hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//secretmanager.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.secretmanager.v1.SecretManagerService/AccessSecretVersion") + } opts = append((*c.CallOptions).AccessSecretVersion[0:len((*c.CallOptions).AccessSecretVersion):len((*c.CallOptions).AccessSecretVersion)], opts...) var resp *secretmanagerpb.AccessSecretVersionResponse err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -782,6 +915,12 @@ func (c *gRPCClient) DisableSecretVersion(ctx context.Context, req *secretmanage hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//secretmanager.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.secretmanager.v1.SecretManagerService/DisableSecretVersion") + } opts = append((*c.CallOptions).DisableSecretVersion[0:len((*c.CallOptions).DisableSecretVersion):len((*c.CallOptions).DisableSecretVersion)], opts...) var resp *secretmanagerpb.SecretVersion err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -800,6 +939,12 @@ func (c *gRPCClient) EnableSecretVersion(ctx context.Context, req *secretmanager hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//secretmanager.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.secretmanager.v1.SecretManagerService/EnableSecretVersion") + } opts = append((*c.CallOptions).EnableSecretVersion[0:len((*c.CallOptions).EnableSecretVersion):len((*c.CallOptions).EnableSecretVersion)], opts...) var resp *secretmanagerpb.SecretVersion err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -818,6 +963,12 @@ func (c *gRPCClient) DestroySecretVersion(ctx context.Context, req *secretmanage hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//secretmanager.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.secretmanager.v1.SecretManagerService/DestroySecretVersion") + } opts = append((*c.CallOptions).DestroySecretVersion[0:len((*c.CallOptions).DestroySecretVersion):len((*c.CallOptions).DestroySecretVersion)], opts...) var resp *secretmanagerpb.SecretVersion err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -836,6 +987,12 @@ func (c *gRPCClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRe hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//secretmanager.googleapis.com/%v", req.GetResource())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.secretmanager.v1.SecretManagerService/SetIamPolicy") + } opts = append((*c.CallOptions).SetIamPolicy[0:len((*c.CallOptions).SetIamPolicy):len((*c.CallOptions).SetIamPolicy)], opts...) var resp *iampb.Policy err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -854,6 +1011,12 @@ func (c *gRPCClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRe hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//secretmanager.googleapis.com/%v", req.GetResource())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.secretmanager.v1.SecretManagerService/GetIamPolicy") + } opts = append((*c.CallOptions).GetIamPolicy[0:len((*c.CallOptions).GetIamPolicy):len((*c.CallOptions).GetIamPolicy)], opts...) var resp *iampb.Policy err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -872,6 +1035,12 @@ func (c *gRPCClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamP hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//secretmanager.googleapis.com/%v", req.GetResource())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.secretmanager.v1.SecretManagerService/TestIamPermissions") + } opts = append((*c.CallOptions).TestIamPermissions[0:len((*c.CallOptions).TestIamPermissions):len((*c.CallOptions).TestIamPermissions)], opts...) var resp *iampb.TestIamPermissionsResponse err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -890,6 +1059,9 @@ func (c *gRPCClient) GetLocation(ctx context.Context, req *locationpb.GetLocatio hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.location.Locations/GetLocation") + } opts = append((*c.CallOptions).GetLocation[0:len((*c.CallOptions).GetLocation):len((*c.CallOptions).GetLocation)], opts...) var resp *locationpb.Location err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -908,9 +1080,12 @@ func (c *gRPCClient) ListLocations(ctx context.Context, req *locationpb.ListLoca hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.location.Locations/ListLocations") + } opts = append((*c.CallOptions).ListLocations[0:len((*c.CallOptions).ListLocations):len((*c.CallOptions).ListLocations)], opts...) it := &LocationIterator{} - req = proto.Clone(req).(*locationpb.ListLocationsRequest) + req = proto.CloneOf(req) it.InternalFetch = func(pageSize int, pageToken string) ([]*locationpb.Location, string, error) { resp := &locationpb.ListLocationsResponse{} if pageToken != "" { @@ -952,7 +1127,7 @@ func (c *gRPCClient) ListLocations(ctx context.Context, req *locationpb.ListLoca // ListSecrets lists Secrets. func (c *restClient) ListSecrets(ctx context.Context, req *secretmanagerpb.ListSecretsRequest, opts ...gax.CallOption) *SecretIterator { it := &SecretIterator{} - req = proto.Clone(req).(*secretmanagerpb.ListSecretsRequest) + req = proto.CloneOf(req) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} it.InternalFetch = func(pageSize int, pageToken string) ([]*secretmanagerpb.Secret, string, error) { resp := &secretmanagerpb.ListSecretsResponse{} @@ -1058,6 +1233,13 @@ func (c *restClient) CreateSecret(ctx context.Context, req *secretmanagerpb.Crea hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//secretmanager.googleapis.com/%v", req.GetParent())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.secretmanager.v1.SecretManagerService/CreateSecret") + ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{parent=projects/*}/secrets") + } opts = append((*c.CallOptions).CreateSecret[0:len((*c.CallOptions).CreateSecret):len((*c.CallOptions).CreateSecret)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &secretmanagerpb.Secret{} @@ -1116,6 +1298,13 @@ func (c *restClient) AddSecretVersion(ctx context.Context, req *secretmanagerpb. hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//secretmanager.googleapis.com/%v", req.GetParent())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.secretmanager.v1.SecretManagerService/AddSecretVersion") + ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{parent=projects/*/secrets/*}:addVersion") + } opts = append((*c.CallOptions).AddSecretVersion[0:len((*c.CallOptions).AddSecretVersion):len((*c.CallOptions).AddSecretVersion)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &secretmanagerpb.SecretVersion{} @@ -1166,6 +1355,13 @@ func (c *restClient) GetSecret(ctx context.Context, req *secretmanagerpb.GetSecr hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//secretmanager.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.secretmanager.v1.SecretManagerService/GetSecret") + ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{name=projects/*/secrets/*}") + } opts = append((*c.CallOptions).GetSecret[0:len((*c.CallOptions).GetSecret):len((*c.CallOptions).GetSecret)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &secretmanagerpb.Secret{} @@ -1231,6 +1427,10 @@ func (c *restClient) UpdateSecret(ctx context.Context, req *secretmanagerpb.Upda hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.secretmanager.v1.SecretManagerService/UpdateSecret") + ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{secret.name=projects/*/secrets/*}") + } opts = append((*c.CallOptions).UpdateSecret[0:len((*c.CallOptions).UpdateSecret):len((*c.CallOptions).UpdateSecret)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &secretmanagerpb.Secret{} @@ -1284,6 +1484,13 @@ func (c *restClient) DeleteSecret(ctx context.Context, req *secretmanagerpb.Dele hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//secretmanager.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.secretmanager.v1.SecretManagerService/DeleteSecret") + ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{name=projects/*/secrets/*}") + } return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path @@ -1304,7 +1511,7 @@ func (c *restClient) DeleteSecret(ctx context.Context, req *secretmanagerpb.Dele // call does not return secret data. func (c *restClient) ListSecretVersions(ctx context.Context, req *secretmanagerpb.ListSecretVersionsRequest, opts ...gax.CallOption) *SecretVersionIterator { it := &SecretVersionIterator{} - req = proto.Clone(req).(*secretmanagerpb.ListSecretVersionsRequest) + req = proto.CloneOf(req) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} it.InternalFetch = func(pageSize int, pageToken string) ([]*secretmanagerpb.SecretVersion, string, error) { resp := &secretmanagerpb.ListSecretVersionsResponse{} @@ -1405,6 +1612,13 @@ func (c *restClient) GetSecretVersion(ctx context.Context, req *secretmanagerpb. hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//secretmanager.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.secretmanager.v1.SecretManagerService/GetSecretVersion") + ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{name=projects/*/secrets/*/versions/*}") + } opts = append((*c.CallOptions).GetSecretVersion[0:len((*c.CallOptions).GetSecretVersion):len((*c.CallOptions).GetSecretVersion)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &secretmanagerpb.SecretVersion{} @@ -1459,6 +1673,13 @@ func (c *restClient) AccessSecretVersion(ctx context.Context, req *secretmanager hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//secretmanager.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.secretmanager.v1.SecretManagerService/AccessSecretVersion") + ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{name=projects/*/secrets/*/versions/*}:access") + } opts = append((*c.CallOptions).AccessSecretVersion[0:len((*c.CallOptions).AccessSecretVersion):len((*c.CallOptions).AccessSecretVersion)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &secretmanagerpb.AccessSecretVersionResponse{} @@ -1519,6 +1740,13 @@ func (c *restClient) DisableSecretVersion(ctx context.Context, req *secretmanage hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//secretmanager.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.secretmanager.v1.SecretManagerService/DisableSecretVersion") + ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{name=projects/*/secrets/*/versions/*}:disable") + } opts = append((*c.CallOptions).DisableSecretVersion[0:len((*c.CallOptions).DisableSecretVersion):len((*c.CallOptions).DisableSecretVersion)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &secretmanagerpb.SecretVersion{} @@ -1579,6 +1807,13 @@ func (c *restClient) EnableSecretVersion(ctx context.Context, req *secretmanager hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//secretmanager.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.secretmanager.v1.SecretManagerService/EnableSecretVersion") + ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{name=projects/*/secrets/*/versions/*}:enable") + } opts = append((*c.CallOptions).EnableSecretVersion[0:len((*c.CallOptions).EnableSecretVersion):len((*c.CallOptions).EnableSecretVersion)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &secretmanagerpb.SecretVersion{} @@ -1640,6 +1875,13 @@ func (c *restClient) DestroySecretVersion(ctx context.Context, req *secretmanage hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//secretmanager.googleapis.com/%v", req.GetName())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.secretmanager.v1.SecretManagerService/DestroySecretVersion") + ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{name=projects/*/secrets/*/versions/*}:destroy") + } opts = append((*c.CallOptions).DestroySecretVersion[0:len((*c.CallOptions).DestroySecretVersion):len((*c.CallOptions).DestroySecretVersion)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &secretmanagerpb.SecretVersion{} @@ -1702,6 +1944,13 @@ func (c *restClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRe hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//secretmanager.googleapis.com/%v", req.GetResource())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.secretmanager.v1.SecretManagerService/SetIamPolicy") + ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{resource=projects/*/secrets/*}:setIamPolicy") + } opts = append((*c.CallOptions).SetIamPolicy[0:len((*c.CallOptions).SetIamPolicy):len((*c.CallOptions).SetIamPolicy)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &iampb.Policy{} @@ -1756,6 +2005,13 @@ func (c *restClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRe hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//secretmanager.googleapis.com/%v", req.GetResource())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.secretmanager.v1.SecretManagerService/GetIamPolicy") + ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{resource=projects/*/secrets/*}:getIamPolicy") + } opts = append((*c.CallOptions).GetIamPolicy[0:len((*c.CallOptions).GetIamPolicy):len((*c.CallOptions).GetIamPolicy)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &iampb.Policy{} @@ -1818,6 +2074,13 @@ func (c *restClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamP hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//secretmanager.googleapis.com/%v", req.GetResource())) + } + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.secretmanager.v1.SecretManagerService/TestIamPermissions") + ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{resource=projects/*/secrets/*}:testIamPermissions") + } opts = append((*c.CallOptions).TestIamPermissions[0:len((*c.CallOptions).TestIamPermissions):len((*c.CallOptions).TestIamPermissions)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &iampb.TestIamPermissionsResponse{} @@ -1868,6 +2131,10 @@ func (c *restClient) GetLocation(ctx context.Context, req *locationpb.GetLocatio hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.cloud.location.Locations/GetLocation") + ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{name=projects/*/locations/*}") + } opts = append((*c.CallOptions).GetLocation[0:len((*c.CallOptions).GetLocation):len((*c.CallOptions).GetLocation)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &locationpb.Location{} @@ -1902,7 +2169,7 @@ func (c *restClient) GetLocation(ctx context.Context, req *locationpb.GetLocatio // ListLocations lists information about the supported locations for this service. func (c *restClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator { it := &LocationIterator{} - req = proto.Clone(req).(*locationpb.ListLocationsRequest) + req = proto.CloneOf(req) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} it.InternalFetch = func(pageSize int, pageToken string) ([]*locationpb.Location, string, error) { resp := &locationpb.ListLocationsResponse{} diff --git a/vendor/cloud.google.com/go/secretmanager/apiv1/secretmanagerpb/resources.pb.go b/vendor/cloud.google.com/go/secretmanager/apiv1/secretmanagerpb/resources.pb.go index a83318977c8..bb46a575972 100644 --- a/vendor/cloud.google.com/go/secretmanager/apiv1/secretmanagerpb/resources.pb.go +++ b/vendor/cloud.google.com/go/secretmanager/apiv1/secretmanagerpb/resources.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.7 +// protoc v6.33.2 // source: google/cloud/secretmanager/v1/resources.proto package secretmanagerpb diff --git a/vendor/cloud.google.com/go/secretmanager/apiv1/secretmanagerpb/service.pb.go b/vendor/cloud.google.com/go/secretmanager/apiv1/secretmanagerpb/service.pb.go index 1e9720dacd0..3d8d86b4a7a 100644 --- a/vendor/cloud.google.com/go/secretmanager/apiv1/secretmanagerpb/service.pb.go +++ b/vendor/cloud.google.com/go/secretmanager/apiv1/secretmanagerpb/service.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.7 +// protoc v6.33.2 // source: google/cloud/secretmanager/v1/service.proto package secretmanagerpb diff --git a/vendor/cloud.google.com/go/secretmanager/apiv1/secretmanagerpb/service_grpc.pb.go b/vendor/cloud.google.com/go/secretmanager/apiv1/secretmanagerpb/service_grpc.pb.go index c9b3dc6a659..a192ddae184 100644 --- a/vendor/cloud.google.com/go/secretmanager/apiv1/secretmanagerpb/service_grpc.pb.go +++ b/vendor/cloud.google.com/go/secretmanager/apiv1/secretmanagerpb/service_grpc.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.7 +// - protoc v6.33.2 // source: google/cloud/secretmanager/v1/service.proto package secretmanagerpb diff --git a/vendor/cloud.google.com/go/secretmanager/internal/version.go b/vendor/cloud.google.com/go/secretmanager/internal/version.go index 3e389f5a263..f3374360ee7 100644 --- a/vendor/cloud.google.com/go/secretmanager/internal/version.go +++ b/vendor/cloud.google.com/go/secretmanager/internal/version.go @@ -17,4 +17,4 @@ package internal // Version is the current tagged release of the library. -const Version = "1.17.0" +const Version = "1.20.0" diff --git a/vendor/cloud.google.com/go/storage/CHANGES.md b/vendor/cloud.google.com/go/storage/CHANGES.md index 6fa87546adc..9ccbb9144ca 100644 --- a/vendor/cloud.google.com/go/storage/CHANGES.md +++ b/vendor/cloud.google.com/go/storage/CHANGES.md @@ -1,6 +1,14 @@ # Changes +## [1.62.1](https://github.com/googleapis/google-cloud-go/releases/tag/storage%2Fv1.62.1) (2026-04-13) + +### Bug Fixes + +* Add retry logic for "http2: client connection lost" ([df22e9e](https://github.com/googleapis/google-cloud-go/commit/df22e9e38ea6de00d858ef00475ae286d3fc6834)) + +* Remove redundant gRPC imports from grpc_dp_diag.go ([c5511e2](https://github.com/googleapis/google-cloud-go/commit/c5511e2101cefbf8b6e54193e39382e86b49d822)) + ## [1.62.0](https://github.com/googleapis/google-cloud-go/releases/tag/storage%2Fv1.62.0) (2026-04-06) ### Features diff --git a/vendor/cloud.google.com/go/storage/grpc_client.go b/vendor/cloud.google.com/go/storage/grpc_client.go index 409998209d7..19c8d70184f 100644 --- a/vendor/cloud.google.com/go/storage/grpc_client.go +++ b/vendor/cloud.google.com/go/storage/grpc_client.go @@ -124,6 +124,10 @@ type grpcStorageClient struct { settings *settings config *storageConfig dpDiag string + + // configFeatureAttributes tracks client-level features that are enabled for this + // client instance. + configFeatureAttributes uint32 } func enableClientMetrics(ctx context.Context, s *settings, config storageConfig) (*metricsContext, error) { @@ -240,6 +244,17 @@ func (c *grpcStorageClient) prepareDirectPathMetadata(ctx context.Context, targe md.Set(requestParamsHeaderKey, reason) } } + + // Client level feature tracking. + features := featureAttributes(ctx) + features |= c.configFeatureAttributes + // Merge all existing headers for this key from metadata. + features |= mergeFeatureAttributes(md[featureTrackerHeaderName]) + + if features > 0 { + md.Set(featureTrackerHeaderName, encodeUint32(features)) + } + return metadata.NewOutgoingContext(ctx, md), nil } diff --git a/vendor/cloud.google.com/go/storage/grpc_dp_diag.go b/vendor/cloud.google.com/go/storage/grpc_dp_diag.go index 1ba4a3f004e..21333c5048a 100644 --- a/vendor/cloud.google.com/go/storage/grpc_dp_diag.go +++ b/vendor/cloud.google.com/go/storage/grpc_dp_diag.go @@ -22,8 +22,6 @@ import ( "cloud.google.com/go/compute/metadata" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" - _ "google.golang.org/grpc/balancer/rls" - _ "google.golang.org/grpc/xds/googledirectpath" ) const ( diff --git a/vendor/cloud.google.com/go/storage/http_client.go b/vendor/cloud.google.com/go/storage/http_client.go index 5df86f18ed5..d117d90e551 100644 --- a/vendor/cloud.google.com/go/storage/http_client.go +++ b/vendor/cloud.google.com/go/storage/http_client.go @@ -45,6 +45,8 @@ import ( // httpStorageClient is the HTTP-JSON API implementation of the transport-agnostic // storageClient interface. +// +// TODO(b/498422946): Add client feature tracker in HTTP client. type httpStorageClient struct { creds *auth.Credentials hc *http.Client diff --git a/vendor/cloud.google.com/go/storage/internal/apiv2/storagepb/storage.pb.go b/vendor/cloud.google.com/go/storage/internal/apiv2/storagepb/storage.pb.go index 482aadafa69..ceb8f4ece3a 100644 --- a/vendor/cloud.google.com/go/storage/internal/apiv2/storagepb/storage.pb.go +++ b/vendor/cloud.google.com/go/storage/internal/apiv2/storagepb/storage.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.7 +// protoc v6.31.0 // source: google/storage/v2/storage.proto package storagepb @@ -2782,9 +2782,11 @@ type WriteObjectResponse struct { // // *WriteObjectResponse_PersistedSize // *WriteObjectResponse_Resource - WriteStatus isWriteObjectResponse_WriteStatus `protobuf_oneof:"write_status"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + WriteStatus isWriteObjectResponse_WriteStatus `protobuf_oneof:"write_status"` + // If persisted_size is set, contains checksums of persisted data. + PersistedDataChecksums *ObjectChecksums `protobuf:"bytes,3,opt,name=persisted_data_checksums,json=persistedDataChecksums,proto3" json:"persisted_data_checksums,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *WriteObjectResponse) Reset() { @@ -2842,6 +2844,13 @@ func (x *WriteObjectResponse) GetResource() *Object { return nil } +func (x *WriteObjectResponse) GetPersistedDataChecksums() *ObjectChecksums { + if x != nil { + return x.PersistedDataChecksums + } + return nil +} + type isWriteObjectResponse_WriteStatus interface { isWriteObjectResponse_WriteStatus() } @@ -3008,9 +3017,9 @@ type BidiWriteObjectRequest struct { // *BidiWriteObjectRequest_ChecksummedData Data isBidiWriteObjectRequest_Data `protobuf_oneof:"data"` // Optional. Checksums for the complete object. If the checksums computed by - // the service don't match the specified checksums the call fails. Might only - // be provided in the first request or the last request (with finish_write - // set). + // the service don't match the specified checksums the call fails. May be + // provided in the last request (with finish_write set). For non-appendable + // objects only, may also be provided in the first request. ObjectChecksums *ObjectChecksums `protobuf:"bytes,6,opt,name=object_checksums,json=objectChecksums,proto3" json:"object_checksums,omitempty"` // Optional. For each `BidiWriteObjectRequest` where `state_lookup` is `true` // or the client closes the stream, the service sends a @@ -3213,6 +3222,8 @@ type BidiWriteObjectResponse struct { // *BidiWriteObjectResponse_PersistedSize // *BidiWriteObjectResponse_Resource WriteStatus isBidiWriteObjectResponse_WriteStatus `protobuf_oneof:"write_status"` + // If persisted_size is set, contains checksums of persisted data. + PersistedDataChecksums *ObjectChecksums `protobuf:"bytes,4,opt,name=persisted_data_checksums,json=persistedDataChecksums,proto3" json:"persisted_data_checksums,omitempty"` // An optional write handle that is returned periodically in response // messages. Clients should save it for later use in establishing a new stream // if a connection is interrupted. @@ -3276,6 +3287,13 @@ func (x *BidiWriteObjectResponse) GetResource() *Object { return nil } +func (x *BidiWriteObjectResponse) GetPersistedDataChecksums() *ObjectChecksums { + if x != nil { + return x.PersistedDataChecksums + } + return nil +} + func (x *BidiWriteObjectResponse) GetWriteHandle() *BidiWriteHandle { if x != nil { return x.WriteHandle @@ -3562,9 +3580,11 @@ type QueryWriteStatusResponse struct { // // *QueryWriteStatusResponse_PersistedSize // *QueryWriteStatusResponse_Resource - WriteStatus isQueryWriteStatusResponse_WriteStatus `protobuf_oneof:"write_status"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + WriteStatus isQueryWriteStatusResponse_WriteStatus `protobuf_oneof:"write_status"` + // If persisted_size is set, contains checksums of persisted data. + PersistedDataChecksums *ObjectChecksums `protobuf:"bytes,3,opt,name=persisted_data_checksums,json=persistedDataChecksums,proto3" json:"persisted_data_checksums,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *QueryWriteStatusResponse) Reset() { @@ -3622,6 +3642,13 @@ func (x *QueryWriteStatusResponse) GetResource() *Object { return nil } +func (x *QueryWriteStatusResponse) GetPersistedDataChecksums() *ObjectChecksums { + if x != nil { + return x.PersistedDataChecksums + } + return nil +} + type isQueryWriteStatusResponse_WriteStatus interface { isQueryWriteStatusResponse_WriteStatus() } @@ -8156,10 +8183,11 @@ const file_google_storage_v2_storage_proto_rawDesc = "" + "\ffinish_write\x18\a \x01(\bB\x03\xe0A\x01R\vfinishWrite\x12r\n" + "\x1ccommon_object_request_params\x18\b \x01(\v2,.google.storage.v2.CommonObjectRequestParamsB\x03\xe0A\x01R\x19commonObjectRequestParamsB\x0f\n" + "\rfirst_messageB\x06\n" + - "\x04data\"\x87\x01\n" + + "\x04data\"\xe5\x01\n" + "\x13WriteObjectResponse\x12'\n" + "\x0epersisted_size\x18\x01 \x01(\x03H\x00R\rpersistedSize\x127\n" + - "\bresource\x18\x02 \x01(\v2\x19.google.storage.v2.ObjectH\x00R\bresourceB\x0e\n" + + "\bresource\x18\x02 \x01(\v2\x19.google.storage.v2.ObjectH\x00R\bresource\x12\\\n" + + "\x18persisted_data_checksums\x18\x03 \x01(\v2\".google.storage.v2.ObjectChecksumsR\x16persistedDataChecksumsB\x0e\n" + "\fwrite_status\"\xe9\x03\n" + "\x10AppendObjectSpec\x12=\n" + "\x06bucket\x18\x01 \x01(\tB%\xe0A\x02\xfaA\x1f\n" + @@ -8189,10 +8217,11 @@ const file_google_storage_v2_storage_proto_rawDesc = "" + "\x1ccommon_object_request_params\x18\n" + " \x01(\v2,.google.storage.v2.CommonObjectRequestParamsB\x03\xe0A\x01R\x19commonObjectRequestParamsB\x0f\n" + "\rfirst_messageB\x06\n" + - "\x04data\"\xe8\x01\n" + + "\x04data\"\xc6\x02\n" + "\x17BidiWriteObjectResponse\x12'\n" + "\x0epersisted_size\x18\x01 \x01(\x03H\x00R\rpersistedSize\x127\n" + - "\bresource\x18\x02 \x01(\v2\x19.google.storage.v2.ObjectH\x00R\bresource\x12J\n" + + "\bresource\x18\x02 \x01(\v2\x19.google.storage.v2.ObjectH\x00R\bresource\x12\\\n" + + "\x18persisted_data_checksums\x18\x04 \x01(\v2\".google.storage.v2.ObjectChecksumsR\x16persistedDataChecksums\x12J\n" + "\fwrite_handle\x18\x03 \x01(\v2\".google.storage.v2.BidiWriteHandleH\x01R\vwriteHandle\x88\x01\x01B\x0e\n" + "\fwrite_statusB\x0f\n" + "\r_write_handle\"\x9e\x05\n" + @@ -8219,10 +8248,11 @@ const file_google_storage_v2_storage_proto_rawDesc = "" + "_read_mask\"\xaf\x01\n" + "\x17QueryWriteStatusRequest\x12 \n" + "\tupload_id\x18\x01 \x01(\tB\x03\xe0A\x02R\buploadId\x12r\n" + - "\x1ccommon_object_request_params\x18\x02 \x01(\v2,.google.storage.v2.CommonObjectRequestParamsB\x03\xe0A\x01R\x19commonObjectRequestParams\"\x8c\x01\n" + + "\x1ccommon_object_request_params\x18\x02 \x01(\v2,.google.storage.v2.CommonObjectRequestParamsB\x03\xe0A\x01R\x19commonObjectRequestParams\"\xea\x01\n" + "\x18QueryWriteStatusResponse\x12'\n" + "\x0epersisted_size\x18\x01 \x01(\x03H\x00R\rpersistedSize\x127\n" + - "\bresource\x18\x02 \x01(\v2\x19.google.storage.v2.ObjectH\x00R\bresourceB\x0e\n" + + "\bresource\x18\x02 \x01(\v2\x19.google.storage.v2.ObjectH\x00R\bresource\x12\\\n" + + "\x18persisted_data_checksums\x18\x03 \x01(\v2\".google.storage.v2.ObjectChecksumsR\x16persistedDataChecksumsB\x0e\n" + "\fwrite_status\"\xea\x0e\n" + "\x14RewriteObjectRequest\x121\n" + "\x10destination_name\x18\x18 \x01(\tB\x06\xe0A\x02\xe0A\x05R\x0fdestinationName\x12W\n" + @@ -8827,149 +8857,152 @@ var file_google_storage_v2_storage_proto_depIdxs = []int32{ 48, // 37: google.storage.v2.WriteObjectRequest.object_checksums:type_name -> google.storage.v2.ObjectChecksums 43, // 38: google.storage.v2.WriteObjectRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams 52, // 39: google.storage.v2.WriteObjectResponse.resource:type_name -> google.storage.v2.Object - 27, // 40: google.storage.v2.AppendObjectSpec.write_handle:type_name -> google.storage.v2.BidiWriteHandle - 28, // 41: google.storage.v2.BidiWriteObjectRequest.write_object_spec:type_name -> google.storage.v2.WriteObjectSpec - 31, // 42: google.storage.v2.BidiWriteObjectRequest.append_object_spec:type_name -> google.storage.v2.AppendObjectSpec - 47, // 43: google.storage.v2.BidiWriteObjectRequest.checksummed_data:type_name -> google.storage.v2.ChecksummedData - 48, // 44: google.storage.v2.BidiWriteObjectRequest.object_checksums:type_name -> google.storage.v2.ObjectChecksums - 43, // 45: google.storage.v2.BidiWriteObjectRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams - 52, // 46: google.storage.v2.BidiWriteObjectResponse.resource:type_name -> google.storage.v2.Object - 27, // 47: google.storage.v2.BidiWriteObjectResponse.write_handle:type_name -> google.storage.v2.BidiWriteHandle - 88, // 48: google.storage.v2.ListObjectsRequest.read_mask:type_name -> google.protobuf.FieldMask - 43, // 49: google.storage.v2.QueryWriteStatusRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams - 52, // 50: google.storage.v2.QueryWriteStatusResponse.resource:type_name -> google.storage.v2.Object - 52, // 51: google.storage.v2.RewriteObjectRequest.destination:type_name -> google.storage.v2.Object - 43, // 52: google.storage.v2.RewriteObjectRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams - 48, // 53: google.storage.v2.RewriteObjectRequest.object_checksums:type_name -> google.storage.v2.ObjectChecksums - 52, // 54: google.storage.v2.RewriteResponse.resource:type_name -> google.storage.v2.Object - 28, // 55: google.storage.v2.StartResumableWriteRequest.write_object_spec:type_name -> google.storage.v2.WriteObjectSpec - 43, // 56: google.storage.v2.StartResumableWriteRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams - 48, // 57: google.storage.v2.StartResumableWriteRequest.object_checksums:type_name -> google.storage.v2.ObjectChecksums - 52, // 58: google.storage.v2.UpdateObjectRequest.object:type_name -> google.storage.v2.Object - 88, // 59: google.storage.v2.UpdateObjectRequest.update_mask:type_name -> google.protobuf.FieldMask - 43, // 60: google.storage.v2.UpdateObjectRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams - 46, // 61: google.storage.v2.Bucket.acl:type_name -> google.storage.v2.BucketAccessControl - 53, // 62: google.storage.v2.Bucket.default_object_acl:type_name -> google.storage.v2.ObjectAccessControl - 64, // 63: google.storage.v2.Bucket.lifecycle:type_name -> google.storage.v2.Bucket.Lifecycle - 90, // 64: google.storage.v2.Bucket.create_time:type_name -> google.protobuf.Timestamp - 61, // 65: google.storage.v2.Bucket.cors:type_name -> google.storage.v2.Bucket.Cors - 90, // 66: google.storage.v2.Bucket.update_time:type_name -> google.protobuf.Timestamp - 75, // 67: google.storage.v2.Bucket.labels:type_name -> google.storage.v2.Bucket.LabelsEntry - 70, // 68: google.storage.v2.Bucket.website:type_name -> google.storage.v2.Bucket.Website - 69, // 69: google.storage.v2.Bucket.versioning:type_name -> google.storage.v2.Bucket.Versioning - 65, // 70: google.storage.v2.Bucket.logging:type_name -> google.storage.v2.Bucket.Logging - 56, // 71: google.storage.v2.Bucket.owner:type_name -> google.storage.v2.Owner - 62, // 72: google.storage.v2.Bucket.encryption:type_name -> google.storage.v2.Bucket.Encryption - 60, // 73: google.storage.v2.Bucket.billing:type_name -> google.storage.v2.Bucket.Billing - 67, // 74: google.storage.v2.Bucket.retention_policy:type_name -> google.storage.v2.Bucket.RetentionPolicy - 63, // 75: google.storage.v2.Bucket.iam_config:type_name -> google.storage.v2.Bucket.IamConfig - 71, // 76: google.storage.v2.Bucket.custom_placement_config:type_name -> google.storage.v2.Bucket.CustomPlacementConfig - 72, // 77: google.storage.v2.Bucket.autoclass:type_name -> google.storage.v2.Bucket.Autoclass - 74, // 78: google.storage.v2.Bucket.hierarchical_namespace:type_name -> google.storage.v2.Bucket.HierarchicalNamespace - 68, // 79: google.storage.v2.Bucket.soft_delete_policy:type_name -> google.storage.v2.Bucket.SoftDeletePolicy - 66, // 80: google.storage.v2.Bucket.object_retention:type_name -> google.storage.v2.Bucket.ObjectRetention - 73, // 81: google.storage.v2.Bucket.ip_filter:type_name -> google.storage.v2.Bucket.IpFilter - 55, // 82: google.storage.v2.BucketAccessControl.project_team:type_name -> google.storage.v2.ProjectTeam - 90, // 83: google.storage.v2.ObjectCustomContextPayload.create_time:type_name -> google.protobuf.Timestamp - 90, // 84: google.storage.v2.ObjectCustomContextPayload.update_time:type_name -> google.protobuf.Timestamp - 85, // 85: google.storage.v2.ObjectContexts.custom:type_name -> google.storage.v2.ObjectContexts.CustomEntry - 53, // 86: google.storage.v2.Object.acl:type_name -> google.storage.v2.ObjectAccessControl - 90, // 87: google.storage.v2.Object.delete_time:type_name -> google.protobuf.Timestamp - 90, // 88: google.storage.v2.Object.finalize_time:type_name -> google.protobuf.Timestamp - 90, // 89: google.storage.v2.Object.create_time:type_name -> google.protobuf.Timestamp - 48, // 90: google.storage.v2.Object.checksums:type_name -> google.storage.v2.ObjectChecksums - 90, // 91: google.storage.v2.Object.update_time:type_name -> google.protobuf.Timestamp - 90, // 92: google.storage.v2.Object.update_storage_class_time:type_name -> google.protobuf.Timestamp - 90, // 93: google.storage.v2.Object.retention_expire_time:type_name -> google.protobuf.Timestamp - 87, // 94: google.storage.v2.Object.metadata:type_name -> google.storage.v2.Object.MetadataEntry - 50, // 95: google.storage.v2.Object.contexts:type_name -> google.storage.v2.ObjectContexts - 56, // 96: google.storage.v2.Object.owner:type_name -> google.storage.v2.Owner - 51, // 97: google.storage.v2.Object.customer_encryption:type_name -> google.storage.v2.CustomerEncryption - 90, // 98: google.storage.v2.Object.custom_time:type_name -> google.protobuf.Timestamp - 90, // 99: google.storage.v2.Object.soft_delete_time:type_name -> google.protobuf.Timestamp - 90, // 100: google.storage.v2.Object.hard_delete_time:type_name -> google.protobuf.Timestamp - 86, // 101: google.storage.v2.Object.retention:type_name -> google.storage.v2.Object.Retention - 55, // 102: google.storage.v2.ObjectAccessControl.project_team:type_name -> google.storage.v2.ProjectTeam - 52, // 103: google.storage.v2.ListObjectsResponse.objects:type_name -> google.storage.v2.Object - 59, // 104: google.storage.v2.ComposeObjectRequest.SourceObject.object_preconditions:type_name -> google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - 76, // 105: google.storage.v2.Bucket.Encryption.google_managed_encryption_enforcement_config:type_name -> google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig - 77, // 106: google.storage.v2.Bucket.Encryption.customer_managed_encryption_enforcement_config:type_name -> google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig - 78, // 107: google.storage.v2.Bucket.Encryption.customer_supplied_encryption_enforcement_config:type_name -> google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig - 79, // 108: google.storage.v2.Bucket.IamConfig.uniform_bucket_level_access:type_name -> google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess - 80, // 109: google.storage.v2.Bucket.Lifecycle.rule:type_name -> google.storage.v2.Bucket.Lifecycle.Rule - 90, // 110: google.storage.v2.Bucket.RetentionPolicy.effective_time:type_name -> google.protobuf.Timestamp - 91, // 111: google.storage.v2.Bucket.RetentionPolicy.retention_duration:type_name -> google.protobuf.Duration - 91, // 112: google.storage.v2.Bucket.SoftDeletePolicy.retention_duration:type_name -> google.protobuf.Duration - 90, // 113: google.storage.v2.Bucket.SoftDeletePolicy.effective_time:type_name -> google.protobuf.Timestamp - 90, // 114: google.storage.v2.Bucket.Autoclass.toggle_time:type_name -> google.protobuf.Timestamp - 90, // 115: google.storage.v2.Bucket.Autoclass.terminal_storage_class_update_time:type_name -> google.protobuf.Timestamp - 83, // 116: google.storage.v2.Bucket.IpFilter.public_network_source:type_name -> google.storage.v2.Bucket.IpFilter.PublicNetworkSource - 84, // 117: google.storage.v2.Bucket.IpFilter.vpc_network_sources:type_name -> google.storage.v2.Bucket.IpFilter.VpcNetworkSource - 90, // 118: google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig.effective_time:type_name -> google.protobuf.Timestamp - 90, // 119: google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig.effective_time:type_name -> google.protobuf.Timestamp - 90, // 120: google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig.effective_time:type_name -> google.protobuf.Timestamp - 90, // 121: google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.lock_time:type_name -> google.protobuf.Timestamp - 81, // 122: google.storage.v2.Bucket.Lifecycle.Rule.action:type_name -> google.storage.v2.Bucket.Lifecycle.Rule.Action - 82, // 123: google.storage.v2.Bucket.Lifecycle.Rule.condition:type_name -> google.storage.v2.Bucket.Lifecycle.Rule.Condition - 92, // 124: google.storage.v2.Bucket.Lifecycle.Rule.Condition.created_before:type_name -> google.type.Date - 92, // 125: google.storage.v2.Bucket.Lifecycle.Rule.Condition.custom_time_before:type_name -> google.type.Date - 92, // 126: google.storage.v2.Bucket.Lifecycle.Rule.Condition.noncurrent_time_before:type_name -> google.type.Date - 49, // 127: google.storage.v2.ObjectContexts.CustomEntry.value:type_name -> google.storage.v2.ObjectCustomContextPayload - 1, // 128: google.storage.v2.Object.Retention.mode:type_name -> google.storage.v2.Object.Retention.Mode - 90, // 129: google.storage.v2.Object.Retention.retain_until_time:type_name -> google.protobuf.Timestamp - 2, // 130: google.storage.v2.Storage.DeleteBucket:input_type -> google.storage.v2.DeleteBucketRequest - 3, // 131: google.storage.v2.Storage.GetBucket:input_type -> google.storage.v2.GetBucketRequest - 4, // 132: google.storage.v2.Storage.CreateBucket:input_type -> google.storage.v2.CreateBucketRequest - 5, // 133: google.storage.v2.Storage.ListBuckets:input_type -> google.storage.v2.ListBucketsRequest - 7, // 134: google.storage.v2.Storage.LockBucketRetentionPolicy:input_type -> google.storage.v2.LockBucketRetentionPolicyRequest - 93, // 135: google.storage.v2.Storage.GetIamPolicy:input_type -> google.iam.v1.GetIamPolicyRequest - 94, // 136: google.storage.v2.Storage.SetIamPolicy:input_type -> google.iam.v1.SetIamPolicyRequest - 95, // 137: google.storage.v2.Storage.TestIamPermissions:input_type -> google.iam.v1.TestIamPermissionsRequest - 8, // 138: google.storage.v2.Storage.UpdateBucket:input_type -> google.storage.v2.UpdateBucketRequest - 9, // 139: google.storage.v2.Storage.ComposeObject:input_type -> google.storage.v2.ComposeObjectRequest - 10, // 140: google.storage.v2.Storage.DeleteObject:input_type -> google.storage.v2.DeleteObjectRequest - 11, // 141: google.storage.v2.Storage.RestoreObject:input_type -> google.storage.v2.RestoreObjectRequest - 12, // 142: google.storage.v2.Storage.CancelResumableWrite:input_type -> google.storage.v2.CancelResumableWriteRequest - 15, // 143: google.storage.v2.Storage.GetObject:input_type -> google.storage.v2.GetObjectRequest - 14, // 144: google.storage.v2.Storage.ReadObject:input_type -> google.storage.v2.ReadObjectRequest - 18, // 145: google.storage.v2.Storage.BidiReadObject:input_type -> google.storage.v2.BidiReadObjectRequest - 42, // 146: google.storage.v2.Storage.UpdateObject:input_type -> google.storage.v2.UpdateObjectRequest - 29, // 147: google.storage.v2.Storage.WriteObject:input_type -> google.storage.v2.WriteObjectRequest - 32, // 148: google.storage.v2.Storage.BidiWriteObject:input_type -> google.storage.v2.BidiWriteObjectRequest - 34, // 149: google.storage.v2.Storage.ListObjects:input_type -> google.storage.v2.ListObjectsRequest - 37, // 150: google.storage.v2.Storage.RewriteObject:input_type -> google.storage.v2.RewriteObjectRequest - 40, // 151: google.storage.v2.Storage.StartResumableWrite:input_type -> google.storage.v2.StartResumableWriteRequest - 35, // 152: google.storage.v2.Storage.QueryWriteStatus:input_type -> google.storage.v2.QueryWriteStatusRequest - 39, // 153: google.storage.v2.Storage.MoveObject:input_type -> google.storage.v2.MoveObjectRequest - 96, // 154: google.storage.v2.Storage.DeleteBucket:output_type -> google.protobuf.Empty - 45, // 155: google.storage.v2.Storage.GetBucket:output_type -> google.storage.v2.Bucket - 45, // 156: google.storage.v2.Storage.CreateBucket:output_type -> google.storage.v2.Bucket - 6, // 157: google.storage.v2.Storage.ListBuckets:output_type -> google.storage.v2.ListBucketsResponse - 45, // 158: google.storage.v2.Storage.LockBucketRetentionPolicy:output_type -> google.storage.v2.Bucket - 97, // 159: google.storage.v2.Storage.GetIamPolicy:output_type -> google.iam.v1.Policy - 97, // 160: google.storage.v2.Storage.SetIamPolicy:output_type -> google.iam.v1.Policy - 98, // 161: google.storage.v2.Storage.TestIamPermissions:output_type -> google.iam.v1.TestIamPermissionsResponse - 45, // 162: google.storage.v2.Storage.UpdateBucket:output_type -> google.storage.v2.Bucket - 52, // 163: google.storage.v2.Storage.ComposeObject:output_type -> google.storage.v2.Object - 96, // 164: google.storage.v2.Storage.DeleteObject:output_type -> google.protobuf.Empty - 52, // 165: google.storage.v2.Storage.RestoreObject:output_type -> google.storage.v2.Object - 13, // 166: google.storage.v2.Storage.CancelResumableWrite:output_type -> google.storage.v2.CancelResumableWriteResponse - 52, // 167: google.storage.v2.Storage.GetObject:output_type -> google.storage.v2.Object - 16, // 168: google.storage.v2.Storage.ReadObject:output_type -> google.storage.v2.ReadObjectResponse - 19, // 169: google.storage.v2.Storage.BidiReadObject:output_type -> google.storage.v2.BidiReadObjectResponse - 52, // 170: google.storage.v2.Storage.UpdateObject:output_type -> google.storage.v2.Object - 30, // 171: google.storage.v2.Storage.WriteObject:output_type -> google.storage.v2.WriteObjectResponse - 33, // 172: google.storage.v2.Storage.BidiWriteObject:output_type -> google.storage.v2.BidiWriteObjectResponse - 54, // 173: google.storage.v2.Storage.ListObjects:output_type -> google.storage.v2.ListObjectsResponse - 38, // 174: google.storage.v2.Storage.RewriteObject:output_type -> google.storage.v2.RewriteResponse - 41, // 175: google.storage.v2.Storage.StartResumableWrite:output_type -> google.storage.v2.StartResumableWriteResponse - 36, // 176: google.storage.v2.Storage.QueryWriteStatus:output_type -> google.storage.v2.QueryWriteStatusResponse - 52, // 177: google.storage.v2.Storage.MoveObject:output_type -> google.storage.v2.Object - 154, // [154:178] is the sub-list for method output_type - 130, // [130:154] is the sub-list for method input_type - 130, // [130:130] is the sub-list for extension type_name - 130, // [130:130] is the sub-list for extension extendee - 0, // [0:130] is the sub-list for field type_name + 48, // 40: google.storage.v2.WriteObjectResponse.persisted_data_checksums:type_name -> google.storage.v2.ObjectChecksums + 27, // 41: google.storage.v2.AppendObjectSpec.write_handle:type_name -> google.storage.v2.BidiWriteHandle + 28, // 42: google.storage.v2.BidiWriteObjectRequest.write_object_spec:type_name -> google.storage.v2.WriteObjectSpec + 31, // 43: google.storage.v2.BidiWriteObjectRequest.append_object_spec:type_name -> google.storage.v2.AppendObjectSpec + 47, // 44: google.storage.v2.BidiWriteObjectRequest.checksummed_data:type_name -> google.storage.v2.ChecksummedData + 48, // 45: google.storage.v2.BidiWriteObjectRequest.object_checksums:type_name -> google.storage.v2.ObjectChecksums + 43, // 46: google.storage.v2.BidiWriteObjectRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams + 52, // 47: google.storage.v2.BidiWriteObjectResponse.resource:type_name -> google.storage.v2.Object + 48, // 48: google.storage.v2.BidiWriteObjectResponse.persisted_data_checksums:type_name -> google.storage.v2.ObjectChecksums + 27, // 49: google.storage.v2.BidiWriteObjectResponse.write_handle:type_name -> google.storage.v2.BidiWriteHandle + 88, // 50: google.storage.v2.ListObjectsRequest.read_mask:type_name -> google.protobuf.FieldMask + 43, // 51: google.storage.v2.QueryWriteStatusRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams + 52, // 52: google.storage.v2.QueryWriteStatusResponse.resource:type_name -> google.storage.v2.Object + 48, // 53: google.storage.v2.QueryWriteStatusResponse.persisted_data_checksums:type_name -> google.storage.v2.ObjectChecksums + 52, // 54: google.storage.v2.RewriteObjectRequest.destination:type_name -> google.storage.v2.Object + 43, // 55: google.storage.v2.RewriteObjectRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams + 48, // 56: google.storage.v2.RewriteObjectRequest.object_checksums:type_name -> google.storage.v2.ObjectChecksums + 52, // 57: google.storage.v2.RewriteResponse.resource:type_name -> google.storage.v2.Object + 28, // 58: google.storage.v2.StartResumableWriteRequest.write_object_spec:type_name -> google.storage.v2.WriteObjectSpec + 43, // 59: google.storage.v2.StartResumableWriteRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams + 48, // 60: google.storage.v2.StartResumableWriteRequest.object_checksums:type_name -> google.storage.v2.ObjectChecksums + 52, // 61: google.storage.v2.UpdateObjectRequest.object:type_name -> google.storage.v2.Object + 88, // 62: google.storage.v2.UpdateObjectRequest.update_mask:type_name -> google.protobuf.FieldMask + 43, // 63: google.storage.v2.UpdateObjectRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams + 46, // 64: google.storage.v2.Bucket.acl:type_name -> google.storage.v2.BucketAccessControl + 53, // 65: google.storage.v2.Bucket.default_object_acl:type_name -> google.storage.v2.ObjectAccessControl + 64, // 66: google.storage.v2.Bucket.lifecycle:type_name -> google.storage.v2.Bucket.Lifecycle + 90, // 67: google.storage.v2.Bucket.create_time:type_name -> google.protobuf.Timestamp + 61, // 68: google.storage.v2.Bucket.cors:type_name -> google.storage.v2.Bucket.Cors + 90, // 69: google.storage.v2.Bucket.update_time:type_name -> google.protobuf.Timestamp + 75, // 70: google.storage.v2.Bucket.labels:type_name -> google.storage.v2.Bucket.LabelsEntry + 70, // 71: google.storage.v2.Bucket.website:type_name -> google.storage.v2.Bucket.Website + 69, // 72: google.storage.v2.Bucket.versioning:type_name -> google.storage.v2.Bucket.Versioning + 65, // 73: google.storage.v2.Bucket.logging:type_name -> google.storage.v2.Bucket.Logging + 56, // 74: google.storage.v2.Bucket.owner:type_name -> google.storage.v2.Owner + 62, // 75: google.storage.v2.Bucket.encryption:type_name -> google.storage.v2.Bucket.Encryption + 60, // 76: google.storage.v2.Bucket.billing:type_name -> google.storage.v2.Bucket.Billing + 67, // 77: google.storage.v2.Bucket.retention_policy:type_name -> google.storage.v2.Bucket.RetentionPolicy + 63, // 78: google.storage.v2.Bucket.iam_config:type_name -> google.storage.v2.Bucket.IamConfig + 71, // 79: google.storage.v2.Bucket.custom_placement_config:type_name -> google.storage.v2.Bucket.CustomPlacementConfig + 72, // 80: google.storage.v2.Bucket.autoclass:type_name -> google.storage.v2.Bucket.Autoclass + 74, // 81: google.storage.v2.Bucket.hierarchical_namespace:type_name -> google.storage.v2.Bucket.HierarchicalNamespace + 68, // 82: google.storage.v2.Bucket.soft_delete_policy:type_name -> google.storage.v2.Bucket.SoftDeletePolicy + 66, // 83: google.storage.v2.Bucket.object_retention:type_name -> google.storage.v2.Bucket.ObjectRetention + 73, // 84: google.storage.v2.Bucket.ip_filter:type_name -> google.storage.v2.Bucket.IpFilter + 55, // 85: google.storage.v2.BucketAccessControl.project_team:type_name -> google.storage.v2.ProjectTeam + 90, // 86: google.storage.v2.ObjectCustomContextPayload.create_time:type_name -> google.protobuf.Timestamp + 90, // 87: google.storage.v2.ObjectCustomContextPayload.update_time:type_name -> google.protobuf.Timestamp + 85, // 88: google.storage.v2.ObjectContexts.custom:type_name -> google.storage.v2.ObjectContexts.CustomEntry + 53, // 89: google.storage.v2.Object.acl:type_name -> google.storage.v2.ObjectAccessControl + 90, // 90: google.storage.v2.Object.delete_time:type_name -> google.protobuf.Timestamp + 90, // 91: google.storage.v2.Object.finalize_time:type_name -> google.protobuf.Timestamp + 90, // 92: google.storage.v2.Object.create_time:type_name -> google.protobuf.Timestamp + 48, // 93: google.storage.v2.Object.checksums:type_name -> google.storage.v2.ObjectChecksums + 90, // 94: google.storage.v2.Object.update_time:type_name -> google.protobuf.Timestamp + 90, // 95: google.storage.v2.Object.update_storage_class_time:type_name -> google.protobuf.Timestamp + 90, // 96: google.storage.v2.Object.retention_expire_time:type_name -> google.protobuf.Timestamp + 87, // 97: google.storage.v2.Object.metadata:type_name -> google.storage.v2.Object.MetadataEntry + 50, // 98: google.storage.v2.Object.contexts:type_name -> google.storage.v2.ObjectContexts + 56, // 99: google.storage.v2.Object.owner:type_name -> google.storage.v2.Owner + 51, // 100: google.storage.v2.Object.customer_encryption:type_name -> google.storage.v2.CustomerEncryption + 90, // 101: google.storage.v2.Object.custom_time:type_name -> google.protobuf.Timestamp + 90, // 102: google.storage.v2.Object.soft_delete_time:type_name -> google.protobuf.Timestamp + 90, // 103: google.storage.v2.Object.hard_delete_time:type_name -> google.protobuf.Timestamp + 86, // 104: google.storage.v2.Object.retention:type_name -> google.storage.v2.Object.Retention + 55, // 105: google.storage.v2.ObjectAccessControl.project_team:type_name -> google.storage.v2.ProjectTeam + 52, // 106: google.storage.v2.ListObjectsResponse.objects:type_name -> google.storage.v2.Object + 59, // 107: google.storage.v2.ComposeObjectRequest.SourceObject.object_preconditions:type_name -> google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions + 76, // 108: google.storage.v2.Bucket.Encryption.google_managed_encryption_enforcement_config:type_name -> google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig + 77, // 109: google.storage.v2.Bucket.Encryption.customer_managed_encryption_enforcement_config:type_name -> google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig + 78, // 110: google.storage.v2.Bucket.Encryption.customer_supplied_encryption_enforcement_config:type_name -> google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig + 79, // 111: google.storage.v2.Bucket.IamConfig.uniform_bucket_level_access:type_name -> google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess + 80, // 112: google.storage.v2.Bucket.Lifecycle.rule:type_name -> google.storage.v2.Bucket.Lifecycle.Rule + 90, // 113: google.storage.v2.Bucket.RetentionPolicy.effective_time:type_name -> google.protobuf.Timestamp + 91, // 114: google.storage.v2.Bucket.RetentionPolicy.retention_duration:type_name -> google.protobuf.Duration + 91, // 115: google.storage.v2.Bucket.SoftDeletePolicy.retention_duration:type_name -> google.protobuf.Duration + 90, // 116: google.storage.v2.Bucket.SoftDeletePolicy.effective_time:type_name -> google.protobuf.Timestamp + 90, // 117: google.storage.v2.Bucket.Autoclass.toggle_time:type_name -> google.protobuf.Timestamp + 90, // 118: google.storage.v2.Bucket.Autoclass.terminal_storage_class_update_time:type_name -> google.protobuf.Timestamp + 83, // 119: google.storage.v2.Bucket.IpFilter.public_network_source:type_name -> google.storage.v2.Bucket.IpFilter.PublicNetworkSource + 84, // 120: google.storage.v2.Bucket.IpFilter.vpc_network_sources:type_name -> google.storage.v2.Bucket.IpFilter.VpcNetworkSource + 90, // 121: google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig.effective_time:type_name -> google.protobuf.Timestamp + 90, // 122: google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig.effective_time:type_name -> google.protobuf.Timestamp + 90, // 123: google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig.effective_time:type_name -> google.protobuf.Timestamp + 90, // 124: google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.lock_time:type_name -> google.protobuf.Timestamp + 81, // 125: google.storage.v2.Bucket.Lifecycle.Rule.action:type_name -> google.storage.v2.Bucket.Lifecycle.Rule.Action + 82, // 126: google.storage.v2.Bucket.Lifecycle.Rule.condition:type_name -> google.storage.v2.Bucket.Lifecycle.Rule.Condition + 92, // 127: google.storage.v2.Bucket.Lifecycle.Rule.Condition.created_before:type_name -> google.type.Date + 92, // 128: google.storage.v2.Bucket.Lifecycle.Rule.Condition.custom_time_before:type_name -> google.type.Date + 92, // 129: google.storage.v2.Bucket.Lifecycle.Rule.Condition.noncurrent_time_before:type_name -> google.type.Date + 49, // 130: google.storage.v2.ObjectContexts.CustomEntry.value:type_name -> google.storage.v2.ObjectCustomContextPayload + 1, // 131: google.storage.v2.Object.Retention.mode:type_name -> google.storage.v2.Object.Retention.Mode + 90, // 132: google.storage.v2.Object.Retention.retain_until_time:type_name -> google.protobuf.Timestamp + 2, // 133: google.storage.v2.Storage.DeleteBucket:input_type -> google.storage.v2.DeleteBucketRequest + 3, // 134: google.storage.v2.Storage.GetBucket:input_type -> google.storage.v2.GetBucketRequest + 4, // 135: google.storage.v2.Storage.CreateBucket:input_type -> google.storage.v2.CreateBucketRequest + 5, // 136: google.storage.v2.Storage.ListBuckets:input_type -> google.storage.v2.ListBucketsRequest + 7, // 137: google.storage.v2.Storage.LockBucketRetentionPolicy:input_type -> google.storage.v2.LockBucketRetentionPolicyRequest + 93, // 138: google.storage.v2.Storage.GetIamPolicy:input_type -> google.iam.v1.GetIamPolicyRequest + 94, // 139: google.storage.v2.Storage.SetIamPolicy:input_type -> google.iam.v1.SetIamPolicyRequest + 95, // 140: google.storage.v2.Storage.TestIamPermissions:input_type -> google.iam.v1.TestIamPermissionsRequest + 8, // 141: google.storage.v2.Storage.UpdateBucket:input_type -> google.storage.v2.UpdateBucketRequest + 9, // 142: google.storage.v2.Storage.ComposeObject:input_type -> google.storage.v2.ComposeObjectRequest + 10, // 143: google.storage.v2.Storage.DeleteObject:input_type -> google.storage.v2.DeleteObjectRequest + 11, // 144: google.storage.v2.Storage.RestoreObject:input_type -> google.storage.v2.RestoreObjectRequest + 12, // 145: google.storage.v2.Storage.CancelResumableWrite:input_type -> google.storage.v2.CancelResumableWriteRequest + 15, // 146: google.storage.v2.Storage.GetObject:input_type -> google.storage.v2.GetObjectRequest + 14, // 147: google.storage.v2.Storage.ReadObject:input_type -> google.storage.v2.ReadObjectRequest + 18, // 148: google.storage.v2.Storage.BidiReadObject:input_type -> google.storage.v2.BidiReadObjectRequest + 42, // 149: google.storage.v2.Storage.UpdateObject:input_type -> google.storage.v2.UpdateObjectRequest + 29, // 150: google.storage.v2.Storage.WriteObject:input_type -> google.storage.v2.WriteObjectRequest + 32, // 151: google.storage.v2.Storage.BidiWriteObject:input_type -> google.storage.v2.BidiWriteObjectRequest + 34, // 152: google.storage.v2.Storage.ListObjects:input_type -> google.storage.v2.ListObjectsRequest + 37, // 153: google.storage.v2.Storage.RewriteObject:input_type -> google.storage.v2.RewriteObjectRequest + 40, // 154: google.storage.v2.Storage.StartResumableWrite:input_type -> google.storage.v2.StartResumableWriteRequest + 35, // 155: google.storage.v2.Storage.QueryWriteStatus:input_type -> google.storage.v2.QueryWriteStatusRequest + 39, // 156: google.storage.v2.Storage.MoveObject:input_type -> google.storage.v2.MoveObjectRequest + 96, // 157: google.storage.v2.Storage.DeleteBucket:output_type -> google.protobuf.Empty + 45, // 158: google.storage.v2.Storage.GetBucket:output_type -> google.storage.v2.Bucket + 45, // 159: google.storage.v2.Storage.CreateBucket:output_type -> google.storage.v2.Bucket + 6, // 160: google.storage.v2.Storage.ListBuckets:output_type -> google.storage.v2.ListBucketsResponse + 45, // 161: google.storage.v2.Storage.LockBucketRetentionPolicy:output_type -> google.storage.v2.Bucket + 97, // 162: google.storage.v2.Storage.GetIamPolicy:output_type -> google.iam.v1.Policy + 97, // 163: google.storage.v2.Storage.SetIamPolicy:output_type -> google.iam.v1.Policy + 98, // 164: google.storage.v2.Storage.TestIamPermissions:output_type -> google.iam.v1.TestIamPermissionsResponse + 45, // 165: google.storage.v2.Storage.UpdateBucket:output_type -> google.storage.v2.Bucket + 52, // 166: google.storage.v2.Storage.ComposeObject:output_type -> google.storage.v2.Object + 96, // 167: google.storage.v2.Storage.DeleteObject:output_type -> google.protobuf.Empty + 52, // 168: google.storage.v2.Storage.RestoreObject:output_type -> google.storage.v2.Object + 13, // 169: google.storage.v2.Storage.CancelResumableWrite:output_type -> google.storage.v2.CancelResumableWriteResponse + 52, // 170: google.storage.v2.Storage.GetObject:output_type -> google.storage.v2.Object + 16, // 171: google.storage.v2.Storage.ReadObject:output_type -> google.storage.v2.ReadObjectResponse + 19, // 172: google.storage.v2.Storage.BidiReadObject:output_type -> google.storage.v2.BidiReadObjectResponse + 52, // 173: google.storage.v2.Storage.UpdateObject:output_type -> google.storage.v2.Object + 30, // 174: google.storage.v2.Storage.WriteObject:output_type -> google.storage.v2.WriteObjectResponse + 33, // 175: google.storage.v2.Storage.BidiWriteObject:output_type -> google.storage.v2.BidiWriteObjectResponse + 54, // 176: google.storage.v2.Storage.ListObjects:output_type -> google.storage.v2.ListObjectsResponse + 38, // 177: google.storage.v2.Storage.RewriteObject:output_type -> google.storage.v2.RewriteResponse + 41, // 178: google.storage.v2.Storage.StartResumableWrite:output_type -> google.storage.v2.StartResumableWriteResponse + 36, // 179: google.storage.v2.Storage.QueryWriteStatus:output_type -> google.storage.v2.QueryWriteStatusResponse + 52, // 180: google.storage.v2.Storage.MoveObject:output_type -> google.storage.v2.Object + 157, // [157:181] is the sub-list for method output_type + 133, // [133:157] is the sub-list for method input_type + 133, // [133:133] is the sub-list for extension type_name + 133, // [133:133] is the sub-list for extension extendee + 0, // [0:133] is the sub-list for field type_name } func init() { file_google_storage_v2_storage_proto_init() } diff --git a/vendor/cloud.google.com/go/storage/internal/apiv2/storagepb/storage_grpc.pb.go b/vendor/cloud.google.com/go/storage/internal/apiv2/storagepb/storage_grpc.pb.go index 10631804fe3..f12e2300b89 100644 --- a/vendor/cloud.google.com/go/storage/internal/apiv2/storagepb/storage_grpc.pb.go +++ b/vendor/cloud.google.com/go/storage/internal/apiv2/storagepb/storage_grpc.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.7 +// - protoc v6.31.0 // source: google/storage/v2/storage.proto package storagepb diff --git a/vendor/cloud.google.com/go/storage/internal/version.go b/vendor/cloud.google.com/go/storage/internal/version.go index fa6d97e7625..8180ba7a8f5 100644 --- a/vendor/cloud.google.com/go/storage/internal/version.go +++ b/vendor/cloud.google.com/go/storage/internal/version.go @@ -17,4 +17,4 @@ package internal // Version is the current tagged release of the library. -const Version = "1.62.0" +const Version = "1.62.1" diff --git a/vendor/cloud.google.com/go/storage/invoke.go b/vendor/cloud.google.com/go/storage/invoke.go index 4574a98ad30..b0d27c4dae1 100644 --- a/vendor/cloud.google.com/go/storage/invoke.go +++ b/vendor/cloud.google.com/go/storage/invoke.go @@ -209,7 +209,7 @@ func ShouldRetry(err error) bool { // Retry socket-level errors ECONNREFUSED and ECONNRESET (from syscall). // Unfortunately the error type is unexported, so we resort to string // matching. - retriable := []string{"connection refused", "connection reset", "broken pipe"} + retriable := []string{"connection refused", "connection reset", "broken pipe", "client connection lost"} for _, s := range retriable { if strings.Contains(e.Error(), s) { return true diff --git a/vendor/cloud.google.com/go/storage/pcu.go b/vendor/cloud.google.com/go/storage/pcu.go index 1b35be91c13..6ca8fad06e3 100644 --- a/vendor/cloud.google.com/go/storage/pcu.go +++ b/vendor/cloud.google.com/go/storage/pcu.go @@ -179,6 +179,9 @@ func (w *Writer) initPCU(ctx context.Context) error { s := newPCUSettings(cfg.MaxConcurrency) + // Track PCU operations using client feature tracking header. + ctx = addFeatureAttributes(ctx, featurePCU) + pCtx, cancel := context.WithCancel(ctx) state := &pcuState{ diff --git a/vendor/cloud.google.com/go/storage/reader.go b/vendor/cloud.google.com/go/storage/reader.go index 043cb4671f9..1ba21a21fa7 100644 --- a/vendor/cloud.google.com/go/storage/reader.go +++ b/vendor/cloud.google.com/go/storage/reader.go @@ -265,7 +265,9 @@ func (o *ObjectHandle) NewMultiRangeDownloader(ctx context.Context, opts ...MRDO for _, opt := range opts { opt.apply(params) } - + if params.minConnections > 1 || params.maxConnections > 1 { + spanCtx = addFeatureAttributes(spanCtx, featureMultistreamInMRD) + } // This call will return the *MultiRangeDownloader with the .impl field set. return o.c.tc.NewMultiRangeDownloader(spanCtx, params, storageOpts...) } diff --git a/vendor/cloud.google.com/go/storage/tracked_features.go b/vendor/cloud.google.com/go/storage/tracked_features.go index fb1bcdc843f..9d29cf75285 100644 --- a/vendor/cloud.google.com/go/storage/tracked_features.go +++ b/vendor/cloud.google.com/go/storage/tracked_features.go @@ -16,7 +16,7 @@ package storage // trackedFeature represents a specific client feature being tracked, represented // as a bit in a bitmask. Each feature corresponds to a specific bit position. -type trackedFeature uint +type trackedFeature uint32 const ( featureMultistreamInMRD trackedFeature = 0 diff --git a/vendor/cloud.google.com/go/storage/tracker.go b/vendor/cloud.google.com/go/storage/tracker.go new file mode 100644 index 00000000000..003cb76bcf1 --- /dev/null +++ b/vendor/cloud.google.com/go/storage/tracker.go @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package storage + +import ( + "context" + + "github.com/googleapis/gax-go/v2/callctx" +) + +const featureTrackerHeaderName = "x-goog-storage-go-features" + +// addFeatureAttributes adds the specified feature codes to the context. +// Features are stored as a bitmask in the callctx headers and will be +// injected into the outgoing request headers by the transport. +func addFeatureAttributes(ctx context.Context, features ...trackedFeature) context.Context { + if len(features) == 0 { + return ctx + } + + current := featureAttributes(ctx) + updated := current + for _, f := range features { + updated |= (1 << f) + } + + if updated == current { + return ctx + } + + return callctx.SetHeaders(ctx, featureTrackerHeaderName, encodeUint32(uint32(updated))) +} + +// featureAttributes extracts and merges all feature attributes present in the context. +// It returns a bitmask represented as a uint8. +func featureAttributes(ctx context.Context) uint32 { + ctxHeaders := callctx.HeadersFromContext(ctx) + // If multiple values are present in the context (e.g. from nested calls), + // merge them into a single bitmask. + return mergeFeatureAttributes(ctxHeaders[featureTrackerHeaderName]) +} + +func mergeFeatureAttributes(vals []string) uint32 { + features := uint32(0) + for _, val := range vals { + if decoded, err := decodeUint32(val); err == nil { + features |= decoded + } + } + return features +} diff --git a/vendor/filippo.io/edwards25519/README.md b/vendor/filippo.io/edwards25519/README.md index 24e2457d875..dcdd8d85fc2 100644 --- a/vendor/filippo.io/edwards25519/README.md +++ b/vendor/filippo.io/edwards25519/README.md @@ -7,8 +7,10 @@ import "filippo.io/edwards25519" This library implements the edwards25519 elliptic curve, exposing the necessary APIs to build a wide array of higher-level primitives. Read the docs at [pkg.go.dev/filippo.io/edwards25519](https://pkg.go.dev/filippo.io/edwards25519). -The code is originally derived from Adam Langley's internal implementation in the Go standard library, and includes George Tankersley's [performance improvements](https://golang.org/cl/71950). It was then further developed by Henry de Valence for use in ristretto255, and was finally [merged back into the Go standard library](https://golang.org/cl/276272) as of Go 1.17. It now tracks the upstream codebase and extends it with additional functionality. +The package tracks the upstream standard library package `crypto/internal/fips140/edwards25519` and extends it with additional functionality. -Most users don't need this package, and should instead use `crypto/ed25519` for signatures, `golang.org/x/crypto/curve25519` for Diffie-Hellman, or `github.com/gtank/ristretto255` for prime order group logic. However, for anyone currently using a fork of `crypto/internal/edwards25519`/`crypto/ed25519/internal/edwards25519` or `github.com/agl/edwards25519`, this package should be a safer, faster, and more powerful alternative. +The code is originally derived from Adam Langley's internal implementation in the Go standard library, and includes George Tankersley's [performance improvements](https://golang.org/cl/71950). It was then further developed by Henry de Valence for use in ristretto255, and was finally [merged back into the Go standard library](https://golang.org/cl/276272) as of Go 1.17. + +Most users don't need this package, and should instead use `crypto/ed25519` for signatures, `crypto/ecdh` for Diffie-Hellman, or `github.com/gtank/ristretto255` for prime order group logic. However, for anyone currently using a fork of the internal `edwards25519` package or of `github.com/agl/edwards25519`, this package should be a safer, faster, and more powerful alternative. Since this package is meant to curb proliferation of edwards25519 implementations in the Go ecosystem, it welcomes requests for new APIs or reviewable performance improvements. diff --git a/vendor/filippo.io/edwards25519/doc.go b/vendor/filippo.io/edwards25519/doc.go index ab6aaebc0ff..dd2deb64493 100644 --- a/vendor/filippo.io/edwards25519/doc.go +++ b/vendor/filippo.io/edwards25519/doc.go @@ -10,11 +10,11 @@ // the curve used by the Ed25519 signature scheme. // // Most users don't need this package, and should instead use crypto/ed25519 for -// signatures, golang.org/x/crypto/curve25519 for Diffie-Hellman, or -// github.com/gtank/ristretto255 for prime order group logic. +// signatures, crypto/ecdh for Diffie-Hellman, or github.com/gtank/ristretto255 +// for prime order group logic. // // However, developers who do need to interact with low-level edwards25519 // operations can use this package, which is an extended version of -// crypto/internal/edwards25519 from the standard library repackaged as +// crypto/internal/fips140/edwards25519 from the standard library repackaged as // an importable module. package edwards25519 diff --git a/vendor/filippo.io/edwards25519/extra.go b/vendor/filippo.io/edwards25519/extra.go index ab2e44a518e..ee9b5ca5bfe 100644 --- a/vendor/filippo.io/edwards25519/extra.go +++ b/vendor/filippo.io/edwards25519/extra.go @@ -9,6 +9,7 @@ package edwards25519 import ( "errors" + "slices" "filippo.io/edwards25519/field" ) @@ -100,13 +101,15 @@ func (v *Point) bytesMontgomery(buf *[32]byte) []byte { // // u = (1 + y) / (1 - y) // - // where y = Y / Z. + // where y = Y / Z and therefore + // + // u = (Z + Y) / (Z - Y) - var y, recip, u field.Element + var n, r, u field.Element - y.Multiply(&v.y, y.Invert(&v.z)) // y = Y / Z - recip.Invert(recip.Subtract(feOne, &y)) // r = 1/(1 - y) - u.Multiply(u.Add(feOne, &y), &recip) // u = (1 + y)*r + n.Add(&v.z, &v.y) // n = Z + Y + r.Invert(r.Subtract(&v.z, &v.y)) // r = 1 / (Z - Y) + u.Multiply(&n, &r) // u = n * r return copyFieldElement(buf, &u) } @@ -124,7 +127,7 @@ func (v *Point) MultByCofactor(p *Point) *Point { return v.fromP1xP1(&result) } -// Given k > 0, set s = s**(2*i). +// Given k > 0, set s = s**(2*k). func (s *Scalar) pow2k(k int) { for i := 0; i < k; i++ { s.Multiply(s, s) @@ -250,12 +253,14 @@ func (v *Point) MultiScalarMult(scalars []*Scalar, points []*Point) *Point { // between each point in the multiscalar equation. // Build lookup tables for each point - tables := make([]projLookupTable, len(points)) + tables := make([]projLookupTable, 0, 2) // avoid allocation for small sizes + tables = slices.Grow(tables, len(points))[:len(points)] for i := range tables { tables[i].FromP3(points[i]) } // Compute signed radix-16 digits for each scalar - digits := make([][64]int8, len(scalars)) + digits := make([][64]int8, 0, 2) // avoid allocation for small sizes + digits = slices.Grow(digits, len(scalars))[:len(scalars)] for i := range digits { digits[i] = scalars[i].signedRadix16() } @@ -348,3 +353,49 @@ func (v *Point) VarTimeMultiScalarMult(scalars []*Scalar, points []*Point) *Poin v.fromP2(tmp2) return v } + +// Select sets v to a if cond == 1 and to b if cond == 0. +func (v *Point) Select(a, b *Point, cond int) *Point { + checkInitialized(a, b) + v.x.Select(&a.x, &b.x, cond) + v.y.Select(&a.y, &b.y, cond) + v.z.Select(&a.z, &b.z, cond) + v.t.Select(&a.t, &b.t, cond) + return v +} + +// Double sets v = p + p, and returns v. +func (v *Point) Double(p *Point) *Point { + checkInitialized(p) + + pp := new(projP2).FromP3(p) + p1 := new(projP1xP1).Double(pp) + return v.fromP1xP1(p1) +} + +func (v *Point) addCached(p *Point, qCached *projCached) *Point { + result := new(projP1xP1).Add(p, qCached) + return v.fromP1xP1(result) +} + +// ScalarMultSlow sets v = x * q, and returns v. It doesn't precompute a large +// table, so it is considerably slower, but requires less memory. +// +// The scalar multiplication is done in constant time. +func (v *Point) ScalarMultSlow(x *Scalar, q *Point) *Point { + checkInitialized(q) + + s := x.Bytes() + qCached := new(projCached).FromP3(q) + v.Set(NewIdentityPoint()) + t := new(Point) + + for i := 255; i >= 0; i-- { + v.Double(v) + t.addCached(v, qCached) + cond := (s[i/8] >> (i % 8)) & 1 + v.Select(t, v, int(cond)) + } + + return v +} diff --git a/vendor/filippo.io/edwards25519/field/fe.go b/vendor/filippo.io/edwards25519/field/fe.go index 5518ef2b902..4d52cc10d19 100644 --- a/vendor/filippo.io/edwards25519/field/fe.go +++ b/vendor/filippo.io/edwards25519/field/fe.go @@ -90,11 +90,7 @@ func (v *Element) Add(a, b *Element) *Element { v.l2 = a.l2 + b.l2 v.l3 = a.l3 + b.l3 v.l4 = a.l4 + b.l4 - // Using the generic implementation here is actually faster than the - // assembly. Probably because the body of this function is so simple that - // the compiler can figure out better optimizations by inlining the carry - // propagation. - return v.carryPropagateGeneric() + return v.carryPropagate() } // Subtract sets v = a - b, and returns v. @@ -232,18 +228,22 @@ func (v *Element) bytes(out *[32]byte) []byte { t := *v t.reduce() - var buf [8]byte - for i, l := range [5]uint64{t.l0, t.l1, t.l2, t.l3, t.l4} { - bitsOffset := i * 51 - binary.LittleEndian.PutUint64(buf[:], l<= len(out) { - break - } - out[off] |= bb - } - } + // Pack five 51-bit limbs into four 64-bit words: + // + // 255 204 153 102 51 0 + // ├──l4──┼──l3──┼──l2──┼──l1──┼──l0──┤ + // ├───u3───┼───u2───┼───u1───┼───u0───┤ + // 256 192 128 64 0 + + u0 := t.l1<<51 | t.l0 + u1 := t.l2<<(102-64) | t.l1>>(64-51) + u2 := t.l3<<(153-128) | t.l2>>(128-102) + u3 := t.l4<<(204-192) | t.l3>>(192-153) + + binary.LittleEndian.PutUint64(out[0*8:], u0) + binary.LittleEndian.PutUint64(out[1*8:], u1) + binary.LittleEndian.PutUint64(out[2*8:], u2) + binary.LittleEndian.PutUint64(out[3*8:], u3) return out[:] } diff --git a/vendor/filippo.io/edwards25519/field/fe_amd64.go b/vendor/filippo.io/edwards25519/field/fe_amd64.go index edcf163c4ed..00bf8f44792 100644 --- a/vendor/filippo.io/edwards25519/field/fe_amd64.go +++ b/vendor/filippo.io/edwards25519/field/fe_amd64.go @@ -1,7 +1,6 @@ // Code generated by command: go run fe_amd64_asm.go -out ../fe_amd64.s -stubs ../fe_amd64.go -pkg field. DO NOT EDIT. -//go:build amd64 && gc && !purego -// +build amd64,gc,!purego +//go:build !purego package field diff --git a/vendor/filippo.io/edwards25519/field/fe_amd64.s b/vendor/filippo.io/edwards25519/field/fe_amd64.s index 293f013c94a..5e06e242ed8 100644 --- a/vendor/filippo.io/edwards25519/field/fe_amd64.s +++ b/vendor/filippo.io/edwards25519/field/fe_amd64.s @@ -1,7 +1,6 @@ // Code generated by command: go run fe_amd64_asm.go -out ../fe_amd64.s -stubs ../fe_amd64.go -pkg field. DO NOT EDIT. -//go:build amd64 && gc && !purego -// +build amd64,gc,!purego +//go:build !purego #include "textflag.h" @@ -17,32 +16,36 @@ TEXT ·feMul(SB), NOSPLIT, $0-24 MOVQ DX, SI // r0 += 19×a1×b4 - MOVQ 8(CX), AX - IMUL3Q $0x13, AX, AX - MULQ 32(BX) - ADDQ AX, DI - ADCQ DX, SI + MOVQ 8(CX), DX + LEAQ (DX)(DX*8), AX + LEAQ (DX)(AX*2), AX + MULQ 32(BX) + ADDQ AX, DI + ADCQ DX, SI // r0 += 19×a2×b3 - MOVQ 16(CX), AX - IMUL3Q $0x13, AX, AX - MULQ 24(BX) - ADDQ AX, DI - ADCQ DX, SI + MOVQ 16(CX), DX + LEAQ (DX)(DX*8), AX + LEAQ (DX)(AX*2), AX + MULQ 24(BX) + ADDQ AX, DI + ADCQ DX, SI // r0 += 19×a3×b2 - MOVQ 24(CX), AX - IMUL3Q $0x13, AX, AX - MULQ 16(BX) - ADDQ AX, DI - ADCQ DX, SI + MOVQ 24(CX), DX + LEAQ (DX)(DX*8), AX + LEAQ (DX)(AX*2), AX + MULQ 16(BX) + ADDQ AX, DI + ADCQ DX, SI // r0 += 19×a4×b1 - MOVQ 32(CX), AX - IMUL3Q $0x13, AX, AX - MULQ 8(BX) - ADDQ AX, DI - ADCQ DX, SI + MOVQ 32(CX), DX + LEAQ (DX)(DX*8), AX + LEAQ (DX)(AX*2), AX + MULQ 8(BX) + ADDQ AX, DI + ADCQ DX, SI // r1 = a0×b1 MOVQ (CX), AX @@ -57,25 +60,28 @@ TEXT ·feMul(SB), NOSPLIT, $0-24 ADCQ DX, R8 // r1 += 19×a2×b4 - MOVQ 16(CX), AX - IMUL3Q $0x13, AX, AX - MULQ 32(BX) - ADDQ AX, R9 - ADCQ DX, R8 + MOVQ 16(CX), DX + LEAQ (DX)(DX*8), AX + LEAQ (DX)(AX*2), AX + MULQ 32(BX) + ADDQ AX, R9 + ADCQ DX, R8 // r1 += 19×a3×b3 - MOVQ 24(CX), AX - IMUL3Q $0x13, AX, AX - MULQ 24(BX) - ADDQ AX, R9 - ADCQ DX, R8 + MOVQ 24(CX), DX + LEAQ (DX)(DX*8), AX + LEAQ (DX)(AX*2), AX + MULQ 24(BX) + ADDQ AX, R9 + ADCQ DX, R8 // r1 += 19×a4×b2 - MOVQ 32(CX), AX - IMUL3Q $0x13, AX, AX - MULQ 16(BX) - ADDQ AX, R9 - ADCQ DX, R8 + MOVQ 32(CX), DX + LEAQ (DX)(DX*8), AX + LEAQ (DX)(AX*2), AX + MULQ 16(BX) + ADDQ AX, R9 + ADCQ DX, R8 // r2 = a0×b2 MOVQ (CX), AX @@ -96,18 +102,20 @@ TEXT ·feMul(SB), NOSPLIT, $0-24 ADCQ DX, R10 // r2 += 19×a3×b4 - MOVQ 24(CX), AX - IMUL3Q $0x13, AX, AX - MULQ 32(BX) - ADDQ AX, R11 - ADCQ DX, R10 + MOVQ 24(CX), DX + LEAQ (DX)(DX*8), AX + LEAQ (DX)(AX*2), AX + MULQ 32(BX) + ADDQ AX, R11 + ADCQ DX, R10 // r2 += 19×a4×b3 - MOVQ 32(CX), AX - IMUL3Q $0x13, AX, AX - MULQ 24(BX) - ADDQ AX, R11 - ADCQ DX, R10 + MOVQ 32(CX), DX + LEAQ (DX)(DX*8), AX + LEAQ (DX)(AX*2), AX + MULQ 24(BX) + ADDQ AX, R11 + ADCQ DX, R10 // r3 = a0×b3 MOVQ (CX), AX @@ -134,11 +142,12 @@ TEXT ·feMul(SB), NOSPLIT, $0-24 ADCQ DX, R12 // r3 += 19×a4×b4 - MOVQ 32(CX), AX - IMUL3Q $0x13, AX, AX - MULQ 32(BX) - ADDQ AX, R13 - ADCQ DX, R12 + MOVQ 32(CX), DX + LEAQ (DX)(DX*8), AX + LEAQ (DX)(AX*2), AX + MULQ 32(BX) + ADDQ AX, R13 + ADCQ DX, R12 // r4 = a0×b4 MOVQ (CX), AX @@ -232,18 +241,22 @@ TEXT ·feSquare(SB), NOSPLIT, $0-16 MOVQ DX, BX // r0 += 38×l1×l4 - MOVQ 8(CX), AX - IMUL3Q $0x26, AX, AX - MULQ 32(CX) - ADDQ AX, SI - ADCQ DX, BX + MOVQ 8(CX), DX + LEAQ (DX)(DX*8), AX + LEAQ (DX)(AX*2), AX + SHLQ $0x01, AX + MULQ 32(CX) + ADDQ AX, SI + ADCQ DX, BX // r0 += 38×l2×l3 - MOVQ 16(CX), AX - IMUL3Q $0x26, AX, AX - MULQ 24(CX) - ADDQ AX, SI - ADCQ DX, BX + MOVQ 16(CX), DX + LEAQ (DX)(DX*8), AX + LEAQ (DX)(AX*2), AX + SHLQ $0x01, AX + MULQ 24(CX) + ADDQ AX, SI + ADCQ DX, BX // r1 = 2×l0×l1 MOVQ (CX), AX @@ -253,18 +266,21 @@ TEXT ·feSquare(SB), NOSPLIT, $0-16 MOVQ DX, DI // r1 += 38×l2×l4 - MOVQ 16(CX), AX - IMUL3Q $0x26, AX, AX - MULQ 32(CX) - ADDQ AX, R8 - ADCQ DX, DI + MOVQ 16(CX), DX + LEAQ (DX)(DX*8), AX + LEAQ (DX)(AX*2), AX + SHLQ $0x01, AX + MULQ 32(CX) + ADDQ AX, R8 + ADCQ DX, DI // r1 += 19×l3×l3 - MOVQ 24(CX), AX - IMUL3Q $0x13, AX, AX - MULQ 24(CX) - ADDQ AX, R8 - ADCQ DX, DI + MOVQ 24(CX), DX + LEAQ (DX)(DX*8), AX + LEAQ (DX)(AX*2), AX + MULQ 24(CX) + ADDQ AX, R8 + ADCQ DX, DI // r2 = 2×l0×l2 MOVQ (CX), AX @@ -280,11 +296,13 @@ TEXT ·feSquare(SB), NOSPLIT, $0-16 ADCQ DX, R9 // r2 += 38×l3×l4 - MOVQ 24(CX), AX - IMUL3Q $0x26, AX, AX - MULQ 32(CX) - ADDQ AX, R10 - ADCQ DX, R9 + MOVQ 24(CX), DX + LEAQ (DX)(DX*8), AX + LEAQ (DX)(AX*2), AX + SHLQ $0x01, AX + MULQ 32(CX) + ADDQ AX, R10 + ADCQ DX, R9 // r3 = 2×l0×l3 MOVQ (CX), AX @@ -294,18 +312,19 @@ TEXT ·feSquare(SB), NOSPLIT, $0-16 MOVQ DX, R11 // r3 += 2×l1×l2 - MOVQ 8(CX), AX - IMUL3Q $0x02, AX, AX - MULQ 16(CX) - ADDQ AX, R12 - ADCQ DX, R11 + MOVQ 8(CX), AX + SHLQ $0x01, AX + MULQ 16(CX) + ADDQ AX, R12 + ADCQ DX, R11 // r3 += 19×l4×l4 - MOVQ 32(CX), AX - IMUL3Q $0x13, AX, AX - MULQ 32(CX) - ADDQ AX, R12 - ADCQ DX, R11 + MOVQ 32(CX), DX + LEAQ (DX)(DX*8), AX + LEAQ (DX)(AX*2), AX + MULQ 32(CX) + ADDQ AX, R12 + ADCQ DX, R11 // r4 = 2×l0×l4 MOVQ (CX), AX @@ -315,11 +334,11 @@ TEXT ·feSquare(SB), NOSPLIT, $0-16 MOVQ DX, R13 // r4 += 2×l1×l3 - MOVQ 8(CX), AX - IMUL3Q $0x02, AX, AX - MULQ 24(CX) - ADDQ AX, R14 - ADCQ DX, R13 + MOVQ 8(CX), AX + SHLQ $0x01, AX + MULQ 24(CX) + ADDQ AX, R14 + ADCQ DX, R13 // r4 += l2×l2 MOVQ 16(CX), AX diff --git a/vendor/filippo.io/edwards25519/field/fe_amd64_noasm.go b/vendor/filippo.io/edwards25519/field/fe_amd64_noasm.go index ddb6c9b8f7f..4b81f25d1d0 100644 --- a/vendor/filippo.io/edwards25519/field/fe_amd64_noasm.go +++ b/vendor/filippo.io/edwards25519/field/fe_amd64_noasm.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !amd64 || !gc || purego -// +build !amd64 !gc purego +//go:build !amd64 || purego package field diff --git a/vendor/filippo.io/edwards25519/field/fe_arm64.go b/vendor/filippo.io/edwards25519/field/fe_arm64.go deleted file mode 100644 index af459ef5154..00000000000 --- a/vendor/filippo.io/edwards25519/field/fe_arm64.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build arm64 && gc && !purego -// +build arm64,gc,!purego - -package field - -//go:noescape -func carryPropagate(v *Element) - -func (v *Element) carryPropagate() *Element { - carryPropagate(v) - return v -} diff --git a/vendor/filippo.io/edwards25519/field/fe_arm64.s b/vendor/filippo.io/edwards25519/field/fe_arm64.s deleted file mode 100644 index 3126a434191..00000000000 --- a/vendor/filippo.io/edwards25519/field/fe_arm64.s +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build arm64 && gc && !purego - -#include "textflag.h" - -// carryPropagate works exactly like carryPropagateGeneric and uses the -// same AND, ADD, and LSR+MADD instructions emitted by the compiler, but -// avoids loading R0-R4 twice and uses LDP and STP. -// -// See https://golang.org/issues/43145 for the main compiler issue. -// -// func carryPropagate(v *Element) -TEXT ·carryPropagate(SB),NOFRAME|NOSPLIT,$0-8 - MOVD v+0(FP), R20 - - LDP 0(R20), (R0, R1) - LDP 16(R20), (R2, R3) - MOVD 32(R20), R4 - - AND $0x7ffffffffffff, R0, R10 - AND $0x7ffffffffffff, R1, R11 - AND $0x7ffffffffffff, R2, R12 - AND $0x7ffffffffffff, R3, R13 - AND $0x7ffffffffffff, R4, R14 - - ADD R0>>51, R11, R11 - ADD R1>>51, R12, R12 - ADD R2>>51, R13, R13 - ADD R3>>51, R14, R14 - // R4>>51 * 19 + R10 -> R10 - LSR $51, R4, R21 - MOVD $19, R22 - MADD R22, R10, R21, R10 - - STP (R10, R11), 0(R20) - STP (R12, R13), 16(R20) - MOVD R14, 32(R20) - - RET diff --git a/vendor/filippo.io/edwards25519/field/fe_arm64_noasm.go b/vendor/filippo.io/edwards25519/field/fe_arm64_noasm.go deleted file mode 100644 index 234a5b2e5d1..00000000000 --- a/vendor/filippo.io/edwards25519/field/fe_arm64_noasm.go +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !arm64 || !gc || purego -// +build !arm64 !gc purego - -package field - -func (v *Element) carryPropagate() *Element { - return v.carryPropagateGeneric() -} diff --git a/vendor/filippo.io/edwards25519/field/fe_generic.go b/vendor/filippo.io/edwards25519/field/fe_generic.go index 86f5fd95534..ef1f15a5dc0 100644 --- a/vendor/filippo.io/edwards25519/field/fe_generic.go +++ b/vendor/filippo.io/edwards25519/field/fe_generic.go @@ -12,20 +12,42 @@ type uint128 struct { lo, hi uint64 } -// mul64 returns a * b. -func mul64(a, b uint64) uint128 { +// mul returns a * b. +func mul(a, b uint64) uint128 { hi, lo := bits.Mul64(a, b) return uint128{lo, hi} } -// addMul64 returns v + a * b. -func addMul64(v uint128, a, b uint64) uint128 { +// addMul returns v + a * b. +func addMul(v uint128, a, b uint64) uint128 { hi, lo := bits.Mul64(a, b) lo, c := bits.Add64(lo, v.lo, 0) hi, _ = bits.Add64(hi, v.hi, c) return uint128{lo, hi} } +// mul19 returns v * 19. +func mul19(v uint64) uint64 { + // Using this approach seems to yield better optimizations than *19. + return v + (v+v<<3)<<1 +} + +// addMul19 returns v + 19 * a * b, where a and b are at most 52 bits. +func addMul19(v uint128, a, b uint64) uint128 { + hi, lo := bits.Mul64(mul19(a), b) + lo, c := bits.Add64(lo, v.lo, 0) + hi, _ = bits.Add64(hi, v.hi, c) + return uint128{lo, hi} +} + +// addMul38 returns v + 38 * a * b, where a and b are at most 52 bits. +func addMul38(v uint128, a, b uint64) uint128 { + hi, lo := bits.Mul64(mul19(a), b*2) + lo, c := bits.Add64(lo, v.lo, 0) + hi, _ = bits.Add64(hi, v.hi, c) + return uint128{lo, hi} +} + // shiftRightBy51 returns a >> 51. a is assumed to be at most 115 bits. func shiftRightBy51(a uint128) uint64 { return (a.hi << (64 - 51)) | (a.lo >> 51) @@ -76,45 +98,40 @@ func feMulGeneric(v, a, b *Element) { // // Finally we add up the columns into wide, overlapping limbs. - a1_19 := a1 * 19 - a2_19 := a2 * 19 - a3_19 := a3 * 19 - a4_19 := a4 * 19 - // r0 = a0×b0 + 19×(a1×b4 + a2×b3 + a3×b2 + a4×b1) - r0 := mul64(a0, b0) - r0 = addMul64(r0, a1_19, b4) - r0 = addMul64(r0, a2_19, b3) - r0 = addMul64(r0, a3_19, b2) - r0 = addMul64(r0, a4_19, b1) + r0 := mul(a0, b0) + r0 = addMul19(r0, a1, b4) + r0 = addMul19(r0, a2, b3) + r0 = addMul19(r0, a3, b2) + r0 = addMul19(r0, a4, b1) // r1 = a0×b1 + a1×b0 + 19×(a2×b4 + a3×b3 + a4×b2) - r1 := mul64(a0, b1) - r1 = addMul64(r1, a1, b0) - r1 = addMul64(r1, a2_19, b4) - r1 = addMul64(r1, a3_19, b3) - r1 = addMul64(r1, a4_19, b2) + r1 := mul(a0, b1) + r1 = addMul(r1, a1, b0) + r1 = addMul19(r1, a2, b4) + r1 = addMul19(r1, a3, b3) + r1 = addMul19(r1, a4, b2) // r2 = a0×b2 + a1×b1 + a2×b0 + 19×(a3×b4 + a4×b3) - r2 := mul64(a0, b2) - r2 = addMul64(r2, a1, b1) - r2 = addMul64(r2, a2, b0) - r2 = addMul64(r2, a3_19, b4) - r2 = addMul64(r2, a4_19, b3) + r2 := mul(a0, b2) + r2 = addMul(r2, a1, b1) + r2 = addMul(r2, a2, b0) + r2 = addMul19(r2, a3, b4) + r2 = addMul19(r2, a4, b3) // r3 = a0×b3 + a1×b2 + a2×b1 + a3×b0 + 19×a4×b4 - r3 := mul64(a0, b3) - r3 = addMul64(r3, a1, b2) - r3 = addMul64(r3, a2, b1) - r3 = addMul64(r3, a3, b0) - r3 = addMul64(r3, a4_19, b4) + r3 := mul(a0, b3) + r3 = addMul(r3, a1, b2) + r3 = addMul(r3, a2, b1) + r3 = addMul(r3, a3, b0) + r3 = addMul19(r3, a4, b4) // r4 = a0×b4 + a1×b3 + a2×b2 + a3×b1 + a4×b0 - r4 := mul64(a0, b4) - r4 = addMul64(r4, a1, b3) - r4 = addMul64(r4, a2, b2) - r4 = addMul64(r4, a3, b1) - r4 = addMul64(r4, a4, b0) + r4 := mul(a0, b4) + r4 = addMul(r4, a1, b3) + r4 = addMul(r4, a2, b2) + r4 = addMul(r4, a3, b1) + r4 = addMul(r4, a4, b0) // After the multiplication, we need to reduce (carry) the five coefficients // to obtain a result with limbs that are at most slightly larger than 2⁵¹, @@ -149,7 +166,7 @@ func feMulGeneric(v, a, b *Element) { c3 := shiftRightBy51(r3) c4 := shiftRightBy51(r4) - rr0 := r0.lo&maskLow51Bits + c4*19 + rr0 := r0.lo&maskLow51Bits + mul19(c4) rr1 := r1.lo&maskLow51Bits + c0 rr2 := r2.lo&maskLow51Bits + c1 rr3 := r3.lo&maskLow51Bits + c2 @@ -158,8 +175,12 @@ func feMulGeneric(v, a, b *Element) { // Now all coefficients fit into 64-bit registers but are still too large to // be passed around as an Element. We therefore do one last carry chain, // where the carries will be small enough to fit in the wiggle room above 2⁵¹. - *v = Element{rr0, rr1, rr2, rr3, rr4} - v.carryPropagate() + + v.l0 = rr0&maskLow51Bits + mul19(rr4>>51) + v.l1 = rr1&maskLow51Bits + rr0>>51 + v.l2 = rr2&maskLow51Bits + rr1>>51 + v.l3 = rr3&maskLow51Bits + rr2>>51 + v.l4 = rr4&maskLow51Bits + rr3>>51 } func feSquareGeneric(v, a *Element) { @@ -190,44 +211,31 @@ func feSquareGeneric(v, a *Element) { // l0l4 19×l4l4 19×l3l4 19×l2l4 19×l1l4 = // -------------------------------------- // r4 r3 r2 r1 r0 - // - // With precomputed 2×, 19×, and 2×19× terms, we can compute each limb with - // only three Mul64 and four Add64, instead of five and eight. - - l0_2 := l0 * 2 - l1_2 := l1 * 2 - - l1_38 := l1 * 38 - l2_38 := l2 * 38 - l3_38 := l3 * 38 - - l3_19 := l3 * 19 - l4_19 := l4 * 19 // r0 = l0×l0 + 19×(l1×l4 + l2×l3 + l3×l2 + l4×l1) = l0×l0 + 19×2×(l1×l4 + l2×l3) - r0 := mul64(l0, l0) - r0 = addMul64(r0, l1_38, l4) - r0 = addMul64(r0, l2_38, l3) + r0 := mul(l0, l0) + r0 = addMul38(r0, l1, l4) + r0 = addMul38(r0, l2, l3) // r1 = l0×l1 + l1×l0 + 19×(l2×l4 + l3×l3 + l4×l2) = 2×l0×l1 + 19×2×l2×l4 + 19×l3×l3 - r1 := mul64(l0_2, l1) - r1 = addMul64(r1, l2_38, l4) - r1 = addMul64(r1, l3_19, l3) + r1 := mul(l0*2, l1) + r1 = addMul38(r1, l2, l4) + r1 = addMul19(r1, l3, l3) // r2 = l0×l2 + l1×l1 + l2×l0 + 19×(l3×l4 + l4×l3) = 2×l0×l2 + l1×l1 + 19×2×l3×l4 - r2 := mul64(l0_2, l2) - r2 = addMul64(r2, l1, l1) - r2 = addMul64(r2, l3_38, l4) + r2 := mul(l0*2, l2) + r2 = addMul(r2, l1, l1) + r2 = addMul38(r2, l3, l4) // r3 = l0×l3 + l1×l2 + l2×l1 + l3×l0 + 19×l4×l4 = 2×l0×l3 + 2×l1×l2 + 19×l4×l4 - r3 := mul64(l0_2, l3) - r3 = addMul64(r3, l1_2, l2) - r3 = addMul64(r3, l4_19, l4) + r3 := mul(l0*2, l3) + r3 = addMul(r3, l1*2, l2) + r3 = addMul19(r3, l4, l4) // r4 = l0×l4 + l1×l3 + l2×l2 + l3×l1 + l4×l0 = 2×l0×l4 + 2×l1×l3 + l2×l2 - r4 := mul64(l0_2, l4) - r4 = addMul64(r4, l1_2, l3) - r4 = addMul64(r4, l2, l2) + r4 := mul(l0*2, l4) + r4 = addMul(r4, l1*2, l3) + r4 = addMul(r4, l2, l2) c0 := shiftRightBy51(r0) c1 := shiftRightBy51(r1) @@ -235,32 +243,30 @@ func feSquareGeneric(v, a *Element) { c3 := shiftRightBy51(r3) c4 := shiftRightBy51(r4) - rr0 := r0.lo&maskLow51Bits + c4*19 + rr0 := r0.lo&maskLow51Bits + mul19(c4) rr1 := r1.lo&maskLow51Bits + c0 rr2 := r2.lo&maskLow51Bits + c1 rr3 := r3.lo&maskLow51Bits + c2 rr4 := r4.lo&maskLow51Bits + c3 - *v = Element{rr0, rr1, rr2, rr3, rr4} - v.carryPropagate() + v.l0 = rr0&maskLow51Bits + mul19(rr4>>51) + v.l1 = rr1&maskLow51Bits + rr0>>51 + v.l2 = rr2&maskLow51Bits + rr1>>51 + v.l3 = rr3&maskLow51Bits + rr2>>51 + v.l4 = rr4&maskLow51Bits + rr3>>51 } -// carryPropagateGeneric brings the limbs below 52 bits by applying the reduction +// carryPropagate brings the limbs below 52 bits by applying the reduction // identity (a * 2²⁵⁵ + b = a * 19 + b) to the l4 carry. -func (v *Element) carryPropagateGeneric() *Element { - c0 := v.l0 >> 51 - c1 := v.l1 >> 51 - c2 := v.l2 >> 51 - c3 := v.l3 >> 51 - c4 := v.l4 >> 51 - - // c4 is at most 64 - 51 = 13 bits, so c4*19 is at most 18 bits, and +func (v *Element) carryPropagate() *Element { + // (l4>>51) is at most 64 - 51 = 13 bits, so (l4>>51)*19 is at most 18 bits, and // the final l0 will be at most 52 bits. Similarly for the rest. - v.l0 = v.l0&maskLow51Bits + c4*19 - v.l1 = v.l1&maskLow51Bits + c0 - v.l2 = v.l2&maskLow51Bits + c1 - v.l3 = v.l3&maskLow51Bits + c2 - v.l4 = v.l4&maskLow51Bits + c3 + l0 := v.l0 + v.l0 = v.l0&maskLow51Bits + mul19(v.l4>>51) + v.l4 = v.l4&maskLow51Bits + v.l3>>51 + v.l3 = v.l3&maskLow51Bits + v.l2>>51 + v.l2 = v.l2&maskLow51Bits + v.l1>>51 + v.l1 = v.l1&maskLow51Bits + l0>>51 return v } diff --git a/vendor/filippo.io/edwards25519/pull.sh b/vendor/filippo.io/edwards25519/pull.sh new file mode 100644 index 00000000000..f6217c96e2e --- /dev/null +++ b/vendor/filippo.io/edwards25519/pull.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +TAG="$1" +TMPDIR="$(mktemp -d)" + +cleanup() { + rm -rf "$TMPDIR" +} +trap cleanup EXIT + +command -v git >/dev/null +command -v git-filter-repo >/dev/null + +if [ -d "$HOME/go/.git" ]; then + REFERENCE=(--reference "$HOME/go" --dissociate) +else + REFERENCE=() +fi + +git -c advice.detachedHead=false clone --no-checkout "${REFERENCE[@]}" \ + -b "$TAG" https://go.googlesource.com/go.git "$TMPDIR" + +# Simplify the history graph by removing the dev.boringcrypto branches, whose +# merges end up empty after grafting anyway. This also fixes a weird quirk +# (maybe a git-filter-repo bug?) where only one file from an old path, +# src/crypto/ed25519/internal/edwards25519/const.go, would still exist in the +# filtered repo. +git -C "$TMPDIR" replace --graft f771edd7f9 99f1bf54eb +git -C "$TMPDIR" replace --graft 109c13b64f c2f96e686f +git -C "$TMPDIR" replace --graft aa4da4f189 912f075047 + +git -C "$TMPDIR" filter-repo --force \ + --paths-from-file /dev/stdin \ + --prune-empty always \ + --prune-degenerate always \ + --tag-callback 'tag.skip()' <<'EOF' +src/crypto/internal/fips140/edwards25519 +src/crypto/internal/edwards25519 +src/crypto/ed25519/internal/edwards25519 +EOF + +git fetch "$TMPDIR" +git update-ref "refs/heads/upstream/$TAG" FETCH_HEAD + +echo +echo "Fetched upstream history up to $TAG. Merge with:" +echo -e "\tgit merge --no-ff --no-commit --allow-unrelated-histories upstream/$TAG" diff --git a/vendor/filippo.io/edwards25519/scalar.go b/vendor/filippo.io/edwards25519/scalar.go index 3fd1653877d..f08b26245c2 100644 --- a/vendor/filippo.io/edwards25519/scalar.go +++ b/vendor/filippo.io/edwards25519/scalar.go @@ -7,6 +7,7 @@ package edwards25519 import ( "encoding/binary" "errors" + "math/bits" ) // A Scalar is an integer modulo @@ -179,15 +180,23 @@ func isReduced(s []byte) bool { return false } - for i := len(s) - 1; i >= 0; i-- { - switch { - case s[i] > scalarMinusOneBytes[i]: - return false - case s[i] < scalarMinusOneBytes[i]: - return true - } - } - return true + s0 := binary.LittleEndian.Uint64(s[:8]) + s1 := binary.LittleEndian.Uint64(s[8:16]) + s2 := binary.LittleEndian.Uint64(s[16:24]) + s3 := binary.LittleEndian.Uint64(s[24:]) + + l0 := binary.LittleEndian.Uint64(scalarMinusOneBytes[:8]) + l1 := binary.LittleEndian.Uint64(scalarMinusOneBytes[8:16]) + l2 := binary.LittleEndian.Uint64(scalarMinusOneBytes[16:24]) + l3 := binary.LittleEndian.Uint64(scalarMinusOneBytes[24:]) + + // Do a constant time subtraction chain scalarMinusOneBytes - s. If there is + // a borrow at the end, then s > scalarMinusOneBytes. + _, b := bits.Sub64(l0, s0, 0) + _, b = bits.Sub64(l1, s1, b) + _, b = bits.Sub64(l2, s2, b) + _, b = bits.Sub64(l3, s3, b) + return b == 0 } // SetBytesWithClamping applies the buffer pruning described in RFC 8032, diff --git a/vendor/filippo.io/edwards25519/tables.go b/vendor/filippo.io/edwards25519/tables.go index 83234bbc0fa..4a2b54ebadf 100644 --- a/vendor/filippo.io/edwards25519/tables.go +++ b/vendor/filippo.io/edwards25519/tables.go @@ -4,9 +4,7 @@ package edwards25519 -import ( - "crypto/subtle" -) +import "crypto/subtle" // A dynamic lookup table for variable-base, constant-time scalar muls. type projLookupTable struct { diff --git a/vendor/github.com/Azure/azure-kusto-go/LICENSE b/vendor/github.com/Azure/azure-kusto-go/azkustodata/LICENSE similarity index 100% rename from vendor/github.com/Azure/azure-kusto-go/LICENSE rename to vendor/github.com/Azure/azure-kusto-go/azkustodata/LICENSE diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/client_details.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/client_details.go similarity index 96% rename from vendor/github.com/Azure/azure-kusto-go/kusto/client_details.go rename to vendor/github.com/Azure/azure-kusto-go/azkustodata/client_details.go index b25b3eeb896..1385ce09f00 100644 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/client_details.go +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/client_details.go @@ -1,9 +1,9 @@ -package kusto +package azkustodata import ( "fmt" - "github.com/Azure/azure-kusto-go/kusto/internal/version" - "github.com/Azure/azure-kusto-go/kusto/utils" + "github.com/Azure/azure-kusto-go/azkustodata/internal/version" + "github.com/Azure/azure-kusto-go/azkustodata/utils" "os" "os/user" "path/filepath" diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/cloudinfo.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/cloudinfo.go similarity index 93% rename from vendor/github.com/Azure/azure-kusto-go/kusto/cloudinfo.go rename to vendor/github.com/Azure/azure-kusto-go/azkustodata/cloudinfo.go index 6e1a9ecf113..b58b3b3b54a 100644 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/cloudinfo.go +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/cloudinfo.go @@ -1,15 +1,14 @@ -package kusto +package azkustodata import ( "encoding/json" "fmt" - kustoErrors "github.com/Azure/azure-kusto-go/kusto/data/errors" - "github.com/Azure/azure-kusto-go/kusto/utils" + kustoErrors "github.com/Azure/azure-kusto-go/azkustodata/errors" + "github.com/Azure/azure-kusto-go/azkustodata/utils" "io" "net/http" "net/url" "os" - "strings" "sync" ) @@ -65,10 +64,11 @@ func GetMetadata(kustoUri string, httpClient *http.Client) (CloudInfo, error) { if err != nil { return CloudInfo{}, err } - if !strings.HasPrefix(u.Path, "/") { - u.Path = "/" + u.Path - } - u = u.JoinPath(metadataPath) + + // Auth metadata is always at the root of the cluster + u.Path = metadataPath + u.RawQuery = "" + // TODO should we make this timeout configurable. req, err := http.NewRequest("GET", u.String(), nil) diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/conn.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/conn.go similarity index 74% rename from vendor/github.com/Azure/azure-kusto-go/kusto/conn.go rename to vendor/github.com/Azure/azure-kusto-go/azkustodata/conn.go index 3b9d2439eb0..b9904b5a0fe 100644 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/conn.go +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/conn.go @@ -1,4 +1,4 @@ -package kusto +package azkustodata // Conn.go holds the connection to the Kusto server and provides methods to do queries // and receive Kusto frames back. @@ -16,12 +16,9 @@ import ( "sync/atomic" "unicode" - "github.com/Azure/azure-kusto-go/kusto/data/errors" - "github.com/Azure/azure-kusto-go/kusto/internal/frames" - v1 "github.com/Azure/azure-kusto-go/kusto/internal/frames/v1" - v2 "github.com/Azure/azure-kusto-go/kusto/internal/frames/v2" - "github.com/Azure/azure-kusto-go/kusto/internal/response" - truestedEndpoints "github.com/Azure/azure-kusto-go/kusto/trustedendpoints" + "github.com/Azure/azure-kusto-go/azkustodata/errors" + "github.com/Azure/azure-kusto-go/azkustodata/internal/response" + truestedEndpoints "github.com/Azure/azure-kusto-go/azkustodata/trusted_endpoints" "github.com/google/uuid" ) @@ -31,6 +28,8 @@ var bufferPool = sync.Pool{ }, } +// TODO - inspect this. Do we need this? can this be simplified? + // Conn provides connectivity to a Kusto instance. type Conn struct { endpoint string @@ -83,30 +82,13 @@ type connOptions struct { queryOptions *queryOptions } -// query makes a query for the purpose of extracting data from Kusto. Context can be used to set -// a timeout or cancel the query. Queries cannot take longer than 5 minutes. -func (c *Conn) query(ctx context.Context, db string, query Statement, options *queryOptions) (execResp, error) { - if strings.HasPrefix(strings.TrimSpace(query.String()), ".") { - return execResp{}, errors.ES(errors.OpQuery, errors.KClientArgs, "a Stmt to Query() cannot begin with a period(.), only Mgmt() calls can do that").SetNoRetry() - } - - return c.execute(ctx, execQuery, db, query, *options.requestProperties) -} - -// mgmt is used to do management queries to Kusto. -func (c *Conn) mgmt(ctx context.Context, db string, query Statement, options *queryOptions) (execResp, error) { - return c.execute(ctx, execMgmt, db, query, *options.requestProperties) -} - -func (c *Conn) queryToJson(ctx context.Context, db string, query Statement, options *queryOptions) (string, error) { - _, _, _, body, e := c.doRequest(ctx, execQuery, db, query, *options.requestProperties) +func (c *Conn) rawQuery(ctx context.Context, callType callType, db string, query Statement, options *queryOptions) (io.ReadCloser, error) { + _, _, _, body, e := c.doRequest(ctx, int(callType), db, query, *options.requestProperties) if e != nil { - return "", e + return nil, e } - defer body.Close() - all, e := io.ReadAll(body) - return string(all), e + return body, nil } const ( @@ -114,33 +96,6 @@ const ( execMgmt = 2 ) -type execResp struct { - reqHeader http.Header - respHeader http.Header - frameCh chan frames.Frame -} - -func (c *Conn) execute(ctx context.Context, execType int, db string, query Statement, properties requestProperties) (execResp, error) { - op, reqHeader, respHeader, body, e := c.doRequest(ctx, execType, db, query, properties) - if e != nil { - return execResp{}, e - } - - var dec frames.Decoder - switch execType { - case execMgmt: - dec = &v1.Decoder{} - case execQuery: - dec = &v2.Decoder{} - default: - return execResp{}, errors.ES(op, errors.KInternal, "unknown execution type was %v", execType).SetNoRetry() - } - - frameCh := dec.Decode(ctx, body, op) - - return execResp{reqHeader: reqHeader, respHeader: respHeader, frameCh: frameCh}, nil -} - func (c *Conn) doRequest(ctx context.Context, execType int, db string, query Statement, properties requestProperties) (errors.Op, http.Header, http.Header, io.ReadCloser, error) { var op errors.Op @@ -278,7 +233,7 @@ func (c *Conn) getHeaders(properties requestProperties) http.Header { header.Add("Accept-Encoding", "gzip, deflate") header.Add("Content-Type", "application/json; charset=utf-8") header.Add("Connection", "Keep-Alive") - header.Add("x-ms-version", "2019-02-13") + header.Add("x-ms-version", "2024-12-12") if properties.ClientRequestID != "" { header.Add(ClientRequestIdHeader, properties.ClientRequestID) diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/conn_streaming_ingest.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/conn_streaming_ingest.go similarity index 96% rename from vendor/github.com/Azure/azure-kusto-go/kusto/conn_streaming_ingest.go rename to vendor/github.com/Azure/azure-kusto-go/azkustodata/conn_streaming_ingest.go index 9be2f3bedf0..ce0f71b8584 100644 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/conn_streaming_ingest.go +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/conn_streaming_ingest.go @@ -1,14 +1,13 @@ -package kusto +package azkustodata import ( "context" "fmt" + "github.com/Azure/azure-kusto-go/azkustodata/errors" + "github.com/google/uuid" "io" "net/url" "time" - - "github.com/Azure/azure-kusto-go/kusto/data/errors" - "github.com/google/uuid" ) type DataFormatForStreaming interface { diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/doc.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/doc.go new file mode 100644 index 00000000000..31ce3eb7610 --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/doc.go @@ -0,0 +1,71 @@ +/* +Package azkustodata provides a client for querying and managing data in Azure Data Explorer (Kusto) clusters. + +The package supports running both Kusto Query Language (KQL) queries and management commands, with built-in support for +streaming responses and mapping results to Go structs. + +To start using this package, create an instance of the Client, passing in a connection string built using the +NewConnectionStringBuilder() function. The Client can be authenticated using various methods from the Azure Identity package. + +Example For Querying the Kusto cluster: + + kcsb := azkustodata.NewConnectionStringBuilder("https://help.kusto.windows.net/").WithDefaultAzureCredential() + client, err := azkustodata.New(kcsb) + + if err != nil { + panic(err) + } + + defer client.Close() // Always close the client when done. + + ctx := context.Background() + dataset, err := client.IterativeQuery(ctx, "Samples", kql.New("PopulationData")) + + // Don't forget to close the dataset when you're done. + defer dataset.Close() + + primaryResult := <-dataset.Tables() // The first table in the dataset will be the primary results. + + // Make sure to check for errors. + if primaryResult.Err() != nil { + panic("add error handling") + } + + for rowResult := range primaryResult.Table().Rows() { + if rowResult.Err() != nil { + panic("add error handling") + } + row := rowResult.Row() + + fmt.Println(row) // As a convenience, printing a *table.Row will output csv + // or Access the columns directly + fmt.Println(row.IntByName("EventId")) + fmt.Println(row.StringByIndex(1)) + } + +Example for Management/Administration commands: + + kcsb := azkustodata.NewConnectionStringBuilder("https://help.kusto.windows.net/").WithDefaultAzureCredential() + client, err := azkustodata.New(kcsb) + + if err != nil { + panic(err) + } + + defer client.Close() // Always close the client when done. + + ctx := context.Background() + dataset, err := client.Mgmt(ctx, "Samples", kql.New(".show tables")) + + table := dataset.Tables()[0] + + // convert the table to a struct + structs, err := query.ToStructs[myStruct](table) + +To handle results, the package provides utilities to directly stream rows, fetch tables into memory, and map results to structs. + +For complete documentation, please visit: +https://github.com/Azure/azure-kusto-go +https://pkg.go.dev/github.com/Azure/azure-kusto-go/azkustodata +*/ +package azkustodata diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/data/errors/errors.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/errors/errors.go similarity index 75% rename from vendor/github.com/Azure/azure-kusto-go/kusto/data/errors/errors.go rename to vendor/github.com/Azure/azure-kusto-go/azkustodata/errors/errors.go index 6b25f78d750..602b684f8a1 100644 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/data/errors/errors.go +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/errors/errors.go @@ -40,6 +40,7 @@ const ( OpFileIngest Op = 5 // OpFileIngest indicates the client is making a file ingestion call. OpCloudInfo Op = 6 // OpCloudInfo indicates an error fetching data from the cloud metadata. OpTokenProvider Op = 7 // OpTokenProvider indicates an error creating a token provider. + OpTableAccess Op = 8 // OpTableAccess indicates an error accessing a table. ) // Kind field classifies the error as one of a set of standard conditions. @@ -47,16 +48,19 @@ type Kind uint16 //go:generate stringer -type Kind const ( - KOther Kind = 0 // Other indicates the error kind was not defined. - KIO Kind = 1 // External I/O error such as network failure. - KInternal Kind = 2 // Internal error or inconsistency at the server. - KDBNotExist Kind = 3 // Database does not exist. - KTimeout Kind = 4 // The request timed out. - KLimitsExceeded Kind = 5 // The request was too large. - KClientArgs Kind = 6 // The client supplied some type of arg(s) that were invalid. - KHTTPError Kind = 7 // The HTTP client gave some type of error. This wraps the http library error types. - KBlobstore Kind = 8 // The Blobstore API returned some type of error. - KLocalFileSystem Kind = 9 // The local fileystem had an error. This could be permission, missing file, etc.... + KOther Kind = 0 // Other indicates the error kind was not defined. + KIO Kind = 1 // External I/O error such as network failure. + KInternal Kind = 2 // Internal error or inconsistency at the server. + KDBNotExist Kind = 3 // Database does not exist. + KTimeout Kind = 4 // The request timed out. + KLimitsExceeded Kind = 5 // The request was too large. + KClientArgs Kind = 6 // The client supplied some type of arg(s) that were invalid. + KHTTPError Kind = 7 // The HTTP client gave some type of error. This wraps the http library error types. + KBlobstore Kind = 8 // The Blobstore API returned some type of error. + KLocalFileSystem Kind = 9 // The local fileystem had an error. This could be permission, missing file, etc...., + KWrongTableKind Kind = 10 // The kind of the table requested did not match the kind of the table. + KWrongColumnType Kind = 11 // The type of the column requested did not match the type of the column. + KFailedToParse Kind = 12 // The client failed to parse the value. ) // Error is a core error for the Kusto package. @@ -223,7 +227,12 @@ func ES(o Op, k Kind, s string, args ...interface{}) *Error { // HTTP constructs an *Error from an *http.Response and a prefix to the error message. func HTTP(o Op, status string, statusCode int, body io.ReadCloser, prefix string) *HttpError { - defer body.Close() + defer func(body io.ReadCloser) { + err := body.Close() + if err != nil { + // TODO: Handle this when we have a logger. + } + }(body) bodyBytes, err := io.ReadAll(body) if err != nil { bodyBytes = []byte(fmt.Sprintf("Failed to read body: %v", err)) @@ -295,86 +304,6 @@ func W(inner error, outer error) *Error { return o } -// OneToErr translates what we think is a Kusto OneApiError into an Error. If we don't recognize it, we return nil. -// This tries to wrap the internal errors, but the errors that are generated are some type of early draft of OneApiError, -// not the current spec. Because the errors we see don't conform to the current OneAPIError spec, had to take guesses on -// what we will receive. The spec says we shouldn't get a list of errors, but we do(we should get an embedded error). -// So I'm taking the guess that these are supposed to be wrapped errors. -func OneToErr(m map[string]interface{}, op Op) *Error { - if m == nil { - return nil - } - - if _, ok := m["OneApiErrors"]; ok { - var topErr *Error - if oneErrors, ok := m["OneApiErrors"].([]interface{}); ok { - var bottomErr *Error - for _, oneErr := range oneErrors { - if errMap, ok := oneErr.(map[string]interface{}); ok { - e := oneToErr(errMap, bottomErr, op) - if e == nil { - continue - } - if topErr == nil { - topErr = e - bottomErr = e - continue - } - bottomErr = e - } - } - return topErr - } - } - return nil -} - -func oneToErr(m map[string]interface{}, err *Error, op Op) *Error { - errJSON, ok := m["error"] - if !ok { - return nil - } - errMap, ok := errJSON.(map[string]interface{}) - if !ok { - return nil - } - - var msg string - msgInter, ok := errMap["message"] - if !ok { - return nil - } - - if msg, ok = msgInter.(string); !ok { - return nil - } - - var code string - - codeInter, ok := errMap["code"] - if ok { - codeStr, ok := codeInter.(string) - if ok { - code = codeStr - } - } - - var kind Kind - switch code { - case "LimitsExceeded": - kind = KLimitsExceeded - msg = msg + ";See https://docs.microsoft.com/en-us/azure/kusto/concepts/querylimits" - } - - if err == nil { - return ES(op, kind, msg) - } - - err = W(ES(op, kind, msg), err) - - return err -} - func (e *HttpError) IsThrottled() bool { return e != nil && (e.StatusCode == http.StatusTooManyRequests) } @@ -404,7 +333,7 @@ type CombinedError struct { Errors []error } -func (c CombinedError) Error() string { +func (c *CombinedError) Error() string { result := "" for _, err := range c.Errors { result += fmt.Sprintf("'%s';", err.Error()) @@ -412,6 +341,57 @@ func (c CombinedError) Error() string { return result } -func GetCombinedError(errs ...error) *CombinedError { - return &CombinedError{Errors: errs} +func NewCombinedError() *CombinedError { + return &CombinedError{ + Errors: []error{}, + } +} + +func (c *CombinedError) AddError(e error) bool { + if e == nil { + return false + } + + var c2 *CombinedError + if errors.As(e, &c2) { + anyAdded := false + for _, err := range c2.Errors { + if c.AddError(err) { + anyAdded = true + } + } + return anyAdded + } + + for _, err := range c.Errors { + if err.Error() == e.Error() { + return false + } + } + c.Errors = append(c.Errors, e) + return true +} + +// Returning []error (rather than a single error) allows errors.Is and errors.As +// to traverse all contained errors when checking for matches. +func (c *CombinedError) Unwrap() []error { + return c.Errors +} + +func (c *CombinedError) GetError() error { + if len(c.Errors) == 0 { + return nil + } + if len(c.Errors) == 1 { + return c.Errors[0] + } + return c +} + +func CombineErrors(errs ...error) error { + combined := NewCombinedError() + for _, err := range errs { + combined.AddError(err) + } + return combined.GetError() } diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/data/errors/kind_string.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/errors/kind_string.go similarity index 100% rename from vendor/github.com/Azure/azure-kusto-go/kusto/data/errors/kind_string.go rename to vendor/github.com/Azure/azure-kusto-go/azkustodata/errors/kind_string.go diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/data/errors/op_string.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/errors/op_string.go similarity index 100% rename from vendor/github.com/Azure/azure-kusto-go/kusto/data/errors/op_string.go rename to vendor/github.com/Azure/azure-kusto-go/azkustodata/errors/op_string.go diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/internal/response/response.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/internal/response/response.go similarity index 95% rename from vendor/github.com/Azure/azure-kusto-go/kusto/internal/response/response.go rename to vendor/github.com/Azure/azure-kusto-go/azkustodata/internal/response/response.go index 1c0ecc66d6d..b9f8818e5d8 100644 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/internal/response/response.go +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/internal/response/response.go @@ -8,7 +8,7 @@ import ( "net/http" "strings" - "github.com/Azure/azure-kusto-go/kusto/data/errors" + "github.com/Azure/azure-kusto-go/azkustodata/errors" ) type originalCloser struct { diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/internal/version/version.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/internal/version/version.go similarity index 87% rename from vendor/github.com/Azure/azure-kusto-go/kusto/internal/version/version.go rename to vendor/github.com/Azure/azure-kusto-go/azkustodata/internal/version/version.go index 41b70be3eec..82e5a1d71a9 100644 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/internal/version/version.go +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/internal/version/version.go @@ -2,4 +2,4 @@ package version // Kusto is the version of this client package that is communicated to the server. -const Kusto = "0.16.1" +const Kusto = "1.2.2" diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/kcsb.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/kcsb.go similarity index 64% rename from vendor/github.com/Azure/azure-kusto-go/kusto/kcsb.go rename to vendor/github.com/Azure/azure-kusto-go/azkustodata/kcsb.go index e7b922348ae..257c4430d43 100644 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/kcsb.go +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/kcsb.go @@ -1,78 +1,53 @@ -package kusto +package azkustodata import ( + "encoding/base64" "fmt" + "github.com/Azure/azure-kusto-go/azkustodata/keywords" "os" "strconv" "strings" - kustoErrors "github.com/Azure/azure-kusto-go/kusto/data/errors" + kustoErrors "github.com/Azure/azure-kusto-go/azkustodata/errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" ) type ConnectionStringBuilder struct { - DataSource string - AadUserID string - Password string - UserToken string - ApplicationClientId string - ApplicationKey string - AuthorityId string - ApplicationCertificatePath string - ApplicationCertificateBytes []byte - ApplicationCertificatePassword []byte - SendCertificateChain bool - ApplicationToken string - AzCli bool - MsiAuthentication bool - WorkloadAuthentication bool - FederationTokenFilePath string - ManagedServiceIdentity string - InteractiveLogin bool - RedirectURL string - DefaultAuth bool - ClientOptions *azcore.ClientOptions - ApplicationForTracing string - UserForTracing string - TokenCredential azcore.TokenCredential + DataSource string + InitialCatalog string // TODO - implement default db support + AadFederatedSecurity bool + AadUserID string + Password string + UserToken string + ApplicationClientId string + ApplicationKey string + AuthorityId string + ApplicationCertificatePath string + ApplicationCertificateBytes []byte + ApplicationCertificatePassword []byte + SendCertificateChain bool + ApplicationToken string + AzCli bool + MsiAuthentication bool + WorkloadAuthentication bool + FederationTokenFilePath string + ManagedServiceIdentityClientId string + ManagedServiceIdentityResourceId string + InteractiveLogin bool + RedirectURL string + DefaultAuth bool + ClientOptions *azcore.ClientOptions + ApplicationForTracing string + UserForTracing string + TokenCredential azcore.TokenCredential } const ( - dataSource string = "DataSource" - aadUserId string = "AADUserID" - password string = "Password" - applicationClientId string = "ApplicationClientId" - applicationKey string = "ApplicationKey" - applicationCertificate string = "ApplicationCertificate" - authorityId string = "AuthorityId" - applicationToken string = "ApplicationToken" - userToken string = "UserToken" - applicationCertificateThumbprint string = "ApplicationCertificateThumbprint" - sendCertificateChain string = "SendCertificateChain" - interactiveLogin string = "InteractiveLogin" - domainHint string = "RedirectURL" + BearerType = "Bearer" + SecretReplacement = "****" ) -const ( - BEARER_TYPE = "Bearer" -) - -var csMapping = map[string]string{"datasource": dataSource, "data source": dataSource, "addr": dataSource, "address": dataSource, "network address": dataSource, "server": dataSource, - "aad user id": aadUserId, "aaduserid": aadUserId, - "password": password, "pwd": password, - "application client id": applicationClientId, "applicationclientid": applicationClientId, "appclientid": applicationClientId, - "application key": applicationKey, "applicationkey": applicationKey, "appkey": applicationKey, - "application certificate": applicationCertificate, "applicationcertificate": applicationCertificate, - "application certificate thumbprint": applicationCertificateThumbprint, "applicationcertificatethumbprint": applicationCertificateThumbprint, - "sendcertificatechain": sendCertificateChain, "send certificate chain": sendCertificateChain, - "authority id": authorityId, "authorityid": authorityId, "authority": authorityId, "tenantid": authorityId, "tenant": authorityId, "tid": authorityId, - "application token": applicationToken, "applicationtoken": applicationToken, "apptoken": applicationToken, - "user token": userToken, "usertoken": userToken, "usrtoken": userToken, - "interactive login": interactiveLogin, "interactivelogin": interactiveLogin, - "domain hint": domainHint, "domainhint": domainHint, -} - func requireNonEmpty(key string, value string) { if isEmpty(value) { panic(fmt.Sprintf("Error: %s cannot be null", key)) @@ -80,42 +55,132 @@ func requireNonEmpty(key string, value string) { } func assignValue(kcsb *ConnectionStringBuilder, rawKey string, value string) error { - rawKey = strings.ToLower(strings.Trim(rawKey, " ")) - parsedKey, ok := csMapping[rawKey] - if !ok { - return fmt.Errorf("Error: unsupported key %q in connection string ", rawKey) + keyword, err := keywords.GetKeyword(rawKey) + if err != nil { + return err } - switch parsedKey { - case dataSource: + + switch keyword.Name { + case keywords.DataSource: kcsb.DataSource = value - case aadUserId: - kcsb.AadUserID = value - case password: - kcsb.Password = value - case applicationClientId: + case keywords.InitialCatalog: + kcsb.InitialCatalog = value + case keywords.FederatedSecurity: + bval, err := strconv.ParseBool(value) + if err != nil { + return kustoErrors.ES(kustoErrors.OpUnknown, kustoErrors.KOther, "error: Couldn't parse federated security value: %s", err) + } + kcsb.AadFederatedSecurity = bval + case keywords.ApplicationClientId: kcsb.ApplicationClientId = value - case applicationKey: - kcsb.ApplicationKey = value - case applicationCertificate: - kcsb.ApplicationCertificatePath = value - case sendCertificateChain: - bval, _ := strconv.ParseBool(value) - kcsb.SendCertificateChain = bval - case authorityId: + case keywords.UserId: + kcsb.AadUserID = value + case keywords.AuthorityId: kcsb.AuthorityId = value - case applicationToken: + + case keywords.ApplicationToken: kcsb.ApplicationToken = value - case userToken: + case keywords.UserToken: kcsb.UserToken = value - case interactiveLogin: - bval, _ := strconv.ParseBool(value) - kcsb.InteractiveLogin = bval - case domainHint: - kcsb.RedirectURL = value + case keywords.ApplicationKey: + kcsb.ApplicationKey = value + case keywords.ApplicationCertificateX5C: + bval, err := strconv.ParseBool(value) + if err != nil { + return kustoErrors.ES(kustoErrors.OpUnknown, kustoErrors.KOther, "error: Couldn't parse certificate x5c value: %s", err) + } + kcsb.SendCertificateChain = bval + case keywords.ApplicationCertificateBlob: + decodeString, err := base64.StdEncoding.DecodeString(value) + if err != nil { + return kustoErrors.ES(kustoErrors.OpUnknown, kustoErrors.KOther, "error: Couldn't decode certificate blob: %s", err) + } + kcsb.ApplicationCertificateBytes = decodeString + case keywords.ApplicationNameForTracing: + kcsb.ApplicationForTracing = value + case keywords.UserNameForTracing: + kcsb.UserForTracing = value + case keywords.Password: + kcsb.Password = value } + return nil } +// ConnectionString Generates a connection string from the current state of the ConnectionStringBuilder. +func (kcsb *ConnectionStringBuilder) ConnectionString(includeSecrets bool) (string, error) { + builder := strings.Builder{} + + writeValue := func(k string, v string) error { + if isEmpty(v) { + return nil + } + + keyword, err := keywords.GetKeyword(k) + if err != nil { + return err + } + + builder.WriteString(keyword.Name) + builder.WriteRune('=') + if keyword.Secret && !includeSecrets { + builder.WriteString(SecretReplacement) + } else { + builder.WriteString(v) + } + + builder.WriteRune(';') + return nil + } + + if err := writeValue(keywords.DataSource, kcsb.DataSource); err != nil { + return "", err + } + if err := writeValue(keywords.InitialCatalog, kcsb.InitialCatalog); err != nil { + return "", err + } + if kcsb.AadFederatedSecurity { + if err := writeValue(keywords.FederatedSecurity, "true"); err != nil { + return "", err + } + } + if err := writeValue(keywords.ApplicationClientId, kcsb.ApplicationClientId); err != nil { + return "", err + } + if err := writeValue(keywords.UserId, kcsb.AadUserID); err != nil { + return "", err + } + if err := writeValue(keywords.AuthorityId, kcsb.AuthorityId); err != nil { + return "", err + } + if err := writeValue(keywords.ApplicationToken, kcsb.ApplicationToken); err != nil { + return "", err + } + if err := writeValue(keywords.UserToken, kcsb.UserToken); err != nil { + return "", err + } + if err := writeValue(keywords.ApplicationKey, kcsb.ApplicationKey); err != nil { + return "", err + } + if kcsb.SendCertificateChain { + if err := writeValue(keywords.ApplicationCertificateX5C, "true"); err != nil { + return "", err + } + } + if len(kcsb.ApplicationCertificateBytes) != 0 { + if err := writeValue(keywords.ApplicationCertificateBlob, base64.StdEncoding.EncodeToString(kcsb.ApplicationCertificateBytes)); err != nil { + return "", err + } + } + + s := builder.String() + if len(s) > 0 { + s = s[:len(s)-1] // remove trailing ';' + } + + return s, nil +} + // NewConnectionStringBuilder Creates new Kusto ConnectionStringBuilder. // Params takes kusto connection string connStr: string. Kusto connection string should be of the format: // https://..kusto.windows.net;AAD User ID="user@microsoft.com";Password=P@ssWord @@ -149,7 +214,9 @@ func NewConnectionStringBuilder(connStr string) *ConnectionStringBuilder { } func (kcsb *ConnectionStringBuilder) resetConnectionString() { + kcsb.AadFederatedSecurity = false kcsb.AadUserID = "" + kcsb.InitialCatalog = "" kcsb.Password = "" kcsb.UserToken = "" kcsb.ApplicationClientId = "" @@ -163,7 +230,8 @@ func (kcsb *ConnectionStringBuilder) resetConnectionString() { kcsb.AzCli = false kcsb.MsiAuthentication = false kcsb.WorkloadAuthentication = false - kcsb.ManagedServiceIdentity = "" + kcsb.ManagedServiceIdentityClientId = "" + kcsb.ManagedServiceIdentityResourceId = "" kcsb.InteractiveLogin = false kcsb.RedirectURL = "" kcsb.ClientOptions = nil @@ -173,32 +241,35 @@ func (kcsb *ConnectionStringBuilder) resetConnectionString() { // WithAadUserPassAuth Creates a Kusto Connection string builder that will authenticate with AAD user name and password. func (kcsb *ConnectionStringBuilder) WithAadUserPassAuth(uname string, pswrd string, authorityID string) *ConnectionStringBuilder { - requireNonEmpty(dataSource, kcsb.DataSource) - requireNonEmpty(aadUserId, uname) - requireNonEmpty(password, pswrd) + requireNonEmpty(keywords.DataSource, kcsb.DataSource) + requireNonEmpty(keywords.UserId, uname) + requireNonEmpty(keywords.Password, pswrd) kcsb.resetConnectionString() + kcsb.AadFederatedSecurity = true kcsb.AadUserID = uname kcsb.Password = pswrd kcsb.AuthorityId = authorityID return kcsb } -// WitAadUserToken Creates a Kusto Connection string builder that will authenticate with AAD user token -func (kcsb *ConnectionStringBuilder) WitAadUserToken(usertoken string) *ConnectionStringBuilder { - requireNonEmpty(dataSource, kcsb.DataSource) - requireNonEmpty(userToken, usertoken) +// WithAadUserToken Creates a Kusto Connection string builder that will authenticate with AAD user token +func (kcsb *ConnectionStringBuilder) WithAadUserToken(usertoken string) *ConnectionStringBuilder { + requireNonEmpty(keywords.DataSource, kcsb.DataSource) + requireNonEmpty(keywords.UserToken, usertoken) kcsb.resetConnectionString() + kcsb.AadFederatedSecurity = true kcsb.UserToken = usertoken return kcsb } // WithAadAppKey Creates a Kusto Connection string builder that will authenticate with AAD application and key. func (kcsb *ConnectionStringBuilder) WithAadAppKey(appId string, appKey string, authorityID string) *ConnectionStringBuilder { - requireNonEmpty(dataSource, kcsb.DataSource) - requireNonEmpty(applicationClientId, appId) - requireNonEmpty(applicationKey, appKey) - requireNonEmpty(authorityId, authorityID) + requireNonEmpty(keywords.DataSource, kcsb.DataSource) + requireNonEmpty(keywords.ApplicationClientId, appId) + requireNonEmpty(keywords.ApplicationKey, appKey) + requireNonEmpty(keywords.AuthorityId, authorityID) kcsb.resetConnectionString() + kcsb.AadFederatedSecurity = true kcsb.ApplicationClientId = appId kcsb.ApplicationKey = appKey kcsb.AuthorityId = authorityID @@ -207,10 +278,11 @@ func (kcsb *ConnectionStringBuilder) WithAadAppKey(appId string, appKey string, // WithAppCertificatePath Creates a Kusto Connection string builder that will authenticate with AAD application using a certificate. func (kcsb *ConnectionStringBuilder) WithAppCertificatePath(appId string, certificatePath string, password []byte, sendCertChain bool, authorityID string) *ConnectionStringBuilder { - requireNonEmpty(dataSource, kcsb.DataSource) - requireNonEmpty(applicationCertificate, certificatePath) - requireNonEmpty(authorityId, authorityID) + requireNonEmpty(keywords.DataSource, kcsb.DataSource) + requireNonEmpty("Application Certificate Path", certificatePath) + requireNonEmpty(keywords.AuthorityId, authorityID) kcsb.resetConnectionString() + kcsb.AadFederatedSecurity = true kcsb.ApplicationClientId = appId kcsb.AuthorityId = authorityID @@ -222,12 +294,13 @@ func (kcsb *ConnectionStringBuilder) WithAppCertificatePath(appId string, certif // WithAppCertificateBytes Creates a Kusto Connection string builder that will authenticate with AAD application using a certificate. func (kcsb *ConnectionStringBuilder) WithAppCertificateBytes(appId string, certificateBytes []byte, password []byte, sendCertChain bool, authorityID string) *ConnectionStringBuilder { - requireNonEmpty(dataSource, kcsb.DataSource) - requireNonEmpty(authorityId, authorityID) + requireNonEmpty(keywords.DataSource, kcsb.DataSource) + requireNonEmpty(keywords.AuthorityId, authorityID) if len(certificateBytes) == 0 { panic("error: Certificate cannot be null") } kcsb.resetConnectionString() + kcsb.AadFederatedSecurity = true kcsb.ApplicationClientId = appId kcsb.AuthorityId = authorityID @@ -239,36 +312,51 @@ func (kcsb *ConnectionStringBuilder) WithAppCertificateBytes(appId string, certi // WithApplicationToken Creates a Kusto Connection string builder that will authenticate with AAD application and an application token. func (kcsb *ConnectionStringBuilder) WithApplicationToken(appId string, appToken string) *ConnectionStringBuilder { - requireNonEmpty(dataSource, kcsb.DataSource) - requireNonEmpty(applicationToken, appToken) + requireNonEmpty(keywords.DataSource, kcsb.DataSource) + requireNonEmpty(keywords.ApplicationToken, appToken) kcsb.resetConnectionString() + kcsb.AadFederatedSecurity = true kcsb.ApplicationToken = appToken return kcsb } // WithAzCli Creates a Kusto Connection string builder that will use existing authenticated az cli profile password. func (kcsb *ConnectionStringBuilder) WithAzCli() *ConnectionStringBuilder { - requireNonEmpty(dataSource, kcsb.DataSource) + requireNonEmpty(keywords.DataSource, kcsb.DataSource) kcsb.resetConnectionString() + kcsb.AadFederatedSecurity = true kcsb.AzCli = true return kcsb } -// WithUserManagedIdentity Creates a Kusto Connection string builder that will authenticate with AAD application, using +// WithUserAssignedIdentityClientId Creates a Kusto Connection string builder that will authenticate with AAD application, using // an application token obtained from a Microsoft Service Identity endpoint using user assigned id. -func (kcsb *ConnectionStringBuilder) WithUserManagedIdentity(clientID string) *ConnectionStringBuilder { - requireNonEmpty(dataSource, kcsb.DataSource) +func (kcsb *ConnectionStringBuilder) WithUserAssignedIdentityClientId(clientID string) *ConnectionStringBuilder { + requireNonEmpty(keywords.DataSource, kcsb.DataSource) kcsb.resetConnectionString() + kcsb.AadFederatedSecurity = true kcsb.MsiAuthentication = true - kcsb.ManagedServiceIdentity = clientID + kcsb.ManagedServiceIdentityClientId = clientID + return kcsb +} + +// WithUserAssignedIdentityResourceId Creates a Kusto Connection string builder that will authenticate with AAD application, using +// an application token obtained from a Microsoft Service Identity endpoint using an MSI's resourceID. +func (kcsb *ConnectionStringBuilder) WithUserAssignedIdentityResourceId(resourceID string) *ConnectionStringBuilder { + requireNonEmpty(keywords.DataSource, kcsb.DataSource) + kcsb.resetConnectionString() + kcsb.AadFederatedSecurity = true + kcsb.MsiAuthentication = true + kcsb.ManagedServiceIdentityResourceId = resourceID return kcsb } // WithSystemManagedIdentity Creates a Kusto Connection string builder that will authenticate with AAD application, using // an application token obtained from a Microsoft Service Identity endpoint using system assigned id. func (kcsb *ConnectionStringBuilder) WithSystemManagedIdentity() *ConnectionStringBuilder { - requireNonEmpty(dataSource, kcsb.DataSource) + requireNonEmpty(keywords.DataSource, kcsb.DataSource) kcsb.resetConnectionString() + kcsb.AadFederatedSecurity = true kcsb.MsiAuthentication = true return kcsb } @@ -276,8 +364,9 @@ func (kcsb *ConnectionStringBuilder) WithSystemManagedIdentity() *ConnectionStri // WithKubernetesWorkloadIdentity Creates a Kusto Connection string builder that will authenticate with AAD application, using // an application token obtained from a Microsoft Service Identity endpoint using Kubernetes workload identity. func (kcsb *ConnectionStringBuilder) WithKubernetesWorkloadIdentity(appId, tokenFilePath, authorityID string) *ConnectionStringBuilder { - requireNonEmpty(dataSource, kcsb.DataSource) + requireNonEmpty(keywords.DataSource, kcsb.DataSource) kcsb.resetConnectionString() + kcsb.AadFederatedSecurity = true kcsb.ApplicationClientId = appId kcsb.AuthorityId = authorityID kcsb.FederationTokenFilePath = tokenFilePath @@ -288,8 +377,9 @@ func (kcsb *ConnectionStringBuilder) WithKubernetesWorkloadIdentity(appId, token // WithInteractiveLogin Creates a Kusto Connection string builder that will authenticate by launching the system default browser // to interactively authenticate a user, and obtain an access token func (kcsb *ConnectionStringBuilder) WithInteractiveLogin(authorityID string) *ConnectionStringBuilder { - requireNonEmpty(dataSource, kcsb.DataSource) + requireNonEmpty(keywords.DataSource, kcsb.DataSource) kcsb.resetConnectionString() + kcsb.AadFederatedSecurity = true if !isEmpty(authorityID) { kcsb.AuthorityId = authorityID } @@ -300,7 +390,7 @@ func (kcsb *ConnectionStringBuilder) WithInteractiveLogin(authorityID string) *C // AttachPolicyClientOptions Assigns ClientOptions to string builder that contains configuration settings like Logging and Retry configs for a client's pipeline. // Read more at https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore@v1.2.0/policy#ClientOptions func (kcsb *ConnectionStringBuilder) AttachPolicyClientOptions(options *azcore.ClientOptions) *ConnectionStringBuilder { - requireNonEmpty(dataSource, kcsb.DataSource) + requireNonEmpty(keywords.DataSource, kcsb.DataSource) if options != nil { kcsb.ClientOptions = options } @@ -311,12 +401,14 @@ func (kcsb *ConnectionStringBuilder) AttachPolicyClientOptions(options *azcore.C // Read more at https://learn.microsoft.com/azure/developer/go/azure-sdk-authentication?tabs=bash#2-authenticate-with-azure func (kcsb *ConnectionStringBuilder) WithDefaultAzureCredential() *ConnectionStringBuilder { kcsb.resetConnectionString() + kcsb.AadFederatedSecurity = true kcsb.DefaultAuth = true return kcsb } func (kcsb *ConnectionStringBuilder) WithTokenCredential(tokenCredential azcore.TokenCredential) *ConnectionStringBuilder { kcsb.resetConnectionString() + kcsb.AadFederatedSecurity = true kcsb.TokenCredential = tokenCredential return kcsb } @@ -324,28 +416,11 @@ func (kcsb *ConnectionStringBuilder) WithTokenCredential(tokenCredential azcore. // Method to be used for generating TokenCredential func (kcsb *ConnectionStringBuilder) newTokenProvider() (*TokenProvider, error) { tkp := &TokenProvider{} - tkp.tokenScheme = BEARER_TYPE + tkp.tokenScheme = BearerType var init func(*CloudInfo, *azcore.ClientOptions, string) (azcore.TokenCredential, error) switch { - case kcsb.InteractiveLogin: - init = func(ci *CloudInfo, cliOpts *azcore.ClientOptions, appClientId string) (azcore.TokenCredential, error) { - inOpts := &azidentity.InteractiveBrowserCredentialOptions{} - inOpts.ClientID = ci.KustoClientAppID - inOpts.TenantID = kcsb.AuthorityId - inOpts.RedirectURL = ci.KustoClientRedirectURI - inOpts.ClientOptions = *cliOpts - - cred, err := azidentity.NewInteractiveBrowserCredential(inOpts) - if err != nil { - return nil, kustoErrors.E(kustoErrors.OpTokenProvider, kustoErrors.KOther, - fmt.Errorf("error: Couldn't retrieve client credentials using Interactive Login. "+ - "Error: %s", err)) - } - - return cred, nil - } case !isEmpty(kcsb.AadUserID) && !isEmpty(kcsb.Password): init = func(ci *CloudInfo, cliOpts *azcore.ClientOptions, appClientId string) (azcore.TokenCredential, error) { opts := &azidentity.UsernamePasswordCredentialOptions{ClientOptions: *cliOpts} @@ -410,8 +485,15 @@ func (kcsb *ConnectionStringBuilder) newTokenProvider() (*TokenProvider, error) case kcsb.MsiAuthentication: init = func(ci *CloudInfo, cliOpts *azcore.ClientOptions, appClientId string) (azcore.TokenCredential, error) { opts := &azidentity.ManagedIdentityCredentialOptions{ClientOptions: *cliOpts} - if !isEmpty(kcsb.ManagedServiceIdentity) { - opts.ID = azidentity.ClientID(kcsb.ManagedServiceIdentity) + // legacy kcsb.ManagedServiceIdentity field takes precedence over + // new kcsb.ManagedServiceIdentityClientId field which takes precedence over + // new kcsb.ManagedServiceIdentityResourceId field + // if no client id is provided, the logic falls back to set up + // the system assigned identity + if !isEmpty(kcsb.ManagedServiceIdentityClientId) { + opts.ID = azidentity.ClientID(kcsb.ManagedServiceIdentityClientId) + } else if !isEmpty(kcsb.ManagedServiceIdentityResourceId) { + opts.ID = azidentity.ResourceID(kcsb.ManagedServiceIdentityResourceId) } cred, err := azidentity.NewManagedIdentityCredential(opts) @@ -498,7 +580,23 @@ func (kcsb *ConnectionStringBuilder) newTokenProvider() (*TokenProvider, error) init = func(ci *CloudInfo, cliOpts *azcore.ClientOptions, appClientId string) (azcore.TokenCredential, error) { return kcsb.TokenCredential, nil } + case kcsb.InteractiveLogin || kcsb.AadFederatedSecurity: // If AadFed is set, but no other auth method is set, default to interactive login + init = func(ci *CloudInfo, cliOpts *azcore.ClientOptions, appClientId string) (azcore.TokenCredential, error) { + inOpts := &azidentity.InteractiveBrowserCredentialOptions{} + inOpts.ClientID = ci.KustoClientAppID + inOpts.TenantID = kcsb.AuthorityId + inOpts.RedirectURL = ci.KustoClientRedirectURI + inOpts.ClientOptions = *cliOpts + + cred, err := azidentity.NewInteractiveBrowserCredential(inOpts) + if err != nil { + return nil, kustoErrors.E(kustoErrors.OpTokenProvider, kustoErrors.KOther, + fmt.Errorf("error: Couldn't retrieve client credentials using Interactive Login. "+ + "Error: %s", err)) + } + return cred, nil + } } if init != nil { diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/keywords/kcsb.json b/vendor/github.com/Azure/azure-kusto-go/azkustodata/keywords/kcsb.json new file mode 100644 index 00000000000..cd5fcc8b7b3 --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/keywords/kcsb.json @@ -0,0 +1,219 @@ +{ + "version": "2025-01-15", + "keywords": [ + { + "name": "Data Source", + "aliases": [ + "server", + "addr", + "address", + "networkaddress" + ], + "type": "string", + "secret": false + }, + { + "name": "dSTS Federated Security", + "aliases": [ + "dstsfed", + "dststokentype" + ], + "type": "bool", + "secret": false + }, + { + "name": "Streaming", + "aliases": [], + "type": "bool", + "secret": false + }, + { + "name": "Uncompressed", + "aliases": [], + "type": "bool", + "secret": false + }, + { + "name": "EnforceMfa", + "aliases": [], + "type": "bool", + "secret": false + }, + { + "name": "Accept", + "aliases": [], + "type": "bool", + "secret": false + }, + { + "name": "Query Consistency", + "aliases": [], + "type": "bool", + "secret": false + }, + { + "name": "Password", + "aliases": [ + "pwd" + ], + "type": "string", + "secret": true + }, + { + "name": "Data Source Uri", + "aliases": [ + "serveruri", + "clusteruri" + ], + "type": "string", + "secret": false + }, + { + "name": "Azure Region", + "aliases": [ + "region" + ], + "type": "string", + "secret": false + }, + { + "name": "Namespace", + "aliases": [ + "ns" + ], + "type": "string", + "secret": false + }, + { + "name": "Application Certificate Thumbprint", + "aliases": [ + "appcert" + ], + "type": "string", + "secret": true + }, + { + "name": "Application Certificate Issuer Distinguished Name", + "aliases": [ + "applicationcertificateissuer" + ], + "type": "string", + "secret": true + }, + { + "name": "Application Certificate Subject Distinguished Name", + "aliases": [ + "applicationcertificatesubject" + ], + "type": "string", + "secret": true + }, + { + "name": "Application Token", + "aliases": [ + "apptoken" + ], + "type": "string", + "secret": true + }, + { + "name": "User Token", + "aliases": [ + "usrtoken" + ], + "type": "string", + "secret": true + }, + { + "name": "Application Key", + "aliases": [ + "appkey" + ], + "type": "string", + "secret": true + }, + { + "name": "Application Certificate Blob", + "aliases": [], + "type": "string", + "secret": true + }, + { + "name": "Application Certificate SendX5c", + "aliases": [ + "applicationcertificatex5c", + "sendx5c", + "applicationcertificatesendpubliccertificate", + "sendcertificatechain" + ], + "type": "bool", + "secret": false + }, + { + "name": "User ID", + "aliases": [ + "user", + "uid", + "loginhint", + "aaduserid" + ], + "type": "string", + "secret": false + }, + { + "name": "Initial Catalog", + "aliases": [ + "database" + ], + "type": "string", + "secret": false + }, + { + "name": "AAD Federated Security", + "aliases": [ + "federatedsecurity", + "aadfed", + "fed", + "federated" + ], + "type": "bool", + "secret": false + }, + { + "name": "Authority Id", + "aliases": [ + "tenantid", + "tid", + "tenant", + "authority", + "domainhint" + ], + "type": "string", + "secret": false + }, + { + "name": "Application Name for Tracing", + "aliases": [ + "traceappname" + ], + "type": "string", + "secret": false + }, + { + "name": "User Name for Tracing", + "aliases": [ + "traceusername" + ], + "type": "string", + "secret": false + }, + { + "name": "Application Client Id", + "aliases": [ + "appclientid" + ], + "type": "string", + "secret": false + } + ] +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/keywords/keywords.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/keywords/keywords.go new file mode 100644 index 00000000000..c9540cca068 --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/keywords/keywords.go @@ -0,0 +1,136 @@ +package keywords + +import ( + _ "embed" + "encoding/json" + "github.com/Azure/azure-kusto-go/azkustodata/errors" + "strings" +) + +const ( + DataSource = "Data Source" + InitialCatalog = "Initial Catalog" + FederatedSecurity = "AAD Federated Security" + ApplicationClientId = "Application Client Id" + ApplicationKey = "Application Key" + UserId = "User ID" + AuthorityId = "Authority Id" + ApplicationToken = "Application Token" + UserToken = "User Token" + ApplicationCertificateX5C = "Application Certificate SendX5c" + ApplicationNameForTracing = "Application Name for Tracing" + UserNameForTracing = "User Name for Tracing" + Password = "Password" + ApplicationCertificateBlob = "Application Certificate Blob" + ApplicationCertificateThumbprint = "Application Certificate Thumbprint" + DstsFederatedSecurity = "dSTS Federated Security" + Streaming = "Streaming" + Uncompressed = "Uncompressed" + EnforceMfa = "EnforceMfa" + Accept = "Accept" + QueryConsistency = "Query Consistency" + DataSourceUri = "Data Source Uri" + AzureRegion = "Azure Region" + Namespace = "Namespace" + ApplicationCertificateIssuerDistinguishedName = "Application Certificate Issuer Distinguished Name" + ApplicationCertificateSubjectDistinguishedName = "Application Certificate Subject Distinguished Name" +) + +var ( + Instance = createInstance() + //go:embed kcsb.json + jsonFile []byte +) + +var ( + keywordSupported = map[string]bool{ + DataSource: true, + InitialCatalog: true, + FederatedSecurity: true, + ApplicationClientId: true, + ApplicationKey: true, + UserId: true, + AuthorityId: true, + ApplicationToken: true, + UserToken: true, + ApplicationCertificateX5C: true, + ApplicationNameForTracing: true, + UserNameForTracing: true, + Password: true, + + ApplicationCertificateBlob: false, + ApplicationCertificateThumbprint: false, + DstsFederatedSecurity: false, + Streaming: false, + Uncompressed: false, + EnforceMfa: false, + Accept: false, + QueryConsistency: false, + DataSourceUri: false, + AzureRegion: false, + Namespace: false, + ApplicationCertificateIssuerDistinguishedName: false, + ApplicationCertificateSubjectDistinguishedName: false, + } +) + +// Keyword represents an individual keyword in the JSON. +type Keyword struct { + Name string `json:"name"` + Aliases []string `json:"aliases"` + Type string `json:"type"` + Secret bool `json:"secret"` + IsSupported bool +} + +// Config represents the root structure of the JSON. +type Config struct { + Version string `json:"version"` + Keywords []Keyword `json:"keywords"` + lookup map[string]Keyword +} + +// normalizeKeyword normalizes a keyword by making it lowercase and removing spaces. +func normalizeKeyword(keyword string) string { + return strings.ReplaceAll(strings.ToLower(keyword), " ", "") +} + +func createInstance() *Config { + config := Config{ + lookup: make(map[string]Keyword), + } + err := json.Unmarshal(jsonFile, &config) + if err != nil { + panic(err.Error()) + } + + for _, word := range config.Keywords { + supported, ok := keywordSupported[word.Name] + if !ok { + // If you get this error, you probably need to update the keywords\kcsb.json file. + panic("Keyword " + word.Name + " not found in embedded kcsb.json file. Please report this issue.") + } + + word.IsSupported = supported + + config.lookup[normalizeKeyword(word.Name)] = word + for _, alias := range word.Aliases { + config.lookup[normalizeKeyword(alias)] = word + } + } + + return &config +} + +func GetKeyword(keyword string) (*Keyword, error) { + word, ok := Instance.lookup[normalizeKeyword(keyword)] + if !ok { + return nil, errors.ES(errors.OpUnknown, errors.KFailedToParse, "The Connection String keyword `%s` is unknown.", keyword) + } + + if !word.IsSupported { + return nil, errors.ES(errors.OpUnknown, errors.KFailedToParse, "The Connection String keyword `%s` is not supported.", keyword) + } + + return &word, nil +} diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/kql/builder.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/kql/builder.go similarity index 60% rename from vendor/github.com/Azure/azure-kusto-go/kusto/kql/builder.go rename to vendor/github.com/Azure/azure-kusto-go/azkustodata/kql/builder.go index cc90e7f67d0..3a120ba384f 100644 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/kql/builder.go +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/kql/builder.go @@ -3,7 +3,7 @@ package kql import ( "errors" "fmt" - "github.com/Azure/azure-kusto-go/kusto/data/types" + "github.com/Azure/azure-kusto-go/azkustodata/value" "github.com/google/uuid" "github.com/shopspring/decimal" "strings" @@ -43,6 +43,11 @@ func (b *Builder) addBase(value fmt.Stringer) *Builder { return b } +func (b *Builder) AddValue(v value.Kusto) *Builder { + b.builder.WriteString(QuoteValue(v)) + return b +} + // AddUnsafe enables unsafe actions on a Builder - adds a string as is, no validation checking or escaping. // This turns off safety features that could allow a service client to compromise your data store. // USE AT YOUR OWN RISK! @@ -55,44 +60,48 @@ func (b *Builder) AddLiteral(value stringConstant) *Builder { return b.addBase(value) } -func (b *Builder) AddBool(value bool) *Builder { - return b.addBase(newValue(value, types.Bool)) +func (b *Builder) AddBool(v bool) *Builder { + return b.AddValue(value.NewBool(v)) +} + +func (b *Builder) AddDateTime(v time.Time) *Builder { + return b.AddValue(value.NewDateTime(v)) } -func (b *Builder) AddDateTime(value time.Time) *Builder { - return b.addBase(newValue(value, types.DateTime)) +func (b *Builder) AddDynamic(v interface{}) *Builder { + return b.AddValue(value.DynamicFromInterface(v)) } -func (b *Builder) AddDynamic(value interface{}) *Builder { - return b.addBase(newValue(value, types.Dynamic)) +func (b *Builder) AddSerializedDynamic(v []byte) *Builder { + return b.AddValue(value.NewDynamic(v)) } -func (b *Builder) AddGUID(value uuid.UUID) *Builder { - return b.addBase(newValue(value, types.GUID)) +func (b *Builder) AddGUID(v uuid.UUID) *Builder { + return b.AddValue(value.NewGUID(v)) } -func (b *Builder) AddInt(value int32) *Builder { - return b.addBase(newValue(value, types.Int)) +func (b *Builder) AddInt(v int32) *Builder { + return b.AddValue(value.NewInt(v)) } -func (b *Builder) AddLong(value int64) *Builder { - return b.addBase(newValue(value, types.Long)) +func (b *Builder) AddLong(v int64) *Builder { + return b.AddValue(value.NewLong(v)) } -func (b *Builder) AddReal(value float64) *Builder { - return b.addBase(newValue(value, types.Real)) +func (b *Builder) AddReal(v float64) *Builder { + return b.AddValue(value.NewReal(v)) } -func (b *Builder) AddString(value string) *Builder { - return b.addBase(newValue(value, types.String)) +func (b *Builder) AddString(v string) *Builder { + return b.AddValue(value.NewString(v)) } -func (b *Builder) AddTimespan(value time.Duration) *Builder { - return b.addBase(newValue(value, types.Timespan)) +func (b *Builder) AddTimespan(v time.Duration) *Builder { + return b.AddValue(value.NewTimespan(v)) } -func (b *Builder) AddDecimal(value decimal.Decimal) *Builder { - return b.addBase(newValue(value, types.Decimal)) +func (b *Builder) AddDecimal(v decimal.Decimal) *Builder { + return b.AddValue(value.NewDecimal(v)) } func (b *Builder) GetParameters() (map[string]string, error) { diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/kql/identifier.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/kql/identifier.go similarity index 100% rename from vendor/github.com/Azure/azure-kusto-go/kusto/kql/identifier.go rename to vendor/github.com/Azure/azure-kusto-go/azkustodata/kql/identifier.go diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/kql/query_parameters.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/kql/query_parameters.go new file mode 100644 index 00000000000..9f1d49d8930 --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/kql/query_parameters.go @@ -0,0 +1,116 @@ +package kql + +import ( + "github.com/Azure/azure-kusto-go/azkustodata/value" + "github.com/google/uuid" + "github.com/shopspring/decimal" + "sort" + "strings" + "time" +) + +type Parameters struct { + parameters map[string]value.Kusto +} + +func NewParameters() *Parameters { + return &Parameters{parameters: make(map[string]value.Kusto)} +} + +func (q *Parameters) Count() int { + return len(q.parameters) +} +func (q *Parameters) AddValue(key string, v value.Kusto) *Parameters { + if RequiresQuoting(key) { + panic("Invalid parameter values. make sure to adhere to KQL entity name conventions and escaping rules.") + } + q.parameters[key] = v + return q +} + +func (q *Parameters) AddBool(key string, v bool) *Parameters { + return q.AddValue(key, value.NewBool(v)) +} + +func (q *Parameters) AddDateTime(key string, v time.Time) *Parameters { + return q.AddValue(key, value.NewDateTime(v)) +} + +func (q *Parameters) AddDynamic(key string, v interface{}) *Parameters { + return q.AddValue(key, value.DynamicFromInterface(v)) +} + +func (q *Parameters) AddSerializedDynamic(key string, v []byte) *Parameters { + return q.AddValue(key, value.NewDynamic(v)) +} + +func (q *Parameters) AddGUID(key string, v uuid.UUID) *Parameters { + return q.AddValue(key, value.NewGUID(v)) +} + +func (q *Parameters) AddInt(key string, v int32) *Parameters { + return q.AddValue(key, value.NewInt(v)) +} + +func (q *Parameters) AddLong(key string, v int64) *Parameters { + return q.AddValue(key, value.NewLong(v)) +} + +func (q *Parameters) AddReal(key string, v float64) *Parameters { + return q.AddValue(key, value.NewReal(v)) +} + +func (q *Parameters) AddString(key string, v string) *Parameters { + return q.AddValue(key, value.NewString(v)) +} + +func (q *Parameters) AddTimespan(key string, v time.Duration) *Parameters { + return q.AddValue(key, value.NewTimespan(v)) +} + +func (q *Parameters) AddDecimal(key string, v decimal.Decimal) *Parameters { + return q.AddValue(key, value.NewDecimal(v)) +} + +func (q *Parameters) ToDeclarationString() string { + const ( + declare = "declare query_parameters(" + closeStmt = ");" + ) + var build = strings.Builder{} + + if len(q.parameters) == 0 { + return "" + } + + build.WriteString(declare) + + keys := make([]string, 0, len(q.parameters)) + for k := range q.parameters { + keys = append(keys, k) + } + sort.Strings(keys) + + for i, key := range keys { + build.WriteString(key) + build.WriteString(":") + build.WriteString(string(q.parameters[key].GetType())) + if i < len(keys)-1 { + build.WriteString(", ") + } + } + build.WriteString(closeStmt) + return build.String() +} +func (q *Parameters) ToParameterCollection() map[string]string { + var parameters = make(map[string]string) + for key, paramVals := range q.parameters { + parameters[key] = QuoteValue(paramVals) + } + return parameters +} + +// Reset resets the parameters map +func (q *Parameters) Reset() { + q.parameters = make(map[string]value.Kusto) +} diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/kql/string_utils.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/kql/string_utils.go similarity index 98% rename from vendor/github.com/Azure/azure-kusto-go/kusto/kql/string_utils.go rename to vendor/github.com/Azure/azure-kusto-go/azkustodata/kql/string_utils.go index e15544b617e..ea6dd9c498f 100644 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/kql/string_utils.go +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/kql/string_utils.go @@ -26,10 +26,6 @@ func RequiresQuoting(value string) bool { } func QuoteString(value string, hidden bool) string { - if value == "" { - return value - } - var literal strings.Builder if hidden { diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/kql/value.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/kql/value.go new file mode 100644 index 00000000000..f954868b6ac --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/kql/value.go @@ -0,0 +1,43 @@ +package kql + +import ( + "fmt" + "github.com/Azure/azure-kusto-go/azkustodata/types" + "github.com/Azure/azure-kusto-go/azkustodata/value" + "github.com/google/uuid" + "github.com/shopspring/decimal" + "time" +) + +func QuoteValue(v value.Kusto) string { + val := v.GetValue() + t := v.GetType() + if val == nil { + return fmt.Sprintf("%v(null)", t) + } + + switch t { + case types.String: + return QuoteString(v.String(), false) + case types.DateTime: + val = FormatDatetime(*val.(*time.Time)) + case types.Timespan: + val = FormatTimespan(*val.(*time.Duration)) + case types.Dynamic: + val = string(val.([]byte)) + case types.Bool: + val = *val.(*bool) + case types.Int: + val = *val.(*int32) + case types.Long: + val = *val.(*int64) + case types.Real: + val = *val.(*float64) + case types.Decimal: + val = *val.(*decimal.Decimal) + case types.GUID: + val = *val.(*uuid.UUID) + } + + return fmt.Sprintf("%v(%v)", t, val) +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/kusto.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/kusto.go new file mode 100644 index 00000000000..57f78800378 --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/kusto.go @@ -0,0 +1,303 @@ +package azkustodata + +import ( + "context" + "github.com/Azure/azure-kusto-go/azkustodata/kql" + "github.com/Azure/azure-kusto-go/azkustodata/query" + v1 "github.com/Azure/azure-kusto-go/azkustodata/query/v1" + queryv2 "github.com/Azure/azure-kusto-go/azkustodata/query/v2" + "github.com/Azure/azure-kusto-go/azkustodata/value" + "io" + "net/http" + "time" + + "github.com/Azure/azure-kusto-go/azkustodata/errors" +) + +type Statement = *kql.Builder + +// queryer provides for getting a stream of Kusto frames. Exists to allow fake Kusto streams in tests. +type queryer interface { + io.Closer + rawQuery(ctx context.Context, callType callType, db string, query Statement, options *queryOptions) (io.ReadCloser, error) +} + +// Authorization provides the TokenProvider needed to acquire the auth token. +type Authorization struct { + // Token provider that can be used to get the access token. + TokenProvider *TokenProvider +} + +const ( + defaultMgmtTimeout = time.Hour + defaultQueryTimeout = 4 * time.Minute + clientServerDelta = 30 * time.Second +) + +// Client is a client to a Kusto instance. +type Client struct { + conn queryer + endpoint string + auth Authorization + http *http.Client + clientDetails *ClientDetails +} + +// Option is an optional argument type for New(). +type Option func(c *Client) + +// New returns a new Client. +func New(kcsb *ConnectionStringBuilder, options ...Option) (*Client, error) { + tkp, err := kcsb.newTokenProvider() + if err != nil { + return nil, err + } + auth := &Authorization{ + TokenProvider: tkp, + } + endpoint := kcsb.DataSource + + client := &Client{auth: *auth, endpoint: endpoint, clientDetails: NewClientDetails(kcsb.ApplicationForTracing, kcsb.UserForTracing)} + for _, o := range options { + o(client) + } + + if client.http == nil { + client.http = &http.Client{ + CheckRedirect: func(req *http.Request, via []*http.Request) error { + return http.ErrUseLastResponse + }, + } + } + + conn, err := NewConn(endpoint, *auth, client.http, client.clientDetails) + if err != nil { + return nil, err + } + client.conn = conn + + return client, nil +} + +func WithHttpClient(client *http.Client) Option { + return func(c *Client) { + c.http = client + } +} + +// QueryOption is an option type for a call to Query(). +type QueryOption func(q *queryOptions) error + +// Auth returns the Authorization passed to New(). +func (c *Client) Auth() Authorization { + return c.auth +} + +// Endpoint returns the endpoint passed to New(). +func (c *Client) Endpoint() string { + return c.endpoint +} + +type callType int8 + +const ( + queryCall = 1 + mgmtCall = 2 +) + +func (c *Client) Mgmt(ctx context.Context, db string, kqlQuery Statement, options ...QueryOption) (v1.Dataset, error) { + ctx, cancel := contextSetup(ctx) + + opQuery := errors.OpMgmt + call := mgmtCall + opts, err := setQueryOptions(ctx, opQuery, kqlQuery, call, options...) + if err != nil { + return nil, err + } + + conn, err := c.getConn(callType(call), connOptions{queryOptions: opts}) + if err != nil { + return nil, err + } + + res, err := conn.rawQuery(ctx, callType(call), db, kqlQuery, opts) + + if err != nil { + cancel() + return nil, err + } + + return v1.NewDatasetFromReader(ctx, opQuery, res) +} + +func (c *Client) Query(ctx context.Context, db string, kqlQuery Statement, options ...QueryOption) (query.Dataset, error) { + ds, err := c.IterativeQuery(ctx, db, kqlQuery, options...) + if err != nil { + return nil, err + } + + return ds.ToDataset() +} + +func (c *Client) IterativeQuery(ctx context.Context, db string, kqlQuery Statement, options ...QueryOption) (query.IterativeDataset, error) { + options = append(options, V2NewlinesBetweenFrames()) + options = append(options, V2FragmentPrimaryTables()) + options = append(options, ResultsErrorReportingPlacement(ResultsErrorReportingPlacementEndOfTable)) + + opts, res, err := c.rawV2(ctx, db, kqlQuery, options) + if err != nil { + return nil, err + } + + frameCapacity := queryv2.DefaultIoCapacity + if opts.v2IoCapacity != -1 { + frameCapacity = opts.v2IoCapacity + } + + rowCapacity := queryv2.DefaultRowCapacity + if opts.v2RowCapacity != -1 { + rowCapacity = opts.v2RowCapacity + } + + fragmentCapacity := queryv2.DefaultTableCapacity + if opts.v2TableCapacity != -1 { + fragmentCapacity = opts.v2TableCapacity + } + + return queryv2.NewIterativeDataset(ctx, res, frameCapacity, rowCapacity, fragmentCapacity) +} + +func (c *Client) RawV2(ctx context.Context, db string, kqlQuery Statement, options []QueryOption) (io.ReadCloser, error) { + + _, res, err := c.rawV2(ctx, db, kqlQuery, options) + + return res, err + +} + +func (c *Client) rawV2(ctx context.Context, db string, kqlQuery Statement, options []QueryOption) (*queryOptions, io.ReadCloser, error) { + ctx, cancel := contextSetup(ctx) + opQuery := errors.OpQuery + opts, err := setQueryOptions(ctx, opQuery, kqlQuery, queryCall, options...) + if err != nil { + return nil, nil, err + } + + conn, err := c.getConn(queryCall, connOptions{queryOptions: opts}) + if err != nil { + return nil, nil, err + } + + res, err := conn.rawQuery(ctx, queryCall, db, kqlQuery, opts) + + if err != nil { + cancel() + return nil, nil, err + } + return opts, res, nil +} + +func (c *Client) QueryToJson(ctx context.Context, db string, query Statement, options ...QueryOption) (string, error) { + _, res, err := c.rawV2(ctx, db, query, options) + if err != nil { + return "", err + } + + all, err := io.ReadAll(res) + if err != nil { + return "", err + } + + return string(all), nil +} + +func setQueryOptions(ctx context.Context, op errors.Op, query Statement, queryType int, options ...QueryOption) (*queryOptions, error) { + opt := &queryOptions{ + requestProperties: &requestProperties{ + Options: map[string]interface{}{}, + }, + v2IoCapacity: -1, + v2RowCapacity: -1, + v2TableCapacity: -1, + } + + for _, o := range options { + if err := o(opt); err != nil { + return nil, errors.ES(op, errors.KClientArgs, "QueryValues in the the Stmt were incorrect: %s", err).SetNoRetry() + } + } + + CalculateTimeout(ctx, opt, queryType) + + if query.SupportsInlineParameters() { + if opt.requestProperties.QueryParameters.Count() != 0 { + return nil, errors.ES(op, errors.KClientArgs, "kusto.Stmt does not support the QueryParameters option. Construct your query using `kql.New`").SetNoRetry() + } + params, err := query.GetParameters() + if err != nil { + return nil, errors.ES(op, errors.KClientArgs, "Parameter validation error: %s", err).SetNoRetry() + } + + opt.requestProperties.Parameters = params + } + return opt, nil +} + +var nower = time.Now + +func CalculateTimeout(ctx context.Context, opt *queryOptions, queryType int) { + // If the user has specified a timeout, use that. + if val, ok := opt.requestProperties.Options[NoRequestTimeoutValue]; ok && val.(bool) { + return + } + if _, ok := opt.requestProperties.Options[ServerTimeoutValue]; ok { + return + } + + // Otherwise use the context deadline, if it exists. If it doesn't, use the default timeout. + if deadline, ok := ctx.Deadline(); ok { + opt.requestProperties.Options[ServerTimeoutValue] = value.TimespanString(deadline.Sub(nower())) + return + } + + var timeout time.Duration + switch queryType { + case queryCall: + timeout = defaultQueryTimeout + case mgmtCall: + timeout = defaultMgmtTimeout + } + opt.requestProperties.Options[ServerTimeoutValue] = value.TimespanString(timeout) +} + +func (c *Client) getConn(callType callType, options connOptions) (queryer, error) { + switch callType { + case queryCall: + return c.conn, nil + case mgmtCall: + delete(options.queryOptions.requestProperties.Options, "results_progressive_enabled") + return c.conn, nil + default: + return nil, errors.ES(errors.OpServConn, errors.KInternal, "an unknown calltype was passed to getConn()") + } +} + +func contextSetup(ctx context.Context) (context.Context, context.CancelFunc) { + return context.WithCancel(ctx) +} + +func (c *Client) HttpClient() *http.Client { + return c.http +} + +func (c *Client) ClientDetails() *ClientDetails { + return c.clientDetails +} + +func (c *Client) Close() error { + var err error + if c.conn != nil { + err = c.conn.Close() + } + return err +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/column.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/column.go new file mode 100644 index 00000000000..146bdacb026 --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/column.go @@ -0,0 +1,15 @@ +package query + +import "github.com/Azure/azure-kusto-go/azkustodata/types" + +// Column represents a column in a table. +type Column interface { + // Ordinal returns the column's index in the table. + Index() int + // Name returns the column's name. + Name() string + // Type returns the column's kusto data type. + Type() types.Column +} + +type Columns []Column diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/column_impl.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/column_impl.go new file mode 100644 index 00000000000..fe2fefad130 --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/column_impl.go @@ -0,0 +1,32 @@ +package query + +import ( + "github.com/Azure/azure-kusto-go/azkustodata/types" +) + +// column is a basic implementation of Column, to be used by specific implementations. +type column struct { + index int + name string + kustoType types.Column +} + +func (c column) Index() int { + return c.index +} + +func (c column) Name() string { + return c.name +} + +func (c column) Type() types.Column { + return c.kustoType +} + +func NewColumn(ordinal int, name string, kustoType types.Column) Column { + return &column{ + index: ordinal, + name: name, + kustoType: kustoType, + } +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/dataset.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/dataset.go new file mode 100644 index 00000000000..b79fd8ee63b --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/dataset.go @@ -0,0 +1,29 @@ +package query + +import ( + "context" + "github.com/Azure/azure-kusto-go/azkustodata/errors" +) + +// BaseDataset represents a result from kusto - a set of tables with metadata +// This basic interface is implemented by all dataset types - both v1 and v2 +// for specific +type BaseDataset interface { + Context() context.Context + Op() errors.Op + + PrimaryResultKind() string +} + +type Dataset interface { + BaseDataset + Tables() []Table +} + +// IterativeDataset represents an iterative result from kusto - where the tables are streamed as they are received from the service. +type IterativeDataset interface { + BaseDataset + Tables() <-chan TableResult + ToDataset() (Dataset, error) + Close() error +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/dataset_impl.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/dataset_impl.go new file mode 100644 index 00000000000..7e87e504e53 --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/dataset_impl.go @@ -0,0 +1,49 @@ +package query + +import ( + "context" + "github.com/Azure/azure-kusto-go/azkustodata/errors" +) + +// baseDataset is a basic implementation of BaseDataset, to be used by specific implementations. +type baseDataset struct { + ctx context.Context + op errors.Op + primaryResultsKind string +} + +func (d *baseDataset) Context() context.Context { + return d.ctx +} + +func (d *baseDataset) Op() errors.Op { + return d.op +} + +func (d *baseDataset) PrimaryResultKind() string { + return d.primaryResultsKind +} + +func NewBaseDataset(ctx context.Context, op errors.Op, primaryResultsKind string) BaseDataset { + return &baseDataset{ + ctx: ctx, + op: op, + primaryResultsKind: primaryResultsKind, + } +} + +type dataset struct { + BaseDataset + tables []Table +} + +func NewDataset(base BaseDataset, tables []Table) Dataset { + return &dataset{ + BaseDataset: base, + tables: tables, + } +} + +func (d *dataset) Tables() []Table { + return d.tables +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/from_kusto.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/from_kusto.go new file mode 100644 index 00000000000..beaec3d9352 --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/from_kusto.go @@ -0,0 +1,74 @@ +package query + +import ( + kustoErrors "github.com/Azure/azure-kusto-go/azkustodata/errors" + "github.com/Azure/azure-kusto-go/azkustodata/value" + "reflect" + "strings" + "sync" +) + +type fieldMap struct { + colNameToFieldName map[string]string +} + +var typeMapper = map[reflect.Type]fieldMap{} +var typeMapperLock = sync.RWMutex{} + +// decodeToStruct takes a list of columns and a row to decode into "p" which will be a pointer +// to a struct (enforce in the decoder). +func decodeToStruct(cols []Column, row value.Values, p interface{}) error { + t := reflect.TypeOf(p) + v := reflect.ValueOf(p) + fields := newFields(t) + + for i, col := range cols { + if err := fields.convert(col, row[i], v); err != nil { + return err + } + } + return nil +} + +// newFields takes in the Columns from our row and the reflect.Type of our *struct. +func newFields(ptr reflect.Type) fieldMap { + typeMapperLock.RLock() + f, ok := typeMapper[ptr] + typeMapperLock.RUnlock() + if ok { + return f + } else { + typeMapperLock.Lock() + defer typeMapperLock.Unlock() + nFields := fieldMap{colNameToFieldName: make(map[string]string, ptr.Elem().NumField())} + for i := 0; i < ptr.Elem().NumField(); i++ { + field := ptr.Elem().Field(i) + if tag := field.Tag.Get("kusto"); strings.TrimSpace(tag) != "" { + nFields.colNameToFieldName[tag] = field.Name + } else { + nFields.colNameToFieldName[field.Name] = field.Name + } + } + typeMapper[ptr] = nFields + return nFields + } +} + +// convert converts a KustoValue that is for Column col into "v" reflect.Value with reflect.Type "t". +func (f fieldMap) convert(col Column, k value.Kusto, v reflect.Value) error { + fieldName, ok := f.colNameToFieldName[col.Name()] + if !ok { + return nil + } + + if fieldName == "-" { + return nil + } + + err := k.Convert(v.Elem().FieldByName(fieldName)) + if err != nil { + return kustoErrors.ES(kustoErrors.OpTableAccess, kustoErrors.KWrongColumnType, "column %s could not store in struct.%s: %s", col.Name(), fieldName, err.Error()) + } + + return nil +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/row.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/row.go new file mode 100644 index 00000000000..3ade08dea0e --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/row.go @@ -0,0 +1,58 @@ +package query + +import ( + "github.com/Azure/azure-kusto-go/azkustodata/value" + "github.com/google/uuid" + "github.com/shopspring/decimal" + "time" +) + +// Row is an interface that represents a row in a table. +// It provides methods to access and manipulate the data in the row. +type Row interface { + // Index returns the index of the row. + Index() int + + // Columns returns the columns of the table that the row belongs to. + Columns() Columns + + // Values returns all the values in the row. + Values() value.Values + + // Value returns the value at the specified index. + Value(i int) (value.Kusto, error) + + ValueByColumn(c Column) (value.Kusto, error) + + // ValueByName returns the value with the specified column name. + ValueByName(name string) (value.Kusto, error) + + // ToStruct converts the row into a struct and assigns it to the provided pointer. + // It returns an error if the conversion fails. + ToStruct(p interface{}) error + + // String returns a string representation of the row. + String() string + + BoolByIndex(i int) (*bool, error) + IntByIndex(i int) (*int32, error) + LongByIndex(i int) (*int64, error) + RealByIndex(i int) (*float64, error) + DecimalByIndex(i int) (*decimal.Decimal, error) + StringByIndex(i int) (string, error) + DynamicByIndex(i int) ([]byte, error) + DateTimeByIndex(i int) (*time.Time, error) + TimespanByIndex(i int) (*time.Duration, error) + GuidByIndex(i int) (*uuid.UUID, error) + + BoolByName(name string) (*bool, error) + IntByName(name string) (*int32, error) + LongByName(name string) (*int64, error) + RealByName(name string) (*float64, error) + DecimalByName(name string) (*decimal.Decimal, error) + StringByName(name string) (string, error) + DynamicByName(name string) ([]byte, error) + DateTimeByName(name string) (*time.Time, error) + TimespanByName(name string) (*time.Duration, error) + GuidByName(name string) (*uuid.UUID, error) +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/row_impl.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/row_impl.go new file mode 100644 index 00000000000..b06d5606ba5 --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/row_impl.go @@ -0,0 +1,297 @@ +package query + +import ( + "encoding/csv" + "github.com/Azure/azure-kusto-go/azkustodata/errors" + "github.com/Azure/azure-kusto-go/azkustodata/types" + "github.com/Azure/azure-kusto-go/azkustodata/value" + "github.com/google/uuid" + "github.com/shopspring/decimal" + "reflect" + "strings" + "time" +) + +type row struct { + columns Columns + columnByName func(string) Column + values value.Values + ordinal int +} + +func NewRow(t BaseTable, ordinal int, values value.Values) Row { + return NewRowFromParts(t.Columns(), t.ColumnByName, ordinal, values) +} + +func NewRowFromParts(c Columns, columnByName func(string) Column, ordinal int, values value.Values) Row { + return &row{ + columns: c, + columnByName: columnByName, + ordinal: ordinal, + values: values, + } +} + +func (r *row) Columns() Columns { + return r.columns +} + +func (r *row) Index() int { + return r.ordinal +} + +func (r *row) Values() value.Values { + return r.values +} + +func (r *row) Value(i int) (value.Kusto, error) { + if i < 0 || i >= len(r.values) { + return nil, errors.ES(errors.OpTableAccess, errors.KClientArgs, "index %d out of range", i) + } + + return r.values[i], nil +} + +func (r *row) ValueByColumn(c Column) (value.Kusto, error) { + return r.Value(c.Index()) +} + +func (r *row) ValueByName(name string) (value.Kusto, error) { + col := r.columnByName(name) + if col == nil { + return nil, columnNotFoundError(name) + } + return r.Value(col.Index()) +} + +// ToStruct fetches the columns in a row into the fields of a struct. p must be a pointer to struct. +// The rules for mapping a row's columns into a struct's exported fields are: +// +// 1. If a field has a `kusto: "column_name"` tag, then decode column +// 'column_name' into the field. A special case is the `column_name: "-"` +// tag, which instructs ToStruct to ignore the field during decoding. +// +// 2. Otherwise, if the name of a field matches the name of a column (ignoring case), +// decode the column into the field. +// +// Slice and pointer fields will be set to nil if the source column is a null value, and a +// non-nil value if the column is not NULL. To decode NULL values of other types, use +// one of the kusto types (Int, Long, Dynamic, ...) as the type of the destination field. +// You can check the .Valid field of those types to see if the value was set. +func (r *row) ToStruct(p interface{}) error { + // Check if p is a pointer to a struct + if t := reflect.TypeOf(p); t == nil || t.Kind() != reflect.Ptr || t.Elem().Kind() != reflect.Struct { + return errors.ES(errors.OpTableAccess, errors.KClientArgs, "type %T is not a pointer to a struct", p) + } + if len(r.Columns()) != len(r.Values()) { + return errors.ES(errors.OpTableAccess, errors.KClientArgs, "row does not have the correct number of values(%d) for the number of columns(%d)", len(r.Values()), len(r.Columns())) + } + + return decodeToStruct(r.Columns(), r.Values(), p) +} + +// String implements fmt.Stringer for a Row. This simply outputs a CSV version of the row. +func (r *row) String() string { + var line []string + for _, v := range r.Values() { + line = append(line, v.String()) + } + b := &strings.Builder{} + w := csv.NewWriter(b) + err := w.Write(line) + if err != nil { + return "" + } + w.Flush() + return b.String() +} + +func conversionError(from string, to string) error { + return errors.ES(errors.OpTableAccess, errors.KOther, "cannot convert %s to %s", from, to) +} + +func columnNotFoundError(name string) error { + return errors.ES(errors.OpTableAccess, errors.KOther, "column %s not found", name) +} + +// contains all types *bool, etc +type kustoTypeGeneric interface { + *bool | *int32 | *int64 | *float64 | *decimal.Decimal | string | interface{} | *time.Time | *time.Duration +} + +func byIndex[T kustoTypeGeneric](r *row, colType types.Column, i int, defaultValue T) (T, error) { + val, err := r.Value(i) + if err != nil { + return defaultValue, err + } + if val.GetType() != colType { + return defaultValue, conversionError(string(val.GetType()), string(colType)) + } + + return val.GetValue().(T), nil +} + +func byName[T kustoTypeGeneric](r *row, colType types.Column, name string, defaultValue T) (T, error) { + col := r.columnByName(name) + if col == nil { + return defaultValue, columnNotFoundError(name) + } + return byIndex(r, colType, col.Index(), defaultValue) +} + +func (r *row) BoolByIndex(i int) (*bool, error) { + return byIndex(r, types.Bool, i, (*bool)(nil)) +} + +func (r *row) IntByIndex(i int) (*int32, error) { + return byIndex(r, types.Int, i, (*int32)(nil)) +} + +func (r *row) LongByIndex(i int) (*int64, error) { + return byIndex(r, types.Long, i, (*int64)(nil)) +} + +func (r *row) RealByIndex(i int) (*float64, error) { + return byIndex(r, types.Real, i, (*float64)(nil)) +} + +func (r *row) DecimalByIndex(i int) (*decimal.Decimal, error) { + return byIndex(r, types.Decimal, i, (*decimal.Decimal)(nil)) +} + +func (r *row) StringByIndex(i int) (string, error) { + return byIndex(r, types.String, i, "") +} + +func (r *row) DynamicByIndex(i int) ([]byte, error) { + return byIndex[[]byte](r, types.Dynamic, i, nil) +} + +func (r *row) DateTimeByIndex(i int) (*time.Time, error) { + return byIndex(r, types.DateTime, i, (*time.Time)(nil)) +} + +func (r *row) TimespanByIndex(i int) (*time.Duration, error) { + return byIndex(r, types.Timespan, i, (*time.Duration)(nil)) +} + +func (r *row) GuidByIndex(i int) (*uuid.UUID, error) { + return byIndex(r, types.GUID, i, (*uuid.UUID)(nil)) +} + +func (r *row) BoolByName(name string) (*bool, error) { + return byName(r, types.Bool, name, (*bool)(nil)) +} + +func (r *row) IntByName(name string) (*int32, error) { + return byName(r, types.Int, name, (*int32)(nil)) +} + +func (r *row) LongByName(name string) (*int64, error) { + return byName(r, types.Long, name, (*int64)(nil)) +} + +func (r *row) RealByName(name string) (*float64, error) { + return byName(r, types.Real, name, (*float64)(nil)) +} + +func (r *row) DecimalByName(name string) (*decimal.Decimal, error) { + return byName(r, types.Decimal, name, (*decimal.Decimal)(nil)) +} + +func (r *row) StringByName(name string) (string, error) { + return byName(r, types.String, name, "") +} + +func (r *row) DynamicByName(name string) ([]byte, error) { + return byName[[]byte](r, types.Dynamic, name, nil) +} + +func (r *row) DateTimeByName(name string) (*time.Time, error) { + return byName(r, types.DateTime, name, (*time.Time)(nil)) +} + +func (r *row) TimespanByName(name string) (*time.Duration, error) { + return byName(r, types.Timespan, name, (*time.Duration)(nil)) +} + +func (r *row) GuidByName(name string) (*uuid.UUID, error) { + return byName(r, types.GUID, name, (*uuid.UUID)(nil)) +} + +// ToStructs converts a table, a non-iterative dataset or a slice of rows into a slice of structs. +// If a dataset is provided, it should contain exactly one table. +func ToStructs[T any](data interface{}) ([]T, error) { + var rows []Row + var errs error + + switch v := data.(type) { + case Table: + rows = v.Rows() + case IterativeTable: + full, err := v.ToTable() + if err != nil { + return nil, err + } + rows = full.Rows() + case []Row: + rows = v + case Row: + rows = []Row{v} + case Dataset: + tables := v.Tables() + if len(tables) == 0 { + return nil, errors.ES(errors.OpUnknown, errors.KInternal, "dataset does not contain any tables") + } + if !tables[0].IsPrimaryResult() { + return nil, errors.ES(errors.OpUnknown, errors.KInternal, "dataset contains no primary results") + } + rows = tables[0].Rows() + default: + return nil, errors.ES(errors.OpUnknown, errors.KInternal, "invalid data type - expected Dataset, Table, BaseTable or []Row") + } + + if rows == nil || len(rows) == 0 { + return nil, errs + } + + out := make([]T, len(rows)) + for i, r := range rows { + if err := r.ToStruct(&out[i]); err != nil { + out = out[:i] + if len(out) == 0 { + out = nil + } + return out, err + } + } + + return out, errs +} + +type StructResult[T any] struct { + Out T + Err error +} + +func ToStructsIterative[T any](tb IterativeTable) chan StructResult[T] { + out := make(chan StructResult[T]) + + go func() { + defer close(out) + for rowResult := range tb.Rows() { + if rowResult.Err() != nil { + out <- StructResult[T]{Err: rowResult.Err()} + } else { + var s T + if err := rowResult.Row().ToStruct(&s); err != nil { + out <- StructResult[T]{Err: err} + } else { + out <- StructResult[T]{Out: s} + } + } + } + }() + + return out +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/row_result.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/row_result.go new file mode 100644 index 00000000000..ec72dc33bab --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/row_result.go @@ -0,0 +1,33 @@ +package query + +type rowResult struct { + row Row + err error +} + +func (r rowResult) Row() Row { + return r.row +} + +func (r rowResult) Err() error { + return r.err +} + +func RowResultSuccess(row Row) RowResult { + return rowResult{ + row: row, + } +} + +func RowResultError(err error) RowResult { + return rowResult{ + err: err, + } +} + +// RowResult is a single streamed row from a table. +// It can contain either a row or an error. +type RowResult interface { + Row() Row + Err() error +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/table.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/table.go new file mode 100644 index 00000000000..664661493de --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/table.go @@ -0,0 +1,27 @@ +package query + +import "github.com/Azure/azure-kusto-go/azkustodata/errors" + +type BaseTable interface { + Id() string + Index() int64 + Name() string + Columns() []Column + Kind() string + ColumnByName(name string) Column + Op() errors.Op + IsPrimaryResult() bool +} + +type Table interface { + BaseTable + Rows() []Row +} + +// IterativeTable is a table that returns rows one at a time. +type IterativeTable interface { + BaseTable + // Rows returns a channel that will be populated with rows as they are read. + Rows() <-chan RowResult + ToTable() (Table, error) +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/table_impl.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/table_impl.go new file mode 100644 index 00000000000..306679b6388 --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/table_impl.go @@ -0,0 +1,87 @@ +package query + +import ( + "github.com/Azure/azure-kusto-go/azkustodata/errors" +) + +type baseTable struct { + dataSet BaseDataset + index int64 + id string + name string + kind string + columns []Column + columnsByName map[string]Column +} + +func NewBaseTable(ds BaseDataset, index int64, id string, name string, kind string, columns []Column) BaseTable { + b := &baseTable{ + dataSet: ds, + index: index, + id: id, + name: name, + kind: kind, + columns: columns, + } + b.columnsByName = make(map[string]Column) + for _, c := range columns { + b.columnsByName[c.Name()] = c + } + + return b +} + +func (t *baseTable) Id() string { + return t.id +} + +func (t *baseTable) Index() int64 { + return t.index +} + +func (t *baseTable) Name() string { + return t.name +} + +func (t *baseTable) Columns() []Column { + return t.columns +} + +func (t *baseTable) Kind() string { + return t.kind +} + +func (t *baseTable) ColumnByName(name string) Column { + if c, ok := t.columnsByName[name]; ok { + return c + } + return nil +} + +func (t *baseTable) IsPrimaryResult() bool { + return t.Kind() == t.dataSet.PrimaryResultKind() +} + +func (t *baseTable) Op() errors.Op { + set := t.dataSet + if set == nil { + return errors.OpUnknown + } + return set.Op() +} + +type table struct { + BaseTable + rows []Row +} + +func NewTable(base BaseTable, rows []Row) Table { + return &table{ + BaseTable: base, + rows: rows, + } +} + +func (t *table) Rows() []Row { + return t.rows +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/table_result.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/table_result.go new file mode 100644 index 00000000000..e9569be745b --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/table_result.go @@ -0,0 +1,37 @@ +package query + +type TableResult interface { + Table() IterativeTable + Err() error +} + +// TableResult is a structure that holds the result of a table operation. +// It contains a Table and an error, if any occurred during the operation. +type tableResult struct { + // Table is the result of the operation. + table IterativeTable + // Err is the error that occurred during the operation, if any. + err error +} + +// Table returns the table that was the result of the operation. +func (t *tableResult) Table() IterativeTable { + return t.table +} + +// Err returns the error that occurred during the operation, if any. +func (t *tableResult) Err() error { + return t.err +} + +func TableResultSuccess(table IterativeTable) TableResult { + return &tableResult{ + table: table, + } +} + +func TableResultError(err error) TableResult { + return &tableResult{ + err: err, + } +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v1/dataset.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v1/dataset.go new file mode 100644 index 00000000000..8fcbb38c20d --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v1/dataset.go @@ -0,0 +1,169 @@ +package v1 + +import ( + "context" + "github.com/Azure/azure-kusto-go/azkustodata/errors" + "github.com/Azure/azure-kusto-go/azkustodata/query" + "github.com/google/uuid" + "io" + "time" +) + +type TableIndexRow struct { + Ordinal int64 + Kind string + Name string + Id string + PrettyName string +} + +const PrimaryResultKind = "QueryResult" + +var primaryResultIndexRow = &TableIndexRow{ + Ordinal: 0, + Kind: "QueryResult", + Name: PrimaryResultKind, + Id: "00000000-0000-0000-0000-000000000000", + PrettyName: "", +} + +type QueryStatus struct { + Timestamp time.Time + Severity int32 + SeverityName string + StatusCode int32 + StatusDescription string + Count int32 + RequestId uuid.UUID + ActivityId uuid.UUID + SubActivityId uuid.UUID + ClientActivityId string +} + +type QueryProperties struct { + Value string +} + +type dataset struct { + query.BaseDataset + results []query.Table + index []TableIndexRow + status []QueryStatus + info []QueryProperties +} + +func NewDatasetFromReader(ctx context.Context, op errors.Op, reader io.ReadCloser) (Dataset, error) { + defer reader.Close() + v1, err := decodeV1(reader) + if err != nil { + return nil, err + } + + return NewDataset(ctx, op, *v1) +} + +func NewDataset(ctx context.Context, op errors.Op, v1 V1) (Dataset, error) { + d := &dataset{ + BaseDataset: query.NewBaseDataset(ctx, op, PrimaryResultKind), + } + + if len(v1.Tables) == 0 { + return nil, errors.ES(d.Op(), errors.KInternal, "kusto query failed: no tables returned") + } + + // Special case - if there is only one table, it is the primary result + if len(v1.Tables) == 1 { + if v1.Exceptions != nil { + return nil, errors.ES(d.Op(), errors.KInternal, "exceptions: %v", v1.Exceptions) + } + + table, err := NewTable(d, &v1.Tables[0], primaryResultIndexRow) + if err != nil { + return nil, err + } + + d.results = append(d.results, table) + + return d, err + } + + // index is always the last table + lastTable := &v1.Tables[len(v1.Tables)-1] + + index, err := parseTable[TableIndexRow](lastTable, d, nil) + if err != nil { + return nil, err + } + + d.index = index + + for i, r := range index { + if r.Kind == "QueryStatus" { + queryStatus, err := parseTable[QueryStatus](&v1.Tables[i], d, &r) + if err != nil { + return nil, err + } + d.status = queryStatus + } else if r.Kind == "QueryProperties" { + queryInfo, err := parseTable[QueryProperties](&v1.Tables[i], d, &r) + if err != nil { + return nil, err + } + d.info = queryInfo + } else if r.Kind == "QueryResult" { + table, err := NewTable(d, &v1.Tables[i], &r) + if err != nil { + return nil, err + } + + d.results = append(d.results, table) + } + } + + err = nil + + if v1.Exceptions != nil { + err = errors.ES(d.Op(), errors.KInternal, "exceptions: %v", v1.Exceptions) + } + + return d, err +} + +func parseTable[T any](rawTable *RawTable, d *dataset, index *TableIndexRow) ([]T, error) { + table, err := NewTable(d, rawTable, index) + if err != nil { + return nil, err + } + + indexRows := table.Rows() + + rows, err := query.ToStructs[T](indexRows) + if err != nil { + return nil, err + } + + return rows, nil +} + +func (d *dataset) Tables() []query.Table { + return d.results +} + +func (d *dataset) Index() []TableIndexRow { + return d.index +} + +func (d *dataset) Status() []QueryStatus { + return d.status +} + +func (d *dataset) Info() []QueryProperties { + return d.info +} + +type Dataset interface { + query.Dataset + Index() []TableIndexRow + Status() []QueryStatus + Info() []QueryProperties +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v1/decode.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v1/decode.go new file mode 100644 index 00000000000..3951a1a83ca --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v1/decode.go @@ -0,0 +1,94 @@ +package v1 + +import ( + "bufio" + "bytes" + "encoding/json" + "github.com/Azure/azure-kusto-go/azkustodata/errors" + "io" +) + +type RawRow struct { + Row []interface{} + Errors []string +} + +func newDecoder(r io.Reader) *json.Decoder { + dec := json.NewDecoder(r) + // This option uses the json.Number type for all numbers, instead of float64. + // This allows us to parse numbers that are too large for a float64, like uint64 or decimal. + dec.UseNumber() + return dec +} + +// UnmarshalJSON implements the json.Unmarshaler interface, to decode a RawRow from JSON. +// It needs special handling, because the field may be a Row or a list of Errors. +func (r *RawRow) UnmarshalJSON(data []byte) error { + var row []interface{} + var errs struct { + Errors []string `json:"Exceptions"` + } + + var err error + + reader := bytes.NewReader(data) + dec := newDecoder(reader) + + if err = dec.Decode(&row); err != nil { + _, err := reader.Seek(0, io.SeekStart) + if err != nil { + return err + } + + if err = dec.Decode(&errs); err != nil { + return err + } + r.Errors = errs.Errors + r.Row = nil + return nil + } + r.Row = row + r.Errors = nil + return nil +} + +type RawColumn struct { + ColumnName string `json:"ColumnName"` + DataType string `json:"DataType"` + ColumnType string `json:"ColumnType"` +} + +type RawTable struct { + TableName string `json:"TableName"` + Columns []RawColumn `json:"Columns"` + Rows []RawRow `json:"Rows"` +} + +type V1 struct { + Tables []RawTable `json:"Tables"` + Exceptions []string `json:"Exceptions"` +} + +func decodeV1(data io.ReadCloser) (*V1, error) { + var v1 V1 + br := bufio.NewReader(data) + peek, err := br.Peek(1) + if err != nil { + return nil, err + } + if peek[0] != '{' { + all, err := io.ReadAll(br) + if err != nil { + return nil, err + } + return nil, errors.ES(errors.OpUnknown, errors.KInternal, "Got error: %v", string(all)) + } + + dec := newDecoder(br) + err = dec.Decode(&v1) + if err != nil { + return nil, err + } + + return &v1, nil +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v1/table.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v1/table.go new file mode 100644 index 00000000000..38a32d6bf82 --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v1/table.go @@ -0,0 +1,77 @@ +package v1 + +import ( + "github.com/Azure/azure-kusto-go/azkustodata/errors" + "github.com/Azure/azure-kusto-go/azkustodata/query" + "github.com/Azure/azure-kusto-go/azkustodata/types" + "github.com/Azure/azure-kusto-go/azkustodata/value" + "strings" +) + +func NewTable(d query.BaseDataset, dt *RawTable, index *TableIndexRow) (query.Table, error) { + var id string + var kind string + var name string + var ordinal int64 + + if index != nil { + id = index.Id + kind = index.Kind + name = index.Name + ordinal = index.Ordinal + } else { + // this case exists for the index table itself + id = "" + kind = "" + name = dt.TableName + ordinal = 0 + } + + op := d.Op() + + columns := make([]query.Column, len(dt.Columns)) + + for i, c := range dt.Columns { + // ColumnType should always be available, but in rare cases there are still commands that don't provide it. + if c.ColumnType == "" { + c.ColumnType = strings.ToLower(c.DataType) + } + normal := types.NormalizeColumn(c.ColumnType) + if normal == "" { + return nil, errors.ES(op, errors.KClientArgs, "column[%d] is of type %q, which is not valid", i, c.ColumnType) + } + + columns[i] = query.NewColumn(i, c.ColumnName, normal) + } + + baseTable := query.NewBaseTable(d, ordinal, id, name, kind, columns) + + rows := make([]query.Row, 0, len(dt.Rows)) + + for i, r := range dt.Rows { + if r.Errors != nil && len(r.Errors) > 0 { + for _, e := range r.Errors { + err := errors.ES(op, errors.KInternal, "row %d has an error: %s", i, e) + return nil, err + } + } + + if r.Row == nil { + continue + } + + values := make(value.Values, len(r.Row)) + for j, v := range r.Row { + parsed := value.Default(columns[j].Type()) + if v != nil { + err := parsed.Unmarshal(v) + if err != nil { + return nil, errors.ES(op, errors.KInternal, "unable to unmarshal column %s into a %s value: %s", columns[j].Name(), columns[j].Type(), err) + } + } + values[j] = parsed + } + rows = append(rows, query.NewRowFromParts(baseTable.Columns(), baseTable.ColumnByName, i, values)) + } + return query.NewTable(baseTable, rows), nil +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/error_frames.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/error_frames.go new file mode 100644 index 00000000000..8b6a44501fc --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/error_frames.go @@ -0,0 +1,47 @@ +package v2 + +import "fmt" + +type OneApiError struct { + ErrorMessage ErrorMessage `json:"error"` +} + +func (e *OneApiError) Error() string { + return e.String() +} + +type ErrorMessage struct { + Code string `json:"code"` + Message string `json:"message"` + Description string `json:"@message"` + Type string `json:"@type"` + Context ErrorContext `json:"@context"` + IsPermanent bool `json:"@permanent"` +} + +type ErrorContext struct { + Timestamp string `json:"timestamp"` + ServiceAlias string `json:"serviceAlias"` + MachineName string `json:"machineName"` + ProcessName string `json:"processName"` + ProcessId int `json:"processId"` + ThreadId int `json:"threadId"` + ClientRequestId string `json:"clientRequestId"` + ActivityId string `json:"activityId"` + SubActivityId string `json:"subActivityId"` + ActivityType string `json:"activityType"` + ParentActivityId string `json:"parentActivityId"` + ActivityStack string `json:"activityStack"` +} + +func (e *OneApiError) String() string { + return fmt.Sprintf("OneApiError(Error=%#v)", e.ErrorMessage) +} + +func (e *ErrorMessage) String() string { + return fmt.Sprintf("ErrorMessage(Code=%s, Message=%s, Type=%s, ErrorContext=%v, IsPermanent=%t)", e.Code, e.Message, e.Type, e.Context, e.IsPermanent) +} + +func (e *ErrorContext) String() string { + return fmt.Sprintf("ErrorContext(Timestamp=%s, ServiceAlias=%s, MachineName=%s, ProcessName=%s, ProcessId=%d, ThreadId=%d, ClientRequestId=%s, ActivityId=%s, SubActivityId=%s, ActivityType=%s, ParentActivityId=%s, ActivityStack=%s)", e.Timestamp, e.ServiceAlias, e.MachineName, e.ProcessName, e.ProcessId, e.ThreadId, e.ClientRequestId, e.ActivityId, e.SubActivityId, e.ActivityType, e.ParentActivityId, e.ActivityStack) +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/fast_json.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/fast_json.go new file mode 100644 index 00000000000..5e4e50ee9f8 --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/fast_json.go @@ -0,0 +1,320 @@ +package v2 + +import ( + "bytes" + "encoding/json" + "github.com/Azure/azure-kusto-go/azkustodata/errors" + "github.com/Azure/azure-kusto-go/azkustodata/query" + "github.com/Azure/azure-kusto-go/azkustodata/types" + "github.com/Azure/azure-kusto-go/azkustodata/value" + "io" +) + +func newDecoder(r io.Reader) *json.Decoder { + dec := json.NewDecoder(r) + // This option uses the json.Number type for all numbers, instead of float64. + // This allows us to parse numbers that are too large for a float64, like uint64 or decimal. + dec.UseNumber() + return dec +} + +// UnmarshalJSON implements the json.Unmarshaler interface for TableFragment. +// See decodeTableFragment for further explanation. +func (t *TableFragment) UnmarshalJSON(b []byte) error { + decoder := newDecoder(bytes.NewReader(b)) + + rows, err := decodeTableFragment(b, decoder, t.Columns, t.PreviousIndex) + if err != nil { + return err + } + t.Rows = rows + + return nil +} + +// UnmarshalJSON implements the json.Unmarshaler interface for DataTable. +// A DataTable is "just" a TableHeader and TableFragment, so we can reuse the existing functions. +func (q *DataTable) UnmarshalJSON(b []byte) error { + decoder := newDecoder(bytes.NewReader(b)) + + err := decodeHeader(decoder, &q.Header, DataTableFrameType) + if err != nil { + return err + } + + rows, err := decodeTableFragment(b, decoder, q.Header.Columns, 0) + if err != nil { + return err + } + q.Rows = rows + + return nil +} + +// UnmarshalJSON implements the json.Unmarshaler interface for DataSetHeader. +// We need to decode this manually to set the correct Columns, in order to save on allocations later on. +func (t *TableHeader) UnmarshalJSON(b []byte) error { + decoder := newDecoder(bytes.NewReader(b)) + + err := decodeHeader(decoder, t, TableHeaderFrameType) + if err != nil { + return err + } + + return nil +} + +// decodeHeader decodes the header of a table, which is the same for TableHeader and DataTable. +// It assumes the order of the properties in the JSON is fixed. +func decodeHeader(decoder *json.Decoder, t *TableHeader, frameType FrameType) error { + err := assertToken(decoder, json.Delim('{')) + if err != nil { + return err + } + + err = assertStringProperty(decoder, "FrameType", string(frameType)) + if err != nil { + return err + } + + t.TableId, err = getIntProperty(decoder, "TableId") + if err != nil { + return err + } + + t.TableKind, err = getStringProperty(decoder, "TableKind") + if err != nil { + return err + } + + t.TableName, err = getStringProperty(decoder, "TableName") + if err != nil { + return err + } + + err = assertToken(decoder, json.Token("Columns")) + if err != nil { + return err + } + + t.Columns, err = decodeColumns(decoder) + if err != nil { + return err + } + return nil +} + +// decodeTableFragment decodes the common part of a TableFragment and DataTable - the rows. +func decodeTableFragment(b []byte, decoder *json.Decoder, columns []query.Column, previousIndex int) ([]query.Row, error) { + + // skip properties until we reach the Rows property (guaranteed to be the last one) + for { + tok, err := decoder.Token() + if err != nil { + return nil, err + } + if tok == json.Token("Rows") { + break + } + } + + rows, err := decodeRows(b, decoder, columns, previousIndex) + if err != nil { + return nil, err + } + + return rows, nil +} + +// decodeColumns decodes the columns of a table from the JSON. +// Columns is an array of the form [ { "ColumnName": "name", "ColumnType": "type" }, ... ] +// 1. We need to set the ColumnIndex, which is not present in the JSON +// 2. We need to normalize the column type - in rare cases, kusto has type aliases like "date" instead of "datetime", and we need to normalize them +// 3. We need to validate the column type - if it's not a valid type, we should return an error +func decodeColumns(decoder *json.Decoder) ([]query.Column, error) { + cols := make([]query.Column, 0) + + err := assertToken(decoder, json.Delim('[')) + if err != nil { + return nil, err + } + + for i := 0; decoder.More(); i++ { + col := FrameColumn{ + ColumnIndex: i, + } + decoder.Decode(&col) + // Normalize the column type - error is an empty string + col.ColumnType = string(types.NormalizeColumn(col.ColumnType)) + if col.ColumnType == "" { + return nil, errors.ES(errors.OpTableAccess, errors.KClientArgs, "column[%d] is of type %s, which is not valid", i, col.ColumnType) + } + cols = append(cols, col) + } + + if err := assertToken(decoder, json.Delim(']')); err != nil { + return nil, err + } + + return cols, nil +} + +// decodeRows decodes the rows of a table from the JSON. +// Rows is an array of the form [ [value1, value2, ...], ... ] +// In V2 Fragmented, it's guaranteed that no errors will appear in the middle of the array, only at the end of the table. +// This function: +// 1. Creates a cached map of column names to columns for faster lookup +// 2. Decodes the rows into a slice of query.Rows +func decodeRows(b []byte, decoder *json.Decoder, cols []query.Column, startIndex int) ([]query.Row, error) { + const RowArrayAllocSize = 10 + var rows = make([]query.Row, 0, RowArrayAllocSize) + + columnsByName := make(map[string]query.Column, len(cols)) + for _, c := range cols { + columnsByName[c.Name()] = c + } + + err := assertToken(decoder, json.Delim('[')) + if err != nil { + return nil, err + } + + for i := startIndex; decoder.More(); i++ { + rowValues, err := decodeRow(b, decoder, cols) + if err != nil { + return nil, err + } + + row := query.NewRowFromParts(cols, func(name string) query.Column { return columnsByName[name] }, i, rowValues) + rows = append(rows, row) + } + + if err := assertToken(decoder, json.Delim(']')); err != nil { + return nil, err + } + return rows, nil +} + +// decodeRow decodes a single row from the JSON. +// A row is an array of values of the types from kusto, as indicated by the columns. +// For dynamic values, they can appear as nested arrays or objects, so we need to handle them. +// Otherwise, we just unmarshal the value into the correct type. +func decodeRow( + buffer []byte, + decoder *json.Decoder, + cols []query.Column) (value.Values, error) { + + err := assertToken(decoder, json.Delim('[')) + if err != nil { + return nil, err + } + + values := make([]value.Kusto, 0, len(cols)) + + field := 0 + + for ; decoder.More(); field++ { + t, err := decoder.Token() + if err != nil { + return nil, err + } + + // Handle nested values + if t == json.Delim('[') || t == json.Delim('{') { + t, err = decodeNestedValue(decoder, buffer) + if err != nil { + return nil, err + } + } + + // Create a new value of the correct type + kustoValue := value.Default(cols[field].Type()) + + // Unmarshal the value + err = kustoValue.Unmarshal(t) + if err != nil { + return nil, err + } + + values = append(values, kustoValue) + } + + err = assertToken(decoder, json.Delim(']')) + if err != nil { + return nil, err + } + + return values, nil +} + +// decodeNestedValue decodes a nested value from the JSON into a byte array inside a json.Token. +// How it works: +// 1. We need the original buffer to be able to extract the nested value from the offsets. +// 2. We get the starting offset of the nested value. +// 3. We get the next tokens, we ignore all of them unless they start a new nested value. +// 4. If we find a nested value, we increase the nesting level, and decrease it when we find the closing token. +// 5. At the end, we're guaranteed to be at the end of original the nested value. +// 6. We get the final offset of the nested value. +// 7. We return a json.Token that points to the entire byte range of the nested value. +func decodeNestedValue(decoder *json.Decoder, buffer []byte) (json.Token, error) { + nest := 1 + initialOffset := decoder.InputOffset() - 1 + for { + for decoder.More() { + t, err := decoder.Token() + if err != nil { + return nil, err + } + if t == json.Delim('[') || t == json.Delim('{') { + nest++ + } + } + t, err := decoder.Token() + if err != nil { + return nil, err + } + if t == json.Delim(']') || t == json.Delim('}') { + nest-- + } + if nest == 0 { + break + } + } + finalOffset := decoder.InputOffset() + + return json.Token(buffer[initialOffset:finalOffset]), nil +} + +// validateDataSetHeader makes sure the dataset header is valid for V2 Fragmented Query. +func validateDataSetHeader(dec *json.Decoder) error { + const HeaderVersion = "v2.0" + const NotProgressive = false + const IsFragmented = true + const ErrorReportingEndOfTable = "EndOfTable" + + if err := assertToken(dec, json.Delim('{')); err != nil { + return err + } + + if err := assertStringProperty(dec, "FrameType", json.Token(string(DataSetHeaderFrameType))); err != nil { + return err + } + + if err := assertStringProperty(dec, "IsProgressive", json.Token(NotProgressive)); err != nil { + return err + } + + if err := assertStringProperty(dec, "Version", json.Token(HeaderVersion)); err != nil { + return err + } + + if err := assertStringProperty(dec, "IsFragmented", json.Token(IsFragmented)); err != nil { + return err + } + + if err := assertStringProperty(dec, "ErrorReportingPlacement", json.Token(ErrorReportingEndOfTable)); err != nil { + return err + } + + return nil +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/fast_json_utils.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/fast_json_utils.go new file mode 100644 index 00000000000..5f056b8e2f0 --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/fast_json_utils.go @@ -0,0 +1,63 @@ +package v2 + +import ( + "encoding/json" + "github.com/Azure/azure-kusto-go/azkustodata/errors" +) + +// assertToken asserts that the next token in the decoder is the expected token. +func assertToken(dec *json.Decoder, expected json.Token) error { + t, err := dec.Token() + if err != nil { + return err + } + if t != expected { + return errors.ES(errors.OpUnknown, errors.KInternal, "Expected %v, got %v", expected, t) + } + return nil +} + +// assertStringProperty asserts that the next token in the decoder is a string property with the expected name and value. +func assertStringProperty(dec *json.Decoder, name string, value json.Token) error { + if err := assertToken(dec, json.Token(name)); err != nil { + return err + } + if err := assertToken(dec, value); err != nil { + return err + } + return nil +} + +// getStringProperty reads a string property from the decoder, validating the name and returning the value. +func getStringProperty(dec *json.Decoder, name string) (string, error) { + if err := assertToken(dec, json.Token(name)); err != nil { + return "", err + } + t, err := dec.Token() + if err != nil { + return "", err + } + if s, ok := t.(string); ok { + return s, nil + } + return "", errors.ES(errors.OpUnknown, errors.KInternal, "Expected string, got %v", t) +} + +// getIntProperty reads an int property from the decoder, validating the name and returning the value. +func getIntProperty(dec *json.Decoder, name string) (int, error) { + if err := assertToken(dec, json.Token(name)); err != nil { + return 0, err + } + t, err := dec.Token() + if err != nil { + return 0, err + } + if s, ok := t.(json.Number); ok { + i, err := s.Int64() + if err != nil { + return 0, err + } + return int(i), nil + } + return 0, errors.ES(errors.OpUnknown, errors.KInternal, "Expected string, got %v", t) +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/frame_reader.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/frame_reader.go new file mode 100644 index 00000000000..2a84f34913c --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/frame_reader.go @@ -0,0 +1,98 @@ +package v2 + +import ( + "bufio" + "context" + "github.com/Azure/azure-kusto-go/azkustodata/errors" + "io" +) + +// frameReader reads frame-by-frame from a Kusto response. +// It is specifically designed for the FragmentedV2 protocol: +// 1. The response is a JSON array of frames, but separated by newlines. +// 2. We convert it into a proper JsonLines format by stripping the first byte of each line. +// 3. We then read each line as a separate frame. +// 4. When we reach the end of the array, it means we have reached the end of the response, and we return io.EOF. +// 5. For every line we read, we check if the context has been cancelled, and if so, return the error. +type frameReader struct { + orig io.ReadCloser + reader bufio.Reader + ctx context.Context +} + +func newFrameReader(r io.ReadCloser, ctx context.Context) (*frameReader, error) { + br := bufio.NewReader(r) + + err := validateJsonResponse(br) + if err != nil { + return nil, err + } + + return &frameReader{orig: r, reader: *br, ctx: ctx}, nil +} + +// validateJsonResponse reads the first byte of the response to determine if it is in fact valid JSON. +// Kusto may return an error message that is not JSON, and instead will just be a plain string with an error message. +// If the first byte is not '[', then we assume it is an error message and return an error. +func validateJsonResponse(br *bufio.Reader) error { + first, err := br.Peek(1) + if err != nil { + return err + } + if len(first) == 0 { + return errors.ES(errors.OpUnknown, errors.KInternal, "No data") + } + + if first[0] != '[' { + all, err := io.ReadAll(br) + if err != nil { + return err + } + return errors.ES(errors.OpUnknown, errors.KInternal, "Got error: %v", string(all)) + } + return nil +} + +// advance reads the next frame from the response. +func (fr *frameReader) advance() ([]byte, error) { + // Check if the context has been cancelled, so we won't keep reading after the response is cancelled. + if fr.ctx.Err() != nil { + return nil, fr.ctx.Err() + } + + // Read until the end of the current line, which is the entire frame. + line, err := fr.reader.ReadBytes('\n') + if err != nil { + return nil, err + } + + // If the first character is ']', then we have reached the end of the response. + if len(line) > 0 && line[0] == ']' { + return nil, io.EOF + } + + // Trim newline + line = line[:len(line)-1] + + if len(line) > 0 && line[len(line)-1] == '\r' { + line = line[:len(line)-1] + } + + if len(line) < 2 { + return nil, errors.ES(errors.OpUnknown, errors.KInternal, "Got EOF while reading frame") + } + + // We skip the first byte of the line, as it is a comma, or the start of the array. + if line[0] != '[' && line[0] != ',' { + return nil, errors.ES(errors.OpUnknown, errors.KInternal, "Expected comma or start array, got '%c'", line[0]) + } + + line = line[1:] + + return line, nil +} + +// Close closes the underlying reader. +func (fr *frameReader) close() error { + return fr.orig.Close() +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/frame_utils.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/frame_utils.go new file mode 100644 index 00000000000..2489b4f7190 --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/frame_utils.go @@ -0,0 +1,28 @@ +package v2 + +import ( + "bytes" + "github.com/Azure/azure-kusto-go/azkustodata/errors" +) + +// peekFrameType reads the line directly, so it can be used to determine the frame type without parsing the entire frame. +// We do it by parsing the first json property, which is the frame type. +// We look for a : and then the value between two quotes. +func peekFrameType(line []byte) (FrameType, error) { + colon := bytes.IndexByte(line, ':') + + if colon == -1 { + return "", errors.ES(errors.OpUnknown, errors.KInternal, "Missing colon in frame") + } + + firstQuote := bytes.IndexByte(line[colon+1:], '"') + if firstQuote == -1 { + return "", errors.ES(errors.OpUnknown, errors.KInternal, "Missing quote in frame") + } + secondQuote := bytes.IndexByte(line[colon+1+firstQuote+1:], '"') + if secondQuote == -1 { + return "", errors.ES(errors.OpUnknown, errors.KInternal, "Missing quote in frame") + } + + return FrameType(line[colon+1+firstQuote+1 : colon+1+firstQuote+1+secondQuote]), nil +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/frames_defs.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/frames_defs.go new file mode 100644 index 00000000000..fbd3caaf080 --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/frames_defs.go @@ -0,0 +1,72 @@ +package v2 + +import ( + "github.com/Azure/azure-kusto-go/azkustodata/query" + "github.com/Azure/azure-kusto-go/azkustodata/types" +) + +type FrameColumn struct { + ColumnIndex int `json:"-"` + ColumnName string `json:"ColumnName"` + ColumnType string `json:"ColumnType"` +} + +func (f FrameColumn) Index() int { + return f.ColumnIndex +} + +func (f FrameColumn) Name() string { + return f.ColumnName +} + +func (f FrameColumn) Type() types.Column { + return types.Column(f.ColumnType) +} + +type DataTable struct { + Header TableHeader + Rows []query.Row +} + +type FrameType string + +const ( + DataSetHeaderFrameType FrameType = "DataSetHeader" + DataTableFrameType FrameType = "DataTable" + TableHeaderFrameType FrameType = "TableHeader" + TableFragmentFrameType FrameType = "TableFragment" + TableCompletionFrameType FrameType = "TableCompletion" + DataSetCompletionFrameType FrameType = "DataSetCompletion" +) + +type DataSetHeader struct { + IsProgressive bool + Version string + IsFragmented bool + ErrorReportingPlacement string +} + +type TableHeader struct { + TableId int + TableKind string + TableName string + Columns []query.Column +} + +type TableFragment struct { + Columns []query.Column + Rows []query.Row + PreviousIndex int +} + +type TableCompletion struct { + TableId int + RowCount int + OneApiErrors []OneApiError +} + +type DataSetCompletion struct { + HasErrors bool + Cancelled bool + OneApiErrors []OneApiError +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/iterative_dataset.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/iterative_dataset.go new file mode 100644 index 00000000000..01efbacbec9 --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/iterative_dataset.go @@ -0,0 +1,416 @@ +package v2 + +import ( + "bytes" + "context" + "encoding/json" + "io" + + "github.com/Azure/azure-kusto-go/azkustodata/errors" + "github.com/Azure/azure-kusto-go/azkustodata/query" +) + +// DefaultIoCapacity is the default capacity of the channel that receives frames from the Kusto service. Lower capacity means less memory usage, but might cause the channel to block if the frames are not consumed fast enough. +const DefaultIoCapacity = 1 + +const DefaultRowCapacity = 1000 + +const DefaultTableCapacity = 1 + +const PrimaryResultTableKind = "PrimaryResult" + +// iterativeDataset contains the main logic of parsing a v2 dataset. +// v2 is made from a series of frames, which are decoded by turn. +type iterativeDataset struct { + query.BaseDataset + + // results is a channel that sends the parsed results as they are decoded. + results chan query.TableResult + + // rowCapacity is the amount of rows to buffer per table. + rowCapacity int + + // cancel is a function to cancel the reading of the dataset, and is called when the dataset is closed. + cancel context.CancelFunc + + // currentTable is the table that is currently being read, as it can contain multiple fragments. + currentTable *iterativeTable + + // queryProperties is a table that contains the query properties, and is sent after the primary results. + queryProperties query.IterativeTable + + // jsonData is a channel that receives the raw JSON data from the Kusto service. + jsonData chan interface{} +} + +// NewIterativeDataset creates a new IterativeDataset from a ReadCloser. +// ioCapacity is the amount of buffered rows to keep in memory. +// tableCapacity is the amount of tables to buffer. +// rowCapacity is the amount of rows to buffer per table. +func NewIterativeDataset(ctx context.Context, r io.ReadCloser, ioCapacity int, rowCapacity int, tableCapacity int) (query.IterativeDataset, error) { + + ctx, cancel := context.WithCancel(ctx) + + d := &iterativeDataset{ + BaseDataset: query.NewBaseDataset(ctx, errors.OpQuery, PrimaryResultTableKind), + results: make(chan query.TableResult, tableCapacity), + rowCapacity: rowCapacity, + cancel: cancel, + currentTable: nil, + queryProperties: nil, + jsonData: make(chan interface{}, ioCapacity), + } + + // This ctor will fail if we get a non-json response + // In this case, we want to return it immediately + reader, err := newFrameReader(r, ctx) + if err != nil { + cancel() + return nil, err + } + + // Spin up two goroutines - one to parse the dataset, and one to read the frames. + go parseRoutine(d, cancel) + go readRoutine(reader, d) + + return d, nil +} + +// readRoutine reads the frames from the Kusto service and sends them to the buffered channel. +// This is so we could keep up if the IO is faster than the consumption of the frames. +func readRoutine(reader *frameReader, d *iterativeDataset) { + loop := true + + for loop { + line, err := reader.advance() + if err != nil { + if err != io.EOF { + select { + case <-d.Context().Done(): + // When we send data, we always make sure that the context isn't cancelled, so we don't block forever. + case d.jsonData <- err: + } + } + loop = false + } else { + select { + case <-d.Context().Done(): + loop = false + case d.jsonData <- line: + } + } + } + + if err := reader.close(); err != nil { + select { + case <-d.Context().Done(): + case d.jsonData <- err: + } + } + + close(d.jsonData) +} + +// parseRoutine reads the frames from the buffered channel and parses them. +func parseRoutine(d *iterativeDataset, cancel context.CancelFunc) { + + err := readDataSet(d) + if err != nil { + select { + case d.results <- query.TableResultError(err): + case <-d.Context().Done(): + } + cancel() + } + + if d.currentTable != nil { + d.currentTable.finishTable([]OneApiError{}, err) + } + + cancel() + close(d.results) +} + +func readDataSet(d *iterativeDataset) error { + + var err error + + // The first frame should be a DataSetHeader. We don't need to save it - just validate it. + if header, _, err := nextFrame(d); err == nil { + if err = validateDataSetHeader(header); err != nil { + return err + } + } else { + return err + } + + // Next up, we expect the QueryProperties table, which is a DataTable. + // We save it and send it after the primary results. + if decoder, frameType, err := nextFrame(d); err == nil { + if frameType != DataTableFrameType { + return errors.ES(errors.OpQuery, errors.KInternal, "unexpected frame type %s, expected DataTable", frameType) + } + + if err = handleDataTable(d, decoder); err != nil { + return err + } + } else { + return err + } + + // We then iterate over the primary tables. + // If we get a TableHeader, we read the table. + // If we get a DataTable, it means we have reached QueryCompletionInformation + // If we get a DataSetCompletion, we are done. + for decoder, frameType, err := nextFrame(d); err == nil; decoder, frameType, err = nextFrame(d) { + if frameType == DataTableFrameType { + if err = handleDataTable(d, decoder); err != nil { + return err + } + continue + } + + if frameType == TableHeaderFrameType { + if err = readPrimaryTable(d, decoder); err != nil { + return err + } + continue + } + + if frameType == DataSetCompletionFrameType { + err = readDataSetCompletion(decoder) + if err != nil { + return err + } + return nil + } + + return errors.ES(errors.OpQuery, errors.KInternal, "unexpected frame type %s, expected DataTable, TableHeader, or DataSetCompletion", frameType) + } + + return err +} + +// nextFrame reads the next frame from the buffered channel. +// It doesn't parse the frame yet, but peeks the frame type to determine how to handle it. +func nextFrame(d *iterativeDataset) (*json.Decoder, FrameType, error) { + var line []byte + select { + case <-d.Context().Done(): + return nil, "", errors.ES(errors.OpQuery, errors.KInternal, "context cancelled") + case val := <-d.jsonData: + if val == nil { + return nil, "", errors.ES(errors.OpQuery, errors.KInternal, "nil value received from channel") + } + if err, ok := val.(error); ok { + return nil, "", err + } + line = val.([]byte) + } + + frameType, err := peekFrameType(line) + if err != nil { + return nil, "", err + } + + return json.NewDecoder(bytes.NewReader(line)), frameType, nil +} + +// readDataSetCompletion reads the DataSetCompletion frame, and returns any errors it might contain. +func readDataSetCompletion(dec *json.Decoder) error { + completion := DataSetCompletion{} + err := dec.Decode(&completion) + if err != nil { + return err + } + if completion.HasErrors { + return combineOneApiErrors(completion.OneApiErrors) + } + return nil +} + +// combineOneApiErrors combines multiple OneApiErrors into a single error, de-duping them if needed. +func combineOneApiErrors(errs []OneApiError) error { + c := errors.NewCombinedError() + for i := range errs { + c.AddError(&errs[i]) + } + return c.GetError() +} + +// readPrimaryTable reads a primary table from the dataset. +// A primary table consists of: +// - A TableHeader - describes the structure of the table and its columns. +// - A series of TableFragment - contains the rows of the table. +// - A TableCompletion - signals the end of the table, and contains any errors that might have occurred. +func readPrimaryTable(d *iterativeDataset, dec *json.Decoder) error { + header := TableHeader{} + err := dec.Decode(&header) + if err != nil { + return err + } + + if err := handleTableHeader(d, header); err != nil { + return err + } + + for i := 0; ; { + dec, frameType, err := nextFrame(d) + if err != nil { + return err + } + if frameType == TableFragmentFrameType { + fragment := TableFragment{Columns: header.Columns, PreviousIndex: i} + err = dec.Decode(&fragment) + if err != nil { + return err + } + i += len(fragment.Rows) + if err = handleTableFragment(d, fragment); err != nil { + return err + } + continue + } + + if frameType == TableCompletionFrameType { + completion := TableCompletion{} + err = dec.Decode(&completion) + if err != nil { + return err + } + + if err = handleTableCompletion(d, completion); err != nil { + return err + } + + break + } + + return errors.ES(errors.OpQuery, errors.KInternal, "unexpected frame type %s, expected TableFragment or TableCompletion", frameType) + } + + return nil +} + +// handleDataTable reads a DataTable frame from the dataset, which aren't iterative. +// In Fragmented V2, these are only the metadata tables - QueryProperties and QueryCompletionInformation. +func handleDataTable(d *iterativeDataset, dec *json.Decoder) error { + var dt DataTable + if err := dec.Decode(&dt); err != nil { + return err + } + + if dt.Header.TableKind == PrimaryResultTableKind { + return errors.ES(d.Op(), errors.KInternal, "received a DataTable frame for a primary result table") + } + switch dt.Header.TableKind { + case QueryPropertiesKind: + // When we get this, we want to store it and not send it to the user immediately. + // We will wait until after the primary results (when we get the QueryCompletionInformation table) and then send it. + res, err := newTable(d, dt) + if err != nil { + return err + } + d.queryProperties = iterativeWrapper{res} + case QueryCompletionInformationKind: + if d.queryProperties != nil { + d.sendTable(d.queryProperties) + } + + res, err := newTable(d, dt) + if err != nil { + return err + } + d.sendTable(iterativeWrapper{res}) + + default: + return errors.ES(d.Op(), errors.KInternal, "unknown secondary table - %s %s", dt.Header.TableName, dt.Header.TableKind) + } + + return nil +} + +func handleTableCompletion(d *iterativeDataset, tc TableCompletion) error { + if d.currentTable == nil { + return errors.ES(d.Op(), errors.KInternal, "received a TableCompletion frame while no streaming table was open") + } + if int(d.currentTable.Index()) != tc.TableId { + return errors.ES(d.Op(), errors.KInternal, "received a TableCompletion frame for table %d while table %d was open", tc.TableId, int((d.currentTable).Index())) + } + + d.currentTable.finishTable(tc.OneApiErrors, nil) + + d.currentTable = nil + + return nil +} + +func handleTableFragment(d *iterativeDataset, tf TableFragment) error { + if d.currentTable == nil { + return errors.ES(d.Op(), errors.KInternal, "received a TableFragment frame while no streaming table was open") + } + + d.currentTable.addRawRows(tf.Rows) + + return nil +} + +func handleTableHeader(d *iterativeDataset, th TableHeader) error { + if d.currentTable != nil { + return errors.ES(d.Op(), errors.KInternal, "received a TableHeader frame while a streaming table was still open") + } + + // Read the table header, set it as the current table, and send it to the user (so they can start reading rows) + + t, err := NewIterativeTable(d, th) + if err != nil { + return err + } + + d.currentTable = t.(*iterativeTable) + d.sendTable(d.currentTable) + + return nil +} + +// sendTable sends a table to results channel for the user, or cancels if the context is done. +func (d *iterativeDataset) sendTable(tb query.IterativeTable) { + select { + case <-d.Context().Done(): + return + case d.results <- query.TableResultSuccess(tb): + return + } +} + +// Tables returns a channel that sends the tables as they are parsed. +func (d *iterativeDataset) Tables() <-chan query.TableResult { + return d.results +} + +// Close closes the dataset, cancelling the context and closing the results channel. +func (d *iterativeDataset) Close() error { + d.cancel() + return nil +} + +// ToDataset reads the entire iterative dataset, converting it to a regular dataset. +func (d *iterativeDataset) ToDataset() (query.Dataset, error) { + tables := make([]query.Table, 0, len(d.results)) + + defer d.Close() + + for tb := range d.Tables() { + if tb.Err() != nil { + return nil, tb.Err() + } + + table, err := tb.Table().ToTable() + if err != nil { + return nil, err + } + tables = append(tables, table) + } + + return query.NewDataset(d, tables), nil +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/iterative_table.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/iterative_table.go new file mode 100644 index 00000000000..ff406bfd99b --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/iterative_table.go @@ -0,0 +1,101 @@ +package v2 + +import ( + "context" + "github.com/Azure/azure-kusto-go/azkustodata/query" + "sync/atomic" +) + +// iterativeTable represents a table that is streamed from the service. +// It is used by the iterative dataset. +// The rows are received from the service via the rawRows channel, and are parsed and sent to the rows channel. +type iterativeTable struct { + query.BaseTable + // a channel of rows and errors, exposed to the user + rows chan query.RowResult + // the number of rows in the table, updated as rows are received + rowCount atomic.Uint32 + // a context for the table + ctx context.Context +} + +// addRawRows is called by the dataset to add rows to the table. +// It will add the rows to the table, unless the table is already skipped. +func (t *iterativeTable) addRawRows(rows []query.Row) { + for _, row := range rows { + if !t.reportRow(row) { + return + } + t.rowCount.Add(1) + } +} + +// RowCount returns the current number of rows in the table. +func (t *iterativeTable) RowCount() int { + return int(t.rowCount.Load()) +} + +func (t *iterativeTable) setRowCount(rowCount int) { + t.rowCount.Store(uint32(rowCount)) +} + +func NewIterativeTable(dataset *iterativeDataset, th TableHeader) (query.IterativeTable, error) { + baseTable, err := newBaseTableFromHeader(dataset, th) + if err != nil { + return nil, err + } + + t := &iterativeTable{ + BaseTable: baseTable, + ctx: dataset.Context(), + rows: make(chan query.RowResult, dataset.rowCapacity), + } + + return t, nil +} + +func (t *iterativeTable) finishTable(errs []OneApiError, cancelError error) { + if cancelError != nil { + t.reportError(cancelError) + } else if errs != nil { + t.reportError(combineOneApiErrors(errs)) + } + close(t.rows) +} + +func (t *iterativeTable) reportRow(row query.Row) bool { + select { + case t.rows <- query.RowResultSuccess(row): + return true + case <-t.ctx.Done(): + return false + } +} + +func (t *iterativeTable) reportError(err error) bool { + select { + case t.rows <- query.RowResultError(err): + return true + case <-t.ctx.Done(): + return false + } +} + +// Rows returns a channel of rows and errors. +func (t *iterativeTable) Rows() <-chan query.RowResult { + return t.rows +} + +// ToTable reads the entire table, converting it from an iterative table to a regular table. +func (t *iterativeTable) ToTable() (query.Table, error) { + var rows []query.Row + for r := range t.rows { + if r.Err() != nil { + return nil, r.Err() + } else { + rows = append(rows, r.Row()) + } + } + + return query.NewTable(t.BaseTable, rows), nil +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/secondary.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/secondary.go new file mode 100644 index 00000000000..7b6d95abdab --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/secondary.go @@ -0,0 +1,52 @@ +package v2 + +import ( + "github.com/Azure/azure-kusto-go/azkustodata/errors" + "github.com/Azure/azure-kusto-go/azkustodata/query" + "github.com/google/uuid" + "time" +) + +// This file handles the parsing of the known secondary tables in v2 datasets. + +// QueryProperties represents the query properties table, which arrives before the first result. +type QueryProperties struct { + TableId int + Key string + Value map[string]interface{} +} + +// QueryCompletionInformation represents the query completion information table, which arrives after the last result. +type QueryCompletionInformation struct { + Timestamp time.Time + ClientRequestId string + ActivityId uuid.UUID + SubActivityId uuid.UUID + ParentActivityId uuid.UUID + Level int + LevelName string + StatusCode int + StatusCodeName string + EventType int + EventTypeName string + Payload string +} + +const QueryPropertiesKind = "QueryProperties" +const QueryCompletionInformationKind = "QueryCompletionInformation" + +func AsQueryProperties(table query.BaseTable) ([]QueryProperties, error) { + if table.Kind() != QueryPropertiesKind { + return nil, errors.ES(errors.OpQuery, errors.KWrongTableKind, "expected QueryProperties table, got %s", table.Kind()) + } + + return query.ToStructs[QueryProperties](table) +} + +func AsQueryCompletionInformation(table query.BaseTable) ([]QueryCompletionInformation, error) { + if table.Kind() != QueryCompletionInformationKind { + return nil, errors.ES(errors.OpQuery, errors.KWrongTableKind, "expected QueryCompletionInformation table, got %s", table.Kind()) + } + + return query.ToStructs[QueryCompletionInformation](table) +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/table.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/table.go new file mode 100644 index 00000000000..053755ff5dc --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/query/v2/table.go @@ -0,0 +1,59 @@ +package v2 + +import ( + "github.com/Azure/azure-kusto-go/azkustodata/errors" + "github.com/Azure/azure-kusto-go/azkustodata/query" + "strconv" +) + +func newBaseTable(dataset query.BaseDataset, id int, name string, kind string, columns []query.Column) (query.BaseTable, error) { + return query.NewBaseTable(dataset, int64(id), strconv.Itoa(id), name, kind, columns), nil +} + +func newBaseTableFromHeader(dataset query.BaseDataset, th TableHeader) (query.BaseTable, error) { + return newBaseTable(dataset, th.TableId, th.TableName, th.TableKind, th.Columns) +} + +func newTable(dataset query.BaseDataset, dt DataTable) (query.Table, error) { + base, err := newBaseTable(dataset, dt.Header.TableId, dt.Header.TableName, dt.Header.TableKind, dt.Header.Columns) + if err != nil { + return nil, err + } + + return query.NewTable(base, dt.Rows), nil +} + +type iterativeWrapper struct { + table query.Table +} + +func (f iterativeWrapper) Id() string { return f.table.Id() } + +func (f iterativeWrapper) Index() int64 { return f.table.Index() } + +func (f iterativeWrapper) Name() string { return f.table.Name() } + +func (f iterativeWrapper) Columns() []query.Column { return f.table.Columns() } + +func (f iterativeWrapper) Kind() string { return f.table.Kind() } + +func (f iterativeWrapper) ColumnByName(name string) query.Column { + return f.table.ColumnByName(name) +} + +func (f iterativeWrapper) Op() errors.Op { return f.table.Op() } + +func (f iterativeWrapper) IsPrimaryResult() bool { return f.table.IsPrimaryResult() } + +func (f iterativeWrapper) ToTable() (query.Table, error) { return f.table, nil } + +func (f iterativeWrapper) Rows() <-chan query.RowResult { + ch := make(chan query.RowResult, len(f.table.Rows())) + go func() { + defer close(ch) + for _, row := range f.table.Rows() { + ch <- query.RowResultSuccess(row) + } + }() + return ch +} diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/queryopts.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/queryopts.go similarity index 89% rename from vendor/github.com/Azure/azure-kusto-go/kusto/queryopts.go rename to vendor/github.com/Azure/azure-kusto-go/azkustodata/queryopts.go index 655ff893efb..0bfb2092a4d 100644 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/queryopts.go +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/queryopts.go @@ -1,13 +1,13 @@ -package kusto +package azkustodata // queryopts.go holds the varying QueryOption constructors as the list is so long that // it clogs up the main kusto.go file. import ( - "github.com/Azure/azure-kusto-go/kusto/kql" + "github.com/Azure/azure-kusto-go/azkustodata/kql" "time" - "github.com/Azure/azure-kusto-go/kusto/data/value" + "github.com/Azure/azure-kusto-go/azkustodata/value" ) // requestProperties is a POD used by clients to describe specific needs from the service. @@ -25,6 +25,9 @@ type requestProperties struct { type queryOptions struct { requestProperties *requestProperties queryIngestion bool + v2IoCapacity int + v2RowCapacity int + v2TableCapacity int } const ResultsProgressiveEnabledValue = "results_progressive_enabled" @@ -75,10 +78,71 @@ const RequestReadonlyValue = "request_readonly" const RequestRemoteEntitiesDisabledValue = "request_remote_entities_disabled" const RequestSandboxedExecutionDisabledValue = "request_sandboxed_execution_disabled" const RequestUserValue = "request_user" -const TruncationMaxRecordsValue = "truncation_max_records" -const TruncationMaxSizeValue = "truncation_max_size" +const TruncationMaxRecordsValue = "truncationmaxrecords" +const TruncationMaxSizeValue = "truncationmaxsize" const ValidatePermissionsValue = "validate_permissions" +const V2NewlinesBetweenFramesValue = "results_v2_newlines_between_frames" + +const V2FragmentPrimaryTablesValue = "results_v2_fragment_primary_tables" + +const ResultsErrorReportingPlacementValue = "results_error_reporting_placement" + +const ResultsErrorReportingPlacementInData = "in_data" +const ResultsErrorReportingPlacementEndOfTable = "end_of_table" +const ResultsErrorReportingPlacementEndOfDataset = "end_of_dataset" + +// V2IoCapacity sets the size of the buffer, in frames, when reading from the network. +func V2IoCapacity(i int) QueryOption { + return func(q *queryOptions) error { + q.v2IoCapacity = i + return nil + } +} + +// V2RowCapacity sets the capacity of the buffer of data rows per table. +func V2RowCapacity(i int) QueryOption { + return func(q *queryOptions) error { + q.v2RowCapacity = i + return nil + } +} + +// V2TableCapacity sets the capacity of the buffer of data fragments in the result set. +func V2TableCapacity(i int) QueryOption { + return func(q *queryOptions) error { + q.v2TableCapacity = i + return nil + } +} + +// V2NewlinesBetweenFrames Adds new lines between frames in the results, in order to make it easier to parse them. +func V2NewlinesBetweenFrames() QueryOption { + return func(q *queryOptions) error { + q.requestProperties.Options[V2NewlinesBetweenFramesValue] = true + return nil + } +} + +// V2FragmentPrimaryTables Causes primary tables to be sent in multiple fragments, each containing a subset of the rows. +func V2FragmentPrimaryTables() QueryOption { + return func(q *queryOptions) error { + q.requestProperties.Options[V2FragmentPrimaryTablesValue] = true + return nil + } +} + +// ResultsErrorReportingPlacement Decides the placement of errors in the result set: +// 1. "in_data" (default) - errors are placed in the table or table fragment, within the array of data rows. +// 2. "end_of_table" - errors are placed in the table completion frame, after the array of data rows. Only applies to queries that are progressive or fragmented. +// 3. "end_of_dataset" - errors are placed in the dataset completion frame. +func ResultsErrorReportingPlacement(s string) QueryOption { + return func(q *queryOptions) error { + q.requestProperties.Options[ResultsErrorReportingPlacementValue] = s + return nil + } +} + // ClientRequestID sets the x-ms-client-request-id header, and can be used to identify the request in the `.show queries` output. func ClientRequestID(clientRequestID string) QueryOption { return func(q *queryOptions) error { @@ -139,7 +203,7 @@ func ResultsProgressiveEnabled() QueryOption { // ServerTimeout overrides the default request timeout. func ServerTimeout(d time.Duration) QueryOption { return func(q *queryOptions) error { - q.requestProperties.Options[ServerTimeoutValue] = value.Timespan{Valid: true, Value: d}.Marshal() + q.requestProperties.Options[ServerTimeoutValue] = value.TimespanString(d) return nil } } @@ -416,7 +480,7 @@ func QueryResultsApplyGetschema() QueryOption { // QueryResultsCacheMaxAge If positive, controls the maximum age of the cached query results the service is allowed to return func QueryResultsCacheMaxAge(d time.Duration) QueryOption { return func(q *queryOptions) error { - q.requestProperties.Options[QueryResultsCacheMaxAgeValue] = value.Timespan{Value: d, Valid: true}.Marshal() + q.requestProperties.Options[QueryResultsCacheMaxAgeValue] = value.TimespanString(d) return nil } } @@ -566,12 +630,3 @@ func ValidatePermissions() QueryOption { return nil } } - -// IngestionEndpoint will instruct the Mgmt call to connect to the ingest-[endpoint] instead of [endpoint]. -// This is not often used by end users and can only be used with a Mgmt() call. -func IngestionEndpoint() QueryOption { - return func(m *queryOptions) error { - m.queryIngestion = true - return nil - } -} diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/tokenprovider.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/tokenprovider.go similarity index 98% rename from vendor/github.com/Azure/azure-kusto-go/kusto/tokenprovider.go rename to vendor/github.com/Azure/azure-kusto-go/azkustodata/tokenprovider.go index b1fa76498fd..238669dfd78 100644 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/tokenprovider.go +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/tokenprovider.go @@ -1,4 +1,4 @@ -package kusto +package azkustodata import ( "context" @@ -7,7 +7,7 @@ import ( "strings" "sync/atomic" - "github.com/Azure/azure-kusto-go/kusto/utils" + "github.com/Azure/azure-kusto-go/azkustodata/utils" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/trustedendpoints/trusted_endpoints.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/trusted_endpoints/trusted_endpoints.go similarity index 86% rename from vendor/github.com/Azure/azure-kusto-go/kusto/trustedendpoints/trusted_endpoints.go rename to vendor/github.com/Azure/azure-kusto-go/azkustodata/trusted_endpoints/trusted_endpoints.go index c993496cea7..aaa4fab8419 100644 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/trustedendpoints/trusted_endpoints.go +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/trusted_endpoints/trusted_endpoints.go @@ -1,14 +1,13 @@ -package trustedendpoints +package trustedEndpoints import ( _ "embed" "encoding/json" - "fmt" "math" "net/url" "strings" - "github.com/Azure/azure-kusto-go/kusto/data/errors" + "github.com/Azure/azure-kusto-go/azkustodata/errors" "github.com/samber/lo" ) @@ -39,10 +38,10 @@ func createInstance() *TrustedEndpoints { for key, value := range wellKnownData.AllowedEndpointsByLogin { rules := []MatchRule{} for _, suf := range value.AllowedKustoSuffixes { - rules = append(rules, MatchRule{suffix: suf, exact: false}) + rules = append(rules, MatchRule{Suffix: suf, Exact: false}) } for _, host := range value.AllowedKustoHostnames { - rules = append(rules, MatchRule{suffix: host, exact: true}) + rules = append(rules, MatchRule{Suffix: host, Exact: true}) } f, err := newFastSuffixMatcher(rules) @@ -67,8 +66,8 @@ type TrustedEndpoints struct { } type MatchRule struct { - suffix string - exact bool + Suffix string + Exact bool } type FastSuffixMatcher struct { @@ -94,8 +93,8 @@ func (matcher *FastSuffixMatcher) isMatch(candidate string) bool { } if lst, ok := matcher.rules[tailLowerCase(candidate, matcher.suffixLength)]; ok { for _, rule := range lst { - if strings.HasSuffix(strings.ToLower(candidate), rule.suffix) { - if len(candidate) == len(rule.suffix) || !rule.exact { + if strings.HasSuffix(strings.ToLower(candidate), rule.Suffix) { + if len(candidate) == len(rule.Suffix) || !rule.Exact { return true } } @@ -107,8 +106,8 @@ func (matcher *FastSuffixMatcher) isMatch(candidate string) bool { func newFastSuffixMatcher(rules []MatchRule) (*FastSuffixMatcher, error) { minSufLen := len(lo.MinBy(rules, func(a MatchRule, cur MatchRule) bool { - return len(a.suffix) < len(cur.suffix) - }).suffix) + return len(a.Suffix) < len(cur.Suffix) + }).Suffix) if minSufLen == 0 || minSufLen == math.MaxInt32 { return nil, errors.ES( @@ -121,7 +120,7 @@ func newFastSuffixMatcher(rules []MatchRule) (*FastSuffixMatcher, error) { processedRules := map[string][]MatchRule{} for _, rule := range rules { - suffix := tailLowerCase(rule.suffix, minSufLen) + suffix := tailLowerCase(rule.Suffix, minSufLen) if lst, ok := processedRules[suffix]; !ok { processedRules[suffix] = []MatchRule{rule} } else { @@ -135,15 +134,6 @@ func newFastSuffixMatcher(rules []MatchRule) (*FastSuffixMatcher, error) { }, nil } -func values[T comparable, R any](m map[T]R) []R { - l := make([]R, 0, len(m)) - for _, val := range m { - l = append(l, val) - } - - return l -} - func createFastSuffixMatcherFromExisting(rules []MatchRule, existing *FastSuffixMatcher) (*FastSuffixMatcher, error) { if existing == nil || len(existing.rules) == 0 { return newFastSuffixMatcher(rules) @@ -236,6 +226,7 @@ func (trusted *TrustedEndpoints) validateHostnameIsTrusted(host string, loginEnd return errors.ES( errors.OpUnknown, errors.KClientArgs, - fmt.Sprintf("Can't communicate with '%s' as this hostname is currently not trusted; please see https://aka.ms/kustotrustedendpoints.", host), + "Can't communicate with '%s' as this hostname is currently not trusted; please see https://aka.ms/kustotrustedendpoints.", + host, ).SetNoRetry() } diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/trustedendpoints/well_known_kusto_endpoints.json b/vendor/github.com/Azure/azure-kusto-go/azkustodata/trusted_endpoints/well_known_kusto_endpoints.json similarity index 66% rename from vendor/github.com/Azure/azure-kusto-go/kusto/trustedendpoints/well_known_kusto_endpoints.json rename to vendor/github.com/Azure/azure-kusto-go/azkustodata/trusted_endpoints/well_known_kusto_endpoints.json index 7a5aca6ad80..f9052935d03 100644 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/trustedendpoints/well_known_kusto_endpoints.json +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/trusted_endpoints/well_known_kusto_endpoints.json @@ -22,7 +22,10 @@ ".kusto.data.microsoft.com", ".kusto.fabric.microsoft.com", ".api.securityplatform.microsoft.com", - ".securitycenter.windows.com" + ".securitycenter.windows.com", + ".arg-int.core.windows.net", + ".arg-df.core.windows.net", + ".arg.core.windows.net" ], "AllowedKustoHostnames": [ "ade.applicationinsights.io", @@ -41,7 +44,8 @@ "https://login.microsoftonline.us": { "AllowedKustoSuffixes": [ ".kusto.usgovcloudapi.net", - ".kustomfa.usgovcloudapi.net" + ".kustomfa.usgovcloudapi.net", + ".arg.core.usgovcloudapi.net" ], "AllowedKustoHostnames": [ @@ -55,7 +59,8 @@ ".kusto.azuresynapse.azure.cn", ".kusto.chinacloudapi.cn", ".kustomfa.chinacloudapi.cn", - ".playfab.cn" + ".playfab.cn", + ".arg.core.chinacloudapi.cn" ], "AllowedKustoHostnames": [ "adx.applicationinsights.azure.cn", @@ -66,8 +71,8 @@ "https://login.microsoftonline.eaglex.ic.gov": { "AllowedKustoSuffixes": [ ".kusto.core.eaglex.ic.gov", - ".kustomfa.core.eaglex.ic.gov" - + ".kustomfa.core.eaglex.ic.gov", + ".arg.core.eaglex.ic.gov" ], "AllowedKustoHostnames": [ "adx.applicationinsights.azure.eaglex.ic.gov", @@ -78,13 +83,47 @@ "https://login.microsoftonline.microsoft.scloud": { "AllowedKustoSuffixes": [ ".kusto.core.microsoft.scloud", - ".kustomfa.core.microsoft.scloud" + ".kustomfa.core.microsoft.scloud", + ".arg.core.microsoft.scloud" ], "AllowedKustoHostnames": [ "adx.applicationinsights.azure.microsoft.scloud", "adx.loganalytics.azure.microsoft.scloud", "adx.monitor.azure.microsoft.scloud" ] + }, + "https://login.sovcloud-identity.fr": { + "AllowedKustoSuffixes": [ + ".kusto.sovcloud-api.fr", + ".kustomfa.sovcloud-api.fr" + ], + "AllowedKustoHostnames": [ + "adx.applicationinsights.azure.fr", + "adx.loganalytics.azure.fr", + "adx.monitor.azure.fr" + ] + }, + "https://login.sovcloud-identity.de": { + "AllowedKustoSuffixes": [ + ".kusto.sovcloud-api.de", + ".kustomfa.sovcloud-api.de" + ], + "AllowedKustoHostnames": [ + "adx.applicationinsights.azure.de", + "adx.loganalytics.azure.de", + "adx.monitor.azure.de" + ] + }, + "https://login.sovcloud-identity.sg": { + "AllowedKustoSuffixes": [ + ".kusto.sovcloud-api.sg", + ".kustomfa.sovcloud-api.sg" + ], + "AllowedKustoHostnames": [ + "adx.applicationinsights.azure.sg", + "adx.loganalytics.azure.sg", + "adx.monitor.azure.sg" + ] } } } diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/data/types/types.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/types/types.go similarity index 67% rename from vendor/github.com/Azure/azure-kusto-go/kusto/data/types/types.go rename to vendor/github.com/Azure/azure-kusto-go/azkustodata/types/types.go index 389185c3406..a0c60de0217 100644 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/data/types/types.go +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/types/types.go @@ -7,9 +7,8 @@ do discovery on table columns, if trying to do some type of dynamic discovery. # Column -Column represents a Column type. A user should never try to implemenet these. Instead they should use -the constants defined in this package, such as types.Bool, types.DateTime, ... Any other value that these -will not pass the Column.Valid() method and will be rejected by the API. +Column represents a Column type. A user should never try to implement these. Instead they should use +the constants defined in this package, such as types.Bool, types.DateTime. */ package types @@ -17,9 +16,14 @@ package types // For more information, please see: https://docs.microsoft.com/en-us/azure/kusto/query/scalar-data-types/ type Column string -// Valid returns true if the Column is a valid value. -func (c Column) Valid() bool { - return valid[c] +// NormalizeColumn checks if the column is a valid column type and returns the normalized column type. +// If the column is not valid, it returns an empty string. +func NormalizeColumn(c string) Column { + if mapped, ok := mappedNames[c]; ok { + return mapped + } + + return "" } // These constants represent the value type stored in a Column. @@ -46,15 +50,31 @@ const ( Decimal Column = "decimal" // We have NOT written a conversion ) -var valid = map[Column]bool{ - Bool: true, - DateTime: true, - Dynamic: true, - GUID: true, - Int: true, - Long: true, - Real: true, - String: true, - Timespan: true, - Decimal: true, +var mappedNames = map[string]Column{ + string(Bool): Bool, + "boolean": Bool, + + string(DateTime): DateTime, + "date": DateTime, + + string(Dynamic): Dynamic, + + string(GUID): GUID, + "uuid": GUID, + "uniqueid": GUID, + + string(Int): Int, + "int32": Int, + + string(Long): Long, + "int64": Long, + + string(Real): Real, + "double": Real, + + string(String): String, + string(Timespan): Timespan, + "time": Timespan, + + string(Decimal): Decimal, } diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/utils/once.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/utils/once.go similarity index 100% rename from vendor/github.com/Azure/azure-kusto-go/kusto/utils/once.go rename to vendor/github.com/Azure/azure-kusto-go/azkustodata/utils/once.go diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/utils/transporter.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/utils/transporter.go similarity index 100% rename from vendor/github.com/Azure/azure-kusto-go/kusto/utils/transporter.go rename to vendor/github.com/Azure/azure-kusto-go/azkustodata/utils/transporter.go diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/bool.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/bool.go new file mode 100644 index 00000000000..05e253aac47 --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/bool.go @@ -0,0 +1,59 @@ +package value + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-kusto-go/azkustodata/types" + "reflect" +) + +// Bool represents a Kusto boolean type. Bool implements Kusto. +type Bool struct { + pointerValue[bool] +} + +func NewBool(v bool) *Bool { + return &Bool{newPointerValue[bool](&v)} +} + +func NewNullBool() *Bool { + return &Bool{newPointerValue[bool](nil)} +} + +// Convert Bool into reflect value. +func (bo *Bool) Convert(v reflect.Value) error { + return Convert[bool](*bo, &bo.pointerValue, v) +} + +func (bo *Bool) Unmarshal(i interface{}) error { + if i == nil { + bo.value = nil + return nil + } + + // Boolean may sometimes be represented as an integer, 0 means false, 1 means true. + if num, ok := i.(json.Number); ok { + num, err := num.Int64() + if err != nil { + return parseError(bo, i, err) + } + + bo.value = new(bool) + + if num == 0 { + *bo.value = false + } else if num == 1 { + *bo.value = true + } else { + return parseError(bo, i, fmt.Errorf("expected 0 or 1, got %d", num)) + } + return nil + } + + return bo.pointerValue.Unmarshal(i) +} + +// GetType returns the type of the value. +func (bo *Bool) GetType() types.Column { + return types.Bool +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/datetime.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/datetime.go new file mode 100644 index 00000000000..d80c2bf936c --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/datetime.go @@ -0,0 +1,70 @@ +package value + +import ( + "fmt" + "github.com/Azure/azure-kusto-go/azkustodata/types" + "reflect" + "time" +) + +// DateTime represents a Kusto datetime type. DateTime implements Kusto. +type DateTime struct { + pointerValue[time.Time] +} + +// NewDateTime creates a new DateTime. +func NewDateTime(v time.Time) *DateTime { + return &DateTime{newPointerValue[time.Time](&v)} +} + +// NewNullDateTime creates a new null DateTime. +func NewNullDateTime() *DateTime { + return &DateTime{newPointerValue[time.Time](nil)} +} + +// String implements fmt.Stringer. +func (d *DateTime) String() string { + if d.value == nil { + return "" + } + return fmt.Sprint(d.value.Format(time.RFC3339Nano)) +} + +// Marshal marshals the DateTime into a Kusto compatible string. +func (d *DateTime) Marshal() string { + if d.value == nil { + return time.Time{}.Format(time.RFC3339Nano) + } + + return d.value.Format(time.RFC3339Nano) +} + +// Unmarshal unmarshals i into DateTime. i must be a string representing RFC3339Nano or nil. +func (d *DateTime) Unmarshal(i interface{}) error { + if i == nil { + d.value = nil + return nil + } + + str, ok := i.(string) + if !ok { + return convertError(d, i) + } + + t, err := time.Parse(time.RFC3339Nano, str) + if err != nil { + return parseError(d, i, err) + } + d.value = &t + return nil +} + +// Convert DateTime into reflect value. +func (d *DateTime) Convert(v reflect.Value) error { + return Convert[time.Time](*d, &d.pointerValue, v) +} + +// GetType returns the type of the value. +func (d *DateTime) GetType() types.Column { + return types.DateTime +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/decimal.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/decimal.go new file mode 100644 index 00000000000..2de315ea4b0 --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/decimal.go @@ -0,0 +1,87 @@ +package value + +import ( + "fmt" + "github.com/Azure/azure-kusto-go/azkustodata/types" + "github.com/shopspring/decimal" + "math/big" + "reflect" +) + +// Decimal represents a Kusto decimal type. Decimal implements Kusto. +type Decimal struct { + pointerValue[decimal.Decimal] +} + +func NewDecimal(v decimal.Decimal) *Decimal { + return &Decimal{newPointerValue[decimal.Decimal](&v)} +} + +func NewNullDecimal() *Decimal { + return &Decimal{newPointerValue[decimal.Decimal](nil)} +} + +func DecimalFromFloat(f float64) *Decimal { + return NewDecimal(decimal.NewFromFloat(f)) +} + +func DecimalFromString(s string) *Decimal { + dec, err := decimal.NewFromString(s) + if err != nil { + return NewNullDecimal() + } + return NewDecimal(dec) +} + +func (*Decimal) isKustoVal() {} + +// ParseFloat provides builtin support for Go's *big.Float conversion where that type meets your needs. +func (d *Decimal) ParseFloat(base int, prec uint, mode big.RoundingMode) (f *big.Float, b int, err error) { + if d.value == nil { + return nil, 0, parseError(d, nil, fmt.Errorf("nil value")) + } + return big.ParseFloat(d.value.String(), base, prec, mode) +} + +// Unmarshal unmarshals i into Decimal. i must be a string representing a decimal type or nil. +func (d *Decimal) Unmarshal(i interface{}) error { + if i == nil { + d.value = nil + return nil + } + + v, ok := i.(string) + if !ok { + return convertError(d, i) + } + + dec, err := decimal.NewFromString(v) + if err != nil { + return parseError(d, i, err) + } + + d.value = &dec + + return nil +} + +// Convert Decimal into reflect value. +func (d *Decimal) Convert(v reflect.Value) error { + if TryConvert[decimal.Decimal](*d, &d.pointerValue, v) { + return nil + } + + if v.Type().Kind() == reflect.String { + if d.value != nil { + v.SetString(d.value.String()) + } + return nil + } + + return convertError(d, v) +} + +// GetType returns the type of the value. +func (d *Decimal) GetType() types.Column { + return types.Decimal +} diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/dynamic.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/dynamic.go similarity index 70% rename from vendor/github.com/Azure/azure-kusto-go/kusto/data/value/dynamic.go rename to vendor/github.com/Azure/azure-kusto-go/azkustodata/value/dynamic.go index e78ea389976..6d76b9ca670 100644 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/dynamic.go +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/dynamic.go @@ -3,69 +3,84 @@ package value import ( "encoding/json" "fmt" + "github.com/Azure/azure-kusto-go/azkustodata/types" "reflect" ) // Dynamic represents a Kusto dynamic type. Dynamic implements Kusto. type Dynamic struct { - // Value holds the value of the type. Value []byte - // Valid indicates if this value was set. - Valid bool } -func (Dynamic) isKustoVal() {} +// NewDynamic creates a new Dynamic. +func NewDynamic(v []byte) *Dynamic { return &Dynamic{v} } -// String implements fmt.Stringer. -func (d Dynamic) String() string { - if !d.Valid { +// NewNullDynamic creates a new null Dynamic. +func NewNullDynamic() *Dynamic { return &Dynamic{nil} } + +func (d *Dynamic) GetValue() interface{} { + return d.Value +} + +func (d *Dynamic) String() string { + if d.Value == nil { return "" } - return string(d.Value) } +func DynamicFromInterface(v interface{}) *Dynamic { + marshal, err := json.Marshal(v) + if err != nil { + return NewNullDynamic() + } + + return NewDynamic(marshal) +} + +func (*Dynamic) isKustoVal() {} + // Unmarshal unmarshal's i into Dynamic. i must be a string, []byte, map[string]interface{}, []interface{}, other JSON serializable value or nil. // If []byte or string, must be a JSON representation of a value. func (d *Dynamic) Unmarshal(i interface{}) error { if i == nil { d.Value = nil - d.Valid = false return nil } switch v := i.(type) { case []byte: d.Value = v - d.Valid = true return nil case string: d.Value = []byte(v) - d.Valid = true return nil } b, err := json.Marshal(i) if err != nil { - return fmt.Errorf("Column with type 'dynamic' was a %T that could not be JSON encoded: %s", i, err) + return parseError(d, i, err) } d.Value = b - d.Valid = true return nil } // Convert Dynamic into reflect value. -func (d Dynamic) Convert(v reflect.Value) error { +func (d *Dynamic) Convert(v reflect.Value) error { t := v.Type() if t.Kind() == reflect.Ptr { t = t.Elem() } + if d.Value == nil { + return nil + } + var valueToSet reflect.Value switch { case t.ConvertibleTo(reflect.TypeOf(Dynamic{})): - valueToSet = reflect.ValueOf(d) + valueToSet = reflect.ValueOf(*d) case t.ConvertibleTo(reflect.TypeOf([]byte{})): if t.Kind() == reflect.String { s := string(d.Value) @@ -74,9 +89,6 @@ func (d Dynamic) Convert(v reflect.Value) error { valueToSet = reflect.ValueOf(d.Value) } case t.Kind() == reflect.Slice || t.Kind() == reflect.Map: - if !d.Valid { - return nil - } ptr := reflect.New(t) if err := json.Unmarshal([]byte(d.Value), ptr.Interface()); err != nil { @@ -106,3 +118,8 @@ func (d Dynamic) Convert(v reflect.Value) error { } return nil } + +// GetType returns the type of the value. +func (d *Dynamic) GetType() types.Column { + return types.Dynamic +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/guid.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/guid.go new file mode 100644 index 00000000000..fb2263678fd --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/guid.go @@ -0,0 +1,48 @@ +package value + +import ( + "github.com/Azure/azure-kusto-go/azkustodata/types" + "reflect" + + "github.com/google/uuid" +) + +// GUID represents a Kusto GUID type. GUID implements Kusto. +type GUID struct { + pointerValue[uuid.UUID] +} + +// NewGUID creates a new GUID. +func NewGUID(v uuid.UUID) *GUID { return &GUID{newPointerValue[uuid.UUID](&v)} } + +// NewNullGUID creates a new null GUID. +func NewNullGUID() *GUID { return &GUID{newPointerValue[uuid.UUID](nil)} } + +// Unmarshal unmarshals i into GUID. i must be a string representing a GUID or nil. +func (g *GUID) Unmarshal(i interface{}) error { + if i == nil { + g.value = nil + return nil + } + str, ok := i.(string) + if !ok { + return convertError(g, i) + } + u, err := uuid.Parse(str) + if err != nil { + return parseError(g, i, err) + } + + g.value = &u + return nil +} + +// Convert GUID into reflect value. +func (g *GUID) Convert(v reflect.Value) error { + return Convert[uuid.UUID](*g, &g.pointerValue, v) +} + +// GetType returns the type of the value. +func (g *GUID) GetType() types.Column { + return types.GUID +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/int.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/int.go new file mode 100644 index 00000000000..c4d8f77c28c --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/int.go @@ -0,0 +1,77 @@ +package value + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-kusto-go/azkustodata/types" + "math" + "reflect" +) + +// Int represents a Kusto boolean type. Bool implements Kusto. +type Int struct { + pointerValue[int32] +} + +func NewInt(v int32) *Int { + return &Int{newPointerValue[int32](&v)} +} + +func NewNullInt() *Int { + return &Int{newPointerValue[int32](nil)} +} + +// Convert Int into reflect value. +func (in *Int) Convert(v reflect.Value) error { + if TryConvert[int32](*in, &in.pointerValue, v) { + return nil + } + + if v.Type().Kind() == reflect.Int { + if in.value != nil { + v.SetInt(int64(*in.value)) + } + return nil + } + + return convertError(in, v) +} + +// GetType returns the type of the value. +func (in *Int) GetType() types.Column { + return types.Int +} + +func (in *Int) Unmarshal(i interface{}) error { + if i == nil { + in.value = nil + return nil + } + + var myInt int64 + + switch v := i.(type) { + case json.Number: + var err error + myInt, err = v.Int64() + if err != nil { + return parseError(in, i, err) + } + case float64: + if v != math.Trunc(v) { + return parseError(in, i, fmt.Errorf("float64 value was not an integer")) + } + myInt = int64(v) + case int: + myInt = int64(v) + default: + return convertError(in, i) + } + + if myInt > math.MaxInt32 { + return parseError(in, i, fmt.Errorf("value was too large for int32")) + } + val := int32(myInt) + in.value = &val + return nil +} diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/long.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/long.go new file mode 100644 index 00000000000..55d5d18d929 --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/long.go @@ -0,0 +1,68 @@ +package value + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-kusto-go/azkustodata/types" + "math" + "reflect" +) + +// Long represents a Kusto long type, which is an int64. Long implements Kusto. +type Long struct { + pointerValue[int64] +} + +func NewLong(i int64) *Long { return &Long{newPointerValue[int64](&i)} } + +func NewNullLong() *Long { return &Long{newPointerValue[int64](nil)} } + +// Unmarshal unmarshals i into Long. i must be an int64 or nil. +func (l *Long) Unmarshal(i interface{}) error { + if i == nil { + l.value = nil + return nil + } + + var myInt int64 + + switch v := i.(type) { + case json.Number: + var err error + myInt, err = v.Int64() + if err != nil { + return parseError(l, i, err) + } + case float64: + if v != math.Trunc(v) { + return parseError(l, i, fmt.Errorf("float64 value was not an integer")) + } + myInt = int64(v) + case int: + myInt = int64(v) + default: + return convertError(l, i) + } + + l.value = &myInt + return nil +} + +// Convert Long into reflect value. +func (l *Long) Convert(v reflect.Value) error { + if TryConvert[int64](*l, &l.pointerValue, v) { + return nil + } + + if v.Type().Kind() == reflect.Int || v.Type().Kind() == reflect.Int32 { + if l.value != nil { + v.SetInt(*l.value) + } + return nil + } + + return convertError(l, v) +} + +// GetType returns the type of the value. +func (l *Long) GetType() types.Column { return types.Long } diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/real.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/real.go new file mode 100644 index 00000000000..5b069eaa66c --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/real.go @@ -0,0 +1,73 @@ +package value + +import ( + "encoding/json" + "github.com/Azure/azure-kusto-go/azkustodata/types" + "reflect" + "strconv" +) + +// Real represents a Kusto real type. Real implements Kusto. +type Real struct { + pointerValue[float64] +} + +func NewReal(i float64) *Real { + return &Real{newPointerValue[float64](&i)} +} +func NewNullReal() *Real { + return &Real{newPointerValue[float64](nil)} +} + +// Unmarshal unmarshals i into Real. i must be a json.Number(that is a float64), float64 or nil. +func (r *Real) Unmarshal(i interface{}) error { + if i == nil { + r.value = nil + return nil + } + + var myFloat float64 + + switch v := i.(type) { + case json.Number: + var err error + myFloat, err = v.Float64() + if err != nil { + return parseError(r, i, err) + } + case float64: + myFloat = v + case string: + var err error + myFloat, err = strconv.ParseFloat(v, 64) + if err != nil { + return parseError(r, i, err) + } + default: + return convertError(r, i) + } + + r.value = &myFloat + return nil +} + +// Convert Real into reflect value. +func (r *Real) Convert(v reflect.Value) error { + if TryConvert[float64](*r, &r.pointerValue, v) { + return nil + } + + if v.Type().Kind() == reflect.Int || v.Type().Kind() == reflect.Int32 { + if r.value != nil { + v.SetInt(int64(*r.value)) + } + return nil + } + + return convertError(r, v) +} + +// GetType returns the type of the value. +func (r *Real) GetType() types.Column { + return types.Real +} diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/string.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/string.go similarity index 62% rename from vendor/github.com/Azure/azure-kusto-go/kusto/data/value/string.go rename to vendor/github.com/Azure/azure-kusto-go/azkustodata/value/string.go index 8eb51e3a2ac..2fd4735543b 100644 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/string.go +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/string.go @@ -2,6 +2,7 @@ package value import ( "fmt" + "github.com/Azure/azure-kusto-go/azkustodata/types" "reflect" ) @@ -9,17 +10,14 @@ import ( type String struct { // Value holds the value of the type. Value string - // Valid indicates if this value was set. - Valid bool } -func (String) isKustoVal() {} +func NewString(v string) *String { + return &String{Value: v} +} // String implements fmt.Stringer. -func (s String) String() string { - if !s.Valid { - return "" - } +func (s *String) String() string { return s.Value } @@ -27,41 +25,45 @@ func (s String) String() string { func (s *String) Unmarshal(i interface{}) error { if i == nil { s.Value = "" - s.Valid = false return nil } v, ok := i.(string) if !ok { - return fmt.Errorf("Column with type 'string' had type %T", i) + return convertError(s, i) } s.Value = v - s.Valid = true return nil } // Convert String into reflect value. -func (s String) Convert(v reflect.Value) error { +func (s *String) Convert(v reflect.Value) error { t := v.Type() switch { case t.Kind() == reflect.String: - if s.Valid { - v.Set(reflect.ValueOf(s.Value)) - } + v.SetString(s.Value) return nil case t.ConvertibleTo(reflect.TypeOf(new(string))): - if s.Valid { - i := &s.Value - v.Set(reflect.ValueOf(i)) - } + i := &s.Value + v.Set(reflect.ValueOf(i)) return nil case t.ConvertibleTo(reflect.TypeOf(String{})): - v.Set(reflect.ValueOf(s)) + v.Set(reflect.ValueOf(*s)) return nil case t.ConvertibleTo(reflect.TypeOf(&String{})): - v.Set(reflect.ValueOf(&s)) + v.Set(reflect.ValueOf(s)) return nil } return fmt.Errorf("Column was type Kusto.String, receiver had base Kind %s ", t.Kind()) } + +// GetValue returns the value of the type. +func (s *String) GetValue() interface{} { + return s.Value +} + +// GetType returns the type of the value. +func (s *String) GetType() types.Column { + return types.String +} diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/timespan.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/timespan.go similarity index 68% rename from vendor/github.com/Azure/azure-kusto-go/kusto/data/value/timespan.go rename to vendor/github.com/Azure/azure-kusto-go/azkustodata/value/timespan.go index 25d85b2334a..d1117733d52 100644 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/timespan.go +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/timespan.go @@ -2,6 +2,7 @@ package value import ( "fmt" + "github.com/Azure/azure-kusto-go/azkustodata/types" "reflect" "strconv" "strings" @@ -9,33 +10,34 @@ import ( ) const tick = 100 * time.Nanosecond +const day = 24 * time.Hour // Timespan represents a Kusto timespan type. Timespan implements Kusto. type Timespan struct { - // Value holds the value of the type. - Value time.Duration - // Valid indicates if this value was set. - Valid bool + pointerValue[time.Duration] } -func (Timespan) isKustoVal() {} +func NewTimespan(v time.Duration) *Timespan { + return &Timespan{newPointerValue[time.Duration](&v)} +} -// String implements fmt.Stringer. -func (t Timespan) String() string { - if !t.Valid { - return "" - } - return t.Value.String() +func NewNullTimespan() *Timespan { + return &Timespan{newPointerValue[time.Duration](nil)} } -// Marshal marshals the Timespan into a Kusto compatible string. The string is the contant invariant(c) -// format. See https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-timespan-format-strings . -func (t Timespan) Marshal() string { - const ( - day = 24 * time.Hour - ) +func TimespanFromString(s string) (*Timespan, error) { + t := &Timespan{} + err := t.Unmarshal(s) + if err != nil { + return nil, err + } + return t, nil +} - if !t.Valid { +// Marshal marshals the Timespan into a Kusto compatible string. The string is the constant invariant (c) +// format. See https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-timespan-format-strings#the-constant-c-format-specifier . +func (t *Timespan) Marshal() string { + if t == nil || t.value == nil || *t.value/tick == 0 { return "00:00:00" } @@ -43,47 +45,34 @@ func (t Timespan) Marshal() string { // For example, after we write to our string the number of days that value had, we remove those days // from the duration. We continue doing this until val only holds values < 10 millionth of a second (tick) // as that is the lowest precision in our string representation. - val := t.Value + val := *t.value - sb := strings.Builder{} + var sb strings.Builder // Add a - sign if we have a negative value. Convert our value to positive for easier processing. - if t.Value < 0 { + if val < 0 { sb.WriteString("-") - val = val * -1 + val = -val } // Only include the day if the duration is 1+ days. days := val / day - val = val - (days * day) if days > 0 { - sb.WriteString(fmt.Sprintf("%d.", int(days))) + sb.WriteString(fmt.Sprintf("%d.", days)) } - // Add our hours:minutes:seconds section. - hours := val / time.Hour - val = val - (hours * time.Hour) - minutes := val / time.Minute - val = val - (minutes * time.Minute) - seconds := val / time.Second - val = val - (seconds * time.Second) - sb.WriteString(fmt.Sprintf("%02d:%02d:%02d", int(hours), int(minutes), int(seconds))) - - // Add our sub-second string representation that is proceeded with a ".". - milliseconds := val / time.Millisecond - val = val - (milliseconds * time.Millisecond) - ticks := val / tick - if milliseconds > 0 || ticks > 0 { - sb.WriteString(fmt.Sprintf(".%03d%d", milliseconds, ticks)) - } + hours := (val % day) / time.Hour + minutes := (val % time.Hour) / time.Minute + seconds := (val % time.Minute) / time.Second + ticks := (val % time.Second) / tick + + sb.WriteString(fmt.Sprintf("%02d:%02d:%02d", hours, minutes, seconds)) - // Remove any trailing 0's. - str := strings.TrimRight(sb.String(), "0") - if strings.HasSuffix(str, ":") { - str = str + "00" + if ticks > 0 { + sb.WriteString(fmt.Sprintf(".%07d", ticks)) } - return str + return sb.String() } // Unmarshal unmarshals i into Timespan. i must be a string representing a Values timespan or nil. @@ -95,14 +84,13 @@ func (t *Timespan) Unmarshal(i interface{}) error { ) if i == nil { - t.Value = 0 - t.Valid = false + t.value = nil return nil } v, ok := i.(string) if !ok { - return fmt.Errorf("Column with type 'timespan' had type %T", i) + return convertError(t, i) } negative := false @@ -115,26 +103,26 @@ func (t *Timespan) Unmarshal(i interface{}) error { sp := strings.Split(v, ":") if len(sp) != 3 { - return fmt.Errorf("value to unmarshal into Timespan does not seem to fit format '00:00:00', where values are decimal(%s)", v) + return parseError(v, sp, fmt.Errorf("value to unmarshal into Timespan does not seem to fit format '00:00:00', where values are decimal(%s)", v)) } var sum time.Duration d, err := t.unmarshalDaysHours(sp[hoursIndex]) if err != nil { - return err + return parseError(v, sp, err) } sum += d d, err = t.unmarshalMinutes(sp[minutesIndex]) if err != nil { - return err + return parseError(v, sp, err) } sum += d d, err = t.unmarshalSeconds(sp[secondsIndex]) if err != nil { - return err + return parseError(v, sp, err) } sum += d @@ -143,13 +131,10 @@ func (t *Timespan) Unmarshal(i interface{}) error { sum = sum * time.Duration(-1) } - t.Value = sum - t.Valid = true + t.value = &sum return nil } -var day = 24 * time.Hour - func (t *Timespan) unmarshalDaysHours(s string) (time.Duration, error) { sp := strings.Split(s, ".") switch len(sp) { @@ -241,26 +226,35 @@ func (t *Timespan) unmarshalSeconds(s string) (time.Duration, error) { } // Convert Timespan into reflect value. -func (ts Timespan) Convert(v reflect.Value) error { - t := v.Type() +func (t *Timespan) Convert(v reflect.Value) error { + pt := v.Type() switch { - case t.AssignableTo(reflect.TypeOf(time.Duration(0))): - if ts.Valid { - v.Set(reflect.ValueOf(ts.Value)) + case pt.AssignableTo(reflect.TypeOf(time.Duration(0))): + if t.value != nil { + v.Set(reflect.ValueOf(*t.value)) } return nil - case t.ConvertibleTo(reflect.TypeOf(new(time.Duration))): - if ts.Valid { - t := &ts.Value - v.Set(reflect.ValueOf(t)) + case pt.ConvertibleTo(reflect.TypeOf(new(time.Duration))): + if t.value != nil { + pt := t.value + v.Set(reflect.ValueOf(pt)) } return nil - case t.ConvertibleTo(reflect.TypeOf(Timespan{})): - v.Set(reflect.ValueOf(ts)) + case pt.ConvertibleTo(reflect.TypeOf(Timespan{})): + v.Set(reflect.ValueOf(*t)) return nil - case t.ConvertibleTo(reflect.TypeOf(&Timespan{})): - v.Set(reflect.ValueOf(&ts)) + case pt.ConvertibleTo(reflect.TypeOf(&Timespan{})): + v.Set(reflect.ValueOf(t)) return nil } - return fmt.Errorf("Column was type Kusto.Timespan, receiver had base Kind %s ", t.Kind()) + return convertError(t, v) +} + +func TimespanString(d time.Duration) string { + return NewTimespan(d).Marshal() +} + +// GetType returns the type of the value. +func (t *Timespan) GetType() types.Column { + return types.Timespan } diff --git a/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/value.go b/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/value.go new file mode 100644 index 00000000000..ef0d56ff3b4 --- /dev/null +++ b/vendor/github.com/Azure/azure-kusto-go/azkustodata/value/value.go @@ -0,0 +1,170 @@ +/* +Package value holds Kusto data value representations. All types provide a Kusto that +stores the native value and Valid which indicates if the value was set or was null. + +# Kusto Value + +A value.Kusto can hold types that represent Kusto Scalar types that define column data. +We represent that with an interface: + + type Kusto interface + +This interface can hold the following values: + + value.Bool + value.Int + value.Long + value.Real + value.Decimal + value.String + value.Dynamic + value.DateTime + value.Timespan + +Each type defined above has at minimum two fields: + + .Value - The type specific value + .Valid - True if the value was non-null in the Kusto table + +Each provides at minimum the following two methods: + + .String() - Returns the string representation of the value. + .Unmarshal() - Unmarshals the value into a standard Go type. + +The Unmarshal() is for internal use, it should not be needed by an end user. Use .Value or table.Row.ToStruct() instead. +*/ +package value + +import ( + "fmt" + "github.com/Azure/azure-kusto-go/azkustodata/errors" + "github.com/Azure/azure-kusto-go/azkustodata/types" + "reflect" +) + +type pointerValue[T any] struct { + value *T +} + +func newPointerValue[T any](v *T) pointerValue[T] { + return pointerValue[T]{value: v} +} + +func (p *pointerValue[T]) String() string { + if p.value == nil { + return "" + } + return fmt.Sprintf("%v", *p.value) +} + +func (p *pointerValue[T]) GetValue() interface{} { + return p.value +} + +func (p *pointerValue[T]) Ptr() *T { + return p.value +} + +func convertError(expected interface{}, actual interface{}) error { + if ref, ok := actual.(reflect.Value); ok { + return errors.ES(errors.OpTableAccess, errors.KWrongColumnType, "column with type '%T' had value that was %v", expected, ref.Type()) + } + return errors.ES(errors.OpTableAccess, errors.KWrongColumnType, "column with type '%T' had value that was %T", expected, actual) +} + +func parseError(expected interface{}, actual interface{}, err error) error { + return errors.ES(errors.OpTableAccess, errors.KFailedToParse, "column with type '%T' had value %s which did not parse: %s", expected, actual, err) +} + +func (p *pointerValue[T]) Unmarshal(i interface{}) error { + if i == nil { + p.value = nil + return nil + } + + v, ok := i.(T) + if !ok { + return convertError(p, i) + } + + p.value = &v + return nil +} + +func TryConvert[T any](holder interface{}, p *pointerValue[T], v reflect.Value) bool { + t := v.Type() + + if holder == nil || p.value == nil { + v.Set(reflect.Zero(t)) + return true + } + + if reflect.TypeOf(*p.value).ConvertibleTo(t) { + v.Set(reflect.ValueOf(*p.value).Convert(t)) + return true + } + + if reflect.TypeOf(p.value).ConvertibleTo(t) { + v.Set(reflect.ValueOf(p.value).Convert(t)) + return true + } + + if reflect.TypeOf(holder).ConvertibleTo(t) { + v.Set(reflect.ValueOf(holder).Convert(t)) + return true + } + + if reflect.TypeOf(&holder).ConvertibleTo(t) { + v.Set(reflect.ValueOf(&holder).Convert(t)) + return true + } + + return false +} + +func Convert[T any](holder interface{}, p *pointerValue[T], v reflect.Value) error { + if !TryConvert[T](holder, p, v) { + return convertError(holder, v) + } + + return nil +} + +// Kusto represents a Kusto value. +type Kusto interface { + fmt.Stringer + Convert(v reflect.Value) error + GetValue() interface{} + GetType() types.Column + Unmarshal(interface{}) error +} + +func Default(t types.Column) Kusto { + switch t { + case types.Bool: + return NewNullBool() + case types.Int: + return NewNullInt() + case types.Long: + return NewNullLong() + case types.Real: + return NewNullReal() + case types.Decimal: + return NewNullDecimal() + case types.String: + return NewString("") + case types.Dynamic: + return NewNullDynamic() + case types.DateTime: + return NewNullDateTime() + case types.Timespan: + return NewNullTimespan() + case types.GUID: + return NewNullGUID() + default: + return nil + } +} + +// Values is a list of Kusto values, usually an ordered row. +type Values []Kusto diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/data/table/from_kusto.go b/vendor/github.com/Azure/azure-kusto-go/kusto/data/table/from_kusto.go deleted file mode 100644 index 428071dc93d..00000000000 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/data/table/from_kusto.go +++ /dev/null @@ -1,66 +0,0 @@ -package table - -// value.go provides methods for converting a row to a *struct and for converting KustoValue into Go types -// or in the reverse. - -import ( - "fmt" - "reflect" - "strings" - - "github.com/Azure/azure-kusto-go/kusto/data/value" -) - -// decodeToStruct takes a list of columns and a row to decode into "p" which will be a pointer -// to a struct (enforce in the decoder). -func decodeToStruct(cols Columns, row value.Values, p interface{}) error { - t := reflect.TypeOf(p) - v := reflect.ValueOf(p) - fields := newFields(cols, t) - - for i, col := range cols { - if err := fields.convert(col, row[i], t, v); err != nil { - return err - } - } - return nil -} - -// fields represents the fields inside a struct. -type fields struct { - colNameToFieldName map[string]string -} - -// newFields takes in the Columns from our row and the reflect.Type of our *struct. -func newFields(cols Columns, ptr reflect.Type) fields { - nFields := fields{colNameToFieldName: map[string]string{}} - for i := 0; i < ptr.Elem().NumField(); i++ { - field := ptr.Elem().Field(i) - if tag := field.Tag.Get("kusto"); strings.TrimSpace(tag) != "" { - nFields.colNameToFieldName[tag] = field.Name - } else { - nFields.colNameToFieldName[field.Name] = field.Name - } - } - - return nFields -} - -// convert converts a KustoValue that is for Column col into "v" reflect.Value with reflect.Type "t". -func (f fields) convert(col Column, k value.Kusto, t reflect.Type, v reflect.Value) error { - fieldName, ok := f.colNameToFieldName[col.Name] - if !ok { - return nil - } - - if fieldName == "-" { - return nil - } - - err := k.Convert(v.Elem().FieldByName(fieldName)) - if err != nil { - return fmt.Errorf("column %s could not store in struct.%s: %s", col.Name, fieldName, err.Error()) - } - - return nil -} diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/data/table/table.go b/vendor/github.com/Azure/azure-kusto-go/kusto/data/table/table.go deleted file mode 100644 index d7182b6c8ed..00000000000 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/data/table/table.go +++ /dev/null @@ -1,174 +0,0 @@ -// Package table contains types that represent the makeup of a Kusto table. -package table - -import ( - "encoding/csv" - "fmt" - "reflect" - "strings" - - "github.com/Azure/azure-kusto-go/kusto/data/errors" - "github.com/Azure/azure-kusto-go/kusto/data/types" - "github.com/Azure/azure-kusto-go/kusto/data/value" -) - -// Column describes a column descriptor. -type Column struct { - // Name is the name of the column. - Name string `json:"ColumnName"` - // Type is the type of value stored in this column. These are described - // via constants starting with CT. - Type types.Column `json:"ColumnType"` -} - -// Columns is a set of columns. -type Columns []Column - -func (c Columns) Validate() error { - if len(c) == 0 { - return fmt.Errorf("Columns is zero length") - } - - names := make(map[string]bool, len(c)) - - for i, col := range c { - if col.Name == "" { - return fmt.Errorf("column[%d].Name is empty string", i) - } - if names[col.Name] { - return fmt.Errorf("column[%d].Name(%s) is already defined", i, col.Name) - } - names[col.Name] = true - - if !col.Type.Valid() { - return fmt.Errorf("column[%d] if of type %q, which is not valid", i, col.Type) - } - } - return nil -} - -// Row represents a row of Kusto data. Methods are not thread-safe. -type Row struct { - // ColumnType contains all the column type information for the row. - ColumnTypes Columns - // Values is the list of values that make up the row. - Values value.Values - // Op is the operation that resulted in the row. This is for internal use. - Op errors.Op - // Replace indicates whether the existing result set should be cleared and replaced with this row. - Replace bool - - columnNames []string -} - -// ColumnNames returns a list of all column names. -func (r *Row) ColumnNames() []string { - if r.columnNames == nil { - for _, col := range r.ColumnTypes { - r.columnNames = append(r.columnNames, col.Name) - } - } - return r.columnNames -} - -// Size returns the number of columns contained in Row. -func (r *Row) Size() int { - return len(r.ColumnTypes) -} - -// Columns fetches all column names in the row at once. -// The name of the kth column will be decoded into the kth argument to Columns. -// The number of arguments must be equal to the number of columns. -// Pass nil to specify that a column should be ignored. -// ptrs may be either the *string or *types.Column type. An error in decoding may leave -// some ptrs set and others not. -func (r *Row) Columns(ptrs ...interface{}) error { - if len(ptrs) != len(r.ColumnTypes) { - return errors.ES(r.Op, errors.KClientArgs, ".Columns() requires %d arguments for this row, had %d", len(r.ColumnTypes), len(ptrs)) - } - - for i, col := range r.ColumnTypes { - if ptrs[i] == nil { - continue - } - switch v := ptrs[i].(type) { - case *string: - *v = col.Name - case *Column: - v.Name = col.Name - v.Type = col.Type - default: - return errors.ES(r.Op, errors.KClientArgs, ".Columns() received argument at position %d that was not a *string, *types.Columns: was %T", i, ptrs[i]) - } - } - - return nil -} - -// ExtractValues fetches all values in the row at once. -// The value of the kth column will be decoded into the kth argument to ExtractValues. -// The number of arguments must be equal to the number of columns. -// Pass nil to specify that a column should be ignored. -// ptrs should be compatible with column types. An error in decoding may leave -// some ptrs set and others not. -func (r *Row) ExtractValues(ptrs ...interface{}) error { - if len(ptrs) != len(r.ColumnTypes) { - return errors.ES(r.Op, errors.KClientArgs, ".Columns() requires %d arguments for this row, had %d", len(r.ColumnTypes), len(ptrs)) - } - - for i, val := range r.Values { - if ptrs[i] == nil { - continue - } - if err := val.Convert(reflect.ValueOf(ptrs[i]).Elem()); err != nil { - return err - } - } - - return nil -} - -// ToStruct fetches the columns in a row into the fields of a struct. p must be a pointer to struct. -// The rules for mapping a row's columns into a struct's exported fields are: -// -// 1. If a field has a `kusto: "column_name"` tag, then decode column -// 'column_name' into the field. A special case is the `column_name: "-"` -// tag, which instructs ToStruct to ignore the field during decoding. -// -// 2. Otherwise, if the name of a field matches the name of a column (ignoring case), -// decode the column into the field. -// -// Slice and pointer fields will be set to nil if the source column is a null value, and a -// non-nil value if the column is not NULL. To decode NULL values of other types, use -// one of the kusto types (Int, Long, Dynamic, ...) as the type of the destination field. -// You can check the .Valid field of those types to see if the value was set. -func (r *Row) ToStruct(p interface{}) error { - // Check if p is a pointer to a struct - if t := reflect.TypeOf(p); t == nil || t.Kind() != reflect.Ptr || t.Elem().Kind() != reflect.Struct { - return errors.ES(r.Op, errors.KClientArgs, "type %T is not a pointer to a struct", p) - } - if len(r.ColumnTypes) != len(r.Values) { - return errors.ES(r.Op, errors.KClientArgs, "row does not have the correct number of values(%d) for the number of columns(%d)", len(r.Values), len(r.ColumnTypes)) - } - - return decodeToStruct(r.ColumnTypes, r.Values, p) -} - -// String implements fmt.Stringer for a Row. This simply outputs a CSV version of the row. -func (r *Row) String() string { - line := []string{} - for _, v := range r.Values { - line = append(line, v.String()) - } - b := &strings.Builder{} - w := csv.NewWriter(b) - err := w.Write(line) - if err != nil { - return "" - } - w.Flush() - return b.String() -} - -// Rows is a set of rows. -type Rows []*Row diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/bool.go b/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/bool.go deleted file mode 100644 index a8fda7a25c1..00000000000 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/bool.go +++ /dev/null @@ -1,71 +0,0 @@ -package value - -import ( - "fmt" - "reflect" -) - -// Bool represents a Kusto boolean type. Bool implements Kusto. -type Bool struct { - // Value holds the value of the type. - Value bool - // Valid indicates if this value was set. - Valid bool -} - -func (Bool) isKustoVal() {} - -// String implements fmt.Stringer. -func (bo Bool) String() string { - if !bo.Valid { - return "" - } - if bo.Value { - return "true" - } - return "false" -} - -// Unmarshal unmarshals i into Bool. i must be a bool or nil. -func (bo *Bool) Unmarshal(i interface{}) error { - if i == nil { - bo.Value = false - bo.Valid = false - return nil - } - v, ok := i.(bool) - if !ok { - return fmt.Errorf("Column with type 'bool' had value that was %T", i) - } - bo.Value = v - bo.Valid = true - return nil -} - -// Convert Bool into reflect value. -func (bo Bool) Convert(v reflect.Value) error { - t := v.Type() - switch { - case t.Kind() == reflect.Bool: - if bo.Valid { - v.SetBool(bo.Value) - } - return nil - case t.ConvertibleTo(reflect.TypeOf(new(bool))): - if bo.Valid { - b := new(bool) - if bo.Value { - *b = true - } - v.Set(reflect.ValueOf(b)) - } - return nil - case t.ConvertibleTo(reflect.TypeOf(Bool{})): - v.Set(reflect.ValueOf(bo)) - return nil - case t.ConvertibleTo(reflect.TypeOf(&Bool{})): - v.Set(reflect.ValueOf(&bo)) - return nil - } - return fmt.Errorf("Column was type Kusto.Bool, receiver had base Kind %s ", t.Kind()) -} diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/datetime.go b/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/datetime.go deleted file mode 100644 index dbc96574bdd..00000000000 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/datetime.go +++ /dev/null @@ -1,81 +0,0 @@ -package value - -import ( - "fmt" - "reflect" - "time" -) - -// DateTime represents a Kusto datetime type. DateTime implements Kusto. -type DateTime struct { - // Value holds the value of the type. - Value time.Time - // Valid indicates if this value was set. - Valid bool -} - -// String implements fmt.Stringer. -func (d DateTime) String() string { - if !d.Valid { - return "" - } - return fmt.Sprint(d.Value.Format(time.RFC3339Nano)) -} - -func (DateTime) isKustoVal() {} - -// Marshal marshals the DateTime into a Kusto compatible string. -func (d DateTime) Marshal() string { - if !d.Valid { - return time.Time{}.Format(time.RFC3339Nano) - } - return d.Value.Format(time.RFC3339Nano) -} - -// Unmarshal unmarshals i into DateTime. i must be a string representing RFC3339Nano or nil. -func (d *DateTime) Unmarshal(i interface{}) error { - if i == nil { - d.Value = time.Time{} - d.Valid = false - return nil - } - - str, ok := i.(string) - if !ok { - return fmt.Errorf("Column with type 'datetime' had value that was %T", i) - } - - t, err := time.Parse(time.RFC3339Nano, str) - if err != nil { - return fmt.Errorf("Column with type 'datetime' had value %s which did not parse: %s", str, err) - } - d.Value = t - d.Valid = true - - return nil -} - -// Convert DateTime into reflect value. -func (d DateTime) Convert(v reflect.Value) error { - t := v.Type() - switch { - case t.AssignableTo(reflect.TypeOf(time.Time{})): - if d.Valid { - v.Set(reflect.ValueOf(d.Value)) - } - return nil - case t.ConvertibleTo(reflect.TypeOf(new(time.Time))): - if d.Valid { - t := &d.Value - v.Set(reflect.ValueOf(t)) - } - return nil - case t.ConvertibleTo(reflect.TypeOf(DateTime{})): - v.Set(reflect.ValueOf(d)) - return nil - case t.ConvertibleTo(reflect.TypeOf(&DateTime{})): - v.Set(reflect.ValueOf(&d)) - return nil - } - return fmt.Errorf("Column was type Kusto.DateTime, receiver had base Kind %s ", t.Kind()) -} diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/decimal.go b/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/decimal.go deleted file mode 100644 index 26d6f479754..00000000000 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/decimal.go +++ /dev/null @@ -1,82 +0,0 @@ -package value - -import ( - "fmt" - "math/big" - "reflect" - "regexp" -) - -// Decimal represents a Kusto decimal type. Decimal implements Kusto. -// Because Go does not have a dynamic decimal type that meets all needs, Decimal -// provides the string representation for you to unmarshal into. -type Decimal struct { - // Value holds the value of the type. - Value string - // Valid indicates if this value was set. - Valid bool -} - -func (Decimal) isKustoVal() {} - -// String implements fmt.Stringer. -func (d Decimal) String() string { - if !d.Valid { - return "" - } - return d.Value -} - -// ParseFloat provides builtin support for Go's *big.Float conversion where that type meets your needs. -func (d *Decimal) ParseFloat(base int, prec uint, mode big.RoundingMode) (f *big.Float, b int, err error) { - return big.ParseFloat(d.Value, base, prec, mode) -} - -var DecRE = regexp.MustCompile(`^((\d+\.?\d*)|(\d*\.?\d+))$`) // Matches decimal numbers, with or without decimal dot, with optional parts missing. - -// Unmarshal unmarshals i into Decimal. i must be a string representing a decimal type or nil. -func (d *Decimal) Unmarshal(i interface{}) error { - if i == nil { - d.Value = "" - d.Valid = false - return nil - } - - v, ok := i.(string) - if !ok { - return fmt.Errorf("Column with type 'decimal' had type %T", i) - } - - if !DecRE.MatchString(v) { - return fmt.Errorf("column with type 'decimal' does not appear to be a decimal number, was %v", v) - } - - d.Value = v - d.Valid = true - return nil -} - -// Convert Decimal into reflect value. -func (d Decimal) Convert(v reflect.Value) error { - t := v.Type() - switch { - case t.Kind() == reflect.String: - if d.Valid { - v.Set(reflect.ValueOf(d.Value)) - } - return nil - case t.ConvertibleTo(reflect.TypeOf(new(string))): - if d.Valid { - i := &d.Value - v.Set(reflect.ValueOf(i)) - } - return nil - case t.ConvertibleTo(reflect.TypeOf(Decimal{})): - v.Set(reflect.ValueOf(d)) - return nil - case t.ConvertibleTo(reflect.TypeOf(&Decimal{})): - v.Set(reflect.ValueOf(&d)) - return nil - } - return fmt.Errorf("Column was type Kusto.Decimal, receiver had base Kind %s ", t.Kind()) -} diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/guid.go b/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/guid.go deleted file mode 100644 index 321bdacd4a6..00000000000 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/guid.go +++ /dev/null @@ -1,71 +0,0 @@ -package value - -import ( - "fmt" - "reflect" - - "github.com/google/uuid" -) - -// GUID represents a Kusto GUID type. GUID implements Kusto. -type GUID struct { - // Value holds the value of the type. - Value uuid.UUID - // Valid indicates if this value was set. - Valid bool -} - -func (GUID) isKustoVal() {} - -// String implements fmt.Stringer. -func (g GUID) String() string { - if !g.Valid { - return "" - } - return g.Value.String() -} - -// Unmarshal unmarshals i into GUID. i must be a string representing a GUID or nil. -func (g *GUID) Unmarshal(i interface{}) error { - if i == nil { - g.Value = uuid.UUID{} - g.Valid = false - return nil - } - str, ok := i.(string) - if !ok { - return fmt.Errorf("Column with type 'guid' was not stored as a string, was %T", i) - } - u, err := uuid.Parse(str) - if err != nil { - return fmt.Errorf("Column with type 'guid' did not store a valid uuid(%s): %s", str, err) - } - g.Value = u - g.Valid = true - return nil -} - -// Convert GUID into reflect value. -func (g GUID) Convert(v reflect.Value) error { - t := v.Type() - switch { - case t.AssignableTo(reflect.TypeOf(uuid.UUID{})): - if g.Valid { - v.Set(reflect.ValueOf(g.Value)) - } - return nil - case t.ConvertibleTo(reflect.TypeOf(new(uuid.UUID))): - if g.Valid { - t := &g.Value - v.Set(reflect.ValueOf(t)) - } - return nil - case t.ConvertibleTo(reflect.TypeOf(GUID{})): - v.Set(reflect.ValueOf(g)) - return nil - case t.ConvertibleTo(reflect.TypeOf(&GUID{})): - v.Set(reflect.ValueOf(&g)) - return nil - } - return fmt.Errorf("Column was type Kusto.GUID, receiver had base Kind %s ", t.Kind()) -} diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/int.go b/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/int.go deleted file mode 100644 index c7b4cf6bf76..00000000000 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/int.go +++ /dev/null @@ -1,103 +0,0 @@ -package value - -import ( - "encoding/json" - "fmt" - "math" - "reflect" - "strconv" -) - -// Int represents a Kusto int type. Values int type's are int32 values. Int implements Kusto. -type Int struct { - // Value holds the value of the type. - Value int32 - // Valid indicates if this value was set. - Valid bool -} - -func (Int) isKustoVal() {} - -// String implements fmt.Stringer. -func (in Int) String() string { - if !in.Valid { - return "" - } - return strconv.Itoa(int(in.Value)) -} - -// Unmarshal unmarshals i into Int. i must be an int32 or nil. -func (in *Int) Unmarshal(i interface{}) error { - if i == nil { - in.Value = 0 - in.Valid = false - return nil - } - - var myInt int64 - - switch v := i.(type) { - case json.Number: - var err error - myInt, err = v.Int64() - if err != nil { - return fmt.Errorf("Column with type 'int' had value json.Number that had error on .Int64(): %s", err) - } - case float64: - if v != math.Trunc(v) { - return fmt.Errorf("Column with type 'int' had value float64(%v) that did not represent a whole number", v) - } - myInt = int64(v) - case int: - myInt = int64(v) - default: - return fmt.Errorf("Column with type 'int' had value that was not a json.Number or int, was %T", i) - } - - if myInt > math.MaxInt32 { - return fmt.Errorf("Column with type 'int' had value that was greater than an int32 can hold, was %d", myInt) - } - in.Value = int32(myInt) - in.Valid = true - return nil -} - -var ( - int32PtrType = reflect.TypeOf((*int32)(nil)) - int32Type = int32PtrType.Elem() - kustoIntPtrType = reflect.TypeOf((*Int)(nil)) - kustoIntType = kustoIntPtrType.Elem() -) - -// Convert Int into reflect value. -func (in Int) Convert(v reflect.Value) error { - t := v.Type() - switch t { - case int32Type: - if in.Valid { - v.SetInt(int64(in.Value)) - } - case kustoIntType: - v.Set(reflect.ValueOf(in)) - case kustoIntPtrType: - v.Set(reflect.ValueOf(&in)) - default: - switch { - case int32Type.ConvertibleTo(t): - if in.Valid { - v.Set(reflect.ValueOf(in.Value).Convert(t)) - } - case int32PtrType.ConvertibleTo(t): - if in.Valid { - v.Set(reflect.ValueOf(&in.Value).Convert(t)) - } - case kustoIntType.ConvertibleTo(t): - v.Set(reflect.ValueOf(in).Convert(t)) - case kustoIntPtrType.ConvertibleTo(t): - v.Set(reflect.ValueOf(&in).Convert(t)) - default: - return fmt.Errorf("Column was type Kusto.Int, receiver had base Kind %s ", t.Kind()) - } - } - return nil -} diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/long.go b/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/long.go deleted file mode 100644 index 85ab72524c4..00000000000 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/long.go +++ /dev/null @@ -1,86 +0,0 @@ -package value - -import ( - "encoding/json" - "fmt" - "math" - "reflect" - "strconv" -) - -// Long represents a Kusto long type, which is an int64. Long implements Kusto. -type Long struct { - // Value holds the value of the type. - Value int64 - // Valid indicates if this value was set. - Valid bool -} - -func (Long) isKustoVal() {} - -// String implements fmt.Stringer. -func (l Long) String() string { - if !l.Valid { - return "" - } - return strconv.Itoa(int(l.Value)) -} - -// Unmarshal unmarshals i into Long. i must be an int64 or nil. -func (l *Long) Unmarshal(i interface{}) error { - if i == nil { - l.Value = 0 - l.Valid = false - return nil - } - - var myInt int64 - - switch v := i.(type) { - case json.Number: - var err error - myInt, err = v.Int64() - if err != nil { - return fmt.Errorf("Column with type 'long' had value json.Number that had error on .Int64(): %s", err) - } - case int: - myInt = int64(v) - case float64: - if v != math.Trunc(v) { - return fmt.Errorf("Column with type 'int' had value float64(%v) that did not represent a whole number", v) - } - myInt = int64(v) - default: - return fmt.Errorf("Column with type 'ong' had value that was not a json.Number or int, was %T", i) - } - - l.Value = myInt - l.Valid = true - return nil -} - -// Convert Long into reflect value. -func (l Long) Convert(v reflect.Value) error { - t := v.Type() - switch { - case t.Kind() == reflect.Int64: - if l.Valid { - v.Set(reflect.ValueOf(l.Value)) - } - return nil - case t.ConvertibleTo(reflect.TypeOf(new(int64))): - if l.Valid { - i := &l.Value - fmt.Println(i) - v.Set(reflect.ValueOf(i)) - } - return nil - case t.ConvertibleTo(reflect.TypeOf(Long{})): - v.Set(reflect.ValueOf(l)) - return nil - case t.ConvertibleTo(reflect.TypeOf(&Long{})): - v.Set(reflect.ValueOf(&l)) - return nil - } - return fmt.Errorf("Column was type Kusto.Long, receiver had base Kind %s ", t.Kind()) -} diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/real.go b/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/real.go deleted file mode 100644 index 9dc396df668..00000000000 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/real.go +++ /dev/null @@ -1,79 +0,0 @@ -package value - -import ( - "encoding/json" - "fmt" - "reflect" - "strconv" -) - -// Real represents a Kusto real type. Real implements Kusto. -type Real struct { - // Value holds the value of the type. - Value float64 - // Valid indicates if this value was set. - Valid bool -} - -func (Real) isKustoVal() {} - -// String implements fmt.Stringer. -func (r Real) String() string { - if !r.Valid { - return "" - } - return strconv.FormatFloat(r.Value, 'e', -1, 64) -} - -// Unmarshal unmarshals i into Real. i must be a json.Number(that is a float64), float64 or nil. -func (r *Real) Unmarshal(i interface{}) error { - if i == nil { - r.Value = 0.0 - r.Valid = false - return nil - } - - var myFloat float64 - - switch v := i.(type) { - case json.Number: - var err error - myFloat, err = v.Float64() - if err != nil { - return fmt.Errorf("Column with type 'real' had value json.Number that had error on .Float64(): %s", err) - } - case float64: - myFloat = v - default: - return fmt.Errorf("Column with type 'real' had value that was not a json.Number or float64, was %T", i) - } - - r.Value = myFloat - r.Valid = true - return nil -} - -// Convert Real into reflect value. -func (r Real) Convert(v reflect.Value) error { - t := v.Type() - switch { - case t.Kind() == reflect.Float64: - if r.Valid { - v.Set(reflect.ValueOf(r.Value)) - } - return nil - case t.ConvertibleTo(reflect.TypeOf(new(float64))): - if r.Valid { - i := &r.Value - v.Set(reflect.ValueOf(i)) - } - return nil - case t.ConvertibleTo(reflect.TypeOf(Real{})): - v.Set(reflect.ValueOf(r)) - return nil - case t.ConvertibleTo(reflect.TypeOf(&Real{})): - v.Set(reflect.ValueOf(&r)) - return nil - } - return fmt.Errorf("Column was type Kusto.Real, receiver had base Kind %s ", t.Kind()) -} diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/value.go b/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/value.go deleted file mode 100644 index 35c59e46dca..00000000000 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/data/value/value.go +++ /dev/null @@ -1,50 +0,0 @@ -/* -Package value holds Kusto data value representations. All types provide a Kusto that -stores the native value and Valid which indicates if the value was set or was null. - -# Kusto Value - -A value.Kusto can hold types that represent Kusto Scalar types that define column data. -We represent that with an interface: - - type Kusto interface - -This interface can hold the following values: - - value.Bool - value.Int - value.Long - value.Real - value.Decimal - value.String - value.Dynamic - value.DateTime - value.Timespan - -Each type defined above has at minimum two fields: - - .Value - The type specific value - .Valid - True if the value was non-null in the Kusto table - -Each provides at minimum the following two methods: - - .String() - Returns the string representation of the value. - .Unmarshal() - Unmarshals the value into a standard Go type. - -The Unmarshal() is for internal use, it should not be needed by an end user. Use .Value or table.Row.ToStruct() instead. -*/ -package value - -import "reflect" - -// Kusto represents a Kusto value. -type Kusto interface { - isKustoVal() - // String implements fmt.Stringer(). - String() string - // Convert into reflect value. - Convert(v reflect.Value) error -} - -// Values is a list of Kusto values, usually an ordered row. -type Values []Kusto diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/doc.go b/vendor/github.com/Azure/azure-kusto-go/kusto/doc.go deleted file mode 100644 index 9934bec77fa..00000000000 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/doc.go +++ /dev/null @@ -1,355 +0,0 @@ -// Copyright 2020 Microsoft Corporation. All rights reserved. -// Use of this source code is governed by an MIT -// license that can be found in the LICENSE file. -// -// Additional licenses for third-pary packages can be found in third_party_licenses/ - -/* -Package kusto provides a client for accessing Azure Data Explorer, also known as Kusto. - -For details on the Azure Kusto service, see: https://azure.microsoft.com/en-us/services/data-explorer/ - -For general documentation on APIs and the Kusto query language, see: https://docs.microsoft.com/en-us/azure/data-explorer/ - -## Examples - -Examples for various scenarios can be found on [pkg.go.dev](https://pkg.go.dev/github.com/Azure/azure-kusto-go#readme-examples) or in the example*_test.go files in our GitHub repo for [azure-kusto-go](https://github.com/Azure/azure-kusto-go/tree/master/kusto). - -### Create the connection string - -Azure Data Explorer (Kusto) connection strings are created using a connection string builder for an existing Azure Data Explorer (Kusto) cluster endpoint of the form `https://..kusto.windows.net`. - -```go -kustoConnectionStringBuilder := kusto.NewConnectionStringBuilder(endpoint) -``` - -### Create and authenticate the client - -Azure Data Explorer (Kusto) clients are created from a connection string and authenticated using a credential from the [Azure Identity package][azure_identity_pkg], like [DefaultAzureCredential][default_azure_credential]. -You can also authenticate a client using a system- or user-assigned managed identity with Azure Active Directory (AAD) credentials. - -#### Using the `DefaultAzureCredential` - -```go -// kusto package is: github.com/Azure/azure-kusto-go/kusto - -// Initialize a new kusto client using the default Azure credential -kustoConnectionString := kustoConnectionStringBuilder.WithDefaultAzureCredential() -client, err = kusto.New(kustoConnectionString) - - if err != nil { - panic("add error handling") - } - -// Be sure to close the client when you're done. (Error handling omitted for brevity.) -defer client.Close() -``` - -#### Using the `az cli` - -```go -kustoConnectionString := kustoConnectionStringBuilder.WithAzCli() -client, err = kusto.New(kustoConnectionString) -``` - -#### Using a system-assigned managed identity - -```go -kustoConnectionString := kustoConnectionStringBuilder.WithSystemManagedIdentity() -client, err = kusto.New(kustoConnectionString) -``` - -#### Using a user-assigned managed identity - -```go -kustoConnectionString := kustoConnectionStringBuilder.WithUserManagedIdentity(clientID) -client, err = kusto.New(kustoConnectionString) -``` - -#### Using a bearer token - -```go -kustoConnectionString := kustoConnectionStringBuilder.WithApplicationToken(appId, token) -client, err = kusto.New(kustoConnectionString) -``` - -#### Using an app id and secret - -```go -kustoConnectionString := kustoConnectionStringBuilder.WithAadAppKey(clientID, clientSecret, tenantID) -client, err = kusto.New(kustoConnectionString) -``` - -#### Using an application certificate - -```go -kustoConnectionString := kustoConnectionStringBuilder.WithAppCertificate(appId, certificate, thumbprint, sendCertChain, authorityID) -client, err = kusto.New(kustoConnectionString) -``` - -### Querying - -#### Simple queries - -* Works for queries and management commands. -* Limited to queries that can be built using a string literal known at compile time. - -The simplest queries can be built using `kql.New`: - -```go -query := kql.New("systemNodes | project CollectionTime, NodeId") -``` - -Queries can only be built using a string literals known at compile time, and special methods for specific parts of the query. -The reason for this is to discourage the use of string concatenation to build queries, which can lead to security vulnerabilities. - -#### Queries with parameters - -* Can re-use the same query with different parameters. -* Only work for queries, management commands are not supported. - -It is recommended to use parameters for queries that contain user input. -Management commands can not use parameters, and therefore should be built using the builder (see next section). - -Parameters can be implicitly referenced in a query: - -```go -query := kql.New("systemNodes | project CollectionTime, NodeId | where CollectionTime > startTime and NodeId == nodeIdValue") -``` - -Here, `startTime` and `nodeIdValue` are parameters that can be passed to the query. - -To Pass the parameters values to the query, create `kql.Parameters`: - -``` -params := kql.NewParameters().AddDateTime("startTime", dt).AddInt("nodeIdValue", 1) -``` - -And then pass it to the `Query` method, as an option: -```go -results, err := client.Query(ctx, database, query, QueryParameters(params)) - - if err != nil { - panic("add error handling") - } - -// You can see the generated parameters using the ToDeclarationString() method: -fmt.Println(params.ToDeclarationString()) // declare query_parameters(startTime:datetime, nodeIdValue:int); -``` - -#### Queries with inline parameters -* Works for queries and management commands. -* More involved building of queries, but allows for more flexibility. - -Queries with runtime data can be built using `kql.New`. -The builder will only accept the correct types for each part of the query, and will escape any special characters in the data. - -For example, here is a query that dynamically accepts values for the table name, and the comparison parameters for the columns: - -```go -dt, _ := time.Parse(time.RFC3339Nano, "2020-03-04T14:05:01.3109965Z") -tableName := "system nodes" -value := 1 - -query := kql.New("") - - .AddTable(tableName) - .AddLiteral(" | where CollectionTime == ").AddDateTime(dt) - .AddLiteral(" and ") - .AddLiteral("NodeId == ").AddInt(value) - -// To view the query string, use the String() method: -fmt.Println(query.String()) -// Output: ['system nodes'] | where CollectionTime == datetime(2020-03-04T14:05:01.3109965Z) and NodeId == int(1) -``` - -Building queries like this is useful for queries that are built from user input, or for queries that are built from a template, and are valid for management commands too. - -#### Query For Rows - -The kusto `table` package queries data into a ***table.Row** which can be printed or have the column data extracted. - -```go -// table package is: github.com/Azure/azure-kusto-go/kusto/data/table - -// Query our database table "systemNodes" for the CollectionTimes and the NodeIds. -iter, err := client.Query(ctx, "database", query) - - if err != nil { - panic("add error handling") - } - -defer iter.Stop() - -// .Do() will call the function for every row in the table. -err = iter.DoOnRowOrError( - - func(row *table.Row, e *kustoErrors.Error) error { - if e != nil { - return e - } - if row.Replace { - fmt.Println("---") // Replace flag indicates that the query result should be cleared and replaced with this row - } - fmt.Println(row) // As a convenience, printing a *table.Row will output csv - return nil - }, - -) - - if err != nil { - panic("add error handling") - } - -``` - -#### Query Into Structs - -Users will often want to turn the returned data into Go structs that are easier to work with. The ***table.Row** object -that is returned supports this via the `.ToStruct()` method. - -```go -// NodeRec represents our Kusto data that will be returned. - - type NodeRec struct { - // ID is the table's NodeId. We use the field tag here to instruct our client to convert NodeId to ID. - ID int64 `kusto:"NodeId"` - // CollectionTime is Go representation of the Kusto datetime type. - CollectionTime time.Time - } - -iter, err := client.Query(ctx, "database", query) - - if err != nil { - panic("add error handling") - } - -defer iter.Stop() - -recs := []NodeRec{} -err = iter.DoOnRowOrError( - - func(row *table.Row, e *kustoErrors.Error) error { - if e != nil { - return e - } - rec := NodeRec{} - if err := row.ToStruct(&rec); err != nil { - return err - } - if row.Replace { - recs = recs[:0] // Replace flag indicates that the query result should be cleared and replaced with this row - } - recs = append(recs, rec) - return nil - }, - -) - - if err != nil { - panic("add error handling") - } - -``` - -### Ingestion - -The `ingest` package provides access to Kusto's ingestion service for importing data into Kusto. This requires -some prerequisite knowledge of acceptable data formats, mapping references, etc. - -That documentation can be found [here](https://docs.microsoft.com/en-us/azure/kusto/management/data-ingestion/) - -If ingesting data from memory, it is suggested that you stream the data in via `FromReader()` passing in the reader -from an `io.Pipe()`. The data will not begin ingestion until the writer closes. - -#### Creating a queued ingestion client - -Setup is quite simple, simply pass a `*kusto.Client`, the name of the database and table you wish to ingest into. - -```go -in, err := ingest.New(kustoClient, "database", "table") - - if err != nil { - panic("add error handling") - } - -// Be sure to close the ingestor when you're done. (Error handling omitted for brevity.) -defer in.Close() -``` - -#### Other Ingestion Clients - -There are other ingestion clients that can be used for different ingestion scenarios. The `ingest` package provides -the following clients: - - Queued Ingest - `ingest.New()` - the default client, uses queues and batching to ingest data. Most reliable. - - Streaming Ingest - `ingest.NewStreaming()` - Directly streams data into the engine. Fast, but is limited with size and can fail. - - Managed Streaming Ingest - `ingest.NewManaged()` - Combines a streaming ingest client with a queued ingest client to provide a reliable ingestion method that is fast and can ingest large amounts of data. - Managed Streaming will try to stream the data, and if it fails multiple times, it will fall back to a queued ingestion. - -#### Ingestion From a File - -Ingesting a local file requires simply passing the path to the file to be ingested: - -```go - - if _, err := in.FromFile(ctx, "/path/to/a/local/file"); err != nil { - panic("add error handling") - } - -``` - -`FromFile()` will accept Unix path names on Unix platforms and Windows path names on Windows platforms. -The file will not be deleted after upload (there is an option that will allow that though). - -#### From a Blob Storage File - -This package will also accept ingestion from an Azure Blob Storage file: - -```go - - if _, err := in.FromFile(ctx, "https://myaccount.blob.core.windows.net/$root/myblob"); err != nil { - panic("add error handling") - } - -``` - -This will ingest a file from Azure Blob Storage. We only support `https://` paths and your domain name may differ than what is here. - -#### Ingestion from an io.Reader - -Sometimes you want to ingest a stream of data that you have in memory without writing to disk. You can do this simply by chunking the -data via an `io.Reader`. - -```go -r, w := io.Pipe() - -enc := json.NewEncoder(w) - - go func() { - defer w.Close() - for _, data := range dataSet { - if err := enc.Encode(data); err != nil { - panic("add error handling") - } - } - }() - - if _, err := in.FromReader(ctx, r); err != nil { - panic("add error handling") - } - -``` - -It is important to remember that `FromReader()` will terminate when it receives an `io.EOF` from the `io.Reader`. Use `io.Readers` that won't -return `io.EOF` until the `io.Writer` is closed (such as `io.Pipe`). - -# Mocking - -To support mocking for this client in your code for hermetic testing purposes, this client supports mocking the data -returned by our RowIterator object. Please see the MockRows documentation for code examples. - -# Package Examples - -Below you will find a simple and complex example of doing Query() the represent compiled code: -*/ -package kusto diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/internal/frames/frames.go b/vendor/github.com/Azure/azure-kusto-go/kusto/internal/frames/frames.go deleted file mode 100644 index f4763819f5b..00000000000 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/internal/frames/frames.go +++ /dev/null @@ -1,98 +0,0 @@ -package frames - -import ( - "context" - "fmt" - "io" - - "github.com/Azure/azure-kusto-go/kusto/data/errors" -) - -const ( - // TypeDataTable is the .FrameType that indicates a Kusto DataTable. - TypeDataTable = "DataTable" - // TypeDataSetCompletion is the .FrameType that indicates a Kusto DataSetCompletion. - TypeDataSetCompletion = "DataSetCompletion" - // TypeDataSetHeader is the .FrameType that indicates a Kusto DataSetHeader. - TypeDataSetHeader = "DataSetHeader" - // TypeTableHeader is the .FrameType that indicates a Kusto TableHeader. - TypeTableHeader = "TableHeader" - // TypeTableFragment is the .FrameType that indicates a Kusto TableFragment. - TypeTableFragment = "TableFragment" - // TypeTableProgress is the .FrameType that indicates a Kusto TableProgress. - TypeTableProgress = "TableProgress" - // TypeTableCompletion is the .FrameType that indicates a Kusto TableCompletion. - TypeTableCompletion = "TableCompletion" -) - -// These constants represent keys for fields when unmarshalling various JSON dicts representing Kusto frames. -const ( - FieldFrameType = "FrameType" - FieldTableID = "TableId" - FieldTableKind = "TableKind" - FieldTableName = "TableName" - FieldColumns = "Columns" - FieldRows = "Rows" - FieldColumnName = "ColumnName" - FieldColumnType = "ColumnType" - FieldCount = "FieldCount" - FieldTableFragmentType = "TableFragmentType" - FieldTableProgress = "TableProgress" - FieldRowCount = "RowCount" -) - -// TableKind describes the kind of table. -type TableKind string - -const ( - // QueryProperties is a dataTable.TableKind that contains properties about the query itself. - // The dataTable.TableName is usually ExtendedProperties. - QueryProperties TableKind = "QueryProperties" - // PrimaryResult is a dataTable.TableKind that contains the query information the user wants. - // The dataTable.TableName is PrimaryResult. - PrimaryResult TableKind = "PrimaryResult" - // QueryCompletionInformation contains information on how long the query took. - // The dataTable.TableName is QueryCompletionInformation. - QueryCompletionInformation TableKind = "QueryCompletionInformation" - QueryTraceLog TableKind = "QueryTraceLog" - QueryPerfLog TableKind = "QueryPerfLog" - QueryResult TableKind = "QueryResult" - TableOfContents TableKind = "TableOfContents" - QueryPlan TableKind = "QueryPlan" - ExtendedProperties TableKind = "@ExtendedProperties" - UnknownTableKind TableKind = "Unknown" -) - -// Decoder provides a function that will decode an incoming data stream and return a channel of Frame objects. -type Decoder interface { - // Decode decodes an io.Reader representing a stream of Kusto frames into our Frame representation. - // The type and order of frames is dependent on the REST interface version and the progressive frame settings. - Decode(ctx context.Context, r io.ReadCloser, op errors.Op) chan Frame -} - -// Frame is a type of Kusto frame as defined in the reference document. -type Frame interface { - IsFrame() -} - -// Error is not actually a Kusto frame, but is used to signal the end of a stream -// where we encountered an error. Error implements error. -type Error struct { - Msg string -} - -// Error implements error.Error(). -func (e Error) Error() string { - return e.Msg -} - -// IsFrame implements Frame.IsFrame(). -func (Error) IsFrame() {} - -// Errorf write a frames.Error to ch with fmt.Sprint(s, a...). -func Errorf(ctx context.Context, ch chan Frame, s string, a ...interface{}) { - select { - case <-ctx.Done(): - case ch <- Error{Msg: fmt.Sprintf(s, a...)}: - } -} diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/internal/frames/unmarshal/json/README.md b/vendor/github.com/Azure/azure-kusto-go/kusto/internal/frames/unmarshal/json/README.md deleted file mode 100644 index 910330d0454..00000000000 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/internal/frames/unmarshal/json/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# Why the fork of encoding/json (from version 1.14) - -The json package is setup for the general use case. And it makes a lot of assumptions about how people are going to send you data. - -In our case, we want to read a stream of Kusto frames represented by a JSON array, but we want to read them as a stream and not all at once. - -That means we need to use a json.Decoder. Which is all well and dandy, except what we are going to read out varies by the type of frame. And we won't know what that frame is until we parse the frametype key. - -So we decode into a json.RawMessage, extract the frametype from the message, and then unmarshal into the concrete frame. All good right? - -Wrong, because json.RawMessage makes a copy of the bytes that were sent in. That costs us a huge amount in allocation per frame on 100's of thousands or millions of frames. - -Next, for some reason which I can't explain, Go translates numbers in a json.Unmarshal() call into float64 if the target is an interface{}. I'm sure there is a good reason for it, I just don't understand it. I would think it would just be an int64 or float64. Or, because they made it, a json.Number. The decoder itself can translate to json.Number, if you enable it. But not Unmarshal. - -Because we need to unmarshal to a [][]interface{} so we can translate to a []value.Values(also an interface) that represent rows in a frame, the unmarshal call couldn't hold all numbers we support in a float64. So Unmarshal was changed to always unmarshal into a json.Number. - -# Important changes - -- RawMessage now uses the passed slice. This also means you **MUST** decode the raw message into something before making any other decoder calls. -- Unmarshal always unmarshals into a json.Number. - -# Things you might try, but won't work - -## Doing a RawMessage for the rows instead of [][]interface{}. Then using another Decoder on that. - -You have to store decoders modified for resetting for this not to go crazy in allocs. Also, the decoder doesn't really like being inside content from another decoder, it creates errors about spacing that actually don't cause an error, but it will eat up a lot of allocations (bad design or unintentional consequence). - -## Using json-iterator package - -Yeah, it looks like it will work, but then it doesn't have the Decoder.Token() thing. - -Then you are going to say, "Just remove the first byte to get rid of "[". - -Yeah, been there. Then it just errors out for some reason that isn't clear. Also, not a big fan of libraries that say 100% compatibility and then don't. - -I tried a lot of experiments with this library, but never one that worked well. It just is designed for its use case and not this one. - -## Use JSON (insert third party package name) - -I looked at a bunch of them. Don't want to add generated code (its a pain) and others like gojay require weird boiler plate I don't want to bolt on at this time. - -## Use map[string]interface{} and manually convert - -Actually, this works fine. The first iteration did this and was just ever so slightly faster over 5 million records fairly consistently. Its allocations were signifcantly less that using plain RawMessage for frame discovery and then doing the decode manually into the structs. - -But it was also a lot more code and with a single change to RawMessage I could half the allocations. On large loads this will keep our GC happy. Also, just less code. diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/internal/frames/unmarshal/json/decode.go b/vendor/github.com/Azure/azure-kusto-go/kusto/internal/frames/unmarshal/json/decode.go deleted file mode 100644 index 4d38dae4f16..00000000000 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/internal/frames/unmarshal/json/decode.go +++ /dev/null @@ -1,1292 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Represents JSON data structure using native Go types: booleans, floats, -// strings, arrays, and maps. - -package json - -import ( - "encoding" - "encoding/base64" - "encoding/json" - "fmt" - "reflect" - "strconv" - "strings" - "unicode" - "unicode/utf16" - "unicode/utf8" -) - -// Unmarshal parses the JSON-encoded data and stores the result -// in the value pointed to by v. If v is nil or not a pointer, -// Unmarshal returns an InvalidUnmarshalError. -// -// Unmarshal uses the inverse of the encodings that -// Marshal uses, allocating maps, slices, and pointers as necessary, -// with the following additional rules: -// -// To unmarshal JSON into a pointer, Unmarshal first handles the case of -// the JSON being the JSON literal null. In that case, Unmarshal sets -// the pointer to nil. Otherwise, Unmarshal unmarshals the JSON into -// the value pointed at by the pointer. If the pointer is nil, Unmarshal -// allocates a new value for it to point to. -// -// To unmarshal JSON into a value implementing the Unmarshaler interface, -// Unmarshal calls that value's UnmarshalJSON method, including -// when the input is a JSON null. -// Otherwise, if the value implements encoding.TextUnmarshaler -// and the input is a JSON quoted string, Unmarshal calls that value's -// UnmarshalText method with the unquoted form of the string. -// -// To unmarshal JSON into a struct, Unmarshal matches incoming object -// keys to the keys used by Marshal (either the struct field name or its tag), -// preferring an exact match but also accepting a case-insensitive match. By -// default, object keys which don't have a corresponding struct field are -// ignored (see Decoder.DisallowUnknownFields for an alternative). -// -// To unmarshal JSON into an interface value, -// Unmarshal stores one of these in the interface value: -// -// bool, for JSON booleans -// float64, for JSON numbers -// string, for JSON strings -// []interface{}, for JSON arrays -// map[string]interface{}, for JSON objects -// nil for JSON null -// -// To unmarshal a JSON array into a slice, Unmarshal resets the slice length -// to zero and then appends each element to the slice. -// As a special case, to unmarshal an empty JSON array into a slice, -// Unmarshal replaces the slice with a new empty slice. -// -// To unmarshal a JSON array into a Go array, Unmarshal decodes -// JSON array elements into corresponding Go array elements. -// If the Go array is smaller than the JSON array, -// the additional JSON array elements are discarded. -// If the JSON array is smaller than the Go array, -// the additional Go array elements are set to zero values. -// -// To unmarshal a JSON object into a map, Unmarshal first establishes a map to -// use. If the map is nil, Unmarshal allocates a new map. Otherwise Unmarshal -// reuses the existing map, keeping existing entries. Unmarshal then stores -// key-value pairs from the JSON object into the map. The map's key type must -// either be any string type, an integer, implement json.Unmarshaler, or -// implement encoding.TextUnmarshaler. -// -// If a JSON value is not appropriate for a given target type, -// or if a JSON number overflows the target type, Unmarshal -// skips that field and completes the unmarshaling as best it can. -// If no more serious errors are encountered, Unmarshal returns -// an UnmarshalTypeError describing the earliest such error. In any -// case, it's not guaranteed that all the remaining fields following -// the problematic one will be unmarshaled into the target object. -// -// The JSON null value unmarshals into an interface, map, pointer, or slice -// by setting that Go value to nil. Because null is often used in JSON to mean -// “not present,” unmarshaling a JSON null into any other Go type has no effect -// on the value and produces no error. -// -// When unmarshaling quoted strings, invalid UTF-8 or -// invalid UTF-16 surrogate pairs are not treated as an error. -// Instead, they are replaced by the Unicode replacement -// character U+FFFD. -func Unmarshal(data []byte, v interface{}) error { - // Check for well-formedness. - // Avoids filling out half a data structure - // before discovering a JSON syntax error. - var d decodeState - err := checkValid(data, &d.scan) - if err != nil { - return err - } - - d.useNumber = true - d.init(data) - return d.unmarshal(v) -} - -// Unmarshaler is the interface implemented by types -// that can unmarshal a JSON description of themselves. -// The input can be assumed to be a valid encoding of -// a JSON value. UnmarshalJSON must copy the JSON data -// if it wishes to retain the data after returning. -// -// By convention, to approximate the behavior of Unmarshal itself, -// Unmarshalers implement UnmarshalJSON([]byte("null")) as a no-op. -type Unmarshaler interface { - UnmarshalJSON([]byte) error -} - -// An UnmarshalTypeError describes a JSON value that was -// not appropriate for a value of a specific Go type. -type UnmarshalTypeError struct { - Value string // description of JSON value - "bool", "array", "number -5" - Type reflect.Type // type of Go value it could not be assigned to - Offset int64 // error occurred after reading Offset bytes - Struct string // name of the struct type containing the field - Field string // the full path from root node to the field -} - -func (e *UnmarshalTypeError) Error() string { - if e.Struct != "" || e.Field != "" { - return "json: cannot unmarshal " + e.Value + " into Go struct field " + e.Struct + "." + e.Field + " of type " + e.Type.String() - } - return "json: cannot unmarshal " + e.Value + " into Go value of type " + e.Type.String() -} - -// An UnmarshalFieldError describes a JSON object key that -// led to an unexported (and therefore unwritable) struct field. -// -// Deprecated: No longer used; kept for compatibility. -type UnmarshalFieldError struct { - Key string - Type reflect.Type - Field reflect.StructField -} - -func (e *UnmarshalFieldError) Error() string { - return "json: cannot unmarshal object key " + strconv.Quote(e.Key) + " into unexported field " + e.Field.Name + " of type " + e.Type.String() -} - -// An InvalidUnmarshalError describes an invalid argument passed to Unmarshal. -// (The argument to Unmarshal must be a non-nil pointer.) -type InvalidUnmarshalError struct { - Type reflect.Type -} - -func (e *InvalidUnmarshalError) Error() string { - if e.Type == nil { - return "json: Unmarshal(nil)" - } - - if e.Type.Kind() != reflect.Ptr { - return "json: Unmarshal(non-pointer " + e.Type.String() + ")" - } - return "json: Unmarshal(nil " + e.Type.String() + ")" -} - -func (d *decodeState) unmarshal(v interface{}) error { - rv := reflect.ValueOf(v) - if rv.Kind() != reflect.Ptr || rv.IsNil() { - return &InvalidUnmarshalError{reflect.TypeOf(v)} - } - - d.scan.reset() - d.scanWhile(scanSkipSpace) - // We decode rv not rv.Elem because the Unmarshaler interface - // test must be applied at the top level of the value. - err := d.value(rv) - if err != nil { - return d.addErrorContext(err) - } - return d.savedError -} - -// A Number represents a JSON number literal. -type Number = json.Number - -// decodeState represents the state while decoding a JSON value. -type decodeState struct { - data []byte - off int // next read offset in data - opcode int // last read result - scan scanner - errorContext struct { // provides context for type errors - Struct reflect.Type - FieldStack []string - } - savedError error - useNumber bool - disallowUnknownFields bool - // safeUnquote is the number of current string literal bytes that don't - // need to be unquoted. When negative, no bytes need unquoting. - safeUnquote int -} - -// readIndex returns the position of the last byte read. -func (d *decodeState) readIndex() int { - return d.off - 1 -} - -// phasePanicMsg is used as a panic message when we end up with something that -// shouldn't happen. It can indicate a bug in the JSON decoder, or that -// something is editing the data slice while the decoder executes. -const phasePanicMsg = "JSON decoder out of sync - data changing underfoot?" - -func (d *decodeState) init(data []byte) *decodeState { - d.data = data - d.off = 0 - d.savedError = nil - d.errorContext.Struct = nil - - // Reuse the allocated space for the FieldStack slice. - d.errorContext.FieldStack = d.errorContext.FieldStack[:0] - return d -} - -// saveError saves the first err it is called with, -// for reporting at the end of the unmarshal. -func (d *decodeState) saveError(err error) { - if d.savedError == nil { - d.savedError = d.addErrorContext(err) - } -} - -// addErrorContext returns a new error enhanced with information from d.errorContext -func (d *decodeState) addErrorContext(err error) error { - if d.errorContext.Struct != nil || len(d.errorContext.FieldStack) > 0 { - switch err := err.(type) { - case *UnmarshalTypeError: - err.Struct = d.errorContext.Struct.Name() - err.Field = strings.Join(d.errorContext.FieldStack, ".") - return err - } - } - return err -} - -// skip scans to the end of what was started. -func (d *decodeState) skip() { - s, data, i := &d.scan, d.data, d.off - depth := len(s.parseState) - for { - op := s.step(s, data[i]) - i++ - if len(s.parseState) < depth { - d.off = i - d.opcode = op - return - } - } -} - -// scanNext processes the byte at d.data[d.off]. -func (d *decodeState) scanNext() { - if d.off < len(d.data) { - d.opcode = d.scan.step(&d.scan, d.data[d.off]) - d.off++ - } else { - d.opcode = d.scan.eof() - d.off = len(d.data) + 1 // mark processed EOF with len+1 - } -} - -// scanWhile processes bytes in d.data[d.off:] until it -// receives a scan code not equal to op. -func (d *decodeState) scanWhile(op int) { - s, data, i := &d.scan, d.data, d.off - for i < len(data) { - newOp := s.step(s, data[i]) - i++ - if newOp != op { - d.opcode = newOp - d.off = i - return - } - } - - d.off = len(data) + 1 // mark processed EOF with len+1 - d.opcode = d.scan.eof() -} - -// rescanLiteral is similar to scanWhile(scanContinue), but it specialises the -// common case where we're decoding a literal. The decoder scans the input -// twice, once for syntax errors and to check the length of the value, and the -// second to perform the decoding. -// -// Only in the second step do we use decodeState to tokenize literals, so we -// know there aren't any syntax errors. We can take advantage of that knowledge, -// and scan a literal's bytes much more quickly. -func (d *decodeState) rescanLiteral() { - data, i := d.data, d.off -Switch: - switch data[i-1] { - case '"': // string - // safeUnquote is initialized at -1, which means that all bytes - // checked so far can be unquoted at a later time with no work - // at all. When reaching the closing '"', if safeUnquote is - // still -1, all bytes can be unquoted with no work. Otherwise, - // only those bytes up until the first '\\' or non-ascii rune - // can be safely unquoted. - safeUnquote := -1 - for ; i < len(data); i++ { - if c := data[i]; c == '\\' { - if safeUnquote < 0 { // first unsafe byte - safeUnquote = int(i - d.off) - } - i++ // escaped char - } else if c == '"' { - d.safeUnquote = safeUnquote - i++ // tokenize the closing quote too - break Switch - } else if c >= utf8.RuneSelf { - if safeUnquote < 0 { // first unsafe byte - safeUnquote = int(i - d.off) - } - } - } - case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-': // number - for ; i < len(data); i++ { - switch data[i] { - case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - '.', 'e', 'E', '+', '-': - default: - break Switch - } - } - case 't': // true - i += len("rue") - case 'f': // false - i += len("alse") - case 'n': // null - i += len("ull") - } - if i < len(data) { - d.opcode = stateEndValue(&d.scan, data[i]) - } else { - d.opcode = scanEnd - } - d.off = i + 1 -} - -// value consumes a JSON value from d.data[d.off-1:], decoding into v, and -// reads the following byte ahead. If v is invalid, the value is discarded. -// The first byte of the value has been read already. -func (d *decodeState) value(v reflect.Value) error { - switch d.opcode { - default: - panic(phasePanicMsg) - - case scanBeginArray: - if v.IsValid() { - if err := d.array(v); err != nil { - return err - } - } else { - d.skip() - } - d.scanNext() - - case scanBeginObject: - if v.IsValid() { - if err := d.object(v); err != nil { - return err - } - } else { - d.skip() - } - d.scanNext() - - case scanBeginLiteral: - // All bytes inside literal return scanContinue op code. - start := d.readIndex() - d.rescanLiteral() - - if v.IsValid() { - if err := d.literalStore(d.data[start:d.readIndex()], v, false); err != nil { - return err - } - } - } - return nil -} - -type unquotedValue struct{} - -// valueQuoted is like value but decodes a -// quoted string literal or literal null into an interface value. -// If it finds anything other than a quoted string literal or null, -// valueQuoted returns unquotedValue{}. -func (d *decodeState) valueQuoted() interface{} { - switch d.opcode { - default: - panic(phasePanicMsg) - - case scanBeginArray, scanBeginObject: - d.skip() - d.scanNext() - - case scanBeginLiteral: - v := d.literalInterface() - switch v.(type) { - case nil, string: - return v - } - } - return unquotedValue{} -} - -// indirect walks down v allocating pointers as needed, -// until it gets to a non-pointer. -// If it encounters an Unmarshaler, indirect stops and returns that. -// If decodingNull is true, indirect stops at the first settable pointer so it -// can be set to nil. -func indirect(v reflect.Value, decodingNull bool) (Unmarshaler, encoding.TextUnmarshaler, reflect.Value) { - // Issue #24153 indicates that it is generally not a guaranteed property - // that you may round-trip a reflect.Value by calling Value.Addr().Elem() - // and expect the value to still be settable for values derived from - // unexported embedded struct fields. - // - // The logic below effectively does this when it first addresses the value - // (to satisfy possible pointer methods) and continues to dereference - // subsequent pointers as necessary. - // - // After the first round-trip, we set v back to the original value to - // preserve the original RW flags contained in reflect.Value. - v0 := v - haveAddr := false - - // If v is a named type and is addressable, - // start with its address, so that if the type has pointer methods, - // we find them. - if v.Kind() != reflect.Ptr && v.Type().Name() != "" && v.CanAddr() { - haveAddr = true - v = v.Addr() - } - for { - // Load value from interface, but only if the result will be - // usefully addressable. - if v.Kind() == reflect.Interface && !v.IsNil() { - e := v.Elem() - if e.Kind() == reflect.Ptr && !e.IsNil() && (!decodingNull || e.Elem().Kind() == reflect.Ptr) { - haveAddr = false - v = e - continue - } - } - - if v.Kind() != reflect.Ptr { - break - } - - if decodingNull && v.CanSet() { - break - } - - // Prevent infinite loop if v is an interface pointing to its own address: - // var v interface{} - // v = &v - if v.Elem().Kind() == reflect.Interface && v.Elem().Elem() == v { - v = v.Elem() - break - } - if v.IsNil() { - v.Set(reflect.New(v.Type().Elem())) - } - if v.Type().NumMethod() > 0 && v.CanInterface() { - if u, ok := v.Interface().(Unmarshaler); ok { - return u, nil, reflect.Value{} - } - if !decodingNull { - if u, ok := v.Interface().(encoding.TextUnmarshaler); ok { - return nil, u, reflect.Value{} - } - } - } - - if haveAddr { - v = v0 // restore original value after round-trip Value.Addr().Elem() - haveAddr = false - } else { - v = v.Elem() - } - } - return nil, nil, v -} - -// array consumes an array from d.data[d.off-1:], decoding into v. -// The first byte of the array ('[') has been read already. -func (d *decodeState) array(v reflect.Value) error { - // Check for unmarshaler. - u, ut, pv := indirect(v, false) - if u != nil { - start := d.readIndex() - d.skip() - return u.UnmarshalJSON(d.data[start:d.off]) - } - if ut != nil { - d.saveError(&UnmarshalTypeError{Value: "array", Type: v.Type(), Offset: int64(d.off)}) - d.skip() - return nil - } - v = pv - - // Check type of target. - switch v.Kind() { - case reflect.Interface: - if v.NumMethod() == 0 { - // Decoding into nil interface? Switch to non-reflect code. - ai := d.arrayInterface() - v.Set(reflect.ValueOf(ai)) - return nil - } - // Otherwise it's invalid. - fallthrough - default: - d.saveError(&UnmarshalTypeError{Value: "array", Type: v.Type(), Offset: int64(d.off)}) - d.skip() - return nil - case reflect.Array, reflect.Slice: - break - } - - i := 0 - for { - // Look ahead for ] - can only happen on first iteration. - d.scanWhile(scanSkipSpace) - if d.opcode == scanEndArray { - break - } - - // Get element of array, growing if necessary. - if v.Kind() == reflect.Slice { - // Grow slice if necessary - if i >= v.Cap() { - newcap := v.Cap() + v.Cap()/2 - if newcap < 4 { - newcap = 4 - } - newv := reflect.MakeSlice(v.Type(), v.Len(), newcap) - reflect.Copy(newv, v) - v.Set(newv) - } - if i >= v.Len() { - v.SetLen(i + 1) - } - } - - if i < v.Len() { - // Decode into element. - if err := d.value(v.Index(i)); err != nil { - return err - } - } else { - // Ran out of fixed array: skip. - if err := d.value(reflect.Value{}); err != nil { - return err - } - } - i++ - - // Next token must be , or ]. - if d.opcode == scanSkipSpace { - d.scanWhile(scanSkipSpace) - } - if d.opcode == scanEndArray { - break - } - if d.opcode != scanArrayValue { - panic(phasePanicMsg) - } - } - - if i < v.Len() { - if v.Kind() == reflect.Array { - // Array. Zero the rest. - z := reflect.Zero(v.Type().Elem()) - for ; i < v.Len(); i++ { - v.Index(i).Set(z) - } - } else { - v.SetLen(i) - } - } - if i == 0 && v.Kind() == reflect.Slice { - v.Set(reflect.MakeSlice(v.Type(), 0, 0)) - } - return nil -} - -var nullLiteral = []byte("null") -var textUnmarshalerType = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem() - -// object consumes an object from d.data[d.off-1:], decoding into v. -// The first byte ('{') of the object has been read already. -func (d *decodeState) object(v reflect.Value) error { - // Check for unmarshaler. - u, ut, pv := indirect(v, false) - if u != nil { - start := d.readIndex() - d.skip() - return u.UnmarshalJSON(d.data[start:d.off]) - } - if ut != nil { - d.saveError(&UnmarshalTypeError{Value: "object", Type: v.Type(), Offset: int64(d.off)}) - d.skip() - return nil - } - v = pv - t := v.Type() - - // Decoding into nil interface? Switch to non-reflect code. - if v.Kind() == reflect.Interface && v.NumMethod() == 0 { - oi := d.objectInterface() - v.Set(reflect.ValueOf(oi)) - return nil - } - - var fields structFields - - // Check type of target: - // struct or - // map[T1]T2 where T1 is string, an integer type, - // or an encoding.TextUnmarshaler - switch v.Kind() { - case reflect.Map: - // Map key must either have string kind, have an integer kind, - // or be an encoding.TextUnmarshaler. - switch t.Key().Kind() { - case reflect.String, - reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - default: - if !reflect.PtrTo(t.Key()).Implements(textUnmarshalerType) { - d.saveError(&UnmarshalTypeError{Value: "object", Type: t, Offset: int64(d.off)}) - d.skip() - return nil - } - } - if v.IsNil() { - v.Set(reflect.MakeMap(t)) - } - case reflect.Struct: - fields = cachedTypeFields(t) - // ok - default: - d.saveError(&UnmarshalTypeError{Value: "object", Type: t, Offset: int64(d.off)}) - d.skip() - return nil - } - - var mapElem reflect.Value - origErrorContext := d.errorContext - - for { - // Read opening " of string key or closing }. - d.scanWhile(scanSkipSpace) - if d.opcode == scanEndObject { - // closing } - can only happen on first iteration. - break - } - if d.opcode != scanBeginLiteral { - panic(phasePanicMsg) - } - - // Read key. - start := d.readIndex() - d.rescanLiteral() - item := d.data[start:d.readIndex()] - key, ok := d.unquoteBytes(item) - if !ok { - panic(phasePanicMsg) - } - - // Figure out field corresponding to key. - var subv reflect.Value - destring := false // whether the value is wrapped in a string to be decoded first - - if v.Kind() == reflect.Map { - elemType := t.Elem() - if !mapElem.IsValid() { - mapElem = reflect.New(elemType).Elem() - } else { - mapElem.Set(reflect.Zero(elemType)) - } - subv = mapElem - } else { - var f *field - if i, ok := fields.nameIndex[string(key)]; ok { - // Found an exact name match. - f = &fields.list[i] - } else { - // Fall back to the expensive case-insensitive - // linear search. - for i := range fields.list { - ff := &fields.list[i] - if ff.equalFold(ff.nameBytes, key) { - f = ff - break - } - } - } - if f != nil { - subv = v - destring = f.quoted - for _, i := range f.index { - if subv.Kind() == reflect.Ptr { - if subv.IsNil() { - // If a struct embeds a pointer to an unexported type, - // it is not possible to set a newly allocated value - // since the field is unexported. - // - // See https://golang.org/issue/21357 - if !subv.CanSet() { - d.saveError(fmt.Errorf("json: cannot set embedded pointer to unexported struct: %v", subv.Type().Elem())) - // Invalidate subv to ensure d.value(subv) skips over - // the JSON value without assigning it to subv. - subv = reflect.Value{} - destring = false - break - } - subv.Set(reflect.New(subv.Type().Elem())) - } - subv = subv.Elem() - } - subv = subv.Field(i) - } - d.errorContext.FieldStack = append(d.errorContext.FieldStack, f.name) - d.errorContext.Struct = t - } else if d.disallowUnknownFields { - d.saveError(fmt.Errorf("json: unknown field %q", key)) - } - } - - // Read : before value. - if d.opcode == scanSkipSpace { - d.scanWhile(scanSkipSpace) - } - if d.opcode != scanObjectKey { - panic(phasePanicMsg) - } - d.scanWhile(scanSkipSpace) - - if destring { - switch qv := d.valueQuoted().(type) { - case nil: - if err := d.literalStore(nullLiteral, subv, false); err != nil { - return err - } - case string: - if err := d.literalStore([]byte(qv), subv, true); err != nil { - return err - } - default: - d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal unquoted value into %v", subv.Type())) - } - } else { - if err := d.value(subv); err != nil { - return err - } - } - - // Write value back to map; - // if using struct, subv points into struct already. - if v.Kind() == reflect.Map { - kt := t.Key() - var kv reflect.Value - switch { - case reflect.PtrTo(kt).Implements(textUnmarshalerType): - kv = reflect.New(kt) - if err := d.literalStore(item, kv, true); err != nil { - return err - } - kv = kv.Elem() - case kt.Kind() == reflect.String: - kv = reflect.ValueOf(key).Convert(kt) - default: - switch kt.Kind() { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - s := string(key) - n, err := strconv.ParseInt(s, 10, 64) - if err != nil || reflect.Zero(kt).OverflowInt(n) { - d.saveError(&UnmarshalTypeError{Value: "number " + s, Type: kt, Offset: int64(start + 1)}) - break - } - kv = reflect.ValueOf(n).Convert(kt) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - s := string(key) - n, err := strconv.ParseUint(s, 10, 64) - if err != nil || reflect.Zero(kt).OverflowUint(n) { - d.saveError(&UnmarshalTypeError{Value: "number " + s, Type: kt, Offset: int64(start + 1)}) - break - } - kv = reflect.ValueOf(n).Convert(kt) - default: - panic("json: Unexpected key type") // should never occur - } - } - if kv.IsValid() { - v.SetMapIndex(kv, subv) - } - } - - // Next token must be , or }. - if d.opcode == scanSkipSpace { - d.scanWhile(scanSkipSpace) - } - // Reset errorContext to its original state. - // Keep the same underlying array for FieldStack, to reuse the - // space and avoid unnecessary allocs. - d.errorContext.FieldStack = d.errorContext.FieldStack[:len(origErrorContext.FieldStack)] - d.errorContext.Struct = origErrorContext.Struct - if d.opcode == scanEndObject { - break - } - if d.opcode != scanObjectValue { - panic(phasePanicMsg) - } - } - return nil -} - -// convertNumber converts the number literal s to a float64 or a Number -// depending on the setting of d.useNumber. -func (d *decodeState) convertNumber(s string) (interface{}, error) { - if d.useNumber { - return Number(s), nil - } - f, err := strconv.ParseFloat(s, 64) - if err != nil { - return nil, &UnmarshalTypeError{Value: "number " + s, Type: reflect.TypeOf(0.0), Offset: int64(d.off)} - } - return f, nil -} - -var numberType = reflect.TypeOf(Number("")) - -// literalStore decodes a literal stored in item into v. -// -// fromQuoted indicates whether this literal came from unwrapping a -// string from the ",string" struct tag option. this is used only to -// produce more helpful error messages. -func (d *decodeState) literalStore(item []byte, v reflect.Value, fromQuoted bool) error { - // Check for unmarshaler. - if len(item) == 0 { - //Empty string given - d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) - return nil - } - isNull := item[0] == 'n' // null - u, ut, pv := indirect(v, isNull) - if u != nil { - return u.UnmarshalJSON(item) - } - if ut != nil { - if item[0] != '"' { - if fromQuoted { - d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) - return nil - } - val := "number" - switch item[0] { - case 'n': - val = "null" - case 't', 'f': - val = "bool" - } - d.saveError(&UnmarshalTypeError{Value: val, Type: v.Type(), Offset: int64(d.readIndex())}) - return nil - } - s, ok := d.unquoteBytes(item) - if !ok { - if fromQuoted { - return fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type()) - } - panic(phasePanicMsg) - } - return ut.UnmarshalText(s) - } - - v = pv - - switch c := item[0]; c { - case 'n': // null - // The main parser checks that only true and false can reach here, - // but if this was a quoted string input, it could be anything. - if fromQuoted && string(item) != "null" { - d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) - break - } - switch v.Kind() { - case reflect.Interface, reflect.Ptr, reflect.Map, reflect.Slice: - v.Set(reflect.Zero(v.Type())) - // otherwise, ignore null for primitives/string - } - case 't', 'f': // true, false - value := item[0] == 't' - // The main parser checks that only true and false can reach here, - // but if this was a quoted string input, it could be anything. - if fromQuoted && string(item) != "true" && string(item) != "false" { - d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) - break - } - switch v.Kind() { - default: - if fromQuoted { - d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) - } else { - d.saveError(&UnmarshalTypeError{Value: "bool", Type: v.Type(), Offset: int64(d.readIndex())}) - } - case reflect.Bool: - v.SetBool(value) - case reflect.Interface: - if v.NumMethod() == 0 { - v.Set(reflect.ValueOf(value)) - } else { - d.saveError(&UnmarshalTypeError{Value: "bool", Type: v.Type(), Offset: int64(d.readIndex())}) - } - } - - case '"': // string - s, ok := d.unquoteBytes(item) - if !ok { - if fromQuoted { - return fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type()) - } - panic(phasePanicMsg) - } - switch v.Kind() { - default: - d.saveError(&UnmarshalTypeError{Value: "string", Type: v.Type(), Offset: int64(d.readIndex())}) - case reflect.Slice: - if v.Type().Elem().Kind() != reflect.Uint8 { - d.saveError(&UnmarshalTypeError{Value: "string", Type: v.Type(), Offset: int64(d.readIndex())}) - break - } - b := make([]byte, base64.StdEncoding.DecodedLen(len(s))) - n, err := base64.StdEncoding.Decode(b, s) - if err != nil { - d.saveError(err) - break - } - v.SetBytes(b[:n]) - case reflect.String: - if v.Type() == numberType && !isValidNumber(string(s)) { - return fmt.Errorf("json: invalid number literal, trying to unmarshal %q into Number", item) - } - v.SetString(string(s)) - case reflect.Interface: - if v.NumMethod() == 0 { - v.Set(reflect.ValueOf(string(s))) - } else { - d.saveError(&UnmarshalTypeError{Value: "string", Type: v.Type(), Offset: int64(d.readIndex())}) - } - } - - default: // number - if c != '-' && (c < '0' || c > '9') { - if fromQuoted { - return fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type()) - } - panic(phasePanicMsg) - } - s := string(item) - switch v.Kind() { - default: - if v.Kind() == reflect.String && v.Type() == numberType { - // s must be a valid number, because it's - // already been tokenized. - v.SetString(s) - break - } - if fromQuoted { - return fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type()) - } - d.saveError(&UnmarshalTypeError{Value: "number", Type: v.Type(), Offset: int64(d.readIndex())}) - case reflect.Interface: - n, err := d.convertNumber(s) - if err != nil { - d.saveError(err) - break - } - if v.NumMethod() != 0 { - d.saveError(&UnmarshalTypeError{Value: "number", Type: v.Type(), Offset: int64(d.readIndex())}) - break - } - v.Set(reflect.ValueOf(n)) - - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - n, err := strconv.ParseInt(s, 10, 64) - if err != nil || v.OverflowInt(n) { - d.saveError(&UnmarshalTypeError{Value: "number " + s, Type: v.Type(), Offset: int64(d.readIndex())}) - break - } - v.SetInt(n) - - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - n, err := strconv.ParseUint(s, 10, 64) - if err != nil || v.OverflowUint(n) { - d.saveError(&UnmarshalTypeError{Value: "number " + s, Type: v.Type(), Offset: int64(d.readIndex())}) - break - } - v.SetUint(n) - - case reflect.Float32, reflect.Float64: - n, err := strconv.ParseFloat(s, v.Type().Bits()) - if err != nil || v.OverflowFloat(n) { - d.saveError(&UnmarshalTypeError{Value: "number " + s, Type: v.Type(), Offset: int64(d.readIndex())}) - break - } - v.SetFloat(n) - } - } - return nil -} - -// The xxxInterface routines build up a value to be stored -// in an empty interface. They are not strictly necessary, -// but they avoid the weight of reflection in this common case. - -// valueInterface is like value but returns interface{} -func (d *decodeState) valueInterface() (val interface{}) { - switch d.opcode { - default: - panic(phasePanicMsg) - case scanBeginArray: - val = d.arrayInterface() - d.scanNext() - case scanBeginObject: - val = d.objectInterface() - d.scanNext() - case scanBeginLiteral: - val = d.literalInterface() - } - return -} - -// arrayInterface is like array but returns []interface{}. -func (d *decodeState) arrayInterface() []interface{} { - var v = make([]interface{}, 0) - for { - // Look ahead for ] - can only happen on first iteration. - d.scanWhile(scanSkipSpace) - if d.opcode == scanEndArray { - break - } - - v = append(v, d.valueInterface()) - - // Next token must be , or ]. - if d.opcode == scanSkipSpace { - d.scanWhile(scanSkipSpace) - } - if d.opcode == scanEndArray { - break - } - if d.opcode != scanArrayValue { - panic(phasePanicMsg) - } - } - return v -} - -// objectInterface is like object but returns map[string]interface{}. -func (d *decodeState) objectInterface() map[string]interface{} { - m := make(map[string]interface{}) - for { - // Read opening " of string key or closing }. - d.scanWhile(scanSkipSpace) - if d.opcode == scanEndObject { - // closing } - can only happen on first iteration. - break - } - if d.opcode != scanBeginLiteral { - panic(phasePanicMsg) - } - - // Read string key. - start := d.readIndex() - d.rescanLiteral() - item := d.data[start:d.readIndex()] - key, ok := d.unquote(item) - if !ok { - panic(phasePanicMsg) - } - - // Read : before value. - if d.opcode == scanSkipSpace { - d.scanWhile(scanSkipSpace) - } - if d.opcode != scanObjectKey { - panic(phasePanicMsg) - } - d.scanWhile(scanSkipSpace) - - // Read value. - m[key] = d.valueInterface() - - // Next token must be , or }. - if d.opcode == scanSkipSpace { - d.scanWhile(scanSkipSpace) - } - if d.opcode == scanEndObject { - break - } - if d.opcode != scanObjectValue { - panic(phasePanicMsg) - } - } - return m -} - -// literalInterface consumes and returns a literal from d.data[d.off-1:] and -// it reads the following byte ahead. The first byte of the literal has been -// read already (that's how the caller knows it's a literal). -func (d *decodeState) literalInterface() interface{} { - // All bytes inside literal return scanContinue op code. - start := d.readIndex() - d.rescanLiteral() - - item := d.data[start:d.readIndex()] - - switch c := item[0]; c { - case 'n': // null - return nil - - case 't', 'f': // true, false - return c == 't' - - case '"': // string - s, ok := d.unquote(item) - if !ok { - panic(phasePanicMsg) - } - return s - - default: // number - if c != '-' && (c < '0' || c > '9') { - panic(phasePanicMsg) - } - n, err := d.convertNumber(string(item)) - if err != nil { - d.saveError(err) - } - return n - } -} - -// getu4 decodes \uXXXX from the beginning of s, returning the hex value, -// or it returns -1. -func getu4(s []byte) rune { - if len(s) < 6 || s[0] != '\\' || s[1] != 'u' { - return -1 - } - var r rune - for _, c := range s[2:6] { - switch { - case '0' <= c && c <= '9': - c = c - '0' - case 'a' <= c && c <= 'f': - c = c - 'a' + 10 - case 'A' <= c && c <= 'F': - c = c - 'A' + 10 - default: - return -1 - } - r = r*16 + rune(c) - } - return r -} - -// unquote converts a quoted JSON string literal s into an actual string t. -// The rules are different than for Go, so cannot use strconv.Unquote. -// The first byte in s must be '"'. -func (d *decodeState) unquote(s []byte) (t string, ok bool) { - s, ok = d.unquoteBytes(s) - t = string(s) - return -} - -func (d *decodeState) unquoteBytes(s []byte) (t []byte, ok bool) { - // We already know that s[0] == '"'. However, we don't know that the - // closing quote exists in all cases, such as when the string is nested - // via the ",string" option. - if len(s) < 2 || s[len(s)-1] != '"' { - return - } - s = s[1 : len(s)-1] - - // If there are no unusual characters, no unquoting is needed, so return - // a slice of the original bytes. - r := d.safeUnquote - if r == -1 { - return s, true - } - - b := make([]byte, len(s)+2*utf8.UTFMax) - w := copy(b, s[0:r]) - for r < len(s) { - // Out of room? Can only happen if s is full of - // malformed UTF-8 and we're replacing each - // byte with RuneError. - if w >= len(b)-2*utf8.UTFMax { - nb := make([]byte, (len(b)+utf8.UTFMax)*2) - copy(nb, b[0:w]) - b = nb - } - switch c := s[r]; { - case c == '\\': - r++ - if r >= len(s) { - return - } - switch s[r] { - default: - return - case '"', '\\', '/', '\'': - b[w] = s[r] - r++ - w++ - case 'b': - b[w] = '\b' - r++ - w++ - case 'f': - b[w] = '\f' - r++ - w++ - case 'n': - b[w] = '\n' - r++ - w++ - case 'r': - b[w] = '\r' - r++ - w++ - case 't': - b[w] = '\t' - r++ - w++ - case 'u': - r-- - rr := getu4(s[r:]) - if rr < 0 { - return - } - r += 6 - if utf16.IsSurrogate(rr) { - rr1 := getu4(s[r:]) - if dec := utf16.DecodeRune(rr, rr1); dec != unicode.ReplacementChar { - // A valid pair; consume. - r += 6 - w += utf8.EncodeRune(b[w:], dec) - break - } - // Invalid surrogate; fall back to replacement rune. - rr = unicode.ReplacementChar - } - w += utf8.EncodeRune(b[w:], rr) - } - - // Quote, control characters are invalid. - case c == '"', c < ' ': - return - - // ASCII - case c < utf8.RuneSelf: - b[w] = c - r++ - w++ - - // Coerce to well-formed UTF-8. - default: - rr, size := utf8.DecodeRune(s[r:]) - r += size - w += utf8.EncodeRune(b[w:], rr) - } - } - return b[0:w], true -} diff --git a/vendor/github.com/Azure/azure-kusto-go/kusto/internal/frames/unmarshal/json/encode.go b/vendor/github.com/Azure/azure-kusto-go/kusto/internal/frames/unmarshal/json/encode.go deleted file mode 100644 index a0b62e3cd7c..00000000000 --- a/vendor/github.com/Azure/azure-kusto-go/kusto/internal/frames/unmarshal/json/encode.go +++ /dev/null @@ -1,1357 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package json implements encoding and decoding of JSON as defined in -// RFC 7159. The mapping between JSON and Go values is described -// in the documentation for the Marshal and Unmarshal functions. -// -// See "JSON and Go" for an introduction to this package: -// https://golang.org/doc/articles/json_and_go.html -package json - -import ( - "bytes" - "encoding" - "encoding/base64" - "fmt" - "math" - "reflect" - "sort" - "strconv" - "strings" - "sync" - "unicode" - "unicode/utf8" -) - -// Marshal returns the JSON encoding of v. -// -// Marshal traverses the value v recursively. -// If an encountered value implements the Marshaler interface -// and is not a nil pointer, Marshal calls its MarshalJSON method -// to produce JSON. If no MarshalJSON method is present but the -// value implements encoding.TextMarshaler instead, Marshal calls -// its MarshalText method and encodes the result as a JSON string. -// The nil pointer exception is not strictly necessary -// but mimics a similar, necessary exception in the behavior of -// UnmarshalJSON. -// -// Otherwise, Marshal uses the following type-dependent default encodings: -// -// Boolean values encode as JSON booleans. -// -// Floating point, integer, and Number values encode as JSON numbers. -// -// String values encode as JSON strings coerced to valid UTF-8, -// replacing invalid bytes with the Unicode replacement rune. -// So that the JSON will be safe to embed inside HTML