Chromium Code Reviews

Side by Side Diff: common/proto/google/descriptor/util_test.pb_test.go

Issue 2219023003: Update APIs to use new Google cloud paths. (Closed) Base URL: https://github.com/luci/luci-go@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
(Empty)
1 // Code generated by protoc-gen-go.
2 // source: github.com/luci/luci-go/common/proto/google/descriptor/util_test.prot o
3 // DO NOT EDIT!
4
5 package descriptor
6
7 import prpc "github.com/luci/luci-go/grpc/prpc"
8
9 import proto "github.com/golang/protobuf/proto"
10 import fmt "fmt"
11 import math "math"
12
13 import (
14 context "golang.org/x/net/context"
15 grpc "google.golang.org/grpc"
16 )
17
18 // Reference imports to suppress errors if they are not otherwise used.
19 var _ = proto.Marshal
20 var _ = fmt.Errorf
21 var _ = math.Inf
22
23 // Enum comment.
24 // next line.
25 type E1 int32
26
27 const (
28 // V0
29 // next line.
30 E1_V0 E1 = 0
31 // V1
32 // next line.
33 E1_V1 E1 = 1
34 )
35
36 var E1_name = map[int32]string{
37 0: "V0",
38 1: "V1",
39 }
40 var E1_value = map[string]int32{
41 "V0": 0,
42 "V1": 1,
43 }
44
45 func (x E1) String() string {
46 return proto.EnumName(E1_name, int32(x))
47 }
48 func (E1) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{0} }
49
50 type NestedMessageParent_NestedEnum int32
51
52 const (
53 NestedMessageParent_V0 NestedMessageParent_NestedEnum = 0
54 NestedMessageParent_V1 NestedMessageParent_NestedEnum = 1
55 )
56
57 var NestedMessageParent_NestedEnum_name = map[int32]string{
58 0: "V0",
59 1: "V1",
60 }
61 var NestedMessageParent_NestedEnum_value = map[string]int32{
62 "V0": 0,
63 "V1": 1,
64 }
65
66 func (x NestedMessageParent_NestedEnum) String() string {
67 return proto.EnumName(NestedMessageParent_NestedEnum_name, int32(x))
68 }
69 func (NestedMessageParent_NestedEnum) EnumDescriptor() ([]byte, []int) {
70 return fileDescriptor1, []int{3, 0}
71 }
72
73 // M1
74 // next line.
75 type M1 struct {
76 // f1
77 // next line.
78 F1 string `protobuf:"bytes,1,opt,name=f1" json:"f1,omitempty"`
79 }
80
81 func (m *M1) Reset() { *m = M1{} }
82 func (m *M1) String() string { return proto.CompactTextString(m) }
83 func (*M1) ProtoMessage() {}
84 func (*M1) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} }
85
86 // M2
87 // next line.
88 type M2 struct {
89 // f1
90 // next line.
91 F1 []*M1 `protobuf:"bytes,1,rep,name=f1" json:"f1,omitempty"`
92 // f2
93 // next line.
94 F2 E1 `protobuf:"varint,2,opt,name=f2,enum=pkg.E1" json:"f2,omitempty"`
95 }
96
97 func (m *M2) Reset() { *m = M2{} }
98 func (m *M2) String() string { return proto.CompactTextString(m) }
99 func (*M2) ProtoMessage() {}
100 func (*M2) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} }
101
102 func (m *M2) GetF1() []*M1 {
103 if m != nil {
104 return m.F1
105 }
106 return nil
107 }
108
109 // M3
110 type M3 struct {
111 // O1
112 //
113 // Types that are valid to be assigned to O1:
114 // *M3_F1
115 // *M3_F2
116 O1 isM3_O1 `protobuf_oneof:"O1"`
117 // O2
118 //
119 // Types that are valid to be assigned to O2:
120 // *M3_F3
121 // *M3_F4
122 O2 isM3_O2 `protobuf_oneof:"O2"`
123 // f5
124 F5 string `protobuf:"bytes,5,opt,name=f5" json:"f5,omitempty"`
125 // f6
126 F6 int32 `protobuf:"varint,6,opt,name=f6" json:"f6,omitempty"`
127 }
128
129 func (m *M3) Reset() { *m = M3{} }
130 func (m *M3) String() string { return proto.CompactTextString(m) }
131 func (*M3) ProtoMessage() {}
132 func (*M3) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} }
133
134 type isM3_O1 interface {
135 isM3_O1()
136 }
137 type isM3_O2 interface {
138 isM3_O2()
139 }
140
141 type M3_F1 struct {
142 F1 int32 `protobuf:"varint,1,opt,name=f1,oneof"`
143 }
144 type M3_F2 struct {
145 F2 int32 `protobuf:"varint,2,opt,name=f2,oneof"`
146 }
147 type M3_F3 struct {
148 F3 int32 `protobuf:"varint,3,opt,name=f3,oneof"`
149 }
150 type M3_F4 struct {
151 F4 int32 `protobuf:"varint,4,opt,name=f4,oneof"`
152 }
153
154 func (*M3_F1) isM3_O1() {}
155 func (*M3_F2) isM3_O1() {}
156 func (*M3_F3) isM3_O2() {}
157 func (*M3_F4) isM3_O2() {}
158
159 func (m *M3) GetO1() isM3_O1 {
160 if m != nil {
161 return m.O1
162 }
163 return nil
164 }
165 func (m *M3) GetO2() isM3_O2 {
166 if m != nil {
167 return m.O2
168 }
169 return nil
170 }
171
172 func (m *M3) GetF1() int32 {
173 if x, ok := m.GetO1().(*M3_F1); ok {
174 return x.F1
175 }
176 return 0
177 }
178
179 func (m *M3) GetF2() int32 {
180 if x, ok := m.GetO1().(*M3_F2); ok {
181 return x.F2
182 }
183 return 0
184 }
185
186 func (m *M3) GetF3() int32 {
187 if x, ok := m.GetO2().(*M3_F3); ok {
188 return x.F3
189 }
190 return 0
191 }
192
193 func (m *M3) GetF4() int32 {
194 if x, ok := m.GetO2().(*M3_F4); ok {
195 return x.F4
196 }
197 return 0
198 }
199
200 // XXX_OneofFuncs is for the internal use of the proto package.
201 func (*M3) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, fun c(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg pro to.Message) (n int), []interface{}) {
202 return _M3_OneofMarshaler, _M3_OneofUnmarshaler, _M3_OneofSizer, []inter face{}{
203 (*M3_F1)(nil),
204 (*M3_F2)(nil),
205 (*M3_F3)(nil),
206 (*M3_F4)(nil),
207 }
208 }
209
210 func _M3_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
211 m := msg.(*M3)
212 // O1
213 switch x := m.O1.(type) {
214 case *M3_F1:
215 b.EncodeVarint(1<<3 | proto.WireVarint)
216 b.EncodeVarint(uint64(x.F1))
217 case *M3_F2:
218 b.EncodeVarint(2<<3 | proto.WireVarint)
219 b.EncodeVarint(uint64(x.F2))
220 case nil:
221 default:
222 return fmt.Errorf("M3.O1 has unexpected type %T", x)
223 }
224 // O2
225 switch x := m.O2.(type) {
226 case *M3_F3:
227 b.EncodeVarint(3<<3 | proto.WireVarint)
228 b.EncodeVarint(uint64(x.F3))
229 case *M3_F4:
230 b.EncodeVarint(4<<3 | proto.WireVarint)
231 b.EncodeVarint(uint64(x.F4))
232 case nil:
233 default:
234 return fmt.Errorf("M3.O2 has unexpected type %T", x)
235 }
236 return nil
237 }
238
239 func _M3_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bo ol, error) {
240 m := msg.(*M3)
241 switch tag {
242 case 1: // O1.f1
243 if wire != proto.WireVarint {
244 return true, proto.ErrInternalBadWireType
245 }
246 x, err := b.DecodeVarint()
247 m.O1 = &M3_F1{int32(x)}
248 return true, err
249 case 2: // O1.f2
250 if wire != proto.WireVarint {
251 return true, proto.ErrInternalBadWireType
252 }
253 x, err := b.DecodeVarint()
254 m.O1 = &M3_F2{int32(x)}
255 return true, err
256 case 3: // O2.f3
257 if wire != proto.WireVarint {
258 return true, proto.ErrInternalBadWireType
259 }
260 x, err := b.DecodeVarint()
261 m.O2 = &M3_F3{int32(x)}
262 return true, err
263 case 4: // O2.f4
264 if wire != proto.WireVarint {
265 return true, proto.ErrInternalBadWireType
266 }
267 x, err := b.DecodeVarint()
268 m.O2 = &M3_F4{int32(x)}
269 return true, err
270 default:
271 return false, nil
272 }
273 }
274
275 func _M3_OneofSizer(msg proto.Message) (n int) {
276 m := msg.(*M3)
277 // O1
278 switch x := m.O1.(type) {
279 case *M3_F1:
280 n += proto.SizeVarint(1<<3 | proto.WireVarint)
281 n += proto.SizeVarint(uint64(x.F1))
282 case *M3_F2:
283 n += proto.SizeVarint(2<<3 | proto.WireVarint)
284 n += proto.SizeVarint(uint64(x.F2))
285 case nil:
286 default:
287 panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
288 }
289 // O2
290 switch x := m.O2.(type) {
291 case *M3_F3:
292 n += proto.SizeVarint(3<<3 | proto.WireVarint)
293 n += proto.SizeVarint(uint64(x.F3))
294 case *M3_F4:
295 n += proto.SizeVarint(4<<3 | proto.WireVarint)
296 n += proto.SizeVarint(uint64(x.F4))
297 case nil:
298 default:
299 panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
300 }
301 return n
302 }
303
304 type NestedMessageParent struct {
305 }
306
307 func (m *NestedMessageParent) Reset() { *m = NestedMessagePar ent{} }
308 func (m *NestedMessageParent) String() string { return proto.CompactT extString(m) }
309 func (*NestedMessageParent) ProtoMessage() {}
310 func (*NestedMessageParent) Descriptor() ([]byte, []int) { return fileDescriptor 1, []int{3} }
311
312 type NestedMessageParent_NestedMessage struct {
313 F1 int32 `protobuf:"varint,1,opt,name=f1" json:"f1,omitempty"`
314 F2 int32 `protobuf:"varint,2,opt,name=f2" json:"f2,omitempty"`
315 }
316
317 func (m *NestedMessageParent_NestedMessage) Reset() { *m = NestedMessage Parent_NestedMessage{} }
318 func (m *NestedMessageParent_NestedMessage) String() string { return proto.Compa ctTextString(m) }
319 func (*NestedMessageParent_NestedMessage) ProtoMessage() {}
320 func (*NestedMessageParent_NestedMessage) Descriptor() ([]byte, []int) {
321 return fileDescriptor1, []int{3, 0}
322 }
323
324 func init() {
325 proto.RegisterType((*M1)(nil), "pkg.M1")
326 proto.RegisterType((*M2)(nil), "pkg.M2")
327 proto.RegisterType((*M3)(nil), "pkg.M3")
328 proto.RegisterType((*NestedMessageParent)(nil), "pkg.NestedMessageParent ")
329 proto.RegisterType((*NestedMessageParent_NestedMessage)(nil), "pkg.Neste dMessageParent.NestedMessage")
330 proto.RegisterEnum("pkg.E1", E1_name, E1_value)
331 proto.RegisterEnum("pkg.NestedMessageParent_NestedEnum", NestedMessagePa rent_NestedEnum_name, NestedMessageParent_NestedEnum_value)
332 }
333
334 // Reference imports to suppress errors if they are not otherwise used.
335 var _ context.Context
336 var _ grpc.ClientConn
337
338 // This is a compile-time assertion to ensure that this generated file
339 // is compatible with the grpc package it is being compiled against.
340 const _ = grpc.SupportPackageIsVersion3
341
342 // Client API for S1 service
343
344 type S1Client interface {
345 // R1
346 R1(ctx context.Context, in *M1, opts ...grpc.CallOption) (*M2, error)
347 }
348 type s1PRPCClient struct {
349 client *prpc.Client
350 }
351
352 func NewS1PRPCClient(client *prpc.Client) S1Client {
353 return &s1PRPCClient{client}
354 }
355
356 func (c *s1PRPCClient) R1(ctx context.Context, in *M1, opts ...grpc.CallOption) (*M2, error) {
357 out := new(M2)
358 err := c.client.Call(ctx, "pkg.S1", "R1", in, out, opts...)
359 if err != nil {
360 return nil, err
361 }
362 return out, nil
363 }
364
365 type s1Client struct {
366 cc *grpc.ClientConn
367 }
368
369 func NewS1Client(cc *grpc.ClientConn) S1Client {
370 return &s1Client{cc}
371 }
372
373 func (c *s1Client) R1(ctx context.Context, in *M1, opts ...grpc.CallOption) (*M2 , error) {
374 out := new(M2)
375 err := grpc.Invoke(ctx, "/pkg.S1/R1", in, out, c.cc, opts...)
376 if err != nil {
377 return nil, err
378 }
379 return out, nil
380 }
381
382 // Server API for S1 service
383
384 type S1Server interface {
385 // R1
386 R1(context.Context, *M1) (*M2, error)
387 }
388
389 func RegisterS1Server(s prpc.Registrar, srv S1Server) {
390 s.RegisterService(&_S1_serviceDesc, srv)
391 }
392
393 func _S1_R1_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
394 in := new(M1)
395 if err := dec(in); err != nil {
396 return nil, err
397 }
398 if interceptor == nil {
399 return srv.(S1Server).R1(ctx, in)
400 }
401 info := &grpc.UnaryServerInfo{
402 Server: srv,
403 FullMethod: "/pkg.S1/R1",
404 }
405 handler := func(ctx context.Context, req interface{}) (interface{}, erro r) {
406 return srv.(S1Server).R1(ctx, req.(*M1))
407 }
408 return interceptor(ctx, in, info, handler)
409 }
410
411 var _S1_serviceDesc = grpc.ServiceDesc{
412 ServiceName: "pkg.S1",
413 HandlerType: (*S1Server)(nil),
414 Methods: []grpc.MethodDesc{
415 {
416 MethodName: "R1",
417 Handler: _S1_R1_Handler,
418 },
419 },
420 Streams: []grpc.StreamDesc{},
421 Metadata: fileDescriptor1,
422 }
423
424 // Client API for S2 service
425
426 type S2Client interface {
427 // R1
428 R1(ctx context.Context, in *M1, opts ...grpc.CallOption) (*M2, error)
429 // R2
430 R2(ctx context.Context, in *M1, opts ...grpc.CallOption) (*M2, error)
431 }
432 type s2PRPCClient struct {
433 client *prpc.Client
434 }
435
436 func NewS2PRPCClient(client *prpc.Client) S2Client {
437 return &s2PRPCClient{client}
438 }
439
440 func (c *s2PRPCClient) R1(ctx context.Context, in *M1, opts ...grpc.CallOption) (*M2, error) {
441 out := new(M2)
442 err := c.client.Call(ctx, "pkg.S2", "R1", in, out, opts...)
443 if err != nil {
444 return nil, err
445 }
446 return out, nil
447 }
448
449 func (c *s2PRPCClient) R2(ctx context.Context, in *M1, opts ...grpc.CallOption) (*M2, error) {
450 out := new(M2)
451 err := c.client.Call(ctx, "pkg.S2", "R2", in, out, opts...)
452 if err != nil {
453 return nil, err
454 }
455 return out, nil
456 }
457
458 type s2Client struct {
459 cc *grpc.ClientConn
460 }
461
462 func NewS2Client(cc *grpc.ClientConn) S2Client {
463 return &s2Client{cc}
464 }
465
466 func (c *s2Client) R1(ctx context.Context, in *M1, opts ...grpc.CallOption) (*M2 , error) {
467 out := new(M2)
468 err := grpc.Invoke(ctx, "/pkg.S2/R1", in, out, c.cc, opts...)
469 if err != nil {
470 return nil, err
471 }
472 return out, nil
473 }
474
475 func (c *s2Client) R2(ctx context.Context, in *M1, opts ...grpc.CallOption) (*M2 , error) {
476 out := new(M2)
477 err := grpc.Invoke(ctx, "/pkg.S2/R2", in, out, c.cc, opts...)
478 if err != nil {
479 return nil, err
480 }
481 return out, nil
482 }
483
484 // Server API for S2 service
485
486 type S2Server interface {
487 // R1
488 R1(context.Context, *M1) (*M2, error)
489 // R2
490 R2(context.Context, *M1) (*M2, error)
491 }
492
493 func RegisterS2Server(s prpc.Registrar, srv S2Server) {
494 s.RegisterService(&_S2_serviceDesc, srv)
495 }
496
497 func _S2_R1_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
498 in := new(M1)
499 if err := dec(in); err != nil {
500 return nil, err
501 }
502 if interceptor == nil {
503 return srv.(S2Server).R1(ctx, in)
504 }
505 info := &grpc.UnaryServerInfo{
506 Server: srv,
507 FullMethod: "/pkg.S2/R1",
508 }
509 handler := func(ctx context.Context, req interface{}) (interface{}, erro r) {
510 return srv.(S2Server).R1(ctx, req.(*M1))
511 }
512 return interceptor(ctx, in, info, handler)
513 }
514
515 func _S2_R2_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
516 in := new(M1)
517 if err := dec(in); err != nil {
518 return nil, err
519 }
520 if interceptor == nil {
521 return srv.(S2Server).R2(ctx, in)
522 }
523 info := &grpc.UnaryServerInfo{
524 Server: srv,
525 FullMethod: "/pkg.S2/R2",
526 }
527 handler := func(ctx context.Context, req interface{}) (interface{}, erro r) {
528 return srv.(S2Server).R2(ctx, req.(*M1))
529 }
530 return interceptor(ctx, in, info, handler)
531 }
532
533 var _S2_serviceDesc = grpc.ServiceDesc{
534 ServiceName: "pkg.S2",
535 HandlerType: (*S2Server)(nil),
536 Methods: []grpc.MethodDesc{
537 {
538 MethodName: "R1",
539 Handler: _S2_R1_Handler,
540 },
541 {
542 MethodName: "R2",
543 Handler: _S2_R2_Handler,
544 },
545 },
546 Streams: []grpc.StreamDesc{},
547 Metadata: fileDescriptor1,
548 }
549
550 func init() {
551 proto.RegisterFile("github.com/luci/luci-go/common/proto/google/descript or/util_test.proto", fileDescriptor1)
552 }
553
554 var fileDescriptor1 = []byte{
555 // 308 bytes of a gzipped FileDescriptorProto
556 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x74, 0x91, 0xcb, 0x4b, 0xec, 0x30,
557 0x14, 0x87, 0xa7, 0x99, 0xc7, 0xe5, 0x46, 0x1c, 0x4a, 0x14, 0x0c, 0x83, 0x88, 0x74, 0x35, 0x08,
558 0x36, 0x26, 0xf3, 0xc0, 0xb5, 0x50, 0x71, 0x53, 0x95, 0x11, 0xdc, 0xca, 0x4c, 0x1b, 0x63, 0xb1,
559 0x6d, 0x4a, 0x9b, 0x82, 0x7f, 0xbe, 0xe9, 0x69, 0xad, 0x0f, 0x74, 0x93, 0x26, 0xdf, 0x77, 0x7e,
560 0xe5, 0x9c, 0x04, 0x5f, 0xab, 0xc4, 0xbc, 0xd4, 0x3b, 0x3f, 0xd2, 0x19, 0x4b, 0xeb, 0x28, 0x81,
561 0xe5, 0x5c, 0x69, 0x66, 0x41, 0xa6, 0x73, 0x56, 0x94, 0xda, 0x68, 0xa6, 0xb4, 0x56, 0xa9, 0x64,
562 0xb1, 0xac, 0xa2, 0x32, 0x29, 0x8c, 0x2e, 0x59, 0x6d, 0x92, 0xf4, 0xc9, 0xc8, 0xca, 0xf8, 0x50,
563 0x41, 0x86, 0xc5, 0xab, 0xf2, 0x0e, 0x31, 0x0a, 0x39, 0x99, 0x62, 0xf4, 0xcc, 0xa9, 0x73, 0xea,
564 0xcc, 0xff, 0x6f, 0xec, 0xce, 0x5b, 0x5b, 0x2a, 0xc8, 0x51, 0x47, 0x87, 0xf3, 0x3d, 0xf1, 0xcf,
565 0xb7, 0xd5, 0x7e, 0xc8, 0x1b, 0x0d, 0x42, 0x50, 0x64, 0xcb, 0xa7, 0x9d, 0x08, 0x1a, 0x21, 0xbc,
566 0x37, 0x9b, 0x5b, 0x10, 0xb7, 0xff, 0xdb, 0xf8, 0x66, 0x00, 0x01, 0xb7, 0x0f, 0xb4, 0x44, 0x00,
567 0x59, 0xd0, 0x21, 0x10, 0xc7, 0x92, 0x36, 0xb5, 0xa4, 0xa3, 0x9e, 0x2c, 0xa1, 0xab, 0x15, 0x1d,
568 0x77, 0x5d, 0xad, 0xe0, 0xbc, 0xa6, 0x93, 0xa6, 0xc2, 0x9e, 0xd7, 0x57, 0x23, 0x8c, 0xee, 0x38,
569 0xac, 0xc2, 0x8b, 0xf1, 0xc1, 0xad, 0x1d, 0x4d, 0xc6, 0xa1, 0xac, 0xaa, 0xad, 0x92, 0xf7, 0xdb,
570 0x52, 0xe6, 0x66, 0xc6, 0xf0, 0xfe, 0x37, 0xfc, 0x65, 0xd2, 0x31, 0x74, 0x36, 0xfd, 0xec, 0x0c,
571 0x26, 0x38, 0xc6, 0xb8, 0x0d, 0x04, 0x79, 0x9d, 0x91, 0x09, 0x46, 0x8f, 0x17, 0xee, 0x00, 0xbe,
572 0xdc, 0x75, 0xce, 0xec, 0x6d, 0x05, 0xfc, 0x27, 0x15, 0x27, 0x18, 0x3d, 0x70, 0x42, 0x31, 0xda,
573 0x70, 0xf2, 0x71, 0x4f, 0xb3, 0x6e, 0x23, 0xbc, 0x81, 0xb8, 0xb4, 0x5e, 0xfc, 0xed, 0xc1, 0x88,
574 0xdf, 0xcc, 0x6e, 0x02, 0x2f, 0xb5, 0x78, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xa7, 0x45, 0x97, 0x30,
575 0xf3, 0x01, 0x00, 0x00,
576 }
OLDNEW

Powered by Google App Engine