diff --git a/pkg/capabilities/consensus/ocr3/ocr3cap/common_builders_generated.go b/pkg/capabilities/consensus/ocr3/ocr3cap/common_builders_generated.go index 758c1859c..4b354c123 100644 --- a/pkg/capabilities/consensus/ocr3/ocr3cap/common_builders_generated.go +++ b/pkg/capabilities/consensus/ocr3/ocr3cap/common_builders_generated.go @@ -6,6 +6,17 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/workflows/sdk" ) +// AggregationConfigWrapper allows access to field from an sdk.CapDefinition[AggregationConfig] +func AggregationConfigWrapper(raw sdk.CapDefinition[AggregationConfig]) AggregationConfigCap { + wrapped, ok := raw.(AggregationConfigCap) + if ok { + return wrapped + } + return AggregationConfigCap(raw) +} + +type AggregationConfigCap sdk.CapDefinition[AggregationConfig] + // EncoderWrapper allows access to field from an sdk.CapDefinition[Encoder] func EncoderWrapper(raw sdk.CapDefinition[Encoder]) EncoderCap { wrapped, ok := raw.(EncoderCap) diff --git a/pkg/capabilities/consensus/ocr3/ocr3cap/identical_consensus.go b/pkg/capabilities/consensus/ocr3/ocr3cap/identical_consensus.go index a3205fb7c..0d971d58d 100644 --- a/pkg/capabilities/consensus/ocr3/ocr3cap/identical_consensus.go +++ b/pkg/capabilities/consensus/ocr3/ocr3cap/identical_consensus.go @@ -10,7 +10,7 @@ import ( type IdenticalConsensusConfig[T any] struct { Encoder Encoder EncoderConfig EncoderConfig - AggregationConfig map[string]interface{} + AggregationConfig AggregationConfig ReportID ReportId KeyID KeyId } diff --git a/pkg/capabilities/consensus/ocr3/ocr3cap/identical_consensus_test.go b/pkg/capabilities/consensus/ocr3/ocr3cap/identical_consensus_test.go index 0b3d02146..b205ffbea 100644 --- a/pkg/capabilities/consensus/ocr3/ocr3cap/identical_consensus_test.go +++ b/pkg/capabilities/consensus/ocr3/ocr3cap/identical_consensus_test.go @@ -20,10 +20,11 @@ func TestIdenticalConsensus(t *testing.T) { trigger := basictrigger.TriggerConfig{Name: "1234", Number: 1}.New(workflow) consensus := ocr3.IdenticalConsensusConfig[basictrigger.TriggerOutputs]{ - Encoder: ocr3.EncoderEVM, - EncoderConfig: ocr3.EncoderConfig{}, - ReportID: "0001", - KeyID: "evm", + Encoder: ocr3.EncoderEVM, + EncoderConfig: ocr3.EncoderConfig{}, + AggregationConfig: ocr3.AggregationConfig{}, + ReportID: "0001", + KeyID: "evm", }.New(workflow, "consensus", ocr3.IdenticalConsensusInput[basictrigger.TriggerOutputs]{ Observation: trigger, Encoder: "evm", @@ -66,6 +67,7 @@ func TestIdenticalConsensus(t *testing.T) { "encoder": "EVM", "encoder_config": map[string]any{}, "aggregation_method": "identical", + "aggregation_config": map[string]any{}, "report_id": "0001", "key_id": "evm", }, diff --git a/pkg/capabilities/consensus/ocr3/ocr3cap/ocr3cap_common-schema.json b/pkg/capabilities/consensus/ocr3/ocr3cap/ocr3cap_common-schema.json index dd4b9b699..d6ed0644d 100644 --- a/pkg/capabilities/consensus/ocr3/ocr3cap/ocr3cap_common-schema.json +++ b/pkg/capabilities/consensus/ocr3/ocr3cap/ocr3cap_common-schema.json @@ -52,6 +52,10 @@ "type": "object", "additionalProperties": true }, + "aggregation_config": { + "type": "object", + "additionalProperties": true + }, "key_id" : { "type": "string", "examples": [ diff --git a/pkg/capabilities/consensus/ocr3/ocr3cap/ocr3cap_common_generated.go b/pkg/capabilities/consensus/ocr3/ocr3cap/ocr3cap_common_generated.go index 6d5869296..4e862ea50 100644 --- a/pkg/capabilities/consensus/ocr3/ocr3cap/ocr3cap_common_generated.go +++ b/pkg/capabilities/consensus/ocr3/ocr3cap/ocr3cap_common_generated.go @@ -9,6 +9,8 @@ import ( "regexp" ) +type AggregationConfig map[string]interface{} + type Encoder string type EncoderConfig map[string]interface{} diff --git a/pkg/capabilities/consensus/ocr3/types/ocr3_types.pb.go b/pkg/capabilities/consensus/ocr3/types/ocr3_types.pb.go index 05ad85bf7..9ea9efda5 100644 --- a/pkg/capabilities/consensus/ocr3/types/ocr3_types.pb.go +++ b/pkg/capabilities/consensus/ocr3/types/ocr3_types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 -// protoc v4.25.1 +// protoc-gen-go v1.35.1 +// protoc v5.28.2 // source: capabilities/consensus/ocr3/types/ocr3_types.proto package types @@ -39,11 +39,9 @@ type AggregationOutcome struct { func (x *AggregationOutcome) Reset() { *x = AggregationOutcome{} - if protoimpl.UnsafeEnabled { - mi := &file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *AggregationOutcome) String() string { @@ -54,7 +52,7 @@ func (*AggregationOutcome) ProtoMessage() {} func (x *AggregationOutcome) ProtoReflect() protoreflect.Message { mi := &file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -129,11 +127,9 @@ type Query struct { func (x *Query) Reset() { *x = Query{} - if protoimpl.UnsafeEnabled { - mi := &file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Query) String() string { @@ -144,7 +140,7 @@ func (*Query) ProtoMessage() {} func (x *Query) ProtoReflect() protoreflect.Message { mi := &file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -183,11 +179,9 @@ type Id struct { func (x *Id) Reset() { *x = Id{} - if protoimpl.UnsafeEnabled { - mi := &file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Id) String() string { @@ -198,7 +192,7 @@ func (*Id) ProtoMessage() {} func (x *Id) ProtoReflect() protoreflect.Message { mi := &file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -283,11 +277,9 @@ type Observation struct { func (x *Observation) Reset() { *x = Observation{} - if protoimpl.UnsafeEnabled { - mi := &file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Observation) String() string { @@ -298,7 +290,7 @@ func (*Observation) ProtoMessage() {} func (x *Observation) ProtoReflect() protoreflect.Message { mi := &file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -356,11 +348,9 @@ type Observations struct { func (x *Observations) Reset() { *x = Observations{} - if protoimpl.UnsafeEnabled { - mi := &file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Observations) String() string { @@ -371,7 +361,7 @@ func (*Observations) ProtoMessage() {} func (x *Observations) ProtoReflect() protoreflect.Message { mi := &file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -418,11 +408,9 @@ type Report struct { func (x *Report) Reset() { *x = Report{} - if protoimpl.UnsafeEnabled { - mi := &file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Report) String() string { @@ -433,7 +421,7 @@ func (*Report) ProtoMessage() {} func (x *Report) ProtoReflect() protoreflect.Message { mi := &file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -473,11 +461,9 @@ type ReportInfo struct { func (x *ReportInfo) Reset() { *x = ReportInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ReportInfo) String() string { @@ -488,7 +474,7 @@ func (*ReportInfo) ProtoMessage() {} func (x *ReportInfo) ProtoReflect() protoreflect.Message { mi := &file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -528,11 +514,9 @@ type Outcome struct { func (x *Outcome) Reset() { *x = Outcome{} - if protoimpl.UnsafeEnabled { - mi := &file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Outcome) String() string { @@ -543,7 +527,7 @@ func (*Outcome) ProtoMessage() {} func (x *Outcome) ProtoReflect() protoreflect.Message { mi := &file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -695,7 +679,7 @@ func file_capabilities_consensus_ocr3_types_ocr3_types_proto_rawDescGZIP() []byt } var file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes = make([]protoimpl.MessageInfo, 9) -var file_capabilities_consensus_ocr3_types_ocr3_types_proto_goTypes = []interface{}{ +var file_capabilities_consensus_ocr3_types_ocr3_types_proto_goTypes = []any{ (*AggregationOutcome)(nil), // 0: ocr3_types.AggregationOutcome (*Query)(nil), // 1: ocr3_types.Query (*Id)(nil), // 2: ocr3_types.Id @@ -737,104 +721,6 @@ func file_capabilities_consensus_ocr3_types_ocr3_types_proto_init() { if File_capabilities_consensus_ocr3_types_ocr3_types_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AggregationOutcome); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Query); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Id); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Observation); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Observations); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Report); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReportInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_capabilities_consensus_ocr3_types_ocr3_types_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Outcome); 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{ diff --git a/pkg/capabilities/pb/capabilities.pb.go b/pkg/capabilities/pb/capabilities.pb.go index 25faae711..ada8a508c 100644 --- a/pkg/capabilities/pb/capabilities.pb.go +++ b/pkg/capabilities/pb/capabilities.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 -// protoc v4.25.1 +// protoc-gen-go v1.35.1 +// protoc v5.28.2 // source: capabilities/pb/capabilities.proto package pb @@ -91,11 +91,9 @@ type CapabilityInfoReply struct { func (x *CapabilityInfoReply) Reset() { *x = CapabilityInfoReply{} - if protoimpl.UnsafeEnabled { - mi := &file_capabilities_pb_capabilities_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_capabilities_pb_capabilities_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CapabilityInfoReply) String() string { @@ -106,7 +104,7 @@ func (*CapabilityInfoReply) ProtoMessage() {} func (x *CapabilityInfoReply) ProtoReflect() protoreflect.Message { mi := &file_capabilities_pb_capabilities_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -172,11 +170,9 @@ type RequestMetadata struct { func (x *RequestMetadata) Reset() { *x = RequestMetadata{} - if protoimpl.UnsafeEnabled { - mi := &file_capabilities_pb_capabilities_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_capabilities_pb_capabilities_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *RequestMetadata) String() string { @@ -187,7 +183,7 @@ func (*RequestMetadata) ProtoMessage() {} func (x *RequestMetadata) ProtoReflect() protoreflect.Message { mi := &file_capabilities_pb_capabilities_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -263,11 +259,9 @@ type CapabilityRequest struct { func (x *CapabilityRequest) Reset() { *x = CapabilityRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_capabilities_pb_capabilities_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_capabilities_pb_capabilities_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CapabilityRequest) String() string { @@ -278,7 +272,7 @@ func (*CapabilityRequest) ProtoMessage() {} func (x *CapabilityRequest) ProtoReflect() protoreflect.Message { mi := &file_capabilities_pb_capabilities_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -326,11 +320,9 @@ type TriggerRegistrationRequest struct { func (x *TriggerRegistrationRequest) Reset() { *x = TriggerRegistrationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_capabilities_pb_capabilities_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_capabilities_pb_capabilities_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TriggerRegistrationRequest) String() string { @@ -341,7 +333,7 @@ func (*TriggerRegistrationRequest) ProtoMessage() {} func (x *TriggerRegistrationRequest) ProtoReflect() protoreflect.Message { mi := &file_capabilities_pb_capabilities_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -389,11 +381,9 @@ type TriggerEvent struct { func (x *TriggerEvent) Reset() { *x = TriggerEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_capabilities_pb_capabilities_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_capabilities_pb_capabilities_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TriggerEvent) String() string { @@ -404,7 +394,7 @@ func (*TriggerEvent) ProtoMessage() {} func (x *TriggerEvent) ProtoReflect() protoreflect.Message { mi := &file_capabilities_pb_capabilities_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -451,11 +441,9 @@ type TriggerResponse struct { func (x *TriggerResponse) Reset() { *x = TriggerResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_capabilities_pb_capabilities_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_capabilities_pb_capabilities_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TriggerResponse) String() string { @@ -466,7 +454,7 @@ func (*TriggerResponse) ProtoMessage() {} func (x *TriggerResponse) ProtoReflect() protoreflect.Message { mi := &file_capabilities_pb_capabilities_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -509,11 +497,9 @@ type TriggerResponseMessage struct { func (x *TriggerResponseMessage) Reset() { *x = TriggerResponseMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_capabilities_pb_capabilities_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_capabilities_pb_capabilities_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TriggerResponseMessage) String() string { @@ -524,7 +510,7 @@ func (*TriggerResponseMessage) ProtoMessage() {} func (x *TriggerResponseMessage) ProtoReflect() protoreflect.Message { mi := &file_capabilities_pb_capabilities_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -587,11 +573,9 @@ type CapabilityResponse struct { func (x *CapabilityResponse) Reset() { *x = CapabilityResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_capabilities_pb_capabilities_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_capabilities_pb_capabilities_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CapabilityResponse) String() string { @@ -602,7 +586,7 @@ func (*CapabilityResponse) ProtoMessage() {} func (x *CapabilityResponse) ProtoReflect() protoreflect.Message { mi := &file_capabilities_pb_capabilities_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -643,11 +627,9 @@ type RegistrationMetadata struct { func (x *RegistrationMetadata) Reset() { *x = RegistrationMetadata{} - if protoimpl.UnsafeEnabled { - mi := &file_capabilities_pb_capabilities_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_capabilities_pb_capabilities_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *RegistrationMetadata) String() string { @@ -658,7 +640,7 @@ func (*RegistrationMetadata) ProtoMessage() {} func (x *RegistrationMetadata) ProtoReflect() protoreflect.Message { mi := &file_capabilities_pb_capabilities_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -705,11 +687,9 @@ type RegisterToWorkflowRequest struct { func (x *RegisterToWorkflowRequest) Reset() { *x = RegisterToWorkflowRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_capabilities_pb_capabilities_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_capabilities_pb_capabilities_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *RegisterToWorkflowRequest) String() string { @@ -720,7 +700,7 @@ func (*RegisterToWorkflowRequest) ProtoMessage() {} func (x *RegisterToWorkflowRequest) ProtoReflect() protoreflect.Message { mi := &file_capabilities_pb_capabilities_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -760,11 +740,9 @@ type UnregisterFromWorkflowRequest struct { func (x *UnregisterFromWorkflowRequest) Reset() { *x = UnregisterFromWorkflowRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_capabilities_pb_capabilities_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_capabilities_pb_capabilities_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *UnregisterFromWorkflowRequest) String() string { @@ -775,7 +753,7 @@ func (*UnregisterFromWorkflowRequest) ProtoMessage() {} func (x *UnregisterFromWorkflowRequest) ProtoReflect() protoreflect.Message { mi := &file_capabilities_pb_capabilities_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -821,11 +799,9 @@ type InitialiseRequest struct { func (x *InitialiseRequest) Reset() { *x = InitialiseRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_capabilities_pb_capabilities_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_capabilities_pb_capabilities_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *InitialiseRequest) String() string { @@ -836,7 +812,7 @@ func (*InitialiseRequest) ProtoMessage() {} func (x *InitialiseRequest) ProtoReflect() protoreflect.Message { mi := &file_capabilities_pb_capabilities_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -917,11 +893,9 @@ type CapabilityInfosReply struct { func (x *CapabilityInfosReply) Reset() { *x = CapabilityInfosReply{} - if protoimpl.UnsafeEnabled { - mi := &file_capabilities_pb_capabilities_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_capabilities_pb_capabilities_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CapabilityInfosReply) String() string { @@ -932,7 +906,7 @@ func (*CapabilityInfosReply) ProtoMessage() {} func (x *CapabilityInfosReply) ProtoReflect() protoreflect.Message { mi := &file_capabilities_pb_capabilities_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1170,7 +1144,7 @@ func file_capabilities_pb_capabilities_proto_rawDescGZIP() []byte { var file_capabilities_pb_capabilities_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_capabilities_pb_capabilities_proto_msgTypes = make([]protoimpl.MessageInfo, 13) -var file_capabilities_pb_capabilities_proto_goTypes = []interface{}{ +var file_capabilities_pb_capabilities_proto_goTypes = []any{ (CapabilityType)(0), // 0: capabilities.CapabilityType (*CapabilityInfoReply)(nil), // 1: capabilities.CapabilityInfoReply (*RequestMetadata)(nil), // 2: capabilities.RequestMetadata @@ -1233,165 +1207,7 @@ func file_capabilities_pb_capabilities_proto_init() { if File_capabilities_pb_capabilities_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_capabilities_pb_capabilities_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CapabilityInfoReply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_capabilities_pb_capabilities_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RequestMetadata); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_capabilities_pb_capabilities_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CapabilityRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_capabilities_pb_capabilities_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TriggerRegistrationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_capabilities_pb_capabilities_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TriggerEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_capabilities_pb_capabilities_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TriggerResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_capabilities_pb_capabilities_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TriggerResponseMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_capabilities_pb_capabilities_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CapabilityResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_capabilities_pb_capabilities_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegistrationMetadata); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_capabilities_pb_capabilities_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegisterToWorkflowRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_capabilities_pb_capabilities_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UnregisterFromWorkflowRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_capabilities_pb_capabilities_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InitialiseRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_capabilities_pb_capabilities_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CapabilityInfosReply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_capabilities_pb_capabilities_proto_msgTypes[6].OneofWrappers = []interface{}{ + file_capabilities_pb_capabilities_proto_msgTypes[6].OneofWrappers = []any{ (*TriggerResponseMessage_Ack)(nil), (*TriggerResponseMessage_Response)(nil), } diff --git a/pkg/capabilities/pb/capabilities_grpc.pb.go b/pkg/capabilities/pb/capabilities_grpc.pb.go index 672a3f07c..2eefc8d22 100644 --- a/pkg/capabilities/pb/capabilities_grpc.pb.go +++ b/pkg/capabilities/pb/capabilities_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.1 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.28.2 // source: capabilities/pb/capabilities.proto package pb @@ -16,8 +16,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( BaseCapability_Info_FullMethodName = "/capabilities.BaseCapability/Info" @@ -39,8 +39,9 @@ func NewBaseCapabilityClient(cc grpc.ClientConnInterface) BaseCapabilityClient { } func (c *baseCapabilityClient) Info(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*CapabilityInfoReply, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CapabilityInfoReply) - err := c.cc.Invoke(ctx, BaseCapability_Info_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, BaseCapability_Info_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -49,20 +50,24 @@ func (c *baseCapabilityClient) Info(ctx context.Context, in *emptypb.Empty, opts // BaseCapabilityServer is the server API for BaseCapability service. // All implementations must embed UnimplementedBaseCapabilityServer -// for forward compatibility +// for forward compatibility. type BaseCapabilityServer interface { Info(context.Context, *emptypb.Empty) (*CapabilityInfoReply, error) mustEmbedUnimplementedBaseCapabilityServer() } -// UnimplementedBaseCapabilityServer must be embedded to have forward compatible implementations. -type UnimplementedBaseCapabilityServer struct { -} +// UnimplementedBaseCapabilityServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedBaseCapabilityServer struct{} func (UnimplementedBaseCapabilityServer) Info(context.Context, *emptypb.Empty) (*CapabilityInfoReply, error) { return nil, status.Errorf(codes.Unimplemented, "method Info not implemented") } func (UnimplementedBaseCapabilityServer) mustEmbedUnimplementedBaseCapabilityServer() {} +func (UnimplementedBaseCapabilityServer) testEmbeddedByValue() {} // UnsafeBaseCapabilityServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to BaseCapabilityServer will @@ -72,6 +77,13 @@ type UnsafeBaseCapabilityServer interface { } func RegisterBaseCapabilityServer(s grpc.ServiceRegistrar, srv BaseCapabilityServer) { + // If the following call pancis, it indicates UnimplementedBaseCapabilityServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&BaseCapability_ServiceDesc, srv) } @@ -118,7 +130,7 @@ const ( // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type TriggerExecutableClient interface { - RegisterTrigger(ctx context.Context, in *TriggerRegistrationRequest, opts ...grpc.CallOption) (TriggerExecutable_RegisterTriggerClient, error) + RegisterTrigger(ctx context.Context, in *TriggerRegistrationRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[TriggerResponseMessage], error) UnregisterTrigger(ctx context.Context, in *TriggerRegistrationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) } @@ -130,12 +142,13 @@ func NewTriggerExecutableClient(cc grpc.ClientConnInterface) TriggerExecutableCl return &triggerExecutableClient{cc} } -func (c *triggerExecutableClient) RegisterTrigger(ctx context.Context, in *TriggerRegistrationRequest, opts ...grpc.CallOption) (TriggerExecutable_RegisterTriggerClient, error) { - stream, err := c.cc.NewStream(ctx, &TriggerExecutable_ServiceDesc.Streams[0], TriggerExecutable_RegisterTrigger_FullMethodName, opts...) +func (c *triggerExecutableClient) RegisterTrigger(ctx context.Context, in *TriggerRegistrationRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[TriggerResponseMessage], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &TriggerExecutable_ServiceDesc.Streams[0], TriggerExecutable_RegisterTrigger_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &triggerExecutableRegisterTriggerClient{stream} + x := &grpc.GenericClientStream[TriggerRegistrationRequest, TriggerResponseMessage]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -145,26 +158,13 @@ func (c *triggerExecutableClient) RegisterTrigger(ctx context.Context, in *Trigg return x, nil } -type TriggerExecutable_RegisterTriggerClient interface { - Recv() (*TriggerResponseMessage, error) - grpc.ClientStream -} - -type triggerExecutableRegisterTriggerClient struct { - grpc.ClientStream -} - -func (x *triggerExecutableRegisterTriggerClient) Recv() (*TriggerResponseMessage, error) { - m := new(TriggerResponseMessage) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type TriggerExecutable_RegisterTriggerClient = grpc.ServerStreamingClient[TriggerResponseMessage] func (c *triggerExecutableClient) UnregisterTrigger(ctx context.Context, in *TriggerRegistrationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, TriggerExecutable_UnregisterTrigger_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, TriggerExecutable_UnregisterTrigger_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -173,24 +173,28 @@ func (c *triggerExecutableClient) UnregisterTrigger(ctx context.Context, in *Tri // TriggerExecutableServer is the server API for TriggerExecutable service. // All implementations must embed UnimplementedTriggerExecutableServer -// for forward compatibility +// for forward compatibility. type TriggerExecutableServer interface { - RegisterTrigger(*TriggerRegistrationRequest, TriggerExecutable_RegisterTriggerServer) error + RegisterTrigger(*TriggerRegistrationRequest, grpc.ServerStreamingServer[TriggerResponseMessage]) error UnregisterTrigger(context.Context, *TriggerRegistrationRequest) (*emptypb.Empty, error) mustEmbedUnimplementedTriggerExecutableServer() } -// UnimplementedTriggerExecutableServer must be embedded to have forward compatible implementations. -type UnimplementedTriggerExecutableServer struct { -} +// UnimplementedTriggerExecutableServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedTriggerExecutableServer struct{} -func (UnimplementedTriggerExecutableServer) RegisterTrigger(*TriggerRegistrationRequest, TriggerExecutable_RegisterTriggerServer) error { +func (UnimplementedTriggerExecutableServer) RegisterTrigger(*TriggerRegistrationRequest, grpc.ServerStreamingServer[TriggerResponseMessage]) error { return status.Errorf(codes.Unimplemented, "method RegisterTrigger not implemented") } func (UnimplementedTriggerExecutableServer) UnregisterTrigger(context.Context, *TriggerRegistrationRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method UnregisterTrigger not implemented") } func (UnimplementedTriggerExecutableServer) mustEmbedUnimplementedTriggerExecutableServer() {} +func (UnimplementedTriggerExecutableServer) testEmbeddedByValue() {} // UnsafeTriggerExecutableServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to TriggerExecutableServer will @@ -200,6 +204,13 @@ type UnsafeTriggerExecutableServer interface { } func RegisterTriggerExecutableServer(s grpc.ServiceRegistrar, srv TriggerExecutableServer) { + // If the following call pancis, it indicates UnimplementedTriggerExecutableServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&TriggerExecutable_ServiceDesc, srv) } @@ -208,21 +219,11 @@ func _TriggerExecutable_RegisterTrigger_Handler(srv interface{}, stream grpc.Ser if err := stream.RecvMsg(m); err != nil { return err } - return srv.(TriggerExecutableServer).RegisterTrigger(m, &triggerExecutableRegisterTriggerServer{stream}) + return srv.(TriggerExecutableServer).RegisterTrigger(m, &grpc.GenericServerStream[TriggerRegistrationRequest, TriggerResponseMessage]{ServerStream: stream}) } -type TriggerExecutable_RegisterTriggerServer interface { - Send(*TriggerResponseMessage) error - grpc.ServerStream -} - -type triggerExecutableRegisterTriggerServer struct { - grpc.ServerStream -} - -func (x *triggerExecutableRegisterTriggerServer) Send(m *TriggerResponseMessage) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type TriggerExecutable_RegisterTriggerServer = grpc.ServerStreamingServer[TriggerResponseMessage] func _TriggerExecutable_UnregisterTrigger_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(TriggerRegistrationRequest) @@ -276,7 +277,7 @@ const ( type ExecutableClient interface { RegisterToWorkflow(ctx context.Context, in *RegisterToWorkflowRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) UnregisterFromWorkflow(ctx context.Context, in *UnregisterFromWorkflowRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - Execute(ctx context.Context, in *CapabilityRequest, opts ...grpc.CallOption) (Executable_ExecuteClient, error) + Execute(ctx context.Context, in *CapabilityRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[CapabilityResponse], error) } type executableClient struct { @@ -288,8 +289,9 @@ func NewExecutableClient(cc grpc.ClientConnInterface) ExecutableClient { } func (c *executableClient) RegisterToWorkflow(ctx context.Context, in *RegisterToWorkflowRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, Executable_RegisterToWorkflow_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Executable_RegisterToWorkflow_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -297,20 +299,22 @@ func (c *executableClient) RegisterToWorkflow(ctx context.Context, in *RegisterT } func (c *executableClient) UnregisterFromWorkflow(ctx context.Context, in *UnregisterFromWorkflowRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, Executable_UnregisterFromWorkflow_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Executable_UnregisterFromWorkflow_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *executableClient) Execute(ctx context.Context, in *CapabilityRequest, opts ...grpc.CallOption) (Executable_ExecuteClient, error) { - stream, err := c.cc.NewStream(ctx, &Executable_ServiceDesc.Streams[0], Executable_Execute_FullMethodName, opts...) +func (c *executableClient) Execute(ctx context.Context, in *CapabilityRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[CapabilityResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &Executable_ServiceDesc.Streams[0], Executable_Execute_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &executableExecuteClient{stream} + x := &grpc.GenericClientStream[CapabilityRequest, CapabilityResponse]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -320,36 +324,25 @@ func (c *executableClient) Execute(ctx context.Context, in *CapabilityRequest, o return x, nil } -type Executable_ExecuteClient interface { - Recv() (*CapabilityResponse, error) - grpc.ClientStream -} - -type executableExecuteClient struct { - grpc.ClientStream -} - -func (x *executableExecuteClient) Recv() (*CapabilityResponse, error) { - m := new(CapabilityResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Executable_ExecuteClient = grpc.ServerStreamingClient[CapabilityResponse] // ExecutableServer is the server API for Executable service. // All implementations must embed UnimplementedExecutableServer -// for forward compatibility +// for forward compatibility. type ExecutableServer interface { RegisterToWorkflow(context.Context, *RegisterToWorkflowRequest) (*emptypb.Empty, error) UnregisterFromWorkflow(context.Context, *UnregisterFromWorkflowRequest) (*emptypb.Empty, error) - Execute(*CapabilityRequest, Executable_ExecuteServer) error + Execute(*CapabilityRequest, grpc.ServerStreamingServer[CapabilityResponse]) error mustEmbedUnimplementedExecutableServer() } -// UnimplementedExecutableServer must be embedded to have forward compatible implementations. -type UnimplementedExecutableServer struct { -} +// UnimplementedExecutableServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedExecutableServer struct{} func (UnimplementedExecutableServer) RegisterToWorkflow(context.Context, *RegisterToWorkflowRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method RegisterToWorkflow not implemented") @@ -357,10 +350,11 @@ func (UnimplementedExecutableServer) RegisterToWorkflow(context.Context, *Regist func (UnimplementedExecutableServer) UnregisterFromWorkflow(context.Context, *UnregisterFromWorkflowRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method UnregisterFromWorkflow not implemented") } -func (UnimplementedExecutableServer) Execute(*CapabilityRequest, Executable_ExecuteServer) error { +func (UnimplementedExecutableServer) Execute(*CapabilityRequest, grpc.ServerStreamingServer[CapabilityResponse]) error { return status.Errorf(codes.Unimplemented, "method Execute not implemented") } func (UnimplementedExecutableServer) mustEmbedUnimplementedExecutableServer() {} +func (UnimplementedExecutableServer) testEmbeddedByValue() {} // UnsafeExecutableServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ExecutableServer will @@ -370,6 +364,13 @@ type UnsafeExecutableServer interface { } func RegisterExecutableServer(s grpc.ServiceRegistrar, srv ExecutableServer) { + // If the following call pancis, it indicates UnimplementedExecutableServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Executable_ServiceDesc, srv) } @@ -414,21 +415,11 @@ func _Executable_Execute_Handler(srv interface{}, stream grpc.ServerStream) erro if err := stream.RecvMsg(m); err != nil { return err } - return srv.(ExecutableServer).Execute(m, &executableExecuteServer{stream}) + return srv.(ExecutableServer).Execute(m, &grpc.GenericServerStream[CapabilityRequest, CapabilityResponse]{ServerStream: stream}) } -type Executable_ExecuteServer interface { - Send(*CapabilityResponse) error - grpc.ServerStream -} - -type executableExecuteServer struct { - grpc.ServerStream -} - -func (x *executableExecuteServer) Send(m *CapabilityResponse) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Executable_ExecuteServer = grpc.ServerStreamingServer[CapabilityResponse] // Executable_ServiceDesc is the grpc.ServiceDesc for Executable service. // It's only intended for direct use with grpc.RegisterService, @@ -478,8 +469,9 @@ func NewStandardCapabilitiesClient(cc grpc.ClientConnInterface) StandardCapabili } func (c *standardCapabilitiesClient) Initialise(ctx context.Context, in *InitialiseRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, StandardCapabilities_Initialise_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, StandardCapabilities_Initialise_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -487,8 +479,9 @@ func (c *standardCapabilitiesClient) Initialise(ctx context.Context, in *Initial } func (c *standardCapabilitiesClient) Infos(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*CapabilityInfosReply, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CapabilityInfosReply) - err := c.cc.Invoke(ctx, StandardCapabilities_Infos_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, StandardCapabilities_Infos_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -497,16 +490,19 @@ func (c *standardCapabilitiesClient) Infos(ctx context.Context, in *emptypb.Empt // StandardCapabilitiesServer is the server API for StandardCapabilities service. // All implementations must embed UnimplementedStandardCapabilitiesServer -// for forward compatibility +// for forward compatibility. type StandardCapabilitiesServer interface { Initialise(context.Context, *InitialiseRequest) (*emptypb.Empty, error) Infos(context.Context, *emptypb.Empty) (*CapabilityInfosReply, error) mustEmbedUnimplementedStandardCapabilitiesServer() } -// UnimplementedStandardCapabilitiesServer must be embedded to have forward compatible implementations. -type UnimplementedStandardCapabilitiesServer struct { -} +// UnimplementedStandardCapabilitiesServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedStandardCapabilitiesServer struct{} func (UnimplementedStandardCapabilitiesServer) Initialise(context.Context, *InitialiseRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Initialise not implemented") @@ -515,6 +511,7 @@ func (UnimplementedStandardCapabilitiesServer) Infos(context.Context, *emptypb.E return nil, status.Errorf(codes.Unimplemented, "method Infos not implemented") } func (UnimplementedStandardCapabilitiesServer) mustEmbedUnimplementedStandardCapabilitiesServer() {} +func (UnimplementedStandardCapabilitiesServer) testEmbeddedByValue() {} // UnsafeStandardCapabilitiesServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to StandardCapabilitiesServer will @@ -524,6 +521,13 @@ type UnsafeStandardCapabilitiesServer interface { } func RegisterStandardCapabilitiesServer(s grpc.ServiceRegistrar, srv StandardCapabilitiesServer) { + // If the following call pancis, it indicates UnimplementedStandardCapabilitiesServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&StandardCapabilities_ServiceDesc, srv) } diff --git a/pkg/capabilities/pb/registry.pb.go b/pkg/capabilities/pb/registry.pb.go index d6a2f6617..53750e80e 100644 --- a/pkg/capabilities/pb/registry.pb.go +++ b/pkg/capabilities/pb/registry.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 -// protoc v4.25.1 +// protoc-gen-go v1.35.1 +// protoc v5.28.2 // source: capabilities/pb/registry.proto package pb @@ -37,11 +37,9 @@ type RemoteTriggerConfig struct { func (x *RemoteTriggerConfig) Reset() { *x = RemoteTriggerConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_capabilities_pb_registry_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_capabilities_pb_registry_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *RemoteTriggerConfig) String() string { @@ -52,7 +50,7 @@ func (*RemoteTriggerConfig) ProtoMessage() {} func (x *RemoteTriggerConfig) ProtoReflect() protoreflect.Message { mi := &file_capabilities_pb_registry_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -122,11 +120,9 @@ type RemoteTargetConfig struct { func (x *RemoteTargetConfig) Reset() { *x = RemoteTargetConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_capabilities_pb_registry_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_capabilities_pb_registry_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *RemoteTargetConfig) String() string { @@ -137,7 +133,7 @@ func (*RemoteTargetConfig) ProtoMessage() {} func (x *RemoteTargetConfig) ProtoReflect() protoreflect.Message { mi := &file_capabilities_pb_registry_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -174,11 +170,9 @@ type RemoteExecutableConfig struct { func (x *RemoteExecutableConfig) Reset() { *x = RemoteExecutableConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_capabilities_pb_registry_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_capabilities_pb_registry_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *RemoteExecutableConfig) String() string { @@ -189,7 +183,7 @@ func (*RemoteExecutableConfig) ProtoMessage() {} func (x *RemoteExecutableConfig) ProtoReflect() protoreflect.Message { mi := &file_capabilities_pb_registry_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -241,11 +235,9 @@ type CapabilityConfig struct { func (x *CapabilityConfig) Reset() { *x = CapabilityConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_capabilities_pb_registry_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_capabilities_pb_registry_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CapabilityConfig) String() string { @@ -256,7 +248,7 @@ func (*CapabilityConfig) ProtoMessage() {} func (x *CapabilityConfig) ProtoReflect() protoreflect.Message { mi := &file_capabilities_pb_registry_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -426,7 +418,7 @@ func file_capabilities_pb_registry_proto_rawDescGZIP() []byte { } var file_capabilities_pb_registry_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_capabilities_pb_registry_proto_goTypes = []interface{}{ +var file_capabilities_pb_registry_proto_goTypes = []any{ (*RemoteTriggerConfig)(nil), // 0: loop.RemoteTriggerConfig (*RemoteTargetConfig)(nil), // 1: loop.RemoteTargetConfig (*RemoteExecutableConfig)(nil), // 2: loop.RemoteExecutableConfig @@ -457,57 +449,7 @@ func file_capabilities_pb_registry_proto_init() { if File_capabilities_pb_registry_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_capabilities_pb_registry_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoteTriggerConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_capabilities_pb_registry_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoteTargetConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_capabilities_pb_registry_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoteExecutableConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_capabilities_pb_registry_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CapabilityConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_capabilities_pb_registry_proto_msgTypes[3].OneofWrappers = []interface{}{ + file_capabilities_pb_registry_proto_msgTypes[3].OneofWrappers = []any{ (*CapabilityConfig_RemoteTriggerConfig)(nil), (*CapabilityConfig_RemoteTargetConfig)(nil), (*CapabilityConfig_RemoteExecutableConfig)(nil), diff --git a/pkg/values/pb/values.pb.go b/pkg/values/pb/values.pb.go index f7a40b24c..c53d2cbe2 100644 --- a/pkg/values/pb/values.pb.go +++ b/pkg/values/pb/values.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 -// protoc v4.25.1 +// protoc-gen-go v1.35.1 +// protoc v5.28.2 // source: values/pb/values.proto package pb @@ -43,11 +43,9 @@ type Value struct { func (x *Value) Reset() { *x = Value{} - if protoimpl.UnsafeEnabled { - mi := &file_values_pb_values_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_values_pb_values_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Value) String() string { @@ -58,7 +56,7 @@ func (*Value) ProtoMessage() {} func (x *Value) ProtoReflect() protoreflect.Message { mi := &file_values_pb_values_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -225,11 +223,9 @@ type BigInt struct { func (x *BigInt) Reset() { *x = BigInt{} - if protoimpl.UnsafeEnabled { - mi := &file_values_pb_values_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_values_pb_values_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BigInt) String() string { @@ -240,7 +236,7 @@ func (*BigInt) ProtoMessage() {} func (x *BigInt) ProtoReflect() protoreflect.Message { mi := &file_values_pb_values_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -279,11 +275,9 @@ type Map struct { func (x *Map) Reset() { *x = Map{} - if protoimpl.UnsafeEnabled { - mi := &file_values_pb_values_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_values_pb_values_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Map) String() string { @@ -294,7 +288,7 @@ func (*Map) ProtoMessage() {} func (x *Map) ProtoReflect() protoreflect.Message { mi := &file_values_pb_values_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -326,11 +320,9 @@ type List struct { func (x *List) Reset() { *x = List{} - if protoimpl.UnsafeEnabled { - mi := &file_values_pb_values_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_values_pb_values_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *List) String() string { @@ -341,7 +333,7 @@ func (*List) ProtoMessage() {} func (x *List) ProtoReflect() protoreflect.Message { mi := &file_values_pb_values_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -374,11 +366,9 @@ type Decimal struct { func (x *Decimal) Reset() { *x = Decimal{} - if protoimpl.UnsafeEnabled { - mi := &file_values_pb_values_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_values_pb_values_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Decimal) String() string { @@ -389,7 +379,7 @@ func (*Decimal) ProtoMessage() {} func (x *Decimal) ProtoReflect() protoreflect.Message { mi := &file_values_pb_values_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -494,7 +484,7 @@ func file_values_pb_values_proto_rawDescGZIP() []byte { } var file_values_pb_values_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_values_pb_values_proto_goTypes = []interface{}{ +var file_values_pb_values_proto_goTypes = []any{ (*Value)(nil), // 0: values.Value (*BigInt)(nil), // 1: values.BigInt (*Map)(nil), // 2: values.Map @@ -525,69 +515,7 @@ func file_values_pb_values_proto_init() { if File_values_pb_values_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_values_pb_values_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Value); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_values_pb_values_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BigInt); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_values_pb_values_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Map); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_values_pb_values_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*List); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_values_pb_values_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Decimal); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_values_pb_values_proto_msgTypes[0].OneofWrappers = []interface{}{ + file_values_pb_values_proto_msgTypes[0].OneofWrappers = []any{ (*Value_StringValue)(nil), (*Value_BoolValue)(nil), (*Value_BytesValue)(nil),