diff --git a/pkg/test/v1/test_v1.pb.go b/pkg/test/v1/test_v1.pb.go index bf383f4..d255f3d 100644 --- a/pkg/test/v1/test_v1.pb.go +++ b/pkg/test/v1/test_v1.pb.go @@ -173,9 +173,10 @@ const file_test_v1_test_v1_proto_rawDesc = "" + "\vPingRequest\"\x0e\n" + "\fPingResponse\"\r\n" + "\vPongRequest\"\x0e\n" + - "\fPongResponse2{\n" + - "\vTestService\x125\n" + - "\x04Ping\x12\x14.test.v1.PingRequest\x1a\x15.test.v1.PingResponse\"\x00\x125\n" + + "\fPongResponse2J\n" + + "\x11TestNoAuthService\x125\n" + + "\x04Ping\x12\x14.test.v1.PingRequest\x1a\x15.test.v1.PingResponse\"\x002H\n" + + "\x0fTestAuthService\x125\n" + "\x04Pong\x12\x14.test.v1.PongRequest\x1a\x15.test.v1.PongResponse\"\x00BEZCgitea.badhouseplants.net/softplayer/softplayer-go-proto/pkg/test/v1b\x06proto3" var ( @@ -198,10 +199,10 @@ var file_test_v1_test_v1_proto_goTypes = []any{ (*PongResponse)(nil), // 3: test.v1.PongResponse } var file_test_v1_test_v1_proto_depIdxs = []int32{ - 0, // 0: test.v1.TestService.Ping:input_type -> test.v1.PingRequest - 2, // 1: test.v1.TestService.Pong:input_type -> test.v1.PongRequest - 1, // 2: test.v1.TestService.Ping:output_type -> test.v1.PingResponse - 3, // 3: test.v1.TestService.Pong:output_type -> test.v1.PongResponse + 0, // 0: test.v1.TestNoAuthService.Ping:input_type -> test.v1.PingRequest + 2, // 1: test.v1.TestAuthService.Pong:input_type -> test.v1.PongRequest + 1, // 2: test.v1.TestNoAuthService.Ping:output_type -> test.v1.PingResponse + 3, // 3: test.v1.TestAuthService.Pong:output_type -> test.v1.PongResponse 2, // [2:4] is the sub-list for method output_type 0, // [0:2] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name @@ -222,7 +223,7 @@ func file_test_v1_test_v1_proto_init() { NumEnums: 0, NumMessages: 4, NumExtensions: 0, - NumServices: 1, + NumServices: 2, }, GoTypes: file_test_v1_test_v1_proto_goTypes, DependencyIndexes: file_test_v1_test_v1_proto_depIdxs, diff --git a/pkg/test/v1/test_v1_grpc.pb.go b/pkg/test/v1/test_v1_grpc.pb.go index ee4742f..1926f34 100644 --- a/pkg/test/v1/test_v1_grpc.pb.go +++ b/pkg/test/v1/test_v1_grpc.pb.go @@ -19,143 +19,205 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - TestService_Ping_FullMethodName = "/test.v1.TestService/Ping" - TestService_Pong_FullMethodName = "/test.v1.TestService/Pong" + TestNoAuthService_Ping_FullMethodName = "/test.v1.TestNoAuthService/Ping" ) -// TestServiceClient is the client API for TestService service. +// TestNoAuthServiceClient is the client API for TestNoAuthService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. // // * // Service for handling environments -type TestServiceClient interface { +type TestNoAuthServiceClient interface { Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) - Pong(ctx context.Context, in *PongRequest, opts ...grpc.CallOption) (*PongResponse, error) } -type testServiceClient struct { +type testNoAuthServiceClient struct { cc grpc.ClientConnInterface } -func NewTestServiceClient(cc grpc.ClientConnInterface) TestServiceClient { - return &testServiceClient{cc} +func NewTestNoAuthServiceClient(cc grpc.ClientConnInterface) TestNoAuthServiceClient { + return &testNoAuthServiceClient{cc} } -func (c *testServiceClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) { +func (c *testNoAuthServiceClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(PingResponse) - err := c.cc.Invoke(ctx, TestService_Ping_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, TestNoAuthService_Ping_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *testServiceClient) Pong(ctx context.Context, in *PongRequest, opts ...grpc.CallOption) (*PongResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(PongResponse) - err := c.cc.Invoke(ctx, TestService_Pong_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// TestServiceServer is the server API for TestService service. -// All implementations should embed UnimplementedTestServiceServer +// TestNoAuthServiceServer is the server API for TestNoAuthService service. +// All implementations should embed UnimplementedTestNoAuthServiceServer // for forward compatibility. // // * // Service for handling environments -type TestServiceServer interface { +type TestNoAuthServiceServer interface { Ping(context.Context, *PingRequest) (*PingResponse, error) - Pong(context.Context, *PongRequest) (*PongResponse, error) } -// UnimplementedTestServiceServer should be embedded to have +// UnimplementedTestNoAuthServiceServer should 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 UnimplementedTestServiceServer struct{} +type UnimplementedTestNoAuthServiceServer struct{} -func (UnimplementedTestServiceServer) Ping(context.Context, *PingRequest) (*PingResponse, error) { +func (UnimplementedTestNoAuthServiceServer) Ping(context.Context, *PingRequest) (*PingResponse, error) { return nil, status.Error(codes.Unimplemented, "method Ping not implemented") } -func (UnimplementedTestServiceServer) Pong(context.Context, *PongRequest) (*PongResponse, error) { - return nil, status.Error(codes.Unimplemented, "method Pong not implemented") -} -func (UnimplementedTestServiceServer) testEmbeddedByValue() {} +func (UnimplementedTestNoAuthServiceServer) testEmbeddedByValue() {} -// UnsafeTestServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to TestServiceServer will +// UnsafeTestNoAuthServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to TestNoAuthServiceServer will // result in compilation errors. -type UnsafeTestServiceServer interface { - mustEmbedUnimplementedTestServiceServer() +type UnsafeTestNoAuthServiceServer interface { + mustEmbedUnimplementedTestNoAuthServiceServer() } -func RegisterTestServiceServer(s grpc.ServiceRegistrar, srv TestServiceServer) { - // If the following call panics, it indicates UnimplementedTestServiceServer was +func RegisterTestNoAuthServiceServer(s grpc.ServiceRegistrar, srv TestNoAuthServiceServer) { + // If the following call panics, it indicates UnimplementedTestNoAuthServiceServer 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(&TestService_ServiceDesc, srv) + s.RegisterService(&TestNoAuthService_ServiceDesc, srv) } -func _TestService_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _TestNoAuthService_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(PingRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TestServiceServer).Ping(ctx, in) + return srv.(TestNoAuthServiceServer).Ping(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: TestService_Ping_FullMethodName, + FullMethod: TestNoAuthService_Ping_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestServiceServer).Ping(ctx, req.(*PingRequest)) + return srv.(TestNoAuthServiceServer).Ping(ctx, req.(*PingRequest)) } return interceptor(ctx, in, info, handler) } -func _TestService_Pong_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PongRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestServiceServer).Pong(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestService_Pong_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestServiceServer).Pong(ctx, req.(*PongRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// TestService_ServiceDesc is the grpc.ServiceDesc for TestService service. +// TestNoAuthService_ServiceDesc is the grpc.ServiceDesc for TestNoAuthService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) -var TestService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "test.v1.TestService", - HandlerType: (*TestServiceServer)(nil), +var TestNoAuthService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "test.v1.TestNoAuthService", + HandlerType: (*TestNoAuthServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Ping", - Handler: _TestService_Ping_Handler, - }, - { - MethodName: "Pong", - Handler: _TestService_Pong_Handler, + Handler: _TestNoAuthService_Ping_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "test/v1/test_v1.proto", +} + +const ( + TestAuthService_Pong_FullMethodName = "/test.v1.TestAuthService/Pong" +) + +// TestAuthServiceClient is the client API for TestAuthService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type TestAuthServiceClient interface { + Pong(ctx context.Context, in *PongRequest, opts ...grpc.CallOption) (*PongResponse, error) +} + +type testAuthServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewTestAuthServiceClient(cc grpc.ClientConnInterface) TestAuthServiceClient { + return &testAuthServiceClient{cc} +} + +func (c *testAuthServiceClient) Pong(ctx context.Context, in *PongRequest, opts ...grpc.CallOption) (*PongResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(PongResponse) + err := c.cc.Invoke(ctx, TestAuthService_Pong_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// TestAuthServiceServer is the server API for TestAuthService service. +// All implementations should embed UnimplementedTestAuthServiceServer +// for forward compatibility. +type TestAuthServiceServer interface { + Pong(context.Context, *PongRequest) (*PongResponse, error) +} + +// UnimplementedTestAuthServiceServer should 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 UnimplementedTestAuthServiceServer struct{} + +func (UnimplementedTestAuthServiceServer) Pong(context.Context, *PongRequest) (*PongResponse, error) { + return nil, status.Error(codes.Unimplemented, "method Pong not implemented") +} +func (UnimplementedTestAuthServiceServer) testEmbeddedByValue() {} + +// UnsafeTestAuthServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to TestAuthServiceServer will +// result in compilation errors. +type UnsafeTestAuthServiceServer interface { + mustEmbedUnimplementedTestAuthServiceServer() +} + +func RegisterTestAuthServiceServer(s grpc.ServiceRegistrar, srv TestAuthServiceServer) { + // If the following call panics, it indicates UnimplementedTestAuthServiceServer 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(&TestAuthService_ServiceDesc, srv) +} + +func _TestAuthService_Pong_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PongRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TestAuthServiceServer).Pong(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TestAuthService_Pong_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TestAuthServiceServer).Pong(ctx, req.(*PongRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// TestAuthService_ServiceDesc is the grpc.ServiceDesc for TestAuthService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var TestAuthService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "test.v1.TestAuthService", + HandlerType: (*TestAuthServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Pong", + Handler: _TestAuthService_Pong_Handler, }, }, Streams: []grpc.StreamDesc{},