parent
c9ec957b4f
commit
97eb8d972f
@ -1,2 +1 @@ |
||||
protoc -I ./ message.proto --go_out=plugins=grpc:./ |
||||
# protoc -I ./ message.proto --go_out=./ |
||||
protoc -I ./ message.proto --go_out=. --go-grpc_out=. |
||||
|
@ -1,3 +1,3 @@ |
||||
package message |
||||
|
||||
//go:generate protoc message.proto --go_out=plugins=grpc:.
|
||||
//go:generate protoc message.proto --go_out=. --go-grpc_out=.
|
||||
|
@ -0,0 +1,101 @@ |
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
|
||||
package message |
||||
|
||||
import ( |
||||
context "context" |
||||
grpc "google.golang.org/grpc" |
||||
codes "google.golang.org/grpc/codes" |
||||
status "google.golang.org/grpc/status" |
||||
) |
||||
|
||||
// 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.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7 |
||||
|
||||
// ClientServiceClient is the client API for ClientService 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 ClientServiceClient interface { |
||||
Process(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Response, error) |
||||
} |
||||
|
||||
type clientServiceClient struct { |
||||
cc grpc.ClientConnInterface |
||||
} |
||||
|
||||
func NewClientServiceClient(cc grpc.ClientConnInterface) ClientServiceClient { |
||||
return &clientServiceClient{cc} |
||||
} |
||||
|
||||
func (c *clientServiceClient) Process(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Response, error) { |
||||
out := new(Response) |
||||
err := c.cc.Invoke(ctx, "/message.ClientService/Process", in, out, opts...) |
||||
if err != nil { |
||||
return nil, err |
||||
} |
||||
return out, nil |
||||
} |
||||
|
||||
// ClientServiceServer is the server API for ClientService service.
|
||||
// All implementations must embed UnimplementedClientServiceServer
|
||||
// for forward compatibility
|
||||
type ClientServiceServer interface { |
||||
Process(context.Context, *Message) (*Response, error) |
||||
mustEmbedUnimplementedClientServiceServer() |
||||
} |
||||
|
||||
// UnimplementedClientServiceServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedClientServiceServer struct { |
||||
} |
||||
|
||||
func (UnimplementedClientServiceServer) Process(context.Context, *Message) (*Response, error) { |
||||
return nil, status.Errorf(codes.Unimplemented, "method Process not implemented") |
||||
} |
||||
func (UnimplementedClientServiceServer) mustEmbedUnimplementedClientServiceServer() {} |
||||
|
||||
// UnsafeClientServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ClientServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeClientServiceServer interface { |
||||
mustEmbedUnimplementedClientServiceServer() |
||||
} |
||||
|
||||
func RegisterClientServiceServer(s grpc.ServiceRegistrar, srv ClientServiceServer) { |
||||
s.RegisterService(&ClientService_ServiceDesc, srv) |
||||
} |
||||
|
||||
func _ClientService_Process_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
||||
in := new(Message) |
||||
if err := dec(in); err != nil { |
||||
return nil, err |
||||
} |
||||
if interceptor == nil { |
||||
return srv.(ClientServiceServer).Process(ctx, in) |
||||
} |
||||
info := &grpc.UnaryServerInfo{ |
||||
Server: srv, |
||||
FullMethod: "/message.ClientService/Process", |
||||
} |
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
||||
return srv.(ClientServiceServer).Process(ctx, req.(*Message)) |
||||
} |
||||
return interceptor(ctx, in, info, handler) |
||||
} |
||||
|
||||
// ClientService_ServiceDesc is the grpc.ServiceDesc for ClientService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var ClientService_ServiceDesc = grpc.ServiceDesc{ |
||||
ServiceName: "message.ClientService", |
||||
HandlerType: (*ClientServiceServer)(nil), |
||||
Methods: []grpc.MethodDesc{ |
||||
{ |
||||
MethodName: "Process", |
||||
Handler: _ClientService_Process_Handler, |
||||
}, |
||||
}, |
||||
Streams: []grpc.StreamDesc{}, |
||||
Metadata: "message.proto", |
||||
} |
Loading…
Reference in new issue