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