diff --git a/_examples/04_timeout/grpc/federation/federation.pb.go b/_examples/04_timeout/grpc/federation/federation.pb.go index 39b3442a..285731ed 100644 --- a/_examples/04_timeout/grpc/federation/federation.pb.go +++ b/_examples/04_timeout/grpc/federation/federation.pb.go @@ -7,6 +7,7 @@ package federation import ( + _ "github.com/mercari/grpc-federation/grpc/federation/cel" code "google.golang.org/genproto/googleapis/rpc/code" errdetails "google.golang.org/genproto/googleapis/rpc/errdetails" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -4075,7 +4076,6 @@ func file_grpc_federation_federation_proto_init() { if File_grpc_federation_federation_proto != nil { return } - file_grpc_federation_private_proto_init() if !protoimpl.UnsafeEnabled { file_grpc_federation_federation_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EnumRule); i { diff --git a/_examples/05_async/grpc/federation/federation.pb.go b/_examples/05_async/grpc/federation/federation.pb.go index 39b3442a..285731ed 100644 --- a/_examples/05_async/grpc/federation/federation.pb.go +++ b/_examples/05_async/grpc/federation/federation.pb.go @@ -7,6 +7,7 @@ package federation import ( + _ "github.com/mercari/grpc-federation/grpc/federation/cel" code "google.golang.org/genproto/googleapis/rpc/code" errdetails "google.golang.org/genproto/googleapis/rpc/errdetails" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -4075,7 +4076,6 @@ func file_grpc_federation_federation_proto_init() { if File_grpc_federation_federation_proto != nil { return } - file_grpc_federation_private_proto_init() if !protoimpl.UnsafeEnabled { file_grpc_federation_federation_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EnumRule); i { diff --git a/_examples/06_alias/grpc/federation/federation.pb.go b/_examples/06_alias/grpc/federation/federation.pb.go index 39b3442a..285731ed 100644 --- a/_examples/06_alias/grpc/federation/federation.pb.go +++ b/_examples/06_alias/grpc/federation/federation.pb.go @@ -7,6 +7,7 @@ package federation import ( + _ "github.com/mercari/grpc-federation/grpc/federation/cel" code "google.golang.org/genproto/googleapis/rpc/code" errdetails "google.golang.org/genproto/googleapis/rpc/errdetails" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -4075,7 +4076,6 @@ func file_grpc_federation_federation_proto_init() { if File_grpc_federation_federation_proto != nil { return } - file_grpc_federation_private_proto_init() if !protoimpl.UnsafeEnabled { file_grpc_federation_federation_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EnumRule); i { diff --git a/_examples/09_multi_user/grpc/federation/federation.pb.go b/_examples/09_multi_user/grpc/federation/federation.pb.go index 39b3442a..285731ed 100644 --- a/_examples/09_multi_user/grpc/federation/federation.pb.go +++ b/_examples/09_multi_user/grpc/federation/federation.pb.go @@ -7,6 +7,7 @@ package federation import ( + _ "github.com/mercari/grpc-federation/grpc/federation/cel" code "google.golang.org/genproto/googleapis/rpc/code" errdetails "google.golang.org/genproto/googleapis/rpc/errdetails" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -4075,7 +4076,6 @@ func file_grpc_federation_federation_proto_init() { if File_grpc_federation_federation_proto != nil { return } - file_grpc_federation_private_proto_init() if !protoimpl.UnsafeEnabled { file_grpc_federation_federation_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EnumRule); i { diff --git a/_examples/10_oneof/grpc/federation/federation.pb.go b/_examples/10_oneof/grpc/federation/federation.pb.go index 39b3442a..285731ed 100644 --- a/_examples/10_oneof/grpc/federation/federation.pb.go +++ b/_examples/10_oneof/grpc/federation/federation.pb.go @@ -7,6 +7,7 @@ package federation import ( + _ "github.com/mercari/grpc-federation/grpc/federation/cel" code "google.golang.org/genproto/googleapis/rpc/code" errdetails "google.golang.org/genproto/googleapis/rpc/errdetails" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -4075,7 +4076,6 @@ func file_grpc_federation_federation_proto_init() { if File_grpc_federation_federation_proto != nil { return } - file_grpc_federation_private_proto_init() if !protoimpl.UnsafeEnabled { file_grpc_federation_federation_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EnumRule); i { diff --git a/_examples/11_multi_service/grpc/federation/federation.pb.go b/_examples/11_multi_service/grpc/federation/federation.pb.go index 39b3442a..285731ed 100644 --- a/_examples/11_multi_service/grpc/federation/federation.pb.go +++ b/_examples/11_multi_service/grpc/federation/federation.pb.go @@ -7,6 +7,7 @@ package federation import ( + _ "github.com/mercari/grpc-federation/grpc/federation/cel" code "google.golang.org/genproto/googleapis/rpc/code" errdetails "google.golang.org/genproto/googleapis/rpc/errdetails" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -4075,7 +4076,6 @@ func file_grpc_federation_federation_proto_init() { if File_grpc_federation_federation_proto != nil { return } - file_grpc_federation_private_proto_init() if !protoimpl.UnsafeEnabled { file_grpc_federation_federation_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EnumRule); i { diff --git a/_examples/14_condition/grpc/federation/federation.pb.go b/_examples/14_condition/grpc/federation/federation.pb.go index 39b3442a..285731ed 100644 --- a/_examples/14_condition/grpc/federation/federation.pb.go +++ b/_examples/14_condition/grpc/federation/federation.pb.go @@ -7,6 +7,7 @@ package federation import ( + _ "github.com/mercari/grpc-federation/grpc/federation/cel" code "google.golang.org/genproto/googleapis/rpc/code" errdetails "google.golang.org/genproto/googleapis/rpc/errdetails" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -4075,7 +4076,6 @@ func file_grpc_federation_federation_proto_init() { if File_grpc_federation_federation_proto != nil { return } - file_grpc_federation_private_proto_init() if !protoimpl.UnsafeEnabled { file_grpc_federation_federation_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EnumRule); i { diff --git a/_examples/17_error_handler/federation/federation.pb.go b/_examples/17_error_handler/federation/federation.pb.go index 5f206ff4..5216e5a5 100644 --- a/_examples/17_error_handler/federation/federation.pb.go +++ b/_examples/17_error_handler/federation/federation.pb.go @@ -282,14 +282,14 @@ var file_federation_federation_proto_rawDesc = []byte{ 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, 0x1f, 0x9a, 0x4a, 0x1c, 0x0a, 0x1a, 0x0a, 0x04, 0x70, 0x6f, 0x73, 0x74, 0x6a, 0x12, 0x0a, 0x04, 0x50, 0x6f, 0x73, 0x74, 0x12, - 0x0a, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x04, 0x24, 0x2e, 0x69, 0x64, 0x22, 0xed, 0x03, 0x0a, 0x04, + 0x0a, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x04, 0x24, 0x2e, 0x69, 0x64, 0x22, 0xf7, 0x03, 0x0a, 0x04, 0x50, 0x6f, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x3a, 0xbe, 0x03, 0x9a, 0x4a, 0xba, - 0x03, 0x0a, 0xa3, 0x03, 0x0a, 0x03, 0x72, 0x65, 0x73, 0x72, 0x9b, 0x03, 0x0a, 0x18, 0x70, 0x6f, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x3a, 0xc8, 0x03, 0x9a, 0x4a, 0xc4, + 0x03, 0x0a, 0xad, 0x03, 0x0a, 0x03, 0x72, 0x65, 0x73, 0x72, 0xa5, 0x03, 0x0a, 0x18, 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, 0x2a, 0xea, 0x02, 0x0a, 0x0a, 0x0a, 0x02, 0x69, 0x64, 0x5a, 0x04, 0x24, 0x2e, 0x69, + 0x69, 0x64, 0x2a, 0xf4, 0x02, 0x0a, 0x0a, 0x0a, 0x02, 0x69, 0x64, 0x5a, 0x04, 0x24, 0x2e, 0x69, 0x64, 0x12, 0x95, 0x01, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x76, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5b, 0x30, 0x5d, @@ -301,47 +301,48 @@ var file_federation_federation_proto_rawDesc = []byte{ 0x74, 0x6f, 0x6d, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x69, 0x64, 0x20, 0x3d, 0x3d, 0x20, 0x27, 0x78, 0x27, 0x18, 0x09, 0x22, 0x1e, 0x27, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x20, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x27, 0x2a, 0xa1, 0x01, 0x12, 0x30, + 0x6f, 0x72, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x27, 0x2a, 0xab, 0x01, 0x12, 0x30, 0x0a, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x6d, 0x73, 0x67, 0x6a, 0x1f, 0x0a, 0x10, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x0b, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x02, 0x69, 0x64, - 0x1a, 0x1a, 0x0a, 0x0d, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x12, 0x09, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x02, 0x69, 0x64, 0x42, 0x33, 0x0a, 0x31, - 0x0a, 0x0b, 0x27, 0x73, 0x6f, 0x6d, 0x65, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x27, 0x12, 0x0e, 0x27, - 0x73, 0x6f, 0x6d, 0x65, 0x2d, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x27, 0x1a, 0x12, 0x27, - 0x73, 0x6f, 0x6d, 0x65, 0x2d, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x27, 0x6a, 0x1c, 0x0a, 0x05, 0x65, 0x6e, 0x2d, 0x55, 0x53, 0x12, 0x13, 0x6c, 0x6f, 0x63, 0x61, - 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2a, - 0x02, 0x30, 0x01, 0x2a, 0x02, 0x18, 0x01, 0x0a, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x73, 0x74, 0x18, - 0x01, 0x5a, 0x08, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x22, 0x4b, 0x0a, 0x10, 0x4c, - 0x6f, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, - 0x37, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, - 0x9a, 0x4a, 0x1e, 0x12, 0x1c, 0x27, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x20, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x27, 0x20, 0x2b, 0x20, 0x24, 0x2e, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x47, 0x0a, 0x0d, 0x43, 0x75, 0x73, 0x74, - 0x6f, 0x6d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x36, 0x0a, 0x03, 0x6d, 0x73, 0x67, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x24, 0x9a, 0x4a, 0x21, 0x12, 0x1f, 0x27, 0x63, 0x75, - 0x73, 0x74, 0x6f, 0x6d, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x3a, 0x27, 0x20, 0x2b, 0x20, 0x24, 0x2e, 0x6d, 0x73, 0x67, 0x52, 0x03, 0x6d, 0x73, - 0x67, 0x32, 0x7a, 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, 0x17, 0x9a, 0x4a, 0x14, 0x0a, 0x12, 0x12, 0x10, 0x70, 0x6f, 0x73, - 0x74, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0x9d, 0x01, - 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, + 0x1a, 0x24, 0x0a, 0x0d, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x12, 0x13, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x12, + 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x33, 0x0a, 0x31, 0x0a, 0x0b, 0x27, 0x73, 0x6f, 0x6d, + 0x65, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x27, 0x12, 0x0e, 0x27, 0x73, 0x6f, 0x6d, 0x65, 0x2d, 0x73, + 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x27, 0x1a, 0x12, 0x27, 0x73, 0x6f, 0x6d, 0x65, 0x2d, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x27, 0x6a, 0x1c, 0x0a, 0x05, 0x65, + 0x6e, 0x2d, 0x55, 0x53, 0x12, 0x13, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, + 0x6d, 0x73, 0x67, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2a, 0x02, 0x30, 0x01, 0x2a, 0x02, 0x18, + 0x01, 0x0a, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x5a, 0x08, 0x72, 0x65, 0x73, + 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x22, 0x4b, 0x0a, 0x10, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x69, 0x7a, + 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x37, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0x9a, 0x4a, 0x1e, 0x12, 0x1c, 0x27, + 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x27, 0x20, 0x2b, 0x20, 0x24, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x22, 0x56, 0x0a, 0x0d, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x12, 0x45, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x33, 0x9a, 0x4a, 0x30, 0x12, 0x2e, 0x27, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x20, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x3a, 0x27, 0x20, 0x2b, + 0x20, 0x24, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x32, 0x7a, 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, 0x17, 0x9a, + 0x4a, 0x14, 0x0a, 0x12, 0x12, 0x10, 0x70, 0x6f, 0x73, 0x74, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0x9d, 0x01, 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 ( diff --git a/_examples/17_error_handler/federation/federation_grpc_federation.pb.go b/_examples/17_error_handler/federation/federation_grpc_federation.pb.go index 9f1ac4c1..e52f9944 100644 --- a/_examples/17_error_handler/federation/federation_grpc_federation.pb.go +++ b/_examples/17_error_handler/federation/federation_grpc_federation.pb.go @@ -22,8 +22,8 @@ var ( // Org_Federation_CustomMessageArgument is argument for "org.federation.CustomMessage" message. type Org_Federation_CustomMessageArgument[T any] struct { - Msg string - Client T + ErrorInfo *grpcfedcel.Error + Client T } // Org_Federation_GetPostResponseArgument is argument for "org.federation.GetPostResponse" message. @@ -137,7 +137,7 @@ func NewFederationService(cfg FederationServiceConfig) (*FederationService, erro } celHelper := grpcfed.NewCELTypeHelper(map[string]map[string]*grpcfed.CELFieldType{ "grpc.federation.private.CustomMessageArgument": { - "msg": grpcfed.NewCELFieldType(grpcfed.CELStringType, "Msg"), + "error_info": grpcfed.NewCELFieldType(grpcfed.NewCELObjectType("grpc.federation.private.Error"), "ErrorInfo"), }, "grpc.federation.private.GetPostResponseArgument": { "id": grpcfed.NewCELFieldType(grpcfed.CELStringType, "Id"), @@ -207,8 +207,8 @@ func (s *FederationService) resolve_Org_Federation_CustomMessage(ctx context.Con ret := &CustomMessage{} // field binding section. - // (grpc.federation.field).by = "'custom error message:' + $.msg" - if err := grpcfed.SetCELValue(ctx, value, "'custom error message:' + $.msg", func(v string) { ret.Msg = v }); err != nil { + // (grpc.federation.field).by = "'custom error message:' + $.error_info.message" + if err := grpcfed.SetCELValue(ctx, value, "'custom error message:' + $.error_info.message", func(v string) { ret.Msg = v }); err != nil { grpcfed.RecordErrorToSpan(ctx, err) return nil, err } @@ -421,7 +421,7 @@ func (s *FederationService) resolve_Org_Federation_Post(ctx context.Context, req name: "_def0_err_detail0_msg0" message { name: "CustomMessage" - args { name: "msg", by: "id" } + args { name: "error_info", by: "error" } } } */ @@ -433,9 +433,9 @@ func (s *FederationService) resolve_Org_Federation_Post(ctx context.Context, req args := &Org_Federation_CustomMessageArgument[*FederationServiceDependentClientSet]{ Client: s.client, } - // { name: "msg", by: "id" } - if err := grpcfed.SetCELValue(ctx, value, "id", func(v string) { - args.Msg = v + // { name: "error_info", by: "error" } + if err := grpcfed.SetCELValue(ctx, value, "error", func(v *grpcfedcel.Error) { + args.ErrorInfo = v }); err != nil { return nil, err } @@ -564,6 +564,13 @@ func (s *FederationService) resolve_Org_Federation_Post(ctx context.Context, req return ret, nil } +func (s *FederationService) logvalue_Grpc_Federation_Private_Error(v *grpcfedcel.Error) slog.Value { + if v == nil { + return slog.GroupValue() + } + return slog.GroupValue() +} + func (s *FederationService) logvalue_Org_Federation_CustomMessage(v *CustomMessage) slog.Value { if v == nil { return slog.GroupValue() @@ -578,7 +585,7 @@ func (s *FederationService) logvalue_Org_Federation_CustomMessageArgument(v *Org return slog.GroupValue() } return slog.GroupValue( - slog.String("msg", v.Msg), + slog.Any("error_info", s.logvalue_Grpc_Federation_Private_Error(v.ErrorInfo)), ) } diff --git a/_examples/17_error_handler/grpc/federation/federation.pb.go b/_examples/17_error_handler/grpc/federation/federation.pb.go index 39b3442a..285731ed 100644 --- a/_examples/17_error_handler/grpc/federation/federation.pb.go +++ b/_examples/17_error_handler/grpc/federation/federation.pb.go @@ -7,6 +7,7 @@ package federation import ( + _ "github.com/mercari/grpc-federation/grpc/federation/cel" code "google.golang.org/genproto/googleapis/rpc/code" errdetails "google.golang.org/genproto/googleapis/rpc/errdetails" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -4075,7 +4076,6 @@ func file_grpc_federation_federation_proto_init() { if File_grpc_federation_federation_proto != nil { return } - file_grpc_federation_private_proto_init() if !protoimpl.UnsafeEnabled { file_grpc_federation_federation_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EnumRule); i { diff --git a/_examples/17_error_handler/proto/federation/federation.proto b/_examples/17_error_handler/proto/federation/federation.proto index 5f2f4b0e..10d464c6 100644 --- a/_examples/17_error_handler/proto/federation/federation.proto +++ b/_examples/17_error_handler/proto/federation/federation.proto @@ -48,7 +48,7 @@ message Post { message: "'this is custom error message'" details { def { name: "localized_msg" message { name: "LocalizedMessage" args { name: "value" by: "id" } } } - message { name: "CustomMessage" args { name: "msg" by: "id" } } + message { name: "CustomMessage" args { name: "error_info" by: "error" } } precondition_failure { violations { type: "'some-type'" @@ -82,5 +82,5 @@ message LocalizedMessage { } message CustomMessage { - string msg = 1 [(grpc.federation.field).by = "'custom error message:' + $.msg"]; + string msg = 1 [(grpc.federation.field).by = "'custom error message:' + $.error_info.message"]; } \ No newline at end of file diff --git a/grpc/federation/cel.go b/grpc/federation/cel.go index d6bb953e..40f575ce 100644 --- a/grpc/federation/cel.go +++ b/grpc/federation/cel.go @@ -559,7 +559,7 @@ func SetGRPCError(ctx context.Context, value localValue, err error) { if !ok { return } - grpcErr := &Error{ + grpcErr := &grpcfedcel.Error{ Code: int32(stat.Code()), Message: stat.Message(), } diff --git a/grpc/federation/private.pb.go b/grpc/federation/cel/private.pb.go similarity index 98% rename from grpc/federation/private.pb.go rename to grpc/federation/cel/private.pb.go index d9504aba..ae73488f 100644 --- a/grpc/federation/private.pb.go +++ b/grpc/federation/cel/private.pb.go @@ -4,7 +4,7 @@ // protoc (unknown) // source: grpc/federation/private.proto -package federation +package cel import ( errdetails "google.golang.org/genproto/googleapis/rpc/errdetails" @@ -232,12 +232,12 @@ var file_grpc_federation_private_proto_rawDesc = []byte{ 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x11, 0x6c, 0x6f, 0x63, - 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x42, 0x3f, - 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x65, 0x72, + 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x42, 0x3c, + 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x65, 0x72, 0x63, 0x61, 0x72, 0x69, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x63, 0x65, 0x6c, 0x3b, 0x63, 0x65, 0x6c, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/grpc/federation/private_vtproto.pb.go b/grpc/federation/cel/private_vtproto.pb.go similarity index 99% rename from grpc/federation/private_vtproto.pb.go rename to grpc/federation/cel/private_vtproto.pb.go index e65092c6..68856fbc 100644 --- a/grpc/federation/private_vtproto.pb.go +++ b/grpc/federation/cel/private_vtproto.pb.go @@ -2,7 +2,7 @@ // protoc-gen-go-vtproto version: v0.6.0 // source: grpc/federation/private.proto -package federation +package cel import ( fmt "fmt" diff --git a/grpc/federation/federation.pb.go b/grpc/federation/federation.pb.go index 7e20655e..d9bd9c21 100644 --- a/grpc/federation/federation.pb.go +++ b/grpc/federation/federation.pb.go @@ -7,6 +7,7 @@ package federation import ( + _ "github.com/mercari/grpc-federation/grpc/federation/cel" code "google.golang.org/genproto/googleapis/rpc/code" errdetails "google.golang.org/genproto/googleapis/rpc/errdetails" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -4067,7 +4068,6 @@ func file_grpc_federation_federation_proto_init() { if File_grpc_federation_federation_proto != nil { return } - file_grpc_federation_private_proto_init() if !protoimpl.UnsafeEnabled { file_grpc_federation_federation_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EnumRule); i { diff --git a/proto/grpc/federation/private.proto b/proto/grpc/federation/private.proto index cbcc7daf..e2a5aa1d 100644 --- a/proto/grpc/federation/private.proto +++ b/proto/grpc/federation/private.proto @@ -5,7 +5,7 @@ package grpc.federation.private; import "google/protobuf/any.proto"; import "google/rpc/error_details.proto"; -option go_package = "github.com/mercari/grpc-federation/grpc/federation;federation"; +option go_package = "github.com/mercari/grpc-federation/grpc/federation/cel;cel"; // Error type information of the error variable used when evaluating CEL. message Error { diff --git a/resolver/resolver.go b/resolver/resolver.go index 44646735..b82a5723 100644 --- a/resolver/resolver.go +++ b/resolver/resolver.go @@ -3005,6 +3005,8 @@ func (r *Resolver) fromCELType(ctx *context, typ *cel.Type) (*Type, error) { return nil, fmt.Errorf("unknown type %s is required", typ.TypeName()) } +const privateProtoFile = "grpc/federation/private.proto" + func messageArgumentFileDescriptor(arg *Message) *descriptorpb.FileDescriptorProto { desc := arg.File.Desc msg := &descriptorpb.DescriptorProto{ @@ -3031,10 +3033,21 @@ func messageArgumentFileDescriptor(arg *Message) *descriptorpb.FileDescriptorPro Label: &label, }) } + var importedPrivateFile bool + for _, dep := range desc.GetDependency() { + if dep == privateProtoFile { + importedPrivateFile = true + break + } + } + deps := append(desc.GetDependency(), arg.File.Name) + if !importedPrivateFile { + deps = append(deps, privateProtoFile) + } return &descriptorpb.FileDescriptorProto{ Name: proto.String(arg.Name), Package: proto.String(federation.PrivatePackageName), - Dependency: append(desc.Dependency, arg.File.Name), + Dependency: deps, PublicDependency: desc.PublicDependency, WeakDependency: desc.WeakDependency, MessageType: []*descriptorpb.DescriptorProto{msg},