diff --git a/pkg/proto/allocator.pb.go b/pkg/proto/allocator.pb.go index 5bd4d00..9ece4b2 100644 --- a/pkg/proto/allocator.pb.go +++ b/pkg/proto/allocator.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.28.1 // protoc v5.28.2 // source: allocator.proto @@ -28,9 +28,11 @@ type AllocMqRequest struct { func (x *AllocMqRequest) Reset() { *x = AllocMqRequest{} - mi := &file_allocator_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_allocator_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *AllocMqRequest) String() string { @@ -41,7 +43,7 @@ func (*AllocMqRequest) ProtoMessage() {} func (x *AllocMqRequest) ProtoReflect() protoreflect.Message { mi := &file_allocator_proto_msgTypes[0] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -67,9 +69,11 @@ type AllocMqResponse struct { func (x *AllocMqResponse) Reset() { *x = AllocMqResponse{} - mi := &file_allocator_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_allocator_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *AllocMqResponse) String() string { @@ -80,7 +84,7 @@ func (*AllocMqResponse) ProtoMessage() {} func (x *AllocMqResponse) ProtoReflect() protoreflect.Message { mi := &file_allocator_proto_msgTypes[1] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -117,9 +121,11 @@ type AllocKvRequest struct { func (x *AllocKvRequest) Reset() { *x = AllocKvRequest{} - mi := &file_allocator_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_allocator_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *AllocKvRequest) String() string { @@ -130,7 +136,7 @@ func (*AllocKvRequest) ProtoMessage() {} func (x *AllocKvRequest) ProtoReflect() protoreflect.Message { mi := &file_allocator_proto_msgTypes[2] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -156,9 +162,11 @@ type AllocKvResponse struct { func (x *AllocKvResponse) Reset() { *x = AllocKvResponse{} - mi := &file_allocator_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_allocator_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *AllocKvResponse) String() string { @@ -169,7 +177,7 @@ func (*AllocKvResponse) ProtoMessage() {} func (x *AllocKvResponse) ProtoReflect() protoreflect.Message { mi := &file_allocator_proto_msgTypes[3] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -240,7 +248,7 @@ func file_allocator_proto_rawDescGZIP() []byte { } var file_allocator_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_allocator_proto_goTypes = []any{ +var file_allocator_proto_goTypes = []interface{}{ (*AllocMqRequest)(nil), // 0: proto.AllocMqRequest (*AllocMqResponse)(nil), // 1: proto.AllocMqResponse (*AllocKvRequest)(nil), // 2: proto.AllocKvRequest @@ -263,6 +271,56 @@ func file_allocator_proto_init() { if File_allocator_proto != nil { return } + if !protoimpl.UnsafeEnabled { + file_allocator_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AllocMqRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_allocator_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AllocMqResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_allocator_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AllocKvRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_allocator_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AllocKvResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/pkg/proto/allocator_grpc.pb.go b/pkg/proto/allocator_grpc.pb.go index 5c73ab3..b06fa2b 100644 --- a/pkg/proto/allocator_grpc.pb.go +++ b/pkg/proto/allocator_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.5.1 +// - protoc-gen-go-grpc v1.2.0 // - protoc v5.28.2 // source: allocator.proto @@ -15,13 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - AllocatorService_AllocMessageQueue_FullMethodName = "/proto.AllocatorService/AllocMessageQueue" - AllocatorService_AllocKv_FullMethodName = "/proto.AllocatorService/AllocKv" -) +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 // AllocatorServiceClient is the client API for AllocatorService service. // @@ -40,9 +35,8 @@ func NewAllocatorServiceClient(cc grpc.ClientConnInterface) AllocatorServiceClie } func (c *allocatorServiceClient) AllocMessageQueue(ctx context.Context, in *AllocMqRequest, opts ...grpc.CallOption) (*AllocMqResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(AllocMqResponse) - err := c.cc.Invoke(ctx, AllocatorService_AllocMessageQueue_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.AllocatorService/AllocMessageQueue", in, out, opts...) if err != nil { return nil, err } @@ -50,9 +44,8 @@ func (c *allocatorServiceClient) AllocMessageQueue(ctx context.Context, in *Allo } func (c *allocatorServiceClient) AllocKv(ctx context.Context, in *AllocKvRequest, opts ...grpc.CallOption) (*AllocKvResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(AllocKvResponse) - err := c.cc.Invoke(ctx, AllocatorService_AllocKv_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.AllocatorService/AllocKv", in, out, opts...) if err != nil { return nil, err } @@ -61,19 +54,16 @@ func (c *allocatorServiceClient) AllocKv(ctx context.Context, in *AllocKvRequest // AllocatorServiceServer is the server API for AllocatorService service. // All implementations must embed UnimplementedAllocatorServiceServer -// for forward compatibility. +// for forward compatibility type AllocatorServiceServer interface { AllocMessageQueue(context.Context, *AllocMqRequest) (*AllocMqResponse, error) AllocKv(context.Context, *AllocKvRequest) (*AllocKvResponse, error) mustEmbedUnimplementedAllocatorServiceServer() } -// UnimplementedAllocatorServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedAllocatorServiceServer struct{} +// UnimplementedAllocatorServiceServer must be embedded to have forward compatible implementations. +type UnimplementedAllocatorServiceServer struct { +} func (UnimplementedAllocatorServiceServer) AllocMessageQueue(context.Context, *AllocMqRequest) (*AllocMqResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AllocMessageQueue not implemented") @@ -82,7 +72,6 @@ func (UnimplementedAllocatorServiceServer) AllocKv(context.Context, *AllocKvRequ return nil, status.Errorf(codes.Unimplemented, "method AllocKv not implemented") } func (UnimplementedAllocatorServiceServer) mustEmbedUnimplementedAllocatorServiceServer() {} -func (UnimplementedAllocatorServiceServer) testEmbeddedByValue() {} // UnsafeAllocatorServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to AllocatorServiceServer will @@ -92,13 +81,6 @@ type UnsafeAllocatorServiceServer interface { } func RegisterAllocatorServiceServer(s grpc.ServiceRegistrar, srv AllocatorServiceServer) { - // If the following call pancis, it indicates UnimplementedAllocatorServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } s.RegisterService(&AllocatorService_ServiceDesc, srv) } @@ -112,7 +94,7 @@ func _AllocatorService_AllocMessageQueue_Handler(srv interface{}, ctx context.Co } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: AllocatorService_AllocMessageQueue_FullMethodName, + FullMethod: "/proto.AllocatorService/AllocMessageQueue", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AllocatorServiceServer).AllocMessageQueue(ctx, req.(*AllocMqRequest)) @@ -130,7 +112,7 @@ func _AllocatorService_AllocKv_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: AllocatorService_AllocKv_FullMethodName, + FullMethod: "/proto.AllocatorService/AllocKv", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AllocatorServiceServer).AllocKv(ctx, req.(*AllocKvRequest)) diff --git a/pkg/proto/authenticate.pb.go b/pkg/proto/authenticate.pb.go index b376372..b819963 100644 --- a/pkg/proto/authenticate.pb.go +++ b/pkg/proto/authenticate.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.28.1 // protoc v5.28.2 // source: authenticate.proto @@ -31,9 +31,11 @@ type AuthInfo struct { func (x *AuthInfo) Reset() { *x = AuthInfo{} - mi := &file_authenticate_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_authenticate_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *AuthInfo) String() string { @@ -44,7 +46,7 @@ func (*AuthInfo) ProtoMessage() {} func (x *AuthInfo) ProtoReflect() protoreflect.Message { mi := &file_authenticate_proto_msgTypes[0] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -83,9 +85,11 @@ type AuthRequest struct { func (x *AuthRequest) Reset() { *x = AuthRequest{} - mi := &file_authenticate_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_authenticate_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *AuthRequest) String() string { @@ -96,7 +100,7 @@ func (*AuthRequest) ProtoMessage() {} func (x *AuthRequest) ProtoReflect() protoreflect.Message { mi := &file_authenticate_proto_msgTypes[1] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -129,9 +133,11 @@ type AuthReply struct { func (x *AuthReply) Reset() { *x = AuthReply{} - mi := &file_authenticate_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_authenticate_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *AuthReply) String() string { @@ -142,7 +148,7 @@ func (*AuthReply) ProtoMessage() {} func (x *AuthReply) ProtoReflect() protoreflect.Message { mi := &file_authenticate_proto_msgTypes[2] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -183,9 +189,11 @@ type CheckPermRequest struct { func (x *CheckPermRequest) Reset() { *x = CheckPermRequest{} - mi := &file_authenticate_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_authenticate_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *CheckPermRequest) String() string { @@ -196,7 +204,7 @@ func (*CheckPermRequest) ProtoMessage() {} func (x *CheckPermRequest) ProtoReflect() protoreflect.Message { mi := &file_authenticate_proto_msgTypes[3] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -242,9 +250,11 @@ type CheckPermResponse struct { func (x *CheckPermResponse) Reset() { *x = CheckPermResponse{} - mi := &file_authenticate_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_authenticate_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *CheckPermResponse) String() string { @@ -255,7 +265,7 @@ func (*CheckPermResponse) ProtoMessage() {} func (x *CheckPermResponse) ProtoReflect() protoreflect.Message { mi := &file_authenticate_proto_msgTypes[4] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -290,9 +300,11 @@ type CheckUserPermRequest struct { func (x *CheckUserPermRequest) Reset() { *x = CheckUserPermRequest{} - mi := &file_authenticate_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_authenticate_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *CheckUserPermRequest) String() string { @@ -303,7 +315,7 @@ func (*CheckUserPermRequest) ProtoMessage() {} func (x *CheckUserPermRequest) ProtoReflect() protoreflect.Message { mi := &file_authenticate_proto_msgTypes[5] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -356,9 +368,11 @@ type CheckUserPermResponse struct { func (x *CheckUserPermResponse) Reset() { *x = CheckUserPermResponse{} - mi := &file_authenticate_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_authenticate_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *CheckUserPermResponse) String() string { @@ -369,7 +383,7 @@ func (*CheckUserPermResponse) ProtoMessage() {} func (x *CheckUserPermResponse) ProtoReflect() protoreflect.Message { mi := &file_authenticate_proto_msgTypes[6] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -460,7 +474,7 @@ func file_authenticate_proto_rawDescGZIP() []byte { } var file_authenticate_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_authenticate_proto_goTypes = []any{ +var file_authenticate_proto_goTypes = []interface{}{ (*AuthInfo)(nil), // 0: proto.AuthInfo (*AuthRequest)(nil), // 1: proto.AuthRequest (*AuthReply)(nil), // 2: proto.AuthReply @@ -492,7 +506,93 @@ func file_authenticate_proto_init() { return } file_user_proto_init() - file_authenticate_proto_msgTypes[2].OneofWrappers = []any{} + if !protoimpl.UnsafeEnabled { + file_authenticate_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AuthInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_authenticate_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AuthRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_authenticate_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AuthReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_authenticate_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CheckPermRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_authenticate_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CheckPermResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_authenticate_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CheckUserPermRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_authenticate_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CheckUserPermResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_authenticate_proto_msgTypes[2].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/pkg/proto/authenticate_grpc.pb.go b/pkg/proto/authenticate_grpc.pb.go index deb0c94..13ad6a5 100644 --- a/pkg/proto/authenticate_grpc.pb.go +++ b/pkg/proto/authenticate_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.5.1 +// - protoc-gen-go-grpc v1.2.0 // - protoc v5.28.2 // source: authenticate.proto @@ -15,14 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - AuthService_Authenticate_FullMethodName = "/proto.AuthService/Authenticate" - AuthService_EnsurePermGranted_FullMethodName = "/proto.AuthService/EnsurePermGranted" - AuthService_EnsureUserPermGranted_FullMethodName = "/proto.AuthService/EnsureUserPermGranted" -) +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 // AuthServiceClient is the client API for AuthService service. // @@ -42,9 +36,8 @@ func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient { } func (c *authServiceClient) Authenticate(ctx context.Context, in *AuthRequest, opts ...grpc.CallOption) (*AuthReply, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(AuthReply) - err := c.cc.Invoke(ctx, AuthService_Authenticate_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.AuthService/Authenticate", in, out, opts...) if err != nil { return nil, err } @@ -52,9 +45,8 @@ func (c *authServiceClient) Authenticate(ctx context.Context, in *AuthRequest, o } func (c *authServiceClient) EnsurePermGranted(ctx context.Context, in *CheckPermRequest, opts ...grpc.CallOption) (*CheckPermResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CheckPermResponse) - err := c.cc.Invoke(ctx, AuthService_EnsurePermGranted_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.AuthService/EnsurePermGranted", in, out, opts...) if err != nil { return nil, err } @@ -62,9 +54,8 @@ func (c *authServiceClient) EnsurePermGranted(ctx context.Context, in *CheckPerm } func (c *authServiceClient) EnsureUserPermGranted(ctx context.Context, in *CheckUserPermRequest, opts ...grpc.CallOption) (*CheckUserPermResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CheckUserPermResponse) - err := c.cc.Invoke(ctx, AuthService_EnsureUserPermGranted_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.AuthService/EnsureUserPermGranted", in, out, opts...) if err != nil { return nil, err } @@ -73,7 +64,7 @@ func (c *authServiceClient) EnsureUserPermGranted(ctx context.Context, in *Check // AuthServiceServer is the server API for AuthService service. // All implementations must embed UnimplementedAuthServiceServer -// for forward compatibility. +// for forward compatibility type AuthServiceServer interface { Authenticate(context.Context, *AuthRequest) (*AuthReply, error) EnsurePermGranted(context.Context, *CheckPermRequest) (*CheckPermResponse, error) @@ -81,12 +72,9 @@ type AuthServiceServer interface { mustEmbedUnimplementedAuthServiceServer() } -// UnimplementedAuthServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedAuthServiceServer struct{} +// UnimplementedAuthServiceServer must be embedded to have forward compatible implementations. +type UnimplementedAuthServiceServer struct { +} func (UnimplementedAuthServiceServer) Authenticate(context.Context, *AuthRequest) (*AuthReply, error) { return nil, status.Errorf(codes.Unimplemented, "method Authenticate not implemented") @@ -98,7 +86,6 @@ func (UnimplementedAuthServiceServer) EnsureUserPermGranted(context.Context, *Ch return nil, status.Errorf(codes.Unimplemented, "method EnsureUserPermGranted not implemented") } func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {} -func (UnimplementedAuthServiceServer) testEmbeddedByValue() {} // UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to AuthServiceServer will @@ -108,13 +95,6 @@ type UnsafeAuthServiceServer interface { } func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer) { - // If the following call pancis, it indicates UnimplementedAuthServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } s.RegisterService(&AuthService_ServiceDesc, srv) } @@ -128,7 +108,7 @@ func _AuthService_Authenticate_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: AuthService_Authenticate_FullMethodName, + FullMethod: "/proto.AuthService/Authenticate", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AuthServiceServer).Authenticate(ctx, req.(*AuthRequest)) @@ -146,7 +126,7 @@ func _AuthService_EnsurePermGranted_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: AuthService_EnsurePermGranted_FullMethodName, + FullMethod: "/proto.AuthService/EnsurePermGranted", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AuthServiceServer).EnsurePermGranted(ctx, req.(*CheckPermRequest)) @@ -164,7 +144,7 @@ func _AuthService_EnsureUserPermGranted_Handler(srv interface{}, ctx context.Con } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: AuthService_EnsureUserPermGranted_FullMethodName, + FullMethod: "/proto.AuthService/EnsureUserPermGranted", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AuthServiceServer).EnsureUserPermGranted(ctx, req.(*CheckUserPermRequest)) diff --git a/pkg/proto/command.pb.go b/pkg/proto/command.pb.go index 58e6864..0139ab9 100644 --- a/pkg/proto/command.pb.go +++ b/pkg/proto/command.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.28.1 // protoc v5.28.2 // source: command.proto @@ -32,9 +32,11 @@ type CommandInfo struct { func (x *CommandInfo) Reset() { *x = CommandInfo{} - mi := &file_command_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_command_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *CommandInfo) String() string { @@ -45,7 +47,7 @@ func (*CommandInfo) ProtoMessage() {} func (x *CommandInfo) ProtoReflect() protoreflect.Message { mi := &file_command_proto_msgTypes[0] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -92,9 +94,11 @@ type CommandLookupRequest struct { func (x *CommandLookupRequest) Reset() { *x = CommandLookupRequest{} - mi := &file_command_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_command_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *CommandLookupRequest) String() string { @@ -105,7 +109,7 @@ func (*CommandLookupRequest) ProtoMessage() {} func (x *CommandLookupRequest) ProtoReflect() protoreflect.Message { mi := &file_command_proto_msgTypes[1] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -144,9 +148,11 @@ type AddCommandResponse struct { func (x *AddCommandResponse) Reset() { *x = AddCommandResponse{} - mi := &file_command_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_command_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *AddCommandResponse) String() string { @@ -157,7 +163,7 @@ func (*AddCommandResponse) ProtoMessage() {} func (x *AddCommandResponse) ProtoReflect() protoreflect.Message { mi := &file_command_proto_msgTypes[2] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -189,9 +195,11 @@ type RemoveCommandResponse struct { func (x *RemoveCommandResponse) Reset() { *x = RemoveCommandResponse{} - mi := &file_command_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_command_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *RemoveCommandResponse) String() string { @@ -202,7 +210,7 @@ func (*RemoveCommandResponse) ProtoMessage() {} func (x *RemoveCommandResponse) ProtoReflect() protoreflect.Message { mi := &file_command_proto_msgTypes[3] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -236,9 +244,11 @@ type CommandArgument struct { func (x *CommandArgument) Reset() { *x = CommandArgument{} - mi := &file_command_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_command_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *CommandArgument) String() string { @@ -249,7 +259,7 @@ func (*CommandArgument) ProtoMessage() {} func (x *CommandArgument) ProtoReflect() protoreflect.Message { mi := &file_command_proto_msgTypes[4] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -298,9 +308,11 @@ type CommandReturn struct { func (x *CommandReturn) Reset() { *x = CommandReturn{} - mi := &file_command_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_command_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *CommandReturn) String() string { @@ -311,7 +323,7 @@ func (*CommandReturn) ProtoMessage() {} func (x *CommandReturn) ProtoReflect() protoreflect.Message { mi := &file_command_proto_msgTypes[5] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -426,7 +438,7 @@ func file_command_proto_rawDescGZIP() []byte { } var file_command_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_command_proto_goTypes = []any{ +var file_command_proto_goTypes = []interface{}{ (*CommandInfo)(nil), // 0: proto.CommandInfo (*CommandLookupRequest)(nil), // 1: proto.CommandLookupRequest (*AddCommandResponse)(nil), // 2: proto.AddCommandResponse @@ -455,8 +467,82 @@ func file_command_proto_init() { if File_command_proto != nil { return } - file_command_proto_msgTypes[4].OneofWrappers = []any{} - file_command_proto_msgTypes[5].OneofWrappers = []any{} + if !protoimpl.UnsafeEnabled { + file_command_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommandInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_command_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommandLookupRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_command_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddCommandResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_command_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveCommandResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_command_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommandArgument); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_command_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommandReturn); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_command_proto_msgTypes[4].OneofWrappers = []interface{}{} + file_command_proto_msgTypes[5].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/pkg/proto/command_grpc.pb.go b/pkg/proto/command_grpc.pb.go index 8ae101c..18c3100 100644 --- a/pkg/proto/command_grpc.pb.go +++ b/pkg/proto/command_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.5.1 +// - protoc-gen-go-grpc v1.2.0 // - protoc v5.28.2 // source: command.proto @@ -15,15 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - CommandProvider_AddCommand_FullMethodName = "/proto.CommandProvider/AddCommand" - CommandProvider_RemoveCommand_FullMethodName = "/proto.CommandProvider/RemoveCommand" - CommandProvider_SendCommand_FullMethodName = "/proto.CommandProvider/SendCommand" - CommandProvider_SendStreamCommand_FullMethodName = "/proto.CommandProvider/SendStreamCommand" -) +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 // CommandProviderClient is the client API for CommandProvider service. // @@ -32,7 +25,7 @@ type CommandProviderClient interface { AddCommand(ctx context.Context, in *CommandInfo, opts ...grpc.CallOption) (*AddCommandResponse, error) RemoveCommand(ctx context.Context, in *CommandLookupRequest, opts ...grpc.CallOption) (*RemoveCommandResponse, error) SendCommand(ctx context.Context, in *CommandArgument, opts ...grpc.CallOption) (*CommandReturn, error) - SendStreamCommand(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[CommandArgument, CommandReturn], error) + SendStreamCommand(ctx context.Context, opts ...grpc.CallOption) (CommandProvider_SendStreamCommandClient, error) } type commandProviderClient struct { @@ -44,9 +37,8 @@ func NewCommandProviderClient(cc grpc.ClientConnInterface) CommandProviderClient } func (c *commandProviderClient) AddCommand(ctx context.Context, in *CommandInfo, opts ...grpc.CallOption) (*AddCommandResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(AddCommandResponse) - err := c.cc.Invoke(ctx, CommandProvider_AddCommand_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.CommandProvider/AddCommand", in, out, opts...) if err != nil { return nil, err } @@ -54,9 +46,8 @@ func (c *commandProviderClient) AddCommand(ctx context.Context, in *CommandInfo, } func (c *commandProviderClient) RemoveCommand(ctx context.Context, in *CommandLookupRequest, opts ...grpc.CallOption) (*RemoveCommandResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(RemoveCommandResponse) - err := c.cc.Invoke(ctx, CommandProvider_RemoveCommand_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.CommandProvider/RemoveCommand", in, out, opts...) if err != nil { return nil, err } @@ -64,45 +55,59 @@ func (c *commandProviderClient) RemoveCommand(ctx context.Context, in *CommandLo } func (c *commandProviderClient) SendCommand(ctx context.Context, in *CommandArgument, opts ...grpc.CallOption) (*CommandReturn, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CommandReturn) - err := c.cc.Invoke(ctx, CommandProvider_SendCommand_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.CommandProvider/SendCommand", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *commandProviderClient) SendStreamCommand(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[CommandArgument, CommandReturn], error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - stream, err := c.cc.NewStream(ctx, &CommandProvider_ServiceDesc.Streams[0], CommandProvider_SendStreamCommand_FullMethodName, cOpts...) +func (c *commandProviderClient) SendStreamCommand(ctx context.Context, opts ...grpc.CallOption) (CommandProvider_SendStreamCommandClient, error) { + stream, err := c.cc.NewStream(ctx, &CommandProvider_ServiceDesc.Streams[0], "/proto.CommandProvider/SendStreamCommand", opts...) if err != nil { return nil, err } - x := &grpc.GenericClientStream[CommandArgument, CommandReturn]{ClientStream: stream} + x := &commandProviderSendStreamCommandClient{stream} return x, nil } -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type CommandProvider_SendStreamCommandClient = grpc.BidiStreamingClient[CommandArgument, CommandReturn] +type CommandProvider_SendStreamCommandClient interface { + Send(*CommandArgument) error + Recv() (*CommandReturn, error) + grpc.ClientStream +} + +type commandProviderSendStreamCommandClient struct { + grpc.ClientStream +} + +func (x *commandProviderSendStreamCommandClient) Send(m *CommandArgument) error { + return x.ClientStream.SendMsg(m) +} + +func (x *commandProviderSendStreamCommandClient) Recv() (*CommandReturn, error) { + m := new(CommandReturn) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} // CommandProviderServer is the server API for CommandProvider service. // All implementations must embed UnimplementedCommandProviderServer -// for forward compatibility. +// for forward compatibility type CommandProviderServer interface { AddCommand(context.Context, *CommandInfo) (*AddCommandResponse, error) RemoveCommand(context.Context, *CommandLookupRequest) (*RemoveCommandResponse, error) SendCommand(context.Context, *CommandArgument) (*CommandReturn, error) - SendStreamCommand(grpc.BidiStreamingServer[CommandArgument, CommandReturn]) error + SendStreamCommand(CommandProvider_SendStreamCommandServer) error mustEmbedUnimplementedCommandProviderServer() } -// UnimplementedCommandProviderServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedCommandProviderServer struct{} +// UnimplementedCommandProviderServer must be embedded to have forward compatible implementations. +type UnimplementedCommandProviderServer struct { +} func (UnimplementedCommandProviderServer) AddCommand(context.Context, *CommandInfo) (*AddCommandResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddCommand not implemented") @@ -113,11 +118,10 @@ func (UnimplementedCommandProviderServer) RemoveCommand(context.Context, *Comman func (UnimplementedCommandProviderServer) SendCommand(context.Context, *CommandArgument) (*CommandReturn, error) { return nil, status.Errorf(codes.Unimplemented, "method SendCommand not implemented") } -func (UnimplementedCommandProviderServer) SendStreamCommand(grpc.BidiStreamingServer[CommandArgument, CommandReturn]) error { +func (UnimplementedCommandProviderServer) SendStreamCommand(CommandProvider_SendStreamCommandServer) error { return status.Errorf(codes.Unimplemented, "method SendStreamCommand not implemented") } func (UnimplementedCommandProviderServer) mustEmbedUnimplementedCommandProviderServer() {} -func (UnimplementedCommandProviderServer) testEmbeddedByValue() {} // UnsafeCommandProviderServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to CommandProviderServer will @@ -127,13 +131,6 @@ type UnsafeCommandProviderServer interface { } func RegisterCommandProviderServer(s grpc.ServiceRegistrar, srv CommandProviderServer) { - // If the following call pancis, it indicates UnimplementedCommandProviderServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } s.RegisterService(&CommandProvider_ServiceDesc, srv) } @@ -147,7 +144,7 @@ func _CommandProvider_AddCommand_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: CommandProvider_AddCommand_FullMethodName, + FullMethod: "/proto.CommandProvider/AddCommand", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CommandProviderServer).AddCommand(ctx, req.(*CommandInfo)) @@ -165,7 +162,7 @@ func _CommandProvider_RemoveCommand_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: CommandProvider_RemoveCommand_FullMethodName, + FullMethod: "/proto.CommandProvider/RemoveCommand", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CommandProviderServer).RemoveCommand(ctx, req.(*CommandLookupRequest)) @@ -183,7 +180,7 @@ func _CommandProvider_SendCommand_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: CommandProvider_SendCommand_FullMethodName, + FullMethod: "/proto.CommandProvider/SendCommand", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CommandProviderServer).SendCommand(ctx, req.(*CommandArgument)) @@ -192,11 +189,30 @@ func _CommandProvider_SendCommand_Handler(srv interface{}, ctx context.Context, } func _CommandProvider_SendStreamCommand_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(CommandProviderServer).SendStreamCommand(&grpc.GenericServerStream[CommandArgument, CommandReturn]{ServerStream: stream}) + return srv.(CommandProviderServer).SendStreamCommand(&commandProviderSendStreamCommandServer{stream}) } -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type CommandProvider_SendStreamCommandServer = grpc.BidiStreamingServer[CommandArgument, CommandReturn] +type CommandProvider_SendStreamCommandServer interface { + Send(*CommandReturn) error + Recv() (*CommandArgument, error) + grpc.ServerStream +} + +type commandProviderSendStreamCommandServer struct { + grpc.ServerStream +} + +func (x *commandProviderSendStreamCommandServer) Send(m *CommandReturn) error { + return x.ServerStream.SendMsg(m) +} + +func (x *commandProviderSendStreamCommandServer) Recv() (*CommandArgument, error) { + m := new(CommandArgument) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} // CommandProvider_ServiceDesc is the grpc.ServiceDesc for CommandProvider service. // It's only intended for direct use with grpc.RegisterService, diff --git a/pkg/proto/database.pb.go b/pkg/proto/database.pb.go index 71f6c63..d4d2d88 100644 --- a/pkg/proto/database.pb.go +++ b/pkg/proto/database.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.28.1 // protoc v5.28.2 // source: database.proto @@ -30,9 +30,11 @@ type AllocDatabaseRequest struct { func (x *AllocDatabaseRequest) Reset() { *x = AllocDatabaseRequest{} - mi := &file_database_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_database_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *AllocDatabaseRequest) String() string { @@ -43,7 +45,7 @@ func (*AllocDatabaseRequest) ProtoMessage() {} func (x *AllocDatabaseRequest) ProtoReflect() protoreflect.Message { mi := &file_database_proto_msgTypes[0] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -76,9 +78,11 @@ type AllocDatabaseResponse struct { func (x *AllocDatabaseResponse) Reset() { *x = AllocDatabaseResponse{} - mi := &file_database_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_database_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *AllocDatabaseResponse) String() string { @@ -89,7 +93,7 @@ func (*AllocDatabaseResponse) ProtoMessage() {} func (x *AllocDatabaseResponse) ProtoReflect() protoreflect.Message { mi := &file_database_proto_msgTypes[1] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -153,7 +157,7 @@ func file_database_proto_rawDescGZIP() []byte { } var file_database_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_database_proto_goTypes = []any{ +var file_database_proto_goTypes = []interface{}{ (*AllocDatabaseRequest)(nil), // 0: proto.AllocDatabaseRequest (*AllocDatabaseResponse)(nil), // 1: proto.AllocDatabaseResponse } @@ -172,6 +176,32 @@ func file_database_proto_init() { if File_database_proto != nil { return } + if !protoimpl.UnsafeEnabled { + file_database_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AllocDatabaseRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_database_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AllocDatabaseResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/pkg/proto/database_grpc.pb.go b/pkg/proto/database_grpc.pb.go index b383471..ce01204 100644 --- a/pkg/proto/database_grpc.pb.go +++ b/pkg/proto/database_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.5.1 +// - protoc-gen-go-grpc v1.2.0 // - protoc v5.28.2 // source: database.proto @@ -15,12 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - DatabaseService_AllocDatabase_FullMethodName = "/proto.DatabaseService/AllocDatabase" -) +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 // DatabaseServiceClient is the client API for DatabaseService service. // @@ -38,9 +34,8 @@ func NewDatabaseServiceClient(cc grpc.ClientConnInterface) DatabaseServiceClient } func (c *databaseServiceClient) AllocDatabase(ctx context.Context, in *AllocDatabaseRequest, opts ...grpc.CallOption) (*AllocDatabaseResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(AllocDatabaseResponse) - err := c.cc.Invoke(ctx, DatabaseService_AllocDatabase_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.DatabaseService/AllocDatabase", in, out, opts...) if err != nil { return nil, err } @@ -49,24 +44,20 @@ func (c *databaseServiceClient) AllocDatabase(ctx context.Context, in *AllocData // DatabaseServiceServer is the server API for DatabaseService service. // All implementations must embed UnimplementedDatabaseServiceServer -// for forward compatibility. +// for forward compatibility type DatabaseServiceServer interface { AllocDatabase(context.Context, *AllocDatabaseRequest) (*AllocDatabaseResponse, error) mustEmbedUnimplementedDatabaseServiceServer() } -// UnimplementedDatabaseServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedDatabaseServiceServer struct{} +// UnimplementedDatabaseServiceServer must be embedded to have forward compatible implementations. +type UnimplementedDatabaseServiceServer struct { +} func (UnimplementedDatabaseServiceServer) AllocDatabase(context.Context, *AllocDatabaseRequest) (*AllocDatabaseResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AllocDatabase not implemented") } func (UnimplementedDatabaseServiceServer) mustEmbedUnimplementedDatabaseServiceServer() {} -func (UnimplementedDatabaseServiceServer) testEmbeddedByValue() {} // UnsafeDatabaseServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to DatabaseServiceServer will @@ -76,13 +67,6 @@ type UnsafeDatabaseServiceServer interface { } func RegisterDatabaseServiceServer(s grpc.ServiceRegistrar, srv DatabaseServiceServer) { - // If the following call pancis, it indicates UnimplementedDatabaseServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } s.RegisterService(&DatabaseService_ServiceDesc, srv) } @@ -96,7 +80,7 @@ func _DatabaseService_AllocDatabase_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: DatabaseService_AllocDatabase_FullMethodName, + FullMethod: "/proto.DatabaseService/AllocDatabase", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DatabaseServiceServer).AllocDatabase(ctx, req.(*AllocDatabaseRequest)) diff --git a/pkg/proto/services.pb.go b/pkg/proto/services.pb.go index 7a11b0d..27db564 100644 --- a/pkg/proto/services.pb.go +++ b/pkg/proto/services.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.28.1 // protoc v5.28.2 // source: services.proto @@ -34,9 +34,11 @@ type ServiceInfo struct { func (x *ServiceInfo) Reset() { *x = ServiceInfo{} - mi := &file_services_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_services_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *ServiceInfo) String() string { @@ -47,7 +49,7 @@ func (*ServiceInfo) ProtoMessage() {} func (x *ServiceInfo) ProtoReflect() protoreflect.Message { mi := &file_services_proto_msgTypes[0] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -108,9 +110,11 @@ type GetServiceRequest struct { func (x *GetServiceRequest) Reset() { *x = GetServiceRequest{} - mi := &file_services_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_services_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *GetServiceRequest) String() string { @@ -121,7 +125,7 @@ func (*GetServiceRequest) ProtoMessage() {} func (x *GetServiceRequest) ProtoReflect() protoreflect.Message { mi := &file_services_proto_msgTypes[1] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -160,9 +164,11 @@ type GetServiceResponse struct { func (x *GetServiceResponse) Reset() { *x = GetServiceResponse{} - mi := &file_services_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_services_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *GetServiceResponse) String() string { @@ -173,7 +179,7 @@ func (*GetServiceResponse) ProtoMessage() {} func (x *GetServiceResponse) ProtoReflect() protoreflect.Message { mi := &file_services_proto_msgTypes[2] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -205,9 +211,11 @@ type ListServiceRequest struct { func (x *ListServiceRequest) Reset() { *x = ListServiceRequest{} - mi := &file_services_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_services_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *ListServiceRequest) String() string { @@ -218,7 +226,7 @@ func (*ListServiceRequest) ProtoMessage() {} func (x *ListServiceRequest) ProtoReflect() protoreflect.Message { mi := &file_services_proto_msgTypes[3] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -250,9 +258,11 @@ type ListServiceResponse struct { func (x *ListServiceResponse) Reset() { *x = ListServiceResponse{} - mi := &file_services_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_services_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *ListServiceResponse) String() string { @@ -263,7 +273,7 @@ func (*ListServiceResponse) ProtoMessage() {} func (x *ListServiceResponse) ProtoReflect() protoreflect.Message { mi := &file_services_proto_msgTypes[4] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -295,9 +305,11 @@ type AddServiceResponse struct { func (x *AddServiceResponse) Reset() { *x = AddServiceResponse{} - mi := &file_services_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_services_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *AddServiceResponse) String() string { @@ -308,7 +320,7 @@ func (*AddServiceResponse) ProtoMessage() {} func (x *AddServiceResponse) ProtoReflect() protoreflect.Message { mi := &file_services_proto_msgTypes[5] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -340,9 +352,11 @@ type RemoveServiceRequest struct { func (x *RemoveServiceRequest) Reset() { *x = RemoveServiceRequest{} - mi := &file_services_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_services_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *RemoveServiceRequest) String() string { @@ -353,7 +367,7 @@ func (*RemoveServiceRequest) ProtoMessage() {} func (x *RemoveServiceRequest) ProtoReflect() protoreflect.Message { mi := &file_services_proto_msgTypes[6] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -385,9 +399,11 @@ type RemoveServiceResponse struct { func (x *RemoveServiceResponse) Reset() { *x = RemoveServiceResponse{} - mi := &file_services_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_services_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *RemoveServiceResponse) String() string { @@ -398,7 +414,7 @@ func (*RemoveServiceResponse) ProtoMessage() {} func (x *RemoveServiceResponse) ProtoReflect() protoreflect.Message { mi := &file_services_proto_msgTypes[7] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -431,9 +447,11 @@ type EventInfo struct { func (x *EventInfo) Reset() { *x = EventInfo{} - mi := &file_services_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_services_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *EventInfo) String() string { @@ -444,7 +462,7 @@ func (*EventInfo) ProtoMessage() {} func (x *EventInfo) ProtoReflect() protoreflect.Message { mi := &file_services_proto_msgTypes[8] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -481,9 +499,11 @@ type EventResponse struct { func (x *EventResponse) Reset() { *x = EventResponse{} - mi := &file_services_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_services_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *EventResponse) String() string { @@ -494,7 +514,7 @@ func (*EventResponse) ProtoMessage() {} func (x *EventResponse) ProtoReflect() protoreflect.Message { mi := &file_services_proto_msgTypes[9] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -593,7 +613,7 @@ func file_services_proto_rawDescGZIP() []byte { } var file_services_proto_msgTypes = make([]protoimpl.MessageInfo, 10) -var file_services_proto_goTypes = []any{ +var file_services_proto_goTypes = []interface{}{ (*ServiceInfo)(nil), // 0: proto.ServiceInfo (*GetServiceRequest)(nil), // 1: proto.GetServiceRequest (*GetServiceResponse)(nil), // 2: proto.GetServiceResponse @@ -630,9 +650,131 @@ func file_services_proto_init() { if File_services_proto != nil { return } - file_services_proto_msgTypes[0].OneofWrappers = []any{} - file_services_proto_msgTypes[1].OneofWrappers = []any{} - file_services_proto_msgTypes[3].OneofWrappers = []any{} + if !protoimpl.UnsafeEnabled { + file_services_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ServiceInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_services_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetServiceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_services_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetServiceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_services_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListServiceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_services_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListServiceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_services_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddServiceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_services_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveServiceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_services_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveServiceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_services_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_services_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_services_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_services_proto_msgTypes[1].OneofWrappers = []interface{}{} + file_services_proto_msgTypes[3].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/pkg/proto/services_grpc.pb.go b/pkg/proto/services_grpc.pb.go index bbe6109..126d119 100644 --- a/pkg/proto/services_grpc.pb.go +++ b/pkg/proto/services_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.5.1 +// - protoc-gen-go-grpc v1.2.0 // - protoc v5.28.2 // source: services.proto @@ -15,16 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - DirectoryService_GetService_FullMethodName = "/proto.DirectoryService/GetService" - DirectoryService_ListService_FullMethodName = "/proto.DirectoryService/ListService" - DirectoryService_AddService_FullMethodName = "/proto.DirectoryService/AddService" - DirectoryService_RemoveService_FullMethodName = "/proto.DirectoryService/RemoveService" - DirectoryService_BroadcastEvent_FullMethodName = "/proto.DirectoryService/BroadcastEvent" -) +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 // DirectoryServiceClient is the client API for DirectoryService service. // @@ -46,9 +38,8 @@ func NewDirectoryServiceClient(cc grpc.ClientConnInterface) DirectoryServiceClie } func (c *directoryServiceClient) GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*GetServiceResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetServiceResponse) - err := c.cc.Invoke(ctx, DirectoryService_GetService_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.DirectoryService/GetService", in, out, opts...) if err != nil { return nil, err } @@ -56,9 +47,8 @@ func (c *directoryServiceClient) GetService(ctx context.Context, in *GetServiceR } func (c *directoryServiceClient) ListService(ctx context.Context, in *ListServiceRequest, opts ...grpc.CallOption) (*ListServiceResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ListServiceResponse) - err := c.cc.Invoke(ctx, DirectoryService_ListService_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.DirectoryService/ListService", in, out, opts...) if err != nil { return nil, err } @@ -66,9 +56,8 @@ func (c *directoryServiceClient) ListService(ctx context.Context, in *ListServic } func (c *directoryServiceClient) AddService(ctx context.Context, in *ServiceInfo, opts ...grpc.CallOption) (*AddServiceResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(AddServiceResponse) - err := c.cc.Invoke(ctx, DirectoryService_AddService_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.DirectoryService/AddService", in, out, opts...) if err != nil { return nil, err } @@ -76,9 +65,8 @@ func (c *directoryServiceClient) AddService(ctx context.Context, in *ServiceInfo } func (c *directoryServiceClient) RemoveService(ctx context.Context, in *RemoveServiceRequest, opts ...grpc.CallOption) (*RemoveServiceResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(RemoveServiceResponse) - err := c.cc.Invoke(ctx, DirectoryService_RemoveService_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.DirectoryService/RemoveService", in, out, opts...) if err != nil { return nil, err } @@ -86,9 +74,8 @@ func (c *directoryServiceClient) RemoveService(ctx context.Context, in *RemoveSe } func (c *directoryServiceClient) BroadcastEvent(ctx context.Context, in *EventInfo, opts ...grpc.CallOption) (*EventResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(EventResponse) - err := c.cc.Invoke(ctx, DirectoryService_BroadcastEvent_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.DirectoryService/BroadcastEvent", in, out, opts...) if err != nil { return nil, err } @@ -97,7 +84,7 @@ func (c *directoryServiceClient) BroadcastEvent(ctx context.Context, in *EventIn // DirectoryServiceServer is the server API for DirectoryService service. // All implementations must embed UnimplementedDirectoryServiceServer -// for forward compatibility. +// for forward compatibility type DirectoryServiceServer interface { GetService(context.Context, *GetServiceRequest) (*GetServiceResponse, error) ListService(context.Context, *ListServiceRequest) (*ListServiceResponse, error) @@ -107,12 +94,9 @@ type DirectoryServiceServer interface { mustEmbedUnimplementedDirectoryServiceServer() } -// UnimplementedDirectoryServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedDirectoryServiceServer struct{} +// UnimplementedDirectoryServiceServer must be embedded to have forward compatible implementations. +type UnimplementedDirectoryServiceServer struct { +} func (UnimplementedDirectoryServiceServer) GetService(context.Context, *GetServiceRequest) (*GetServiceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetService not implemented") @@ -130,7 +114,6 @@ func (UnimplementedDirectoryServiceServer) BroadcastEvent(context.Context, *Even return nil, status.Errorf(codes.Unimplemented, "method BroadcastEvent not implemented") } func (UnimplementedDirectoryServiceServer) mustEmbedUnimplementedDirectoryServiceServer() {} -func (UnimplementedDirectoryServiceServer) testEmbeddedByValue() {} // UnsafeDirectoryServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to DirectoryServiceServer will @@ -140,13 +123,6 @@ type UnsafeDirectoryServiceServer interface { } func RegisterDirectoryServiceServer(s grpc.ServiceRegistrar, srv DirectoryServiceServer) { - // If the following call pancis, it indicates UnimplementedDirectoryServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } s.RegisterService(&DirectoryService_ServiceDesc, srv) } @@ -160,7 +136,7 @@ func _DirectoryService_GetService_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: DirectoryService_GetService_FullMethodName, + FullMethod: "/proto.DirectoryService/GetService", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DirectoryServiceServer).GetService(ctx, req.(*GetServiceRequest)) @@ -178,7 +154,7 @@ func _DirectoryService_ListService_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: DirectoryService_ListService_FullMethodName, + FullMethod: "/proto.DirectoryService/ListService", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DirectoryServiceServer).ListService(ctx, req.(*ListServiceRequest)) @@ -196,7 +172,7 @@ func _DirectoryService_AddService_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: DirectoryService_AddService_FullMethodName, + FullMethod: "/proto.DirectoryService/AddService", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DirectoryServiceServer).AddService(ctx, req.(*ServiceInfo)) @@ -214,7 +190,7 @@ func _DirectoryService_RemoveService_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: DirectoryService_RemoveService_FullMethodName, + FullMethod: "/proto.DirectoryService/RemoveService", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DirectoryServiceServer).RemoveService(ctx, req.(*RemoveServiceRequest)) @@ -232,7 +208,7 @@ func _DirectoryService_BroadcastEvent_Handler(srv interface{}, ctx context.Conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: DirectoryService_BroadcastEvent_FullMethodName, + FullMethod: "/proto.DirectoryService/BroadcastEvent", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DirectoryServiceServer).BroadcastEvent(ctx, req.(*EventInfo)) diff --git a/pkg/proto/stream.pb.go b/pkg/proto/stream.pb.go index 203bc0d..1f2b9bc 100644 --- a/pkg/proto/stream.pb.go +++ b/pkg/proto/stream.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.28.1 // protoc v5.28.2 // source: stream.proto @@ -30,9 +30,11 @@ type CountConnectionRequest struct { func (x *CountConnectionRequest) Reset() { *x = CountConnectionRequest{} - mi := &file_stream_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_stream_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *CountConnectionRequest) String() string { @@ -43,7 +45,7 @@ func (*CountConnectionRequest) ProtoMessage() {} func (x *CountConnectionRequest) ProtoReflect() protoreflect.Message { mi := &file_stream_proto_msgTypes[0] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -75,9 +77,11 @@ type CountConnectionResponse struct { func (x *CountConnectionResponse) Reset() { *x = CountConnectionResponse{} - mi := &file_stream_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_stream_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *CountConnectionResponse) String() string { @@ -88,7 +92,7 @@ func (*CountConnectionResponse) ProtoMessage() {} func (x *CountConnectionResponse) ProtoReflect() protoreflect.Message { mi := &file_stream_proto_msgTypes[1] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -122,9 +126,11 @@ type PushStreamRequest struct { func (x *PushStreamRequest) Reset() { *x = PushStreamRequest{} - mi := &file_stream_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_stream_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *PushStreamRequest) String() string { @@ -135,7 +141,7 @@ func (*PushStreamRequest) ProtoMessage() {} func (x *PushStreamRequest) ProtoReflect() protoreflect.Message { mi := &file_stream_proto_msgTypes[2] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -183,9 +189,11 @@ type PushStreamBatchRequest struct { func (x *PushStreamBatchRequest) Reset() { *x = PushStreamBatchRequest{} - mi := &file_stream_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_stream_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *PushStreamBatchRequest) String() string { @@ -196,7 +204,7 @@ func (*PushStreamBatchRequest) ProtoMessage() {} func (x *PushStreamBatchRequest) ProtoReflect() protoreflect.Message { mi := &file_stream_proto_msgTypes[3] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -244,9 +252,11 @@ type PushStreamResponse struct { func (x *PushStreamResponse) Reset() { *x = PushStreamResponse{} - mi := &file_stream_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_stream_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *PushStreamResponse) String() string { @@ -257,7 +267,7 @@ func (*PushStreamResponse) ProtoMessage() {} func (x *PushStreamResponse) ProtoReflect() protoreflect.Message { mi := &file_stream_proto_msgTypes[4] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -306,9 +316,11 @@ type StreamEventRequest struct { func (x *StreamEventRequest) Reset() { *x = StreamEventRequest{} - mi := &file_stream_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_stream_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *StreamEventRequest) String() string { @@ -319,7 +331,7 @@ func (*StreamEventRequest) ProtoMessage() {} func (x *StreamEventRequest) ProtoReflect() protoreflect.Message { mi := &file_stream_proto_msgTypes[5] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -370,9 +382,11 @@ type StreamEventResponse struct { func (x *StreamEventResponse) Reset() { *x = StreamEventResponse{} - mi := &file_stream_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_stream_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *StreamEventResponse) String() string { @@ -383,7 +397,7 @@ func (*StreamEventResponse) ProtoMessage() {} func (x *StreamEventResponse) ProtoReflect() protoreflect.Message { mi := &file_stream_proto_msgTypes[6] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -473,7 +487,7 @@ func file_stream_proto_rawDescGZIP() []byte { } var file_stream_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_stream_proto_goTypes = []any{ +var file_stream_proto_goTypes = []interface{}{ (*CountConnectionRequest)(nil), // 0: proto.CountConnectionRequest (*CountConnectionResponse)(nil), // 1: proto.CountConnectionResponse (*PushStreamRequest)(nil), // 2: proto.PushStreamRequest @@ -501,7 +515,93 @@ func file_stream_proto_init() { if File_stream_proto != nil { return } - file_stream_proto_msgTypes[2].OneofWrappers = []any{} + if !protoimpl.UnsafeEnabled { + file_stream_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CountConnectionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_stream_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CountConnectionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_stream_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PushStreamRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_stream_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PushStreamBatchRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_stream_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PushStreamResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_stream_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StreamEventRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_stream_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StreamEventResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_stream_proto_msgTypes[2].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/pkg/proto/stream_grpc.pb.go b/pkg/proto/stream_grpc.pb.go index b1f96c3..d13ad02 100644 --- a/pkg/proto/stream_grpc.pb.go +++ b/pkg/proto/stream_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.5.1 +// - protoc-gen-go-grpc v1.2.0 // - protoc v5.28.2 // source: stream.proto @@ -15,14 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - StreamService_CountStreamConnection_FullMethodName = "/proto.StreamService/CountStreamConnection" - StreamService_PushStream_FullMethodName = "/proto.StreamService/PushStream" - StreamService_PushStreamBatch_FullMethodName = "/proto.StreamService/PushStreamBatch" -) +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 // StreamServiceClient is the client API for StreamService service. // @@ -42,9 +36,8 @@ func NewStreamServiceClient(cc grpc.ClientConnInterface) StreamServiceClient { } func (c *streamServiceClient) CountStreamConnection(ctx context.Context, in *CountConnectionRequest, opts ...grpc.CallOption) (*CountConnectionResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CountConnectionResponse) - err := c.cc.Invoke(ctx, StreamService_CountStreamConnection_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.StreamService/CountStreamConnection", in, out, opts...) if err != nil { return nil, err } @@ -52,9 +45,8 @@ func (c *streamServiceClient) CountStreamConnection(ctx context.Context, in *Cou } func (c *streamServiceClient) PushStream(ctx context.Context, in *PushStreamRequest, opts ...grpc.CallOption) (*PushStreamResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(PushStreamResponse) - err := c.cc.Invoke(ctx, StreamService_PushStream_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.StreamService/PushStream", in, out, opts...) if err != nil { return nil, err } @@ -62,9 +54,8 @@ func (c *streamServiceClient) PushStream(ctx context.Context, in *PushStreamRequ } func (c *streamServiceClient) PushStreamBatch(ctx context.Context, in *PushStreamBatchRequest, opts ...grpc.CallOption) (*PushStreamResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(PushStreamResponse) - err := c.cc.Invoke(ctx, StreamService_PushStreamBatch_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.StreamService/PushStreamBatch", in, out, opts...) if err != nil { return nil, err } @@ -73,7 +64,7 @@ func (c *streamServiceClient) PushStreamBatch(ctx context.Context, in *PushStrea // StreamServiceServer is the server API for StreamService service. // All implementations must embed UnimplementedStreamServiceServer -// for forward compatibility. +// for forward compatibility type StreamServiceServer interface { CountStreamConnection(context.Context, *CountConnectionRequest) (*CountConnectionResponse, error) PushStream(context.Context, *PushStreamRequest) (*PushStreamResponse, error) @@ -81,12 +72,9 @@ type StreamServiceServer interface { mustEmbedUnimplementedStreamServiceServer() } -// UnimplementedStreamServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedStreamServiceServer struct{} +// UnimplementedStreamServiceServer must be embedded to have forward compatible implementations. +type UnimplementedStreamServiceServer struct { +} func (UnimplementedStreamServiceServer) CountStreamConnection(context.Context, *CountConnectionRequest) (*CountConnectionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CountStreamConnection not implemented") @@ -98,7 +86,6 @@ func (UnimplementedStreamServiceServer) PushStreamBatch(context.Context, *PushSt return nil, status.Errorf(codes.Unimplemented, "method PushStreamBatch not implemented") } func (UnimplementedStreamServiceServer) mustEmbedUnimplementedStreamServiceServer() {} -func (UnimplementedStreamServiceServer) testEmbeddedByValue() {} // UnsafeStreamServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to StreamServiceServer will @@ -108,13 +95,6 @@ type UnsafeStreamServiceServer interface { } func RegisterStreamServiceServer(s grpc.ServiceRegistrar, srv StreamServiceServer) { - // If the following call pancis, it indicates UnimplementedStreamServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } s.RegisterService(&StreamService_ServiceDesc, srv) } @@ -128,7 +108,7 @@ func _StreamService_CountStreamConnection_Handler(srv interface{}, ctx context.C } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: StreamService_CountStreamConnection_FullMethodName, + FullMethod: "/proto.StreamService/CountStreamConnection", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(StreamServiceServer).CountStreamConnection(ctx, req.(*CountConnectionRequest)) @@ -146,7 +126,7 @@ func _StreamService_PushStream_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: StreamService_PushStream_FullMethodName, + FullMethod: "/proto.StreamService/PushStream", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(StreamServiceServer).PushStream(ctx, req.(*PushStreamRequest)) @@ -164,7 +144,7 @@ func _StreamService_PushStreamBatch_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: StreamService_PushStreamBatch_FullMethodName, + FullMethod: "/proto.StreamService/PushStreamBatch", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(StreamServiceServer).PushStreamBatch(ctx, req.(*PushStreamBatchRequest)) diff --git a/pkg/proto/user.pb.go b/pkg/proto/user.pb.go index d9929d0..da707aa 100644 --- a/pkg/proto/user.pb.go +++ b/pkg/proto/user.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.28.1 // protoc v5.28.2 // source: user.proto @@ -33,9 +33,11 @@ type UserInfo struct { func (x *UserInfo) Reset() { *x = UserInfo{} - mi := &file_user_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_user_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *UserInfo) String() string { @@ -46,7 +48,7 @@ func (*UserInfo) ProtoMessage() {} func (x *UserInfo) ProtoReflect() protoreflect.Message { mi := &file_user_proto_msgTypes[0] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -99,9 +101,11 @@ type MultipleUserInfo struct { func (x *MultipleUserInfo) Reset() { *x = MultipleUserInfo{} - mi := &file_user_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_user_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *MultipleUserInfo) String() string { @@ -112,7 +116,7 @@ func (*MultipleUserInfo) ProtoMessage() {} func (x *MultipleUserInfo) ProtoReflect() protoreflect.Message { mi := &file_user_proto_msgTypes[1] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -139,14 +143,17 @@ type GetUserRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UserId uint64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + UserId *uint64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3,oneof" json:"user_id,omitempty"` + Name *string `protobuf:"bytes,2,opt,name=name,proto3,oneof" json:"name,omitempty"` } func (x *GetUserRequest) Reset() { *x = GetUserRequest{} - mi := &file_user_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_user_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *GetUserRequest) String() string { @@ -157,7 +164,7 @@ func (*GetUserRequest) ProtoMessage() {} func (x *GetUserRequest) ProtoReflect() protoreflect.Message { mi := &file_user_proto_msgTypes[2] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -173,12 +180,19 @@ func (*GetUserRequest) Descriptor() ([]byte, []int) { } func (x *GetUserRequest) GetUserId() uint64 { - if x != nil { - return x.UserId + if x != nil && x.UserId != nil { + return *x.UserId } return 0 } +func (x *GetUserRequest) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + type ListUserRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -189,9 +203,11 @@ type ListUserRequest struct { func (x *ListUserRequest) Reset() { *x = ListUserRequest{} - mi := &file_user_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_user_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *ListUserRequest) String() string { @@ -202,7 +218,7 @@ func (*ListUserRequest) ProtoMessage() {} func (x *ListUserRequest) ProtoReflect() protoreflect.Message { mi := &file_user_proto_msgTypes[3] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -236,9 +252,11 @@ type ListUserRelativeRequest struct { func (x *ListUserRelativeRequest) Reset() { *x = ListUserRelativeRequest{} - mi := &file_user_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_user_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *ListUserRelativeRequest) String() string { @@ -249,7 +267,7 @@ func (*ListUserRelativeRequest) ProtoMessage() {} func (x *ListUserRelativeRequest) ProtoReflect() protoreflect.Message { mi := &file_user_proto_msgTypes[4] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -295,9 +313,11 @@ type ListUserRelativeResponse struct { func (x *ListUserRelativeResponse) Reset() { *x = ListUserRelativeResponse{} - mi := &file_user_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_user_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *ListUserRelativeResponse) String() string { @@ -308,7 +328,7 @@ func (*ListUserRelativeResponse) ProtoMessage() {} func (x *ListUserRelativeResponse) ProtoReflect() protoreflect.Message { mi := &file_user_proto_msgTypes[5] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -346,38 +366,42 @@ var file_user_proto_rawDesc = []byte{ 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x37, 0x0a, 0x10, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x23, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x29, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x5c, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x2a, 0x0a, 0x0f, 0x4c, 0x69, 0x73, - 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, - 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x52, 0x06, 0x75, - 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x69, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, - 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, - 0x22, 0x3f, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, - 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x04, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x64, 0x61, 0x74, - 0x61, 0x32, 0xd8, 0x01, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x33, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x73, 0x65, 0x72, - 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, - 0x65, 0x72, 0x12, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, - 0x6e, 0x66, 0x6f, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, - 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x12, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, - 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, - 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x09, 0x5a, 0x07, - 0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x1c, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x48, 0x00, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x17, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x2a, 0x0a, 0x0f, + 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, + 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x69, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, + 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x52, 0x65, 0x6c, 0x61, + 0x74, 0x65, 0x64, 0x22, 0x3f, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x23, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x32, 0xd8, 0x01, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, + 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x08, 0x4c, 0x69, 0x73, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x12, 0x1e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, + 0x61, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, + 0x61, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, + 0x09, 0x5a, 0x07, 0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -393,7 +417,7 @@ func file_user_proto_rawDescGZIP() []byte { } var file_user_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_user_proto_goTypes = []any{ +var file_user_proto_goTypes = []interface{}{ (*UserInfo)(nil), // 0: proto.UserInfo (*MultipleUserInfo)(nil), // 1: proto.MultipleUserInfo (*GetUserRequest)(nil), // 2: proto.GetUserRequest @@ -422,7 +446,82 @@ func file_user_proto_init() { if File_user_proto != nil { return } - file_user_proto_msgTypes[0].OneofWrappers = []any{} + if !protoimpl.UnsafeEnabled { + file_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MultipleUserInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUserRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListUserRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListUserRelativeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListUserRelativeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_user_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_user_proto_msgTypes[2].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/pkg/proto/user.proto b/pkg/proto/user.proto index c8596f2..aa946de 100644 --- a/pkg/proto/user.proto +++ b/pkg/proto/user.proto @@ -22,7 +22,8 @@ message MultipleUserInfo { } message GetUserRequest { - uint64 user_id = 1; + optional uint64 user_id = 1; + optional string name = 2; } message ListUserRequest { diff --git a/pkg/proto/user_grpc.pb.go b/pkg/proto/user_grpc.pb.go index f257f26..8d24f31 100644 --- a/pkg/proto/user_grpc.pb.go +++ b/pkg/proto/user_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.5.1 +// - protoc-gen-go-grpc v1.2.0 // - protoc v5.28.2 // source: user.proto @@ -15,14 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - UserService_GetUser_FullMethodName = "/proto.UserService/GetUser" - UserService_ListUser_FullMethodName = "/proto.UserService/ListUser" - UserService_ListUserRelative_FullMethodName = "/proto.UserService/ListUserRelative" -) +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 // UserServiceClient is the client API for UserService service. // @@ -42,9 +36,8 @@ func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient { } func (c *userServiceClient) GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*UserInfo, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(UserInfo) - err := c.cc.Invoke(ctx, UserService_GetUser_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.UserService/GetUser", in, out, opts...) if err != nil { return nil, err } @@ -52,9 +45,8 @@ func (c *userServiceClient) GetUser(ctx context.Context, in *GetUserRequest, opt } func (c *userServiceClient) ListUser(ctx context.Context, in *ListUserRequest, opts ...grpc.CallOption) (*MultipleUserInfo, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MultipleUserInfo) - err := c.cc.Invoke(ctx, UserService_ListUser_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.UserService/ListUser", in, out, opts...) if err != nil { return nil, err } @@ -62,9 +54,8 @@ func (c *userServiceClient) ListUser(ctx context.Context, in *ListUserRequest, o } func (c *userServiceClient) ListUserRelative(ctx context.Context, in *ListUserRelativeRequest, opts ...grpc.CallOption) (*ListUserRelativeResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ListUserRelativeResponse) - err := c.cc.Invoke(ctx, UserService_ListUserRelative_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, "/proto.UserService/ListUserRelative", in, out, opts...) if err != nil { return nil, err } @@ -73,7 +64,7 @@ func (c *userServiceClient) ListUserRelative(ctx context.Context, in *ListUserRe // UserServiceServer is the server API for UserService service. // All implementations must embed UnimplementedUserServiceServer -// for forward compatibility. +// for forward compatibility type UserServiceServer interface { GetUser(context.Context, *GetUserRequest) (*UserInfo, error) ListUser(context.Context, *ListUserRequest) (*MultipleUserInfo, error) @@ -81,12 +72,9 @@ type UserServiceServer interface { mustEmbedUnimplementedUserServiceServer() } -// UnimplementedUserServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedUserServiceServer struct{} +// UnimplementedUserServiceServer must be embedded to have forward compatible implementations. +type UnimplementedUserServiceServer struct { +} func (UnimplementedUserServiceServer) GetUser(context.Context, *GetUserRequest) (*UserInfo, error) { return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented") @@ -98,7 +86,6 @@ func (UnimplementedUserServiceServer) ListUserRelative(context.Context, *ListUse return nil, status.Errorf(codes.Unimplemented, "method ListUserRelative not implemented") } func (UnimplementedUserServiceServer) mustEmbedUnimplementedUserServiceServer() {} -func (UnimplementedUserServiceServer) testEmbeddedByValue() {} // UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to UserServiceServer will @@ -108,13 +95,6 @@ type UnsafeUserServiceServer interface { } func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer) { - // If the following call pancis, it indicates UnimplementedUserServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } s.RegisterService(&UserService_ServiceDesc, srv) } @@ -128,7 +108,7 @@ func _UserService_GetUser_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: UserService_GetUser_FullMethodName, + FullMethod: "/proto.UserService/GetUser", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServiceServer).GetUser(ctx, req.(*GetUserRequest)) @@ -146,7 +126,7 @@ func _UserService_ListUser_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: UserService_ListUser_FullMethodName, + FullMethod: "/proto.UserService/ListUser", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServiceServer).ListUser(ctx, req.(*ListUserRequest)) @@ -164,7 +144,7 @@ func _UserService_ListUserRelative_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: UserService_ListUserRelative_FullMethodName, + FullMethod: "/proto.UserService/ListUserRelative", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServiceServer).ListUserRelative(ctx, req.(*ListUserRelativeRequest))