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