...
1
2
3 package pb
4
5 import (
6 context "context"
7 grpc "google.golang.org/grpc"
8 codes "google.golang.org/grpc/codes"
9 status "google.golang.org/grpc/status"
10 )
11
12
13
14
15 const _ = grpc.SupportPackageIsVersion7
16
17
18
19
20 type TestClient interface {
21 Test(ctx context.Context, in *TestRequest, opts ...grpc.CallOption) (*TestResponse, error)
22 }
23
24 type testClient struct {
25 cc grpc.ClientConnInterface
26 }
27
28 func NewTestClient(cc grpc.ClientConnInterface) TestClient {
29 return &testClient{cc}
30 }
31
32 func (c *testClient) Test(ctx context.Context, in *TestRequest, opts ...grpc.CallOption) (*TestResponse, error) {
33 out := new(TestResponse)
34 err := c.cc.Invoke(ctx, "/pb.Test/Test", in, out, opts...)
35 if err != nil {
36 return nil, err
37 }
38 return out, nil
39 }
40
41
42
43
44 type TestServer interface {
45 Test(context.Context, *TestRequest) (*TestResponse, error)
46 mustEmbedUnimplementedTestServer()
47 }
48
49
50 type UnimplementedTestServer struct {
51 }
52
53 func (UnimplementedTestServer) Test(context.Context, *TestRequest) (*TestResponse, error) {
54 return nil, status.Errorf(codes.Unimplemented, "method Test not implemented")
55 }
56 func (UnimplementedTestServer) mustEmbedUnimplementedTestServer() {}
57
58
59
60
61 type UnsafeTestServer interface {
62 mustEmbedUnimplementedTestServer()
63 }
64
65 func RegisterTestServer(s grpc.ServiceRegistrar, srv TestServer) {
66 s.RegisterService(&Test_ServiceDesc, srv)
67 }
68
69 func _Test_Test_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
70 in := new(TestRequest)
71 if err := dec(in); err != nil {
72 return nil, err
73 }
74 if interceptor == nil {
75 return srv.(TestServer).Test(ctx, in)
76 }
77 info := &grpc.UnaryServerInfo{
78 Server: srv,
79 FullMethod: "/pb.Test/Test",
80 }
81 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
82 return srv.(TestServer).Test(ctx, req.(*TestRequest))
83 }
84 return interceptor(ctx, in, info, handler)
85 }
86
87
88
89
90 var Test_ServiceDesc = grpc.ServiceDesc{
91 ServiceName: "pb.Test",
92 HandlerType: (*TestServer)(nil),
93 Methods: []grpc.MethodDesc{
94 {
95 MethodName: "Test",
96 Handler: _Test_Test_Handler,
97 },
98 },
99 Streams: []grpc.StreamDesc{},
100 Metadata: "test.proto",
101 }
102
View as plain text