...
1
2
3
4
5
6
7 package examplepb
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 FooServiceClient interface {
25
26 Foo(ctx context.Context, in *FooRequest, opts ...grpc.CallOption) (*FooReply, error)
27 }
28
29 type fooServiceClient struct {
30 cc grpc.ClientConnInterface
31 }
32
33 func NewFooServiceClient(cc grpc.ClientConnInterface) FooServiceClient {
34 return &fooServiceClient{cc}
35 }
36
37 func (c *fooServiceClient) Foo(ctx context.Context, in *FooRequest, opts ...grpc.CallOption) (*FooReply, error) {
38 out := new(FooReply)
39 err := c.cc.Invoke(ctx, "/grpc.gateway.examples.internal.proto.examplepb.FooService/Foo", in, out, opts...)
40 if err != nil {
41 return nil, err
42 }
43 return out, nil
44 }
45
46
47
48
49 type FooServiceServer interface {
50
51 Foo(context.Context, *FooRequest) (*FooReply, error)
52 }
53
54
55 type UnimplementedFooServiceServer struct {
56 }
57
58 func (UnimplementedFooServiceServer) Foo(context.Context, *FooRequest) (*FooReply, error) {
59 return nil, status.Errorf(codes.Unimplemented, "method Foo not implemented")
60 }
61
62
63
64
65 type UnsafeFooServiceServer interface {
66 mustEmbedUnimplementedFooServiceServer()
67 }
68
69 func RegisterFooServiceServer(s grpc.ServiceRegistrar, srv FooServiceServer) {
70 s.RegisterService(&FooService_ServiceDesc, srv)
71 }
72
73 func _FooService_Foo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
74 in := new(FooRequest)
75 if err := dec(in); err != nil {
76 return nil, err
77 }
78 if interceptor == nil {
79 return srv.(FooServiceServer).Foo(ctx, in)
80 }
81 info := &grpc.UnaryServerInfo{
82 Server: srv,
83 FullMethod: "/grpc.gateway.examples.internal.proto.examplepb.FooService/Foo",
84 }
85 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
86 return srv.(FooServiceServer).Foo(ctx, req.(*FooRequest))
87 }
88 return interceptor(ctx, in, info, handler)
89 }
90
91
92
93
94 var FooService_ServiceDesc = grpc.ServiceDesc{
95 ServiceName: "grpc.gateway.examples.internal.proto.examplepb.FooService",
96 HandlerType: (*FooServiceServer)(nil),
97 Methods: []grpc.MethodDesc{
98 {
99 MethodName: "Foo",
100 Handler: _FooService_Foo_Handler,
101 },
102 },
103 Streams: []grpc.StreamDesc{},
104 Metadata: "examples/internal/proto/examplepb/ignore_comment.proto",
105 }
106
View as plain text