1
2
3
4
14 package proto
15
16 import proto1 "github.com/golang/protobuf/proto"
17 import fmt "fmt"
18 import math "math"
19
20 import (
21 context "golang.org/x/net/context"
22 grpc "google.golang.org/grpc"
23 )
24
25
26 var _ = proto1.Marshal
27 var _ = fmt.Errorf
28 var _ = math.Inf
29
30
31
32
33
34 const _ = proto1.ProtoPackageIsVersion2
35
36 type HelloRequest struct {
37 Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
38 }
39
40 func (m *HelloRequest) Reset() { *m = HelloRequest{} }
41 func (m *HelloRequest) String() string { return proto1.CompactTextString(m) }
42 func (*HelloRequest) ProtoMessage() {}
43 func (*HelloRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
44
45 func (m *HelloRequest) GetName() string {
46 if m != nil {
47 return m.Name
48 }
49 return ""
50 }
51
52 type HelloResponse struct {
53 Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"`
54 }
55
56 func (m *HelloResponse) Reset() { *m = HelloResponse{} }
57 func (m *HelloResponse) String() string { return proto1.CompactTextString(m) }
58 func (*HelloResponse) ProtoMessage() {}
59 func (*HelloResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
60
61 func (m *HelloResponse) GetMessage() string {
62 if m != nil {
63 return m.Message
64 }
65 return ""
66 }
67
68 func init() {
69 proto1.RegisterType((*HelloRequest)(nil), "proto.HelloRequest")
70 proto1.RegisterType((*HelloResponse)(nil), "proto.HelloResponse")
71 }
72
73
74 var _ context.Context
75 var _ grpc.ClientConn
76
77
78
79 const _ = grpc.SupportPackageIsVersion4
80
81
82
83 type DemoServiceClient interface {
84 SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloResponse, error)
85 }
86
87 type demoServiceClient struct {
88 cc *grpc.ClientConn
89 }
90
91 func NewDemoServiceClient(cc *grpc.ClientConn) DemoServiceClient {
92 return &demoServiceClient{cc}
93 }
94
95 func (c *demoServiceClient) SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloResponse, error) {
96 out := new(HelloResponse)
97 err := grpc.Invoke(ctx, "/proto.DemoService/SayHello", in, out, c.cc, opts...)
98 if err != nil {
99 return nil, err
100 }
101 return out, nil
102 }
103
104
105
106 type DemoServiceServer interface {
107 SayHello(context.Context, *HelloRequest) (*HelloResponse, error)
108 }
109
110 func RegisterDemoServiceServer(s *grpc.Server, srv DemoServiceServer) {
111 s.RegisterService(&_DemoService_serviceDesc, srv)
112 }
113
114 func _DemoService_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
115 in := new(HelloRequest)
116 if err := dec(in); err != nil {
117 return nil, err
118 }
119 if interceptor == nil {
120 return srv.(DemoServiceServer).SayHello(ctx, in)
121 }
122 info := &grpc.UnaryServerInfo{
123 Server: srv,
124 FullMethod: "/proto.DemoService/SayHello",
125 }
126 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
127 return srv.(DemoServiceServer).SayHello(ctx, req.(*HelloRequest))
128 }
129 return interceptor(ctx, in, info, handler)
130 }
131
132 var _DemoService_serviceDesc = grpc.ServiceDesc{
133 ServiceName: "proto.DemoService",
134 HandlerType: (*DemoServiceServer)(nil),
135 Methods: []grpc.MethodDesc{
136 {
137 MethodName: "SayHello",
138 Handler: _DemoService_SayHello_Handler,
139 },
140 },
141 Streams: []grpc.StreamDesc{},
142 Metadata: "service.proto",
143 }
144
145 func init() { proto1.RegisterFile("service.proto", fileDescriptor0) }
146
147 var fileDescriptor0 = []byte{
148
149 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2d, 0x4e, 0x2d, 0x2a,
150 0xcb, 0x4c, 0x4e, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x05, 0x53, 0x4a, 0x4a, 0x5c,
151 0x3c, 0x1e, 0xa9, 0x39, 0x39, 0xf9, 0x41, 0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x42, 0x42, 0x5c,
152 0x2c, 0x79, 0x89, 0xb9, 0xa9, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x60, 0xb6, 0x92, 0x26,
153 0x17, 0x2f, 0x54, 0x4d, 0x71, 0x41, 0x7e, 0x5e, 0x71, 0xaa, 0x90, 0x04, 0x17, 0x7b, 0x6e, 0x6a,
154 0x71, 0x71, 0x62, 0x3a, 0x4c, 0x1d, 0x8c, 0x6b, 0xe4, 0xc6, 0xc5, 0xed, 0x92, 0x9a, 0x9b, 0x1f,
155 0x0c, 0xb1, 0x4a, 0xc8, 0x9c, 0x8b, 0x23, 0x38, 0xb1, 0x12, 0xac, 0x59, 0x48, 0x18, 0x62, 0xb1,
156 0x1e, 0xb2, 0x75, 0x52, 0x22, 0xa8, 0x82, 0x10, 0xf3, 0x95, 0x18, 0x92, 0xd8, 0xc0, 0xc2, 0xc6,
157 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf2, 0xf5, 0x90, 0x47, 0xb5, 0x00, 0x00, 0x00,
158 }
159
View as plain text