/
rpctest.pb.go
410 lines (355 loc) · 12 KB
/
rpctest.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
408
409
410
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: lorawan-stack/pkg/util/rpctest/rpctest.proto
package rpctest
import (
context "context"
fmt "fmt"
proto "github.com/gogo/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
math "math"
)
// 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.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type Foo struct {
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Foo) Reset() { *m = Foo{} }
func (m *Foo) String() string { return proto.CompactTextString(m) }
func (*Foo) ProtoMessage() {}
func (*Foo) Descriptor() ([]byte, []int) {
return fileDescriptor_205509ffe52f0e65, []int{0}
}
func (m *Foo) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Foo.Unmarshal(m, b)
}
func (m *Foo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Foo.Marshal(b, m, deterministic)
}
func (m *Foo) XXX_Merge(src proto.Message) {
xxx_messageInfo_Foo.Merge(m, src)
}
func (m *Foo) XXX_Size() int {
return xxx_messageInfo_Foo.Size(m)
}
func (m *Foo) XXX_DiscardUnknown() {
xxx_messageInfo_Foo.DiscardUnknown(m)
}
var xxx_messageInfo_Foo proto.InternalMessageInfo
func (m *Foo) GetMessage() string {
if m != nil {
return m.Message
}
return ""
}
type Bar struct {
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Bar) Reset() { *m = Bar{} }
func (m *Bar) String() string { return proto.CompactTextString(m) }
func (*Bar) ProtoMessage() {}
func (*Bar) Descriptor() ([]byte, []int) {
return fileDescriptor_205509ffe52f0e65, []int{1}
}
func (m *Bar) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Bar.Unmarshal(m, b)
}
func (m *Bar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Bar.Marshal(b, m, deterministic)
}
func (m *Bar) XXX_Merge(src proto.Message) {
xxx_messageInfo_Bar.Merge(m, src)
}
func (m *Bar) XXX_Size() int {
return xxx_messageInfo_Bar.Size(m)
}
func (m *Bar) XXX_DiscardUnknown() {
xxx_messageInfo_Bar.DiscardUnknown(m)
}
var xxx_messageInfo_Bar proto.InternalMessageInfo
func (m *Bar) GetMessage() string {
if m != nil {
return m.Message
}
return ""
}
func init() {
proto.RegisterType((*Foo)(nil), "rpctest.Foo")
proto.RegisterType((*Bar)(nil), "rpctest.Bar")
}
func init() {
proto.RegisterFile("lorawan-stack/pkg/util/rpctest/rpctest.proto", fileDescriptor_205509ffe52f0e65)
}
var fileDescriptor_205509ffe52f0e65 = []byte{
// 215 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0xd0, 0xc1, 0x4a, 0x03, 0x31,
0x10, 0xc6, 0x71, 0x83, 0xd8, 0x62, 0xe8, 0x29, 0xa7, 0xe2, 0x45, 0x29, 0x08, 0x3d, 0x68, 0x52,
0x2c, 0x88, 0xe7, 0x08, 0xfb, 0x00, 0x16, 0x2f, 0xde, 0xc6, 0x3a, 0xa4, 0x61, 0x77, 0x33, 0xcb,
0x64, 0xdc, 0xc5, 0xa7, 0xf3, 0xd5, 0x24, 0xe2, 0x22, 0x22, 0xca, 0x9e, 0xc2, 0x07, 0x3f, 0x32,
0xf0, 0xd7, 0x57, 0x0d, 0x31, 0x0c, 0x90, 0xae, 0xb3, 0xc0, 0xbe, 0x76, 0x5d, 0x1d, 0xdc, 0xab,
0xc4, 0xc6, 0x71, 0xb7, 0x17, 0xcc, 0x32, 0xbe, 0xb6, 0x63, 0x12, 0x32, 0xf3, 0xaf, 0xb9, 0x3a,
0xd7, 0xc7, 0x15, 0x91, 0x59, 0xea, 0x79, 0x8b, 0x39, 0x43, 0xc0, 0xa5, 0xba, 0x50, 0xeb, 0xd3,
0x87, 0x71, 0x16, 0xe0, 0x81, 0xff, 0x06, 0x37, 0xef, 0x4a, 0xcf, 0x2a, 0xa2, 0x82, 0x2e, 0xf5,
0xc9, 0x63, 0x02, 0x7e, 0x33, 0x0b, 0x3b, 0x9e, 0xab, 0x88, 0xce, 0xbe, 0x97, 0x07, 0x5e, 0x1d,
0x19, 0xab, 0x17, 0xf7, 0x4d, 0xc4, 0x24, 0x3b, 0x61, 0x84, 0xf6, 0x7f, 0xbd, 0x56, 0xc5, 0xef,
0x90, 0x7b, 0xe4, 0x29, 0x7e, 0x53, 0xbc, 0xf6, 0xf1, 0x25, 0x4e, 0xfb, 0x7d, 0xa3, 0xfc, 0xdd,
0xd3, 0x6d, 0x20, 0x2b, 0x07, 0x94, 0x43, 0x4c, 0x21, 0xdb, 0x84, 0x32, 0x10, 0xd7, 0xee, 0x67,
0xd1, 0x7e, 0xfb, 0x2b, 0xea, 0xf3, 0xec, 0xb3, 0xe6, 0xf6, 0x23, 0x00, 0x00, 0xff, 0xff, 0x4a,
0x45, 0x4a, 0xf3, 0x7d, 0x01, 0x00, 0x00,
}
// 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
// FooBarClient is the client API for FooBar service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type FooBarClient interface {
Unary(ctx context.Context, in *Foo, opts ...grpc.CallOption) (*Bar, error)
ClientStream(ctx context.Context, opts ...grpc.CallOption) (FooBar_ClientStreamClient, error)
ServerStream(ctx context.Context, in *Foo, opts ...grpc.CallOption) (FooBar_ServerStreamClient, error)
BidiStream(ctx context.Context, opts ...grpc.CallOption) (FooBar_BidiStreamClient, error)
}
type fooBarClient struct {
cc *grpc.ClientConn
}
func NewFooBarClient(cc *grpc.ClientConn) FooBarClient {
return &fooBarClient{cc}
}
func (c *fooBarClient) Unary(ctx context.Context, in *Foo, opts ...grpc.CallOption) (*Bar, error) {
out := new(Bar)
err := c.cc.Invoke(ctx, "/rpctest.FooBar/Unary", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *fooBarClient) ClientStream(ctx context.Context, opts ...grpc.CallOption) (FooBar_ClientStreamClient, error) {
stream, err := c.cc.NewStream(ctx, &_FooBar_serviceDesc.Streams[0], "/rpctest.FooBar/ClientStream", opts...)
if err != nil {
return nil, err
}
x := &fooBarClientStreamClient{stream}
return x, nil
}
type FooBar_ClientStreamClient interface {
Send(*Foo) error
CloseAndRecv() (*Bar, error)
grpc.ClientStream
}
type fooBarClientStreamClient struct {
grpc.ClientStream
}
func (x *fooBarClientStreamClient) Send(m *Foo) error {
return x.ClientStream.SendMsg(m)
}
func (x *fooBarClientStreamClient) CloseAndRecv() (*Bar, error) {
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
m := new(Bar)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *fooBarClient) ServerStream(ctx context.Context, in *Foo, opts ...grpc.CallOption) (FooBar_ServerStreamClient, error) {
stream, err := c.cc.NewStream(ctx, &_FooBar_serviceDesc.Streams[1], "/rpctest.FooBar/ServerStream", opts...)
if err != nil {
return nil, err
}
x := &fooBarServerStreamClient{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 FooBar_ServerStreamClient interface {
Recv() (*Bar, error)
grpc.ClientStream
}
type fooBarServerStreamClient struct {
grpc.ClientStream
}
func (x *fooBarServerStreamClient) Recv() (*Bar, error) {
m := new(Bar)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *fooBarClient) BidiStream(ctx context.Context, opts ...grpc.CallOption) (FooBar_BidiStreamClient, error) {
stream, err := c.cc.NewStream(ctx, &_FooBar_serviceDesc.Streams[2], "/rpctest.FooBar/BidiStream", opts...)
if err != nil {
return nil, err
}
x := &fooBarBidiStreamClient{stream}
return x, nil
}
type FooBar_BidiStreamClient interface {
Send(*Foo) error
Recv() (*Bar, error)
grpc.ClientStream
}
type fooBarBidiStreamClient struct {
grpc.ClientStream
}
func (x *fooBarBidiStreamClient) Send(m *Foo) error {
return x.ClientStream.SendMsg(m)
}
func (x *fooBarBidiStreamClient) Recv() (*Bar, error) {
m := new(Bar)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// FooBarServer is the server API for FooBar service.
type FooBarServer interface {
Unary(context.Context, *Foo) (*Bar, error)
ClientStream(FooBar_ClientStreamServer) error
ServerStream(*Foo, FooBar_ServerStreamServer) error
BidiStream(FooBar_BidiStreamServer) error
}
// UnimplementedFooBarServer can be embedded to have forward compatible implementations.
type UnimplementedFooBarServer struct {
}
func (*UnimplementedFooBarServer) Unary(ctx context.Context, req *Foo) (*Bar, error) {
return nil, status.Errorf(codes.Unimplemented, "method Unary not implemented")
}
func (*UnimplementedFooBarServer) ClientStream(srv FooBar_ClientStreamServer) error {
return status.Errorf(codes.Unimplemented, "method ClientStream not implemented")
}
func (*UnimplementedFooBarServer) ServerStream(req *Foo, srv FooBar_ServerStreamServer) error {
return status.Errorf(codes.Unimplemented, "method ServerStream not implemented")
}
func (*UnimplementedFooBarServer) BidiStream(srv FooBar_BidiStreamServer) error {
return status.Errorf(codes.Unimplemented, "method BidiStream not implemented")
}
func RegisterFooBarServer(s *grpc.Server, srv FooBarServer) {
s.RegisterService(&_FooBar_serviceDesc, srv)
}
func _FooBar_Unary_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Foo)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(FooBarServer).Unary(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rpctest.FooBar/Unary",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(FooBarServer).Unary(ctx, req.(*Foo))
}
return interceptor(ctx, in, info, handler)
}
func _FooBar_ClientStream_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(FooBarServer).ClientStream(&fooBarClientStreamServer{stream})
}
type FooBar_ClientStreamServer interface {
SendAndClose(*Bar) error
Recv() (*Foo, error)
grpc.ServerStream
}
type fooBarClientStreamServer struct {
grpc.ServerStream
}
func (x *fooBarClientStreamServer) SendAndClose(m *Bar) error {
return x.ServerStream.SendMsg(m)
}
func (x *fooBarClientStreamServer) Recv() (*Foo, error) {
m := new(Foo)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func _FooBar_ServerStream_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(Foo)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(FooBarServer).ServerStream(m, &fooBarServerStreamServer{stream})
}
type FooBar_ServerStreamServer interface {
Send(*Bar) error
grpc.ServerStream
}
type fooBarServerStreamServer struct {
grpc.ServerStream
}
func (x *fooBarServerStreamServer) Send(m *Bar) error {
return x.ServerStream.SendMsg(m)
}
func _FooBar_BidiStream_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(FooBarServer).BidiStream(&fooBarBidiStreamServer{stream})
}
type FooBar_BidiStreamServer interface {
Send(*Bar) error
Recv() (*Foo, error)
grpc.ServerStream
}
type fooBarBidiStreamServer struct {
grpc.ServerStream
}
func (x *fooBarBidiStreamServer) Send(m *Bar) error {
return x.ServerStream.SendMsg(m)
}
func (x *fooBarBidiStreamServer) Recv() (*Foo, error) {
m := new(Foo)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
var _FooBar_serviceDesc = grpc.ServiceDesc{
ServiceName: "rpctest.FooBar",
HandlerType: (*FooBarServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Unary",
Handler: _FooBar_Unary_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "ClientStream",
Handler: _FooBar_ClientStream_Handler,
ClientStreams: true,
},
{
StreamName: "ServerStream",
Handler: _FooBar_ServerStream_Handler,
ServerStreams: true,
},
{
StreamName: "BidiStream",
Handler: _FooBar_BidiStream_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "lorawan-stack/pkg/util/rpctest/rpctest.proto",
}