diff --git a/_examples/06_alias/federation/federation.pb.go b/_examples/06_alias/federation/federation.pb.go index eee30281..77cf1371 100644 --- a/_examples/06_alias/federation/federation.pb.go +++ b/_examples/06_alias/federation/federation.pb.go @@ -7,6 +7,7 @@ package federation import ( + post "example/post" _ "github.com/mercari/grpc-federation/grpc/federation" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -261,6 +262,7 @@ type Post struct { Data *PostData `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` Data2 *PostData `protobuf:"bytes,3,opt,name=data2,proto3" json:"data2,omitempty"` Type PostType `protobuf:"varint,4,opt,name=type,proto3,enum=org.federation.PostType" json:"type,omitempty"` + M *post.M `protobuf:"bytes,5,opt,name=m,proto3" json:"m,omitempty"` } func (x *Post) Reset() { @@ -323,6 +325,13 @@ func (x *Post) GetType() PostType { return PostType_POST_TYPE_UNKNOWN } +func (x *Post) GetM() *post.M { + if x != nil { + return x.M + } + return nil +} + type PostData struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -465,6 +474,53 @@ func (x *PostContent) GetCounts() map[int32]int32 { return nil } +type M struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + X string `protobuf:"bytes,1,opt,name=x,proto3" json:"x,omitempty"` +} + +func (x *M) Reset() { + *x = M{} + if protoimpl.UnsafeEnabled { + mi := &file_federation_federation_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *M) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*M) ProtoMessage() {} + +func (x *M) ProtoReflect() protoreflect.Message { + mi := &file_federation_federation_proto_msgTypes[5] + 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 M.ProtoReflect.Descriptor instead. +func (*M) Descriptor() ([]byte, []int) { + return file_federation_federation_proto_rawDescGZIP(), []int{5} +} + +func (x *M) GetX() string { + if x != nil { + return x.X + } + return "" +} + type GetPostRequest_ConditionA struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -476,7 +532,7 @@ type GetPostRequest_ConditionA struct { func (x *GetPostRequest_ConditionA) Reset() { *x = GetPostRequest_ConditionA{} if protoimpl.UnsafeEnabled { - mi := &file_federation_federation_proto_msgTypes[5] + mi := &file_federation_federation_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -489,7 +545,7 @@ func (x *GetPostRequest_ConditionA) String() string { func (*GetPostRequest_ConditionA) ProtoMessage() {} func (x *GetPostRequest_ConditionA) ProtoReflect() protoreflect.Message { - mi := &file_federation_federation_proto_msgTypes[5] + mi := &file_federation_federation_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -521,7 +577,7 @@ type GetPostRequest_ConditionB struct { func (x *GetPostRequest_ConditionB) Reset() { *x = GetPostRequest_ConditionB{} if protoimpl.UnsafeEnabled { - mi := &file_federation_federation_proto_msgTypes[6] + mi := &file_federation_federation_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -534,7 +590,7 @@ func (x *GetPostRequest_ConditionB) String() string { func (*GetPostRequest_ConditionB) ProtoMessage() {} func (x *GetPostRequest_ConditionB) ProtoReflect() protoreflect.Message { - mi := &file_federation_federation_proto_msgTypes[6] + mi := &file_federation_federation_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -557,155 +613,160 @@ var file_federation_federation_proto_rawDesc = []byte{ 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x20, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x66, - 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0xa2, 0x02, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x39, 0x0a, 0x01, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, - 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, - 0x65, 0x74, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x6f, - 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x48, 0x00, 0x52, 0x01, 0x61, 0x12, 0x4c, 0x0a, - 0x0b, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x48, 0x00, 0x52, - 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x1a, 0x3e, 0x0a, 0x0a, 0x43, - 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x72, 0x6f, - 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x72, 0x6f, 0x70, 0x3a, 0x1c, 0x9a, - 0x4a, 0x19, 0x1a, 0x17, 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x50, 0x6f, 0x73, - 0x74, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x1a, 0x2a, 0x0a, 0x0a, 0x43, - 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x3a, 0x1c, 0x9a, 0x4a, 0x19, 0x1a, 0x17, - 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x6e, - 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x42, 0x0b, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x85, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x73, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x04, 0x70, 0x6f, 0x73, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x42, 0x09, 0x9a, 0x4a, - 0x06, 0x12, 0x04, 0x70, 0x6f, 0x73, 0x74, 0x52, 0x04, 0x70, 0x6f, 0x73, 0x74, 0x3a, 0x3d, 0x9a, - 0x4a, 0x3a, 0x0a, 0x38, 0x0a, 0x04, 0x70, 0x6f, 0x73, 0x74, 0x6a, 0x30, 0x0a, 0x04, 0x50, 0x6f, - 0x73, 0x74, 0x12, 0x0a, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x04, 0x24, 0x2e, 0x69, 0x64, 0x12, 0x08, - 0x0a, 0x01, 0x61, 0x12, 0x03, 0x24, 0x2e, 0x61, 0x12, 0x12, 0x0a, 0x01, 0x62, 0x12, 0x0d, 0x24, - 0x2e, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x22, 0x9c, 0x05, 0x0a, - 0x04, 0x50, 0x6f, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2c, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, + 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x0f, 0x70, 0x6f, 0x73, 0x74, 0x2f, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0xa2, 0x02, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x01, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, + 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x47, 0x65, 0x74, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, + 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x48, 0x00, 0x52, 0x01, 0x61, 0x12, 0x4c, + 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x48, 0x00, + 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x1a, 0x3e, 0x0a, 0x0a, + 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x72, + 0x6f, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x72, 0x6f, 0x70, 0x3a, 0x1c, + 0x9a, 0x4a, 0x19, 0x1a, 0x17, 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x50, 0x6f, + 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x1a, 0x2a, 0x0a, 0x0a, + 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x3a, 0x1c, 0x9a, 0x4a, 0x19, 0x1a, + 0x17, 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x43, 0x6f, + 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x42, 0x0b, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x85, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x04, 0x70, 0x6f, 0x73, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, + 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x42, 0x09, 0x9a, + 0x4a, 0x06, 0x12, 0x04, 0x70, 0x6f, 0x73, 0x74, 0x52, 0x04, 0x70, 0x6f, 0x73, 0x74, 0x3a, 0x3d, + 0x9a, 0x4a, 0x3a, 0x0a, 0x38, 0x0a, 0x04, 0x70, 0x6f, 0x73, 0x74, 0x6a, 0x30, 0x0a, 0x04, 0x50, + 0x6f, 0x73, 0x74, 0x12, 0x0a, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x04, 0x24, 0x2e, 0x69, 0x64, 0x12, + 0x08, 0x0a, 0x01, 0x61, 0x12, 0x03, 0x24, 0x2e, 0x61, 0x12, 0x12, 0x0a, 0x01, 0x62, 0x12, 0x0d, + 0x24, 0x2e, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x22, 0xc9, 0x05, + 0x0a, 0x04, 0x50, 0x6f, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2c, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x3a, 0x0a, 0x05, 0x64, 0x61, 0x74, 0x61, 0x32, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x12, 0x3a, 0x0a, 0x05, 0x64, 0x61, 0x74, 0x61, 0x32, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x42, 0x0a, 0x9a, 0x4a, - 0x07, 0x12, 0x05, 0x64, 0x61, 0x74, 0x61, 0x32, 0x52, 0x05, 0x64, 0x61, 0x74, 0x61, 0x32, 0x12, - 0x3d, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, - 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, - 0x6f, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x42, 0x0f, 0x9a, 0x4a, 0x0c, 0x12, 0x0a, 0x64, 0x61, - 0x74, 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x32, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x3a, 0xda, - 0x03, 0x9a, 0x4a, 0xd6, 0x03, 0x0a, 0x5f, 0x0a, 0x03, 0x72, 0x65, 0x73, 0x72, 0x58, 0x0a, 0x1c, - 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2f, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x73, 0x74, 0x12, 0x0a, 0x0a, 0x02, - 0x69, 0x64, 0x12, 0x04, 0x24, 0x2e, 0x69, 0x64, 0x12, 0x15, 0x0a, 0x01, 0x61, 0x12, 0x03, 0x24, - 0x2e, 0x61, 0x1a, 0x0b, 0x24, 0x2e, 0x61, 0x20, 0x21, 0x3d, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x12, - 0x15, 0x0a, 0x01, 0x62, 0x12, 0x03, 0x24, 0x2e, 0x62, 0x1a, 0x0b, 0x24, 0x2e, 0x62, 0x20, 0x21, - 0x3d, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x0a, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x73, 0x74, 0x18, 0x01, - 0x5a, 0x08, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x0a, 0x35, 0x0a, 0x04, 0x72, 0x65, - 0x73, 0x32, 0x72, 0x2d, 0x0a, 0x1f, 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x76, - 0x32, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x47, 0x65, - 0x74, 0x50, 0x6f, 0x73, 0x74, 0x12, 0x0a, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x04, 0x24, 0x2e, 0x69, - 0x64, 0x0a, 0x17, 0x0a, 0x05, 0x64, 0x61, 0x74, 0x61, 0x32, 0x5a, 0x0e, 0x72, 0x65, 0x73, 0x32, - 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x0a, 0xa0, 0x01, 0x0a, 0x09, 0x64, - 0x61, 0x74, 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5a, 0x92, 0x01, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x65, 0x6e, 0x75, 0x6d, 0x2e, - 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x20, 0x6f, 0x72, 0x67, - 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, - 0x70, 0x65, 0x2e, 0x66, 0x72, 0x6f, 0x6d, 0x28, 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, - 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x50, 0x4f, - 0x53, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x29, 0x2c, 0x20, 0x6f, 0x72, 0x67, 0x2e, - 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, - 0x54, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x28, 0x27, 0x50, 0x4f, 0x53, 0x54, - 0x5f, 0x56, 0x32, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x27, 0x29, 0x29, 0x0a, 0x6c, 0x0a, - 0x0a, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x32, 0x5a, 0x5e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x65, 0x6e, 0x75, - 0x6d, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x20, 0x64, - 0x61, 0x74, 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2c, 0x20, 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x42, 0x0a, 0x9a, + 0x4a, 0x07, 0x12, 0x05, 0x64, 0x61, 0x74, 0x61, 0x32, 0x52, 0x05, 0x64, 0x61, 0x74, 0x61, 0x32, + 0x12, 0x3d, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, + 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x50, 0x6f, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x42, 0x0f, 0x9a, 0x4a, 0x0c, 0x12, 0x0a, 0x64, + 0x61, 0x74, 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x32, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, + 0x2b, 0x0a, 0x01, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x6f, 0x72, 0x67, + 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x4d, 0x42, 0x10, 0x9a, 0x4a, 0x0d, 0x12, 0x0b, 0x4d, 0x7b, + 0x78, 0x3a, 0x20, 0x27, 0x78, 0x78, 0x78, 0x27, 0x7d, 0x52, 0x01, 0x6d, 0x3a, 0xda, 0x03, 0x9a, + 0x4a, 0xd6, 0x03, 0x0a, 0x5f, 0x0a, 0x03, 0x72, 0x65, 0x73, 0x72, 0x58, 0x0a, 0x1c, 0x6f, 0x72, + 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2f, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x73, 0x74, 0x12, 0x0a, 0x0a, 0x02, 0x69, 0x64, + 0x12, 0x04, 0x24, 0x2e, 0x69, 0x64, 0x12, 0x15, 0x0a, 0x01, 0x61, 0x12, 0x03, 0x24, 0x2e, 0x61, + 0x1a, 0x0b, 0x24, 0x2e, 0x61, 0x20, 0x21, 0x3d, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x12, 0x15, 0x0a, + 0x01, 0x62, 0x12, 0x03, 0x24, 0x2e, 0x62, 0x1a, 0x0b, 0x24, 0x2e, 0x62, 0x20, 0x21, 0x3d, 0x20, + 0x6e, 0x75, 0x6c, 0x6c, 0x0a, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x5a, 0x08, + 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x0a, 0x35, 0x0a, 0x04, 0x72, 0x65, 0x73, 0x32, + 0x72, 0x2d, 0x0a, 0x1f, 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x76, 0x32, 0x2e, + 0x50, 0x6f, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x47, 0x65, 0x74, 0x50, + 0x6f, 0x73, 0x74, 0x12, 0x0a, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x04, 0x24, 0x2e, 0x69, 0x64, 0x0a, + 0x17, 0x0a, 0x05, 0x64, 0x61, 0x74, 0x61, 0x32, 0x5a, 0x0e, 0x72, 0x65, 0x73, 0x32, 0x2e, 0x70, + 0x6f, 0x73, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x0a, 0xa0, 0x01, 0x0a, 0x09, 0x64, 0x61, 0x74, + 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5a, 0x92, 0x01, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x66, 0x65, + 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x65, 0x6e, 0x75, 0x6d, 0x2e, 0x73, 0x65, + 0x6c, 0x65, 0x63, 0x74, 0x28, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x20, 0x6f, 0x72, 0x67, 0x2e, 0x70, + 0x6f, 0x73, 0x74, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, + 0x2e, 0x66, 0x72, 0x6f, 0x6d, 0x28, 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x50, + 0x6f, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x50, 0x4f, 0x53, 0x54, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x29, 0x2c, 0x20, 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x28, 0x27, 0x50, 0x4f, 0x53, 0x54, 0x5f, 0x56, - 0x32, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x27, 0x29, 0x29, 0x22, 0xb3, 0x01, 0x0a, 0x08, - 0x50, 0x6f, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, - 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x35, 0x0a, 0x07, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, - 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, - 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x3a, 0x2c, 0x9a, 0x4a, 0x29, 0x1a, 0x11, 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, - 0x73, 0x74, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x14, 0x6f, 0x72, 0x67, - 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x44, 0x61, 0x74, - 0x61, 0x22, 0xbf, 0x03, 0x0a, 0x0b, 0x50, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x74, 0x12, 0x40, 0x0a, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, - 0x6f, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x68, 0x65, 0x61, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x24, 0x0a, 0x08, 0x64, - 0x75, 0x70, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0x9a, - 0x4a, 0x06, 0x1a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x52, 0x07, 0x64, 0x75, 0x70, 0x42, 0x6f, 0x64, - 0x79, 0x12, 0x3f, 0x0a, 0x06, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x32, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x27, 0x29, 0x29, 0x0a, 0x6c, 0x0a, 0x0a, 0x64, + 0x61, 0x74, 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x32, 0x5a, 0x5e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x65, 0x6e, 0x75, 0x6d, 0x2e, + 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x20, 0x64, 0x61, 0x74, + 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2c, 0x20, 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, + 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, + 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x28, 0x27, 0x50, 0x4f, 0x53, 0x54, 0x5f, 0x56, 0x32, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x27, 0x29, 0x29, 0x22, 0xb3, 0x01, 0x0a, 0x08, 0x50, 0x6f, + 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x35, 0x0a, 0x07, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x72, + 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x6f, 0x73, + 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x3a, 0x2c, 0x9a, 0x4a, 0x29, 0x1a, 0x11, 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, + 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x14, 0x6f, 0x72, 0x67, 0x2e, 0x70, + 0x6f, 0x73, 0x74, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x22, + 0xbf, 0x03, 0x0a, 0x0b, 0x50, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, + 0x40, 0x0a, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x24, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x70, 0x0a, - 0x08, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x41, 0x54, - 0x45, 0x47, 0x4f, 0x52, 0x59, 0x5f, 0x41, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x41, 0x54, - 0x45, 0x47, 0x4f, 0x52, 0x59, 0x5f, 0x42, 0x10, 0x01, 0x1a, 0x44, 0x9a, 0x4a, 0x41, 0x0a, 0x1d, - 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x0a, 0x20, 0x6f, - 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x43, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x3a, - 0x32, 0x9a, 0x4a, 0x2f, 0x1a, 0x14, 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x50, - 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x1a, 0x17, 0x6f, 0x72, 0x67, 0x2e, - 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x2a, 0xb6, 0x02, 0x0a, 0x08, 0x50, 0x6f, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x1c, 0x0a, 0x11, 0x50, 0x4f, 0x53, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, - 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x1a, 0x05, 0x9a, 0x4a, 0x02, 0x08, 0x01, 0x12, 0x23, - 0x0a, 0x0d, 0x50, 0x4f, 0x53, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x4f, 0x4f, 0x10, - 0x01, 0x1a, 0x10, 0x9a, 0x4a, 0x0d, 0x12, 0x0b, 0x50, 0x4f, 0x53, 0x54, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x41, 0x12, 0xb0, 0x01, 0x0a, 0x0d, 0x50, 0x4f, 0x53, 0x54, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x42, 0x41, 0x52, 0x10, 0x02, 0x1a, 0x9c, 0x01, 0x9a, 0x4a, 0x98, 0x01, 0x12, 0x21, - 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x44, 0x61, 0x74, - 0x61, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x50, 0x4f, 0x53, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, - 0x42, 0x12, 0x21, 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x50, 0x6f, 0x73, 0x74, - 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x50, 0x4f, 0x53, 0x54, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x43, 0x12, 0x27, 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x76, - 0x32, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x50, - 0x4f, 0x53, 0x54, 0x5f, 0x56, 0x32, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x12, 0x27, 0x6f, - 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x44, - 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x50, 0x4f, 0x53, 0x54, 0x5f, 0x56, 0x32, 0x5f, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x1a, 0x34, 0x9a, 0x4a, 0x31, 0x0a, 0x15, 0x6f, 0x72, 0x67, - 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, - 0x70, 0x65, 0x0a, 0x18, 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x76, 0x32, 0x2e, - 0x50, 0x6f, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x32, 0x66, 0x0a, 0x11, - 0x46, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x4c, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x73, 0x74, 0x12, 0x1e, 0x2e, 0x6f, - 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, - 0x74, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6f, - 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, - 0x74, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x1a, - 0x03, 0x9a, 0x4a, 0x00, 0x42, 0xc5, 0x01, 0x9a, 0x4a, 0x25, 0x12, 0x0f, 0x70, 0x6f, 0x73, 0x74, - 0x2f, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x70, 0x6f, 0x73, - 0x74, 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x0a, - 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x42, 0x0f, 0x46, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1d, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, - 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x66, 0x65, 0x64, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x4f, 0x46, 0x58, 0xaa, 0x02, 0x0e, 0x4f, 0x72, - 0x67, 0x2e, 0x46, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x0e, 0x4f, - 0x72, 0x67, 0x5c, 0x46, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x1a, - 0x4f, 0x72, 0x67, 0x5c, 0x46, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x4f, 0x72, 0x67, - 0x3a, 0x3a, 0x46, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, + 0x79, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x68, 0x65, 0x61, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x24, 0x0a, 0x08, 0x64, 0x75, 0x70, + 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0x9a, 0x4a, 0x06, + 0x1a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x52, 0x07, 0x64, 0x75, 0x70, 0x42, 0x6f, 0x64, 0x79, 0x12, + 0x3f, 0x0a, 0x06, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x27, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, + 0x1a, 0x39, 0x0a, 0x0b, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x70, 0x0a, 0x08, 0x43, + 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x41, 0x54, 0x45, 0x47, + 0x4f, 0x52, 0x59, 0x5f, 0x41, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x41, 0x54, 0x45, 0x47, + 0x4f, 0x52, 0x59, 0x5f, 0x42, 0x10, 0x01, 0x1a, 0x44, 0x9a, 0x4a, 0x41, 0x0a, 0x1d, 0x6f, 0x72, + 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x0a, 0x20, 0x6f, 0x72, 0x67, + 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x3a, 0x32, 0x9a, + 0x4a, 0x2f, 0x1a, 0x14, 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x50, 0x6f, 0x73, + 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x1a, 0x17, 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, + 0x73, 0x74, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x22, 0x22, 0x0a, 0x01, 0x4d, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x01, 0x78, 0x3a, 0x0f, 0x9a, 0x4a, 0x0c, 0x1a, 0x0a, 0x6f, 0x72, 0x67, 0x2e, 0x70, + 0x6f, 0x73, 0x74, 0x2e, 0x4d, 0x2a, 0xb6, 0x02, 0x0a, 0x08, 0x50, 0x6f, 0x73, 0x74, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x11, 0x50, 0x4f, 0x53, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x1a, 0x05, 0x9a, 0x4a, 0x02, 0x08, 0x01, + 0x12, 0x23, 0x0a, 0x0d, 0x50, 0x4f, 0x53, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x4f, + 0x4f, 0x10, 0x01, 0x1a, 0x10, 0x9a, 0x4a, 0x0d, 0x12, 0x0b, 0x50, 0x4f, 0x53, 0x54, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x41, 0x12, 0xb0, 0x01, 0x0a, 0x0d, 0x50, 0x4f, 0x53, 0x54, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x42, 0x41, 0x52, 0x10, 0x02, 0x1a, 0x9c, 0x01, 0x9a, 0x4a, 0x98, 0x01, + 0x12, 0x21, 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x44, + 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x50, 0x4f, 0x53, 0x54, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x42, 0x12, 0x21, 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x50, 0x6f, + 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x50, 0x4f, 0x53, 0x54, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x12, 0x27, 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, + 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, + 0x2e, 0x50, 0x4f, 0x53, 0x54, 0x5f, 0x56, 0x32, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x12, + 0x27, 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x6f, 0x73, + 0x74, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x50, 0x4f, 0x53, 0x54, 0x5f, 0x56, + 0x32, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x1a, 0x34, 0x9a, 0x4a, 0x31, 0x0a, 0x15, 0x6f, + 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, + 0x54, 0x79, 0x70, 0x65, 0x0a, 0x18, 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x76, + 0x32, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x32, 0x66, + 0x0a, 0x11, 0x46, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x4c, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x73, 0x74, 0x12, 0x1e, + 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x47, 0x65, 0x74, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, + 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x47, 0x65, 0x74, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x1a, 0x03, 0x9a, 0x4a, 0x00, 0x42, 0xb4, 0x01, 0x9a, 0x4a, 0x14, 0x12, 0x12, 0x70, 0x6f, + 0x73, 0x74, 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0f, 0x46, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1d, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x2f, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x66, 0x65, 0x64, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x4f, 0x46, 0x58, 0xaa, 0x02, 0x0e, 0x4f, + 0x72, 0x67, 0x2e, 0x46, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x0e, + 0x4f, 0x72, 0x67, 0x5c, 0x46, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, + 0x1a, 0x4f, 0x72, 0x67, 0x5c, 0x46, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x4f, 0x72, + 0x67, 0x3a, 0x3a, 0x46, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -721,7 +782,7 @@ func file_federation_federation_proto_rawDescGZIP() []byte { } var file_federation_federation_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_federation_federation_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_federation_federation_proto_msgTypes = make([]protoimpl.MessageInfo, 9) var file_federation_federation_proto_goTypes = []interface{}{ (PostType)(0), // 0: org.federation.PostType (PostContent_Category)(0), // 1: org.federation.PostContent.Category @@ -730,28 +791,31 @@ var file_federation_federation_proto_goTypes = []interface{}{ (*Post)(nil), // 4: org.federation.Post (*PostData)(nil), // 5: org.federation.PostData (*PostContent)(nil), // 6: org.federation.PostContent - (*GetPostRequest_ConditionA)(nil), // 7: org.federation.GetPostRequest.ConditionA - (*GetPostRequest_ConditionB)(nil), // 8: org.federation.GetPostRequest.ConditionB - nil, // 9: org.federation.PostContent.CountsEntry + (*M)(nil), // 7: org.federation.M + (*GetPostRequest_ConditionA)(nil), // 8: org.federation.GetPostRequest.ConditionA + (*GetPostRequest_ConditionB)(nil), // 9: org.federation.GetPostRequest.ConditionB + nil, // 10: org.federation.PostContent.CountsEntry + (*post.M)(nil), // 11: org.post.M } var file_federation_federation_proto_depIdxs = []int32{ - 7, // 0: org.federation.GetPostRequest.a:type_name -> org.federation.GetPostRequest.ConditionA - 8, // 1: org.federation.GetPostRequest.condition_b:type_name -> org.federation.GetPostRequest.ConditionB + 8, // 0: org.federation.GetPostRequest.a:type_name -> org.federation.GetPostRequest.ConditionA + 9, // 1: org.federation.GetPostRequest.condition_b:type_name -> org.federation.GetPostRequest.ConditionB 4, // 2: org.federation.GetPostResponse.post:type_name -> org.federation.Post 5, // 3: org.federation.Post.data:type_name -> org.federation.PostData 5, // 4: org.federation.Post.data2:type_name -> org.federation.PostData 0, // 5: org.federation.Post.type:type_name -> org.federation.PostType - 0, // 6: org.federation.PostData.type:type_name -> org.federation.PostType - 6, // 7: org.federation.PostData.content:type_name -> org.federation.PostContent - 1, // 8: org.federation.PostContent.category:type_name -> org.federation.PostContent.Category - 9, // 9: org.federation.PostContent.counts:type_name -> org.federation.PostContent.CountsEntry - 2, // 10: org.federation.FederationService.GetPost:input_type -> org.federation.GetPostRequest - 3, // 11: org.federation.FederationService.GetPost:output_type -> org.federation.GetPostResponse - 11, // [11:12] is the sub-list for method output_type - 10, // [10:11] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name + 11, // 6: org.federation.Post.m:type_name -> org.post.M + 0, // 7: org.federation.PostData.type:type_name -> org.federation.PostType + 6, // 8: org.federation.PostData.content:type_name -> org.federation.PostContent + 1, // 9: org.federation.PostContent.category:type_name -> org.federation.PostContent.Category + 10, // 10: org.federation.PostContent.counts:type_name -> org.federation.PostContent.CountsEntry + 2, // 11: org.federation.FederationService.GetPost:input_type -> org.federation.GetPostRequest + 3, // 12: org.federation.FederationService.GetPost:output_type -> org.federation.GetPostResponse + 12, // [12:13] is the sub-list for method output_type + 11, // [11:12] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name } func init() { file_federation_federation_proto_init() } @@ -821,7 +885,7 @@ func file_federation_federation_proto_init() { } } file_federation_federation_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPostRequest_ConditionA); i { + switch v := v.(*M); i { case 0: return &v.state case 1: @@ -833,6 +897,18 @@ func file_federation_federation_proto_init() { } } file_federation_federation_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPostRequest_ConditionA); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_federation_federation_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetPostRequest_ConditionB); i { case 0: return &v.state @@ -855,7 +931,7 @@ func file_federation_federation_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_federation_federation_proto_rawDesc, NumEnums: 2, - NumMessages: 8, + NumMessages: 9, NumExtensions: 0, NumServices: 1, }, diff --git a/_examples/06_alias/federation/federation_grpc_federation.pb.go b/_examples/06_alias/federation/federation_grpc_federation.pb.go index 9a5101fd..964a2979 100644 --- a/_examples/06_alias/federation/federation_grpc_federation.pb.go +++ b/_examples/06_alias/federation/federation_grpc_federation.pb.go @@ -665,6 +665,23 @@ func (s *FederationService) resolve_Org_Federation_Post(ctx context.Context, req grpcfed.RecordErrorToSpan(ctx, err) return nil, err } + // (grpc.federation.field).by = "M{x: 'xxx'}" + if err := grpcfed.SetCELValue(ctx, &grpcfed.SetCELValueParam[*M]{ + Value: value, + Expr: `M{x: 'xxx'}`, + CacheIndex: 17, + Setter: func(v *M) error { + mValue, err := s.cast_Org_Federation_M__to__Org_Post_M(v) + if err != nil { + return err + } + ret.M = mValue + return nil + }, + }); err != nil { + grpcfed.RecordErrorToSpan(ctx, err) + return nil, err + } grpcfed.Logger(ctx).DebugContext(ctx, "resolved org.federation.Post", slog.Any("org.federation.Post", s.logvalue_Org_Federation_Post(ret))) return ret, nil @@ -692,6 +709,19 @@ func (s *FederationService) cast_Org_Federation_GetPostRequest_ConditionB__to__O return &post.PostConditionB{}, nil } +// cast_Org_Federation_M__to__Org_Post_M cast from "org.federation.M" to "org.post.M". +func (s *FederationService) cast_Org_Federation_M__to__Org_Post_M(from *M) (*post.M, error) { + if from == nil { + return nil, nil + } + + xValue := from.GetX() + + return &post.M{ + X: xValue, + }, nil +} + // cast_Org_Post_PostContent_Category__to__Org_Federation_PostContent_Category cast from "org.post.PostContent.Category" to "org.federation.PostContent.Category". func (s *FederationService) cast_Org_Post_PostContent_Category__to__Org_Federation_PostContent_Category(from post.PostContent_Category) (PostContent_Category, error) { switch from { @@ -883,6 +913,7 @@ func (s *FederationService) logvalue_Org_Federation_Post(v *Post) slog.Value { slog.Any("data", s.logvalue_Org_Federation_PostData(v.GetData())), slog.Any("data2", s.logvalue_Org_Federation_PostData(v.GetData2())), slog.String("type", s.logvalue_Org_Federation_PostType(v.GetType()).String()), + slog.Any("m", s.logvalue_Org_Post_M(v.GetM())), ) } @@ -965,6 +996,15 @@ func (s *FederationService) logvalue_Org_Post_GetPostRequest(v *post.GetPostRequ ) } +func (s *FederationService) logvalue_Org_Post_M(v *post.M) slog.Value { + if v == nil { + return slog.GroupValue() + } + return slog.GroupValue( + slog.String("x", v.GetX()), + ) +} + func (s *FederationService) logvalue_Org_Post_PostConditionA(v *post.PostConditionA) slog.Value { if v == nil { return slog.GroupValue() diff --git a/_examples/06_alias/main_test.go b/_examples/06_alias/main_test.go index 989eb418..e6437603 100644 --- a/_examples/06_alias/main_test.go +++ b/_examples/06_alias/main_test.go @@ -178,6 +178,7 @@ func TestFederation(t *testing.T) { DupBody: "bodybody2", }, }, + M: &post.M{X: "xxx"}, Type: federation.PostType_POST_TYPE_BAR, }, }, cmpopts.IgnoreUnexported( @@ -185,6 +186,7 @@ func TestFederation(t *testing.T) { federation.Post{}, federation.PostData{}, federation.PostContent{}, + post.M{}, )); diff != "" { t.Errorf("(-got, +want)\n%s", diff) } diff --git a/_examples/06_alias/post/post.pb.go b/_examples/06_alias/post/post.pb.go index 86a32d42..210d3612 100644 --- a/_examples/06_alias/post/post.pb.go +++ b/_examples/06_alias/post/post.pb.go @@ -536,6 +536,53 @@ func (*PostConditionB) Descriptor() ([]byte, []int) { return file_post_post_proto_rawDescGZIP(), []int{6} } +type M struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + X string `protobuf:"bytes,1,opt,name=x,proto3" json:"x,omitempty"` +} + +func (x *M) Reset() { + *x = M{} + if protoimpl.UnsafeEnabled { + mi := &file_post_post_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *M) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*M) ProtoMessage() {} + +func (x *M) ProtoReflect() protoreflect.Message { + mi := &file_post_post_proto_msgTypes[7] + 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 M.ProtoReflect.Descriptor instead. +func (*M) Descriptor() ([]byte, []int) { + return file_post_post_proto_rawDescGZIP(), []int{7} +} + +func (x *M) GetX() string { + if x != nil { + return x.X + } + return "" +} + var File_post_post_proto protoreflect.FileDescriptor var file_post_post_proto_rawDesc = []byte{ @@ -586,25 +633,26 @@ var file_post_post_proto_rawDesc = []byte{ 0x22, 0x24, 0x0a, 0x0e, 0x50, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x72, 0x6f, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x72, 0x6f, 0x70, 0x22, 0x10, 0x0a, 0x0e, 0x50, 0x6f, 0x73, 0x74, 0x43, 0x6f, - 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x2a, 0x52, 0x0a, 0x0c, 0x50, 0x6f, 0x73, 0x74, - 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x50, 0x4f, 0x53, 0x54, - 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x41, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x50, 0x4f, 0x53, - 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x50, 0x4f, - 0x53, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x50, - 0x4f, 0x53, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x10, 0x03, 0x32, 0x4f, 0x0a, 0x0b, - 0x50, 0x6f, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x40, 0x0a, 0x07, 0x47, - 0x65, 0x74, 0x50, 0x6f, 0x73, 0x74, 0x12, 0x18, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, - 0x74, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x19, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x50, - 0x6f, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x6d, 0x0a, - 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x42, 0x09, 0x50, - 0x6f, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x11, 0x65, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x2f, 0x70, 0x6f, 0x73, 0x74, 0x3b, 0x70, 0x6f, 0x73, 0x74, 0xa2, 0x02, 0x03, - 0x4f, 0x50, 0x58, 0xaa, 0x02, 0x08, 0x4f, 0x72, 0x67, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0xca, 0x02, - 0x08, 0x4f, 0x72, 0x67, 0x5c, 0x50, 0x6f, 0x73, 0x74, 0xe2, 0x02, 0x14, 0x4f, 0x72, 0x67, 0x5c, - 0x50, 0x6f, 0x73, 0x74, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0xea, 0x02, 0x09, 0x4f, 0x72, 0x67, 0x3a, 0x3a, 0x50, 0x6f, 0x73, 0x74, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x22, 0x11, 0x0a, 0x01, 0x4d, 0x12, 0x0c, 0x0a, + 0x01, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x78, 0x2a, 0x52, 0x0a, 0x0c, 0x50, + 0x6f, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x50, + 0x4f, 0x53, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x41, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, + 0x50, 0x4f, 0x53, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x10, 0x01, 0x12, 0x0f, 0x0a, + 0x0b, 0x50, 0x4f, 0x53, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x10, 0x02, 0x12, 0x0f, + 0x0a, 0x0b, 0x50, 0x4f, 0x53, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x10, 0x03, 0x32, + 0x4f, 0x0a, 0x0b, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x40, + 0x0a, 0x07, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x73, 0x74, 0x12, 0x18, 0x2e, 0x6f, 0x72, 0x67, 0x2e, + 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x47, + 0x65, 0x74, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x42, 0x6d, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x70, 0x6f, 0x73, 0x74, + 0x42, 0x09, 0x50, 0x6f, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x11, 0x65, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x70, 0x6f, 0x73, 0x74, 0x3b, 0x70, 0x6f, 0x73, 0x74, + 0xa2, 0x02, 0x03, 0x4f, 0x50, 0x58, 0xaa, 0x02, 0x08, 0x4f, 0x72, 0x67, 0x2e, 0x50, 0x6f, 0x73, + 0x74, 0xca, 0x02, 0x08, 0x4f, 0x72, 0x67, 0x5c, 0x50, 0x6f, 0x73, 0x74, 0xe2, 0x02, 0x14, 0x4f, + 0x72, 0x67, 0x5c, 0x50, 0x6f, 0x73, 0x74, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x4f, 0x72, 0x67, 0x3a, 0x3a, 0x50, 0x6f, 0x73, 0x74, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -620,7 +668,7 @@ func file_post_post_proto_rawDescGZIP() []byte { } var file_post_post_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_post_post_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_post_post_proto_msgTypes = make([]protoimpl.MessageInfo, 9) var file_post_post_proto_goTypes = []interface{}{ (PostDataType)(0), // 0: org.post.PostDataType (PostContent_Category)(0), // 1: org.post.PostContent.Category @@ -631,24 +679,25 @@ var file_post_post_proto_goTypes = []interface{}{ (*PostContent)(nil), // 6: org.post.PostContent (*PostConditionA)(nil), // 7: org.post.PostConditionA (*PostConditionB)(nil), // 8: org.post.PostConditionB - nil, // 9: org.post.PostContent.CountsEntry + (*M)(nil), // 9: org.post.M + nil, // 10: org.post.PostContent.CountsEntry } var file_post_post_proto_depIdxs = []int32{ - 7, // 0: org.post.GetPostRequest.a:type_name -> org.post.PostConditionA - 8, // 1: org.post.GetPostRequest.b:type_name -> org.post.PostConditionB - 4, // 2: org.post.GetPostResponse.post:type_name -> org.post.Post - 5, // 3: org.post.Post.data:type_name -> org.post.PostData - 0, // 4: org.post.PostData.type:type_name -> org.post.PostDataType - 6, // 5: org.post.PostData.content:type_name -> org.post.PostContent - 1, // 6: org.post.PostContent.category:type_name -> org.post.PostContent.Category - 9, // 7: org.post.PostContent.counts:type_name -> org.post.PostContent.CountsEntry - 2, // 8: org.post.PostService.GetPost:input_type -> org.post.GetPostRequest - 3, // 9: org.post.PostService.GetPost:output_type -> org.post.GetPostResponse - 9, // [9:10] is the sub-list for method output_type - 8, // [8:9] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name + 7, // 0: org.post.GetPostRequest.a:type_name -> org.post.PostConditionA + 8, // 1: org.post.GetPostRequest.b:type_name -> org.post.PostConditionB + 4, // 2: org.post.GetPostResponse.post:type_name -> org.post.Post + 5, // 3: org.post.Post.data:type_name -> org.post.PostData + 0, // 4: org.post.PostData.type:type_name -> org.post.PostDataType + 6, // 5: org.post.PostData.content:type_name -> org.post.PostContent + 1, // 6: org.post.PostContent.category:type_name -> org.post.PostContent.Category + 10, // 7: org.post.PostContent.counts:type_name -> org.post.PostContent.CountsEntry + 2, // 8: org.post.PostService.GetPost:input_type -> org.post.GetPostRequest + 3, // 9: org.post.PostService.GetPost:output_type -> org.post.GetPostResponse + 9, // [9:10] is the sub-list for method output_type + 8, // [8:9] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_post_post_proto_init() } @@ -741,6 +790,18 @@ func file_post_post_proto_init() { return nil } } + file_post_post_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*M); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_post_post_proto_msgTypes[0].OneofWrappers = []interface{}{ (*GetPostRequest_A)(nil), @@ -752,7 +813,7 @@ func file_post_post_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_post_post_proto_rawDesc, NumEnums: 2, - NumMessages: 8, + NumMessages: 9, NumExtensions: 0, NumServices: 1, }, diff --git a/_examples/06_alias/proto/federation/federation.proto b/_examples/06_alias/proto/federation/federation.proto index e476b40d..7a7d74f4 100644 --- a/_examples/06_alias/proto/federation/federation.proto +++ b/_examples/06_alias/proto/federation/federation.proto @@ -3,11 +3,12 @@ syntax = "proto3"; package org.federation; import "grpc/federation/federation.proto"; +import "post/post.proto"; option go_package = "example/federation;federation"; option (grpc.federation.file)= { - import: ["post/post.proto", "post/v2/post.proto"] + import: ["post/v2/post.proto"] }; service FederationService { @@ -79,6 +80,7 @@ message Post { PostData data = 2; PostData data2 = 3 [(grpc.federation.field).by = "data2"]; PostType type = 4 [(grpc.federation.field).by = "data_type2"]; + org.post.M m = 5 [(grpc.federation.field).by = "M{x: 'xxx'}"]; } enum PostType { @@ -128,3 +130,9 @@ message PostContent { string dup_body = 4 [(grpc.federation.field).alias = "body"]; map counts = 5; } + +message M { + option (grpc.federation.message).alias = "org.post.M"; + + string x = 1; +} \ No newline at end of file diff --git a/_examples/06_alias/proto/post/post.proto b/_examples/06_alias/proto/post/post.proto index 8880ed88..3bb032ac 100644 --- a/_examples/06_alias/proto/post/post.proto +++ b/_examples/06_alias/proto/post/post.proto @@ -55,3 +55,7 @@ message PostConditionA { } message PostConditionB {} + +message M { + string x = 1; +} \ No newline at end of file diff --git a/resolver/resolver.go b/resolver/resolver.go index 79394b7c..904776bc 100644 --- a/resolver/resolver.go +++ b/resolver/resolver.go @@ -1286,12 +1286,13 @@ func (r *Resolver) validateRequestFieldType(ctx *context, fromType *Type, toFiel } fromMessage := fromType.Message fromMessageName := fromType.Message.FQDN() - toMessageName := toType.Message.FQDN() + toMessage := toType.Message + toMessageName := toMessage.FQDN() if fromMessageName == toMessageName { // assignment of the same type is okay. return } - if fromMessage.Rule == nil || len(fromMessage.Rule.Aliases) == 0 { + if !r.findMessageAliasName(fromMessage, toMessage) { ctx.addError( ErrWithLocation( fmt.Sprintf( @@ -1303,35 +1304,15 @@ func (r *Resolver) validateRequestFieldType(ctx *context, fromType *Type, toFiel ) return } - var found bool - for _, alias := range fromMessage.Rule.Aliases { - fromMessageAliasName := alias.FQDN() - if fromMessageAliasName == toMessageName { - found = true - break - } - } - if !found { - ctx.addError( - ErrWithLocation( - fmt.Sprintf( - `required specify alias = %q in grpc.federation.message option for the %q type to automatically assign a value to the %q field`, - toMessageName, fromMessageName, toField.FQDN(), - ), - source.NewMessageBuilder(fromMessage.File.Name, fromMessage.Name). - WithOption().WithAlias().Location(), - ), - ) - return - } } if toType.Kind == types.Enum { if fromType.Enum == nil || toType.Enum == nil { return } fromEnum := fromType.Enum + toEnum := toType.Enum fromEnumName := fromEnum.FQDN() - toEnumName := toType.Enum.FQDN() + toEnumName := toEnum.FQDN() if fromEnumName == toEnumName { // assignment of the same type is okay. return @@ -1340,7 +1321,7 @@ func (r *Resolver) validateRequestFieldType(ctx *context, fromType *Type, toFiel if fromEnum.Message != nil { fromEnumMessageName = fromEnum.Message.Name } - if fromEnum.Rule == nil || len(fromEnum.Rule.Aliases) == 0 { + if !r.findEnumAliasName(fromEnum, toEnum) { ctx.addError( ErrWithLocation( fmt.Sprintf( @@ -1352,26 +1333,6 @@ func (r *Resolver) validateRequestFieldType(ctx *context, fromType *Type, toFiel ) return } - var found bool - for _, alias := range fromEnum.Rule.Aliases { - fromEnumAliasName := alias.FQDN() - if fromEnumAliasName == toEnumName { - found = true - break - } - } - if !found { - ctx.addError( - ErrWithLocation( - fmt.Sprintf( - `required specify alias = %q in grpc.federation.enum option for the %q type to automatically assign a value to the %q field`, - toEnumName, fromEnumName, toField.FQDN(), - ), - source.NewEnumBuilder(ctx.fileName(), fromEnumMessageName, fromEnum.Name).WithOption().Location(), - ), - ) - return - } } if isDifferentType(fromType, toField.Type) { ctx.addError( @@ -1387,6 +1348,52 @@ func (r *Resolver) validateRequestFieldType(ctx *context, fromType *Type, toFiel } } +func (r *Resolver) findMessageAliasName(from, to *Message) bool { + fromName := from.FQDN() + toName := to.FQDN() + + if from.Rule != nil { + for _, alias := range from.Rule.Aliases { + fromAliasName := alias.FQDN() + if fromAliasName == toName { + return true + } + } + } + if to.Rule != nil { + for _, alias := range to.Rule.Aliases { + toAliasName := alias.FQDN() + if toAliasName == fromName { + return true + } + } + } + return false +} + +func (r *Resolver) findEnumAliasName(from, to *Enum) bool { + fromName := from.FQDN() + toName := to.FQDN() + + if from.Rule != nil { + for _, alias := range from.Rule.Aliases { + fromAliasName := alias.FQDN() + if fromAliasName == toName { + return true + } + } + } + if to.Rule != nil { + for _, alias := range to.Rule.Aliases { + toAliasName := alias.FQDN() + if toAliasName == fromName { + return true + } + } + } + return false +} + func (r *Resolver) validateBindFieldEnumSelectorType(ctx *context, enumSelector *Message, toField *Field, builder *source.FieldBuilder) { for _, field := range enumSelector.Fields { if field.Type.Kind == types.Message && field.Type.Message.IsEnumSelector() { @@ -1441,14 +1448,15 @@ func (r *Resolver) validateBindFieldType(ctx *context, fromType *Type, toField * } return } - fromMessageName := fromType.Message.FQDN() + fromMessage := fromType.Message + fromMessageName := fromMessage.FQDN() toMessage := toType.Message toMessageName := toMessage.FQDN() if fromMessageName == toMessageName { // assignment of the same type is okay. return } - if toMessage.Rule == nil || len(toMessage.Rule.Aliases) == 0 { + if !r.findMessageAliasName(fromMessage, toMessage) { ctx.addError( ErrWithLocation( fmt.Sprintf( @@ -1460,71 +1468,31 @@ func (r *Resolver) validateBindFieldType(ctx *context, fromType *Type, toField * ) return } - var found bool - for _, alias := range toMessage.Rule.Aliases { - toMessageAliasName := alias.FQDN() - if toMessageAliasName == fromMessageName { - found = true - break - } - } - if !found { - ctx.addError( - ErrWithLocation( - fmt.Sprintf( - `required specify alias = %q in grpc.federation.message option for the %q type to automatically assign a value to the "%s.%s" field via autobind`, - fromMessageName, toMessageName, ctx.messageName(), toField.Name, - ), - source.NewMessageBuilder(toMessage.File.Name, toMessage.Name). - WithOption().WithAlias().Location(), - ), - ) - return - } } if fromType.Kind == types.Enum { if fromType.Enum == nil || toType.Enum == nil { return } - fromEnumName := fromType.Enum.FQDN() + fromEnum := fromType.Enum + fromEnumName := fromEnum.FQDN() toEnum := toType.Enum toEnumName := toEnum.FQDN() - if toEnumName == fromEnumName { - // assignment of the same type is okay. - return - } var toEnumMessageName string if toEnum.Message != nil { toEnumMessageName = toEnum.Message.Name } - if toEnum.Rule == nil || len(toEnum.Rule.Aliases) == 0 { - ctx.addError( - ErrWithLocation( - fmt.Sprintf( - `required specify alias = %q in grpc.federation.enum option for the %q type to automatically assign a value to the "%s.%s" field via autobind`, - fromEnumName, toEnumName, ctx.messageName(), toField.Name, - ), - source.NewEnumBuilder(ctx.fileName(), toEnumMessageName, toEnum.Name).Location(), - ), - ) + if toEnumName == fromEnumName { + // assignment of the same type is okay. return } - var found bool - for _, alias := range toEnum.Rule.Aliases { - toEnumAliasName := alias.FQDN() - if toEnumAliasName == fromEnumName { - found = true - break - } - } - if !found { + if !r.findEnumAliasName(fromEnum, toEnum) { ctx.addError( ErrWithLocation( fmt.Sprintf( `required specify alias = %q in grpc.federation.enum option for the %q type to automatically assign a value to the "%s.%s" field via autobind`, fromEnumName, toEnumName, ctx.messageName(), toField.Name, ), - source.NewEnumBuilder(ctx.fileName(), toEnumMessageName, toEnum.Name).WithOption().Location(), + source.NewEnumBuilder(ctx.fileName(), toEnumMessageName, toEnum.Name).Location(), ), ) return diff --git a/validator/validator_test.go b/validator/validator_test.go index e0fc4b93..1b552545 100644 --- a/validator/validator_test.go +++ b/validator/validator_test.go @@ -87,12 +87,12 @@ testdata/invalid_go_package.proto:9:21: go_package option "a;b;c;d" is invalid ^ `}, {file: "invalid_enum_alias_target.proto", expected: ` -testdata/invalid_enum_alias_target.proto:48:41: required specify alias = "org.post.PostDataType" in grpc.federation.enum option for the "org.federation.PostType" type to automatically assign a value to the "PostData.type" field via autobind -48: option (grpc.federation.enum).alias = "org.post.FakePostDataType"; - ^ -testdata/invalid_enum_alias_target.proto:67:43: required specify alias = "org.post.PostContent.Category" in grpc.federation.enum option for the "org.federation.PostContent.Category" type to automatically assign a value to the "PostContent.category" field via autobind -67: option (grpc.federation.enum).alias = "org.post.FakePostContent.FakeCategory"; - ^ +testdata/invalid_enum_alias_target.proto:47:1: required specify alias = "org.post.PostDataType" in grpc.federation.enum option for the "org.federation.PostType" type to automatically assign a value to the "PostData.type" field via autobind +47: enum PostType { + ^ +testdata/invalid_enum_alias_target.proto:66:3: required specify alias = "org.post.PostContent.Category" in grpc.federation.enum option for the "org.federation.PostContent.Category" type to automatically assign a value to the "PostContent.category" field via autobind +66: enum Category { + ^ `}, {file: "invalid_enum_selector.proto", expected: ` testdata/invalid_enum_selector.proto:20:15: ERROR: :1:56: cannot specify an int type. if you are directly specifying an enum value, you need to explicitly use "pkg.EnumName.value('ENUM_VALUE')" function to use the enum type @@ -163,9 +163,9 @@ testdata/invalid_map_iterator_src.proto:54:47: ERROR: :1:8: undefined fie ^ `}, {file: "invalid_message_alias_target.proto", expected: ` -testdata/invalid_message_alias_target.proto:56:44: required specify alias = "org.post.PostData" in grpc.federation.message option for the "org.federation.PostData" type to automatically assign a value to the "Post.data" field via autobind -56: option (grpc.federation.message).alias = "org.post.FakePostData"; - ^ +testdata/invalid_message_alias_target.proto:44:3: required specify alias = "org.post.PostData" in grpc.federation.message option for the "org.federation.PostData" type to automatically assign a value to the "Post.data" field via autobind +44: PostData data = 4; + ^ `}, {file: "invalid_message_alias.proto", expected: ` testdata/invalid_message_alias.proto:44:3: required specify alias = "org.post.PostData" in grpc.federation.message option for the "org.federation.PostData" type to automatically assign a value to the "Post.data" field via autobind @@ -244,15 +244,15 @@ testdata/invalid_multi_alias.proto:74:3: The types of "org.federation.PostData"' testdata/invalid_multi_alias.proto:74:3: "title" field in "org.federation.PostData" message needs to specify "grpc.federation.field" option 74: string title = 2; ^ +testdata/invalid_multi_alias.proto:75:3: required specify alias = "org.post.v2.PostContent" in grpc.federation.message option for the "org.federation.PostContent" type to automatically assign a value to the "PostData.content" field via autobind +75: PostContent content = 3; + ^ testdata/invalid_multi_alias.proto:76:3: specified "alias" in grpc.federation.message option, but "dummy" field does not exist in "org.post.PostData" message 76: int64 dummy = 4; ^ testdata/invalid_multi_alias.proto:76:3: "dummy" field in "org.federation.PostData" message needs to specify "grpc.federation.field" option 76: int64 dummy = 4; ^ -testdata/invalid_multi_alias.proto:81:12: required specify alias = "org.post.v2.PostContent" in grpc.federation.message option for the "org.federation.PostContent" type to automatically assign a value to the "PostData.content" field via autobind -81: alias: [ "org.post.PostContent" ] - ^ `}, {file: "invalid_oneof_selection.proto", expected: ` testdata/invalid_oneof_selection.proto:26:47: "org.federation.UserSelection" type has "user" as oneof name, but "user" has a difference type and cannot be accessed directly, so "user" becomes an undefined field