/
simple.pb.go
407 lines (351 loc) · 13.7 KB
/
simple.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: simple.proto
package simple
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type SimpleInputData struct {
Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"`
Delay int64 `protobuf:"varint,2,opt,name=delay,proto3" json:"delay,omitempty"`
TotalMessages int64 `protobuf:"varint,3,opt,name=totalMessages,proto3" json:"totalMessages,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SimpleInputData) Reset() { *m = SimpleInputData{} }
func (m *SimpleInputData) String() string { return proto.CompactTextString(m) }
func (*SimpleInputData) ProtoMessage() {}
func (*SimpleInputData) Descriptor() ([]byte, []int) {
return fileDescriptor_simple_46feaad1d8b307cd, []int{0}
}
func (m *SimpleInputData) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SimpleInputData.Unmarshal(m, b)
}
func (m *SimpleInputData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SimpleInputData.Marshal(b, m, deterministic)
}
func (dst *SimpleInputData) XXX_Merge(src proto.Message) {
xxx_messageInfo_SimpleInputData.Merge(dst, src)
}
func (m *SimpleInputData) XXX_Size() int {
return xxx_messageInfo_SimpleInputData.Size(m)
}
func (m *SimpleInputData) XXX_DiscardUnknown() {
xxx_messageInfo_SimpleInputData.DiscardUnknown(m)
}
var xxx_messageInfo_SimpleInputData proto.InternalMessageInfo
func (m *SimpleInputData) GetMsg() string {
if m != nil {
return m.Msg
}
return ""
}
func (m *SimpleInputData) GetDelay() int64 {
if m != nil {
return m.Delay
}
return 0
}
func (m *SimpleInputData) GetTotalMessages() int64 {
if m != nil {
return m.TotalMessages
}
return 0
}
type SimpleOutputData struct {
Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SimpleOutputData) Reset() { *m = SimpleOutputData{} }
func (m *SimpleOutputData) String() string { return proto.CompactTextString(m) }
func (*SimpleOutputData) ProtoMessage() {}
func (*SimpleOutputData) Descriptor() ([]byte, []int) {
return fileDescriptor_simple_46feaad1d8b307cd, []int{1}
}
func (m *SimpleOutputData) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SimpleOutputData.Unmarshal(m, b)
}
func (m *SimpleOutputData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SimpleOutputData.Marshal(b, m, deterministic)
}
func (dst *SimpleOutputData) XXX_Merge(src proto.Message) {
xxx_messageInfo_SimpleOutputData.Merge(dst, src)
}
func (m *SimpleOutputData) XXX_Size() int {
return xxx_messageInfo_SimpleOutputData.Size(m)
}
func (m *SimpleOutputData) XXX_DiscardUnknown() {
xxx_messageInfo_SimpleOutputData.DiscardUnknown(m)
}
var xxx_messageInfo_SimpleOutputData proto.InternalMessageInfo
func (m *SimpleOutputData) GetMsg() string {
if m != nil {
return m.Msg
}
return ""
}
func init() {
proto.RegisterType((*SimpleInputData)(nil), "simple.SimpleInputData")
proto.RegisterType((*SimpleOutputData)(nil), "simple.SimpleOutputData")
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// SimpleServiceClient is the client API for SimpleService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type SimpleServiceClient interface {
UnaryRPCExample(ctx context.Context, in *SimpleInputData, opts ...grpc.CallOption) (*SimpleOutputData, error)
ServerStreamingRPC(ctx context.Context, in *SimpleInputData, opts ...grpc.CallOption) (SimpleService_ServerStreamingRPCClient, error)
ClientStreamingRPC(ctx context.Context, opts ...grpc.CallOption) (SimpleService_ClientStreamingRPCClient, error)
BidirectionalStreamingRPC(ctx context.Context, opts ...grpc.CallOption) (SimpleService_BidirectionalStreamingRPCClient, error)
}
type simpleServiceClient struct {
cc *grpc.ClientConn
}
func NewSimpleServiceClient(cc *grpc.ClientConn) SimpleServiceClient {
return &simpleServiceClient{cc}
}
func (c *simpleServiceClient) UnaryRPCExample(ctx context.Context, in *SimpleInputData, opts ...grpc.CallOption) (*SimpleOutputData, error) {
out := new(SimpleOutputData)
err := c.cc.Invoke(ctx, "/simple.SimpleService/UnaryRPCExample", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *simpleServiceClient) ServerStreamingRPC(ctx context.Context, in *SimpleInputData, opts ...grpc.CallOption) (SimpleService_ServerStreamingRPCClient, error) {
stream, err := c.cc.NewStream(ctx, &_SimpleService_serviceDesc.Streams[0], "/simple.SimpleService/ServerStreamingRPC", opts...)
if err != nil {
return nil, err
}
x := &simpleServiceServerStreamingRPCClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type SimpleService_ServerStreamingRPCClient interface {
Recv() (*SimpleOutputData, error)
grpc.ClientStream
}
type simpleServiceServerStreamingRPCClient struct {
grpc.ClientStream
}
func (x *simpleServiceServerStreamingRPCClient) Recv() (*SimpleOutputData, error) {
m := new(SimpleOutputData)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *simpleServiceClient) ClientStreamingRPC(ctx context.Context, opts ...grpc.CallOption) (SimpleService_ClientStreamingRPCClient, error) {
stream, err := c.cc.NewStream(ctx, &_SimpleService_serviceDesc.Streams[1], "/simple.SimpleService/ClientStreamingRPC", opts...)
if err != nil {
return nil, err
}
x := &simpleServiceClientStreamingRPCClient{stream}
return x, nil
}
type SimpleService_ClientStreamingRPCClient interface {
Send(*SimpleInputData) error
CloseAndRecv() (*SimpleOutputData, error)
grpc.ClientStream
}
type simpleServiceClientStreamingRPCClient struct {
grpc.ClientStream
}
func (x *simpleServiceClientStreamingRPCClient) Send(m *SimpleInputData) error {
return x.ClientStream.SendMsg(m)
}
func (x *simpleServiceClientStreamingRPCClient) CloseAndRecv() (*SimpleOutputData, error) {
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
m := new(SimpleOutputData)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *simpleServiceClient) BidirectionalStreamingRPC(ctx context.Context, opts ...grpc.CallOption) (SimpleService_BidirectionalStreamingRPCClient, error) {
stream, err := c.cc.NewStream(ctx, &_SimpleService_serviceDesc.Streams[2], "/simple.SimpleService/BidirectionalStreamingRPC", opts...)
if err != nil {
return nil, err
}
x := &simpleServiceBidirectionalStreamingRPCClient{stream}
return x, nil
}
type SimpleService_BidirectionalStreamingRPCClient interface {
Send(*SimpleInputData) error
Recv() (*SimpleOutputData, error)
grpc.ClientStream
}
type simpleServiceBidirectionalStreamingRPCClient struct {
grpc.ClientStream
}
func (x *simpleServiceBidirectionalStreamingRPCClient) Send(m *SimpleInputData) error {
return x.ClientStream.SendMsg(m)
}
func (x *simpleServiceBidirectionalStreamingRPCClient) Recv() (*SimpleOutputData, error) {
m := new(SimpleOutputData)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// SimpleServiceServer is the server API for SimpleService service.
type SimpleServiceServer interface {
UnaryRPCExample(context.Context, *SimpleInputData) (*SimpleOutputData, error)
ServerStreamingRPC(*SimpleInputData, SimpleService_ServerStreamingRPCServer) error
ClientStreamingRPC(SimpleService_ClientStreamingRPCServer) error
BidirectionalStreamingRPC(SimpleService_BidirectionalStreamingRPCServer) error
}
func RegisterSimpleServiceServer(s *grpc.Server, srv SimpleServiceServer) {
s.RegisterService(&_SimpleService_serviceDesc, srv)
}
func _SimpleService_UnaryRPCExample_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SimpleInputData)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SimpleServiceServer).UnaryRPCExample(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/simple.SimpleService/UnaryRPCExample",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SimpleServiceServer).UnaryRPCExample(ctx, req.(*SimpleInputData))
}
return interceptor(ctx, in, info, handler)
}
func _SimpleService_ServerStreamingRPC_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(SimpleInputData)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(SimpleServiceServer).ServerStreamingRPC(m, &simpleServiceServerStreamingRPCServer{stream})
}
type SimpleService_ServerStreamingRPCServer interface {
Send(*SimpleOutputData) error
grpc.ServerStream
}
type simpleServiceServerStreamingRPCServer struct {
grpc.ServerStream
}
func (x *simpleServiceServerStreamingRPCServer) Send(m *SimpleOutputData) error {
return x.ServerStream.SendMsg(m)
}
func _SimpleService_ClientStreamingRPC_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(SimpleServiceServer).ClientStreamingRPC(&simpleServiceClientStreamingRPCServer{stream})
}
type SimpleService_ClientStreamingRPCServer interface {
SendAndClose(*SimpleOutputData) error
Recv() (*SimpleInputData, error)
grpc.ServerStream
}
type simpleServiceClientStreamingRPCServer struct {
grpc.ServerStream
}
func (x *simpleServiceClientStreamingRPCServer) SendAndClose(m *SimpleOutputData) error {
return x.ServerStream.SendMsg(m)
}
func (x *simpleServiceClientStreamingRPCServer) Recv() (*SimpleInputData, error) {
m := new(SimpleInputData)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func _SimpleService_BidirectionalStreamingRPC_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(SimpleServiceServer).BidirectionalStreamingRPC(&simpleServiceBidirectionalStreamingRPCServer{stream})
}
type SimpleService_BidirectionalStreamingRPCServer interface {
Send(*SimpleOutputData) error
Recv() (*SimpleInputData, error)
grpc.ServerStream
}
type simpleServiceBidirectionalStreamingRPCServer struct {
grpc.ServerStream
}
func (x *simpleServiceBidirectionalStreamingRPCServer) Send(m *SimpleOutputData) error {
return x.ServerStream.SendMsg(m)
}
func (x *simpleServiceBidirectionalStreamingRPCServer) Recv() (*SimpleInputData, error) {
m := new(SimpleInputData)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
var _SimpleService_serviceDesc = grpc.ServiceDesc{
ServiceName: "simple.SimpleService",
HandlerType: (*SimpleServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "UnaryRPCExample",
Handler: _SimpleService_UnaryRPCExample_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "ServerStreamingRPC",
Handler: _SimpleService_ServerStreamingRPC_Handler,
ServerStreams: true,
},
{
StreamName: "ClientStreamingRPC",
Handler: _SimpleService_ClientStreamingRPC_Handler,
ClientStreams: true,
},
{
StreamName: "BidirectionalStreamingRPC",
Handler: _SimpleService_BidirectionalStreamingRPC_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "simple.proto",
}
func init() { proto.RegisterFile("simple.proto", fileDescriptor_simple_46feaad1d8b307cd) }
var fileDescriptor_simple_46feaad1d8b307cd = []byte{
// 236 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0xce, 0xcc, 0x2d,
0xc8, 0x49, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x83, 0xf0, 0x94, 0xe2, 0xb9, 0xf8,
0x83, 0xc1, 0x2c, 0xcf, 0xbc, 0x82, 0xd2, 0x12, 0x97, 0xc4, 0x92, 0x44, 0x21, 0x01, 0x2e, 0xe6,
0xdc, 0xe2, 0x74, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x10, 0x53, 0x48, 0x84, 0x8b, 0x35,
0x25, 0x35, 0x27, 0xb1, 0x52, 0x82, 0x49, 0x81, 0x51, 0x83, 0x39, 0x08, 0xc2, 0x11, 0x52, 0xe1,
0xe2, 0x2d, 0xc9, 0x2f, 0x49, 0xcc, 0xf1, 0x4d, 0x2d, 0x2e, 0x4e, 0x4c, 0x4f, 0x2d, 0x96, 0x60,
0x06, 0xcb, 0xa2, 0x0a, 0x2a, 0xa9, 0x70, 0x09, 0x40, 0x2c, 0xf0, 0x2f, 0x2d, 0xc1, 0x69, 0x83,
0xd1, 0x71, 0x26, 0x2e, 0x5e, 0x88, 0xb2, 0xe0, 0xd4, 0xa2, 0xb2, 0xcc, 0xe4, 0x54, 0x21, 0x37,
0x2e, 0xfe, 0xd0, 0xbc, 0xc4, 0xa2, 0xca, 0xa0, 0x00, 0x67, 0xd7, 0x8a, 0x44, 0x90, 0x8c, 0x90,
0xb8, 0x1e, 0xd4, 0x0b, 0x68, 0x2e, 0x96, 0x92, 0x40, 0x95, 0x40, 0xd8, 0xa4, 0xc4, 0x20, 0xe4,
0xcd, 0x25, 0x04, 0x32, 0x32, 0xb5, 0x28, 0xb8, 0xa4, 0x28, 0x35, 0x31, 0x37, 0x33, 0x2f, 0x3d,
0x28, 0xc0, 0x99, 0x2c, 0xa3, 0x0c, 0x18, 0x41, 0x86, 0x39, 0xe7, 0x64, 0xa6, 0xe6, 0x95, 0x50,
0x6c, 0x98, 0x06, 0xa3, 0x50, 0x08, 0x97, 0xa4, 0x53, 0x66, 0x4a, 0x66, 0x51, 0x6a, 0x72, 0x49,
0x66, 0x7e, 0x5e, 0x62, 0x0e, 0x15, 0xcc, 0x34, 0x60, 0x4c, 0x62, 0x03, 0xc7, 0xaf, 0x31, 0x20,
0x00, 0x00, 0xff, 0xff, 0x37, 0x27, 0x5b, 0x87, 0xef, 0x01, 0x00, 0x00,
}