From b0ce388bf802243a289ea72f46de50b787ce4bbb Mon Sep 17 00:00:00 2001 From: "update-envoy[bot]" <135279899+update-envoy[bot]@users.noreply.github.com> Date: Wed, 17 Jul 2024 14:04:45 +0000 Subject: [PATCH] Mirrored from envoyproxy/envoy @ f79b881883e862bc0f7dc7f09d3bc811fb0944f6 Signed-off-by: update-envoy[bot] <135279899+update-envoy[bot]@users.noreply.github.com> --- envoy/COMMIT | 2 +- .../v3/static_config_resource_detector.pb.go | 191 ++++++++++++++++++ ...ic_config_resource_detector.pb.validate.go | 144 +++++++++++++ ...tic_config_resource_detector_vtproto.pb.go | 89 ++++++++ 4 files changed, 425 insertions(+), 1 deletion(-) create mode 100755 envoy/extensions/tracers/opentelemetry/resource_detectors/v3/static_config_resource_detector.pb.go create mode 100755 envoy/extensions/tracers/opentelemetry/resource_detectors/v3/static_config_resource_detector.pb.validate.go create mode 100755 envoy/extensions/tracers/opentelemetry/resource_detectors/v3/static_config_resource_detector_vtproto.pb.go diff --git a/envoy/COMMIT b/envoy/COMMIT index 37d7856d70..d59d5e84ea 100644 --- a/envoy/COMMIT +++ b/envoy/COMMIT @@ -1 +1 @@ -d84f707f8cc03d41a9f6bbffaf1b4f0105e7432b +f79b881883e862bc0f7dc7f09d3bc811fb0944f6 diff --git a/envoy/extensions/tracers/opentelemetry/resource_detectors/v3/static_config_resource_detector.pb.go b/envoy/extensions/tracers/opentelemetry/resource_detectors/v3/static_config_resource_detector.pb.go new file mode 100755 index 0000000000..454087ff11 --- /dev/null +++ b/envoy/extensions/tracers/opentelemetry/resource_detectors/v3/static_config_resource_detector.pb.go @@ -0,0 +1,191 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v5.26.1 +// source: envoy/extensions/tracers/opentelemetry/resource_detectors/v3/static_config_resource_detector.proto + +package resource_detectorsv3 + +import ( + _ "github.com/cncf/xds/go/udpa/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Configuration for the Static Resource detector extension. +// The resource detector uses static config for resource attribute, +// as per the OpenTelemetry specification. +// +// [#extension: envoy.tracers.opentelemetry.resource_detectors.static_config] +type StaticConfigResourceDetectorConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Custom Resource attributes to be included. + Attributes map[string]string `protobuf:"bytes,1,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *StaticConfigResourceDetectorConfig) Reset() { + *x = StaticConfigResourceDetectorConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_extensions_tracers_opentelemetry_resource_detectors_v3_static_config_resource_detector_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StaticConfigResourceDetectorConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StaticConfigResourceDetectorConfig) ProtoMessage() {} + +func (x *StaticConfigResourceDetectorConfig) ProtoReflect() protoreflect.Message { + mi := &file_envoy_extensions_tracers_opentelemetry_resource_detectors_v3_static_config_resource_detector_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StaticConfigResourceDetectorConfig.ProtoReflect.Descriptor instead. +func (*StaticConfigResourceDetectorConfig) Descriptor() ([]byte, []int) { + return file_envoy_extensions_tracers_opentelemetry_resource_detectors_v3_static_config_resource_detector_proto_rawDescGZIP(), []int{0} +} + +func (x *StaticConfigResourceDetectorConfig) GetAttributes() map[string]string { + if x != nil { + return x.Attributes + } + return nil +} + +var File_envoy_extensions_tracers_opentelemetry_resource_detectors_v3_static_config_resource_detector_proto protoreflect.FileDescriptor + +var file_envoy_extensions_tracers_opentelemetry_resource_detectors_v3_static_config_resource_detector_proto_rawDesc = []byte{ + 0x0a, 0x62, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x73, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, + 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x5f, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x76, 0x33, 0x2f, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x63, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x3c, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, + 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x73, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x2e, + 0x76, 0x33, 0x1a, 0x1d, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0xf6, 0x01, 0x0a, 0x22, 0x53, 0x74, 0x61, 0x74, 0x69, 0x63, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x74, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x90, 0x01, 0x0a, 0x0a, 0x61, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x70, 0x2e, + 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x73, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, + 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, + 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x74, 0x61, + 0x74, 0x69, 0x63, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x44, 0x65, 0x74, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, + 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x41, + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0xf3, 0x01, 0xba, 0x80, 0xc8, + 0xd1, 0x06, 0x02, 0x10, 0x02, 0x0a, 0x4a, 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, + 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x73, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x5f, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x2e, 0x76, + 0x33, 0x42, 0x21, 0x53, 0x74, 0x61, 0x74, 0x69, 0x63, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x74, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x78, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, + 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x65, + 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, + 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x73, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, + 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x64, + 0x65, 0x74, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x76, 0x33, 0x3b, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x5f, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x76, 0x33, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_envoy_extensions_tracers_opentelemetry_resource_detectors_v3_static_config_resource_detector_proto_rawDescOnce sync.Once + file_envoy_extensions_tracers_opentelemetry_resource_detectors_v3_static_config_resource_detector_proto_rawDescData = file_envoy_extensions_tracers_opentelemetry_resource_detectors_v3_static_config_resource_detector_proto_rawDesc +) + +func file_envoy_extensions_tracers_opentelemetry_resource_detectors_v3_static_config_resource_detector_proto_rawDescGZIP() []byte { + file_envoy_extensions_tracers_opentelemetry_resource_detectors_v3_static_config_resource_detector_proto_rawDescOnce.Do(func() { + file_envoy_extensions_tracers_opentelemetry_resource_detectors_v3_static_config_resource_detector_proto_rawDescData = protoimpl.X.CompressGZIP(file_envoy_extensions_tracers_opentelemetry_resource_detectors_v3_static_config_resource_detector_proto_rawDescData) + }) + return file_envoy_extensions_tracers_opentelemetry_resource_detectors_v3_static_config_resource_detector_proto_rawDescData +} + +var file_envoy_extensions_tracers_opentelemetry_resource_detectors_v3_static_config_resource_detector_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_envoy_extensions_tracers_opentelemetry_resource_detectors_v3_static_config_resource_detector_proto_goTypes = []interface{}{ + (*StaticConfigResourceDetectorConfig)(nil), // 0: envoy.extensions.tracers.opentelemetry.resource_detectors.v3.StaticConfigResourceDetectorConfig + nil, // 1: envoy.extensions.tracers.opentelemetry.resource_detectors.v3.StaticConfigResourceDetectorConfig.AttributesEntry +} +var file_envoy_extensions_tracers_opentelemetry_resource_detectors_v3_static_config_resource_detector_proto_depIdxs = []int32{ + 1, // 0: envoy.extensions.tracers.opentelemetry.resource_detectors.v3.StaticConfigResourceDetectorConfig.attributes:type_name -> envoy.extensions.tracers.opentelemetry.resource_detectors.v3.StaticConfigResourceDetectorConfig.AttributesEntry + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { + file_envoy_extensions_tracers_opentelemetry_resource_detectors_v3_static_config_resource_detector_proto_init() +} +func file_envoy_extensions_tracers_opentelemetry_resource_detectors_v3_static_config_resource_detector_proto_init() { + if File_envoy_extensions_tracers_opentelemetry_resource_detectors_v3_static_config_resource_detector_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_envoy_extensions_tracers_opentelemetry_resource_detectors_v3_static_config_resource_detector_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StaticConfigResourceDetectorConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_envoy_extensions_tracers_opentelemetry_resource_detectors_v3_static_config_resource_detector_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_envoy_extensions_tracers_opentelemetry_resource_detectors_v3_static_config_resource_detector_proto_goTypes, + DependencyIndexes: file_envoy_extensions_tracers_opentelemetry_resource_detectors_v3_static_config_resource_detector_proto_depIdxs, + MessageInfos: file_envoy_extensions_tracers_opentelemetry_resource_detectors_v3_static_config_resource_detector_proto_msgTypes, + }.Build() + File_envoy_extensions_tracers_opentelemetry_resource_detectors_v3_static_config_resource_detector_proto = out.File + file_envoy_extensions_tracers_opentelemetry_resource_detectors_v3_static_config_resource_detector_proto_rawDesc = nil + file_envoy_extensions_tracers_opentelemetry_resource_detectors_v3_static_config_resource_detector_proto_goTypes = nil + file_envoy_extensions_tracers_opentelemetry_resource_detectors_v3_static_config_resource_detector_proto_depIdxs = nil +} diff --git a/envoy/extensions/tracers/opentelemetry/resource_detectors/v3/static_config_resource_detector.pb.validate.go b/envoy/extensions/tracers/opentelemetry/resource_detectors/v3/static_config_resource_detector.pb.validate.go new file mode 100755 index 0000000000..592dd30a83 --- /dev/null +++ b/envoy/extensions/tracers/opentelemetry/resource_detectors/v3/static_config_resource_detector.pb.validate.go @@ -0,0 +1,144 @@ +//go:build !disable_pgv +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: envoy/extensions/tracers/opentelemetry/resource_detectors/v3/static_config_resource_detector.proto + +package resource_detectorsv3 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on StaticConfigResourceDetectorConfig with +// the rules defined in the proto definition for this message. If any rules +// are violated, the first error encountered is returned, or nil if there are +// no violations. +func (m *StaticConfigResourceDetectorConfig) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on StaticConfigResourceDetectorConfig +// with the rules defined in the proto definition for this message. If any +// rules are violated, the result is a list of violation errors wrapped in +// StaticConfigResourceDetectorConfigMultiError, or nil if none found. +func (m *StaticConfigResourceDetectorConfig) ValidateAll() error { + return m.validate(true) +} + +func (m *StaticConfigResourceDetectorConfig) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Attributes + + if len(errors) > 0 { + return StaticConfigResourceDetectorConfigMultiError(errors) + } + + return nil +} + +// StaticConfigResourceDetectorConfigMultiError is an error wrapping multiple +// validation errors returned by +// StaticConfigResourceDetectorConfig.ValidateAll() if the designated +// constraints aren't met. +type StaticConfigResourceDetectorConfigMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m StaticConfigResourceDetectorConfigMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m StaticConfigResourceDetectorConfigMultiError) AllErrors() []error { return m } + +// StaticConfigResourceDetectorConfigValidationError is the validation error +// returned by StaticConfigResourceDetectorConfig.Validate if the designated +// constraints aren't met. +type StaticConfigResourceDetectorConfigValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e StaticConfigResourceDetectorConfigValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e StaticConfigResourceDetectorConfigValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e StaticConfigResourceDetectorConfigValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e StaticConfigResourceDetectorConfigValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e StaticConfigResourceDetectorConfigValidationError) ErrorName() string { + return "StaticConfigResourceDetectorConfigValidationError" +} + +// Error satisfies the builtin error interface +func (e StaticConfigResourceDetectorConfigValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sStaticConfigResourceDetectorConfig.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = StaticConfigResourceDetectorConfigValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = StaticConfigResourceDetectorConfigValidationError{} diff --git a/envoy/extensions/tracers/opentelemetry/resource_detectors/v3/static_config_resource_detector_vtproto.pb.go b/envoy/extensions/tracers/opentelemetry/resource_detectors/v3/static_config_resource_detector_vtproto.pb.go new file mode 100755 index 0000000000..7f6ba508f6 --- /dev/null +++ b/envoy/extensions/tracers/opentelemetry/resource_detectors/v3/static_config_resource_detector_vtproto.pb.go @@ -0,0 +1,89 @@ +//go:build vtprotobuf +// +build vtprotobuf + +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// source: envoy/extensions/tracers/opentelemetry/resource_detectors/v3/static_config_resource_detector.proto + +package resource_detectorsv3 + +import ( + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +func (m *StaticConfigResourceDetectorConfig) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StaticConfigResourceDetectorConfig) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *StaticConfigResourceDetectorConfig) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Attributes) > 0 { + for k := range m.Attributes { + v := m.Attributes[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *StaticConfigResourceDetectorConfig) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Attributes) > 0 { + for k, v := range m.Attributes { + _ = k + _ = v + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + 1 + len(v) + protohelpers.SizeOfVarint(uint64(len(v))) + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) + } + } + n += len(m.unknownFields) + return n +}