...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package echo
22
23 import (
24 context "context"
25
26 grpc "google.golang.org/grpc"
27 codes "google.golang.org/grpc/codes"
28 status "google.golang.org/grpc/status"
29 )
30
31
32
33
34 const _ = grpc.SupportPackageIsVersion7
35
36 const (
37 Echoer_Echo_FullMethodName = "/echo.Echoer/Echo"
38 )
39
40
41
42
43 type EchoerClient interface {
44 Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoReply, error)
45 }
46
47 type echoerClient struct {
48 cc grpc.ClientConnInterface
49 }
50
51 func NewEchoerClient(cc grpc.ClientConnInterface) EchoerClient {
52 return &echoerClient{cc}
53 }
54
55 func (c *echoerClient) Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoReply, error) {
56 out := new(EchoReply)
57 err := c.cc.Invoke(ctx, Echoer_Echo_FullMethodName, in, out, opts...)
58 if err != nil {
59 return nil, err
60 }
61 return out, nil
62 }
63
64
65
66
67 type EchoerServer interface {
68 Echo(context.Context, *EchoRequest) (*EchoReply, error)
69 mustEmbedUnimplementedEchoerServer()
70 }
71
72
73 type UnimplementedEchoerServer struct {
74 }
75
76 func (UnimplementedEchoerServer) Echo(context.Context, *EchoRequest) (*EchoReply, error) {
77 return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented")
78 }
79 func (UnimplementedEchoerServer) mustEmbedUnimplementedEchoerServer() {}
80
81
82
83
84 type UnsafeEchoerServer interface {
85 mustEmbedUnimplementedEchoerServer()
86 }
87
88 func RegisterEchoerServer(s grpc.ServiceRegistrar, srv EchoerServer) {
89 s.RegisterService(&Echoer_ServiceDesc, srv)
90 }
91
92 func _Echoer_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
93 in := new(EchoRequest)
94 if err := dec(in); err != nil {
95 return nil, err
96 }
97 if interceptor == nil {
98 return srv.(EchoerServer).Echo(ctx, in)
99 }
100 info := &grpc.UnaryServerInfo{
101 Server: srv,
102 FullMethod: Echoer_Echo_FullMethodName,
103 }
104 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
105 return srv.(EchoerServer).Echo(ctx, req.(*EchoRequest))
106 }
107 return interceptor(ctx, in, info, handler)
108 }
109
110
111
112
113 var Echoer_ServiceDesc = grpc.ServiceDesc{
114 ServiceName: "echo.Echoer",
115 HandlerType: (*EchoerServer)(nil),
116 Methods: []grpc.MethodDesc{
117 {
118 MethodName: "Echo",
119 Handler: _Echoer_Echo_Handler,
120 },
121 },
122 Streams: []grpc.StreamDesc{},
123 Metadata: "echo.proto",
124 }
125
View as plain text