diff --git a/buf.work.yaml b/buf.work.yaml new file mode 100644 index 0000000..6810f65 --- /dev/null +++ b/buf.work.yaml @@ -0,0 +1,3 @@ +version: v1 +directories: + - testpb diff --git a/cosmos.pb.go b/cosmos.pb.go index ee95820..ddb9fd0 100644 --- a/cosmos.pb.go +++ b/cosmos.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 +// protoc-gen-go v1.33.0 // protoc (unknown) // source: cosmos_proto/cosmos.proto @@ -214,64 +214,13 @@ func (x *ScalarDescriptor) GetFieldType() []ScalarType { return nil } -// SinceDescriptor describes the version at which a service, message or field was added. -// Scalars extend simple protobuf built-in types with additional -// syntax and semantics, for instance to represent versions. -type SinceDescriptor struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // version is the version at which the field was added. - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` -} - -func (x *SinceDescriptor) Reset() { - *x = SinceDescriptor{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_proto_cosmos_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SinceDescriptor) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SinceDescriptor) ProtoMessage() {} - -func (x *SinceDescriptor) ProtoReflect() protoreflect.Message { - mi := &file_cosmos_proto_cosmos_proto_msgTypes[2] - 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 SinceDescriptor.ProtoReflect.Descriptor instead. -func (*SinceDescriptor) Descriptor() ([]byte, []int) { - return file_cosmos_proto_cosmos_proto_rawDescGZIP(), []int{2} -} - -func (x *SinceDescriptor) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - var file_cosmos_proto_cosmos_proto_extTypes = []protoimpl.ExtensionInfo{ { - ExtendedType: (*descriptorpb.ServiceOptions)(nil), + ExtendedType: (*descriptorpb.MethodOptions)(nil), ExtensionType: (*string)(nil), Field: 93001, - Name: "cosmos_proto.since", - Tag: "bytes,93001,opt,name=since", + Name: "cosmos_proto.method_added_since", + Tag: "bytes,93001,opt,name=method_added_since", Filename: "cosmos_proto/cosmos.proto", }, { @@ -282,6 +231,14 @@ var file_cosmos_proto_cosmos_proto_extTypes = []protoimpl.ExtensionInfo{ Tag: "bytes,93001,rep,name=implements_interface", Filename: "cosmos_proto/cosmos.proto", }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*string)(nil), + Field: 93002, + Name: "cosmos_proto.message_added_since", + Tag: "bytes,93002,opt,name=message_added_since", + Filename: "cosmos_proto/cosmos.proto", + }, { ExtendedType: (*descriptorpb.FieldOptions)(nil), ExtensionType: (*string)(nil), @@ -298,6 +255,14 @@ var file_cosmos_proto_cosmos_proto_extTypes = []protoimpl.ExtensionInfo{ Tag: "bytes,93002,opt,name=scalar", Filename: "cosmos_proto/cosmos.proto", }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*string)(nil), + Field: 93003, + Name: "cosmos_proto.field_added_since", + Tag: "bytes,93003,opt,name=field_added_since", + Filename: "cosmos_proto/cosmos.proto", + }, { ExtendedType: (*descriptorpb.FileOptions)(nil), ExtensionType: ([]*InterfaceDescriptor)(nil), @@ -314,14 +279,22 @@ var file_cosmos_proto_cosmos_proto_extTypes = []protoimpl.ExtensionInfo{ Tag: "bytes,793022,rep,name=declare_scalar", Filename: "cosmos_proto/cosmos.proto", }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*string)(nil), + Field: 793023, + Name: "cosmos_proto.file_added_since", + Tag: "bytes,793023,opt,name=file_added_since", + Filename: "cosmos_proto/cosmos.proto", + }, } -// Extension fields to descriptorpb.ServiceOptions. +// Extension fields to descriptorpb.MethodOptions. var ( - // since is used to indicate the version at which a service,message,field was added. + // method_added_since is used to indicate the version at which a method was added. // - // optional string since = 93001; - E_Since = &file_cosmos_proto_cosmos_proto_extTypes[0] + // optional string method_added_since = 93001; + E_MethodAddedSince = &file_cosmos_proto_cosmos_proto_extTypes[0] ) // Extension fields to descriptorpb.MessageOptions. @@ -334,6 +307,10 @@ var ( // // repeated string implements_interface = 93001; E_ImplementsInterface = &file_cosmos_proto_cosmos_proto_extTypes[1] + // message_added_since is used to indicate the version at which a message was added. + // + // optional string message_added_since = 93002; + E_MessageAddedSince = &file_cosmos_proto_cosmos_proto_extTypes[2] ) // Extension fields to descriptorpb.FieldOptions. @@ -343,14 +320,18 @@ var ( // Interfaces should be declared using a declare_interface file option. // // optional string accepts_interface = 93001; - E_AcceptsInterface = &file_cosmos_proto_cosmos_proto_extTypes[2] + E_AcceptsInterface = &file_cosmos_proto_cosmos_proto_extTypes[3] // scalar is used to indicate that this field follows the formatting defined // by the named scalar which should be declared with declare_scalar. Code // generators may choose to use this information to map this field to a // language-specific type representing the scalar. // // optional string scalar = 93002; - E_Scalar = &file_cosmos_proto_cosmos_proto_extTypes[3] + E_Scalar = &file_cosmos_proto_cosmos_proto_extTypes[4] + // field_added_since is used to indicate the version at which a field was added. + // + // optional string field_added_since = 93003; + E_FieldAddedSince = &file_cosmos_proto_cosmos_proto_extTypes[5] ) // Extension fields to descriptorpb.FileOptions. @@ -363,7 +344,7 @@ var ( // a/b/interfaces.proto in the file descriptor set. // // repeated cosmos_proto.InterfaceDescriptor declare_interface = 793021; - E_DeclareInterface = &file_cosmos_proto_cosmos_proto_extTypes[4] + E_DeclareInterface = &file_cosmos_proto_cosmos_proto_extTypes[6] // declare_scalar declares a scalar type to be used with // the scalar field option. Scalar names are // expected to follow the following convention such that their declaration @@ -372,7 +353,11 @@ var ( // a/b/scalars.proto in the file descriptor set. // // repeated cosmos_proto.ScalarDescriptor declare_scalar = 793022; - E_DeclareScalar = &file_cosmos_proto_cosmos_proto_extTypes[5] + E_DeclareScalar = &file_cosmos_proto_cosmos_proto_extTypes[7] + // file_added_since is used to indicate the version at which a file was added. + // + // optional string file_added_since = 793023; + E_FileAddedSince = &file_cosmos_proto_cosmos_proto_extTypes[8] ) var File_cosmos_proto_cosmos_proto protoreflect.FileDescriptor @@ -395,57 +380,70 @@ var file_cosmos_proto_cosmos_proto_rawDesc = []byte{ 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x0a, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x54, 0x79, 0x70, - 0x65, 0x52, 0x09, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, 0x22, 0x2b, 0x0a, 0x0f, - 0x53, 0x69, 0x6e, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, - 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2a, 0x58, 0x0a, 0x0a, 0x53, 0x63, 0x61, - 0x6c, 0x61, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x53, 0x43, 0x41, 0x4c, 0x41, - 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x43, 0x41, 0x4c, 0x41, 0x52, 0x5f, 0x54, - 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, - 0x53, 0x43, 0x41, 0x4c, 0x41, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x59, 0x54, 0x45, - 0x53, 0x10, 0x02, 0x3a, 0x37, 0x0a, 0x05, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc9, 0xd6, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x3a, 0x54, 0x0a, 0x14, - 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x66, 0x61, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc9, 0xd6, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x69, - 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, - 0x63, 0x65, 0x3a, 0x4c, 0x0a, 0x11, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x73, 0x5f, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc9, 0xd6, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, - 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x73, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, - 0x3a, 0x37, 0x0a, 0x06, 0x73, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, - 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xca, 0xd6, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x73, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x3a, 0x6e, 0x0a, 0x11, 0x64, 0x65, 0x63, - 0x6c, 0x61, 0x72, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x12, 0x1c, + 0x65, 0x52, 0x09, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, 0x2a, 0x58, 0x0a, 0x0a, + 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x53, 0x43, + 0x41, 0x4c, 0x41, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x43, 0x41, 0x4c, 0x41, + 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, + 0x15, 0x0a, 0x11, 0x53, 0x43, 0x41, 0x4c, 0x41, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, + 0x59, 0x54, 0x45, 0x53, 0x10, 0x02, 0x3a, 0x4e, 0x0a, 0x12, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x5f, 0x61, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x1e, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc9, 0xd6, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x41, 0x64, 0x64, 0x65, + 0x64, 0x53, 0x69, 0x6e, 0x63, 0x65, 0x3a, 0x54, 0x0a, 0x14, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xbd, 0xb3, 0x30, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x44, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x10, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, - 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x3a, 0x65, 0x0a, 0x0e, 0x64, 0x65, 0x63, - 0x6c, 0x61, 0x72, 0x65, 0x5f, 0x73, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x12, 0x1c, 0x2e, 0x67, 0x6f, + 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0xc9, 0xd6, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x3a, 0x51, 0x0a, 0x13, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x73, 0x69, + 0x6e, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xca, 0xd6, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x41, 0x64, 0x64, 0x65, 0x64, 0x53, 0x69, 0x6e, 0x63, 0x65, 0x3a, + 0x4c, 0x0a, 0x11, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x73, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x66, 0x61, 0x63, 0x65, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0xc9, 0xd6, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x61, 0x63, 0x63, + 0x65, 0x70, 0x74, 0x73, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x3a, 0x37, 0x0a, + 0x06, 0x73, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xca, 0xd6, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x73, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x3a, 0x4b, 0x0a, 0x11, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, + 0x61, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, - 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xbe, 0xb3, 0x30, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, - 0x72, 0x52, 0x0d, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, - 0x42, 0x9e, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x0b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x0b, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0xca, 0x02, 0x0b, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0xe2, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xcb, 0xd6, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x41, 0x64, 0x64, 0x65, 0x64, 0x53, 0x69, + 0x6e, 0x63, 0x65, 0x3a, 0x6e, 0x0a, 0x11, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x5f, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xbd, 0xb3, 0x30, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x6e, + 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, + 0x72, 0x52, 0x10, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, + 0x61, 0x63, 0x65, 0x3a, 0x65, 0x0a, 0x0e, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x5f, 0x73, + 0x63, 0x61, 0x6c, 0x61, 0x72, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0xbe, 0xb3, 0x30, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x63, 0x61, 0x6c, 0x61, + 0x72, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x0d, 0x64, 0x65, 0x63, + 0x6c, 0x61, 0x72, 0x65, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x3a, 0x48, 0x0a, 0x10, 0x66, 0x69, + 0x6c, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x1c, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xbf, 0xb3, 0x30, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x66, 0x69, 0x6c, 0x65, 0x41, 0x64, 0x64, 0x65, 0x64, 0x53, + 0x69, 0x6e, 0x63, 0x65, 0x42, 0x9e, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x0b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0xa2, 0x02, 0x03, 0x43, 0x58, + 0x58, 0xaa, 0x02, 0x0b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0xca, + 0x02, 0x0b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0xe2, 0x02, 0x17, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -461,32 +459,34 @@ func file_cosmos_proto_cosmos_proto_rawDescGZIP() []byte { } var file_cosmos_proto_cosmos_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_cosmos_proto_cosmos_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_cosmos_proto_cosmos_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_cosmos_proto_cosmos_proto_goTypes = []interface{}{ (ScalarType)(0), // 0: cosmos_proto.ScalarType (*InterfaceDescriptor)(nil), // 1: cosmos_proto.InterfaceDescriptor (*ScalarDescriptor)(nil), // 2: cosmos_proto.ScalarDescriptor - (*SinceDescriptor)(nil), // 3: cosmos_proto.SinceDescriptor - (*descriptorpb.ServiceOptions)(nil), // 4: google.protobuf.ServiceOptions - (*descriptorpb.MessageOptions)(nil), // 5: google.protobuf.MessageOptions - (*descriptorpb.FieldOptions)(nil), // 6: google.protobuf.FieldOptions - (*descriptorpb.FileOptions)(nil), // 7: google.protobuf.FileOptions + (*descriptorpb.MethodOptions)(nil), // 3: google.protobuf.MethodOptions + (*descriptorpb.MessageOptions)(nil), // 4: google.protobuf.MessageOptions + (*descriptorpb.FieldOptions)(nil), // 5: google.protobuf.FieldOptions + (*descriptorpb.FileOptions)(nil), // 6: google.protobuf.FileOptions } var file_cosmos_proto_cosmos_proto_depIdxs = []int32{ - 0, // 0: cosmos_proto.ScalarDescriptor.field_type:type_name -> cosmos_proto.ScalarType - 4, // 1: cosmos_proto.since:extendee -> google.protobuf.ServiceOptions - 5, // 2: cosmos_proto.implements_interface:extendee -> google.protobuf.MessageOptions - 6, // 3: cosmos_proto.accepts_interface:extendee -> google.protobuf.FieldOptions - 6, // 4: cosmos_proto.scalar:extendee -> google.protobuf.FieldOptions - 7, // 5: cosmos_proto.declare_interface:extendee -> google.protobuf.FileOptions - 7, // 6: cosmos_proto.declare_scalar:extendee -> google.protobuf.FileOptions - 1, // 7: cosmos_proto.declare_interface:type_name -> cosmos_proto.InterfaceDescriptor - 2, // 8: cosmos_proto.declare_scalar:type_name -> cosmos_proto.ScalarDescriptor - 9, // [9:9] is the sub-list for method output_type - 9, // [9:9] is the sub-list for method input_type - 7, // [7:9] is the sub-list for extension type_name - 1, // [1:7] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 0, // 0: cosmos_proto.ScalarDescriptor.field_type:type_name -> cosmos_proto.ScalarType + 3, // 1: cosmos_proto.method_added_since:extendee -> google.protobuf.MethodOptions + 4, // 2: cosmos_proto.implements_interface:extendee -> google.protobuf.MessageOptions + 4, // 3: cosmos_proto.message_added_since:extendee -> google.protobuf.MessageOptions + 5, // 4: cosmos_proto.accepts_interface:extendee -> google.protobuf.FieldOptions + 5, // 5: cosmos_proto.scalar:extendee -> google.protobuf.FieldOptions + 5, // 6: cosmos_proto.field_added_since:extendee -> google.protobuf.FieldOptions + 6, // 7: cosmos_proto.declare_interface:extendee -> google.protobuf.FileOptions + 6, // 8: cosmos_proto.declare_scalar:extendee -> google.protobuf.FileOptions + 6, // 9: cosmos_proto.file_added_since:extendee -> google.protobuf.FileOptions + 1, // 10: cosmos_proto.declare_interface:type_name -> cosmos_proto.InterfaceDescriptor + 2, // 11: cosmos_proto.declare_scalar:type_name -> cosmos_proto.ScalarDescriptor + 12, // [12:12] is the sub-list for method output_type + 12, // [12:12] is the sub-list for method input_type + 10, // [10:12] is the sub-list for extension type_name + 1, // [1:10] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_cosmos_proto_cosmos_proto_init() } @@ -519,18 +519,6 @@ func file_cosmos_proto_cosmos_proto_init() { return nil } } - file_cosmos_proto_cosmos_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SinceDescriptor); 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{ @@ -538,8 +526,8 @@ func file_cosmos_proto_cosmos_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_proto_cosmos_proto_rawDesc, NumEnums: 1, - NumMessages: 3, - NumExtensions: 6, + NumMessages: 2, + NumExtensions: 9, NumServices: 0, }, GoTypes: file_cosmos_proto_cosmos_proto_goTypes, diff --git a/go.mod b/go.mod index c033fd3..8008aa1 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.18 require ( github.com/google/go-cmp v0.6.0 github.com/stretchr/testify v1.9.0 + google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda google.golang.org/protobuf v1.33.0 gotest.tools/v3 v3.5.1 pgregory.net/rapid v1.1.0 diff --git a/go.sum b/go.sum index def06a7..e8d4014 100644 --- a/go.sum +++ b/go.sum @@ -6,6 +6,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda h1:b6F6WIV4xHHD0FA4oIyzU6mHWg2WI2X1RBehwa5QN38= +google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda/go.mod h1:AHcE/gZH76Bk/ROZhQphlRoWo5xKDEtz3eVEO1LfA8c= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= diff --git a/proto/cosmos_proto/cosmos.proto b/proto/cosmos_proto/cosmos.proto index 7faa1cf..9e9ad12 100644 --- a/proto/cosmos_proto/cosmos.proto +++ b/proto/cosmos_proto/cosmos.proto @@ -5,10 +5,10 @@ import "google/protobuf/descriptor.proto"; option go_package = "github.com/cosmos/cosmos-proto;cosmos_proto"; -extend google.protobuf.ServiceOptions { +extend google.protobuf.MethodOptions { - // since is used to indicate the version at which a service,message,field was added. - string since = 93001; + // method_added_since is used to indicate the version at which a method was added. + string method_added_since = 93001; } extend google.protobuf.MessageOptions { @@ -19,6 +19,9 @@ extend google.protobuf.MessageOptions { // interfaces. Interfaces should be declared using a declare_interface // file option. repeated string implements_interface = 93001; + + // message_added_since is used to indicate the version at which a message was added. + string message_added_since = 93002; } extend google.protobuf.FieldOptions { @@ -33,6 +36,9 @@ extend google.protobuf.FieldOptions { // generators may choose to use this information to map this field to a // language-specific type representing the scalar. string scalar = 93002; + + // field_added_since is used to indicate the version at which a field was added. + string field_added_since = 93003; } extend google.protobuf.FileOptions { @@ -52,6 +58,9 @@ extend google.protobuf.FileOptions { // expected that the declaration will be found in a protobuf file named // a/b/scalars.proto in the file descriptor set. repeated ScalarDescriptor declare_scalar = 793022; + + // file_added_since is used to indicate the version at which a file was added. + string file_added_since = 793023; } // InterfaceDescriptor describes an interface type to be used with @@ -100,12 +109,4 @@ enum ScalarType { SCALAR_TYPE_UNSPECIFIED = 0; SCALAR_TYPE_STRING = 1; SCALAR_TYPE_BYTES = 2; -} - -// SinceDescriptor describes the version at which a service, message or field was added. -// Scalars extend simple protobuf built-in types with additional -// syntax and semantics, for instance to represent versions. -message SinceDescriptor { - // version is the version at which the field was added. - string version = 1; } \ No newline at end of file diff --git a/testpb/1.proto b/testpb/1.proto index bd9185d..15ced1c 100644 --- a/testpb/1.proto +++ b/testpb/1.proto @@ -1,6 +1,6 @@ syntax="proto3"; -import "testpb/2.proto"; +import "2.proto"; option go_package = "github.com/cosmos/cosmos-proto/testpb"; diff --git a/testpb/1.pulsar.go b/testpb/1.pulsar.go index 1397f0f..b44c0e5 100644 --- a/testpb/1.pulsar.go +++ b/testpb/1.pulsar.go @@ -231,8 +231,8 @@ var ( ) func init() { - file_testpb_1_proto_init() - md_A = File_testpb_1_proto.Messages().ByName("A") + file__1_proto_init() + md_A = File__1_proto.Messages().ByName("A") fd_A_enum = md_A.Fields().ByName("enum") fd_A_some_boolean = md_A.Fields().ByName("some_boolean") fd_A_INT32 = md_A.Fields().ByName("INT32") @@ -268,7 +268,7 @@ func (x *A) ProtoReflect() protoreflect.Message { } func (x *A) slowProtoReflect() protoreflect.Message { - mi := &file_testpb_1_proto_msgTypes[0] + mi := &file__1_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2218,8 +2218,8 @@ var ( ) func init() { - file_testpb_1_proto_init() - md_B = File_testpb_1_proto.Messages().ByName("B") + file__1_proto_init() + md_B = File__1_proto.Messages().ByName("B") fd_B_x = md_B.Fields().ByName("x") } @@ -2232,7 +2232,7 @@ func (x *B) ProtoReflect() protoreflect.Message { } func (x *B) slowProtoReflect() protoreflect.Message { - mi := &file_testpb_1_proto_msgTypes[1] + mi := &file__1_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2635,8 +2635,8 @@ func (x *fastReflection_B) ProtoMethods() *protoiface.Methods { // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc v3.18.1 -// source: testpb/1.proto +// protoc (unknown) +// source: 1.proto const ( // Verify that this generated code is sufficiently up-to-date. @@ -2675,11 +2675,11 @@ func (x Enumeration) String() string { } func (Enumeration) Descriptor() protoreflect.EnumDescriptor { - return file_testpb_1_proto_enumTypes[0].Descriptor() + return file__1_proto_enumTypes[0].Descriptor() } func (Enumeration) Type() protoreflect.EnumType { - return &file_testpb_1_proto_enumTypes[0] + return &file__1_proto_enumTypes[0] } func (x Enumeration) Number() protoreflect.EnumNumber { @@ -2688,7 +2688,7 @@ func (x Enumeration) Number() protoreflect.EnumNumber { // Deprecated: Use Enumeration.Descriptor instead. func (Enumeration) EnumDescriptor() ([]byte, []int) { - return file_testpb_1_proto_rawDescGZIP(), []int{0} + return file__1_proto_rawDescGZIP(), []int{0} } type A struct { @@ -2716,6 +2716,7 @@ type A struct { MAP map[string]*B `protobuf:"bytes,18,rep,name=MAP,proto3" json:"MAP,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` LIST []*B `protobuf:"bytes,19,rep,name=LIST,proto3" json:"LIST,omitempty"` // Types that are assignable to ONEOF: + // // *A_ONEOF_B // *A_ONEOF_STRING ONEOF isA_ONEOF `protobuf_oneof:"ONEOF"` @@ -2727,7 +2728,7 @@ type A struct { func (x *A) Reset() { *x = A{} if protoimpl.UnsafeEnabled { - mi := &file_testpb_1_proto_msgTypes[0] + mi := &file__1_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2741,7 +2742,7 @@ func (*A) ProtoMessage() {} // Deprecated: Use A.ProtoReflect.Descriptor instead. func (*A) Descriptor() ([]byte, []int) { - return file_testpb_1_proto_rawDescGZIP(), []int{0} + return file__1_proto_rawDescGZIP(), []int{0} } func (x *A) GetEnum() Enumeration { @@ -2946,7 +2947,7 @@ type B struct { func (x *B) Reset() { *x = B{} if protoimpl.UnsafeEnabled { - mi := &file_testpb_1_proto_msgTypes[1] + mi := &file__1_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2960,7 +2961,7 @@ func (*B) ProtoMessage() {} // Deprecated: Use B.ProtoReflect.Descriptor instead. func (*B) Descriptor() ([]byte, []int) { - return file_testpb_1_proto_rawDescGZIP(), []int{1} + return file__1_proto_rawDescGZIP(), []int{1} } func (x *B) GetX() string { @@ -2970,88 +2971,88 @@ func (x *B) GetX() string { return "" } -var File_testpb_1_proto protoreflect.FileDescriptor - -var file_testpb_1_proto_rawDesc = []byte{ - 0x0a, 0x0e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x0e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, 0x32, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0xe7, 0x05, 0x0a, 0x01, 0x41, 0x12, 0x20, 0x0a, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0c, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x6f, 0x6d, 0x65, - 0x5f, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, - 0x73, 0x6f, 0x6d, 0x65, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x49, - 0x4e, 0x54, 0x33, 0x32, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x49, 0x4e, 0x54, 0x33, - 0x32, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x11, 0x52, 0x06, 0x53, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x49, 0x4e, - 0x54, 0x33, 0x32, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x55, 0x49, 0x4e, 0x54, 0x33, - 0x32, 0x12, 0x14, 0x0a, 0x05, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x05, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x49, 0x4e, 0x47, 0x36, - 0x34, 0x18, 0x07, 0x20, 0x01, 0x28, 0x12, 0x52, 0x06, 0x53, 0x49, 0x4e, 0x47, 0x36, 0x34, 0x12, - 0x16, 0x0a, 0x06, 0x55, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x06, 0x55, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x46, 0x49, 0x58, 0x45, - 0x44, 0x33, 0x32, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0f, 0x52, 0x08, 0x53, 0x46, 0x49, 0x58, 0x45, - 0x44, 0x33, 0x32, 0x12, 0x18, 0x0a, 0x07, 0x46, 0x49, 0x58, 0x45, 0x44, 0x33, 0x32, 0x18, 0x0a, - 0x20, 0x01, 0x28, 0x07, 0x52, 0x07, 0x46, 0x49, 0x58, 0x45, 0x44, 0x33, 0x32, 0x12, 0x14, 0x0a, - 0x05, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x02, 0x52, 0x05, 0x46, 0x4c, - 0x4f, 0x41, 0x54, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x46, 0x49, 0x58, 0x45, 0x44, 0x36, 0x34, 0x18, - 0x0c, 0x20, 0x01, 0x28, 0x10, 0x52, 0x08, 0x53, 0x46, 0x49, 0x58, 0x45, 0x44, 0x36, 0x34, 0x12, - 0x18, 0x0a, 0x07, 0x46, 0x49, 0x58, 0x45, 0x44, 0x36, 0x34, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x06, - 0x52, 0x07, 0x46, 0x49, 0x58, 0x45, 0x44, 0x36, 0x34, 0x12, 0x16, 0x0a, 0x06, 0x44, 0x4f, 0x55, - 0x42, 0x4c, 0x45, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x44, 0x4f, 0x55, 0x42, 0x4c, - 0x45, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x18, 0x0f, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x12, 0x14, 0x0a, 0x05, 0x42, 0x59, 0x54, - 0x45, 0x53, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x42, 0x59, 0x54, 0x45, 0x53, 0x12, - 0x1c, 0x0a, 0x07, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x02, 0x2e, 0x42, 0x52, 0x07, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x12, 0x1d, 0x0a, - 0x03, 0x4d, 0x41, 0x50, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x41, 0x2e, 0x4d, - 0x41, 0x50, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x03, 0x4d, 0x41, 0x50, 0x12, 0x16, 0x0a, 0x04, - 0x4c, 0x49, 0x53, 0x54, 0x18, 0x13, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x02, 0x2e, 0x42, 0x52, 0x04, - 0x4c, 0x49, 0x53, 0x54, 0x12, 0x1d, 0x0a, 0x07, 0x4f, 0x4e, 0x45, 0x4f, 0x46, 0x5f, 0x42, 0x18, - 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x02, 0x2e, 0x42, 0x48, 0x00, 0x52, 0x06, 0x4f, 0x4e, 0x45, - 0x4f, 0x46, 0x42, 0x12, 0x23, 0x0a, 0x0c, 0x4f, 0x4e, 0x45, 0x4f, 0x46, 0x5f, 0x53, 0x54, 0x52, - 0x49, 0x4e, 0x47, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x4f, 0x4e, 0x45, - 0x4f, 0x46, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x12, 0x29, 0x0a, 0x09, 0x4c, 0x49, 0x53, 0x54, - 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x18, 0x16, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x0c, 0x2e, 0x45, 0x6e, - 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x4c, 0x49, 0x53, 0x54, 0x45, - 0x4e, 0x55, 0x4d, 0x12, 0x2c, 0x0a, 0x08, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, - 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, - 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x18, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x1a, 0x3a, 0x0a, 0x08, 0x4d, 0x41, 0x50, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x02, 0x2e, 0x42, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x42, 0x07, 0x0a, 0x05, 0x4f, 0x4e, 0x45, 0x4f, 0x46, 0x22, 0x11, 0x0a, 0x01, 0x42, 0x12, - 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x78, 0x2a, 0x1f, 0x0a, - 0x0b, 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x07, 0x0a, 0x03, - 0x4f, 0x6e, 0x65, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x77, 0x6f, 0x10, 0x01, 0x42, 0x27, - 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +var File__1_proto protoreflect.FileDescriptor + +var file__1_proto_rawDesc = []byte{ + 0x0a, 0x07, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x07, 0x32, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0xe7, 0x05, 0x0a, 0x01, 0x41, 0x12, 0x20, 0x0a, 0x04, 0x65, 0x6e, 0x75, 0x6d, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0c, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x6f, + 0x6d, 0x65, 0x5f, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0b, 0x73, 0x6f, 0x6d, 0x65, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x12, 0x14, 0x0a, + 0x05, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x49, 0x4e, + 0x54, 0x33, 0x32, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x11, 0x52, 0x06, 0x53, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x12, 0x16, 0x0a, 0x06, 0x55, + 0x49, 0x4e, 0x54, 0x33, 0x32, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x55, 0x49, 0x4e, + 0x54, 0x33, 0x32, 0x12, 0x14, 0x0a, 0x05, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x05, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x49, 0x4e, + 0x47, 0x36, 0x34, 0x18, 0x07, 0x20, 0x01, 0x28, 0x12, 0x52, 0x06, 0x53, 0x49, 0x4e, 0x47, 0x36, + 0x34, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x06, 0x55, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x46, 0x49, + 0x58, 0x45, 0x44, 0x33, 0x32, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0f, 0x52, 0x08, 0x53, 0x46, 0x49, + 0x58, 0x45, 0x44, 0x33, 0x32, 0x12, 0x18, 0x0a, 0x07, 0x46, 0x49, 0x58, 0x45, 0x44, 0x33, 0x32, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x07, 0x52, 0x07, 0x46, 0x49, 0x58, 0x45, 0x44, 0x33, 0x32, 0x12, + 0x14, 0x0a, 0x05, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x02, 0x52, 0x05, + 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x46, 0x49, 0x58, 0x45, 0x44, 0x36, + 0x34, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x10, 0x52, 0x08, 0x53, 0x46, 0x49, 0x58, 0x45, 0x44, 0x36, + 0x34, 0x12, 0x18, 0x0a, 0x07, 0x46, 0x49, 0x58, 0x45, 0x44, 0x36, 0x34, 0x18, 0x0d, 0x20, 0x01, + 0x28, 0x06, 0x52, 0x07, 0x46, 0x49, 0x58, 0x45, 0x44, 0x36, 0x34, 0x12, 0x16, 0x0a, 0x06, 0x44, + 0x4f, 0x55, 0x42, 0x4c, 0x45, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x44, 0x4f, 0x55, + 0x42, 0x4c, 0x45, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x18, 0x0f, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x12, 0x14, 0x0a, 0x05, 0x42, + 0x59, 0x54, 0x45, 0x53, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x42, 0x59, 0x54, 0x45, + 0x53, 0x12, 0x1c, 0x0a, 0x07, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x18, 0x11, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x02, 0x2e, 0x42, 0x52, 0x07, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x12, + 0x1d, 0x0a, 0x03, 0x4d, 0x41, 0x50, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x41, + 0x2e, 0x4d, 0x41, 0x50, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x03, 0x4d, 0x41, 0x50, 0x12, 0x16, + 0x0a, 0x04, 0x4c, 0x49, 0x53, 0x54, 0x18, 0x13, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x02, 0x2e, 0x42, + 0x52, 0x04, 0x4c, 0x49, 0x53, 0x54, 0x12, 0x1d, 0x0a, 0x07, 0x4f, 0x4e, 0x45, 0x4f, 0x46, 0x5f, + 0x42, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x02, 0x2e, 0x42, 0x48, 0x00, 0x52, 0x06, 0x4f, + 0x4e, 0x45, 0x4f, 0x46, 0x42, 0x12, 0x23, 0x0a, 0x0c, 0x4f, 0x4e, 0x45, 0x4f, 0x46, 0x5f, 0x53, + 0x54, 0x52, 0x49, 0x4e, 0x47, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x4f, + 0x4e, 0x45, 0x4f, 0x46, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x12, 0x29, 0x0a, 0x09, 0x4c, 0x49, + 0x53, 0x54, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x18, 0x16, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x0c, 0x2e, + 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x4c, 0x49, 0x53, + 0x54, 0x45, 0x4e, 0x55, 0x4d, 0x12, 0x2c, 0x0a, 0x08, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, + 0x64, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, + 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x69, 0x6d, 0x70, 0x6f, 0x72, + 0x74, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x18, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x1a, 0x3a, 0x0a, 0x08, 0x4d, 0x41, 0x50, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x02, 0x2e, 0x42, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x4f, 0x4e, 0x45, 0x4f, 0x46, 0x22, 0x11, 0x0a, 0x01, + 0x42, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x78, 0x2a, + 0x1f, 0x0a, 0x0b, 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x07, + 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x77, 0x6f, 0x10, 0x01, + 0x42, 0x31, 0x42, 0x06, 0x31, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x25, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x65, 0x73, + 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_testpb_1_proto_rawDescOnce sync.Once - file_testpb_1_proto_rawDescData = file_testpb_1_proto_rawDesc + file__1_proto_rawDescOnce sync.Once + file__1_proto_rawDescData = file__1_proto_rawDesc ) -func file_testpb_1_proto_rawDescGZIP() []byte { - file_testpb_1_proto_rawDescOnce.Do(func() { - file_testpb_1_proto_rawDescData = protoimpl.X.CompressGZIP(file_testpb_1_proto_rawDescData) +func file__1_proto_rawDescGZIP() []byte { + file__1_proto_rawDescOnce.Do(func() { + file__1_proto_rawDescData = protoimpl.X.CompressGZIP(file__1_proto_rawDescData) }) - return file_testpb_1_proto_rawDescData + return file__1_proto_rawDescData } -var file_testpb_1_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_testpb_1_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_testpb_1_proto_goTypes = []interface{}{ +var file__1_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file__1_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file__1_proto_goTypes = []interface{}{ (Enumeration)(0), // 0: Enumeration (*A)(nil), // 1: A (*B)(nil), // 2: B nil, // 3: A.MAPEntry (*ImportedMessage)(nil), // 4: ImportedMessage } -var file_testpb_1_proto_depIdxs = []int32{ +var file__1_proto_depIdxs = []int32{ 0, // 0: A.enum:type_name -> Enumeration 2, // 1: A.MESSAGE:type_name -> B 3, // 2: A.MAP:type_name -> A.MAPEntry @@ -3067,14 +3068,14 @@ var file_testpb_1_proto_depIdxs = []int32{ 0, // [0:8] is the sub-list for field type_name } -func init() { file_testpb_1_proto_init() } -func file_testpb_1_proto_init() { - if File_testpb_1_proto != nil { +func init() { file__1_proto_init() } +func file__1_proto_init() { + if File__1_proto != nil { return } - file_testpb_2_proto_init() + file__2_proto_init() if !protoimpl.UnsafeEnabled { - file_testpb_1_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file__1_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*A); i { case 0: return &v.state @@ -3086,7 +3087,7 @@ func file_testpb_1_proto_init() { return nil } } - file_testpb_1_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file__1_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*B); i { case 0: return &v.state @@ -3099,7 +3100,7 @@ func file_testpb_1_proto_init() { } } } - file_testpb_1_proto_msgTypes[0].OneofWrappers = []interface{}{ + file__1_proto_msgTypes[0].OneofWrappers = []interface{}{ (*A_ONEOF_B)(nil), (*A_ONEOF_STRING)(nil), } @@ -3107,19 +3108,19 @@ func file_testpb_1_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_testpb_1_proto_rawDesc, + RawDescriptor: file__1_proto_rawDesc, NumEnums: 1, NumMessages: 3, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_testpb_1_proto_goTypes, - DependencyIndexes: file_testpb_1_proto_depIdxs, - EnumInfos: file_testpb_1_proto_enumTypes, - MessageInfos: file_testpb_1_proto_msgTypes, + GoTypes: file__1_proto_goTypes, + DependencyIndexes: file__1_proto_depIdxs, + EnumInfos: file__1_proto_enumTypes, + MessageInfos: file__1_proto_msgTypes, }.Build() - File_testpb_1_proto = out.File - file_testpb_1_proto_rawDesc = nil - file_testpb_1_proto_goTypes = nil - file_testpb_1_proto_depIdxs = nil + File__1_proto = out.File + file__1_proto_rawDesc = nil + file__1_proto_goTypes = nil + file__1_proto_depIdxs = nil } diff --git a/testpb/2.proto b/testpb/2.proto index 1183687..ae549dd 100644 --- a/testpb/2.proto +++ b/testpb/2.proto @@ -1,4 +1,5 @@ syntax="proto3"; + option go_package = "github.com/cosmos/cosmos-proto/testpb"; message ImportedMessage { diff --git a/testpb/2.pulsar.go b/testpb/2.pulsar.go index cb2aac9..c2bb321 100644 --- a/testpb/2.pulsar.go +++ b/testpb/2.pulsar.go @@ -17,8 +17,8 @@ var ( ) func init() { - file_testpb_2_proto_init() - md_ImportedMessage = File_testpb_2_proto.Messages().ByName("ImportedMessage") + file__2_proto_init() + md_ImportedMessage = File__2_proto.Messages().ByName("ImportedMessage") } var _ protoreflect.Message = (*fastReflection_ImportedMessage)(nil) @@ -30,7 +30,7 @@ func (x *ImportedMessage) ProtoReflect() protoreflect.Message { } func (x *ImportedMessage) slowProtoReflect() protoreflect.Message { - mi := &file_testpb_2_proto_msgTypes[0] + mi := &file__2_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -371,8 +371,8 @@ func (x *fastReflection_ImportedMessage) ProtoMethods() *protoiface.Methods { // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc v3.18.1 -// source: testpb/2.proto +// protoc (unknown) +// source: 2.proto const ( // Verify that this generated code is sufficiently up-to-date. @@ -390,7 +390,7 @@ type ImportedMessage struct { func (x *ImportedMessage) Reset() { *x = ImportedMessage{} if protoimpl.UnsafeEnabled { - mi := &file_testpb_2_proto_msgTypes[0] + mi := &file__2_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -404,37 +404,37 @@ func (*ImportedMessage) ProtoMessage() {} // Deprecated: Use ImportedMessage.ProtoReflect.Descriptor instead. func (*ImportedMessage) Descriptor() ([]byte, []int) { - return file_testpb_2_proto_rawDescGZIP(), []int{0} + return file__2_proto_rawDescGZIP(), []int{0} } -var File_testpb_2_proto protoreflect.FileDescriptor +var File__2_proto protoreflect.FileDescriptor -var file_testpb_2_proto_rawDesc = []byte{ - 0x0a, 0x0e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, 0x32, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0x11, 0x0a, 0x0f, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x42, 0x27, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, +var file__2_proto_rawDesc = []byte{ + 0x0a, 0x07, 0x32, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x11, 0x0a, 0x0f, 0x49, 0x6d, 0x70, + 0x6f, 0x72, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x31, 0x42, 0x06, + 0x32, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_testpb_2_proto_rawDescOnce sync.Once - file_testpb_2_proto_rawDescData = file_testpb_2_proto_rawDesc + file__2_proto_rawDescOnce sync.Once + file__2_proto_rawDescData = file__2_proto_rawDesc ) -func file_testpb_2_proto_rawDescGZIP() []byte { - file_testpb_2_proto_rawDescOnce.Do(func() { - file_testpb_2_proto_rawDescData = protoimpl.X.CompressGZIP(file_testpb_2_proto_rawDescData) +func file__2_proto_rawDescGZIP() []byte { + file__2_proto_rawDescOnce.Do(func() { + file__2_proto_rawDescData = protoimpl.X.CompressGZIP(file__2_proto_rawDescData) }) - return file_testpb_2_proto_rawDescData + return file__2_proto_rawDescData } -var file_testpb_2_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_testpb_2_proto_goTypes = []interface{}{ +var file__2_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file__2_proto_goTypes = []interface{}{ (*ImportedMessage)(nil), // 0: ImportedMessage } -var file_testpb_2_proto_depIdxs = []int32{ +var file__2_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name @@ -442,13 +442,13 @@ var file_testpb_2_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_testpb_2_proto_init() } -func file_testpb_2_proto_init() { - if File_testpb_2_proto != nil { +func init() { file__2_proto_init() } +func file__2_proto_init() { + if File__2_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_testpb_2_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file__2_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ImportedMessage); i { case 0: return &v.state @@ -465,18 +465,18 @@ func file_testpb_2_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_testpb_2_proto_rawDesc, + RawDescriptor: file__2_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_testpb_2_proto_goTypes, - DependencyIndexes: file_testpb_2_proto_depIdxs, - MessageInfos: file_testpb_2_proto_msgTypes, + GoTypes: file__2_proto_goTypes, + DependencyIndexes: file__2_proto_depIdxs, + MessageInfos: file__2_proto_msgTypes, }.Build() - File_testpb_2_proto = out.File - file_testpb_2_proto_rawDesc = nil - file_testpb_2_proto_goTypes = nil - file_testpb_2_proto_depIdxs = nil + File__2_proto = out.File + file__2_proto_rawDesc = nil + file__2_proto_goTypes = nil + file__2_proto_depIdxs = nil } diff --git a/testpb/3.proto b/testpb/3.proto new file mode 100644 index 0000000..f7623d2 --- /dev/null +++ b/testpb/3.proto @@ -0,0 +1,23 @@ +syntax="proto3"; + +import "google/api/annotations.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-proto/testpb"; + +// Query defines the gRPC querier service. +service Query { + // CounterQuery queries a counter. + rpc CounterQuery(QueryCounter) returns (CounterQueryResponse) { + option (google.api.http).get = "/counter"; + option (cosmos_proto.method_added_since) = "v1.0.1"; + } +} + +// QueryCounter defines the request type used to query the counter. +message QueryCounter {} + +// CounterQueryResponse defines the response type for querying the counter. +message CounterQueryResponse { + uint64 counter = 1 [(cosmos_proto.field_added_since) = "v1.0.1"]; +} \ No newline at end of file diff --git a/testpb/3.pulsar.go b/testpb/3.pulsar.go new file mode 100644 index 0000000..53297a7 --- /dev/null +++ b/testpb/3.pulsar.go @@ -0,0 +1,952 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package testpb + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_QueryCounter protoreflect.MessageDescriptor +) + +func init() { + file__3_proto_init() + md_QueryCounter = File__3_proto.Messages().ByName("QueryCounter") +} + +var _ protoreflect.Message = (*fastReflection_QueryCounter)(nil) + +type fastReflection_QueryCounter QueryCounter + +func (x *QueryCounter) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryCounter)(x) +} + +func (x *QueryCounter) slowProtoReflect() protoreflect.Message { + mi := &file__3_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) +} + +var _fastReflection_QueryCounter_messageType fastReflection_QueryCounter_messageType +var _ protoreflect.MessageType = fastReflection_QueryCounter_messageType{} + +type fastReflection_QueryCounter_messageType struct{} + +func (x fastReflection_QueryCounter_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryCounter)(nil) +} +func (x fastReflection_QueryCounter_messageType) New() protoreflect.Message { + return new(fastReflection_QueryCounter) +} +func (x fastReflection_QueryCounter_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCounter +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryCounter) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCounter +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryCounter) Type() protoreflect.MessageType { + return _fastReflection_QueryCounter_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryCounter) New() protoreflect.Message { + return new(fastReflection_QueryCounter) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryCounter) Interface() protoreflect.ProtoMessage { + return (*QueryCounter)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryCounter) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryCounter) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: QueryCounter")) + } + panic(fmt.Errorf("message QueryCounter does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCounter) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: QueryCounter")) + } + panic(fmt.Errorf("message QueryCounter does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryCounter) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: QueryCounter")) + } + panic(fmt.Errorf("message QueryCounter does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCounter) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: QueryCounter")) + } + panic(fmt.Errorf("message QueryCounter does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCounter) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: QueryCounter")) + } + panic(fmt.Errorf("message QueryCounter does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryCounter) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: QueryCounter")) + } + panic(fmt.Errorf("message QueryCounter does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryCounter) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in QueryCounter", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryCounter) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCounter) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryCounter) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryCounter) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryCounter) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryCounter) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryCounter) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCounter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCounter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_CounterQueryResponse protoreflect.MessageDescriptor + fd_CounterQueryResponse_counter protoreflect.FieldDescriptor +) + +func init() { + file__3_proto_init() + md_CounterQueryResponse = File__3_proto.Messages().ByName("CounterQueryResponse") + fd_CounterQueryResponse_counter = md_CounterQueryResponse.Fields().ByName("counter") +} + +var _ protoreflect.Message = (*fastReflection_CounterQueryResponse)(nil) + +type fastReflection_CounterQueryResponse CounterQueryResponse + +func (x *CounterQueryResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_CounterQueryResponse)(x) +} + +func (x *CounterQueryResponse) slowProtoReflect() protoreflect.Message { + mi := &file__3_proto_msgTypes[1] + 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) +} + +var _fastReflection_CounterQueryResponse_messageType fastReflection_CounterQueryResponse_messageType +var _ protoreflect.MessageType = fastReflection_CounterQueryResponse_messageType{} + +type fastReflection_CounterQueryResponse_messageType struct{} + +func (x fastReflection_CounterQueryResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_CounterQueryResponse)(nil) +} +func (x fastReflection_CounterQueryResponse_messageType) New() protoreflect.Message { + return new(fastReflection_CounterQueryResponse) +} +func (x fastReflection_CounterQueryResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_CounterQueryResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_CounterQueryResponse) Descriptor() protoreflect.MessageDescriptor { + return md_CounterQueryResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_CounterQueryResponse) Type() protoreflect.MessageType { + return _fastReflection_CounterQueryResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_CounterQueryResponse) New() protoreflect.Message { + return new(fastReflection_CounterQueryResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_CounterQueryResponse) Interface() protoreflect.ProtoMessage { + return (*CounterQueryResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_CounterQueryResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Counter != uint64(0) { + value := protoreflect.ValueOfUint64(x.Counter) + if !f(fd_CounterQueryResponse_counter, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_CounterQueryResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "CounterQueryResponse.counter": + return x.Counter != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: CounterQueryResponse")) + } + panic(fmt.Errorf("message CounterQueryResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_CounterQueryResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "CounterQueryResponse.counter": + x.Counter = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: CounterQueryResponse")) + } + panic(fmt.Errorf("message CounterQueryResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_CounterQueryResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "CounterQueryResponse.counter": + value := x.Counter + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: CounterQueryResponse")) + } + panic(fmt.Errorf("message CounterQueryResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_CounterQueryResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "CounterQueryResponse.counter": + x.Counter = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: CounterQueryResponse")) + } + panic(fmt.Errorf("message CounterQueryResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_CounterQueryResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "CounterQueryResponse.counter": + panic(fmt.Errorf("field counter of message CounterQueryResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: CounterQueryResponse")) + } + panic(fmt.Errorf("message CounterQueryResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_CounterQueryResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "CounterQueryResponse.counter": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: CounterQueryResponse")) + } + panic(fmt.Errorf("message CounterQueryResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_CounterQueryResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in CounterQueryResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_CounterQueryResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_CounterQueryResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_CounterQueryResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_CounterQueryResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*CounterQueryResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Counter != 0 { + n += 1 + runtime.Sov(uint64(x.Counter)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*CounterQueryResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Counter != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Counter)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*CounterQueryResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: CounterQueryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: CounterQueryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Counter", wireType) + } + x.Counter = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Counter |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: 3.proto + +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) +) + +// QueryCounter defines the request type used to query the counter. +type QueryCounter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryCounter) Reset() { + *x = QueryCounter{} + if protoimpl.UnsafeEnabled { + mi := &file__3_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryCounter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryCounter) ProtoMessage() {} + +// Deprecated: Use QueryCounter.ProtoReflect.Descriptor instead. +func (*QueryCounter) Descriptor() ([]byte, []int) { + return file__3_proto_rawDescGZIP(), []int{0} +} + +// CounterQueryResponse defines the response type for querying the counter. +type CounterQueryResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Counter uint64 `protobuf:"varint,1,opt,name=counter,proto3" json:"counter,omitempty"` +} + +func (x *CounterQueryResponse) Reset() { + *x = CounterQueryResponse{} + if protoimpl.UnsafeEnabled { + mi := &file__3_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CounterQueryResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CounterQueryResponse) ProtoMessage() {} + +// Deprecated: Use CounterQueryResponse.ProtoReflect.Descriptor instead. +func (*CounterQueryResponse) Descriptor() ([]byte, []int) { + return file__3_proto_rawDescGZIP(), []int{1} +} + +func (x *CounterQueryResponse) GetCounter() uint64 { + if x != nil { + return x.Counter + } + return 0 +} + +var File__3_proto protoreflect.FileDescriptor + +var file__3_proto_rawDesc = []byte{ + 0x0a, 0x07, 0x33, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x0e, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x65, 0x72, 0x22, 0x3c, 0x0a, 0x14, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, + 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0a, + 0xda, 0xb4, 0x2d, 0x06, 0x76, 0x31, 0x2e, 0x30, 0x2e, 0x31, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x65, 0x72, 0x32, 0x59, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x50, 0x0a, 0x0c, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x0d, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x1a, 0x15, 0x2e, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x65, 0x72, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x1a, 0xca, 0xb4, 0x2d, 0x06, 0x76, 0x31, 0x2e, 0x30, 0x2e, 0x31, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x42, 0x31, + 0x42, 0x06, 0x33, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file__3_proto_rawDescOnce sync.Once + file__3_proto_rawDescData = file__3_proto_rawDesc +) + +func file__3_proto_rawDescGZIP() []byte { + file__3_proto_rawDescOnce.Do(func() { + file__3_proto_rawDescData = protoimpl.X.CompressGZIP(file__3_proto_rawDescData) + }) + return file__3_proto_rawDescData +} + +var file__3_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file__3_proto_goTypes = []interface{}{ + (*QueryCounter)(nil), // 0: QueryCounter + (*CounterQueryResponse)(nil), // 1: CounterQueryResponse +} +var file__3_proto_depIdxs = []int32{ + 0, // 0: Query.CounterQuery:input_type -> QueryCounter + 1, // 1: Query.CounterQuery:output_type -> CounterQueryResponse + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file__3_proto_init() } +func file__3_proto_init() { + if File__3_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file__3_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryCounter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file__3_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CounterQueryResponse); 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__3_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file__3_proto_goTypes, + DependencyIndexes: file__3_proto_depIdxs, + MessageInfos: file__3_proto_msgTypes, + }.Build() + File__3_proto = out.File + file__3_proto_rawDesc = nil + file__3_proto_goTypes = nil + file__3_proto_depIdxs = nil +} diff --git a/testpb/buf.gen.yaml b/testpb/buf.gen.yaml new file mode 100644 index 0000000..e417bed --- /dev/null +++ b/testpb/buf.gen.yaml @@ -0,0 +1,7 @@ +version: v1 +managed: + enabled: true +plugins: + - name: go-pulsar + out: . + opt: paths=source_relative diff --git a/testpb/buf.lock b/testpb/buf.lock new file mode 100644 index 0000000..022956b --- /dev/null +++ b/testpb/buf.lock @@ -0,0 +1,13 @@ +# Generated by buf. DO NOT EDIT. +version: v1 +deps: + - remote: buf.build + owner: cosmos + repository: cosmos-proto + commit: 1935555c206d4afb9e94615dfd0fad31 + digest: shake256:c74d91a3ac7ae07d579e90eee33abf9b29664047ac8816500cf22c081fec0d72d62c89ce0bebafc1f6fec7aa5315be72606717740ca95007248425102c365377 + - remote: buf.build + owner: googleapis + repository: googleapis + commit: 4ed3bc159a8b4ac68fe253218760d035 + digest: shake256:7149cf5e9955c692d381e557830555d4e93f205a0f1b8e2dfdae46d029369aa3fc1980e35df0d310f7cc3b622f93e19ad276769a283a967dd3065ddfd3a40e13 diff --git a/testpb/buf.yaml b/testpb/buf.yaml new file mode 100644 index 0000000..bc2d92c --- /dev/null +++ b/testpb/buf.yaml @@ -0,0 +1,15 @@ +version: v1 +deps: + - buf.build/googleapis/googleapis + - buf.build/cosmos/cosmos-proto +lint: + use: + - DEFAULT + - COMMENTS + - FILE_LOWER_SNAKE_CASE + except: + - UNARY_RPC + - COMMENT_FIELD + - SERVICE_SUFFIX + - PACKAGE_VERSION_SUFFIX + - RPC_REQUEST_STANDARD_NAME